Add parse fail test using safe trait/impl trait

This commit is contained in:
Santiago Pastorino 2024-07-02 17:35:49 -03:00
parent c3774be741
commit 8b6435d5ce
No known key found for this signature in database
GPG Key ID: 8131A24E0C79EFAF
6 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,8 @@
error: expected one of `!` or `::`, found keyword `impl`
--> $DIR/safe-impl-trait.rs:5:6
|
LL | safe impl Bar for () { }
| ^^^^ expected one of `!` or `::`
error: aborting due to 1 previous error

View File

@ -0,0 +1,8 @@
//@ revisions: gated ungated
#![cfg_attr(gated, feature(unsafe_extern_blocks))]
trait Bar {}
safe impl Bar for () { }
//~^ ERROR expected one of `!` or `::`, found keyword `impl`
fn main() {}

View File

@ -0,0 +1,8 @@
error: expected one of `!` or `::`, found keyword `impl`
--> $DIR/safe-impl-trait.rs:5:6
|
LL | safe impl Bar for () { }
| ^^^^ expected one of `!` or `::`
error: aborting due to 1 previous error

View File

@ -0,0 +1,8 @@
error: expected one of `!` or `::`, found keyword `trait`
--> $DIR/safe-trait.rs:4:6
|
LL | safe trait Foo {}
| ^^^^^ expected one of `!` or `::`
error: aborting due to 1 previous error

View File

@ -0,0 +1,7 @@
//@ revisions: gated ungated
#![cfg_attr(gated, feature(unsafe_extern_blocks))]
safe trait Foo {}
//~^ ERROR expected one of `!` or `::`, found keyword `trait`
fn main() {}

View File

@ -0,0 +1,8 @@
error: expected one of `!` or `::`, found keyword `trait`
--> $DIR/safe-trait.rs:4:6
|
LL | safe trait Foo {}
| ^^^^^ expected one of `!` or `::`
error: aborting due to 1 previous error