1
Fork 0

Always use RevealAll for const eval queries

This commit is contained in:
Oli Scherer 2024-01-10 16:54:43 +00:00
parent e927184629
commit 867831a170
32 changed files with 362 additions and 107 deletions

View file

@ -145,7 +145,7 @@ impl<'tcx> TyCtxt<'tcx> {
) -> EvalToConstValueResult<'tcx> {
// Const-eval shouldn't depend on lifetimes at all, so we can erase them, which should
// improve caching of queries.
let inputs = self.erase_regions(param_env.and(cid));
let inputs = self.erase_regions(param_env.with_reveal_all_normalized(self).and(cid));
if let Some(span) = span {
// The query doesn't know where it is being invoked, so we need to fix the span.
self.at(span).eval_to_const_value_raw(inputs).map_err(|e| e.with_span(span))
@ -164,7 +164,7 @@ impl<'tcx> TyCtxt<'tcx> {
) -> EvalToValTreeResult<'tcx> {
// Const-eval shouldn't depend on lifetimes at all, so we can erase them, which should
// improve caching of queries.
let inputs = self.erase_regions(param_env.and(cid));
let inputs = self.erase_regions(param_env.with_reveal_all_normalized(self).and(cid));
debug!(?inputs);
if let Some(span) = span {
// The query doesn't know where it is being invoked, so we need to fix the span.