Skip to content

Commit e62f6a0

Browse files
committed
Remove box syntax from Box<rustdoc::clean::types::ItemKind> construction
The type has 240 bytes according to compiler internal rustdoc.
1 parent 9fa62f2 commit e62f6a0

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/librustdoc/clean/inline.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ fn build_module(
538538
attrs: Box::new(clean::Attributes::default()),
539539
item_id: ItemId::Primitive(prim_ty, did.krate),
540540
visibility: clean::Public,
541-
kind: box clean::ImportItem(clean::Import::new_simple(
541+
kind: Box::new(clean::ImportItem(clean::Import::new_simple(
542542
item.ident.name,
543543
clean::ImportSource {
544544
path: clean::Path {
@@ -554,7 +554,7 @@ fn build_module(
554554
did: None,
555555
},
556556
true,
557-
)),
557+
))),
558558
cfg: None,
559559
});
560560
} else if let Some(i) = try_inline(cx, did, None, res, item.ident.name, None, visited) {

src/librustdoc/clean/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2108,7 +2108,7 @@ fn clean_extern_crate<'tcx>(
21082108
attrs: Box::new(attrs.clean(cx)),
21092109
item_id: crate_def_id.into(),
21102110
visibility: clean_visibility(ty_vis),
2111-
kind: box ExternCrateItem { src: orig_name },
2111+
kind: Box::new(ExternCrateItem { src: orig_name }),
21122112
cfg: attrs.cfg(cx.tcx, &cx.cache.hidden_cfg),
21132113
}]
21142114
}

src/librustdoc/clean/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ impl Item {
502502
clean_visibility(cx.tcx.visibility(def_id))
503503
};
504504

505-
Item { item_id: def_id.into(), kind: box kind, name, attrs, visibility, cfg }
505+
Item { item_id: def_id.into(), kind: Box::new(kind), name, attrs, visibility, cfg }
506506
}
507507

508508
/// Finds all `doc` attributes as NameValues and returns their corresponding values, joined

src/librustdoc/fold.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::clean::*;
22

33
pub(crate) fn strip_item(mut item: Item) -> Item {
44
if !matches!(*item.kind, StrippedItem(..)) {
5-
item.kind = box StrippedItem(item.kind);
5+
item.kind = Box::new(StrippedItem(item.kind));
66
}
77
item
88
}
@@ -75,10 +75,10 @@ pub(crate) trait DocFolder: Sized {
7575

7676
/// don't override!
7777
fn fold_item_recur(&mut self, mut item: Item) -> Item {
78-
item.kind = box match *item.kind {
79-
StrippedItem(box i) => StrippedItem(box self.fold_inner_recur(i)),
78+
item.kind = Box::new(match *item.kind {
79+
StrippedItem(box i) => StrippedItem(Box::new(self.fold_inner_recur(i))),
8080
_ => self.fold_inner_recur(*item.kind),
81-
};
81+
});
8282
item
8383
}
8484

0 commit comments

Comments
 (0)