rustdoc: remove unneeded Box from ItemKind
This commit is contained in:
parent
03968a802c
commit
24714b84ea
3 changed files with 4 additions and 4 deletions
|
|
@ -1080,7 +1080,7 @@ fn clean_trait_item<'tcx>(trait_item: &hir::TraitItem<'tcx>, cx: &mut DocContext
|
|||
hir::TraitItemKind::Type(bounds, None) => {
|
||||
let generics = enter_impl_trait(cx, |cx| clean_generics(trait_item.generics, cx));
|
||||
let bounds = bounds.iter().filter_map(|x| clean_generic_bound(x, cx)).collect();
|
||||
TyAssocTypeItem(Box::new(generics), bounds)
|
||||
TyAssocTypeItem(generics, bounds)
|
||||
}
|
||||
};
|
||||
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>(
|
|||
bounds,
|
||||
)
|
||||
} else {
|
||||
TyAssocTypeItem(Box::new(generics), bounds)
|
||||
TyAssocTypeItem(generics, bounds)
|
||||
}
|
||||
} else {
|
||||
// FIXME: when could this happen? Associated items in inherent impls?
|
||||
|
|
|
|||
|
|
@ -795,7 +795,7 @@ pub(crate) enum ItemKind {
|
|||
/// A required associated type in a trait declaration.
|
||||
///
|
||||
/// The bounds may be non-empty if there is a `where` clause.
|
||||
TyAssocTypeItem(Box<Generics>, Vec<GenericBound>),
|
||||
TyAssocTypeItem(Generics, Vec<GenericBound>),
|
||||
/// An associated type in a trait impl or a provided one in a trait declaration.
|
||||
AssocTypeItem(Box<Typedef>, Vec<GenericBound>),
|
||||
/// An item that has been stripped by a rustdoc pass
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ fn from_clean_item(item: clean::Item, tcx: TyCtxt<'_>) -> ItemEnum {
|
|||
ItemEnum::AssocConst { type_: ty.into_tcx(tcx), default: Some(default.expr(tcx)) }
|
||||
}
|
||||
TyAssocTypeItem(g, b) => ItemEnum::AssocType {
|
||||
generics: (*g).into_tcx(tcx),
|
||||
generics: g.into_tcx(tcx),
|
||||
bounds: b.into_tcx(tcx),
|
||||
default: None,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue