1
Fork 0

Rollup merge of #109665 - fee1-dead-contrib:rm-remap-queries, r=oli-obk

Remove `remap_env_constness` in queries

This removes some of the complexities with const traits. #88119 used to be caused by this but was fixed by `param_env = param_env.without_const()`.
This commit is contained in:
fee1-dead 2023-04-16 18:55:38 +08:00 committed by GitHub
commit a5136f14ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 25 additions and 68 deletions

View file

@ -32,14 +32,8 @@ impl<'tcx> super::QueryTypeOp<'tcx> for ProvePredicate<'tcx> {
fn perform_query(
tcx: TyCtxt<'tcx>,
mut canonicalized: Canonical<'tcx, ParamEnvAnd<'tcx, Self>>,
canonicalized: Canonical<'tcx, ParamEnvAnd<'tcx, Self>>,
) -> Fallible<CanonicalQueryResponse<'tcx, ()>> {
match canonicalized.value.value.predicate.kind().skip_binder() {
ty::PredicateKind::Clause(ty::Clause::Trait(pred)) => {
canonicalized.value.param_env.remap_constness_with(pred.constness);
}
_ => canonicalized.value.param_env = canonicalized.value.param_env.without_const(),
}
tcx.type_op_prove_predicate(canonicalized)
}
}