mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:40:12 +01:00
Improve CanDestroyType to handle remaining cases (#6943)
This is only fixing the decision about *whether* to produce a witness. Implementation of the witness is still a TODO, though where a body is generated, it should also precisely reflect where one _needs_ to be generated. Note the tests: - toolchain/lower/testdata/function/generic/import_core_witness.carbon - toolchain/lower/testdata/function/generic/import_unused_def.carbon These tests can probably be produced _without_ Core.Destroy, but I found the essence of them while trying to build //examples with Core.Destroy and a simpler minimization wasn't striking me. Assisted-by: Google Antigravity with Gemini --------- Co-authored-by: jonmeow <jperkins@google.com>
This commit is contained in:
co-authored by
jonmeow
parent
1fa7a64cd4
commit
9266ced4e3
@@ -2349,7 +2349,7 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver,
|
||||
break;
|
||||
}
|
||||
case SemIR::Function::SpecialFunctionKind::CoreWitness: {
|
||||
new_function.SetCoreWitness();
|
||||
new_function.SetCoreWitness(import_function.builtin_function_kind());
|
||||
break;
|
||||
}
|
||||
case SemIR::Function::SpecialFunctionKind::Thunk: {
|
||||
|
||||
Reference in New Issue
Block a user