From 9108fb7bae11f18715d971eeae1e5ca84662e1ee Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Fri, 22 Apr 2016 23:43:14 +0300 Subject: Remove some old code from libsyntax --- src/libsyntax_ext/deriving/generic/mod.rs | 8 ++++---- src/libsyntax_ext/deriving/generic/ty.rs | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src/libsyntax_ext') diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs index a3e70cc6321..5251b0d08d4 100644 --- a/src/libsyntax_ext/deriving/generic/mod.rs +++ b/src/libsyntax_ext/deriving/generic/mod.rs @@ -525,7 +525,7 @@ impl<'a> TraitDef<'a> { span: self.span, bound_lifetimes: wb.bound_lifetimes.clone(), bounded_ty: wb.bounded_ty.clone(), - bounds: P::from_vec(wb.bounds.iter().cloned().collect()) + bounds: wb.bounds.iter().cloned().collect(), }) } ast::WherePredicate::RegionPredicate(ref rb) => { @@ -595,9 +595,9 @@ impl<'a> TraitDef<'a> { let trait_ref = cx.trait_ref(trait_path); // Create the type parameters on the `self` path. - let self_ty_params = generics.ty_params.map(|ty_param| { + let self_ty_params = generics.ty_params.iter().map(|ty_param| { cx.ty_ident(self.span, ty_param.ident) - }); + }).collect(); let self_lifetimes: Vec = generics.lifetimes @@ -608,7 +608,7 @@ impl<'a> TraitDef<'a> { // Create the type of `self`. let self_type = cx.ty_path( cx.path_all(self.span, false, vec!( type_ident ), self_lifetimes, - self_ty_params.into_vec(), Vec::new())); + self_ty_params, Vec::new())); let attr = cx.attribute( self.span, diff --git a/src/libsyntax_ext/deriving/generic/ty.rs b/src/libsyntax_ext/deriving/generic/ty.rs index e19febe2a12..e31d45d91a5 100644 --- a/src/libsyntax_ext/deriving/generic/ty.rs +++ b/src/libsyntax_ext/deriving/generic/ty.rs @@ -169,15 +169,14 @@ impl<'a> Ty<'a> { -> ast::Path { match *self { Self_ => { - let self_params = self_generics.ty_params.map(|ty_param| { + let self_params = self_generics.ty_params.iter().map(|ty_param| { cx.ty_ident(span, ty_param.ident) - }); + }).collect(); let lifetimes = self_generics.lifetimes.iter() .map(|d| d.lifetime) .collect(); - cx.path_all(span, false, vec!(self_ty), lifetimes, - self_params.into_vec(), Vec::new()) + cx.path_all(span, false, vec![self_ty], lifetimes, self_params, Vec::new()) } Literal(ref p) => { p.to_path(cx, span, self_ty, self_generics) -- cgit 1.4.1-3-g733a5