Skip to content

Commit 2e900ed

Browse files
committed
Make sure tcx.create_def also depends on the forever red node, instead of just tcx.at(span).create_def
1 parent 81b757c commit 2e900ed

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

compiler/rustc_middle/src/ty/context.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1046,12 +1046,6 @@ impl<'tcx> TyCtxtAt<'tcx> {
10461046
name: Symbol,
10471047
def_kind: DefKind,
10481048
) -> TyCtxtFeed<'tcx, LocalDefId> {
1049-
// This function modifies `self.definitions` using a side-effect.
1050-
// We need to ensure that these side effects are re-run by the incr. comp. engine.
1051-
// Depending on the forever-red node will tell the graph that the calling query
1052-
// needs to be re-evaluated.
1053-
self.dep_graph.read_index(DepNodeIndex::FOREVER_RED_NODE);
1054-
10551049
// The following call has the side effect of modifying the tables inside `definitions`.
10561050
// These very tables are relied on by the incr. comp. engine to decode DepNodes and to
10571051
// decode the on-disk cache.
@@ -1080,6 +1074,12 @@ impl<'tcx> TyCtxt<'tcx> {
10801074
let data = def_kind.def_path_data(name);
10811075
let def_id = self.untracked.definitions.write().create_def(parent, data);
10821076

1077+
// This function modifies `self.definitions` using a side-effect.
1078+
// We need to ensure that these side effects are re-run by the incr. comp. engine.
1079+
// Depending on the forever-red node will tell the graph that the calling query
1080+
// needs to be re-evaluated.
1081+
self.dep_graph.read_index(DepNodeIndex::FOREVER_RED_NODE);
1082+
10831083
let feed = self.feed_local_def_id(def_id);
10841084
feed.def_kind(def_kind);
10851085
// Unique types created for closures participate in type privacy checking.

0 commit comments

Comments
 (0)