@@ -3,7 +3,7 @@ use rustc_hir as hir;
33use rustc_hir:: def_id:: DefId ;
44use rustc_middle:: ty:: query:: Providers ;
55use rustc_middle:: ty:: subst:: GenericArgKind ;
6- use rustc_middle:: ty:: { self , CratePredicatesMap , ToPredicate , TyCtxt } ;
6+ use rustc_middle:: ty:: { self , CratePredicatesMap , 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 : DefId ) -> & [ ( ty:: Predicate < ' _ > , Span ) ] {
20+ fn inferred_outlives_of ( tcx : TyCtxt < ' _ > , item_def_id : DefId ) -> & [ ( ty:: Clause < ' _ > , Span ) ] {
2121 let id = tcx. hir ( ) . local_def_id_to_hir_id ( item_def_id. expect_local ( ) ) ;
2222
2323 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
5050 if tcx. has_attr ( item_def_id, sym:: rustc_outlives) {
5151 let mut pred: Vec < String > = predicates
5252 . 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) ,
5957 } )
6058 . collect ( ) ;
6159 pred. sort ( ) ;
@@ -103,19 +101,11 @@ fn inferred_outlives_crate(tcx: TyCtxt<'_>, (): ()) -> CratePredicatesMap<'_> {
103101 |( ty:: OutlivesPredicate ( kind1, region2) , & span) | {
104102 match kind1. unpack ( ) {
105103 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) ) ,
110105 span,
111106 ) ) ,
112107 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) ) ,
119109 span,
120110 ) ) ,
121111 GenericArgKind :: Const ( _) => {
0 commit comments