Skip to content

Commit 761cedd

Browse files
committed
Do not depend on FOREVER_RED_NODE.
1 parent c6b3bee commit 761cedd

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

compiler/rustc_middle/src/ty/context.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -1832,9 +1832,8 @@ impl<'tcx> TyCtxt<'tcx> {
18321832
}
18331833

18341834
pub fn iter_local_def_id(self) -> impl Iterator<Item = LocalDefId> + 'tcx {
1835-
// Create a dependency to the red node to be sure we re-execute this when the amount of
1836-
// definitions change.
1837-
self.dep_graph.read_index(DepNodeIndex::FOREVER_RED_NODE);
1835+
// Depend on the `analysis` query to ensure compilation if finished.
1836+
self.ensure().analysis(());
18381837

18391838
let definitions = &self.untracked.definitions;
18401839
std::iter::from_coroutine(
@@ -1857,9 +1856,8 @@ impl<'tcx> TyCtxt<'tcx> {
18571856
}
18581857

18591858
pub fn def_path_table(self) -> &'tcx rustc_hir::definitions::DefPathTable {
1860-
// Create a dependency to the crate to be sure we re-execute this when the amount of
1861-
// definitions change.
1862-
self.dep_graph.read_index(DepNodeIndex::FOREVER_RED_NODE);
1859+
// Depend on the `analysis` query to ensure compilation if finished.
1860+
self.ensure().analysis(());
18631861

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

0 commit comments

Comments
 (0)