about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/diagnostics/macros.rs8
-rw-r--r--src/libsyntax/lib.rs2
-rw-r--r--src/libsyntax/parse/parser.rs11
3 files changed, 11 insertions, 10 deletions
diff --git a/src/libsyntax/diagnostics/macros.rs b/src/libsyntax/diagnostics/macros.rs
index 6f7493ad597..b754d083376 100644
--- a/src/libsyntax/diagnostics/macros.rs
+++ b/src/libsyntax/diagnostics/macros.rs
@@ -170,19 +170,19 @@ macro_rules! help {
 #[macro_export]
 macro_rules! register_diagnostics {
     ($($code:tt),*) => (
-        $(register_diagnostic! { $code })*
+        $($crate::register_diagnostic! { $code })*
     );
     ($($code:tt),*,) => (
-        $(register_diagnostic! { $code })*
+        $($crate::register_diagnostic! { $code })*
     )
 }
 
 #[macro_export]
 macro_rules! register_long_diagnostics {
     ($($code:tt: $description:tt),*) => (
-        $(register_diagnostic! { $code, $description })*
+        $($crate::register_diagnostic! { $code, $description })*
     );
     ($($code:tt: $description:tt),*,) => (
-        $(register_diagnostic! { $code, $description })*
+        $($crate::register_diagnostic! { $code, $description })*
     )
 }
diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs
index ee7fb97ffd7..591f2fb599b 100644
--- a/src/libsyntax/lib.rs
+++ b/src/libsyntax/lib.rs
@@ -18,9 +18,7 @@
 #![feature(label_break_value)]
 #![feature(mem_take)]
 #![feature(nll)]
-#![feature(rustc_attrs)]
 #![feature(rustc_diagnostic_macros)]
-#![feature(step_trait)]
 #![feature(try_trait)]
 #![feature(unicode_internals)]
 
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index e0633f73ac4..83030e89af3 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -7410,10 +7410,13 @@ impl<'a> Parser<'a> {
             } else if self.look_ahead(1, |t| *t == token::OpenDelim(token::Paren)) {
                 let ident = self.parse_ident().unwrap();
                 self.bump();  // `(`
-                let kw_name = if let Ok(Some(_)) = self.parse_self_arg_with_attrs() {
-                    "method"
-                } else {
-                    "function"
+                let kw_name = match self.parse_self_arg_with_attrs() {
+                    Ok(Some(_)) => "method",
+                    Ok(None) => "function",
+                    Err(mut err) => {
+                        err.cancel();
+                        "function"
+                    }
                 };
                 self.consume_block(token::Paren);
                 let (kw, kw_name, ambiguous) = if self.check(&token::RArrow) {