Skip to content

Commit

Permalink
Auto merge of #50175 - michaelwoerister:backport-e31dae4, r=alexcrichton
Browse files Browse the repository at this point in the history
[beta] Backport - Improve assertion in Query::force().

Follow up to #49695 (comment)

r? @alexcrichton
  • Loading branch information
bors committed Apr 23, 2018
2 parents 7d025f4 + eab568c commit d7c60a1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/librustc/ty/maps/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,16 @@ macro_rules! define_maps {
span: Span,
dep_node: DepNode)
-> Result<($V, DepNodeIndex), CycleError<'a, $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 = tcx.cycle_check(span, Query::$name(key), || {
Expand Down

0 comments on commit d7c60a1

Please sign in to comment.