Skip to content

Commit 327563f

Browse files
committed
Increase instances of try_get_cached
1 parent f5b8f44 commit 327563f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

compiler/rustc_middle/src/ty/query.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ macro_rules! define_callbacks {
355355
let key = key.into_query_param();
356356
opt_remap_env_constness!([$($modifiers)*][key]);
357357

358-
match try_get_cached(self.tcx, &self.tcx.query_system.caches.$name, &key) {
358+
match try_get_cached::<_, _, $V>(self.tcx, &self.tcx.query_system.caches.$name, &key) {
359359
Some(_) => return,
360360
None => self.tcx.queries.$name(
361361
self.tcx,
@@ -374,7 +374,7 @@ macro_rules! define_callbacks {
374374
let key = key.into_query_param();
375375
opt_remap_env_constness!([$($modifiers)*][key]);
376376

377-
match try_get_cached(self.tcx, &self.tcx.query_system.caches.$name, &key) {
377+
match try_get_cached::<_, _, $V>(self.tcx, &self.tcx.query_system.caches.$name, &key) {
378378
Some(_) => return,
379379
None => self.tcx.queries.$name(
380380
self.tcx,
@@ -404,7 +404,7 @@ macro_rules! define_callbacks {
404404
let key = key.into_query_param();
405405
opt_remap_env_constness!([$($modifiers)*][key]);
406406

407-
restore::<$V>(match try_get_cached(self.tcx, &self.tcx.query_system.caches.$name, &key) {
407+
restore::<$V>(match try_get_cached::<_, _, $V>(self.tcx, &self.tcx.query_system.caches.$name, &key) {
408408
Some(value) => value,
409409
None => self.tcx.queries.$name(self.tcx, self.span, key, QueryMode::Get).unwrap(),
410410
})
@@ -499,7 +499,7 @@ macro_rules! define_feedable {
499499
let value = restore::<$V>(erased);
500500
let cache = &tcx.query_system.caches.$name;
501501

502-
match try_get_cached(tcx, cache, &key) {
502+
match try_get_cached::<_, _, $V>(tcx, cache, &key) {
503503
Some(old) => {
504504
let old = restore::<$V>(old);
505505
bug!(

compiler/rustc_query_system/src/query/plumbing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ pub(crate) struct CycleError<D: DepKind> {
237237
/// which will be used if the query is not in the cache and we need
238238
/// to compute it.
239239
#[inline]
240-
pub fn try_get_cached<Tcx, C>(tcx: Tcx, cache: &C, key: &C::Key) -> Option<C::Value>
240+
pub fn try_get_cached<Tcx, C, V>(tcx: Tcx, cache: &C, key: &C::Key) -> Option<C::Value>
241241
where
242242
C: QueryCache,
243243
Tcx: DepContext,

0 commit comments

Comments
 (0)