]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/dep_graph/dep_node.rs
Auto merge of #45353 - wesleywiser:untracked_queries, r=michaelwoerister
[rust.git] / src / librustc / dep_graph / dep_node.rs
index 56b218889854d0a49121b063c42018359575c297..4a763d4144edcbf8a044a2cc5a1b6e2ba9085241 100644 (file)
@@ -90,6 +90,11 @@ macro_rules! is_input_attr {
     ($attr:ident) => (false);
 }
 
+macro_rules! is_eval_always_attr {
+    (eval_always) => (true);
+    ($attr:ident) => (false);
+}
+
 macro_rules! contains_anon_attr {
     ($($attr:ident),*) => ({$(is_anon_attr!($attr) | )* false});
 }
@@ -98,6 +103,10 @@ macro_rules! contains_input_attr {
     ($($attr:ident),*) => ({$(is_input_attr!($attr) | )* false});
 }
 
+macro_rules! contains_eval_always_attr {
+    ($($attr:ident),*) => ({$(is_eval_always_attr!($attr) | )* false});
+}
+
 macro_rules! define_dep_nodes {
     (<$tcx:tt>
     $(
@@ -160,6 +169,15 @@ pub fn is_input(&self) -> bool {
                 }
             }
 
+            #[inline]
+            pub fn is_eval_always(&self) -> bool {
+                match *self {
+                    $(
+                        DepKind :: $variant => { contains_eval_always_attr!($($attr), *) }
+                    )*
+                }
+            }
+
             #[allow(unreachable_code)]
             #[inline]
             pub fn has_params(&self) -> bool {
@@ -447,10 +465,10 @@ pub fn fingerprint_needed_for_crate_hash(self) -> bool {
 
     // Represents different phases in the compiler.
     [] RegionScopeTree(DefId),
-    [] Coherence,
-    [] CoherenceInherentImplOverlapCheck,
+    [eval_always] Coherence,
+    [eval_always] CoherenceInherentImplOverlapCheck,
     [] CoherenceCheckTrait(DefId),
-    [] PrivacyAccessLevels(CrateNum),
+    [eval_always] PrivacyAccessLevels(CrateNum),
 
     // Represents the MIR for a fn; also used as the task node for
     // things read/modify that MIR.
@@ -467,7 +485,7 @@ pub fn fingerprint_needed_for_crate_hash(self) -> bool {
 
     [] Reachability,
     [] MirKeys,
-    [] CrateVariances,
+    [eval_always] CrateVariances,
 
     // Nodes representing bits of computed IR in the tcx. Each shared
     // table in the tcx (or elsewhere) maps to one of these
@@ -497,7 +515,7 @@ pub fn fingerprint_needed_for_crate_hash(self) -> bool {
     [] DtorckConstraint(DefId),
     [] AdtDestructor(DefId),
     [] AssociatedItemDefIds(DefId),
-    [] InherentImpls(DefId),
+    [eval_always] InherentImpls(DefId),
     [] TypeckBodiesKrate,
     [] TypeckTables(DefId),
     [] UsedTraitImports(DefId),
@@ -567,7 +585,7 @@ pub fn fingerprint_needed_for_crate_hash(self) -> bool {
     [] IsCompilerBuiltins(CrateNum),
     [] HasGlobalAllocator(CrateNum),
     [] ExternCrate(DefId),
-    [] LintLevels,
+    [eval_always] LintLevels,
     [] Specializes { impl1: DefId, impl2: DefId },
     [input] InScopeTraits(DefIndex),
     [] ModuleExports(DefId),
@@ -626,7 +644,7 @@ pub fn fingerprint_needed_for_crate_hash(self) -> bool {
     [] StabilityIndex,
     [] AllCrateNums,
     [] ExportedSymbols(CrateNum),
-    [] CollectAndPartitionTranslationItems,
+    [eval_always] CollectAndPartitionTranslationItems,
     [] ExportName(DefId),
     [] ContainsExternIndicator(DefId),
     [] IsTranslatedFunction(DefId),