1
Fork 0

Surround found token with `

This commit is contained in:
Esteban Küber 2019-03-06 13:16:52 -08:00
parent 669be1a0a6
commit 02eb523d91
3 changed files with 3 additions and 3 deletions

View file

@ -285,7 +285,7 @@ impl<'a> Parser<'a> {
}
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))
}

View file

@ -28,7 +28,7 @@ struct S9;
macro_rules! generate_s10 {
($expr: expr) => {
#[cfg(feature = $expr)]
//~^ ERROR expected unsuffixed literal or identifier, found concat!("nonexistent")
//~^ ERROR expected unsuffixed literal or identifier, found `concat!("nonexistent")`
struct S10;
}
}

View file

@ -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
| ^^^^^ 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
|
LL | #[cfg(feature = $expr)]