Skip to content

Commit 02eb523

Browse files
committed
Surround found token with `
1 parent 669be1a commit 02eb523

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/libsyntax/parse/attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ impl<'a> Parser<'a> {
285285
}
286286

287287
let found = self.this_token_to_string();
288-
let msg = format!("expected unsuffixed literal or identifier, found {}", found);
288+
let msg = format!("expected unsuffixed literal or identifier, found `{}`", found);
289289
Err(self.diagnostic().struct_span_err(self.span, &msg))
290290
}
291291

src/test/ui/conditional-compilation/cfg-attr-syntax-validation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct S9;
2828
macro_rules! generate_s10 {
2929
($expr: expr) => {
3030
#[cfg(feature = $expr)]
31-
//~^ ERROR expected unsuffixed literal or identifier, found concat!("nonexistent")
31+
//~^ ERROR expected unsuffixed literal or identifier, found `concat!("nonexistent")`
3232
struct S10;
3333
}
3434
}

src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ error[E0565]: literal in `cfg` predicate value must be a string
5252
LL | #[cfg(a = b"hi")] //~ ERROR literal in `cfg` predicate value must be a string
5353
| ^^^^^ help: consider removing the prefix: `"hi"`
5454

55-
error: expected unsuffixed literal or identifier, found concat!("nonexistent")
55+
error: expected unsuffixed literal or identifier, found `concat!("nonexistent")`
5656
--> $DIR/cfg-attr-syntax-validation.rs:30:25
5757
|
5858
LL | #[cfg(feature = $expr)]

0 commit comments

Comments
 (0)