Skip to content

Commit 9fdec81

Browse files
Fix new merge conflict
1 parent 3ea9462 commit 9fdec81

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

tests/ui/parser/attribute/attr-unquoted-ident.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ fn main() {
2626

2727
macro_rules! make {
2828
($name:ident) => { #[doc(alias = $name)] pub struct S; }
29-
//~^ ERROR: expected unsuffixed literal, found identifier `nickname`
29+
//~^ ERROR: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found expression
30+
//~| NOTE: expressions are not allowed here
31+
//~| HELP: surround the identifier with quotation marks to make it into a string literal
3032
}
3133

3234
make!(nickname); //~ NOTE: in this expansion
35+
//~^ NOTE in this expansion of make

tests/ui/parser/attribute/attr-unquoted-ident.stderr

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,31 @@ help: surround the identifier with quotation marks to make it into a string lite
2020
LL | #[cfg(key="foo bar baz")]
2121
| + +
2222

23+
error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found expression
24+
--> $DIR/attr-unquoted-ident.rs:18:15
25+
|
26+
LL | #[cfg(key=foo 1 bar 2.0 baz.)]
27+
| ^^^ expressions are not allowed here
28+
|
29+
help: surround the identifier with quotation marks to make it into a string literal
30+
|
31+
LL | #[cfg(key="foo 1 bar 2.0 baz.")]
32+
| + +
33+
34+
error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found expression
35+
--> $DIR/attr-unquoted-ident.rs:28:38
2336
|
2437
LL | ($name:ident) => { #[doc(alias = $name)] pub struct S; }
25-
| ^^^^^
38+
| ^^^^^ expressions are not allowed here
2639
...
2740
LL | make!(nickname);
2841
| --------------- in this macro invocation
2942
|
3043
= note: this error originates in the macro `make` (in Nightly builds, run with -Z macro-backtrace for more info)
44+
help: surround the identifier with quotation marks to make it into a string literal
45+
|
46+
LL | ($name:ident) => { #[doc(alias = "$name")] pub struct S; }
47+
| + +
3148

3249
error: aborting due to 4 previous errors
3350

0 commit comments

Comments
 (0)