Skip to content

Commit 0f1f693

Browse files
committed
Do not depend on FOREVER_RED_NODE.
1 parent 1b41853 commit 0f1f693

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
@@ -1862,9 +1862,8 @@ impl<'tcx> TyCtxt<'tcx> {
18621862
}
18631863

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

18691868
let definitions = &self.untracked.definitions;
18701869
std::iter::from_coroutine(
@@ -1887,9 +1886,8 @@ impl<'tcx> TyCtxt<'tcx> {
18871886
}
18881887

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

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

0 commit comments

Comments
 (0)