@@ -1292,28 +1292,12 @@ pub fn check_type_bounds<'tcx>(
1292
1292
} ;
1293
1293
1294
1294
tcx. infer_ctxt ( ) . enter ( move |infcx| {
1295
- // if the item is inside a const impl, we transform the predicates to be const.
1296
1295
let constness = impl_ty
1297
1296
. container
1298
1297
. impl_def_id ( )
1299
1298
. map ( |did| tcx. impl_constness ( did) )
1300
1299
. unwrap_or ( hir:: Constness :: NotConst ) ;
1301
1300
1302
- let pred_map = match constness {
1303
- hir:: Constness :: NotConst => |p, _| p,
1304
- hir:: Constness :: Const => |p : ty:: Predicate < ' tcx > , tcx : TyCtxt < ' tcx > | {
1305
- p. kind ( )
1306
- . map_bound ( |kind| match kind {
1307
- ty:: PredicateKind :: Trait ( mut tp) => {
1308
- tp. constness = hir:: Constness :: Const ;
1309
- ty:: PredicateKind :: Trait ( tp)
1310
- }
1311
- kind => kind,
1312
- } )
1313
- . to_predicate ( tcx)
1314
- } ,
1315
- } ;
1316
-
1317
1301
let inh = Inherited :: with_constness ( infcx, impl_ty. def_id . expect_local ( ) , constness) ;
1318
1302
let infcx = & inh. infcx ;
1319
1303
let mut selcx = traits:: SelectionContext :: new ( & infcx) ;
@@ -1332,7 +1316,7 @@ pub fn check_type_bounds<'tcx>(
1332
1316
. explicit_item_bounds ( trait_ty. def_id )
1333
1317
. iter ( )
1334
1318
. map ( |& ( bound, span) | {
1335
- let concrete_ty_bound = pred_map ( bound. subst ( tcx, rebased_substs) , tcx ) ;
1319
+ let concrete_ty_bound = bound. subst ( tcx, rebased_substs) ;
1336
1320
debug ! ( "check_type_bounds: concrete_ty_bound = {:?}" , concrete_ty_bound) ;
1337
1321
1338
1322
traits:: Obligation :: new ( mk_cause ( span) , param_env, concrete_ty_bound)
@@ -1350,10 +1334,7 @@ pub fn check_type_bounds<'tcx>(
1350
1334
debug ! ( "compare_projection_bounds: normalized predicate = {:?}" , normalized_predicate) ;
1351
1335
obligation. predicate = normalized_predicate;
1352
1336
1353
- inh. register_predicates ( obligations. into_iter ( ) . map ( |mut o| {
1354
- o. predicate = pred_map ( o. predicate , tcx) ;
1355
- o
1356
- } ) ) ;
1337
+ inh. register_predicates ( obligations) ;
1357
1338
inh. register_predicate ( obligation) ;
1358
1339
}
1359
1340
0 commit comments