From d4cdd005dc3807584334df1b36bad4724f3bdbfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Fri, 10 Apr 2026 13:16:00 +0200 Subject: [PATCH] use typing mode postanalysis in qualif in the next solver --- compiler/rustc_const_eval/src/check_consts/qualifs.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_const_eval/src/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/check_consts/qualifs.rs index a4f33ea05b2d3..9d54286d7eff3 100644 --- a/compiler/rustc_const_eval/src/check_consts/qualifs.rs +++ b/compiler/rustc_const_eval/src/check_consts/qualifs.rs @@ -105,7 +105,11 @@ impl Qualif for HasMutInterior { // opaque types. let typing_env = ty::TypingEnv::new( cx.typing_env.param_env, - ty::TypingMode::analysis_in_body(cx.tcx, cx.body.source.def_id().expect_local()), + if cx.tcx.next_trait_solver_globally() { + ty::TypingMode::PostAnalysis + } else { + ty::TypingMode::analysis_in_body(cx.tcx, cx.body.source.def_id().expect_local()) + }, ); let (infcx, param_env) = cx.tcx.infer_ctxt().build_with_typing_env(typing_env); let ocx = ObligationCtxt::new(&infcx);