@@ -16,11 +16,11 @@ use crate::ty::TyCtxt;
1616///
1717/// (Also performs some associated bookkeeping, if a value was found.)
1818#[ inline( always) ]
19- fn try_get_cached < ' tcx , C > ( tcx : TyCtxt < ' tcx > , cache : & C , key : & C :: Key ) -> Option < C :: Value >
19+ fn try_get_cached < ' tcx , C > ( tcx : TyCtxt < ' tcx > , cache : & C , key : C :: Key ) -> Option < C :: Value >
2020where
2121 C : QueryCache ,
2222{
23- match cache. lookup ( key) {
23+ match cache. lookup ( & key) {
2424 Some ( ( value, index) ) => {
2525 tcx. prof . query_cache_hit ( index. into ( ) ) ;
2626 tcx. dep_graph . read_index ( index) ;
@@ -42,7 +42,7 @@ pub(crate) fn query_get_at<'tcx, C>(
4242where
4343 C : QueryCache ,
4444{
45- match try_get_cached ( tcx, & query. cache , & key) {
45+ match try_get_cached ( tcx, & query. cache , key) {
4646 Some ( value) => value,
4747 None => ( query. execute_query_fn ) ( tcx, span, key, QueryMode :: Get ) . unwrap ( ) ,
4848 }
@@ -59,7 +59,7 @@ pub(crate) fn query_ensure<'tcx, C>(
5959) where
6060 C : QueryCache ,
6161{
62- if try_get_cached ( tcx, & query. cache , & key) . is_none ( ) {
62+ if try_get_cached ( tcx, & query. cache , key) . is_none ( ) {
6363 ( query. execute_query_fn ) ( tcx, DUMMY_SP , key, QueryMode :: Ensure { ensure_mode } ) ;
6464 }
6565}
8181{
8282 assert_matches ! ( ensure_mode, EnsureMode :: Ok ) ;
8383
84- if let Some ( res) = try_get_cached ( tcx, & query. cache , & key) {
84+ if let Some ( res) = try_get_cached ( tcx, & query. cache , key) {
8585 erase:: restore_val ( res) . map ( drop)
8686 } else {
8787 ( query. execute_query_fn ) ( tcx, DUMMY_SP , key, QueryMode :: Ensure { ensure_mode } )
@@ -111,7 +111,7 @@ pub(crate) fn query_feed<'tcx, C>(
111111 let format_value = query_vtable. format_value ;
112112
113113 // Check whether the in-memory cache already has a value for this key.
114- match try_get_cached ( tcx, & query_vtable. cache , & key) {
114+ match try_get_cached ( tcx, & query_vtable. cache , key) {
115115 Some ( old) => {
116116 // The query already has a cached value for this key.
117117 // That's OK if both values are the same, i.e. they have the same hash,
0 commit comments