Files
carbon-lang/core/prelude/destroy.carbon
T
Jon Ross-Perkins 4aa62bf5cd Switch Destroy to addr self (#5748)
Pointed out by zygoloid on #toolchain, just taking care of this now.
2025-06-28 00:50:47 +00:00

17 lines
532 B
Plaintext

// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
package Core library "prelude/destroy";
// Object destruction, including running `fn destroy()`. Note this is distinct
// from memory deallocation.
interface Destroy {
fn Op[addr self: Self*]();
}
// Provide a default blanket impl for trivial destruction.
impl forall [T:! type] T as Destroy {
fn Op[addr self: Self*]() = "no_op";
}