@@ -22,8 +22,8 @@ use crate::job::{QueryJobInfo, QueryJobMap, find_cycle_in_stack, report_cycle};
2222use crate :: plumbing:: { current_query_job, next_job_id, start_query} ;
2323
2424#[ inline]
25- fn equivalent_key < K : Eq , V > ( k : & K ) -> impl Fn ( & ( K , V ) ) -> bool + ' _ {
26- move |x| x. 0 == * k
25+ fn equivalent_key < K : Eq , V > ( k : K ) -> impl Fn ( & ( K , V ) ) -> bool {
26+ move |x| x. 0 == k
2727}
2828
2929/// Obtains the enclosed [`QueryJob`], or panics if this query evaluation
@@ -173,7 +173,7 @@ where
173173 // since unwinding also wants to look at this map, this can also prevent a double
174174 // panic.
175175 let mut shard = state. active . lock_shard_by_hash ( key_hash) ;
176- match shard. find_entry ( key_hash, equivalent_key ( & key) ) {
176+ match shard. find_entry ( key_hash, equivalent_key ( key) ) {
177177 Err ( _) => None ,
178178 Ok ( occupied) => Some ( occupied. remove ( ) . 0 . 1 ) ,
179179 }
@@ -195,7 +195,7 @@ where
195195 let Self { state, key, key_hash } = * self ;
196196 let job = {
197197 let mut shard = state. active . lock_shard_by_hash ( key_hash) ;
198- match shard. find_entry ( key_hash, equivalent_key ( & key) ) {
198+ match shard. find_entry ( key_hash, equivalent_key ( key) ) {
199199 Err ( _) => panic ! ( ) ,
200200 Ok ( occupied) => {
201201 let ( ( key, value) , vacant) = occupied. remove ( ) ;
@@ -254,7 +254,7 @@ fn wait_for_query<'tcx, C: QueryCache>(
254254 // poisoned due to a panic instead.
255255 let key_hash = sharded:: make_hash ( & key) ;
256256 let shard = query. state . active . lock_shard_by_hash ( key_hash) ;
257- match shard. find ( key_hash, equivalent_key ( & key) ) {
257+ match shard. find ( key_hash, equivalent_key ( key) ) {
258258 // The query we waited on panicked. Continue unwinding here.
259259 Some ( ( _, ActiveKeyStatus :: Poisoned ) ) => FatalError . raise ( ) ,
260260 _ => panic ! (
@@ -303,7 +303,7 @@ fn try_execute_query<'tcx, C: QueryCache, const INCR: bool>(
303303
304304 let current_job_id = current_query_job ( ) ;
305305
306- match state_lock. entry ( key_hash, equivalent_key ( & key) , |( k, _) | sharded:: make_hash ( k) ) {
306+ match state_lock. entry ( key_hash, equivalent_key ( key) , |( k, _) | sharded:: make_hash ( k) ) {
307307 Entry :: Vacant ( entry) => {
308308 // Nothing has computed or is computing the query, so we start a new job and insert it in the
309309 // state map.
@@ -459,7 +459,7 @@ fn execute_job_incr<'tcx, C: QueryCache>(
459459 tcx,
460460 dep_graph_data,
461461 query,
462- & key,
462+ key,
463463 dep_node,
464464 prev_index,
465465 dep_node_index,
@@ -507,7 +507,7 @@ fn load_from_disk_or_invoke_provider_green<'tcx, C: QueryCache>(
507507 tcx : TyCtxt < ' tcx > ,
508508 dep_graph_data : & DepGraphData ,
509509 query : & ' tcx QueryVTable < ' tcx , C > ,
510- key : & C :: Key ,
510+ key : C :: Key ,
511511 dep_node : & DepNode ,
512512 prev_index : SerializedDepNodeIndex ,
513513 dep_node_index : DepNodeIndex ,
@@ -570,7 +570,7 @@ fn load_from_disk_or_invoke_provider_green<'tcx, C: QueryCache>(
570570
571571 // The dep-graph for this computation is already in-place.
572572 // Call the query provider.
573- let value = tcx. dep_graph . with_ignore ( || ( query. invoke_provider_fn ) ( tcx, * key) ) ;
573+ let value = tcx. dep_graph . with_ignore ( || ( query. invoke_provider_fn ) ( tcx, key) ) ;
574574
575575 prof_timer. finish_with_query_invocation_id ( dep_node_index. into ( ) ) ;
576576
@@ -615,7 +615,7 @@ struct EnsureCanSkip {
615615fn check_if_ensure_can_skip_execution < ' tcx , C : QueryCache > (
616616 query : & ' tcx QueryVTable < ' tcx , C > ,
617617 tcx : TyCtxt < ' tcx > ,
618- key : & C :: Key ,
618+ key : C :: Key ,
619619 ensure_mode : EnsureMode ,
620620) -> EnsureCanSkip {
621621 // Queries with `eval_always` should never skip execution.
@@ -626,7 +626,7 @@ fn check_if_ensure_can_skip_execution<'tcx, C: QueryCache>(
626626 // Ensuring an anonymous query makes no sense
627627 assert ! ( !query. anon) ;
628628
629- let dep_node = DepNode :: construct ( tcx, query. dep_kind , key) ;
629+ let dep_node = DepNode :: construct ( tcx, query. dep_kind , & key) ;
630630
631631 let dep_graph = & tcx. dep_graph ;
632632 let serialized_dep_node_index = match dep_graph. try_mark_green ( tcx, & dep_node) {
@@ -695,7 +695,7 @@ pub(super) fn execute_query_incr_inner<'tcx, C: QueryCache>(
695695 let dep_node: Option < DepNode > = match mode {
696696 QueryMode :: Ensure { ensure_mode } => {
697697 let EnsureCanSkip { skip_execution, dep_node } =
698- check_if_ensure_can_skip_execution ( query, tcx, & key, ensure_mode) ;
698+ check_if_ensure_can_skip_execution ( query, tcx, key, ensure_mode) ;
699699 if skip_execution {
700700 // Return early to skip execution.
701701 return None ;
0 commit comments