diff options
| author | Michael Howell <michael@notriddle.com> | 2024-08-30 10:52:45 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2024-09-07 21:06:50 -0700 |
| commit | 65903362ad810c572e8ae742f6ed5ae3548238e4 (patch) | |
| tree | a7658890f8165abdda135c92045ccdb77612a720 /src/librustdoc/clean/utils.rs | |
| parent | e80c9ac3e213c0c2e6d1a80ea2d4bf074ff8f887 (diff) | |
| download | rust-65903362ad810c572e8ae742f6ed5ae3548238e4.tar.gz rust-65903362ad810c572e8ae742f6ed5ae3548238e4.zip | |
rustdoc: use a single box to store Attributes and ItemKind
Diffstat (limited to 'src/librustdoc/clean/utils.rs')
| -rw-r--r-- | src/librustdoc/clean/utils.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs index 5686307d83d..885758c17cf 100644 --- a/src/librustdoc/clean/utils.rs +++ b/src/librustdoc/clean/utils.rs @@ -36,7 +36,7 @@ pub(crate) fn krate(cx: &mut DocContext<'_>) -> Crate { // understood by rustdoc. let mut module = clean_doc_module(&module, cx); - match *module.kind { + match module.kind { ItemKind::ModuleItem(ref module) => { for it in &module.items { // `compiler_builtins` should be masked too, but we can't apply @@ -60,7 +60,7 @@ pub(crate) fn krate(cx: &mut DocContext<'_>) -> Crate { let primitives = local_crate.primitives(cx.tcx); let keywords = local_crate.keywords(cx.tcx); { - let ItemKind::ModuleItem(ref mut m) = *module.kind else { unreachable!() }; + let ItemKind::ModuleItem(ref mut m) = &mut module.inner.kind else { unreachable!() }; m.items.extend(primitives.iter().map(|&(def_id, prim)| { Item::from_def_id_and_parts( def_id, @@ -281,7 +281,7 @@ pub(crate) fn build_deref_target_impls( let tcx = cx.tcx; for item in items { - let target = match *item.kind { + let target = match item.kind { ItemKind::AssocTypeItem(ref t, _) => &t.type_, _ => continue, }; |
