-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #119341 - sjwang05:issue-58462, r=WaffleLapkin
Suggest quoting unquoted idents in attrs Closes #58462
- Loading branch information
Showing
8 changed files
with
107 additions
and
6 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
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
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
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
7 changes: 6 additions & 1 deletion
7
tests/ui/deprecation/issue-66340-deprecated-attr-non-meta-grammar.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 |
---|---|---|
@@ -1,8 +1,13 @@ | ||
error: expected unsuffixed literal or identifier, found `test` | ||
error: expected unsuffixed literal, found `test` | ||
--> $DIR/issue-66340-deprecated-attr-non-meta-grammar.rs:9:21 | ||
| | ||
LL | #[deprecated(note = test)] | ||
| ^^^^ | ||
| | ||
help: surround the identifier with quotation marks to parse it as a string | ||
| | ||
LL | #[deprecated(note = "test")] | ||
| + + | ||
|
||
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,15 @@ | ||
// compile-flags: -Zdeduplicate-diagnostics=yes | ||
// run-rustfix | ||
|
||
fn main() { | ||
#[cfg(key="foo")] | ||
//~^ ERROR expected unsuffixed literal, found `foo` | ||
//~| HELP surround the identifier with quotation marks to parse it as a string | ||
println!(); | ||
#[cfg(key="bar")] | ||
println!(); | ||
#[cfg(key="foo bar baz")] | ||
//~^ ERROR expected unsuffixed literal, found `foo` | ||
//~| HELP surround the identifier with quotation marks to parse it as a string | ||
println!(); | ||
} |
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,15 @@ | ||
// compile-flags: -Zdeduplicate-diagnostics=yes | ||
// run-rustfix | ||
|
||
fn main() { | ||
#[cfg(key=foo)] | ||
//~^ ERROR expected unsuffixed literal, found `foo` | ||
//~| HELP surround the identifier with quotation marks to parse it as a string | ||
println!(); | ||
#[cfg(key="bar")] | ||
println!(); | ||
#[cfg(key=foo bar baz)] | ||
//~^ ERROR expected unsuffixed literal, found `foo` | ||
//~| HELP surround the identifier with quotation marks to parse it as a string | ||
println!(); | ||
} |
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,24 @@ | ||
error: expected unsuffixed literal, found `foo` | ||
--> $DIR/attr-unquoted-ident.rs:5:15 | ||
| | ||
LL | #[cfg(key=foo)] | ||
| ^^^ | ||
| | ||
help: surround the identifier with quotation marks to parse it as a string | ||
| | ||
LL | #[cfg(key="foo")] | ||
| + + | ||
|
||
error: expected unsuffixed literal, found `foo` | ||
--> $DIR/attr-unquoted-ident.rs:11:15 | ||
| | ||
LL | #[cfg(key=foo bar baz)] | ||
| ^^^ | ||
| | ||
help: surround the identifier with quotation marks to parse it as a string | ||
| | ||
LL | #[cfg(key="foo bar baz")] | ||
| + + | ||
|
||
error: aborting due to 2 previous errors | ||
|