@@ -28,7 +28,7 @@ use rustc_errors::{
28
28
use rustc_hir:: def:: DefKind ;
29
29
use rustc_hir:: def_id:: { DefId , LocalDefId } ;
30
30
use rustc_hir:: intravisit:: { self , InferKind , Visitor , VisitorExt , walk_generics} ;
31
- use rustc_hir:: { self as hir, GenericParamKind , HirId , Node } ;
31
+ use rustc_hir:: { self as hir, GenericParamKind , HirId , Node , PreciseCapturingArgKind } ;
32
32
use rustc_infer:: infer:: { InferCtxt , TyCtxtInferExt } ;
33
33
use rustc_infer:: traits:: ObligationCause ;
34
34
use rustc_middle:: hir:: nested_filter;
@@ -1792,7 +1792,7 @@ fn opaque_ty_origin<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> hir::OpaqueT
1792
1792
fn rendered_precise_capturing_args < ' tcx > (
1793
1793
tcx : TyCtxt < ' tcx > ,
1794
1794
def_id : LocalDefId ,
1795
- ) -> Option < & ' tcx [ Symbol ] > {
1795
+ ) -> Option < & ' tcx [ PreciseCapturingArgKind < Symbol , Symbol > ] > {
1796
1796
if let Some ( ty:: ImplTraitInTraitData :: Trait { opaque_def_id, .. } ) =
1797
1797
tcx. opt_rpitit_info ( def_id. to_def_id ( ) )
1798
1798
{
@@ -1801,7 +1801,12 @@ fn rendered_precise_capturing_args<'tcx>(
1801
1801
1802
1802
tcx. hir_node_by_def_id ( def_id) . expect_opaque_ty ( ) . bounds . iter ( ) . find_map ( |bound| match bound {
1803
1803
hir:: GenericBound :: Use ( args, ..) => {
1804
- Some ( & * tcx. arena . alloc_from_iter ( args. iter ( ) . map ( |arg| arg. name ( ) ) ) )
1804
+ Some ( & * tcx. arena . alloc_from_iter ( args. iter ( ) . map ( |arg| match arg {
1805
+ PreciseCapturingArgKind :: Lifetime ( _) => {
1806
+ PreciseCapturingArgKind :: Lifetime ( arg. name ( ) )
1807
+ }
1808
+ PreciseCapturingArgKind :: Param ( _) => PreciseCapturingArgKind :: Param ( arg. name ( ) ) ,
1809
+ } ) ) )
1805
1810
}
1806
1811
_ => None ,
1807
1812
} )
0 commit comments