@@ -3,7 +3,7 @@ use rustc_hir as hir;
3
3
use rustc_hir:: def_id:: DefId ;
4
4
use rustc_middle:: ty:: query:: Providers ;
5
5
use rustc_middle:: ty:: subst:: GenericArgKind ;
6
- use rustc_middle:: ty:: { self , CratePredicatesMap , ToPredicate , TyCtxt } ;
6
+ use rustc_middle:: ty:: { self , CratePredicatesMap , 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 : DefId ) -> & [ ( ty:: Predicate < ' _ > , Span ) ] {
20
+ fn inferred_outlives_of ( tcx : TyCtxt < ' _ > , item_def_id : DefId ) -> & [ ( ty:: Clause < ' _ > , Span ) ] {
21
21
let id = tcx. hir ( ) . local_def_id_to_hir_id ( item_def_id. expect_local ( ) ) ;
22
22
23
23
if matches ! ( tcx. def_kind( item_def_id) , hir:: def:: DefKind :: AnonConst ) && tcx. lazy_normalization ( )
@@ -50,12 +50,10 @@ fn inferred_outlives_of(tcx: TyCtxt<'_>, item_def_id: DefId) -> &[(ty::Predicate
50
50
if tcx. has_attr ( item_def_id, sym:: rustc_outlives) {
51
51
let mut pred: Vec < String > = predicates
52
52
. iter ( )
53
- . map ( |( out_pred, _) | match out_pred. kind ( ) . skip_binder ( ) {
54
- ty:: PredicateKind :: Clause ( ty:: Clause :: RegionOutlives ( p) ) => {
55
- p. to_string ( )
56
- }
57
- ty:: PredicateKind :: Clause ( ty:: Clause :: TypeOutlives ( p) ) => p. to_string ( ) ,
58
- err => bug ! ( "unexpected predicate {:?}" , err) ,
53
+ . map ( |( out_pred, _) | match out_pred {
54
+ ty:: Clause :: RegionOutlives ( p) => p. to_string ( ) ,
55
+ ty:: Clause :: TypeOutlives ( p) => p. to_string ( ) ,
56
+ err => bug ! ( "unexpected clause {:?}" , err) ,
59
57
} )
60
58
. collect ( ) ;
61
59
pred. sort ( ) ;
@@ -103,19 +101,11 @@ fn inferred_outlives_crate(tcx: TyCtxt<'_>, (): ()) -> CratePredicatesMap<'_> {
103
101
|( ty:: OutlivesPredicate ( kind1, region2) , & span) | {
104
102
match kind1. unpack ( ) {
105
103
GenericArgKind :: Type ( ty1) => Some ( (
106
- ty:: Binder :: dummy ( ty:: PredicateKind :: Clause ( ty:: Clause :: TypeOutlives (
107
- ty:: OutlivesPredicate ( ty1, * region2) ,
108
- ) ) )
109
- . to_predicate ( tcx) ,
104
+ ty:: Clause :: TypeOutlives ( ty:: OutlivesPredicate ( ty1, * region2) ) ,
110
105
span,
111
106
) ) ,
112
107
GenericArgKind :: Lifetime ( region1) => Some ( (
113
- ty:: Binder :: dummy ( ty:: PredicateKind :: Clause (
114
- ty:: Clause :: RegionOutlives ( ty:: OutlivesPredicate (
115
- region1, * region2,
116
- ) ) ,
117
- ) )
118
- . to_predicate ( tcx) ,
108
+ ty:: Clause :: RegionOutlives ( ty:: OutlivesPredicate ( region1, * region2) ) ,
119
109
span,
120
110
) ) ,
121
111
GenericArgKind :: Const ( _) => {
0 commit comments