@@ -10,7 +10,7 @@ use rustc_middle::mir::visit::{MutatingUseContext, NonMutatingUseContext, PlaceC
10
10
use rustc_middle:: mir:: * ;
11
11
use rustc_middle:: ty:: subst:: { GenericArgKind , InternalSubsts } ;
12
12
use 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 } ;
14
14
use rustc_mir_dataflow:: { self , Analysis } ;
15
15
use rustc_span:: { sym, Span , Symbol } ;
16
16
use rustc_trait_selection:: traits:: error_reporting:: TypeErrCtxtExt as _;
@@ -726,11 +726,8 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
726
726
}
727
727
728
728
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 ) ;
734
731
let obligation =
735
732
Obligation :: new ( tcx, ObligationCause :: dummy ( ) , param_env, poly_trait_pred) ;
736
733
@@ -819,9 +816,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
819
816
tcx,
820
817
ObligationCause :: dummy_with_span ( * fn_span) ,
821
818
param_env,
822
- tcx. mk_predicate (
823
- poly_trait_pred. map_bound ( ty:: PredicateKind :: Trait ) ,
824
- ) ,
819
+ poly_trait_pred,
825
820
) ;
826
821
827
822
// improve diagnostics by showing what failed. Our requirements are stricter this time
0 commit comments