@@ -1383,12 +1383,13 @@ impl<'tcx> TyTrait<'tcx> {
13831383 /// we convert the principal trait-ref into a normal trait-ref,
13841384 /// you must give *some* self-type. A common choice is `mk_err()`
13851385 /// or some skolemized type.
1386- pub fn principal_trait_ref_with_self_ty ( & self , self_ty : Ty < ' tcx > )
1386+ pub fn principal_trait_ref_with_self_ty ( & self ,
1387+ tcx : & ctxt < ' tcx > , self_ty : Ty < ' tcx > )
13871388 -> Rc < ty:: PolyTraitRef < ' tcx > >
13881389 {
13891390 Rc :: new ( ty:: Binder ( ty:: TraitRef {
13901391 def_id : self . principal . def_id ( ) ,
1391- substs : self . principal . substs ( ) . with_self_ty ( self_ty) ,
1392+ substs : tcx . mk_substs ( self . principal . substs ( ) . with_self_ty ( self_ty) ) ,
13921393 } ) )
13931394 }
13941395}
@@ -1425,8 +1426,8 @@ impl<'tcx> PolyTraitRef<'tcx> {
14251426 self . 0 . def_id
14261427 }
14271428
1428- pub fn substs ( & self ) -> & Substs < ' tcx > {
1429- & self . 0 . substs
1429+ pub fn substs ( & self ) -> & ' tcx Substs < ' tcx > {
1430+ self . 0 . substs
14301431 }
14311432
14321433 pub fn input_types ( & self ) -> & [ Ty < ' tcx > ] {
@@ -4159,8 +4160,8 @@ pub fn adjust_ty<'tcx, F>(cx: &ctxt<'tcx>,
41594160
41604161 AdjustReifyFnPointer ( _) => {
41614162 match unadjusted_ty. sty {
4162- ty:: ty_bare_fn( Some ( _) , ref b) => {
4163- ty:: mk_bare_fn ( cx, None , ( * b ) . clone ( ) )
4163+ ty:: ty_bare_fn( Some ( _) , b) => {
4164+ ty:: mk_bare_fn ( cx, None , b )
41644165 }
41654166 ref b => {
41664167 cx. sess . bug (
@@ -6727,42 +6728,42 @@ pub trait RegionEscape {
67276728 self . has_regions_escaping_depth ( 0 )
67286729 }
67296730
6730- fn has_regions_escaping_depth ( & self , depth : uint ) -> bool ;
6731+ fn has_regions_escaping_depth ( & self , depth : u32 ) -> bool ;
67316732}
67326733
67336734impl < ' tcx > RegionEscape for Ty < ' tcx > {
6734- fn has_regions_escaping_depth ( & self , depth : uint ) -> bool {
6735+ fn has_regions_escaping_depth ( & self , depth : u32 ) -> bool {
67356736 ty:: type_escapes_depth ( * self , depth)
67366737 }
67376738}
67386739
67396740impl RegionEscape for Region {
6740- fn has_regions_escaping_depth ( & self , depth : uint ) -> bool {
6741+ fn has_regions_escaping_depth ( & self , depth : u32 ) -> bool {
67416742 self . escapes_depth ( depth)
67426743 }
67436744}
67446745
67456746impl < ' tcx > RegionEscape for TraitRef < ' tcx > {
6746- fn has_regions_escaping_depth ( & self , depth : uint ) -> bool {
6747+ fn has_regions_escaping_depth ( & self , depth : u32 ) -> bool {
67476748 self . substs . types . iter ( ) . any ( |t| t. has_regions_escaping_depth ( depth) ) &&
67486749 self . substs . regions ( ) . iter ( ) . any ( |t| t. has_regions_escaping_depth ( depth) )
67496750 }
67506751}
67516752
67526753impl < ' tcx , T : RegionEscape > RegionEscape for Binder < T > {
6753- fn has_regions_escaping_depth ( & self , depth : uint ) -> bool {
6754+ fn has_regions_escaping_depth ( & self , depth : u32 ) -> bool {
67546755 self . 0 . has_regions_escaping_depth ( depth + 1 )
67556756 }
67566757}
67576758
67586759impl < ' tcx > RegionEscape for EquatePredicate < ' tcx > {
6759- fn has_regions_escaping_depth ( & self , depth : uint ) -> bool {
6760+ fn has_regions_escaping_depth ( & self , depth : u32 ) -> bool {
67606761 self . 0 . has_regions_escaping_depth ( depth) || self . 1 . has_regions_escaping_depth ( depth)
67616762 }
67626763}
67636764
67646765impl < T : RegionEscape , U : RegionEscape > RegionEscape for OutlivesPredicate < T , U > {
6765- fn has_regions_escaping_depth ( & self , depth : uint ) -> bool {
6766+ fn has_regions_escaping_depth ( & self , depth : u32 ) -> bool {
67666767 self . 0 . has_regions_escaping_depth ( depth) || self . 1 . has_regions_escaping_depth ( depth)
67676768 }
67686769}
0 commit comments