Skip to content

Commit d811b22

Browse files
authored
Unrolled build for rust-lang#127248
Rollup merge of rust-lang#127248 - spastorino:unsafe-extern-tests, r=compiler-errors Add parse fail test using safe trait/impl trait Added 2 more tests to be sure that nothing weird happens using `safe` on items. Needed to do this in separate tests as they give parsing errors.
2 parents 1086aff + 8b6435d commit d811b22

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+
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)