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> {
2058
2058
}
2059
2059
2060
2060
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 ( ( ) ) ;
2064
2063
2065
2064
let definitions = & self . untracked . definitions ;
2066
2065
gen {
@@ -2080,9 +2079,8 @@ impl<'tcx> TyCtxt<'tcx> {
2080
2079
}
2081
2080
2082
2081
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 ( ( ) ) ;
2086
2084
2087
2085
// Freeze definitions once we start iterating on them, to prevent adding new ones
2088
2086
// 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