@@ -1562,47 +1562,6 @@ fn components_must_outlive<'a, 'tcx>(rcx: &Rcx<'a, 'tcx>,
1562
1562
}
1563
1563
}
1564
1564
1565
- /// Checks that all data reachable via `ty` *strictly* outlives `scope`.
1566
- /// This is used by dropck.
1567
- ///
1568
- /// CAUTION: It is mostly but not entirely equivalent to `T:'parent`
1569
- /// where `'parent` is the parent of `scope`. The difference is subtle
1570
- /// and has to do with trait objects, primarily. In particular, if you
1571
- /// have `Foo<'y>+'z`, then we require that `'z:'parent` but not
1572
- /// `'y:'parent` (same with lifetimes appearing in fn arguments). This
1573
- /// is because there is no actual reference to the trait object that
1574
- /// outlives `scope`, so we don't need to require that the type could
1575
- /// be named outside `scope`. Because trait objects are always
1576
- /// considered "suspicious" by dropck, if we don't add this special
1577
- /// case, you wind up with some kind of annoying and odd limitations
1578
- /// that crop up
1579
- /// `src/test/compile-fail/regions-early-bound-trait-param.rs`.
1580
- /// Basically there we have `&'foo Trait<'foo>+'bar`, and thus forcing
1581
- /// `'foo` to outlive `'parent` also forces the borrow to outlive
1582
- /// `'parent`, which is longer than should be necessary. The existence
1583
- /// of this "the same but different" predicate is somewhat bothersome
1584
- /// and questionable.
1585
- pub fn type_strictly_outlives < ' a , ' tcx > ( rcx : & mut Rcx < ' a , ' tcx > ,
1586
- origin : infer:: SubregionOrigin < ' tcx > ,
1587
- ty : Ty < ' tcx > ,
1588
- scope : CodeExtent )
1589
- {
1590
- debug ! ( "type_strictly_outlives(ty={:?}, scope={:?})" ,
1591
- ty, scope) ;
1592
-
1593
- let span = origin. span ( ) ;
1594
-
1595
- let parent_region =
1596
- match rcx. tcx ( ) . region_maps . opt_encl_scope ( scope) {
1597
- Some ( parent_scope) => ty:: ReScope ( parent_scope) ,
1598
- None => rcx. tcx ( ) . sess . span_bug (
1599
- span, & format ! ( "no enclosing scope found for scope: {:?}" ,
1600
- scope) ) ,
1601
- } ;
1602
-
1603
- type_must_outlive ( rcx, origin, ty, parent_region) ;
1604
- }
1605
-
1606
1565
fn param_ty_must_outlive < ' a , ' tcx > ( rcx : & Rcx < ' a , ' tcx > ,
1607
1566
origin : infer:: SubregionOrigin < ' tcx > ,
1608
1567
region : ty:: Region ,
0 commit comments