@@ -80,6 +80,11 @@ pub struct DepKindStruct {
8080 /// When their result is needed, it is recomputed. They are useful for fine-grained
8181 /// dependency tracking, and caching within one compiler invocation.
8282 pub ( super ) is_anon : bool ,
83+
84+ /// Eval-always queries do not track their dependencies, and are always recomputed, even if
85+ /// their inputs have not changed since the last compiler invocation. The result is still
86+ /// cached within one compiler invocation.
87+ pub ( super ) is_eval_always : bool ,
8388}
8489
8590impl std:: ops:: Deref for DepKind {
@@ -127,14 +132,15 @@ pub mod dep_kind {
127132 use super :: * ;
128133
129134 // We use this for most things when incr. comp. is turned off.
130- pub const Null : DepKindStruct = DepKindStruct { is_anon : false } ;
135+ pub const Null : DepKindStruct = DepKindStruct { is_anon : false , is_eval_always : false } ;
131136
132137 // Represents metadata from an extern crate.
133- pub const CrateMetadata : DepKindStruct = DepKindStruct { is_anon : false } ;
138+ pub const CrateMetadata : DepKindStruct = DepKindStruct { is_anon : false , is_eval_always : true } ;
134139
135- pub const TraitSelect : DepKindStruct = DepKindStruct { is_anon : true } ;
140+ pub const TraitSelect : DepKindStruct = DepKindStruct { is_anon : true , is_eval_always : false } ;
136141
137- pub const CompileCodegenUnit : DepKindStruct = DepKindStruct { is_anon : false } ;
142+ pub const CompileCodegenUnit : DepKindStruct =
143+ DepKindStruct { is_anon : false , is_eval_always : false } ;
138144
139145 macro_rules! define_query_dep_kinds {
140146 ( $(
@@ -143,9 +149,11 @@ pub mod dep_kind {
143149 , ) * ) => (
144150 $( pub const $variant: DepKindStruct = {
145151 const is_anon: bool = contains_anon_attr!( $( $attrs) * ) ;
152+ const is_eval_always: bool = contains_eval_always_attr!( $( $attrs) * ) ;
146153
147154 DepKindStruct {
148155 is_anon,
156+ is_eval_always,
149157 }
150158 } ; ) *
151159 ) ;
@@ -192,14 +200,6 @@ macro_rules! define_dep_nodes {
192200 }
193201 }
194202
195- pub fn is_eval_always( & self ) -> bool {
196- match * self {
197- $(
198- DepKind :: $variant => { contains_eval_always_attr!( $( $attrs) * ) }
199- ) *
200- }
201- }
202-
203203 #[ allow( unreachable_code) ]
204204 pub fn has_params( & self ) -> bool {
205205 match * self {
0 commit comments