@@ -8,7 +8,7 @@ use rustc_infer::infer::InferCtxt;
8
8
use rustc_middle:: ty:: {
9
9
fold:: { BottomUpFolder , TypeFoldable , TypeFolder } ,
10
10
subst:: { GenericArg , InternalSubsts , SubstsRef } ,
11
- GenericParamDefKind , ParamEnv , Predicate , Region , TraitRef , Ty , TyCtxt , Unevaluated ,
11
+ GenericParamDefKind , ParamEnv , Predicate , Region , Term , TraitRef , Ty , TyCtxt , Unevaluated ,
12
12
} ;
13
13
use std:: collections:: HashMap ;
14
14
@@ -261,7 +261,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
261
261
substs : self
262
262
. tcx
263
263
. intern_substs ( & target_substs[ 1 ..] ) ,
264
- ty ,
264
+ term : Term :: Ty ( ty ) ,
265
265
} )
266
266
} else {
267
267
success. set ( false ) ;
@@ -420,7 +420,10 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
420
420
substs : target_substs,
421
421
item_def_id : target_def_id,
422
422
} ,
423
- ty : self . translate ( index_map, pred. ty ) ,
423
+ term : match pred. term {
424
+ Term :: Ty ( ty) => Term :: Ty ( self . translate ( index_map, ty) ) ,
425
+ Term :: Const ( _) => pred. term ,
426
+ } ,
424
427
}
425
428
} else {
426
429
return None ;
0 commit comments