@@ -12,7 +12,7 @@ pub(crate) mod utils;
12
12
13
13
use rustc_ast as ast;
14
14
use rustc_attr as attr;
15
- use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
15
+ use rustc_data_structures:: fx:: { FxHashMap , FxHashSet , FxIndexSet } ;
16
16
use rustc_hir as hir;
17
17
use rustc_hir:: def:: { CtorKind , DefKind , Res } ;
18
18
use rustc_hir:: def_id:: { DefId , LOCAL_CRATE } ;
@@ -1710,8 +1710,25 @@ pub(crate) fn clean_middle_ty<'tcx>(
1710
1710
} )
1711
1711
. collect ( ) ;
1712
1712
1713
+ let late_bound_regions: FxIndexSet < _ > = obj
1714
+ . iter ( )
1715
+ . flat_map ( |pb| pb. bound_vars ( ) )
1716
+ . filter_map ( |br| match br {
1717
+ ty:: BoundVariableKind :: Region ( ty:: BrNamed ( _, name) )
1718
+ if name != kw:: UnderscoreLifetime =>
1719
+ {
1720
+ Some ( GenericParamDef {
1721
+ name,
1722
+ kind : GenericParamDefKind :: Lifetime { outlives : vec ! [ ] } ,
1723
+ } )
1724
+ }
1725
+ _ => None ,
1726
+ } )
1727
+ . collect ( ) ;
1728
+ let late_bound_regions = late_bound_regions. into_iter ( ) . collect ( ) ;
1729
+
1713
1730
let path = external_path ( cx, did, false , bindings, substs) ;
1714
- bounds. insert ( 0 , PolyTrait { trait_ : path, generic_params : Vec :: new ( ) } ) ;
1731
+ bounds. insert ( 0 , PolyTrait { trait_ : path, generic_params : late_bound_regions } ) ;
1715
1732
1716
1733
DynTrait ( bounds, lifetime)
1717
1734
}
0 commit comments