Skip to content

Commit e75ed18

Browse files
committed
Do not depend on FOREVER_RED_NODE.
1 parent 0357489 commit e75ed18

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
@@ -1822,9 +1822,8 @@ impl<'tcx> TyCtxt<'tcx> {
18221822
}
18231823

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

18291828
let definitions = &self.untracked.definitions;
18301829
std::iter::from_coroutine(
@@ -1847,9 +1846,8 @@ impl<'tcx> TyCtxt<'tcx> {
18471846
}
18481847

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

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

0 commit comments

Comments
 (0)