@@ -2646,13 +2646,13 @@ impl methods for lookup {
2646
2646
tps: self_substs. tps + m_substs} ;
2647
2647
self . fcx. write_ty_substs( self . node_id, fty, all_substs) ;
2648
2648
2649
- // FIXME--this treatment of self and regions seems wrong . As a rule
2650
- // of thumb, one ought to substitute all type parameters at once, and
2651
- // we are not doing so here. The danger you open up has to do with
2652
- // the possibility that one of the substs in `all_substs` maps to a
2653
- // self type. Right now I think this is impossible but it may not be
2654
- // forever, and it's just sloppy to substitute in multiple steps.
2655
- // Probably the self parameter ought to be part of the all_substs .
2649
+ // n.b. This treatment of self is risky but ok . As a rule of thumb,
2650
+ // one ought to substitute all type parameters at once, and we are not
2651
+ // doing so here. The danger you open up has to do with the
2652
+ // possibility that one of the substs in `all_substs` maps to a self
2653
+ // type. However, right now I think it is safe because the types in
2654
+ // `all_substs` may not refer to self. This may not stay true
2655
+ // forever, though .
2656
2656
2657
2657
if has_self && !option:: is_none( self_ty_sub) {
2658
2658
let fty = self . fcx. node_ty( self . node_id) ;
@@ -2662,13 +2662,6 @@ impl methods for lookup {
2662
2662
self . fcx. write_ty( self . node_id, fty) ;
2663
2663
}
2664
2664
2665
- if ty:: type_has_regions( ty:: ty_fn_ret( fty) ) {
2666
- let fty = self . fcx. node_ty( self . node_id) ;
2667
- let self_region = region_of( self . fcx, self . expr) ;
2668
- let fty = replace_self_region( self . tcx( ) , self_region, fty) ;
2669
- self . fcx. write_ty( self . node_id, fty) ;
2670
- }
2671
-
2672
2665
ret origin;
2673
2666
}
2674
2667
}
0 commit comments