Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parse fail test using safe trait/impl trait #127248

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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

8 changes: 8 additions & 0 deletions tests/ui/rust-2024/unsafe-extern-blocks/safe-impl-trait.rs
Original file line number Diff line number Diff line change
@@ -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() {}
Original file line number Diff line number Diff line change
@@ -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

Original file line number Diff line number Diff line change
@@ -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 changes: 7 additions & 0 deletions tests/ui/rust-2024/unsafe-extern-blocks/safe-trait.rs
Original file line number Diff line number Diff line change
@@ -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() {}
Original file line number Diff line number Diff line change
@@ -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