@@ -1675,7 +1675,6 @@ fn insert_late_bound_lifetimes(map: &mut NamedRegionMap,
1675
1675
1676
1676
let mut appears_in_output = AllCollector {
1677
1677
regions : FxHashSet ( ) ,
1678
- impl_trait : false
1679
1678
} ;
1680
1679
intravisit:: walk_fn_ret_ty ( & mut appears_in_output, & decl. output ) ;
1681
1680
@@ -1688,7 +1687,6 @@ fn insert_late_bound_lifetimes(map: &mut NamedRegionMap,
1688
1687
// ignore binders here and scrape up all names we see.
1689
1688
let mut appears_in_where_clause = AllCollector {
1690
1689
regions : FxHashSet ( ) ,
1691
- impl_trait : false
1692
1690
} ;
1693
1691
for ty_param in generics. ty_params . iter ( ) {
1694
1692
walk_list ! ( & mut appears_in_where_clause,
@@ -1729,9 +1727,6 @@ fn insert_late_bound_lifetimes(map: &mut NamedRegionMap,
1729
1727
// appears in the where clauses? early-bound.
1730
1728
if appears_in_where_clause. regions . contains ( & name) { continue ; }
1731
1729
1732
- // any `impl Trait` in the return type? early-bound.
1733
- if appears_in_output. impl_trait { continue ; }
1734
-
1735
1730
// does not appear in the inputs, but appears in the return type? early-bound.
1736
1731
if !constrained_by_input. regions . contains ( & name) &&
1737
1732
appears_in_output. regions . contains ( & name) {
@@ -1790,7 +1785,6 @@ fn insert_late_bound_lifetimes(map: &mut NamedRegionMap,
1790
1785
1791
1786
struct AllCollector {
1792
1787
regions : FxHashSet < hir:: LifetimeName > ,
1793
- impl_trait : bool
1794
1788
}
1795
1789
1796
1790
impl < ' v > Visitor < ' v > for AllCollector {
@@ -1801,12 +1795,5 @@ fn insert_late_bound_lifetimes(map: &mut NamedRegionMap,
1801
1795
fn visit_lifetime ( & mut self , lifetime_ref : & ' v hir:: Lifetime ) {
1802
1796
self . regions . insert ( lifetime_ref. name ) ;
1803
1797
}
1804
-
1805
- fn visit_ty ( & mut self , ty : & hir:: Ty ) {
1806
- if let hir:: TyImplTraitExistential ( ..) = ty. node {
1807
- self . impl_trait = true ;
1808
- }
1809
- intravisit:: walk_ty ( self , ty) ;
1810
- }
1811
1798
}
1812
1799
}
0 commit comments