Skip to content

Commit 345077a

Browse files
author
Lukas Markeffsky
committed
don't clone clean::Item in TypeImplCollector
1 parent 4facc1c commit 345077a

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎src/librustdoc/html/render/write_shared.rs‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -824,9 +824,9 @@ impl Serialize for Implementor {
824824
/// this visitor works to reverse that: `aliased_types` is a map
825825
/// from target to the aliases that reference it, and each one
826826
/// will generate one file.
827-
structTypeImplCollector<'cx,'cache>{
827+
structTypeImplCollector<'cx,'cache,'item>{
828828
/// Map from DefId-of-aliased-type to its data.
829-
aliased_types:IndexMap<DefId,AliasedType<'cache>>,
829+
aliased_types:IndexMap<DefId,AliasedType<'cache,'item>>,
830830
visited_aliases:FxHashSet<DefId>,
831831
cache:&'cacheCache,
832832
cx:&'cachemutContext<'cx>,
@@ -847,26 +847,26 @@ struct TypeImplCollector<'cx, 'cache> {
847847
/// ]
848848
/// )
849849
/// ```
850-
structAliasedType<'cache>{
850+
structAliasedType<'cache,'item>{
851851
/// This is used to generate the actual filename of this aliased type.
852852
target_fqp:&'cache[Symbol],
853853
target_type:ItemType,
854854
/// This is the data stored inside the file.
855855
/// ItemId is used to deduplicate impls.
856-
impl_:IndexMap<ItemId,AliasedTypeImpl<'cache>>,
856+
impl_:IndexMap<ItemId,AliasedTypeImpl<'cache,'item>>,
857857
}
858858

859859
/// The `impl_` contains data that's used to figure out if an alias will work,
860860
/// and to generate the HTML at the end.
861861
///
862862
/// The `type_aliases` list is built up with each type alias that matches.
863-
structAliasedTypeImpl<'cache>{
863+
structAliasedTypeImpl<'cache,'item>{
864864
impl_:&'cacheImpl,
865-
type_aliases:Vec<(&'cache[Symbol],Item)>,
865+
type_aliases:Vec<(&'cache[Symbol],&'itemItem)>,
866866
}
867867

868-
impl<'cx,'cache>DocVisitor<'_>forTypeImplCollector<'cx,'cache>{
869-
fnvisit_item(&mutself,it:&Item){
868+
impl<'cx,'cache,'item>DocVisitor<'item>forTypeImplCollector<'cx,'cache,'item>{
869+
fnvisit_item(&mutself,it:&'itemItem){
870870
self.visit_item_recur(it);
871871
let cache = self.cache;
872872
letItemKind::TypeAliasItem(ref t) = it.kindelse{return};
@@ -927,7 +927,7 @@ impl<'cx, 'cache> DocVisitor<'_> for TypeImplCollector<'cx, 'cache> {
927927
continue;
928928
}
929929
// This impl was not found in the set of rejected impls
930-
aliased_type_impl.type_aliases.push((&self_fqp[..], it.clone()));
930+
aliased_type_impl.type_aliases.push((&self_fqp[..], it));
931931
}
932932
}
933933
}

0 commit comments

Comments
 (0)