File tree 1 file changed +4
-6
lines changed
compiler/rustc_middle/src/ty
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -1862,9 +1862,8 @@ impl<'tcx> TyCtxt<'tcx> {
1862
1862
}
1863
1863
1864
1864
pub fn iter_local_def_id ( self ) -> impl Iterator < Item = LocalDefId > + ' tcx {
1865
- // Create a dependency to the red node to be sure we re-execute this when the amount of
1866
- // definitions change.
1867
- self . dep_graph . read_index ( DepNodeIndex :: FOREVER_RED_NODE ) ;
1865
+ // Depend on the `analysis` query to ensure compilation if finished.
1866
+ self . ensure ( ) . analysis ( ( ) ) ;
1868
1867
1869
1868
let definitions = & self . untracked . definitions ;
1870
1869
std:: iter:: from_coroutine (
@@ -1887,9 +1886,8 @@ impl<'tcx> TyCtxt<'tcx> {
1887
1886
}
1888
1887
1889
1888
pub fn def_path_table ( self ) -> & ' tcx rustc_hir:: definitions:: DefPathTable {
1890
- // Create a dependency to the crate to be sure we re-execute this when the amount of
1891
- // definitions change.
1892
- self . dep_graph . read_index ( DepNodeIndex :: FOREVER_RED_NODE ) ;
1889
+ // Depend on the `analysis` query to ensure compilation if finished.
1890
+ self . ensure ( ) . analysis ( ( ) ) ;
1893
1891
1894
1892
// Freeze definitions once we start iterating on them, to prevent adding new ones
1895
1893
// 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