diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2021-03-31 15:43:33 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2021-04-23 10:40:32 -0300 |
| commit | 0e4d2fd447602f8cc9cf2eb9851cdfddfbcd6f3d (patch) | |
| tree | 6e5549a1d04acb5a99655b1e6076d7e60c45379e /compiler/rustc_parse/src | |
| parent | 5f1aeb52c22e3784928765e34be6dc0d17a350b4 (diff) | |
| download | rust-0e4d2fd447602f8cc9cf2eb9851cdfddfbcd6f3d.tar.gz rust-0e4d2fd447602f8cc9cf2eb9851cdfddfbcd6f3d.zip | |
Revert "Rollup merge of #82296 - spastorino:pubrules, r=nikomatsakis"
This reverts commit e2561c58a41023a14e0e583113dcf55e1ecb236a, reversing changes made to 2982ba50fc4bb629b8fe4108a81cb2f9b053510b.
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/parser/item.rs | 10 |
1 files changed, 9 insertions, 1 deletions
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( |
