Skip to content

Commit 31330bf

Browse files
committed
Use variable.
1 parent eeb3c8f commit 31330bf

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

compiler/rustc_query_system/src/query/plumbing.rs

+5-12
Original file line numberDiff line numberDiff line change
@@ -491,13 +491,7 @@ where
491491
// `to_dep_node` is expensive for some `DepKind`s.
492492
let dep_node = dep_node_opt.unwrap_or_else(|| query.to_dep_node(*tcx.dep_context(), &key));
493493

494-
tcx.dep_context().dep_graph().with_task(
495-
dep_node,
496-
*tcx.dep_context(),
497-
key,
498-
compute,
499-
query.hash_result,
500-
)
494+
dep_graph.with_task(dep_node, *tcx.dep_context(), key, compute, query.hash_result)
501495
});
502496

503497
prof_timer.finish_with_query_invocation_id(dep_node_index.into());
@@ -531,10 +525,10 @@ where
531525
// Note this function can be called concurrently from the same query
532526
// We must ensure that this is handled correctly.
533527

534-
let (prev_dep_node_index, dep_node_index) =
535-
tcx.dep_context().dep_graph().try_mark_green(tcx, &dep_node)?;
528+
let dep_graph = tcx.dep_context().dep_graph();
529+
let (prev_dep_node_index, dep_node_index) = dep_graph.try_mark_green(tcx, &dep_node)?;
536530

537-
debug_assert!(tcx.dep_context().dep_graph().is_green(dep_node));
531+
debug_assert!(dep_graph.is_green(dep_node));
538532

539533
// First we try to load the result from the on-disk cache.
540534
// Some things are never cached on disk.
@@ -567,8 +561,7 @@ where
567561
let prof_timer = tcx.dep_context().profiler().query_provider();
568562

569563
// The dep-graph for this computation is already in-place.
570-
let result =
571-
tcx.dep_context().dep_graph().with_ignore(|| compute(*tcx.dep_context(), key.clone()));
564+
let result = dep_graph.with_ignore(|| compute(*tcx.dep_context(), key.clone()));
572565

573566
prof_timer.finish_with_query_invocation_id(dep_node_index.into());
574567

0 commit comments

Comments
 (0)