Poison impl lookup queries with concrete results (#5373)

Once a concrete result has been found, it's not legal to write an `impl`
that would change the concrete result afterward.

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
Dana Jansens
2025-04-29 21:55:11 +00:00
committed by GitHub
co-authored by Richard Smith
parent bd99b74608
commit 13da710e94
13 changed files with 285 additions and 13 deletions
+2 -1
View File
@@ -207,7 +207,8 @@ auto EvalConstantInst(Context& context, SemIR::InstId inst_id,
GetCanonicalizedFacetOrTypeValue(context, inst.query_self_inst_id);
auto result = EvalLookupSingleImplWitness(
context, SemIR::LocId(inst_id), inst, non_canonical_query_self_inst_id);
context, SemIR::LocId(inst_id), inst, non_canonical_query_self_inst_id,
/*poison_concrete_results=*/true);
if (!result.has_value()) {
// We use NotConstant to communicate back to impl lookup that the lookup
// failed. This can not happen for a deferred symbolic lookup in a generic