Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion compiler/rustc_const_eval/src/check_consts/qualifs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
},
Copy link
Copy Markdown
Contributor

@lcnr lcnr Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use cx.typing_env here and use its TypingMode. we currently specify that mode to be non_body_analysis which is very wrong™️, so this is a bigger change to use the proper TypingMode here. In the new solver we should generally use TypingMode::Borrowck until we're done with mir_borrowck at hwich point it should be PostBorrowckAnalysis

View changes since the review

);
let (infcx, param_env) = cx.tcx.infer_ctxt().build_with_typing_env(typing_env);
let ocx = ObligationCtxt::new(&infcx);
Expand Down
Loading