File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -2081,9 +2081,8 @@ impl<'tcx> TyCtxt<'tcx> {
20812081 }
20822082
20832083 pub fn iter_local_def_id ( self ) -> impl Iterator < Item = LocalDefId > {
2084- // Create a dependency to the red node to be sure we re-execute this when the amount of
2085- // definitions change.
2086- self . dep_graph . read_index ( DepNodeIndex :: FOREVER_RED_NODE ) ;
2084+ // Depend on the `analysis` query to ensure compilation if finished.
2085+ self . ensure_ok ( ) . analysis ( ( ) ) ;
20872086
20882087 let definitions = & self . untracked . definitions ;
20892088 gen {
@@ -2103,9 +2102,8 @@ impl<'tcx> TyCtxt<'tcx> {
21032102 }
21042103
21052104 pub fn def_path_table ( self ) -> & ' tcx rustc_hir:: definitions:: DefPathTable {
2106- // Create a dependency to the crate to be sure we re-execute this when the amount of
2107- // definitions change.
2108- self . dep_graph . read_index ( DepNodeIndex :: FOREVER_RED_NODE ) ;
2105+ // Depend on the `analysis` query to ensure compilation if finished.
2106+ self . ensure_ok ( ) . analysis ( ( ) ) ;
21092107
21102108 // Freeze definitions once we start iterating on them, to prevent adding new ones
21112109 // while iterating. If some query needs to add definitions, it should be `ensure`d above.
You can’t perform that action at this time.
0 commit comments