@@ -1643,26 +1643,33 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1643
1643
/// that cannot be named by `fr1`; in that case, we will require
1644
1644
/// that `fr1: 'static` because it is the only way to `fr1: r` to
1645
1645
/// be satisfied. (See `add_incompatible_universe`.)
1646
- #[ instrument( skip( self ) , ret) ]
1647
1646
pub ( crate ) fn provides_universal_region (
1648
1647
& self ,
1649
1648
r : RegionVid ,
1650
1649
fr1 : RegionVid ,
1651
1650
fr2 : RegionVid ,
1652
1651
) -> bool {
1653
- let fr2_is_static = fr2 == self . universal_regions . fr_static ;
1654
- r == fr2 || ( fr2_is_static && self . cannot_name_placeholder ( fr1, r) )
1652
+ debug ! ( "provides_universal_region(r={:?}, fr1={:?}, fr2={:?})" , r, fr1, fr2) ;
1653
+ let result = {
1654
+ r == fr2 || {
1655
+ fr2 == self . universal_regions . fr_static && self . cannot_name_placeholder ( fr1, r)
1656
+ }
1657
+ } ;
1658
+ debug ! ( "provides_universal_region: result = {:?}" , result) ;
1659
+ result
1655
1660
}
1656
1661
1657
1662
/// If `r2` represents a placeholder region, then this returns
1658
1663
/// `true` if `r1` cannot name that placeholder in its
1659
1664
/// value; otherwise, returns `false`.
1660
- #[ instrument( skip( self ) , ret) ]
1661
1665
pub ( crate ) fn cannot_name_placeholder ( & self , r1 : RegionVid , r2 : RegionVid ) -> bool {
1662
1666
match self . definitions [ r2] . origin {
1663
1667
NllRegionVariableOrigin :: Placeholder ( placeholder) => {
1664
1668
let r1_universe = self . definitions [ r1] . universe ;
1665
- debug ! ( ?placeholder, ?r1_universe) ;
1669
+ debug ! (
1670
+ "cannot_name_value_of: universe1={r1_universe:?} placeholder={:?}" ,
1671
+ placeholder
1672
+ ) ;
1666
1673
r1_universe. cannot_name ( placeholder. universe )
1667
1674
}
1668
1675
@@ -2162,16 +2169,6 @@ impl<'tcx> RegionDefinition<'tcx> {
2162
2169
2163
2170
Self { origin, universe, external_name : None }
2164
2171
}
2165
-
2166
- #[ inline( always) ]
2167
- pub fn is_placeholder ( & self ) -> bool {
2168
- matches ! ( self . origin, NllRegionVariableOrigin :: Placeholder ( _) )
2169
- }
2170
-
2171
- #[ inline( always) ]
2172
- pub fn is_existential ( & self ) -> bool {
2173
- matches ! ( self . origin, NllRegionVariableOrigin :: Existential { .. } )
2174
- }
2175
2172
}
2176
2173
2177
2174
#[ derive( Clone , Debug ) ]
0 commit comments