Add parse fail test using safe trait/impl trait
This commit is contained in:
parent
c3774be741
commit
8b6435d5ce
@ -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
|
||||
|
@ -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() {}
|
@ -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
|
||||
|
@ -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
|
||||
|
7
tests/ui/rust-2024/unsafe-extern-blocks/safe-trait.rs
Normal file
7
tests/ui/rust-2024/unsafe-extern-blocks/safe-trait.rs
Normal 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() {}
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user