Skip to content

Commit 168855e

Browse files
committed
Do not depend on FOREVER_RED_NODE.
1 parent 6268d0a commit 168855e

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
@@ -2058,9 +2058,8 @@ impl<'tcx> TyCtxt<'tcx> {
20582058
}
20592059

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

20652064
let definitions = &self.untracked.definitions;
20662065
gen {
@@ -2080,9 +2079,8 @@ impl<'tcx> TyCtxt<'tcx> {
20802079
}
20812080

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

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

0 commit comments

Comments
 (0)