Skip to content

Commit 5f13bb1

Browse files
committed
Do not depend on FOREVER_RED_NODE.
1 parent 89ae686 commit 5f13bb1

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
@@ -947,9 +947,8 @@ impl<'tcx> TyCtxtAt<'tcx> {
947947

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

954953
let definitions = &self.untracked.definitions;
955954
std::iter::from_generator(|| {
@@ -969,9 +968,8 @@ impl<'tcx> TyCtxt<'tcx> {
969968
}
970969

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

976974
// Leak a read lock once we start iterating on definitions, to prevent adding new ones
977975
// while iterating. If some query needs to add definitions, it should be `ensure`d above.

0 commit comments

Comments
 (0)