Surround found token with `
This commit is contained in:
parent
669be1a0a6
commit
02eb523d91
3 changed files with 3 additions and 3 deletions
|
@ -285,7 +285,7 @@ impl<'a> Parser<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let found = self.this_token_to_string();
|
let found = self.this_token_to_string();
|
||||||
let msg = format!("expected unsuffixed literal or identifier, found {}", found);
|
let msg = format!("expected unsuffixed literal or identifier, found `{}`", found);
|
||||||
Err(self.diagnostic().struct_span_err(self.span, &msg))
|
Err(self.diagnostic().struct_span_err(self.span, &msg))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ struct S9;
|
||||||
macro_rules! generate_s10 {
|
macro_rules! generate_s10 {
|
||||||
($expr: expr) => {
|
($expr: expr) => {
|
||||||
#[cfg(feature = $expr)]
|
#[cfg(feature = $expr)]
|
||||||
//~^ ERROR expected unsuffixed literal or identifier, found concat!("nonexistent")
|
//~^ ERROR expected unsuffixed literal or identifier, found `concat!("nonexistent")`
|
||||||
struct S10;
|
struct S10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ error[E0565]: literal in `cfg` predicate value must be a string
|
||||||
LL | #[cfg(a = b"hi")] //~ ERROR literal in `cfg` predicate value must be a string
|
LL | #[cfg(a = b"hi")] //~ ERROR literal in `cfg` predicate value must be a string
|
||||||
| ^^^^^ help: consider removing the prefix: `"hi"`
|
| ^^^^^ help: consider removing the prefix: `"hi"`
|
||||||
|
|
||||||
error: expected unsuffixed literal or identifier, found concat!("nonexistent")
|
error: expected unsuffixed literal or identifier, found `concat!("nonexistent")`
|
||||||
--> $DIR/cfg-attr-syntax-validation.rs:30:25
|
--> $DIR/cfg-attr-syntax-validation.rs:30:25
|
||||||
|
|
|
|
||||||
LL | #[cfg(feature = $expr)]
|
LL | #[cfg(feature = $expr)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue