match lhs {
Type::QPath { name: left_name, ref self_type, ref trait_, .. } => {
let ty = &*self_type;
- let mut new_trait = *trait_.clone();
+ let mut new_trait = trait_.clone();
if self.is_fn_trait(trait_) && left_name == sym::Output {
ty_to_fn
// duplicate bound like `T: Iterator + Iterator<Item=u8>`
// on the docs page.
bounds.remove(&GenericBound::TraitBound(
- PolyTrait { trait_: *trait_.clone(), generic_params: Vec::new() },
+ PolyTrait { trait_: trait_.clone(), generic_params: Vec::new() },
hir::TraitBoundModifier::None,
));
// Avoid creating any new duplicate bounds later in the outer
// loop
- ty_to_traits.entry(*ty.clone()).or_default().insert(*trait_.clone());
+ ty_to_traits.entry(*ty.clone()).or_default().insert(trait_.clone());
}
_ => panic!("Unexpected LHS {:?} for {:?}", lhs, item_def_id),
}
name: cx.tcx.associated_item(self.item_def_id).ident.name,
self_def_id: self_type.def_id(),
self_type: box self_type,
- trait_: box trait_,
+ trait_,
}
}
}
let segments = if p.is_global() { &p.segments[1..] } else { &p.segments };
let trait_segments = &segments[..segments.len() - 1];
let trait_def = cx.tcx.associated_item(p.res.def_id()).container.id();
- let trait_path = self::Path {
+ let trait_ = self::Path {
res: Res::Def(DefKind::Trait, trait_def),
segments: trait_segments.clean(cx),
};
- register_res(cx, trait_path.res);
+ register_res(cx, trait_.res);
Type::QPath {
name: p.segments.last().expect("segments were empty").ident.name,
self_def_id: Some(DefId::local(qself.hir_id.owner.local_def_index)),
self_type: box qself.clean(cx),
- trait_: box trait_path,
+ trait_,
}
}
hir::QPath::TypeRelative(ref qself, ref segment) => {
ty::Error(_) => return Type::Infer,
_ => bug!("clean: expected associated type, found `{:?}`", ty),
};
- let trait_path = hir::Path { span, res, segments: &[] }.clean(cx);
- register_res(cx, trait_path.res);
+ let trait_ = hir::Path { span, res, segments: &[] }.clean(cx);
+ register_res(cx, trait_.res);
Type::QPath {
name: segment.ident.name,
self_def_id: res.opt_def_id(),
self_type: box qself.clean(cx),
- trait_: box trait_path,
+ trait_,
}
}
hir::QPath::LangItem(..) => bug!("clean: requiring documentation of lang item"),
},
QPath { name, self_type, trait_, .. } => {
// FIXME: should `trait_` be a clean::Path equivalent in JSON?
- let trait_ = ResolvedPath { did: trait_.res.def_id(), path: *trait_ }.into_tcx(tcx);
+ let trait_ = ResolvedPath { did: trait_.res.def_id(), path: trait_ }.into_tcx(tcx);
Type::QualifiedPath {
name: name.to_string(),
self_type: Box::new((*self_type).into_tcx(tcx)),