diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2018-03-22 11:47:59 +0100 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2018-04-06 10:35:23 +0200 |
| commit | e31dae4741bc1eaaceeef0fd96dd0135d36598e0 (patch) | |
| tree | 3b990e9f2c91a145e6361fe55be1ed6b10e2dbf8 | |
| parent | abfc8c267c155443491dafc09f94aa956c0c3830 (diff) | |
| download | rust-e31dae4741bc1eaaceeef0fd96dd0135d36598e0.tar.gz rust-e31dae4741bc1eaaceeef0fd96dd0135d36598e0.zip | |
Improve assertion in Query::force().
| -rw-r--r-- | src/librustc/ty/maps/plumbing.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/librustc/ty/maps/plumbing.rs b/src/librustc/ty/maps/plumbing.rs index bc5a14c96f0..21ffb47029c 100644 --- a/src/librustc/ty/maps/plumbing.rs +++ b/src/librustc/ty/maps/plumbing.rs @@ -636,7 +636,16 @@ macro_rules! define_maps { map: LockGuard<'_, QueryMap<$tcx, Self>>, dep_node: DepNode) -> Result<($V, DepNodeIndex), CycleError<$tcx>> { - debug_assert!(!tcx.dep_graph.dep_node_exists(&dep_node)); + // If the following assertion triggers, it can have two reasons: + // 1. Something is wrong with DepNode creation, either here or + // in DepGraph::try_mark_green() + // 2. Two distinct query keys get mapped to the same DepNode + // (see for example #48923) + assert!(!tcx.dep_graph.dep_node_exists(&dep_node), + "Forcing query with already existing DepNode.\n\ + - query-key: {:?}\n\ + - dep-node: {:?}", + key, dep_node); profq_msg!(tcx, ProfileQueriesMsg::ProviderBegin); let res = Self::start_job(tcx, |
