@@ -1383,12 +1383,13 @@ impl<'tcx> TyTrait<'tcx> {
1383
1383
/// we convert the principal trait-ref into a normal trait-ref,
1384
1384
/// you must give *some* self-type. A common choice is `mk_err()`
1385
1385
/// 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 > )
1387
1388
-> Rc < ty:: PolyTraitRef < ' tcx > >
1388
1389
{
1389
1390
Rc :: new ( ty:: Binder ( ty:: TraitRef {
1390
1391
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) ) ,
1392
1393
} ) )
1393
1394
}
1394
1395
}
@@ -1425,8 +1426,8 @@ impl<'tcx> PolyTraitRef<'tcx> {
1425
1426
self . 0 . def_id
1426
1427
}
1427
1428
1428
- pub fn substs ( & self ) -> & Substs < ' tcx > {
1429
- & self . 0 . substs
1429
+ pub fn substs ( & self ) -> & ' tcx Substs < ' tcx > {
1430
+ self . 0 . substs
1430
1431
}
1431
1432
1432
1433
pub fn input_types ( & self ) -> & [ Ty < ' tcx > ] {
@@ -4159,8 +4160,8 @@ pub fn adjust_ty<'tcx, F>(cx: &ctxt<'tcx>,
4159
4160
4160
4161
AdjustReifyFnPointer ( _) => {
4161
4162
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 )
4164
4165
}
4165
4166
ref b => {
4166
4167
cx. sess . bug (
@@ -6727,42 +6728,42 @@ pub trait RegionEscape {
6727
6728
self . has_regions_escaping_depth ( 0 )
6728
6729
}
6729
6730
6730
- fn has_regions_escaping_depth ( & self , depth : uint ) -> bool ;
6731
+ fn has_regions_escaping_depth ( & self , depth : u32 ) -> bool ;
6731
6732
}
6732
6733
6733
6734
impl < ' 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 {
6735
6736
ty:: type_escapes_depth ( * self , depth)
6736
6737
}
6737
6738
}
6738
6739
6739
6740
impl RegionEscape for Region {
6740
- fn has_regions_escaping_depth ( & self , depth : uint ) -> bool {
6741
+ fn has_regions_escaping_depth ( & self , depth : u32 ) -> bool {
6741
6742
self . escapes_depth ( depth)
6742
6743
}
6743
6744
}
6744
6745
6745
6746
impl < ' 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 {
6747
6748
self . substs . types . iter ( ) . any ( |t| t. has_regions_escaping_depth ( depth) ) &&
6748
6749
self . substs . regions ( ) . iter ( ) . any ( |t| t. has_regions_escaping_depth ( depth) )
6749
6750
}
6750
6751
}
6751
6752
6752
6753
impl < ' 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 {
6754
6755
self . 0 . has_regions_escaping_depth ( depth + 1 )
6755
6756
}
6756
6757
}
6757
6758
6758
6759
impl < ' 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 {
6760
6761
self . 0 . has_regions_escaping_depth ( depth) || self . 1 . has_regions_escaping_depth ( depth)
6761
6762
}
6762
6763
}
6763
6764
6764
6765
impl < 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 {
6766
6767
self . 0 . has_regions_escaping_depth ( depth) || self . 1 . has_regions_escaping_depth ( depth)
6767
6768
}
6768
6769
}
0 commit comments