@@ -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 _;
@@ -726,11 +726,8 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
726726 }
727727
728728 let trait_ref = TraitRef :: from_method ( tcx, trait_id, substs) ;
729- let poly_trait_pred = Binder :: dummy ( TraitPredicate {
730- trait_ref,
731- constness : ty:: BoundConstness :: ConstIfConst ,
732- polarity : ty:: ImplPolarity :: Positive ,
733- } ) ;
729+ let poly_trait_pred =
730+ Binder :: dummy ( trait_ref) . with_constness ( ty:: BoundConstness :: ConstIfConst ) ;
734731 let obligation =
735732 Obligation :: new ( tcx, ObligationCause :: dummy ( ) , param_env, poly_trait_pred) ;
736733
@@ -819,9 +816,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
819816 tcx,
820817 ObligationCause :: dummy_with_span ( * fn_span) ,
821818 param_env,
822- tcx. mk_predicate (
823- poly_trait_pred. map_bound ( ty:: PredicateKind :: Trait ) ,
824- ) ,
819+ poly_trait_pred,
825820 ) ;
826821
827822 // improve diagnostics by showing what failed. Our requirements are stricter this time
0 commit comments