1
Fork 0

Support pub on macro_rules

This commit is contained in:
Vadim Petrochenkov 2020-10-21 00:46:29 +03:00 committed by Santiago Pastorino
parent 25a2c13e9d
commit 0fddc2f780
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
14 changed files with 183 additions and 35 deletions

View file

@ -1488,15 +1488,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(