@@ -29,7 +29,6 @@ use parse::token::special_idents::clownshoes_extensions;
29
29
use ast_util;
30
30
use opt_vec;
31
31
32
- use core:: dvec;
33
32
use core:: uint;
34
33
35
34
enum Junction {
@@ -99,7 +98,7 @@ fn expand_deriving(cx: ext_ctxt,
99
98
expand_deriving_struct_def : ExpandDerivingStructDefFn ,
100
99
expand_deriving_enum_def : ExpandDerivingEnumDefFn )
101
100
-> ~[ @item] {
102
- let result = dvec :: DVec ( ) ;
101
+ let mut result = ~ [ ] ;
103
102
for in_items. each |item| {
104
103
result. push ( copy * item) ;
105
104
match item. node {
@@ -120,7 +119,7 @@ fn expand_deriving(cx: ext_ctxt,
120
119
_ => ( )
121
120
}
122
121
}
123
- dvec :: unwrap ( result)
122
+ result
124
123
}
125
124
126
125
fn create_impl_item( cx: ext_ctxt, span: span, +item: item_) -> @item {
@@ -202,14 +201,13 @@ fn create_self_type_with_params(cx: ext_ctxt,
202
201
generics: & Generics )
203
202
-> @Ty {
204
203
// Create the type parameters on the `self` path.
205
- let self_ty_params = dvec :: DVec ( ) ;
204
+ let mut self_ty_params = ~ [ ] ;
206
205
for generics. ty_params . each |ty_param| {
207
206
let self_ty_param = build:: mk_simple_ty_path ( cx,
208
207
span,
209
208
ty_param. ident ) ;
210
209
self_ty_params. push ( self_ty_param) ;
211
210
}
212
- let self_ty_params = dvec:: unwrap ( self_ty_params) ;
213
211
214
212
// Create the type of `self`.
215
213
let self_type = build:: mk_raw_path_ ( span,
@@ -433,7 +431,7 @@ fn create_subpatterns(cx: ext_ctxt,
433
431
prefix : ~str ,
434
432
n : uint )
435
433
-> ~[ @pat] {
436
- let subpats = dvec :: DVec ( ) ;
434
+ let mut subpats = ~ [ ] ;
437
435
for uint:: range( 0 , n) |_i| {
438
436
// Create the subidentifier.
439
437
let index = subpats. len ( ) . to_str ( ) ;
@@ -445,7 +443,7 @@ fn create_subpatterns(cx: ext_ctxt,
445
443
let subpat = build:: mk_pat ( cx, span, subpat) ;
446
444
subpats. push ( subpat) ;
447
445
}
448
- return dvec :: unwrap ( subpats) ;
446
+ return subpats;
449
447
}
450
448
451
449
fn is_struct_tuple ( struct_def : & struct_def ) -> bool {
@@ -809,7 +807,7 @@ fn expand_deriving_iter_bytes_struct_method(cx: ext_ctxt,
809
807
let self_ident = cx. ident_of ( ~"self ") ;
810
808
811
809
// Create the body of the method.
812
- let statements = dvec :: DVec ( ) ;
810
+ let mut statements = ~ [ ] ;
813
811
for struct_def. fields. each |struct_field| {
814
812
match struct_field. node . kind {
815
813
named_field( ident, _, _) => {
@@ -833,7 +831,6 @@ fn expand_deriving_iter_bytes_struct_method(cx: ext_ctxt,
833
831
}
834
832
835
833
// Create the method itself.
836
- let statements = dvec:: unwrap ( statements) ;
837
834
return create_iter_bytes_method ( cx, span, statements) ;
838
835
}
839
836
@@ -942,9 +939,9 @@ fn expand_deriving_eq_enum_method(cx: ext_ctxt,
942
939
}
943
940
944
941
// Create the arms of the self match in the method body.
945
- let self_arms = dvec :: DVec ( ) ;
942
+ let mut self_arms = ~ [ ] ;
946
943
for enum_definition. variants. each |self_variant| {
947
- let other_arms = dvec :: DVec ( ) ;
944
+ let mut other_arms = ~ [ ] ;
948
945
949
946
// Create the matching pattern.
950
947
let matching_pat = create_enum_variant_pattern ( cx,
@@ -1026,7 +1023,6 @@ fn expand_deriving_eq_enum_method(cx: ext_ctxt,
1026
1023
// Create the self pattern body.
1027
1024
let other_expr = build:: mk_path ( cx, span, ~[ other_ident ] ) ;
1028
1025
let other_expr = build:: mk_unary ( cx, span, deref, other_expr) ;
1029
- let other_arms = dvec:: unwrap ( other_arms) ;
1030
1026
let other_match_expr = expr_match ( other_expr, other_arms) ;
1031
1027
let other_match_expr = build:: mk_expr ( cx,
1032
1028
span,
@@ -1047,7 +1043,6 @@ fn expand_deriving_eq_enum_method(cx: ext_ctxt,
1047
1043
// Create the method body.
1048
1044
let self_expr = build:: mk_path ( cx, span, ~[ self_ident ] ) ;
1049
1045
let self_expr = build:: mk_unary ( cx, span, deref, self_expr) ;
1050
- let self_arms = dvec:: unwrap ( self_arms) ;
1051
1046
let self_match_expr = expr_match ( self_expr, self_arms) ;
1052
1047
let self_match_expr = build:: mk_expr ( cx, span, self_match_expr) ;
1053
1048
@@ -1148,7 +1143,7 @@ fn expand_deriving_iter_bytes_enum_method(cx: ext_ctxt,
1148
1143
}
1149
1144
1150
1145
// Feed the discriminant to the byte iteration function.
1151
- let stmts = dvec :: DVec ( ) ;
1146
+ let mut stmts = ~ [ ] ;
1152
1147
let discrim_stmt = call_substructure_iter_bytes_method ( cx,
1153
1148
span,
1154
1149
discriminant) ;
@@ -1167,7 +1162,6 @@ fn expand_deriving_iter_bytes_enum_method(cx: ext_ctxt,
1167
1162
}
1168
1163
1169
1164
// Create the pattern body.
1170
- let stmts = dvec:: unwrap ( stmts) ;
1171
1165
let match_body_block = build:: mk_block_ ( cx, span, stmts) ;
1172
1166
1173
1167
// Create the arm.
0 commit comments