Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5a75c07

Browse files
committed
Do not depend on FOREVER_RED_NODE.
1 parent a080653 commit 5a75c07

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

‎compiler/rustc_middle/src/ty/context.rs‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -954,9 +954,8 @@ impl<'tcx> TyCtxtAt<'tcx> {
954954

955955
impl<'tcx> TyCtxt<'tcx> {
956956
pub fn iter_local_def_id(self) -> impl Iterator<Item = LocalDefId> + 'tcx {
957-
// Create a dependency to the red node to be sure we re-execute this when the amount of
958-
// definitions change.
959-
self.dep_graph.read_index(DepNodeIndex::FOREVER_RED_NODE);
957+
// Depend on the `analysis` query to ensure compilation if finished.
958+
self.ensure().analysis(());
960959

961960
let definitions = &self.untracked.definitions;
962961
std::iter::from_generator(|| {
@@ -976,9 +975,8 @@ impl<'tcx> TyCtxt<'tcx> {
976975
}
977976

978977
pub fn def_path_table(self) -> &'tcx rustc_hir::definitions::DefPathTable {
979-
// Create a dependency to the crate to be sure we re-execute this when the amount of
980-
// definitions change.
981-
self.dep_graph.read_index(DepNodeIndex::FOREVER_RED_NODE);
978+
// Depend on the `analysis` query to ensure compilation if finished.
979+
self.ensure().analysis(());
982980

983981
// Freeze definitions once we start iterating on them, to prevent adding new ones
984982
// while iterating. If some query needs to add definitions, it should be `ensure`d above.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /