about summary refs log tree commit diff
path: root/src/librustc_plugin
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-07-04 01:38:49 +0200
committerGitHub <noreply@github.com>2019-07-04 01:38:49 +0200
commit8867ba19de71f437956440eeda9cd45ca8f1dc8f (patch)
tree7317b5b94dd9f662f97812282e7f901eb6ffe45d /src/librustc_plugin
parent944bda9abb4b80aa383223ea98e230224df76a8b (diff)
parentd0dc41a2bdd45531e9d5ef9364027763158b4b85 (diff)
Rollup merge of #62258 - petrochenkov:idclean, r=Centril
syntax: Unsupport `foo! bar { ... }` macros in the parser

Their support in expansion was removed in https://github.com/rust-lang/rust/pull/61606.

Also un-reserve `macro_rules` as a macro name, there's no ambiguity between `macro_rules` definitions and macro calls (it also wasn't reserved correctly).

cc https://github.com/rust-lang-nursery/wg-grammar/issues/51
Diffstat (limited to 'src/librustc_plugin')
-rw-r--r--src/librustc_plugin/registry.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/librustc_plugin/registry.rs b/src/librustc_plugin/registry.rs
index 2fb65a60693..ec2855f826a 100644
--- a/src/librustc_plugin/registry.rs
+++ b/src/librustc_plugin/registry.rs
@@ -6,7 +6,7 @@ use rustc::util::nodemap::FxHashMap;
 
 use syntax::ext::base::{SyntaxExtension, SyntaxExtensionKind, NamedSyntaxExtension};
 use syntax::ext::base::MacroExpanderFn;
-use syntax::symbol::{Symbol, sym};
+use syntax::symbol::Symbol;
 use syntax::ast;
 use syntax::feature_gate::AttributeType;
 use syntax_pos::Span;
@@ -85,9 +85,6 @@ impl<'a> Registry<'a> {
     ///
     /// This is the most general hook into `libsyntax`'s expansion behavior.
     pub fn register_syntax_extension(&mut self, name: ast::Name, mut extension: SyntaxExtension) {
-        if name == sym::macro_rules {
-            panic!("user-defined macros may not be named `macro_rules`");
-        }
         if extension.def_info.is_none() {
             extension.def_info = Some((ast::CRATE_NODE_ID, self.krate_span));
         }