Skip to content

Commit a0dc0b5

Browse files
committed
Do not depend on FOREVER_RED_NODE.
1 parent 706f244 commit a0dc0b5

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

compiler/rustc_middle/src/ty/context.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,9 +2082,8 @@ impl<'tcx> TyCtxt<'tcx> {
20822082
}
20832083

20842084
pub fn iter_local_def_id(self) -> impl Iterator<Item = LocalDefId> {
2085-
// Create a dependency to the red node to be sure we re-execute this when the amount of
2086-
// definitions change.
2087-
self.dep_graph.read_index(DepNodeIndex::FOREVER_RED_NODE);
2085+
// Depend on the `analysis` query to ensure compilation if finished.
2086+
self.ensure_ok().analysis(());
20882087

20892088
let definitions = &self.untracked.definitions;
20902089
gen {
@@ -2104,9 +2103,8 @@ impl<'tcx> TyCtxt<'tcx> {
21042103
}
21052104

21062105
pub fn def_path_table(self) -> &'tcx rustc_hir::definitions::DefPathTable {
2107-
// Create a dependency to the crate to be sure we re-execute this when the amount of
2108-
// definitions change.
2109-
self.dep_graph.read_index(DepNodeIndex::FOREVER_RED_NODE);
2106+
// Depend on the `analysis` query to ensure compilation if finished.
2107+
self.ensure_ok().analysis(());
21102108

21112109
// Freeze definitions once we start iterating on them, to prevent adding new ones
21122110
// while iterating. If some query needs to add definitions, it should be `ensure`d above.

0 commit comments

Comments
 (0)