about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2019-03-08 09:42:09 +0100
committerGitHub <noreply@github.com>2019-03-08 09:42:09 +0100
commit54a5073af99ec927ceaa01de90743534cbd39e80 (patch)
tree1607c0c9291d6b5c1c399acfde742783cd169ffa /src/libsyntax/parse
parent1d33fc9975dff3d61c4c2202daca5368d368df80 (diff)
parent02eb523d91a2acbb78c9c1ca305e03d88d6dd985 (diff)
downloadrust-54a5073af99ec927ceaa01de90743534cbd39e80.tar.gz
rust-54a5073af99ec927ceaa01de90743534cbd39e80.zip
Rollup merge of #58961 - estebank:issue-58462, r=varkor
On incorrect cfg literal/identifier, point at the right span

CC #58462
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/attr.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs
index e7937f57002..e93e15f9012 100644
--- a/src/libsyntax/parse/attr.rs
+++ b/src/libsyntax/parse/attr.rs
@@ -285,8 +285,8 @@ impl<'a> Parser<'a> {
         }
 
         let found = self.this_token_to_string();
-        let msg = format!("expected unsuffixed literal or identifier, found {}", found);
-        Err(self.diagnostic().struct_span_err(lo, &msg))
+        let msg = format!("expected unsuffixed literal or identifier, found `{}`", found);
+        Err(self.diagnostic().struct_span_err(self.span, &msg))
     }
 
     /// matches meta_seq = ( COMMASEP(meta_item_inner) )