@@ -29,7 +29,6 @@ use parse::token::special_idents::clownshoes_extensions;
2929use ast_util;
3030use opt_vec;
3131
32- use core:: dvec;
3332use core:: uint;
3433
3534enum Junction {
@@ -99,7 +98,7 @@ fn expand_deriving(cx: ext_ctxt,
9998 expand_deriving_struct_def : ExpandDerivingStructDefFn ,
10099 expand_deriving_enum_def : ExpandDerivingEnumDefFn )
101100 -> ~[ @item] {
102- let result = dvec :: DVec ( ) ;
101+ let mut result = ~ [ ] ;
103102 for in_items. each |item| {
104103 result. push ( copy * item) ;
105104 match item. node {
@@ -120,7 +119,7 @@ fn expand_deriving(cx: ext_ctxt,
120119 _ => ( )
121120 }
122121 }
123- dvec :: unwrap ( result)
122+ result
124123}
125124
126125fn create_impl_item( cx: ext_ctxt, span: span, +item: item_) -> @item {
@@ -202,14 +201,13 @@ fn create_self_type_with_params(cx: ext_ctxt,
202201 generics: & Generics )
203202 -> @Ty {
204203 // Create the type parameters on the `self` path.
205- let self_ty_params = dvec :: DVec ( ) ;
204+ let mut self_ty_params = ~ [ ] ;
206205 for generics. ty_params . each |ty_param| {
207206 let self_ty_param = build:: mk_simple_ty_path ( cx,
208207 span,
209208 ty_param. ident ) ;
210209 self_ty_params. push ( self_ty_param) ;
211210 }
212- let self_ty_params = dvec:: unwrap ( self_ty_params) ;
213211
214212 // Create the type of `self`.
215213 let self_type = build:: mk_raw_path_ ( span,
@@ -433,7 +431,7 @@ fn create_subpatterns(cx: ext_ctxt,
433431 prefix : ~str ,
434432 n : uint )
435433 -> ~[ @pat] {
436- let subpats = dvec :: DVec ( ) ;
434+ let mut subpats = ~ [ ] ;
437435 for uint:: range( 0 , n) |_i| {
438436 // Create the subidentifier.
439437 let index = subpats. len ( ) . to_str ( ) ;
@@ -445,7 +443,7 @@ fn create_subpatterns(cx: ext_ctxt,
445443 let subpat = build:: mk_pat ( cx, span, subpat) ;
446444 subpats. push ( subpat) ;
447445 }
448- return dvec :: unwrap ( subpats) ;
446+ return subpats;
449447}
450448
451449fn is_struct_tuple ( struct_def : & struct_def ) -> bool {
@@ -809,7 +807,7 @@ fn expand_deriving_iter_bytes_struct_method(cx: ext_ctxt,
809807 let self_ident = cx. ident_of ( ~"self ") ;
810808
811809 // Create the body of the method.
812- let statements = dvec :: DVec ( ) ;
810+ let mut statements = ~ [ ] ;
813811 for struct_def. fields. each |struct_field| {
814812 match struct_field. node . kind {
815813 named_field( ident, _, _) => {
@@ -833,7 +831,6 @@ fn expand_deriving_iter_bytes_struct_method(cx: ext_ctxt,
833831 }
834832
835833 // Create the method itself.
836- let statements = dvec:: unwrap ( statements) ;
837834 return create_iter_bytes_method ( cx, span, statements) ;
838835}
839836
@@ -942,9 +939,9 @@ fn expand_deriving_eq_enum_method(cx: ext_ctxt,
942939 }
943940
944941 // Create the arms of the self match in the method body.
945- let self_arms = dvec :: DVec ( ) ;
942+ let mut self_arms = ~ [ ] ;
946943 for enum_definition. variants. each |self_variant| {
947- let other_arms = dvec :: DVec ( ) ;
944+ let mut other_arms = ~ [ ] ;
948945
949946 // Create the matching pattern.
950947 let matching_pat = create_enum_variant_pattern ( cx,
@@ -1026,7 +1023,6 @@ fn expand_deriving_eq_enum_method(cx: ext_ctxt,
10261023 // Create the self pattern body.
10271024 let other_expr = build:: mk_path ( cx, span, ~[ other_ident ] ) ;
10281025 let other_expr = build:: mk_unary ( cx, span, deref, other_expr) ;
1029- let other_arms = dvec:: unwrap ( other_arms) ;
10301026 let other_match_expr = expr_match ( other_expr, other_arms) ;
10311027 let other_match_expr = build:: mk_expr ( cx,
10321028 span,
@@ -1047,7 +1043,6 @@ fn expand_deriving_eq_enum_method(cx: ext_ctxt,
10471043 // Create the method body.
10481044 let self_expr = build:: mk_path ( cx, span, ~[ self_ident ] ) ;
10491045 let self_expr = build:: mk_unary ( cx, span, deref, self_expr) ;
1050- let self_arms = dvec:: unwrap ( self_arms) ;
10511046 let self_match_expr = expr_match ( self_expr, self_arms) ;
10521047 let self_match_expr = build:: mk_expr ( cx, span, self_match_expr) ;
10531048
@@ -1148,7 +1143,7 @@ fn expand_deriving_iter_bytes_enum_method(cx: ext_ctxt,
11481143 }
11491144
11501145 // Feed the discriminant to the byte iteration function.
1151- let stmts = dvec :: DVec ( ) ;
1146+ let mut stmts = ~ [ ] ;
11521147 let discrim_stmt = call_substructure_iter_bytes_method ( cx,
11531148 span,
11541149 discriminant) ;
@@ -1167,7 +1162,6 @@ fn expand_deriving_iter_bytes_enum_method(cx: ext_ctxt,
11671162 }
11681163
11691164 // Create the pattern body.
1170- let stmts = dvec:: unwrap ( stmts) ;
11711165 let match_body_block = build:: mk_block_ ( cx, span, stmts) ;
11721166
11731167 // Create the arm.
0 commit comments