diff options
Diffstat (limited to 'src/librustdoc/clean/auto_trait.rs')
| -rw-r--r-- | src/librustdoc/clean/auto_trait.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs index 96d19e8e17d..3b13cb9e98c 100644 --- a/src/librustdoc/clean/auto_trait.rs +++ b/src/librustdoc/clean/auto_trait.rs @@ -123,7 +123,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { attrs: Default::default(), visibility: Inherited, def_id: self.cx.next_def_id(param_env_def_id.krate), - kind: ImplItem(Impl { + kind: box ImplItem(Impl { unsafety: hir::Unsafety::Normal, generics: new_generics, provided_trait_methods: Default::default(), @@ -351,8 +351,8 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { if let Some(data) = ty_to_fn.get(&ty) { let (poly_trait, output) = (data.0.as_ref().expect("as_ref failed").clone(), data.1.as_ref().cloned()); - let new_ty = match &poly_trait.trait_ { - &Type::ResolvedPath { + let new_ty = match poly_trait.trait_ { + Type::ResolvedPath { ref path, ref param_names, ref did, @@ -597,7 +597,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { ref mut bindings, .. } => { bindings.push(TypeBinding { - name: left_name.clone(), + name: left_name, kind: TypeBindingKind::Equality { ty: rhs }, }); } @@ -665,7 +665,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { GenericParamDefKind::Type { ref mut default, ref mut bounds, .. } => { // We never want something like `impl<T=Foo>`. default.take(); - let generic_ty = Type::Generic(param.name.clone()); + let generic_ty = Type::Generic(param.name); if !has_sized.contains(&generic_ty) { bounds.insert(0, GenericBound::maybe_sized(self.cx)); } @@ -738,11 +738,11 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { } fn is_fn_ty(&self, tcx: TyCtxt<'_>, ty: &Type) -> bool { - match &ty { - &&Type::ResolvedPath { ref did, .. } => { - *did == tcx.require_lang_item(LangItem::Fn, None) - || *did == tcx.require_lang_item(LangItem::FnMut, None) - || *did == tcx.require_lang_item(LangItem::FnOnce, None) + match ty { + &Type::ResolvedPath { did, .. } => { + did == tcx.require_lang_item(LangItem::Fn, None) + || did == tcx.require_lang_item(LangItem::FnMut, None) + || did == tcx.require_lang_item(LangItem::FnOnce, None) } _ => false, } |
