@@ -340,13 +340,14 @@ pub fn ensure_trait_methods(ccx: &CrateCtxt, trait_id: ast::NodeId) {
340
340
// add in the "self" type parameter
341
341
let self_trait_def = get_trait_def ( ccx, local_def ( trait_id) ) ;
342
342
let self_trait_ref = self_trait_def. trait_ref . subst ( tcx, & substs) ;
343
+ let bounds = ty:: ParamBounds {
344
+ builtin_bounds : ty:: EmptyBuiltinBounds ( ) ,
345
+ trait_bounds : vec ! ( self_trait_ref)
346
+ } ;
343
347
new_type_param_defs. push ( ty:: TypeParameterDef {
344
348
ident : special_idents:: self_,
345
349
def_id : dummy_defid,
346
- bounds : Rc :: new ( ty:: ParamBounds {
347
- builtin_bounds : ty:: EmptyBuiltinBounds ( ) ,
348
- trait_bounds : vec ! ( self_trait_ref)
349
- } ) ,
350
+ bounds : Rc :: new ( bounds) ,
350
351
default : None
351
352
} ) ;
352
353
@@ -1035,7 +1036,7 @@ fn ty_generics(ccx: &CrateCtxt,
1035
1036
type_param_defs : Rc :: new ( ty_params. iter ( ) . enumerate ( ) . map ( |( offset, param) | {
1036
1037
let existing_def_opt = {
1037
1038
let ty_param_defs = ccx. tcx . ty_param_defs . borrow ( ) ;
1038
- ty_param_defs. find ( & param. id ) . map ( |def| def. clone ( ) )
1039
+ ty_param_defs. find ( & param. id ) . map ( |def| ( * def) . clone ( ) )
1039
1040
} ;
1040
1041
existing_def_opt. unwrap_or_else ( || {
1041
1042
let param_ty = ty:: param_ty { idx : base_index + offset,
0 commit comments