summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2017-01-17 01:54:59 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2017-01-17 01:54:59 +0300
commit03620dba25328ee8cc7316cf6d9bad2d0a118ba1 (patch)
tree36d4e35e2c6196f64147a2d9f5bc897ff30da076 /src/libsyntax/ext
parent2efe865d22eb85871562b2497ac819efc0174a3d (diff)
downloadrust-03620dba25328ee8cc7316cf6d9bad2d0a118ba1.tar.gz
rust-03620dba25328ee8cc7316cf6d9bad2d0a118ba1.zip
Use resizable Vec instead of P<[T]> in AST
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/build.rs25
1 files changed, 4 insertions, 21 deletions
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs
index fc3cbf20fb9..b234677f544 100644
--- a/src/libsyntax/ext/build.rs
+++ b/src/libsyntax/ext/build.rs
@@ -67,9 +67,6 @@ pub trait AstBuilder {
     fn ty_option(&self, ty: P<ast::Ty>) -> P<ast::Ty>;
     fn ty_infer(&self, sp: Span) -> P<ast::Ty>;
 
-    fn ty_vars(&self, ty_params: &P<[ast::TyParam]>) -> Vec<P<ast::Ty>> ;
-    fn ty_vars_global(&self, ty_params: &P<[ast::TyParam]>) -> Vec<P<ast::Ty>> ;
-
     fn typaram(&self,
                span: Span,
                id: ast::Ident,
@@ -333,8 +330,8 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
         } else {
             Some(P(ast::PathParameters::AngleBracketed(ast::AngleBracketedParameterData {
                 lifetimes: lifetimes,
-                types: P::from_vec(types),
-                bindings: P::from_vec(bindings),
+                types: types,
+                bindings: bindings,
             })))
         };
         segments.push(ast::PathSegment { identifier: last_identifier, parameters: parameters });
@@ -369,8 +366,8 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
         let mut path = trait_path;
         let parameters = ast::AngleBracketedParameterData {
             lifetimes: lifetimes,
-            types: P::from_vec(types),
-            bindings: P::from_vec(bindings),
+            types: types,
+            bindings: bindings,
         };
         path.segments.push(ast::PathSegment {
             identifier: ident,
@@ -458,20 +455,6 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
         }
     }
 
-    // these are strange, and probably shouldn't be used outside of
-    // pipes. Specifically, the global version possible generates
-    // incorrect code.
-    fn ty_vars(&self, ty_params: &P<[ast::TyParam]>) -> Vec<P<ast::Ty>> {
-        ty_params.iter().map(|p| self.ty_ident(DUMMY_SP, p.ident)).collect()
-    }
-
-    fn ty_vars_global(&self, ty_params: &P<[ast::TyParam]>) -> Vec<P<ast::Ty>> {
-        ty_params
-            .iter()
-            .map(|p| self.ty_path(self.path_global(DUMMY_SP, vec![p.ident])))
-            .collect()
-    }
-
     fn trait_ref(&self, path: ast::Path) -> ast::TraitRef {
         ast::TraitRef {
             path: path,