Skip to content

Commit e8221ef

Browse files
committed
Do not depend on FOREVER_RED_NODE.
1 parent 5b48feb commit e8221ef

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
@@ -2081,9 +2081,8 @@ impl<'tcx> TyCtxt<'tcx> {
20812081
}
20822082

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

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

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

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

0 commit comments

Comments
 (0)