forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add regression test for rust-lang#117058
- Loading branch information
1 parent
8501f1c
commit b85dbea
Showing
2 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
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,39 @@ | ||
// test for #117058 - check that attributes are validated on various kinds of statements. | ||
|
||
struct A; | ||
|
||
fn func() {} | ||
|
||
fn main() { | ||
#[allow(two-words)] | ||
//~^ ERROR expected one of `(`, `,`, `::`, or `=`, found `-` | ||
if true { | ||
} else { | ||
} | ||
#[allow(two-words)] | ||
//~^ ERROR expected one of `(`, `,`, `::`, or `=`, found `-` | ||
(1); | ||
#[allow(two-words)] | ||
//~^ ERROR expected one of `(`, `,`, `::`, or `=`, found `-` | ||
match 1 { | ||
_ => {} | ||
} | ||
#[allow(two-words)] | ||
//~^ ERROR expected one of `(`, `,`, `::`, or `=`, found `-` | ||
while false {} | ||
#[allow(two-words)] | ||
//~^ ERROR expected one of `(`, `,`, `::`, or `=`, found `-` | ||
{} | ||
#[allow(two-words)] | ||
//~^ ERROR expected one of `(`, `,`, `::`, or `=`, found `-` | ||
A {}; | ||
#[allow(two-words)] | ||
//~^ ERROR expected one of `(`, `,`, `::`, or `=`, found `-` | ||
func(); | ||
#[allow(two-words)] | ||
//~^ ERROR expected one of `(`, `,`, `::`, or `=`, found `-` | ||
A; | ||
#[allow(two-words)] | ||
//~^ ERROR expected one of `(`, `,`, `::`, or `=`, found `-` | ||
loop {} | ||
} |
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,56 @@ | ||
error: expected one of `(`, `,`, `::`, or `=`, found `-` | ||
--> $DIR/statement-attribute-validation.rs:6:16 | ||
| | ||
LL | #[allow(two-words)] | ||
| ^ expected one of `(`, `,`, `::`, or `=` | ||
|
||
error: expected one of `(`, `,`, `::`, or `=`, found `-` | ||
--> $DIR/statement-attribute-validation.rs:11:16 | ||
| | ||
LL | #[allow(two-words)] | ||
| ^ expected one of `(`, `,`, `::`, or `=` | ||
|
||
error: expected one of `(`, `,`, `::`, or `=`, found `-` | ||
--> $DIR/statement-attribute-validation.rs:14:16 | ||
| | ||
LL | #[allow(two-words)] | ||
| ^ expected one of `(`, `,`, `::`, or `=` | ||
|
||
error: expected one of `(`, `,`, `::`, or `=`, found `-` | ||
--> $DIR/statement-attribute-validation.rs:19:16 | ||
| | ||
LL | #[allow(two-words)] | ||
| ^ expected one of `(`, `,`, `::`, or `=` | ||
|
||
error: expected one of `(`, `,`, `::`, or `=`, found `-` | ||
--> $DIR/statement-attribute-validation.rs:22:16 | ||
| | ||
LL | #[allow(two-words)] | ||
| ^ expected one of `(`, `,`, `::`, or `=` | ||
|
||
error: expected one of `(`, `,`, `::`, or `=`, found `-` | ||
--> $DIR/statement-attribute-validation.rs:25:16 | ||
| | ||
LL | #[allow(two-words)] | ||
| ^ expected one of `(`, `,`, `::`, or `=` | ||
|
||
error: expected one of `(`, `,`, `::`, or `=`, found `-` | ||
--> $DIR/statement-attribute-validation.rs:28:16 | ||
| | ||
LL | #[allow(two-words)] | ||
| ^ expected one of `(`, `,`, `::`, or `=` | ||
|
||
error: expected one of `(`, `,`, `::`, or `=`, found `-` | ||
--> $DIR/statement-attribute-validation.rs:31:16 | ||
| | ||
LL | #[allow(two-words)] | ||
| ^ expected one of `(`, `,`, `::`, or `=` | ||
|
||
error: expected one of `(`, `,`, `::`, or `=`, found `-` | ||
--> $DIR/statement-attribute-validation.rs:34:16 | ||
| | ||
LL | #[allow(two-words)] | ||
| ^ expected one of `(`, `,`, `::`, or `=` | ||
|
||
error: aborting due to 9 previous errors | ||
|