diff options
| author | bors <bors@rust-lang.org> | 2021-04-28 05:52:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-04-28 05:52:47 +0000 |
| commit | 855c2d130fb70da1643cf8f696c7aad7537aef34 (patch) | |
| tree | 41829a9612ab210fc11b74691bd783c44190db85 /compiler/rustc_resolve/src | |
| parent | 537544b1061467ee4b74ef7f552fab3d513e5caf (diff) | |
| parent | 83767d97f0ac4e644340792dd7209bbcd9306647 (diff) | |
| download | rust-855c2d130fb70da1643cf8f696c7aad7537aef34.tar.gz rust-855c2d130fb70da1643cf8f696c7aad7537aef34.zip | |
Auto merge of #83713 - spastorino:revert-pub-macro-rules, r=nikomatsakis
Revert "Rollup merge of #82296 - spastorino:pubrules, r=nikomatsakis" This reverts commit e2561c58a41023a14e0e583113dcf55e1ecb236a, reversing changes made to 2982ba50fc4bb629b8fe4108a81cb2f9b053510b. 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`
Diffstat (limited to 'compiler/rustc_resolve/src')
| -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 |
