diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2021-11-12 20:15:14 +0800 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2021-11-12 20:15:14 +0800 |
| commit | 66557270419400a2d104833f3ff6dd6a55210543 (patch) | |
| tree | 631b73a25e051c4f6f4829de554add92f50374e4 /compiler/rustc_passes/src | |
| parent | e4c23daeb461ac02413eb36c8cefcc5530638a05 (diff) | |
| download | rust-66557270419400a2d104833f3ff6dd6a55210543.tar.gz rust-66557270419400a2d104833f3ff6dd6a55210543.zip | |
rustc_feature: Convert `BuiltinAttribute` from tuple to a struct
Diffstat (limited to 'compiler/rustc_passes/src')
| -rw-r--r-- | compiler/rustc_passes/src/check_attr.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index 596d13d2d9a..129a9fdab82 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -11,7 +11,7 @@ use rustc_middle::ty::TyCtxt; use rustc_ast::{ast, AttrStyle, Attribute, Lit, LitKind, NestedMetaItem}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_errors::{pluralize, struct_span_err, Applicability}; -use rustc_feature::{AttributeType, BUILTIN_ATTRIBUTE_MAP}; +use rustc_feature::{AttributeType, BuiltinAttribute, BUILTIN_ATTRIBUTE_MAP}; use rustc_hir as hir; use rustc_hir::def_id::LocalDefId; use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor}; @@ -148,7 +148,7 @@ impl CheckAttrVisitor<'tcx> { } if hir_id != CRATE_HIR_ID { - if let Some((_, AttributeType::CrateLevel, ..)) = + if let Some(BuiltinAttribute { type_: AttributeType::CrateLevel, .. }) = attr.ident().and_then(|ident| BUILTIN_ATTRIBUTE_MAP.get(&ident.name)) { self.tcx.struct_span_lint_hir(UNUSED_ATTRIBUTES, hir_id, attr.span, |lint| { |
