Skip to content

Commit 8b6435d

Browse files
committed
Add parse fail test using safe trait/impl trait
1 parent c3774be commit 8b6435d

File tree

6 files changed

+47
-0
lines changed

6 files changed

+47
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!` or `::`, found keyword `impl`
2+
--> $DIR/safe-impl-trait.rs:5:6
3+
|
4+
LL | safe impl Bar for () { }
5+
| ^^^^ expected one of `!` or `::`
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//@ revisions: gated ungated
2+
#![cfg_attr(gated, feature(unsafe_extern_blocks))]
3+
4+
trait Bar {}
5+
safe impl Bar for () { }
6+
//~^ ERROR expected one of `!` or `::`, found keyword `impl`
7+
8+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!` or `::`, found keyword `impl`
2+
--> $DIR/safe-impl-trait.rs:5:6
3+
|
4+
LL | safe impl Bar for () { }
5+
| ^^^^ expected one of `!` or `::`
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!` or `::`, found keyword `trait`
2+
--> $DIR/safe-trait.rs:4:6
3+
|
4+
LL | safe trait Foo {}
5+
| ^^^^^ expected one of `!` or `::`
6+
7+
error: aborting due to 1 previous error
8+
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//@ revisions: gated ungated
2+
#![cfg_attr(gated, feature(unsafe_extern_blocks))]
3+
4+
safe trait Foo {}
5+
//~^ ERROR expected one of `!` or `::`, found keyword `trait`
6+
7+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!` or `::`, found keyword `trait`
2+
--> $DIR/safe-trait.rs:4:6
3+
|
4+
LL | safe trait Foo {}
5+
| ^^^^^ expected one of `!` or `::`
6+
7+
error: aborting due to 1 previous error
8+

0 commit comments

Comments
 (0)