1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -701,8 +701,11 @@ fn replace_param_and_infer_args_with_placeholder<'tcx>(
701
701
/// used during analysis.
702
702
pub fn impossible_predicates < ' tcx > ( tcx : TyCtxt < ' tcx > , predicates : Vec < ty:: Clause < ' tcx > > ) -> bool {
703
703
debug ! ( "impossible_predicates(predicates={:?})" , predicates) ;
704
- let ( infcx, param_env) =
705
- tcx. infer_ctxt ( ) . build_with_typing_env ( ty:: TypingEnv :: fully_monomorphized ( ) ) ;
704
+ let ( infcx, param_env) = tcx
705
+ . infer_ctxt ( )
706
+ . with_next_trait_solver ( true )
707
+ . build_with_typing_env ( ty:: TypingEnv :: fully_monomorphized ( ) ) ;
708
+
706
709
let ocx = ObligationCtxt :: new ( & infcx) ;
707
710
let predicates = ocx. normalize ( & ObligationCause :: dummy ( ) , param_env, predicates) ;
708
711
for predicate in predicates {
@@ -715,13 +718,6 @@ pub fn impossible_predicates<'tcx>(tcx: TyCtxt<'tcx>, predicates: Vec<ty::Clause
715
718
return true ;
716
719
}
717
720
718
- // Leak check for any higher-ranked trait mismatches.
719
- // We only need to do this in the old solver, since the new solver already
720
- // leak-checks.
721
- if !infcx. next_trait_solver ( ) && infcx. leak_check ( ty:: UniverseIndex :: ROOT , None ) . is_err ( ) {
722
- return true ;
723
- }
724
-
725
721
false
726
722
}
727
723
0 commit comments