incr.comp.: Assert that no DepNode is re-opened (see issue #42298).
This commit is contained in:
parent
6e8452ee4f
commit
6bb0693fde
3 changed files with 16 additions and 1 deletions
|
@ -394,6 +394,7 @@ define_dep_nodes!( <'tcx>
|
||||||
// Represents different phases in the compiler.
|
// Represents different phases in the compiler.
|
||||||
[] RegionMaps(DefId),
|
[] RegionMaps(DefId),
|
||||||
[] Coherence,
|
[] Coherence,
|
||||||
|
[] CoherenceInherentImplOverlapCheck,
|
||||||
[] Resolve,
|
[] Resolve,
|
||||||
[] CoherenceCheckTrait(DefId),
|
[] CoherenceCheckTrait(DefId),
|
||||||
[] PrivacyAccessLevels(CrateNum),
|
[] PrivacyAccessLevels(CrateNum),
|
||||||
|
|
|
@ -23,6 +23,11 @@ pub struct DepGraphEdges {
|
||||||
edges: FxHashSet<(DepNodeIndex, DepNodeIndex)>,
|
edges: FxHashSet<(DepNodeIndex, DepNodeIndex)>,
|
||||||
task_stack: Vec<OpenTask>,
|
task_stack: Vec<OpenTask>,
|
||||||
forbidden_edge: Option<EdgeFilter>,
|
forbidden_edge: Option<EdgeFilter>,
|
||||||
|
|
||||||
|
// A set to help assert that no two tasks use the same DepNode. This is a
|
||||||
|
// temporary measure. Once we load the previous dep-graph as readonly, this
|
||||||
|
// check will fall out of the graph implementation naturally.
|
||||||
|
opened_once: FxHashSet<DepNode>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
||||||
|
@ -80,6 +85,7 @@ impl DepGraphEdges {
|
||||||
edges: FxHashSet(),
|
edges: FxHashSet(),
|
||||||
task_stack: Vec::new(),
|
task_stack: Vec::new(),
|
||||||
forbidden_edge,
|
forbidden_edge,
|
||||||
|
opened_once: FxHashSet(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,6 +103,10 @@ impl DepGraphEdges {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn push_task(&mut self, key: DepNode) {
|
pub fn push_task(&mut self, key: DepNode) {
|
||||||
|
if !self.opened_once.insert(key) {
|
||||||
|
bug!("Re-opened node {:?}", key)
|
||||||
|
}
|
||||||
|
|
||||||
self.task_stack.push(OpenTask::Regular {
|
self.task_stack.push(OpenTask::Regular {
|
||||||
node: key,
|
node: key,
|
||||||
reads: Vec::new(),
|
reads: Vec::new(),
|
||||||
|
|
|
@ -931,7 +931,7 @@ define_maps! { <'tcx>
|
||||||
/// Checks all types in the krate for overlap in their inherent impls. Reports errors.
|
/// Checks all types in the krate for overlap in their inherent impls. Reports errors.
|
||||||
/// Not meant to be used directly outside of coherence.
|
/// Not meant to be used directly outside of coherence.
|
||||||
/// (Defined only for LOCAL_CRATE)
|
/// (Defined only for LOCAL_CRATE)
|
||||||
[] crate_inherent_impls_overlap_check: crate_inherent_impls_dep_node(CrateNum) -> (),
|
[] crate_inherent_impls_overlap_check: inherent_impls_overlap_check_dep_node(CrateNum) -> (),
|
||||||
|
|
||||||
/// Results of evaluating const items or constants embedded in
|
/// Results of evaluating const items or constants embedded in
|
||||||
/// other items (such as enum variant explicit discriminants).
|
/// other items (such as enum variant explicit discriminants).
|
||||||
|
@ -1014,6 +1014,10 @@ fn crate_inherent_impls_dep_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
||||||
DepConstructor::Coherence
|
DepConstructor::Coherence
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn inherent_impls_overlap_check_dep_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
||||||
|
DepConstructor::CoherenceInherentImplOverlapCheck
|
||||||
|
}
|
||||||
|
|
||||||
fn reachability_dep_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
fn reachability_dep_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
||||||
DepConstructor::Reachability
|
DepConstructor::Reachability
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue