Add constness to ParamEnv

This now causes a lot of queries to be executed twice, as reveal_all forces NotConst
This commit is contained in:
Oli Scherer
2021-10-21 14:56:00 +00:00
committed by Deadbeef
parent 22eeff700e
commit 721ffd14c3
8 changed files with 126 additions and 45 deletions

View File

@@ -370,12 +370,17 @@ impl AutoTraitFinder<'tcx> {
computed_preds.clone().chain(user_computed_preds.iter().cloned()),
)
.map(|o| o.predicate);
new_env = ty::ParamEnv::new(tcx.mk_predicates(normalized_preds), param_env.reveal());
new_env = ty::ParamEnv::new(
tcx.mk_predicates(normalized_preds),
param_env.reveal(),
param_env.constness(),
);
}
let final_user_env = ty::ParamEnv::new(
tcx.mk_predicates(user_computed_preds.into_iter()),
user_env.reveal(),
user_env.constness(),
);
debug!(
"evaluate_nested_obligations(ty={:?}, trait_did={:?}): succeeded with '{:?}' \