Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 24714b8

Browse files
committed
rustdoc: remove unneeded Box from ItemKind
1 parent 03968a8 commit 24714b8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ fn clean_trait_item<'tcx>(trait_item: &hir::TraitItem<'tcx>, cx: &mut DocContext
10801080
hir::TraitItemKind::Type(bounds, None) => {
10811081
let generics = enter_impl_trait(cx, |cx| clean_generics(trait_item.generics, cx));
10821082
let bounds = bounds.iter().filter_map(|x| clean_generic_bound(x, cx)).collect();
1083-
TyAssocTypeItem(Box::new(generics), bounds)
1083+
TyAssocTypeItem(generics, bounds)
10841084
}
10851085
};
10861086
Item::from_def_id_and_parts(local_did, Some(trait_item.ident.name), inner, cx)
@@ -1297,7 +1297,7 @@ pub(crate) fn clean_middle_assoc_item<'tcx>(
12971297
bounds,
12981298
)
12991299
} else {
1300-
TyAssocTypeItem(Box::new(generics), bounds)
1300+
TyAssocTypeItem(generics, bounds)
13011301
}
13021302
} else {
13031303
// FIXME: when could this happen? Associated items in inherent impls?

src/librustdoc/clean/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ pub(crate) enum ItemKind {
795795
/// A required associated type in a trait declaration.
796796
///
797797
/// The bounds may be non-empty if there is a `where` clause.
798-
TyAssocTypeItem(Box<Generics>, Vec<GenericBound>),
798+
TyAssocTypeItem(Generics, Vec<GenericBound>),
799799
/// An associated type in a trait impl or a provided one in a trait declaration.
800800
AssocTypeItem(Box<Typedef>, Vec<GenericBound>),
801801
/// An item that has been stripped by a rustdoc pass

src/librustdoc/json/conversions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ fn from_clean_item(item: clean::Item, tcx: TyCtxt<'_>) -> ItemEnum {
284284
ItemEnum::AssocConst { type_: ty.into_tcx(tcx), default: Some(default.expr(tcx)) }
285285
}
286286
TyAssocTypeItem(g, b) => ItemEnum::AssocType {
287-
generics: (*g).into_tcx(tcx),
287+
generics: g.into_tcx(tcx),
288288
bounds: b.into_tcx(tcx),
289289
default: None,
290290
},

0 commit comments

Comments
 (0)