@@ -3,7 +3,7 @@ use rustc_hir as hir;
3
3
use rustc_hir:: def_id:: LocalDefId ;
4
4
use rustc_middle:: query:: Providers ;
5
5
use rustc_middle:: ty:: subst:: GenericArgKind ;
6
- use rustc_middle:: ty:: { self , CratePredicatesMap , TyCtxt } ;
6
+ use rustc_middle:: ty:: { self , CratePredicatesMap , ToPredicate , TyCtxt } ;
7
7
use rustc_span:: symbol:: sym;
8
8
use rustc_span:: Span ;
9
9
@@ -17,7 +17,7 @@ pub fn provide(providers: &mut Providers) {
17
17
* providers = Providers { inferred_outlives_of, inferred_outlives_crate, ..* providers } ;
18
18
}
19
19
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 ) ] {
21
21
let id = tcx. hir ( ) . local_def_id_to_hir_id ( item_def_id) ;
22
22
23
23
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
52
52
if tcx. has_attr ( item_def_id, sym:: rustc_outlives) {
53
53
let mut pred: Vec < String > = predicates
54
54
. iter ( )
55
- . map ( |( out_pred, _) | match out_pred {
55
+ . map ( |( out_pred, _) | match out_pred. kind ( ) . skip_binder ( ) {
56
56
ty:: ClauseKind :: RegionOutlives ( p) => p. to_string ( ) ,
57
57
ty:: ClauseKind :: TypeOutlives ( p) => p. to_string ( ) ,
58
58
err => bug ! ( "unexpected clause {:?}" , err) ,
@@ -104,13 +104,15 @@ fn inferred_outlives_crate(tcx: TyCtxt<'_>, (): ()) -> CratePredicatesMap<'_> {
104
104
|( ty:: OutlivesPredicate ( kind1, region2) , & span) | {
105
105
match kind1. unpack ( ) {
106
106
GenericArgKind :: Type ( ty1) => Some ( (
107
- ty:: ClauseKind :: TypeOutlives ( ty:: OutlivesPredicate ( ty1, * region2) ) ,
107
+ ty:: ClauseKind :: TypeOutlives ( ty:: OutlivesPredicate ( ty1, * region2) )
108
+ . to_predicate ( tcx) ,
108
109
span,
109
110
) ) ,
110
111
GenericArgKind :: Lifetime ( region1) => Some ( (
111
112
ty:: ClauseKind :: RegionOutlives ( ty:: OutlivesPredicate (
112
113
region1, * region2,
113
- ) ) ,
114
+ ) )
115
+ . to_predicate ( tcx) ,
114
116
span,
115
117
) ) ,
116
118
GenericArgKind :: Const ( _) => {
0 commit comments