Rollup merge of #121084 - oli-obk:create_def_forever_red2, r=WaffleLapkin

Make sure `tcx.create_def` also depends on the forever red node, instead of just `tcx.at(span).create_def`

oversight from https://github.com/rust-lang/rust/pull/119136

Not actually an issue, because all uses of `tcx.create_def` were in the resolver, which is `eval_always`, but still good to harden against future uses of `create_def`

cc `@petrochenkov` `@WaffleLapkin`
This commit is contained in:
Matthias Krüger 2024-02-15 09:20:20 +01:00 committed by GitHub
commit f62d981a18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 14 deletions

View file

@ -1245,7 +1245,7 @@ impl<'tcx> Resolver<'_, 'tcx> {
);
// FIXME: remove `def_span` body, pass in the right spans here and call `tcx.at().create_def()`
let def_id = self.tcx.create_def(parent, name, def_kind);
let def_id = self.tcx.create_def(parent, name, def_kind).def_id();
// Create the definition.
if expn_id != ExpnId::root() {