|
2 | 2 | //! generate the actual methods on tcx which find and execute the provider, |
3 | 3 | //! manage the caches, and so forth. |
4 | 4 |
|
5 | | -use crate::dep_graph::{ |
6 | | - DepContext, DepGraph, DepKind, DepNode, DepNodeIndex, DepNodeParams, TaskDepsRef, |
7 | | -}; |
| 5 | +use crate::dep_graph::{DepContext, DepKind, DepNode, DepNodeIndex, DepNodeParams}; |
8 | 6 | use crate::dep_graph::{DepGraphData, HasDepContext}; |
9 | 7 | use crate::ich::StableHashingContext; |
10 | 8 | use crate::query::caches::QueryCache; |
@@ -430,13 +428,12 @@ where |
430 | 428 |
|
431 | 429 | // Similarly, fingerprint the result to assert that |
432 | 430 | // it doesn't have anything not considered hashable. |
433 | | - if cfg!(debug_assertions) |
434 | | - && let Some(hash_result) = query.hash_result() |
435 | | - { |
436 | | - qcx.dep_context().with_stable_hashing_context(|mut hcx| { |
437 | | - hash_result(&mut hcx, &result); |
438 | | - }); |
439 | | - } |
| 431 | + if cfg!(debug_assertions) && let Some(hash_result) = query.hash_result() |
| 432 | + { |
| 433 | + qcx.dep_context().with_stable_hashing_context(|mut hcx| { |
| 434 | + hash_result(&mut hcx, &result); |
| 435 | + }); |
| 436 | + } |
440 | 437 |
|
441 | 438 | return (result, dep_node_index); |
442 | 439 | } |
@@ -524,9 +521,10 @@ where |
524 | 521 | // The call to `with_query_deserialization` enforces that no new `DepNodes` |
525 | 522 | // are created during deserialization. See the docs of that method for more |
526 | 523 | // details. |
527 | | - let result = DepGraph::<Qcx::DepKind>::with_query_deserialization(|| { |
528 | | - try_load_from_disk(qcx, prev_dep_node_index) |
529 | | - }); |
| 524 | + let result = qcx |
| 525 | + .dep_context() |
| 526 | + .dep_graph() |
| 527 | + .with_query_deserialization(|| try_load_from_disk(qcx, prev_dep_node_index)); |
530 | 528 |
|
531 | 529 | prof_timer.finish_with_query_invocation_id(dep_node_index.into()); |
532 | 530 |
|
@@ -575,7 +573,7 @@ where |
575 | 573 | let prof_timer = qcx.dep_context().profiler().query_provider(); |
576 | 574 |
|
577 | 575 | // The dep-graph for this computation is already in-place. |
578 | | - let result = Qcx::DepKind::with_deps(TaskDepsRef::Ignore, || query.compute(qcx, *key)); |
| 576 | + let result = qcx.dep_context().dep_graph().with_ignore(|| query.compute(qcx, *key)); |
579 | 577 |
|
580 | 578 | prof_timer.finish_with_query_invocation_id(dep_node_index.into()); |
581 | 579 |
|
|
0 commit comments