Rollup merge of #149183 - tiif:typing_env_fix, r=BoxyUwU
Use `TypingMode::PostAnalysis` in `try_evaluate_const` As mentioned in https://github.com/rust-lang/rust/pull/148698#discussion_r2541882341, we should use ``TypingMode::PostAnalysis`` for that path. ````@BoxyUwU```` prefer the match in ``try_evaluate_const`` to be exhaustive, so I also included that in this PR :3
This commit is contained in:
commit
bea2f89de6
1 changed files with 2 additions and 2 deletions
|
|
@ -681,7 +681,7 @@ pub fn try_evaluate_const<'tcx>(
|
|||
|
||||
(args, typing_env)
|
||||
}
|
||||
_ => {
|
||||
Some(ty::AnonConstKind::MCG) | Some(ty::AnonConstKind::NonTypeSystem) | None => {
|
||||
// We are only dealing with "truly" generic/uninferred constants here:
|
||||
// - GCEConsts have been handled separately
|
||||
// - Repeat expr count back compat consts have also been handled separately
|
||||
|
|
@ -700,7 +700,7 @@ pub fn try_evaluate_const<'tcx>(
|
|||
|
||||
// Since there is no generic parameter, we can just drop the environment
|
||||
// to prevent query cycle.
|
||||
let typing_env = infcx.typing_env(ty::ParamEnv::empty());
|
||||
let typing_env = ty::TypingEnv::fully_monomorphized();
|
||||
|
||||
(uv.args, typing_env)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue