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_resolve | |
| 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_resolve')
| -rw-r--r-- | compiler/rustc_resolve/src/build_reduced_graph.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index d77022a65e4..b5c95cfcb29 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -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 |
