From 0e4d2fd447602f8cc9cf2eb9851cdfddfbcd6f3d Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Wed, 31 Mar 2021 15:43:33 -0300 Subject: Revert "Rollup merge of #82296 - spastorino:pubrules, r=nikomatsakis" This reverts commit e2561c58a41023a14e0e583113dcf55e1ecb236a, reversing changes made to 2982ba50fc4bb629b8fe4108a81cb2f9b053510b. --- compiler/rustc_parse/src/parser/item.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_parse/src/parser') diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index 299b9a959c5..acf3867cf89 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -1478,7 +1478,15 @@ impl<'a> Parser<'a> { let vstr = pprust::vis_to_string(vis); let vstr = vstr.trim_end(); if macro_rules { - self.sess.gated_spans.gate(sym::pub_macro_rules, vis.span); + 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(); } else { self.struct_span_err(vis.span, "can't qualify macro invocation with `pub`") .span_suggestion( -- cgit 1.4.1-3-g733a5