Skip to content

Commit 4a6376c

Browse files
authored
Rename/restructure Destroy logic to better reflect carbon-language#6124 (carbon-language#6144)
This also does a little restructuring in the same direction, following carbon-language#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.
1 parent 0166d88 commit 4a6376c

File tree

160 files changed

+4005
-3863
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+4005
-3863
lines changed

core/prelude/destroy.carbon

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,22 @@
44

55
package Core library "prelude/destroy";
66

7-
import library "prelude/types/bool";
8-
import library "prelude/types/int_literal";
7+
// TODO: Add `Destructor`, as in:
8+
// interface Destructor {
9+
// private fn Op[ref self: Self]();
10+
// }
911

10-
// Destroys objects. Note this is distinct from memory deallocation.
11-
// TODO: Switch to `Destructor`+`Destroy` model.
12+
// Destroys objects. This will invoke `Destructor` impls recursively on members;
13+
// it does not deallocate memory.
1214
interface Destroy {
15+
// TODO: This should be `final fn Op[ref self: Self]() = "type.destroy"`.
1316
fn Op[addr self: Self*]();
1417
}
1518

16-
// Add destruction for essential builtin types. This can't be done earlier
17-
// because `Destroy` is using them.
18-
// TODO: This should match trivial destruction.
19-
impl bool as Destroy {
20-
fn Op[addr self: Self*]() = "no_op";
21-
}
22-
impl type as Destroy {
23-
fn Op[addr self: Self*]() = "no_op";
24-
}
25-
impl forall [PointeeT:! type] PointeeT* as Destroy {
26-
fn Op[addr self: Self*]() = "no_op";
27-
}
28-
29-
// Handles builtin aggregate type destruction.
30-
private fn CanAggregateDestroy() -> type = "type.can_aggregate_destroy";
31-
impl forall [AggregateT:! CanAggregateDestroy()] AggregateT as Destroy {
32-
fn Op[addr self: Self*]() = "type.aggregate_destroy";
33-
}
19+
// Returns a constraint that matches all types that should have a `Destroy` impl.
20+
private fn CanDestroy() -> type = "type.can_destroy";
3421

