diff options
| -rw-r--r-- | src/librustdoc/clean/auto_trait.rs | 6 | ||||
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 14 | ||||
| -rw-r--r-- | src/librustdoc/clean/types.rs | 3 | ||||
| -rw-r--r-- | src/librustdoc/json/conversions.rs | 2 |
4 files changed, 12 insertions, 13 deletions
diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs index cbc010698c7..20fb91eba39 100644 --- a/src/librustdoc/clean/auto_trait.rs +++ b/src/librustdoc/clean/auto_trait.rs @@ -545,7 +545,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { 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 @@ -592,12 +592,12 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { // 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), } diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 3c10fadeff3..73e56a610fb 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -387,7 +387,7 @@ impl<'tcx> Clean<Type> for ty::ProjectionTy<'tcx> { 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_, } } } @@ -1277,16 +1277,16 @@ fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &mut DocContext<'_>) -> Type { 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) => { @@ -1297,13 +1297,13 @@ fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &mut DocContext<'_>) -> Type { 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"), diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index da06737394d..b57e8a0ed2a 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -1408,8 +1408,7 @@ crate enum Type { name: Symbol, self_type: Box<Type>, self_def_id: Option<DefId>, - // FIXME: remove this `Box`; it's unnecessary - trait_: Box<Path>, + trait_: Path, }, // `_` diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs index 10320baaf93..fda540aa186 100644 --- a/src/librustdoc/json/conversions.rs +++ b/src/librustdoc/json/conversions.rs @@ -436,7 +436,7 @@ impl FromWithTcx<clean::Type> for Type { }, 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)), |
