@@ -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 _;
@@ -735,11 +735,8 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
735
735
}
736
736
737
737
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 ) ;
743
740
let obligation =
744
741
Obligation :: new ( tcx, ObligationCause :: dummy ( ) , param_env, poly_trait_pred) ;
745
742
@@ -828,9 +825,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
828
825
tcx,
829
826
ObligationCause :: dummy_with_span ( * fn_span) ,
830
827
param_env,
831
- tcx. mk_predicate (
832
- poly_trait_pred. map_bound ( ty:: PredicateKind :: Trait ) ,
833
- ) ,
828
+ poly_trait_pred,
834
829
) ;
835
830
836
831
// improve diagnostics by showing what failed. Our requirements are stricter this time
0 commit comments