Revert "Rollup merge of #82296 - spastorino:pubrules, r=nikomatsakis"
This reverts commite2561c58a4
, reversing changes made to2982ba50fc
.
This commit is contained in:
parent
5f1aeb52c2
commit
0e4d2fd447
14 changed files with 35 additions and 183 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