Remember mutability in DefKind::Static.

This allows to compute the `BodyOwnerKind` from `DefKind` only, and
removes a direct dependency of some MIR queries onto HIR.

As a side effect, it also simplifies metadata, since we don't need 4
flavours of `EntryKind::*Static` any more.
This commit is contained in:
Camille GILLOT
2022-03-29 17:11:12 +02:00
parent 11909e3588
commit 21a554caf6
40 changed files with 98 additions and 128 deletions

View File

@@ -300,7 +300,7 @@ impl<'a> PathSource<'a> {
Res::Def(
DefKind::Ctor(_, CtorKind::Const | CtorKind::Fn)
| DefKind::Const
| DefKind::Static
| DefKind::Static(_)
| DefKind::Fn
| DefKind::AssocFn
| DefKind::AssocConst
@@ -1830,7 +1830,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
}
Some(res)
}
Res::Def(DefKind::Ctor(..) | DefKind::Const | DefKind::Static, _) => {
Res::Def(DefKind::Ctor(..) | DefKind::Const | DefKind::Static(_), _) => {
// This is unambiguously a fresh binding, either syntactically
// (e.g., `IDENT @ PAT` or `ref IDENT`) or because `IDENT` resolves
// to something unusable as a pattern (e.g., constructor function),