@@ -342,10 +342,10 @@ pub fn ensure_trait_methods(ccx: &CrateCtxt, trait_id: ast::NodeId) {
342
342
new_type_param_defs. push ( ty:: TypeParameterDef {
343
343
ident : special_idents:: self_,
344
344
def_id : dummy_defid,
345
- bounds : @ ty:: ParamBounds {
345
+ bounds : Rc :: new ( ty:: ParamBounds {
346
346
builtin_bounds : ty:: EmptyBuiltinBounds ( ) ,
347
347
trait_bounds : vec ! ( self_trait_ref)
348
- } ,
348
+ } ) ,
349
349
default : None
350
350
} ) ;
351
351
@@ -999,24 +999,24 @@ pub fn ty_of_foreign_item(ccx: &CrateCtxt,
999
999
}
1000
1000
}
1001
1001
1002
- pub fn ty_generics_for_type ( ccx : & CrateCtxt ,
1003
- generics : & ast:: Generics )
1004
- -> ty:: Generics {
1002
+ fn ty_generics_for_type ( ccx : & CrateCtxt ,
1003
+ generics : & ast:: Generics )
1004
+ -> ty:: Generics {
1005
1005
ty_generics ( ccx, & generics. lifetimes , & generics. ty_params , 0 )
1006
1006
}
1007
1007
1008
- pub fn ty_generics_for_fn_or_method ( ccx : & CrateCtxt ,
1009
- generics : & ast:: Generics ,
1010
- base_index : uint )
1011
- -> ty:: Generics {
1008
+ fn ty_generics_for_fn_or_method ( ccx : & CrateCtxt ,
1009
+ generics : & ast:: Generics ,
1010
+ base_index : uint )
1011
+ -> ty:: Generics {
1012
1012
let early_lifetimes = resolve_lifetime:: early_bound_lifetimes ( generics) ;
1013
1013
ty_generics ( ccx, & early_lifetimes, & generics. ty_params , base_index)
1014
1014
}
1015
1015
1016
- pub fn ty_generics ( ccx : & CrateCtxt ,
1017
- lifetimes : & Vec < ast:: Lifetime > ,
1018
- ty_params : & OwnedSlice < ast:: TyParam > ,
1019
- base_index : uint ) -> ty:: Generics {
1016
+ fn ty_generics ( ccx : & CrateCtxt ,
1017
+ lifetimes : & Vec < ast:: Lifetime > ,
1018
+ ty_params : & OwnedSlice < ast:: TyParam > ,
1019
+ base_index : uint ) -> ty:: Generics {
1020
1020
return ty:: Generics {
1021
1021
region_param_defs : Rc :: new ( lifetimes. iter ( ) . map ( |l| {
1022
1022
ty:: RegionParameterDef { name : l. name ,
@@ -1025,12 +1025,12 @@ pub fn ty_generics(ccx: &CrateCtxt,
1025
1025
type_param_defs : Rc :: new ( ty_params. iter ( ) . enumerate ( ) . map ( |( offset, param) | {
1026
1026
let existing_def_opt = {
1027
1027
let ty_param_defs = ccx. tcx . ty_param_defs . borrow ( ) ;
1028
- ty_param_defs. find ( & param. id ) . map ( |& def| def)
1028
+ ty_param_defs. find ( & param. id ) . map ( |def| def. clone ( ) )
1029
1029
} ;
1030
1030
existing_def_opt. unwrap_or_else ( || {
1031
1031
let param_ty = ty:: param_ty { idx : base_index + offset,
1032
1032
def_id : local_def ( param. id ) } ;
1033
- let bounds = @ compute_bounds ( ccx, param_ty, & param. bounds ) ;
1033
+ let bounds = Rc :: new ( compute_bounds ( ccx, param_ty, & param. bounds ) ) ;
1034
1034
let default = param. default . map ( |path| {
1035
1035
let ty = ast_ty_to_ty ( ccx, & ExplicitRscope , path) ;
1036
1036
let cur_idx = param_ty. idx ;
@@ -1056,7 +1056,7 @@ pub fn ty_generics(ccx: &CrateCtxt,
1056
1056
default : default
1057
1057
} ;
1058
1058
debug ! ( "def for param: {}" , def. repr( ccx. tcx) ) ;
1059
- ccx. tcx . ty_param_defs . borrow_mut ( ) . insert ( param. id , def) ;
1059
+ ccx. tcx . ty_param_defs . borrow_mut ( ) . insert ( param. id , def. clone ( ) ) ;
1060
1060
def
1061
1061
} )
1062
1062
} ) . collect ( ) ) ,
0 commit comments