diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-03-29 17:11:12 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-03-29 18:50:52 +0200 |
| commit | 21a554caf680b74ee6270d3a61b0336b643c5456 (patch) | |
| tree | e292c7ada14407a4008626d27304c3f7b244e6c9 /src/librustdoc/clean | |
| parent | 11909e3588319235e28e99294e17cca11db1d7e2 (diff) | |
| download | rust-21a554caf680b74ee6270d3a61b0336b643c5456.tar.gz rust-21a554caf680b74ee6270d3a61b0336b643c5456.zip | |
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.
Diffstat (limited to 'src/librustdoc/clean')
| -rw-r--r-- | src/librustdoc/clean/inline.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/clean/utils.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index b681df3a99a..8c19cf973fc 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -100,7 +100,7 @@ crate fn try_inline( record_extern_fqn(cx, did, ItemType::Module); clean::ModuleItem(build_module(cx, did, visited)) } - Res::Def(DefKind::Static, did) => { + Res::Def(DefKind::Static(_), did) => { record_extern_fqn(cx, did, ItemType::Static); clean::StaticItem(build_static(cx, did, cx.tcx.is_mutable_static(did))) } diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs index 656f28bfd28..c94824f5c64 100644 --- a/src/librustdoc/clean/utils.rs +++ b/src/librustdoc/clean/utils.rs @@ -397,7 +397,7 @@ crate fn register_res(cx: &mut DocContext<'_>, res: Res) -> DefId { // These should be added to the cache using `record_extern_fqn`. Res::Def( kind @ (AssocTy | AssocFn | AssocConst | Variant | Fn | TyAlias | Enum | Trait | Struct - | Union | Mod | ForeignTy | Const | Static | Macro(..) | TraitAlias), + | Union | Mod | ForeignTy | Const | Static(_) | Macro(..) | TraitAlias), i, ) => (i, kind.into()), // This is part of a trait definition or trait impl; document the trait. |
