about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs7
-rw-r--r--src/libsyntax/parse/token.rs7
2 files changed, 9 insertions, 5 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 7cce9c2dc3a..d2735a425f5 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -3402,9 +3402,10 @@ impl<'a> Parser<'a> {
                        binding_mode: ast::BindingMode)
                        -> ast::Pat_ {
         if !is_plain_ident(&self.token) {
-            let last_span = self.last_span;
-            self.span_fatal(last_span,
-                            "expected identifier, found path");
+            let span = self.span;
+            let tok_str = self.this_token_to_string();
+            self.span_fatal(span,
+                            format!("expected identifier, found `{}`", tok_str).as_slice());
         }
         let ident = self.parse_ident();
         let last_span = self.last_span;
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index a486ac40a97..a8c827439cc 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -383,12 +383,15 @@ macro_rules! declare_special_idents_and_keywords {(
 
     pub mod special_idents {
         use ast::{Ident, Name};
-        $( pub static $si_static: Ident = Ident { name: Name($si_name), ctxt: 0 }; )*
+        $(
+            #[allow(non_uppercase_statics)]
+            pub static $si_static: Ident = Ident { name: Name($si_name), ctxt: 0 };
+         )*
     }
 
     pub mod special_names {
         use ast::Name;
-        $( pub static $si_static: Name =  Name($si_name); )*
+        $( #[allow(non_uppercase_statics)] pub static $si_static: Name =  Name($si_name); )*
     }
 
     /**