@@ -192,7 +192,7 @@ type field = rec(ast::ident ident, mt mt);
192
192
type method =
193
193
rec ( ast:: proto proto,
194
194
ast:: ident ident,
195
- vec [ arg] inputs ,
195
+ arg[ ] inputs,
196
196
t output,
197
197
controlflow cf,
198
198
vec[ @constr_def] constrs ) ;
@@ -266,8 +266,8 @@ tag sty {
266
266
ty_task;
267
267
ty_tup ( mt[ ] ) ;
268
268
ty_rec ( field[ ] ) ;
269
- ty_fn ( ast:: proto, vec [ arg] , t, controlflow, vec[ @constr_def] ) ;
270
- ty_native_fn ( ast:: native_abi, vec [ arg] , t) ;
269
+ ty_fn ( ast:: proto, arg[ ] , t, controlflow, vec[ @constr_def] ) ;
270
+ ty_native_fn ( ast:: native_abi, arg[ ] , t) ;
271
271
ty_obj ( vec[ method] ) ;
272
272
ty_res ( def_id, t, vec[ t] ) ;
273
273
ty_var ( int) ; // type variable
@@ -445,7 +445,7 @@ fn mk_raw_ty(&ctxt cx, &sty st, &option::t[str] cname) -> raw_t {
445
445
derive_flags_t ( cx, has_params, has_vars, a. ty ) ;
446
446
}
447
447
fn derive_flags_sig( & ctxt cx, & mutable bool has_params ,
448
- & mutable bool has_vars , & vec [ arg] args , & t tt ) {
448
+ & mutable bool has_vars , & arg[ ] args, & t tt) {
449
449
for ( arg a in args) { derive_flags_arg( cx, has_params, has_vars, a) ; }
450
450
derive_flags_t( cx, has_params, has_vars, tt) ;
451
451
}
@@ -597,12 +597,12 @@ fn mk_imm_tup(&ctxt cx, &t[] tys) -> t {
597
597
598
598
fn mk_rec( & ctxt cx, & field[ ] fs) -> t { ret gen_ty( cx , ty_rec ( fs ) ) ; }
599
599
600
- fn mk_fn( & ctxt cx, & ast:: proto proto, & vec [ arg] args, & t ty, & controlflow cf,
600
+ fn mk_fn( & ctxt cx, & ast:: proto proto, & arg[ ] args, & t ty, & controlflow cf,
601
601
& vec[ @constr_def] constrs) -> t {
602
602
ret gen_ty( cx , ty_fn ( proto , args , ty , cf , constrs ) ) ;
603
603
}
604
604
605
- fn mk_native_fn( & ctxt cx, & ast:: native_abi abi, & vec [ arg] args, & t ty) -> t {
605
+ fn mk_native_fn( & ctxt cx, & ast:: native_abi abi, & arg[ ] args, & t ty) -> t {
606
606
ret gen_ty( cx, ty_native_fn( abi, args, ty) ) ;
607
607
}
608
608
@@ -792,21 +792,21 @@ fn fold_ty(&ctxt cx, fold_mode fld, t ty_0) -> t {
792
792
ty = copy_cname( cx, mk_rec( cx, new_fields) , ty) ;
793
793
}
794
794
case ( ty_fn( ?proto, ?args, ?ret_ty, ?cf, ?constrs) ) {
795
- let vec [ arg] new_args = [ ] ;
795
+ let arg[ ] new_args = ~ [ ] ;
796
796
for ( arg a in args) {
797
797
auto new_ty = fold_ty( cx, fld, a. ty) ;
798
- new_args += [ rec( mode=a. mode, ty=new_ty) ] ;
798
+ new_args += ~ [ rec( mode=a. mode, ty=new_ty) ] ;
799
799
}
800
800
ty =
801
801
copy_cname( cx,
802
802
mk_fn( cx, proto, new_args,
803
803
fold_ty( cx, fld, ret_ty) , cf, constrs) , ty) ;
804
804
}
805
805
case ( ty_native_fn( ?abi, ?args, ?ret_ty) ) {
806
- let vec [ arg] new_args = [ ] ;
806
+ let arg[ ] new_args = ~ [ ] ;
807
807
for ( arg a in args) {
808
808
auto new_ty = fold_ty( cx, fld, a. ty) ;
809
- new_args += [ rec( mode=a. mode, ty=new_ty) ] ;
809
+ new_args += ~ [ rec( mode=a. mode, ty=new_ty) ] ;
810
810
}
811
811
ty =
812
812
copy_cname( cx,
@@ -816,9 +816,10 @@ fn fold_ty(&ctxt cx, fold_mode fld, t ty_0) -> t {
816
816
case ( ty_obj( ?methods) ) {
817
817
let vec[ method] new_methods = [ ] ;
818
818
for ( method m in methods) {
819
- let vec [ arg] new_args = [ ] ;
819
+ let arg[ ] new_args = ~ [ ] ;
820
820
for ( arg a in m. inputs) {
821
- new_args += [ rec( mode=a. mode, ty=fold_ty( cx, fld, a. ty) ) ] ;
821
+ new_args += ~[ rec( mode=a. mode,
822
+ ty=fold_ty( cx, fld, a. ty) ) ] ;
822
823
}
823
824
new_methods +=
824
825
[ rec( proto=m. proto,
@@ -1302,7 +1303,7 @@ fn hash_type_structure(&sty st) -> uint {
1302
1303
h += h << 5 u + hash_ty( subty) ;
1303
1304
ret h;
1304
1305
}
1305
- fn hash_fn( uint id, & vec [ arg] args, & t rty) -> uint {
1306
+ fn hash_fn( uint id, & arg[ ] args, & t rty) -> uint {
1306
1307
auto h = id;
1307
1308
for ( arg a in args) { h += h << 5 u + hash_ty( a. ty) ; }
1308
1309
h += h << 5 u + hash_ty( rty) ;
@@ -1448,11 +1449,11 @@ fn equal_type_structures(&sty a, &sty b) -> bool {
1448
1449
fn equal_mt( & mt a, & mt b) -> bool {
1449
1450
ret a. mut == b. mut && eq_ty( a. ty, b. ty) ;
1450
1451
}
1451
- fn equal_fn( & vec [ arg] args_a, & t rty_a, & vec [ arg] args_b, & t rty_b) ->
1452
+ fn equal_fn( & arg[ ] args_a, & t rty_a, & arg[ ] args_b, & t rty_b) ->
1452
1453
bool {
1453
1454
if ( !eq_ty( rty_a, rty_b) ) { ret false; }
1454
- auto len = vec :: len[ arg] ( args_a) ;
1455
- if ( len != vec :: len[ arg] ( args_b) ) { ret false; }
1455
+ auto len = ivec :: len[ arg] ( args_a) ;
1456
+ if ( len != ivec :: len[ arg] ( args_b) ) { ret false; }
1456
1457
auto i = 0 u;
1457
1458
while ( i < len) {
1458
1459
auto arg_a = args_a. ( i) ;
@@ -1788,7 +1789,7 @@ fn type_contains_params(&ctxt cx, &t typ) -> bool {
1788
1789
1789
1790
1790
1791
// Type accessors for substructures of types
1791
- fn ty_fn_args( & ctxt cx, & t fty) -> vec [ arg] {
1792
+ fn ty_fn_args( & ctxt cx, & t fty) -> arg[ ] {
1792
1793
alt ( struct ( cx, fty) ) {
1793
1794
case ( ty:: ty_fn( _, ?a, _, _, _) ) { ret a; }
1794
1795
case ( ty:: ty_native_fn( _, ?a, _) ) { ret a; }
@@ -2073,20 +2074,20 @@ mod unify {
2073
2074
}
2074
2075
tag fn_common_res {
2075
2076
fn_common_res_err( result) ;
2076
- fn_common_res_ok( vec [ arg] , t) ;
2077
+ fn_common_res_ok( arg[ ] , t) ;
2077
2078
}
2078
2079
fn unify_fn_common( & @ctxt cx, & t expected, & t actual,
2079
- & vec [ arg] expected_inputs, & t expected_output,
2080
- & vec [ arg] actual_inputs, & t actual_output) ->
2080
+ & arg[ ] expected_inputs, & t expected_output,
2081
+ & arg[ ] actual_inputs, & t actual_output) ->
2081
2082
fn_common_res {
2082
- auto expected_len = vec :: len[ arg] ( expected_inputs) ;
2083
- auto actual_len = vec :: len[ arg] ( actual_inputs) ;
2083
+ auto expected_len = ivec :: len[ arg] ( expected_inputs) ;
2084
+ auto actual_len = ivec :: len[ arg] ( actual_inputs) ;
2084
2085
if ( expected_len != actual_len) {
2085
2086
ret fn_common_res_err( ures_err( terr_arg_count) ) ;
2086
2087
}
2087
2088
// TODO: as above, we should have an iter2 iterator.
2088
2089
2089
- let vec [ arg] result_ins = [ ] ;
2090
+ let arg[ ] result_ins = ~ [ ] ;
2090
2091
auto i = 0 u;
2091
2092
while ( i < expected_len) {
2092
2093
auto expected_input = expected_inputs. ( i) ;
@@ -2101,7 +2102,7 @@ mod unify {
2101
2102
auto result = unify_step( cx, expected_input. ty, actual_input. ty) ;
2102
2103
alt ( result) {
2103
2104
case ( ures_ok( ?rty) ) {
2104
- result_ins += [ rec( mode=result_mode, ty=rty) ] ;
2105
+ result_ins += ~ [ rec( mode=result_mode, ty=rty) ] ;
2105
2106
}
2106
2107
case ( _) { ret fn_common_res_err( result) ; }
2107
2108
}
@@ -2116,8 +2117,8 @@ mod unify {
2116
2117
}
2117
2118
}
2118
2119
fn unify_fn( & @ctxt cx, & ast:: proto e_proto, & ast:: proto a_proto,
2119
- & t expected, & t actual, & vec [ arg] expected_inputs,
2120
- & t expected_output, & vec [ arg] actual_inputs, & t actual_output,
2120
+ & t expected, & t actual, & arg[ ] expected_inputs,
2121
+ & t expected_output, & arg[ ] actual_inputs, & t actual_output,
2121
2122
& controlflow expected_cf, & controlflow actual_cf,
2122
2123
& vec[ @constr_def] expected_constrs,
2123
2124
& vec[ @constr_def] actual_constrs) -> result {
@@ -2158,8 +2159,8 @@ mod unify {
2158
2159
}
2159
2160
fn unify_native_fn( & @ctxt cx, & ast:: native_abi e_abi,
2160
2161
& ast:: native_abi a_abi, & t expected, & t actual,
2161
- & vec [ arg] expected_inputs, & t expected_output,
2162
- & vec [ arg] actual_inputs, & t actual_output) -> result {
2162
+ & arg[ ] expected_inputs, & t expected_output,
2163
+ & arg[ ] actual_inputs, & t actual_output) -> result {
2163
2164
if ( e_abi != a_abi) { ret ures_err( terr_mismatch) ; }
2164
2165
auto t =
2165
2166
unify_fn_common( cx, expected, actual, expected_inputs,
0 commit comments