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> {
2081
2081
}
2082
2082
2083
2083
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 ( ( ) ) ;
2087
2086
2088
2087
let definitions = & self . untracked . definitions ;
2089
2088
gen {
@@ -2103,9 +2102,8 @@ impl<'tcx> TyCtxt<'tcx> {
2103
2102
}
2104
2103
2105
2104
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 ( ( ) ) ;
2109
2107
2110
2108
// Freeze definitions once we start iterating on them, to prevent adding new ones
2111
2109
// 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