]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_incremental/src/assert_module_sources.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / compiler / rustc_incremental / src / assert_module_sources.rs
index 8220eb6c6570f5bfbe29df85a1dd35907e6579f5..a5f3e4553ce56abc45c8a77e1d5a8ad2e9be9294 100644 (file)
@@ -57,27 +57,26 @@ struct AssertModuleSource<'tcx> {
 
 impl AssertModuleSource<'tcx> {
     fn check_attr(&self, attr: &ast::Attribute) {
-        let (expected_reuse, comp_kind) =
-            if self.tcx.sess.check_name(attr, sym::rustc_partition_reused) {
-                (CguReuse::PreLto, ComparisonKind::AtLeast)
-            } else if self.tcx.sess.check_name(attr, sym::rustc_partition_codegened) {
-                (CguReuse::No, ComparisonKind::Exact)
-            } else if self.tcx.sess.check_name(attr, sym::rustc_expected_cgu_reuse) {
-                match self.field(attr, sym::kind) {
-                    sym::no => (CguReuse::No, ComparisonKind::Exact),
-                    sym::pre_dash_lto => (CguReuse::PreLto, ComparisonKind::Exact),
-                    sym::post_dash_lto => (CguReuse::PostLto, ComparisonKind::Exact),
-                    sym::any => (CguReuse::PreLto, ComparisonKind::AtLeast),
-                    other => {
-                        self.tcx.sess.span_fatal(
-                            attr.span,
-                            &format!("unknown cgu-reuse-kind `{}` specified", other),
-                        );
-                    }
+        let (expected_reuse, comp_kind) = if attr.has_name(sym::rustc_partition_reused) {
+            (CguReuse::PreLto, ComparisonKind::AtLeast)
+        } else if attr.has_name(sym::rustc_partition_codegened) {
+            (CguReuse::No, ComparisonKind::Exact)
+        } else if attr.has_name(sym::rustc_expected_cgu_reuse) {
+            match self.field(attr, sym::kind) {
+                sym::no => (CguReuse::No, ComparisonKind::Exact),
+                sym::pre_dash_lto => (CguReuse::PreLto, ComparisonKind::Exact),
+                sym::post_dash_lto => (CguReuse::PostLto, ComparisonKind::Exact),
+                sym::any => (CguReuse::PreLto, ComparisonKind::AtLeast),
+                other => {
+                    self.tcx.sess.span_fatal(
+                        attr.span,
+                        &format!("unknown cgu-reuse-kind `{}` specified", other),
+                    );
                 }
-            } else {
-                return;
-            };
+            }
+        } else {
+            return;
+        };
 
         if !self.tcx.sess.opts.debugging_opts.query_dep_graph {
             self.tcx.sess.span_fatal(