@@ -157,7 +157,7 @@ fn instantiate_path(&@fn_ctxt fcx, &ast::path pth, &ty_param_count_and_ty tpt,
157
157
auto ty_substs_opt;
158
158
auto ty_substs_len = vec:: len[ @ast:: ty] ( pth. node . types ) ;
159
159
if ( ty_substs_len > 0 u) {
160
- let vec [ ty:: t] ty_substs = [ ] ;
160
+ let ty:: t[ ] ty_substs = ~ [ ] ;
161
161
auto i = 0 u;
162
162
while ( i < ty_substs_len) {
163
163
// TODO: Report an error if the number of type params in the item
@@ -166,10 +166,10 @@ fn instantiate_path(&@fn_ctxt fcx, &ast::path pth, &ty_param_count_and_ty tpt,
166
166
auto ty_var = ty:: mk_var ( fcx. ccx . tcx , ty_param_vars. ( i) ) ;
167
167
auto ty_subst = ast_ty_to_ty_crate ( fcx. ccx , pth. node . types . ( i) ) ;
168
168
auto res_ty = demand:: simple ( fcx, pth. span , ty_var, ty_subst) ;
169
- ty_substs += [ res_ty] ;
169
+ ty_substs += ~ [ res_ty] ;
170
170
i += 1 u;
171
171
}
172
- ty_substs_opt = some[ vec [ ty:: t] ] ( ty_substs) ;
172
+ ty_substs_opt = some[ ty:: t[ ] ] ( ty_substs) ;
173
173
if ( ty_param_count == 0 u) {
174
174
fcx. ccx . tcx . sess . span_fatal ( sp,
175
175
"this item does not take type " +
@@ -179,13 +179,13 @@ fn instantiate_path(&@fn_ctxt fcx, &ast::path pth, &ty_param_count_and_ty tpt,
179
179
} else {
180
180
// We will acquire the type parameters through unification.
181
181
182
- let vec [ ty:: t] ty_substs = [ ] ;
182
+ let ty:: t[ ] ty_substs = ~ [ ] ;
183
183
auto i = 0 u;
184
184
while ( i < ty_param_count) {
185
- ty_substs += [ ty:: mk_var ( fcx. ccx . tcx , ty_param_vars. ( i) ) ] ;
185
+ ty_substs += ~ [ ty:: mk_var ( fcx. ccx . tcx , ty_param_vars. ( i) ) ] ;
186
186
i += 1 u;
187
187
}
188
- ty_substs_opt = some[ vec [ ty:: t] ] ( ty_substs) ;
188
+ ty_substs_opt = some[ ty:: t[ ] ] ( ty_substs) ;
189
189
}
190
190
ret tup( ty_substs_opt, tpt. _1 ) ;
191
191
}
@@ -435,23 +435,23 @@ mod write {
435
435
436
436
// Writes a type with no type parameters into the node type table.
437
437
fn ty_only( & ty:: ctxt tcx, ast:: node_id node_id, ty:: t typ) {
438
- ret ty( tcx, node_id, tup( none[ vec [ ty:: t] ] , typ) ) ;
438
+ ret ty( tcx, node_id, tup( none[ ty:: t[ ] ] , typ) ) ;
439
439
}
440
440
441
441
// Writes a type with no type parameters into the node type table. This
442
442
// function allows for the possibility of type variables.
443
443
fn ty_only_fixup( @fn_ctxt fcx, ast:: node_id node_id, ty:: t typ) {
444
- ret ty_fixup( fcx, node_id, tup( none[ vec [ ty:: t] ] , typ) ) ;
444
+ ret ty_fixup( fcx, node_id, tup( none[ ty:: t[ ] ] , typ) ) ;
445
445
}
446
446
447
447
// Writes a nil type into the node type table.
448
448
fn nil_ty( & ty:: ctxt tcx, ast:: node_id node_id) {
449
- ret ty( tcx, node_id, tup( none[ vec [ ty:: t] ] , ty:: mk_nil( tcx) ) ) ;
449
+ ret ty( tcx, node_id, tup( none[ ty:: t[ ] ] , ty:: mk_nil( tcx) ) ) ;
450
450
}
451
451
452
452
// Writes the bottom type into the node type table.
453
453
fn bot_ty( & ty:: ctxt tcx, ast:: node_id node_id) {
454
- ret ty( tcx, node_id, tup( none[ vec [ ty:: t] ] , ty:: mk_bot( tcx) ) ) ;
454
+ ret ty( tcx, node_id, tup( none[ ty:: t[ ] ] , ty:: mk_bot( tcx) ) ) ;
455
455
}
456
456
}
457
457
@@ -912,24 +912,22 @@ fn resolve_type_vars_if_possible(&@fn_ctxt fcx, ty::t typ) -> ty::t {
912
912
913
913
// Demands - procedures that require that two types unify and emit an error
914
914
// message if they don't.
915
- type ty_param_substs_and_ty = tup( vec [ ty:: t] , ty:: t) ;
915
+ type ty_param_substs_and_ty = tup( ty:: t[ ] , ty:: t) ;
916
916
917
917
mod demand {
918
918
fn simple( & @fn_ctxt fcx, & span sp, & ty:: t expected, & ty:: t actual) ->
919
919
ty:: t {
920
- let vec[ ty:: t] tps = [ ] ;
921
- ret full( fcx, sp, expected, actual, tps, NO_AUTODEREF ) . _1;
920
+ ret full( fcx, sp, expected, actual, ~[ ] , NO_AUTODEREF ) . _1;
922
921
}
923
922
fn autoderef( & @fn_ctxt fcx, & span sp, & ty:: t expected, & ty:: t actual,
924
923
autoderef_kind adk) -> ty:: t {
925
- let vec[ ty:: t] tps = [ ] ;
926
- ret full( fcx, sp, expected, actual, tps, adk) . _1;
924
+ ret full( fcx, sp, expected, actual, ~[ ] , adk) . _1;
927
925
}
928
926
929
927
// Requires that the two types unify, and prints an error message if they
930
928
// don't. Returns the unified type and the type parameter substitutions.
931
929
fn full( & @fn_ctxt fcx, & span sp, & ty:: t expected, & ty:: t actual,
932
- & vec [ ty:: t] ty_param_substs_0, autoderef_kind adk) ->
930
+ & ty:: t[ ] ty_param_substs_0, autoderef_kind adk) ->
933
931
ty_param_substs_and_ty {
934
932
auto expected_1 = expected;
935
933
auto actual_1 = actual;
@@ -954,10 +952,10 @@ mod demand {
954
952
fn mk_result( & @fn_ctxt fcx, & ty:: t result_ty,
955
953
& vec[ int] ty_param_subst_var_ids,
956
954
uint implicit_boxes) -> ty_param_substs_and_ty {
957
- let vec [ ty:: t] result_ty_param_substs = [ ] ;
955
+ let ty:: t[ ] result_ty_param_substs = ~ [ ] ;
958
956
for ( int var_id in ty_param_subst_var_ids) {
959
957
auto tp_subst = ty:: mk_var( fcx. ccx. tcx, var_id) ;
960
- result_ty_param_substs += [ tp_subst] ;
958
+ result_ty_param_substs += ~ [ tp_subst] ;
961
959
}
962
960
ret tup( result_ty_param_substs,
963
961
add_boxes( fcx. ccx, implicit_boxes, result_ty) ) ;
@@ -1047,13 +1045,14 @@ mod writeback {
1047
1045
auto new_ty = resolve_type_vars_in_type( fcx, sp, tpot. _1) ;
1048
1046
auto new_substs_opt;
1049
1047
alt ( tpot. _0) {
1050
- case ( none[ vec [ ty:: t] ] ) { new_substs_opt = none[ vec [ ty:: t] ] ; }
1051
- case ( some[ vec [ ty:: t] ] ( ?substs) ) {
1052
- let vec [ ty:: t] new_substs = [ ] ;
1048
+ case ( none[ ty:: t[ ] ] ) { new_substs_opt = none[ ty:: t[ ] ] ; }
1049
+ case ( some[ ty:: t[ ] ] ( ?substs) ) {
1050
+ let ty:: t[ ] new_substs = ~ [ ] ;
1053
1051
for ( ty:: t subst in substs) {
1054
- new_substs += [ resolve_type_vars_in_type( fcx, sp, subst) ] ;
1052
+ new_substs += ~[ resolve_type_vars_in_type( fcx, sp,
1053
+ subst) ] ;
1055
1054
}
1056
- new_substs_opt = some[ vec [ ty:: t] ] ( new_substs) ;
1055
+ new_substs_opt = some[ ty:: t[ ] ] ( new_substs) ;
1057
1056
}
1058
1057
}
1059
1058
write:: ty( fcx. ccx. tcx, id, tup( new_substs_opt, new_ty) ) ;
@@ -1234,11 +1233,11 @@ fn gather_locals(&@crate_ctxt ccx, &ast::fn_decl decl, &ast::block body,
1234
1233
1235
1234
// AST fragment utilities
1236
1235
fn replace_expr_type( & @fn_ctxt fcx, & @ast:: expr expr,
1237
- & tup( vec [ ty:: t] , ty:: t) new_tyt) {
1236
+ & tup( ty:: t[ ] , ty:: t) new_tyt) {
1238
1237
auto new_tps;
1239
1238
if ( ty:: expr_has_ty_params( fcx. ccx. tcx, expr) ) {
1240
- new_tps = some[ vec [ ty:: t] ] ( new_tyt. _0) ;
1241
- } else { new_tps = none[ vec [ ty:: t] ] ; }
1239
+ new_tps = some[ ty:: t[ ] ] ( new_tyt. _0) ;
1240
+ } else { new_tps = none[ ty:: t[ ] ] ; }
1242
1241
write:: ty_fixup( fcx, expr. id, tup( new_tps, new_tyt. _1) ) ;
1243
1242
}
1244
1243
@@ -1295,13 +1294,13 @@ fn check_pat(&@fn_ctxt fcx, &@ast::pat pat, ty::t expected) {
1295
1294
path_tpot) ;
1296
1295
1297
1296
// FIXME: Remove this ivec->vec conversion.
1298
- auto tps_vec = [ ] ;
1299
- for ( ty:: t tp in expected_tps) { tps_vec += [ tp] ; }
1297
+ auto tps_vec = ~ [ ] ;
1298
+ for ( ty:: t tp in expected_tps) { tps_vec += ~ [ tp] ; }
1300
1299
1301
1300
auto path_tpt =
1302
1301
demand:: full( fcx, pat. span, expected, ctor_ty, tps_vec,
1303
1302
NO_AUTODEREF ) ;
1304
- path_tpot = tup( some[ vec [ ty:: t] ] ( path_tpt. _0) , path_tpt. _1) ;
1303
+ path_tpot = tup( some[ ty:: t[ ] ] ( path_tpt. _0) , path_tpt. _1) ;
1305
1304
// Get the number of arguments in this tag variant.
1306
1305
1307
1306
auto arg_types =
0 commit comments