File tree 1 file changed +10
-1
lines changed
compiler/rustc_middle/src/ty
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,10 @@ macro_rules! define_callbacks {
200
200
201
201
$( pub type $name<' tcx> = $V; ) *
202
202
}
203
+
204
+ /// This module specifies the type returned from query providers and the type used for
205
+ /// decoding. For regular queries this is the declared returned type `V`, but
206
+ /// `arena_cache` will use `<V as Deref>::Target` instead.
203
207
#[ allow( nonstandard_style, unused_lifetimes) ]
204
208
pub mod query_provided {
205
209
use super :: * ;
@@ -208,12 +212,17 @@ macro_rules! define_callbacks {
208
212
pub type $name<' tcx> = query_if_arena!( [ $( $modifiers) * ] ( <$V as Deref >:: Target ) ( $V) ) ;
209
213
) *
210
214
}
215
+
216
+ /// This module has a function per query which takes a `query_provided` value and coverts
217
+ /// it to a regular `V` value by allocating it on an arena if the query has the
218
+ /// `arena_cache` modifier. This will happen when computing the query using a provider or
219
+ /// decoding a stored result.
211
220
#[ allow( nonstandard_style, unused_lifetimes) ]
212
221
pub mod query_provided_to_value {
213
222
use super :: * ;
214
223
215
224
$(
216
- #[ inline]
225
+ #[ inline( always ) ]
217
226
pub fn $name<' tcx>(
218
227
_tcx: TyCtxt <' tcx>,
219
228
value: query_provided:: $name<' tcx>,
You can’t perform that action at this time.
0 commit comments