diff --git a/core/prelude/iterate.carbon b/core/prelude/iterate.carbon index 9f0da2f0a645e..15129c6068677 100644 --- a/core/prelude/iterate.carbon +++ b/core/prelude/iterate.carbon @@ -11,13 +11,13 @@ export import library "prelude/operators"; interface Iterate { // TODO: Support iterating ranges of non-copyable values. - let ElementType:! Copy; + let ElementType:! Copy & Destroy; let CursorType:! type; fn NewCursor[self: Self]() -> CursorType; fn Next[self: Self](cursor: CursorType*) -> Optional(ElementType); } -impl forall [T:! Copy, N:! IntLiteral()] +impl forall [T:! Copy & Destroy, N:! IntLiteral()] array(T, N) as Iterate where .ElementType = T and .CursorType = i32 { fn NewCursor[self: Self]() -> i32 { return 0; } diff --git a/core/prelude/types/maybe_unformed.carbon b/core/prelude/types/maybe_unformed.carbon index e04cef1a01c0c..79f77078ca3da 100644 --- a/core/prelude/types/maybe_unformed.carbon +++ b/core/prelude/types/maybe_unformed.carbon @@ -8,6 +8,7 @@ import library "prelude/destroy"; private fn MakeMaybeUnformed(t: type) -> type = "maybe_unformed.make_type"; -class MaybeUnformed(T:! type) { +// TODO: There should probably support for non-destructible types. +class MaybeUnformed(T:! Destroy) { adapt MakeMaybeUnformed(T); } diff --git a/core/prelude/types/optional.carbon b/core/prelude/types/optional.carbon index 0f0804efaeaa3..9dcb0fa5b332f 100644 --- a/core/prelude/types/optional.carbon +++ b/core/prelude/types/optional.carbon @@ -6,6 +6,7 @@ package Core library "prelude/types/optional"; import library "prelude/copy"; import library "prelude/destroy"; +import library "prelude/operators/bitwise"; import library "prelude/types/bool"; // For now, an `Optional(T)` is stored as a pair of a `bool` and a `T`, with @@ -16,7 +17,7 @@ import library "prelude/types/bool"; // // TODO: We don't have an approved design for an `Optional` type yet, but it's // used by the design for `Iterate`. The API here is a placeholder. -class Optional(T:! Copy) { +class Optional(T:! Copy & Destroy) { fn None() -> Self { returned var me: Self; me.has_value = false; diff --git a/toolchain/check/impl_lookup.cpp b/toolchain/check/impl_lookup.cpp index 33d16bc51e660..0b656b58cec08 100644 --- a/toolchain/check/impl_lookup.cpp +++ b/toolchain/check/impl_lookup.cpp @@ -18,6 +18,7 @@ #include "toolchain/check/impl.h" #include "toolchain/check/import_ref.h" #include "toolchain/check/inst.h" +#include "toolchain/check/name_lookup.h" #include "toolchain/check/subst.h" #include "toolchain/check/type.h" #include "toolchain/check/type_completion.h" @@ -26,6 +27,7 @@ #include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/impl.h" #include "toolchain/sem_ir/inst.h" +#include "toolchain/sem_ir/specific_interface.h" #include "toolchain/sem_ir/typed_insts.h" namespace Carbon::Check { @@ -523,48 +525,203 @@ static auto GetOrAddLookupImplWitness(Context& context, SemIR::LocId loc_id, return context.constant_values().GetInstId(witness_const_id); } -// Returns true if the `Self` should impl `Destroy`. -static auto TypeCanDestroy(Context& context, - SemIR::ConstantId query_self_const_id) -> bool { - auto inst = context.insts().Get(context.constant_values().GetInstId( - GetCanonicalFacetOrTypeValue(context, query_self_const_id))); - - // For facet values, look if the FacetType provides the same. - if (auto facet_type = - context.types().TryGetAs(inst.type_id())) { - const auto& info = context.facet_types().Get(facet_type->facet_type_id); - if (info.builtin_constraint_mask.HasAnyOf( - SemIR::BuiltinConstraintMask::TypeCanDestroy)) { - return true; +// Determines whether `type_id` is a `FacetType` which impls `Destroy`. +// +// This handles cases where the facet type provides either `CanDestroy` or +// `Destroy`; the former case will always have a `Destroy` implementation. +static auto CanDestroyFacetType(Context& context, SemIR::LocId loc_id, + SemIR::FacetType facet_type, + SemIR::InterfaceId& destroy_interface_id) + -> bool { + const auto& info = context.facet_types().Get(facet_type.facet_type_id); + if (info.builtin_constraint_mask.HasAnyOf( + SemIR::BuiltinConstraintMask::TypeCanDestroy)) { + return true; + } + + if (info.extend_constraints.empty()) { + return false; + } + + // Fetch `Core.Destroy` if it isn't yet known. + if (!destroy_interface_id.has_value()) { + auto destroy_id = LookupNameInCore(context, loc_id, "Destroy"); + auto destroy_facet_type = + context.insts().TryGetAs(destroy_id); + if (!destroy_facet_type) { + return false; + } + const auto& destroy_facet_type_info = + context.facet_types().Get(destroy_facet_type->facet_type_id); + auto destroy_specific_interface = + destroy_facet_type_info.TryAsSingleInterface(); + if (!destroy_specific_interface) { + return false; } + + destroy_interface_id = destroy_specific_interface->interface_id; } - CARBON_KIND_SWITCH(inst) { - case CARBON_KIND(SemIR::ClassType class_type): { - auto class_info = context.classes().Get(class_type.class_id); - // Incomplete and abstract classes can't be destroyed. - // TODO: Return false if the object repr doesn't impl `Destroy`. - // TODO: Return false for C++ types that lack a destructor. - return class_info.is_complete() && - class_info.inheritance_kind != - SemIR::Class::InheritanceKind::Abstract; - } - case SemIR::ArrayType::Kind: - case SemIR::ConstType::Kind: - case SemIR::MaybeUnformedType::Kind: - case SemIR::PartialType::Kind: - case SemIR::StructType::Kind: - case SemIR::TupleType::Kind: - // TODO: Return false for types that indirectly reference a type that - // doesn't impl `Destroy`. + for (const auto& constraint : info.extend_constraints) { + if (constraint.interface_id == destroy_interface_id) { return true; - case SemIR::BoolType::Kind: - case SemIR::PointerType::Kind: - // Trivially destructible. - return true; - default: - return false; + } } + + return false; +} + +// Returns true if the `Self` should impl `Destroy`. +static auto TypeCanDestroy(Context& context, SemIR::LocId loc_id, + SemIR::ConstantId query_self_const_id) -> bool { + // A lazily cached `Destroy` interface. + auto destroy_interface_id = SemIR::InterfaceId::None; + + auto query_inst_id = context.constant_values().GetInstId( + GetCanonicalFacetOrTypeValue(context, query_self_const_id)); + + // When querying a facet type, we can return early. + if (auto facet_type = context.types().TryGetAs( + context.insts().Get(query_inst_id).type_id())) { + return CanDestroyFacetType(context, loc_id, *facet_type, + destroy_interface_id); + } + + // A stack of IDs to check (ordering shouldn't be important). + struct WorkItem { + SemIR::InstId id; + // The only case `abstract` is allowed during a type walk is when looking at + // a `base` type of a class. + bool allow_abstract = false; + }; + llvm::SmallVector work; + + // Start by checking the queried instruction. + work.push_back({.id = query_inst_id}); + + // Loop through type structures recursively, looking for any types + // incompatible with `Destroy`. + while (!work.empty()) { + auto work_item = work.pop_back_val(); + auto inst = context.insts().Get(work_item.id); + + CARBON_KIND_SWITCH(inst) { + case CARBON_KIND(SemIR::ArrayType array_type): { + work.push_back({.id = array_type.element_type_inst_id}); + break; + } + + case CARBON_KIND(SemIR::BaseDecl base_decl): { + work.push_back( + {.id = base_decl.base_type_inst_id, .allow_abstract = true}); + break; + } + + case CARBON_KIND(SemIR::ConstType const_type): { + work.push_back({.id = const_type.inner_id, + .allow_abstract = work_item.allow_abstract}); + break; + } + + case CARBON_KIND(SemIR::ClassType class_type): { + auto class_info = context.classes().Get(class_type.class_id); + // Incomplete and abstract classes can't be destroyed. + if (!class_info.is_complete() || + (!work_item.allow_abstract && + class_info.inheritance_kind == + SemIR::Class::InheritanceKind::Abstract)) { + return false; + } + + // For C++ types, use Clang to determine whether they can be destructed. + // TODO: Needs appropriate calls. + if (context.name_scopes().Get(class_info.scope_id).is_cpp_scope()) { + break; + } + + auto obj_repr_id = + class_info.GetObjectRepr(context.sem_ir(), SemIR::SpecificId::None); + work.push_back({.id = context.types().GetInstId(obj_repr_id)}); + break; + } + + case CARBON_KIND(SemIR::FacetAccessType facet_access_type): { + // For facet types, see if they impl `Core.Destroy` directly. + if (!facet_access_type.facet_value_inst_id.has_value()) { + return false; + } + auto facet_value = + context.insts().Get(facet_access_type.facet_value_inst_id); + auto facet_type = + context.types().GetAs(facet_value.type_id()); + if (!CanDestroyFacetType(context, loc_id, facet_type, + destroy_interface_id)) { + return false; + } + break; + } + + case CARBON_KIND(SemIR::SymbolicBindingType facet_access_type): { + // For facet types, see if they impl `Core.Destroy` directly. + if (!facet_access_type.facet_value_inst_id.has_value()) { + return false; + } + auto facet_value = + context.insts().Get(facet_access_type.facet_value_inst_id); + auto facet_type = + context.types().GetAs(facet_value.type_id()); + if (!CanDestroyFacetType(context, loc_id, facet_type, + destroy_interface_id)) { + return false; + } + break; + } + + case CARBON_KIND(SemIR::StructType struct_type): { + for (auto field : + context.struct_type_fields().Get(struct_type.fields_id)) { + work.push_back({.id = field.type_inst_id}); + } + break; + } + + case CARBON_KIND(SemIR::TupleType tuple_type): { + for (auto element_id : + context.inst_blocks().Get(tuple_type.type_elements_id)) { + work.push_back({.id = element_id}); + } + break; + } + + case SemIR::FloatLiteralType::Kind: + case SemIR::FloatType::Kind: + case SemIR::IntLiteralType::Kind: + case SemIR::IntType::Kind: + case SemIR::BoolType::Kind: + case SemIR::PointerType::Kind: + case SemIR::TypeType::Kind: + // Trivially destructible. + break; + + case SemIR::MaybeUnformedType::Kind: + // TODO: Need to dig into the type to ensure it does `Destroy`. + break; + + case SemIR::BindSymbolicName::Kind: + case SemIR::ImplWitnessAccess::Kind: + // TODO: Figure out what to do with these. + return false; + + case SemIR::PartialType::Kind: + // Never destructible. + return false; + + default: + CARBON_FATAL("TypeCanDestroy found unexpected inst: {0}", inst); + } + } + + return true; } auto LookupImplWitness(Context& context, SemIR::LocId loc_id, @@ -597,7 +754,7 @@ auto LookupImplWitness(Context& context, SemIR::LocId loc_id, } if (builtin_constraint_mask.HasAnyOf( SemIR::BuiltinConstraintMask::TypeCanDestroy) && - !TypeCanDestroy(context, query_self_const_id)) { + !TypeCanDestroy(context, loc_id, query_self_const_id)) { return SemIR::InstBlockId::None; } if (interfaces.empty()) { diff --git a/toolchain/check/testdata/array/init_dependent_bound.carbon b/toolchain/check/testdata/array/init_dependent_bound.carbon index a66145ba12c52..caeaa99628b9f 100644 --- a/toolchain/check/testdata/array/init_dependent_bound.carbon +++ b/toolchain/check/testdata/array/init_dependent_bound.carbon @@ -14,7 +14,7 @@ library "[[@TEST_NAME]]"; -fn G(T:! type) { +fn G(T:! Core.Destroy) { // We can initialize this without knowing T. //@dump-sem-ir-begin var arr: array(T, 0) = (); @@ -59,29 +59,33 @@ fn H() { G(3); } // CHECK:STDOUT: --- generic_empty.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %T: %Destroy.type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] -// CHECK:STDOUT: %array_type.281: type = array_type %int_0, %T [symbolic] -// CHECK:STDOUT: %ptr.e06: type = ptr_type %array_type.281 [symbolic] -// CHECK:STDOUT: %require_complete.b7f: = require_complete_type %array_type.281 [symbolic] -// CHECK:STDOUT: %pattern_type.d48: type = pattern_type %array_type.281 [symbolic] -// CHECK:STDOUT: %array.2ed: %array_type.281 = tuple_value () [symbolic] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic] +// CHECK:STDOUT: %array_type.e6d: type = array_type %int_0, %T.binding.as_type [symbolic] +// CHECK:STDOUT: %ptr.6f8: type = ptr_type %array_type.e6d [symbolic] +// CHECK:STDOUT: %require_complete.2ee: = require_complete_type %array_type.e6d [symbolic] +// CHECK:STDOUT: %pattern_type.b8b: type = pattern_type %array_type.e6d [symbolic] +// CHECK:STDOUT: %array.bd1: %array_type.e6d = tuple_value () [symbolic] // CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] // CHECK:STDOUT: %type_where: type = facet_type > [concrete] // CHECK:STDOUT: %DestroyT: %type_where = bind_symbolic_name DestroyT, 0 [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%DestroyT) [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.544: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d = struct_value () [symbolic] -// CHECK:STDOUT: %facet_value.bf1: %type_where = facet_value %array_type.281, () [symbolic] -// CHECK:STDOUT: %Destroy.impl_witness.5dc: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.bf1) [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.90e: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.bf1) [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.84c: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.90e = struct_value () [symbolic] -// CHECK:STDOUT: %require_complete.662: = require_complete_type %ptr.e06 [symbolic] -// CHECK:STDOUT: %Destroy.facet.b30: %Destroy.type = facet_value %array_type.281, (%Destroy.impl_witness.5dc) [symbolic] -// CHECK:STDOUT: %.dc4: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.b30 [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.9d2: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.84c, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.bf1) [symbolic] +// CHECK:STDOUT: %facet_value.04b: %type_where = facet_value %array_type.e6d, () [symbolic] +// CHECK:STDOUT: %Destroy.impl_witness.d52: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.04b) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.2b0: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.04b) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.62b: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.2b0 = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.eb9: = require_complete_type %ptr.6f8 [symbolic] +// CHECK:STDOUT: %Destroy.facet.38d: %Destroy.type = facet_value %array_type.e6d, (%Destroy.impl_witness.d52) [symbolic] +// CHECK:STDOUT: %.34e: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.38d [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.962: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.62b, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.04b) [symbolic] // CHECK:STDOUT: %C: type = class_type @C [concrete] +// CHECK:STDOUT: %facet_value.be8: %type_where = facet_value %C, () [concrete] +// CHECK:STDOUT: %Destroy.impl_witness.a03: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.be8) [concrete] +// CHECK:STDOUT: %Destroy.facet.e5f: %Destroy.type = facet_value %C, (%Destroy.impl_witness.a03) [concrete] // CHECK:STDOUT: %array_type.6f1: type = array_type %int_0, %C [concrete] // CHECK:STDOUT: %ptr.cf4: type = ptr_type %array_type.6f1 [concrete] // CHECK:STDOUT: %complete_type.ed6: = complete_type_witness %array_type.6f1 [concrete] @@ -102,48 +106,51 @@ fn H() { G(3); } // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.950), @DestroyT.binding.as_type.as.Destroy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @G(%T.loc4_6.2: type) { +// CHECK:STDOUT: generic fn @G(%T.loc4_6.2: %Destroy.type) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %array_type.loc7_22.2: type = array_type constants.%int_0, %T.loc4_6.1 [symbolic = %array_type.loc7_22.2 (constants.%array_type.281)] -// CHECK:STDOUT: %require_complete.loc7_22: = require_complete_type %array_type.loc7_22.2 [symbolic = %require_complete.loc7_22 (constants.%require_complete.b7f)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc7_22.2 [symbolic = %pattern_type (constants.%pattern_type.d48)] -// CHECK:STDOUT: %array: @G.%array_type.loc7_22.2 (%array_type.281) = tuple_value () [symbolic = %array (constants.%array.2ed)] -// CHECK:STDOUT: %facet_value.loc7_3.2: %type_where = facet_value %array_type.loc7_22.2, () [symbolic = %facet_value.loc7_3.2 (constants.%facet_value.bf1)] -// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc7_3.2) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.5dc)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %array_type.loc7_22.2, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.b30)] -// CHECK:STDOUT: %.loc7_3.3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc7_3.3 (constants.%.dc4)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc7_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.90e)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @G.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.90e) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.84c)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc7_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.9d2)] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type.loc7_22.2 [symbolic = %ptr (constants.%ptr.e06)] -// CHECK:STDOUT: %require_complete.loc7_3: = require_complete_type %ptr [symbolic = %require_complete.loc7_3 (constants.%require_complete.662)] +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc4_6.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %array_type.loc7_22.2: type = array_type constants.%int_0, %T.binding.as_type [symbolic = %array_type.loc7_22.2 (constants.%array_type.e6d)] +// CHECK:STDOUT: %require_complete.loc7_22: = require_complete_type %array_type.loc7_22.2 [symbolic = %require_complete.loc7_22 (constants.%require_complete.2ee)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc7_22.2 [symbolic = %pattern_type (constants.%pattern_type.b8b)] +// CHECK:STDOUT: %array: @G.%array_type.loc7_22.2 (%array_type.e6d) = tuple_value () [symbolic = %array (constants.%array.bd1)] +// CHECK:STDOUT: %facet_value.loc7_3.2: %type_where = facet_value %array_type.loc7_22.2, () [symbolic = %facet_value.loc7_3.2 (constants.%facet_value.04b)] +// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc7_3.2) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.d52)] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %array_type.loc7_22.2, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.38d)] +// CHECK:STDOUT: %.loc7_3.3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc7_3.3 (constants.%.34e)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc7_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.2b0)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @G.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.2b0) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.62b)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc7_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.962)] +// CHECK:STDOUT: %ptr: type = ptr_type %array_type.loc7_22.2 [symbolic = %ptr (constants.%ptr.6f8)] +// CHECK:STDOUT: %require_complete.loc7_3: = require_complete_type %ptr [symbolic = %require_complete.loc7_3 (constants.%require_complete.eb9)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %arr.patt: @G.%pattern_type (%pattern_type.d48) = binding_pattern arr [concrete] -// CHECK:STDOUT: %arr.var_patt: @G.%pattern_type (%pattern_type.d48) = var_pattern %arr.patt [concrete] +// CHECK:STDOUT: %arr.patt: @G.%pattern_type (%pattern_type.b8b) = binding_pattern arr [concrete] +// CHECK:STDOUT: %arr.var_patt: @G.%pattern_type (%pattern_type.b8b) = var_pattern %arr.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref @G.%array_type.loc7_22.2 (%array_type.281) = var %arr.var_patt +// CHECK:STDOUT: %arr.var: ref @G.%array_type.loc7_22.2 (%array_type.e6d) = var %arr.var_patt // CHECK:STDOUT: %.loc7_27.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc7_27.2: init @G.%array_type.loc7_22.2 (%array_type.281) = array_init () to %arr.var [symbolic = %array (constants.%array.2ed)] -// CHECK:STDOUT: %.loc7_3.1: init @G.%array_type.loc7_22.2 (%array_type.281) = converted %.loc7_27.1, %.loc7_27.2 [symbolic = %array (constants.%array.2ed)] +// CHECK:STDOUT: %.loc7_27.2: init @G.%array_type.loc7_22.2 (%array_type.e6d) = array_init () to %arr.var [symbolic = %array (constants.%array.bd1)] +// CHECK:STDOUT: %.loc7_3.1: init @G.%array_type.loc7_22.2 (%array_type.e6d) = converted %.loc7_27.1, %.loc7_27.2 [symbolic = %array (constants.%array.bd1)] // CHECK:STDOUT: assign %arr.var, %.loc7_3.1 -// CHECK:STDOUT: %.loc7_22: type = splice_block %array_type.loc7_22.1 [symbolic = %array_type.loc7_22.2 (constants.%array_type.281)] { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] +// CHECK:STDOUT: %.loc7_22: type = splice_block %array_type.loc7_22.1 [symbolic = %array_type.loc7_22.2 (constants.%array_type.e6d)] { +// CHECK:STDOUT: %T.ref: %Destroy.type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %array_type.loc7_22.1: type = array_type %int_0, %T.ref [symbolic = %array_type.loc7_22.2 (constants.%array_type.281)] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc7_18: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %array_type.loc7_22.1: type = array_type %int_0, %.loc7_18 [symbolic = %array_type.loc7_22.2 (constants.%array_type.e6d)] // CHECK:STDOUT: } -// CHECK:STDOUT: %arr: ref @G.%array_type.loc7_22.2 (%array_type.281) = bind_name arr, %arr.var -// CHECK:STDOUT: %facet_value.loc7_3.1: %type_where = facet_value constants.%array_type.281, () [symbolic = %facet_value.loc7_3.2 (constants.%facet_value.bf1)] -// CHECK:STDOUT: %.loc7_3.2: %type_where = converted constants.%array_type.281, %facet_value.loc7_3.1 [symbolic = %facet_value.loc7_3.2 (constants.%facet_value.bf1)] -// CHECK:STDOUT: %impl.elem0: @G.%.loc7_3.3 (%.dc4) = impl_witness_access constants.%Destroy.impl_witness.5dc, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.84c)] +// CHECK:STDOUT: %arr: ref @G.%array_type.loc7_22.2 (%array_type.e6d) = bind_name arr, %arr.var +// CHECK:STDOUT: %facet_value.loc7_3.1: %type_where = facet_value constants.%array_type.e6d, () [symbolic = %facet_value.loc7_3.2 (constants.%facet_value.04b)] +// CHECK:STDOUT: %.loc7_3.2: %type_where = converted constants.%array_type.e6d, %facet_value.loc7_3.1 [symbolic = %facet_value.loc7_3.2 (constants.%facet_value.04b)] +// CHECK:STDOUT: %impl.elem0: @G.%.loc7_3.3 (%.34e) = impl_witness_access constants.%Destroy.impl_witness.d52, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.62b)] // CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %arr.var, %impl.elem0 -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.bf1) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.9d2)] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.04b) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.962)] // CHECK:STDOUT: %bound_method.loc7_3.2: = bound_method %arr.var, %specific_fn -// CHECK:STDOUT: %addr: @G.%ptr (%ptr.e06) = addr_of %arr.var +// CHECK:STDOUT: %addr: @G.%ptr (%ptr.6f8) = addr_of %arr.var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc7_3.2(%addr) // CHECK:STDOUT: // CHECK:STDOUT: } @@ -153,10 +160,11 @@ fn H() { G(3); } // CHECK:STDOUT: %T.loc4_6.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @G(constants.%C) { -// CHECK:STDOUT: %T.loc4_6.1 => constants.%C +// CHECK:STDOUT: specific @G(constants.%Destroy.facet.e5f) { +// CHECK:STDOUT: %T.loc4_6.1 => constants.%Destroy.facet.e5f // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %T.binding.as_type => constants.%C // CHECK:STDOUT: %array_type.loc7_22.2 => constants.%array_type.6f1 // CHECK:STDOUT: %require_complete.loc7_22 => constants.%complete_type.ed6 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9c8 diff --git a/toolchain/check/testdata/as/maybe_unformed.carbon b/toolchain/check/testdata/as/maybe_unformed.carbon index 1cacd5fc08584..35f412c0fa5f8 100644 --- a/toolchain/check/testdata/as/maybe_unformed.carbon +++ b/toolchain/check/testdata/as/maybe_unformed.carbon @@ -39,18 +39,18 @@ let value: X = Init(); fn Use() { // TODO: These should probably be valid. //@dump-sem-ir-begin - // CHECK:STDERR: fail_todo_add_unformed_nonref.carbon:[[@LINE+7]]:34: error: cannot convert expression of type `X` to `Core.MaybeUnformed(X)` with `as` [ConversionFailure] + // CHECK:STDERR: fail_todo_add_unformed_nonref.carbon:[[@LINE+7]]:34: error: cannot convert expression of type `X` to `Core.MaybeUnformed(X as Core.Destroy)` with `as` [ConversionFailure] // CHECK:STDERR: var i: Core.MaybeUnformed(X) = Init() as Core.MaybeUnformed(X); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_add_unformed_nonref.carbon:[[@LINE+4]]:34: note: type `X` does not implement interface `Core.As(Core.MaybeUnformed(X))` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_todo_add_unformed_nonref.carbon:[[@LINE+4]]:34: note: type `X` does not implement interface `Core.As(Core.MaybeUnformed(X as Core.Destroy))` [MissingImplInMemberAccessNote] // CHECK:STDERR: var i: Core.MaybeUnformed(X) = Init() as Core.MaybeUnformed(X); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var i: Core.MaybeUnformed(X) = Init() as Core.MaybeUnformed(X); - // CHECK:STDERR: fail_todo_add_unformed_nonref.carbon:[[@LINE+7]]:34: error: cannot convert expression of type `X` to `Core.MaybeUnformed(X)` with `as` [ConversionFailure] + // CHECK:STDERR: fail_todo_add_unformed_nonref.carbon:[[@LINE+7]]:34: error: cannot convert expression of type `X` to `Core.MaybeUnformed(X as Core.Destroy)` with `as` [ConversionFailure] // CHECK:STDERR: let v: Core.MaybeUnformed(X) = value as Core.MaybeUnformed(X); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_add_unformed_nonref.carbon:[[@LINE+4]]:34: note: type `X` does not implement interface `Core.As(Core.MaybeUnformed(X))` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_todo_add_unformed_nonref.carbon:[[@LINE+4]]:34: note: type `X` does not implement interface `Core.As(Core.MaybeUnformed(X as Core.Destroy))` [MissingImplInMemberAccessNote] // CHECK:STDERR: let v: Core.MaybeUnformed(X) = value as Core.MaybeUnformed(X); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -70,44 +70,44 @@ var reference: Core.MaybeUnformed(X); let ptr: Core.MaybeUnformed(X)* = &reference; fn Use() { - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:14: error: cannot convert expression of type `Core.MaybeUnformed(X)` to `X` with `as` [ConversionFailure] + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:14: error: cannot convert expression of type `Core.MaybeUnformed(X as Core.Destroy)` to `X` with `as` [ConversionFailure] // CHECK:STDERR: var i: X = Init() as X; // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:14: note: type `Core.MaybeUnformed(X)` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:14: note: type `Core.MaybeUnformed(X as Core.Destroy)` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var i: X = Init() as X; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: var i: X = Init() as X; // TODO: The diagnostic should explain that the reason we can't perform this // conversion is due to the expression category. - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:14: error: cannot convert expression of type `Core.MaybeUnformed(X)` to `X` with `unsafe as` [ConversionFailure] + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:14: error: cannot convert expression of type `Core.MaybeUnformed(X as Core.Destroy)` to `X` with `unsafe as` [ConversionFailure] // CHECK:STDERR: var j: X = Init() unsafe as X; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:14: note: type `Core.MaybeUnformed(X)` does not implement interface `Core.UnsafeAs(X)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:14: note: type `Core.MaybeUnformed(X as Core.Destroy)` does not implement interface `Core.UnsafeAs(X)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var j: X = Init() unsafe as X; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var j: X = Init() unsafe as X; - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:14: error: cannot convert expression of type `Core.MaybeUnformed(X)` to `X` with `as` [ConversionFailure] + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:14: error: cannot convert expression of type `Core.MaybeUnformed(X as Core.Destroy)` to `X` with `as` [ConversionFailure] // CHECK:STDERR: let v: X = value as X; // CHECK:STDERR: ^~~~~~~~~~ - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:14: note: type `Core.MaybeUnformed(X)` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:14: note: type `Core.MaybeUnformed(X as Core.Destroy)` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] // CHECK:STDERR: let v: X = value as X; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: let v: X = value as X; - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:17: error: cannot convert expression of type `Core.MaybeUnformed(X)` to `X` with `as` [ConversionFailure] + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:17: error: cannot convert expression of type `Core.MaybeUnformed(X as Core.Destroy)` to `X` with `as` [ConversionFailure] // CHECK:STDERR: let a: X* = &(reference as X); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:17: note: type `Core.MaybeUnformed(X)` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:17: note: type `Core.MaybeUnformed(X as Core.Destroy)` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] // CHECK:STDERR: let a: X* = &(reference as X); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: let a: X* = &(reference as X); - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:15: error: cannot convert expression of type `Core.MaybeUnformed(X)*` to `X*` with `as` [ConversionFailure] + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:15: error: cannot convert expression of type `Core.MaybeUnformed(X as Core.Destroy)*` to `X*` with `as` [ConversionFailure] // CHECK:STDERR: let b: X* = ptr as X*; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:15: note: type `Core.MaybeUnformed(X)*` does not implement interface `Core.As(X*)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:15: note: type `Core.MaybeUnformed(X as Core.Destroy)*` does not implement interface `Core.As(X*)` [MissingImplInMemberAccessNote] // CHECK:STDERR: let b: X* = ptr as X*; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -140,11 +140,16 @@ fn Use() { // CHECK:STDOUT: %ptr.d17: type = ptr_type %X [concrete] // CHECK:STDOUT: %MaybeUnformed.type: type = generic_class_type @MaybeUnformed [concrete] // CHECK:STDOUT: %MaybeUnformed.generic: %MaybeUnformed.type = struct_value () [concrete] -// CHECK:STDOUT: %MaybeUnformed.275: type = class_type @MaybeUnformed, @MaybeUnformed(%X) [concrete] -// CHECK:STDOUT: %ptr.58e: type = ptr_type %MaybeUnformed.275 [concrete] -// CHECK:STDOUT: %pattern_type.460: type = pattern_type %ptr.58e [concrete] -// CHECK:STDOUT: %reference.var: ref %MaybeUnformed.275 = var file.%reference.var_patt [concrete] -// CHECK:STDOUT: %addr.10a: %ptr.58e = addr_of %reference.var [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %type_where: type = facet_type > [concrete] +// CHECK:STDOUT: %facet_value: %type_where = facet_value %X, () [concrete] +// CHECK:STDOUT: %Destroy.impl_witness.f8a: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %X, (%Destroy.impl_witness.f8a) [concrete] +// CHECK:STDOUT: %MaybeUnformed.065: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet) [concrete] +// CHECK:STDOUT: %ptr.0d8: type = ptr_type %MaybeUnformed.065 [concrete] +// CHECK:STDOUT: %pattern_type.032: type = pattern_type %ptr.0d8 [concrete] +// CHECK:STDOUT: %reference.var: ref %MaybeUnformed.065 = var file.%reference.var_patt [concrete] +// CHECK:STDOUT: %addr.7f8: %ptr.0d8 = addr_of %reference.var [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -154,48 +159,66 @@ fn Use() { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.MaybeUnformed: %MaybeUnformed.type = import_ref Core//prelude/parts/maybe_unformed, MaybeUnformed, loaded [concrete = constants.%MaybeUnformed.generic] +// CHECK:STDOUT: %Core.import_ref.0c9 = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.0c9), @DestroyT.binding.as_type.as.Destroy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Use() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %a.patt: %pattern_type.460 = binding_pattern a [concrete] +// CHECK:STDOUT: %a.patt: %pattern_type.032 = binding_pattern a [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %reference.ref: ref %X = name_ref reference, file.%reference [concrete = file.%reference.var] // CHECK:STDOUT: %Core.ref.loc12_50: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %MaybeUnformed.ref.loc12_54: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] // CHECK:STDOUT: %X.ref.loc12_69: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc12_70: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.275] -// CHECK:STDOUT: %.loc12_47.1: ref %MaybeUnformed.275 = as_compatible %reference.ref [concrete = constants.%reference.var] -// CHECK:STDOUT: %.loc12_47.2: ref %MaybeUnformed.275 = converted %reference.ref, %.loc12_47.1 [concrete = constants.%reference.var] -// CHECK:STDOUT: %addr: %ptr.58e = addr_of %.loc12_47.2 [concrete = constants.%addr.10a] -// CHECK:STDOUT: %.loc12_31: type = splice_block %ptr.loc12 [concrete = constants.%ptr.58e] { +// CHECK:STDOUT: %facet_value.loc12_70: %type_where = facet_value constants.%X, () [concrete = constants.%facet_value] +// CHECK:STDOUT: %.loc12_70.1: %type_where = converted constants.%X, %facet_value.loc12_70 [concrete = constants.%facet_value] +// CHECK:STDOUT: %Destroy.facet.loc12_70: %Destroy.type = facet_value %X.ref.loc12_69, (constants.%Destroy.impl_witness.f8a) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc12_70.2: %Destroy.type = converted %X.ref.loc12_69, %Destroy.facet.loc12_70 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %MaybeUnformed.loc12_70: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%Destroy.facet) [concrete = constants.%MaybeUnformed.065] +// CHECK:STDOUT: %.loc12_47.1: ref %MaybeUnformed.065 = as_compatible %reference.ref [concrete = constants.%reference.var] +// CHECK:STDOUT: %.loc12_47.2: ref %MaybeUnformed.065 = converted %reference.ref, %.loc12_47.1 [concrete = constants.%reference.var] +// CHECK:STDOUT: %addr: %ptr.0d8 = addr_of %.loc12_47.2 [concrete = constants.%addr.7f8] +// CHECK:STDOUT: %.loc12_31: type = splice_block %ptr.loc12 [concrete = constants.%ptr.0d8] { // CHECK:STDOUT: %Core.ref.loc12_10: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %MaybeUnformed.ref.loc12_14: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] // CHECK:STDOUT: %X.ref.loc12_29: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc12_30: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.275] -// CHECK:STDOUT: %ptr.loc12: type = ptr_type %MaybeUnformed.loc12_30 [concrete = constants.%ptr.58e] +// CHECK:STDOUT: %facet_value.loc12_30: %type_where = facet_value constants.%X, () [concrete = constants.%facet_value] +// CHECK:STDOUT: %.loc12_30.1: %type_where = converted constants.%X, %facet_value.loc12_30 [concrete = constants.%facet_value] +// CHECK:STDOUT: %Destroy.facet.loc12_30: %Destroy.type = facet_value %X.ref.loc12_29, (constants.%Destroy.impl_witness.f8a) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc12_30.2: %Destroy.type = converted %X.ref.loc12_29, %Destroy.facet.loc12_30 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %MaybeUnformed.loc12_30: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%Destroy.facet) [concrete = constants.%MaybeUnformed.065] +// CHECK:STDOUT: %ptr.loc12: type = ptr_type %MaybeUnformed.loc12_30 [concrete = constants.%ptr.0d8] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: %ptr.58e = bind_name a, %addr +// CHECK:STDOUT: %a: %ptr.0d8 = bind_name a, %addr // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %b.patt: %pattern_type.460 = binding_pattern b [concrete] +// CHECK:STDOUT: %b.patt: %pattern_type.032 = binding_pattern b [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %ptr.ref: %ptr.d17 = name_ref ptr, file.%ptr.loc7_5 // CHECK:STDOUT: %Core.ref.loc13_42: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %MaybeUnformed.ref.loc13_46: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] // CHECK:STDOUT: %X.ref.loc13_61: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc13_62: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.275] -// CHECK:STDOUT: %ptr.loc13_63: type = ptr_type %MaybeUnformed.loc13_62 [concrete = constants.%ptr.58e] -// CHECK:STDOUT: %.loc13_39.1: %ptr.58e = as_compatible %ptr.ref -// CHECK:STDOUT: %.loc13_39.2: %ptr.58e = converted %ptr.ref, %.loc13_39.1 -// CHECK:STDOUT: %.loc13_31: type = splice_block %ptr.loc13_31 [concrete = constants.%ptr.58e] { +// CHECK:STDOUT: %facet_value.loc13_62: %type_where = facet_value constants.%X, () [concrete = constants.%facet_value] +// CHECK:STDOUT: %.loc13_62.1: %type_where = converted constants.%X, %facet_value.loc13_62 [concrete = constants.%facet_value] +// CHECK:STDOUT: %Destroy.facet.loc13_62: %Destroy.type = facet_value %X.ref.loc13_61, (constants.%Destroy.impl_witness.f8a) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc13_62.2: %Destroy.type = converted %X.ref.loc13_61, %Destroy.facet.loc13_62 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %MaybeUnformed.loc13_62: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%Destroy.facet) [concrete = constants.%MaybeUnformed.065] +// CHECK:STDOUT: %ptr.loc13_63: type = ptr_type %MaybeUnformed.loc13_62 [concrete = constants.%ptr.0d8] +// CHECK:STDOUT: %.loc13_39.1: %ptr.0d8 = as_compatible %ptr.ref +// CHECK:STDOUT: %.loc13_39.2: %ptr.0d8 = converted %ptr.ref, %.loc13_39.1 +// CHECK:STDOUT: %.loc13_31: type = splice_block %ptr.loc13_31 [concrete = constants.%ptr.0d8] { // CHECK:STDOUT: %Core.ref.loc13_10: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %MaybeUnformed.ref.loc13_14: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] // CHECK:STDOUT: %X.ref.loc13_29: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc13_30: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.275] -// CHECK:STDOUT: %ptr.loc13_31: type = ptr_type %MaybeUnformed.loc13_30 [concrete = constants.%ptr.58e] +// CHECK:STDOUT: %facet_value.loc13_30: %type_where = facet_value constants.%X, () [concrete = constants.%facet_value] +// CHECK:STDOUT: %.loc13_30.1: %type_where = converted constants.%X, %facet_value.loc13_30 [concrete = constants.%facet_value] +// CHECK:STDOUT: %Destroy.facet.loc13_30: %Destroy.type = facet_value %X.ref.loc13_29, (constants.%Destroy.impl_witness.f8a) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc13_30.2: %Destroy.type = converted %X.ref.loc13_29, %Destroy.facet.loc13_30 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %MaybeUnformed.loc13_30: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%Destroy.facet) [concrete = constants.%MaybeUnformed.065] +// CHECK:STDOUT: %ptr.loc13_31: type = ptr_type %MaybeUnformed.loc13_30 [concrete = constants.%ptr.0d8] // CHECK:STDOUT: } -// CHECK:STDOUT: %b: %ptr.58e = bind_name b, %.loc13_39.2 +// CHECK:STDOUT: %b: %ptr.0d8 = bind_name b, %.loc13_39.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -213,16 +236,22 @@ fn Use() { // CHECK:STDOUT: %Init: %Init.type = struct_value () [concrete] // CHECK:STDOUT: %MaybeUnformed.type: type = generic_class_type @MaybeUnformed [concrete] // CHECK:STDOUT: %MaybeUnformed.generic: %MaybeUnformed.type = struct_value () [concrete] -// CHECK:STDOUT: %MaybeUnformed.275: type = class_type @MaybeUnformed, @MaybeUnformed(%X) [concrete] -// CHECK:STDOUT: %pattern_type.eb8: type = pattern_type %MaybeUnformed.275 [concrete] -// CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete] -// CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %type_where: type = facet_type > [concrete] -// CHECK:STDOUT: %facet_value: %type_where = facet_value %MaybeUnformed.275, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.bef: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.60f: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.bef = struct_value () [concrete] -// CHECK:STDOUT: %ptr.58e: type = ptr_type %MaybeUnformed.275 [concrete] +// CHECK:STDOUT: %DestroyT: %type_where = bind_symbolic_name DestroyT, 0 [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%DestroyT) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.544: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d = struct_value () [symbolic] +// CHECK:STDOUT: %facet_value.b19: %type_where = facet_value %X, () [concrete] +// CHECK:STDOUT: %Destroy.impl_witness.0b8: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.b19) [concrete] +// CHECK:STDOUT: %Destroy.facet.e1c: %Destroy.type = facet_value %X, (%Destroy.impl_witness.0b8) [concrete] +// CHECK:STDOUT: %MaybeUnformed.367: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e1c) [concrete] +// CHECK:STDOUT: %pattern_type.a65: type = pattern_type %MaybeUnformed.367 [concrete] +// CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete] +// CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete] +// CHECK:STDOUT: %facet_value.d77: %type_where = facet_value %MaybeUnformed.367, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.0f8: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.d77) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.999: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.0f8 = struct_value () [concrete] +// CHECK:STDOUT: %ptr.720: type = ptr_type %MaybeUnformed.367 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -234,6 +263,8 @@ fn Use() { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.MaybeUnformed: %MaybeUnformed.type = import_ref Core//prelude/parts/maybe_unformed, MaybeUnformed, loaded [concrete = constants.%MaybeUnformed.generic] +// CHECK:STDOUT: %Core.import_ref.950: @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.544)] +// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.950), @DestroyT.binding.as_type.as.Destroy.impl [concrete] // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } @@ -241,48 +272,64 @@ fn Use() { // CHECK:STDOUT: fn @Use() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %i.patt: %pattern_type.eb8 = binding_pattern i [concrete] -// CHECK:STDOUT: %i.var_patt: %pattern_type.eb8 = var_pattern %i.patt [concrete] +// CHECK:STDOUT: %i.patt: %pattern_type.a65 = binding_pattern i [concrete] +// CHECK:STDOUT: %i.var_patt: %pattern_type.a65 = var_pattern %i.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %i.var: ref %MaybeUnformed.275 = var %i.var_patt +// CHECK:STDOUT: %i.var: ref %MaybeUnformed.367 = var %i.var_patt // CHECK:STDOUT: %Init.ref: %Init.type = name_ref Init, file.%Init.decl [concrete = constants.%Init] // CHECK:STDOUT: %.loc19_39: ref %X = temporary_storage // CHECK:STDOUT: %Init.call: init %X = call %Init.ref() to %.loc19_39 // CHECK:STDOUT: %Core.ref.loc19_44: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %MaybeUnformed.ref.loc19_48: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] // CHECK:STDOUT: %X.ref.loc19_63: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc19_64: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.275] -// CHECK:STDOUT: %.loc19_41: %MaybeUnformed.275 = converted %Init.call, [concrete = ] +// CHECK:STDOUT: %facet_value.loc19_64: %type_where = facet_value constants.%X, () [concrete = constants.%facet_value.b19] +// CHECK:STDOUT: %.loc19_64.1: %type_where = converted constants.%X, %facet_value.loc19_64 [concrete = constants.%facet_value.b19] +// CHECK:STDOUT: %Destroy.facet.loc19_64: %Destroy.type = facet_value %X.ref.loc19_63, (constants.%Destroy.impl_witness.0b8) [concrete = constants.%Destroy.facet.e1c] +// CHECK:STDOUT: %.loc19_64.2: %Destroy.type = converted %X.ref.loc19_63, %Destroy.facet.loc19_64 [concrete = constants.%Destroy.facet.e1c] +// CHECK:STDOUT: %MaybeUnformed.loc19_64: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%Destroy.facet.e1c) [concrete = constants.%MaybeUnformed.367] +// CHECK:STDOUT: %.loc19_41: %MaybeUnformed.367 = converted %Init.call, [concrete = ] // CHECK:STDOUT: assign %i.var, -// CHECK:STDOUT: %.loc19_30: type = splice_block %MaybeUnformed.loc19_30 [concrete = constants.%MaybeUnformed.275] { +// CHECK:STDOUT: %.loc19_30.1: type = splice_block %MaybeUnformed.loc19_30 [concrete = constants.%MaybeUnformed.367] { // CHECK:STDOUT: %Core.ref.loc19_10: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %MaybeUnformed.ref.loc19_14: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] // CHECK:STDOUT: %X.ref.loc19_29: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc19_30: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.275] +// CHECK:STDOUT: %facet_value.loc19_30: %type_where = facet_value constants.%X, () [concrete = constants.%facet_value.b19] +// CHECK:STDOUT: %.loc19_30.2: %type_where = converted constants.%X, %facet_value.loc19_30 [concrete = constants.%facet_value.b19] +// CHECK:STDOUT: %Destroy.facet.loc19_30: %Destroy.type = facet_value %X.ref.loc19_29, (constants.%Destroy.impl_witness.0b8) [concrete = constants.%Destroy.facet.e1c] +// CHECK:STDOUT: %.loc19_30.3: %Destroy.type = converted %X.ref.loc19_29, %Destroy.facet.loc19_30 [concrete = constants.%Destroy.facet.e1c] +// CHECK:STDOUT: %MaybeUnformed.loc19_30: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%Destroy.facet.e1c) [concrete = constants.%MaybeUnformed.367] // CHECK:STDOUT: } -// CHECK:STDOUT: %i: ref %MaybeUnformed.275 = bind_name i, %i.var +// CHECK:STDOUT: %i: ref %MaybeUnformed.367 = bind_name i, %i.var // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %v.patt: %pattern_type.eb8 = binding_pattern v [concrete] +// CHECK:STDOUT: %v.patt: %pattern_type.a65 = binding_pattern v [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %value.ref: %X = name_ref value, file.%value // CHECK:STDOUT: %Core.ref.loc27_43: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %MaybeUnformed.ref.loc27_47: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] // CHECK:STDOUT: %X.ref.loc27_62: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc27_63: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.275] -// CHECK:STDOUT: %.loc27_40: %MaybeUnformed.275 = converted %value.ref, [concrete = ] -// CHECK:STDOUT: %.loc27_30: type = splice_block %MaybeUnformed.loc27_30 [concrete = constants.%MaybeUnformed.275] { +// CHECK:STDOUT: %facet_value.loc27_63: %type_where = facet_value constants.%X, () [concrete = constants.%facet_value.b19] +// CHECK:STDOUT: %.loc27_63.1: %type_where = converted constants.%X, %facet_value.loc27_63 [concrete = constants.%facet_value.b19] +// CHECK:STDOUT: %Destroy.facet.loc27_63: %Destroy.type = facet_value %X.ref.loc27_62, (constants.%Destroy.impl_witness.0b8) [concrete = constants.%Destroy.facet.e1c] +// CHECK:STDOUT: %.loc27_63.2: %Destroy.type = converted %X.ref.loc27_62, %Destroy.facet.loc27_63 [concrete = constants.%Destroy.facet.e1c] +// CHECK:STDOUT: %MaybeUnformed.loc27_63: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%Destroy.facet.e1c) [concrete = constants.%MaybeUnformed.367] +// CHECK:STDOUT: %.loc27_40: %MaybeUnformed.367 = converted %value.ref, [concrete = ] +// CHECK:STDOUT: %.loc27_30.1: type = splice_block %MaybeUnformed.loc27_30 [concrete = constants.%MaybeUnformed.367] { // CHECK:STDOUT: %Core.ref.loc27_10: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %MaybeUnformed.ref.loc27_14: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] // CHECK:STDOUT: %X.ref.loc27_29: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc27_30: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.275] +// CHECK:STDOUT: %facet_value.loc27_30: %type_where = facet_value constants.%X, () [concrete = constants.%facet_value.b19] +// CHECK:STDOUT: %.loc27_30.2: %type_where = converted constants.%X, %facet_value.loc27_30 [concrete = constants.%facet_value.b19] +// CHECK:STDOUT: %Destroy.facet.loc27_30: %Destroy.type = facet_value %X.ref.loc27_29, (constants.%Destroy.impl_witness.0b8) [concrete = constants.%Destroy.facet.e1c] +// CHECK:STDOUT: %.loc27_30.3: %Destroy.type = converted %X.ref.loc27_29, %Destroy.facet.loc27_30 [concrete = constants.%Destroy.facet.e1c] +// CHECK:STDOUT: %MaybeUnformed.loc27_30: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%Destroy.facet.e1c) [concrete = constants.%MaybeUnformed.367] // CHECK:STDOUT: } -// CHECK:STDOUT: %v: %MaybeUnformed.275 = bind_name v, [concrete = ] -// CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%MaybeUnformed.275, () [concrete = constants.%facet_value] -// CHECK:STDOUT: %.loc19_3: %type_where = converted constants.%MaybeUnformed.275, %facet_value [concrete = constants.%facet_value] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: = bound_method %i.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.60f +// CHECK:STDOUT: %v: %MaybeUnformed.367 = bind_name v, [concrete = ] +// CHECK:STDOUT: %facet_value.loc19_3: %type_where = facet_value constants.%MaybeUnformed.367, () [concrete = constants.%facet_value.d77] +// CHECK:STDOUT: %.loc19_3: %type_where = converted constants.%MaybeUnformed.367, %facet_value.loc19_3 [concrete = constants.%facet_value.d77] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: = bound_method %i.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.999 // CHECK:STDOUT: // CHECK:STDOUT: %bound_method: = bound_method %i.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr: %ptr.58e = addr_of %i.var +// CHECK:STDOUT: %addr: %ptr.720 = addr_of %i.var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr) // CHECK:STDOUT: // CHECK:STDOUT: } @@ -296,16 +343,23 @@ fn Use() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %X: type = class_type @X [concrete] -// CHECK:STDOUT: %MaybeUnformed.275: type = class_type @MaybeUnformed, @MaybeUnformed(%X) [concrete] -// CHECK:STDOUT: %ptr.58e: type = ptr_type %MaybeUnformed.275 [concrete] -// CHECK:STDOUT: %pattern_type.019: type = pattern_type %X [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %type_where: type = facet_type > [concrete] +// CHECK:STDOUT: %facet_value: %type_where = facet_value %X, () [concrete] +// CHECK:STDOUT: %Destroy.impl_witness.f8a: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete] // CHECK:STDOUT: %ptr.d17: type = ptr_type %X [concrete] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %X, (%Destroy.impl_witness.f8a) [concrete] +// CHECK:STDOUT: %MaybeUnformed.065: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet) [concrete] +// CHECK:STDOUT: %ptr.0d8: type = ptr_type %MaybeUnformed.065 [concrete] +// CHECK:STDOUT: %pattern_type.019: type = pattern_type %X [concrete] // CHECK:STDOUT: %pattern_type.1c6: type = pattern_type %ptr.d17 [concrete] // CHECK:STDOUT: %reference.var: ref %X = var file.%reference.var_patt [concrete] -// CHECK:STDOUT: %addr.a46: %ptr.d17 = addr_of %reference.var [concrete] +// CHECK:STDOUT: %addr.d75: %ptr.d17 = addr_of %reference.var [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core.import_ref.0c9 = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.0c9), @DestroyT.binding.as_type.as.Destroy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Use() { @@ -313,9 +367,9 @@ fn Use() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %v.patt: %pattern_type.019 = binding_pattern v [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %value.ref: %MaybeUnformed.275 = name_ref value, file.%value +// CHECK:STDOUT: %value.ref: %MaybeUnformed.065 = name_ref value, file.%value // CHECK:STDOUT: %X.ref.loc13_30: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc13_27.1: ref %MaybeUnformed.275 = value_as_ref %value.ref +// CHECK:STDOUT: %.loc13_27.1: ref %MaybeUnformed.065 = value_as_ref %value.ref // CHECK:STDOUT: %.loc13_27.2: ref %X = as_compatible %.loc13_27.1 // CHECK:STDOUT: %.loc13_27.3: %X = bind_value %.loc13_27.2 // CHECK:STDOUT: %.loc13_27.4: %X = converted %value.ref, %.loc13_27.3 @@ -324,11 +378,11 @@ fn Use() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.1c6 = binding_pattern a [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %reference.ref: ref %MaybeUnformed.275 = name_ref reference, file.%reference [concrete = file.%reference.var] +// CHECK:STDOUT: %reference.ref: ref %MaybeUnformed.065 = name_ref reference, file.%reference [concrete = file.%reference.var] // CHECK:STDOUT: %X.ref.loc14_37: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %.loc14_34.1: ref %X = as_compatible %reference.ref [concrete = constants.%reference.var] // CHECK:STDOUT: %.loc14_34.2: ref %X = converted %reference.ref, %.loc14_34.1 [concrete = constants.%reference.var] -// CHECK:STDOUT: %addr: %ptr.d17 = addr_of %.loc14_34.2 [concrete = constants.%addr.a46] +// CHECK:STDOUT: %addr: %ptr.d17 = addr_of %.loc14_34.2 [concrete = constants.%addr.d75] // CHECK:STDOUT: %.loc14_11: type = splice_block %ptr.loc14 [concrete = constants.%ptr.d17] { // CHECK:STDOUT: %X.ref.loc14_10: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %ptr.loc14: type = ptr_type %X.ref.loc14_10 [concrete = constants.%ptr.d17] @@ -337,7 +391,7 @@ fn Use() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.1c6 = binding_pattern b [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %ptr.ref: %ptr.58e = name_ref ptr, file.%ptr.loc9_5 +// CHECK:STDOUT: %ptr.ref: %ptr.0d8 = name_ref ptr, file.%ptr.loc9_5 // CHECK:STDOUT: %X.ref.loc15_29: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %ptr.loc15_30: type = ptr_type %X.ref.loc15_29 [concrete = constants.%ptr.d17] // CHECK:STDOUT: %.loc15_26.1: %ptr.d17 = as_compatible %ptr.ref diff --git a/toolchain/check/testdata/as/partial.carbon b/toolchain/check/testdata/as/partial.carbon index 807825816e6ea..53b1c631dc997 100644 --- a/toolchain/check/testdata/as/partial.carbon +++ b/toolchain/check/testdata/as/partial.carbon @@ -24,13 +24,33 @@ let ptr: X* = &reference; fn Use() { // TODO: Should some of these be valid without the `as`? //@dump-sem-ir-begin - var i: partial X = Init() as partial X; let v: partial X = value as partial X; let a: partial X* = &(reference as partial X); let b: partial X* = ptr as partial X*; //@dump-sem-ir-end } +// --- fail_todo_init_partial.carbon + +library "[[@TEST_NAME]]"; + +base class X {} + +fn Init() -> X; + +fn Use() { + // TODO: Should some of these be valid without the `as`? + // TODO: This errors because the `as partial X` causes a copy instead of a + // move. + //@dump-sem-ir-begin + // CHECK:STDERR: fail_todo_init_partial.carbon:[[@LINE+4]]:22: error: cannot access member of interface `Core.Destroy` in type `partial X` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: let i: partial X = Init() as partial X; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + let i: partial X = Init() as partial X; + //@dump-sem-ir-end +} + // --- fail_todo_remove_partial_in_init.carbon library "[[@TEST_NAME]]"; @@ -132,9 +152,6 @@ fn Use() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %X: type = class_type @X [concrete] -// CHECK:STDOUT: %Init.type: type = fn_type @Init [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %Init: %Init.type = struct_value () [concrete] // CHECK:STDOUT: %ptr.d17: type = ptr_type %X [concrete] // CHECK:STDOUT: %.e71: type = partial_type %X [concrete] // CHECK:STDOUT: %pattern_type.a53: type = pattern_type %.e71 [concrete] @@ -142,10 +159,6 @@ fn Use() { // CHECK:STDOUT: %pattern_type.46e: type = pattern_type %ptr.7b2 [concrete] // CHECK:STDOUT: %reference.var: ref %.e71 = var file.%reference.var_patt [concrete] // CHECK:STDOUT: %addr.e01: %ptr.7b2 = addr_of %reference.var [concrete] -// CHECK:STDOUT: %type_where: type = facet_type > [concrete] -// CHECK:STDOUT: %facet_value: %type_where = facet_value %.e71, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.f3c: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.70b: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.f3c = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -154,73 +167,48 @@ fn Use() { // CHECK:STDOUT: fn @Use() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %i.patt: %pattern_type.a53 = binding_pattern i [concrete] -// CHECK:STDOUT: %i.var_patt: %pattern_type.a53 = var_pattern %i.patt [concrete] +// CHECK:STDOUT: %v.patt: %pattern_type.a53 = binding_pattern v [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %i.var: ref %.e71 = var %i.var_patt -// CHECK:STDOUT: %Init.ref: %Init.type = name_ref Init, file.%Init.decl [concrete = constants.%Init] -// CHECK:STDOUT: %.loc14_3.1: ref %.e71 = splice_block %i.var {} -// CHECK:STDOUT: %Init.call: init %X = call %Init.ref() to %.loc14_3.1 -// CHECK:STDOUT: %X.ref.loc14_40: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc14_32: type = partial_type %X.ref.loc14_40 [concrete = constants.%.e71] -// CHECK:STDOUT: %.loc14_29.1: init %.e71 = as_compatible %Init.call -// CHECK:STDOUT: %.loc14_29.2: init %.e71 = converted %Init.call, %.loc14_29.1 -// CHECK:STDOUT: assign %i.var, %.loc14_29.2 +// CHECK:STDOUT: %value.ref: %X = name_ref value, file.%value +// CHECK:STDOUT: %X.ref.loc14_39: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc14_31: type = partial_type %X.ref.loc14_39 [concrete = constants.%.e71] +// CHECK:STDOUT: %.loc14_28.1: %.e71 = as_compatible %value.ref +// CHECK:STDOUT: %.loc14_28.2: %.e71 = converted %value.ref, %.loc14_28.1 // CHECK:STDOUT: %.loc14_10.1: type = splice_block %.loc14_10.2 [concrete = constants.%.e71] { // CHECK:STDOUT: %X.ref.loc14_18: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %.loc14_10.2: type = partial_type %X.ref.loc14_18 [concrete = constants.%.e71] // CHECK:STDOUT: } -// CHECK:STDOUT: %i: ref %.e71 = bind_name i, %i.var -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %v.patt: %pattern_type.a53 = binding_pattern v [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %value.ref: %X = name_ref value, file.%value -// CHECK:STDOUT: %X.ref.loc15_39: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc15_31: type = partial_type %X.ref.loc15_39 [concrete = constants.%.e71] -// CHECK:STDOUT: %.loc15_28.1: %.e71 = as_compatible %value.ref -// CHECK:STDOUT: %.loc15_28.2: %.e71 = converted %value.ref, %.loc15_28.1 -// CHECK:STDOUT: %.loc15_10.1: type = splice_block %.loc15_10.2 [concrete = constants.%.e71] { -// CHECK:STDOUT: %X.ref.loc15_18: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc15_10.2: type = partial_type %X.ref.loc15_18 [concrete = constants.%.e71] -// CHECK:STDOUT: } -// CHECK:STDOUT: %v: %.e71 = bind_name v, %.loc15_28.2 +// CHECK:STDOUT: %v: %.e71 = bind_name v, %.loc14_28.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.46e = binding_pattern a [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %reference.ref: ref %X = name_ref reference, file.%reference [concrete = file.%reference.var] -// CHECK:STDOUT: %X.ref.loc16_46: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc16_38: type = partial_type %X.ref.loc16_46 [concrete = constants.%.e71] -// CHECK:STDOUT: %.loc16_35.1: ref %.e71 = as_compatible %reference.ref [concrete = constants.%reference.var] -// CHECK:STDOUT: %.loc16_35.2: ref %.e71 = converted %reference.ref, %.loc16_35.1 [concrete = constants.%reference.var] -// CHECK:STDOUT: %addr.loc16: %ptr.7b2 = addr_of %.loc16_35.2 [concrete = constants.%addr.e01] -// CHECK:STDOUT: %.loc16_19: type = splice_block %ptr.loc16 [concrete = constants.%ptr.7b2] { -// CHECK:STDOUT: %X.ref.loc16_18: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc16_10: type = partial_type %X.ref.loc16_18 [concrete = constants.%.e71] -// CHECK:STDOUT: %ptr.loc16: type = ptr_type %.loc16_10 [concrete = constants.%ptr.7b2] +// CHECK:STDOUT: %X.ref.loc15_46: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc15_38: type = partial_type %X.ref.loc15_46 [concrete = constants.%.e71] +// CHECK:STDOUT: %.loc15_35.1: ref %.e71 = as_compatible %reference.ref [concrete = constants.%reference.var] +// CHECK:STDOUT: %.loc15_35.2: ref %.e71 = converted %reference.ref, %.loc15_35.1 [concrete = constants.%reference.var] +// CHECK:STDOUT: %addr: %ptr.7b2 = addr_of %.loc15_35.2 [concrete = constants.%addr.e01] +// CHECK:STDOUT: %.loc15_19: type = splice_block %ptr.loc15 [concrete = constants.%ptr.7b2] { +// CHECK:STDOUT: %X.ref.loc15_18: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc15_10: type = partial_type %X.ref.loc15_18 [concrete = constants.%.e71] +// CHECK:STDOUT: %ptr.loc15: type = ptr_type %.loc15_10 [concrete = constants.%ptr.7b2] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: %ptr.7b2 = bind_name a, %addr.loc16 +// CHECK:STDOUT: %a: %ptr.7b2 = bind_name a, %addr // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.46e = binding_pattern b [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %ptr.ref: %ptr.d17 = name_ref ptr, file.%ptr.loc9_5 -// CHECK:STDOUT: %X.ref.loc17_38: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc17_30: type = partial_type %X.ref.loc17_38 [concrete = constants.%.e71] -// CHECK:STDOUT: %ptr.loc17_39: type = ptr_type %.loc17_30 [concrete = constants.%ptr.7b2] -// CHECK:STDOUT: %.loc17_27.1: %ptr.7b2 = as_compatible %ptr.ref -// CHECK:STDOUT: %.loc17_27.2: %ptr.7b2 = converted %ptr.ref, %.loc17_27.1 -// CHECK:STDOUT: %.loc17_19: type = splice_block %ptr.loc17_19 [concrete = constants.%ptr.7b2] { -// CHECK:STDOUT: %X.ref.loc17_18: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc17_10: type = partial_type %X.ref.loc17_18 [concrete = constants.%.e71] -// CHECK:STDOUT: %ptr.loc17_19: type = ptr_type %.loc17_10 [concrete = constants.%ptr.7b2] +// CHECK:STDOUT: %X.ref.loc16_38: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc16_30: type = partial_type %X.ref.loc16_38 [concrete = constants.%.e71] +// CHECK:STDOUT: %ptr.loc16_39: type = ptr_type %.loc16_30 [concrete = constants.%ptr.7b2] +// CHECK:STDOUT: %.loc16_27.1: %ptr.7b2 = as_compatible %ptr.ref +// CHECK:STDOUT: %.loc16_27.2: %ptr.7b2 = converted %ptr.ref, %.loc16_27.1 +// CHECK:STDOUT: %.loc16_19: type = splice_block %ptr.loc16_19 [concrete = constants.%ptr.7b2] { +// CHECK:STDOUT: %X.ref.loc16_18: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc16_10: type = partial_type %X.ref.loc16_18 [concrete = constants.%.e71] +// CHECK:STDOUT: %ptr.loc16_19: type = ptr_type %.loc16_10 [concrete = constants.%ptr.7b2] // CHECK:STDOUT: } -// CHECK:STDOUT: %b: %ptr.7b2 = bind_name b, %.loc17_27.2 -// CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%.e71, () [concrete = constants.%facet_value] -// CHECK:STDOUT: %.loc14_3.2: %type_where = converted constants.%.e71, %facet_value [concrete = constants.%facet_value] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: = bound_method %i.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.70b -// CHECK:STDOUT: -// CHECK:STDOUT: %bound_method: = bound_method %i.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr.loc14: %ptr.7b2 = addr_of %i.var -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc14) +// CHECK:STDOUT: %b: %ptr.7b2 = bind_name b, %.loc16_27.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -229,6 +217,41 @@ fn Use() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: --- fail_todo_init_partial.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %X: type = class_type @X [concrete] +// CHECK:STDOUT: %Init.type: type = fn_type @Init [concrete] +// CHECK:STDOUT: %Init: %Init.type = struct_value () [concrete] +// CHECK:STDOUT: %.e71: type = partial_type %X [concrete] +// CHECK:STDOUT: %pattern_type.a53: type = pattern_type %.e71 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Use() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %i.patt: %pattern_type.a53 = binding_pattern i [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %Init.ref: %Init.type = name_ref Init, file.%Init.decl [concrete = constants.%Init] +// CHECK:STDOUT: %.loc17_27: ref %X = temporary_storage +// CHECK:STDOUT: %Init.call: init %X = call %Init.ref() to %.loc17_27 +// CHECK:STDOUT: %X.ref.loc17_40: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc17_32: type = partial_type %X.ref.loc17_40 [concrete = constants.%.e71] +// CHECK:STDOUT: %.loc17_29.1: init %.e71 = as_compatible %Init.call +// CHECK:STDOUT: %.loc17_29.2: init %.e71 = converted %Init.call, %.loc17_29.1 +// CHECK:STDOUT: %.loc17_10.1: type = splice_block %.loc17_10.2 [concrete = constants.%.e71] { +// CHECK:STDOUT: %X.ref.loc17_18: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc17_10.2: type = partial_type %X.ref.loc17_18 [concrete = constants.%.e71] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc17_29.3: ref %.e71 = temporary %.loc17_27, %.loc17_29.2 +// CHECK:STDOUT: %.loc17_29.4: %.e71 = bind_value %.loc17_29.3 +// CHECK:STDOUT: %i: %.e71 = bind_name i, %.loc17_29.4 +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_remove_partial_in_init.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/builtins/type/can_destroy.carbon b/toolchain/check/testdata/builtins/type/can_destroy.carbon index e833ec110906d..8bace8b9aadbd 100644 --- a/toolchain/check/testdata/builtins/type/can_destroy.carbon +++ b/toolchain/check/testdata/builtins/type/can_destroy.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/bool.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon // // AUTOUPDATE // TIP: To test this file alone, run: @@ -10,24 +10,32 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtins/type/can_destroy.carbon -// --- param.carbon +// --- can_destroy.carbon library "[[@TEST_NAME]]"; fn CanDestroy() -> type = "type.can_destroy"; +fn TypeAnd(a: type, b: type) -> type = "type.and"; + +fn TestCanDestroy(T:! CanDestroy()) {} + +// --- param.carbon +library "[[@TEST_NAME]]"; +import library "can_destroy"; -fn F(T:! CanDestroy()) {} +abstract class Abstract {} fn G() { //@dump-sem-ir-begin - F(()); - F({}); + TestCanDestroy(()); + TestCanDestroy({}); + TestCanDestroy(bool); + TestCanDestroy(Abstract*); //@dump-sem-ir-end } // --- impls.carbon library "[[@TEST_NAME]]"; - -fn CanDestroy() -> type = "type.can_destroy"; +import library "can_destroy"; fn F(T:! type where .Self impls CanDestroy()) {} @@ -55,49 +63,78 @@ fn F(T:! Z & CanDestroy()) { // --- fail_incomplete.carbon library "[[@TEST_NAME]]"; - -fn CanDestroy() -> type = "type.can_destroy"; - -fn F(T:! CanDestroy()) {} +import library "can_destroy"; class Incomplete; -fn G() { - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:3: error: cannot convert type `Incomplete` into type implementing `type where .Self impls Core.CanDestroy` [ConversionFailureTypeToFacet] - // CHECK:STDERR: F(Incomplete); - // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-8]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! CanDestroy()) {} - // CHECK:STDERR: ^ +fn F() { + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+8]]:3: error: cannot convert type `Incomplete` into type implementing `type where .Self impls Core.CanDestroy` [ConversionFailureTypeToFacet] + // CHECK:STDERR: TestCanDestroy(Incomplete); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-8]]:1: in import [InImport] + // CHECK:STDERR: can_destroy.carbon:6:19: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn TestCanDestroy(T:! CanDestroy()) {} + // CHECK:STDERR: ^ // CHECK:STDERR: - F(Incomplete); + TestCanDestroy(Incomplete); } // --- fail_abstract.carbon library "[[@TEST_NAME]]"; +import library "can_destroy"; -fn CanDestroy() -> type = "type.can_destroy"; +abstract class Abstract {} -fn F(T:! CanDestroy()) {} +fn F() { + // CHECK:STDERR: fail_abstract.carbon:[[@LINE+8]]:3: error: cannot convert type `Abstract` into type implementing `type where .Self impls Core.CanDestroy` [ConversionFailureTypeToFacet] + // CHECK:STDERR: TestCanDestroy(Abstract); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_abstract.carbon:[[@LINE-8]]:1: in import [InImport] + // CHECK:STDERR: can_destroy.carbon:6:19: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn TestCanDestroy(T:! CanDestroy()) {} + // CHECK:STDERR: ^ + // CHECK:STDERR: + TestCanDestroy(Abstract); +} + +// --- fail_partial_abstract.carbon +library "[[@TEST_NAME]]"; +import library "can_destroy"; abstract class Abstract {} -fn G() { - // CHECK:STDERR: fail_abstract.carbon:[[@LINE+7]]:3: error: cannot convert type `Abstract` into type implementing `type where .Self impls Core.CanDestroy` [ConversionFailureTypeToFacet] - // CHECK:STDERR: F(Abstract); - // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_abstract.carbon:[[@LINE-8]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! CanDestroy()) {} - // CHECK:STDERR: ^ +fn F() { + // CHECK:STDERR: fail_partial_abstract.carbon:[[@LINE+8]]:3: error: cannot convert type `partial Abstract` into type implementing `type where .Self impls Core.CanDestroy` [ConversionFailureTypeToFacet] + // CHECK:STDERR: TestCanDestroy(partial Abstract); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_partial_abstract.carbon:[[@LINE-8]]:1: in import [InImport] + // CHECK:STDERR: can_destroy.carbon:6:19: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn TestCanDestroy(T:! CanDestroy()) {} + // CHECK:STDERR: ^ // CHECK:STDERR: - F(Abstract); + TestCanDestroy(partial Abstract); } -// --- fail_impl.carbon +// --- fail_maybe_unformed_abstract.carbon library "[[@TEST_NAME]]"; +import library "can_destroy"; -fn CanDestroy() -> type = "type.can_destroy"; -fn TypeAnd(a: type, b: type) -> type = "type.and"; +abstract class Abstract {} + +fn F() { + // CHECK:STDERR: fail_maybe_unformed_abstract.carbon:[[@LINE+7]]:18: error: cannot convert type `Abstract` into type implementing `Core.Destroy` [ConversionFailureTypeToFacet] + // CHECK:STDERR: TestCanDestroy(Core.MaybeUnformed(Abstract)); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: {{.*}}/prelude/types/maybe_unformed.carbon:12:21: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: class MaybeUnformed(T:! Destroy) { + // CHECK:STDERR: ^ + // CHECK:STDERR: + TestCanDestroy(Core.MaybeUnformed(Abstract)); +} + +// --- fail_impl.carbon +library "[[@TEST_NAME]]"; +import library "can_destroy"; class C {} @@ -111,9 +148,7 @@ impl C as CanDestroy() {} // --- impl_with_interface.carbon library "[[@TEST_NAME]]"; - -fn CanDestroy() -> type = "type.can_destroy"; -fn TypeAnd(a: type, b: type) -> type = "type.and"; +import library "can_destroy"; class C {} @@ -124,43 +159,65 @@ impl C as TypeAnd(I, CanDestroy()) {} // CHECK:STDOUT: --- param.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %Abstract: type = class_type @Abstract [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %TestCanDestroy.type: type = fn_type @TestCanDestroy [concrete] +// CHECK:STDOUT: %TestCanDestroy: %TestCanDestroy.type = struct_value () [concrete] // CHECK:STDOUT: %type_where: type = facet_type > [concrete] -// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] -// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %facet_value.ff9: %type_where = facet_value %empty_tuple.type, () [concrete] -// CHECK:STDOUT: %F.specific_fn.1af: = specific_function %F, @F(%facet_value.ff9) [concrete] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %TestCanDestroy.specific_fn.344: = specific_function %TestCanDestroy, @TestCanDestroy(%facet_value.ff9) [concrete] // CHECK:STDOUT: %facet_value.7c2: %type_where = facet_value %empty_struct_type, () [concrete] -// CHECK:STDOUT: %F.specific_fn.da1: = specific_function %F, @F(%facet_value.7c2) [concrete] +// CHECK:STDOUT: %TestCanDestroy.specific_fn.8c2: = specific_function %TestCanDestroy, @TestCanDestroy(%facet_value.7c2) [concrete] +// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] +// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] +// CHECK:STDOUT: %facet_value.3f5: %type_where = facet_value bool, () [concrete] +// CHECK:STDOUT: %TestCanDestroy.specific_fn.0bf: = specific_function %TestCanDestroy, @TestCanDestroy(%facet_value.3f5) [concrete] +// CHECK:STDOUT: %ptr: type = ptr_type %Abstract [concrete] +// CHECK:STDOUT: %facet_value.82d: %type_where = facet_value %ptr, () [concrete] +// CHECK:STDOUT: %TestCanDestroy.specific_fn.8a3: = specific_function %TestCanDestroy, @TestCanDestroy(%facet_value.82d) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Main.TestCanDestroy: %TestCanDestroy.type = import_ref Main//can_destroy, TestCanDestroy, loaded [concrete = constants.%TestCanDestroy] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref.loc9: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %.loc9_6: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%empty_tuple.type, () [concrete = constants.%facet_value.ff9] -// CHECK:STDOUT: %.loc9_7: %type_where = converted %.loc9_6, %facet_value.loc9 [concrete = constants.%facet_value.ff9] -// CHECK:STDOUT: %F.specific_fn.loc9: = specific_function %F.ref.loc9, @F(constants.%facet_value.ff9) [concrete = constants.%F.specific_fn.1af] -// CHECK:STDOUT: %F.call.loc9: init %empty_tuple.type = call %F.specific_fn.loc9() -// CHECK:STDOUT: %F.ref.loc10: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %.loc10_6: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value constants.%empty_struct_type, () [concrete = constants.%facet_value.7c2] -// CHECK:STDOUT: %.loc10_7: %type_where = converted %.loc10_6, %facet_value.loc10 [concrete = constants.%facet_value.7c2] -// CHECK:STDOUT: %F.specific_fn.loc10: = specific_function %F.ref.loc10, @F(constants.%facet_value.7c2) [concrete = constants.%F.specific_fn.da1] -// CHECK:STDOUT: %F.call.loc10: init %empty_tuple.type = call %F.specific_fn.loc10() +// CHECK:STDOUT: %TestCanDestroy.ref.loc8: %TestCanDestroy.type = name_ref TestCanDestroy, imports.%Main.TestCanDestroy [concrete = constants.%TestCanDestroy] +// CHECK:STDOUT: %.loc8_19: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%empty_tuple.type, () [concrete = constants.%facet_value.ff9] +// CHECK:STDOUT: %.loc8_20: %type_where = converted %.loc8_19, %facet_value.loc8 [concrete = constants.%facet_value.ff9] +// CHECK:STDOUT: %TestCanDestroy.specific_fn.loc8: = specific_function %TestCanDestroy.ref.loc8, @TestCanDestroy(constants.%facet_value.ff9) [concrete = constants.%TestCanDestroy.specific_fn.344] +// CHECK:STDOUT: %TestCanDestroy.call.loc8: init %empty_tuple.type = call %TestCanDestroy.specific_fn.loc8() +// CHECK:STDOUT: %TestCanDestroy.ref.loc9: %TestCanDestroy.type = name_ref TestCanDestroy, imports.%Main.TestCanDestroy [concrete = constants.%TestCanDestroy] +// CHECK:STDOUT: %.loc9_19: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%empty_struct_type, () [concrete = constants.%facet_value.7c2] +// CHECK:STDOUT: %.loc9_20: %type_where = converted %.loc9_19, %facet_value.loc9 [concrete = constants.%facet_value.7c2] +// CHECK:STDOUT: %TestCanDestroy.specific_fn.loc9: = specific_function %TestCanDestroy.ref.loc9, @TestCanDestroy(constants.%facet_value.7c2) [concrete = constants.%TestCanDestroy.specific_fn.8c2] +// CHECK:STDOUT: %TestCanDestroy.call.loc9: init %empty_tuple.type = call %TestCanDestroy.specific_fn.loc9() +// CHECK:STDOUT: %TestCanDestroy.ref.loc10: %TestCanDestroy.type = name_ref TestCanDestroy, imports.%Main.TestCanDestroy [concrete = constants.%TestCanDestroy] +// CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool] +// CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value %Bool.call, () [concrete = constants.%facet_value.3f5] +// CHECK:STDOUT: %.loc10: %type_where = converted %Bool.call, %facet_value.loc10 [concrete = constants.%facet_value.3f5] +// CHECK:STDOUT: %TestCanDestroy.specific_fn.loc10: = specific_function %TestCanDestroy.ref.loc10, @TestCanDestroy(constants.%facet_value.3f5) [concrete = constants.%TestCanDestroy.specific_fn.0bf] +// CHECK:STDOUT: %TestCanDestroy.call.loc10: init %empty_tuple.type = call %TestCanDestroy.specific_fn.loc10() +// CHECK:STDOUT: %TestCanDestroy.ref.loc11: %TestCanDestroy.type = name_ref TestCanDestroy, imports.%Main.TestCanDestroy [concrete = constants.%TestCanDestroy] +// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [concrete = constants.%Abstract] +// CHECK:STDOUT: %ptr: type = ptr_type %Abstract.ref [concrete = constants.%ptr] +// CHECK:STDOUT: %facet_value.loc11: %type_where = facet_value %ptr, () [concrete = constants.%facet_value.82d] +// CHECK:STDOUT: %.loc11: %type_where = converted %ptr, %facet_value.loc11 [concrete = constants.%facet_value.82d] +// CHECK:STDOUT: %TestCanDestroy.specific_fn.loc11: = specific_function %TestCanDestroy.ref.loc11, @TestCanDestroy(constants.%facet_value.82d) [concrete = constants.%TestCanDestroy.specific_fn.8a3] +// CHECK:STDOUT: %TestCanDestroy.call.loc11: init %empty_tuple.type = call %TestCanDestroy.specific_fn.loc11() // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- impls.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %type_where: type = facet_type > [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %facet_value.ff9: %type_where = facet_value %empty_tuple.type, () [concrete] // CHECK:STDOUT: %F.specific_fn.1af: = specific_function %F, @F(%facet_value.ff9) [concrete] @@ -174,18 +231,18 @@ impl C as TypeAnd(I, CanDestroy()) {} // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %F.ref.loc8: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] +// CHECK:STDOUT: %.loc8_6: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%empty_tuple.type, () [concrete = constants.%facet_value.ff9] +// CHECK:STDOUT: %.loc8_7: %type_where = converted %.loc8_6, %facet_value.loc8 [concrete = constants.%facet_value.ff9] +// CHECK:STDOUT: %F.specific_fn.loc8: = specific_function %F.ref.loc8, @F(constants.%facet_value.ff9) [concrete = constants.%F.specific_fn.1af] +// CHECK:STDOUT: %F.call.loc8: init %empty_tuple.type = call %F.specific_fn.loc8() // CHECK:STDOUT: %F.ref.loc9: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %.loc9_6: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%empty_tuple.type, () [concrete = constants.%facet_value.ff9] -// CHECK:STDOUT: %.loc9_7: %type_where = converted %.loc9_6, %facet_value.loc9 [concrete = constants.%facet_value.ff9] -// CHECK:STDOUT: %F.specific_fn.loc9: = specific_function %F.ref.loc9, @F(constants.%facet_value.ff9) [concrete = constants.%F.specific_fn.1af] +// CHECK:STDOUT: %.loc9_6: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%empty_struct_type, () [concrete = constants.%facet_value.7c2] +// CHECK:STDOUT: %.loc9_7: %type_where = converted %.loc9_6, %facet_value.loc9 [concrete = constants.%facet_value.7c2] +// CHECK:STDOUT: %F.specific_fn.loc9: = specific_function %F.ref.loc9, @F(constants.%facet_value.7c2) [concrete = constants.%F.specific_fn.da1] // CHECK:STDOUT: %F.call.loc9: init %empty_tuple.type = call %F.specific_fn.loc9() -// CHECK:STDOUT: %F.ref.loc10: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %.loc10_6: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value constants.%empty_struct_type, () [concrete = constants.%facet_value.7c2] -// CHECK:STDOUT: %.loc10_7: %type_where = converted %.loc10_6, %facet_value.loc10 [concrete = constants.%facet_value.7c2] -// CHECK:STDOUT: %F.specific_fn.loc10: = specific_function %F.ref.loc10, @F(constants.%facet_value.7c2) [concrete = constants.%F.specific_fn.da1] -// CHECK:STDOUT: %F.call.loc10: init %empty_tuple.type = call %F.specific_fn.loc10() // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/init.carbon b/toolchain/check/testdata/class/generic/init.carbon index 1503479e92fe3..f3ab50bd12a10 100644 --- a/toolchain/check/testdata/class/generic/init.carbon +++ b/toolchain/check/testdata/class/generic/init.carbon @@ -14,12 +14,12 @@ library "[[@TEST_NAME]]"; -class Class(T:! type) { +class Class(T:! Core.Destroy) { var k: T; } //@dump-sem-ir-begin -fn InitFromStructGeneric(T:! Core.Copy, x: T) -> T { +fn InitFromStructGeneric(T:! Core.Copy & Core.Destroy, x: T) -> T { var v: Class(T) = {.k = x}; return v.k; } @@ -51,42 +51,57 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: --- from_struct.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] -// CHECK:STDOUT: %T.be8: %Copy.type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %pattern_type.322: type = pattern_type %Copy.type [concrete] -// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.be8 [symbolic] -// CHECK:STDOUT: %pattern_type.17e4b7.1: type = pattern_type %T.binding.as_type [symbolic] +// CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete] +// CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.f2e = struct_value () [concrete] +// CHECK:STDOUT: %BitAndWith.type.8a6: type = facet_type <@BitAndWith, @BitAndWith(type)> [concrete] +// CHECK:STDOUT: %BitAndWith.Op.type.9a3: type = fn_type @BitAndWith.Op, @BitAndWith(type) [concrete] +// CHECK:STDOUT: %BitAndWith.impl_witness: = impl_witness imports.%BitAndWith.impl_witness_table [concrete] +// CHECK:STDOUT: %BitAndWith.facet: %BitAndWith.type.8a6 = facet_value type, (%BitAndWith.impl_witness) [concrete] +// CHECK:STDOUT: %.fa7: type = fn_type_with_self_type %BitAndWith.Op.type.9a3, %BitAndWith.facet [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.type: type = fn_type @type.as.BitAndWith.impl.Op [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op: %type.as.BitAndWith.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.bound: = bound_method %Copy.type, %type.as.BitAndWith.impl.Op [concrete] +// CHECK:STDOUT: %facet_type: type = facet_type <@Destroy & @Copy> [concrete] +// CHECK:STDOUT: %T.4b8: %facet_type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %pattern_type.4e2: type = pattern_type %facet_type [concrete] +// CHECK:STDOUT: %T.binding.as_type.b4b: type = symbolic_binding_type T, 0, %T.4b8 [symbolic] +// CHECK:STDOUT: %pattern_type.1ba: type = pattern_type %T.binding.as_type.b4b [symbolic] // CHECK:STDOUT: %InitFromStructGeneric.type: type = fn_type @InitFromStructGeneric [concrete] // CHECK:STDOUT: %InitFromStructGeneric: %InitFromStructGeneric.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete.1cd: = require_complete_type %T.binding.as_type [symbolic] -// CHECK:STDOUT: %Class.091: type = class_type @Class, @Class(%T.binding.as_type) [symbolic] -// CHECK:STDOUT: %Class.elem.bb0: type = unbound_element_type %Class.091, %T.binding.as_type [symbolic] -// CHECK:STDOUT: %struct_type.k.443: type = struct_type {.k: %T.binding.as_type} [symbolic] -// CHECK:STDOUT: %require_complete.34f: = require_complete_type %Class.091 [symbolic] -// CHECK:STDOUT: %pattern_type.4bf: type = pattern_type %Class.091 [symbolic] -// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] -// CHECK:STDOUT: %Copy.lookup_impl_witness.e15: = lookup_impl_witness %T.be8, @Copy [symbolic] -// CHECK:STDOUT: %.427: type = fn_type_with_self_type %Copy.Op.type, %T.be8 [symbolic] -// CHECK:STDOUT: %impl.elem0.168: %.427 = impl_witness_access %Copy.lookup_impl_witness.e15, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.2ce: = specific_impl_function %impl.elem0.168, @Copy.Op(%T.be8) [symbolic] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] +// CHECK:STDOUT: %require_complete.2e0: = require_complete_type %T.binding.as_type.b4b [symbolic] // CHECK:STDOUT: %type_where: type = facet_type > [concrete] // CHECK:STDOUT: %DestroyT: %type_where = bind_symbolic_name DestroyT, 0 [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%DestroyT) [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.544: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d = struct_value () [symbolic] -// CHECK:STDOUT: %facet_value.313: %type_where = facet_value %Class.091, () [symbolic] -// CHECK:STDOUT: %Destroy.impl_witness.b22: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.313) [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.4cf: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.313) [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.9d1: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.4cf = struct_value () [symbolic] -// CHECK:STDOUT: %ptr.aa5: type = ptr_type %Class.091 [symbolic] -// CHECK:STDOUT: %require_complete.2ed: = require_complete_type %ptr.aa5 [symbolic] -// CHECK:STDOUT: %Destroy.facet.840: %Destroy.type = facet_value %Class.091, (%Destroy.impl_witness.b22) [symbolic] -// CHECK:STDOUT: %.3f3: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.840 [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.687: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.9d1, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.313) [symbolic] +// CHECK:STDOUT: %facet_value.8c7: %type_where = facet_value %T.binding.as_type.b4b, () [symbolic] +// CHECK:STDOUT: %Destroy.impl_witness.816: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.8c7) [symbolic] +// CHECK:STDOUT: %Destroy.facet.f16: %Destroy.type = facet_value %T.binding.as_type.b4b, (%Destroy.impl_witness.816) [symbolic] +// CHECK:STDOUT: %Class.c9f: type = class_type @Class, @Class(%Destroy.facet.f16) [symbolic] +// CHECK:STDOUT: %Class.elem.ce2: type = unbound_element_type %Class.c9f, %T.binding.as_type.b4b [symbolic] +// CHECK:STDOUT: %struct_type.k.fb1: type = struct_type {.k: %T.binding.as_type.b4b} [symbolic] +// CHECK:STDOUT: %require_complete.d9b: = require_complete_type %Class.c9f [symbolic] +// CHECK:STDOUT: %pattern_type.25d: type = pattern_type %Class.c9f [symbolic] +// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] +// CHECK:STDOUT: %Copy.lookup_impl_witness.8a9: = lookup_impl_witness %T.4b8, @Copy [symbolic] +// CHECK:STDOUT: %Copy.facet.dbb: %Copy.type = facet_value %T.binding.as_type.b4b, (%Copy.lookup_impl_witness.8a9) [symbolic] +// CHECK:STDOUT: %.0bf: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.dbb [symbolic] +// CHECK:STDOUT: %impl.elem0.54f: %.0bf = impl_witness_access %Copy.lookup_impl_witness.8a9, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.1b5: = specific_impl_function %impl.elem0.54f, @Copy.Op(%Copy.facet.dbb) [symbolic] +// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] +// CHECK:STDOUT: %facet_value.1de: %type_where = facet_value %Class.c9f, () [symbolic] +// CHECK:STDOUT: %Destroy.impl_witness.adc: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.1de) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.3ec: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.1de) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.c69: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.3ec = struct_value () [symbolic] +// CHECK:STDOUT: %ptr.78b: type = ptr_type %Class.c9f [symbolic] +// CHECK:STDOUT: %require_complete.816: = require_complete_type %ptr.78b [symbolic] +// CHECK:STDOUT: %Destroy.facet.40a: %Destroy.type = facet_value %Class.c9f, (%Destroy.impl_witness.adc) [symbolic] +// CHECK:STDOUT: %.057: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.40a [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.30d: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.c69, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.1de) [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] @@ -95,34 +110,41 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %InitFromStructSpecific.type: type = fn_type @InitFromStructSpecific [concrete] // CHECK:STDOUT: %InitFromStructSpecific: %InitFromStructSpecific.type = struct_value () [concrete] -// CHECK:STDOUT: %Class.247: type = class_type @Class, @Class(%i32) [concrete] -// CHECK:STDOUT: %Class.elem.2d8: type = unbound_element_type %Class.247, %i32 [concrete] +// CHECK:STDOUT: %facet_value.d23: %type_where = facet_value %i32, () [concrete] +// CHECK:STDOUT: %Destroy.impl_witness.f71: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.d23) [concrete] +// CHECK:STDOUT: %Destroy.facet.276: %Destroy.type = facet_value %i32, (%Destroy.impl_witness.f71) [concrete] +// CHECK:STDOUT: %Class.626: type = class_type @Class, @Class(%Destroy.facet.276) [concrete] +// CHECK:STDOUT: %Class.elem.24d: type = unbound_element_type %Class.626, %i32 [concrete] // CHECK:STDOUT: %struct_type.k.0bf: type = struct_type {.k: %i32} [concrete] -// CHECK:STDOUT: %pattern_type.0fa: type = pattern_type %Class.247 [concrete] +// CHECK:STDOUT: %pattern_type.740: type = pattern_type %Class.626 [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.afd: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] // CHECK:STDOUT: %Int.as.Copy.impl.Op.6cd: %Int.as.Copy.impl.Op.type.afd = struct_value () [symbolic] // CHECK:STDOUT: %Copy.impl_witness.a32: = impl_witness imports.%Copy.impl_witness_table.1ed, @Int.as.Copy.impl(%int_32) [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.276: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.f59: %Int.as.Copy.impl.Op.type.276 = struct_value () [concrete] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %i32, (%Copy.impl_witness.a32) [concrete] -// CHECK:STDOUT: %.7fa: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete] +// CHECK:STDOUT: %Copy.facet.c49: %Copy.type = facet_value %i32, (%Copy.impl_witness.a32) [concrete] +// CHECK:STDOUT: %.7fa: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.c49 [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.f59, @Int.as.Copy.impl.Op(%int_32) [concrete] -// CHECK:STDOUT: %facet_value.06f: %type_where = facet_value %Class.247, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.473: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.06f) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.79b: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.473 = struct_value () [concrete] -// CHECK:STDOUT: %ptr.f7c: type = ptr_type %Class.247 [concrete] +// CHECK:STDOUT: %facet_value.de8: %type_where = facet_value %Class.626, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.719: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.de8) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.12d: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.719 = struct_value () [concrete] +// CHECK:STDOUT: %ptr.1b6: type = ptr_type %Class.626 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .Copy = %Core.Copy +// CHECK:STDOUT: .BitAndWith = %Core.BitAndWith // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude/parts/as, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] +// CHECK:STDOUT: %Core.import_ref.636: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.636), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: %Core.import_ref.950: @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.544)] // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.950), @DestroyT.binding.as_type.as.Destroy.impl [concrete] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] @@ -132,30 +154,37 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %InitFromStructGeneric.decl: %InitFromStructGeneric.type = fn_decl @InitFromStructGeneric [concrete = constants.%InitFromStructGeneric] { -// CHECK:STDOUT: %T.patt: %pattern_type.322 = symbolic_binding_pattern T, 0 [concrete] -// CHECK:STDOUT: %x.patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.17e4b7.1) = binding_pattern x [concrete] -// CHECK:STDOUT: %x.param_patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.17e4b7.1) = value_param_pattern %x.patt, call_param0 [concrete] -// CHECK:STDOUT: %return.patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.17e4b7.1) = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.17e4b7.1) = out_param_pattern %return.patt, call_param1 [concrete] +// CHECK:STDOUT: %T.patt: %pattern_type.4e2 = symbolic_binding_pattern T, 0 [concrete] +// CHECK:STDOUT: %x.patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.1ba) = binding_pattern x [concrete] +// CHECK:STDOUT: %x.param_patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.1ba) = value_param_pattern %x.patt, call_param0 [concrete] +// CHECK:STDOUT: %return.patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.1ba) = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: @InitFromStructGeneric.%pattern_type.loc9 (%pattern_type.1ba) = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc9_50: %Copy.type = name_ref T, %T.loc9_26.2 [symbolic = %T.loc9_26.1 (constants.%T.be8)] -// CHECK:STDOUT: %T.as_type.loc9_50: type = facet_access_type %T.ref.loc9_50 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc9_50: type = converted %T.ref.loc9_50, %T.as_type.loc9_50 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc9_34: type = splice_block %Copy.ref [concrete = constants.%Copy.type] { +// CHECK:STDOUT: %T.ref.loc9_65: %facet_type = name_ref T, %T.loc9_26.2 [symbolic = %T.loc9_26.1 (constants.%T.4b8)] +// CHECK:STDOUT: %T.as_type.loc9_65: type = facet_access_type %T.ref.loc9_65 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.b4b)] +// CHECK:STDOUT: %.loc9_65: type = converted %T.ref.loc9_65, %T.as_type.loc9_65 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.b4b)] +// CHECK:STDOUT: %.loc9_40.1: type = splice_block %.loc9_40.3 [concrete = constants.%facet_type] { // CHECK:STDOUT: -// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Core.ref.loc9_30: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Copy.ref: type = name_ref Copy, imports.%Core.Copy [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.ref.loc9_42: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Destroy.ref: type = name_ref Destroy, imports.%Core.Destroy [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %impl.elem0.loc9: %.fa7 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %bound_method.loc9: = bound_method %Copy.ref, %impl.elem0.loc9 [concrete = constants.%type.as.BitAndWith.impl.Op.bound] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call: init type = call %bound_method.loc9(%Copy.ref, %Destroy.ref) [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc9_40.2: type = value_of_initializer %type.as.BitAndWith.impl.Op.call [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc9_40.3: type = converted %type.as.BitAndWith.impl.Op.call, %.loc9_40.2 [concrete = constants.%facet_type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc9_26.2: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T.loc9_26.1 (constants.%T.be8)] -// CHECK:STDOUT: %x.param: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc9_44.1: type = splice_block %.loc9_44.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { -// CHECK:STDOUT: %T.ref.loc9_44: %Copy.type = name_ref T, %T.loc9_26.2 [symbolic = %T.loc9_26.1 (constants.%T.be8)] -// CHECK:STDOUT: %T.as_type.loc9_44: type = facet_access_type %T.ref.loc9_44 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc9_44.2: type = converted %T.ref.loc9_44, %T.as_type.loc9_44 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %T.loc9_26.2: %facet_type = bind_symbolic_name T, 0 [symbolic = %T.loc9_26.1 (constants.%T.4b8)] +// CHECK:STDOUT: %x.param: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b4b) = value_param call_param0 +// CHECK:STDOUT: %.loc9_59.1: type = splice_block %.loc9_59.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.b4b)] { +// CHECK:STDOUT: %T.ref.loc9_59: %facet_type = name_ref T, %T.loc9_26.2 [symbolic = %T.loc9_26.1 (constants.%T.4b8)] +// CHECK:STDOUT: %T.as_type.loc9_59: type = facet_access_type %T.ref.loc9_59 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.b4b)] +// CHECK:STDOUT: %.loc9_59.2: type = converted %T.ref.loc9_59, %T.as_type.loc9_59 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.b4b)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = out_param call_param1 -// CHECK:STDOUT: %return: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = return_slot %return.param +// CHECK:STDOUT: %x: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b4b) = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b4b) = out_param call_param1 +// CHECK:STDOUT: %return: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b4b) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %InitFromStructSpecific.decl: %InitFromStructSpecific.type = fn_decl @InitFromStructSpecific [concrete = constants.%InitFromStructSpecific] { // CHECK:STDOUT: %x.patt: %pattern_type.7ce = binding_pattern x [concrete] @@ -176,76 +205,84 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @InitFromStructGeneric(%T.loc9_26.2: %Copy.type) { -// CHECK:STDOUT: %T.loc9_26.1: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T.loc9_26.1 (constants.%T.be8)] -// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc9_26.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %pattern_type.loc9: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc9 (constants.%pattern_type.17e4b7.1)] +// CHECK:STDOUT: generic fn @InitFromStructGeneric(%T.loc9_26.2: %facet_type) { +// CHECK:STDOUT: %T.loc9_26.1: %facet_type = bind_symbolic_name T, 0 [symbolic = %T.loc9_26.1 (constants.%T.4b8)] +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc9_26.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.b4b)] +// CHECK:STDOUT: %pattern_type.loc9: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc9 (constants.%pattern_type.1ba)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc9: = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc9 (constants.%require_complete.1cd)] -// CHECK:STDOUT: %Class.loc10_17.2: type = class_type @Class, @Class(%T.binding.as_type) [symbolic = %Class.loc10_17.2 (constants.%Class.091)] -// CHECK:STDOUT: %require_complete.loc10_17: = require_complete_type %Class.loc10_17.2 [symbolic = %require_complete.loc10_17 (constants.%require_complete.34f)] -// CHECK:STDOUT: %pattern_type.loc10: type = pattern_type %Class.loc10_17.2 [symbolic = %pattern_type.loc10 (constants.%pattern_type.4bf)] -// CHECK:STDOUT: %struct_type.k: type = struct_type {.k: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.k (constants.%struct_type.k.443)] -// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T.loc9_26.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.e15)] -// CHECK:STDOUT: %.loc10_27.2: type = fn_type_with_self_type constants.%Copy.Op.type, %T.loc9_26.1 [symbolic = %.loc10_27.2 (constants.%.427)] -// CHECK:STDOUT: %impl.elem0.loc10_27.2: @InitFromStructGeneric.%.loc10_27.2 (%.427) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.168)] -// CHECK:STDOUT: %specific_impl_fn.loc10_27.2: = specific_impl_function %impl.elem0.loc10_27.2, @Copy.Op(%T.loc9_26.1) [symbolic = %specific_impl_fn.loc10_27.2 (constants.%specific_impl_fn.2ce)] -// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class.loc10_17.2, %T.binding.as_type [symbolic = %Class.elem (constants.%Class.elem.bb0)] -// CHECK:STDOUT: %facet_value.loc10_3.2: %type_where = facet_value %Class.loc10_17.2, () [symbolic = %facet_value.loc10_3.2 (constants.%facet_value.313)] -// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc10_3.2) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.b22)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Class.loc10_17.2, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.840)] -// CHECK:STDOUT: %.loc10_3.3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc10_3.3 (constants.%.3f3)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc10_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.4cf)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @InitFromStructGeneric.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.4cf) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.9d1)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc10_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.687)] -// CHECK:STDOUT: %ptr: type = ptr_type %Class.loc10_17.2 [symbolic = %ptr (constants.%ptr.aa5)] -// CHECK:STDOUT: %require_complete.loc10_3: = require_complete_type %ptr [symbolic = %require_complete.loc10_3 (constants.%require_complete.2ed)] +// CHECK:STDOUT: %require_complete.loc9: = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc9 (constants.%require_complete.2e0)] +// CHECK:STDOUT: %facet_value.loc10_17.2: %type_where = facet_value %T.binding.as_type, () [symbolic = %facet_value.loc10_17.2 (constants.%facet_value.8c7)] +// CHECK:STDOUT: %Destroy.impl_witness.loc10_17: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc10_17.2) [symbolic = %Destroy.impl_witness.loc10_17 (constants.%Destroy.impl_witness.816)] +// CHECK:STDOUT: %Destroy.facet.loc10_17.2: %Destroy.type = facet_value %T.binding.as_type, (%Destroy.impl_witness.loc10_17) [symbolic = %Destroy.facet.loc10_17.2 (constants.%Destroy.facet.f16)] +// CHECK:STDOUT: %Class.loc10_17.2: type = class_type @Class, @Class(%Destroy.facet.loc10_17.2) [symbolic = %Class.loc10_17.2 (constants.%Class.c9f)] +// CHECK:STDOUT: %require_complete.loc10_17: = require_complete_type %Class.loc10_17.2 [symbolic = %require_complete.loc10_17 (constants.%require_complete.d9b)] +// CHECK:STDOUT: %pattern_type.loc10: type = pattern_type %Class.loc10_17.2 [symbolic = %pattern_type.loc10 (constants.%pattern_type.25d)] +// CHECK:STDOUT: %struct_type.k: type = struct_type {.k: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b4b)} [symbolic = %struct_type.k (constants.%struct_type.k.fb1)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T.loc9_26.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.8a9)] +// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %T.binding.as_type, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.dbb)] +// CHECK:STDOUT: %.loc10_27.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc10_27.2 (constants.%.0bf)] +// CHECK:STDOUT: %impl.elem0.loc10_27.2: @InitFromStructGeneric.%.loc10_27.2 (%.0bf) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.54f)] +// CHECK:STDOUT: %specific_impl_fn.loc10_27.2: = specific_impl_function %impl.elem0.loc10_27.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc10_27.2 (constants.%specific_impl_fn.1b5)] +// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class.loc10_17.2, %T.binding.as_type [symbolic = %Class.elem (constants.%Class.elem.ce2)] +// CHECK:STDOUT: %facet_value.loc10_3.2: %type_where = facet_value %Class.loc10_17.2, () [symbolic = %facet_value.loc10_3.2 (constants.%facet_value.1de)] +// CHECK:STDOUT: %Destroy.impl_witness.loc10_3: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc10_3.2) [symbolic = %Destroy.impl_witness.loc10_3 (constants.%Destroy.impl_witness.adc)] +// CHECK:STDOUT: %Destroy.facet.loc10_3: %Destroy.type = facet_value %Class.loc10_17.2, (%Destroy.impl_witness.loc10_3) [symbolic = %Destroy.facet.loc10_3 (constants.%Destroy.facet.40a)] +// CHECK:STDOUT: %.loc10_3.3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet.loc10_3 [symbolic = %.loc10_3.3 (constants.%.057)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc10_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.3ec)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @InitFromStructGeneric.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.3ec) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.c69)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc10_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.30d)] +// CHECK:STDOUT: %ptr: type = ptr_type %Class.loc10_17.2 [symbolic = %ptr (constants.%ptr.78b)] +// CHECK:STDOUT: %require_complete.loc10_3: = require_complete_type %ptr [symbolic = %require_complete.loc10_3 (constants.%require_complete.816)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type)) -> %return.param: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) { +// CHECK:STDOUT: fn(%x.param: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b4b)) -> %return.param: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b4b) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %v.patt: @InitFromStructGeneric.%pattern_type.loc10 (%pattern_type.4bf) = binding_pattern v [concrete] -// CHECK:STDOUT: %v.var_patt: @InitFromStructGeneric.%pattern_type.loc10 (%pattern_type.4bf) = var_pattern %v.patt [concrete] +// CHECK:STDOUT: %v.patt: @InitFromStructGeneric.%pattern_type.loc10 (%pattern_type.25d) = binding_pattern v [concrete] +// CHECK:STDOUT: %v.var_patt: @InitFromStructGeneric.%pattern_type.loc10 (%pattern_type.25d) = var_pattern %v.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %v.var: ref @InitFromStructGeneric.%Class.loc10_17.2 (%Class.091) = var %v.var_patt -// CHECK:STDOUT: %x.ref: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = name_ref x, %x -// CHECK:STDOUT: %.loc10_28.1: @InitFromStructGeneric.%struct_type.k (%struct_type.k.443) = struct_literal (%x.ref) -// CHECK:STDOUT: %impl.elem0.loc10_27.1: @InitFromStructGeneric.%.loc10_27.2 (%.427) = impl_witness_access constants.%Copy.lookup_impl_witness.e15, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.168)] +// CHECK:STDOUT: %v.var: ref @InitFromStructGeneric.%Class.loc10_17.2 (%Class.c9f) = var %v.var_patt +// CHECK:STDOUT: %x.ref: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b4b) = name_ref x, %x +// CHECK:STDOUT: %.loc10_28.1: @InitFromStructGeneric.%struct_type.k (%struct_type.k.fb1) = struct_literal (%x.ref) +// CHECK:STDOUT: %impl.elem0.loc10_27.1: @InitFromStructGeneric.%.loc10_27.2 (%.0bf) = impl_witness_access constants.%Copy.lookup_impl_witness.8a9, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.54f)] // CHECK:STDOUT: %bound_method.loc10_27.1: = bound_method %x.ref, %impl.elem0.loc10_27.1 -// CHECK:STDOUT: %specific_impl_fn.loc10_27.1: = specific_impl_function %impl.elem0.loc10_27.1, @Copy.Op(constants.%T.be8) [symbolic = %specific_impl_fn.loc10_27.2 (constants.%specific_impl_fn.2ce)] +// CHECK:STDOUT: %specific_impl_fn.loc10_27.1: = specific_impl_function %impl.elem0.loc10_27.1, @Copy.Op(constants.%Copy.facet.dbb) [symbolic = %specific_impl_fn.loc10_27.2 (constants.%specific_impl_fn.1b5)] // CHECK:STDOUT: %bound_method.loc10_27.2: = bound_method %x.ref, %specific_impl_fn.loc10_27.1 -// CHECK:STDOUT: %.loc10_28.2: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = class_element_access %v.var, element0 -// CHECK:STDOUT: %.loc10_27.1: init @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = call %bound_method.loc10_27.2(%x.ref) to %.loc10_28.2 -// CHECK:STDOUT: %.loc10_28.3: init @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = initialize_from %.loc10_27.1 to %.loc10_28.2 -// CHECK:STDOUT: %.loc10_28.4: init @InitFromStructGeneric.%Class.loc10_17.2 (%Class.091) = class_init (%.loc10_28.3), %v.var -// CHECK:STDOUT: %.loc10_3.1: init @InitFromStructGeneric.%Class.loc10_17.2 (%Class.091) = converted %.loc10_28.1, %.loc10_28.4 +// CHECK:STDOUT: %.loc10_28.2: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b4b) = class_element_access %v.var, element0 +// CHECK:STDOUT: %.loc10_27.1: init @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b4b) = call %bound_method.loc10_27.2(%x.ref) to %.loc10_28.2 +// CHECK:STDOUT: %.loc10_28.3: init @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b4b) = initialize_from %.loc10_27.1 to %.loc10_28.2 +// CHECK:STDOUT: %.loc10_28.4: init @InitFromStructGeneric.%Class.loc10_17.2 (%Class.c9f) = class_init (%.loc10_28.3), %v.var +// CHECK:STDOUT: %.loc10_3.1: init @InitFromStructGeneric.%Class.loc10_17.2 (%Class.c9f) = converted %.loc10_28.1, %.loc10_28.4 // CHECK:STDOUT: assign %v.var, %.loc10_3.1 -// CHECK:STDOUT: %.loc10_17.1: type = splice_block %Class.loc10_17.1 [symbolic = %Class.loc10_17.2 (constants.%Class.091)] { +// CHECK:STDOUT: %.loc10_17.1: type = splice_block %Class.loc10_17.1 [symbolic = %Class.loc10_17.2 (constants.%Class.c9f)] { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [concrete = constants.%Class.generic] -// CHECK:STDOUT: %T.ref.loc10: %Copy.type = name_ref T, %T.loc9_26.2 [symbolic = %T.loc9_26.1 (constants.%T.be8)] -// CHECK:STDOUT: %T.as_type.loc10: type = facet_access_type %T.ref.loc10 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc10_17.2: type = converted %T.ref.loc10, %T.as_type.loc10 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %Class.loc10_17.1: type = class_type @Class, @Class(constants.%T.binding.as_type) [symbolic = %Class.loc10_17.2 (constants.%Class.091)] +// CHECK:STDOUT: %T.ref.loc10: %facet_type = name_ref T, %T.loc9_26.2 [symbolic = %T.loc9_26.1 (constants.%T.4b8)] +// CHECK:STDOUT: %T.as_type.loc10: type = facet_access_type %T.ref.loc10 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.b4b)] +// CHECK:STDOUT: %as_type: type = facet_access_type constants.%T.4b8 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.b4b)] +// CHECK:STDOUT: %facet_value.loc10_17.1: %type_where = facet_value %as_type, () [symbolic = %facet_value.loc10_17.2 (constants.%facet_value.8c7)] +// CHECK:STDOUT: %.loc10_17.2: %type_where = converted constants.%T.4b8, %facet_value.loc10_17.1 [symbolic = %facet_value.loc10_17.2 (constants.%facet_value.8c7)] +// CHECK:STDOUT: %Destroy.facet.loc10_17.1: %Destroy.type = facet_value %T.as_type.loc10, (constants.%Destroy.impl_witness.816) [symbolic = %Destroy.facet.loc10_17.2 (constants.%Destroy.facet.f16)] +// CHECK:STDOUT: %.loc10_17.3: %Destroy.type = converted %T.ref.loc10, %Destroy.facet.loc10_17.1 [symbolic = %Destroy.facet.loc10_17.2 (constants.%Destroy.facet.f16)] +// CHECK:STDOUT: %Class.loc10_17.1: type = class_type @Class, @Class(constants.%Destroy.facet.f16) [symbolic = %Class.loc10_17.2 (constants.%Class.c9f)] // CHECK:STDOUT: } -// CHECK:STDOUT: %v: ref @InitFromStructGeneric.%Class.loc10_17.2 (%Class.091) = bind_name v, %v.var -// CHECK:STDOUT: %v.ref: ref @InitFromStructGeneric.%Class.loc10_17.2 (%Class.091) = name_ref v, %v -// CHECK:STDOUT: %k.ref: @InitFromStructGeneric.%Class.elem (%Class.elem.bb0) = name_ref k, @Class.%.loc5 [concrete = @Class.%.loc5] -// CHECK:STDOUT: %.loc11_11.1: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = class_element_access %v.ref, element0 -// CHECK:STDOUT: %.loc11_11.2: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = bind_value %.loc11_11.1 -// CHECK:STDOUT: %impl.elem0.loc11: @InitFromStructGeneric.%.loc10_27.2 (%.427) = impl_witness_access constants.%Copy.lookup_impl_witness.e15, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.168)] +// CHECK:STDOUT: %v: ref @InitFromStructGeneric.%Class.loc10_17.2 (%Class.c9f) = bind_name v, %v.var +// CHECK:STDOUT: %v.ref: ref @InitFromStructGeneric.%Class.loc10_17.2 (%Class.c9f) = name_ref v, %v +// CHECK:STDOUT: %k.ref: @InitFromStructGeneric.%Class.elem (%Class.elem.ce2) = name_ref k, @Class.%.loc5_8 [concrete = @Class.%.loc5_8] +// CHECK:STDOUT: %.loc11_11.1: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b4b) = class_element_access %v.ref, element0 +// CHECK:STDOUT: %.loc11_11.2: @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b4b) = bind_value %.loc11_11.1 +// CHECK:STDOUT: %impl.elem0.loc11: @InitFromStructGeneric.%.loc10_27.2 (%.0bf) = impl_witness_access constants.%Copy.lookup_impl_witness.8a9, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.54f)] // CHECK:STDOUT: %bound_method.loc11_11.1: = bound_method %.loc11_11.2, %impl.elem0.loc11 -// CHECK:STDOUT: %specific_impl_fn.loc11: = specific_impl_function %impl.elem0.loc11, @Copy.Op(constants.%T.be8) [symbolic = %specific_impl_fn.loc10_27.2 (constants.%specific_impl_fn.2ce)] +// CHECK:STDOUT: %specific_impl_fn.loc11: = specific_impl_function %impl.elem0.loc11, @Copy.Op(constants.%Copy.facet.dbb) [symbolic = %specific_impl_fn.loc10_27.2 (constants.%specific_impl_fn.1b5)] // CHECK:STDOUT: %bound_method.loc11_11.2: = bound_method %.loc11_11.2, %specific_impl_fn.loc11 -// CHECK:STDOUT: %.loc9_47: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = splice_block %return {} -// CHECK:STDOUT: %.loc11_11.3: init @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = call %bound_method.loc11_11.2(%.loc11_11.2) to %.loc9_47 -// CHECK:STDOUT: %facet_value.loc10_3.1: %type_where = facet_value constants.%Class.091, () [symbolic = %facet_value.loc10_3.2 (constants.%facet_value.313)] -// CHECK:STDOUT: %.loc10_3.2: %type_where = converted constants.%Class.091, %facet_value.loc10_3.1 [symbolic = %facet_value.loc10_3.2 (constants.%facet_value.313)] -// CHECK:STDOUT: %impl.elem0.loc10_3: @InitFromStructGeneric.%.loc10_3.3 (%.3f3) = impl_witness_access constants.%Destroy.impl_witness.b22, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.9d1)] +// CHECK:STDOUT: %.loc9_62: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b4b) = splice_block %return {} +// CHECK:STDOUT: %.loc11_11.3: init @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type.b4b) = call %bound_method.loc11_11.2(%.loc11_11.2) to %.loc9_62 +// CHECK:STDOUT: %facet_value.loc10_3.1: %type_where = facet_value constants.%Class.c9f, () [symbolic = %facet_value.loc10_3.2 (constants.%facet_value.1de)] +// CHECK:STDOUT: %.loc10_3.2: %type_where = converted constants.%Class.c9f, %facet_value.loc10_3.1 [symbolic = %facet_value.loc10_3.2 (constants.%facet_value.1de)] +// CHECK:STDOUT: %impl.elem0.loc10_3: @InitFromStructGeneric.%.loc10_3.3 (%.057) = impl_witness_access constants.%Destroy.impl_witness.adc, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.c69)] // CHECK:STDOUT: %bound_method.loc10_3.1: = bound_method %v.var, %impl.elem0.loc10_3 -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc10_3, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.313) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.687)] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc10_3, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.1de) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.30d)] // CHECK:STDOUT: %bound_method.loc10_3.2: = bound_method %v.var, %specific_fn -// CHECK:STDOUT: %addr: @InitFromStructGeneric.%ptr (%ptr.aa5) = addr_of %v.var +// CHECK:STDOUT: %addr: @InitFromStructGeneric.%ptr (%ptr.78b) = addr_of %v.var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_3.2(%addr) // CHECK:STDOUT: return %.loc11_11.3 to %return // CHECK:STDOUT: } @@ -254,10 +291,10 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: fn @InitFromStructSpecific(%x.param: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %v.patt: %pattern_type.0fa = binding_pattern v [concrete] -// CHECK:STDOUT: %v.var_patt: %pattern_type.0fa = var_pattern %v.patt [concrete] +// CHECK:STDOUT: %v.patt: %pattern_type.740 = binding_pattern v [concrete] +// CHECK:STDOUT: %v.var_patt: %pattern_type.740 = var_pattern %v.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %v.var: ref %Class.247 = var %v.var_patt +// CHECK:STDOUT: %v.var: ref %Class.626 = var %v.var_patt // CHECK:STDOUT: %x.ref: %i32 = name_ref x, %x // CHECK:STDOUT: %.loc15_30.1: %struct_type.k.0bf = struct_literal (%x.ref) // CHECK:STDOUT: %impl.elem0.loc15: %.7fa = impl_witness_access constants.%Copy.impl_witness.a32, element0 [concrete = constants.%Int.as.Copy.impl.Op.f59] @@ -267,18 +304,22 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc15: init %i32 = call %bound_method.loc15_29.2(%x.ref) // CHECK:STDOUT: %.loc15_30.2: ref %i32 = class_element_access %v.var, element0 // CHECK:STDOUT: %.loc15_30.3: init %i32 = initialize_from %Int.as.Copy.impl.Op.call.loc15 to %.loc15_30.2 -// CHECK:STDOUT: %.loc15_30.4: init %Class.247 = class_init (%.loc15_30.3), %v.var -// CHECK:STDOUT: %.loc15_3.1: init %Class.247 = converted %.loc15_30.1, %.loc15_30.4 +// CHECK:STDOUT: %.loc15_30.4: init %Class.626 = class_init (%.loc15_30.3), %v.var +// CHECK:STDOUT: %.loc15_3.1: init %Class.626 = converted %.loc15_30.1, %.loc15_30.4 // CHECK:STDOUT: assign %v.var, %.loc15_3.1 -// CHECK:STDOUT: %.loc15_19: type = splice_block %Class [concrete = constants.%Class.247] { +// CHECK:STDOUT: %.loc15_19.1: type = splice_block %Class [concrete = constants.%Class.626] { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [concrete = constants.%Class.generic] // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [concrete = constants.%Class.247] +// CHECK:STDOUT: %facet_value.loc15_19: %type_where = facet_value constants.%i32, () [concrete = constants.%facet_value.d23] +// CHECK:STDOUT: %.loc15_19.2: %type_where = converted constants.%i32, %facet_value.loc15_19 [concrete = constants.%facet_value.d23] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %i32.loc15, (constants.%Destroy.impl_witness.f71) [concrete = constants.%Destroy.facet.276] +// CHECK:STDOUT: %.loc15_19.3: %Destroy.type = converted %i32.loc15, %Destroy.facet [concrete = constants.%Destroy.facet.276] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%Destroy.facet.276) [concrete = constants.%Class.626] // CHECK:STDOUT: } -// CHECK:STDOUT: %v: ref %Class.247 = bind_name v, %v.var -// CHECK:STDOUT: %v.ref: ref %Class.247 = name_ref v, %v -// CHECK:STDOUT: %k.ref: %Class.elem.2d8 = name_ref k, @Class.%.loc5 [concrete = @Class.%.loc5] +// CHECK:STDOUT: %v: ref %Class.626 = bind_name v, %v.var +// CHECK:STDOUT: %v.ref: ref %Class.626 = name_ref v, %v +// CHECK:STDOUT: %k.ref: %Class.elem.24d = name_ref k, @Class.%.loc5_8 [concrete = @Class.%.loc5_8] // CHECK:STDOUT: %.loc16_11.1: ref %i32 = class_element_access %v.ref, element0 // CHECK:STDOUT: %.loc16_11.2: %i32 = bind_value %.loc16_11.1 // CHECK:STDOUT: %impl.elem0.loc16: %.7fa = impl_witness_access constants.%Copy.impl_witness.a32, element0 [concrete = constants.%Int.as.Copy.impl.Op.f59] @@ -286,20 +327,20 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %specific_fn.loc16: = specific_function %impl.elem0.loc16, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc16_11.2: = bound_method %.loc16_11.2, %specific_fn.loc16 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc16: init %i32 = call %bound_method.loc16_11.2(%.loc16_11.2) -// CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%Class.247, () [concrete = constants.%facet_value.06f] -// CHECK:STDOUT: %.loc15_3.2: %type_where = converted constants.%Class.247, %facet_value [concrete = constants.%facet_value.06f] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: = bound_method %v.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.79b +// CHECK:STDOUT: %facet_value.loc15_3: %type_where = facet_value constants.%Class.626, () [concrete = constants.%facet_value.de8] +// CHECK:STDOUT: %.loc15_3.2: %type_where = converted constants.%Class.626, %facet_value.loc15_3 [concrete = constants.%facet_value.de8] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: = bound_method %v.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.12d // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc15_3: = bound_method %v.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr: %ptr.f7c = addr_of %v.var +// CHECK:STDOUT: %addr: %ptr.1b6 = addr_of %v.var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc15_3(%addr) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call.loc16 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @InitFromStructGeneric(constants.%T.be8) { -// CHECK:STDOUT: %T.loc9_26.1 => constants.%T.be8 -// CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type -// CHECK:STDOUT: %pattern_type.loc9 => constants.%pattern_type.17e4b7.1 +// CHECK:STDOUT: specific @InitFromStructGeneric(constants.%T.4b8) { +// CHECK:STDOUT: %T.loc9_26.1 => constants.%T.4b8 +// CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type.b4b +// CHECK:STDOUT: %pattern_type.loc9 => constants.%pattern_type.1ba // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- adapt.carbon diff --git a/toolchain/check/testdata/class/generic/member_type.carbon b/toolchain/check/testdata/class/generic/member_type.carbon index 142f73200e78b..9c12ac31b72f7 100644 --- a/toolchain/check/testdata/class/generic/member_type.carbon +++ b/toolchain/check/testdata/class/generic/member_type.carbon @@ -16,7 +16,7 @@ library "[[@TEST_NAME]]"; -class Outer(T:! Core.Copy) { +class Outer(T:! Core.Copy & Core.Destroy) { class Inner { var n: T; } @@ -62,30 +62,43 @@ fn Test() -> i32 { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] -// CHECK:STDOUT: %T.be8: %Copy.type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %pattern_type.322: type = pattern_type %Copy.type [concrete] -// CHECK:STDOUT: %Outer.type: type = generic_class_type @Outer [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.f2e = struct_value () [concrete] +// CHECK:STDOUT: %BitAndWith.type.8a6: type = facet_type <@BitAndWith, @BitAndWith(type)> [concrete] +// CHECK:STDOUT: %BitAndWith.Op.type.9a3: type = fn_type @BitAndWith.Op, @BitAndWith(type) [concrete] +// CHECK:STDOUT: %BitAndWith.impl_witness: = impl_witness imports.%BitAndWith.impl_witness_table [concrete] +// CHECK:STDOUT: %BitAndWith.facet: %BitAndWith.type.8a6 = facet_value type, (%BitAndWith.impl_witness) [concrete] +// CHECK:STDOUT: %.fa7: type = fn_type_with_self_type %BitAndWith.Op.type.9a3, %BitAndWith.facet [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.type: type = fn_type @type.as.BitAndWith.impl.Op [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op: %type.as.BitAndWith.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.bound: = bound_method %Copy.type, %type.as.BitAndWith.impl.Op [concrete] +// CHECK:STDOUT: %facet_type: type = facet_type <@Copy & @Destroy> [concrete] +// CHECK:STDOUT: %T.062: %facet_type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %pattern_type.7d5: type = pattern_type %facet_type [concrete] +// CHECK:STDOUT: %Outer.type: type = generic_class_type @Outer [concrete] // CHECK:STDOUT: %Outer.generic: %Outer.type = struct_value () [concrete] -// CHECK:STDOUT: %Outer.117: type = class_type @Outer, @Outer(%T.be8) [symbolic] -// CHECK:STDOUT: %Inner.6ee: type = class_type @Inner, @Inner(%T.be8) [symbolic] -// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.be8 [symbolic] -// CHECK:STDOUT: %require_complete.1cd: = require_complete_type %T.binding.as_type [symbolic] -// CHECK:STDOUT: %Inner.elem.0ae: type = unbound_element_type %Inner.6ee, %T.binding.as_type [symbolic] -// CHECK:STDOUT: %struct_type.n.789: type = struct_type {.n: %T.binding.as_type} [symbolic] -// CHECK:STDOUT: %complete_type.b23: = complete_type_witness %struct_type.n.789 [symbolic] -// CHECK:STDOUT: %pattern_type.17e4b7.1: type = pattern_type %T.binding.as_type [symbolic] -// CHECK:STDOUT: %pattern_type.a9d: type = pattern_type %Inner.6ee [symbolic] -// CHECK:STDOUT: %Outer.F.type.f58: type = fn_type @Outer.F, @Outer(%T.be8) [symbolic] -// CHECK:STDOUT: %Outer.F.5ba: %Outer.F.type.f58 = struct_value () [symbolic] +// CHECK:STDOUT: %Outer.399: type = class_type @Outer, @Outer(%T.062) [symbolic] +// CHECK:STDOUT: %Inner.ffd: type = class_type @Inner, @Inner(%T.062) [symbolic] +// CHECK:STDOUT: %T.binding.as_type.f97: type = symbolic_binding_type T, 0, %T.062 [symbolic] +// CHECK:STDOUT: %require_complete.c03: = require_complete_type %T.binding.as_type.f97 [symbolic] +// CHECK:STDOUT: %Inner.elem.bff: type = unbound_element_type %Inner.ffd, %T.binding.as_type.f97 [symbolic] +// CHECK:STDOUT: %struct_type.n.1bd: type = struct_type {.n: %T.binding.as_type.f97} [symbolic] +// CHECK:STDOUT: %complete_type.cfa: = complete_type_witness %struct_type.n.1bd [symbolic] +// CHECK:STDOUT: %pattern_type.0b1: type = pattern_type %T.binding.as_type.f97 [symbolic] +// CHECK:STDOUT: %pattern_type.bdf: type = pattern_type %Inner.ffd [symbolic] +// CHECK:STDOUT: %Outer.F.type.475: type = fn_type @Outer.F, @Outer(%T.062) [symbolic] +// CHECK:STDOUT: %Outer.F.ff4: %Outer.F.type.475 = struct_value () [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %require_complete.f2b: = require_complete_type %Inner.6ee [symbolic] +// CHECK:STDOUT: %require_complete.f7d: = require_complete_type %Inner.ffd [symbolic] // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] -// CHECK:STDOUT: %Copy.lookup_impl_witness.e15: = lookup_impl_witness %T.be8, @Copy [symbolic] -// CHECK:STDOUT: %.427: type = fn_type_with_self_type %Copy.Op.type, %T.be8 [symbolic] -// CHECK:STDOUT: %impl.elem0.168: %.427 = impl_witness_access %Copy.lookup_impl_witness.e15, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.2ce: = specific_impl_function %impl.elem0.168, @Copy.Op(%T.be8) [symbolic] +// CHECK:STDOUT: %Copy.lookup_impl_witness.13a: = lookup_impl_witness %T.062, @Copy [symbolic] +// CHECK:STDOUT: %Copy.facet.9d2: %Copy.type = facet_value %T.binding.as_type.f97, (%Copy.lookup_impl_witness.13a) [symbolic] +// CHECK:STDOUT: %.6a3: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.9d2 [symbolic] +// CHECK:STDOUT: %impl.elem0.780: %.6a3 = impl_witness_access %Copy.lookup_impl_witness.13a, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.3bc: = specific_impl_function %impl.elem0.780, @Copy.Op(%Copy.facet.9d2) [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] @@ -101,19 +114,27 @@ fn Test() -> i32 { // CHECK:STDOUT: %Copy.impl_witness.a32: = impl_witness imports.%Copy.impl_witness_table.1ed, @Int.as.Copy.impl(%int_32) [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.276: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.f59: %Int.as.Copy.impl.Op.type.276 = struct_value () [concrete] -// CHECK:STDOUT: %Copy.facet.c49: %Copy.type = facet_value %i32, (%Copy.impl_witness.a32) [concrete] -// CHECK:STDOUT: %Outer.3a3: type = class_type @Outer, @Outer(%Copy.facet.c49) [concrete] -// CHECK:STDOUT: %Inner.d35: type = class_type @Inner, @Inner(%Copy.facet.c49) [concrete] -// CHECK:STDOUT: %Outer.F.type.f5d: type = fn_type @Outer.F, @Outer(%Copy.facet.c49) [concrete] -// CHECK:STDOUT: %Outer.F.e06: %Outer.F.type.f5d = struct_value () [concrete] -// CHECK:STDOUT: %Inner.elem.7f6: type = unbound_element_type %Inner.d35, %i32 [concrete] +// CHECK:STDOUT: %type_where: type = facet_type > [concrete] +// CHECK:STDOUT: %DestroyT: %type_where = bind_symbolic_name DestroyT, 0 [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%DestroyT) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.544: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d = struct_value () [symbolic] +// CHECK:STDOUT: %facet_value.d23: %type_where = facet_value %i32, () [concrete] +// CHECK:STDOUT: %Destroy.impl_witness.f71: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.d23) [concrete] +// CHECK:STDOUT: %facet_value.073: %facet_type = facet_value %i32, (%Copy.impl_witness.a32, %Destroy.impl_witness.f71) [concrete] +// CHECK:STDOUT: %Outer.be2: type = class_type @Outer, @Outer(%facet_value.073) [concrete] +// CHECK:STDOUT: %Inner.6a6: type = class_type @Inner, @Inner(%facet_value.073) [concrete] +// CHECK:STDOUT: %Outer.F.type.060: type = fn_type @Outer.F, @Outer(%facet_value.073) [concrete] +// CHECK:STDOUT: %Outer.F.174: %Outer.F.type.060 = struct_value () [concrete] +// CHECK:STDOUT: %Inner.elem.7a2: type = unbound_element_type %Inner.6a6, %i32 [concrete] // CHECK:STDOUT: %struct_type.n.033: type = struct_type {.n: %i32} [concrete] // CHECK:STDOUT: %complete_type.54b: = complete_type_witness %struct_type.n.033 [concrete] -// CHECK:STDOUT: %pattern_type.8e8: type = pattern_type %Inner.d35 [concrete] +// CHECK:STDOUT: %pattern_type.a76: type = pattern_type %Inner.6a6 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %Copy.impl_witness.d08: = impl_witness imports.%Copy.impl_witness_table.5a1 [concrete] -// CHECK:STDOUT: %Copy.facet.8aa: %Copy.type = facet_value Core.IntLiteral, (%Copy.impl_witness.d08) [concrete] -// CHECK:STDOUT: %Outer.F.specific_fn: = specific_function %Outer.F.e06, @Outer.F(%Copy.facet.c49) [concrete] +// CHECK:STDOUT: %facet_value.96f: %type_where = facet_value Core.IntLiteral, () [concrete] +// CHECK:STDOUT: %Destroy.impl_witness.889: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.96f) [concrete] +// CHECK:STDOUT: %facet_value.0f0: %facet_type = facet_value Core.IntLiteral, (%Copy.impl_witness.d08, %Destroy.impl_witness.889) [concrete] +// CHECK:STDOUT: %Outer.F.specific_fn: = specific_function %Outer.F.174, @Outer.F(%facet_value.073) [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] @@ -130,36 +151,41 @@ fn Test() -> i32 { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] +// CHECK:STDOUT: %Copy.facet.c49: %Copy.type = facet_value %i32, (%Copy.impl_witness.a32) [concrete] // CHECK:STDOUT: %.7fa: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.c49 [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.f59, @Int.as.Copy.impl.Op(%int_32) [concrete] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %type_where: type = facet_type > [concrete] -// CHECK:STDOUT: %facet_value: %type_where = facet_value %Inner.d35, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.1d9: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.b25: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.1d9 = struct_value () [concrete] -// CHECK:STDOUT: %ptr.44b: type = ptr_type %Inner.d35 [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.b25, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [concrete] +// CHECK:STDOUT: %facet_value.b24: %type_where = facet_value %Inner.6a6, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.98e: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.b24) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.44a: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.98e = struct_value () [concrete] +// CHECK:STDOUT: %ptr.646: type = ptr_type %Inner.6a6 [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.44a, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.b24) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Copy = %Core.Copy +// CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .BitAndWith = %Core.BitAndWith // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs -// CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude/parts/as, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] +// CHECK:STDOUT: %Core.import_ref.636: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.636), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.import_ref.d0f6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.afd) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6cd)] // CHECK:STDOUT: %Copy.impl_witness_table.1ed = impl_witness_table (%Core.import_ref.d0f6), @Int.as.Copy.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.950: @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.544)] +// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.950), @DestroyT.binding.as_type.as.Destroy.impl [concrete] // CHECK:STDOUT: %Core.import_ref.b02 = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %Copy.impl_witness_table.5a1 = impl_witness_table (%Core.import_ref.b02), @Core.IntLiteral.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.ee7: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -170,14 +196,21 @@ fn Test() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Outer.decl: %Outer.type = class_decl @Outer [concrete = constants.%Outer.generic] { -// CHECK:STDOUT: %T.patt: %pattern_type.322 = symbolic_binding_pattern T, 0 [concrete] +// CHECK:STDOUT: %T.patt: %pattern_type.7d5 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc4: type = splice_block %Copy.ref [concrete = constants.%Copy.type] { +// CHECK:STDOUT: %.loc4_27.1: type = splice_block %.loc4_27.3 [concrete = constants.%facet_type] { // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Core.ref.loc4_17: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Copy.ref: type = name_ref Copy, imports.%Core.Copy [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.ref.loc4_29: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Destroy.ref: type = name_ref Destroy, imports.%Core.Destroy [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %impl.elem0: %.fa7 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %bound_method: = bound_method %Copy.ref, %impl.elem0 [concrete = constants.%type.as.BitAndWith.impl.Op.bound] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call: init type = call %bound_method(%Copy.ref, %Destroy.ref) [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %type.as.BitAndWith.impl.Op.call [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc4_27.3: type = converted %type.as.BitAndWith.impl.Op.call, %.loc4_27.2 [concrete = constants.%facet_type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc4_13.2: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.1 (constants.%T.be8)] +// CHECK:STDOUT: %T.loc4_13.2: %facet_type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.1 (constants.%T.062)] // CHECK:STDOUT: } // CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [concrete = constants.%Test] { // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] @@ -190,99 +223,100 @@ fn Test() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Outer(%T.loc4_13.2: %Copy.type) { -// CHECK:STDOUT: %T.loc4_13.1: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.1 (constants.%T.be8)] +// CHECK:STDOUT: generic class @Outer(%T.loc4_13.2: %facet_type) { +// CHECK:STDOUT: %T.loc4_13.1: %facet_type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.1 (constants.%T.062)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(%T.loc4_13.1) [symbolic = %Inner (constants.%Inner.6ee)] -// CHECK:STDOUT: %Outer.F.type: type = fn_type @Outer.F, @Outer(%T.loc4_13.1) [symbolic = %Outer.F.type (constants.%Outer.F.type.f58)] -// CHECK:STDOUT: %Outer.F: @Outer.%Outer.F.type (%Outer.F.type.f58) = struct_value () [symbolic = %Outer.F (constants.%Outer.F.5ba)] +// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(%T.loc4_13.1) [symbolic = %Inner (constants.%Inner.ffd)] +// CHECK:STDOUT: %Outer.F.type: type = fn_type @Outer.F, @Outer(%T.loc4_13.1) [symbolic = %Outer.F.type (constants.%Outer.F.type.475)] +// CHECK:STDOUT: %Outer.F: @Outer.%Outer.F.type (%Outer.F.type.475) = struct_value () [symbolic = %Outer.F (constants.%Outer.F.ff4)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [symbolic = @Outer.%Inner (constants.%Inner.6ee)] {} {} -// CHECK:STDOUT: %Outer.F.decl: @Outer.%Outer.F.type (%Outer.F.type.f58) = fn_decl @Outer.F [symbolic = @Outer.%Outer.F (constants.%Outer.F.5ba)] { -// CHECK:STDOUT: %n.patt: @Outer.F.%pattern_type.loc9_8 (%pattern_type.17e4b7.1) = binding_pattern n [concrete] -// CHECK:STDOUT: %n.param_patt: @Outer.F.%pattern_type.loc9_8 (%pattern_type.17e4b7.1) = value_param_pattern %n.patt, call_param0 [concrete] -// CHECK:STDOUT: %return.patt: @Outer.F.%pattern_type.loc9_14 (%pattern_type.a9d) = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: @Outer.F.%pattern_type.loc9_14 (%pattern_type.a9d) = out_param_pattern %return.patt, call_param1 [concrete] +// CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [symbolic = @Outer.%Inner (constants.%Inner.ffd)] {} {} +// CHECK:STDOUT: %Outer.F.decl: @Outer.%Outer.F.type (%Outer.F.type.475) = fn_decl @Outer.F [symbolic = @Outer.%Outer.F (constants.%Outer.F.ff4)] { +// CHECK:STDOUT: %n.patt: @Outer.F.%pattern_type.loc9_8 (%pattern_type.0b1) = binding_pattern n [concrete] +// CHECK:STDOUT: %n.param_patt: @Outer.F.%pattern_type.loc9_8 (%pattern_type.0b1) = value_param_pattern %n.patt, call_param0 [concrete] +// CHECK:STDOUT: %return.patt: @Outer.F.%pattern_type.loc9_14 (%pattern_type.bdf) = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: @Outer.F.%pattern_type.loc9_14 (%pattern_type.bdf) = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc9_17: type = specific_constant @Outer.%Inner.decl, @Outer(constants.%T.be8) [symbolic = %Inner (constants.%Inner.6ee)] -// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %.loc9_17 [symbolic = %Inner (constants.%Inner.6ee)] -// CHECK:STDOUT: %n.param: @Outer.F.%T.binding.as_type (%T.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc9_11.1: type = splice_block %.loc9_11.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { -// CHECK:STDOUT: %T.ref: %Copy.type = name_ref T, @Outer.%T.loc4_13.2 [symbolic = %T (constants.%T.be8)] -// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc9_11.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc9_17: type = specific_constant @Outer.%Inner.decl, @Outer(constants.%T.062) [symbolic = %Inner (constants.%Inner.ffd)] +// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %.loc9_17 [symbolic = %Inner (constants.%Inner.ffd)] +// CHECK:STDOUT: %n.param: @Outer.F.%T.binding.as_type (%T.binding.as_type.f97) = value_param call_param0 +// CHECK:STDOUT: %.loc9_11.1: type = splice_block %.loc9_11.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.f97)] { +// CHECK:STDOUT: %T.ref: %facet_type = name_ref T, @Outer.%T.loc4_13.2 [symbolic = %T (constants.%T.062)] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type.f97)] +// CHECK:STDOUT: %.loc9_11.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type.f97)] // CHECK:STDOUT: } -// CHECK:STDOUT: %n: @Outer.F.%T.binding.as_type (%T.binding.as_type) = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref @Outer.F.%Inner (%Inner.6ee) = out_param call_param1 -// CHECK:STDOUT: %return: ref @Outer.F.%Inner (%Inner.6ee) = return_slot %return.param +// CHECK:STDOUT: %n: @Outer.F.%T.binding.as_type (%T.binding.as_type.f97) = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref @Outer.F.%Inner (%Inner.ffd) = out_param call_param1 +// CHECK:STDOUT: %return: ref @Outer.F.%Inner (%Inner.ffd) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%Outer.117 +// CHECK:STDOUT: .Self = constants.%Outer.399 // CHECK:STDOUT: .Inner = %Inner.decl // CHECK:STDOUT: .T = // CHECK:STDOUT: .F = %Outer.F.decl // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Inner(@Outer.%T.loc4_13.2: %Copy.type) { +// CHECK:STDOUT: generic class @Inner(@Outer.%T.loc4_13.2: %facet_type) { // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %T: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.be8)] -// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %require_complete: = require_complete_type %T.binding.as_type [symbolic = %require_complete (constants.%require_complete.1cd)] -// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(%T) [symbolic = %Inner (constants.%Inner.6ee)] -// CHECK:STDOUT: %Inner.elem: type = unbound_element_type %Inner, %T.binding.as_type [symbolic = %Inner.elem (constants.%Inner.elem.0ae)] -// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Inner.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.n (constants.%struct_type.n.789)] -// CHECK:STDOUT: %complete_type.loc7_3.2: = complete_type_witness %struct_type.n [symbolic = %complete_type.loc7_3.2 (constants.%complete_type.b23)] +// CHECK:STDOUT: %T: %facet_type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.062)] +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic = %T.binding.as_type (constants.%T.binding.as_type.f97)] +// CHECK:STDOUT: %require_complete: = require_complete_type %T.binding.as_type [symbolic = %require_complete (constants.%require_complete.c03)] +// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(%T) [symbolic = %Inner (constants.%Inner.ffd)] +// CHECK:STDOUT: %Inner.elem: type = unbound_element_type %Inner, %T.binding.as_type [symbolic = %Inner.elem (constants.%Inner.elem.bff)] +// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Inner.%T.binding.as_type (%T.binding.as_type.f97)} [symbolic = %struct_type.n (constants.%struct_type.n.1bd)] +// CHECK:STDOUT: %complete_type.loc7_3.2: = complete_type_witness %struct_type.n [symbolic = %complete_type.loc7_3.2 (constants.%complete_type.cfa)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: %Copy.type = name_ref T, @Outer.%T.loc4_13.2 [symbolic = %T (constants.%T.be8)] -// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc6_12: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc6_10: @Inner.%Inner.elem (%Inner.elem.0ae) = field_decl n, element0 [concrete] -// CHECK:STDOUT: %complete_type.loc7_3.1: = complete_type_witness constants.%struct_type.n.789 [symbolic = %complete_type.loc7_3.2 (constants.%complete_type.b23)] +// CHECK:STDOUT: %T.ref: %facet_type = name_ref T, @Outer.%T.loc4_13.2 [symbolic = %T (constants.%T.062)] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type.f97)] +// CHECK:STDOUT: %.loc6_12: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type.f97)] +// CHECK:STDOUT: %.loc6_10: @Inner.%Inner.elem (%Inner.elem.bff) = field_decl n, element0 [concrete] +// CHECK:STDOUT: %complete_type.loc7_3.1: = complete_type_witness constants.%struct_type.n.1bd [symbolic = %complete_type.loc7_3.2 (constants.%complete_type.cfa)] // CHECK:STDOUT: complete_type_witness = %complete_type.loc7_3.1 // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%Inner.6ee +// CHECK:STDOUT: .Self = constants.%Inner.ffd // CHECK:STDOUT: .T = // CHECK:STDOUT: .n = %.loc6_10 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Outer.F(@Outer.%T.loc4_13.2: %Copy.type) { -// CHECK:STDOUT: %T: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.be8)] -// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %pattern_type.loc9_8: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc9_8 (constants.%pattern_type.17e4b7.1)] -// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(%T) [symbolic = %Inner (constants.%Inner.6ee)] -// CHECK:STDOUT: %pattern_type.loc9_14: type = pattern_type %Inner [symbolic = %pattern_type.loc9_14 (constants.%pattern_type.a9d)] +// CHECK:STDOUT: generic fn @Outer.F(@Outer.%T.loc4_13.2: %facet_type) { +// CHECK:STDOUT: %T: %facet_type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.062)] +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic = %T.binding.as_type (constants.%T.binding.as_type.f97)] +// CHECK:STDOUT: %pattern_type.loc9_8: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc9_8 (constants.%pattern_type.0b1)] +// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(%T) [symbolic = %Inner (constants.%Inner.ffd)] +// CHECK:STDOUT: %pattern_type.loc9_14: type = pattern_type %Inner [symbolic = %pattern_type.loc9_14 (constants.%pattern_type.bdf)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc9_14: = require_complete_type %Inner [symbolic = %require_complete.loc9_14 (constants.%require_complete.f2b)] -// CHECK:STDOUT: %require_complete.loc9_9: = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc9_9 (constants.%require_complete.1cd)] -// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Outer.F.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.n (constants.%struct_type.n.789)] -// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.e15)] -// CHECK:STDOUT: %.loc9_38.2: type = fn_type_with_self_type constants.%Copy.Op.type, %T [symbolic = %.loc9_38.2 (constants.%.427)] -// CHECK:STDOUT: %impl.elem0.loc9_38.2: @Outer.F.%.loc9_38.2 (%.427) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_38.2 (constants.%impl.elem0.168)] -// CHECK:STDOUT: %specific_impl_fn.loc9_38.2: = specific_impl_function %impl.elem0.loc9_38.2, @Copy.Op(%T) [symbolic = %specific_impl_fn.loc9_38.2 (constants.%specific_impl_fn.2ce)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn(%n.param: @Outer.F.%T.binding.as_type (%T.binding.as_type)) -> %return.param: @Outer.F.%Inner (%Inner.6ee) { +// CHECK:STDOUT: %require_complete.loc9_14: = require_complete_type %Inner [symbolic = %require_complete.loc9_14 (constants.%require_complete.f7d)] +// CHECK:STDOUT: %require_complete.loc9_9: = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc9_9 (constants.%require_complete.c03)] +// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Outer.F.%T.binding.as_type (%T.binding.as_type.f97)} [symbolic = %struct_type.n (constants.%struct_type.n.1bd)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.13a)] +// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %T.binding.as_type, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.9d2)] +// CHECK:STDOUT: %.loc9_38.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc9_38.2 (constants.%.6a3)] +// CHECK:STDOUT: %impl.elem0.loc9_38.2: @Outer.F.%.loc9_38.2 (%.6a3) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_38.2 (constants.%impl.elem0.780)] +// CHECK:STDOUT: %specific_impl_fn.loc9_38.2: = specific_impl_function %impl.elem0.loc9_38.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc9_38.2 (constants.%specific_impl_fn.3bc)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%n.param: @Outer.F.%T.binding.as_type (%T.binding.as_type.f97)) -> %return.param: @Outer.F.%Inner (%Inner.ffd) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: @Outer.F.%T.binding.as_type (%T.binding.as_type) = name_ref n, %n -// CHECK:STDOUT: %.loc9_39.1: @Outer.F.%struct_type.n (%struct_type.n.789) = struct_literal (%n.ref) -// CHECK:STDOUT: %impl.elem0.loc9_38.1: @Outer.F.%.loc9_38.2 (%.427) = impl_witness_access constants.%Copy.lookup_impl_witness.e15, element0 [symbolic = %impl.elem0.loc9_38.2 (constants.%impl.elem0.168)] +// CHECK:STDOUT: %n.ref: @Outer.F.%T.binding.as_type (%T.binding.as_type.f97) = name_ref n, %n +// CHECK:STDOUT: %.loc9_39.1: @Outer.F.%struct_type.n (%struct_type.n.1bd) = struct_literal (%n.ref) +// CHECK:STDOUT: %impl.elem0.loc9_38.1: @Outer.F.%.loc9_38.2 (%.6a3) = impl_witness_access constants.%Copy.lookup_impl_witness.13a, element0 [symbolic = %impl.elem0.loc9_38.2 (constants.%impl.elem0.780)] // CHECK:STDOUT: %bound_method.loc9_38.1: = bound_method %n.ref, %impl.elem0.loc9_38.1 -// CHECK:STDOUT: %specific_impl_fn.loc9_38.1: = specific_impl_function %impl.elem0.loc9_38.1, @Copy.Op(constants.%T.be8) [symbolic = %specific_impl_fn.loc9_38.2 (constants.%specific_impl_fn.2ce)] +// CHECK:STDOUT: %specific_impl_fn.loc9_38.1: = specific_impl_function %impl.elem0.loc9_38.1, @Copy.Op(constants.%Copy.facet.9d2) [symbolic = %specific_impl_fn.loc9_38.2 (constants.%specific_impl_fn.3bc)] // CHECK:STDOUT: %bound_method.loc9_38.2: = bound_method %n.ref, %specific_impl_fn.loc9_38.1 -// CHECK:STDOUT: %.loc9_39.2: ref @Outer.F.%T.binding.as_type (%T.binding.as_type) = class_element_access %return, element0 -// CHECK:STDOUT: %.loc9_38.1: init @Outer.F.%T.binding.as_type (%T.binding.as_type) = call %bound_method.loc9_38.2(%n.ref) to %.loc9_39.2 -// CHECK:STDOUT: %.loc9_39.3: init @Outer.F.%T.binding.as_type (%T.binding.as_type) = initialize_from %.loc9_38.1 to %.loc9_39.2 -// CHECK:STDOUT: %.loc9_39.4: init @Outer.F.%Inner (%Inner.6ee) = class_init (%.loc9_39.3), %return -// CHECK:STDOUT: %.loc9_40: init @Outer.F.%Inner (%Inner.6ee) = converted %.loc9_39.1, %.loc9_39.4 +// CHECK:STDOUT: %.loc9_39.2: ref @Outer.F.%T.binding.as_type (%T.binding.as_type.f97) = class_element_access %return, element0 +// CHECK:STDOUT: %.loc9_38.1: init @Outer.F.%T.binding.as_type (%T.binding.as_type.f97) = call %bound_method.loc9_38.2(%n.ref) to %.loc9_39.2 +// CHECK:STDOUT: %.loc9_39.3: init @Outer.F.%T.binding.as_type (%T.binding.as_type.f97) = initialize_from %.loc9_38.1 to %.loc9_39.2 +// CHECK:STDOUT: %.loc9_39.4: init @Outer.F.%Inner (%Inner.ffd) = class_init (%.loc9_39.3), %return +// CHECK:STDOUT: %.loc9_40: init @Outer.F.%Inner (%Inner.ffd) = converted %.loc9_39.1, %.loc9_39.4 // CHECK:STDOUT: return %.loc9_40 to %return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -290,25 +324,31 @@ fn Test() -> i32 { // CHECK:STDOUT: fn @Test() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %c.patt: %pattern_type.8e8 = binding_pattern c [concrete] -// CHECK:STDOUT: %c.var_patt: %pattern_type.8e8 = var_pattern %c.patt [concrete] +// CHECK:STDOUT: %c.patt: %pattern_type.a76 = binding_pattern c [concrete] +// CHECK:STDOUT: %c.var_patt: %pattern_type.a76 = var_pattern %c.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %c.var: ref %Inner.d35 = var %c.var_patt +// CHECK:STDOUT: %c.var: ref %Inner.6a6 = var %c.var_patt // CHECK:STDOUT: %Outer.ref.loc13_29: %Outer.type = name_ref Outer, file.%Outer.decl [concrete = constants.%Outer.generic] // CHECK:STDOUT: %int_32.loc13_35: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc13_35: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %Copy.facet.loc13_38: %Copy.type = facet_value %i32.loc13_35, (constants.%Copy.impl_witness.a32) [concrete = constants.%Copy.facet.c49] -// CHECK:STDOUT: %.loc13_38: %Copy.type = converted %i32.loc13_35, %Copy.facet.loc13_38 [concrete = constants.%Copy.facet.c49] -// CHECK:STDOUT: %Outer.loc13_38: type = class_type @Outer, @Outer(constants.%Copy.facet.c49) [concrete = constants.%Outer.3a3] -// CHECK:STDOUT: %.loc13_39: %Outer.F.type.f5d = specific_constant @Outer.%Outer.F.decl, @Outer(constants.%Copy.facet.c49) [concrete = constants.%Outer.F.e06] -// CHECK:STDOUT: %F.ref: %Outer.F.type.f5d = name_ref F, %.loc13_39 [concrete = constants.%Outer.F.e06] +// CHECK:STDOUT: %facet_value.loc13_38.1: %type_where = facet_value constants.%i32, () [concrete = constants.%facet_value.d23] +// CHECK:STDOUT: %.loc13_38.1: %type_where = converted constants.%i32, %facet_value.loc13_38.1 [concrete = constants.%facet_value.d23] +// CHECK:STDOUT: %facet_value.loc13_38.2: %facet_type = facet_value %i32.loc13_35, (constants.%Copy.impl_witness.a32, constants.%Destroy.impl_witness.f71) [concrete = constants.%facet_value.073] +// CHECK:STDOUT: %.loc13_38.2: %facet_type = converted %i32.loc13_35, %facet_value.loc13_38.2 [concrete = constants.%facet_value.073] +// CHECK:STDOUT: %Outer.loc13_38: type = class_type @Outer, @Outer(constants.%facet_value.073) [concrete = constants.%Outer.be2] +// CHECK:STDOUT: %.loc13_39: %Outer.F.type.060 = specific_constant @Outer.%Outer.F.decl, @Outer(constants.%facet_value.073) [concrete = constants.%Outer.F.174] +// CHECK:STDOUT: %F.ref: %Outer.F.type.060 = name_ref F, %.loc13_39 [concrete = constants.%Outer.F.174] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %Copy.facet.loc13_43.1: %Copy.type = facet_value Core.IntLiteral, (constants.%Copy.impl_witness.d08) [concrete = constants.%Copy.facet.8aa] -// CHECK:STDOUT: %.loc13_43.1: %Copy.type = converted Core.IntLiteral, %Copy.facet.loc13_43.1 [concrete = constants.%Copy.facet.8aa] -// CHECK:STDOUT: %Copy.facet.loc13_43.2: %Copy.type = facet_value Core.IntLiteral, (constants.%Copy.impl_witness.d08) [concrete = constants.%Copy.facet.8aa] -// CHECK:STDOUT: %.loc13_43.2: %Copy.type = converted Core.IntLiteral, %Copy.facet.loc13_43.2 [concrete = constants.%Copy.facet.8aa] -// CHECK:STDOUT: %Outer.F.specific_fn: = specific_function %F.ref, @Outer.F(constants.%Copy.facet.c49) [concrete = constants.%Outer.F.specific_fn] -// CHECK:STDOUT: %.loc13_3.1: ref %Inner.d35 = splice_block %c.var {} +// CHECK:STDOUT: %facet_value.loc13_43.1: %type_where = facet_value Core.IntLiteral, () [concrete = constants.%facet_value.96f] +// CHECK:STDOUT: %.loc13_43.1: %type_where = converted Core.IntLiteral, %facet_value.loc13_43.1 [concrete = constants.%facet_value.96f] +// CHECK:STDOUT: %facet_value.loc13_43.2: %facet_type = facet_value Core.IntLiteral, (constants.%Copy.impl_witness.d08, constants.%Destroy.impl_witness.889) [concrete = constants.%facet_value.0f0] +// CHECK:STDOUT: %.loc13_43.2: %facet_type = converted Core.IntLiteral, %facet_value.loc13_43.2 [concrete = constants.%facet_value.0f0] +// CHECK:STDOUT: %facet_value.loc13_43.3: %type_where = facet_value Core.IntLiteral, () [concrete = constants.%facet_value.96f] +// CHECK:STDOUT: %.loc13_43.3: %type_where = converted Core.IntLiteral, %facet_value.loc13_43.3 [concrete = constants.%facet_value.96f] +// CHECK:STDOUT: %facet_value.loc13_43.4: %facet_type = facet_value Core.IntLiteral, (constants.%Copy.impl_witness.d08, constants.%Destroy.impl_witness.889) [concrete = constants.%facet_value.0f0] +// CHECK:STDOUT: %.loc13_43.4: %facet_type = converted Core.IntLiteral, %facet_value.loc13_43.4 [concrete = constants.%facet_value.0f0] +// CHECK:STDOUT: %Outer.F.specific_fn: = specific_function %F.ref, @Outer.F(constants.%facet_value.073) [concrete = constants.%Outer.F.specific_fn] +// CHECK:STDOUT: %.loc13_3.1: ref %Inner.6a6 = splice_block %c.var {} // CHECK:STDOUT: %impl.elem0.loc13: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0] // CHECK:STDOUT: %bound_method.loc13_42.1: = bound_method %int_1, %impl.elem0.loc13 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] // CHECK:STDOUT: %specific_fn.loc13: = specific_function %impl.elem0.loc13, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -316,21 +356,23 @@ fn Test() -> i32 { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc13_42.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_42.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_42.2: %i32 = converted %int_1, %.loc13_42.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %Outer.F.call: init %Inner.d35 = call %Outer.F.specific_fn(%.loc13_42.2) to %.loc13_3.1 +// CHECK:STDOUT: %Outer.F.call: init %Inner.6a6 = call %Outer.F.specific_fn(%.loc13_42.2) to %.loc13_3.1 // CHECK:STDOUT: assign %c.var, %Outer.F.call -// CHECK:STDOUT: %.loc13_20.1: type = splice_block %Inner.ref [concrete = constants.%Inner.d35] { +// CHECK:STDOUT: %.loc13_20.1: type = splice_block %Inner.ref [concrete = constants.%Inner.6a6] { // CHECK:STDOUT: %Outer.ref.loc13_10: %Outer.type = name_ref Outer, file.%Outer.decl [concrete = constants.%Outer.generic] // CHECK:STDOUT: %int_32.loc13_16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc13_16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %Copy.facet.loc13_19: %Copy.type = facet_value %i32.loc13_16, (constants.%Copy.impl_witness.a32) [concrete = constants.%Copy.facet.c49] -// CHECK:STDOUT: %.loc13_19: %Copy.type = converted %i32.loc13_16, %Copy.facet.loc13_19 [concrete = constants.%Copy.facet.c49] -// CHECK:STDOUT: %Outer.loc13_19: type = class_type @Outer, @Outer(constants.%Copy.facet.c49) [concrete = constants.%Outer.3a3] -// CHECK:STDOUT: %.loc13_20.2: type = specific_constant @Outer.%Inner.decl, @Outer(constants.%Copy.facet.c49) [concrete = constants.%Inner.d35] -// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %.loc13_20.2 [concrete = constants.%Inner.d35] +// CHECK:STDOUT: %facet_value.loc13_19.1: %type_where = facet_value constants.%i32, () [concrete = constants.%facet_value.d23] +// CHECK:STDOUT: %.loc13_19.1: %type_where = converted constants.%i32, %facet_value.loc13_19.1 [concrete = constants.%facet_value.d23] +// CHECK:STDOUT: %facet_value.loc13_19.2: %facet_type = facet_value %i32.loc13_16, (constants.%Copy.impl_witness.a32, constants.%Destroy.impl_witness.f71) [concrete = constants.%facet_value.073] +// CHECK:STDOUT: %.loc13_19.2: %facet_type = converted %i32.loc13_16, %facet_value.loc13_19.2 [concrete = constants.%facet_value.073] +// CHECK:STDOUT: %Outer.loc13_19: type = class_type @Outer, @Outer(constants.%facet_value.073) [concrete = constants.%Outer.be2] +// CHECK:STDOUT: %.loc13_20.2: type = specific_constant @Outer.%Inner.decl, @Outer(constants.%facet_value.073) [concrete = constants.%Inner.6a6] +// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %.loc13_20.2 [concrete = constants.%Inner.6a6] // CHECK:STDOUT: } -// CHECK:STDOUT: %c: ref %Inner.d35 = bind_name c, %c.var -// CHECK:STDOUT: %c.ref: ref %Inner.d35 = name_ref c, %c -// CHECK:STDOUT: %n.ref: %Inner.elem.7f6 = name_ref n, @Inner.%.loc6_10 [concrete = @Inner.%.loc6_10] +// CHECK:STDOUT: %c: ref %Inner.6a6 = bind_name c, %c.var +// CHECK:STDOUT: %c.ref: ref %Inner.6a6 = name_ref c, %c +// CHECK:STDOUT: %n.ref: %Inner.elem.7a2 = name_ref n, @Inner.%.loc6_10 [concrete = @Inner.%.loc6_10] // CHECK:STDOUT: %.loc14_11.1: ref %i32 = class_element_access %c.ref, element0 // CHECK:STDOUT: %.loc14_11.2: %i32 = bind_value %.loc14_11.1 // CHECK:STDOUT: %impl.elem0.loc14: %.7fa = impl_witness_access constants.%Copy.impl_witness.a32, element0 [concrete = constants.%Int.as.Copy.impl.Op.f59] @@ -338,76 +380,77 @@ fn Test() -> i32 { // CHECK:STDOUT: %specific_fn.loc14: = specific_function %impl.elem0.loc14, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc14_11.2: = bound_method %.loc14_11.2, %specific_fn.loc14 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc14_11.2(%.loc14_11.2) -// CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%Inner.d35, () [concrete = constants.%facet_value] -// CHECK:STDOUT: %.loc13_3.2: %type_where = converted constants.%Inner.d35, %facet_value [concrete = constants.%facet_value] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: = bound_method %c.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.b25 -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.b25, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn] +// CHECK:STDOUT: %facet_value.loc13_3: %type_where = facet_value constants.%Inner.6a6, () [concrete = constants.%facet_value.b24] +// CHECK:STDOUT: %.loc13_3.2: %type_where = converted constants.%Inner.6a6, %facet_value.loc13_3 [concrete = constants.%facet_value.b24] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: = bound_method %c.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.44a +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.44a, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.b24) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc13_3: = bound_method %c.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr: %ptr.44b = addr_of %c.var +// CHECK:STDOUT: %addr: %ptr.646 = addr_of %c.var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc13_3(%addr) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(constants.%T.be8) { -// CHECK:STDOUT: %T.loc4_13.1 => constants.%T.be8 +// CHECK:STDOUT: specific @Outer(constants.%T.062) { +// CHECK:STDOUT: %T.loc4_13.1 => constants.%T.062 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Inner => constants.%Inner.6ee -// CHECK:STDOUT: %Outer.F.type => constants.%Outer.F.type.f58 -// CHECK:STDOUT: %Outer.F => constants.%Outer.F.5ba +// CHECK:STDOUT: %Inner => constants.%Inner.ffd +// CHECK:STDOUT: %Outer.F.type => constants.%Outer.F.type.475 +// CHECK:STDOUT: %Outer.F => constants.%Outer.F.ff4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Inner(constants.%T.be8) { +// CHECK:STDOUT: specific @Inner(constants.%T.062) { // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %T => constants.%T.be8 -// CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type -// CHECK:STDOUT: %require_complete => constants.%require_complete.1cd -// CHECK:STDOUT: %Inner => constants.%Inner.6ee -// CHECK:STDOUT: %Inner.elem => constants.%Inner.elem.0ae -// CHECK:STDOUT: %struct_type.n => constants.%struct_type.n.789 -// CHECK:STDOUT: %complete_type.loc7_3.2 => constants.%complete_type.b23 +// CHECK:STDOUT: %T => constants.%T.062 +// CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type.f97 +// CHECK:STDOUT: %require_complete => constants.%require_complete.c03 +// CHECK:STDOUT: %Inner => constants.%Inner.ffd +// CHECK:STDOUT: %Inner.elem => constants.%Inner.elem.bff +// CHECK:STDOUT: %struct_type.n => constants.%struct_type.n.1bd +// CHECK:STDOUT: %complete_type.loc7_3.2 => constants.%complete_type.cfa // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer.F(constants.%T.be8) { -// CHECK:STDOUT: %T => constants.%T.be8 -// CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type -// CHECK:STDOUT: %pattern_type.loc9_8 => constants.%pattern_type.17e4b7.1 -// CHECK:STDOUT: %Inner => constants.%Inner.6ee -// CHECK:STDOUT: %pattern_type.loc9_14 => constants.%pattern_type.a9d +// CHECK:STDOUT: specific @Outer.F(constants.%T.062) { +// CHECK:STDOUT: %T => constants.%T.062 +// CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type.f97 +// CHECK:STDOUT: %pattern_type.loc9_8 => constants.%pattern_type.0b1 +// CHECK:STDOUT: %Inner => constants.%Inner.ffd +// CHECK:STDOUT: %pattern_type.loc9_14 => constants.%pattern_type.bdf // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(constants.%Copy.facet.c49) { -// CHECK:STDOUT: %T.loc4_13.1 => constants.%Copy.facet.c49 +// CHECK:STDOUT: specific @Outer(constants.%facet_value.073) { +// CHECK:STDOUT: %T.loc4_13.1 => constants.%facet_value.073 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Inner => constants.%Inner.d35 -// CHECK:STDOUT: %Outer.F.type => constants.%Outer.F.type.f5d -// CHECK:STDOUT: %Outer.F => constants.%Outer.F.e06 +// CHECK:STDOUT: %Inner => constants.%Inner.6a6 +// CHECK:STDOUT: %Outer.F.type => constants.%Outer.F.type.060 +// CHECK:STDOUT: %Outer.F => constants.%Outer.F.174 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Inner(constants.%Copy.facet.c49) { +// CHECK:STDOUT: specific @Inner(constants.%facet_value.073) { // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %T => constants.%Copy.facet.c49 +// CHECK:STDOUT: %T => constants.%facet_value.073 // CHECK:STDOUT: %T.binding.as_type => constants.%i32 // CHECK:STDOUT: %require_complete => constants.%complete_type.f8a -// CHECK:STDOUT: %Inner => constants.%Inner.d35 -// CHECK:STDOUT: %Inner.elem => constants.%Inner.elem.7f6 +// CHECK:STDOUT: %Inner => constants.%Inner.6a6 +// CHECK:STDOUT: %Inner.elem => constants.%Inner.elem.7a2 // CHECK:STDOUT: %struct_type.n => constants.%struct_type.n.033 // CHECK:STDOUT: %complete_type.loc7_3.2 => constants.%complete_type.54b // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer.F(constants.%Copy.facet.c49) { -// CHECK:STDOUT: %T => constants.%Copy.facet.c49 +// CHECK:STDOUT: specific @Outer.F(constants.%facet_value.073) { +// CHECK:STDOUT: %T => constants.%facet_value.073 // CHECK:STDOUT: %T.binding.as_type => constants.%i32 // CHECK:STDOUT: %pattern_type.loc9_8 => constants.%pattern_type.7ce -// CHECK:STDOUT: %Inner => constants.%Inner.d35 -// CHECK:STDOUT: %pattern_type.loc9_14 => constants.%pattern_type.8e8 +// CHECK:STDOUT: %Inner => constants.%Inner.6a6 +// CHECK:STDOUT: %pattern_type.loc9_14 => constants.%pattern_type.a76 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc9_14 => constants.%complete_type.54b // CHECK:STDOUT: %require_complete.loc9_9 => constants.%complete_type.f8a // CHECK:STDOUT: %struct_type.n => constants.%struct_type.n.033 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.a32 +// CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.c49 // CHECK:STDOUT: %.loc9_38.2 => constants.%.7fa // CHECK:STDOUT: %impl.elem0.loc9_38.2 => constants.%Int.as.Copy.impl.Op.f59 // CHECK:STDOUT: %specific_impl_fn.loc9_38.2 => constants.%Int.as.Copy.impl.Op.specific_fn diff --git a/toolchain/check/testdata/eval/aggregates.carbon b/toolchain/check/testdata/eval/aggregates.carbon index 805267b6f0835..8faae1d0ef4ad 100644 --- a/toolchain/check/testdata/eval/aggregates.carbon +++ b/toolchain/check/testdata/eval/aggregates.carbon @@ -39,7 +39,7 @@ var array_index: array(i32, 1) = (0,) as array(i32, ((5, 7, 1, 9) as array(i32, library "[[@TEST_NAME]]"; // Check that we propagate the `symbolic` tag through evaluations. -fn F(T:! type) { +fn F(T:! Core.Destroy) { //@dump-sem-ir-begin var u: (T*, const T); var v: {.a: T}; @@ -496,54 +496,55 @@ fn G(N:! i32) { // CHECK:STDOUT: --- symbolic.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %T: %Destroy.type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %ptr.79f: type = ptr_type %T [symbolic] -// CHECK:STDOUT: %const: type = const_type %T [symbolic] +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic] +// CHECK:STDOUT: %ptr.8654e8.1: type = ptr_type %T.binding.as_type [symbolic] +// CHECK:STDOUT: %const: type = const_type %T.binding.as_type [symbolic] // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] -// CHECK:STDOUT: %tuple.type.4f2: type = tuple_type (%ptr.79f, %const) [symbolic] -// CHECK:STDOUT: %require_complete.155: = require_complete_type %tuple.type.4f2 [symbolic] -// CHECK:STDOUT: %pattern_type.973: type = pattern_type %tuple.type.4f2 [symbolic] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %T} [symbolic] -// CHECK:STDOUT: %require_complete.28a: = require_complete_type %struct_type.a [symbolic] -// CHECK:STDOUT: %pattern_type.95a: type = pattern_type %struct_type.a [symbolic] +// CHECK:STDOUT: %tuple.type.545: type = tuple_type (%ptr.8654e8.1, %const) [symbolic] +// CHECK:STDOUT: %require_complete.bb7: = require_complete_type %tuple.type.545 [symbolic] +// CHECK:STDOUT: %pattern_type.efb: type = pattern_type %tuple.type.545 [symbolic] +// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %T.binding.as_type} [symbolic] +// CHECK:STDOUT: %require_complete.a7d: = require_complete_type %struct_type.a [symbolic] +// CHECK:STDOUT: %pattern_type.c36: type = pattern_type %struct_type.a [symbolic] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete] -// CHECK:STDOUT: %array_type.ec2: type = array_type %int_5, %T [symbolic] -// CHECK:STDOUT: %ptr.1a0: type = ptr_type %array_type.ec2 [symbolic] -// CHECK:STDOUT: %require_complete.fe1: = require_complete_type %array_type.ec2 [symbolic] -// CHECK:STDOUT: %pattern_type.035: type = pattern_type %array_type.ec2 [symbolic] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %array_type.5a1: type = array_type %int_5, %T.binding.as_type [symbolic] +// CHECK:STDOUT: %ptr.0e5: type = ptr_type %array_type.5a1 [symbolic] +// CHECK:STDOUT: %require_complete.cbd: = require_complete_type %array_type.5a1 [symbolic] +// CHECK:STDOUT: %pattern_type.ebf: type = pattern_type %array_type.5a1 [symbolic] // CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] // CHECK:STDOUT: %type_where: type = facet_type > [concrete] // CHECK:STDOUT: %DestroyT: %type_where = bind_symbolic_name DestroyT, 0 [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%DestroyT) [symbolic] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.544: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d = struct_value () [symbolic] -// CHECK:STDOUT: %facet_value.daa: %type_where = facet_value %array_type.ec2, () [symbolic] -// CHECK:STDOUT: %Destroy.impl_witness.aac: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.daa) [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.26c: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.daa) [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.1fc: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.26c = struct_value () [symbolic] -// CHECK:STDOUT: %require_complete.b09: = require_complete_type %ptr.1a0 [symbolic] -// CHECK:STDOUT: %Destroy.facet.1a3: %Destroy.type = facet_value %array_type.ec2, (%Destroy.impl_witness.aac) [symbolic] -// CHECK:STDOUT: %.0ab: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.1a3 [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.deb: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.1fc, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.daa) [symbolic] -// CHECK:STDOUT: %facet_value.6d7: %type_where = facet_value %struct_type.a, () [symbolic] -// CHECK:STDOUT: %Destroy.impl_witness.aae: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.6d7) [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.fa3: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.6d7) [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.b12: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.fa3 = struct_value () [symbolic] -// CHECK:STDOUT: %ptr.48a: type = ptr_type %struct_type.a [symbolic] -// CHECK:STDOUT: %require_complete.86d: = require_complete_type %ptr.48a [symbolic] -// CHECK:STDOUT: %Destroy.facet.8be: %Destroy.type = facet_value %struct_type.a, (%Destroy.impl_witness.aae) [symbolic] -// CHECK:STDOUT: %.50f: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.8be [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.cc0: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.b12, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.6d7) [symbolic] -// CHECK:STDOUT: %facet_value.2b4: %type_where = facet_value %tuple.type.4f2, () [symbolic] -// CHECK:STDOUT: %Destroy.impl_witness.875: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.2b4) [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.3b6: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.2b4) [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.fb3: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.3b6 = struct_value () [symbolic] -// CHECK:STDOUT: %ptr.6cd: type = ptr_type %tuple.type.4f2 [symbolic] -// CHECK:STDOUT: %require_complete.66e: = require_complete_type %ptr.6cd [symbolic] -// CHECK:STDOUT: %Destroy.facet.4d7: %Destroy.type = facet_value %tuple.type.4f2, (%Destroy.impl_witness.875) [symbolic] -// CHECK:STDOUT: %.b81: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.4d7 [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.a6e: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.fb3, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.2b4) [symbolic] +// CHECK:STDOUT: %facet_value.e8e: %type_where = facet_value %array_type.5a1, () [symbolic] +// CHECK:STDOUT: %Destroy.impl_witness.398: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.e8e) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.7c0: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.e8e) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.644: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.7c0 = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.3fb: = require_complete_type %ptr.0e5 [symbolic] +// CHECK:STDOUT: %Destroy.facet.4dc: %Destroy.type = facet_value %array_type.5a1, (%Destroy.impl_witness.398) [symbolic] +// CHECK:STDOUT: %.491: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.4dc [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.0bb: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.644, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.e8e) [symbolic] +// CHECK:STDOUT: %facet_value.3e2: %type_where = facet_value %struct_type.a, () [symbolic] +// CHECK:STDOUT: %Destroy.impl_witness.982: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.3e2) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.c08: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.3e2) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.996: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.c08 = struct_value () [symbolic] +// CHECK:STDOUT: %ptr.f8a: type = ptr_type %struct_type.a [symbolic] +// CHECK:STDOUT: %require_complete.ff9: = require_complete_type %ptr.f8a [symbolic] +// CHECK:STDOUT: %Destroy.facet.ec7: %Destroy.type = facet_value %struct_type.a, (%Destroy.impl_witness.982) [symbolic] +// CHECK:STDOUT: %.8bc: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.ec7 [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.977: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.996, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.3e2) [symbolic] +// CHECK:STDOUT: %facet_value.769: %type_where = facet_value %tuple.type.545, () [symbolic] +// CHECK:STDOUT: %Destroy.impl_witness.a5e: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.769) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.4ad: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.769) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.2b6: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.4ad = struct_value () [symbolic] +// CHECK:STDOUT: %ptr.f48: type = ptr_type %tuple.type.545 [symbolic] +// CHECK:STDOUT: %require_complete.6c4: = require_complete_type %ptr.f48 [symbolic] +// CHECK:STDOUT: %Destroy.facet.ae5: %Destroy.type = facet_value %tuple.type.545, (%Destroy.impl_witness.a5e) [symbolic] +// CHECK:STDOUT: %.827: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.ae5 [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1f8: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.2b6, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.769) [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %N.51e: %i32 = bind_symbolic_name N, 0 [symbolic] @@ -582,109 +583,118 @@ fn G(N:! i32) { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.e99 = impl_witness_table (%Core.import_ref.25c), @Int.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%T.loc4_6.2: type) { +// CHECK:STDOUT: generic fn @F(%T.loc4_6.2: %Destroy.type) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ptr.loc6_12.2: type = ptr_type %T.loc4_6.1 [symbolic = %ptr.loc6_12.2 (constants.%ptr.79f)] -// CHECK:STDOUT: %const.loc6_15.2: type = const_type %T.loc4_6.1 [symbolic = %const.loc6_15.2 (constants.%const)] -// CHECK:STDOUT: %tuple.type: type = tuple_type (%ptr.loc6_12.2, %const.loc6_15.2) [symbolic = %tuple.type (constants.%tuple.type.4f2)] -// CHECK:STDOUT: %require_complete.loc6_22: = require_complete_type %tuple.type [symbolic = %require_complete.loc6_22 (constants.%require_complete.155)] -// CHECK:STDOUT: %pattern_type.loc6: type = pattern_type %tuple.type [symbolic = %pattern_type.loc6 (constants.%pattern_type.973)] -// CHECK:STDOUT: %struct_type.a.loc7_16.2: type = struct_type {.a: @F.%T.loc4_6.1 (%T)} [symbolic = %struct_type.a.loc7_16.2 (constants.%struct_type.a)] -// CHECK:STDOUT: %require_complete.loc7_16: = require_complete_type %struct_type.a.loc7_16.2 [symbolic = %require_complete.loc7_16 (constants.%require_complete.28a)] -// CHECK:STDOUT: %pattern_type.loc7: type = pattern_type %struct_type.a.loc7_16.2 [symbolic = %pattern_type.loc7 (constants.%pattern_type.95a)] -// CHECK:STDOUT: %array_type.loc8_20.2: type = array_type constants.%int_5, %T.loc4_6.1 [symbolic = %array_type.loc8_20.2 (constants.%array_type.ec2)] -// CHECK:STDOUT: %require_complete.loc8_20: = require_complete_type %array_type.loc8_20.2 [symbolic = %require_complete.loc8_20 (constants.%require_complete.fe1)] -// CHECK:STDOUT: %pattern_type.loc8: type = pattern_type %array_type.loc8_20.2 [symbolic = %pattern_type.loc8 (constants.%pattern_type.035)] -// CHECK:STDOUT: %facet_value.loc8_3.2: %type_where = facet_value %array_type.loc8_20.2, () [symbolic = %facet_value.loc8_3.2 (constants.%facet_value.daa)] -// CHECK:STDOUT: %Destroy.impl_witness.loc8: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc8_3.2) [symbolic = %Destroy.impl_witness.loc8 (constants.%Destroy.impl_witness.aac)] -// CHECK:STDOUT: %Destroy.facet.loc8: %Destroy.type = facet_value %array_type.loc8_20.2, (%Destroy.impl_witness.loc8) [symbolic = %Destroy.facet.loc8 (constants.%Destroy.facet.1a3)] -// CHECK:STDOUT: %.loc8_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet.loc8 [symbolic = %.loc8_3.2 (constants.%.0ab)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc8: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc8_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc8 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.26c)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.loc8: @F.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc8 (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.26c) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc8 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.1fc)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc8: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.loc8, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc8_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc8 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.deb)] -// CHECK:STDOUT: %ptr.loc8: type = ptr_type %array_type.loc8_20.2 [symbolic = %ptr.loc8 (constants.%ptr.1a0)] -// CHECK:STDOUT: %require_complete.loc8_3: = require_complete_type %ptr.loc8 [symbolic = %require_complete.loc8_3 (constants.%require_complete.b09)] -// CHECK:STDOUT: %facet_value.loc7_3.2: %type_where = facet_value %struct_type.a.loc7_16.2, () [symbolic = %facet_value.loc7_3.2 (constants.%facet_value.6d7)] -// CHECK:STDOUT: %Destroy.impl_witness.loc7: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc7_3.2) [symbolic = %Destroy.impl_witness.loc7 (constants.%Destroy.impl_witness.aae)] -// CHECK:STDOUT: %Destroy.facet.loc7: %Destroy.type = facet_value %struct_type.a.loc7_16.2, (%Destroy.impl_witness.loc7) [symbolic = %Destroy.facet.loc7 (constants.%Destroy.facet.8be)] -// CHECK:STDOUT: %.loc7_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet.loc7 [symbolic = %.loc7_3.2 (constants.%.50f)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc7: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc7_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc7 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.fa3)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.loc7: @F.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc7 (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.fa3) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc7 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.b12)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc7: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.loc7, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc7_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc7 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.cc0)] -// CHECK:STDOUT: %ptr.loc7: type = ptr_type %struct_type.a.loc7_16.2 [symbolic = %ptr.loc7 (constants.%ptr.48a)] -// CHECK:STDOUT: %require_complete.loc7_3: = require_complete_type %ptr.loc7 [symbolic = %require_complete.loc7_3 (constants.%require_complete.86d)] -// CHECK:STDOUT: %facet_value.loc6_3.2: %type_where = facet_value %tuple.type, () [symbolic = %facet_value.loc6_3.2 (constants.%facet_value.2b4)] -// CHECK:STDOUT: %Destroy.impl_witness.loc6: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc6_3.2) [symbolic = %Destroy.impl_witness.loc6 (constants.%Destroy.impl_witness.875)] -// CHECK:STDOUT: %Destroy.facet.loc6: %Destroy.type = facet_value %tuple.type, (%Destroy.impl_witness.loc6) [symbolic = %Destroy.facet.loc6 (constants.%Destroy.facet.4d7)] -// CHECK:STDOUT: %.loc6_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet.loc6 [symbolic = %.loc6_3.2 (constants.%.b81)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc6: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc6_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc6 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.3b6)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.loc6: @F.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc6 (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.3b6) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc6 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.fb3)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc6: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.loc6, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc6_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc6 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.a6e)] -// CHECK:STDOUT: %ptr.loc6_3: type = ptr_type %tuple.type [symbolic = %ptr.loc6_3 (constants.%ptr.6cd)] -// CHECK:STDOUT: %require_complete.loc6_3: = require_complete_type %ptr.loc6_3 [symbolic = %require_complete.loc6_3 (constants.%require_complete.66e)] +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc4_6.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %ptr.loc6_12.2: type = ptr_type %T.binding.as_type [symbolic = %ptr.loc6_12.2 (constants.%ptr.8654e8.1)] +// CHECK:STDOUT: %const.loc6_15.2: type = const_type %T.binding.as_type [symbolic = %const.loc6_15.2 (constants.%const)] +// CHECK:STDOUT: %tuple.type: type = tuple_type (%ptr.loc6_12.2, %const.loc6_15.2) [symbolic = %tuple.type (constants.%tuple.type.545)] +// CHECK:STDOUT: %require_complete.loc6_22: = require_complete_type %tuple.type [symbolic = %require_complete.loc6_22 (constants.%require_complete.bb7)] +// CHECK:STDOUT: %pattern_type.loc6: type = pattern_type %tuple.type [symbolic = %pattern_type.loc6 (constants.%pattern_type.efb)] +// CHECK:STDOUT: %struct_type.a.loc7_16.2: type = struct_type {.a: @F.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc7_16.2 (constants.%struct_type.a)] +// CHECK:STDOUT: %require_complete.loc7_16: = require_complete_type %struct_type.a.loc7_16.2 [symbolic = %require_complete.loc7_16 (constants.%require_complete.a7d)] +// CHECK:STDOUT: %pattern_type.loc7: type = pattern_type %struct_type.a.loc7_16.2 [symbolic = %pattern_type.loc7 (constants.%pattern_type.c36)] +// CHECK:STDOUT: %array_type.loc8_20.2: type = array_type constants.%int_5, %T.binding.as_type [symbolic = %array_type.loc8_20.2 (constants.%array_type.5a1)] +// CHECK:STDOUT: %require_complete.loc8_20: = require_complete_type %array_type.loc8_20.2 [symbolic = %require_complete.loc8_20 (constants.%require_complete.cbd)] +// CHECK:STDOUT: %pattern_type.loc8: type = pattern_type %array_type.loc8_20.2 [symbolic = %pattern_type.loc8 (constants.%pattern_type.ebf)] +// CHECK:STDOUT: %facet_value.loc8_3.2: %type_where = facet_value %array_type.loc8_20.2, () [symbolic = %facet_value.loc8_3.2 (constants.%facet_value.e8e)] +// CHECK:STDOUT: %Destroy.impl_witness.loc8: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc8_3.2) [symbolic = %Destroy.impl_witness.loc8 (constants.%Destroy.impl_witness.398)] +// CHECK:STDOUT: %Destroy.facet.loc8: %Destroy.type = facet_value %array_type.loc8_20.2, (%Destroy.impl_witness.loc8) [symbolic = %Destroy.facet.loc8 (constants.%Destroy.facet.4dc)] +// CHECK:STDOUT: %.loc8_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet.loc8 [symbolic = %.loc8_3.2 (constants.%.491)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc8: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc8_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc8 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.7c0)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.loc8: @F.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc8 (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.7c0) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc8 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.644)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc8: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.loc8, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc8_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc8 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.0bb)] +// CHECK:STDOUT: %ptr.loc8: type = ptr_type %array_type.loc8_20.2 [symbolic = %ptr.loc8 (constants.%ptr.0e5)] +// CHECK:STDOUT: %require_complete.loc8_3: = require_complete_type %ptr.loc8 [symbolic = %require_complete.loc8_3 (constants.%require_complete.3fb)] +// CHECK:STDOUT: %facet_value.loc7_3.2: %type_where = facet_value %struct_type.a.loc7_16.2, () [symbolic = %facet_value.loc7_3.2 (constants.%facet_value.3e2)] +// CHECK:STDOUT: %Destroy.impl_witness.loc7: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc7_3.2) [symbolic = %Destroy.impl_witness.loc7 (constants.%Destroy.impl_witness.982)] +// CHECK:STDOUT: %Destroy.facet.loc7: %Destroy.type = facet_value %struct_type.a.loc7_16.2, (%Destroy.impl_witness.loc7) [symbolic = %Destroy.facet.loc7 (constants.%Destroy.facet.ec7)] +// CHECK:STDOUT: %.loc7_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet.loc7 [symbolic = %.loc7_3.2 (constants.%.8bc)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc7: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc7_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc7 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.c08)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.loc7: @F.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc7 (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.c08) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc7 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.996)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc7: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.loc7, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc7_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc7 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.977)] +// CHECK:STDOUT: %ptr.loc7: type = ptr_type %struct_type.a.loc7_16.2 [symbolic = %ptr.loc7 (constants.%ptr.f8a)] +// CHECK:STDOUT: %require_complete.loc7_3: = require_complete_type %ptr.loc7 [symbolic = %require_complete.loc7_3 (constants.%require_complete.ff9)] +// CHECK:STDOUT: %facet_value.loc6_3.2: %type_where = facet_value %tuple.type, () [symbolic = %facet_value.loc6_3.2 (constants.%facet_value.769)] +// CHECK:STDOUT: %Destroy.impl_witness.loc6: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc6_3.2) [symbolic = %Destroy.impl_witness.loc6 (constants.%Destroy.impl_witness.a5e)] +// CHECK:STDOUT: %Destroy.facet.loc6: %Destroy.type = facet_value %tuple.type, (%Destroy.impl_witness.loc6) [symbolic = %Destroy.facet.loc6 (constants.%Destroy.facet.ae5)] +// CHECK:STDOUT: %.loc6_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet.loc6 [symbolic = %.loc6_3.2 (constants.%.827)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc6: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc6_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc6 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.4ad)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.loc6: @F.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.loc6 (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.4ad) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc6 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.2b6)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc6: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.loc6, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc6_3.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc6 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1f8)] +// CHECK:STDOUT: %ptr.loc6_3: type = ptr_type %tuple.type [symbolic = %ptr.loc6_3 (constants.%ptr.f48)] +// CHECK:STDOUT: %require_complete.loc6_3: = require_complete_type %ptr.loc6_3 [symbolic = %require_complete.loc6_3 (constants.%require_complete.6c4)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %u.patt: @F.%pattern_type.loc6 (%pattern_type.973) = binding_pattern u [concrete] -// CHECK:STDOUT: %u.var_patt: @F.%pattern_type.loc6 (%pattern_type.973) = var_pattern %u.patt [concrete] +// CHECK:STDOUT: %u.patt: @F.%pattern_type.loc6 (%pattern_type.efb) = binding_pattern u [concrete] +// CHECK:STDOUT: %u.var_patt: @F.%pattern_type.loc6 (%pattern_type.efb) = var_pattern %u.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %u.var: ref @F.%tuple.type (%tuple.type.4f2) = var %u.var_patt -// CHECK:STDOUT: %.loc6_22.1: type = splice_block %.loc6_22.3 [symbolic = %tuple.type (constants.%tuple.type.4f2)] { -// CHECK:STDOUT: %T.ref.loc6_11: type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] -// CHECK:STDOUT: %ptr.loc6_12.1: type = ptr_type %T.ref.loc6_11 [symbolic = %ptr.loc6_12.2 (constants.%ptr.79f)] -// CHECK:STDOUT: %T.ref.loc6_21: type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] -// CHECK:STDOUT: %const.loc6_15.1: type = const_type %T.ref.loc6_21 [symbolic = %const.loc6_15.2 (constants.%const)] +// CHECK:STDOUT: %u.var: ref @F.%tuple.type (%tuple.type.545) = var %u.var_patt +// CHECK:STDOUT: %.loc6_22.1: type = splice_block %.loc6_22.3 [symbolic = %tuple.type (constants.%tuple.type.545)] { +// CHECK:STDOUT: %T.ref.loc6_11: %Destroy.type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] +// CHECK:STDOUT: %T.as_type.loc6_12: type = facet_access_type %T.ref.loc6_11 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc6_12: type = converted %T.ref.loc6_11, %T.as_type.loc6_12 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %ptr.loc6_12.1: type = ptr_type %.loc6_12 [symbolic = %ptr.loc6_12.2 (constants.%ptr.8654e8.1)] +// CHECK:STDOUT: %T.ref.loc6_21: %Destroy.type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] +// CHECK:STDOUT: %T.as_type.loc6_15: type = facet_access_type %T.ref.loc6_21 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc6_15: type = converted %T.ref.loc6_21, %T.as_type.loc6_15 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %const.loc6_15.1: type = const_type %.loc6_15 [symbolic = %const.loc6_15.2 (constants.%const)] // CHECK:STDOUT: %.loc6_22.2: %tuple.type.24b = tuple_literal (%ptr.loc6_12.1, %const.loc6_15.1) -// CHECK:STDOUT: %.loc6_22.3: type = converted %.loc6_22.2, constants.%tuple.type.4f2 [symbolic = %tuple.type (constants.%tuple.type.4f2)] +// CHECK:STDOUT: %.loc6_22.3: type = converted %.loc6_22.2, constants.%tuple.type.545 [symbolic = %tuple.type (constants.%tuple.type.545)] // CHECK:STDOUT: } -// CHECK:STDOUT: %u: ref @F.%tuple.type (%tuple.type.4f2) = bind_name u, %u.var +// CHECK:STDOUT: %u: ref @F.%tuple.type (%tuple.type.545) = bind_name u, %u.var // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %v.patt: @F.%pattern_type.loc7 (%pattern_type.95a) = binding_pattern v [concrete] -// CHECK:STDOUT: %v.var_patt: @F.%pattern_type.loc7 (%pattern_type.95a) = var_pattern %v.patt [concrete] +// CHECK:STDOUT: %v.patt: @F.%pattern_type.loc7 (%pattern_type.c36) = binding_pattern v [concrete] +// CHECK:STDOUT: %v.var_patt: @F.%pattern_type.loc7 (%pattern_type.c36) = var_pattern %v.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref @F.%struct_type.a.loc7_16.2 (%struct_type.a) = var %v.var_patt // CHECK:STDOUT: %.loc7_16: type = splice_block %struct_type.a.loc7_16.1 [symbolic = %struct_type.a.loc7_16.2 (constants.%struct_type.a)] { -// CHECK:STDOUT: %T.ref.loc7: type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] -// CHECK:STDOUT: %struct_type.a.loc7_16.1: type = struct_type {.a: @F.%T.loc4_6.1 (%T)} [symbolic = %struct_type.a.loc7_16.2 (constants.%struct_type.a)] +// CHECK:STDOUT: %T.ref.loc7: %Destroy.type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] +// CHECK:STDOUT: %T.as_type.loc7: type = facet_access_type %T.ref.loc7 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc7_15: type = converted %T.ref.loc7, %T.as_type.loc7 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %struct_type.a.loc7_16.1: type = struct_type {.a: @F.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc7_16.2 (constants.%struct_type.a)] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref @F.%struct_type.a.loc7_16.2 (%struct_type.a) = bind_name v, %v.var // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %w.patt: @F.%pattern_type.loc8 (%pattern_type.035) = binding_pattern w [concrete] -// CHECK:STDOUT: %w.var_patt: @F.%pattern_type.loc8 (%pattern_type.035) = var_pattern %w.patt [concrete] +// CHECK:STDOUT: %w.patt: @F.%pattern_type.loc8 (%pattern_type.ebf) = binding_pattern w [concrete] +// CHECK:STDOUT: %w.var_patt: @F.%pattern_type.loc8 (%pattern_type.ebf) = var_pattern %w.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %w.var: ref @F.%array_type.loc8_20.2 (%array_type.ec2) = var %w.var_patt -// CHECK:STDOUT: %.loc8_20: type = splice_block %array_type.loc8_20.1 [symbolic = %array_type.loc8_20.2 (constants.%array_type.ec2)] { -// CHECK:STDOUT: %T.ref.loc8: type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] +// CHECK:STDOUT: %w.var: ref @F.%array_type.loc8_20.2 (%array_type.5a1) = var %w.var_patt +// CHECK:STDOUT: %.loc8_20: type = splice_block %array_type.loc8_20.1 [symbolic = %array_type.loc8_20.2 (constants.%array_type.5a1)] { +// CHECK:STDOUT: %T.ref.loc8: %Destroy.type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5] -// CHECK:STDOUT: %array_type.loc8_20.1: type = array_type %int_5, %T.ref.loc8 [symbolic = %array_type.loc8_20.2 (constants.%array_type.ec2)] +// CHECK:STDOUT: %T.as_type.loc8: type = facet_access_type %T.ref.loc8 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc8_16: type = converted %T.ref.loc8, %T.as_type.loc8 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %array_type.loc8_20.1: type = array_type %int_5, %.loc8_16 [symbolic = %array_type.loc8_20.2 (constants.%array_type.5a1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %w: ref @F.%array_type.loc8_20.2 (%array_type.ec2) = bind_name w, %w.var -// CHECK:STDOUT: %facet_value.loc8_3.1: %type_where = facet_value constants.%array_type.ec2, () [symbolic = %facet_value.loc8_3.2 (constants.%facet_value.daa)] -// CHECK:STDOUT: %.loc8_3.1: %type_where = converted constants.%array_type.ec2, %facet_value.loc8_3.1 [symbolic = %facet_value.loc8_3.2 (constants.%facet_value.daa)] -// CHECK:STDOUT: %impl.elem0.loc8: @F.%.loc8_3.2 (%.0ab) = impl_witness_access constants.%Destroy.impl_witness.aac, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc8 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.1fc)] +// CHECK:STDOUT: %w: ref @F.%array_type.loc8_20.2 (%array_type.5a1) = bind_name w, %w.var +// CHECK:STDOUT: %facet_value.loc8_3.1: %type_where = facet_value constants.%array_type.5a1, () [symbolic = %facet_value.loc8_3.2 (constants.%facet_value.e8e)] +// CHECK:STDOUT: %.loc8_3.1: %type_where = converted constants.%array_type.5a1, %facet_value.loc8_3.1 [symbolic = %facet_value.loc8_3.2 (constants.%facet_value.e8e)] +// CHECK:STDOUT: %impl.elem0.loc8: @F.%.loc8_3.2 (%.491) = impl_witness_access constants.%Destroy.impl_witness.398, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc8 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.644)] // CHECK:STDOUT: %bound_method.loc8_3.1: = bound_method %w.var, %impl.elem0.loc8 -// CHECK:STDOUT: %specific_fn.loc8: = specific_function %impl.elem0.loc8, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.daa) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc8 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.deb)] +// CHECK:STDOUT: %specific_fn.loc8: = specific_function %impl.elem0.loc8, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.e8e) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc8 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.0bb)] // CHECK:STDOUT: %bound_method.loc8_3.2: = bound_method %w.var, %specific_fn.loc8 -// CHECK:STDOUT: %addr.loc8: @F.%ptr.loc8 (%ptr.1a0) = addr_of %w.var +// CHECK:STDOUT: %addr.loc8: @F.%ptr.loc8 (%ptr.0e5) = addr_of %w.var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8_3.2(%addr.loc8) -// CHECK:STDOUT: %facet_value.loc7_3.1: %type_where = facet_value constants.%struct_type.a, () [symbolic = %facet_value.loc7_3.2 (constants.%facet_value.6d7)] -// CHECK:STDOUT: %.loc7_3.1: %type_where = converted constants.%struct_type.a, %facet_value.loc7_3.1 [symbolic = %facet_value.loc7_3.2 (constants.%facet_value.6d7)] -// CHECK:STDOUT: %impl.elem0.loc7: @F.%.loc7_3.2 (%.50f) = impl_witness_access constants.%Destroy.impl_witness.aae, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc7 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.b12)] +// CHECK:STDOUT: %facet_value.loc7_3.1: %type_where = facet_value constants.%struct_type.a, () [symbolic = %facet_value.loc7_3.2 (constants.%facet_value.3e2)] +// CHECK:STDOUT: %.loc7_3.1: %type_where = converted constants.%struct_type.a, %facet_value.loc7_3.1 [symbolic = %facet_value.loc7_3.2 (constants.%facet_value.3e2)] +// CHECK:STDOUT: %impl.elem0.loc7: @F.%.loc7_3.2 (%.8bc) = impl_witness_access constants.%Destroy.impl_witness.982, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc7 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.996)] // CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %v.var, %impl.elem0.loc7 -// CHECK:STDOUT: %specific_fn.loc7: = specific_function %impl.elem0.loc7, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.6d7) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc7 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.cc0)] +// CHECK:STDOUT: %specific_fn.loc7: = specific_function %impl.elem0.loc7, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.3e2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc7 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.977)] // CHECK:STDOUT: %bound_method.loc7_3.2: = bound_method %v.var, %specific_fn.loc7 -// CHECK:STDOUT: %addr.loc7: @F.%ptr.loc7 (%ptr.48a) = addr_of %v.var +// CHECK:STDOUT: %addr.loc7: @F.%ptr.loc7 (%ptr.f8a) = addr_of %v.var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc7: init %empty_tuple.type = call %bound_method.loc7_3.2(%addr.loc7) -// CHECK:STDOUT: %facet_value.loc6_3.1: %type_where = facet_value constants.%tuple.type.4f2, () [symbolic = %facet_value.loc6_3.2 (constants.%facet_value.2b4)] -// CHECK:STDOUT: %.loc6_3.1: %type_where = converted constants.%tuple.type.4f2, %facet_value.loc6_3.1 [symbolic = %facet_value.loc6_3.2 (constants.%facet_value.2b4)] -// CHECK:STDOUT: %impl.elem0.loc6: @F.%.loc6_3.2 (%.b81) = impl_witness_access constants.%Destroy.impl_witness.875, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc6 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.fb3)] +// CHECK:STDOUT: %facet_value.loc6_3.1: %type_where = facet_value constants.%tuple.type.545, () [symbolic = %facet_value.loc6_3.2 (constants.%facet_value.769)] +// CHECK:STDOUT: %.loc6_3.1: %type_where = converted constants.%tuple.type.545, %facet_value.loc6_3.1 [symbolic = %facet_value.loc6_3.2 (constants.%facet_value.769)] +// CHECK:STDOUT: %impl.elem0.loc6: @F.%.loc6_3.2 (%.827) = impl_witness_access constants.%Destroy.impl_witness.a5e, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.loc6 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.2b6)] // CHECK:STDOUT: %bound_method.loc6_3.1: = bound_method %u.var, %impl.elem0.loc6 -// CHECK:STDOUT: %specific_fn.loc6: = specific_function %impl.elem0.loc6, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.2b4) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc6 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.a6e)] +// CHECK:STDOUT: %specific_fn.loc6: = specific_function %impl.elem0.loc6, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.769) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc6 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1f8)] // CHECK:STDOUT: %bound_method.loc6_3.2: = bound_method %u.var, %specific_fn.loc6 -// CHECK:STDOUT: %addr.loc6: @F.%ptr.loc6_3 (%ptr.6cd) = addr_of %u.var +// CHECK:STDOUT: %addr.loc6: @F.%ptr.loc6_3 (%ptr.f48) = addr_of %u.var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc6: init %empty_tuple.type = call %bound_method.loc6_3.2(%addr.loc6) // CHECK:STDOUT: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/for/actual.carbon b/toolchain/check/testdata/for/actual.carbon index a7c257806c01c..7ea16d0cbee64 100644 --- a/toolchain/check/testdata/for/actual.carbon +++ b/toolchain/check/testdata/for/actual.carbon @@ -77,46 +77,57 @@ fn Read() { // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self.adc [symbolic_self] // CHECK:STDOUT: %Iterate.lookup_impl_witness.106: = lookup_impl_witness %.Self.adc, @Iterate [symbolic_self] // CHECK:STDOUT: %impl.elem1.1c0: type = impl_witness_access %Iterate.lookup_impl_witness.106, element1 [symbolic_self] -// CHECK:STDOUT: %assoc0.0f6: %Iterate.assoc_type = assoc_entity element0, imports.%Core.import_ref.61e [concrete] +// CHECK:STDOUT: %assoc0.32e: %Iterate.assoc_type = assoc_entity element0, imports.%Core.import_ref.dc2 [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] -// CHECK:STDOUT: %impl.elem0.5f7: %Copy.type = impl_witness_access %Iterate.lookup_impl_witness.106, element0 [symbolic_self] -// CHECK:STDOUT: %T.be8: %Copy.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %facet_type: type = facet_type <@Destroy & @Copy> [concrete] +// CHECK:STDOUT: %impl.elem0.76a: %facet_type = impl_witness_access %Iterate.lookup_impl_witness.106, element0 [symbolic_self] +// CHECK:STDOUT: %type_where: type = facet_type > [concrete] +// CHECK:STDOUT: %DestroyT: %type_where = bind_symbolic_name DestroyT, 0 [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%DestroyT) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.544: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d = struct_value () [symbolic] +// CHECK:STDOUT: %facet_value.818: %type_where = facet_value %Int.49d0e6.1, () [symbolic] +// CHECK:STDOUT: %Destroy.impl_witness.47b: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.818) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.c3b: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.818) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.db2: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.c3b = struct_value () [symbolic] +// CHECK:STDOUT: %ptr.784: type = ptr_type %Int.49d0e6.1 [symbolic] +// CHECK:STDOUT: %require_complete.0f5: = require_complete_type %ptr.784 [symbolic] // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.afd: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] // CHECK:STDOUT: %Int.as.Copy.impl.Op.6cd: %Int.as.Copy.impl.Op.type.afd = struct_value () [symbolic] // CHECK:STDOUT: %require_complete.b4f426.1: = require_complete_type %Int.49d0e6.1 [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.ccc: = lookup_impl_witness %Int.49d0e6.1, @Copy [symbolic] -// CHECK:STDOUT: %Copy.facet.cd7: %Copy.type = facet_value %Int.49d0e6.1, (%Copy.lookup_impl_witness.ccc) [symbolic] -// CHECK:STDOUT: %Iterate_where.type: type = facet_type <@Iterate where %impl.elem1.1c0 = %Int.49d0e6.1 and %impl.elem0.5f7 = %Copy.facet.cd7> [symbolic] -// CHECK:STDOUT: %require_complete.c0e: = require_complete_type %Iterate_where.type [symbolic] +// CHECK:STDOUT: %facet_value.cbf: %facet_type = facet_value %Int.49d0e6.1, (%Destroy.impl_witness.47b, %Copy.lookup_impl_witness.ccc) [symbolic] +// CHECK:STDOUT: %Iterate_where.type: type = facet_type <@Iterate where %impl.elem1.1c0 = %Int.49d0e6.1 and %impl.elem0.76a = %facet_value.cbf> [symbolic] +// CHECK:STDOUT: %require_complete.e0d: = require_complete_type %Iterate_where.type [symbolic] // CHECK:STDOUT: %Optional.type: type = generic_class_type @Optional [concrete] // CHECK:STDOUT: %Optional.generic: %Optional.type = struct_value () [concrete] -// CHECK:STDOUT: %Optional.None.type.3df: type = fn_type @Optional.None, @Optional(%T.be8) [symbolic] -// CHECK:STDOUT: %Optional.None.321: %Optional.None.type.3df = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.Some.type.48a: type = fn_type @Optional.Some, @Optional(%T.be8) [symbolic] -// CHECK:STDOUT: %Optional.Some.a29: %Optional.Some.type.48a = struct_value () [symbolic] +// CHECK:STDOUT: %T.4b8: %facet_type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %Optional.None.type.83a: type = fn_type @Optional.None, @Optional(%T.4b8) [symbolic] +// CHECK:STDOUT: %Optional.None.ca1: %Optional.None.type.83a = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.Some.type.faf: type = fn_type @Optional.Some, @Optional(%T.4b8) [symbolic] +// CHECK:STDOUT: %Optional.Some.59b: %Optional.Some.type.faf = struct_value () [symbolic] // CHECK:STDOUT: %Iterate.impl_witness: = impl_witness @IntRange.%Iterate.impl_witness_table, @IntRange.as.Iterate.impl(%N) [symbolic] // CHECK:STDOUT: %IntRange.as.Iterate.impl.NewCursor.type: type = fn_type @IntRange.as.Iterate.impl.NewCursor, @IntRange.as.Iterate.impl(%N) [symbolic] // CHECK:STDOUT: %IntRange.as.Iterate.impl.NewCursor: %IntRange.as.Iterate.impl.NewCursor.type = struct_value () [symbolic] -// CHECK:STDOUT: %ptr.784: type = ptr_type %Int.49d0e6.1 [symbolic] // CHECK:STDOUT: %pattern_type.4dc: type = pattern_type %ptr.784 [symbolic] -// CHECK:STDOUT: %Optional.671: type = class_type @Optional, @Optional(%Copy.facet.cd7) [symbolic] -// CHECK:STDOUT: %pattern_type.ff2: type = pattern_type %Optional.671 [symbolic] +// CHECK:STDOUT: %Optional.ef0: type = class_type @Optional, @Optional(%facet_value.cbf) [symbolic] +// CHECK:STDOUT: %pattern_type.932: type = pattern_type %Optional.ef0 [symbolic] // CHECK:STDOUT: %IntRange.as.Iterate.impl.Next.type: type = fn_type @IntRange.as.Iterate.impl.Next, @IntRange.as.Iterate.impl(%N) [symbolic] // CHECK:STDOUT: %IntRange.as.Iterate.impl.Next: %IntRange.as.Iterate.impl.Next.type = struct_value () [symbolic] // CHECK:STDOUT: %IntRange.elem.e7c: type = unbound_element_type %IntRange.349, %Int.49d0e6.1 [symbolic] // CHECK:STDOUT: %struct_type.start.end.78d: type = struct_type {.start: %Int.49d0e6.1, .end: %Int.49d0e6.1} [symbolic] // CHECK:STDOUT: %complete_type.9d5: = complete_type_witness %struct_type.start.end.78d [symbolic] // CHECK:STDOUT: %require_complete.524: = require_complete_type %IntRange.349 [symbolic] +// CHECK:STDOUT: %Copy.facet.cd7: %Copy.type = facet_value %Int.49d0e6.1, (%Copy.lookup_impl_witness.ccc) [symbolic] // CHECK:STDOUT: %.8f7: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.cd7 [symbolic] // CHECK:STDOUT: %impl.elem0.840: %.8f7 = impl_witness_access %Copy.lookup_impl_witness.ccc, element0 [symbolic] // CHECK:STDOUT: %specific_impl_fn.70b: = specific_impl_function %impl.elem0.840, @Copy.Op(%Copy.facet.cd7) [symbolic] -// CHECK:STDOUT: %Optional.None.type.66e: type = fn_type @Optional.None, @Optional(%Copy.facet.cd7) [symbolic] -// CHECK:STDOUT: %Optional.None.016: %Optional.None.type.66e = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.Some.type.20f: type = fn_type @Optional.Some, @Optional(%Copy.facet.cd7) [symbolic] -// CHECK:STDOUT: %Optional.Some.dff: %Optional.Some.type.20f = struct_value () [symbolic] -// CHECK:STDOUT: %require_complete.380: = require_complete_type %Optional.671 [symbolic] -// CHECK:STDOUT: %require_complete.0f5: = require_complete_type %ptr.784 [symbolic] +// CHECK:STDOUT: %Optional.None.type.38b: type = fn_type @Optional.None, @Optional(%facet_value.cbf) [symbolic] +// CHECK:STDOUT: %Optional.None.fd7: %Optional.None.type.38b = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.Some.type.9ca: type = fn_type @Optional.Some, @Optional(%facet_value.cbf) [symbolic] +// CHECK:STDOUT: %Optional.Some.1b1: %Optional.Some.type.9ca = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.288: = require_complete_type %Optional.ef0 [symbolic] // CHECK:STDOUT: %OrderedWith.type.270: type = generic_interface_type @OrderedWith [concrete] // CHECK:STDOUT: %OrderedWith.generic: %OrderedWith.type.270 = struct_value () [concrete] // CHECK:STDOUT: %Other: type = bind_symbolic_name Other, 0 [symbolic] @@ -126,7 +137,7 @@ fn Read() { // CHECK:STDOUT: %OrderedWith.type.389: type = facet_type <@OrderedWith, @OrderedWith(%Int.49d0e6.1)> [symbolic] // CHECK:STDOUT: %OrderedWith.Less.type.8fe: type = fn_type @OrderedWith.Less, @OrderedWith(%Int.49d0e6.1) [symbolic] // CHECK:STDOUT: %OrderedWith.assoc_type.d92: type = assoc_entity_type @OrderedWith, @OrderedWith(%Int.49d0e6.1) [symbolic] -// CHECK:STDOUT: %assoc0.2ae: %OrderedWith.assoc_type.d92 = assoc_entity element0, imports.%Core.import_ref.9108 [symbolic] +// CHECK:STDOUT: %assoc0.2ae: %OrderedWith.assoc_type.d92 = assoc_entity element0, imports.%Core.import_ref.910 [symbolic] // CHECK:STDOUT: %require_complete.1fb: = require_complete_type %OrderedWith.type.389 [symbolic] // CHECK:STDOUT: %assoc0.3c6: %OrderedWith.assoc_type.03c = assoc_entity element0, imports.%Core.import_ref.146ebd.1 [symbolic] // CHECK:STDOUT: %M: Core.IntLiteral = bind_symbolic_name M, 1 [symbolic] @@ -147,21 +158,12 @@ fn Read() { // CHECK:STDOUT: %.941: type = fn_type_with_self_type %Inc.Op.type, %Inc.facet [symbolic] // CHECK:STDOUT: %impl.elem0.bca: %.941 = impl_witness_access %Inc.lookup_impl_witness, element0 [symbolic] // CHECK:STDOUT: %specific_impl_fn.989: = specific_impl_function %impl.elem0.bca, @Inc.Op(%Inc.facet) [symbolic] -// CHECK:STDOUT: %Optional.Some.specific_fn: = specific_function %Optional.Some.dff, @Optional.Some(%Copy.facet.cd7) [symbolic] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %Optional.Some.specific_fn: = specific_function %Optional.Some.1b1, @Optional.Some(%facet_value.cbf) [symbolic] // CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %type_where: type = facet_type > [concrete] -// CHECK:STDOUT: %DestroyT: %type_where = bind_symbolic_name DestroyT, 0 [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%DestroyT) [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.544: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d = struct_value () [symbolic] -// CHECK:STDOUT: %facet_value: %type_where = facet_value %Int.49d0e6.1, () [symbolic] -// CHECK:STDOUT: %Destroy.impl_witness.47b: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.c3b: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.db2: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.c3b = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Int.49d0e6.1, (%Destroy.impl_witness.47b) [symbolic] // CHECK:STDOUT: %.944: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.db2, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic] -// CHECK:STDOUT: %Optional.None.specific_fn: = specific_function %Optional.None.016, @Optional.None(%Copy.facet.cd7) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.db2, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.818) [symbolic] +// CHECK:STDOUT: %Optional.None.specific_fn: = specific_function %Optional.None.fd7, @Optional.None(%facet_value.cbf) [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] @@ -217,21 +219,23 @@ fn Read() { // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Iterate: type = import_ref Core//prelude/iterate, Iterate, loaded [concrete = constants.%Iterate.type] -// CHECK:STDOUT: %Core.import_ref.119: %Iterate.assoc_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc0.0f6] +// CHECK:STDOUT: %Core.import_ref.944: %Iterate.assoc_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc0.32e] // CHECK:STDOUT: %Core.import_ref.ed6: %Iterate.assoc_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc1.02e] // CHECK:STDOUT: %Core.import_ref.9e6: type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = %CursorType] // CHECK:STDOUT: %CursorType: type = assoc_const_decl @CursorType [concrete] {} -// CHECK:STDOUT: %Core.import_ref.61e: %Copy.type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = %ElementType] -// CHECK:STDOUT: %ElementType: %Copy.type = assoc_const_decl @ElementType [concrete] {} +// CHECK:STDOUT: %Core.import_ref.dc2: %facet_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = %ElementType] +// CHECK:STDOUT: %ElementType: %facet_type = assoc_const_decl @ElementType [concrete] {} +// CHECK:STDOUT: %Core.import_ref.950: @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d) = import_ref Core//prelude/destroy, loc{{\d+_\d+}}, loaded [symbolic = @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.544)] +// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.950), @DestroyT.binding.as_type.as.Destroy.impl [concrete] // CHECK:STDOUT: %Core.import_ref.d0f6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.afd) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6cd)] // CHECK:STDOUT: %Copy.impl_witness_table.1ed = impl_witness_table (%Core.import_ref.d0f6), @Int.as.Copy.impl [concrete] -// CHECK:STDOUT: %Core.import_ref.725b: @Optional.%Optional.None.type (%Optional.None.type.3df) = import_ref Core//prelude/iterate, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.None (constants.%Optional.None.321)] -// CHECK:STDOUT: %Core.import_ref.9103: @Optional.%Optional.Some.type (%Optional.Some.type.48a) = import_ref Core//prelude/iterate, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.Some (constants.%Optional.Some.a29)] +// CHECK:STDOUT: %Core.import_ref.aad: @Optional.%Optional.None.type (%Optional.None.type.83a) = import_ref Core//prelude/iterate, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.None (constants.%Optional.None.ca1)] +// CHECK:STDOUT: %Core.import_ref.a00: @Optional.%Optional.Some.type (%Optional.Some.type.faf) = import_ref Core//prelude/iterate, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.Some (constants.%Optional.Some.59b)] // CHECK:STDOUT: %Core.Optional: %Optional.type = import_ref Core//prelude/types/optional, Optional, loaded [concrete = constants.%Optional.generic] // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.OrderedWith: %OrderedWith.type.270 = import_ref Core//prelude/operators/comparison, OrderedWith, loaded [concrete = constants.%OrderedWith.generic] // CHECK:STDOUT: %Core.import_ref.1cc: @OrderedWith.%OrderedWith.assoc_type (%OrderedWith.assoc_type.03c) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.%assoc0 (constants.%assoc0.3c6)] -// CHECK:STDOUT: %Core.import_ref.9108: @OrderedWith.%OrderedWith.Less.type (%OrderedWith.Less.type.f19) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.%OrderedWith.Less (constants.%OrderedWith.Less.02e)] +// CHECK:STDOUT: %Core.import_ref.910: @OrderedWith.%OrderedWith.Less.type (%OrderedWith.Less.type.f19) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.%OrderedWith.Less (constants.%OrderedWith.Less.02e)] // CHECK:STDOUT: %Core.import_ref.146ebd.1 = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %Core.import_ref.ab6: @Int.as.OrderedWith.impl.aed.%Int.as.OrderedWith.impl.Less.type (%Int.as.OrderedWith.impl.Less.type.6d6) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.OrderedWith.impl.aed.%Int.as.OrderedWith.impl.Less (constants.%Int.as.OrderedWith.impl.Less.d8b)] // CHECK:STDOUT: %Core.import_ref.54d = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, unloaded @@ -240,8 +244,6 @@ fn Read() { // CHECK:STDOUT: %OrderedWith.impl_witness_table.95f = impl_witness_table (%Core.import_ref.ab6, %Core.import_ref.54d, %Core.import_ref.e00, %Core.import_ref.a77), @Int.as.OrderedWith.impl.aed [concrete] // CHECK:STDOUT: %Core.Inc: type = import_ref Core//prelude/operators/arithmetic, Inc, loaded [concrete = constants.%Inc.type] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] -// CHECK:STDOUT: %Core.import_ref.950: @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d) = import_ref Core//prelude/destroy, loc{{\d+_\d+}}, loaded [symbolic = @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.544)] -// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.950), @DestroyT.binding.as_type.as.Destroy.impl [concrete] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.ee7: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete] @@ -291,10 +293,12 @@ fn Read() { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %IntRange: type = class_type @IntRange, @IntRange(%N) [symbolic = %IntRange (constants.%IntRange.349)] // CHECK:STDOUT: %Int.loc9_54.1: type = class_type @Int, @Int(%N) [symbolic = %Int.loc9_54.1 (constants.%Int.49d0e6.1)] +// CHECK:STDOUT: %facet_value.loc9_85.1: %type_where = facet_value %Int.loc9_54.1, () [symbolic = %facet_value.loc9_85.1 (constants.%facet_value.818)] +// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc9_85.1) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.47b)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %Int.loc9_54.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.ccc)] -// CHECK:STDOUT: %Copy.facet.loc9_85.1: %Copy.type = facet_value %Int.loc9_54.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc9_85.1 (constants.%Copy.facet.cd7)] -// CHECK:STDOUT: %Iterate_where.type: type = facet_type <@Iterate where constants.%impl.elem1.1c0 = %Int.loc9_54.1 and constants.%impl.elem0.5f7 = %Copy.facet.loc9_85.1> [symbolic = %Iterate_where.type (constants.%Iterate_where.type)] -// CHECK:STDOUT: %require_complete: = require_complete_type %Iterate_where.type [symbolic = %require_complete (constants.%require_complete.c0e)] +// CHECK:STDOUT: %facet_value.loc9_85.2: %facet_type = facet_value %Int.loc9_54.1, (%Destroy.impl_witness, %Copy.lookup_impl_witness) [symbolic = %facet_value.loc9_85.2 (constants.%facet_value.cbf)] +// CHECK:STDOUT: %Iterate_where.type: type = facet_type <@Iterate where constants.%impl.elem1.1c0 = %Int.loc9_54.1 and constants.%impl.elem0.76a = %facet_value.loc9_85.2> [symbolic = %Iterate_where.type (constants.%Iterate_where.type)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Iterate_where.type [symbolic = %require_complete (constants.%require_complete.e0d)] // CHECK:STDOUT: %Iterate.impl_witness: = impl_witness @IntRange.%Iterate.impl_witness_table, @IntRange.as.Iterate.impl(%N) [symbolic = %Iterate.impl_witness (constants.%Iterate.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -328,8 +332,8 @@ fn Read() { // CHECK:STDOUT: %self.param_patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_13 (%pattern_type.dcd) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: %cursor.patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_25 (%pattern_type.4dc) = binding_pattern cursor [concrete] // CHECK:STDOUT: %cursor.param_patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_25 (%pattern_type.4dc) = value_param_pattern %cursor.patt, call_param1 [concrete] -// CHECK:STDOUT: %return.patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_47 (%pattern_type.ff2) = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_47 (%pattern_type.ff2) = out_param_pattern %return.patt, call_param2 [concrete] +// CHECK:STDOUT: %return.patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_47 (%pattern_type.932) = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_47 (%pattern_type.932) = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %Core.ref.loc11_50: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Optional.ref.loc11: %Optional.type = name_ref Optional, imports.%Core.Optional [concrete = constants.%Optional.generic] @@ -337,9 +341,11 @@ fn Read() { // CHECK:STDOUT: %Int.ref.loc11_68: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc11_73: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_16.2 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %Int.loc11_74: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_43.1 (constants.%Int.49d0e6.1)] -// CHECK:STDOUT: %Copy.facet.loc11_75.2: %Copy.type = facet_value %Int.loc11_74, (constants.%Copy.lookup_impl_witness.ccc) [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.cd7)] -// CHECK:STDOUT: %.loc11_75: %Copy.type = converted %Int.loc11_74, %Copy.facet.loc11_75.2 [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.cd7)] -// CHECK:STDOUT: %Optional.loc11_75.2: type = class_type @Optional, @Optional(constants.%Copy.facet.cd7) [symbolic = %Optional.loc11_75.1 (constants.%Optional.671)] +// CHECK:STDOUT: %facet_value.loc11_75.3: %type_where = facet_value constants.%Int.49d0e6.1, () [symbolic = %facet_value.loc11_75.1 (constants.%facet_value.818)] +// CHECK:STDOUT: %.loc11_75.1: %type_where = converted constants.%Int.49d0e6.1, %facet_value.loc11_75.3 [symbolic = %facet_value.loc11_75.1 (constants.%facet_value.818)] +// CHECK:STDOUT: %facet_value.loc11_75.4: %facet_type = facet_value %Int.loc11_74, (constants.%Destroy.impl_witness.47b, constants.%Copy.lookup_impl_witness.ccc) [symbolic = %facet_value.loc11_75.2 (constants.%facet_value.cbf)] +// CHECK:STDOUT: %.loc11_75.2: %facet_type = converted %Int.loc11_74, %facet_value.loc11_75.4 [symbolic = %facet_value.loc11_75.2 (constants.%facet_value.cbf)] +// CHECK:STDOUT: %Optional.loc11_75.2: type = class_type @Optional, @Optional(constants.%facet_value.cbf) [symbolic = %Optional.loc11_75.1 (constants.%Optional.ef0)] // CHECK:STDOUT: %self.param: @IntRange.as.Iterate.impl.Next.%IntRange (%IntRange.349) = value_param call_param0 // CHECK:STDOUT: %.loc11_19.1: type = splice_block %Self.ref [symbolic = %IntRange (constants.%IntRange.349)] { // CHECK:STDOUT: %.loc11_19.2: type = specific_constant constants.%IntRange.349, @IntRange(constants.%N) [symbolic = %IntRange (constants.%IntRange.349)] @@ -355,8 +361,8 @@ fn Read() { // CHECK:STDOUT: %ptr.loc11_44.2: type = ptr_type %Int.loc11_43.2 [symbolic = %ptr.loc11_44.1 (constants.%ptr.784)] // CHECK:STDOUT: } // CHECK:STDOUT: %cursor: @IntRange.as.Iterate.impl.Next.%ptr.loc11_44.1 (%ptr.784) = bind_name cursor, %cursor.param -// CHECK:STDOUT: %return.param: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.671) = out_param call_param2 -// CHECK:STDOUT: %return: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.671) = return_slot %return.param +// CHECK:STDOUT: %return.param: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.ef0) = out_param call_param2 +// CHECK:STDOUT: %return: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.ef0) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -425,26 +431,28 @@ fn Read() { // CHECK:STDOUT: %N.ref.loc9_53: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_16.2 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %Int.loc9_54.2: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc9_54.1 (constants.%Int.49d0e6.1)] // CHECK:STDOUT: %.Self.ref.loc9_60: %Iterate.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.adc] -// CHECK:STDOUT: %ElementType.ref: %Iterate.assoc_type = name_ref ElementType, imports.%Core.import_ref.119 [concrete = constants.%assoc0.0f6] +// CHECK:STDOUT: %ElementType.ref: %Iterate.assoc_type = name_ref ElementType, imports.%Core.import_ref.944 [concrete = constants.%assoc0.32e] // CHECK:STDOUT: %.Self.as_type.loc9_60: type = facet_access_type %.Self.ref.loc9_60 [symbolic_self = constants.%.Self.binding.as_type] // CHECK:STDOUT: %.loc9_60: type = converted %.Self.ref.loc9_60, %.Self.as_type.loc9_60 [symbolic_self = constants.%.Self.binding.as_type] -// CHECK:STDOUT: %impl.elem0: %Copy.type = impl_witness_access constants.%Iterate.lookup_impl_witness.106, element0 [symbolic_self = constants.%impl.elem0.5f7] +// CHECK:STDOUT: %impl.elem0: %facet_type = impl_witness_access constants.%Iterate.lookup_impl_witness.106, element0 [symbolic_self = constants.%impl.elem0.76a] // CHECK:STDOUT: %Core.ref.loc9_75: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Int.ref.loc9_79: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc9_84: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_16.2 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %Int.loc9_85: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc9_54.1 (constants.%Int.49d0e6.1)] -// CHECK:STDOUT: %Copy.facet.loc9_85.2: %Copy.type = facet_value %Int.loc9_85, (constants.%Copy.lookup_impl_witness.ccc) [symbolic = %Copy.facet.loc9_85.1 (constants.%Copy.facet.cd7)] -// CHECK:STDOUT: %.loc9_85: %Copy.type = converted %Int.loc9_85, %Copy.facet.loc9_85.2 [symbolic = %Copy.facet.loc9_85.1 (constants.%Copy.facet.cd7)] +// CHECK:STDOUT: %facet_value.loc9_85.3: %type_where = facet_value constants.%Int.49d0e6.1, () [symbolic = %facet_value.loc9_85.1 (constants.%facet_value.818)] +// CHECK:STDOUT: %.loc9_85.1: %type_where = converted constants.%Int.49d0e6.1, %facet_value.loc9_85.3 [symbolic = %facet_value.loc9_85.1 (constants.%facet_value.818)] +// CHECK:STDOUT: %facet_value.loc9_85.4: %facet_type = facet_value %Int.loc9_85, (constants.%Destroy.impl_witness.47b, constants.%Copy.lookup_impl_witness.ccc) [symbolic = %facet_value.loc9_85.2 (constants.%facet_value.cbf)] +// CHECK:STDOUT: %.loc9_85.2: %facet_type = converted %Int.loc9_85, %facet_value.loc9_85.4 [symbolic = %facet_value.loc9_85.2 (constants.%facet_value.cbf)] // CHECK:STDOUT: %.loc9_24: type = where_expr %.Self [symbolic = %Iterate_where.type (constants.%Iterate_where.type)] { // CHECK:STDOUT: requirement_base_facet_type constants.%Iterate.type // CHECK:STDOUT: requirement_rewrite %impl.elem1, %Int.loc9_54.2 -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_85 +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_85.2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant.loc9_87.2, %impl_witness_assoc_constant.loc9_87.1, @IntRange.as.Iterate.impl.%IntRange.as.Iterate.impl.NewCursor.decl, @IntRange.as.Iterate.impl.%IntRange.as.Iterate.impl.Next.decl), @IntRange.as.Iterate.impl [concrete] // CHECK:STDOUT: %Iterate.impl_witness: = impl_witness %Iterate.impl_witness_table, @IntRange.as.Iterate.impl(constants.%N) [symbolic = @IntRange.as.Iterate.impl.%Iterate.impl_witness (constants.%Iterate.impl_witness)] // CHECK:STDOUT: %impl_witness_assoc_constant.loc9_87.1: type = impl_witness_assoc_constant constants.%Int.49d0e6.1 [symbolic = @IntRange.as.Iterate.impl.%Int.loc9_54.1 (constants.%Int.49d0e6.1)] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc9_87.2: %Copy.type = impl_witness_assoc_constant constants.%Copy.facet.cd7 [symbolic = @IntRange.as.Iterate.impl.%Copy.facet.loc9_85.1 (constants.%Copy.facet.cd7)] +// CHECK:STDOUT: %impl_witness_assoc_constant.loc9_87.2: %facet_type = impl_witness_assoc_constant constants.%facet_value.cbf [symbolic = @IntRange.as.Iterate.impl.%facet_value.loc9_85.2 (constants.%facet_value.cbf)] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Int.ref.loc22: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc22: Core.IntLiteral = name_ref N, %N.loc4_16.2 [symbolic = %N.loc4_16.1 (constants.%N)] @@ -548,25 +556,28 @@ fn Read() { // CHECK:STDOUT: %Int.loc11_43.1: type = class_type @Int, @Int(%N) [symbolic = %Int.loc11_43.1 (constants.%Int.49d0e6.1)] // CHECK:STDOUT: %ptr.loc11_44.1: type = ptr_type %Int.loc11_43.1 [symbolic = %ptr.loc11_44.1 (constants.%ptr.784)] // CHECK:STDOUT: %pattern_type.loc11_25: type = pattern_type %ptr.loc11_44.1 [symbolic = %pattern_type.loc11_25 (constants.%pattern_type.4dc)] +// CHECK:STDOUT: %facet_value.loc11_75.1: %type_where = facet_value %Int.loc11_43.1, () [symbolic = %facet_value.loc11_75.1 (constants.%facet_value.818)] +// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc11_75.1) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.47b)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %Int.loc11_43.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.ccc)] -// CHECK:STDOUT: %Copy.facet.loc11_75.1: %Copy.type = facet_value %Int.loc11_43.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.cd7)] -// CHECK:STDOUT: %Optional.loc11_75.1: type = class_type @Optional, @Optional(%Copy.facet.loc11_75.1) [symbolic = %Optional.loc11_75.1 (constants.%Optional.671)] -// CHECK:STDOUT: %pattern_type.loc11_47: type = pattern_type %Optional.loc11_75.1 [symbolic = %pattern_type.loc11_47 (constants.%pattern_type.ff2)] +// CHECK:STDOUT: %facet_value.loc11_75.2: %facet_type = facet_value %Int.loc11_43.1, (%Destroy.impl_witness, %Copy.lookup_impl_witness) [symbolic = %facet_value.loc11_75.2 (constants.%facet_value.cbf)] +// CHECK:STDOUT: %Optional.loc11_75.1: type = class_type @Optional, @Optional(%facet_value.loc11_75.2) [symbolic = %Optional.loc11_75.1 (constants.%Optional.ef0)] +// CHECK:STDOUT: %pattern_type.loc11_47: type = pattern_type %Optional.loc11_75.1 [symbolic = %pattern_type.loc11_47 (constants.%pattern_type.932)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc11_47: = require_complete_type %Optional.loc11_75.1 [symbolic = %require_complete.loc11_47 (constants.%require_complete.380)] +// CHECK:STDOUT: %require_complete.loc11_47: = require_complete_type %Optional.loc11_75.1 [symbolic = %require_complete.loc11_47 (constants.%require_complete.288)] // CHECK:STDOUT: %require_complete.loc11_17: = require_complete_type %IntRange [symbolic = %require_complete.loc11_17 (constants.%require_complete.524)] // CHECK:STDOUT: %require_complete.loc11_31: = require_complete_type %ptr.loc11_44.1 [symbolic = %require_complete.loc11_31 (constants.%require_complete.0f5)] // CHECK:STDOUT: %require_complete.loc12: = require_complete_type %Int.loc11_43.1 [symbolic = %require_complete.loc12 (constants.%require_complete.b4f426.1)] // CHECK:STDOUT: %pattern_type.loc12: type = pattern_type %Int.loc11_43.1 [symbolic = %pattern_type.loc12 (constants.%pattern_type.8963eb.1)] -// CHECK:STDOUT: %.loc12_32.4: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet.loc11_75.1 [symbolic = %.loc12_32.4 (constants.%.8f7)] +// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %Int.loc11_43.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.cd7)] +// CHECK:STDOUT: %.loc12_32.4: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc12_32.4 (constants.%.8f7)] // CHECK:STDOUT: %impl.elem0.loc12_32.2: @IntRange.as.Iterate.impl.Next.%.loc12_32.4 (%.8f7) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc12_32.2 (constants.%impl.elem0.840)] -// CHECK:STDOUT: %specific_impl_fn.loc12_32.2: = specific_impl_function %impl.elem0.loc12_32.2, @Copy.Op(%Copy.facet.loc11_75.1) [symbolic = %specific_impl_fn.loc12_32.2 (constants.%specific_impl_fn.70b)] +// CHECK:STDOUT: %specific_impl_fn.loc12_32.2: = specific_impl_function %impl.elem0.loc12_32.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc12_32.2 (constants.%specific_impl_fn.70b)] // CHECK:STDOUT: %IntRange.elem: type = unbound_element_type %IntRange, %Int.loc11_43.1 [symbolic = %IntRange.elem (constants.%IntRange.elem.e7c)] // CHECK:STDOUT: %OrderedWith.type.loc13_17.2: type = facet_type <@OrderedWith, @OrderedWith(%Int.loc11_43.1)> [symbolic = %OrderedWith.type.loc13_17.2 (constants.%OrderedWith.type.389)] // CHECK:STDOUT: %require_complete.loc13: = require_complete_type %OrderedWith.type.loc13_17.2 [symbolic = %require_complete.loc13 (constants.%require_complete.1fb)] // CHECK:STDOUT: %OrderedWith.assoc_type: type = assoc_entity_type @OrderedWith, @OrderedWith(%Int.loc11_43.1) [symbolic = %OrderedWith.assoc_type (constants.%OrderedWith.assoc_type.d92)] -// CHECK:STDOUT: %assoc0: @IntRange.as.Iterate.impl.Next.%OrderedWith.assoc_type (%OrderedWith.assoc_type.d92) = assoc_entity element0, imports.%Core.import_ref.9108 [symbolic = %assoc0 (constants.%assoc0.2ae)] +// CHECK:STDOUT: %assoc0: @IntRange.as.Iterate.impl.Next.%OrderedWith.assoc_type (%OrderedWith.assoc_type.d92) = assoc_entity element0, imports.%Core.import_ref.910 [symbolic = %assoc0 (constants.%assoc0.2ae)] // CHECK:STDOUT: %OrderedWith.impl_witness: = impl_witness imports.%OrderedWith.impl_witness_table.95f, @Int.as.OrderedWith.impl.aed(%N, %N) [symbolic = %OrderedWith.impl_witness (constants.%OrderedWith.impl_witness.cef)] // CHECK:STDOUT: %OrderedWith.Less.type: type = fn_type @OrderedWith.Less, @OrderedWith(%Int.loc11_43.1) [symbolic = %OrderedWith.Less.type (constants.%OrderedWith.Less.type.8fe)] // CHECK:STDOUT: %OrderedWith.facet: @IntRange.as.Iterate.impl.Next.%OrderedWith.type.loc13_17.2 (%OrderedWith.type.389) = facet_value %Int.loc11_43.1, (%OrderedWith.impl_witness) [symbolic = %OrderedWith.facet (constants.%OrderedWith.facet)] @@ -579,21 +590,19 @@ fn Read() { // CHECK:STDOUT: %.loc14_9.2: type = fn_type_with_self_type constants.%Inc.Op.type, %Inc.facet [symbolic = %.loc14_9.2 (constants.%.941)] // CHECK:STDOUT: %impl.elem0.loc14_9.2: @IntRange.as.Iterate.impl.Next.%.loc14_9.2 (%.941) = impl_witness_access %Inc.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_9.2 (constants.%impl.elem0.bca)] // CHECK:STDOUT: %specific_impl_fn.loc14_9.2: = specific_impl_function %impl.elem0.loc14_9.2, @Inc.Op(%Inc.facet) [symbolic = %specific_impl_fn.loc14_9.2 (constants.%specific_impl_fn.989)] -// CHECK:STDOUT: %Optional.Some.type: type = fn_type @Optional.Some, @Optional(%Copy.facet.loc11_75.1) [symbolic = %Optional.Some.type (constants.%Optional.Some.type.20f)] -// CHECK:STDOUT: %Optional.Some: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.20f) = struct_value () [symbolic = %Optional.Some (constants.%Optional.Some.dff)] -// CHECK:STDOUT: %Optional.Some.specific_fn.loc15_42.2: = specific_function %Optional.Some, @Optional.Some(%Copy.facet.loc11_75.1) [symbolic = %Optional.Some.specific_fn.loc15_42.2 (constants.%Optional.Some.specific_fn)] -// CHECK:STDOUT: %facet_value.loc12_7.3: %type_where = facet_value %Int.loc11_43.1, () [symbolic = %facet_value.loc12_7.3 (constants.%facet_value)] -// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc12_7.3) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.47b)] +// CHECK:STDOUT: %Optional.Some.type: type = fn_type @Optional.Some, @Optional(%facet_value.loc11_75.2) [symbolic = %Optional.Some.type (constants.%Optional.Some.type.9ca)] +// CHECK:STDOUT: %Optional.Some: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.9ca) = struct_value () [symbolic = %Optional.Some (constants.%Optional.Some.1b1)] +// CHECK:STDOUT: %Optional.Some.specific_fn.loc15_42.2: = specific_function %Optional.Some, @Optional.Some(%facet_value.loc11_75.2) [symbolic = %Optional.Some.specific_fn.loc15_42.2 (constants.%Optional.Some.specific_fn)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Int.loc11_43.1, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet)] // CHECK:STDOUT: %.loc12_7.3: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc12_7.3 (constants.%.944)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc12_7.3) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.c3b)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc11_75.1) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.c3b)] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @IntRange.as.Iterate.impl.Next.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.c3b) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.db2)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc12_7.3) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] -// CHECK:STDOUT: %Optional.None.type: type = fn_type @Optional.None, @Optional(%Copy.facet.loc11_75.1) [symbolic = %Optional.None.type (constants.%Optional.None.type.66e)] -// CHECK:STDOUT: %Optional.None: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.66e) = struct_value () [symbolic = %Optional.None (constants.%Optional.None.016)] -// CHECK:STDOUT: %Optional.None.specific_fn.loc17_42.2: = specific_function %Optional.None, @Optional.None(%Copy.facet.loc11_75.1) [symbolic = %Optional.None.specific_fn.loc17_42.2 (constants.%Optional.None.specific_fn)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc11_75.1) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] +// CHECK:STDOUT: %Optional.None.type: type = fn_type @Optional.None, @Optional(%facet_value.loc11_75.2) [symbolic = %Optional.None.type (constants.%Optional.None.type.38b)] +// CHECK:STDOUT: %Optional.None: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.38b) = struct_value () [symbolic = %Optional.None (constants.%Optional.None.fd7)] +// CHECK:STDOUT: %Optional.None.specific_fn.loc17_42.2: = specific_function %Optional.None, @Optional.None(%facet_value.loc11_75.2) [symbolic = %Optional.None.specific_fn.loc17_42.2 (constants.%Optional.None.specific_fn)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @IntRange.as.Iterate.impl.Next.%IntRange (%IntRange.349), %cursor.param: @IntRange.as.Iterate.impl.Next.%ptr.loc11_44.1 (%ptr.784)) -> %return.param: @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.671) { +// CHECK:STDOUT: fn(%self.param: @IntRange.as.Iterate.impl.Next.%IntRange (%IntRange.349), %cursor.param: @IntRange.as.Iterate.impl.Next.%ptr.loc11_44.1 (%ptr.784)) -> %return.param: @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.ef0) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %value.patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc12 (%pattern_type.8963eb.1) = binding_pattern value [concrete] @@ -649,25 +658,31 @@ fn Read() { // CHECK:STDOUT: %Int.ref.loc15: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc15: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_16.2 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %Int.loc15: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_43.1 (constants.%Int.49d0e6.1)] -// CHECK:STDOUT: %Copy.facet.loc15_41: %Copy.type = facet_value %Int.loc15, (constants.%Copy.lookup_impl_witness.ccc) [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.cd7)] -// CHECK:STDOUT: %.loc15_41: %Copy.type = converted %Int.loc15, %Copy.facet.loc15_41 [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.cd7)] -// CHECK:STDOUT: %Optional.loc15: type = class_type @Optional, @Optional(constants.%Copy.facet.cd7) [symbolic = %Optional.loc11_75.1 (constants.%Optional.671)] -// CHECK:STDOUT: %.loc15_42: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.20f) = specific_constant imports.%Core.import_ref.9103, @Optional(constants.%Copy.facet.cd7) [symbolic = %Optional.Some (constants.%Optional.Some.dff)] -// CHECK:STDOUT: %Some.ref: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.20f) = name_ref Some, %.loc15_42 [symbolic = %Optional.Some (constants.%Optional.Some.dff)] +// CHECK:STDOUT: %facet_value.loc15_41.1: %type_where = facet_value constants.%Int.49d0e6.1, () [symbolic = %facet_value.loc11_75.1 (constants.%facet_value.818)] +// CHECK:STDOUT: %.loc15_41.1: %type_where = converted constants.%Int.49d0e6.1, %facet_value.loc15_41.1 [symbolic = %facet_value.loc11_75.1 (constants.%facet_value.818)] +// CHECK:STDOUT: %facet_value.loc15_41.2: %facet_type = facet_value %Int.loc15, (constants.%Destroy.impl_witness.47b, constants.%Copy.lookup_impl_witness.ccc) [symbolic = %facet_value.loc11_75.2 (constants.%facet_value.cbf)] +// CHECK:STDOUT: %.loc15_41.2: %facet_type = converted %Int.loc15, %facet_value.loc15_41.2 [symbolic = %facet_value.loc11_75.2 (constants.%facet_value.cbf)] +// CHECK:STDOUT: %Optional.loc15: type = class_type @Optional, @Optional(constants.%facet_value.cbf) [symbolic = %Optional.loc11_75.1 (constants.%Optional.ef0)] +// CHECK:STDOUT: %.loc15_42: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.9ca) = specific_constant imports.%Core.import_ref.a00, @Optional(constants.%facet_value.cbf) [symbolic = %Optional.Some (constants.%Optional.Some.1b1)] +// CHECK:STDOUT: %Some.ref: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.9ca) = name_ref Some, %.loc15_42 [symbolic = %Optional.Some (constants.%Optional.Some.1b1)] // CHECK:STDOUT: %value.ref.loc15: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.49d0e6.1) = name_ref value, %value -// CHECK:STDOUT: %Copy.facet.loc15_53.1: %Copy.type = facet_value constants.%Int.49d0e6.1, (constants.%Copy.lookup_impl_witness.ccc) [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.cd7)] -// CHECK:STDOUT: %.loc15_53.1: %Copy.type = converted constants.%Int.49d0e6.1, %Copy.facet.loc15_53.1 [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.cd7)] -// CHECK:STDOUT: %Copy.facet.loc15_53.2: %Copy.type = facet_value constants.%Int.49d0e6.1, (constants.%Copy.lookup_impl_witness.ccc) [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.cd7)] -// CHECK:STDOUT: %.loc15_53.2: %Copy.type = converted constants.%Int.49d0e6.1, %Copy.facet.loc15_53.2 [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.cd7)] -// CHECK:STDOUT: %Optional.Some.specific_fn.loc15_42.1: = specific_function %Some.ref, @Optional.Some(constants.%Copy.facet.cd7) [symbolic = %Optional.Some.specific_fn.loc15_42.2 (constants.%Optional.Some.specific_fn)] -// CHECK:STDOUT: %.loc11_47.1: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.671) = splice_block %return {} +// CHECK:STDOUT: %facet_value.loc15_53.1: %type_where = facet_value constants.%Int.49d0e6.1, () [symbolic = %facet_value.loc11_75.1 (constants.%facet_value.818)] +// CHECK:STDOUT: %.loc15_53.1: %type_where = converted constants.%Int.49d0e6.1, %facet_value.loc15_53.1 [symbolic = %facet_value.loc11_75.1 (constants.%facet_value.818)] +// CHECK:STDOUT: %facet_value.loc15_53.2: %facet_type = facet_value constants.%Int.49d0e6.1, (constants.%Destroy.impl_witness.47b, constants.%Copy.lookup_impl_witness.ccc) [symbolic = %facet_value.loc11_75.2 (constants.%facet_value.cbf)] +// CHECK:STDOUT: %.loc15_53.2: %facet_type = converted constants.%Int.49d0e6.1, %facet_value.loc15_53.2 [symbolic = %facet_value.loc11_75.2 (constants.%facet_value.cbf)] +// CHECK:STDOUT: %facet_value.loc15_53.3: %type_where = facet_value constants.%Int.49d0e6.1, () [symbolic = %facet_value.loc11_75.1 (constants.%facet_value.818)] +// CHECK:STDOUT: %.loc15_53.3: %type_where = converted constants.%Int.49d0e6.1, %facet_value.loc15_53.3 [symbolic = %facet_value.loc11_75.1 (constants.%facet_value.818)] +// CHECK:STDOUT: %facet_value.loc15_53.4: %facet_type = facet_value constants.%Int.49d0e6.1, (constants.%Destroy.impl_witness.47b, constants.%Copy.lookup_impl_witness.ccc) [symbolic = %facet_value.loc11_75.2 (constants.%facet_value.cbf)] +// CHECK:STDOUT: %.loc15_53.4: %facet_type = converted constants.%Int.49d0e6.1, %facet_value.loc15_53.4 [symbolic = %facet_value.loc11_75.2 (constants.%facet_value.cbf)] +// CHECK:STDOUT: %Optional.Some.specific_fn.loc15_42.1: = specific_function %Some.ref, @Optional.Some(constants.%facet_value.cbf) [symbolic = %Optional.Some.specific_fn.loc15_42.2 (constants.%Optional.Some.specific_fn)] +// CHECK:STDOUT: %.loc11_47.1: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.ef0) = splice_block %return {} // CHECK:STDOUT: %.loc15_48: @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.49d0e6.1) = bind_value %value.ref.loc15 -// CHECK:STDOUT: %Optional.Some.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.671) = call %Optional.Some.specific_fn.loc15_42.1(%.loc15_48) to %.loc11_47.1 -// CHECK:STDOUT: %facet_value.loc12_7.1: %type_where = facet_value constants.%Int.49d0e6.1, () [symbolic = %facet_value.loc12_7.3 (constants.%facet_value)] -// CHECK:STDOUT: %.loc12_7.1: %type_where = converted constants.%Int.49d0e6.1, %facet_value.loc12_7.1 [symbolic = %facet_value.loc12_7.3 (constants.%facet_value)] +// CHECK:STDOUT: %Optional.Some.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.ef0) = call %Optional.Some.specific_fn.loc15_42.1(%.loc15_48) to %.loc11_47.1 +// CHECK:STDOUT: %facet_value.loc12_7.1: %type_where = facet_value constants.%Int.49d0e6.1, () [symbolic = %facet_value.loc11_75.1 (constants.%facet_value.818)] +// CHECK:STDOUT: %.loc12_7.1: %type_where = converted constants.%Int.49d0e6.1, %facet_value.loc12_7.1 [symbolic = %facet_value.loc11_75.1 (constants.%facet_value.818)] // CHECK:STDOUT: %impl.elem0.loc12_7.1: @IntRange.as.Iterate.impl.Next.%.loc12_7.3 (%.944) = impl_witness_access constants.%Destroy.impl_witness.47b, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.db2)] // CHECK:STDOUT: %bound_method.loc12_7.1: = bound_method %value.var, %impl.elem0.loc12_7.1 -// CHECK:STDOUT: %specific_fn.loc12_7.1: = specific_function %impl.elem0.loc12_7.1, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] +// CHECK:STDOUT: %specific_fn.loc12_7.1: = specific_function %impl.elem0.loc12_7.1, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.818) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] // CHECK:STDOUT: %bound_method.loc12_7.2: = bound_method %value.var, %specific_fn.loc12_7.1 // CHECK:STDOUT: %addr.loc12_7.1: @IntRange.as.Iterate.impl.Next.%ptr.loc11_44.1 (%ptr.784) = addr_of %value.var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc12_7.1: init %empty_tuple.type = call %bound_method.loc12_7.2(%addr.loc12_7.1) @@ -680,19 +695,21 @@ fn Read() { // CHECK:STDOUT: %Int.ref.loc17: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc17: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_16.2 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %Int.loc17: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_43.1 (constants.%Int.49d0e6.1)] -// CHECK:STDOUT: %Copy.facet.loc17: %Copy.type = facet_value %Int.loc17, (constants.%Copy.lookup_impl_witness.ccc) [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.cd7)] -// CHECK:STDOUT: %.loc17_41: %Copy.type = converted %Int.loc17, %Copy.facet.loc17 [symbolic = %Copy.facet.loc11_75.1 (constants.%Copy.facet.cd7)] -// CHECK:STDOUT: %Optional.loc17: type = class_type @Optional, @Optional(constants.%Copy.facet.cd7) [symbolic = %Optional.loc11_75.1 (constants.%Optional.671)] -// CHECK:STDOUT: %.loc17_42: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.66e) = specific_constant imports.%Core.import_ref.725b, @Optional(constants.%Copy.facet.cd7) [symbolic = %Optional.None (constants.%Optional.None.016)] -// CHECK:STDOUT: %None.ref: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.66e) = name_ref None, %.loc17_42 [symbolic = %Optional.None (constants.%Optional.None.016)] -// CHECK:STDOUT: %Optional.None.specific_fn.loc17_42.1: = specific_function %None.ref, @Optional.None(constants.%Copy.facet.cd7) [symbolic = %Optional.None.specific_fn.loc17_42.2 (constants.%Optional.None.specific_fn)] -// CHECK:STDOUT: %.loc11_47.2: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.671) = splice_block %return {} -// CHECK:STDOUT: %Optional.None.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.671) = call %Optional.None.specific_fn.loc17_42.1() to %.loc11_47.2 -// CHECK:STDOUT: %facet_value.loc12_7.2: %type_where = facet_value constants.%Int.49d0e6.1, () [symbolic = %facet_value.loc12_7.3 (constants.%facet_value)] -// CHECK:STDOUT: %.loc12_7.2: %type_where = converted constants.%Int.49d0e6.1, %facet_value.loc12_7.2 [symbolic = %facet_value.loc12_7.3 (constants.%facet_value)] +// CHECK:STDOUT: %facet_value.loc17_41.1: %type_where = facet_value constants.%Int.49d0e6.1, () [symbolic = %facet_value.loc11_75.1 (constants.%facet_value.818)] +// CHECK:STDOUT: %.loc17_41.1: %type_where = converted constants.%Int.49d0e6.1, %facet_value.loc17_41.1 [symbolic = %facet_value.loc11_75.1 (constants.%facet_value.818)] +// CHECK:STDOUT: %facet_value.loc17_41.2: %facet_type = facet_value %Int.loc17, (constants.%Destroy.impl_witness.47b, constants.%Copy.lookup_impl_witness.ccc) [symbolic = %facet_value.loc11_75.2 (constants.%facet_value.cbf)] +// CHECK:STDOUT: %.loc17_41.2: %facet_type = converted %Int.loc17, %facet_value.loc17_41.2 [symbolic = %facet_value.loc11_75.2 (constants.%facet_value.cbf)] +// CHECK:STDOUT: %Optional.loc17: type = class_type @Optional, @Optional(constants.%facet_value.cbf) [symbolic = %Optional.loc11_75.1 (constants.%Optional.ef0)] +// CHECK:STDOUT: %.loc17_42: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.38b) = specific_constant imports.%Core.import_ref.aad, @Optional(constants.%facet_value.cbf) [symbolic = %Optional.None (constants.%Optional.None.fd7)] +// CHECK:STDOUT: %None.ref: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.38b) = name_ref None, %.loc17_42 [symbolic = %Optional.None (constants.%Optional.None.fd7)] +// CHECK:STDOUT: %Optional.None.specific_fn.loc17_42.1: = specific_function %None.ref, @Optional.None(constants.%facet_value.cbf) [symbolic = %Optional.None.specific_fn.loc17_42.2 (constants.%Optional.None.specific_fn)] +// CHECK:STDOUT: %.loc11_47.2: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.ef0) = splice_block %return {} +// CHECK:STDOUT: %Optional.None.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.ef0) = call %Optional.None.specific_fn.loc17_42.1() to %.loc11_47.2 +// CHECK:STDOUT: %facet_value.loc12_7.2: %type_where = facet_value constants.%Int.49d0e6.1, () [symbolic = %facet_value.loc11_75.1 (constants.%facet_value.818)] +// CHECK:STDOUT: %.loc12_7.2: %type_where = converted constants.%Int.49d0e6.1, %facet_value.loc12_7.2 [symbolic = %facet_value.loc11_75.1 (constants.%facet_value.818)] // CHECK:STDOUT: %impl.elem0.loc12_7.2: @IntRange.as.Iterate.impl.Next.%.loc12_7.3 (%.944) = impl_witness_access constants.%Destroy.impl_witness.47b, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.db2)] // CHECK:STDOUT: %bound_method.loc12_7.3: = bound_method %value.var, %impl.elem0.loc12_7.2 -// CHECK:STDOUT: %specific_fn.loc12_7.2: = specific_function %impl.elem0.loc12_7.2, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] +// CHECK:STDOUT: %specific_fn.loc12_7.2: = specific_function %impl.elem0.loc12_7.2, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.818) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] // CHECK:STDOUT: %bound_method.loc12_7.4: = bound_method %value.var, %specific_fn.loc12_7.2 // CHECK:STDOUT: %addr.loc12_7.2: @IntRange.as.Iterate.impl.Next.%ptr.loc11_44.1 (%ptr.784) = addr_of %value.var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc12_7.2: init %empty_tuple.type = call %bound_method.loc12_7.4(%addr.loc12_7.2) @@ -748,10 +765,12 @@ fn Read() { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %IntRange => constants.%IntRange.349 // CHECK:STDOUT: %Int.loc9_54.1 => constants.%Int.49d0e6.1 +// CHECK:STDOUT: %facet_value.loc9_85.1 => constants.%facet_value.818 +// CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.47b // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.ccc -// CHECK:STDOUT: %Copy.facet.loc9_85.1 => constants.%Copy.facet.cd7 +// CHECK:STDOUT: %facet_value.loc9_85.2 => constants.%facet_value.cbf // CHECK:STDOUT: %Iterate_where.type => constants.%Iterate_where.type -// CHECK:STDOUT: %require_complete => constants.%require_complete.c0e +// CHECK:STDOUT: %require_complete => constants.%require_complete.e0d // CHECK:STDOUT: %Iterate.impl_witness => constants.%Iterate.impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -776,10 +795,12 @@ fn Read() { // CHECK:STDOUT: %Int.loc11_43.1 => constants.%Int.49d0e6.1 // CHECK:STDOUT: %ptr.loc11_44.1 => constants.%ptr.784 // CHECK:STDOUT: %pattern_type.loc11_25 => constants.%pattern_type.4dc +// CHECK:STDOUT: %facet_value.loc11_75.1 => constants.%facet_value.818 +// CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.47b // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.ccc -// CHECK:STDOUT: %Copy.facet.loc11_75.1 => constants.%Copy.facet.cd7 -// CHECK:STDOUT: %Optional.loc11_75.1 => constants.%Optional.671 -// CHECK:STDOUT: %pattern_type.loc11_47 => constants.%pattern_type.ff2 +// CHECK:STDOUT: %facet_value.loc11_75.2 => constants.%facet_value.cbf +// CHECK:STDOUT: %Optional.loc11_75.1 => constants.%Optional.ef0 +// CHECK:STDOUT: %pattern_type.loc11_47 => constants.%pattern_type.932 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @IntRange(constants.%int_32) { diff --git a/toolchain/check/testdata/for/basic.carbon b/toolchain/check/testdata/for/basic.carbon index 61a11df19e444..7061a11adbadb 100644 --- a/toolchain/check/testdata/for/basic.carbon +++ b/toolchain/check/testdata/for/basic.carbon @@ -59,50 +59,54 @@ fn Run() { // CHECK:STDOUT: %TrivialRange: type = class_type @TrivialRange [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] -// CHECK:STDOUT: %T.be8: %Copy.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %facet_type: type = facet_type <@Destroy & @Copy> [concrete] +// CHECK:STDOUT: %type_where: type = facet_type > [concrete] +// CHECK:STDOUT: %DestroyT: %type_where = bind_symbolic_name DestroyT, 0 [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%DestroyT) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.544: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d = struct_value () [symbolic] +// CHECK:STDOUT: %facet_value.ff9: %type_where = facet_value %empty_tuple.type, () [concrete] +// CHECK:STDOUT: %Destroy.impl_witness.589: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.ff9) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.789: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.ff9) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.93e: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.789 = struct_value () [concrete] +// CHECK:STDOUT: %ptr.843: type = ptr_type %empty_tuple.type [concrete] // CHECK:STDOUT: %Copy.impl_witness.c9a: = impl_witness imports.%Copy.impl_witness_table.955 [concrete] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %empty_tuple.type, (%Copy.impl_witness.c9a) [concrete] +// CHECK:STDOUT: %facet_value.ded: %facet_type = facet_value %empty_tuple.type, (%Destroy.impl_witness.589, %Copy.impl_witness.c9a) [concrete] // CHECK:STDOUT: %Iterate.NewCursor.type: type = fn_type @Iterate.NewCursor [concrete] // CHECK:STDOUT: %Iterate.Next.type: type = fn_type @Iterate.Next [concrete] -// CHECK:STDOUT: %Optional.HasValue.type.b77: type = fn_type @Optional.HasValue, @Optional(%T.be8) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.110: %Optional.HasValue.type.b77 = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.Get.type.81f: type = fn_type @Optional.Get, @Optional(%T.be8) [symbolic] -// CHECK:STDOUT: %Optional.Get.546: %Optional.Get.type.81f = struct_value () [symbolic] +// CHECK:STDOUT: %T.4b8: %facet_type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.8eb: type = fn_type @Optional.HasValue, @Optional(%T.4b8) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.db8: %Optional.HasValue.type.8eb = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.Get.type.897: type = fn_type @Optional.Get, @Optional(%T.4b8) [symbolic] +// CHECK:STDOUT: %Optional.Get.9b6: %Optional.Get.type.897 = struct_value () [symbolic] // CHECK:STDOUT: %Iterate.impl_witness: = impl_witness @TrivialRange.%Iterate.impl_witness_table [concrete] -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.81eeda.1: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_32.1 [concrete] -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.d4796b.1: %TrivialRange.as.Iterate.impl.NewCursor.type.81eeda.1 = struct_value () [concrete] -// CHECK:STDOUT: %ptr.843: type = ptr_type %empty_tuple.type [concrete] -// CHECK:STDOUT: %Optional.68c: type = class_type @Optional, @Optional(%Copy.facet) [concrete] +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.06b145.1: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_32.1 [concrete] +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.33e994.1: %TrivialRange.as.Iterate.impl.NewCursor.type.06b145.1 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.c09: type = class_type @Optional, @Optional(%facet_value.ded) [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next.type: type = fn_type @TrivialRange.as.Iterate.impl.Next [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next: %TrivialRange.as.Iterate.impl.Next.type = struct_value () [concrete] // CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %TrivialRange, (%Iterate.impl_witness) [concrete] // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.81eeda.2: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_32.2 [concrete] -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.d4796b.2: %TrivialRange.as.Iterate.impl.NewCursor.type.81eeda.2 = struct_value () [concrete] +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.06b145.2: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_32.2 [concrete] +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.33e994.2: %TrivialRange.as.Iterate.impl.NewCursor.type.06b145.2 = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %Optional.HasValue.type.cac: type = fn_type @Optional.HasValue, @Optional(%Copy.facet) [concrete] -// CHECK:STDOUT: %Optional.HasValue.5e3: %Optional.HasValue.type.cac = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.a4e: type = fn_type @Optional.Get, @Optional(%Copy.facet) [concrete] -// CHECK:STDOUT: %Optional.Get.1d7: %Optional.Get.type.a4e = struct_value () [concrete] +// CHECK:STDOUT: %Optional.HasValue.type.4e9: type = fn_type @Optional.HasValue, @Optional(%facet_value.ded) [concrete] +// CHECK:STDOUT: %Optional.HasValue.386: %Optional.HasValue.type.4e9 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.eca: type = fn_type @Optional.Get, @Optional(%facet_value.ded) [concrete] +// CHECK:STDOUT: %Optional.Get.29b: %Optional.Get.type.eca = struct_value () [concrete] // CHECK:STDOUT: %Body.type: type = fn_type @Body [concrete] // CHECK:STDOUT: %Body: %Body.type = struct_value () [concrete] // CHECK:STDOUT: %AfterLoop.type: type = fn_type @AfterLoop [concrete] // CHECK:STDOUT: %AfterLoop: %AfterLoop.type = struct_value () [concrete] // CHECK:STDOUT: %TrivialRange.val: %TrivialRange = struct_value () [concrete] -// CHECK:STDOUT: %.298: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %.b35: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.5e3, @Optional.HasValue(%Copy.facet) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.1d7, @Optional.Get(%Copy.facet) [concrete] +// CHECK:STDOUT: %.714: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %.832: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.386, @Optional.HasValue(%facet_value.ded) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.29b, @Optional.Get(%facet_value.ded) [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] -// CHECK:STDOUT: %type_where: type = facet_type > [concrete] -// CHECK:STDOUT: %facet_value.ff9: %type_where = facet_value %empty_tuple.type, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.789: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.ff9) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.93e: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.789 = struct_value () [concrete] -// CHECK:STDOUT: %facet_value.136: %type_where = facet_value %Optional.68c, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.979: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.136) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.fea: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.979 = struct_value () [concrete] -// CHECK:STDOUT: %ptr.17e: type = ptr_type %Optional.68c [concrete] +// CHECK:STDOUT: %facet_value.d36: %type_where = facet_value %Optional.c09, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a57: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.d36) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.15c: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a57 = struct_value () [concrete] +// CHECK:STDOUT: %ptr.2ba: type = ptr_type %Optional.c09 [concrete] // CHECK:STDOUT: %facet_value.441: %type_where = facet_value %TrivialRange, () [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.01c: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.441) [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.72a: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.01c = struct_value () [concrete] @@ -112,10 +116,12 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core.import_ref.950: @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.544)] +// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.950), @DestroyT.binding.as_type.as.Destroy.impl [concrete] // CHECK:STDOUT: %Core.import_ref.1a3: %empty_tuple.type.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [concrete = constants.%empty_tuple.type.as.Copy.impl.Op] // CHECK:STDOUT: %Copy.impl_witness_table.955 = impl_witness_table (%Core.import_ref.1a3), @empty_tuple.type.as.Copy.impl [concrete] -// CHECK:STDOUT: %Core.import_ref.b87: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.b77) = import_ref Core//prelude/parts/iterate, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.110)] -// CHECK:STDOUT: %Core.import_ref.d08: @Optional.%Optional.Get.type (%Optional.Get.type.81f) = import_ref Core//prelude/parts/iterate, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.546)] +// CHECK:STDOUT: %Core.import_ref.994: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.8eb) = import_ref Core//prelude/parts/iterate, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.db8)] +// CHECK:STDOUT: %Core.import_ref.db5: @Optional.%Optional.Get.type (%Optional.Get.type.897) = import_ref Core//prelude/parts/iterate, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.9b6)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -129,10 +135,10 @@ fn Run() { // CHECK:STDOUT: %.loc18_18.3: init %TrivialRange = class_init (), %.loc18_18.2 [concrete = constants.%TrivialRange.val] // CHECK:STDOUT: %.loc18_18.4: ref %TrivialRange = temporary %.loc18_18.2, %.loc18_18.3 // CHECK:STDOUT: %.loc18_20.1: ref %TrivialRange = converted %.loc18_18.1, %.loc18_18.4 -// CHECK:STDOUT: %impl.elem2: %.298 = impl_witness_access constants.%Iterate.impl_witness, element2 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.d4796b.2] +// CHECK:STDOUT: %impl.elem2: %.714 = impl_witness_access constants.%Iterate.impl_witness, element2 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.33e994.2] // CHECK:STDOUT: %bound_method.loc18_35.1: = bound_method %.loc18_20.1, %impl.elem2 // CHECK:STDOUT: %.loc18_20.2: %TrivialRange = bind_value %.loc18_20.1 -// CHECK:STDOUT: %NewCursor.ref: %TrivialRange.as.Iterate.impl.NewCursor.type.81eeda.1 = name_ref NewCursor, @TrivialRange.as.Iterate.impl.%TrivialRange.as.Iterate.impl.NewCursor.decl.loc6_32.1 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.d4796b.1] +// CHECK:STDOUT: %NewCursor.ref: %TrivialRange.as.Iterate.impl.NewCursor.type.06b145.1 = name_ref NewCursor, @TrivialRange.as.Iterate.impl.%TrivialRange.as.Iterate.impl.NewCursor.decl.loc6_32.1 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.33e994.1] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.bound: = bound_method %.loc18_20.2, %NewCursor.ref // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.call: init %empty_tuple.type = call %TrivialRange.as.Iterate.impl.NewCursor.bound(%.loc18_20.2) // CHECK:STDOUT: %var: ref %empty_tuple.type = var invalid @@ -141,30 +147,30 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr.loc18_35.1: %ptr.843 = addr_of %var -// CHECK:STDOUT: %impl.elem3: %.b35 = impl_witness_access constants.%Iterate.impl_witness, element3 [concrete = constants.%TrivialRange.as.Iterate.impl.Next] +// CHECK:STDOUT: %impl.elem3: %.832 = impl_witness_access constants.%Iterate.impl_witness, element3 [concrete = constants.%TrivialRange.as.Iterate.impl.Next] // CHECK:STDOUT: %bound_method.loc18_35.2: = bound_method %.loc18_20.1, %impl.elem3 -// CHECK:STDOUT: %.loc18_35.1: ref %Optional.68c = temporary_storage +// CHECK:STDOUT: %.loc18_35.1: ref %Optional.c09 = temporary_storage // CHECK:STDOUT: %.loc18_20.3: %TrivialRange = bind_value %.loc18_20.1 -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next.call: init %Optional.68c = call %bound_method.loc18_35.2(%.loc18_20.3, %addr.loc18_35.1) to %.loc18_35.1 -// CHECK:STDOUT: %.loc18_35.2: ref %Optional.68c = temporary %.loc18_35.1, %TrivialRange.as.Iterate.impl.Next.call -// CHECK:STDOUT: %.loc18_35.3: %Optional.HasValue.type.cac = specific_constant imports.%Core.import_ref.b87, @Optional(constants.%Copy.facet) [concrete = constants.%Optional.HasValue.5e3] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.cac = name_ref HasValue, %.loc18_35.3 [concrete = constants.%Optional.HasValue.5e3] +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next.call: init %Optional.c09 = call %bound_method.loc18_35.2(%.loc18_20.3, %addr.loc18_35.1) to %.loc18_35.1 +// CHECK:STDOUT: %.loc18_35.2: ref %Optional.c09 = temporary %.loc18_35.1, %TrivialRange.as.Iterate.impl.Next.call +// CHECK:STDOUT: %.loc18_35.3: %Optional.HasValue.type.4e9 = specific_constant imports.%Core.import_ref.994, @Optional(constants.%facet_value.ded) [concrete = constants.%Optional.HasValue.386] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.4e9 = name_ref HasValue, %.loc18_35.3 [concrete = constants.%Optional.HasValue.386] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc18_35.2, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%Copy.facet) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%facet_value.ded) [concrete = constants.%Optional.HasValue.specific_fn] // CHECK:STDOUT: %bound_method.loc18_35.3: = bound_method %.loc18_35.2, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc18_35.4: %Optional.68c = bind_value %.loc18_35.2 +// CHECK:STDOUT: %.loc18_35.4: %Optional.c09 = bind_value %.loc18_35.2 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc18_35.3(%.loc18_35.4) // CHECK:STDOUT: %.loc18_35.5: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc18_35.6: bool = converted %Optional.HasValue.call, %.loc18_35.5 // CHECK:STDOUT: if %.loc18_35.6 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc18_35.7: %Optional.Get.type.a4e = specific_constant imports.%Core.import_ref.d08, @Optional(constants.%Copy.facet) [concrete = constants.%Optional.Get.1d7] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.a4e = name_ref Get, %.loc18_35.7 [concrete = constants.%Optional.Get.1d7] +// CHECK:STDOUT: %.loc18_35.7: %Optional.Get.type.eca = specific_constant imports.%Core.import_ref.db5, @Optional(constants.%facet_value.ded) [concrete = constants.%Optional.Get.29b] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.eca = name_ref Get, %.loc18_35.7 [concrete = constants.%Optional.Get.29b] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc18_35.2, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%Copy.facet) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%facet_value.ded) [concrete = constants.%Optional.Get.specific_fn] // CHECK:STDOUT: %bound_method.loc18_35.4: = bound_method %.loc18_35.2, %Optional.Get.specific_fn -// CHECK:STDOUT: %.loc18_35.8: %Optional.68c = bind_value %.loc18_35.2 +// CHECK:STDOUT: %.loc18_35.8: %Optional.c09 = bind_value %.loc18_35.2 // CHECK:STDOUT: %Optional.Get.call: init %empty_tuple.type = call %bound_method.loc18_35.4(%.loc18_35.8) // CHECK:STDOUT: %.loc18_12.1: type = splice_block %.loc18_12.3 [concrete = constants.%empty_tuple.type] { // CHECK:STDOUT: %.loc18_12.2: %empty_tuple.type = tuple_literal () @@ -189,12 +195,12 @@ fn Run() { // CHECK:STDOUT: %bound_method.loc18_35.5: = bound_method %.loc18_35.10, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1 // CHECK:STDOUT: %addr.loc18_35.2: %ptr.843 = addr_of %.loc18_35.10 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc18_35.1: init %empty_tuple.type = call %bound_method.loc18_35.5(%addr.loc18_35.2) -// CHECK:STDOUT: %facet_value.loc18_35.2: %type_where = facet_value constants.%Optional.68c, () [concrete = constants.%facet_value.136] -// CHECK:STDOUT: %.loc18_35.13: %type_where = converted constants.%Optional.68c, %facet_value.loc18_35.2 [concrete = constants.%facet_value.136] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc18_35.2: = bound_method %.loc18_35.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.fea +// CHECK:STDOUT: %facet_value.loc18_35.2: %type_where = facet_value constants.%Optional.c09, () [concrete = constants.%facet_value.d36] +// CHECK:STDOUT: %.loc18_35.13: %type_where = converted constants.%Optional.c09, %facet_value.loc18_35.2 [concrete = constants.%facet_value.d36] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc18_35.2: = bound_method %.loc18_35.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.15c // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc18_35.6: = bound_method %.loc18_35.2, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2 -// CHECK:STDOUT: %addr.loc18_35.3: %ptr.17e = addr_of %.loc18_35.2 +// CHECK:STDOUT: %addr.loc18_35.3: %ptr.2ba = addr_of %.loc18_35.2 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc18_35.2: init %empty_tuple.type = call %bound_method.loc18_35.6(%addr.loc18_35.3) // CHECK:STDOUT: %facet_value.loc18_35.3: %type_where = facet_value constants.%empty_tuple.type, () [concrete = constants.%facet_value.ff9] // CHECK:STDOUT: %.loc18_35.14: %type_where = converted constants.%empty_tuple.type, %facet_value.loc18_35.3 [concrete = constants.%facet_value.ff9] diff --git a/toolchain/check/testdata/for/pattern.carbon b/toolchain/check/testdata/for/pattern.carbon index ab6017d7316f1..5c9a979ff48e0 100644 --- a/toolchain/check/testdata/for/pattern.carbon +++ b/toolchain/check/testdata/for/pattern.carbon @@ -14,7 +14,7 @@ library "[[@TEST_NAME]]"; -class EmptyRange(T:! Core.Copy) { +class EmptyRange(T:! Core.Copy & Core.Destroy) { fn Make() -> Self { return {}; } impl as Core.Iterate where .CursorType = {} and .ElementType = T { @@ -129,60 +129,64 @@ fn Run() { // CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [concrete] // CHECK:STDOUT: %EmptyRange.type: type = generic_class_type @EmptyRange [concrete] // CHECK:STDOUT: %EmptyRange.generic: %EmptyRange.type = struct_value () [concrete] -// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] -// CHECK:STDOUT: %T.7dd: %Copy.type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %EmptyRange.Make.type.838: type = fn_type @EmptyRange.Make, @EmptyRange(%T.7dd) [symbolic] -// CHECK:STDOUT: %EmptyRange.Make.b34: %EmptyRange.Make.type.838 = struct_value () [symbolic] +// CHECK:STDOUT: %facet_type: type = facet_type <@Destroy & @Copy> [concrete] +// CHECK:STDOUT: %T.de3: %facet_type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %EmptyRange.Make.type.cd2: type = fn_type @EmptyRange.Make, @EmptyRange(%T.de3) [symbolic] +// CHECK:STDOUT: %EmptyRange.Make.5ef: %EmptyRange.Make.type.cd2 = struct_value () [symbolic] +// CHECK:STDOUT: %type_where: type = facet_type > [concrete] +// CHECK:STDOUT: %DestroyT: %type_where = bind_symbolic_name DestroyT, 0 [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.47d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%DestroyT) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.10b: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.47d = struct_value () [symbolic] +// CHECK:STDOUT: %facet_value.be8: %type_where = facet_value %C, () [concrete] +// CHECK:STDOUT: %Destroy.impl_witness.b41: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.be8) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.95b: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.be8) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.4a1: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.95b = struct_value () [concrete] +// CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete] // CHECK:STDOUT: %Copy.impl_witness.1de: = impl_witness imports.%Copy.impl_witness_table.2c6 [concrete] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %C, (%Copy.impl_witness.1de) [concrete] -// CHECK:STDOUT: %EmptyRange.ab3: type = class_type @EmptyRange, @EmptyRange(%Copy.facet) [concrete] -// CHECK:STDOUT: %EmptyRange.Make.type.f28: type = fn_type @EmptyRange.Make, @EmptyRange(%Copy.facet) [concrete] -// CHECK:STDOUT: %EmptyRange.Make.203: %EmptyRange.Make.type.f28 = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.203, @EmptyRange.Make(%Copy.facet) [concrete] +// CHECK:STDOUT: %facet_value.a99: %facet_type = facet_value %C, (%Destroy.impl_witness.b41, %Copy.impl_witness.1de) [concrete] +// CHECK:STDOUT: %EmptyRange.38c: type = class_type @EmptyRange, @EmptyRange(%facet_value.a99) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.type.7da: type = fn_type @EmptyRange.Make, @EmptyRange(%facet_value.a99) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.bf0: %EmptyRange.Make.type.7da = struct_value () [concrete] +// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.bf0, @EmptyRange.Make(%facet_value.a99) [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %Iterate.NewCursor.type: type = fn_type @Iterate.NewCursor [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.22a: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T.7dd) [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.28c: %EmptyRange.as.Iterate.impl.NewCursor.type.22a = struct_value () [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.e5a: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T.7dd) [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.185: %EmptyRange.as.Iterate.impl.Next.type.e5a = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.HasValue.type.5d5: type = fn_type @Optional.HasValue, @Optional(%T.7dd) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.d64: %Optional.HasValue.type.5d5 = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.Get.type.91e: type = fn_type @Optional.Get, @Optional(%T.7dd) [symbolic] -// CHECK:STDOUT: %Optional.Get.4d9: %Optional.Get.type.91e = struct_value () [symbolic] -// CHECK:STDOUT: %Iterate.impl_witness.9b1: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%Copy.facet) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.b3a: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%Copy.facet) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.680: %EmptyRange.as.Iterate.impl.NewCursor.type.b3a = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.7e7: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%Copy.facet) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.02b: %EmptyRange.as.Iterate.impl.Next.type.7e7 = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %EmptyRange.ab3, (%Iterate.impl_witness.9b1) [concrete] -// CHECK:STDOUT: %.740: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.680, @EmptyRange.as.Iterate.impl.NewCursor(%Copy.facet) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.b13: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T.de3) [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.081: %EmptyRange.as.Iterate.impl.NewCursor.type.b13 = struct_value () [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.7ed: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T.de3) [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.874: %EmptyRange.as.Iterate.impl.Next.type.7ed = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.e13: type = fn_type @Optional.HasValue, @Optional(%T.de3) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.d80: %Optional.HasValue.type.e13 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.Get.type.7cd: type = fn_type @Optional.Get, @Optional(%T.de3) [symbolic] +// CHECK:STDOUT: %Optional.Get.846: %Optional.Get.type.7cd = struct_value () [symbolic] +// CHECK:STDOUT: %Iterate.impl_witness.a7c: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%facet_value.a99) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.c88: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%facet_value.a99) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.0be: %EmptyRange.as.Iterate.impl.NewCursor.type.c88 = struct_value () [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.bf6: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%facet_value.a99) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.b98: %EmptyRange.as.Iterate.impl.Next.type.bf6 = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %EmptyRange.38c, (%Iterate.impl_witness.a7c) [concrete] +// CHECK:STDOUT: %.dc4: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.0be, @EmptyRange.as.Iterate.impl.NewCursor(%facet_value.a99) [concrete] // CHECK:STDOUT: %Iterate.Next.type: type = fn_type @Iterate.Next [concrete] -// CHECK:STDOUT: %.dc5: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %Optional.47f: type = class_type @Optional, @Optional(%Copy.facet) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.02b, @EmptyRange.as.Iterate.impl.Next(%Copy.facet) [concrete] -// CHECK:STDOUT: %Optional.HasValue.type.970: type = fn_type @Optional.HasValue, @Optional(%Copy.facet) [concrete] -// CHECK:STDOUT: %Optional.HasValue.ac0: %Optional.HasValue.type.970 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.f65: type = fn_type @Optional.Get, @Optional(%Copy.facet) [concrete] -// CHECK:STDOUT: %Optional.Get.71a: %Optional.Get.type.f65 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.ac0, @Optional.HasValue(%Copy.facet) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.71a, @Optional.Get(%Copy.facet) [concrete] -// CHECK:STDOUT: %type_where: type = facet_type > [concrete] -// CHECK:STDOUT: %facet_value.be8: %type_where = facet_value %C, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.ed8: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.be8) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.f93: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.ed8 = struct_value () [concrete] -// CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete] -// CHECK:STDOUT: %facet_value.94b: %type_where = facet_value %Optional.47f, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a5d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.94b) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.22f: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a5d = struct_value () [concrete] -// CHECK:STDOUT: %ptr.c56: type = ptr_type %Optional.47f [concrete] +// CHECK:STDOUT: %.862: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %Optional.6ac: type = class_type @Optional, @Optional(%facet_value.a99) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.b98, @EmptyRange.as.Iterate.impl.Next(%facet_value.a99) [concrete] +// CHECK:STDOUT: %Optional.HasValue.type.223: type = fn_type @Optional.HasValue, @Optional(%facet_value.a99) [concrete] +// CHECK:STDOUT: %Optional.HasValue.f56: %Optional.HasValue.type.223 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.35d: type = fn_type @Optional.Get, @Optional(%facet_value.a99) [concrete] +// CHECK:STDOUT: %Optional.Get.205: %Optional.Get.type.35d = struct_value () [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.f56, @Optional.HasValue(%facet_value.a99) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.205, @Optional.Get(%facet_value.a99) [concrete] +// CHECK:STDOUT: %facet_value.7a5: %type_where = facet_value %Optional.6ac, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a69: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.7a5) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.ef3: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a69 = struct_value () [concrete] +// CHECK:STDOUT: %ptr.70b: type = ptr_type %Optional.6ac [concrete] // CHECK:STDOUT: %facet_value.7c2: %type_where = facet_value %empty_struct_type, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.bd1: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.7c2) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.596: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.bd1 = struct_value () [concrete] -// CHECK:STDOUT: %facet_value.b6d: %type_where = facet_value %EmptyRange.ab3, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a3e: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.b6d) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.5f4: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a3e = struct_value () [concrete] -// CHECK:STDOUT: %ptr.43f: type = ptr_type %EmptyRange.ab3 [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.26d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.7c2) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.ddd: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.26d = struct_value () [concrete] +// CHECK:STDOUT: %facet_value.cd5: %type_where = facet_value %EmptyRange.38c, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.381: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.cd5) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.cac: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.381 = struct_value () [concrete] +// CHECK:STDOUT: %ptr.f56: type = ptr_type %EmptyRange.38c [concrete] // CHECK:STDOUT: %C.as.Copy.impl.Op.type: type = fn_type @C.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %C.as.Copy.impl.Op: %C.as.Copy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -190,16 +194,18 @@ fn Run() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.EmptyRange: %EmptyRange.type = import_ref Main//empty_range, EmptyRange, loaded [concrete = constants.%EmptyRange.generic] // CHECK:STDOUT: %Main.C: type = import_ref Main//empty_range, C, loaded [concrete = constants.%C] -// CHECK:STDOUT: %Main.import_ref.8f2f: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.838) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.b34)] +// CHECK:STDOUT: %Main.import_ref.e7c: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.cd2) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.5ef)] +// CHECK:STDOUT: %Core.import_ref.1a1: @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.47d) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.10b)] +// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.1a1), @DestroyT.binding.as_type.as.Destroy.impl [concrete] // CHECK:STDOUT: %Main.import_ref.157: %C.as.Copy.impl.Op.type = import_ref Main//empty_range, loc19_33, loaded [concrete = constants.%C.as.Copy.impl.Op] // CHECK:STDOUT: %Copy.impl_witness_table.2c6 = impl_witness_table (%Main.import_ref.157), @C.as.Copy.impl [concrete] -// CHECK:STDOUT: %Main.import_ref.4d9 = import_ref Main//empty_range, loc7_68, unloaded +// CHECK:STDOUT: %Main.import_ref.b9f = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded -// CHECK:STDOUT: %Main.import_ref.85e: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.22a) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.28c)] -// CHECK:STDOUT: %Main.import_ref.782: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.e5a) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.185)] -// CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.4d9, %Main.import_ref.999, %Main.import_ref.85e, %Main.import_ref.782), @EmptyRange.as.Iterate.impl [concrete] -// CHECK:STDOUT: %Main.import_ref.cfa: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.5d5) = import_ref Main//empty_range, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.d64)] -// CHECK:STDOUT: %Main.import_ref.01a: @Optional.%Optional.Get.type (%Optional.Get.type.91e) = import_ref Main//empty_range, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.4d9)] +// CHECK:STDOUT: %Main.import_ref.e75: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.b13) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.081)] +// CHECK:STDOUT: %Main.import_ref.c30: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.7ed) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.874)] +// CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.b9f, %Main.import_ref.999, %Main.import_ref.e75, %Main.import_ref.c30), @EmptyRange.as.Iterate.impl [concrete] +// CHECK:STDOUT: %Main.import_ref.2b8: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.e13) = import_ref Main//empty_range, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.d80)] +// CHECK:STDOUT: %Main.import_ref.e05: @Optional.%Optional.Get.type (%Optional.Get.type.7cd) = import_ref Main//empty_range, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.846)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -209,20 +215,22 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %EmptyRange.ref: %EmptyRange.type = name_ref EmptyRange, imports.%Main.EmptyRange [concrete = constants.%EmptyRange.generic] // CHECK:STDOUT: %C.ref.loc10_27: type = name_ref C, imports.%Main.C [concrete = constants.%C] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %C.ref.loc10_27, (constants.%Copy.impl_witness.1de) [concrete = constants.%Copy.facet] -// CHECK:STDOUT: %.loc10_28: %Copy.type = converted %C.ref.loc10_27, %Copy.facet [concrete = constants.%Copy.facet] -// CHECK:STDOUT: %EmptyRange: type = class_type @EmptyRange, @EmptyRange(constants.%Copy.facet) [concrete = constants.%EmptyRange.ab3] -// CHECK:STDOUT: %.loc10_29: %EmptyRange.Make.type.f28 = specific_constant imports.%Main.import_ref.8f2f, @EmptyRange(constants.%Copy.facet) [concrete = constants.%EmptyRange.Make.203] -// CHECK:STDOUT: %Make.ref: %EmptyRange.Make.type.f28 = name_ref Make, %.loc10_29 [concrete = constants.%EmptyRange.Make.203] -// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %Make.ref, @EmptyRange.Make(constants.%Copy.facet) [concrete = constants.%EmptyRange.Make.specific_fn] -// CHECK:STDOUT: %.loc10_35.1: ref %EmptyRange.ab3 = temporary_storage -// CHECK:STDOUT: %EmptyRange.Make.call: init %EmptyRange.ab3 = call %EmptyRange.Make.specific_fn() to %.loc10_35.1 -// CHECK:STDOUT: %.loc10_35.2: ref %EmptyRange.ab3 = temporary %.loc10_35.1, %EmptyRange.Make.call -// CHECK:STDOUT: %impl.elem2: %.740 = impl_witness_access constants.%Iterate.impl_witness.9b1, element2 [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.680] +// CHECK:STDOUT: %facet_value.loc10_28.1: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value.be8] +// CHECK:STDOUT: %.loc10_28.1: %type_where = converted constants.%C, %facet_value.loc10_28.1 [concrete = constants.%facet_value.be8] +// CHECK:STDOUT: %facet_value.loc10_28.2: %facet_type = facet_value %C.ref.loc10_27, (constants.%Destroy.impl_witness.b41, constants.%Copy.impl_witness.1de) [concrete = constants.%facet_value.a99] +// CHECK:STDOUT: %.loc10_28.2: %facet_type = converted %C.ref.loc10_27, %facet_value.loc10_28.2 [concrete = constants.%facet_value.a99] +// CHECK:STDOUT: %EmptyRange: type = class_type @EmptyRange, @EmptyRange(constants.%facet_value.a99) [concrete = constants.%EmptyRange.38c] +// CHECK:STDOUT: %.loc10_29: %EmptyRange.Make.type.7da = specific_constant imports.%Main.import_ref.e7c, @EmptyRange(constants.%facet_value.a99) [concrete = constants.%EmptyRange.Make.bf0] +// CHECK:STDOUT: %Make.ref: %EmptyRange.Make.type.7da = name_ref Make, %.loc10_29 [concrete = constants.%EmptyRange.Make.bf0] +// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %Make.ref, @EmptyRange.Make(constants.%facet_value.a99) [concrete = constants.%EmptyRange.Make.specific_fn] +// CHECK:STDOUT: %.loc10_35.1: ref %EmptyRange.38c = temporary_storage +// CHECK:STDOUT: %EmptyRange.Make.call: init %EmptyRange.38c = call %EmptyRange.Make.specific_fn() to %.loc10_35.1 +// CHECK:STDOUT: %.loc10_35.2: ref %EmptyRange.38c = temporary %.loc10_35.1, %EmptyRange.Make.call +// CHECK:STDOUT: %impl.elem2: %.dc4 = impl_witness_access constants.%Iterate.impl_witness.a7c, element2 [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.0be] // CHECK:STDOUT: %bound_method.loc10_36.1: = bound_method %.loc10_35.2, %impl.elem2 -// CHECK:STDOUT: %specific_fn.loc10_36.1: = specific_function %impl.elem2, @EmptyRange.as.Iterate.impl.NewCursor(constants.%Copy.facet) [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.specific_fn] +// CHECK:STDOUT: %specific_fn.loc10_36.1: = specific_function %impl.elem2, @EmptyRange.as.Iterate.impl.NewCursor(constants.%facet_value.a99) [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.specific_fn] // CHECK:STDOUT: %bound_method.loc10_36.2: = bound_method %.loc10_35.2, %specific_fn.loc10_36.1 -// CHECK:STDOUT: %.loc10_35.3: %EmptyRange.ab3 = bind_value %.loc10_35.2 +// CHECK:STDOUT: %.loc10_35.3: %EmptyRange.38c = bind_value %.loc10_35.2 // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.call: init %empty_struct_type = call %bound_method.loc10_36.2(%.loc10_35.3) // CHECK:STDOUT: %var: ref %empty_struct_type = var invalid // CHECK:STDOUT: assign %var, %EmptyRange.as.Iterate.impl.NewCursor.call @@ -230,33 +238,33 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr.loc10_36.1: %ptr.c28 = addr_of %var -// CHECK:STDOUT: %impl.elem3: %.dc5 = impl_witness_access constants.%Iterate.impl_witness.9b1, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.02b] +// CHECK:STDOUT: %impl.elem3: %.862 = impl_witness_access constants.%Iterate.impl_witness.a7c, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.b98] // CHECK:STDOUT: %bound_method.loc10_36.3: = bound_method %.loc10_35.2, %impl.elem3 -// CHECK:STDOUT: %specific_fn.loc10_36.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%Copy.facet) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] +// CHECK:STDOUT: %specific_fn.loc10_36.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%facet_value.a99) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] // CHECK:STDOUT: %bound_method.loc10_36.4: = bound_method %.loc10_35.2, %specific_fn.loc10_36.2 -// CHECK:STDOUT: %.loc10_36.1: ref %Optional.47f = temporary_storage -// CHECK:STDOUT: %.loc10_35.4: %EmptyRange.ab3 = bind_value %.loc10_35.2 -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.47f = call %bound_method.loc10_36.4(%.loc10_35.4, %addr.loc10_36.1) to %.loc10_36.1 -// CHECK:STDOUT: %.loc10_36.2: ref %Optional.47f = temporary %.loc10_36.1, %EmptyRange.as.Iterate.impl.Next.call -// CHECK:STDOUT: %.loc10_36.3: %Optional.HasValue.type.970 = specific_constant imports.%Main.import_ref.cfa, @Optional(constants.%Copy.facet) [concrete = constants.%Optional.HasValue.ac0] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.970 = name_ref HasValue, %.loc10_36.3 [concrete = constants.%Optional.HasValue.ac0] +// CHECK:STDOUT: %.loc10_36.1: ref %Optional.6ac = temporary_storage +// CHECK:STDOUT: %.loc10_35.4: %EmptyRange.38c = bind_value %.loc10_35.2 +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.6ac = call %bound_method.loc10_36.4(%.loc10_35.4, %addr.loc10_36.1) to %.loc10_36.1 +// CHECK:STDOUT: %.loc10_36.2: ref %Optional.6ac = temporary %.loc10_36.1, %EmptyRange.as.Iterate.impl.Next.call +// CHECK:STDOUT: %.loc10_36.3: %Optional.HasValue.type.223 = specific_constant imports.%Main.import_ref.2b8, @Optional(constants.%facet_value.a99) [concrete = constants.%Optional.HasValue.f56] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.223 = name_ref HasValue, %.loc10_36.3 [concrete = constants.%Optional.HasValue.f56] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc10_36.2, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%Copy.facet) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%facet_value.a99) [concrete = constants.%Optional.HasValue.specific_fn] // CHECK:STDOUT: %bound_method.loc10_36.5: = bound_method %.loc10_36.2, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc10_36.4: %Optional.47f = bind_value %.loc10_36.2 +// CHECK:STDOUT: %.loc10_36.4: %Optional.6ac = bind_value %.loc10_36.2 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc10_36.5(%.loc10_36.4) // CHECK:STDOUT: %.loc10_36.5: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc10_36.6: bool = converted %Optional.HasValue.call, %.loc10_36.5 // CHECK:STDOUT: if %.loc10_36.6 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc10_36.7: %Optional.Get.type.f65 = specific_constant imports.%Main.import_ref.01a, @Optional(constants.%Copy.facet) [concrete = constants.%Optional.Get.71a] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.f65 = name_ref Get, %.loc10_36.7 [concrete = constants.%Optional.Get.71a] +// CHECK:STDOUT: %.loc10_36.7: %Optional.Get.type.35d = specific_constant imports.%Main.import_ref.e05, @Optional(constants.%facet_value.a99) [concrete = constants.%Optional.Get.205] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.35d = name_ref Get, %.loc10_36.7 [concrete = constants.%Optional.Get.205] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc10_36.2, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%Copy.facet) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%facet_value.a99) [concrete = constants.%Optional.Get.specific_fn] // CHECK:STDOUT: %bound_method.loc10_36.6: = bound_method %.loc10_36.2, %Optional.Get.specific_fn // CHECK:STDOUT: %.loc10_36.8: ref %C = temporary_storage -// CHECK:STDOUT: %.loc10_36.9: %Optional.47f = bind_value %.loc10_36.2 +// CHECK:STDOUT: %.loc10_36.9: %Optional.6ac = bind_value %.loc10_36.2 // CHECK:STDOUT: %Optional.Get.call: init %C = call %bound_method.loc10_36.6(%.loc10_36.9) to %.loc10_36.8 // CHECK:STDOUT: %C.ref.loc10_11: type = name_ref C, imports.%Main.C [concrete = constants.%C] // CHECK:STDOUT: %.loc10_36.10: ref %C = temporary %.loc10_36.8, %Optional.Get.call @@ -270,31 +278,31 @@ fn Run() { // CHECK:STDOUT: !for.done: // CHECK:STDOUT: %facet_value.loc10_36.1: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value.be8] // CHECK:STDOUT: %.loc10_36.12: %type_where = converted constants.%C, %facet_value.loc10_36.1 [concrete = constants.%facet_value.be8] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_36.1: = bound_method %.loc10_36.10, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.f93 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_36.1: = bound_method %.loc10_36.10, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.4a1 // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_36.7: = bound_method %.loc10_36.10, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1 // CHECK:STDOUT: %addr.loc10_36.2: %ptr.019 = addr_of %.loc10_36.10 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10_36.1: init %empty_tuple.type = call %bound_method.loc10_36.7(%addr.loc10_36.2) -// CHECK:STDOUT: %facet_value.loc10_36.2: %type_where = facet_value constants.%Optional.47f, () [concrete = constants.%facet_value.94b] -// CHECK:STDOUT: %.loc10_36.13: %type_where = converted constants.%Optional.47f, %facet_value.loc10_36.2 [concrete = constants.%facet_value.94b] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_36.2: = bound_method %.loc10_36.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.22f +// CHECK:STDOUT: %facet_value.loc10_36.2: %type_where = facet_value constants.%Optional.6ac, () [concrete = constants.%facet_value.7a5] +// CHECK:STDOUT: %.loc10_36.13: %type_where = converted constants.%Optional.6ac, %facet_value.loc10_36.2 [concrete = constants.%facet_value.7a5] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_36.2: = bound_method %.loc10_36.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.ef3 // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_36.8: = bound_method %.loc10_36.2, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2 -// CHECK:STDOUT: %addr.loc10_36.3: %ptr.c56 = addr_of %.loc10_36.2 +// CHECK:STDOUT: %addr.loc10_36.3: %ptr.70b = addr_of %.loc10_36.2 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10_36.2: init %empty_tuple.type = call %bound_method.loc10_36.8(%addr.loc10_36.3) // CHECK:STDOUT: %facet_value.loc10_36.3: %type_where = facet_value constants.%empty_struct_type, () [concrete = constants.%facet_value.7c2] // CHECK:STDOUT: %.loc10_36.14: %type_where = converted constants.%empty_struct_type, %facet_value.loc10_36.3 [concrete = constants.%facet_value.7c2] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_36.3: = bound_method %var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.596 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_36.3: = bound_method %var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.ddd // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_36.9: = bound_method %var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3 // CHECK:STDOUT: %addr.loc10_36.4: %ptr.c28 = addr_of %var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10_36.3: init %empty_tuple.type = call %bound_method.loc10_36.9(%addr.loc10_36.4) -// CHECK:STDOUT: %facet_value.loc10_35: %type_where = facet_value constants.%EmptyRange.ab3, () [concrete = constants.%facet_value.b6d] -// CHECK:STDOUT: %.loc10_35.5: %type_where = converted constants.%EmptyRange.ab3, %facet_value.loc10_35 [concrete = constants.%facet_value.b6d] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_35: = bound_method %.loc10_35.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.5f4 +// CHECK:STDOUT: %facet_value.loc10_35: %type_where = facet_value constants.%EmptyRange.38c, () [concrete = constants.%facet_value.cd5] +// CHECK:STDOUT: %.loc10_35.5: %type_where = converted constants.%EmptyRange.38c, %facet_value.loc10_35 [concrete = constants.%facet_value.cd5] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_35: = bound_method %.loc10_35.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.cac // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_35: = bound_method %.loc10_35.2, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.4 -// CHECK:STDOUT: %addr.loc10_35: %ptr.43f = addr_of %.loc10_35.2 +// CHECK:STDOUT: %addr.loc10_35: %ptr.f56 = addr_of %.loc10_35.2 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10_35: init %empty_tuple.type = call %bound_method.loc10_35(%addr.loc10_35) // CHECK:STDOUT: // CHECK:STDOUT: } @@ -312,59 +320,63 @@ fn Run() { // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] // CHECK:STDOUT: %EmptyRange.type: type = generic_class_type @EmptyRange [concrete] // CHECK:STDOUT: %EmptyRange.generic: %EmptyRange.type = struct_value () [concrete] -// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] -// CHECK:STDOUT: %T.7dd: %Copy.type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %EmptyRange.Make.type.838: type = fn_type @EmptyRange.Make, @EmptyRange(%T.7dd) [symbolic] -// CHECK:STDOUT: %EmptyRange.Make.b34: %EmptyRange.Make.type.838 = struct_value () [symbolic] +// CHECK:STDOUT: %facet_type: type = facet_type <@Destroy & @Copy> [concrete] +// CHECK:STDOUT: %T.de3: %facet_type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %EmptyRange.Make.type.cd2: type = fn_type @EmptyRange.Make, @EmptyRange(%T.de3) [symbolic] +// CHECK:STDOUT: %EmptyRange.Make.5ef: %EmptyRange.Make.type.cd2 = struct_value () [symbolic] +// CHECK:STDOUT: %type_where: type = facet_type > [concrete] +// CHECK:STDOUT: %DestroyT: %type_where = bind_symbolic_name DestroyT, 0 [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.47d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%DestroyT) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.10b: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.47d = struct_value () [symbolic] +// CHECK:STDOUT: %facet_value.be8: %type_where = facet_value %C, () [concrete] +// CHECK:STDOUT: %Destroy.impl_witness.b41: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.be8) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.95b: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.be8) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.4a1: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.95b = struct_value () [concrete] // CHECK:STDOUT: %Copy.impl_witness.1de: = impl_witness imports.%Copy.impl_witness_table.2c6 [concrete] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %C, (%Copy.impl_witness.1de) [concrete] -// CHECK:STDOUT: %EmptyRange.ab3: type = class_type @EmptyRange, @EmptyRange(%Copy.facet) [concrete] -// CHECK:STDOUT: %EmptyRange.Make.type.f28: type = fn_type @EmptyRange.Make, @EmptyRange(%Copy.facet) [concrete] -// CHECK:STDOUT: %EmptyRange.Make.203: %EmptyRange.Make.type.f28 = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.203, @EmptyRange.Make(%Copy.facet) [concrete] +// CHECK:STDOUT: %facet_value.a99: %facet_type = facet_value %C, (%Destroy.impl_witness.b41, %Copy.impl_witness.1de) [concrete] +// CHECK:STDOUT: %EmptyRange.38c: type = class_type @EmptyRange, @EmptyRange(%facet_value.a99) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.type.7da: type = fn_type @EmptyRange.Make, @EmptyRange(%facet_value.a99) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.bf0: %EmptyRange.Make.type.7da = struct_value () [concrete] +// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.bf0, @EmptyRange.Make(%facet_value.a99) [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %Iterate.NewCursor.type: type = fn_type @Iterate.NewCursor [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.22a: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T.7dd) [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.28c: %EmptyRange.as.Iterate.impl.NewCursor.type.22a = struct_value () [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.e5a: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T.7dd) [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.185: %EmptyRange.as.Iterate.impl.Next.type.e5a = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.HasValue.type.5d5: type = fn_type @Optional.HasValue, @Optional(%T.7dd) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.d64: %Optional.HasValue.type.5d5 = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.Get.type.91e: type = fn_type @Optional.Get, @Optional(%T.7dd) [symbolic] -// CHECK:STDOUT: %Optional.Get.4d9: %Optional.Get.type.91e = struct_value () [symbolic] -// CHECK:STDOUT: %Iterate.impl_witness.9b1: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%Copy.facet) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.b3a: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%Copy.facet) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.680: %EmptyRange.as.Iterate.impl.NewCursor.type.b3a = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.7e7: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%Copy.facet) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.02b: %EmptyRange.as.Iterate.impl.Next.type.7e7 = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %EmptyRange.ab3, (%Iterate.impl_witness.9b1) [concrete] -// CHECK:STDOUT: %.740: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.680, @EmptyRange.as.Iterate.impl.NewCursor(%Copy.facet) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.b13: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T.de3) [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.081: %EmptyRange.as.Iterate.impl.NewCursor.type.b13 = struct_value () [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.7ed: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T.de3) [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.874: %EmptyRange.as.Iterate.impl.Next.type.7ed = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.e13: type = fn_type @Optional.HasValue, @Optional(%T.de3) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.d80: %Optional.HasValue.type.e13 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.Get.type.7cd: type = fn_type @Optional.Get, @Optional(%T.de3) [symbolic] +// CHECK:STDOUT: %Optional.Get.846: %Optional.Get.type.7cd = struct_value () [symbolic] +// CHECK:STDOUT: %Iterate.impl_witness.a7c: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%facet_value.a99) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.c88: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%facet_value.a99) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.0be: %EmptyRange.as.Iterate.impl.NewCursor.type.c88 = struct_value () [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.bf6: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%facet_value.a99) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.b98: %EmptyRange.as.Iterate.impl.Next.type.bf6 = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %EmptyRange.38c, (%Iterate.impl_witness.a7c) [concrete] +// CHECK:STDOUT: %.dc4: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.0be, @EmptyRange.as.Iterate.impl.NewCursor(%facet_value.a99) [concrete] // CHECK:STDOUT: %Iterate.Next.type: type = fn_type @Iterate.Next [concrete] -// CHECK:STDOUT: %.dc5: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %Optional.47f: type = class_type @Optional, @Optional(%Copy.facet) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.02b, @EmptyRange.as.Iterate.impl.Next(%Copy.facet) [concrete] -// CHECK:STDOUT: %Optional.HasValue.type.970: type = fn_type @Optional.HasValue, @Optional(%Copy.facet) [concrete] -// CHECK:STDOUT: %Optional.HasValue.ac0: %Optional.HasValue.type.970 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.f65: type = fn_type @Optional.Get, @Optional(%Copy.facet) [concrete] -// CHECK:STDOUT: %Optional.Get.71a: %Optional.Get.type.f65 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.ac0, @Optional.HasValue(%Copy.facet) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.71a, @Optional.Get(%Copy.facet) [concrete] -// CHECK:STDOUT: %type_where: type = facet_type > [concrete] -// CHECK:STDOUT: %facet_value.be8: %type_where = facet_value %C, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.ed8: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.be8) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.f93: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.ed8 = struct_value () [concrete] -// CHECK:STDOUT: %facet_value.94b: %type_where = facet_value %Optional.47f, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a5d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.94b) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.22f: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a5d = struct_value () [concrete] -// CHECK:STDOUT: %ptr.c56: type = ptr_type %Optional.47f [concrete] +// CHECK:STDOUT: %.862: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %Optional.6ac: type = class_type @Optional, @Optional(%facet_value.a99) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.b98, @EmptyRange.as.Iterate.impl.Next(%facet_value.a99) [concrete] +// CHECK:STDOUT: %Optional.HasValue.type.223: type = fn_type @Optional.HasValue, @Optional(%facet_value.a99) [concrete] +// CHECK:STDOUT: %Optional.HasValue.f56: %Optional.HasValue.type.223 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.35d: type = fn_type @Optional.Get, @Optional(%facet_value.a99) [concrete] +// CHECK:STDOUT: %Optional.Get.205: %Optional.Get.type.35d = struct_value () [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.f56, @Optional.HasValue(%facet_value.a99) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.205, @Optional.Get(%facet_value.a99) [concrete] +// CHECK:STDOUT: %facet_value.7a5: %type_where = facet_value %Optional.6ac, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a69: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.7a5) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.ef3: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a69 = struct_value () [concrete] +// CHECK:STDOUT: %ptr.70b: type = ptr_type %Optional.6ac [concrete] // CHECK:STDOUT: %facet_value.7c2: %type_where = facet_value %empty_struct_type, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.bd1: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.7c2) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.596: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.bd1 = struct_value () [concrete] -// CHECK:STDOUT: %facet_value.b6d: %type_where = facet_value %EmptyRange.ab3, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a3e: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.b6d) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.5f4: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a3e = struct_value () [concrete] -// CHECK:STDOUT: %ptr.43f: type = ptr_type %EmptyRange.ab3 [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.26d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.7c2) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.ddd: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.26d = struct_value () [concrete] +// CHECK:STDOUT: %facet_value.cd5: %type_where = facet_value %EmptyRange.38c, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.381: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.cd5) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.cac: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.381 = struct_value () [concrete] +// CHECK:STDOUT: %ptr.f56: type = ptr_type %EmptyRange.38c [concrete] // CHECK:STDOUT: %C.as.Copy.impl.Op.type: type = fn_type @C.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %C.as.Copy.impl.Op: %C.as.Copy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -372,16 +384,18 @@ fn Run() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.EmptyRange: %EmptyRange.type = import_ref Main//empty_range, EmptyRange, loaded [concrete = constants.%EmptyRange.generic] // CHECK:STDOUT: %Main.C: type = import_ref Main//empty_range, C, loaded [concrete = constants.%C] -// CHECK:STDOUT: %Main.import_ref.8f2f: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.838) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.b34)] +// CHECK:STDOUT: %Main.import_ref.e7c: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.cd2) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.5ef)] +// CHECK:STDOUT: %Core.import_ref.1a1: @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.47d) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.10b)] +// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.1a1), @DestroyT.binding.as_type.as.Destroy.impl [concrete] // CHECK:STDOUT: %Main.import_ref.157: %C.as.Copy.impl.Op.type = import_ref Main//empty_range, loc19_33, loaded [concrete = constants.%C.as.Copy.impl.Op] // CHECK:STDOUT: %Copy.impl_witness_table.2c6 = impl_witness_table (%Main.import_ref.157), @C.as.Copy.impl [concrete] -// CHECK:STDOUT: %Main.import_ref.4d9 = import_ref Main//empty_range, loc7_68, unloaded +// CHECK:STDOUT: %Main.import_ref.b9f = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded -// CHECK:STDOUT: %Main.import_ref.85e: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.22a) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.28c)] -// CHECK:STDOUT: %Main.import_ref.782: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.e5a) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.185)] -// CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.4d9, %Main.import_ref.999, %Main.import_ref.85e, %Main.import_ref.782), @EmptyRange.as.Iterate.impl [concrete] -// CHECK:STDOUT: %Main.import_ref.cfa: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.5d5) = import_ref Main//empty_range, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.d64)] -// CHECK:STDOUT: %Main.import_ref.01a: @Optional.%Optional.Get.type (%Optional.Get.type.91e) = import_ref Main//empty_range, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.4d9)] +// CHECK:STDOUT: %Main.import_ref.e75: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.b13) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.081)] +// CHECK:STDOUT: %Main.import_ref.c30: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.7ed) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.874)] +// CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.b9f, %Main.import_ref.999, %Main.import_ref.e75, %Main.import_ref.c30), @EmptyRange.as.Iterate.impl [concrete] +// CHECK:STDOUT: %Main.import_ref.2b8: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.e13) = import_ref Main//empty_range, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.d80)] +// CHECK:STDOUT: %Main.import_ref.e05: @Optional.%Optional.Get.type (%Optional.Get.type.7cd) = import_ref Main//empty_range, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.846)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -392,20 +406,22 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %EmptyRange.ref: %EmptyRange.type = name_ref EmptyRange, imports.%Main.EmptyRange [concrete = constants.%EmptyRange.generic] // CHECK:STDOUT: %C.ref.loc10_31: type = name_ref C, imports.%Main.C [concrete = constants.%C] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %C.ref.loc10_31, (constants.%Copy.impl_witness.1de) [concrete = constants.%Copy.facet] -// CHECK:STDOUT: %.loc10_32: %Copy.type = converted %C.ref.loc10_31, %Copy.facet [concrete = constants.%Copy.facet] -// CHECK:STDOUT: %EmptyRange: type = class_type @EmptyRange, @EmptyRange(constants.%Copy.facet) [concrete = constants.%EmptyRange.ab3] -// CHECK:STDOUT: %.loc10_33: %EmptyRange.Make.type.f28 = specific_constant imports.%Main.import_ref.8f2f, @EmptyRange(constants.%Copy.facet) [concrete = constants.%EmptyRange.Make.203] -// CHECK:STDOUT: %Make.ref: %EmptyRange.Make.type.f28 = name_ref Make, %.loc10_33 [concrete = constants.%EmptyRange.Make.203] -// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %Make.ref, @EmptyRange.Make(constants.%Copy.facet) [concrete = constants.%EmptyRange.Make.specific_fn] -// CHECK:STDOUT: %.loc10_39.1: ref %EmptyRange.ab3 = temporary_storage -// CHECK:STDOUT: %EmptyRange.Make.call: init %EmptyRange.ab3 = call %EmptyRange.Make.specific_fn() to %.loc10_39.1 -// CHECK:STDOUT: %.loc10_39.2: ref %EmptyRange.ab3 = temporary %.loc10_39.1, %EmptyRange.Make.call -// CHECK:STDOUT: %impl.elem2: %.740 = impl_witness_access constants.%Iterate.impl_witness.9b1, element2 [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.680] +// CHECK:STDOUT: %facet_value.loc10_32.1: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value.be8] +// CHECK:STDOUT: %.loc10_32.1: %type_where = converted constants.%C, %facet_value.loc10_32.1 [concrete = constants.%facet_value.be8] +// CHECK:STDOUT: %facet_value.loc10_32.2: %facet_type = facet_value %C.ref.loc10_31, (constants.%Destroy.impl_witness.b41, constants.%Copy.impl_witness.1de) [concrete = constants.%facet_value.a99] +// CHECK:STDOUT: %.loc10_32.2: %facet_type = converted %C.ref.loc10_31, %facet_value.loc10_32.2 [concrete = constants.%facet_value.a99] +// CHECK:STDOUT: %EmptyRange: type = class_type @EmptyRange, @EmptyRange(constants.%facet_value.a99) [concrete = constants.%EmptyRange.38c] +// CHECK:STDOUT: %.loc10_33: %EmptyRange.Make.type.7da = specific_constant imports.%Main.import_ref.e7c, @EmptyRange(constants.%facet_value.a99) [concrete = constants.%EmptyRange.Make.bf0] +// CHECK:STDOUT: %Make.ref: %EmptyRange.Make.type.7da = name_ref Make, %.loc10_33 [concrete = constants.%EmptyRange.Make.bf0] +// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %Make.ref, @EmptyRange.Make(constants.%facet_value.a99) [concrete = constants.%EmptyRange.Make.specific_fn] +// CHECK:STDOUT: %.loc10_39.1: ref %EmptyRange.38c = temporary_storage +// CHECK:STDOUT: %EmptyRange.Make.call: init %EmptyRange.38c = call %EmptyRange.Make.specific_fn() to %.loc10_39.1 +// CHECK:STDOUT: %.loc10_39.2: ref %EmptyRange.38c = temporary %.loc10_39.1, %EmptyRange.Make.call +// CHECK:STDOUT: %impl.elem2: %.dc4 = impl_witness_access constants.%Iterate.impl_witness.a7c, element2 [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.0be] // CHECK:STDOUT: %bound_method.loc10_40.1: = bound_method %.loc10_39.2, %impl.elem2 -// CHECK:STDOUT: %specific_fn.loc10_40.1: = specific_function %impl.elem2, @EmptyRange.as.Iterate.impl.NewCursor(constants.%Copy.facet) [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.specific_fn] +// CHECK:STDOUT: %specific_fn.loc10_40.1: = specific_function %impl.elem2, @EmptyRange.as.Iterate.impl.NewCursor(constants.%facet_value.a99) [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.specific_fn] // CHECK:STDOUT: %bound_method.loc10_40.2: = bound_method %.loc10_39.2, %specific_fn.loc10_40.1 -// CHECK:STDOUT: %.loc10_39.3: %EmptyRange.ab3 = bind_value %.loc10_39.2 +// CHECK:STDOUT: %.loc10_39.3: %EmptyRange.38c = bind_value %.loc10_39.2 // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.call: init %empty_struct_type = call %bound_method.loc10_40.2(%.loc10_39.3) // CHECK:STDOUT: %var: ref %empty_struct_type = var invalid // CHECK:STDOUT: assign %var, %EmptyRange.as.Iterate.impl.NewCursor.call @@ -413,20 +429,20 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr.loc10_40.1: %ptr.c28 = addr_of %var -// CHECK:STDOUT: %impl.elem3: %.dc5 = impl_witness_access constants.%Iterate.impl_witness.9b1, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.02b] +// CHECK:STDOUT: %impl.elem3: %.862 = impl_witness_access constants.%Iterate.impl_witness.a7c, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.b98] // CHECK:STDOUT: %bound_method.loc10_40.3: = bound_method %.loc10_39.2, %impl.elem3 -// CHECK:STDOUT: %specific_fn.loc10_40.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%Copy.facet) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] +// CHECK:STDOUT: %specific_fn.loc10_40.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%facet_value.a99) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] // CHECK:STDOUT: %bound_method.loc10_40.4: = bound_method %.loc10_39.2, %specific_fn.loc10_40.2 -// CHECK:STDOUT: %.loc10_40.1: ref %Optional.47f = temporary_storage -// CHECK:STDOUT: %.loc10_39.4: %EmptyRange.ab3 = bind_value %.loc10_39.2 -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.47f = call %bound_method.loc10_40.4(%.loc10_39.4, %addr.loc10_40.1) to %.loc10_40.1 -// CHECK:STDOUT: %.loc10_40.2: ref %Optional.47f = temporary %.loc10_40.1, %EmptyRange.as.Iterate.impl.Next.call -// CHECK:STDOUT: %.loc10_40.3: %Optional.HasValue.type.970 = specific_constant imports.%Main.import_ref.cfa, @Optional(constants.%Copy.facet) [concrete = constants.%Optional.HasValue.ac0] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.970 = name_ref HasValue, %.loc10_40.3 [concrete = constants.%Optional.HasValue.ac0] +// CHECK:STDOUT: %.loc10_40.1: ref %Optional.6ac = temporary_storage +// CHECK:STDOUT: %.loc10_39.4: %EmptyRange.38c = bind_value %.loc10_39.2 +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.6ac = call %bound_method.loc10_40.4(%.loc10_39.4, %addr.loc10_40.1) to %.loc10_40.1 +// CHECK:STDOUT: %.loc10_40.2: ref %Optional.6ac = temporary %.loc10_40.1, %EmptyRange.as.Iterate.impl.Next.call +// CHECK:STDOUT: %.loc10_40.3: %Optional.HasValue.type.223 = specific_constant imports.%Main.import_ref.2b8, @Optional(constants.%facet_value.a99) [concrete = constants.%Optional.HasValue.f56] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.223 = name_ref HasValue, %.loc10_40.3 [concrete = constants.%Optional.HasValue.f56] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc10_40.2, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%Copy.facet) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%facet_value.a99) [concrete = constants.%Optional.HasValue.specific_fn] // CHECK:STDOUT: %bound_method.loc10_40.5: = bound_method %.loc10_40.2, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc10_40.4: %Optional.47f = bind_value %.loc10_40.2 +// CHECK:STDOUT: %.loc10_40.4: %Optional.6ac = bind_value %.loc10_40.2 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc10_40.5(%.loc10_40.4) // CHECK:STDOUT: %.loc10_40.5: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc10_40.6: bool = converted %Optional.HasValue.call, %.loc10_40.5 @@ -434,13 +450,13 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: !for.body: // CHECK:STDOUT: %c.var: ref %C = var %c.var_patt -// CHECK:STDOUT: %.loc10_40.7: %Optional.Get.type.f65 = specific_constant imports.%Main.import_ref.01a, @Optional(constants.%Copy.facet) [concrete = constants.%Optional.Get.71a] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.f65 = name_ref Get, %.loc10_40.7 [concrete = constants.%Optional.Get.71a] +// CHECK:STDOUT: %.loc10_40.7: %Optional.Get.type.35d = specific_constant imports.%Main.import_ref.e05, @Optional(constants.%facet_value.a99) [concrete = constants.%Optional.Get.205] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.35d = name_ref Get, %.loc10_40.7 [concrete = constants.%Optional.Get.205] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc10_40.2, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%Copy.facet) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%facet_value.a99) [concrete = constants.%Optional.Get.specific_fn] // CHECK:STDOUT: %bound_method.loc10_40.6: = bound_method %.loc10_40.2, %Optional.Get.specific_fn // CHECK:STDOUT: %.loc10_8.1: ref %C = splice_block %c.var {} -// CHECK:STDOUT: %.loc10_40.8: %Optional.47f = bind_value %.loc10_40.2 +// CHECK:STDOUT: %.loc10_40.8: %Optional.6ac = bind_value %.loc10_40.2 // CHECK:STDOUT: %Optional.Get.call: init %C = call %bound_method.loc10_40.6(%.loc10_40.8) to %.loc10_8.1 // CHECK:STDOUT: assign %c.var, %Optional.Get.call // CHECK:STDOUT: %C.ref.loc10_15: type = name_ref C, imports.%Main.C [concrete = constants.%C] @@ -454,31 +470,31 @@ fn Run() { // CHECK:STDOUT: !for.done: // CHECK:STDOUT: %facet_value.loc10_8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value.be8] // CHECK:STDOUT: %.loc10_8.2: %type_where = converted constants.%C, %facet_value.loc10_8 [concrete = constants.%facet_value.be8] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_8: = bound_method %c.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.f93 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_8: = bound_method %c.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.4a1 // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_8: = bound_method %c.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1 // CHECK:STDOUT: %addr.loc10_8: %ptr.019 = addr_of %c.var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10_8: init %empty_tuple.type = call %bound_method.loc10_8(%addr.loc10_8) -// CHECK:STDOUT: %facet_value.loc10_40.1: %type_where = facet_value constants.%Optional.47f, () [concrete = constants.%facet_value.94b] -// CHECK:STDOUT: %.loc10_40.9: %type_where = converted constants.%Optional.47f, %facet_value.loc10_40.1 [concrete = constants.%facet_value.94b] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_40.1: = bound_method %.loc10_40.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.22f +// CHECK:STDOUT: %facet_value.loc10_40.1: %type_where = facet_value constants.%Optional.6ac, () [concrete = constants.%facet_value.7a5] +// CHECK:STDOUT: %.loc10_40.9: %type_where = converted constants.%Optional.6ac, %facet_value.loc10_40.1 [concrete = constants.%facet_value.7a5] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_40.1: = bound_method %.loc10_40.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.ef3 // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_40.7: = bound_method %.loc10_40.2, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2 -// CHECK:STDOUT: %addr.loc10_40.2: %ptr.c56 = addr_of %.loc10_40.2 +// CHECK:STDOUT: %addr.loc10_40.2: %ptr.70b = addr_of %.loc10_40.2 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10_40.1: init %empty_tuple.type = call %bound_method.loc10_40.7(%addr.loc10_40.2) // CHECK:STDOUT: %facet_value.loc10_40.2: %type_where = facet_value constants.%empty_struct_type, () [concrete = constants.%facet_value.7c2] // CHECK:STDOUT: %.loc10_40.10: %type_where = converted constants.%empty_struct_type, %facet_value.loc10_40.2 [concrete = constants.%facet_value.7c2] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_40.2: = bound_method %var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.596 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_40.2: = bound_method %var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.ddd // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_40.8: = bound_method %var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3 // CHECK:STDOUT: %addr.loc10_40.3: %ptr.c28 = addr_of %var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10_40.2: init %empty_tuple.type = call %bound_method.loc10_40.8(%addr.loc10_40.3) -// CHECK:STDOUT: %facet_value.loc10_39: %type_where = facet_value constants.%EmptyRange.ab3, () [concrete = constants.%facet_value.b6d] -// CHECK:STDOUT: %.loc10_39.5: %type_where = converted constants.%EmptyRange.ab3, %facet_value.loc10_39 [concrete = constants.%facet_value.b6d] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_39: = bound_method %.loc10_39.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.5f4 +// CHECK:STDOUT: %facet_value.loc10_39: %type_where = facet_value constants.%EmptyRange.38c, () [concrete = constants.%facet_value.cd5] +// CHECK:STDOUT: %.loc10_39.5: %type_where = converted constants.%EmptyRange.38c, %facet_value.loc10_39 [concrete = constants.%facet_value.cd5] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_39: = bound_method %.loc10_39.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.cac // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_39: = bound_method %.loc10_39.2, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.4 -// CHECK:STDOUT: %addr.loc10_39: %ptr.43f = addr_of %.loc10_39.2 +// CHECK:STDOUT: %addr.loc10_39: %ptr.f56 = addr_of %.loc10_39.2 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10_39: init %empty_tuple.type = call %bound_method.loc10_39(%addr.loc10_39) // CHECK:STDOUT: // CHECK:STDOUT: } @@ -498,84 +514,92 @@ fn Run() { // CHECK:STDOUT: %EmptyRange.generic: %EmptyRange.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] -// CHECK:STDOUT: %T.7dd: %Copy.type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %EmptyRange.Make.type.838: type = fn_type @EmptyRange.Make, @EmptyRange(%T.7dd) [symbolic] -// CHECK:STDOUT: %EmptyRange.Make.b34: %EmptyRange.Make.type.838 = struct_value () [symbolic] +// CHECK:STDOUT: %facet_type: type = facet_type <@Destroy & @Copy> [concrete] +// CHECK:STDOUT: %T.de3: %facet_type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %EmptyRange.Make.type.cd2: type = fn_type @EmptyRange.Make, @EmptyRange(%T.de3) [symbolic] +// CHECK:STDOUT: %EmptyRange.Make.5ef: %EmptyRange.Make.type.cd2 = struct_value () [symbolic] // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] +// CHECK:STDOUT: %type_where: type = facet_type > [concrete] +// CHECK:STDOUT: %DestroyT: %type_where = bind_symbolic_name DestroyT, 0 [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.47d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%DestroyT) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.10b: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.47d = struct_value () [symbolic] +// CHECK:STDOUT: %facet_value.d7c: %type_where = facet_value %tuple.type.784, () [concrete] +// CHECK:STDOUT: %Destroy.impl_witness.33b: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.d7c) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.823: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.d7c) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.00a: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.823 = struct_value () [concrete] +// CHECK:STDOUT: %ptr.b85: type = ptr_type %tuple.type.784 [concrete] +// CHECK:STDOUT: %T.7dd: %Copy.type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %U: %Copy.type = bind_symbolic_name U, 1 [symbolic] // CHECK:STDOUT: %tuple.type.as.Copy.impl.Op.type.b6b: type = fn_type @tuple.type.as.Copy.impl.Op.1, @tuple.type.as.Copy.impl.bca(%T.7dd, %U) [symbolic] // CHECK:STDOUT: %tuple.type.as.Copy.impl.Op.b8c: %tuple.type.as.Copy.impl.Op.type.b6b = struct_value () [symbolic] // CHECK:STDOUT: %Copy.impl_witness.1f3: = impl_witness imports.%Copy.impl_witness_table.416 [concrete] // CHECK:STDOUT: %Copy.facet.559: %Copy.type = facet_value bool, (%Copy.impl_witness.1f3) [concrete] // CHECK:STDOUT: %Copy.impl_witness.f89: = impl_witness imports.%Copy.impl_witness_table.179, @tuple.type.as.Copy.impl.bca(%Copy.facet.559, %Copy.facet.559) [concrete] -// CHECK:STDOUT: %Copy.facet.46f: %Copy.type = facet_value %tuple.type.784, (%Copy.impl_witness.f89) [concrete] -// CHECK:STDOUT: %EmptyRange.689: type = class_type @EmptyRange, @EmptyRange(%Copy.facet.46f) [concrete] -// CHECK:STDOUT: %EmptyRange.Make.type.d30: type = fn_type @EmptyRange.Make, @EmptyRange(%Copy.facet.46f) [concrete] -// CHECK:STDOUT: %EmptyRange.Make.7b4: %EmptyRange.Make.type.d30 = struct_value () [concrete] +// CHECK:STDOUT: %facet_value.748: %facet_type = facet_value %tuple.type.784, (%Destroy.impl_witness.33b, %Copy.impl_witness.f89) [concrete] +// CHECK:STDOUT: %EmptyRange.8c5: type = class_type @EmptyRange, @EmptyRange(%facet_value.748) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.type.4b4: type = fn_type @EmptyRange.Make, @EmptyRange(%facet_value.748) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.574: %EmptyRange.Make.type.4b4 = struct_value () [concrete] // CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [concrete] -// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.7b4, @EmptyRange.Make(%Copy.facet.46f) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.574, @EmptyRange.Make(%facet_value.748) [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %Iterate.NewCursor.type: type = fn_type @Iterate.NewCursor [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.22a: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T.7dd) [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.28c: %EmptyRange.as.Iterate.impl.NewCursor.type.22a = struct_value () [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.e5a: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T.7dd) [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.185: %EmptyRange.as.Iterate.impl.Next.type.e5a = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.HasValue.type.5d5: type = fn_type @Optional.HasValue, @Optional(%T.7dd) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.d64: %Optional.HasValue.type.5d5 = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.Get.type.91e: type = fn_type @Optional.Get, @Optional(%T.7dd) [symbolic] -// CHECK:STDOUT: %Optional.Get.4d9: %Optional.Get.type.91e = struct_value () [symbolic] -// CHECK:STDOUT: %Iterate.impl_witness.da5: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%Copy.facet.46f) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.9d7: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%Copy.facet.46f) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.1f8: %EmptyRange.as.Iterate.impl.NewCursor.type.9d7 = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.5f0: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%Copy.facet.46f) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.8be: %EmptyRange.as.Iterate.impl.Next.type.5f0 = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %EmptyRange.689, (%Iterate.impl_witness.da5) [concrete] -// CHECK:STDOUT: %.85e: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.1f8, @EmptyRange.as.Iterate.impl.NewCursor(%Copy.facet.46f) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.b13: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T.de3) [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.081: %EmptyRange.as.Iterate.impl.NewCursor.type.b13 = struct_value () [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.7ed: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T.de3) [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.874: %EmptyRange.as.Iterate.impl.Next.type.7ed = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.e13: type = fn_type @Optional.HasValue, @Optional(%T.de3) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.d80: %Optional.HasValue.type.e13 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.Get.type.7cd: type = fn_type @Optional.Get, @Optional(%T.de3) [symbolic] +// CHECK:STDOUT: %Optional.Get.846: %Optional.Get.type.7cd = struct_value () [symbolic] +// CHECK:STDOUT: %Iterate.impl_witness.5b7: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%facet_value.748) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.c48: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%facet_value.748) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.0a6: %EmptyRange.as.Iterate.impl.NewCursor.type.c48 = struct_value () [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.ffc: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%facet_value.748) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.c85: %EmptyRange.as.Iterate.impl.Next.type.ffc = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %EmptyRange.8c5, (%Iterate.impl_witness.5b7) [concrete] +// CHECK:STDOUT: %.7a2: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.0a6, @EmptyRange.as.Iterate.impl.NewCursor(%facet_value.748) [concrete] // CHECK:STDOUT: %Iterate.Next.type: type = fn_type @Iterate.Next [concrete] -// CHECK:STDOUT: %.fe7: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %Optional.b7e: type = class_type @Optional, @Optional(%Copy.facet.46f) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.8be, @EmptyRange.as.Iterate.impl.Next(%Copy.facet.46f) [concrete] -// CHECK:STDOUT: %Optional.HasValue.type.f4b: type = fn_type @Optional.HasValue, @Optional(%Copy.facet.46f) [concrete] -// CHECK:STDOUT: %Optional.HasValue.339: %Optional.HasValue.type.f4b = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.e6e: type = fn_type @Optional.Get, @Optional(%Copy.facet.46f) [concrete] -// CHECK:STDOUT: %Optional.Get.5e8: %Optional.Get.type.e6e = struct_value () [concrete] -// CHECK:STDOUT: %ptr.b85: type = ptr_type %tuple.type.784 [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.339, @Optional.HasValue(%Copy.facet.46f) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.5e8, @Optional.Get(%Copy.facet.46f) [concrete] -// CHECK:STDOUT: %type_where: type = facet_type > [concrete] -// CHECK:STDOUT: %facet_value.d7c: %type_where = facet_value %tuple.type.784, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.ea5: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.d7c) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.f9f: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.ea5 = struct_value () [concrete] -// CHECK:STDOUT: %facet_value.871: %type_where = facet_value %Optional.b7e, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a01: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.871) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.cdc: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a01 = struct_value () [concrete] -// CHECK:STDOUT: %ptr.b9f: type = ptr_type %Optional.b7e [concrete] +// CHECK:STDOUT: %.d24: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %Optional.d29: type = class_type @Optional, @Optional(%facet_value.748) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.c85, @EmptyRange.as.Iterate.impl.Next(%facet_value.748) [concrete] +// CHECK:STDOUT: %Optional.HasValue.type.bbc: type = fn_type @Optional.HasValue, @Optional(%facet_value.748) [concrete] +// CHECK:STDOUT: %Optional.HasValue.2f9: %Optional.HasValue.type.bbc = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.5e5: type = fn_type @Optional.Get, @Optional(%facet_value.748) [concrete] +// CHECK:STDOUT: %Optional.Get.198: %Optional.Get.type.5e5 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.2f9, @Optional.HasValue(%facet_value.748) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.198, @Optional.Get(%facet_value.748) [concrete] +// CHECK:STDOUT: %facet_value.277: %type_where = facet_value %Optional.d29, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.d44: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.277) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.7cd: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.d44 = struct_value () [concrete] +// CHECK:STDOUT: %ptr.188: type = ptr_type %Optional.d29 [concrete] // CHECK:STDOUT: %facet_value.7c2: %type_where = facet_value %empty_struct_type, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.bd1: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.7c2) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.596: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.bd1 = struct_value () [concrete] -// CHECK:STDOUT: %facet_value.61e: %type_where = facet_value %EmptyRange.689, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.f03: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.61e) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.73c: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.f03 = struct_value () [concrete] -// CHECK:STDOUT: %ptr.ac0: type = ptr_type %EmptyRange.689 [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.26d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.7c2) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.ddd: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.26d = struct_value () [concrete] +// CHECK:STDOUT: %facet_value.b80: %type_where = facet_value %EmptyRange.8c5, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.394: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.b80) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.48a: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.394 = struct_value () [concrete] +// CHECK:STDOUT: %ptr.514: type = ptr_type %EmptyRange.8c5 [concrete] // CHECK:STDOUT: %bool.as.Copy.impl.Op.type: type = fn_type @bool.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %bool.as.Copy.impl.Op: %bool.as.Copy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.EmptyRange: %EmptyRange.type = import_ref Main//empty_range, EmptyRange, loaded [concrete = constants.%EmptyRange.generic] -// CHECK:STDOUT: %Main.import_ref.8f2f: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.838) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.b34)] +// CHECK:STDOUT: %Main.import_ref.e7c: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.cd2) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.5ef)] +// CHECK:STDOUT: %Core.import_ref.1a1: @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.47d) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.10b)] +// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.1a1), @DestroyT.binding.as_type.as.Destroy.impl [concrete] // CHECK:STDOUT: %Core.import_ref.ae0: @tuple.type.as.Copy.impl.bca.%tuple.type.as.Copy.impl.Op.type (%tuple.type.as.Copy.impl.Op.type.b6b) = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [symbolic = @tuple.type.as.Copy.impl.bca.%tuple.type.as.Copy.impl.Op (constants.%tuple.type.as.Copy.impl.Op.b8c)] // CHECK:STDOUT: %Copy.impl_witness_table.179 = impl_witness_table (%Core.import_ref.ae0), @tuple.type.as.Copy.impl.bca [concrete] // CHECK:STDOUT: %Core.import_ref.afa: %bool.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [concrete = constants.%bool.as.Copy.impl.Op] // CHECK:STDOUT: %Copy.impl_witness_table.416 = impl_witness_table (%Core.import_ref.afa), @bool.as.Copy.impl [concrete] -// CHECK:STDOUT: %Main.import_ref.4d9 = import_ref Main//empty_range, loc7_68, unloaded +// CHECK:STDOUT: %Main.import_ref.b9f = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded -// CHECK:STDOUT: %Main.import_ref.85e: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.22a) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.28c)] -// CHECK:STDOUT: %Main.import_ref.782: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.e5a) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.185)] -// CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.4d9, %Main.import_ref.999, %Main.import_ref.85e, %Main.import_ref.782), @EmptyRange.as.Iterate.impl [concrete] -// CHECK:STDOUT: %Main.import_ref.cfa: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.5d5) = import_ref Main//empty_range, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.d64)] -// CHECK:STDOUT: %Main.import_ref.01a: @Optional.%Optional.Get.type (%Optional.Get.type.91e) = import_ref Main//empty_range, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.4d9)] +// CHECK:STDOUT: %Main.import_ref.e75: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.b13) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.081)] +// CHECK:STDOUT: %Main.import_ref.c30: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.7ed) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.874)] +// CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.b9f, %Main.import_ref.999, %Main.import_ref.e75, %Main.import_ref.c30), @EmptyRange.as.Iterate.impl [concrete] +// CHECK:STDOUT: %Main.import_ref.2b8: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.e13) = import_ref Main//empty_range, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.d80)] +// CHECK:STDOUT: %Main.import_ref.e05: @Optional.%Optional.Get.type (%Optional.Get.type.7cd) = import_ref Main//empty_range, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.846)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -593,24 +617,26 @@ fn Run() { // CHECK:STDOUT: %.loc10_53.2: type = converted %Bool.call.loc10_42, %.loc10_53.1 [concrete = bool] // CHECK:STDOUT: %.loc10_53.3: type = value_of_initializer %Bool.call.loc10_48 [concrete = bool] // CHECK:STDOUT: %.loc10_53.4: type = converted %Bool.call.loc10_48, %.loc10_53.3 [concrete = bool] +// CHECK:STDOUT: %facet_value.loc10_53.1: %type_where = facet_value constants.%tuple.type.784, () [concrete = constants.%facet_value.d7c] +// CHECK:STDOUT: %.loc10_53.5: %type_where = converted constants.%tuple.type.784, %facet_value.loc10_53.1 [concrete = constants.%facet_value.d7c] // CHECK:STDOUT: %Copy.facet.loc10_53.1: %Copy.type = facet_value bool, (constants.%Copy.impl_witness.1f3) [concrete = constants.%Copy.facet.559] -// CHECK:STDOUT: %.loc10_53.5: %Copy.type = converted bool, %Copy.facet.loc10_53.1 [concrete = constants.%Copy.facet.559] +// CHECK:STDOUT: %.loc10_53.6: %Copy.type = converted bool, %Copy.facet.loc10_53.1 [concrete = constants.%Copy.facet.559] // CHECK:STDOUT: %Copy.facet.loc10_53.2: %Copy.type = facet_value bool, (constants.%Copy.impl_witness.1f3) [concrete = constants.%Copy.facet.559] -// CHECK:STDOUT: %.loc10_53.6: %Copy.type = converted bool, %Copy.facet.loc10_53.2 [concrete = constants.%Copy.facet.559] -// CHECK:STDOUT: %Copy.facet.loc10_53.3: %Copy.type = facet_value constants.%tuple.type.784, (constants.%Copy.impl_witness.f89) [concrete = constants.%Copy.facet.46f] -// CHECK:STDOUT: %.loc10_53.7: %Copy.type = converted %.loc10_52, %Copy.facet.loc10_53.3 [concrete = constants.%Copy.facet.46f] -// CHECK:STDOUT: %EmptyRange: type = class_type @EmptyRange, @EmptyRange(constants.%Copy.facet.46f) [concrete = constants.%EmptyRange.689] -// CHECK:STDOUT: %.loc10_54: %EmptyRange.Make.type.d30 = specific_constant imports.%Main.import_ref.8f2f, @EmptyRange(constants.%Copy.facet.46f) [concrete = constants.%EmptyRange.Make.7b4] -// CHECK:STDOUT: %Make.ref: %EmptyRange.Make.type.d30 = name_ref Make, %.loc10_54 [concrete = constants.%EmptyRange.Make.7b4] -// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %Make.ref, @EmptyRange.Make(constants.%Copy.facet.46f) [concrete = constants.%EmptyRange.Make.specific_fn] -// CHECK:STDOUT: %.loc10_60.1: ref %EmptyRange.689 = temporary_storage -// CHECK:STDOUT: %EmptyRange.Make.call: init %EmptyRange.689 = call %EmptyRange.Make.specific_fn() to %.loc10_60.1 -// CHECK:STDOUT: %.loc10_60.2: ref %EmptyRange.689 = temporary %.loc10_60.1, %EmptyRange.Make.call -// CHECK:STDOUT: %impl.elem2: %.85e = impl_witness_access constants.%Iterate.impl_witness.da5, element2 [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.1f8] +// CHECK:STDOUT: %.loc10_53.7: %Copy.type = converted bool, %Copy.facet.loc10_53.2 [concrete = constants.%Copy.facet.559] +// CHECK:STDOUT: %facet_value.loc10_53.2: %facet_type = facet_value constants.%tuple.type.784, (constants.%Destroy.impl_witness.33b, constants.%Copy.impl_witness.f89) [concrete = constants.%facet_value.748] +// CHECK:STDOUT: %.loc10_53.8: %facet_type = converted %.loc10_52, %facet_value.loc10_53.2 [concrete = constants.%facet_value.748] +// CHECK:STDOUT: %EmptyRange: type = class_type @EmptyRange, @EmptyRange(constants.%facet_value.748) [concrete = constants.%EmptyRange.8c5] +// CHECK:STDOUT: %.loc10_54: %EmptyRange.Make.type.4b4 = specific_constant imports.%Main.import_ref.e7c, @EmptyRange(constants.%facet_value.748) [concrete = constants.%EmptyRange.Make.574] +// CHECK:STDOUT: %Make.ref: %EmptyRange.Make.type.4b4 = name_ref Make, %.loc10_54 [concrete = constants.%EmptyRange.Make.574] +// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %Make.ref, @EmptyRange.Make(constants.%facet_value.748) [concrete = constants.%EmptyRange.Make.specific_fn] +// CHECK:STDOUT: %.loc10_60.1: ref %EmptyRange.8c5 = temporary_storage +// CHECK:STDOUT: %EmptyRange.Make.call: init %EmptyRange.8c5 = call %EmptyRange.Make.specific_fn() to %.loc10_60.1 +// CHECK:STDOUT: %.loc10_60.2: ref %EmptyRange.8c5 = temporary %.loc10_60.1, %EmptyRange.Make.call +// CHECK:STDOUT: %impl.elem2: %.7a2 = impl_witness_access constants.%Iterate.impl_witness.5b7, element2 [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.0a6] // CHECK:STDOUT: %bound_method.loc10_61.1: = bound_method %.loc10_60.2, %impl.elem2 -// CHECK:STDOUT: %specific_fn.loc10_61.1: = specific_function %impl.elem2, @EmptyRange.as.Iterate.impl.NewCursor(constants.%Copy.facet.46f) [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.specific_fn] +// CHECK:STDOUT: %specific_fn.loc10_61.1: = specific_function %impl.elem2, @EmptyRange.as.Iterate.impl.NewCursor(constants.%facet_value.748) [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.specific_fn] // CHECK:STDOUT: %bound_method.loc10_61.2: = bound_method %.loc10_60.2, %specific_fn.loc10_61.1 -// CHECK:STDOUT: %.loc10_60.3: %EmptyRange.689 = bind_value %.loc10_60.2 +// CHECK:STDOUT: %.loc10_60.3: %EmptyRange.8c5 = bind_value %.loc10_60.2 // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.call: init %empty_struct_type = call %bound_method.loc10_61.2(%.loc10_60.3) // CHECK:STDOUT: %var: ref %empty_struct_type = var invalid // CHECK:STDOUT: assign %var, %EmptyRange.as.Iterate.impl.NewCursor.call @@ -618,33 +644,33 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr.loc10_61.1: %ptr.c28 = addr_of %var -// CHECK:STDOUT: %impl.elem3: %.fe7 = impl_witness_access constants.%Iterate.impl_witness.da5, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.8be] +// CHECK:STDOUT: %impl.elem3: %.d24 = impl_witness_access constants.%Iterate.impl_witness.5b7, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.c85] // CHECK:STDOUT: %bound_method.loc10_61.3: = bound_method %.loc10_60.2, %impl.elem3 -// CHECK:STDOUT: %specific_fn.loc10_61.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%Copy.facet.46f) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] +// CHECK:STDOUT: %specific_fn.loc10_61.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%facet_value.748) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] // CHECK:STDOUT: %bound_method.loc10_61.4: = bound_method %.loc10_60.2, %specific_fn.loc10_61.2 -// CHECK:STDOUT: %.loc10_61.1: ref %Optional.b7e = temporary_storage -// CHECK:STDOUT: %.loc10_60.4: %EmptyRange.689 = bind_value %.loc10_60.2 -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.b7e = call %bound_method.loc10_61.4(%.loc10_60.4, %addr.loc10_61.1) to %.loc10_61.1 -// CHECK:STDOUT: %.loc10_61.2: ref %Optional.b7e = temporary %.loc10_61.1, %EmptyRange.as.Iterate.impl.Next.call -// CHECK:STDOUT: %.loc10_61.3: %Optional.HasValue.type.f4b = specific_constant imports.%Main.import_ref.cfa, @Optional(constants.%Copy.facet.46f) [concrete = constants.%Optional.HasValue.339] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.f4b = name_ref HasValue, %.loc10_61.3 [concrete = constants.%Optional.HasValue.339] +// CHECK:STDOUT: %.loc10_61.1: ref %Optional.d29 = temporary_storage +// CHECK:STDOUT: %.loc10_60.4: %EmptyRange.8c5 = bind_value %.loc10_60.2 +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.d29 = call %bound_method.loc10_61.4(%.loc10_60.4, %addr.loc10_61.1) to %.loc10_61.1 +// CHECK:STDOUT: %.loc10_61.2: ref %Optional.d29 = temporary %.loc10_61.1, %EmptyRange.as.Iterate.impl.Next.call +// CHECK:STDOUT: %.loc10_61.3: %Optional.HasValue.type.bbc = specific_constant imports.%Main.import_ref.2b8, @Optional(constants.%facet_value.748) [concrete = constants.%Optional.HasValue.2f9] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.bbc = name_ref HasValue, %.loc10_61.3 [concrete = constants.%Optional.HasValue.2f9] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc10_61.2, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%Copy.facet.46f) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%facet_value.748) [concrete = constants.%Optional.HasValue.specific_fn] // CHECK:STDOUT: %bound_method.loc10_61.5: = bound_method %.loc10_61.2, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc10_61.4: %Optional.b7e = bind_value %.loc10_61.2 +// CHECK:STDOUT: %.loc10_61.4: %Optional.d29 = bind_value %.loc10_61.2 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc10_61.5(%.loc10_61.4) // CHECK:STDOUT: %.loc10_61.5: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc10_61.6: bool = converted %Optional.HasValue.call, %.loc10_61.5 // CHECK:STDOUT: if %.loc10_61.6 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc10_61.7: %Optional.Get.type.e6e = specific_constant imports.%Main.import_ref.01a, @Optional(constants.%Copy.facet.46f) [concrete = constants.%Optional.Get.5e8] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.e6e = name_ref Get, %.loc10_61.7 [concrete = constants.%Optional.Get.5e8] +// CHECK:STDOUT: %.loc10_61.7: %Optional.Get.type.5e5 = specific_constant imports.%Main.import_ref.e05, @Optional(constants.%facet_value.748) [concrete = constants.%Optional.Get.198] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.5e5 = name_ref Get, %.loc10_61.7 [concrete = constants.%Optional.Get.198] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc10_61.2, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%Copy.facet.46f) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%facet_value.748) [concrete = constants.%Optional.Get.specific_fn] // CHECK:STDOUT: %bound_method.loc10_61.6: = bound_method %.loc10_61.2, %Optional.Get.specific_fn // CHECK:STDOUT: %.loc10_61.8: ref %tuple.type.784 = temporary_storage -// CHECK:STDOUT: %.loc10_61.9: %Optional.b7e = bind_value %.loc10_61.2 +// CHECK:STDOUT: %.loc10_61.9: %Optional.d29 = bind_value %.loc10_61.2 // CHECK:STDOUT: %Optional.Get.call: init %tuple.type.784 = call %bound_method.loc10_61.6(%.loc10_61.9) to %.loc10_61.8 // CHECK:STDOUT: %.loc10_61.10: ref %tuple.type.784 = temporary %.loc10_61.8, %Optional.Get.call // CHECK:STDOUT: %tuple.elem0: ref bool = tuple_access %.loc10_61.10, element0 @@ -672,31 +698,31 @@ fn Run() { // CHECK:STDOUT: !for.done: // CHECK:STDOUT: %facet_value.loc10_61.1: %type_where = facet_value constants.%tuple.type.784, () [concrete = constants.%facet_value.d7c] // CHECK:STDOUT: %.loc10_61.13: %type_where = converted constants.%tuple.type.784, %facet_value.loc10_61.1 [concrete = constants.%facet_value.d7c] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_61.1: = bound_method %.loc10_61.10, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.f9f +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_61.1: = bound_method %.loc10_61.10, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.00a // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_61.7: = bound_method %.loc10_61.10, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1 // CHECK:STDOUT: %addr.loc10_61.2: %ptr.b85 = addr_of %.loc10_61.10 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10_61.1: init %empty_tuple.type = call %bound_method.loc10_61.7(%addr.loc10_61.2) -// CHECK:STDOUT: %facet_value.loc10_61.2: %type_where = facet_value constants.%Optional.b7e, () [concrete = constants.%facet_value.871] -// CHECK:STDOUT: %.loc10_61.14: %type_where = converted constants.%Optional.b7e, %facet_value.loc10_61.2 [concrete = constants.%facet_value.871] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_61.2: = bound_method %.loc10_61.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.cdc +// CHECK:STDOUT: %facet_value.loc10_61.2: %type_where = facet_value constants.%Optional.d29, () [concrete = constants.%facet_value.277] +// CHECK:STDOUT: %.loc10_61.14: %type_where = converted constants.%Optional.d29, %facet_value.loc10_61.2 [concrete = constants.%facet_value.277] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_61.2: = bound_method %.loc10_61.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.7cd // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_61.8: = bound_method %.loc10_61.2, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2 -// CHECK:STDOUT: %addr.loc10_61.3: %ptr.b9f = addr_of %.loc10_61.2 +// CHECK:STDOUT: %addr.loc10_61.3: %ptr.188 = addr_of %.loc10_61.2 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10_61.2: init %empty_tuple.type = call %bound_method.loc10_61.8(%addr.loc10_61.3) // CHECK:STDOUT: %facet_value.loc10_61.3: %type_where = facet_value constants.%empty_struct_type, () [concrete = constants.%facet_value.7c2] // CHECK:STDOUT: %.loc10_61.15: %type_where = converted constants.%empty_struct_type, %facet_value.loc10_61.3 [concrete = constants.%facet_value.7c2] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_61.3: = bound_method %var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.596 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_61.3: = bound_method %var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.ddd // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_61.9: = bound_method %var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3 // CHECK:STDOUT: %addr.loc10_61.4: %ptr.c28 = addr_of %var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10_61.3: init %empty_tuple.type = call %bound_method.loc10_61.9(%addr.loc10_61.4) -// CHECK:STDOUT: %facet_value.loc10_60: %type_where = facet_value constants.%EmptyRange.689, () [concrete = constants.%facet_value.61e] -// CHECK:STDOUT: %.loc10_60.5: %type_where = converted constants.%EmptyRange.689, %facet_value.loc10_60 [concrete = constants.%facet_value.61e] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_60: = bound_method %.loc10_60.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.73c +// CHECK:STDOUT: %facet_value.loc10_60: %type_where = facet_value constants.%EmptyRange.8c5, () [concrete = constants.%facet_value.b80] +// CHECK:STDOUT: %.loc10_60.5: %type_where = converted constants.%EmptyRange.8c5, %facet_value.loc10_60 [concrete = constants.%facet_value.b80] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_60: = bound_method %.loc10_60.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.48a // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_60: = bound_method %.loc10_60.2, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.4 -// CHECK:STDOUT: %addr.loc10_60: %ptr.ac0 = addr_of %.loc10_60.2 +// CHECK:STDOUT: %addr.loc10_60: %ptr.514 = addr_of %.loc10_60.2 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10_60: init %empty_tuple.type = call %bound_method.loc10_60(%addr.loc10_60) // CHECK:STDOUT: // CHECK:STDOUT: } @@ -716,65 +742,71 @@ fn Run() { // CHECK:STDOUT: %EmptyRange.type: type = generic_class_type @EmptyRange [concrete] // CHECK:STDOUT: %EmptyRange.generic: %EmptyRange.type = struct_value () [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] -// CHECK:STDOUT: %T.7dd: %Copy.type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %EmptyRange.Make.type.838: type = fn_type @EmptyRange.Make, @EmptyRange(%T.7dd) [symbolic] -// CHECK:STDOUT: %EmptyRange.Make.b34: %EmptyRange.Make.type.838 = struct_value () [symbolic] +// CHECK:STDOUT: %facet_type: type = facet_type <@Destroy & @Copy> [concrete] +// CHECK:STDOUT: %T.de3: %facet_type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %EmptyRange.Make.type.cd2: type = fn_type @EmptyRange.Make, @EmptyRange(%T.de3) [symbolic] +// CHECK:STDOUT: %EmptyRange.Make.5ef: %EmptyRange.Make.type.cd2 = struct_value () [symbolic] // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] +// CHECK:STDOUT: %type_where: type = facet_type > [concrete] +// CHECK:STDOUT: %DestroyT: %type_where = bind_symbolic_name DestroyT, 0 [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.47d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%DestroyT) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.10b: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.47d = struct_value () [symbolic] +// CHECK:STDOUT: %facet_value.c79: %type_where = facet_value %tuple.type.56b, () [concrete] +// CHECK:STDOUT: %Destroy.impl_witness.b95: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.c79) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.6b3: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.c79) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.614: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.6b3 = struct_value () [concrete] +// CHECK:STDOUT: %ptr.9f0: type = ptr_type %tuple.type.56b [concrete] +// CHECK:STDOUT: %T.7dd: %Copy.type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %U: %Copy.type = bind_symbolic_name U, 1 [symbolic] // CHECK:STDOUT: %tuple.type.as.Copy.impl.Op.type.b6b: type = fn_type @tuple.type.as.Copy.impl.Op.1, @tuple.type.as.Copy.impl.bca(%T.7dd, %U) [symbolic] // CHECK:STDOUT: %tuple.type.as.Copy.impl.Op.b8c: %tuple.type.as.Copy.impl.Op.type.b6b = struct_value () [symbolic] // CHECK:STDOUT: %Copy.impl_witness.1de: = impl_witness imports.%Copy.impl_witness_table.2c6 [concrete] // CHECK:STDOUT: %Copy.facet.762: %Copy.type = facet_value %C, (%Copy.impl_witness.1de) [concrete] // CHECK:STDOUT: %Copy.impl_witness.cde: = impl_witness imports.%Copy.impl_witness_table.179, @tuple.type.as.Copy.impl.bca(%Copy.facet.762, %Copy.facet.762) [concrete] -// CHECK:STDOUT: %Copy.facet.307: %Copy.type = facet_value %tuple.type.56b, (%Copy.impl_witness.cde) [concrete] -// CHECK:STDOUT: %EmptyRange.b32: type = class_type @EmptyRange, @EmptyRange(%Copy.facet.307) [concrete] -// CHECK:STDOUT: %EmptyRange.Make.type.d9c: type = fn_type @EmptyRange.Make, @EmptyRange(%Copy.facet.307) [concrete] -// CHECK:STDOUT: %EmptyRange.Make.c75: %EmptyRange.Make.type.d9c = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.c75, @EmptyRange.Make(%Copy.facet.307) [concrete] +// CHECK:STDOUT: %facet_value.8ed: %facet_type = facet_value %tuple.type.56b, (%Destroy.impl_witness.b95, %Copy.impl_witness.cde) [concrete] +// CHECK:STDOUT: %EmptyRange.6be: type = class_type @EmptyRange, @EmptyRange(%facet_value.8ed) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.type.37d: type = fn_type @EmptyRange.Make, @EmptyRange(%facet_value.8ed) [concrete] +// CHECK:STDOUT: %EmptyRange.Make.296: %EmptyRange.Make.type.37d = struct_value () [concrete] +// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.296, @EmptyRange.Make(%facet_value.8ed) [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %Iterate.NewCursor.type: type = fn_type @Iterate.NewCursor [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.22a: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T.7dd) [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.28c: %EmptyRange.as.Iterate.impl.NewCursor.type.22a = struct_value () [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.e5a: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T.7dd) [symbolic] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.185: %EmptyRange.as.Iterate.impl.Next.type.e5a = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.HasValue.type.5d5: type = fn_type @Optional.HasValue, @Optional(%T.7dd) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.d64: %Optional.HasValue.type.5d5 = struct_value () [symbolic] -// CHECK:STDOUT: %Optional.Get.type.91e: type = fn_type @Optional.Get, @Optional(%T.7dd) [symbolic] -// CHECK:STDOUT: %Optional.Get.4d9: %Optional.Get.type.91e = struct_value () [symbolic] -// CHECK:STDOUT: %Iterate.impl_witness.2ed: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%Copy.facet.307) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.ae0: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%Copy.facet.307) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.e68: %EmptyRange.as.Iterate.impl.NewCursor.type.ae0 = struct_value () [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.0d7: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%Copy.facet.307) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.979: %EmptyRange.as.Iterate.impl.Next.type.0d7 = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %EmptyRange.b32, (%Iterate.impl_witness.2ed) [concrete] -// CHECK:STDOUT: %.414: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.e68, @EmptyRange.as.Iterate.impl.NewCursor(%Copy.facet.307) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.b13: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T.de3) [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.081: %EmptyRange.as.Iterate.impl.NewCursor.type.b13 = struct_value () [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.7ed: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T.de3) [symbolic] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.874: %EmptyRange.as.Iterate.impl.Next.type.7ed = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.e13: type = fn_type @Optional.HasValue, @Optional(%T.de3) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.d80: %Optional.HasValue.type.e13 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.Get.type.7cd: type = fn_type @Optional.Get, @Optional(%T.de3) [symbolic] +// CHECK:STDOUT: %Optional.Get.846: %Optional.Get.type.7cd = struct_value () [symbolic] +// CHECK:STDOUT: %Iterate.impl_witness.ec5: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%facet_value.8ed) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.c02: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%facet_value.8ed) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.cc8: %EmptyRange.as.Iterate.impl.NewCursor.type.c02 = struct_value () [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.e5e: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%facet_value.8ed) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.0ef: %EmptyRange.as.Iterate.impl.Next.type.e5e = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %EmptyRange.6be, (%Iterate.impl_witness.ec5) [concrete] +// CHECK:STDOUT: %.3cf: type = fn_type_with_self_type %Iterate.NewCursor.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.cc8, @EmptyRange.as.Iterate.impl.NewCursor(%facet_value.8ed) [concrete] // CHECK:STDOUT: %Iterate.Next.type: type = fn_type @Iterate.Next [concrete] -// CHECK:STDOUT: %.f02: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] -// CHECK:STDOUT: %Optional.654: type = class_type @Optional, @Optional(%Copy.facet.307) [concrete] -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.979, @EmptyRange.as.Iterate.impl.Next(%Copy.facet.307) [concrete] -// CHECK:STDOUT: %Optional.HasValue.type.a71: type = fn_type @Optional.HasValue, @Optional(%Copy.facet.307) [concrete] -// CHECK:STDOUT: %Optional.HasValue.2f2: %Optional.HasValue.type.a71 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.bc3: type = fn_type @Optional.Get, @Optional(%Copy.facet.307) [concrete] -// CHECK:STDOUT: %Optional.Get.7b4: %Optional.Get.type.bc3 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.2f2, @Optional.HasValue(%Copy.facet.307) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.7b4, @Optional.Get(%Copy.facet.307) [concrete] -// CHECK:STDOUT: %type_where: type = facet_type > [concrete] -// CHECK:STDOUT: %facet_value.c79: %type_where = facet_value %tuple.type.56b, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.dbb: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.c79) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.f17: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.dbb = struct_value () [concrete] -// CHECK:STDOUT: %ptr.9f0: type = ptr_type %tuple.type.56b [concrete] -// CHECK:STDOUT: %facet_value.4cb: %type_where = facet_value %Optional.654, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.383: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.4cb) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.169: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.383 = struct_value () [concrete] -// CHECK:STDOUT: %ptr.0ac: type = ptr_type %Optional.654 [concrete] +// CHECK:STDOUT: %.0c2: type = fn_type_with_self_type %Iterate.Next.type, %Iterate.facet [concrete] +// CHECK:STDOUT: %Optional.ae9: type = class_type @Optional, @Optional(%facet_value.8ed) [concrete] +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.0ef, @EmptyRange.as.Iterate.impl.Next(%facet_value.8ed) [concrete] +// CHECK:STDOUT: %Optional.HasValue.type.ff8: type = fn_type @Optional.HasValue, @Optional(%facet_value.8ed) [concrete] +// CHECK:STDOUT: %Optional.HasValue.f58: %Optional.HasValue.type.ff8 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.530: type = fn_type @Optional.Get, @Optional(%facet_value.8ed) [concrete] +// CHECK:STDOUT: %Optional.Get.bb2: %Optional.Get.type.530 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.f58, @Optional.HasValue(%facet_value.8ed) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.bb2, @Optional.Get(%facet_value.8ed) [concrete] +// CHECK:STDOUT: %facet_value.b45: %type_where = facet_value %Optional.ae9, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.43a: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.b45) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.0e7: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.43a = struct_value () [concrete] +// CHECK:STDOUT: %ptr.c8a: type = ptr_type %Optional.ae9 [concrete] // CHECK:STDOUT: %facet_value.7c2: %type_where = facet_value %empty_struct_type, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.bd1: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.7c2) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.596: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.bd1 = struct_value () [concrete] -// CHECK:STDOUT: %facet_value.2ad: %type_where = facet_value %EmptyRange.b32, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.417: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.2ad) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.4f3: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.417 = struct_value () [concrete] -// CHECK:STDOUT: %ptr.4b6: type = ptr_type %EmptyRange.b32 [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.26d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.7c2) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.ddd: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.26d = struct_value () [concrete] +// CHECK:STDOUT: %facet_value.2a7: %type_where = facet_value %EmptyRange.6be, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.51c: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.2a7) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.d1b: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.51c = struct_value () [concrete] +// CHECK:STDOUT: %ptr.0e1: type = ptr_type %EmptyRange.6be [concrete] // CHECK:STDOUT: %C.as.Copy.impl.Op.type: type = fn_type @C.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %C.as.Copy.impl.Op: %C.as.Copy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -782,18 +814,20 @@ fn Run() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.EmptyRange: %EmptyRange.type = import_ref Main//empty_range, EmptyRange, loaded [concrete = constants.%EmptyRange.generic] // CHECK:STDOUT: %Main.C: type = import_ref Main//empty_range, C, loaded [concrete = constants.%C] -// CHECK:STDOUT: %Main.import_ref.8f2f: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.838) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.b34)] +// CHECK:STDOUT: %Main.import_ref.e7c: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.cd2) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.5ef)] +// CHECK:STDOUT: %Core.import_ref.1a1: @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.47d) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.10b)] +// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.1a1), @DestroyT.binding.as_type.as.Destroy.impl [concrete] // CHECK:STDOUT: %Core.import_ref.ae0: @tuple.type.as.Copy.impl.bca.%tuple.type.as.Copy.impl.Op.type (%tuple.type.as.Copy.impl.Op.type.b6b) = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [symbolic = @tuple.type.as.Copy.impl.bca.%tuple.type.as.Copy.impl.Op (constants.%tuple.type.as.Copy.impl.Op.b8c)] // CHECK:STDOUT: %Copy.impl_witness_table.179 = impl_witness_table (%Core.import_ref.ae0), @tuple.type.as.Copy.impl.bca [concrete] // CHECK:STDOUT: %Main.import_ref.157: %C.as.Copy.impl.Op.type = import_ref Main//empty_range, loc19_33, loaded [concrete = constants.%C.as.Copy.impl.Op] // CHECK:STDOUT: %Copy.impl_witness_table.2c6 = impl_witness_table (%Main.import_ref.157), @C.as.Copy.impl [concrete] -// CHECK:STDOUT: %Main.import_ref.4d9 = import_ref Main//empty_range, loc7_68, unloaded +// CHECK:STDOUT: %Main.import_ref.b9f = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded -// CHECK:STDOUT: %Main.import_ref.85e: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.22a) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.28c)] -// CHECK:STDOUT: %Main.import_ref.782: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.e5a) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.185)] -// CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.4d9, %Main.import_ref.999, %Main.import_ref.85e, %Main.import_ref.782), @EmptyRange.as.Iterate.impl [concrete] -// CHECK:STDOUT: %Main.import_ref.cfa: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.5d5) = import_ref Main//empty_range, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.d64)] -// CHECK:STDOUT: %Main.import_ref.01a: @Optional.%Optional.Get.type (%Optional.Get.type.91e) = import_ref Main//empty_range, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.4d9)] +// CHECK:STDOUT: %Main.import_ref.e75: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.b13) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.081)] +// CHECK:STDOUT: %Main.import_ref.c30: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.7ed) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.874)] +// CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.b9f, %Main.import_ref.999, %Main.import_ref.e75, %Main.import_ref.c30), @EmptyRange.as.Iterate.impl [concrete] +// CHECK:STDOUT: %Main.import_ref.2b8: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.e13) = import_ref Main//empty_range, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.d80)] +// CHECK:STDOUT: %Main.import_ref.e05: @Optional.%Optional.Get.type (%Optional.Get.type.7cd) = import_ref Main//empty_range, inst{{\d+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.846)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -807,24 +841,26 @@ fn Run() { // CHECK:STDOUT: %C.ref.loc10_36: type = name_ref C, imports.%Main.C [concrete = constants.%C] // CHECK:STDOUT: %C.ref.loc10_39: type = name_ref C, imports.%Main.C [concrete = constants.%C] // CHECK:STDOUT: %.loc10_40: %tuple.type.24b = tuple_literal (%C.ref.loc10_36, %C.ref.loc10_39) +// CHECK:STDOUT: %facet_value.loc10_41.1: %type_where = facet_value constants.%tuple.type.56b, () [concrete = constants.%facet_value.c79] +// CHECK:STDOUT: %.loc10_41.1: %type_where = converted constants.%tuple.type.56b, %facet_value.loc10_41.1 [concrete = constants.%facet_value.c79] // CHECK:STDOUT: %Copy.facet.loc10_41.1: %Copy.type = facet_value constants.%C, (constants.%Copy.impl_witness.1de) [concrete = constants.%Copy.facet.762] -// CHECK:STDOUT: %.loc10_41.1: %Copy.type = converted constants.%C, %Copy.facet.loc10_41.1 [concrete = constants.%Copy.facet.762] +// CHECK:STDOUT: %.loc10_41.2: %Copy.type = converted constants.%C, %Copy.facet.loc10_41.1 [concrete = constants.%Copy.facet.762] // CHECK:STDOUT: %Copy.facet.loc10_41.2: %Copy.type = facet_value constants.%C, (constants.%Copy.impl_witness.1de) [concrete = constants.%Copy.facet.762] -// CHECK:STDOUT: %.loc10_41.2: %Copy.type = converted constants.%C, %Copy.facet.loc10_41.2 [concrete = constants.%Copy.facet.762] -// CHECK:STDOUT: %Copy.facet.loc10_41.3: %Copy.type = facet_value constants.%tuple.type.56b, (constants.%Copy.impl_witness.cde) [concrete = constants.%Copy.facet.307] -// CHECK:STDOUT: %.loc10_41.3: %Copy.type = converted %.loc10_40, %Copy.facet.loc10_41.3 [concrete = constants.%Copy.facet.307] -// CHECK:STDOUT: %EmptyRange: type = class_type @EmptyRange, @EmptyRange(constants.%Copy.facet.307) [concrete = constants.%EmptyRange.b32] -// CHECK:STDOUT: %.loc10_42: %EmptyRange.Make.type.d9c = specific_constant imports.%Main.import_ref.8f2f, @EmptyRange(constants.%Copy.facet.307) [concrete = constants.%EmptyRange.Make.c75] -// CHECK:STDOUT: %Make.ref: %EmptyRange.Make.type.d9c = name_ref Make, %.loc10_42 [concrete = constants.%EmptyRange.Make.c75] -// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %Make.ref, @EmptyRange.Make(constants.%Copy.facet.307) [concrete = constants.%EmptyRange.Make.specific_fn] -// CHECK:STDOUT: %.loc10_48.1: ref %EmptyRange.b32 = temporary_storage -// CHECK:STDOUT: %EmptyRange.Make.call: init %EmptyRange.b32 = call %EmptyRange.Make.specific_fn() to %.loc10_48.1 -// CHECK:STDOUT: %.loc10_48.2: ref %EmptyRange.b32 = temporary %.loc10_48.1, %EmptyRange.Make.call -// CHECK:STDOUT: %impl.elem2: %.414 = impl_witness_access constants.%Iterate.impl_witness.2ed, element2 [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.e68] +// CHECK:STDOUT: %.loc10_41.3: %Copy.type = converted constants.%C, %Copy.facet.loc10_41.2 [concrete = constants.%Copy.facet.762] +// CHECK:STDOUT: %facet_value.loc10_41.2: %facet_type = facet_value constants.%tuple.type.56b, (constants.%Destroy.impl_witness.b95, constants.%Copy.impl_witness.cde) [concrete = constants.%facet_value.8ed] +// CHECK:STDOUT: %.loc10_41.4: %facet_type = converted %.loc10_40, %facet_value.loc10_41.2 [concrete = constants.%facet_value.8ed] +// CHECK:STDOUT: %EmptyRange: type = class_type @EmptyRange, @EmptyRange(constants.%facet_value.8ed) [concrete = constants.%EmptyRange.6be] +// CHECK:STDOUT: %.loc10_42: %EmptyRange.Make.type.37d = specific_constant imports.%Main.import_ref.e7c, @EmptyRange(constants.%facet_value.8ed) [concrete = constants.%EmptyRange.Make.296] +// CHECK:STDOUT: %Make.ref: %EmptyRange.Make.type.37d = name_ref Make, %.loc10_42 [concrete = constants.%EmptyRange.Make.296] +// CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %Make.ref, @EmptyRange.Make(constants.%facet_value.8ed) [concrete = constants.%EmptyRange.Make.specific_fn] +// CHECK:STDOUT: %.loc10_48.1: ref %EmptyRange.6be = temporary_storage +// CHECK:STDOUT: %EmptyRange.Make.call: init %EmptyRange.6be = call %EmptyRange.Make.specific_fn() to %.loc10_48.1 +// CHECK:STDOUT: %.loc10_48.2: ref %EmptyRange.6be = temporary %.loc10_48.1, %EmptyRange.Make.call +// CHECK:STDOUT: %impl.elem2: %.3cf = impl_witness_access constants.%Iterate.impl_witness.ec5, element2 [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.cc8] // CHECK:STDOUT: %bound_method.loc10_49.1: = bound_method %.loc10_48.2, %impl.elem2 -// CHECK:STDOUT: %specific_fn.loc10_49.1: = specific_function %impl.elem2, @EmptyRange.as.Iterate.impl.NewCursor(constants.%Copy.facet.307) [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.specific_fn] +// CHECK:STDOUT: %specific_fn.loc10_49.1: = specific_function %impl.elem2, @EmptyRange.as.Iterate.impl.NewCursor(constants.%facet_value.8ed) [concrete = constants.%EmptyRange.as.Iterate.impl.NewCursor.specific_fn] // CHECK:STDOUT: %bound_method.loc10_49.2: = bound_method %.loc10_48.2, %specific_fn.loc10_49.1 -// CHECK:STDOUT: %.loc10_48.3: %EmptyRange.b32 = bind_value %.loc10_48.2 +// CHECK:STDOUT: %.loc10_48.3: %EmptyRange.6be = bind_value %.loc10_48.2 // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.call: init %empty_struct_type = call %bound_method.loc10_49.2(%.loc10_48.3) // CHECK:STDOUT: %var: ref %empty_struct_type = var invalid // CHECK:STDOUT: assign %var, %EmptyRange.as.Iterate.impl.NewCursor.call @@ -832,33 +868,33 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr.loc10_49.1: %ptr.c28 = addr_of %var -// CHECK:STDOUT: %impl.elem3: %.f02 = impl_witness_access constants.%Iterate.impl_witness.2ed, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.979] +// CHECK:STDOUT: %impl.elem3: %.0c2 = impl_witness_access constants.%Iterate.impl_witness.ec5, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.0ef] // CHECK:STDOUT: %bound_method.loc10_49.3: = bound_method %.loc10_48.2, %impl.elem3 -// CHECK:STDOUT: %specific_fn.loc10_49.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%Copy.facet.307) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] +// CHECK:STDOUT: %specific_fn.loc10_49.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%facet_value.8ed) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] // CHECK:STDOUT: %bound_method.loc10_49.4: = bound_method %.loc10_48.2, %specific_fn.loc10_49.2 -// CHECK:STDOUT: %.loc10_49.1: ref %Optional.654 = temporary_storage -// CHECK:STDOUT: %.loc10_48.4: %EmptyRange.b32 = bind_value %.loc10_48.2 -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.654 = call %bound_method.loc10_49.4(%.loc10_48.4, %addr.loc10_49.1) to %.loc10_49.1 -// CHECK:STDOUT: %.loc10_49.2: ref %Optional.654 = temporary %.loc10_49.1, %EmptyRange.as.Iterate.impl.Next.call -// CHECK:STDOUT: %.loc10_49.3: %Optional.HasValue.type.a71 = specific_constant imports.%Main.import_ref.cfa, @Optional(constants.%Copy.facet.307) [concrete = constants.%Optional.HasValue.2f2] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.a71 = name_ref HasValue, %.loc10_49.3 [concrete = constants.%Optional.HasValue.2f2] +// CHECK:STDOUT: %.loc10_49.1: ref %Optional.ae9 = temporary_storage +// CHECK:STDOUT: %.loc10_48.4: %EmptyRange.6be = bind_value %.loc10_48.2 +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.ae9 = call %bound_method.loc10_49.4(%.loc10_48.4, %addr.loc10_49.1) to %.loc10_49.1 +// CHECK:STDOUT: %.loc10_49.2: ref %Optional.ae9 = temporary %.loc10_49.1, %EmptyRange.as.Iterate.impl.Next.call +// CHECK:STDOUT: %.loc10_49.3: %Optional.HasValue.type.ff8 = specific_constant imports.%Main.import_ref.2b8, @Optional(constants.%facet_value.8ed) [concrete = constants.%Optional.HasValue.f58] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.ff8 = name_ref HasValue, %.loc10_49.3 [concrete = constants.%Optional.HasValue.f58] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc10_49.2, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%Copy.facet.307) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%facet_value.8ed) [concrete = constants.%Optional.HasValue.specific_fn] // CHECK:STDOUT: %bound_method.loc10_49.5: = bound_method %.loc10_49.2, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc10_49.4: %Optional.654 = bind_value %.loc10_49.2 +// CHECK:STDOUT: %.loc10_49.4: %Optional.ae9 = bind_value %.loc10_49.2 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc10_49.5(%.loc10_49.4) // CHECK:STDOUT: %.loc10_49.5: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc10_49.6: bool = converted %Optional.HasValue.call, %.loc10_49.5 // CHECK:STDOUT: if %.loc10_49.6 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc10_49.7: %Optional.Get.type.bc3 = specific_constant imports.%Main.import_ref.01a, @Optional(constants.%Copy.facet.307) [concrete = constants.%Optional.Get.7b4] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.bc3 = name_ref Get, %.loc10_49.7 [concrete = constants.%Optional.Get.7b4] +// CHECK:STDOUT: %.loc10_49.7: %Optional.Get.type.530 = specific_constant imports.%Main.import_ref.e05, @Optional(constants.%facet_value.8ed) [concrete = constants.%Optional.Get.bb2] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.530 = name_ref Get, %.loc10_49.7 [concrete = constants.%Optional.Get.bb2] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc10_49.2, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%Copy.facet.307) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%facet_value.8ed) [concrete = constants.%Optional.Get.specific_fn] // CHECK:STDOUT: %bound_method.loc10_49.6: = bound_method %.loc10_49.2, %Optional.Get.specific_fn // CHECK:STDOUT: %.loc10_49.8: ref %tuple.type.56b = temporary_storage -// CHECK:STDOUT: %.loc10_49.9: %Optional.654 = bind_value %.loc10_49.2 +// CHECK:STDOUT: %.loc10_49.9: %Optional.ae9 = bind_value %.loc10_49.2 // CHECK:STDOUT: %Optional.Get.call: init %tuple.type.56b = call %bound_method.loc10_49.6(%.loc10_49.9) to %.loc10_49.8 // CHECK:STDOUT: %.loc10_49.10: ref %tuple.type.56b = temporary %.loc10_49.8, %Optional.Get.call // CHECK:STDOUT: %tuple.elem0: ref %C = tuple_access %.loc10_49.10, element0 @@ -878,31 +914,31 @@ fn Run() { // CHECK:STDOUT: !for.done: // CHECK:STDOUT: %facet_value.loc10_49.1: %type_where = facet_value constants.%tuple.type.56b, () [concrete = constants.%facet_value.c79] // CHECK:STDOUT: %.loc10_49.13: %type_where = converted constants.%tuple.type.56b, %facet_value.loc10_49.1 [concrete = constants.%facet_value.c79] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_49.1: = bound_method %.loc10_49.10, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.f17 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_49.1: = bound_method %.loc10_49.10, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.614 // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_49.7: = bound_method %.loc10_49.10, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1 // CHECK:STDOUT: %addr.loc10_49.2: %ptr.9f0 = addr_of %.loc10_49.10 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10_49.1: init %empty_tuple.type = call %bound_method.loc10_49.7(%addr.loc10_49.2) -// CHECK:STDOUT: %facet_value.loc10_49.2: %type_where = facet_value constants.%Optional.654, () [concrete = constants.%facet_value.4cb] -// CHECK:STDOUT: %.loc10_49.14: %type_where = converted constants.%Optional.654, %facet_value.loc10_49.2 [concrete = constants.%facet_value.4cb] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_49.2: = bound_method %.loc10_49.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.169 +// CHECK:STDOUT: %facet_value.loc10_49.2: %type_where = facet_value constants.%Optional.ae9, () [concrete = constants.%facet_value.b45] +// CHECK:STDOUT: %.loc10_49.14: %type_where = converted constants.%Optional.ae9, %facet_value.loc10_49.2 [concrete = constants.%facet_value.b45] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_49.2: = bound_method %.loc10_49.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.0e7 // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_49.8: = bound_method %.loc10_49.2, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2 -// CHECK:STDOUT: %addr.loc10_49.3: %ptr.0ac = addr_of %.loc10_49.2 +// CHECK:STDOUT: %addr.loc10_49.3: %ptr.c8a = addr_of %.loc10_49.2 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10_49.2: init %empty_tuple.type = call %bound_method.loc10_49.8(%addr.loc10_49.3) // CHECK:STDOUT: %facet_value.loc10_49.3: %type_where = facet_value constants.%empty_struct_type, () [concrete = constants.%facet_value.7c2] // CHECK:STDOUT: %.loc10_49.15: %type_where = converted constants.%empty_struct_type, %facet_value.loc10_49.3 [concrete = constants.%facet_value.7c2] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_49.3: = bound_method %var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.596 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_49.3: = bound_method %var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.ddd // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_49.9: = bound_method %var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3 // CHECK:STDOUT: %addr.loc10_49.4: %ptr.c28 = addr_of %var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10_49.3: init %empty_tuple.type = call %bound_method.loc10_49.9(%addr.loc10_49.4) -// CHECK:STDOUT: %facet_value.loc10_48: %type_where = facet_value constants.%EmptyRange.b32, () [concrete = constants.%facet_value.2ad] -// CHECK:STDOUT: %.loc10_48.5: %type_where = converted constants.%EmptyRange.b32, %facet_value.loc10_48 [concrete = constants.%facet_value.2ad] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_48: = bound_method %.loc10_48.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.4f3 +// CHECK:STDOUT: %facet_value.loc10_48: %type_where = facet_value constants.%EmptyRange.6be, () [concrete = constants.%facet_value.2a7] +// CHECK:STDOUT: %.loc10_48.5: %type_where = converted constants.%EmptyRange.6be, %facet_value.loc10_48 [concrete = constants.%facet_value.2a7] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10_48: = bound_method %.loc10_48.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.d1b // CHECK:STDOUT: // CHECK:STDOUT: %bound_method.loc10_48: = bound_method %.loc10_48.2, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.4 -// CHECK:STDOUT: %addr.loc10_48: %ptr.4b6 = addr_of %.loc10_48.2 +// CHECK:STDOUT: %addr.loc10_48: %ptr.0e1 = addr_of %.loc10_48.2 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10_48: init %empty_tuple.type = call %bound_method.loc10_48(%addr.loc10_48) // CHECK:STDOUT: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/generic/local.carbon b/toolchain/check/testdata/generic/local.carbon index 8dde4f116e45c..1fd861ba9d50e 100644 --- a/toolchain/check/testdata/generic/local.carbon +++ b/toolchain/check/testdata/generic/local.carbon @@ -17,7 +17,7 @@ library "[[@TEST_NAME]]"; fn F() { - class C(T:! type) { + class C(T:! Core.Destroy) { var x: T; } var v: C(i32) = {.x = 1}; @@ -55,26 +55,35 @@ class C(C:! type) { // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %T: %Destroy.type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %pattern_type.3ab: type = pattern_type %Destroy.type [concrete] // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete] -// CHECK:STDOUT: %C.f06: type = class_type @C, @C(%T) [symbolic] -// CHECK:STDOUT: %require_complete.4ae: = require_complete_type %T [symbolic] -// CHECK:STDOUT: %C.elem.cca: type = unbound_element_type %C.f06, %T [symbolic] -// CHECK:STDOUT: %struct_type.x.2ac: type = struct_type {.x: %T} [symbolic] -// CHECK:STDOUT: %complete_type.433: = complete_type_witness %struct_type.x.2ac [symbolic] +// CHECK:STDOUT: %C.c1b: type = class_type @C, @C(%T) [symbolic] +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic] +// CHECK:STDOUT: %require_complete.cf3: = require_complete_type %T.binding.as_type [symbolic] +// CHECK:STDOUT: %C.elem.82d: type = unbound_element_type %C.c1b, %T.binding.as_type [symbolic] +// CHECK:STDOUT: %struct_type.x.473: type = struct_type {.x: %T.binding.as_type} [symbolic] +// CHECK:STDOUT: %complete_type.b93: = complete_type_witness %struct_type.x.473 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] -// CHECK:STDOUT: %C.d45: type = class_type @C, @C(%i32) [concrete] +// CHECK:STDOUT: %type_where: type = facet_type > [concrete] +// CHECK:STDOUT: %DestroyT: %type_where = bind_symbolic_name DestroyT, 0 [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%DestroyT) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.544: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d = struct_value () [symbolic] +// CHECK:STDOUT: %facet_value.d23: %type_where = facet_value %i32, () [concrete] +// CHECK:STDOUT: %Destroy.impl_witness.f71: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.d23) [concrete] +// CHECK:STDOUT: %Destroy.facet.276: %Destroy.type = facet_value %i32, (%Destroy.impl_witness.f71) [concrete] +// CHECK:STDOUT: %C.4c7: type = class_type @C, @C(%Destroy.facet.276) [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [concrete] -// CHECK:STDOUT: %C.elem.f74: type = unbound_element_type %C.d45, %i32 [concrete] +// CHECK:STDOUT: %C.elem.e98: type = unbound_element_type %C.4c7, %i32 [concrete] // CHECK:STDOUT: %struct_type.x.ed6: type = struct_type {.x: %i32} [concrete] // CHECK:STDOUT: %complete_type.1ec: = complete_type_witness %struct_type.x.ed6 [concrete] -// CHECK:STDOUT: %pattern_type.7db: type = pattern_type %C.d45 [concrete] +// CHECK:STDOUT: %pattern_type.5d3: type = pattern_type %C.4c7 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %struct_type.x.c96: type = struct_type {.x: Core.IntLiteral} [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] @@ -93,29 +102,29 @@ class C(C:! type) { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] -// CHECK:STDOUT: %C.val: %C.d45 = struct_value (%int_1.5d2) [concrete] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %type_where: type = facet_type > [concrete] -// CHECK:STDOUT: %facet_value: %type_where = facet_value %C.d45, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.da4: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.d69: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.da4 = struct_value () [concrete] -// CHECK:STDOUT: %ptr.9c7: type = ptr_type %C.d45 [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.d69, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [concrete] +// CHECK:STDOUT: %C.val: %C.4c7 = struct_value (%int_1.5d2) [concrete] +// CHECK:STDOUT: %facet_value.510: %type_where = facet_value %C.4c7, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.983: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.510) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.1cc: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.983 = struct_value () [concrete] +// CHECK:STDOUT: %ptr.fa7: type = ptr_type %C.4c7 [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.1cc, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.510) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs -// CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] +// CHECK:STDOUT: %Core.import_ref.950: @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.544)] +// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.950), @DestroyT.binding.as_type.as.Destroy.impl [concrete] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.ee7: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -127,42 +136,49 @@ class C(C:! type) { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(%T.loc5_11.2: type) { -// CHECK:STDOUT: %T.loc5_11.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_11.1 (constants.%T)] +// CHECK:STDOUT: generic class @C(%T.loc5_11.2: %Destroy.type) { +// CHECK:STDOUT: %T.loc5_11.1: %Destroy.type = bind_symbolic_name T, 0 [symbolic = %T.loc5_11.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %T.loc5_11.1 [symbolic = %require_complete (constants.%require_complete.4ae)] -// CHECK:STDOUT: %C: type = class_type @C, @C(%T.loc5_11.1) [symbolic = %C (constants.%C.f06)] -// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %T.loc5_11.1 [symbolic = %C.elem (constants.%C.elem.cca)] -// CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @C.%T.loc5_11.1 (%T)} [symbolic = %struct_type.x (constants.%struct_type.x.2ac)] -// CHECK:STDOUT: %complete_type.loc7_3.2: = complete_type_witness %struct_type.x [symbolic = %complete_type.loc7_3.2 (constants.%complete_type.433)] +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc5_11.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %require_complete: = require_complete_type %T.binding.as_type [symbolic = %require_complete (constants.%require_complete.cf3)] +// CHECK:STDOUT: %C: type = class_type @C, @C(%T.loc5_11.1) [symbolic = %C (constants.%C.c1b)] +// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %T.binding.as_type [symbolic = %C.elem (constants.%C.elem.82d)] +// CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @C.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.x (constants.%struct_type.x.473)] +// CHECK:STDOUT: %complete_type.loc7_3.2: = complete_type_witness %struct_type.x [symbolic = %complete_type.loc7_3.2 (constants.%complete_type.b93)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc5_11.2 [symbolic = %T.loc5_11.1 (constants.%T)] -// CHECK:STDOUT: %.loc6: @C.%C.elem (%C.elem.cca) = field_decl x, element0 [concrete] -// CHECK:STDOUT: %complete_type.loc7_3.1: = complete_type_witness constants.%struct_type.x.2ac [symbolic = %complete_type.loc7_3.2 (constants.%complete_type.433)] +// CHECK:STDOUT: %T.ref: %Destroy.type = name_ref T, %T.loc5_11.2 [symbolic = %T.loc5_11.1 (constants.%T)] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc6_12: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc6_10: @C.%C.elem (%C.elem.82d) = field_decl x, element0 [concrete] +// CHECK:STDOUT: %complete_type.loc7_3.1: = complete_type_witness constants.%struct_type.x.473 [symbolic = %complete_type.loc7_3.2 (constants.%complete_type.b93)] // CHECK:STDOUT: complete_type_witness = %complete_type.loc7_3.1 // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%C.f06 +// CHECK:STDOUT: .Self = constants.%C.c1b // CHECK:STDOUT: .T = -// CHECK:STDOUT: .x = %.loc6 +// CHECK:STDOUT: .x = %.loc6_10 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] { -// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] +// CHECK:STDOUT: %T.patt: %pattern_type.3ab = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T.loc5_11.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_11.1 (constants.%T)] +// CHECK:STDOUT: %.loc5: type = splice_block %Destroy.ref [concrete = constants.%Destroy.type] { +// CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Destroy.ref: type = name_ref Destroy, imports.%Core.Destroy [concrete = constants.%Destroy.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %T.loc5_11.2: %Destroy.type = bind_symbolic_name T, 0 [symbolic = %T.loc5_11.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %v.patt: %pattern_type.7db = binding_pattern v [concrete] -// CHECK:STDOUT: %v.var_patt: %pattern_type.7db = var_pattern %v.patt [concrete] +// CHECK:STDOUT: %v.patt: %pattern_type.5d3 = binding_pattern v [concrete] +// CHECK:STDOUT: %v.var_patt: %pattern_type.5d3 = var_pattern %v.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %v.var: ref %C.d45 = var %v.var_patt +// CHECK:STDOUT: %v.var: ref %C.4c7 = var %v.var_patt // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc8_26.1: %struct_type.x.c96 = struct_literal (%int_1) // CHECK:STDOUT: %impl.elem0: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0] @@ -173,22 +189,26 @@ class C(C:! type) { // CHECK:STDOUT: %.loc8_26.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_26.3: ref %i32 = class_element_access %v.var, element0 // CHECK:STDOUT: %.loc8_26.4: init %i32 = initialize_from %.loc8_26.2 to %.loc8_26.3 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc8_26.5: init %C.d45 = class_init (%.loc8_26.4), %v.var [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc8_3.1: init %C.d45 = converted %.loc8_26.1, %.loc8_26.5 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc8_26.5: init %C.4c7 = class_init (%.loc8_26.4), %v.var [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc8_3.1: init %C.4c7 = converted %.loc8_26.1, %.loc8_26.5 [concrete = constants.%C.val] // CHECK:STDOUT: assign %v.var, %.loc8_3.1 -// CHECK:STDOUT: %.loc8_15: type = splice_block %C [concrete = constants.%C.d45] { +// CHECK:STDOUT: %.loc8_15.1: type = splice_block %C [concrete = constants.%C.4c7] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [concrete = constants.%C.d45] +// CHECK:STDOUT: %facet_value.loc8_15: %type_where = facet_value constants.%i32, () [concrete = constants.%facet_value.d23] +// CHECK:STDOUT: %.loc8_15.2: %type_where = converted constants.%i32, %facet_value.loc8_15 [concrete = constants.%facet_value.d23] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %i32, (constants.%Destroy.impl_witness.f71) [concrete = constants.%Destroy.facet.276] +// CHECK:STDOUT: %.loc8_15.3: %Destroy.type = converted %i32, %Destroy.facet [concrete = constants.%Destroy.facet.276] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%Destroy.facet.276) [concrete = constants.%C.4c7] // CHECK:STDOUT: } -// CHECK:STDOUT: %v: ref %C.d45 = bind_name v, %v.var -// CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%C.d45, () [concrete = constants.%facet_value] -// CHECK:STDOUT: %.loc8_3.2: %type_where = converted constants.%C.d45, %facet_value [concrete = constants.%facet_value] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: = bound_method %v.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.d69 -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.d69, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn] +// CHECK:STDOUT: %v: ref %C.4c7 = bind_name v, %v.var +// CHECK:STDOUT: %facet_value.loc8_3: %type_where = facet_value constants.%C.4c7, () [concrete = constants.%facet_value.510] +// CHECK:STDOUT: %.loc8_3.2: %type_where = converted constants.%C.4c7, %facet_value.loc8_3 [concrete = constants.%facet_value.510] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: = bound_method %v.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.1cc +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.1cc, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.510) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc8_3: = bound_method %v.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn -// CHECK:STDOUT: %addr: %ptr.9c7 = addr_of %v.var +// CHECK:STDOUT: %addr: %ptr.fa7 = addr_of %v.var // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_3(%addr) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -197,13 +217,14 @@ class C(C:! type) { // CHECK:STDOUT: %T.loc5_11.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%i32) { -// CHECK:STDOUT: %T.loc5_11.1 => constants.%i32 +// CHECK:STDOUT: specific @C(constants.%Destroy.facet.276) { +// CHECK:STDOUT: %T.loc5_11.1 => constants.%Destroy.facet.276 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %T.binding.as_type => constants.%i32 // CHECK:STDOUT: %require_complete => constants.%complete_type.f8a -// CHECK:STDOUT: %C => constants.%C.d45 -// CHECK:STDOUT: %C.elem => constants.%C.elem.f74 +// CHECK:STDOUT: %C => constants.%C.4c7 +// CHECK:STDOUT: %C.elem => constants.%C.elem.e98 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.ed6 // CHECK:STDOUT: %complete_type.loc7_3.2 => constants.%complete_type.1ec // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/generic/template/unimplemented.carbon b/toolchain/check/testdata/generic/template/unimplemented.carbon index d820c57b915c8..64e4a2d1449b8 100644 --- a/toolchain/check/testdata/generic/template/unimplemented.carbon +++ b/toolchain/check/testdata/generic/template/unimplemented.carbon @@ -271,17 +271,22 @@ fn F[template T:! Core.Destroy](x: T) { // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %i32, (%Copy.impl_witness.dc4) [concrete] // CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] // CHECK:STDOUT: %type_where: type = facet_type > [concrete] -// CHECK:STDOUT: %facet_value: %type_where = facet_value %i32, () [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a12: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete] +// CHECK:STDOUT: %DestroyT: %type_where = bind_symbolic_name DestroyT, 0 [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%DestroyT) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.544: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d = struct_value () [symbolic] +// CHECK:STDOUT: %facet_value.d23: %type_where = facet_value %i32, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a12: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.d23) [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.a57: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a12 = struct_value () [concrete] // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.a57, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %T.9ff, @Destroy [template] -// CHECK:STDOUT: %.8eb: type = fn_type_with_self_type %Destroy.Op.type, %T.9ff [template] -// CHECK:STDOUT: %impl.elem0.b2e: %.8eb = impl_witness_access %Destroy.lookup_impl_witness, element0 [template] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.8ab: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.a57, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.d23) [concrete] +// CHECK:STDOUT: %facet_value.f79: %type_where = facet_value %T.binding.as_type.ef2, () [template] +// CHECK:STDOUT: %Destroy.impl_witness.f86: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.f79) [template] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.fc6: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.f79) [template] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.41b: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.fc6 = struct_value () [template] // CHECK:STDOUT: %ptr.8654e8.2: type = ptr_type %T.binding.as_type.ef2 [template] -// CHECK:STDOUT: %specific_impl_fn.b6b: = specific_impl_function %impl.elem0.b2e, @Destroy.Op(%T.9ff) [template] // CHECK:STDOUT: %require_complete.ebb: = require_complete_type %ptr.8654e8.2 [template] +// CHECK:STDOUT: %.8eb: type = fn_type_with_self_type %Destroy.Op.type, %T.9ff [template] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.d0f: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.41b, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.f79) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -297,6 +302,8 @@ fn F[template T:! Core.Destroy](x: T) { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.import_ref.2eb = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %Copy.impl_witness_table.965 = impl_witness_table (%Core.import_ref.2eb), @Int.as.Copy.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.950: @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d) = import_ref Core//prelude/destroy, loc{{\d+_\d+}}, loaded [symbolic = @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.544)] +// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.950), @DestroyT.binding.as_type.as.Destroy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -336,10 +343,12 @@ fn F[template T:! Core.Destroy](x: T) { // CHECK:STDOUT: %ImplicitAs.type.loc14_3.2: type = facet_type <@ImplicitAs, @ImplicitAs(%T.binding.as_type)> [template = %ImplicitAs.type.loc14_3.2 (constants.%ImplicitAs.type.587)] // CHECK:STDOUT: %.loc14_3.4: = access_member_action %ImplicitAs.type.loc14_3.1, Convert [template] // CHECK:STDOUT: %.loc14_3.5: type = type_of_inst %.loc14_3.4 [template] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %T.loc4_15.1, @Destroy [template = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] +// CHECK:STDOUT: %facet_value.loc14_3.2: %type_where = facet_value %T.binding.as_type, () [template = %facet_value.loc14_3.2 (constants.%facet_value.f79)] +// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc14_3.2) [template = %Destroy.impl_witness (constants.%Destroy.impl_witness.f86)] // CHECK:STDOUT: %.loc14_3.6: type = fn_type_with_self_type constants.%Destroy.Op.type, %T.loc4_15.1 [template = %.loc14_3.6 (constants.%.8eb)] -// CHECK:STDOUT: %impl.elem0.loc14_3.2: @F.%.loc14_3.6 (%.8eb) = impl_witness_access %Destroy.lookup_impl_witness, element0 [template = %impl.elem0.loc14_3.2 (constants.%impl.elem0.b2e)] -// CHECK:STDOUT: %specific_impl_fn.loc14_3.2: = specific_impl_function %impl.elem0.loc14_3.2, @Destroy.Op(%T.loc4_15.1) [template = %specific_impl_fn.loc14_3.2 (constants.%specific_impl_fn.b6b)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc14_3.2) [template = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.fc6)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @F.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.fc6) = struct_value () [template = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.41b)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc14: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc14_3.2) [template = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc14 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.d0f)] // CHECK:STDOUT: %ptr: type = ptr_type %T.binding.as_type [template = %ptr (constants.%ptr.8654e8.2)] // CHECK:STDOUT: %require_complete.loc14: = require_complete_type %ptr [template = %require_complete.loc14 (constants.%require_complete.ebb)] // CHECK:STDOUT: @@ -377,20 +386,22 @@ fn F[template T:! Core.Destroy](x: T) { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var -// CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%i32, () [concrete = constants.%facet_value] -// CHECK:STDOUT: %.loc22_3.3: %type_where = converted constants.%i32, %facet_value [concrete = constants.%facet_value] +// CHECK:STDOUT: %facet_value.loc22: %type_where = facet_value constants.%i32, () [concrete = constants.%facet_value.d23] +// CHECK:STDOUT: %.loc22_3.3: %type_where = converted constants.%i32, %facet_value.loc22 [concrete = constants.%facet_value.d23] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: = bound_method %w.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.a57 -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.a57, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc22: = bound_method %w.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1: = specific_function constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.a57, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.d23) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.8ab] +// CHECK:STDOUT: %bound_method.loc22: = bound_method %w.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1 // CHECK:STDOUT: %addr.loc22: %ptr.235 = addr_of %w.var -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc22(%addr.loc22) +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc22: init %empty_tuple.type = call %bound_method.loc22(%addr.loc22) // CHECK:STDOUT: %as_type.loc14: type = facet_access_type constants.%T.9ff [template = %T.binding.as_type (constants.%T.binding.as_type.ef2)] -// CHECK:STDOUT: %impl.elem0.loc14_3.1: @F.%.loc14_3.6 (%.8eb) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [template = %impl.elem0.loc14_3.2 (constants.%impl.elem0.b2e)] -// CHECK:STDOUT: %bound_method.loc14_3.1: = bound_method %v.var, %impl.elem0.loc14_3.1 -// CHECK:STDOUT: %specific_impl_fn.loc14_3.1: = specific_impl_function %impl.elem0.loc14_3.1, @Destroy.Op(constants.%T.9ff) [template = %specific_impl_fn.loc14_3.2 (constants.%specific_impl_fn.b6b)] -// CHECK:STDOUT: %bound_method.loc14_3.2: = bound_method %v.var, %specific_impl_fn.loc14_3.1 +// CHECK:STDOUT: %facet_value.loc14_3.1: %type_where = facet_value %as_type.loc14, () [template = %facet_value.loc14_3.2 (constants.%facet_value.f79)] +// CHECK:STDOUT: %.loc14_3.3: %type_where = converted constants.%T.9ff, %facet_value.loc14_3.1 [template = %facet_value.loc14_3.2 (constants.%facet_value.f79)] +// CHECK:STDOUT: %impl.elem0: @F.%.loc14_3.6 (%.8eb) = impl_witness_access constants.%Destroy.impl_witness.f86, element0 [template = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.41b)] +// CHECK:STDOUT: %bound_method.loc14_3.1: = bound_method %v.var, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.f79) [template = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc14 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.d0f)] +// CHECK:STDOUT: %bound_method.loc14_3.2: = bound_method %v.var, %specific_fn // CHECK:STDOUT: %addr.loc14: @F.%ptr (%ptr.8654e8.2) = addr_of %v.var -// CHECK:STDOUT: %.loc14_3.3: init %empty_tuple.type = call %bound_method.loc14_3.2(%addr.loc14) +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc14: init %empty_tuple.type = call %bound_method.loc14_3.2(%addr.loc14) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/find_in_final.carbon b/toolchain/check/testdata/impl/lookup/find_in_final.carbon index c62fe4131b601..4ccff2183eda4 100644 --- a/toolchain/check/testdata/impl/lookup/find_in_final.carbon +++ b/toolchain/check/testdata/impl/lookup/find_in_final.carbon @@ -64,7 +64,7 @@ fn F[T:! Z where .X = ()](z: T) { // --- final_impl_makes_compatible_facet_values.carbon library "[[@TEST_NAME]]"; -interface I { let X:! type; } +interface I { let X:! Core.Destroy; } interface J {} final impl forall [T:! J] T as I where .X = () {} @@ -90,7 +90,7 @@ fn F(T:! I & J) -> () { // --- non_final_impl_makes_compatible_facet_values.carbon library "[[@TEST_NAME]]"; -interface I { let X:! type; } +interface I { let X:! Core.Destroy; } interface J {} impl forall [T:! J] T as I where .X = () {} diff --git a/toolchain/check/testdata/impl/lookup/impl_overlap_wrapped_types.carbon b/toolchain/check/testdata/impl/lookup/impl_overlap_wrapped_types.carbon index 17efa39033cb3..41df7d1ad9c59 100644 --- a/toolchain/check/testdata/impl/lookup/impl_overlap_wrapped_types.carbon +++ b/toolchain/check/testdata/impl/lookup/impl_overlap_wrapped_types.carbon @@ -62,7 +62,7 @@ impl Core.MaybeUnformed(C) as I {} impl partial C as I {} impl C* as I {} -// CHECK:STDERR: fail_maybe_unformed_overlap.carbon:[[@LINE+7]]:1: error: redefinition of `impl Core.MaybeUnformed(C) as I` [ImplRedefinition] +// CHECK:STDERR: fail_maybe_unformed_overlap.carbon:[[@LINE+7]]:1: error: redefinition of `impl Core.MaybeUnformed(C as Core.Destroy) as I` [ImplRedefinition] // CHECK:STDERR: impl Core.MaybeUnformed(C) as I {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_maybe_unformed_overlap.carbon:[[@LINE-7]]:1: note: previous definition was here [ImplPreviousDefinition] diff --git a/toolchain/check/testdata/impl/use_assoc_const.carbon b/toolchain/check/testdata/impl/use_assoc_const.carbon index 5082d6dff0ec4..0dab51c88814b 100644 --- a/toolchain/check/testdata/impl/use_assoc_const.carbon +++ b/toolchain/check/testdata/impl/use_assoc_const.carbon @@ -1557,13 +1557,19 @@ fn F() { // CHECK:STDOUT: %impl.elem0.f6a: %.c47 = impl_witness_access %I.lookup_impl_witness, element0 [symbolic] // CHECK:STDOUT: %specific_impl_fn.456: = specific_impl_function %impl.elem0.f6a, @I.Op(%I.facet) [symbolic] // CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem0.82c3d7.2, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %as_type.2a6e07.2, (%Destroy.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %.c2f: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet [symbolic] -// CHECK:STDOUT: %impl.elem0.dd1: %.c2f = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %type_where: type = facet_type > [concrete] +// CHECK:STDOUT: %DestroyT: %type_where = bind_symbolic_name DestroyT, 0 [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%DestroyT) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.544: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d = struct_value () [symbolic] +// CHECK:STDOUT: %facet_value: %type_where = facet_value %as_type.2a6e07.2, () [symbolic] +// CHECK:STDOUT: %Destroy.impl_witness.31e: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.3e2: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.aaa: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.3e2 = struct_value () [symbolic] // CHECK:STDOUT: %ptr.d16: type = ptr_type %as_type.2a6e07.2 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.07a: = specific_impl_function %impl.elem0.dd1, @Destroy.Op(%Destroy.facet) [symbolic] // CHECK:STDOUT: %require_complete.0ed: = require_complete_type %ptr.d16 [symbolic] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %as_type.2a6e07.2, (%Destroy.impl_witness.31e) [symbolic] +// CHECK:STDOUT: %.677: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.aaa, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1575,6 +1581,8 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude/parts/as, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] +// CHECK:STDOUT: %Core.import_ref.950: @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.544)] +// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.950), @DestroyT.binding.as_type.as.Destroy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1747,11 +1755,13 @@ fn F() { // CHECK:STDOUT: %.loc13_16: type = fn_type_with_self_type constants.%I.Op.type, %I.facet.loc13_16 [symbolic = %.loc13_16 (constants.%.c47)] // CHECK:STDOUT: %impl.elem0.loc13_16.2: @GenericResult.%.loc13_16 (%.c47) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_16.2 (constants.%impl.elem0.f6a)] // CHECK:STDOUT: %specific_impl_fn.loc13_16.2: = specific_impl_function %impl.elem0.loc13_16.2, @I.Op(%I.facet.loc13_16) [symbolic = %specific_impl_fn.loc13_16.2 (constants.%specific_impl_fn.456)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem0.loc12_35.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %as_type.loc12_35.1, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet)] -// CHECK:STDOUT: %.loc13_29.8: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc13_29.8 (constants.%.c2f)] -// CHECK:STDOUT: %impl.elem0.loc13_29.2: @GenericResult.%.loc13_29.8 (%.c2f) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_29.2 (constants.%impl.elem0.dd1)] -// CHECK:STDOUT: %specific_impl_fn.loc13_29.2: = specific_impl_function %impl.elem0.loc13_29.2, @Destroy.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc13_29.2 (constants.%specific_impl_fn.07a)] +// CHECK:STDOUT: %facet_value.loc13_29.2: %type_where = facet_value %as_type.loc12_35.1, () [symbolic = %facet_value.loc13_29.2 (constants.%facet_value)] +// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc13_29.2) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.31e)] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %as_type.loc12_35.1, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet)] +// CHECK:STDOUT: %.loc13_29.8: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc13_29.8 (constants.%.677)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc13_29.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.3e2)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @GenericResult.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.3e2) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.aaa)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc13_29.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] // CHECK:STDOUT: %ptr: type = ptr_type %as_type.loc12_35.1 [symbolic = %ptr (constants.%ptr.d16)] // CHECK:STDOUT: %require_complete.loc13: = require_complete_type %ptr [symbolic = %require_complete.loc13 (constants.%require_complete.0ed)] // CHECK:STDOUT: @@ -1794,19 +1804,23 @@ fn F() { // CHECK:STDOUT: %.loc13_29.6: @GenericResult.%as_type.loc12_35.1 (%as_type.2a6e07.2) = bind_value %.loc13_29.5 // CHECK:STDOUT: %.loc13_30.3: init @GenericResult.%as_type.loc12_35.1 (%as_type.2a6e07.2) = call %bound_method.loc13_30(%.loc13_15.6, %.loc13_29.6) to %.loc12_39 // CHECK:STDOUT: %as_type.loc13_29: type = facet_access_type constants.%impl.elem0.82c3d7.2 [symbolic = %as_type.loc12_35.1 (constants.%as_type.2a6e07.2)] -// CHECK:STDOUT: %impl.elem0.loc13_29.1: @GenericResult.%.loc13_29.8 (%.c2f) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_29.2 (constants.%impl.elem0.dd1)] -// CHECK:STDOUT: %bound_method.loc13_29.1: = bound_method %.loc13_29.5, %impl.elem0.loc13_29.1 -// CHECK:STDOUT: %specific_impl_fn.loc13_29.1: = specific_impl_function %impl.elem0.loc13_29.1, @Destroy.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.loc13_29.2 (constants.%specific_impl_fn.07a)] -// CHECK:STDOUT: %bound_method.loc13_29.2: = bound_method %.loc13_29.5, %specific_impl_fn.loc13_29.1 +// CHECK:STDOUT: %facet_value.loc13_29.1: %type_where = facet_value %as_type.loc13_29, () [symbolic = %facet_value.loc13_29.2 (constants.%facet_value)] +// CHECK:STDOUT: %.loc13_29.7: %type_where = converted constants.%impl.elem0.82c3d7.2, %facet_value.loc13_29.1 [symbolic = %facet_value.loc13_29.2 (constants.%facet_value)] +// CHECK:STDOUT: %impl.elem0.loc13_29: @GenericResult.%.loc13_29.8 (%.677) = impl_witness_access constants.%Destroy.impl_witness.31e, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.aaa)] +// CHECK:STDOUT: %bound_method.loc13_29.1: = bound_method %.loc13_29.5, %impl.elem0.loc13_29 +// CHECK:STDOUT: %specific_fn.loc13_29: = specific_function %impl.elem0.loc13_29, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] +// CHECK:STDOUT: %bound_method.loc13_29.2: = bound_method %.loc13_29.5, %specific_fn.loc13_29 // CHECK:STDOUT: %addr.loc13_29: @GenericResult.%ptr (%ptr.d16) = addr_of %.loc13_29.5 -// CHECK:STDOUT: %.loc13_29.7: init %empty_tuple.type = call %bound_method.loc13_29.2(%addr.loc13_29) +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc13_29: init %empty_tuple.type = call %bound_method.loc13_29.2(%addr.loc13_29) // CHECK:STDOUT: %as_type.loc13_15: type = facet_access_type constants.%impl.elem0.82c3d7.2 [symbolic = %as_type.loc12_35.1 (constants.%as_type.2a6e07.2)] -// CHECK:STDOUT: %impl.elem0.loc13_15: @GenericResult.%.loc13_29.8 (%.c2f) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_29.2 (constants.%impl.elem0.dd1)] +// CHECK:STDOUT: %facet_value.loc13_15: %type_where = facet_value %as_type.loc13_15, () [symbolic = %facet_value.loc13_29.2 (constants.%facet_value)] +// CHECK:STDOUT: %.loc13_15.7: %type_where = converted constants.%impl.elem0.82c3d7.2, %facet_value.loc13_15 [symbolic = %facet_value.loc13_29.2 (constants.%facet_value)] +// CHECK:STDOUT: %impl.elem0.loc13_15: @GenericResult.%.loc13_29.8 (%.677) = impl_witness_access constants.%Destroy.impl_witness.31e, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.aaa)] // CHECK:STDOUT: %bound_method.loc13_15.1: = bound_method %.loc13_15.5, %impl.elem0.loc13_15 -// CHECK:STDOUT: %specific_impl_fn.loc13_15: = specific_impl_function %impl.elem0.loc13_15, @Destroy.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.loc13_29.2 (constants.%specific_impl_fn.07a)] -// CHECK:STDOUT: %bound_method.loc13_15.2: = bound_method %.loc13_15.5, %specific_impl_fn.loc13_15 +// CHECK:STDOUT: %specific_fn.loc13_15: = specific_function %impl.elem0.loc13_15, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn)] +// CHECK:STDOUT: %bound_method.loc13_15.2: = bound_method %.loc13_15.5, %specific_fn.loc13_15 // CHECK:STDOUT: %addr.loc13_15: @GenericResult.%ptr (%ptr.d16) = addr_of %.loc13_15.5 -// CHECK:STDOUT: %.loc13_15.7: init %empty_tuple.type = call %bound_method.loc13_15.2(%addr.loc13_15) +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc13_15: init %empty_tuple.type = call %bound_method.loc13_15.2(%addr.loc13_15) // CHECK:STDOUT: return %.loc13_30.3 to %return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/generic_method.carbon b/toolchain/check/testdata/interface/generic_method.carbon index 96b9d8aceffe3..e979db3655b64 100644 --- a/toolchain/check/testdata/interface/generic_method.carbon +++ b/toolchain/check/testdata/interface/generic_method.carbon @@ -38,7 +38,7 @@ fn Call() { (Y as A(X)).F(Z, &u); } -fn CallGeneric(T:! A(X)) { +fn CallGeneric(T:! A(X) & Core.Destroy) { var u: Z; T.F(Z, &u); } @@ -74,7 +74,7 @@ fn Call() { (((Y1, Y2) as type) as A(X)).F(Z, {}); } -fn CallGeneric(T:! A(X)) { +fn CallGeneric(T:! A(X) & Core.Destroy) { T.F(Z, {}); } @@ -126,7 +126,7 @@ fn CallIndirect() { // CHECK:STDOUT: %pattern_type.ac9: type = pattern_type %tuple.type.c14 [symbolic] // CHECK:STDOUT: %Y.as.A.impl.F.type: type = fn_type @Y.as.A.impl.F [concrete] // CHECK:STDOUT: %Y.as.A.impl.F: %Y.as.A.impl.F.type = struct_value () [concrete] -// CHECK:STDOUT: %A.facet: %A.type.0a4 = facet_value %Y, (%A.impl_witness) [concrete] +// CHECK:STDOUT: %A.facet.51d: %A.type.0a4 = facet_value %Y, (%A.impl_witness) [concrete] // CHECK:STDOUT: %tuple.type.5a1: type = tuple_type (type, %A.type.0a4, type) [concrete] // CHECK:STDOUT: %require_complete.86f: = require_complete_type %tuple.type.c14 [symbolic] // CHECK:STDOUT: %require_complete.6e5e64.1: = require_complete_type %ptr.79f131.1 [symbolic] @@ -145,7 +145,7 @@ fn CallIndirect() { // CHECK:STDOUT: %Call.type: type = fn_type @Call [concrete] // CHECK:STDOUT: %Call: %Call.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.8f9: type = pattern_type %Z [concrete] -// CHECK:STDOUT: %.d35: type = fn_type_with_self_type %A.F.type.13d, %A.facet [concrete] +// CHECK:STDOUT: %.d35: type = fn_type_with_self_type %A.F.type.13d, %A.facet.51d [concrete] // CHECK:STDOUT: %ptr.fb6: type = ptr_type %Z [concrete] // CHECK:STDOUT: %pattern_type.f76: type = pattern_type %ptr.fb6 [concrete] // CHECK:STDOUT: %tuple.type.092: type = tuple_type (%X, %Y, %ptr.fb6) [concrete] @@ -171,30 +171,45 @@ fn CallIndirect() { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.8e8: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.766 = struct_value () [concrete] // CHECK:STDOUT: %complete_type.d3e: = complete_type_witness %ptr.fb6 [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.97f: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.8e8, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.4e3) [concrete] -// CHECK:STDOUT: %T.7bf: %A.type.0a4 = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %pattern_type.809: type = pattern_type %A.type.0a4 [concrete] +// CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete] +// CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.f2e = struct_value () [concrete] +// CHECK:STDOUT: %BitAndWith.type.8a6: type = facet_type <@BitAndWith, @BitAndWith(type)> [concrete] +// CHECK:STDOUT: %BitAndWith.Op.type.9a3: type = fn_type @BitAndWith.Op, @BitAndWith(type) [concrete] +// CHECK:STDOUT: %BitAndWith.impl_witness: = impl_witness imports.%BitAndWith.impl_witness_table [concrete] +// CHECK:STDOUT: %BitAndWith.facet: %BitAndWith.type.8a6 = facet_value type, (%BitAndWith.impl_witness) [concrete] +// CHECK:STDOUT: %.fa7: type = fn_type_with_self_type %BitAndWith.Op.type.9a3, %BitAndWith.facet [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.type: type = fn_type @type.as.BitAndWith.impl.Op [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op: %type.as.BitAndWith.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.bound: = bound_method %A.type.0a4, %type.as.BitAndWith.impl.Op [concrete] +// CHECK:STDOUT: %facet_type: type = facet_type <@A, @A(%X) & @Destroy> [concrete] +// CHECK:STDOUT: %T.7eb: %facet_type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %pattern_type.f6e: type = pattern_type %facet_type [concrete] // CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [concrete] // CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [concrete] -// CHECK:STDOUT: %T.binding.as_type.4c5: type = symbolic_binding_type T, 0, %T.7bf [symbolic] -// CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %T.7bf, @A, @A(%X) [symbolic] -// CHECK:STDOUT: %.0c6: type = fn_type_with_self_type %A.F.type.13d, %T.7bf [symbolic] -// CHECK:STDOUT: %impl.elem0.dd2: %.0c6 = impl_witness_access %A.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %tuple.type.6ee: type = tuple_type (%X, %T.binding.as_type.4c5, %ptr.fb6) [symbolic] -// CHECK:STDOUT: %pattern_type.4fd: type = pattern_type %tuple.type.6ee [symbolic] -// CHECK:STDOUT: %specific_impl_fn.304: = specific_impl_function %impl.elem0.dd2, @A.F(%X, %T.7bf, %Z) [symbolic] -// CHECK:STDOUT: %require_complete.439: = require_complete_type %tuple.type.6ee [symbolic] -// CHECK:STDOUT: %facet_value.017: %type_where = facet_value %tuple.type.6ee, () [symbolic] -// CHECK:STDOUT: %Destroy.impl_witness.5b3: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.017) [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.e71: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.017) [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.833: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.e71 = struct_value () [symbolic] -// CHECK:STDOUT: %ptr.641a: type = ptr_type %tuple.type.6ee [symbolic] -// CHECK:STDOUT: %require_complete.3d6: = require_complete_type %ptr.641a [symbolic] -// CHECK:STDOUT: %Destroy.facet.b1d: %Destroy.type = facet_value %tuple.type.6ee, (%Destroy.impl_witness.5b3) [symbolic] -// CHECK:STDOUT: %.dff: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.b1d [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.446: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.833, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.017) [symbolic] +// CHECK:STDOUT: %T.binding.as_type.21d: type = symbolic_binding_type T, 0, %T.7eb [symbolic] +// CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %T.7eb, @A, @A(%X) [symbolic] +// CHECK:STDOUT: %A.facet.419: %A.type.0a4 = facet_value %T.binding.as_type.21d, (%A.lookup_impl_witness) [symbolic] +// CHECK:STDOUT: %.0d6: type = fn_type_with_self_type %A.F.type.13d, %A.facet.419 [symbolic] +// CHECK:STDOUT: %impl.elem0.539: %.0d6 = impl_witness_access %A.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %tuple.type.708: type = tuple_type (%X, %T.binding.as_type.21d, %ptr.fb6) [symbolic] +// CHECK:STDOUT: %pattern_type.5e2: type = pattern_type %tuple.type.708 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.3ac: = specific_impl_function %impl.elem0.539, @A.F(%X, %A.facet.419, %Z) [symbolic] +// CHECK:STDOUT: %require_complete.55f: = require_complete_type %tuple.type.708 [symbolic] +// CHECK:STDOUT: %facet_value.721: %type_where = facet_value %tuple.type.708, () [symbolic] +// CHECK:STDOUT: %Destroy.impl_witness.3df: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.721) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.991: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.721) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.7da: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.991 = struct_value () [symbolic] +// CHECK:STDOUT: %ptr.d52: type = ptr_type %tuple.type.708 [symbolic] +// CHECK:STDOUT: %require_complete.1a2: = require_complete_type %ptr.d52 [symbolic] +// CHECK:STDOUT: %Destroy.facet.325: %Destroy.type = facet_value %tuple.type.708, (%Destroy.impl_witness.3df) [symbolic] +// CHECK:STDOUT: %.9c0: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.325 [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.98e: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.7da, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.721) [symbolic] // CHECK:STDOUT: %CallIndirect.type: type = fn_type @CallIndirect [concrete] // CHECK:STDOUT: %CallIndirect: %CallIndirect.type = struct_value () [concrete] -// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric, @CallGeneric(%A.facet) [concrete] +// CHECK:STDOUT: %facet_value.5b7: %type_where = facet_value %Y, () [concrete] +// CHECK:STDOUT: %Destroy.impl_witness.766: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.5b7) [concrete] +// CHECK:STDOUT: %facet_value.d70: %facet_type = facet_value %Y, (%A.impl_witness, %Destroy.impl_witness.766) [concrete] +// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric, @CallGeneric(%facet_value.d70) [concrete] // CHECK:STDOUT: %complete_type.05d: = complete_type_witness %tuple.type.092 [concrete] // CHECK:STDOUT: %tuple.type.953: type = tuple_type (%empty_struct_type, %empty_struct_type, %ptr.fb6) [concrete] // CHECK:STDOUT: %Copy.impl_witness.4b2: = impl_witness imports.%Copy.impl_witness_table.53c, @ptr.as.Copy.impl(%Z) [concrete] @@ -209,6 +224,7 @@ fn CallIndirect() { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .BitAndWith = %Core.BitAndWith // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -218,6 +234,9 @@ fn CallIndirect() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.import_ref.950: @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.544)] // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.950), @DestroyT.binding.as_type.as.Destroy.impl [concrete] +// CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude/parts/as, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] +// CHECK:STDOUT: %Core.import_ref.636: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.636), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -251,15 +270,22 @@ fn CallIndirect() { // CHECK:STDOUT: %A.impl_witness: = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness] // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [concrete = constants.%Call] {} {} // CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [concrete = constants.%CallGeneric] { -// CHECK:STDOUT: %T.patt: %pattern_type.809 = symbolic_binding_pattern T, 0 [concrete] +// CHECK:STDOUT: %T.patt: %pattern_type.f6e = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc26: type = splice_block %A.type [concrete = constants.%A.type.0a4] { +// CHECK:STDOUT: %.loc26_25.1: type = splice_block %.loc26_25.3 [concrete = constants.%facet_type] { // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.0a4] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Destroy.ref: type = name_ref Destroy, imports.%Core.Destroy [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %impl.elem0.loc26: %.fa7 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %bound_method.loc26: = bound_method %A.type, %impl.elem0.loc26 [concrete = constants.%type.as.BitAndWith.impl.Op.bound] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call: init type = call %bound_method.loc26(%A.type, %Destroy.ref) [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc26_25.2: type = value_of_initializer %type.as.BitAndWith.impl.Op.call [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc26_25.3: type = converted %type.as.BitAndWith.impl.Op.call, %.loc26_25.2 [concrete = constants.%facet_type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc26_16.2: %A.type.0a4 = bind_symbolic_name T, 0 [symbolic = %T.loc26_16.1 (constants.%T.7bf)] +// CHECK:STDOUT: %T.loc26_16.2: %facet_type = bind_symbolic_name T, 0 [symbolic = %T.loc26_16.1 (constants.%T.7eb)] // CHECK:STDOUT: } // CHECK:STDOUT: %CallIndirect.decl: %CallIndirect.type = fn_decl @CallIndirect [concrete = constants.%CallIndirect] {} {} // CHECK:STDOUT: } @@ -441,8 +467,8 @@ fn CallIndirect() { // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.0a4] -// CHECK:STDOUT: %A.facet: %A.type.0a4 = facet_value %Y.ref, (constants.%A.impl_witness) [concrete = constants.%A.facet] -// CHECK:STDOUT: %.loc23_6: %A.type.0a4 = converted %Y.ref, %A.facet [concrete = constants.%A.facet] +// CHECK:STDOUT: %A.facet: %A.type.0a4 = facet_value %Y.ref, (constants.%A.impl_witness) [concrete = constants.%A.facet.51d] +// CHECK:STDOUT: %.loc23_6: %A.type.0a4 = converted %Y.ref, %A.facet [concrete = constants.%A.facet.51d] // CHECK:STDOUT: %.loc23_14.1: %A.assoc_type.296 = specific_constant @A.%assoc0.loc6_41.1, @A(constants.%X) [concrete = constants.%assoc0.5f6] // CHECK:STDOUT: %F.ref: %A.assoc_type.296 = name_ref F, %.loc23_14.1 [concrete = constants.%assoc0.5f6] // CHECK:STDOUT: %as_type: type = facet_access_type %.loc23_6 [concrete = constants.%Y] @@ -472,26 +498,27 @@ fn CallIndirect() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @CallGeneric(%T.loc26_16.2: %A.type.0a4) { -// CHECK:STDOUT: %T.loc26_16.1: %A.type.0a4 = bind_symbolic_name T, 0 [symbolic = %T.loc26_16.1 (constants.%T.7bf)] +// CHECK:STDOUT: generic fn @CallGeneric(%T.loc26_16.2: %facet_type) { +// CHECK:STDOUT: %T.loc26_16.1: %facet_type = bind_symbolic_name T, 0 [symbolic = %T.loc26_16.1 (constants.%T.7eb)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc26_16.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.4c5)] +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc26_16.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.21d)] // CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %T.loc26_16.1, @A, @A(constants.%X) [symbolic = %A.lookup_impl_witness (constants.%A.lookup_impl_witness)] -// CHECK:STDOUT: %.loc28_4.3: type = fn_type_with_self_type constants.%A.F.type.13d, %T.loc26_16.1 [symbolic = %.loc28_4.3 (constants.%.0c6)] -// CHECK:STDOUT: %impl.elem0.loc28_4.2: @CallGeneric.%.loc28_4.3 (%.0c6) = impl_witness_access %A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0.dd2)] -// CHECK:STDOUT: %specific_impl_fn.loc28_4.2: = specific_impl_function %impl.elem0.loc28_4.2, @A.F(constants.%X, %T.loc26_16.1, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn.304)] -// CHECK:STDOUT: %tuple.type: type = tuple_type (constants.%X, %T.binding.as_type, constants.%ptr.fb6) [symbolic = %tuple.type (constants.%tuple.type.6ee)] -// CHECK:STDOUT: %require_complete.loc28_12.1: = require_complete_type %tuple.type [symbolic = %require_complete.loc28_12.1 (constants.%require_complete.439)] -// CHECK:STDOUT: %facet_value.loc28_12.2: %type_where = facet_value %tuple.type, () [symbolic = %facet_value.loc28_12.2 (constants.%facet_value.017)] -// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc28_12.2) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.5b3)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %tuple.type, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.b1d)] -// CHECK:STDOUT: %.loc28_12.5: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc28_12.5 (constants.%.dff)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc28_12.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.e71)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @CallGeneric.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.e71) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.833)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc28_12.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.446)] -// CHECK:STDOUT: %ptr: type = ptr_type %tuple.type [symbolic = %ptr (constants.%ptr.641a)] -// CHECK:STDOUT: %require_complete.loc28_12.2: = require_complete_type %ptr [symbolic = %require_complete.loc28_12.2 (constants.%require_complete.3d6)] +// CHECK:STDOUT: %A.facet: %A.type.0a4 = facet_value %T.binding.as_type, (%A.lookup_impl_witness) [symbolic = %A.facet (constants.%A.facet.419)] +// CHECK:STDOUT: %.loc28_4.3: type = fn_type_with_self_type constants.%A.F.type.13d, %A.facet [symbolic = %.loc28_4.3 (constants.%.0d6)] +// CHECK:STDOUT: %impl.elem0.loc28_4.2: @CallGeneric.%.loc28_4.3 (%.0d6) = impl_witness_access %A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0.539)] +// CHECK:STDOUT: %specific_impl_fn.loc28_4.2: = specific_impl_function %impl.elem0.loc28_4.2, @A.F(constants.%X, %A.facet, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn.3ac)] +// CHECK:STDOUT: %tuple.type: type = tuple_type (constants.%X, %T.binding.as_type, constants.%ptr.fb6) [symbolic = %tuple.type (constants.%tuple.type.708)] +// CHECK:STDOUT: %require_complete.loc28_12.1: = require_complete_type %tuple.type [symbolic = %require_complete.loc28_12.1 (constants.%require_complete.55f)] +// CHECK:STDOUT: %facet_value.loc28_12.2: %type_where = facet_value %tuple.type, () [symbolic = %facet_value.loc28_12.2 (constants.%facet_value.721)] +// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc28_12.2) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.3df)] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %tuple.type, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.325)] +// CHECK:STDOUT: %.loc28_12.5: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc28_12.5 (constants.%.9c0)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc28_12.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.991)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @CallGeneric.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.991) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.7da)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc28_12.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.98e)] +// CHECK:STDOUT: %ptr: type = ptr_type %tuple.type [symbolic = %ptr (constants.%ptr.d52)] +// CHECK:STDOUT: %require_complete.loc28_12.2: = require_complete_type %ptr [symbolic = %require_complete.loc28_12.2 (constants.%require_complete.1a2)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -502,26 +529,26 @@ fn CallIndirect() { // CHECK:STDOUT: %u.var: ref %Z = var %u.var_patt // CHECK:STDOUT: %Z.ref.loc27: type = name_ref Z, file.%Z.decl [concrete = constants.%Z] // CHECK:STDOUT: %u: ref %Z = bind_name u, %u.var -// CHECK:STDOUT: %T.ref: %A.type.0a4 = name_ref T, %T.loc26_16.2 [symbolic = %T.loc26_16.1 (constants.%T.7bf)] +// CHECK:STDOUT: %T.ref: %facet_type = name_ref T, %T.loc26_16.2 [symbolic = %T.loc26_16.1 (constants.%T.7eb)] // CHECK:STDOUT: %.loc28_4.1: %A.assoc_type.296 = specific_constant @A.%assoc0.loc6_41.1, @A(constants.%X) [concrete = constants.%assoc0.5f6] // CHECK:STDOUT: %F.ref: %A.assoc_type.296 = name_ref F, %.loc28_4.1 [concrete = constants.%assoc0.5f6] -// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type.4c5)] -// CHECK:STDOUT: %.loc28_4.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type.4c5)] -// CHECK:STDOUT: %impl.elem0.loc28_4.1: @CallGeneric.%.loc28_4.3 (%.0c6) = impl_witness_access constants.%A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0.dd2)] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type.21d)] +// CHECK:STDOUT: %.loc28_4.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type.21d)] +// CHECK:STDOUT: %impl.elem0.loc28_4.1: @CallGeneric.%.loc28_4.3 (%.0d6) = impl_witness_access constants.%A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0.539)] // CHECK:STDOUT: %Z.ref.loc28: type = name_ref Z, file.%Z.decl [concrete = constants.%Z] // CHECK:STDOUT: %u.ref: ref %Z = name_ref u, %u // CHECK:STDOUT: %addr.loc28_10: %ptr.fb6 = addr_of %u.ref -// CHECK:STDOUT: %specific_impl_fn.loc28_4.1: = specific_impl_function %impl.elem0.loc28_4.1, @A.F(constants.%X, constants.%T.7bf, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn.304)] -// CHECK:STDOUT: %.loc28_12.1: ref @CallGeneric.%tuple.type (%tuple.type.6ee) = temporary_storage -// CHECK:STDOUT: %.loc28_12.2: init @CallGeneric.%tuple.type (%tuple.type.6ee) = call %specific_impl_fn.loc28_4.1(%addr.loc28_10) to %.loc28_12.1 -// CHECK:STDOUT: %.loc28_12.3: ref @CallGeneric.%tuple.type (%tuple.type.6ee) = temporary %.loc28_12.1, %.loc28_12.2 -// CHECK:STDOUT: %facet_value.loc28_12.1: %type_where = facet_value constants.%tuple.type.6ee, () [symbolic = %facet_value.loc28_12.2 (constants.%facet_value.017)] -// CHECK:STDOUT: %.loc28_12.4: %type_where = converted constants.%tuple.type.6ee, %facet_value.loc28_12.1 [symbolic = %facet_value.loc28_12.2 (constants.%facet_value.017)] -// CHECK:STDOUT: %impl.elem0.loc28_12: @CallGeneric.%.loc28_12.5 (%.dff) = impl_witness_access constants.%Destroy.impl_witness.5b3, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.833)] +// CHECK:STDOUT: %specific_impl_fn.loc28_4.1: = specific_impl_function %impl.elem0.loc28_4.1, @A.F(constants.%X, constants.%A.facet.419, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn.3ac)] +// CHECK:STDOUT: %.loc28_12.1: ref @CallGeneric.%tuple.type (%tuple.type.708) = temporary_storage +// CHECK:STDOUT: %.loc28_12.2: init @CallGeneric.%tuple.type (%tuple.type.708) = call %specific_impl_fn.loc28_4.1(%addr.loc28_10) to %.loc28_12.1 +// CHECK:STDOUT: %.loc28_12.3: ref @CallGeneric.%tuple.type (%tuple.type.708) = temporary %.loc28_12.1, %.loc28_12.2 +// CHECK:STDOUT: %facet_value.loc28_12.1: %type_where = facet_value constants.%tuple.type.708, () [symbolic = %facet_value.loc28_12.2 (constants.%facet_value.721)] +// CHECK:STDOUT: %.loc28_12.4: %type_where = converted constants.%tuple.type.708, %facet_value.loc28_12.1 [symbolic = %facet_value.loc28_12.2 (constants.%facet_value.721)] +// CHECK:STDOUT: %impl.elem0.loc28_12: @CallGeneric.%.loc28_12.5 (%.9c0) = impl_witness_access constants.%Destroy.impl_witness.3df, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.7da)] // CHECK:STDOUT: %bound_method.loc28_12.1: = bound_method %.loc28_12.3, %impl.elem0.loc28_12 -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc28_12, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.017) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.446)] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc28_12, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.721) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.98e)] // CHECK:STDOUT: %bound_method.loc28_12.2: = bound_method %.loc28_12.3, %specific_fn -// CHECK:STDOUT: %addr.loc28_12: @CallGeneric.%ptr (%ptr.641a) = addr_of %.loc28_12.3 +// CHECK:STDOUT: %addr.loc28_12: @CallGeneric.%ptr (%ptr.d52) = addr_of %.loc28_12.3 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc28: init %empty_tuple.type = call %bound_method.loc28_12.2(%addr.loc28_12) // CHECK:STDOUT: %facet_value.loc27: %type_where = facet_value constants.%Z, () [concrete = constants.%facet_value.4e3] // CHECK:STDOUT: %.loc27: %type_where = converted constants.%Z, %facet_value.loc27 [concrete = constants.%facet_value.4e3] @@ -538,9 +565,11 @@ fn CallIndirect() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %CallGeneric.ref: %CallGeneric.type = name_ref CallGeneric, file.%CallGeneric.decl [concrete = constants.%CallGeneric] // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y] -// CHECK:STDOUT: %A.facet: %A.type.0a4 = facet_value %Y.ref, (constants.%A.impl_witness) [concrete = constants.%A.facet] -// CHECK:STDOUT: %.loc32: %A.type.0a4 = converted %Y.ref, %A.facet [concrete = constants.%A.facet] -// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric.ref, @CallGeneric(constants.%A.facet) [concrete = constants.%CallGeneric.specific_fn] +// CHECK:STDOUT: %facet_value.loc32_16.1: %type_where = facet_value constants.%Y, () [concrete = constants.%facet_value.5b7] +// CHECK:STDOUT: %.loc32_16.1: %type_where = converted constants.%Y, %facet_value.loc32_16.1 [concrete = constants.%facet_value.5b7] +// CHECK:STDOUT: %facet_value.loc32_16.2: %facet_type = facet_value %Y.ref, (constants.%A.impl_witness, constants.%Destroy.impl_witness.766) [concrete = constants.%facet_value.d70] +// CHECK:STDOUT: %.loc32_16.2: %facet_type = converted %Y.ref, %facet_value.loc32_16.2 [concrete = constants.%facet_value.d70] +// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric.ref, @CallGeneric(constants.%facet_value.d70) [concrete = constants.%CallGeneric.specific_fn] // CHECK:STDOUT: %CallGeneric.call: init %empty_tuple.type = call %CallGeneric.specific_fn() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -582,13 +611,13 @@ fn CallIndirect() { // CHECK:STDOUT: %pattern_type.loc16_25 => constants.%pattern_type.ac9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A.F(constants.%X, constants.%A.facet, constants.%U.8b3) { +// CHECK:STDOUT: specific @A.F(constants.%X, constants.%A.facet.51d, constants.%U.8b3) { // CHECK:STDOUT: %U.loc6_8.1 => constants.%U.8b3 // CHECK:STDOUT: %ptr.loc6_22.1 => constants.%ptr.79f131.1 // CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.afe393.1 // CHECK:STDOUT: %T => constants.%X // CHECK:STDOUT: %A.type => constants.%A.type.0a4 -// CHECK:STDOUT: %Self => constants.%A.facet +// CHECK:STDOUT: %Self => constants.%A.facet.51d // CHECK:STDOUT: %tuple.type.loc6_40.1 => constants.%tuple.type.5a1 // CHECK:STDOUT: %Self.binding.as_type => constants.%Y // CHECK:STDOUT: %tuple.type.loc6_40.2 => constants.%tuple.type.c14 @@ -613,29 +642,30 @@ fn CallIndirect() { // CHECK:STDOUT: %specific_impl_fn.loc17_21.2 => constants.%ptr.as.Copy.impl.Op.specific_fn // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @CallGeneric(constants.%T.7bf) { -// CHECK:STDOUT: %T.loc26_16.1 => constants.%T.7bf +// CHECK:STDOUT: specific @CallGeneric(constants.%T.7eb) { +// CHECK:STDOUT: %T.loc26_16.1 => constants.%T.7eb // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A.F(constants.%X, constants.%T.7bf, constants.%Z) { +// CHECK:STDOUT: specific @A.F(constants.%X, constants.%A.facet.419, constants.%Z) { // CHECK:STDOUT: %U.loc6_8.1 => constants.%Z // CHECK:STDOUT: %ptr.loc6_22.1 => constants.%ptr.fb6 // CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.f76 // CHECK:STDOUT: %T => constants.%X // CHECK:STDOUT: %A.type => constants.%A.type.0a4 -// CHECK:STDOUT: %Self => constants.%T.7bf +// CHECK:STDOUT: %Self => constants.%A.facet.419 // CHECK:STDOUT: %tuple.type.loc6_40.1 => constants.%tuple.type.5a1 -// CHECK:STDOUT: %Self.binding.as_type => constants.%T.binding.as_type.4c5 -// CHECK:STDOUT: %tuple.type.loc6_40.2 => constants.%tuple.type.6ee -// CHECK:STDOUT: %pattern_type.loc6_25 => constants.%pattern_type.4fd +// CHECK:STDOUT: %Self.binding.as_type => constants.%T.binding.as_type.21d +// CHECK:STDOUT: %tuple.type.loc6_40.2 => constants.%tuple.type.708 +// CHECK:STDOUT: %pattern_type.loc6_25 => constants.%pattern_type.5e2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @CallGeneric(constants.%A.facet) { -// CHECK:STDOUT: %T.loc26_16.1 => constants.%A.facet +// CHECK:STDOUT: specific @CallGeneric(constants.%facet_value.d70) { +// CHECK:STDOUT: %T.loc26_16.1 => constants.%facet_value.d70 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.binding.as_type => constants.%Y // CHECK:STDOUT: %A.lookup_impl_witness => constants.%A.impl_witness +// CHECK:STDOUT: %A.facet => constants.%A.facet.51d // CHECK:STDOUT: %.loc28_4.3 => constants.%.d35 // CHECK:STDOUT: %impl.elem0.loc28_4.2 => constants.%Y.as.A.impl.F // CHECK:STDOUT: %specific_impl_fn.loc28_4.2 => constants.%Y.as.A.impl.F.specific_fn @@ -652,13 +682,13 @@ fn CallIndirect() { // CHECK:STDOUT: %require_complete.loc28_12.2 => constants.%complete_type.aab // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A.F(constants.%X, constants.%A.facet, constants.%Z) { +// CHECK:STDOUT: specific @A.F(constants.%X, constants.%A.facet.51d, constants.%Z) { // CHECK:STDOUT: %U.loc6_8.1 => constants.%Z // CHECK:STDOUT: %ptr.loc6_22.1 => constants.%ptr.fb6 // CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.f76 // CHECK:STDOUT: %T => constants.%X // CHECK:STDOUT: %A.type => constants.%A.type.0a4 -// CHECK:STDOUT: %Self => constants.%A.facet +// CHECK:STDOUT: %Self => constants.%A.facet.51d // CHECK:STDOUT: %tuple.type.loc6_40.1 => constants.%tuple.type.5a1 // CHECK:STDOUT: %Self.binding.as_type => constants.%Y // CHECK:STDOUT: %tuple.type.loc6_40.2 => constants.%tuple.type.092 @@ -758,43 +788,62 @@ fn CallIndirect() { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.8e8: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.766 = struct_value () [concrete] // CHECK:STDOUT: %ptr.fb6: type = ptr_type %Z [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.97f: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.8e8, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.4e3) [concrete] -// CHECK:STDOUT: %T.7bf: %A.type.0a4 = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %pattern_type.809: type = pattern_type %A.type.0a4 [concrete] +// CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete] +// CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.f2e = struct_value () [concrete] +// CHECK:STDOUT: %BitAndWith.type.8a6: type = facet_type <@BitAndWith, @BitAndWith(type)> [concrete] +// CHECK:STDOUT: %BitAndWith.Op.type.9a3: type = fn_type @BitAndWith.Op, @BitAndWith(type) [concrete] +// CHECK:STDOUT: %BitAndWith.impl_witness: = impl_witness imports.%BitAndWith.impl_witness_table [concrete] +// CHECK:STDOUT: %BitAndWith.facet: %BitAndWith.type.8a6 = facet_value type, (%BitAndWith.impl_witness) [concrete] +// CHECK:STDOUT: %.fa7: type = fn_type_with_self_type %BitAndWith.Op.type.9a3, %BitAndWith.facet [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.type: type = fn_type @type.as.BitAndWith.impl.Op [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op: %type.as.BitAndWith.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.bound: = bound_method %A.type.0a4, %type.as.BitAndWith.impl.Op [concrete] +// CHECK:STDOUT: %facet_type: type = facet_type <@A, @A(%X) & @Destroy> [concrete] +// CHECK:STDOUT: %T.7eb: %facet_type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %pattern_type.f6e: type = pattern_type %facet_type [concrete] // CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [concrete] // CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [concrete] -// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.7bf [symbolic] -// CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %T.7bf, @A, @A(%X) [symbolic] -// CHECK:STDOUT: %.0c6: type = fn_type_with_self_type %A.F.type.13d, %T.7bf [symbolic] -// CHECK:STDOUT: %impl.elem0: %.0c6 = impl_witness_access %A.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.7eb [symbolic] +// CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %T.7eb, @A, @A(%X) [symbolic] +// CHECK:STDOUT: %A.facet.419: %A.type.0a4 = facet_value %T.binding.as_type, (%A.lookup_impl_witness) [symbolic] +// CHECK:STDOUT: %.0d6: type = fn_type_with_self_type %A.F.type.13d, %A.facet.419 [symbolic] +// CHECK:STDOUT: %impl.elem0: %.0d6 = impl_witness_access %A.lookup_impl_witness, element0 [symbolic] // CHECK:STDOUT: %tuple.type.5a1: type = tuple_type (type, %A.type.0a4, type) [concrete] -// CHECK:STDOUT: %tuple.type.16c: type = tuple_type (%X, %T.binding.as_type, %Z) [symbolic] -// CHECK:STDOUT: %pattern_type.c32: type = pattern_type %tuple.type.16c [symbolic] -// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @A.F(%X, %T.7bf, %Z) [symbolic] -// CHECK:STDOUT: %require_complete.788: = require_complete_type %tuple.type.16c [symbolic] -// CHECK:STDOUT: %facet_value.237: %type_where = facet_value %tuple.type.16c, () [symbolic] -// CHECK:STDOUT: %Destroy.impl_witness.6de: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.237) [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b35: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.237) [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.cae: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b35 = struct_value () [symbolic] -// CHECK:STDOUT: %ptr.784: type = ptr_type %tuple.type.16c [symbolic] -// CHECK:STDOUT: %require_complete.8be: = require_complete_type %ptr.784 [symbolic] -// CHECK:STDOUT: %Destroy.facet.837: %Destroy.type = facet_value %tuple.type.16c, (%Destroy.impl_witness.6de) [symbolic] -// CHECK:STDOUT: %.a5a: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.837 [symbolic] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.d49: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.cae, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.237) [symbolic] +// CHECK:STDOUT: %tuple.type.c44: type = tuple_type (%X, %T.binding.as_type, %Z) [symbolic] +// CHECK:STDOUT: %pattern_type.d75: type = pattern_type %tuple.type.c44 [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @A.F(%X, %A.facet.419, %Z) [symbolic] +// CHECK:STDOUT: %require_complete.3ab: = require_complete_type %tuple.type.c44 [symbolic] +// CHECK:STDOUT: %facet_value.acf: %type_where = facet_value %tuple.type.c44, () [symbolic] +// CHECK:STDOUT: %Destroy.impl_witness.d37: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.acf) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.83d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.acf) [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.ef3: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.83d = struct_value () [symbolic] +// CHECK:STDOUT: %ptr.4ad: type = ptr_type %tuple.type.c44 [symbolic] +// CHECK:STDOUT: %require_complete.9f1: = require_complete_type %ptr.4ad [symbolic] +// CHECK:STDOUT: %Destroy.facet.f4b: %Destroy.type = facet_value %tuple.type.c44, (%Destroy.impl_witness.d37) [symbolic] +// CHECK:STDOUT: %.078: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.f4b [symbolic] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.d46: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.ef3, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.acf) [symbolic] // CHECK:STDOUT: %CallIndirect.type: type = fn_type @CallIndirect [concrete] // CHECK:STDOUT: %CallIndirect: %CallIndirect.type = struct_value () [concrete] -// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric, @CallGeneric(%A.facet.cdd) [concrete] +// CHECK:STDOUT: %facet_value.3b5: %type_where = facet_value %tuple.type.a46, () [concrete] +// CHECK:STDOUT: %Destroy.impl_witness.a08: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.3b5) [concrete] +// CHECK:STDOUT: %facet_value.049: %facet_type = facet_value %tuple.type.a46, (%A.impl_witness.c8b, %Destroy.impl_witness.a08) [concrete] +// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric, @CallGeneric(%facet_value.049) [concrete] // CHECK:STDOUT: %complete_type.aa8: = complete_type_witness %tuple.type.415 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: .BitAndWith = %Core.BitAndWith // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.import_ref.950: @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.544)] // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.950), @DestroyT.binding.as_type.as.Destroy.impl [concrete] +// CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude/parts/as, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] +// CHECK:STDOUT: %Core.import_ref.636: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.636), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -843,15 +892,22 @@ fn CallIndirect() { // CHECK:STDOUT: %A.impl_witness: = impl_witness %A.impl_witness_table, @tuple.type.as.A.impl(constants.%V1, constants.%V2, constants.%W) [symbolic = @tuple.type.as.A.impl.%A.impl_witness (constants.%A.impl_witness.4bf)] // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [concrete = constants.%Call] {} {} // CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [concrete = constants.%CallGeneric] { -// CHECK:STDOUT: %T.patt: %pattern_type.809 = symbolic_binding_pattern T, 0 [concrete] +// CHECK:STDOUT: %T.patt: %pattern_type.f6e = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc27: type = splice_block %A.type [concrete = constants.%A.type.0a4] { +// CHECK:STDOUT: %.loc27_25.1: type = splice_block %.loc27_25.3 [concrete = constants.%facet_type] { // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.0a4] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Destroy.ref: type = name_ref Destroy, imports.%Core.Destroy [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %impl.elem0.loc27: %.fa7 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %bound_method.loc27: = bound_method %A.type, %impl.elem0.loc27 [concrete = constants.%type.as.BitAndWith.impl.Op.bound] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call: init type = call %bound_method.loc27(%A.type, %Destroy.ref) [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc27_25.2: type = value_of_initializer %type.as.BitAndWith.impl.Op.call [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc27_25.3: type = converted %type.as.BitAndWith.impl.Op.call, %.loc27_25.2 [concrete = constants.%facet_type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc27_16.2: %A.type.0a4 = bind_symbolic_name T, 0 [symbolic = %T.loc27_16.1 (constants.%T.7bf)] +// CHECK:STDOUT: %T.loc27_16.2: %facet_type = bind_symbolic_name T, 0 [symbolic = %T.loc27_16.1 (constants.%T.7eb)] // CHECK:STDOUT: } // CHECK:STDOUT: %CallIndirect.decl: %CallIndirect.type = fn_decl @CallIndirect [concrete = constants.%CallIndirect] {} {} // CHECK:STDOUT: } @@ -1069,53 +1125,54 @@ fn CallIndirect() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @CallGeneric(%T.loc27_16.2: %A.type.0a4) { -// CHECK:STDOUT: %T.loc27_16.1: %A.type.0a4 = bind_symbolic_name T, 0 [symbolic = %T.loc27_16.1 (constants.%T.7bf)] +// CHECK:STDOUT: generic fn @CallGeneric(%T.loc27_16.2: %facet_type) { +// CHECK:STDOUT: %T.loc27_16.1: %facet_type = bind_symbolic_name T, 0 [symbolic = %T.loc27_16.1 (constants.%T.7eb)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc27_16.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] // CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %T.loc27_16.1, @A, @A(constants.%X) [symbolic = %A.lookup_impl_witness (constants.%A.lookup_impl_witness)] -// CHECK:STDOUT: %.loc28_4.3: type = fn_type_with_self_type constants.%A.F.type.13d, %T.loc27_16.1 [symbolic = %.loc28_4.3 (constants.%.0c6)] -// CHECK:STDOUT: %impl.elem0.loc28_4.2: @CallGeneric.%.loc28_4.3 (%.0c6) = impl_witness_access %A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_impl_fn.loc28_4.2: = specific_impl_function %impl.elem0.loc28_4.2, @A.F(constants.%X, %T.loc27_16.1, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn)] -// CHECK:STDOUT: %tuple.type: type = tuple_type (constants.%X, %T.binding.as_type, constants.%Z) [symbolic = %tuple.type (constants.%tuple.type.16c)] -// CHECK:STDOUT: %require_complete.loc28_12.1: = require_complete_type %tuple.type [symbolic = %require_complete.loc28_12.1 (constants.%require_complete.788)] -// CHECK:STDOUT: %facet_value.loc28_12.2: %type_where = facet_value %tuple.type, () [symbolic = %facet_value.loc28_12.2 (constants.%facet_value.237)] -// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc28_12.2) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.6de)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %tuple.type, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.837)] -// CHECK:STDOUT: %.loc28_12.5: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc28_12.5 (constants.%.a5a)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc28_12.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.b35)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @CallGeneric.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.b35) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.cae)] -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc28_12.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.d49)] -// CHECK:STDOUT: %ptr: type = ptr_type %tuple.type [symbolic = %ptr (constants.%ptr.784)] -// CHECK:STDOUT: %require_complete.loc28_12.2: = require_complete_type %ptr [symbolic = %require_complete.loc28_12.2 (constants.%require_complete.8be)] +// CHECK:STDOUT: %A.facet: %A.type.0a4 = facet_value %T.binding.as_type, (%A.lookup_impl_witness) [symbolic = %A.facet (constants.%A.facet.419)] +// CHECK:STDOUT: %.loc28_4.3: type = fn_type_with_self_type constants.%A.F.type.13d, %A.facet [symbolic = %.loc28_4.3 (constants.%.0d6)] +// CHECK:STDOUT: %impl.elem0.loc28_4.2: @CallGeneric.%.loc28_4.3 (%.0d6) = impl_witness_access %A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_impl_fn.loc28_4.2: = specific_impl_function %impl.elem0.loc28_4.2, @A.F(constants.%X, %A.facet, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %tuple.type: type = tuple_type (constants.%X, %T.binding.as_type, constants.%Z) [symbolic = %tuple.type (constants.%tuple.type.c44)] +// CHECK:STDOUT: %require_complete.loc28_12.1: = require_complete_type %tuple.type [symbolic = %require_complete.loc28_12.1 (constants.%require_complete.3ab)] +// CHECK:STDOUT: %facet_value.loc28_12.2: %type_where = facet_value %tuple.type, () [symbolic = %facet_value.loc28_12.2 (constants.%facet_value.acf)] +// CHECK:STDOUT: %Destroy.impl_witness: = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc28_12.2) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.d37)] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %tuple.type, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.f4b)] +// CHECK:STDOUT: %.loc28_12.5: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc28_12.5 (constants.%.078)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.loc28_12.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.83d)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @CallGeneric.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.83d) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.ef3)] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.loc28_12.2) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.d46)] +// CHECK:STDOUT: %ptr: type = ptr_type %tuple.type [symbolic = %ptr (constants.%ptr.4ad)] +// CHECK:STDOUT: %require_complete.loc28_12.2: = require_complete_type %ptr [symbolic = %require_complete.loc28_12.2 (constants.%require_complete.9f1)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %T.ref: %A.type.0a4 = name_ref T, %T.loc27_16.2 [symbolic = %T.loc27_16.1 (constants.%T.7bf)] +// CHECK:STDOUT: %T.ref: %facet_type = name_ref T, %T.loc27_16.2 [symbolic = %T.loc27_16.1 (constants.%T.7eb)] // CHECK:STDOUT: %.loc28_4.1: %A.assoc_type.296 = specific_constant @A.%assoc0.loc6_39.1, @A(constants.%X) [concrete = constants.%assoc0.5f6] // CHECK:STDOUT: %F.ref: %A.assoc_type.296 = name_ref F, %.loc28_4.1 [concrete = constants.%assoc0.5f6] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] // CHECK:STDOUT: %.loc28_4.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %impl.elem0.loc28_4.1: @CallGeneric.%.loc28_4.3 (%.0c6) = impl_witness_access constants.%A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc28_4.1: @CallGeneric.%.loc28_4.3 (%.0d6) = impl_witness_access constants.%A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0)] // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z] // CHECK:STDOUT: %.loc28_11.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %specific_impl_fn.loc28_4.1: = specific_impl_function %impl.elem0.loc28_4.1, @A.F(constants.%X, constants.%T.7bf, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn)] -// CHECK:STDOUT: %.loc28_12.1: ref @CallGeneric.%tuple.type (%tuple.type.16c) = temporary_storage +// CHECK:STDOUT: %specific_impl_fn.loc28_4.1: = specific_impl_function %impl.elem0.loc28_4.1, @A.F(constants.%X, constants.%A.facet.419, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %.loc28_12.1: ref @CallGeneric.%tuple.type (%tuple.type.c44) = temporary_storage // CHECK:STDOUT: %.loc28_11.2: ref %Z = temporary_storage // CHECK:STDOUT: %.loc28_11.3: init %Z = class_init (), %.loc28_11.2 [concrete = constants.%Z.val] // CHECK:STDOUT: %.loc28_11.4: ref %Z = temporary %.loc28_11.2, %.loc28_11.3 // CHECK:STDOUT: %.loc28_11.5: ref %Z = converted %.loc28_11.1, %.loc28_11.4 // CHECK:STDOUT: %.loc28_11.6: %Z = bind_value %.loc28_11.5 -// CHECK:STDOUT: %.loc28_12.2: init @CallGeneric.%tuple.type (%tuple.type.16c) = call %specific_impl_fn.loc28_4.1(%.loc28_11.6) to %.loc28_12.1 -// CHECK:STDOUT: %.loc28_12.3: ref @CallGeneric.%tuple.type (%tuple.type.16c) = temporary %.loc28_12.1, %.loc28_12.2 -// CHECK:STDOUT: %facet_value.loc28_12.1: %type_where = facet_value constants.%tuple.type.16c, () [symbolic = %facet_value.loc28_12.2 (constants.%facet_value.237)] -// CHECK:STDOUT: %.loc28_12.4: %type_where = converted constants.%tuple.type.16c, %facet_value.loc28_12.1 [symbolic = %facet_value.loc28_12.2 (constants.%facet_value.237)] -// CHECK:STDOUT: %impl.elem0.loc28_12: @CallGeneric.%.loc28_12.5 (%.a5a) = impl_witness_access constants.%Destroy.impl_witness.6de, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.cae)] +// CHECK:STDOUT: %.loc28_12.2: init @CallGeneric.%tuple.type (%tuple.type.c44) = call %specific_impl_fn.loc28_4.1(%.loc28_11.6) to %.loc28_12.1 +// CHECK:STDOUT: %.loc28_12.3: ref @CallGeneric.%tuple.type (%tuple.type.c44) = temporary %.loc28_12.1, %.loc28_12.2 +// CHECK:STDOUT: %facet_value.loc28_12.1: %type_where = facet_value constants.%tuple.type.c44, () [symbolic = %facet_value.loc28_12.2 (constants.%facet_value.acf)] +// CHECK:STDOUT: %.loc28_12.4: %type_where = converted constants.%tuple.type.c44, %facet_value.loc28_12.1 [symbolic = %facet_value.loc28_12.2 (constants.%facet_value.acf)] +// CHECK:STDOUT: %impl.elem0.loc28_12: @CallGeneric.%.loc28_12.5 (%.078) = impl_witness_access constants.%Destroy.impl_witness.d37, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.ef3)] // CHECK:STDOUT: %bound_method.loc28_12.1: = bound_method %.loc28_12.3, %impl.elem0.loc28_12 -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc28_12, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.237) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.d49)] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc28_12, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.acf) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.loc28 (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.d46)] // CHECK:STDOUT: %bound_method.loc28_12.2: = bound_method %.loc28_12.3, %specific_fn -// CHECK:STDOUT: %addr.loc28_12: @CallGeneric.%ptr (%ptr.784) = addr_of %.loc28_12.3 +// CHECK:STDOUT: %addr.loc28_12: @CallGeneric.%ptr (%ptr.4ad) = addr_of %.loc28_12.3 // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc28_12: init %empty_tuple.type = call %bound_method.loc28_12.2(%addr.loc28_12) // CHECK:STDOUT: %facet_value.loc28_11: %type_where = facet_value constants.%Z, () [concrete = constants.%facet_value.4e3] // CHECK:STDOUT: %.loc28_11.7: %type_where = converted constants.%Z, %facet_value.loc28_11 [concrete = constants.%facet_value.4e3] @@ -1135,9 +1192,11 @@ fn CallIndirect() { // CHECK:STDOUT: %Y2.ref: type = name_ref Y2, file.%Y2.decl [concrete = constants.%Y2] // CHECK:STDOUT: %.loc33_22: %tuple.type.24b = tuple_literal (%Y1.ref, %Y2.ref) // CHECK:STDOUT: %.loc33_24: type = converted %.loc33_22, constants.%tuple.type.a46 [concrete = constants.%tuple.type.a46] -// CHECK:STDOUT: %A.facet: %A.type.0a4 = facet_value %.loc33_24, (constants.%A.impl_witness.c8b) [concrete = constants.%A.facet.cdd] -// CHECK:STDOUT: %.loc33_31: %A.type.0a4 = converted %.loc33_24, %A.facet [concrete = constants.%A.facet.cdd] -// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric.ref, @CallGeneric(constants.%A.facet.cdd) [concrete = constants.%CallGeneric.specific_fn] +// CHECK:STDOUT: %facet_value.loc33_31.1: %type_where = facet_value constants.%tuple.type.a46, () [concrete = constants.%facet_value.3b5] +// CHECK:STDOUT: %.loc33_31.1: %type_where = converted constants.%tuple.type.a46, %facet_value.loc33_31.1 [concrete = constants.%facet_value.3b5] +// CHECK:STDOUT: %facet_value.loc33_31.2: %facet_type = facet_value %.loc33_24, (constants.%A.impl_witness.c8b, constants.%Destroy.impl_witness.a08) [concrete = constants.%facet_value.049] +// CHECK:STDOUT: %.loc33_31.2: %facet_type = converted %.loc33_24, %facet_value.loc33_31.2 [concrete = constants.%facet_value.049] +// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric.ref, @CallGeneric(constants.%facet_value.049) [concrete = constants.%CallGeneric.specific_fn] // CHECK:STDOUT: %CallGeneric.call: init %empty_tuple.type = call %CallGeneric.specific_fn() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1258,28 +1317,29 @@ fn CallIndirect() { // CHECK:STDOUT: %tuple.type.as.A.impl.F.specific_fn.loc18_12.2 => constants.%tuple.type.as.A.impl.F.specific_fn.417 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @CallGeneric(constants.%T.7bf) { -// CHECK:STDOUT: %T.loc27_16.1 => constants.%T.7bf +// CHECK:STDOUT: specific @CallGeneric(constants.%T.7eb) { +// CHECK:STDOUT: %T.loc27_16.1 => constants.%T.7eb // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A.F(constants.%X, constants.%T.7bf, constants.%Z) { +// CHECK:STDOUT: specific @A.F(constants.%X, constants.%A.facet.419, constants.%Z) { // CHECK:STDOUT: %U.loc6_8.1 => constants.%Z // CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.8f9 // CHECK:STDOUT: %T => constants.%X // CHECK:STDOUT: %A.type => constants.%A.type.0a4 -// CHECK:STDOUT: %Self => constants.%T.7bf +// CHECK:STDOUT: %Self => constants.%A.facet.419 // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.5a1 // CHECK:STDOUT: %Self.binding.as_type => constants.%T.binding.as_type -// CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.16c -// CHECK:STDOUT: %pattern_type.loc6_24 => constants.%pattern_type.c32 +// CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.c44 +// CHECK:STDOUT: %pattern_type.loc6_24 => constants.%pattern_type.d75 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @CallGeneric(constants.%A.facet.cdd) { -// CHECK:STDOUT: %T.loc27_16.1 => constants.%A.facet.cdd +// CHECK:STDOUT: specific @CallGeneric(constants.%facet_value.049) { +// CHECK:STDOUT: %T.loc27_16.1 => constants.%facet_value.049 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.binding.as_type => constants.%tuple.type.a46 // CHECK:STDOUT: %A.lookup_impl_witness => constants.%A.impl_witness.c8b +// CHECK:STDOUT: %A.facet => constants.%A.facet.cdd // CHECK:STDOUT: %.loc28_4.3 => constants.%.9b3 // CHECK:STDOUT: %impl.elem0.loc28_4.2 => constants.%tuple.type.as.A.impl.F.e39 // CHECK:STDOUT: %specific_impl_fn.loc28_4.2 => constants.%tuple.type.as.A.impl.F.specific_fn.417 diff --git a/toolchain/lower/testdata/array/iterate.carbon b/toolchain/lower/testdata/array/iterate.carbon index 34e6a08c9d806..a2025b4dcf82c 100644 --- a/toolchain/lower/testdata/array/iterate.carbon +++ b/toolchain/lower/testdata/array/iterate.carbon @@ -30,7 +30,7 @@ fn F() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc16_43.3.temp = alloca [6 x i32], align 4, !dbg !7 // CHECK:STDOUT: %var = alloca i32, align 4, !dbg !8 -// CHECK:STDOUT: %.loc17_19.3.temp = alloca { i1, i32 }, align 8, !dbg !8 +// CHECK:STDOUT: %.loc17_19.5.temp = alloca { i1, i32 }, align 8, !dbg !8 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc16_43.3.temp), !dbg !7 // CHECK:STDOUT: %.loc16_43.4.array.index = getelementptr inbounds [6 x i32], ptr %.loc16_43.3.temp, i32 0, i64 0, !dbg !7 // CHECK:STDOUT: %.loc16_43.7.array.index = getelementptr inbounds [6 x i32], ptr %.loc16_43.3.temp, i32 0, i64 1, !dbg !7 @@ -39,19 +39,19 @@ fn F() { // CHECK:STDOUT: %.loc16_43.16.array.index = getelementptr inbounds [6 x i32], ptr %.loc16_43.3.temp, i32 0, i64 4, !dbg !7 // CHECK:STDOUT: %.loc16_43.19.array.index = getelementptr inbounds [6 x i32], ptr %.loc16_43.3.temp, i32 0, i64 5, !dbg !7 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %.loc16_43.3.temp, ptr align 4 @array.loc16_43.22, i64 24, i1 false), !dbg !7 -// CHECK:STDOUT: %array_type.as.Iterate.impl.NewCursor.call = call i32 @"_CNewCursor.25e6cb2a64776520:Iterate.Core.c71fd8c166af9f17"(ptr %.loc16_43.3.temp), !dbg !8 +// CHECK:STDOUT: %array_type.as.Iterate.impl.NewCursor.call = call i32 @"_CNewCursor.15cf3b4d423d3a2a:Iterate.Core.9b8f4449f50d77ec"(ptr %.loc16_43.3.temp), !dbg !8 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var), !dbg !8 // CHECK:STDOUT: store i32 %array_type.as.Iterate.impl.NewCursor.call, ptr %var, align 4, !dbg !8 // CHECK:STDOUT: br label %for.next, !dbg !8 // CHECK:STDOUT: // CHECK:STDOUT: for.next: ; preds = %for.body, %entry -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_19.3.temp), !dbg !8 -// CHECK:STDOUT: call void @"_CNext.25e6cb2a64776520:Iterate.Core.c71fd8c166af9f17"(ptr %.loc17_19.3.temp, ptr %.loc16_43.3.temp, ptr %var), !dbg !8 -// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.de631560529e9861(ptr %.loc17_19.3.temp), !dbg !8 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_19.5.temp), !dbg !8 +// CHECK:STDOUT: call void @"_CNext.15cf3b4d423d3a2a:Iterate.Core.9b8f4449f50d77ec"(ptr %.loc17_19.5.temp, ptr %.loc16_43.3.temp, ptr %var), !dbg !8 +// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.c831c62a6babb214(ptr %.loc17_19.5.temp), !dbg !8 // CHECK:STDOUT: br i1 %Optional.HasValue.call, label %for.body, label %for.done, !dbg !8 // CHECK:STDOUT: // CHECK:STDOUT: for.body: ; preds = %for.next -// CHECK:STDOUT: %Optional.Get.call = call i32 @_CGet.Optional.Core.de631560529e9861(ptr %.loc17_19.3.temp), !dbg !8 +// CHECK:STDOUT: %Optional.Get.call = call i32 @_CGet.Optional.Core.c831c62a6babb214(ptr %.loc17_19.5.temp), !dbg !8 // CHECK:STDOUT: call void @_CG.Main(i32 %Optional.Get.call), !dbg !9 // CHECK:STDOUT: br label %for.next, !dbg !10 // CHECK:STDOUT: @@ -65,11 +65,11 @@ fn F() { // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr i32 @"_CNewCursor.25e6cb2a64776520:Iterate.Core.c71fd8c166af9f17"(ptr %self) !dbg !12 { +// CHECK:STDOUT: define linkonce_odr i32 @"_CNewCursor.15cf3b4d423d3a2a:Iterate.Core.9b8f4449f50d77ec"(ptr %self) !dbg !12 { // CHECK:STDOUT: ret i32 0, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @"_CNext.25e6cb2a64776520:Iterate.Core.c71fd8c166af9f17"(ptr sret({ i1, i32 }) %return, ptr %self, ptr %cursor) !dbg !15 { +// CHECK:STDOUT: define linkonce_odr void @"_CNext.15cf3b4d423d3a2a:Iterate.Core.9b8f4449f50d77ec"(ptr sret({ i1, i32 }) %return, ptr %self, ptr %cursor) !dbg !15 { // CHECK:STDOUT: %1 = load i32, ptr %cursor, align 4, !dbg !16 // CHECK:STDOUT: %2 = icmp slt i32 %1, 6, !dbg !16 // CHECK:STDOUT: br i1 %2, label %3, label %7, !dbg !17 @@ -80,22 +80,22 @@ fn F() { // CHECK:STDOUT: %5 = sub i32 %4, 1, !dbg !19 // CHECK:STDOUT: %array.index = getelementptr inbounds [6 x i32], ptr %self, i32 0, i32 %5, !dbg !20 // CHECK:STDOUT: %6 = load i32, ptr %array.index, align 4, !dbg !20 -// CHECK:STDOUT: call void @_CSome.Optional.Core.de631560529e9861(ptr %return, i32 %6), !dbg !21 +// CHECK:STDOUT: call void @_CSome.Optional.Core.c831c62a6babb214(ptr %return, i32 %6), !dbg !21 // CHECK:STDOUT: ret void, !dbg !22 // CHECK:STDOUT: // CHECK:STDOUT: 7: ; preds = %0 -// CHECK:STDOUT: call void @_CNone.Optional.Core.de631560529e9861(ptr %return), !dbg !23 +// CHECK:STDOUT: call void @_CNone.Optional.Core.c831c62a6babb214(ptr %return), !dbg !23 // CHECK:STDOUT: ret void, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.de631560529e9861(ptr %self) !dbg !25 { +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.c831c62a6babb214(ptr %self) !dbg !25 { // CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 0, !dbg !27 // CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !27 // CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !27 // CHECK:STDOUT: ret i1 %2, !dbg !28 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.de631560529e9861(ptr %self) !dbg !29 { +// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.c831c62a6babb214(ptr %self) !dbg !29 { // CHECK:STDOUT: %value = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 1, !dbg !30 // CHECK:STDOUT: %1 = load i32, ptr %value, align 4, !dbg !30 // CHECK:STDOUT: ret i32 %1, !dbg !31 @@ -106,7 +106,7 @@ fn F() { // CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.de631560529e9861(ptr sret({ i1, i32 }) %return, i32 %value) !dbg !36 { +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.c831c62a6babb214(ptr sret({ i1, i32 }) %return, i32 %value) !dbg !36 { // CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i1, i32 }, ptr %return, i32 0, i32 0, !dbg !37 // CHECK:STDOUT: %value1 = getelementptr inbounds nuw { i1, i32 }, ptr %return, i32 0, i32 1, !dbg !37 // CHECK:STDOUT: store i32 %value, ptr %value1, align 4, !dbg !37 @@ -114,7 +114,7 @@ fn F() { // CHECK:STDOUT: ret void, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.de631560529e9861(ptr sret({ i1, i32 }) %return) !dbg !39 { +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.c831c62a6babb214(ptr sret({ i1, i32 }) %return) !dbg !39 { // CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i1, i32 }, ptr %return, i32 0, i32 0, !dbg !40 // CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !40 // CHECK:STDOUT: ret void, !dbg !41 @@ -153,10 +153,10 @@ fn F() { // CHECK:STDOUT: !9 = !DILocation(line: 18, column: 5, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 17, column: 3, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 1, scope: !4) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.25e6cb2a64776520:Iterate.Core.c71fd8c166af9f17", scope: null, file: !13, line: 23, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.15cf3b4d423d3a2a:Iterate.Core.9b8f4449f50d77ec", scope: null, file: !13, line: 23, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !13 = !DIFile(filename: "{{.*}}/prelude/iterate.carbon", directory: "") // CHECK:STDOUT: !14 = !DILocation(line: 23, column: 39, scope: !12) -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.25e6cb2a64776520:Iterate.Core.c71fd8c166af9f17", scope: null, file: !13, line: 24, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.15cf3b4d423d3a2a:Iterate.Core.9b8f4449f50d77ec", scope: null, file: !13, line: 24, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !16 = !DILocation(line: 25, column: 9, scope: !15) // CHECK:STDOUT: !17 = !DILocation(line: 25, column: 8, scope: !15) // CHECK:STDOUT: !18 = !DILocation(line: 26, column: 7, scope: !15) @@ -166,23 +166,23 @@ fn F() { // CHECK:STDOUT: !22 = !DILocation(line: 27, column: 7, scope: !15) // CHECK:STDOUT: !23 = !DILocation(line: 29, column: 14, scope: !15) // CHECK:STDOUT: !24 = !DILocation(line: 29, column: 7, scope: !15) -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.de631560529e9861", scope: null, file: !26, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.c831c62a6babb214", scope: null, file: !26, line: 31, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !26 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !27 = !DILocation(line: 30, column: 46, scope: !25) -// CHECK:STDOUT: !28 = !DILocation(line: 30, column: 39, scope: !25) -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.de631560529e9861", scope: null, file: !26, line: 31, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !30 = !DILocation(line: 31, column: 38, scope: !29) -// CHECK:STDOUT: !31 = !DILocation(line: 31, column: 31, scope: !29) +// CHECK:STDOUT: !27 = !DILocation(line: 31, column: 46, scope: !25) +// CHECK:STDOUT: !28 = !DILocation(line: 31, column: 39, scope: !25) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.c831c62a6babb214", scope: null, file: !26, line: 32, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !30 = !DILocation(line: 32, column: 38, scope: !29) +// CHECK:STDOUT: !31 = !DILocation(line: 32, column: 31, scope: !29) // CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !33, line: 339, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !33 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") // CHECK:STDOUT: !34 = !DILocation(line: 341, column: 5, scope: !32) // CHECK:STDOUT: !35 = !DILocation(line: 339, column: 3, scope: !32) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.de631560529e9861", scope: null, file: !26, line: 26, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !37 = !DILocation(line: 27, column: 12, scope: !36) -// CHECK:STDOUT: !38 = !DILocation(line: 27, column: 5, scope: !36) -// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.de631560529e9861", scope: null, file: !26, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !40 = !DILocation(line: 22, column: 5, scope: !39) -// CHECK:STDOUT: !41 = !DILocation(line: 23, column: 5, scope: !39) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.c831c62a6babb214", scope: null, file: !26, line: 27, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !37 = !DILocation(line: 28, column: 12, scope: !36) +// CHECK:STDOUT: !38 = !DILocation(line: 28, column: 5, scope: !36) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.c831c62a6babb214", scope: null, file: !26, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !40 = !DILocation(line: 23, column: 5, scope: !39) +// CHECK:STDOUT: !41 = !DILocation(line: 24, column: 5, scope: !39) // CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.Core:AddAssignWith.Core.406b182375ada471", scope: null, file: !33, line: 275, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !43 = !DILocation(line: 4294967295, scope: !42) // CHECK:STDOUT: !44 = !DILocation(line: 275, column: 3, scope: !42) diff --git a/toolchain/lower/testdata/builtins/maybe_unformed.carbon b/toolchain/lower/testdata/builtins/maybe_unformed.carbon index feae4ea6b37de..38d80da87bce9 100644 --- a/toolchain/lower/testdata/builtins/maybe_unformed.carbon +++ b/toolchain/lower/testdata/builtins/maybe_unformed.carbon @@ -31,70 +31,10 @@ fn TakeAdapter(x: MaybeUnformedAdapter(i32)) {} fn MakeAdapter() -> MaybeUnformedAdapter(i32); fn PassAdapter() { + // CHECK:STDERR: maybe_unformed.carbon:[[@LINE+4]]:15: error: cannot access member of interface `Core.Destroy` in type `MaybeUnformedAdapter(i32)` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: TakeAdapter(MakeAdapter()); + // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: TakeAdapter(MakeAdapter()); } -// CHECK:STDOUT: ; ModuleID = 'maybe_unformed.carbon' -// CHECK:STDOUT: source_filename = "maybe_unformed.carbon" -// CHECK:STDOUT: -// CHECK:STDOUT: define void @_CTakeBuiltin.Main(ptr %x) !dbg !4 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: declare void @_CMakeBuiltin.Main(ptr sret(i32)) -// CHECK:STDOUT: -// CHECK:STDOUT: define void @_CPassBuiltin.Main() !dbg !8 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc21_27.1.temp = alloca i32, align 4, !dbg !9 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_27.1.temp), !dbg !9 -// CHECK:STDOUT: call void @_CMakeBuiltin.Main(ptr %.loc21_27.1.temp), !dbg !9 -// CHECK:STDOUT: call void @_CTakeBuiltin.Main(ptr %.loc21_27.1.temp), !dbg !10 -// CHECK:STDOUT: ret void, !dbg !11 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define void @_CTakeAdapter.Main(ptr %x) !dbg !12 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !13 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: declare void @_CMakeAdapter.Main(ptr sret(i32)) -// CHECK:STDOUT: -// CHECK:STDOUT: define void @_CPassAdapter.Main() !dbg !14 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc34_27.1.temp = alloca i32, align 4, !dbg !15 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc34_27.1.temp), !dbg !15 -// CHECK:STDOUT: call void @_CMakeAdapter.Main(ptr %.loc34_27.1.temp), !dbg !15 -// CHECK:STDOUT: call void @_CTakeAdapter.Main(ptr %.loc34_27.1.temp), !dbg !16 -// CHECK:STDOUT: ret void, !dbg !17 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #0 -// CHECK:STDOUT: -// CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } -// CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -// CHECK:STDOUT: -// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} -// CHECK:STDOUT: !llvm.dbg.cu = !{!2} -// CHECK:STDOUT: -// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !3 = !DIFile(filename: "maybe_unformed.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "TakeBuiltin", linkageName: "_CTakeBuiltin.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) -// CHECK:STDOUT: !6 = !{} -// CHECK:STDOUT: !7 = !DILocation(line: 15, column: 1, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "PassBuiltin", linkageName: "_CPassBuiltin.Main", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !9 = !DILocation(line: 21, column: 15, scope: !8) -// CHECK:STDOUT: !10 = !DILocation(line: 21, column: 3, scope: !8) -// CHECK:STDOUT: !11 = !DILocation(line: 18, column: 1, scope: !8) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "TakeAdapter", linkageName: "_CTakeAdapter.Main", scope: null, file: !3, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !13 = !DILocation(line: 30, column: 1, scope: !12) -// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "PassAdapter", linkageName: "_CPassAdapter.Main", scope: null, file: !3, line: 33, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !15 = !DILocation(line: 34, column: 15, scope: !14) -// CHECK:STDOUT: !16 = !DILocation(line: 34, column: 3, scope: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 33, column: 1, scope: !14) diff --git a/toolchain/lower/testdata/class/generic.carbon b/toolchain/lower/testdata/class/generic.carbon index cc6bb57f7dbfa..b585de8dacbfc 100644 --- a/toolchain/lower/testdata/class/generic.carbon +++ b/toolchain/lower/testdata/class/generic.carbon @@ -83,331 +83,38 @@ class C(T:! Core.Copy) { } fn AccessBool() -> bool { + // CHECK:STDERR: access.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.Destroy` in type `C(i32 as Core.Copy)` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: var c: C(i32) = {.v = true, .w = 0}; + // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: var c: C(i32) = {.v = true, .w = 0}; return c.GetBool(); } fn AccessInt() -> i32 { + // CHECK:STDERR: access.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.Destroy` in type `C(i32 as Core.Copy)` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: var c: C(i32) = {.v = true, .w = 0}; + // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: var c: C(i32) = {.v = true, .w = 0}; return c.GetT(); } fn AccessEmpty() -> () { + // CHECK:STDERR: access.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.Destroy` in type `C(() as Core.Copy)` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: var c: C(()) = {.v = true, .w = ()}; + // CHECK:STDERR: ^~~~~~~~~~~~ + // CHECK:STDERR: var c: C(()) = {.v = true, .w = ()}; return c.GetT(); } fn AccessTuple() -> (i32, i32, i32) { + // CHECK:STDERR: access.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.Destroy` in type `C((i32, i32, i32) as Core.Copy)` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: var c: C((i32, i32, i32)) = {.v = true, .w = (1, 2, 3)}; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: var c: C((i32, i32, i32)) = {.v = true, .w = (1, 2, 3)}; return c.GetT(); } -// CHECK:STDOUT: ; ModuleID = 'classes.carbon' -// CHECK:STDOUT: source_filename = "classes.carbon" -// CHECK:STDOUT: -// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} -// CHECK:STDOUT: !llvm.dbg.cu = !{!2} -// CHECK:STDOUT: -// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !3 = !DIFile(filename: "classes.carbon", directory: "") -// CHECK:STDOUT: ; ModuleID = 'create.carbon' -// CHECK:STDOUT: source_filename = "create.carbon" -// CHECK:STDOUT: -// CHECK:STDOUT: @Derived.val.loc7_36 = internal constant { { i32 }, i32 } { { i32 } { i32 1 }, i32 2 } -// CHECK:STDOUT: -// CHECK:STDOUT: define void @_CCreateDerived.Create(ptr sret({ { i32 }, i32 }) %return) !dbg !4 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_35.2.base = getelementptr inbounds nuw { { i32 }, i32 }, ptr %return, i32 0, i32 0, !dbg !7 -// CHECK:STDOUT: %.loc7_26.3.b = getelementptr inbounds nuw { i32 }, ptr %.loc7_35.2.base, i32 0, i32 0, !dbg !8 -// CHECK:STDOUT: %.loc7_35.5.d = getelementptr inbounds nuw { { i32 }, i32 }, ptr %return, i32 0, i32 1, !dbg !7 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %return, ptr align 4 @Derived.val.loc7_36, i64 8, i1 false), !dbg !9 -// CHECK:STDOUT: ret void, !dbg !9 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define void @_CCreateAdapter.Create(ptr sret({ { i32 }, i32 }) %return) !dbg !10 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CCreateDerived.Create(ptr %return), !dbg !11 -// CHECK:STDOUT: ret void, !dbg !12 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 -// CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } -// CHECK:STDOUT: -// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} -// CHECK:STDOUT: !llvm.dbg.cu = !{!2} -// CHECK:STDOUT: -// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !3 = !DIFile(filename: "create.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "CreateDerived", linkageName: "_CCreateDerived.Create", scope: null, file: !3, line: 6, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) -// CHECK:STDOUT: !6 = !{} -// CHECK:STDOUT: !7 = !DILocation(line: 7, column: 10, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 7, column: 19, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 7, column: 3, scope: !4) -// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "CreateAdapter", linkageName: "_CCreateAdapter.Create", scope: null, file: !3, line: 10, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !11 = !DILocation(line: 11, column: 10, scope: !10) -// CHECK:STDOUT: !12 = !DILocation(line: 11, column: 3, scope: !10) -// CHECK:STDOUT: ; ModuleID = 'create_generic.carbon' -// CHECK:STDOUT: source_filename = "create_generic.carbon" -// CHECK:STDOUT: -// CHECK:STDOUT: @tuple.loc22_28.6 = internal constant { i32, i32 } { i32 1, i32 2 } -// CHECK:STDOUT: -// CHECK:STDOUT: define void @_CInts.Main(ptr sret({ i32, i32 }) %return) !dbg !4 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CMake.Main.de631560529e9861(ptr %return, i32 1, i32 2), !dbg !7 -// CHECK:STDOUT: ret void, !dbg !8 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define void @_CEmpty.Main(ptr sret({ {}, {} }) %return) !dbg !9 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CMake.Main.cf13cead63317d44(ptr %return), !dbg !10 -// CHECK:STDOUT: ret void, !dbg !11 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define void @_CTuples.Main(ptr sret({ { i32, i32 }, { i32, i32 } }) %return) !dbg !12 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CMake.Main.54ec9394d5df5464(ptr %return, ptr @tuple.loc22_28.6, ptr @tuple.loc22_28.6), !dbg !13 -// CHECK:STDOUT: ret void, !dbg !14 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CMake.Main.de631560529e9861(ptr sret({ i32, i32 }) %return, i32 %x, i32 %y) !dbg !15 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc10_25.2.x = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !16 -// CHECK:STDOUT: store i32 %x, ptr %.loc10_25.2.x, align 4, !dbg !16 -// CHECK:STDOUT: %.loc10_25.4.y = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !16 -// CHECK:STDOUT: store i32 %y, ptr %.loc10_25.4.y, align 4, !dbg !16 -// CHECK:STDOUT: ret void, !dbg !17 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CMake.Main.cf13cead63317d44(ptr sret({ {}, {} }) %return) !dbg !18 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc10_25.2.x = getelementptr inbounds nuw { {}, {} }, ptr %return, i32 0, i32 0, !dbg !19 -// CHECK:STDOUT: %.loc10_25.4.y = getelementptr inbounds nuw { {}, {} }, ptr %return, i32 0, i32 1, !dbg !19 -// CHECK:STDOUT: ret void, !dbg !20 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CMake.Main.54ec9394d5df5464(ptr sret({ { i32, i32 }, { i32, i32 } }) %return, ptr %x, ptr %y) !dbg !21 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc10_25.2.x = getelementptr inbounds nuw { { i32, i32 }, { i32, i32 } }, ptr %return, i32 0, i32 0, !dbg !22 -// CHECK:STDOUT: call void @"_COp.0f13b78cd2788a9b:Copy.Core.58c6957df82926a9"(ptr %.loc10_25.2.x, ptr %x), !dbg !23 -// CHECK:STDOUT: %.loc10_25.4.y = getelementptr inbounds nuw { { i32, i32 }, { i32, i32 } }, ptr %return, i32 0, i32 1, !dbg !22 -// CHECK:STDOUT: call void @"_COp.0f13b78cd2788a9b:Copy.Core.58c6957df82926a9"(ptr %.loc10_25.4.y, ptr %y), !dbg !24 -// CHECK:STDOUT: ret void, !dbg !25 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @"_COp.0f13b78cd2788a9b:Copy.Core.58c6957df82926a9"(ptr sret({ i32, i32 }) %return, ptr %self) !dbg !26 { -// CHECK:STDOUT: %tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !28 -// CHECK:STDOUT: %tuple.elem.load = load i32, ptr %tuple.elem, align 4, !dbg !28 -// CHECK:STDOUT: %tuple.elem1 = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !29 -// CHECK:STDOUT: %tuple.elem2 = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !30 -// CHECK:STDOUT: %tuple.elem.load3 = load i32, ptr %tuple.elem2, align 4, !dbg !30 -// CHECK:STDOUT: %tuple.elem4 = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !29 -// CHECK:STDOUT: store i32 %tuple.elem.load, ptr %tuple.elem1, align 4, !dbg !29 -// CHECK:STDOUT: store i32 %tuple.elem.load3, ptr %tuple.elem4, align 4, !dbg !29 -// CHECK:STDOUT: ret void, !dbg !31 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.0f13b78cd2788a9b:Copy.Core.58c6957df82926a9", { 1, 0 } -// CHECK:STDOUT: -// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} -// CHECK:STDOUT: !llvm.dbg.cu = !{!2} -// CHECK:STDOUT: -// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !3 = !DIFile(filename: "create_generic.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Ints", linkageName: "_CInts.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) -// CHECK:STDOUT: !6 = !{} -// CHECK:STDOUT: !7 = !DILocation(line: 14, column: 10, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 14, column: 3, scope: !4) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Empty", linkageName: "_CEmpty.Main", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !10 = !DILocation(line: 18, column: 10, scope: !9) -// CHECK:STDOUT: !11 = !DILocation(line: 18, column: 3, scope: !9) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Tuples", linkageName: "_CTuples.Main", scope: null, file: !3, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !13 = !DILocation(line: 23, column: 10, scope: !12) -// CHECK:STDOUT: !14 = !DILocation(line: 23, column: 3, scope: !12) -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main.de631560529e9861", scope: null, file: !3, line: 9, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !16 = !DILocation(line: 10, column: 10, scope: !15) -// CHECK:STDOUT: !17 = !DILocation(line: 10, column: 3, scope: !15) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main.cf13cead63317d44", scope: null, file: !3, line: 9, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !19 = !DILocation(line: 10, column: 10, scope: !18) -// CHECK:STDOUT: !20 = !DILocation(line: 10, column: 3, scope: !18) -// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main.54ec9394d5df5464", scope: null, file: !3, line: 9, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !22 = !DILocation(line: 10, column: 10, scope: !21) -// CHECK:STDOUT: !23 = !DILocation(line: 10, column: 16, scope: !21) -// CHECK:STDOUT: !24 = !DILocation(line: 10, column: 24, scope: !21) -// CHECK:STDOUT: !25 = !DILocation(line: 10, column: 3, scope: !21) -// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0f13b78cd2788a9b:Copy.Core.58c6957df82926a9", scope: null, file: !27, line: 48, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !27 = !DIFile(filename: "min_prelude/parts/copy.carbon", directory: "") -// CHECK:STDOUT: !28 = !DILocation(line: 49, column: 13, scope: !26) -// CHECK:STDOUT: !29 = !DILocation(line: 49, column: 12, scope: !26) -// CHECK:STDOUT: !30 = !DILocation(line: 49, column: 26, scope: !26) -// CHECK:STDOUT: !31 = !DILocation(line: 49, column: 5, scope: !26) -// CHECK:STDOUT: ; ModuleID = 'access.carbon' -// CHECK:STDOUT: source_filename = "access.carbon" -// CHECK:STDOUT: -// CHECK:STDOUT: @C.val.bc7.loc16_3.1 = internal constant { i1, i32 } { i1 true, i32 0 } -// CHECK:STDOUT: @C.val.f52.loc26_3.1 = internal constant { i1, {} } { i1 true, {} zeroinitializer } -// CHECK:STDOUT: @C.val.f32.loc31_3.1 = internal constant { i1, { i32, i32, i32 } } { i1 true, { i32, i32, i32 } { i32 1, i32 2, i32 3 } } -// CHECK:STDOUT: -// CHECK:STDOUT: define i1 @_CAccessBool.Main() !dbg !4 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca { i1, i32 }, align 8, !dbg !7 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !7 -// CHECK:STDOUT: %.loc16_37.2.v = getelementptr inbounds nuw { i1, i32 }, ptr %c.var, i32 0, i32 0, !dbg !8 -// CHECK:STDOUT: %.loc16_37.5.w = getelementptr inbounds nuw { i1, i32 }, ptr %c.var, i32 0, i32 1, !dbg !8 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @C.val.bc7.loc16_3.1, i64 8, i1 false), !dbg !7 -// CHECK:STDOUT: %C.GetBool.call = call i1 @_CGetBool.C.Main.de631560529e9861(ptr %c.var), !dbg !9 -// CHECK:STDOUT: ret i1 %C.GetBool.call, !dbg !10 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define i32 @_CAccessInt.Main() !dbg !11 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca { i1, i32 }, align 8, !dbg !12 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !12 -// CHECK:STDOUT: %.loc21_37.2.v = getelementptr inbounds nuw { i1, i32 }, ptr %c.var, i32 0, i32 0, !dbg !13 -// CHECK:STDOUT: %.loc21_37.5.w = getelementptr inbounds nuw { i1, i32 }, ptr %c.var, i32 0, i32 1, !dbg !13 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @C.val.bc7.loc16_3.1, i64 8, i1 false), !dbg !12 -// CHECK:STDOUT: %C.GetT.call = call i32 @_CGetT.C.Main.de631560529e9861(ptr %c.var), !dbg !14 -// CHECK:STDOUT: ret i32 %C.GetT.call, !dbg !15 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define void @_CAccessEmpty.Main() !dbg !16 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca { i1, {} }, align 8, !dbg !17 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !17 -// CHECK:STDOUT: %.loc26_37.2.v = getelementptr inbounds nuw { i1, {} }, ptr %c.var, i32 0, i32 0, !dbg !18 -// CHECK:STDOUT: %.loc26_37.4.w = getelementptr inbounds nuw { i1, {} }, ptr %c.var, i32 0, i32 1, !dbg !18 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @C.val.f52.loc26_3.1, i64 1, i1 false), !dbg !17 -// CHECK:STDOUT: call void @_CGetT.C.Main.cf13cead63317d44(ptr %c.var), !dbg !19 -// CHECK:STDOUT: ret void, !dbg !20 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define void @_CAccessTuple.Main(ptr sret({ i32, i32, i32 }) %return) !dbg !21 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca { i1, { i32, i32, i32 } }, align 8, !dbg !22 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !22 -// CHECK:STDOUT: %.loc31_57.2.v = getelementptr inbounds nuw { i1, { i32, i32, i32 } }, ptr %c.var, i32 0, i32 0, !dbg !23 -// CHECK:STDOUT: %.loc31_57.4.w = getelementptr inbounds nuw { i1, { i32, i32, i32 } }, ptr %c.var, i32 0, i32 1, !dbg !23 -// CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc31_57.4.w, i32 0, i32 0, !dbg !24 -// CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc31_57.4.w, i32 0, i32 1, !dbg !24 -// CHECK:STDOUT: %tuple.elem2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc31_57.4.w, i32 0, i32 2, !dbg !24 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @C.val.f32.loc31_3.1, i64 16, i1 false), !dbg !22 -// CHECK:STDOUT: call void @_CGetT.C.Main.7a4734f1d45ccfe4(ptr %return, ptr %c.var), !dbg !25 -// CHECK:STDOUT: ret void, !dbg !26 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #0 -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 -// CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr i1 @_CGetBool.C.Main.de631560529e9861(ptr %self) !dbg !27 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc6_16.1.v = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 0, !dbg !28 -// CHECK:STDOUT: %.loc6_16.2 = load i8, ptr %.loc6_16.1.v, align 1, !dbg !28 -// CHECK:STDOUT: %.loc6_16.21 = trunc i8 %.loc6_16.2 to i1, !dbg !28 -// CHECK:STDOUT: ret i1 %.loc6_16.21, !dbg !29 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr i32 @_CGetT.C.Main.de631560529e9861(ptr %self) !dbg !30 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_16.1.w = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 1, !dbg !31 -// CHECK:STDOUT: %.loc9_16.2 = load i32, ptr %.loc9_16.1.w, align 4, !dbg !31 -// CHECK:STDOUT: ret i32 %.loc9_16.2, !dbg !32 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CGetT.C.Main.cf13cead63317d44(ptr %self) !dbg !33 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_16.1.w = getelementptr inbounds nuw { i1, {} }, ptr %self, i32 0, i32 1, !dbg !34 -// CHECK:STDOUT: ret void, !dbg !35 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CGetT.C.Main.7a4734f1d45ccfe4(ptr sret({ i32, i32, i32 }) %return, ptr %self) !dbg !36 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_16.1.w = getelementptr inbounds nuw { i1, { i32, i32, i32 } }, ptr %self, i32 0, i32 1, !dbg !37 -// CHECK:STDOUT: call void @"_COp.95e85d56bfcba7ff:Copy.Core.03f4bad6da36de16"(ptr %return, ptr %.loc9_16.1.w), !dbg !37 -// CHECK:STDOUT: ret void, !dbg !38 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @"_COp.95e85d56bfcba7ff:Copy.Core.03f4bad6da36de16"(ptr sret({ i32, i32, i32 }) %return, ptr %self) !dbg !39 { -// CHECK:STDOUT: %tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %self, i32 0, i32 0, !dbg !41 -// CHECK:STDOUT: %tuple.elem.load = load i32, ptr %tuple.elem, align 4, !dbg !41 -// CHECK:STDOUT: %tuple.elem1 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 0, !dbg !42 -// CHECK:STDOUT: %tuple.elem2 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %self, i32 0, i32 1, !dbg !43 -// CHECK:STDOUT: %tuple.elem.load3 = load i32, ptr %tuple.elem2, align 4, !dbg !43 -// CHECK:STDOUT: %tuple.elem4 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 1, !dbg !42 -// CHECK:STDOUT: %tuple.elem5 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %self, i32 0, i32 2, !dbg !44 -// CHECK:STDOUT: %tuple.elem.load6 = load i32, ptr %tuple.elem5, align 4, !dbg !44 -// CHECK:STDOUT: %tuple.elem7 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 2, !dbg !42 -// CHECK:STDOUT: store i32 %tuple.elem.load, ptr %tuple.elem1, align 4, !dbg !42 -// CHECK:STDOUT: store i32 %tuple.elem.load3, ptr %tuple.elem4, align 4, !dbg !42 -// CHECK:STDOUT: store i32 %tuple.elem.load6, ptr %tuple.elem7, align 4, !dbg !42 -// CHECK:STDOUT: ret void, !dbg !45 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 3, 2, 1, 0 } -// CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 3, 2, 1, 0 } -// CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -// CHECK:STDOUT: attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } -// CHECK:STDOUT: -// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} -// CHECK:STDOUT: !llvm.dbg.cu = !{!2} -// CHECK:STDOUT: -// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !3 = !DIFile(filename: "access.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "AccessBool", linkageName: "_CAccessBool.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) -// CHECK:STDOUT: !6 = !{} -// CHECK:STDOUT: !7 = !DILocation(line: 16, column: 3, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 16, column: 19, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 17, column: 10, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 17, column: 3, scope: !4) -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "AccessInt", linkageName: "_CAccessInt.Main", scope: null, file: !3, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !12 = !DILocation(line: 21, column: 3, scope: !11) -// CHECK:STDOUT: !13 = !DILocation(line: 21, column: 19, scope: !11) -// CHECK:STDOUT: !14 = !DILocation(line: 22, column: 10, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 22, column: 3, scope: !11) -// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "AccessEmpty", linkageName: "_CAccessEmpty.Main", scope: null, file: !3, line: 25, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !17 = !DILocation(line: 26, column: 3, scope: !16) -// CHECK:STDOUT: !18 = !DILocation(line: 26, column: 18, scope: !16) -// CHECK:STDOUT: !19 = !DILocation(line: 27, column: 10, scope: !16) -// CHECK:STDOUT: !20 = !DILocation(line: 27, column: 3, scope: !16) -// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "AccessTuple", linkageName: "_CAccessTuple.Main", scope: null, file: !3, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !22 = !DILocation(line: 31, column: 3, scope: !21) -// CHECK:STDOUT: !23 = !DILocation(line: 31, column: 31, scope: !21) -// CHECK:STDOUT: !24 = !DILocation(line: 31, column: 48, scope: !21) -// CHECK:STDOUT: !25 = !DILocation(line: 32, column: 10, scope: !21) -// CHECK:STDOUT: !26 = !DILocation(line: 32, column: 3, scope: !21) -// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "GetBool", linkageName: "_CGetBool.C.Main.de631560529e9861", scope: null, file: !3, line: 5, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !28 = !DILocation(line: 6, column: 12, scope: !27) -// CHECK:STDOUT: !29 = !DILocation(line: 6, column: 5, scope: !27) -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "GetT", linkageName: "_CGetT.C.Main.de631560529e9861", scope: null, file: !3, line: 8, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !31 = !DILocation(line: 9, column: 12, scope: !30) -// CHECK:STDOUT: !32 = !DILocation(line: 9, column: 5, scope: !30) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "GetT", linkageName: "_CGetT.C.Main.cf13cead63317d44", scope: null, file: !3, line: 8, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !34 = !DILocation(line: 9, column: 12, scope: !33) -// CHECK:STDOUT: !35 = !DILocation(line: 9, column: 5, scope: !33) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "GetT", linkageName: "_CGetT.C.Main.7a4734f1d45ccfe4", scope: null, file: !3, line: 8, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !37 = !DILocation(line: 9, column: 12, scope: !36) -// CHECK:STDOUT: !38 = !DILocation(line: 9, column: 5, scope: !36) -// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "Op", linkageName: "_COp.95e85d56bfcba7ff:Copy.Core.03f4bad6da36de16", scope: null, file: !40, line: 54, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !40 = !DIFile(filename: "min_prelude/parts/copy.carbon", directory: "") -// CHECK:STDOUT: !41 = !DILocation(line: 55, column: 13, scope: !39) -// CHECK:STDOUT: !42 = !DILocation(line: 55, column: 12, scope: !39) -// CHECK:STDOUT: !43 = !DILocation(line: 55, column: 26, scope: !39) -// CHECK:STDOUT: !44 = !DILocation(line: 55, column: 39, scope: !39) -// CHECK:STDOUT: !45 = !DILocation(line: 55, column: 5, scope: !39) diff --git a/toolchain/lower/testdata/for/bindings.carbon b/toolchain/lower/testdata/for/bindings.carbon index 2cf5d42549a83..f45e80630f6d4 100644 --- a/toolchain/lower/testdata/for/bindings.carbon +++ b/toolchain/lower/testdata/for/bindings.carbon @@ -11,11 +11,29 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/for/bindings.carbon class EmptyRange(T:! Core.Copy) { + // CHECK:STDERR: bindings.carbon:[[@LINE+4]]:66: error: cannot convert type `T` that implements `Core.Copy` into type implementing `Core.Copy & Core.Destroy` [ConversionFailureFacetToFacet] + // CHECK:STDERR: impl as Core.Iterate where .CursorType = {} and .ElementType = T { + // CHECK:STDERR: ^ + // CHECK:STDERR: impl as Core.Iterate where .CursorType = {} and .ElementType = T { fn NewCursor[self: Self]() -> {} { return {}; } + // CHECK:STDERR: bindings.carbon:[[@LINE+7]]:41: error: cannot convert type `T` that implements `Core.Copy` into type implementing `Core.Copy & Core.Destroy` [ConversionFailureFacetToFacet] + // CHECK:STDERR: fn Next[self: Self](cursor: {}*) -> Core.Optional(T) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~ + // CHECK:STDERR: {{.*}}/prelude/types/optional.carbon:20:16: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: class Optional(T:! Copy & Destroy) { + // CHECK:STDERR: ^ + // CHECK:STDERR: fn Next[self: Self](cursor: {}*) -> Core.Optional(T) { + // CHECK:STDERR: bindings.carbon:[[@LINE+7]]:14: error: cannot convert type `T` that implements `Core.Copy` into type implementing `Core.Copy & Core.Destroy` [ConversionFailureFacetToFacet] + // CHECK:STDERR: return Core.Optional(T).None(); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~ + // CHECK:STDERR: {{.*}}/prelude/types/optional.carbon:20:16: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: class Optional(T:! Copy & Destroy) { + // CHECK:STDERR: ^ + // CHECK:STDERR: return Core.Optional(T).None(); } } @@ -26,141 +44,16 @@ fn F(m: i32, n: i32*); fn For() { var r: EmptyRange((i32, i32)) = {}; + // CHECK:STDERR: bindings.carbon:[[@LINE+8]]:7: error: cannot access member of interface `Core.Iterate` in type `EmptyRange((i32, i32) as Core.Copy)` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: for ((m: i32, var n: i32) in r) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + // CHECK:STDERR: bindings.carbon:[[@LINE+4]]:7: error: cannot access member of interface `Core.Iterate` in type `EmptyRange((i32, i32) as Core.Copy)` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: for ((m: i32, var n: i32) in r) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: for ((m: i32, var n: i32) in r) { F(m, &n); } } -// CHECK:STDOUT: ; ModuleID = 'bindings.carbon' -// CHECK:STDOUT: source_filename = "bindings.carbon" -// CHECK:STDOUT: -// CHECK:STDOUT: @EmptyRange.val.loc27_3.1 = internal constant {} zeroinitializer -// CHECK:STDOUT: -// CHECK:STDOUT: declare void @_CF.Main(i32, ptr) -// CHECK:STDOUT: -// CHECK:STDOUT: define void @_CFor.Main() !dbg !4 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %r.var = alloca {}, align 8, !dbg !7 -// CHECK:STDOUT: %var = alloca {}, align 8, !dbg !8 -// CHECK:STDOUT: %.loc29_33.1.temp = alloca { i1, { i32, i32 } }, align 8, !dbg !8 -// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !9 -// CHECK:STDOUT: %.loc29_33.8.temp = alloca { i32, i32 }, align 8, !dbg !8 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %r.var), !dbg !7 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %r.var, ptr align 1 @EmptyRange.val.loc27_3.1, i64 0, i1 false), !dbg !7 -// CHECK:STDOUT: call void @"_CNewCursor.EmptyRange.Main:Iterate.Core.54ec9394d5df5464"(ptr %r.var), !dbg !8 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var), !dbg !8 -// CHECK:STDOUT: br label %for.next, !dbg !8 -// CHECK:STDOUT: -// CHECK:STDOUT: for.next: ; preds = %for.body, %entry -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_33.1.temp), !dbg !8 -// CHECK:STDOUT: call void @"_CNext.EmptyRange.Main:Iterate.Core.54ec9394d5df5464"(ptr %.loc29_33.1.temp, ptr %r.var, ptr %var), !dbg !8 -// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.54ec9394d5df5464(ptr %.loc29_33.1.temp), !dbg !8 -// CHECK:STDOUT: br i1 %Optional.HasValue.call, label %for.body, label %for.done, !dbg !8 -// CHECK:STDOUT: -// CHECK:STDOUT: for.body: ; preds = %for.next -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !9 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_33.8.temp), !dbg !8 -// CHECK:STDOUT: call void @_CGet.Optional.Core.54ec9394d5df5464(ptr %.loc29_33.8.temp, ptr %.loc29_33.1.temp), !dbg !8 -// CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc29_33.8.temp, i32 0, i32 0, !dbg !8 -// CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc29_33.8.temp, i32 0, i32 1, !dbg !8 -// CHECK:STDOUT: %.loc29_33.11 = load i32, ptr %tuple.elem0.tuple.elem, align 4, !dbg !8 -// CHECK:STDOUT: %.loc29_33.12 = load i32, ptr %tuple.elem1.tuple.elem, align 4, !dbg !8 -// CHECK:STDOUT: store i32 %.loc29_33.12, ptr %n.var, align 4, !dbg !9 -// CHECK:STDOUT: call void @_CF.Main(i32 %.loc29_33.11, ptr %n.var), !dbg !10 -// CHECK:STDOUT: br label %for.next, !dbg !11 -// CHECK:STDOUT: -// CHECK:STDOUT: for.done: ; preds = %for.next -// CHECK:STDOUT: ret void, !dbg !12 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #0 -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 -// CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @"_CNewCursor.EmptyRange.Main:Iterate.Core.54ec9394d5df5464"(ptr %self) !dbg !13 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !14 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @"_CNext.EmptyRange.Main:Iterate.Core.54ec9394d5df5464"(ptr sret({ i1, { i32, i32 } }) %return, ptr %self, ptr %cursor) !dbg !15 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CNone.Optional.Core.54ec9394d5df5464(ptr %return), !dbg !16 -// CHECK:STDOUT: ret void, !dbg !17 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.54ec9394d5df5464(ptr %self) !dbg !18 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i1, { i32, i32 } }, ptr %self, i32 0, i32 0, !dbg !20 -// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !20 -// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !20 -// CHECK:STDOUT: ret i1 %2, !dbg !21 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CGet.Optional.Core.54ec9394d5df5464(ptr sret({ i32, i32 }) %return, ptr %self) !dbg !22 { -// CHECK:STDOUT: %value = getelementptr inbounds nuw { i1, { i32, i32 } }, ptr %self, i32 0, i32 1, !dbg !23 -// CHECK:STDOUT: call void @"_COp.0f13b78cd2788a9b:Copy.Core.58c6957df82926a9"(ptr %return, ptr %value), !dbg !23 -// CHECK:STDOUT: ret void, !dbg !24 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.54ec9394d5df5464(ptr sret({ i1, { i32, i32 } }) %return) !dbg !25 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i1, { i32, i32 } }, ptr %return, i32 0, i32 0, !dbg !26 -// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !26 -// CHECK:STDOUT: ret void, !dbg !27 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr void @"_COp.0f13b78cd2788a9b:Copy.Core.58c6957df82926a9"(ptr sret({ i32, i32 }) %return, ptr %self) !dbg !28 { -// CHECK:STDOUT: %tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !30 -// CHECK:STDOUT: %tuple.elem.load = load i32, ptr %tuple.elem, align 4, !dbg !30 -// CHECK:STDOUT: %tuple.elem1 = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !31 -// CHECK:STDOUT: %tuple.elem2 = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !32 -// CHECK:STDOUT: %tuple.elem.load3 = load i32, ptr %tuple.elem2, align 4, !dbg !32 -// CHECK:STDOUT: %tuple.elem4 = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !31 -// CHECK:STDOUT: store i32 %tuple.elem.load, ptr %tuple.elem1, align 4, !dbg !31 -// CHECK:STDOUT: store i32 %tuple.elem.load3, ptr %tuple.elem4, align 4, !dbg !31 -// CHECK:STDOUT: ret void, !dbg !33 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 4, 3, 2, 1, 0 } -// CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -// CHECK:STDOUT: attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } -// CHECK:STDOUT: -// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} -// CHECK:STDOUT: !llvm.dbg.cu = !{!2} -// CHECK:STDOUT: -// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !3 = !DIFile(filename: "bindings.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "For", linkageName: "_CFor.Main", scope: null, file: !3, line: 26, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) -// CHECK:STDOUT: !6 = !{} -// CHECK:STDOUT: !7 = !DILocation(line: 27, column: 3, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 29, column: 7, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 29, column: 17, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 30, column: 5, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 29, column: 3, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 26, column: 1, scope: !4) -// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.EmptyRange.Main:Iterate.Core.54ec9394d5df5464", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !14 = !DILocation(line: 16, column: 7, scope: !13) -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.EmptyRange.Main:Iterate.Core.54ec9394d5df5464", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !16 = !DILocation(line: 19, column: 14, scope: !15) -// CHECK:STDOUT: !17 = !DILocation(line: 19, column: 7, scope: !15) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.54ec9394d5df5464", scope: null, file: !19, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !19 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !20 = !DILocation(line: 30, column: 46, scope: !18) -// CHECK:STDOUT: !21 = !DILocation(line: 30, column: 39, scope: !18) -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.54ec9394d5df5464", scope: null, file: !19, line: 31, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !23 = !DILocation(line: 31, column: 38, scope: !22) -// CHECK:STDOUT: !24 = !DILocation(line: 31, column: 31, scope: !22) -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.54ec9394d5df5464", scope: null, file: !19, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !26 = !DILocation(line: 22, column: 5, scope: !25) -// CHECK:STDOUT: !27 = !DILocation(line: 23, column: 5, scope: !25) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0f13b78cd2788a9b:Copy.Core.58c6957df82926a9", scope: null, file: !29, line: 58, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !29 = !DIFile(filename: "{{.*}}/prelude/copy.carbon", directory: "") -// CHECK:STDOUT: !30 = !DILocation(line: 59, column: 13, scope: !28) -// CHECK:STDOUT: !31 = !DILocation(line: 59, column: 12, scope: !28) -// CHECK:STDOUT: !32 = !DILocation(line: 59, column: 26, scope: !28) -// CHECK:STDOUT: !33 = !DILocation(line: 59, column: 5, scope: !28) diff --git a/toolchain/testing/testdata/min_prelude/parts/iterate.carbon b/toolchain/testing/testdata/min_prelude/parts/iterate.carbon index 0aae03be0c5d1..47eaa48fd2a34 100644 --- a/toolchain/testing/testdata/min_prelude/parts/iterate.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/iterate.carbon @@ -2,18 +2,22 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/as.carbon // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/copy.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/destroy.carbon // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/optional.carbon // --- min_prelude/parts/iterate.carbon package Core library "prelude/parts/iterate"; +import library "prelude/parts/as"; import library "prelude/parts/copy"; +import library "prelude/parts/destroy"; import library "prelude/parts/optional"; interface Iterate { - let ElementType:! Copy; + let ElementType:! Copy & Destroy; let CursorType:! type; fn NewCursor[self: Self]() -> CursorType; fn Next[self: Self](cursor: CursorType*) -> Optional(ElementType); diff --git a/toolchain/testing/testdata/min_prelude/parts/maybe_unformed.carbon b/toolchain/testing/testdata/min_prelude/parts/maybe_unformed.carbon index 86973d9bac336..26e1f63ca0723 100644 --- a/toolchain/testing/testdata/min_prelude/parts/maybe_unformed.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/maybe_unformed.carbon @@ -12,6 +12,7 @@ export import library "prelude/parts/destroy"; private fn Make(t: type) -> type = "maybe_unformed.make_type"; -class MaybeUnformed(T:! type) { +// TODO: There should probably be support for non-destructible types. +class MaybeUnformed(T:! Destroy) { adapt Make(T); } diff --git a/toolchain/testing/testdata/min_prelude/parts/optional.carbon b/toolchain/testing/testdata/min_prelude/parts/optional.carbon index 5339171ca53f7..02f0553fbae92 100644 --- a/toolchain/testing/testdata/min_prelude/parts/optional.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/optional.carbon @@ -2,6 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/as.carbon // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/bool.carbon // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/copy.carbon // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/parts/destroy.carbon @@ -10,11 +11,12 @@ package Core library "prelude/parts/optional"; +import library "prelude/parts/as"; import library "prelude/parts/bool"; import library "prelude/parts/copy"; import library "prelude/parts/destroy"; -class Optional(T:! Copy) { +class Optional(T:! Copy & Destroy) { fn None() -> Self { returned var me: Self; me.has_value = false;