Skip to content

Commit

Permalink
Surround found token with `
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Mar 6, 2019
1 parent 669be1a commit 02eb523
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/libsyntax/parse/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 02eb523

Please sign in to comment.