@@ -162,7 +162,7 @@ fn type_of(cx: @crate_ctxt, t: ty::t) -> TypeRef {
162
162
163
163
fn type_of_enum ( cx : @crate_ctxt , did : ast:: def_id , t : ty:: t )
164
164
-> TypeRef {
165
- let degen = vec :: len ( * ty:: enum_variants ( cx. tcx , did) ) == 1 u;
165
+ let degen = ( * ty:: enum_variants ( cx. tcx , did) ) . len ( ) == 1 u;
166
166
if check type_has_static_size ( cx, t) {
167
167
let size = static_size_of_enum ( cx, t) ;
168
168
if !degen { T_enum ( cx, size) }
@@ -289,7 +289,7 @@ fn get_simple_extern_fn(cx: @block_ctxt,
289
289
fn trans_native_call ( cx : @block_ctxt , externs : hashmap < str , ValueRef > ,
290
290
llmod : ModuleRef , name : str , args : [ ValueRef ] ) ->
291
291
ValueRef {
292
- let n: int = vec :: len :: < ValueRef > ( args ) as int ;
292
+ let n = args . len ( ) as int ;
293
293
let llnative: ValueRef =
294
294
get_simple_extern_fn ( cx, externs, llmod, name, n) ;
295
295
let call_args: [ ValueRef ] = [ ] ;
@@ -388,7 +388,7 @@ fn GEP_tup_like(bcx: @block_ctxt, t: ty::t, base: ValueRef, ixs: [int])
388
388
t : ty:: t ,
389
389
ixs : [ int ] ,
390
390
n : uint ) -> ( @block_ctxt , ValueRef , ty:: t ) {
391
- if n == vec :: len ( ixs ) {
391
+ if n == ixs . len ( ) {
392
392
ret ( bcx, off, t) ;
393
393
}
394
394
@@ -638,8 +638,8 @@ fn get_derived_tydesc(cx: @block_ctxt, t: ty::t, escapes: bool,
638
638
// promising to do so itself.
639
639
let n_params = ty:: count_ty_params ( bcx_tcx ( bcx) , t) ;
640
640
641
- assert ( n_params == vec :: len :: < uint > ( tys. params ) ) ;
642
- assert ( n_params == vec :: len :: < ValueRef > ( tys. descs ) ) ;
641
+ assert n_params == tys. params . len ( ) ;
642
+ assert n_params == tys. descs . len ( ) ;
643
643
644
644
let llparamtydescs =
645
645
alloca ( bcx, T_array ( T_ptr ( bcx_ccx ( bcx) . tydesc_type ) , n_params + 1 u) ) ;
@@ -687,7 +687,7 @@ fn get_tydesc(cx: @block_ctxt, t: ty::t, escapes: bool,
687
687
// Is the supplied type a type param? If so, return the passed-in tydesc.
688
688
alt ty:: type_param ( t) {
689
689
some ( id) {
690
- if id < vec :: len ( cx. fcx . lltyparams ) {
690
+ if id < cx. fcx . lltyparams . len ( ) {
691
691
ret { kind : tk_param,
692
692
result : rslt ( cx, cx. fcx . lltyparams [ id] . desc ) } ;
693
693
} else {
@@ -821,7 +821,7 @@ fn make_generic_glue_inner(ccx: @crate_ctxt, t: ty::t,
821
821
T_ptr ( type_of ( ccx, t) )
822
822
} else { T_ptr ( T_i8 ( ) ) } ;
823
823
824
- let ty_param_count = vec :: len ( ty_params ) ;
824
+ let ty_param_count = ty_params . len ( ) ;
825
825
let lltyparams = llvm:: LLVMGetParam ( llfn, 2 u as c_uint ) ;
826
826
let load_env_bcx = new_raw_block_ctxt ( fcx, fcx. llloadenv ) ;
827
827
let lltydescs = [ mutable] ;
@@ -1072,7 +1072,7 @@ fn trans_res_drop(cx: @block_ctxt, rs: ValueRef, did: ast::def_id,
1072
1072
// for type variables.
1073
1073
let val_llty = lib:: llvm:: fn_ty_param_tys
1074
1074
( llvm:: LLVMGetElementType
1075
- ( llvm:: LLVMTypeOf ( dtor_addr) ) ) [ vec :: len ( args ) ] ;
1075
+ ( llvm:: LLVMTypeOf ( dtor_addr) ) ) [ args . len ( ) ] ;
1076
1076
let val_cast = BitCast ( cx, val. val , val_llty) ;
1077
1077
Call ( cx, dtor_addr, args + [ val_cast] ) ;
1078
1078
@@ -1244,7 +1244,7 @@ fn iter_structural_ty(cx: @block_ctxt, av: ValueRef, t: ty::t,
1244
1244
fn iter_variant ( cx : @block_ctxt , a_tup : ValueRef ,
1245
1245
variant : ty:: variant_info , tps : [ ty:: t ] , tid : ast:: def_id ,
1246
1246
f : val_and_ty_fn ) -> @block_ctxt {
1247
- if vec :: len :: < ty :: t > ( variant. args ) == 0 u { ret cx; }
1247
+ if variant. args . len ( ) == 0 u { ret cx; }
1248
1248
let fn_ty = variant. ctor_ty ;
1249
1249
let ccx = bcx_ccx ( cx) ;
1250
1250
let cx = cx;
@@ -1299,7 +1299,7 @@ fn iter_structural_ty(cx: @block_ctxt, av: ValueRef, t: ty::t,
1299
1299
}
1300
1300
ty:: ty_enum ( tid, tps) {
1301
1301
let variants = ty:: enum_variants ( bcx_tcx ( cx) , tid) ;
1302
- let n_variants = vec :: len ( * variants) ;
1302
+ let n_variants = ( * variants) . len ( ) ;
1303
1303
1304
1304
// Cast the enums to types we can GEP into.
1305
1305
if n_variants == 1 u {
@@ -1912,8 +1912,7 @@ fn autoderef(cx: @block_ctxt, v: ValueRef, t: ty::t) -> result_t {
1912
1912
}
1913
1913
ty:: ty_enum ( did, tps) {
1914
1914
let variants = ty:: enum_variants ( ccx. tcx , did) ;
1915
- if vec:: len ( * variants) != 1 u ||
1916
- vec:: len ( variants[ 0 ] . args ) != 1 u {
1915
+ if ( * variants) . len ( ) != 1 u || variants[ 0 ] . args . len ( ) != 1 u {
1917
1916
break ;
1918
1917
}
1919
1918
t1 =
@@ -2278,7 +2277,7 @@ fn monomorphic_fn(ccx: @crate_ctxt, fn_id: ast::def_id, substs: [ty::t],
2278
2277
let this_tv = option:: get ( vec:: find ( * tvs, { |tv|
2279
2278
tv. id . node == fn_id. node } ) ) ;
2280
2279
trans_enum_variant ( ccx, enum_id. node , v, this_tv. disr_val ,
2281
- vec :: len ( * tvs) == 1 u, [ ] , psubsts, lldecl) ;
2280
+ ( * tvs) . len ( ) == 1 u, [ ] , psubsts, lldecl) ;
2282
2281
}
2283
2282
ast_map:: node_method ( mth, impl_id, _) {
2284
2283
let selfty = ty:: node_id_to_type ( ccx. tcx , impl_id) ;
@@ -2301,12 +2300,12 @@ fn lval_static_fn(bcx: @block_ctxt, fn_id: ast::def_id, id: ast::node_id,
2301
2300
// monomorphized and non-monomorphized functions at the moment. If
2302
2301
// monomorphizing becomes the only approach, this'll be much simpler.
2303
2302
if ccx. sess . opts . monomorphize &&
2304
- ( option:: is_some ( substs) || vec :: len ( tys ) > 0 u) &&
2303
+ ( option:: is_some ( substs) || tys . len ( ) > 0 u) &&
2305
2304
fn_id. crate == ast:: local_crate &&
2306
2305
!vec:: any ( tys, { |t| ty:: type_has_params ( t) } ) {
2307
2306
let mono = alt substs {
2308
2307
some( ( stys, dicts) ) {
2309
- if ( vec :: len ( stys ) + vec :: len ( tys ) ) > 0 u {
2308
+ if ( stys . len ( ) + tys . len ( ) ) > 0 u {
2310
2309
monomorphic_fn ( ccx, fn_id, stys + tys, some ( dicts) )
2311
2310
} else { none }
2312
2311
}
@@ -2340,7 +2339,7 @@ fn lval_static_fn(bcx: @block_ctxt, fn_id: ast::def_id, id: ast::node_id,
2340
2339
trans_external_path ( bcx, fn_id, tpt)
2341
2340
} ;
2342
2341
let gen = generic_none, bcx = bcx;
2343
- if vec :: len ( tys ) > 0 u {
2342
+ if tys . len ( ) > 0 u {
2344
2343
let tydescs = [ ] , tis = [ ] ;
2345
2344
for t in tys {
2346
2345
// TODO: Doesn't always escape.
@@ -2424,7 +2423,7 @@ fn trans_var(cx: @block_ctxt, def: ast::def, id: ast::node_id)
2424
2423
ret lval_static_fn ( cx, did, id, none) ;
2425
2424
}
2426
2425
ast:: def_variant ( tid, vid) {
2427
- if vec :: len ( ty:: enum_variant_with_id ( ccx. tcx , tid, vid) . args ) > 0 u {
2426
+ if ty:: enum_variant_with_id ( ccx. tcx , tid, vid) . args . len ( ) > 0 u {
2428
2427
// N-ary variant.
2429
2428
ret lval_static_fn ( cx, vid, id, none) ;
2430
2429
} else {
@@ -2616,7 +2615,7 @@ fn maybe_add_env(bcx: @block_ctxt, c: lval_maybe_callee)
2616
2615
fn lval_maybe_callee_to_lval ( c : lval_maybe_callee , ty : ty:: t ) -> lval_result {
2617
2616
alt c. generic {
2618
2617
generic_full ( gi) {
2619
- let n_args = vec :: len ( ty:: ty_fn_args ( ty) ) ;
2618
+ let n_args = ty:: ty_fn_args ( ty) . len ( ) ;
2620
2619
let args = vec:: init_elt ( n_args, none :: < @ast:: expr > ) ;
2621
2620
let space = alloc_ty ( c. bcx , ty) ;
2622
2621
let bcx = closure:: trans_bind_1 ( space. bcx , ty, c, args, ty,
@@ -3877,10 +3876,8 @@ fn new_raw_block_ctxt(fcx: @fn_ctxt, llbb: BasicBlockRef) -> @block_ctxt {
3877
3876
fn trans_block_cleanups ( bcx : @block_ctxt , cleanup_cx : @block_ctxt ) ->
3878
3877
@block_ctxt {
3879
3878
if bcx. unreachable { ret bcx; }
3880
- if cleanup_cx. kind == NON_SCOPE_BLOCK {
3881
- assert ( vec:: len :: < cleanup > ( cleanup_cx. cleanups ) == 0 u) ;
3882
- }
3883
- let i = vec:: len :: < cleanup > ( cleanup_cx. cleanups ) , bcx = bcx;
3879
+ let i = cleanup_cx. cleanups . len ( ) , bcx = bcx;
3880
+ if cleanup_cx. kind == NON_SCOPE_BLOCK { assert i == 0 u; }
3884
3881
while i > 0 u {
3885
3882
i -= 1 u;
3886
3883
let c = cleanup_cx. cleanups [ i] ;
@@ -4535,7 +4532,7 @@ fn trans_native_mod(ccx: @crate_ctxt,
4535
4532
let bcx = new_top_block_ctxt ( fcx, none) ;
4536
4533
let lltop = bcx. llbb ;
4537
4534
let llargbundle = llvm:: LLVMGetParam ( llshimfn, 0 as c_uint ) ;
4538
- let i = 0 u, n = vec :: len ( tys. arg_tys ) ;
4535
+ let i = 0 u, n = tys. arg_tys . len ( ) ;
4539
4536
let llargvals = [ ] ;
4540
4537
while i < n {
4541
4538
let llargval = load_inbounds ( bcx, llargbundle, [ 0 , i as int ] ) ;
@@ -4573,7 +4570,7 @@ fn trans_native_mod(ccx: @crate_ctxt,
4573
4570
4574
4571
// Allocate the struct and write the arguments into it.
4575
4572
let llargbundle = alloca ( bcx, tys. bundle_ty ) ;
4576
- let i = 0 u, n = vec :: len ( tys. arg_tys ) ;
4573
+ let i = 0 u, n = tys. arg_tys . len ( ) ;
4577
4574
let implicit_args = 2 u + num_tps; // ret + env
4578
4575
while i < n {
4579
4576
let llargval = llvm:: LLVMGetParam ( llwrapfn,
@@ -4608,7 +4605,7 @@ fn trans_native_mod(ccx: @crate_ctxt,
4608
4605
alt ccx. item_ids . find ( id) {
4609
4606
some ( llwrapfn) {
4610
4607
let llshimfn = build_shim_fn ( ccx, native_item, tys, cc) ;
4611
- build_wrap_fn ( ccx, tys, vec :: len ( tps ) , llshimfn, llwrapfn) ;
4608
+ build_wrap_fn ( ccx, tys, tps . len ( ) , llshimfn, llwrapfn) ;
4612
4609
}
4613
4610
none {
4614
4611
ccx. sess . span_fatal (
@@ -4661,11 +4658,11 @@ fn trans_item(ccx: @crate_ctxt, item: ast::item) {
4661
4658
trans_mod ( ccx, m) ;
4662
4659
}
4663
4660
ast:: item_enum ( variants, tps) {
4664
- let degen = vec :: len ( variants ) == 1 u;
4661
+ let degen = variants . len ( ) == 1 u;
4665
4662
let vi = ty:: enum_variants ( ccx. tcx , local_def ( item. id ) ) ;
4666
4663
let i = 0 ;
4667
4664
for variant: ast:: variant in variants {
4668
- if vec :: len ( variant. node . args ) > 0 u {
4665
+ if variant. node . args . len ( ) > 0 u {
4669
4666
trans_enum_variant ( ccx, item. id , variant,
4670
4667
vi[ i] . disr_val , degen, tps,
4671
4668
none, ccx. item_ids . get ( variant. node . id ) ) ;
@@ -4737,7 +4734,7 @@ fn create_main_wrapper(ccx: @crate_ctxt, sp: span, main_llfn: ValueRef,
4737
4734
let main_takes_argv =
4738
4735
// invariant!
4739
4736
alt ty:: get ( main_node_type) . struct {
4740
- ty:: ty_fn ( { inputs, _} ) { vec :: len ( inputs ) != 0 u }
4737
+ ty:: ty_fn ( { inputs, _} ) { inputs . len ( ) != 0 u }
4741
4738
_ { ccx. sess . span_fatal ( sp, "main has a non-function type" ) ; }
4742
4739
} ;
4743
4740
@@ -4800,7 +4797,7 @@ fn create_main_wrapper(ccx: @crate_ctxt, sp: span, main_llfn: ValueRef,
4800
4797
llvm:: LLVMGetParam ( llfn, 1 as c_uint ) , crate_map] ;
4801
4798
let result = unsafe {
4802
4799
llvm:: LLVMBuildCall ( bld, start, vec:: to_ptr ( args) ,
4803
- vec :: len ( args ) as c_uint , noname ( ) )
4800
+ args . len ( ) as c_uint , noname ( ) )
4804
4801
} ;
4805
4802
llvm:: LLVMBuildRet ( bld, result) ;
4806
4803
}
@@ -4938,7 +4935,7 @@ fn collect_item(ccx: @crate_ctxt, abi: @mutable option<ast::native_abi>,
4938
4935
}
4939
4936
ast:: item_enum ( variants, tps) {
4940
4937
for variant in variants {
4941
- if vec :: len ( variant. node . args ) != 0 u {
4938
+ if variant. node . args . len ( ) != 0 u {
4942
4939
register_fn ( ccx, i. span ,
4943
4940
my_path + [ path_name ( variant. node . name ) ] ,
4944
4941
"enum" , tps, variant. node . id ) ;
0 commit comments