@@ -15,9 +15,9 @@ use rustc_middle::mir::{BinOp, Body, Const as MirConst, ConstValue, UnOp};
15
15
use rustc_middle:: ty:: layout:: { FnAbiOf , LayoutOf } ;
16
16
use rustc_middle:: ty:: print:: { with_forced_trimmed_paths, with_no_trimmed_paths} ;
17
17
use rustc_middle:: ty:: {
18
- AdtDef , AdtKind , AssocItem , ClosureKind , GenericArgsRef , GenericPredicates , Instance ,
19
- InstanceKind , IntrinsicDef , List , PolyFnSig , ScalarInt , TraitDef , Ty , TyCtxt , TyKind ,
20
- TypeVisitableExt , UintTy , ValTree , VariantDef ,
18
+ AdtDef , AdtKind , AssocItem , ClosureKind , GenericArgsRef , Instance , InstanceKind , IntrinsicDef ,
19
+ List , PolyFnSig , ScalarInt , TraitDef , Ty , TyCtxt , TyKind , TypeVisitableExt , UintTy , ValTree ,
20
+ VariantDef ,
21
21
} ;
22
22
use rustc_middle:: { mir, ty} ;
23
23
use rustc_session:: cstore:: ForeignModule ;
@@ -197,12 +197,32 @@ impl<'tcx, B: Bridge> SmirCtxt<'tcx, B> {
197
197
self . tcx . generics_of ( def_id)
198
198
}
199
199
200
- pub fn predicates_of ( & self , def_id : DefId ) -> GenericPredicates < ' tcx > {
201
- self . tcx . predicates_of ( def_id)
200
+ pub fn predicates_of (
201
+ & self ,
202
+ def_id : DefId ,
203
+ ) -> ( Option < DefId > , Vec < ( ty:: PredicateKind < ' tcx > , Span ) > ) {
204
+ let ty:: GenericPredicates { parent, predicates } = self . tcx . predicates_of ( def_id) ;
205
+ (
206
+ parent,
207
+ predicates
208
+ . iter ( )
209
+ . map ( |( clause, span) | ( clause. as_predicate ( ) . kind ( ) . skip_binder ( ) , * span) )
210
+ . collect ( ) ,
211
+ )
202
212
}
203
213
204
- pub fn explicit_predicates_of ( & self , def_id : DefId ) -> GenericPredicates < ' tcx > {
205
- self . tcx . explicit_predicates_of ( def_id)
214
+ pub fn explicit_predicates_of (
215
+ & self ,
216
+ def_id : DefId ,
217
+ ) -> ( Option < DefId > , Vec < ( ty:: PredicateKind < ' tcx > , Span ) > ) {
218
+ let ty:: GenericPredicates { parent, predicates } = self . tcx . explicit_predicates_of ( def_id) ;
219
+ (
220
+ parent,
221
+ predicates
222
+ . iter ( )
223
+ . map ( |( clause, span) | ( clause. as_predicate ( ) . kind ( ) . skip_binder ( ) , * span) )
224
+ . collect ( ) ,
225
+ )
206
226
}
207
227
208
228
pub fn crate_name ( & self , crate_num : CrateNum ) -> String {
0 commit comments