]> git.lizzy.rs Git - rust.git/commitdiff
Remove box syntax from Box<rustdoc::clean::types::ItemKind> construction
authorest31 <MTest31@outlook.com>
Sun, 10 Jul 2022 22:08:55 +0000 (00:08 +0200)
committerest31 <MTest31@outlook.com>
Fri, 29 Jul 2022 17:30:23 +0000 (19:30 +0200)
The type has 240 bytes according to compiler internal rustdoc.

src/librustdoc/clean/inline.rs
src/librustdoc/clean/mod.rs
src/librustdoc/clean/types.rs
src/librustdoc/fold.rs

index 731d8766686c8be1ba70ecfe1a0da79afbab5bb5..d5dd040eceda4dcc96894ad8aed0adf4354e5f52 100644 (file)
@@ -538,7 +538,7 @@ fn build_module(
                     attrs: Box::new(clean::Attributes::default()),
                     item_id: ItemId::Primitive(prim_ty, did.krate),
                     visibility: clean::Public,
-                    kind: box clean::ImportItem(clean::Import::new_simple(
+                    kind: Box::new(clean::ImportItem(clean::Import::new_simple(
                         item.ident.name,
                         clean::ImportSource {
                             path: clean::Path {
@@ -554,7 +554,7 @@ fn build_module(
                             did: None,
                         },
                         true,
-                    )),
+                    ))),
                     cfg: None,
                 });
             } else if let Some(i) = try_inline(cx, did, None, res, item.ident.name, None, visited) {
index 624eec57e832488f1f13e079a1e0bd04da111e18..f4d66907b7ae265e1023085bc9d11a0f11b6f921 100644 (file)
@@ -2108,7 +2108,7 @@ fn clean_extern_crate<'tcx>(
         attrs: Box::new(attrs.clean(cx)),
         item_id: crate_def_id.into(),
         visibility: clean_visibility(ty_vis),
-        kind: box ExternCrateItem { src: orig_name },
+        kind: Box::new(ExternCrateItem { src: orig_name }),
         cfg: attrs.cfg(cx.tcx, &cx.cache.hidden_cfg),
     }]
 }
index a5d27a940341a2be5c85de2fcd67bcba09b0b65f..09438c40dc1d76d1396df48c5c7f89ed3a21a94a 100644 (file)
@@ -502,7 +502,7 @@ pub(crate) fn from_def_id_and_attrs_and_parts(
             clean_visibility(cx.tcx.visibility(def_id))
         };
 
-        Item { item_id: def_id.into(), kind: box kind, name, attrs, visibility, cfg }
+        Item { item_id: def_id.into(), kind: Box::new(kind), name, attrs, visibility, cfg }
     }
 
     /// Finds all `doc` attributes as NameValues and returns their corresponding values, joined
index c93897236db691f0e326052ac75837d25d285b18..6b7e67e2ce34269eca68fdf136a10016c10a4587 100644 (file)
@@ -2,7 +2,7 @@
 
 pub(crate) fn strip_item(mut item: Item) -> Item {
     if !matches!(*item.kind, StrippedItem(..)) {
-        item.kind = box StrippedItem(item.kind);
+        item.kind = Box::new(StrippedItem(item.kind));
     }
     item
 }
@@ -75,10 +75,10 @@ fn fold_inner_recur(&mut self, kind: ItemKind) -> ItemKind {
 
     /// don't override!
     fn fold_item_recur(&mut self, mut item: Item) -> Item {
-        item.kind = box match *item.kind {
-            StrippedItem(box i) => StrippedItem(box self.fold_inner_recur(i)),
+        item.kind = Box::new(match *item.kind {
+            StrippedItem(box i) => StrippedItem(Box::new(self.fold_inner_recur(i))),
             _ => self.fold_inner_recur(*item.kind),
-        };
+        });
         item
     }