@@ -28,7 +28,7 @@ use rustc_errors::{
2828use rustc_hir:: def:: DefKind ;
2929use rustc_hir:: def_id:: { DefId , LocalDefId } ;
3030use 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 } ;
3232use rustc_infer:: infer:: { InferCtxt , TyCtxtInferExt } ;
3333use rustc_infer:: traits:: ObligationCause ;
3434use rustc_middle:: hir:: nested_filter;
@@ -1792,7 +1792,7 @@ fn opaque_ty_origin<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> hir::OpaqueT
17921792fn rendered_precise_capturing_args < ' tcx > (
17931793 tcx : TyCtxt < ' tcx > ,
17941794 def_id : LocalDefId ,
1795- ) -> Option < & ' tcx [ Symbol ] > {
1795+ ) -> Option < & ' tcx [ PreciseCapturingArgKind < Symbol , Symbol > ] > {
17961796 if let Some ( ty:: ImplTraitInTraitData :: Trait { opaque_def_id, .. } ) =
17971797 tcx. opt_rpitit_info ( def_id. to_def_id ( ) )
17981798 {
@@ -1801,7 +1801,12 @@ fn rendered_precise_capturing_args<'tcx>(
18011801
18021802 tcx. hir_node_by_def_id ( def_id) . expect_opaque_ty ( ) . bounds . iter ( ) . find_map ( |bound| match bound {
18031803 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+ } ) ) )
18051810 }
18061811 _ => None ,
18071812 } )
0 commit comments