From 453b5474e4925f4f647096edd5aa7d633ab86995 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 22 Jul 2026 14:08:35 -0400 Subject: [PATCH] CHECK that the self is a symbolic type when looking for a Destroy and its type is a facet (#7553) As a follow up to #7546 (and see the discussion there), verify our assumptions that you can't have an object of type facet where the facet is not symbolic, and then need to find a Destroy witness for the object. --- toolchain/check/custom_witness.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/toolchain/check/custom_witness.cpp b/toolchain/check/custom_witness.cpp index 2c7d8fd569ac..6066c51a1da1 100644 --- a/toolchain/check/custom_witness.cpp +++ b/toolchain/check/custom_witness.cpp @@ -185,6 +185,7 @@ static auto CanDestroyType( // The value's type is a facet (whose type is a facet type). We don't // provide a custom witness for symbolic values of type facet. The witness // will be found from impl lookup. + CARBON_CHECK(query_self_const_id.is_symbolic()); return DestroyFormat::NoDestroy; }