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 @@ -2058,9 +2058,8 @@ impl<'tcx> TyCtxt<'tcx> {
20582058 }
20592059
20602060 pub fn iter_local_def_id ( self ) -> impl Iterator < Item = LocalDefId > {
2061- // Create a dependency to the red node to be sure we re-execute this when the amount of
2062- // definitions change.
2063- self . dep_graph . read_index ( DepNodeIndex :: FOREVER_RED_NODE ) ;
2061+ // Depend on the `analysis` query to ensure compilation if finished.
2062+ self . ensure_ok ( ) . analysis ( ( ) ) ;
20642063
20652064 let definitions = & self . untracked . definitions ;
20662065 gen {
@@ -2080,9 +2079,8 @@ impl<'tcx> TyCtxt<'tcx> {
20802079 }
20812080
20822081 pub fn def_path_table ( self ) -> & ' tcx rustc_hir:: definitions:: DefPathTable {
2083- // Create a dependency to the crate to be sure we re-execute this when the amount of
2084- // definitions change.
2085- self . dep_graph . read_index ( DepNodeIndex :: FOREVER_RED_NODE ) ;
2082+ // Depend on the `analysis` query to ensure compilation if finished.
2083+ self . ensure_ok ( ) . analysis ( ( ) ) ;
20862084
20872085 // Freeze definitions once we start iterating on them, to prevent adding new ones
20882086 // 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