@@ -80,6 +80,11 @@ pub struct DepKindStruct {
80
80
/// When their result is needed, it is recomputed. They are useful for fine-grained
81
81
/// dependency tracking, and caching within one compiler invocation.
82
82
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 ,
83
88
}
84
89
85
90
impl std:: ops:: Deref for DepKind {
@@ -127,14 +132,15 @@ pub mod dep_kind {
127
132
use super :: * ;
128
133
129
134
// 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 } ;
131
136
132
137
// 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 } ;
134
139
135
- pub const TraitSelect : DepKindStruct = DepKindStruct { is_anon : true } ;
140
+ pub const TraitSelect : DepKindStruct = DepKindStruct { is_anon : true , is_eval_always : false } ;
136
141
137
- pub const CompileCodegenUnit : DepKindStruct = DepKindStruct { is_anon : false } ;
142
+ pub const CompileCodegenUnit : DepKindStruct =
143
+ DepKindStruct { is_anon : false , is_eval_always : false } ;
138
144
139
145
macro_rules! define_query_dep_kinds {
140
146
( $(
@@ -143,9 +149,11 @@ pub mod dep_kind {
143
149
, ) * ) => (
144
150
$( pub const $variant: DepKindStruct = {
145
151
const is_anon: bool = contains_anon_attr!( $( $attrs) * ) ;
152
+ const is_eval_always: bool = contains_eval_always_attr!( $( $attrs) * ) ;
146
153
147
154
DepKindStruct {
148
155
is_anon,
156
+ is_eval_always,
149
157
}
150
158
} ; ) *
151
159
) ;
@@ -192,14 +200,6 @@ macro_rules! define_dep_nodes {
192
200
}
193
201
}
194
202
195
- pub fn is_eval_always( & self ) -> bool {
196
- match * self {
197
- $(
198
- DepKind :: $variant => { contains_eval_always_attr!( $( $attrs) * ) }
199
- ) *
200
- }
201
- }
202
-
203
203
#[ allow( unreachable_code) ]
204
204
pub fn has_params( & self ) -> bool {
205
205
match * self {
0 commit comments