Revert "Rollup merge of #82296 - spastorino:pubrules, r=nikomatsakis"

This reverts commit e2561c58a4, reversing
changes made to 2982ba50fc.
This commit is contained in:
Santiago Pastorino 2021-03-31 15:43:33 -03:00
parent 5f1aeb52c2
commit 0e4d2fd447
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
14 changed files with 35 additions and 183 deletions

View file

@ -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(