35-
// `const` instances always use the non-`const` destructor.
36-
impl forall [NonConstT:! Destroy] const NonConstT as Destroy {
37-
fn Op[addr self: Self*]() { (self unsafe as NonConstT*)->(Destroy.Op)(); }
22+
// Destroys an instance of `DestroyT`. This is also used for trivial types.
23+
final impl forall [DestroyT:! CanDestroy()] DestroyT as Destroy {
24+
fn Op[addr self: Self*]() = "type.destroy";
3825
}

toolchain/check/eval.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,7 +1646,7 @@ static auto MakeConstantForBuiltinCall(EvalContext& eval_context,
16461646
CARBON_FATAL("Not a builtin function.");
16471647

16481648
case SemIR::BuiltinFunctionKind::NoOp:
1649-
case SemIR::BuiltinFunctionKind::TypeAggregateDestroy: {
1649+
case SemIR::BuiltinFunctionKind::TypeDestroy: {
16501650
// Return an empty tuple value.
16511651
auto type_id = GetTupleType(eval_context.context(), {});
16521652
return MakeConstantResult(
@@ -1656,11 +1656,11 @@ static auto MakeConstantForBuiltinCall(EvalContext& eval_context,
16561656
phase);
16571657
}
16581658

1659-
case SemIR::BuiltinFunctionKind::TypeCanAggregateDestroy: {
1659+
case SemIR::BuiltinFunctionKind::TypeCanDestroy: {
16601660
CARBON_CHECK(arg_ids.empty());
16611661
auto id = eval_context.facet_types().Add(
16621662
{.builtin_constraint_mask =
1663-
SemIR::BuiltinConstraintMask::TypeCanAggregateDestroy});
1663+
SemIR::BuiltinConstraintMask::TypeCanDestroy});
16641664
return MakeConstantResult(
16651665
eval_context.context(),
16661666
SemIR::FacetType{.type_id = SemIR::TypeType::TypeId,

toolchain/check/impl_lookup.cpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -542,27 +542,34 @@ static auto GetOrAddLookupImplWitness(Context& context, SemIR::LocId loc_id,
542542
return context.constant_values().GetInstId(witness_const_id);
543543
}
544544

545-
// Returns true if the `Self` supports aggregate destruction.
546-
static auto TypeCanAggregateDestroy(Context& context,
547-
SemIR::ConstantId query_self_const_id)
548-
-> bool {
545+
// Returns true if the `Self` should impl `Destroy`.
546+
static auto TypeCanDestroy(Context& context,
547+
SemIR::ConstantId query_self_const_id) -> bool {
549548
auto inst = context.insts().Get(
550549
context.constant_values().GetInstId(query_self_const_id));
551550
CARBON_KIND_SWITCH(inst) {
552551
case CARBON_KIND(SemIR::ClassType class_type): {
553552
auto class_info = context.classes().Get(class_type.class_id);
554-
// Incomplete classes can't be destroyed.
553+
// Incomplete and abstract classes can't be destroyed.
555554
// TODO: Return false if the object repr doesn't impl `Destroy`.
556555
// TODO: Return false for C++ types that lack a destructor.
557-
return class_info.is_complete();
556+
return class_info.is_complete() &&
557+
class_info.inheritance_kind !=
558+
SemIR::Class::InheritanceKind::Abstract;
558559
}
559560
case SemIR::ArrayType::Kind:
561+
case SemIR::ConstType::Kind:
560562
case SemIR::MaybeUnformedType::Kind:
563+
case SemIR::PartialType::Kind:
561564
case SemIR::StructType::Kind:
562565
case SemIR::TupleType::Kind:
563566
// TODO: Return false for types that indirectly reference a type that
564567
// doesn't impl `Destroy`.
565568
return true;
569+
case SemIR::BoolType::Kind:
570+
case SemIR::PointerType::Kind:
571+
// Trivially destructible.
572+
return true;
566573
default:
567574
return false;
568575
}
@@ -597,8 +604,8 @@ auto LookupImplWitness(Context& context, SemIR::LocId loc_id,
597604
return SemIR::InstBlockId::None;
598605
}
599606
if (builtin_constraint_mask.HasAnyOf(
600-
SemIR::BuiltinConstraintMask::TypeCanAggregateDestroy) &&
601-
!TypeCanAggregateDestroy(context, query_self_const_id)) {
607+
SemIR::BuiltinConstraintMask::TypeCanDestroy) &&
608+
!TypeCanDestroy(context, query_self_const_id)) {
602609
return SemIR::InstBlockId::None;
603610
}
604611
if (interfaces.empty()) {

toolchain/check/testdata/array/basics.carbon

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ var a: array(1, 1);
181181
// CHECK:STDOUT: %tuple.type.14a: type = tuple_type (%tuple.type.734, %tuple.type.734) [concrete]
182182
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
183183
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
184-
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
184+
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
185185
// CHECK:STDOUT: %facet_value: %type_where = facet_value %array_type, () [concrete]
186-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.type.f05: type = fn_type @AggregateT.as_type.as.Destroy.impl.Op, @AggregateT.as_type.as.Destroy.impl(%facet_value) [concrete]
187-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.6cc: %AggregateT.as_type.as.Destroy.impl.Op.type.f05 = struct_value () [concrete]
186+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.type.f05: type = fn_type @DestroyT.as_type.as.Destroy.impl.Op, @DestroyT.as_type.as.Destroy.impl(%facet_value) [concrete]
187+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.6cc: %DestroyT.as_type.as.Destroy.impl.Op.type.f05 = struct_value () [concrete]
188188
// CHECK:STDOUT: }
189189
// CHECK:STDOUT:
190190
// CHECK:STDOUT: imports {
@@ -225,11 +225,11 @@ var a: array(1, 1);
225225
// CHECK:STDOUT: %v: ref %array_type = bind_name v, %v.var
226226
// CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%array_type, () [concrete = constants.%facet_value]
227227
// CHECK:STDOUT: %.loc10_3.2: %type_where = converted constants.%array_type, %facet_value [concrete = constants.%facet_value]
228-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %v.var, constants.%AggregateT.as_type.as.Destroy.impl.Op.6cc
228+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %v.var, constants.%DestroyT.as_type.as.Destroy.impl.Op.6cc
229229
// CHECK:STDOUT: <elided>
230-
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %v.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn
230+
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %v.var, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn
231231
// CHECK:STDOUT: %addr: %ptr.c6b = addr_of %v.var
232-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
232+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
233233
// CHECK:STDOUT: <elided>
234234
// CHECK:STDOUT: }
235235
// CHECK:STDOUT:
@@ -244,13 +244,13 @@ var a: array(1, 1);
244244
// CHECK:STDOUT: %tuple.type: type = tuple_type (%empty_tuple.type, %empty_tuple.type, %empty_tuple.type) [concrete]
245245
// CHECK:STDOUT: %ptr.7fe: type = ptr_type %tuple.type [concrete]
246246
// CHECK:STDOUT: %pattern_type.8c1: type = pattern_type %tuple.type [concrete]
247-
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
247+
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
248248
// CHECK:STDOUT: %facet_value.c7f: %type_where = facet_value %tuple.type, () [concrete]
249-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.type.b05: type = fn_type @AggregateT.as_type.as.Destroy.impl.Op, @AggregateT.as_type.as.Destroy.impl(%facet_value.c7f) [concrete]
250-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.1d6: %AggregateT.as_type.as.Destroy.impl.Op.type.b05 = struct_value () [concrete]
249+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.type.b05: type = fn_type @DestroyT.as_type.as.Destroy.impl.Op, @DestroyT.as_type.as.Destroy.impl(%facet_value.c7f) [concrete]
250+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.1d6: %DestroyT.as_type.as.Destroy.impl.Op.type.b05 = struct_value () [concrete]
251251
// CHECK:STDOUT: %facet_value.4cf: %type_where = facet_value %array_type, () [concrete]
252-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.type.7a9: type = fn_type @AggregateT.as_type.as.Destroy.impl.Op, @AggregateT.as_type.as.Destroy.impl(%facet_value.4cf) [concrete]
253-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.190: %AggregateT.as_type.as.Destroy.impl.Op.type.7a9 = struct_value () [concrete]
252+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.type.7a9: type = fn_type @DestroyT.as_type.as.Destroy.impl.Op, @DestroyT.as_type.as.Destroy.impl(%facet_value.4cf) [concrete]
253+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.190: %DestroyT.as_type.as.Destroy.impl.Op.type.7a9 = struct_value () [concrete]
254254
// CHECK:STDOUT: }
255255
// CHECK:STDOUT:
256256
// CHECK:STDOUT: imports {
@@ -288,18 +288,18 @@ var a: array(1, 1);
288288
// CHECK:STDOUT: %b: ref %tuple.type = bind_name b, %b.var
289289
// CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%tuple.type, () [concrete = constants.%facet_value.c7f]
290290
// CHECK:STDOUT: %.loc8_3: %type_where = converted constants.%tuple.type, %facet_value.loc8 [concrete = constants.%facet_value.c7f]
291-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %b.var, constants.%AggregateT.as_type.as.Destroy.impl.Op.1d6
291+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %b.var, constants.%DestroyT.as_type.as.Destroy.impl.Op.1d6
292292
// CHECK:STDOUT: <elided>
293-
// CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %b.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.1
293+
// CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %b.var, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn.1
294294
// CHECK:STDOUT: %addr.loc8: %ptr.7fe = addr_of %b.var
295-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8)
295+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8)
296296
// CHECK:STDOUT: %facet_value.loc7: %type_where = facet_value constants.%array_type, () [concrete = constants.%facet_value.4cf]
297297
// CHECK:STDOUT: %.loc7_3: %type_where = converted constants.%array_type, %facet_value.loc7 [concrete = constants.%facet_value.4cf]
298-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.bound.loc7: <bound method> = bound_method %a.var, constants.%AggregateT.as_type.as.Destroy.impl.Op.190
298+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound.loc7: <bound method> = bound_method %a.var, constants.%DestroyT.as_type.as.Destroy.impl.Op.190
299299
// CHECK:STDOUT: <elided>
300-
// CHECK:STDOUT: %bound_method.loc7: <bound method> = bound_method %a.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.2
300+
// CHECK:STDOUT: %bound_method.loc7: <bound method> = bound_method %a.var, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn.2
301301
// CHECK:STDOUT: %addr.loc7: %ptr.20b = addr_of %a.var
302-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc7: init %empty_tuple.type = call %bound_method.loc7(%addr.loc7)
302+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call.loc7: init %empty_tuple.type = call %bound_method.loc7(%addr.loc7)
303303
// CHECK:STDOUT: <elided>
304304
// CHECK:STDOUT: }
305305
// CHECK:STDOUT:
@@ -317,14 +317,14 @@ var a: array(1, 1);
317317
// CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %array_type [concrete]
318318
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
319319
// CHECK:STDOUT: %array: %array_type = tuple_value (%empty_tuple) [concrete]
320-
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
320+
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
321321
// CHECK:STDOUT: %facet_value.132: %type_where = facet_value %tuple.type, () [concrete]
322-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.type.2ee: type = fn_type @AggregateT.as_type.as.Destroy.impl.Op, @AggregateT.as_type.as.Destroy.impl(%facet_value.132) [concrete]
323-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.7ed: %AggregateT.as_type.as.Destroy.impl.Op.type.2ee = struct_value () [concrete]
322+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.type.2ee: type = fn_type @DestroyT.as_type.as.Destroy.impl.Op, @DestroyT.as_type.as.Destroy.impl(%facet_value.132) [concrete]
323+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.7ed: %DestroyT.as_type.as.Destroy.impl.Op.type.2ee = struct_value () [concrete]
324324
// CHECK:STDOUT: %ptr.652: type = ptr_type %tuple.type [concrete]
325325
// CHECK:STDOUT: %facet_value.c1b: %type_where = facet_value %array_type, () [concrete]
326-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.type.c21: type = fn_type @AggregateT.as_type.as.Destroy.impl.Op, @AggregateT.as_type.as.Destroy.impl(%facet_value.c1b) [concrete]
327-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.e50: %AggregateT.as_type.as.Destroy.impl.Op.type.c21 = struct_value () [concrete]
326+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.type.c21: type = fn_type @DestroyT.as_type.as.Destroy.impl.Op, @DestroyT.as_type.as.Destroy.impl(%facet_value.c1b) [concrete]
327+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.e50: %DestroyT.as_type.as.Destroy.impl.Op.type.c21 = struct_value () [concrete]
328328
// CHECK:STDOUT: }
329329
// CHECK:STDOUT:
330330
// CHECK:STDOUT: imports {
@@ -358,18 +358,18 @@ var a: array(1, 1);
358358
// CHECK:STDOUT: %t: ref %array_type = bind_name t, %t.var
359359
// CHECK:STDOUT: %facet_value.loc8_27: %type_where = facet_value constants.%tuple.type, () [concrete = constants.%facet_value.132]
360360
// CHECK:STDOUT: %.loc8_27.7: %type_where = converted constants.%tuple.type, %facet_value.loc8_27 [concrete = constants.%facet_value.132]
361-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.bound.loc8_27: <bound method> = bound_method %.loc8_27.2, constants.%AggregateT.as_type.as.Destroy.impl.Op.7ed
361+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound.loc8_27: <bound method> = bound_method %.loc8_27.2, constants.%DestroyT.as_type.as.Destroy.impl.Op.7ed
362362
// CHECK:STDOUT: <elided>
363-
// CHECK:STDOUT: %bound_method.loc8_27: <bound method> = bound_method %.loc8_27.2, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.1
363+
// CHECK:STDOUT: %bound_method.loc8_27: <bound method> = bound_method %.loc8_27.2, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn.1
364364
// CHECK:STDOUT: %addr.loc8_27: %ptr.652 = addr_of %.loc8_27.2
365-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc8_27: init %empty_tuple.type = call %bound_method.loc8_27(%addr.loc8_27)
365+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call.loc8_27: init %empty_tuple.type = call %bound_method.loc8_27(%addr.loc8_27)
366366
// CHECK:STDOUT: %facet_value.loc8_3: %type_where = facet_value constants.%array_type, () [concrete = constants.%facet_value.c1b]
367367
// CHECK:STDOUT: %.loc8_3.2: %type_where = converted constants.%array_type, %facet_value.loc8_3 [concrete = constants.%facet_value.c1b]
368-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.bound.loc8_3: <bound method> = bound_method %t.var, constants.%AggregateT.as_type.as.Destroy.impl.Op.e50
368+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound.loc8_3: <bound method> = bound_method %t.var, constants.%DestroyT.as_type.as.Destroy.impl.Op.e50
369369
// CHECK:STDOUT: <elided>
370-
// CHECK:STDOUT: %bound_method.loc8_3: <bound method> = bound_method %t.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.2
370+
// CHECK:STDOUT: %bound_method.loc8_3: <bound method> = bound_method %t.var, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn.2
371371
// CHECK:STDOUT: %addr.loc8_3: %ptr.b99 = addr_of %t.var
372-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc8_3: init %empty_tuple.type = call %bound_method.loc8_3(%addr.loc8_3)
372+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call.loc8_3: init %empty_tuple.type = call %bound_method.loc8_3(%addr.loc8_3)
373373
// CHECK:STDOUT: <elided>
374374
// CHECK:STDOUT: }
375375
// CHECK:STDOUT:

toolchain/check/testdata/array/import.carbon

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ fn F() -> array(i32, 1) {
7979
// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %i32, (%Copy.impl_witness.a32) [concrete]
8080
// CHECK:STDOUT: %.7fa: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete]
8181
// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.f59, @Int.as.Copy.impl.Op(%int_32) [concrete]
82-
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
82+
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
8383
// CHECK:STDOUT: %facet_value: %type_where = facet_value %array_type, () [concrete]
84-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.type.b6e: type = fn_type @AggregateT.as_type.as.Destroy.impl.Op, @AggregateT.as_type.as.Destroy.impl(%facet_value) [concrete]
85-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.91f: %AggregateT.as_type.as.Destroy.impl.Op.type.b6e = struct_value () [concrete]
84+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.type.b6e: type = fn_type @DestroyT.as_type.as.Destroy.impl.Op, @DestroyT.as_type.as.Destroy.impl(%facet_value) [concrete]
85+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.91f: %DestroyT.as_type.as.Destroy.impl.Op.type.b6e = struct_value () [concrete]
8686
// CHECK:STDOUT: }
8787
// CHECK:STDOUT:
8888
// CHECK:STDOUT: imports {
@@ -109,11 +109,11 @@ fn F() -> array(i32, 1) {
109109
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_15.2(%.loc6_15.2)
110110
// CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%array_type, () [concrete = constants.%facet_value]
111111
// CHECK:STDOUT: %.loc6_12.3: %type_where = converted constants.%array_type, %facet_value [concrete = constants.%facet_value]
112-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc6_12.2, constants.%AggregateT.as_type.as.Destroy.impl.Op.91f
112+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc6_12.2, constants.%DestroyT.as_type.as.Destroy.impl.Op.91f
113113
// CHECK:STDOUT: <elided>
114-
// CHECK:STDOUT: %bound_method.loc6_12: <bound method> = bound_method %.loc6_12.2, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn
114+
// CHECK:STDOUT: %bound_method.loc6_12: <bound method> = bound_method %.loc6_12.2, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn
115115
// CHECK:STDOUT: %addr: %ptr.830 = addr_of %.loc6_12.2
116-
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc6_12(%addr)
116+
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc6_12(%addr)
117117
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call to %return
118118
// CHECK:STDOUT: }
119119
// CHECK:STDOUT:

0 commit comments

Comments
 (0)