Auto merge of #83713 - spastorino:revert-pub-macro-rules, r=nikomatsakis
Revert "Rollup merge of #82296 - spastorino:pubrules, r=nikomatsakis" This reverts commite2561c58a4
, reversing changes made to2982ba50fc
. As discussed in #83641 this feature is not complete and in particular doesn't work cross macros and given that this is not going to be included in edition 2021 nobody seems to be trying to fix the underlying problem. When can add this again I guess, whenever somebody has the time to make it work cross crates. r? `@nikomatsakis`
This commit is contained in:
commit
855c2d130f
14 changed files with 37 additions and 182 deletions
|
@ -1230,13 +1230,13 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
|
|||
};
|
||||
|
||||
let res = Res::Def(DefKind::Macro(ext.macro_kind()), def_id.to_def_id());
|
||||
let is_macro_export = self.r.session.contains_name(&item.attrs, sym::macro_export);
|
||||
self.r.macro_map.insert(def_id.to_def_id(), ext);
|
||||
self.r.local_macro_def_scopes.insert(def_id, parent_scope.module);
|
||||
|
||||
if macro_rules && matches!(item.vis.kind, ast::VisibilityKind::Inherited) {
|
||||
if macro_rules {
|
||||
let ident = ident.normalize_to_macros_2_0();
|
||||
self.r.macro_names.insert(ident);
|
||||
let is_macro_export = self.r.session.contains_name(&item.attrs, sym::macro_export);
|
||||
let vis = if is_macro_export {
|
||||
ty::Visibility::Public
|
||||
} else {
|
||||
|
@ -1261,11 +1261,6 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
|
|||
}),
|
||||
))
|
||||
} else {
|
||||
if is_macro_export {
|
||||
let what = if macro_rules { "`macro_rules` with `pub`" } else { "`macro` items" };
|
||||
let msg = format!("`#[macro_export]` cannot be used on {what}");
|
||||
self.r.session.span_err(item.span, &msg);
|
||||
}
|
||||
let module = parent_scope.module;
|
||||
let vis = match item.kind {
|
||||
// Visibilities must not be resolved non-speculatively twice
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue