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 @@ -2082,9 +2082,8 @@ impl<'tcx> TyCtxt<'tcx> {
2082
2082
}
2083
2083
2084
2084
pub fn iter_local_def_id ( self ) -> impl Iterator < Item = LocalDefId > {
2085
- // Create a dependency to the red node to be sure we re-execute this when the amount of
2086
- // definitions change.
2087
- self . dep_graph . read_index ( DepNodeIndex :: FOREVER_RED_NODE ) ;
2085
+ // Depend on the `analysis` query to ensure compilation if finished.
2086
+ self . ensure_ok ( ) . analysis ( ( ) ) ;
2088
2087
2089
2088
let definitions = & self . untracked . definitions ;
2090
2089
gen {
@@ -2104,9 +2103,8 @@ impl<'tcx> TyCtxt<'tcx> {
2104
2103
}
2105
2104
2106
2105
pub fn def_path_table ( self ) -> & ' tcx rustc_hir:: definitions:: DefPathTable {
2107
- // Create a dependency to the crate to be sure we re-execute this when the amount of
2108
- // definitions change.
2109
- self . dep_graph . read_index ( DepNodeIndex :: FOREVER_RED_NODE ) ;
2106
+ // Depend on the `analysis` query to ensure compilation if finished.
2107
+ self . ensure_ok ( ) . analysis ( ( ) ) ;
2110
2108
2111
2109
// Freeze definitions once we start iterating on them, to prevent adding new ones
2112
2110
// 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