@@ -495,7 +495,7 @@ where
495
495
// promoted to the current session during
496
496
// `try_mark_green()`, so we can ignore them here.
497
497
let loaded = tcx. start_query ( job. id , None , || {
498
- try_load_from_disk_and_cache_in_memory ( tcx, key. clone ( ) , & dep_node, query, compute)
498
+ try_load_from_disk_and_cache_in_memory ( tcx, & key, & dep_node, query, compute)
499
499
} ) ;
500
500
if let Some ( ( result, dep_node_index) ) = loaded {
501
501
return job. complete ( result, dep_node_index) ;
@@ -509,12 +509,13 @@ where
509
509
510
510
fn try_load_from_disk_and_cache_in_memory < CTX , K , V > (
511
511
tcx : CTX ,
512
- key : K ,
512
+ key : & K ,
513
513
dep_node : & DepNode < CTX :: DepKind > ,
514
514
query : & QueryVtable < CTX , K , V > ,
515
515
compute : fn ( CTX :: DepContext , K ) -> V ,
516
516
) -> Option < ( V , DepNodeIndex ) >
517
517
where
518
+ K : Clone ,
518
519
CTX : QueryContext ,
519
520
V : Debug ,
520
521
{
@@ -527,7 +528,7 @@ where
527
528
debug_assert ! ( tcx. dep_context( ) . dep_graph( ) . is_green( dep_node) ) ;
528
529
529
530
// First we try to load the result from the on-disk cache.
530
- let result = if query. cache_on_disk ( tcx, & key, None ) {
531
+ let result = if query. cache_on_disk ( tcx, key, None ) {
531
532
let prof_timer = tcx. dep_context ( ) . profiler ( ) . incr_cache_loading ( ) ;
532
533
let result = query. try_load_from_disk ( tcx, prev_dep_node_index) ;
533
534
prof_timer. finish_with_query_invocation_id ( dep_node_index. into ( ) ) ;
@@ -559,7 +560,8 @@ where
559
560
let prof_timer = tcx. dep_context ( ) . profiler ( ) . query_provider ( ) ;
560
561
561
562
// The dep-graph for this computation is already in-place.
562
- let result = tcx. dep_context ( ) . dep_graph ( ) . with_ignore ( || compute ( * tcx. dep_context ( ) , key) ) ;
563
+ let result =
564
+ tcx. dep_context ( ) . dep_graph ( ) . with_ignore ( || compute ( * tcx. dep_context ( ) , key. clone ( ) ) ) ;
563
565
564
566
prof_timer. finish_with_query_invocation_id ( dep_node_index. into ( ) ) ;
565
567
0 commit comments