Skip to content

Commit

Permalink
Remove box syntax for Box<ImplItem> construction
Browse files Browse the repository at this point in the history
ImplItem only has 80 bytes according to compiler internal rustdoc.
  • Loading branch information
est31 committed Jul 11, 2022
1 parent ccf1bdb commit 88d72a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/librustdoc/clean/auto_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
attrs: Default::default(),
visibility: Inherited,
item_id: ItemId::Auto { trait_: trait_def_id, for_: item_def_id },
kind: box ImplItem(Impl {
kind: Box::new(ImplItem(Impl {
unsafety: hir::Unsafety::Normal,
generics: new_generics,
trait_: Some(trait_ref.clean(self.cx)),
for_: ty.clean(self.cx),
items: Vec::new(),
polarity,
kind: ImplKind::Auto,
}),
})),
cfg: None,
})
}
Expand Down
6 changes: 3 additions & 3 deletions src/librustdoc/clean/blanket_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
attrs: Default::default(),
visibility: Inherited,
item_id: ItemId::Blanket { impl_id: impl_def_id, for_: item_def_id },
kind: box ImplItem(Impl {
kind: Box::new(ImplItem(Impl {
unsafety: hir::Unsafety::Normal,
generics: clean_ty_generics(
cx,
Expand All @@ -123,8 +123,8 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
.map(|x| x.clean(cx))
.collect::<Vec<_>>(),
polarity: ty::ImplPolarity::Positive,
kind: ImplKind::Blanket(box trait_ref.0.self_ty().clean(cx)),
}),
kind: ImplKind::Blanket(Box::new(trait_ref.0.self_ty().clean(cx))),
})),
cfg: None,
});
}
Expand Down

0 comments on commit 88d72a9

Please sign in to comment.