@@ -1292,28 +1292,12 @@ pub fn check_type_bounds<'tcx>(
12921292 } ;
12931293
12941294 tcx. infer_ctxt ( ) . enter ( move |infcx| {
1295- // if the item is inside a const impl, we transform the predicates to be const.
12961295 let constness = impl_ty
12971296 . container
12981297 . impl_def_id ( )
12991298 . map ( |did| tcx. impl_constness ( did) )
13001299 . unwrap_or ( hir:: Constness :: NotConst ) ;
13011300
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-
13171301 let inh = Inherited :: with_constness ( infcx, impl_ty. def_id . expect_local ( ) , constness) ;
13181302 let infcx = & inh. infcx ;
13191303 let mut selcx = traits:: SelectionContext :: new ( & infcx) ;
@@ -1332,7 +1316,7 @@ pub fn check_type_bounds<'tcx>(
13321316 . explicit_item_bounds ( trait_ty. def_id )
13331317 . iter ( )
13341318 . 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) ;
13361320 debug ! ( "check_type_bounds: concrete_ty_bound = {:?}" , concrete_ty_bound) ;
13371321
13381322 traits:: Obligation :: new ( mk_cause ( span) , param_env, concrete_ty_bound)
@@ -1350,10 +1334,7 @@ pub fn check_type_bounds<'tcx>(
13501334 debug ! ( "compare_projection_bounds: normalized predicate = {:?}" , normalized_predicate) ;
13511335 obligation. predicate = normalized_predicate;
13521336
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) ;
13571338 inh. register_predicate ( obligation) ;
13581339 }
13591340
0 commit comments