This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
compiler/rustc_trait_selection/src/traits Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -703,8 +703,11 @@ fn replace_param_and_infer_args_with_placeholder<'tcx>(
703703/// used during analysis.
704704pub fn impossible_predicates < ' tcx > ( tcx : TyCtxt < ' tcx > , predicates : Vec < ty:: Clause < ' tcx > > ) -> bool {
705705 debug ! ( "impossible_predicates(predicates={:?})" , predicates) ;
706- let ( infcx, param_env) =
707- tcx. infer_ctxt ( ) . build_with_typing_env ( ty:: TypingEnv :: fully_monomorphized ( ) ) ;
706+ let ( infcx, param_env) = tcx
707+ . infer_ctxt ( )
708+ . with_next_trait_solver ( true )
709+ . build_with_typing_env ( ty:: TypingEnv :: fully_monomorphized ( ) ) ;
710+
708711 let ocx = ObligationCtxt :: new ( & infcx) ;
709712 let predicates = ocx. normalize ( & ObligationCause :: dummy ( ) , param_env, predicates) ;
710713 for predicate in predicates {
@@ -717,13 +720,6 @@ pub fn impossible_predicates<'tcx>(tcx: TyCtxt<'tcx>, predicates: Vec<ty::Clause
717720 return true ;
718721 }
719722
720- // Leak check for any higher-ranked trait mismatches.
721- // We only need to do this in the old solver, since the new solver already
722- // leak-checks.
723- if !infcx. next_trait_solver ( ) && infcx. leak_check ( ty:: UniverseIndex :: ROOT , None ) . is_err ( ) {
724- return true ;
725- }
726-
727723 false
728724}
729725
You can’t perform that action at this time.
0 commit comments