@@ -10,7 +10,7 @@ use rustc_middle::mir::visit::{MutatingUseContext, NonMutatingUseContext, PlaceC
1010use rustc_middle:: mir:: * ;
1111use rustc_middle:: ty:: subst:: { GenericArgKind , InternalSubsts } ;
1212use rustc_middle:: ty:: { self , adjustment:: PointerCast , Instance , InstanceDef , Ty , TyCtxt } ;
13- use rustc_middle:: ty:: { Binder , TraitPredicate , TraitRef , TypeVisitable } ;
13+ use rustc_middle:: ty:: { Binder , TraitRef , TypeVisitable } ;
1414use rustc_mir_dataflow:: { self , Analysis } ;
1515use rustc_span:: { sym, Span , Symbol } ;
1616use rustc_trait_selection:: traits:: error_reporting:: TypeErrCtxtExt as _;
@@ -735,11 +735,8 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
735735 }
736736
737737 let trait_ref = TraitRef :: from_method ( tcx, trait_id, substs) ;
738- let poly_trait_pred = Binder :: dummy ( TraitPredicate {
739- trait_ref,
740- constness : ty:: BoundConstness :: ConstIfConst ,
741- polarity : ty:: ImplPolarity :: Positive ,
742- } ) ;
738+ let poly_trait_pred =
739+ Binder :: dummy ( trait_ref) . with_constness ( ty:: BoundConstness :: ConstIfConst ) ;
743740 let obligation =
744741 Obligation :: new ( tcx, ObligationCause :: dummy ( ) , param_env, poly_trait_pred) ;
745742
@@ -828,9 +825,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
828825 tcx,
829826 ObligationCause :: dummy_with_span ( * fn_span) ,
830827 param_env,
831- tcx. mk_predicate (
832- poly_trait_pred. map_bound ( ty:: PredicateKind :: Trait ) ,
833- ) ,
828+ poly_trait_pred,
834829 ) ;
835830
836831 // improve diagnostics by showing what failed. Our requirements are stricter this time
0 commit comments