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 @@ -1832,9 +1832,8 @@ impl<'tcx> TyCtxt<'tcx> {
1832
1832
}
1833
1833
1834
1834
pub fn iter_local_def_id ( self ) -> impl Iterator < Item = LocalDefId > + ' tcx {
1835
- // Create a dependency to the red node to be sure we re-execute this when the amount of
1836
- // definitions change.
1837
- self . dep_graph . read_index ( DepNodeIndex :: FOREVER_RED_NODE ) ;
1835
+ // Depend on the `analysis` query to ensure compilation if finished.
1836
+ self . ensure ( ) . analysis ( ( ) ) ;
1838
1837
1839
1838
let definitions = & self . untracked . definitions ;
1840
1839
std:: iter:: from_coroutine (
@@ -1857,9 +1856,8 @@ impl<'tcx> TyCtxt<'tcx> {
1857
1856
}
1858
1857
1859
1858
pub fn def_path_table ( self ) -> & ' tcx rustc_hir:: definitions:: DefPathTable {
1860
- // Create a dependency to the crate to be sure we re-execute this when the amount of
1861
- // definitions change.
1862
- self . dep_graph . read_index ( DepNodeIndex :: FOREVER_RED_NODE ) ;
1859
+ // Depend on the `analysis` query to ensure compilation if finished.
1860
+ self . ensure ( ) . analysis ( ( ) ) ;
1863
1861
1864
1862
// Freeze definitions once we start iterating on them, to prevent adding new ones
1865
1863
// 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