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 @@ -1822,9 +1822,8 @@ impl<'tcx> TyCtxt<'tcx> {
1822
1822
}
1823
1823
1824
1824
pub fn iter_local_def_id ( self ) -> impl Iterator < Item = LocalDefId > + ' tcx {
1825
- // Create a dependency to the red node to be sure we re-execute this when the amount of
1826
- // definitions change.
1827
- self . dep_graph . read_index ( DepNodeIndex :: FOREVER_RED_NODE ) ;
1825
+ // Depend on the `analysis` query to ensure compilation if finished.
1826
+ self . ensure ( ) . analysis ( ( ) ) ;
1828
1827
1829
1828
let definitions = & self . untracked . definitions ;
1830
1829
std:: iter:: from_coroutine (
@@ -1847,9 +1846,8 @@ impl<'tcx> TyCtxt<'tcx> {
1847
1846
}
1848
1847
1849
1848
pub fn def_path_table ( self ) -> & ' tcx rustc_hir:: definitions:: DefPathTable {
1850
- // Create a dependency to the crate to be sure we re-execute this when the amount of
1851
- // definitions change.
1852
- self . dep_graph . read_index ( DepNodeIndex :: FOREVER_RED_NODE ) ;
1849
+ // Depend on the `analysis` query to ensure compilation if finished.
1850
+ self . ensure ( ) . analysis ( ( ) ) ;
1853
1851
1854
1852
// Freeze definitions once we start iterating on them, to prevent adding new ones
1855
1853
// 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