@@ -3,7 +3,7 @@ use rustc_hir as hir;
33use rustc_hir:: def_id:: LocalDefId ;
44use rustc_middle:: query:: Providers ;
55use rustc_middle:: ty:: subst:: GenericArgKind ;
6- use rustc_middle:: ty:: { self , CratePredicatesMap , TyCtxt } ;
6+ use rustc_middle:: ty:: { self , CratePredicatesMap , ToPredicate , TyCtxt } ;
77use rustc_span:: symbol:: sym;
88use rustc_span:: Span ;
99
@@ -17,7 +17,7 @@ pub fn provide(providers: &mut Providers) {
1717 * providers = Providers { inferred_outlives_of, inferred_outlives_crate, ..* providers } ;
1818}
1919
20- fn inferred_outlives_of ( tcx : TyCtxt < ' _ > , item_def_id : LocalDefId ) -> & [ ( ty:: ClauseKind < ' _ > , Span ) ] {
20+ fn inferred_outlives_of ( tcx : TyCtxt < ' _ > , item_def_id : LocalDefId ) -> & [ ( ty:: Clause < ' _ > , Span ) ] {
2121 let id = tcx. hir ( ) . local_def_id_to_hir_id ( item_def_id) ;
2222
2323 if matches ! ( tcx. def_kind( item_def_id) , hir:: def:: DefKind :: AnonConst )
@@ -52,7 +52,7 @@ fn inferred_outlives_of(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[(ty::Clau
5252 if tcx. has_attr ( item_def_id, sym:: rustc_outlives) {
5353 let mut pred: Vec < String > = predicates
5454 . iter ( )
55- . map ( |( out_pred, _) | match out_pred {
55+ . map ( |( out_pred, _) | match out_pred. kind ( ) . skip_binder ( ) {
5656 ty:: ClauseKind :: RegionOutlives ( p) => p. to_string ( ) ,
5757 ty:: ClauseKind :: TypeOutlives ( p) => p. to_string ( ) ,
5858 err => bug ! ( "unexpected clause {:?}" , err) ,
@@ -104,13 +104,15 @@ fn inferred_outlives_crate(tcx: TyCtxt<'_>, (): ()) -> CratePredicatesMap<'_> {
104104 |( ty:: OutlivesPredicate ( kind1, region2) , & span) | {
105105 match kind1. unpack ( ) {
106106 GenericArgKind :: Type ( ty1) => Some ( (
107- ty:: ClauseKind :: TypeOutlives ( ty:: OutlivesPredicate ( ty1, * region2) ) ,
107+ ty:: ClauseKind :: TypeOutlives ( ty:: OutlivesPredicate ( ty1, * region2) )
108+ . to_predicate ( tcx) ,
108109 span,
109110 ) ) ,
110111 GenericArgKind :: Lifetime ( region1) => Some ( (
111112 ty:: ClauseKind :: RegionOutlives ( ty:: OutlivesPredicate (
112113 region1, * region2,
113- ) ) ,
114+ ) )
115+ . to_predicate ( tcx) ,
114116 span,
115117 ) ) ,
116118 GenericArgKind :: Const ( _) => {
0 commit comments