@@ -80,22 +80,22 @@ fn ty_param_bounds_and_ty_for_def(fcx: @fn_ctxt, sp: span, defn: ast::def) ->
80
80
ast : : def_arg ( id, _) {
81
81
assert ( fcx. locals . contains_key ( id. node ) ) ;
82
82
let typ = ty:: mk_var ( fcx. ccx . tcx , lookup_local ( fcx, sp, id. node ) ) ;
83
- ret @ { bounds : [ ] , ty : typ} ;
83
+ ret { bounds : @ [ ] , ty : typ} ;
84
84
}
85
85
ast:: def_local ( id, _) {
86
86
assert ( fcx. locals . contains_key ( id. node ) ) ;
87
87
let typ = ty:: mk_var ( fcx. ccx . tcx , lookup_local ( fcx, sp, id. node ) ) ;
88
- ret @ { bounds : [ ] , ty : typ} ;
88
+ ret { bounds : @ [ ] , ty : typ} ;
89
89
}
90
90
ast:: def_obj_field ( id, _) {
91
91
assert ( fcx. locals . contains_key ( id. node ) ) ;
92
92
let typ = ty:: mk_var ( fcx. ccx . tcx , lookup_local ( fcx, sp, id. node ) ) ;
93
- ret @ { bounds : [ ] , ty : typ} ;
93
+ ret { bounds : @ [ ] , ty : typ} ;
94
94
}
95
95
ast:: def_self ( id) {
96
96
alt get_self_info ( fcx. ccx ) {
97
97
some ( self_obj ( _, obj_t) ) | some ( self_impl ( obj_t) ) {
98
- ret @ { bounds : [ ] , ty : obj_t} ;
98
+ ret { bounds : @ [ ] , ty : obj_t} ;
99
99
}
100
100
}
101
101
}
@@ -106,12 +106,12 @@ fn ty_param_bounds_and_ty_for_def(fcx: @fn_ctxt, sp: span, defn: ast::def) ->
106
106
ast:: def_binding ( id) {
107
107
assert ( fcx. locals . contains_key ( id. node ) ) ;
108
108
let typ = ty:: mk_var ( fcx. ccx . tcx , lookup_local ( fcx, sp, id. node ) ) ;
109
- ret @ { bounds : [ ] , ty : typ} ;
109
+ ret { bounds : @ [ ] , ty : typ} ;
110
110
}
111
111
ast:: def_mod ( _) {
112
112
// Hopefully part of a path.
113
113
// TODO: return a type that's more poisonous, perhaps?
114
- ret @ { bounds : [ ] , ty : ty:: mk_nil ( fcx. ccx . tcx ) } ;
114
+ ret { bounds : @ [ ] , ty : ty:: mk_nil ( fcx. ccx . tcx ) } ;
115
115
}
116
116
ast:: def_ty ( _) {
117
117
fcx. ccx . tcx . sess . span_fatal ( sp, "expected value but found type" ) ;
@@ -132,7 +132,7 @@ fn ty_param_bounds_and_ty_for_def(fcx: @fn_ctxt, sp: span, defn: ast::def) ->
132
132
fn instantiate_path ( fcx : @fn_ctxt , pth : @ast:: path ,
133
133
tpt : ty_param_bounds_and_ty , sp : span )
134
134
-> ty_param_substs_opt_and_ty {
135
- let ty_param_count = vec:: len ( tpt. bounds ) ;
135
+ let ty_param_count = vec:: len ( * tpt. bounds ) ;
136
136
let bind_result =
137
137
bind_params_in_type ( sp, fcx. ccx . tcx , bind next_ty_var_id ( fcx) , tpt. ty ,
138
138
ty_param_count) ;
@@ -286,13 +286,13 @@ fn ast_ty_to_ty(tcx: ty::ctxt, mode: mode, &&ast_ty: @ast::ty) -> ty::t {
286
286
// "foo = int" like OCaml?
287
287
288
288
let ty_param_bounds_and_ty = getter ( tcx, mode, id) ;
289
- if vec:: len ( ty_param_bounds_and_ty. bounds ) == 0 u {
289
+ if vec:: len ( * ty_param_bounds_and_ty. bounds ) == 0 u {
290
290
ret ty_param_bounds_and_ty. ty ;
291
291
}
292
292
293
293
// The typedef is type-parametric. Do the type substitution.
294
294
let param_bindings: [ ty:: t ] = [ ] ;
295
- if vec:: len ( args) != vec:: len ( ty_param_bounds_and_ty. bounds ) {
295
+ if vec:: len ( args) != vec:: len ( * ty_param_bounds_and_ty. bounds ) {
296
296
tcx. sess . span_fatal ( sp, "Wrong number of type arguments for a \
297
297
polymorphic type") ;
298
298
}
@@ -386,7 +386,7 @@ fn ty_of_item(tcx: ty::ctxt, mode: mode, it: @ast::item)
386
386
alt it. node {
387
387
ast:: item_const ( t, _) {
388
388
let typ = ast_ty_to_ty ( tcx, mode, t) ;
389
- let tpt = @ { bounds: [ ] , ty: typ} ;
389
+ let tpt = { bounds: @ [ ] , ty: typ} ;
390
390
tcx. tcache . insert ( local_def ( it. id ) , tpt) ;
391
391
ret tpt;
392
392
}
@@ -405,7 +405,7 @@ fn ty_of_item(tcx: ty::ctxt, mode: mode, it: @ast::item)
405
405
}
406
406
// Tell ast_ty_to_ty() that we want to perform a recursive
407
407
// call to resolve any named types.
408
- let tpt = @ { bounds: ty_param_bounds ( tcx, mode, tps) ,
408
+ let tpt = { bounds: ty_param_bounds ( tcx, mode, tps) ,
409
409
ty: ty:: mk_named ( tcx, ast_ty_to_ty ( tcx, mode, t) ,
410
410
@it. ident ) } ;
411
411
tcx. tcache . insert ( local_def ( it. id ) , tpt) ;
@@ -417,7 +417,7 @@ fn ty_of_item(tcx: ty::ctxt, mode: mode, it: @ast::item)
417
417
let t = ty:: mk_named ( tcx, ty:: mk_res ( tcx, local_def ( it. id ) , t_arg. ty ,
418
418
params) ,
419
419
@it. ident ) ;
420
- let t_res = @ { bounds: bounds, ty: t} ;
420
+ let t_res = { bounds: bounds, ty: t} ;
421
421
tcx. tcache . insert ( local_def ( it. id ) , t_res) ;
422
422
ret t_res;
423
423
}
@@ -426,7 +426,7 @@ fn ty_of_item(tcx: ty::ctxt, mode: mode, it: @ast::item)
426
426
let { bounds, params} = mk_ty_params ( tcx, tps) ;
427
427
let t = ty:: mk_named ( tcx, ty:: mk_tag ( tcx, local_def ( it. id ) , params) ,
428
428
@it. ident ) ;
429
- let tpt = @ { bounds: bounds, ty: t} ;
429
+ let tpt = { bounds: bounds, ty: t} ;
430
430
tcx. tcache . insert ( local_def ( it. id ) , tpt) ;
431
431
ret tpt;
432
432
}
@@ -435,7 +435,7 @@ fn ty_of_item(tcx: ty::ctxt, mode: mode, it: @ast::item)
435
435
let t = ty:: mk_named ( tcx, ty:: mk_iface ( tcx, local_def ( it. id ) ,
436
436
params) ,
437
437
@it. ident ) ;
438
- let tpt = @ { bounds: bounds, ty: t} ;
438
+ let tpt = { bounds: bounds, ty: t} ;
439
439
tcx. tcache . insert ( local_def ( it. id ) , tpt) ;
440
440
ty:: store_iface_methods ( tcx, it. id , @vec:: map ( ms, { |m|
441
441
ty_of_ty_method ( tcx, m_collect, m)
@@ -459,7 +459,7 @@ fn ty_of_native_item(tcx: ty::ctxt, mode: mode, it: @ast::native_item)
459
459
none. { }
460
460
}
461
461
let t = ty:: mk_native ( tcx, ast_util:: local_def ( it. id ) ) ;
462
- let tpt = @ { bounds: [ ] , ty: t} ;
462
+ let tpt = { bounds: @ [ ] , ty: t} ;
463
463
tcx. tcache . insert ( local_def ( it. id ) , tpt) ;
464
464
ret tpt;
465
465
}
@@ -487,7 +487,7 @@ fn ty_of_fn(tcx: ty::ctxt, mode: mode, decl: ast::fn_decl,
487
487
-> ty:: ty_param_bounds_and_ty {
488
488
let bounds = ty_param_bounds ( tcx, mode, ty_params) ;
489
489
let tofd = ty_of_fn_decl ( tcx, mode, ast:: proto_bare, decl) ;
490
- let tpt = @ { bounds: bounds, ty: ty:: mk_fn ( tcx, tofd) } ;
490
+ let tpt = { bounds: bounds, ty: ty:: mk_fn ( tcx, tofd) } ;
491
491
tcx. tcache . insert ( def_id, tpt) ;
492
492
ret tpt;
493
493
}
@@ -499,12 +499,12 @@ fn ty_of_native_fn_decl(tcx: ty::ctxt, mode: mode, decl: ast::fn_decl,
499
499
let output_ty = ast_ty_to_ty ( tcx, mode, decl. output ) ;
500
500
501
501
let t_fn = ty:: mk_native_fn ( tcx, input_tys, output_ty) ;
502
- let tpt = @ { bounds: bounds, ty: t_fn} ;
502
+ let tpt = { bounds: bounds, ty: t_fn} ;
503
503
tcx. tcache . insert ( def_id, tpt) ;
504
504
ret tpt;
505
505
}
506
506
fn ty_param_bounds ( tcx : ty:: ctxt , mode : mode , params : [ ast:: ty_param ] )
507
- -> [ ty:: param_bounds ] {
507
+ -> @ [ ty:: param_bounds ] {
508
508
let result = [ ] ;
509
509
for param in params {
510
510
result += [ alt tcx. ty_param_bounds . find ( local_def ( param. id ) ) {
@@ -526,7 +526,7 @@ fn ty_param_bounds(tcx: ty::ctxt, mode: mode, params: [ast::ty_param])
526
526
}
527
527
} ] ;
528
528
}
529
- result
529
+ @ result
530
530
}
531
531
fn ty_of_method ( tcx : ty:: ctxt , mode : mode , m : @ast:: method ) -> ty:: method {
532
532
{ ident: m. ident , tps: ty_param_bounds ( tcx, mode, m. tps ) ,
@@ -543,7 +543,7 @@ fn ty_of_obj(tcx: ty::ctxt, mode: mode, id: ast::ident, ob: ast::_obj,
543
543
let methods = vec:: map ( ob. methods , { |m| ty_of_method ( tcx, mode, m) } ) ;
544
544
let t_obj = ty:: mk_named ( tcx, ty:: mk_obj ( tcx, ty:: sort_methods ( methods) ) ,
545
545
@id) ;
546
- ret @ { bounds : bounds, ty : t_obj} ;
546
+ ret { bounds : bounds, ty : t_obj} ;
547
547
}
548
548
fn ty_of_obj_ctor ( tcx : ty:: ctxt , mode : mode , id : ast:: ident , ob : ast:: _obj ,
549
549
ctor_id : ast:: node_id , ty_params : [ ast:: ty_param ] )
@@ -557,7 +557,7 @@ fn ty_of_obj_ctor(tcx: ty::ctxt, mode: mode, id: ast::ident, ob: ast::_obj,
557
557
let t_fn = ty:: mk_fn ( tcx, { proto: ast:: proto_shared ( ast:: sugar_normal) ,
558
558
inputs: t_inputs, output: t_obj. ty ,
559
559
ret_style: ast:: return_val, constraints: [ ] } ) ;
560
- let tpt = @ { bounds: ty_param_bounds ( tcx, mode, ty_params) , ty: t_fn} ;
560
+ let tpt = { bounds: ty_param_bounds ( tcx, mode, ty_params) , ty: t_fn} ;
561
561
tcx. tcache . insert ( local_def ( ctor_id) , tpt) ;
562
562
ret tpt;
563
563
}
@@ -626,7 +626,7 @@ mod write {
626
626
}
627
627
628
628
fn mk_ty_params ( tcx : ty:: ctxt , atps : [ ast:: ty_param ] )
629
- -> { bounds : [ ty:: param_bounds ] , params : [ ty:: t ] } {
629
+ -> { bounds : @ [ ty:: param_bounds ] , params : [ ty:: t ] } {
630
630
let i = 0 u, bounds = ty_param_bounds ( tcx, m_collect, atps) ;
631
631
{ bounds: bounds,
632
632
params: vec:: map ( atps, { |atp|
@@ -678,7 +678,7 @@ mod collect {
678
678
inputs: args, output: tag_ty,
679
679
ret_style: ast:: return_val, constraints: [ ] } )
680
680
} ;
681
- let tpt = @ { bounds: ty_param_bounds ( cx. tcx , m_collect, ty_params) ,
681
+ let tpt = { bounds: ty_param_bounds ( cx. tcx , m_collect, ty_params) ,
682
682
ty: result_ty} ;
683
683
cx. tcx . tcache . insert ( local_def ( variant. node . id ) , tpt) ;
684
684
write:: ty_only ( cx. tcx , variant. node . id , result_ty) ;
@@ -700,7 +700,7 @@ mod collect {
700
700
let ty = ty:: mk_fn ( cx. tcx ,
701
701
ty_of_fn_decl ( cx. tcx , m_collect,
702
702
ast:: proto_bare, m. decl ) ) ;
703
- cx. tcx . tcache . insert ( local_def ( m. id ) , @ { bounds: bounds,
703
+ cx. tcx . tcache . insert ( local_def ( m. id ) , { bounds: bounds,
704
704
ty: ty} ) ;
705
705
write:: ty_only ( cx. tcx , m. id , ty) ;
706
706
}
@@ -758,8 +758,7 @@ mod collect {
758
758
write:: ty_only ( cx. tcx , it. id , t_res) ;
759
759
write:: ty_only ( cx. tcx , ctor_id, t_ctor) ;
760
760
cx. tcx . tcache . insert ( local_def ( ctor_id) ,
761
- @{ bounds: bounds,
762
- ty: t_ctor} ) ;
761
+ { bounds: bounds, ty: t_ctor} ) ;
763
762
write:: ty_only ( cx. tcx , dtor_id, t_dtor) ;
764
763
}
765
764
_ {
@@ -1481,7 +1480,7 @@ fn impl_self_ty(tcx: ty::ctxt, did: ast::def_id) -> {n_tps: uint, ty: ty::t} {
1481
1480
}
1482
1481
} else {
1483
1482
let tpt = csearch:: get_type ( tcx, did) ;
1484
- { n_tps: vec:: len ( tpt. bounds ) , ty: tpt. ty }
1483
+ { n_tps: vec:: len ( * tpt. bounds ) , ty: tpt. ty }
1485
1484
}
1486
1485
}
1487
1486
@@ -1505,7 +1504,7 @@ fn lookup_method(fcx: @fn_ctxt, isc: resolve::iscopes,
1505
1504
{ |m| m. ident == name} ) {
1506
1505
some ( m) {
1507
1506
ret some ( { method_ty: ty:: mk_fn ( tcx, m. fty ) ,
1508
- n_tps: vec:: len ( m. tps ) ,
1507
+ n_tps: vec:: len ( * m. tps ) ,
1509
1508
ids: [ ] , // FIXME[impl]
1510
1509
origin: method_param ( n) } ) ;
1511
1510
}
0 commit comments