about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2021-02-23 16:10:23 +0100
committerGitHub <noreply@github.com>2021-02-23 16:10:23 +0100
commite2561c58a41023a14e0e583113dcf55e1ecb236a (patch)
treeb4f78b67c2cf8052c90b91d734ed4b02e1a1edd7 /compiler/rustc_parse/src/parser
parent2982ba50fc4bb629b8fe4108a81cb2f9b053510b (diff)
parentb3000ec0cdb35b305bfe954db4b14ce32cbc255b (diff)
downloadrust-e2561c58a41023a14e0e583113dcf55e1ecb236a.tar.gz
rust-e2561c58a41023a14e0e583113dcf55e1ecb236a.zip
Rollup merge of #82296 - spastorino:pubrules, r=nikomatsakis
Support `pub` on `macro_rules`

This rebases and updates `since` version of #78166 from ``@petrochenkov``

r? ``@nikomatsakis``
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/item.rs10
1 files changed, 1 insertions, 9 deletions
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs
index f3f5fc9af64..073a2d8bd51 100644
--- a/compiler/rustc_parse/src/parser/item.rs
+++ b/compiler/rustc_parse/src/parser/item.rs
@@ -1475,15 +1475,7 @@ impl<'a> Parser<'a> {
         let vstr = pprust::vis_to_string(vis);
         let vstr = vstr.trim_end();
         if macro_rules {
-            let msg = format!("can't qualify macro_rules invocation with `{}`", vstr);
-            self.struct_span_err(vis.span, &msg)
-                .span_suggestion(
-                    vis.span,
-                    "try exporting the macro",
-                    "#[macro_export]".to_owned(),
-                    Applicability::MaybeIncorrect, // speculative
-                )
-                .emit();
+            self.sess.gated_spans.gate(sym::pub_macro_rules, vis.span);
         } else {
             self.struct_span_err(vis.span, "can't qualify macro invocation with `pub`")
                 .span_suggestion(