about summary refs log tree commit diff
path: root/compiler/rustc_passes
diff options
context:
space:
mode:
authorclubby789 <jamie@hill-daniel.co.uk>2023-05-01 14:36:52 +0100
committerclubby789 <jamie@hill-daniel.co.uk>2023-05-01 15:05:39 +0100
commit0453cda59e4eb09e2bc632c41420da22bfeac242 (patch)
tree7369df01221614ba909c07eac3f96b7eade8b1a2 /compiler/rustc_passes
parent4b87ed9d0f18166a26aadb5289bac004e058b90f (diff)
downloadrust-0453cda59e4eb09e2bc632c41420da22bfeac242.tar.gz
rust-0453cda59e4eb09e2bc632c41420da22bfeac242.zip
Don't bail out early when checking invalid `repr` attr
Diffstat (limited to 'compiler/rustc_passes')
-rw-r--r--compiler/rustc_passes/src/check_attr.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs
index 3f28ac26f86..06aa2737915 100644
--- a/compiler/rustc_passes/src/check_attr.rs
+++ b/compiler/rustc_passes/src/check_attr.rs
@@ -101,12 +101,11 @@ impl CheckAttrVisitor<'_> {
         item: Option<ItemLike<'_>>,
     ) {
         let mut doc_aliases = FxHashMap::default();
-        let mut is_valid = true;
         let mut specified_inline = None;
         let mut seen = FxHashMap::default();
         let attrs = self.tcx.hir().attrs(hir_id);
         for attr in attrs {
-            let attr_is_valid = match attr.name_or_empty() {
+            match attr.name_or_empty() {
                 sym::do_not_recommend => self.check_do_not_recommend(attr.span, target),
                 sym::inline => self.check_inline(hir_id, attr, span, target),
                 sym::no_coverage => self.check_no_coverage(hir_id, attr, span, target),
@@ -188,7 +187,6 @@ impl CheckAttrVisitor<'_> {
                 sym::link_ordinal => self.check_link_ordinal(&attr, span, target),
                 _ => true,
             };
-            is_valid &= attr_is_valid;
 
             // lint-only checks
             match attr.name_or_empty() {
@@ -255,10 +253,6 @@ impl CheckAttrVisitor<'_> {
             self.check_unused_attribute(hir_id, attr)
         }
 
-        if !is_valid {
-            return;
-        }
-
         self.check_repr(attrs, span, target, item, hir_id);
         self.check_used(attrs, target);
     }