diff options
| author | Jana Dönszelmann <jana@donsz.nl> | 2025-02-09 22:49:33 +0100 |
|---|---|---|
| committer | Jana Dönszelmann <jana@donsz.nl> | 2025-02-24 14:31:17 +0100 |
| commit | 7e0f5b50168c63bd1879067c043559ef0f01671e (patch) | |
| tree | b2f1b1f68ef89985faec8ae287731613e4b520c4 /compiler/rustc_privacy | |
| parent | dbd3b7928e91758296a0f6093d72f90214888133 (diff) | |
| download | rust-7e0f5b50168c63bd1879067c043559ef0f01671e.tar.gz rust-7e0f5b50168c63bd1879067c043559ef0f01671e.zip | |
Introduce new-style attribute parsers for several attributes
note: compiler compiles but librustdoc and clippy don't
Diffstat (limited to 'compiler/rustc_privacy')
| -rw-r--r-- | compiler/rustc_privacy/src/lib.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs index 41725d0c6a4..5271d03a6f6 100644 --- a/compiler/rustc_privacy/src/lib.rs +++ b/compiler/rustc_privacy/src/lib.rs @@ -22,6 +22,7 @@ use errors::{ }; use rustc_ast::MacroDef; use rustc_ast::visit::{VisitorResult, try_visit}; +use rustc_attr_parsing::AttributeKind; use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::intern::Interned; use rustc_errors::{MultiSpan, listify}; @@ -493,7 +494,11 @@ impl<'tcx> EmbargoVisitor<'tcx> { // Non-opaque macros cannot make other items more accessible than they already are. let hir_id = self.tcx.local_def_id_to_hir_id(local_def_id); let attrs = self.tcx.hir().attrs(hir_id); - if attr::find_transparency(attrs, md.macro_rules).0 != Transparency::Opaque { + + if attr::find_attr!(attrs, AttributeKind::MacroTransparency(x) => *x) + .unwrap_or(Transparency::fallback(md.macro_rules)) + != Transparency::Opaque + { return; } |
