@@ -159,7 +159,7 @@ fn instantiate_path(&@fn_ctxt fcx, &ast::path pth, &ty_param_count_and_ty tpt,
159
159
auto ty_substs_opt;
160
160
auto ty_substs_len = vec:: len[ @ast:: ty] ( pth. node . types ) ;
161
161
if ( ty_substs_len > 0 u) {
162
- let vec [ ty:: t] ty_substs = [ ] ;
162
+ let ty:: t[ ] ty_substs = ~ [ ] ;
163
163
auto i = 0 u;
164
164
while ( i < ty_substs_len) {
165
165
// TODO: Report an error if the number of type params in the item
@@ -168,10 +168,10 @@ fn instantiate_path(&@fn_ctxt fcx, &ast::path pth, &ty_param_count_and_ty tpt,
168
168
auto ty_var = ty:: mk_var ( fcx. ccx . tcx , ty_param_vars. ( i) ) ;
169
169
auto ty_subst = ast_ty_to_ty_crate ( fcx. ccx , pth. node . types . ( i) ) ;
170
170
auto res_ty = demand:: simple ( fcx, pth. span , ty_var, ty_subst) ;
171
- ty_substs += [ res_ty] ;
171
+ ty_substs += ~ [ res_ty] ;
172
172
i += 1 u;
173
173
}
174
- ty_substs_opt = some[ vec [ ty:: t] ] ( ty_substs) ;
174
+ ty_substs_opt = some[ ty:: t[ ] ] ( ty_substs) ;
175
175
if ( ty_param_count == 0 u) {
176
176
fcx. ccx . tcx . sess . span_fatal ( sp,
177
177
"this item does not take type " +
@@ -181,13 +181,13 @@ fn instantiate_path(&@fn_ctxt fcx, &ast::path pth, &ty_param_count_and_ty tpt,
181
181
} else {
182
182
// We will acquire the type parameters through unification.
183
183
184
- let vec [ ty:: t] ty_substs = [ ] ;
184
+ let ty:: t[ ] ty_substs = ~ [ ] ;
185
185
auto i = 0 u;
186
186
while ( i < ty_param_count) {
187
- ty_substs += [ ty:: mk_var ( fcx. ccx . tcx , ty_param_vars. ( i) ) ] ;
187
+ ty_substs += ~ [ ty:: mk_var ( fcx. ccx . tcx , ty_param_vars. ( i) ) ] ;
188
188
i += 1 u;
189
189
}
190
- ty_substs_opt = some[ vec [ ty:: t] ] ( ty_substs) ;
190
+ ty_substs_opt = some[ ty:: t[ ] ] ( ty_substs) ;
191
191
}
192
192
ret tup( ty_substs_opt, tpt. _1 ) ;
193
193
}
@@ -437,23 +437,23 @@ mod write {
437
437
438
438
// Writes a type with no type parameters into the node type table.
439
439
fn ty_only( & ty:: ctxt tcx, ast:: node_id node_id, ty:: t typ) {
440
- ret ty( tcx, node_id, tup( none[ vec [ ty:: t] ] , typ) ) ;
440
+ ret ty( tcx, node_id, tup( none[ ty:: t[ ] ] , typ) ) ;
441
441
}
442
442
443
443
// Writes a type with no type parameters into the node type table. This
444
444
// function allows for the possibility of type variables.
445
445
fn ty_only_fixup( @fn_ctxt fcx, ast:: node_id node_id, ty:: t typ) {
446
- ret ty_fixup( fcx, node_id, tup( none[ vec [ ty:: t] ] , typ) ) ;
446
+ ret ty_fixup( fcx, node_id, tup( none[ ty:: t[ ] ] , typ) ) ;
447
447
}
448
448
449
449
// Writes a nil type into the node type table.
450
450
fn nil_ty( & ty:: ctxt tcx, ast:: node_id node_id) {
451
- ret ty( tcx, node_id, tup( none[ vec [ ty:: t] ] , ty:: mk_nil( tcx) ) ) ;
451
+ ret ty( tcx, node_id, tup( none[ ty:: t[ ] ] , ty:: mk_nil( tcx) ) ) ;
452
452
}
453
453
454
454
// Writes the bottom type into the node type table.
455
455
fn bot_ty( & ty:: ctxt tcx, ast:: node_id node_id) {
456
- ret ty( tcx, node_id, tup( none[ vec [ ty:: t] ] , ty:: mk_bot( tcx) ) ) ;
456
+ ret ty( tcx, node_id, tup( none[ ty:: t[ ] ] , ty:: mk_bot( tcx) ) ) ;
457
457
}
458
458
}
459
459
@@ -914,24 +914,22 @@ fn resolve_type_vars_if_possible(&@fn_ctxt fcx, ty::t typ) -> ty::t {
914
914
915
915
// Demands - procedures that require that two types unify and emit an error
916
916
// message if they don't.
917
- type ty_param_substs_and_ty = tup( vec [ ty:: t] , ty:: t) ;
917
+ type ty_param_substs_and_ty = tup( ty:: t[ ] , ty:: t) ;
918
918
919
919
mod demand {
920
920
fn simple( & @fn_ctxt fcx, & span sp, & ty:: t expected, & ty:: t actual) ->
921
921
ty:: t {
922
- let vec[ ty:: t] tps = [ ] ;
923
- ret full( fcx, sp, expected, actual, tps, NO_AUTODEREF ) . _1;
922
+ ret full( fcx, sp, expected, actual, ~[ ] , NO_AUTODEREF ) . _1;
924
923
}
925
924
fn autoderef( & @fn_ctxt fcx, & span sp, & ty:: t expected, & ty:: t actual,
926
925
autoderef_kind adk) -> ty:: t {
927
- let vec[ ty:: t] tps = [ ] ;
928
- ret full( fcx, sp, expected, actual, tps, adk) . _1;
926
+ ret full( fcx, sp, expected, actual, ~[ ] , adk) . _1;
929
927
}
930
928
931
929
// Requires that the two types unify, and prints an error message if they
932
930
// don't. Returns the unified type and the type parameter substitutions.
933
931
fn full( & @fn_ctxt fcx, & span sp, & ty:: t expected, & ty:: t actual,
934
- & vec [ ty:: t] ty_param_substs_0, autoderef_kind adk) ->
932
+ & ty:: t[ ] ty_param_substs_0, autoderef_kind adk) ->
935
933
ty_param_substs_and_ty {
936
934
auto expected_1 = expected;
937
935
auto actual_1 = actual;
@@ -956,10 +954,10 @@ mod demand {
956
954
fn mk_result( & @fn_ctxt fcx, & ty:: t result_ty,
957
955
& vec[ int] ty_param_subst_var_ids,
958
956
uint implicit_boxes) -> ty_param_substs_and_ty {
959
- let vec [ ty:: t] result_ty_param_substs = [ ] ;
957
+ let ty:: t[ ] result_ty_param_substs = ~ [ ] ;
960
958
for ( int var_id in ty_param_subst_var_ids) {
961
959
auto tp_subst = ty:: mk_var( fcx. ccx. tcx, var_id) ;
962
- result_ty_param_substs += [ tp_subst] ;
960
+ result_ty_param_substs += ~ [ tp_subst] ;
963
961
}
964
962
ret tup( result_ty_param_substs,
965
963
add_boxes( fcx. ccx, implicit_boxes, result_ty) ) ;
@@ -1061,21 +1059,21 @@ mod writeback {
1061
1059
} ;
1062
1060
auto new_substs_opt;
1063
1061
alt ( tpot. _0) {
1064
- case ( none[ vec [ ty:: t] ] ) { new_substs_opt = none[ vec [ ty:: t] ] ; }
1065
- case ( some[ vec [ ty:: t] ] ( ?substs) ) {
1066
- let vec [ ty:: t] new_substs = [ ] ;
1062
+ case ( none[ ty:: t[ ] ] ) { new_substs_opt = none[ ty:: t[ ] ] ; }
1063
+ case ( some[ ty:: t[ ] ] ( ?substs) ) {
1064
+ let ty:: t[ ] new_substs = ~ [ ] ;
1067
1065
for ( ty:: t subst in substs) {
1068
1066
alt ( resolve_type_vars_in_type( fcx, sp, subst) ) {
1069
1067
case ( some( ?t) ) {
1070
- new_substs += [ t] ;
1068
+ new_substs += ~ [ t] ;
1071
1069
}
1072
1070
case ( none) {
1073
1071
wbcx. success = false;
1074
1072
ret;
1075
1073
}
1076
1074
}
1077
1075
}
1078
- new_substs_opt = some[ vec [ ty:: t] ] ( new_substs) ;
1076
+ new_substs_opt = some[ ty:: t[ ] ] ( new_substs) ;
1079
1077
}
1080
1078
}
1081
1079
write:: ty( fcx. ccx. tcx, id, tup( new_substs_opt, new_ty) ) ;
@@ -1266,11 +1264,11 @@ fn gather_locals(&@crate_ctxt ccx, &ast::fn_decl decl, &ast::block body,
1266
1264
1267
1265
// AST fragment utilities
1268
1266
fn replace_expr_type( & @fn_ctxt fcx, & @ast:: expr expr,
1269
- & tup( vec [ ty:: t] , ty:: t) new_tyt) {
1267
+ & tup( ty:: t[ ] , ty:: t) new_tyt) {
1270
1268
auto new_tps;
1271
1269
if ( ty:: expr_has_ty_params( fcx. ccx. tcx, expr) ) {
1272
- new_tps = some[ vec [ ty:: t] ] ( new_tyt. _0) ;
1273
- } else { new_tps = none[ vec [ ty:: t] ] ; }
1270
+ new_tps = some[ ty:: t[ ] ] ( new_tyt. _0) ;
1271
+ } else { new_tps = none[ ty:: t[ ] ] ; }
1274
1272
write:: ty_fixup( fcx, expr. id, tup( new_tps, new_tyt. _1) ) ;
1275
1273
}
1276
1274
@@ -1327,13 +1325,13 @@ fn check_pat(&@fn_ctxt fcx, &@ast::pat pat, ty::t expected) {
1327
1325
path_tpot) ;
1328
1326
1329
1327
// FIXME: Remove this ivec->vec conversion.
1330
- auto tps_vec = [ ] ;
1331
- for ( ty:: t tp in expected_tps) { tps_vec += [ tp] ; }
1328
+ auto tps_vec = ~ [ ] ;
1329
+ for ( ty:: t tp in expected_tps) { tps_vec += ~ [ tp] ; }
1332
1330
1333
1331
auto path_tpt =
1334
1332
demand:: full( fcx, pat. span, expected, ctor_ty, tps_vec,
1335
1333
NO_AUTODEREF ) ;
1336
- path_tpot = tup( some[ vec [ ty:: t] ] ( path_tpt. _0) , path_tpt. _1) ;
1334
+ path_tpot = tup( some[ ty:: t[ ] ] ( path_tpt. _0) , path_tpt. _1) ;
1337
1335
// Get the number of arguments in this tag variant.
1338
1336
1339
1337
auto arg_types =
0 commit comments