mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 19:20:13 +01:00
This also does a little restructuring in the same direction, following #6124. Leads want `Destroy` to work similarly now for all types. As a consequence, there doesn't seem to be as much benefit to splitting off aggregate destruction. In this PR, the `type.destroy` function can now be expected to destroy anything that's destructible; that means it'll be usable for the `final fn` once that support is available. Similarly, this gets rid of the impls other than the single blanket impl, now using `type.can_destroy`. Since they all need to use the same function, there's no benefit to splitting approaches. Also, now it can just be a `final impl` since there should be no need for people to create specializations -- if this blanket impl applies, it means the `final fn` is the same. This also slips in `partial` support since there's no reason to have it diverge anymore. Also `abstract`, which I'm not sure is broadly testable since most cases it'd come up, the `abstract` keyword is explicitly detected/rejected. Note though that this doesn't make any really big changes. It's just realigning on the leads decision. I'm going this way to try to reduce name-related churn for other changes.