forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add parse fail test using safe trait/impl trait
- Loading branch information
1 parent
c3774be
commit 8b6435d
Showing
6 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
tests/ui/rust-2024/unsafe-extern-blocks/safe-impl-trait.gated.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
8 changes: 8 additions & 0 deletions
8
tests/ui/rust-2024/unsafe-extern-blocks/safe-impl-trait.ungated.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
8
tests/ui/rust-2024/unsafe-extern-blocks/safe-trait.gated.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
8 changes: 8 additions & 0 deletions
8
tests/ui/rust-2024/unsafe-extern-blocks/safe-trait.ungated.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|