diff --git a/toolchain/check/handle_impl.cpp b/toolchain/check/handle_impl.cpp index fba77b6316fc2..3f031f71c554a 100644 --- a/toolchain/check/handle_impl.cpp +++ b/toolchain/check/handle_impl.cpp @@ -281,6 +281,7 @@ static auto BuildImplDecl(Context& context, Parse::AnyImplDeclId node_id) // impl unusable for impl lookup. impl.witness_id = SemIR::ErrorInst::InstId; } else { + context.inst_block_stack().Push(); // This makes either a placeholder witness table or a full witness // table. The full witness table is deferred to the impl definition // unless the declaration uses rewrite constraints to set values of @@ -293,6 +294,7 @@ static auto BuildImplDecl(Context& context, Parse::AnyImplDeclId node_id) impl.witness_id = AddImplWitnessForDeclaration( context, node_id, impl, context.generics().GetSelfSpecific(impl.generic_id)); + impl.witness_block_id = context.inst_block_stack().Pop(); } FinishGenericDecl(context, node_id, impl.generic_id); diff --git a/toolchain/check/testdata/as/basics.carbon b/toolchain/check/testdata/as/basics.carbon index 908c5eec2e64a..6ad0fa598a3af 100644 --- a/toolchain/check/testdata/as/basics.carbon +++ b/toolchain/check/testdata/as/basics.carbon @@ -381,7 +381,7 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: %struct.948: %struct_type.x = struct_value (%empty_tuple) [concrete] // CHECK:STDOUT: %X.val: %X = struct_value (%empty_tuple) [concrete] // CHECK:STDOUT: %As.type.cd7: type = facet_type <@As, @As(%Y)> [concrete] -// CHECK:STDOUT: %As.impl_witness.362: = impl_witness file.%As.impl_witness_table.loc14 [concrete] +// CHECK:STDOUT: %As.impl_witness.362: = impl_witness @X.as.As.impl.%As.impl_witness_table [concrete] // CHECK:STDOUT: %As.Convert.type.5a7: type = fn_type @As.Convert, @As(%Y) [concrete] // CHECK:STDOUT: %X.as.As.impl.Convert.type: type = fn_type @X.as.As.impl.Convert [concrete] // CHECK:STDOUT: %X.as.As.impl.Convert: %X.as.As.impl.Convert.type = struct_value () [concrete] diff --git a/toolchain/check/testdata/as/var_init.carbon b/toolchain/check/testdata/as/var_init.carbon index ddaa571ae1530..b6ce4e03ec483 100644 --- a/toolchain/check/testdata/as/var_init.carbon +++ b/toolchain/check/testdata/as/var_init.carbon @@ -34,7 +34,7 @@ fn Convert(t: ()) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.37a: type = facet_type <@ImplicitAs, @ImplicitAs(%X)> [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness @X.%ImplicitAs.impl_witness_table [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness @empty_tuple.type.as.ImplicitAs.impl.%ImplicitAs.impl_witness_table [concrete] // CHECK:STDOUT: %ImplicitAs.Convert.type.9f8: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%X) [concrete] // CHECK:STDOUT: %pattern_type.05f: type = pattern_type %X [concrete] // CHECK:STDOUT: %empty_tuple.type.as.ImplicitAs.impl.Convert.type: type = fn_type @empty_tuple.type.as.ImplicitAs.impl.Convert [concrete] diff --git a/toolchain/check/testdata/basics/include_in_dumps.carbon b/toolchain/check/testdata/basics/include_in_dumps.carbon index cb928b86efe9b..7fb8b9538e54d 100644 --- a/toolchain/check/testdata/basics/include_in_dumps.carbon +++ b/toolchain/check/testdata/basics/include_in_dumps.carbon @@ -124,7 +124,7 @@ fn F(c: C) { c.(I.Op)(); } // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%I.Op.decl [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete] // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/builtins/type/destroy.carbon b/toolchain/check/testdata/builtins/type/destroy.carbon index 99a01f0912dad..14a2ed86c8923 100644 --- a/toolchain/check/testdata/builtins/type/destroy.carbon +++ b/toolchain/check/testdata/builtins/type/destroy.carbon @@ -41,7 +41,7 @@ fn F() { // CHECK:STDOUT: %assoc0: %DestroyLike.assoc_type = assoc_entity element0, @DestroyLike.%DestroyLike.Op.decl [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %DestroyLike.impl_witness.52f: = impl_witness file.%DestroyLike.impl_witness_table, @T.as.DestroyLike.impl(%empty_tuple.type) [concrete] +// CHECK:STDOUT: %DestroyLike.impl_witness.52f: = impl_witness @T.as.DestroyLike.impl.%DestroyLike.impl_witness_table, @T.as.DestroyLike.impl(%empty_tuple.type) [concrete] // CHECK:STDOUT: %T.as.DestroyLike.impl.Op.type.6ca: type = fn_type @T.as.DestroyLike.impl.Op, @T.as.DestroyLike.impl(%empty_tuple.type) [concrete] // CHECK:STDOUT: %T.as.DestroyLike.impl.Op.3ae: %T.as.DestroyLike.impl.Op.type.6ca = struct_value () [concrete] // CHECK:STDOUT: %DestroyLike.facet.430: %DestroyLike.type = facet_value %empty_tuple.type, (%DestroyLike.impl_witness.52f) [concrete] @@ -49,7 +49,7 @@ fn F() { // CHECK:STDOUT: %T.as.DestroyLike.impl.Op.bound.f9f: = bound_method file.%a.var, %T.as.DestroyLike.impl.Op.3ae [concrete] // CHECK:STDOUT: %T.as.DestroyLike.impl.Op.specific_fn.38d: = specific_function %T.as.DestroyLike.impl.Op.3ae, @T.as.DestroyLike.impl.Op(%empty_tuple.type) [concrete] // CHECK:STDOUT: %bound_method.717: = bound_method file.%a.var, %T.as.DestroyLike.impl.Op.specific_fn.38d [concrete] -// CHECK:STDOUT: %DestroyLike.impl_witness.409: = impl_witness file.%DestroyLike.impl_witness_table, @T.as.DestroyLike.impl(%empty_struct_type) [concrete] +// CHECK:STDOUT: %DestroyLike.impl_witness.409: = impl_witness @T.as.DestroyLike.impl.%DestroyLike.impl_witness_table, @T.as.DestroyLike.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %T.as.DestroyLike.impl.Op.type.1f5: type = fn_type @T.as.DestroyLike.impl.Op, @T.as.DestroyLike.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %T.as.DestroyLike.impl.Op.f28: %T.as.DestroyLike.impl.Op.type.1f5 = struct_value () [concrete] // CHECK:STDOUT: %DestroyLike.facet.736: %DestroyLike.type = facet_value %empty_struct_type, (%DestroyLike.impl_witness.409) [concrete] diff --git a/toolchain/check/testdata/class/generic/member_type.carbon b/toolchain/check/testdata/class/generic/member_type.carbon index d0b6dd22e0f72..2addf173307ec 100644 --- a/toolchain/check/testdata/class/generic/member_type.carbon +++ b/toolchain/check/testdata/class/generic/member_type.carbon @@ -430,7 +430,7 @@ fn Test() -> i32 { // CHECK:STDOUT: %Inner.assoc_type.be2: type = assoc_entity_type @Inner, @Inner(%T) [symbolic] // CHECK:STDOUT: %assoc0.0a9: %Inner.assoc_type.be2 = assoc_entity element0, @Inner.%Inner.F.decl [symbolic] // CHECK:STDOUT: %C.131: type = class_type @C, @C(%T) [symbolic] -// CHECK:STDOUT: %Inner.impl_witness.154: = impl_witness @C.%Inner.impl_witness_table, @C.as.Inner.impl(%T) [symbolic] +// CHECK:STDOUT: %Inner.impl_witness.154: = impl_witness @C.as.Inner.impl.%Inner.impl_witness_table, @C.as.Inner.impl(%T) [symbolic] // CHECK:STDOUT: %require_complete.0f7: = require_complete_type %Inner.type.e0e [symbolic] // CHECK:STDOUT: %pattern_type.fe7: type = pattern_type %C.131 [symbolic] // CHECK:STDOUT: %C.as.Inner.impl.F.type.9a2: type = fn_type @C.as.Inner.impl.F, @C.as.Inner.impl(%T) [symbolic] @@ -454,7 +454,7 @@ fn Test() -> i32 { // CHECK:STDOUT: %Outer.d71: type = class_type @Outer, @Outer(%i32) [concrete] // CHECK:STDOUT: %Inner.type.b33: type = facet_type <@Inner, @Inner(%i32)> [concrete] // CHECK:STDOUT: %C.d3f: type = class_type @C, @C(%i32) [concrete] -// CHECK:STDOUT: %Inner.impl_witness.744: = impl_witness @D.%Inner.impl_witness_table [concrete] +// CHECK:STDOUT: %Inner.impl_witness.744: = impl_witness @D.as.Inner.impl.%Inner.impl_witness_table [concrete] // CHECK:STDOUT: %Self.d74: %Inner.type.b33 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %Inner.F.type.c8b: type = fn_type @Inner.F, @Inner(%i32) [concrete] // CHECK:STDOUT: %Inner.F.1cd: %Inner.F.type.c8b = struct_value () [concrete] @@ -472,7 +472,7 @@ fn Test() -> i32 { // CHECK:STDOUT: %pattern_type.129: type = pattern_type %C.d3f [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %C.val: %C.d3f = struct_value () [concrete] -// CHECK:STDOUT: %Inner.impl_witness.2d0: = impl_witness @C.%Inner.impl_witness_table, @C.as.Inner.impl(%i32) [concrete] +// CHECK:STDOUT: %Inner.impl_witness.2d0: = impl_witness @C.as.Inner.impl.%Inner.impl_witness_table, @C.as.Inner.impl(%i32) [concrete] // CHECK:STDOUT: %complete_type.75e: = complete_type_witness %Inner.type.b33 [concrete] // CHECK:STDOUT: %C.as.Inner.impl.F.type.457: type = fn_type @C.as.Inner.impl.F, @C.as.Inner.impl(%i32) [concrete] // CHECK:STDOUT: %C.as.Inner.impl.F.cc7: %C.as.Inner.impl.F.type.457 = struct_value () [concrete] @@ -571,7 +571,7 @@ fn Test() -> i32 { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.131)] // CHECK:STDOUT: %Inner.type: type = facet_type <@Inner, @Inner(%T)> [symbolic = %Inner.type (constants.%Inner.type.e0e)] -// CHECK:STDOUT: %Inner.impl_witness: = impl_witness @C.%Inner.impl_witness_table, @C.as.Inner.impl(%T) [symbolic = %Inner.impl_witness (constants.%Inner.impl_witness.154)] +// CHECK:STDOUT: %Inner.impl_witness.loc10_19.2: = impl_witness %Inner.impl_witness_table, @C.as.Inner.impl(%T) [symbolic = %Inner.impl_witness.loc10_19.2 (constants.%Inner.impl_witness.154)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %Inner.type [symbolic = %require_complete (constants.%require_complete.0f7)] @@ -595,13 +595,15 @@ fn Test() -> i32 { // CHECK:STDOUT: %return.param: ref @C.as.Inner.impl.F.%T (%T) = out_param call_param1 // CHECK:STDOUT: %return: ref @C.as.Inner.impl.F.%T (%T) = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Inner.impl_witness_table = impl_witness_table (%C.as.Inner.impl.F.decl), @C.as.Inner.impl [concrete] +// CHECK:STDOUT: %Inner.impl_witness.loc10_19.1: = impl_witness %Inner.impl_witness_table, @C.as.Inner.impl(constants.%T) [symbolic = %Inner.impl_witness.loc10_19.2 (constants.%Inner.impl_witness.154)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = // CHECK:STDOUT: .T = // CHECK:STDOUT: .F = %C.as.Inner.impl.F.decl // CHECK:STDOUT: .Inner = -// CHECK:STDOUT: witness = @C.%Inner.impl_witness +// CHECK:STDOUT: witness = %Inner.impl_witness.loc10_19.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -620,11 +622,13 @@ fn Test() -> i32 { // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Inner.impl_witness_table = impl_witness_table (%D.as.Inner.impl.F.decl), @D.as.Inner.impl [concrete] +// CHECK:STDOUT: %Inner.impl_witness: = impl_witness %Inner.impl_witness_table [concrete = constants.%Inner.impl_witness.744] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .D = // CHECK:STDOUT: .F = %D.as.Inner.impl.F.decl -// CHECK:STDOUT: witness = @D.%Inner.impl_witness +// CHECK:STDOUT: witness = %Inner.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Outer(%T.loc4_13.2: type) { @@ -657,8 +661,6 @@ fn Test() -> i32 { // CHECK:STDOUT: %.loc10: type = specific_constant @Outer.%Inner.decl, @Outer(constants.%T) [symbolic = %Inner.type (constants.%Inner.type.e0e)] // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %.loc10 [symbolic = %Inner.type (constants.%Inner.type.e0e)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Inner.impl_witness_table = impl_witness_table (@C.as.Inner.impl.%C.as.Inner.impl.F.decl), @C.as.Inner.impl [concrete] -// CHECK:STDOUT: %Inner.impl_witness: = impl_witness %Inner.impl_witness_table, @C.as.Inner.impl(constants.%T) [symbolic = @C.as.Inner.impl.%Inner.impl_witness (constants.%Inner.impl_witness.154)] // 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: @@ -680,8 +682,6 @@ fn Test() -> i32 { // CHECK:STDOUT: %.loc17: type = specific_constant @Outer.%Inner.decl, @Outer(constants.%i32) [concrete = constants.%Inner.type.b33] // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %.loc17 [concrete = constants.%Inner.type.b33] // CHECK:STDOUT: } -// CHECK:STDOUT: %Inner.impl_witness_table = impl_witness_table (@D.as.Inner.impl.%D.as.Inner.impl.F.decl), @D.as.Inner.impl [concrete] -// CHECK:STDOUT: %Inner.impl_witness: = impl_witness %Inner.impl_witness_table [concrete = constants.%Inner.impl_witness.744] // 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: @@ -820,7 +820,7 @@ fn Test() -> i32 { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %C => constants.%C.131 // CHECK:STDOUT: %Inner.type => constants.%Inner.type.e0e -// CHECK:STDOUT: %Inner.impl_witness => constants.%Inner.impl_witness.154 +// CHECK:STDOUT: %Inner.impl_witness.loc10_19.2 => constants.%Inner.impl_witness.154 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete.0f7 @@ -889,7 +889,7 @@ fn Test() -> i32 { // CHECK:STDOUT: %T => constants.%i32 // CHECK:STDOUT: %C => constants.%C.d3f // CHECK:STDOUT: %Inner.type => constants.%Inner.type.b33 -// CHECK:STDOUT: %Inner.impl_witness => constants.%Inner.impl_witness.2d0 +// CHECK:STDOUT: %Inner.impl_witness.loc10_19.2 => constants.%Inner.impl_witness.2d0 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.75e diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index 9d1dd6054fe2a..7b3fc0c81d6e5 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -2003,7 +2003,7 @@ class T2(G2:! type) { // 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.865: type = facet_type <@ImplicitAs, @ImplicitAs(%T1)> [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness file.%ImplicitAs.impl_witness_table [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness @T2.as.ImplicitAs.impl.%ImplicitAs.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.b8b: type = pattern_type %T2 [concrete] // CHECK:STDOUT: %pattern_type.818: type = pattern_type %T1 [concrete] // CHECK:STDOUT: %T2.as.ImplicitAs.impl.Convert.type: type = fn_type @T2.as.ImplicitAs.impl.Convert [concrete] @@ -2055,8 +2055,6 @@ class T2(G2:! type) { // CHECK:STDOUT: %T1.ref: type = name_ref T1, file.%T1.decl [concrete = constants.%T1] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%T1)> [concrete = constants.%ImplicitAs.type.865] // CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (@T2.as.ImplicitAs.impl.%T2.as.ImplicitAs.impl.Convert.decl), @T2.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness] // CHECK:STDOUT: %Base.decl: type = class_decl @Base [concrete = constants.%Base] {} {} // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [concrete = constants.%Derived] {} {} // CHECK:STDOUT: } @@ -2075,11 +2073,13 @@ class T2(G2:! type) { // CHECK:STDOUT: %return.param: ref %T1 = out_param call_param1 // CHECK:STDOUT: %return: ref %T1 = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%T2.as.ImplicitAs.impl.Convert.decl), @T2.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .T1 = // CHECK:STDOUT: .Convert = %T2.as.ImplicitAs.impl.Convert.decl -// CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness +// CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @T1 { diff --git a/toolchain/check/testdata/facet/call_combined_impl_witness.carbon b/toolchain/check/testdata/facet/call_combined_impl_witness.carbon index b54bcc49f6c91..230df6a8c56c4 100644 --- a/toolchain/check/testdata/facet/call_combined_impl_witness.carbon +++ b/toolchain/check/testdata/facet/call_combined_impl_witness.carbon @@ -66,12 +66,12 @@ fn F() { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %Empty.impl_witness: = impl_witness file.%Empty.impl_witness_table [concrete] -// CHECK:STDOUT: %A.impl_witness: = impl_witness file.%A.impl_witness_table [concrete] +// CHECK:STDOUT: %Empty.impl_witness: = impl_witness @C.as.Empty.impl.%Empty.impl_witness_table [concrete] +// CHECK:STDOUT: %A.impl_witness: = impl_witness @C.as.A.impl.%A.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.A.impl.AA.type: type = fn_type @C.as.A.impl.AA [concrete] // CHECK:STDOUT: %C.as.A.impl.AA: %C.as.A.impl.AA.type = struct_value () [concrete] // CHECK:STDOUT: %A.facet.409: %A.type = facet_value %C, (%A.impl_witness) [concrete] -// CHECK:STDOUT: %B.impl_witness: = impl_witness file.%B.impl_witness_table [concrete] +// CHECK:STDOUT: %B.impl_witness: = impl_witness @C.as.B.impl.%B.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.B.impl.BB.type: type = fn_type @C.as.B.impl.BB [concrete] // CHECK:STDOUT: %C.as.B.impl.BB: %C.as.B.impl.BB.type = struct_value () [concrete] // CHECK:STDOUT: %B.facet.150: %B.type = facet_value %C, (%B.impl_witness) [concrete] @@ -156,20 +156,14 @@ fn F() { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [concrete = constants.%Empty.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Empty.impl_witness_table = impl_witness_table (), @C.as.Empty.impl [concrete] -// CHECK:STDOUT: %Empty.impl_witness: = impl_witness %Empty.impl_witness_table [concrete = constants.%Empty.impl_witness] // CHECK:STDOUT: impl_decl @C.as.A.impl [concrete] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (@C.as.A.impl.%C.as.A.impl.AA.decl), @C.as.A.impl [concrete] -// CHECK:STDOUT: %A.impl_witness: = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness] // CHECK:STDOUT: impl_decl @C.as.B.impl [concrete] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %B.impl_witness_table = impl_witness_table (@C.as.B.impl.%C.as.B.impl.BB.decl), @C.as.B.impl [concrete] -// CHECK:STDOUT: %B.impl_witness: = impl_witness %B.impl_witness_table [concrete = constants.%B.impl_witness] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %T.patt: %pattern_type.f32 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %t.patt: @G.%pattern_type (%pattern_type.402) = value_binding_pattern t [concrete] @@ -244,24 +238,31 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.Empty.impl: %C.ref as %Empty.ref { +// CHECK:STDOUT: %Empty.impl_witness_table = impl_witness_table (), @C.as.Empty.impl [concrete] +// CHECK:STDOUT: %Empty.impl_witness: = impl_witness %Empty.impl_witness_table [concrete = constants.%Empty.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Empty.impl_witness +// CHECK:STDOUT: witness = %Empty.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.A.impl: %C.ref as %A.ref { // CHECK:STDOUT: %C.as.A.impl.AA.decl: %C.as.A.impl.AA.type = fn_decl @C.as.A.impl.AA [concrete = constants.%C.as.A.impl.AA] {} {} +// CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (%C.as.A.impl.AA.decl), @C.as.A.impl [concrete] +// CHECK:STDOUT: %A.impl_witness: = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .AA = %C.as.A.impl.AA.decl -// CHECK:STDOUT: witness = file.%A.impl_witness +// CHECK:STDOUT: witness = %A.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.B.impl: %C.ref as %B.ref { // CHECK:STDOUT: %C.as.B.impl.BB.decl: %C.as.B.impl.BB.type = fn_decl @C.as.B.impl.BB [concrete = constants.%C.as.B.impl.BB] {} {} +// CHECK:STDOUT: %B.impl_witness_table = impl_witness_table (%C.as.B.impl.BB.decl), @C.as.B.impl [concrete] +// CHECK:STDOUT: %B.impl_witness: = impl_witness %B.impl_witness_table [concrete = constants.%B.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .BB = %C.as.B.impl.BB.decl -// CHECK:STDOUT: witness = file.%B.impl_witness +// CHECK:STDOUT: witness = %B.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/facet/convert_class_type_to_facet_type.carbon b/toolchain/check/testdata/facet/convert_class_type_to_facet_type.carbon index f004752fc447a..90a7781107094 100644 --- a/toolchain/check/testdata/facet/convert_class_type_to_facet_type.carbon +++ b/toolchain/check/testdata/facet/convert_class_type_to_facet_type.carbon @@ -31,7 +31,7 @@ fn F() { // CHECK:STDOUT: %Goat: type = class_type @Goat [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %Animal.impl_witness: = impl_witness file.%Animal.impl_witness_table [concrete] +// CHECK:STDOUT: %Animal.impl_witness: = impl_witness @Goat.as.Animal.impl.%Animal.impl_witness_table [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %A: %Animal.type = symbolic_binding A, 0 [symbolic] @@ -67,8 +67,6 @@ fn F() { // CHECK:STDOUT: %Goat.ref: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat] // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Animal.impl_witness_table = impl_witness_table (), @Goat.as.Animal.impl [concrete] -// CHECK:STDOUT: %Animal.impl_witness: = impl_witness %Animal.impl_witness_table [concrete = constants.%Animal.impl_witness] // CHECK:STDOUT: %WalkAnimal.decl: %WalkAnimal.type = fn_decl @WalkAnimal [concrete = constants.%WalkAnimal] { // CHECK:STDOUT: %A.patt: %pattern_type = symbolic_binding_pattern A, 0 [concrete] // CHECK:STDOUT: } { @@ -92,8 +90,11 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @Goat.as.Animal.impl: %Goat.ref as %Animal.ref { +// CHECK:STDOUT: %Animal.impl_witness_table = impl_witness_table (), @Goat.as.Animal.impl [concrete] +// CHECK:STDOUT: %Animal.impl_witness: = impl_witness %Animal.impl_witness_table [concrete = constants.%Animal.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Animal.impl_witness +// CHECK:STDOUT: witness = %Animal.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Goat { diff --git a/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon b/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon index f76c51e0c0bb0..0af4bc36fe73e 100644 --- a/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon +++ b/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon @@ -83,7 +83,7 @@ fn G() { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %ImplsGeneric: type = class_type @ImplsGeneric [concrete] // CHECK:STDOUT: %Generic.type.407: type = facet_type <@Generic, @Generic(%GenericParam)> [concrete] -// CHECK:STDOUT: %Generic.impl_witness: = impl_witness file.%Generic.impl_witness_table [concrete] +// CHECK:STDOUT: %Generic.impl_witness: = impl_witness @ImplsGeneric.as.Generic.impl.%Generic.impl_witness_table [concrete] // CHECK:STDOUT: %Self.de4: %Generic.type.407 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %Generic.F.type.0a1: type = fn_type @Generic.F, @Generic(%GenericParam) [concrete] // CHECK:STDOUT: %Generic.F.edf: %Generic.F.type.0a1 = struct_value () [concrete] @@ -148,8 +148,6 @@ fn G() { // CHECK:STDOUT: %GenericParam.ref: type = name_ref GenericParam, file.%GenericParam.decl [concrete = constants.%GenericParam] // CHECK:STDOUT: %Generic.type: type = facet_type <@Generic, @Generic(constants.%GenericParam)> [concrete = constants.%Generic.type.407] // CHECK:STDOUT: } -// CHECK:STDOUT: %Generic.impl_witness_table = impl_witness_table (@ImplsGeneric.as.Generic.impl.%ImplsGeneric.as.Generic.impl.F.decl), @ImplsGeneric.as.Generic.impl [concrete] -// CHECK:STDOUT: %Generic.impl_witness: = impl_witness %Generic.impl_witness_table [concrete = constants.%Generic.impl_witness] // CHECK:STDOUT: %CallGenericMethod.decl: %CallGenericMethod.type = fn_decl @CallGenericMethod [concrete = constants.%CallGenericMethod] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %U.patt: @CallGenericMethod.%pattern_type (%pattern_type.740) = symbolic_binding_pattern U, 1 [concrete] @@ -209,10 +207,12 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: impl @ImplsGeneric.as.Generic.impl: %ImplsGeneric.ref as %Generic.type { // CHECK:STDOUT: %ImplsGeneric.as.Generic.impl.F.decl: %ImplsGeneric.as.Generic.impl.F.type = fn_decl @ImplsGeneric.as.Generic.impl.F [concrete = constants.%ImplsGeneric.as.Generic.impl.F] {} {} +// CHECK:STDOUT: %Generic.impl_witness_table = impl_witness_table (%ImplsGeneric.as.Generic.impl.F.decl), @ImplsGeneric.as.Generic.impl [concrete] +// CHECK:STDOUT: %Generic.impl_witness: = impl_witness %Generic.impl_witness_table [concrete = constants.%Generic.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %ImplsGeneric.as.Generic.impl.F.decl -// CHECK:STDOUT: witness = file.%Generic.impl_witness +// CHECK:STDOUT: witness = %Generic.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @GenericParam { @@ -386,7 +386,7 @@ fn G() { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %ImplsGeneric: type = class_type @ImplsGeneric [concrete] // CHECK:STDOUT: %Generic.type.407: type = facet_type <@Generic, @Generic(%GenericParam)> [concrete] -// CHECK:STDOUT: %Generic.impl_witness: = impl_witness file.%Generic.impl_witness_table [concrete] +// CHECK:STDOUT: %Generic.impl_witness: = impl_witness @ImplsGeneric.as.Generic.impl.%Generic.impl_witness_table [concrete] // CHECK:STDOUT: %Self.de4: %Generic.type.407 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %Generic.F.type.0a1: type = fn_type @Generic.F, @Generic(%GenericParam) [concrete] // CHECK:STDOUT: %Generic.F.edf: %Generic.F.type.0a1 = struct_value () [concrete] @@ -451,8 +451,6 @@ fn G() { // CHECK:STDOUT: %GenericParam.ref: type = name_ref GenericParam, file.%GenericParam.decl [concrete = constants.%GenericParam] // CHECK:STDOUT: %Generic.type: type = facet_type <@Generic, @Generic(constants.%GenericParam)> [concrete = constants.%Generic.type.407] // CHECK:STDOUT: } -// CHECK:STDOUT: %Generic.impl_witness_table = impl_witness_table (@ImplsGeneric.as.Generic.impl.%ImplsGeneric.as.Generic.impl.F.decl), @ImplsGeneric.as.Generic.impl [concrete] -// CHECK:STDOUT: %Generic.impl_witness: = impl_witness %Generic.impl_witness_table [concrete = constants.%Generic.impl_witness] // CHECK:STDOUT: %CallGenericMethod.decl: %CallGenericMethod.type = fn_decl @CallGenericMethod [concrete = constants.%CallGenericMethod] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %U.patt: @CallGenericMethod.%pattern_type.loc15_32 (%pattern_type.740) = symbolic_binding_pattern U, 1 [concrete] @@ -502,10 +500,12 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: impl @ImplsGeneric.as.Generic.impl: %ImplsGeneric.ref as %Generic.type { // CHECK:STDOUT: %ImplsGeneric.as.Generic.impl.F.decl: %ImplsGeneric.as.Generic.impl.F.type = fn_decl @ImplsGeneric.as.Generic.impl.F [concrete = constants.%ImplsGeneric.as.Generic.impl.F] {} {} +// CHECK:STDOUT: %Generic.impl_witness_table = impl_witness_table (%ImplsGeneric.as.Generic.impl.F.decl), @ImplsGeneric.as.Generic.impl [concrete] +// CHECK:STDOUT: %Generic.impl_witness: = impl_witness %Generic.impl_witness_table [concrete = constants.%Generic.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %ImplsGeneric.as.Generic.impl.F.decl -// CHECK:STDOUT: witness = file.%Generic.impl_witness +// CHECK:STDOUT: witness = %Generic.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @GenericParam { diff --git a/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon b/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon index 7de0053d41f8f..1bf046d8eea3d 100644 --- a/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon +++ b/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon @@ -41,7 +41,7 @@ fn F() { // CHECK:STDOUT: %Goat: type = class_type @Goat [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %Animal.impl_witness: = impl_witness file.%Animal.impl_witness_table [concrete] +// CHECK:STDOUT: %Animal.impl_witness: = impl_witness @Goat.as.Animal.impl.%Animal.impl_witness_table [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] @@ -99,8 +99,6 @@ fn F() { // CHECK:STDOUT: %Goat.ref: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat] // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Animal.impl_witness_table = impl_witness_table (), @Goat.as.Animal.impl [concrete] -// CHECK:STDOUT: %Animal.impl_witness: = impl_witness %Animal.impl_witness_table [concrete = constants.%Animal.impl_witness] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -115,8 +113,11 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @Goat.as.Animal.impl: %Goat.ref as %Animal.ref { +// CHECK:STDOUT: %Animal.impl_witness_table = impl_witness_table (), @Goat.as.Animal.impl [concrete] +// CHECK:STDOUT: %Animal.impl_witness: = impl_witness %Animal.impl_witness_table [concrete = constants.%Animal.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Animal.impl_witness +// CHECK:STDOUT: witness = %Animal.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Goat { diff --git a/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon b/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon index 419aeb4ba45ff..f24998234973f 100644 --- a/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon +++ b/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon @@ -115,7 +115,7 @@ fn B() { // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %ImplsGeneric: type = class_type @ImplsGeneric [concrete] // CHECK:STDOUT: %Generic.type.407: type = facet_type <@Generic, @Generic(%GenericParam)> [concrete] -// CHECK:STDOUT: %Generic.impl_witness: = impl_witness file.%Generic.impl_witness_table [concrete] +// CHECK:STDOUT: %Generic.impl_witness: = impl_witness @ImplsGeneric.as.Generic.impl.%Generic.impl_witness_table [concrete] // CHECK:STDOUT: %Self.de4: %Generic.type.407 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %Generic.F.type.0a1: type = fn_type @Generic.F, @Generic(%GenericParam) [concrete] // CHECK:STDOUT: %Generic.F.edf: %Generic.F.type.0a1 = struct_value () [concrete] @@ -201,8 +201,6 @@ fn B() { // CHECK:STDOUT: %GenericParam.ref: type = name_ref GenericParam, file.%GenericParam.decl [concrete = constants.%GenericParam] // CHECK:STDOUT: %Generic.type: type = facet_type <@Generic, @Generic(constants.%GenericParam)> [concrete = constants.%Generic.type.407] // CHECK:STDOUT: } -// CHECK:STDOUT: %Generic.impl_witness_table = impl_witness_table (@ImplsGeneric.as.Generic.impl.%ImplsGeneric.as.Generic.impl.F.decl), @ImplsGeneric.as.Generic.impl [concrete] -// CHECK:STDOUT: %Generic.impl_witness: = impl_witness %Generic.impl_witness_table [concrete = constants.%Generic.impl_witness] // CHECK:STDOUT: %CallGenericMethod.decl: %CallGenericMethod.type = fn_decl @CallGenericMethod [concrete = constants.%CallGenericMethod] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %U.patt: @CallGenericMethod.%pattern_type.loc15_32 (%pattern_type.740) = symbolic_binding_pattern U, 1 [concrete] @@ -261,10 +259,12 @@ fn B() { // CHECK:STDOUT: // CHECK:STDOUT: impl @ImplsGeneric.as.Generic.impl: %ImplsGeneric.ref as %Generic.type { // CHECK:STDOUT: %ImplsGeneric.as.Generic.impl.F.decl: %ImplsGeneric.as.Generic.impl.F.type = fn_decl @ImplsGeneric.as.Generic.impl.F [concrete = constants.%ImplsGeneric.as.Generic.impl.F] {} {} +// CHECK:STDOUT: %Generic.impl_witness_table = impl_witness_table (%ImplsGeneric.as.Generic.impl.F.decl), @ImplsGeneric.as.Generic.impl [concrete] +// CHECK:STDOUT: %Generic.impl_witness: = impl_witness %Generic.impl_witness_table [concrete = constants.%Generic.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %ImplsGeneric.as.Generic.impl.F.decl -// CHECK:STDOUT: witness = file.%Generic.impl_witness +// CHECK:STDOUT: witness = %Generic.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @GenericParam { @@ -444,7 +444,7 @@ fn B() { // CHECK:STDOUT: %T.67d: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %I.type.76c: type = facet_type <@I, @I(%T.67d, %empty_tuple.type)> [symbolic] -// CHECK:STDOUT: %I.impl_witness.559: = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%T.67d) [symbolic] +// CHECK:STDOUT: %I.impl_witness.559: = impl_witness @C.as.I.impl.%I.impl_witness_table, @C.as.I.impl(%T.67d) [symbolic] // CHECK:STDOUT: %Self.a31: %I.type.76c = symbolic_binding Self, 2 [symbolic] // CHECK:STDOUT: %require_complete.0f4: = require_complete_type %I.type.76c [symbolic] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] @@ -460,7 +460,7 @@ fn B() { // CHECK:STDOUT: %B.type: type = fn_type @B [concrete] // CHECK:STDOUT: %B: %B.type = struct_value () [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] -// CHECK:STDOUT: %I.impl_witness.add: = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%empty_struct_type) [concrete] +// CHECK:STDOUT: %I.impl_witness.add: = impl_witness @C.as.I.impl.%I.impl_witness_table, @C.as.I.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %complete_type.532: = complete_type_witness %I.type.05e [concrete] // CHECK:STDOUT: %I.facet: %I.type.05e = facet_value %C, (%I.impl_witness.add) [concrete] // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete] @@ -513,8 +513,6 @@ fn B() { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc7_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc7_14.2 (constants.%T.67d)] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%T.67d) [symbolic = @C.as.I.impl.%I.impl_witness (constants.%I.impl_witness.559)] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [concrete = constants.%A] { // CHECK:STDOUT: %T.patt: %pattern_type.418 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %t.patt: @A.%pattern_type (%pattern_type.7eb) = value_binding_pattern t [concrete] @@ -563,14 +561,17 @@ fn B() { // CHECK:STDOUT: generic impl @C.as.I.impl(%T.loc7_14.1: type) { // CHECK:STDOUT: %T.loc7_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc7_14.2 (constants.%T.67d)] // CHECK:STDOUT: %I.type.loc7_36.2: type = facet_type <@I, @I(%T.loc7_14.2, constants.%empty_tuple.type)> [symbolic = %I.type.loc7_36.2 (constants.%I.type.76c)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%T.loc7_14.2) [symbolic = %I.impl_witness (constants.%I.impl_witness.559)] +// CHECK:STDOUT: %I.impl_witness.loc7_38.2: = impl_witness %I.impl_witness_table, @C.as.I.impl(%T.loc7_14.2) [symbolic = %I.impl_witness.loc7_38.2 (constants.%I.impl_witness.559)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %I.type.loc7_36.2 [symbolic = %require_complete (constants.%require_complete.0f4)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref as %I.type.loc7_36.1 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness.loc7_38.1: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%T.67d) [symbolic = %I.impl_witness.loc7_38.2 (constants.%I.impl_witness.559)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness.loc7_38.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -636,7 +637,7 @@ fn B() { // CHECK:STDOUT: specific @C.as.I.impl(constants.%T.67d) { // CHECK:STDOUT: %T.loc7_14.2 => constants.%T.67d // CHECK:STDOUT: %I.type.loc7_36.2 => constants.%I.type.76c -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness.559 +// CHECK:STDOUT: %I.impl_witness.loc7_38.2 => constants.%I.impl_witness.559 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%empty_struct_type, constants.%empty_tuple.type) { @@ -657,7 +658,7 @@ fn B() { // CHECK:STDOUT: specific @C.as.I.impl(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc7_14.2 => constants.%empty_struct_type // CHECK:STDOUT: %I.type.loc7_36.2 => constants.%I.type.05e -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness.add +// CHECK:STDOUT: %I.impl_witness.loc7_38.2 => constants.%I.impl_witness.add // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.532 @@ -691,7 +692,7 @@ fn B() { // CHECK:STDOUT: %T.67d: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %I.type.76c: type = facet_type <@I, @I(%T.67d, %empty_tuple.type)> [symbolic] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%T.67d) [symbolic] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table, @C.as.I.impl(%T.67d) [symbolic] // CHECK:STDOUT: %Self.a31: %I.type.76c = symbolic_binding Self, 2 [symbolic] // CHECK:STDOUT: %require_complete.0f4: = require_complete_type %I.type.76c [symbolic] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] @@ -755,8 +756,6 @@ fn B() { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc7_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc7_14.2 (constants.%T.67d)] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%T.67d) [symbolic = @C.as.I.impl.%I.impl_witness (constants.%I.impl_witness)] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [concrete = constants.%A] { // CHECK:STDOUT: %T.patt: %pattern_type.0e5 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %t.patt: @A.%pattern_type (%pattern_type.d65) = value_binding_pattern t [concrete] @@ -805,14 +804,17 @@ fn B() { // CHECK:STDOUT: generic impl @C.as.I.impl(%T.loc7_14.1: type) { // CHECK:STDOUT: %T.loc7_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc7_14.2 (constants.%T.67d)] // CHECK:STDOUT: %I.type.loc7_36.2: type = facet_type <@I, @I(%T.loc7_14.2, constants.%empty_tuple.type)> [symbolic = %I.type.loc7_36.2 (constants.%I.type.76c)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%T.loc7_14.2) [symbolic = %I.impl_witness (constants.%I.impl_witness)] +// CHECK:STDOUT: %I.impl_witness.loc7_38.2: = impl_witness %I.impl_witness_table, @C.as.I.impl(%T.loc7_14.2) [symbolic = %I.impl_witness.loc7_38.2 (constants.%I.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %I.type.loc7_36.2 [symbolic = %require_complete (constants.%require_complete.0f4)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref as %I.type.loc7_36.1 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness.loc7_38.1: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%T.67d) [symbolic = %I.impl_witness.loc7_38.2 (constants.%I.impl_witness)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness.loc7_38.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -871,7 +873,7 @@ fn B() { // CHECK:STDOUT: specific @C.as.I.impl(constants.%T.67d) { // CHECK:STDOUT: %T.loc7_14.2 => constants.%T.67d // CHECK:STDOUT: %I.type.loc7_36.2 => constants.%I.type.76c -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness +// CHECK:STDOUT: %I.impl_witness.loc7_38.2 => constants.%I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%empty_struct_type, constants.%empty_struct_type) { @@ -908,7 +910,7 @@ fn B() { // CHECK:STDOUT: %T.67d: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %C.13c: type = class_type @C, @C(%T.67d, %empty_tuple.type) [symbolic] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%T.67d) [symbolic] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table, @C.as.I.impl(%T.67d) [symbolic] // CHECK:STDOUT: %T.50f: %I.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.a15: type = pattern_type %I.type [concrete] // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.50f [symbolic] @@ -969,8 +971,6 @@ fn B() { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc7_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc7_14.2 (constants.%T.67d)] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%T.67d) [symbolic = @C.as.I.impl.%I.impl_witness (constants.%I.impl_witness)] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [concrete = constants.%A] { // CHECK:STDOUT: %T.patt: %pattern_type.a15 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %t.patt: @A.%pattern_type (%pattern_type.55e) = value_binding_pattern t [concrete] @@ -1005,13 +1005,16 @@ fn B() { // CHECK:STDOUT: generic impl @C.as.I.impl(%T.loc7_14.1: type) { // CHECK:STDOUT: %T.loc7_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc7_14.2 (constants.%T.67d)] // CHECK:STDOUT: %C.loc7_31.2: type = class_type @C, @C(%T.loc7_14.2, constants.%empty_tuple.type) [symbolic = %C.loc7_31.2 (constants.%C.13c)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%T.loc7_14.2) [symbolic = %I.impl_witness (constants.%I.impl_witness)] +// CHECK:STDOUT: %I.impl_witness.loc7_38.2: = impl_witness %I.impl_witness_table, @C.as.I.impl(%T.loc7_14.2) [symbolic = %I.impl_witness.loc7_38.2 (constants.%I.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.loc7_31.1 as %I.ref { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness.loc7_38.1: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%T.67d) [symbolic = %I.impl_witness.loc7_38.2 (constants.%I.impl_witness)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness.loc7_38.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1078,7 +1081,7 @@ fn B() { // CHECK:STDOUT: specific @C.as.I.impl(constants.%T.67d) { // CHECK:STDOUT: %T.loc7_14.2 => constants.%T.67d // CHECK:STDOUT: %C.loc7_31.2 => constants.%C.13c -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness +// CHECK:STDOUT: %I.impl_witness.loc7_38.2 => constants.%I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%T.50f) { diff --git a/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon b/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon index 7d8541ed0dc97..92b70fa8e3b44 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon @@ -97,8 +97,8 @@ fn F[A:! J, B:! A](x: C(A, B)) { // CHECK:STDOUT: %Eats.type: type = facet_type <@Eats> [concrete] // CHECK:STDOUT: %Animal.type: type = facet_type <@Animal> [concrete] // CHECK:STDOUT: %Goat: type = class_type @Goat [concrete] -// CHECK:STDOUT: %Animal.impl_witness: = impl_witness file.%Animal.impl_witness_table [concrete] -// CHECK:STDOUT: %Eats.impl_witness: = impl_witness file.%Eats.impl_witness_table [concrete] +// CHECK:STDOUT: %Animal.impl_witness: = impl_witness @Goat.as.Animal.impl.%Animal.impl_witness_table [concrete] +// CHECK:STDOUT: %Eats.impl_witness: = impl_witness @Goat.as.Eats.impl.%Eats.impl_witness_table [concrete] // CHECK:STDOUT: %Feed.type: type = fn_type @Feed [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Feed: %Feed.type = struct_value () [concrete] @@ -138,8 +138,8 @@ fn F[A:! J, B:! A](x: C(A, B)) { // CHECK:STDOUT: %Goat: type = class_type @Goat [concrete] // CHECK:STDOUT: %Goat.Bleet.type: type = fn_type @Goat.Bleet [concrete] // CHECK:STDOUT: %Goat.Bleet: %Goat.Bleet.type = struct_value () [concrete] -// CHECK:STDOUT: %Animal.impl_witness: = impl_witness @Goat.%Animal.impl_witness_table [concrete] -// CHECK:STDOUT: %Eats.impl_witness: = impl_witness @Goat.%Eats.impl_witness_table [concrete] +// CHECK:STDOUT: %Animal.impl_witness: = impl_witness @Goat.as.Animal.impl.%Animal.impl_witness_table [concrete] +// CHECK:STDOUT: %Eats.impl_witness: = impl_witness @Goat.as.Eats.impl.%Eats.impl_witness_table [concrete] // CHECK:STDOUT: %Goat.as.Eats.impl.Eat.type: type = fn_type @Goat.as.Eats.impl.Eat [concrete] // CHECK:STDOUT: %Goat.as.Eats.impl.Eat: %Goat.as.Eats.impl.Eat.type = struct_value () [concrete] // CHECK:STDOUT: %Eats.facet: %Eats.type = facet_value %Goat, (%Eats.impl_witness) [concrete] diff --git a/toolchain/check/testdata/facet/convert_facet_value_to_itself.carbon b/toolchain/check/testdata/facet/convert_facet_value_to_itself.carbon index 8a085ccb2536a..3da5bcef8c80a 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_to_itself.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_to_itself.carbon @@ -43,7 +43,7 @@ fn F() { // CHECK:STDOUT: %Goat: type = class_type @Goat [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %Animal.impl_witness: = impl_witness file.%Animal.impl_witness_table [concrete] +// CHECK:STDOUT: %Animal.impl_witness: = impl_witness @Goat.as.Animal.impl.%Animal.impl_witness_table [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %Animal.facet: %Animal.type = facet_value %Goat, (%Animal.impl_witness) [concrete] @@ -92,8 +92,6 @@ fn F() { // CHECK:STDOUT: %Goat.ref: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat] // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Animal.impl_witness_table = impl_witness_table (), @Goat.as.Animal.impl [concrete] -// CHECK:STDOUT: %Animal.impl_witness: = impl_witness %Animal.impl_witness_table [concrete = constants.%Animal.impl_witness] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -108,8 +106,11 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @Goat.as.Animal.impl: %Goat.ref as %Animal.ref { +// CHECK:STDOUT: %Animal.impl_witness_table = impl_witness_table (), @Goat.as.Animal.impl [concrete] +// CHECK:STDOUT: %Animal.impl_witness: = impl_witness %Animal.impl_witness_table [concrete = constants.%Animal.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Animal.impl_witness +// CHECK:STDOUT: witness = %Animal.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Goat { diff --git a/toolchain/check/testdata/facet/convert_facet_value_to_narrowed_facet_type.carbon b/toolchain/check/testdata/facet/convert_facet_value_to_narrowed_facet_type.carbon index 3fcecd135217d..3d093f1424b0b 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_to_narrowed_facet_type.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_to_narrowed_facet_type.carbon @@ -507,7 +507,7 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: %A: %Animal.type = symbolic_binding A, 0 [symbolic] // CHECK:STDOUT: %pattern_type.71b: type = pattern_type %Animal.type [concrete] // CHECK:STDOUT: %A.binding.as_type: type = symbolic_binding_type A, 0, %A [symbolic] -// CHECK:STDOUT: %Eats.impl_witness.bef: = impl_witness file.%Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(%A) [symbolic] +// CHECK:STDOUT: %Eats.impl_witness.bef: = impl_witness @A.binding.as_type.as.Eats.impl.%Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(%A) [symbolic] // 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] @@ -538,7 +538,7 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: %require_complete.7aa: = require_complete_type %W.binding.as_type [symbolic] // CHECK:STDOUT: %Animal.lookup_impl_witness: = lookup_impl_witness %W, @Animal [symbolic] // CHECK:STDOUT: %Animal.facet: %Animal.type = facet_value %W.binding.as_type, (%Animal.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %Eats.impl_witness.f70: = impl_witness file.%Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(%Animal.facet) [symbolic] +// CHECK:STDOUT: %Eats.impl_witness.f70: = impl_witness @A.binding.as_type.as.Eats.impl.%Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(%Animal.facet) [symbolic] // CHECK:STDOUT: %.dc8: require_specific_def_type = require_specific_def @A.binding.as_type.as.Eats.impl(%Animal.facet) [symbolic] // CHECK:STDOUT: %Eats.lookup_impl_witness: = lookup_impl_witness %W, @Eats [symbolic] // CHECK:STDOUT: %Tame.lookup_impl_witness: = lookup_impl_witness %W, @Tame [symbolic] @@ -583,8 +583,6 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %A.loc7_14.1: %Animal.type = symbolic_binding A, 0 [symbolic = %A.loc7_14.2 (constants.%A)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Eats.impl_witness_table = impl_witness_table (), @A.binding.as_type.as.Eats.impl [concrete] -// CHECK:STDOUT: %Eats.impl_witness: = impl_witness %Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(constants.%A) [symbolic = @A.binding.as_type.as.Eats.impl.%Eats.impl_witness (constants.%Eats.impl_witness.bef)] // CHECK:STDOUT: %FeedTame2.decl: %FeedTame2.type = fn_decl @FeedTame2 [concrete = constants.%FeedTame2] { // CHECK:STDOUT: %V.patt: %pattern_type.556 = symbolic_binding_pattern V, 0 [concrete] // CHECK:STDOUT: %v.patt: @FeedTame2.%pattern_type (%pattern_type.493) = value_binding_pattern v [concrete] @@ -668,13 +666,16 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: generic impl @A.binding.as_type.as.Eats.impl(%A.loc7_14.1: %Animal.type) { // CHECK:STDOUT: %A.loc7_14.2: %Animal.type = symbolic_binding A, 0 [symbolic = %A.loc7_14.2 (constants.%A)] // CHECK:STDOUT: %A.binding.as_type: type = symbolic_binding_type A, 0, %A.loc7_14.2 [symbolic = %A.binding.as_type (constants.%A.binding.as_type)] -// CHECK:STDOUT: %Eats.impl_witness: = impl_witness file.%Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(%A.loc7_14.2) [symbolic = %Eats.impl_witness (constants.%Eats.impl_witness.bef)] +// CHECK:STDOUT: %Eats.impl_witness.loc7_36.2: = impl_witness %Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(%A.loc7_14.2) [symbolic = %Eats.impl_witness.loc7_36.2 (constants.%Eats.impl_witness.bef)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc7_26 as %Eats.ref { +// CHECK:STDOUT: %Eats.impl_witness_table = impl_witness_table (), @A.binding.as_type.as.Eats.impl [concrete] +// CHECK:STDOUT: %Eats.impl_witness.loc7_36.1: = impl_witness %Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(constants.%A) [symbolic = %Eats.impl_witness.loc7_36.2 (constants.%Eats.impl_witness.bef)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Eats.impl_witness +// CHECK:STDOUT: witness = %Eats.impl_witness.loc7_36.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -724,7 +725,7 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: specific @A.binding.as_type.as.Eats.impl(constants.%A) { // CHECK:STDOUT: %A.loc7_14.2 => constants.%A // CHECK:STDOUT: %A.binding.as_type => constants.%A.binding.as_type -// CHECK:STDOUT: %Eats.impl_witness => constants.%Eats.impl_witness.bef +// CHECK:STDOUT: %Eats.impl_witness.loc7_36.2 => constants.%Eats.impl_witness.bef // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @FeedTame2(constants.%V) { @@ -742,7 +743,7 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: specific @A.binding.as_type.as.Eats.impl(constants.%Animal.facet) { // CHECK:STDOUT: %A.loc7_14.2 => constants.%Animal.facet // CHECK:STDOUT: %A.binding.as_type => constants.%W.binding.as_type -// CHECK:STDOUT: %Eats.impl_witness => constants.%Eats.impl_witness.f70 +// CHECK:STDOUT: %Eats.impl_witness.loc7_36.2 => constants.%Eats.impl_witness.f70 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/facet/convert_facet_value_value_to_blanket_impl.carbon b/toolchain/check/testdata/facet/convert_facet_value_value_to_blanket_impl.carbon index f2440b56b54a2..6571fae735e36 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_value_to_blanket_impl.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_value_to_blanket_impl.carbon @@ -33,7 +33,7 @@ fn HandleAnimal[T:! Animal](a: T) { Feed(a); } // CHECK:STDOUT: %A: %Animal.type = symbolic_binding A, 0 [symbolic] // CHECK:STDOUT: %pattern_type.71b: type = pattern_type %Animal.type [concrete] // CHECK:STDOUT: %A.binding.as_type: type = symbolic_binding_type A, 0, %A [symbolic] -// CHECK:STDOUT: %Eats.impl_witness.bef35e.1: = impl_witness file.%Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(%A) [symbolic] +// CHECK:STDOUT: %Eats.impl_witness.bef35e.1: = impl_witness @A.binding.as_type.as.Eats.impl.%Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(%A) [symbolic] // CHECK:STDOUT: %T.b61: %Eats.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.4c2: type = pattern_type %Eats.type [concrete] // CHECK:STDOUT: %T.binding.as_type.c82: type = symbolic_binding_type T, 0, %T.b61 [symbolic] @@ -48,7 +48,7 @@ fn HandleAnimal[T:! Animal](a: T) { Feed(a); } // CHECK:STDOUT: %HandleAnimal.type: type = fn_type @HandleAnimal [concrete] // CHECK:STDOUT: %HandleAnimal: %HandleAnimal.type = struct_value () [concrete] // CHECK:STDOUT: %require_complete.1b9: = require_complete_type %T.binding.as_type.d94 [symbolic] -// CHECK:STDOUT: %Eats.impl_witness.bef35e.2: = impl_witness file.%Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(%T.bfe) [symbolic] +// CHECK:STDOUT: %Eats.impl_witness.bef35e.2: = impl_witness @A.binding.as_type.as.Eats.impl.%Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(%T.bfe) [symbolic] // CHECK:STDOUT: %.e4c: require_specific_def_type = require_specific_def @A.binding.as_type.as.Eats.impl(%T.bfe) [symbolic] // CHECK:STDOUT: %Eats.lookup_impl_witness: = lookup_impl_witness %T.bfe, @Eats [symbolic] // CHECK:STDOUT: %Eats.facet: %Eats.type = facet_value %T.binding.as_type.d94, (%Eats.lookup_impl_witness) [symbolic] @@ -86,8 +86,6 @@ fn HandleAnimal[T:! Animal](a: T) { Feed(a); } // CHECK:STDOUT: } // CHECK:STDOUT: %A.loc18_14.1: %Animal.type = symbolic_binding A, 0 [symbolic = %A.loc18_14.2 (constants.%A)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Eats.impl_witness_table = impl_witness_table (), @A.binding.as_type.as.Eats.impl [concrete] -// CHECK:STDOUT: %Eats.impl_witness: = impl_witness %Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(constants.%A) [symbolic = @A.binding.as_type.as.Eats.impl.%Eats.impl_witness (constants.%Eats.impl_witness.bef35e.1)] // CHECK:STDOUT: %Feed.decl: %Feed.type = fn_decl @Feed [concrete = constants.%Feed] { // CHECK:STDOUT: %T.patt: %pattern_type.4c2 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %e.patt: @Feed.%pattern_type (%pattern_type.e61) = value_binding_pattern e [concrete] @@ -149,13 +147,16 @@ fn HandleAnimal[T:! Animal](a: T) { Feed(a); } // CHECK:STDOUT: generic impl @A.binding.as_type.as.Eats.impl(%A.loc18_14.1: %Animal.type) { // CHECK:STDOUT: %A.loc18_14.2: %Animal.type = symbolic_binding A, 0 [symbolic = %A.loc18_14.2 (constants.%A)] // CHECK:STDOUT: %A.binding.as_type: type = symbolic_binding_type A, 0, %A.loc18_14.2 [symbolic = %A.binding.as_type (constants.%A.binding.as_type)] -// CHECK:STDOUT: %Eats.impl_witness: = impl_witness file.%Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(%A.loc18_14.2) [symbolic = %Eats.impl_witness (constants.%Eats.impl_witness.bef35e.1)] +// CHECK:STDOUT: %Eats.impl_witness.loc18_36.2: = impl_witness %Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(%A.loc18_14.2) [symbolic = %Eats.impl_witness.loc18_36.2 (constants.%Eats.impl_witness.bef35e.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc18_26 as %Eats.ref { +// CHECK:STDOUT: %Eats.impl_witness_table = impl_witness_table (), @A.binding.as_type.as.Eats.impl [concrete] +// CHECK:STDOUT: %Eats.impl_witness.loc18_36.1: = impl_witness %Eats.impl_witness_table, @A.binding.as_type.as.Eats.impl(constants.%A) [symbolic = %Eats.impl_witness.loc18_36.2 (constants.%Eats.impl_witness.bef35e.1)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Eats.impl_witness +// CHECK:STDOUT: witness = %Eats.impl_witness.loc18_36.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -202,7 +203,7 @@ fn HandleAnimal[T:! Animal](a: T) { Feed(a); } // CHECK:STDOUT: specific @A.binding.as_type.as.Eats.impl(constants.%A) { // CHECK:STDOUT: %A.loc18_14.2 => constants.%A // CHECK:STDOUT: %A.binding.as_type => constants.%A.binding.as_type -// CHECK:STDOUT: %Eats.impl_witness => constants.%Eats.impl_witness.bef35e.1 +// CHECK:STDOUT: %Eats.impl_witness.loc18_36.2 => constants.%Eats.impl_witness.bef35e.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Feed(constants.%T.b61) { @@ -220,7 +221,7 @@ fn HandleAnimal[T:! Animal](a: T) { Feed(a); } // CHECK:STDOUT: specific @A.binding.as_type.as.Eats.impl(constants.%T.bfe) { // CHECK:STDOUT: %A.loc18_14.2 => constants.%T.bfe // CHECK:STDOUT: %A.binding.as_type => constants.%T.binding.as_type.d94 -// CHECK:STDOUT: %Eats.impl_witness => constants.%Eats.impl_witness.bef35e.2 +// CHECK:STDOUT: %Eats.impl_witness.loc18_36.2 => constants.%Eats.impl_witness.bef35e.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon b/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon index c9f5fb24dad20..37653fecefeb0 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon @@ -43,7 +43,7 @@ fn F() { // CHECK:STDOUT: %Grass: type = class_type @Grass [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %Edible.impl_witness: = impl_witness file.%Edible.impl_witness_table [concrete] +// CHECK:STDOUT: %Edible.impl_witness: = impl_witness @Grass.as.Edible.impl.%Edible.impl_witness_table [concrete] // CHECK:STDOUT: %Animal.type: type = facet_type <@Animal> [concrete] // CHECK:STDOUT: %Self.614: %Animal.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %type: type = facet_type [concrete] @@ -62,11 +62,11 @@ fn F() { // CHECK:STDOUT: %T.binding.as_type.d94: type = symbolic_binding_type T, 0, %T.bfe [symbolic] // CHECK:STDOUT: %U.binding.as_type: type = symbolic_binding_type U, 1, %U [symbolic] // CHECK:STDOUT: %Eats.type.1b7e7c.1: type = facet_type <@Eats, @Eats(%U.binding.as_type)> [symbolic] -// CHECK:STDOUT: %Eats.impl_witness.cce0fb.1: = impl_witness file.%Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(%T.bfe, %U) [symbolic] +// CHECK:STDOUT: %Eats.impl_witness.cce0fb.1: = impl_witness @T.binding.as_type.as.Eats.impl.%Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(%T.bfe, %U) [symbolic] // CHECK:STDOUT: %Self.42a: %Eats.type.1b7e7c.1 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %require_complete.52c920.1: = require_complete_type %Eats.type.1b7e7c.1 [symbolic] // CHECK:STDOUT: %Goat: type = class_type @Goat [concrete] -// CHECK:STDOUT: %Animal.impl_witness: = impl_witness file.%Animal.impl_witness_table [concrete] +// CHECK:STDOUT: %Animal.impl_witness: = impl_witness @Goat.as.Animal.impl.%Animal.impl_witness_table [concrete] // CHECK:STDOUT: %Food.4a8: %Edible.type = symbolic_binding Food, 0 [symbolic] // CHECK:STDOUT: %Food.binding.as_type.d04: type = symbolic_binding_type Food, 0, %Food.4a8 [symbolic] // CHECK:STDOUT: %Eats.type.133: type = facet_type <@Eats, @Eats(%Food.binding.as_type.d04)> [symbolic] @@ -91,7 +91,7 @@ fn F() { // CHECK:STDOUT: %require_complete.1b9: = require_complete_type %A.binding.as_type [symbolic] // CHECK:STDOUT: %require_complete.9fb: = require_complete_type %Food.binding.as_type.cd7 [symbolic] // CHECK:STDOUT: %Eats.type.1b7e7c.2: type = facet_type <@Eats, @Eats(%Food.binding.as_type.cd7)> [symbolic] -// CHECK:STDOUT: %Eats.impl_witness.cce0fb.2: = impl_witness file.%Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(%A, %Food.a7e) [symbolic] +// CHECK:STDOUT: %Eats.impl_witness.cce0fb.2: = impl_witness @T.binding.as_type.as.Eats.impl.%Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(%A, %Food.a7e) [symbolic] // CHECK:STDOUT: %require_complete.52c920.2: = require_complete_type %Eats.type.1b7e7c.2 [symbolic] // CHECK:STDOUT: %.c9c: require_specific_def_type = require_specific_def @T.binding.as_type.as.Eats.impl(%A, %Food.a7e) [symbolic] // CHECK:STDOUT: %Eats.lookup_impl_witness: = lookup_impl_witness %A, @Eats, @Eats(%Food.binding.as_type.cd7) [symbolic] @@ -119,7 +119,7 @@ fn F() { // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.8f6: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.e32 = struct_value () [concrete] // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.9be: = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.8f6, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.cfa) [concrete] // CHECK:STDOUT: %Eats.type.749: type = facet_type <@Eats, @Eats(%Grass)> [concrete] -// CHECK:STDOUT: %Eats.impl_witness.61e: = impl_witness file.%Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(%Animal.facet, %Edible.facet) [concrete] +// CHECK:STDOUT: %Eats.impl_witness.61e: = impl_witness @T.binding.as_type.as.Eats.impl.%Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(%Animal.facet, %Edible.facet) [concrete] // CHECK:STDOUT: %Self.813: %Eats.type.749 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %complete_type.d50: = complete_type_witness %Eats.type.749 [concrete] // CHECK:STDOUT: %.12a: require_specific_def_type = require_specific_def @T.binding.as_type.as.Eats.impl(%Animal.facet, %Edible.facet) [concrete] @@ -156,8 +156,6 @@ fn F() { // CHECK:STDOUT: %Grass.ref: type = name_ref Grass, file.%Grass.decl [concrete = constants.%Grass] // CHECK:STDOUT: %Edible.ref: type = name_ref Edible, file.%Edible.decl [concrete = constants.%Edible.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Edible.impl_witness_table = impl_witness_table (), @Grass.as.Edible.impl [concrete] -// CHECK:STDOUT: %Edible.impl_witness: = impl_witness %Edible.impl_witness_table [concrete = constants.%Edible.impl_witness] // CHECK:STDOUT: %Animal.decl: type = interface_decl @Animal [concrete = constants.%Animal.type] {} {} // CHECK:STDOUT: %Eats.decl: %Eats.type.321 = interface_decl @Eats [concrete = constants.%Eats.generic] { // CHECK:STDOUT: %Food.patt: %pattern_type.98f = symbolic_binding_pattern Food, 0 [concrete] @@ -188,15 +186,11 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %U.loc26_26.1: %Edible.type = symbolic_binding U, 1 [symbolic = %U.loc26_26.2 (constants.%U)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Eats.impl_witness_table = impl_witness_table (), @T.binding.as_type.as.Eats.impl [concrete] -// CHECK:STDOUT: %Eats.impl_witness: = impl_witness %Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(constants.%T.bfe, constants.%U) [symbolic = @T.binding.as_type.as.Eats.impl.%Eats.impl_witness (constants.%Eats.impl_witness.cce0fb.1)] // CHECK:STDOUT: %Goat.decl: type = class_decl @Goat [concrete = constants.%Goat] {} {} // CHECK:STDOUT: impl_decl @Goat.as.Animal.impl [concrete] {} { // CHECK:STDOUT: %Goat.ref: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat] // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Animal.impl_witness_table = impl_witness_table (), @Goat.as.Animal.impl [concrete] -// CHECK:STDOUT: %Animal.impl_witness: = impl_witness %Animal.impl_witness_table [concrete = constants.%Animal.impl_witness] // CHECK:STDOUT: %Feed.decl: %Feed.type = fn_decl @Feed [concrete = constants.%Feed] { // CHECK:STDOUT: %Food.patt: %pattern_type.981 = symbolic_binding_pattern Food, 0 [concrete] // CHECK:STDOUT: %T.patt: @Feed.%pattern_type.loc31_24 (%pattern_type.016) = symbolic_binding_pattern T, 1 [concrete] @@ -309,8 +303,11 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @Grass.as.Edible.impl: %Grass.ref as %Edible.ref { +// CHECK:STDOUT: %Edible.impl_witness_table = impl_witness_table (), @Grass.as.Edible.impl [concrete] +// CHECK:STDOUT: %Edible.impl_witness: = impl_witness %Edible.impl_witness_table [concrete = constants.%Edible.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Edible.impl_witness +// CHECK:STDOUT: witness = %Edible.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @T.binding.as_type.as.Eats.impl(%T.loc26_14.1: %Animal.type, %U.loc26_26.1: %Edible.type) { @@ -319,20 +316,26 @@ fn F() { // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc26_14.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.d94)] // CHECK:STDOUT: %U.binding.as_type: type = symbolic_binding_type U, 1, %U.loc26_26.2 [symbolic = %U.binding.as_type (constants.%U.binding.as_type)] // CHECK:STDOUT: %Eats.type.loc26_49.2: type = facet_type <@Eats, @Eats(%U.binding.as_type)> [symbolic = %Eats.type.loc26_49.2 (constants.%Eats.type.1b7e7c.1)] -// CHECK:STDOUT: %Eats.impl_witness: = impl_witness file.%Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(%T.loc26_14.2, %U.loc26_26.2) [symbolic = %Eats.impl_witness (constants.%Eats.impl_witness.cce0fb.1)] +// CHECK:STDOUT: %Eats.impl_witness.loc26_51.2: = impl_witness %Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(%T.loc26_14.2, %U.loc26_26.2) [symbolic = %Eats.impl_witness.loc26_51.2 (constants.%Eats.impl_witness.cce0fb.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %Eats.type.loc26_49.2 [symbolic = %require_complete (constants.%require_complete.52c920.1)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc26_38 as %Eats.type.loc26_49.1 { +// CHECK:STDOUT: %Eats.impl_witness_table = impl_witness_table (), @T.binding.as_type.as.Eats.impl [concrete] +// CHECK:STDOUT: %Eats.impl_witness.loc26_51.1: = impl_witness %Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(constants.%T.bfe, constants.%U) [symbolic = %Eats.impl_witness.loc26_51.2 (constants.%Eats.impl_witness.cce0fb.1)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Eats.impl_witness +// CHECK:STDOUT: witness = %Eats.impl_witness.loc26_51.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @Goat.as.Animal.impl: %Goat.ref as %Animal.ref { +// CHECK:STDOUT: %Animal.impl_witness_table = impl_witness_table (), @Goat.as.Animal.impl [concrete] +// CHECK:STDOUT: %Animal.impl_witness: = impl_witness %Animal.impl_witness_table [concrete = constants.%Animal.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Animal.impl_witness +// CHECK:STDOUT: witness = %Animal.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Grass { @@ -459,7 +462,7 @@ fn F() { // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type.d94 // CHECK:STDOUT: %U.binding.as_type => constants.%U.binding.as_type // CHECK:STDOUT: %Eats.type.loc26_49.2 => constants.%Eats.type.1b7e7c.1 -// CHECK:STDOUT: %Eats.impl_witness => constants.%Eats.impl_witness.cce0fb.1 +// CHECK:STDOUT: %Eats.impl_witness.loc26_51.2 => constants.%Eats.impl_witness.cce0fb.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Eats(constants.%Food.binding.as_type.d04) { @@ -500,7 +503,7 @@ fn F() { // CHECK:STDOUT: %T.binding.as_type => constants.%A.binding.as_type // CHECK:STDOUT: %U.binding.as_type => constants.%Food.binding.as_type.cd7 // CHECK:STDOUT: %Eats.type.loc26_49.2 => constants.%Eats.type.1b7e7c.2 -// CHECK:STDOUT: %Eats.impl_witness => constants.%Eats.impl_witness.cce0fb.2 +// CHECK:STDOUT: %Eats.impl_witness.loc26_51.2 => constants.%Eats.impl_witness.cce0fb.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete.52c920.2 @@ -545,7 +548,7 @@ fn F() { // CHECK:STDOUT: %T.binding.as_type => constants.%Goat // CHECK:STDOUT: %U.binding.as_type => constants.%Grass // CHECK:STDOUT: %Eats.type.loc26_49.2 => constants.%Eats.type.749 -// CHECK:STDOUT: %Eats.impl_witness => constants.%Eats.impl_witness.61e +// CHECK:STDOUT: %Eats.impl_witness.loc26_51.2 => constants.%Eats.impl_witness.61e // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.d50 diff --git a/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon b/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon index dc8399b494241..05ab37e4b754b 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon @@ -46,7 +46,7 @@ fn F() { // CHECK:STDOUT: %Goat: type = class_type @Goat [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %Animal.impl_witness: = impl_witness file.%Animal.impl_witness_table [concrete] +// CHECK:STDOUT: %Animal.impl_witness: = impl_witness @Goat.as.Animal.impl.%Animal.impl_witness_table [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] @@ -124,8 +124,6 @@ fn F() { // CHECK:STDOUT: %Goat.ref: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat] // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Animal.impl_witness_table = impl_witness_table (), @Goat.as.Animal.impl [concrete] -// CHECK:STDOUT: %Animal.impl_witness: = impl_witness %Animal.impl_witness_table [concrete = constants.%Animal.impl_witness] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -140,8 +138,11 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @Goat.as.Animal.impl: %Goat.ref as %Animal.ref { +// CHECK:STDOUT: %Animal.impl_witness_table = impl_witness_table (), @Goat.as.Animal.impl [concrete] +// CHECK:STDOUT: %Animal.impl_witness: = impl_witness %Animal.impl_witness_table [concrete = constants.%Animal.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Animal.impl_witness +// CHECK:STDOUT: witness = %Animal.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Goat { diff --git a/toolchain/check/testdata/facet/convert_interface.carbon b/toolchain/check/testdata/facet/convert_interface.carbon index 3dc006bd7ef1b..1be899787ccc6 100644 --- a/toolchain/check/testdata/facet/convert_interface.carbon +++ b/toolchain/check/testdata/facet/convert_interface.carbon @@ -29,7 +29,7 @@ fn G() { F(Animal); } // CHECK:STDOUT: %Self.f2a: %Eats.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %Animal.type: type = facet_type <@Animal> [concrete] // CHECK:STDOUT: %Self.614: %Animal.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Eats.impl_witness: = impl_witness file.%Eats.impl_witness_table [concrete] +// CHECK:STDOUT: %Eats.impl_witness: = impl_witness @Animal.type.as.Eats.impl.%Eats.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type: type = pattern_type %Eats.type [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] @@ -61,8 +61,6 @@ fn G() { F(Animal); } // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] // CHECK:STDOUT: %Eats.ref: type = name_ref Eats, file.%Eats.decl [concrete = constants.%Eats.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Eats.impl_witness_table = impl_witness_table (), @Animal.type.as.Eats.impl [concrete] -// CHECK:STDOUT: %Eats.impl_witness: = impl_witness %Eats.impl_witness_table [concrete = constants.%Eats.impl_witness] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %e.patt: %pattern_type = value_binding_pattern e [concrete] // CHECK:STDOUT: %e.param_patt: %pattern_type = value_param_pattern %e.patt, call_param0 [concrete] @@ -95,8 +93,11 @@ fn G() { F(Animal); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @Animal.type.as.Eats.impl: %Animal.ref as %Eats.ref { +// CHECK:STDOUT: %Eats.impl_witness_table = impl_witness_table (), @Animal.type.as.Eats.impl [concrete] +// CHECK:STDOUT: %Eats.impl_witness: = impl_witness %Eats.impl_witness_table [concrete = constants.%Eats.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Eats.impl_witness +// CHECK:STDOUT: witness = %Eats.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%e.param: %Eats.type) { diff --git a/toolchain/check/testdata/facet/fail_convert_class_type_to_generic_facet_value.carbon b/toolchain/check/testdata/facet/fail_convert_class_type_to_generic_facet_value.carbon index 5a3e40ea51323..e5ac44fee1746 100644 --- a/toolchain/check/testdata/facet/fail_convert_class_type_to_generic_facet_value.carbon +++ b/toolchain/check/testdata/facet/fail_convert_class_type_to_generic_facet_value.carbon @@ -58,7 +58,7 @@ fn G() { // CHECK:STDOUT: %WrongGenericParam: type = class_type @WrongGenericParam [concrete] // CHECK:STDOUT: %ImplsGeneric: type = class_type @ImplsGeneric [concrete] // CHECK:STDOUT: %Generic.type.407: type = facet_type <@Generic, @Generic(%GenericParam)> [concrete] -// CHECK:STDOUT: %Generic.impl_witness: = impl_witness file.%Generic.impl_witness_table [concrete] +// CHECK:STDOUT: %Generic.impl_witness: = impl_witness @ImplsGeneric.as.Generic.impl.%Generic.impl_witness_table [concrete] // CHECK:STDOUT: %Self.de4: %Generic.type.407 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %Generic.F.type.0a1: type = fn_type @Generic.F, @Generic(%GenericParam) [concrete] // CHECK:STDOUT: %Generic.F.edf: %Generic.F.type.0a1 = struct_value () [concrete] @@ -110,8 +110,6 @@ fn G() { // CHECK:STDOUT: %GenericParam.ref: type = name_ref GenericParam, file.%GenericParam.decl [concrete = constants.%GenericParam] // CHECK:STDOUT: %Generic.type: type = facet_type <@Generic, @Generic(constants.%GenericParam)> [concrete = constants.%Generic.type.407] // CHECK:STDOUT: } -// CHECK:STDOUT: %Generic.impl_witness_table = impl_witness_table (@ImplsGeneric.as.Generic.impl.%ImplsGeneric.as.Generic.impl.F.decl), @ImplsGeneric.as.Generic.impl [concrete] -// CHECK:STDOUT: %Generic.impl_witness: = impl_witness %Generic.impl_witness_table [concrete = constants.%Generic.impl_witness] // CHECK:STDOUT: %CallGenericMethod.decl: %CallGenericMethod.type = fn_decl @CallGenericMethod [concrete = constants.%CallGenericMethod] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %U.patt: @CallGenericMethod.%pattern_type (%pattern_type.740) = symbolic_binding_pattern U, 1 [concrete] @@ -156,10 +154,12 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: impl @ImplsGeneric.as.Generic.impl: %ImplsGeneric.ref as %Generic.type { // CHECK:STDOUT: %ImplsGeneric.as.Generic.impl.F.decl: %ImplsGeneric.as.Generic.impl.F.type = fn_decl @ImplsGeneric.as.Generic.impl.F [concrete = constants.%ImplsGeneric.as.Generic.impl.F] {} {} +// CHECK:STDOUT: %Generic.impl_witness_table = impl_witness_table (%ImplsGeneric.as.Generic.impl.F.decl), @ImplsGeneric.as.Generic.impl [concrete] +// CHECK:STDOUT: %Generic.impl_witness: = impl_witness %Generic.impl_witness_table [concrete = constants.%Generic.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %ImplsGeneric.as.Generic.impl.F.decl -// CHECK:STDOUT: witness = file.%Generic.impl_witness +// CHECK:STDOUT: witness = %Generic.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @GenericParam { diff --git a/toolchain/check/testdata/facet/fail_convert_type_erased_type_to_facet.carbon b/toolchain/check/testdata/facet/fail_convert_type_erased_type_to_facet.carbon index 06e489c959efc..192cc2f914145 100644 --- a/toolchain/check/testdata/facet/fail_convert_type_erased_type_to_facet.carbon +++ b/toolchain/check/testdata/facet/fail_convert_type_erased_type_to_facet.carbon @@ -36,6 +36,7 @@ fn F() { // CHECK:STDOUT: %Goat: type = class_type @Goat [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %Animal.impl_witness: = impl_witness .inst{{[0-9A-F]+}}.loc18_21 [concrete] // CHECK:STDOUT: %a: %Animal.type = symbolic_binding a, 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -50,6 +51,9 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @: .inst{{[0-9A-F]+}}.loc18_6 as .inst{{[0-9A-F]+}}.loc18_14 { +// CHECK:STDOUT: impl_witness_table (), @ [concrete] +// CHECK:STDOUT: .inst{{[0-9A-F]+}}.loc18_21: = impl_witness .inst{{[0-9A-F]+}}.loc18_21 [concrete = constants.%Animal.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = .inst{{[0-9A-F]+}}.loc18_21 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon b/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon index e17649d73bc6f..633709aa7a4a4 100644 --- a/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon +++ b/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon @@ -60,7 +60,7 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), from:! RuntimeConvertFrom) { // 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.d8e: type = facet_type <@ImplicitAs, @ImplicitAs(%RuntimeConvertTo)> [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness file.%ImplicitAs.impl_witness_table [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness @RuntimeConvertFrom.as.ImplicitAs.impl.%ImplicitAs.impl_witness_table [concrete] // CHECK:STDOUT: %ImplicitAs.Convert.type.559: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%RuntimeConvertTo) [concrete] // CHECK:STDOUT: %pattern_type.6bd: type = pattern_type %RuntimeConvertFrom [concrete] // CHECK:STDOUT: %pattern_type.c89: type = pattern_type %RuntimeConvertTo [concrete] @@ -133,8 +133,6 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), from:! RuntimeConvertFrom) { // CHECK:STDOUT: %RuntimeConvertTo.ref: type = name_ref RuntimeConvertTo, file.%RuntimeConvertTo.decl [concrete = constants.%RuntimeConvertTo] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%RuntimeConvertTo)> [concrete = constants.%ImplicitAs.type.d8e] // CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (@RuntimeConvertFrom.as.ImplicitAs.impl.%RuntimeConvertFrom.as.ImplicitAs.impl.Convert.decl), @RuntimeConvertFrom.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %T.patt: %pattern_type.f1e = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %A.patt: @F.%pattern_type.loc27_20 (%pattern_type.e66) = symbolic_binding_pattern A, 1 [concrete] @@ -199,11 +197,13 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), from:! RuntimeConvertFrom) { // CHECK:STDOUT: %return.param: ref %RuntimeConvertTo = out_param call_param1 // CHECK:STDOUT: %return: ref %RuntimeConvertTo = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%RuntimeConvertFrom.as.ImplicitAs.impl.Convert.decl), @RuntimeConvertFrom.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .RuntimeConvertTo = // CHECK:STDOUT: .Convert = %RuntimeConvertFrom.as.ImplicitAs.impl.Convert.decl -// CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness +// CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @HoldsType(%T.loc17_17.2: %tuple.type) { diff --git a/toolchain/check/testdata/for/actual.carbon b/toolchain/check/testdata/for/actual.carbon index 30e0620597e21..461e7d1f08ecb 100644 --- a/toolchain/check/testdata/for/actual.carbon +++ b/toolchain/check/testdata/for/actual.carbon @@ -95,7 +95,7 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: %Optional.Some.6de: %Optional.Some.type.2b8 = struct_value () [symbolic] // CHECK:STDOUT: %Optional.None.type.401: type = fn_type @Optional.None, @Optional(%T.8ba) [symbolic] // CHECK:STDOUT: %Optional.None.c2f: %Optional.None.type.401 = struct_value () [symbolic] -// CHECK:STDOUT: %Iterate.impl_witness: = impl_witness @IntRange.%Iterate.impl_witness_table, @IntRange.as.Iterate.impl(%N) [symbolic] +// CHECK:STDOUT: %Iterate.impl_witness: = impl_witness @IntRange.as.Iterate.impl.%Iterate.impl_witness_table, @IntRange.as.Iterate.impl(%N) [symbolic] // CHECK:STDOUT: %require_complete.fbb: = require_complete_type %Iterate_where.type [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] @@ -303,7 +303,7 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %Int.loc9_54.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.7a8)] // 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.118)] // CHECK:STDOUT: %Iterate_where.type: type = facet_type <@Iterate where constants.%impl.elem1.ff5 = %Int.loc9_54.1 and constants.%impl.elem0.546 = %Copy.facet.loc9_85.1> [symbolic = %Iterate_where.type (constants.%Iterate_where.type)] -// 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: %Iterate.impl_witness.loc9_87.2: = impl_witness %Iterate.impl_witness_table, @IntRange.as.Iterate.impl(%N) [symbolic = %Iterate.impl_witness.loc9_87.2 (constants.%Iterate.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %Iterate_where.type [symbolic = %require_complete (constants.%require_complete.fbb)] @@ -368,12 +368,16 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: %return.param: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.0d9) = out_param call_param2 // CHECK:STDOUT: %return: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.0d9) = return_slot %return.param // 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.NewCursor.decl, %IntRange.as.Iterate.impl.Next.decl), @IntRange.as.Iterate.impl [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.loc9_87.1: = impl_witness %Iterate.impl_witness_table, @IntRange.as.Iterate.impl(constants.%N) [symbolic = %Iterate.impl_witness.loc9_87.2 (constants.%Iterate.impl_witness)] +// CHECK:STDOUT: %impl_witness_assoc_constant.loc9_87.1: type = impl_witness_assoc_constant constants.%Int.fc6021.1 [symbolic = %Int.loc9_54.1 (constants.%Int.fc6021.1)] +// CHECK:STDOUT: %impl_witness_assoc_constant.loc9_87.2: %Copy.type = impl_witness_assoc_constant constants.%Copy.facet.118 [symbolic = %Copy.facet.loc9_85.1 (constants.%Copy.facet.118)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .N = // CHECK:STDOUT: .NewCursor = %IntRange.as.Iterate.impl.NewCursor.decl // CHECK:STDOUT: .Next = %IntRange.as.Iterate.impl.Next.decl -// CHECK:STDOUT: witness = @IntRange.%Iterate.impl_witness +// CHECK:STDOUT: witness = %Iterate.impl_witness.loc9_87.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -452,10 +456,6 @@ fn Read(y:! Core.IntLiteral()) { // 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.fc6021.1 [symbolic = @IntRange.as.Iterate.impl.%Int.loc9_54.1 (constants.%Int.fc6021.1)] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc9_87.2: %Copy.type = impl_witness_assoc_constant constants.%Copy.facet.118 [symbolic = @IntRange.as.Iterate.impl.%Copy.facet.loc9_85.1 (constants.%Copy.facet.118)] // 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)] @@ -766,7 +766,7 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.7a8 // CHECK:STDOUT: %Copy.facet.loc9_85.1 => constants.%Copy.facet.118 // CHECK:STDOUT: %Iterate_where.type => constants.%Iterate_where.type -// CHECK:STDOUT: %Iterate.impl_witness => constants.%Iterate.impl_witness +// CHECK:STDOUT: %Iterate.impl_witness.loc9_87.2 => constants.%Iterate.impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete.fbb diff --git a/toolchain/check/testdata/for/basic.carbon b/toolchain/check/testdata/for/basic.carbon index caae3de1aef29..90f442db0ce52 100644 --- a/toolchain/check/testdata/for/basic.carbon +++ b/toolchain/check/testdata/for/basic.carbon @@ -70,7 +70,7 @@ fn Run() { // CHECK:STDOUT: %Optional.Get.0e5: %Optional.Get.type.b87 = struct_value () [symbolic] // CHECK:STDOUT: %Optional.HasValue.type.c70: type = fn_type @Optional.HasValue, @Optional(%T.f92) [symbolic] // CHECK:STDOUT: %Optional.HasValue.c68: %Optional.HasValue.type.c70 = struct_value () [symbolic] -// CHECK:STDOUT: %Iterate.impl_witness: = impl_witness @TrivialRange.%Iterate.impl_witness_table [concrete] +// CHECK:STDOUT: %Iterate.impl_witness: = impl_witness @TrivialRange.as.Iterate.impl.%Iterate.impl_witness_table [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.b01a0a.1: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_32.1 [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.843a65.1: %TrivialRange.as.Iterate.impl.NewCursor.type.b01a0a.1 = struct_value () [concrete] // CHECK:STDOUT: %ptr.843: type = ptr_type %empty_tuple.type [concrete] diff --git a/toolchain/check/testdata/function/builtin/call_from_operator.carbon b/toolchain/check/testdata/function/builtin/call_from_operator.carbon index 4a6ab67b7999a..ae8ce0d1f457c 100644 --- a/toolchain/check/testdata/function/builtin/call_from_operator.carbon +++ b/toolchain/check/testdata/function/builtin/call_from_operator.carbon @@ -99,7 +99,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %AddWith.type.943: type = facet_type <@AddWith, @AddWith(%i32.builtin)> [concrete] -// CHECK:STDOUT: %AddWith.impl_witness: = impl_witness file.%AddWith.impl_witness_table [concrete] +// CHECK:STDOUT: %AddWith.impl_witness: = impl_witness @i32.builtin.as.AddWith.impl.%AddWith.impl_witness_table [concrete] // CHECK:STDOUT: %Self.53c: %AddWith.type.943 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %AddWith.Op.type.bae: type = fn_type @AddWith.Op, @AddWith(%i32.builtin) [concrete] // CHECK:STDOUT: %AddWith.Op.a6f: %AddWith.Op.type.bae = struct_value () [concrete] @@ -110,7 +110,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %i32.builtin.as.AddWith.impl.Op: %i32.builtin.as.AddWith.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %AddWith.facet: %AddWith.type.943 = facet_value %i32.builtin, (%AddWith.impl_witness) [concrete] // CHECK:STDOUT: %As.type.0c6: type = facet_type <@As, @As(%i32.builtin)> [concrete] -// CHECK:STDOUT: %As.impl_witness: = impl_witness file.%As.impl_witness_table [concrete] +// CHECK:STDOUT: %As.impl_witness: = impl_witness @Core.IntLiteral.as.As.impl.%As.impl_witness_table [concrete] // CHECK:STDOUT: %Self.013: %As.type.0c6 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %As.Convert.type.063: type = fn_type @As.Convert, @As(%i32.builtin) [concrete] // CHECK:STDOUT: %As.Convert.701: %As.Convert.type.063 = struct_value () [concrete] @@ -120,7 +120,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert: %Core.IntLiteral.as.As.impl.Convert.type = struct_value () [concrete] // CHECK:STDOUT: %As.facet: %As.type.0c6 = facet_value Core.IntLiteral, (%As.impl_witness) [concrete] // CHECK:STDOUT: %ImplicitAs.type.7cd: type = facet_type <@ImplicitAs, @ImplicitAs(%i32.builtin)> [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.d89: = impl_witness file.%ImplicitAs.impl_witness_table.loc27 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.d89: = impl_witness @Core.IntLiteral.as.ImplicitAs.impl.%ImplicitAs.impl_witness_table [concrete] // CHECK:STDOUT: %Self.ece: %ImplicitAs.type.7cd = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %ImplicitAs.Convert.type.424: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32.builtin) [concrete] // CHECK:STDOUT: %ImplicitAs.Convert.a1f: %ImplicitAs.Convert.type.424 = struct_value () [concrete] @@ -130,7 +130,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.facet.b3c: %ImplicitAs.type.7cd = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.d89) [concrete] // CHECK:STDOUT: %ImplicitAs.type.5c7: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.285: = impl_witness file.%ImplicitAs.impl_witness_table.loc31 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.285: = impl_witness @i32.builtin.as.ImplicitAs.impl.%ImplicitAs.impl_witness_table [concrete] // CHECK:STDOUT: %Self.12f: %ImplicitAs.type.5c7 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %ImplicitAs.Convert.type.785: type = fn_type @ImplicitAs.Convert, @ImplicitAs(Core.IntLiteral) [concrete] // CHECK:STDOUT: %ImplicitAs.Convert.aec: %ImplicitAs.Convert.type.785 = struct_value () [concrete] @@ -203,8 +203,6 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %.loc19_24.2: type = converted %Int.call.loc19_21, %.loc19_24.1 [concrete = constants.%i32.builtin] // CHECK:STDOUT: %AddWith.type: type = facet_type <@AddWith, @AddWith(constants.%i32.builtin)> [concrete = constants.%AddWith.type.943] // CHECK:STDOUT: } -// CHECK:STDOUT: %AddWith.impl_witness_table = impl_witness_table (@i32.builtin.as.AddWith.impl.%i32.builtin.as.AddWith.impl.Op.decl), @i32.builtin.as.AddWith.impl [concrete] -// CHECK:STDOUT: %AddWith.impl_witness: = impl_witness %AddWith.impl_witness_table [concrete = constants.%AddWith.impl_witness] // CHECK:STDOUT: impl_decl @Core.IntLiteral.as.As.impl [concrete] {} { // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] // CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] @@ -217,8 +215,6 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %.loc23_28.2: type = converted %Int.call, %.loc23_28.1 [concrete = constants.%i32.builtin] // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(constants.%i32.builtin)> [concrete = constants.%As.type.0c6] // CHECK:STDOUT: } -// CHECK:STDOUT: %As.impl_witness_table = impl_witness_table (@Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.decl), @Core.IntLiteral.as.As.impl [concrete] -// CHECK:STDOUT: %As.impl_witness: = impl_witness %As.impl_witness_table [concrete = constants.%As.impl_witness] // CHECK:STDOUT: impl_decl @Core.IntLiteral.as.ImplicitAs.impl [concrete] {} { // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] // CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] @@ -231,8 +227,6 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %.loc27_36.2: type = converted %Int.call, %.loc27_36.1 [concrete = constants.%i32.builtin] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32.builtin)> [concrete = constants.%ImplicitAs.type.7cd] // CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.loc27 = impl_witness_table (@Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.decl), @Core.IntLiteral.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.loc27: = impl_witness %ImplicitAs.impl_witness_table.loc27 [concrete = constants.%ImplicitAs.impl_witness.d89] // CHECK:STDOUT: impl_decl @i32.builtin.as.ImplicitAs.impl [concrete] {} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %Int.call: init type = call constants.%Int(%int_32) [concrete = constants.%i32.builtin] @@ -245,8 +239,6 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %.loc31_36.2: type = converted %IntLiteral.call, %.loc31_36.1 [concrete = Core.IntLiteral] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete = constants.%ImplicitAs.type.5c7] // CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.loc31 = impl_witness_table (@i32.builtin.as.ImplicitAs.impl.%i32.builtin.as.ImplicitAs.impl.Convert.decl), @i32.builtin.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.loc31: = impl_witness %ImplicitAs.impl_witness_table.loc31 [concrete = constants.%ImplicitAs.impl_witness.285] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @AddWith(%T.loc7_19.2: type) { @@ -409,10 +401,12 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param call_param2 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %AddWith.impl_witness_table = impl_witness_table (%i32.builtin.as.AddWith.impl.Op.decl), @i32.builtin.as.AddWith.impl [concrete] +// CHECK:STDOUT: %AddWith.impl_witness: = impl_witness %AddWith.impl_witness_table [concrete = constants.%AddWith.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %i32.builtin.as.AddWith.impl.Op.decl -// CHECK:STDOUT: witness = file.%AddWith.impl_witness +// CHECK:STDOUT: witness = %AddWith.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @Core.IntLiteral.as.As.impl: %.loc23_17.2 as %As.type { @@ -432,10 +426,12 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param call_param1 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %As.impl_witness_table = impl_witness_table (%Core.IntLiteral.as.As.impl.Convert.decl), @Core.IntLiteral.as.As.impl [concrete] +// CHECK:STDOUT: %As.impl_witness: = impl_witness %As.impl_witness_table [concrete = constants.%As.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Core.IntLiteral.as.As.impl.Convert.decl -// CHECK:STDOUT: witness = file.%As.impl_witness +// CHECK:STDOUT: witness = %As.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @Core.IntLiteral.as.ImplicitAs.impl: %.loc27_17.2 as %ImplicitAs.type { @@ -455,10 +451,12 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param call_param1 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%Core.IntLiteral.as.ImplicitAs.impl.Convert.decl), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness.d89] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Core.IntLiteral.as.ImplicitAs.impl.Convert.decl -// CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness.loc27 +// CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @i32.builtin.as.ImplicitAs.impl: %.loc31_6.2 as %ImplicitAs.type { @@ -478,11 +476,13 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param call_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%i32.builtin.as.ImplicitAs.impl.Convert.decl), @i32.builtin.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness.285] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .IntLiteral = // CHECK:STDOUT: .Convert = %i32.builtin.as.ImplicitAs.impl.Convert.decl -// CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness.loc31 +// CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; diff --git a/toolchain/check/testdata/function/builtin/method.carbon b/toolchain/check/testdata/function/builtin/method.carbon index 2b16454d3e234..c7849dac20ff7 100644 --- a/toolchain/check/testdata/function/builtin/method.carbon +++ b/toolchain/check/testdata/function/builtin/method.carbon @@ -37,7 +37,7 @@ var arr: array(i32, (1 as i32).(I.F)(2)); // 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: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @i32.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %i32.as.I.impl.F.type: type = fn_type @i32.as.I.impl.F [concrete] // CHECK:STDOUT: %i32.as.I.impl.F: %i32.as.I.impl.F.type = struct_value () [concrete] @@ -128,8 +128,6 @@ var arr: array(i32, (1 as i32).(I.F)(2)); // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@i32.as.I.impl.%i32.as.I.impl.F.decl), @i32.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %arr.patt: %pattern_type.5d8 = ref_binding_pattern arr [concrete] // CHECK:STDOUT: %arr.var_patt: %pattern_type.5d8 = var_pattern %arr.patt [concrete] @@ -241,10 +239,12 @@ var arr: array(i32, (1 as i32).(I.F)(2)); // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%i32.as.I.impl.F.decl), @i32.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %i32.as.I.impl.F.decl -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @I.F(@I.%Self: %I.type) { diff --git a/toolchain/check/testdata/function/generic/call_method_on_generic_facet.carbon b/toolchain/check/testdata/function/generic/call_method_on_generic_facet.carbon index 030b00a89f163..2f6c434b30d45 100644 --- a/toolchain/check/testdata/function/generic/call_method_on_generic_facet.carbon +++ b/toolchain/check/testdata/function/generic/call_method_on_generic_facet.carbon @@ -59,7 +59,7 @@ fn G() { // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %ImplsGeneric: type = class_type @ImplsGeneric [concrete] // CHECK:STDOUT: %Generic.type.407: type = facet_type <@Generic, @Generic(%GenericParam)> [concrete] -// CHECK:STDOUT: %Generic.impl_witness: = impl_witness file.%Generic.impl_witness_table [concrete] +// CHECK:STDOUT: %Generic.impl_witness: = impl_witness @ImplsGeneric.as.Generic.impl.%Generic.impl_witness_table [concrete] // CHECK:STDOUT: %Self.de4: %Generic.type.407 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %Generic.F.type.0a1: type = fn_type @Generic.F, @Generic(%GenericParam) [concrete] // CHECK:STDOUT: %Generic.F.edf: %Generic.F.type.0a1 = struct_value () [concrete] @@ -74,7 +74,7 @@ fn G() { // CHECK:STDOUT: %Other.G: %Other.G.type = struct_value () [concrete] // CHECK:STDOUT: %Other.assoc_type: type = assoc_entity_type @Other [concrete] // CHECK:STDOUT: %assoc0.96c: %Other.assoc_type = assoc_entity element0, @Other.%Other.G.decl [concrete] -// CHECK:STDOUT: %Other.impl_witness: = impl_witness file.%Other.impl_witness_table [concrete] +// CHECK:STDOUT: %Other.impl_witness: = impl_witness @ImplsGeneric.as.Other.impl.%Other.impl_witness_table [concrete] // CHECK:STDOUT: %ImplsGeneric.as.Other.impl.G.type: type = fn_type @ImplsGeneric.as.Other.impl.G [concrete] // CHECK:STDOUT: %ImplsGeneric.as.Other.impl.G: %ImplsGeneric.as.Other.impl.G.type = struct_value () [concrete] // CHECK:STDOUT: %Other.facet: %Other.type = facet_value %ImplsGeneric, (%Other.impl_witness) [concrete] @@ -135,15 +135,11 @@ fn G() { // CHECK:STDOUT: %GenericParam.ref: type = name_ref GenericParam, file.%GenericParam.decl [concrete = constants.%GenericParam] // CHECK:STDOUT: %Generic.type: type = facet_type <@Generic, @Generic(constants.%GenericParam)> [concrete = constants.%Generic.type.407] // CHECK:STDOUT: } -// CHECK:STDOUT: %Generic.impl_witness_table = impl_witness_table (@ImplsGeneric.as.Generic.impl.%ImplsGeneric.as.Generic.impl.F.decl), @ImplsGeneric.as.Generic.impl [concrete] -// CHECK:STDOUT: %Generic.impl_witness: = impl_witness %Generic.impl_witness_table [concrete = constants.%Generic.impl_witness] // CHECK:STDOUT: %Other.decl: type = interface_decl @Other [concrete = constants.%Other.type] {} {} // CHECK:STDOUT: impl_decl @ImplsGeneric.as.Other.impl [concrete] {} { // CHECK:STDOUT: %ImplsGeneric.ref: type = name_ref ImplsGeneric, file.%ImplsGeneric.decl [concrete = constants.%ImplsGeneric] // CHECK:STDOUT: %Other.ref: type = name_ref Other, file.%Other.decl [concrete = constants.%Other.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Other.impl_witness_table = impl_witness_table (@ImplsGeneric.as.Other.impl.%ImplsGeneric.as.Other.impl.G.decl), @ImplsGeneric.as.Other.impl [concrete] -// CHECK:STDOUT: %Other.impl_witness: = impl_witness %Other.impl_witness_table [concrete = constants.%Other.impl_witness] // CHECK:STDOUT: %CallGenericMethod.decl: %CallGenericMethod.type = fn_decl @CallGenericMethod [concrete = constants.%CallGenericMethod] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %U.patt: @CallGenericMethod.%pattern_type (%pattern_type.740) = symbolic_binding_pattern U, 1 [concrete] @@ -201,18 +197,22 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: impl @ImplsGeneric.as.Generic.impl: %ImplsGeneric.ref as %Generic.type { // CHECK:STDOUT: %ImplsGeneric.as.Generic.impl.F.decl: %ImplsGeneric.as.Generic.impl.F.type = fn_decl @ImplsGeneric.as.Generic.impl.F [concrete = constants.%ImplsGeneric.as.Generic.impl.F] {} {} +// CHECK:STDOUT: %Generic.impl_witness_table = impl_witness_table (%ImplsGeneric.as.Generic.impl.F.decl), @ImplsGeneric.as.Generic.impl [concrete] +// CHECK:STDOUT: %Generic.impl_witness: = impl_witness %Generic.impl_witness_table [concrete = constants.%Generic.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %ImplsGeneric.as.Generic.impl.F.decl -// CHECK:STDOUT: witness = file.%Generic.impl_witness +// CHECK:STDOUT: witness = %Generic.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @ImplsGeneric.as.Other.impl: %ImplsGeneric.ref as %Other.ref { // CHECK:STDOUT: %ImplsGeneric.as.Other.impl.G.decl: %ImplsGeneric.as.Other.impl.G.type = fn_decl @ImplsGeneric.as.Other.impl.G [concrete = constants.%ImplsGeneric.as.Other.impl.G] {} {} +// CHECK:STDOUT: %Other.impl_witness_table = impl_witness_table (%ImplsGeneric.as.Other.impl.G.decl), @ImplsGeneric.as.Other.impl [concrete] +// CHECK:STDOUT: %Other.impl_witness: = impl_witness %Other.impl_witness_table [concrete = constants.%Other.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G = %ImplsGeneric.as.Other.impl.G.decl -// CHECK:STDOUT: witness = file.%Other.impl_witness +// CHECK:STDOUT: witness = %Other.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @GenericParam { diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 1d4e8fcd8262c..b3e64f3b1fe0f 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -1589,7 +1589,7 @@ fn F() { // CHECK:STDOUT: %EE: type = class_type @EE [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %Z.impl_witness.9e2: = impl_witness file.%Z.impl_witness_table.loc6 [concrete] +// CHECK:STDOUT: %Z.impl_witness.9e2: = impl_witness @EE.as.Z.impl.%Z.impl_witness_table [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %E: type = symbolic_binding E, 0 [symbolic] @@ -1597,7 +1597,7 @@ fn F() { // CHECK:STDOUT: %DD.type: type = generic_class_type @DD [concrete] // CHECK:STDOUT: %DD.generic: %DD.type = struct_value () [concrete] // CHECK:STDOUT: %DD.a29: type = class_type @DD, @DD(%E) [symbolic] -// CHECK:STDOUT: %Z.impl_witness.718: = impl_witness file.%Z.impl_witness_table.loc9, @DD.as.Z.impl(%E) [symbolic] +// CHECK:STDOUT: %Z.impl_witness.718: = impl_witness @DD.as.Z.impl.%Z.impl_witness_table, @DD.as.Z.impl(%E) [symbolic] // CHECK:STDOUT: %D: %Z.type = symbolic_binding D, 0 [symbolic] // CHECK:STDOUT: %pattern_type.fe6: type = pattern_type %Z.type [concrete] // CHECK:STDOUT: %CC.type: type = generic_class_type @CC [concrete] @@ -1607,15 +1607,15 @@ fn F() { // CHECK:STDOUT: %Z.lookup_impl_witness: = lookup_impl_witness %DD.a29, @Z [symbolic] // CHECK:STDOUT: %Z.facet.67c: %Z.type = facet_value %DD.a29, (%Z.lookup_impl_witness) [symbolic] // CHECK:STDOUT: %CC.474: type = class_type @CC, @CC(%Z.facet.67c) [symbolic] -// CHECK:STDOUT: %Z.impl_witness.1a2: = impl_witness file.%Z.impl_witness_table.loc12, @CC.as.Z.impl(%E) [symbolic] +// CHECK:STDOUT: %Z.impl_witness.1a2: = impl_witness @CC.as.Z.impl.%Z.impl_witness_table, @CC.as.Z.impl(%E) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %DD.2e1: type = class_type @DD, @DD(%EE) [concrete] -// CHECK:STDOUT: %Z.impl_witness.8fc: = impl_witness file.%Z.impl_witness_table.loc9, @DD.as.Z.impl(%EE) [concrete] +// CHECK:STDOUT: %Z.impl_witness.8fc: = impl_witness @DD.as.Z.impl.%Z.impl_witness_table, @DD.as.Z.impl(%EE) [concrete] // CHECK:STDOUT: %.db7: require_specific_def_type = require_specific_def @DD.as.Z.impl(%EE) [concrete] // CHECK:STDOUT: %Z.facet.175: %Z.type = facet_value %DD.2e1, (%Z.impl_witness.8fc) [concrete] // CHECK:STDOUT: %CC.8cd: type = class_type @CC, @CC(%Z.facet.175) [concrete] -// CHECK:STDOUT: %Z.impl_witness.12a: = impl_witness file.%Z.impl_witness_table.loc12, @CC.as.Z.impl(%EE) [concrete] +// CHECK:STDOUT: %Z.impl_witness.12a: = impl_witness @CC.as.Z.impl.%Z.impl_witness_table, @CC.as.Z.impl(%EE) [concrete] // CHECK:STDOUT: %Z.facet.35e: %Z.type = facet_value %CC.8cd, (%Z.impl_witness.12a) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1642,8 +1642,6 @@ fn F() { // CHECK:STDOUT: %EE.ref: type = name_ref EE, file.%EE.decl [concrete = constants.%EE] // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Z.impl_witness_table.loc6 = impl_witness_table (), @EE.as.Z.impl [concrete] -// CHECK:STDOUT: %Z.impl_witness.loc6: = impl_witness %Z.impl_witness_table.loc6 [concrete = constants.%Z.impl_witness.9e2] // CHECK:STDOUT: %DD.decl: %DD.type = class_decl @DD [concrete = constants.%DD.generic] { // CHECK:STDOUT: %E.patt: %pattern_type.98f = symbolic_binding_pattern E, 0 [concrete] // CHECK:STDOUT: } { @@ -1660,8 +1658,6 @@ fn F() { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %E.loc9_14.1: type = symbolic_binding E, 0 [symbolic = %E.loc9_14.2 (constants.%E)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Z.impl_witness_table.loc9 = impl_witness_table (), @DD.as.Z.impl [concrete] -// CHECK:STDOUT: %Z.impl_witness.loc9: = impl_witness %Z.impl_witness_table.loc9, @DD.as.Z.impl(constants.%E) [symbolic = @DD.as.Z.impl.%Z.impl_witness (constants.%Z.impl_witness.718)] // CHECK:STDOUT: %CC.decl: %CC.type = class_decl @CC [concrete = constants.%CC.generic] { // CHECK:STDOUT: %D.patt: %pattern_type.fe6 = symbolic_binding_pattern D, 0 [concrete] // CHECK:STDOUT: } { @@ -1685,8 +1681,6 @@ fn F() { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %E.loc12_14.1: type = symbolic_binding E, 0 [symbolic = %E.loc12_14.2 (constants.%E)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Z.impl_witness_table.loc12 = impl_witness_table (), @CC.as.Z.impl [concrete] -// CHECK:STDOUT: %Z.impl_witness.loc12: = impl_witness %Z.impl_witness_table.loc12, @CC.as.Z.impl(constants.%E) [symbolic = @CC.as.Z.impl.%Z.impl_witness (constants.%Z.impl_witness.1a2)] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1701,20 +1695,26 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @EE.as.Z.impl: %EE.ref as %Z.ref { +// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (), @EE.as.Z.impl [concrete] +// CHECK:STDOUT: %Z.impl_witness: = impl_witness %Z.impl_witness_table [concrete = constants.%Z.impl_witness.9e2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Z.impl_witness.loc6 +// CHECK:STDOUT: witness = %Z.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @DD.as.Z.impl(%E.loc9_14.1: type) { // CHECK:STDOUT: %E.loc9_14.2: type = symbolic_binding E, 0 [symbolic = %E.loc9_14.2 (constants.%E)] // CHECK:STDOUT: %DD.loc9_28.2: type = class_type @DD, @DD(%E.loc9_14.2) [symbolic = %DD.loc9_28.2 (constants.%DD.a29)] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness file.%Z.impl_witness_table.loc9, @DD.as.Z.impl(%E.loc9_14.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.718)] +// CHECK:STDOUT: %Z.impl_witness.loc9_35.2: = impl_witness %Z.impl_witness_table, @DD.as.Z.impl(%E.loc9_14.2) [symbolic = %Z.impl_witness.loc9_35.2 (constants.%Z.impl_witness.718)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %DD.loc9_28.1 as %Z.ref { +// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (), @DD.as.Z.impl [concrete] +// CHECK:STDOUT: %Z.impl_witness.loc9_35.1: = impl_witness %Z.impl_witness_table, @DD.as.Z.impl(constants.%E) [symbolic = %Z.impl_witness.loc9_35.2 (constants.%Z.impl_witness.718)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Z.impl_witness.loc9 +// CHECK:STDOUT: witness = %Z.impl_witness.loc9_35.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1725,13 +1725,16 @@ fn F() { // CHECK:STDOUT: %Z.lookup_impl_witness: = lookup_impl_witness %DD.loc12_31.2, @Z [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness)] // CHECK:STDOUT: %Z.facet.loc12_32.2: %Z.type = facet_value %DD.loc12_31.2, (%Z.lookup_impl_witness) [symbolic = %Z.facet.loc12_32.2 (constants.%Z.facet.67c)] // CHECK:STDOUT: %CC.loc12_32.2: type = class_type @CC, @CC(%Z.facet.loc12_32.2) [symbolic = %CC.loc12_32.2 (constants.%CC.474)] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness file.%Z.impl_witness_table.loc12, @CC.as.Z.impl(%E.loc12_14.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.1a2)] +// CHECK:STDOUT: %Z.impl_witness.loc12_39.2: = impl_witness %Z.impl_witness_table, @CC.as.Z.impl(%E.loc12_14.2) [symbolic = %Z.impl_witness.loc12_39.2 (constants.%Z.impl_witness.1a2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %CC.loc12_32.1 as %Z.ref { +// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (), @CC.as.Z.impl [concrete] +// CHECK:STDOUT: %Z.impl_witness.loc12_39.1: = impl_witness %Z.impl_witness_table, @CC.as.Z.impl(constants.%E) [symbolic = %Z.impl_witness.loc12_39.2 (constants.%Z.impl_witness.1a2)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Z.impl_witness.loc12 +// CHECK:STDOUT: witness = %Z.impl_witness.loc12_39.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1793,7 +1796,7 @@ fn F() { // CHECK:STDOUT: specific @DD.as.Z.impl(constants.%E) { // CHECK:STDOUT: %E.loc9_14.2 => constants.%E // CHECK:STDOUT: %DD.loc9_28.2 => constants.%DD.a29 -// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.718 +// CHECK:STDOUT: %Z.impl_witness.loc9_35.2 => constants.%Z.impl_witness.718 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -1813,7 +1816,7 @@ fn F() { // CHECK:STDOUT: %Z.lookup_impl_witness => constants.%Z.lookup_impl_witness // CHECK:STDOUT: %Z.facet.loc12_32.2 => constants.%Z.facet.67c // CHECK:STDOUT: %CC.loc12_32.2 => constants.%CC.474 -// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.1a2 +// CHECK:STDOUT: %Z.impl_witness.loc12_39.2 => constants.%Z.impl_witness.1a2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @DD(constants.%EE) { @@ -1823,7 +1826,7 @@ fn F() { // CHECK:STDOUT: specific @DD.as.Z.impl(constants.%EE) { // CHECK:STDOUT: %E.loc9_14.2 => constants.%EE // CHECK:STDOUT: %DD.loc9_28.2 => constants.%DD.2e1 -// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.8fc +// CHECK:STDOUT: %Z.impl_witness.loc9_35.2 => constants.%Z.impl_witness.8fc // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -1839,7 +1842,7 @@ fn F() { // CHECK:STDOUT: %Z.lookup_impl_witness => constants.%Z.impl_witness.8fc // CHECK:STDOUT: %Z.facet.loc12_32.2 => constants.%Z.facet.175 // CHECK:STDOUT: %CC.loc12_32.2 => constants.%CC.8cd -// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.12a +// CHECK:STDOUT: %Z.impl_witness.loc12_39.2 => constants.%Z.impl_witness.12a // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/generic/deduce_nested_facet_value.carbon b/toolchain/check/testdata/function/generic/deduce_nested_facet_value.carbon index 107b35451b3b6..dd85155ec8809 100644 --- a/toolchain/check/testdata/function/generic/deduce_nested_facet_value.carbon +++ b/toolchain/check/testdata/function/generic/deduce_nested_facet_value.carbon @@ -47,8 +47,8 @@ fn F() { // CHECK:STDOUT: %DD: type = class_type @DD [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %Y.impl_witness: = impl_witness file.%Y.impl_witness_table [concrete] -// CHECK:STDOUT: %W.impl_witness: = impl_witness file.%W.impl_witness_table [concrete] +// CHECK:STDOUT: %Y.impl_witness: = impl_witness @DD.as.Y.impl.%Y.impl_witness_table [concrete] +// CHECK:STDOUT: %W.impl_witness: = impl_witness @DD.as.W.impl.%W.impl_witness_table [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %D: %Y.type = symbolic_binding D, 0 [symbolic] @@ -75,13 +75,13 @@ fn F() { // CHECK:STDOUT: %Y.lookup_impl_witness: = lookup_impl_witness %E, @Y [symbolic] // CHECK:STDOUT: %Y.facet.e80: %Y.type = facet_value %E.binding.as_type, (%Y.lookup_impl_witness) [symbolic] // CHECK:STDOUT: %CC.8db: type = class_type @CC, @CC(%Y.facet.e80) [symbolic] -// CHECK:STDOUT: %Z.impl_witness.34f: = impl_witness file.%Z.impl_witness_table, @CC.as.Z.impl(%E) [symbolic] +// CHECK:STDOUT: %Z.impl_witness.34f: = impl_witness @CC.as.Z.impl.%Z.impl_witness_table, @CC.as.Z.impl(%E) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %Y.facet.68a: %Y.type = facet_value %DD, (%Y.impl_witness) [concrete] // CHECK:STDOUT: %CC.fc9: type = class_type @CC, @CC(%Y.facet.68a) [concrete] // CHECK:STDOUT: %facet_value: %facet_type = facet_value %DD, (%Y.impl_witness, %W.impl_witness) [concrete] -// CHECK:STDOUT: %Z.impl_witness.b71: = impl_witness file.%Z.impl_witness_table, @CC.as.Z.impl(%facet_value) [concrete] +// CHECK:STDOUT: %Z.impl_witness.b71: = impl_witness @CC.as.Z.impl.%Z.impl_witness_table, @CC.as.Z.impl(%facet_value) [concrete] // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %CC.fc9, (%Z.impl_witness.b71) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -114,14 +114,10 @@ fn F() { // CHECK:STDOUT: %DD.ref: type = name_ref DD, file.%DD.decl [concrete = constants.%DD] // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (), @DD.as.Y.impl [concrete] -// CHECK:STDOUT: %Y.impl_witness: = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness] // CHECK:STDOUT: impl_decl @DD.as.W.impl [concrete] {} { // CHECK:STDOUT: %DD.ref: type = name_ref DD, file.%DD.decl [concrete = constants.%DD] // CHECK:STDOUT: %W.ref: type = name_ref W, file.%W.decl [concrete = constants.%W.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %W.impl_witness_table = impl_witness_table (), @DD.as.W.impl [concrete] -// CHECK:STDOUT: %W.impl_witness: = impl_witness %W.impl_witness_table [concrete = constants.%W.impl_witness] // CHECK:STDOUT: %CC.decl: %CC.type = class_decl @CC [concrete = constants.%CC.generic] { // CHECK:STDOUT: %D.patt: %pattern_type.650 = symbolic_binding_pattern D, 0 [concrete] // CHECK:STDOUT: } { @@ -154,8 +150,6 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %E.loc19_14.1: %facet_type = symbolic_binding E, 0 [symbolic = %E.loc19_14.2 (constants.%E)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (), @CC.as.Z.impl [concrete] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness %Z.impl_witness_table, @CC.as.Z.impl(constants.%E) [symbolic = @CC.as.Z.impl.%Z.impl_witness (constants.%Z.impl_witness.34f)] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -190,13 +184,19 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @DD.as.Y.impl: %DD.ref as %Y.ref { +// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (), @DD.as.Y.impl [concrete] +// CHECK:STDOUT: %Y.impl_witness: = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Y.impl_witness +// CHECK:STDOUT: witness = %Y.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @DD.as.W.impl: %DD.ref as %W.ref { +// CHECK:STDOUT: %W.impl_witness_table = impl_witness_table (), @DD.as.W.impl [concrete] +// CHECK:STDOUT: %W.impl_witness: = impl_witness %W.impl_witness_table [concrete = constants.%W.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%W.impl_witness +// CHECK:STDOUT: witness = %W.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @CC.as.Z.impl(%E.loc19_14.1: %facet_type) { @@ -205,13 +205,16 @@ fn F() { // CHECK:STDOUT: %Y.lookup_impl_witness: = lookup_impl_witness %E.loc19_14.2, @Y [symbolic = %Y.lookup_impl_witness (constants.%Y.lookup_impl_witness)] // CHECK:STDOUT: %Y.facet.loc19_29.2: %Y.type = facet_value %E.binding.as_type, (%Y.lookup_impl_witness) [symbolic = %Y.facet.loc19_29.2 (constants.%Y.facet.e80)] // CHECK:STDOUT: %CC.loc19_29.2: type = class_type @CC, @CC(%Y.facet.loc19_29.2) [symbolic = %CC.loc19_29.2 (constants.%CC.8db)] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness file.%Z.impl_witness_table, @CC.as.Z.impl(%E.loc19_14.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.34f)] +// CHECK:STDOUT: %Z.impl_witness.loc19_36.2: = impl_witness %Z.impl_witness_table, @CC.as.Z.impl(%E.loc19_14.2) [symbolic = %Z.impl_witness.loc19_36.2 (constants.%Z.impl_witness.34f)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %CC.loc19_29.1 as %Z.ref { +// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (), @CC.as.Z.impl [concrete] +// CHECK:STDOUT: %Z.impl_witness.loc19_36.1: = impl_witness %Z.impl_witness_table, @CC.as.Z.impl(constants.%E) [symbolic = %Z.impl_witness.loc19_36.2 (constants.%Z.impl_witness.34f)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Z.impl_witness +// CHECK:STDOUT: witness = %Z.impl_witness.loc19_36.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -264,7 +267,7 @@ fn F() { // CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.lookup_impl_witness // CHECK:STDOUT: %Y.facet.loc19_29.2 => constants.%Y.facet.e80 // CHECK:STDOUT: %CC.loc19_29.2 => constants.%CC.8db -// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.34f +// CHECK:STDOUT: %Z.impl_witness.loc19_36.2 => constants.%Z.impl_witness.34f // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CC(constants.%Y.facet.68a) { @@ -277,7 +280,7 @@ fn F() { // CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.impl_witness // CHECK:STDOUT: %Y.facet.loc19_29.2 => constants.%Y.facet.68a // CHECK:STDOUT: %CC.loc19_29.2 => constants.%CC.fc9 -// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.b71 +// CHECK:STDOUT: %Z.impl_witness.loc19_36.2 => constants.%Z.impl_witness.b71 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/generic/dot_self_symbolic_type.carbon b/toolchain/check/testdata/generic/dot_self_symbolic_type.carbon index daf597a24b49e..37427345b49e7 100644 --- a/toolchain/check/testdata/generic/dot_self_symbolic_type.carbon +++ b/toolchain/check/testdata/generic/dot_self_symbolic_type.carbon @@ -330,7 +330,7 @@ fn H(T:! type) { // CHECK:STDOUT: %BB.binding.as_type: type = symbolic_binding_type BB, 1, %BB.62b [symbolic] // CHECK:STDOUT: %ptr.e8f8f9.1: type = ptr_type %AA [symbolic] // CHECK:STDOUT: %B.type.8d1021.1: type = facet_type <@B, @B(%ptr.e8f8f9.1)> [symbolic] -// CHECK:STDOUT: %B.impl_witness.217: = impl_witness file.%B.impl_witness_table.loc9, @BB.binding.as_type.as.B.impl(%AA, %BB.62b) [symbolic] +// CHECK:STDOUT: %B.impl_witness.217: = impl_witness @BB.binding.as_type.as.B.impl.%B.impl_witness_table, @BB.binding.as_type.as.B.impl(%AA, %BB.62b) [symbolic] // CHECK:STDOUT: %require_complete.5d6507.1: = require_complete_type %B.type.8d1021.1 [symbolic] // CHECK:STDOUT: %DD: type = symbolic_binding DD, 0 [symbolic] // CHECK:STDOUT: %D.bd6: type = class_type @D, @D(%DD) [symbolic] @@ -388,8 +388,6 @@ fn H(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %BB.loc9_25.1: @BB.binding.as_type.as.B.impl.%A_where.type (%A_where.type.1e830c.1) = symbolic_binding BB, 1 [symbolic = %BB.loc9_25.2 (constants.%BB.62b)] // CHECK:STDOUT: } -// CHECK:STDOUT: %B.impl_witness_table.loc9 = impl_witness_table (), @BB.binding.as_type.as.B.impl [concrete] -// CHECK:STDOUT: %B.impl_witness.loc9: = impl_witness %B.impl_witness_table.loc9, @BB.binding.as_type.as.B.impl(constants.%AA, constants.%BB.62b) [symbolic = @BB.binding.as_type.as.B.impl.%B.impl_witness (constants.%B.impl_witness.217)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @BB.binding.as_type.as.B.impl(%AA.loc9_14.1: type, %BB.loc9_25.1: @BB.binding.as_type.as.B.impl.%A_where.type (%A_where.type.1e830c.1)) { @@ -408,14 +406,17 @@ fn H(T:! type) { // CHECK:STDOUT: %BB.binding.as_type: type = symbolic_binding_type BB, 1, %BB.loc9_25.2 [symbolic = %BB.binding.as_type (constants.%BB.binding.as_type)] // CHECK:STDOUT: %ptr.loc9_61.2: type = ptr_type %AA.loc9_14.2 [symbolic = %ptr.loc9_61.2 (constants.%ptr.e8f8f9.1)] // CHECK:STDOUT: %B.type.loc9_62.2: type = facet_type <@B, @B(%ptr.loc9_61.2)> [symbolic = %B.type.loc9_62.2 (constants.%B.type.8d1021.1)] -// CHECK:STDOUT: %B.impl_witness: = impl_witness file.%B.impl_witness_table.loc9, @BB.binding.as_type.as.B.impl(%AA.loc9_14.2, %BB.loc9_25.2) [symbolic = %B.impl_witness (constants.%B.impl_witness.217)] +// CHECK:STDOUT: %B.impl_witness.loc9_64.2: = impl_witness %B.impl_witness_table, @BB.binding.as_type.as.B.impl(%AA.loc9_14.2, %BB.loc9_25.2) [symbolic = %B.impl_witness.loc9_64.2 (constants.%B.impl_witness.217)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc9_62: = require_complete_type %B.type.loc9_62.2 [symbolic = %require_complete.loc9_62 (constants.%require_complete.5d6507.1)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc9_51 as %B.type.loc9_62.1 { +// CHECK:STDOUT: %B.impl_witness_table = impl_witness_table (), @BB.binding.as_type.as.B.impl [concrete] +// CHECK:STDOUT: %B.impl_witness.loc9_64.1: = impl_witness %B.impl_witness_table, @BB.binding.as_type.as.B.impl(constants.%AA, constants.%BB.62b) [symbolic = %B.impl_witness.loc9_64.2 (constants.%B.impl_witness.217)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%B.impl_witness.loc9 +// CHECK:STDOUT: witness = %B.impl_witness.loc9_64.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -477,7 +478,7 @@ fn H(T:! type) { // CHECK:STDOUT: %BB.binding.as_type => constants.%BB.binding.as_type // CHECK:STDOUT: %ptr.loc9_61.2 => constants.%ptr.e8f8f9.1 // CHECK:STDOUT: %B.type.loc9_62.2 => constants.%B.type.8d1021.1 -// CHECK:STDOUT: %B.impl_witness => constants.%B.impl_witness.217 +// CHECK:STDOUT: %B.impl_witness.loc9_64.2 => constants.%B.impl_witness.217 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @D(constants.%DD) { diff --git a/toolchain/check/testdata/generic/template/convert.carbon b/toolchain/check/testdata/generic/template/convert.carbon index 9a471a2ad67af..d56373203120a 100644 --- a/toolchain/check/testdata/generic/template/convert.carbon +++ b/toolchain/check/testdata/generic/template/convert.carbon @@ -98,7 +98,7 @@ fn Test(d: D) -> i32 { // 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] -// CHECK:STDOUT: %ImplicitAs.impl_witness.6fb: = impl_witness @C.%ImplicitAs.impl_witness_table [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.6fb: = impl_witness @C.as.ImplicitAs.impl.%ImplicitAs.impl_witness_table [concrete] // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete] // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type: type = fn_type @C.as.ImplicitAs.impl.Convert [concrete] @@ -220,10 +220,12 @@ fn Test(d: D) -> i32 { // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness.6fb] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %C.as.ImplicitAs.impl.Convert.decl -// CHECK:STDOUT: witness = @C.%ImplicitAs.impl_witness +// CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -238,8 +240,6 @@ fn Test(d: D) -> i32 { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32)> [concrete = constants.%ImplicitAs.type.d14] // CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (@C.as.ImplicitAs.impl.%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness.6fb] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%struct_type.n [concrete = constants.%complete_type.54b] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/assoc_const_self.carbon b/toolchain/check/testdata/impl/assoc_const_self.carbon index 914620f8f51ee..aa8d6f641b10b 100644 --- a/toolchain/check/testdata/impl/assoc_const_self.carbon +++ b/toolchain/check/testdata/impl/assoc_const_self.carbon @@ -117,7 +117,7 @@ fn CallF() { // CHECK:STDOUT: %require_complete.a39: = require_complete_type %.Self.binding.as_type [symbolic_self] // CHECK:STDOUT: %impl.elem0: %.Self.binding.as_type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %I_where.type.1e8: type = facet_type <@I where %impl.elem0 = %empty_struct> [concrete] -// CHECK:STDOUT: %I.impl_witness.8ad: = impl_witness file.%I.impl_witness_table.loc8 [concrete] +// CHECK:STDOUT: %I.impl_witness.8ad: = impl_witness @empty_struct_type.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %I.facet.03f: %I.type = facet_value %empty_struct_type, (%I.impl_witness.8ad) [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] @@ -126,7 +126,7 @@ fn CallF() { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %I_where.type.583: type = facet_type <@I where %impl.elem0 = %int_0.5c6> [concrete] -// CHECK:STDOUT: %I.impl_witness.d2b: = impl_witness file.%I.impl_witness_table.loc10 [concrete] +// CHECK:STDOUT: %I.impl_witness.d2b: = impl_witness @i32.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %I.facet.55a: %I.type = facet_value %i32, (%I.impl_witness.d2b) [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [concrete] @@ -186,9 +186,6 @@ fn CallF() { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc8_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table.loc8 = impl_witness_table (%impl_witness_assoc_constant.loc8), @empty_struct_type.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness.loc8: = impl_witness %I.impl_witness_table.loc8 [concrete = constants.%I.impl_witness.8ad] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc8: %empty_struct_type = impl_witness_assoc_constant constants.%empty_struct [concrete = constants.%empty_struct] // CHECK:STDOUT: impl_decl @i32.as.I.impl [concrete] {} { // 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] @@ -198,23 +195,13 @@ fn CallF() { // CHECK:STDOUT: %V.ref: %I.assoc_type = name_ref V, @V.%assoc0 [concrete = constants.%assoc0.4e5] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type] // CHECK:STDOUT: %.loc10_21: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type] -// CHECK:STDOUT: %impl.elem0: %.Self.binding.as_type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0.loc10_21: %.Self.binding.as_type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] -// CHECK:STDOUT: %.loc10_15: type = where_expr %.Self [concrete = constants.%I_where.type.583] { +// CHECK:STDOUT: %.loc10_15.1: type = where_expr %.Self [concrete = constants.%I_where.type.583] { // CHECK:STDOUT: requirement_base_facet_type constants.%I.type -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %int_0 +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_21, %int_0 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table.loc10 = impl_witness_table (%impl_witness_assoc_constant.loc10), @i32.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness.loc10: = impl_witness %I.impl_witness_table.loc10 [concrete = constants.%I.impl_witness.d2b] -// CHECK:STDOUT: %impl.elem0: %.dbf = impl_witness_access constants.%ImplicitAs.impl_witness.57f, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0] -// CHECK:STDOUT: %bound_method.loc10_15.1: = bound_method constants.%int_0.5c6, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc10_15.2: = bound_method constants.%int_0.5c6, %specific_fn [concrete = constants.%bound_method] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc10_15.2(constants.%int_0.5c6) [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc10_15.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc10_15.2: %i32 = converted constants.%int_0.5c6, %.loc10_15.1 [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc10: %i32 = impl_witness_assoc_constant constants.%int_0.6a9 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -240,13 +227,28 @@ fn CallF() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc8_7.2 as %.loc8_14 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @empty_struct_type.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.8ad] +// CHECK:STDOUT: %impl_witness_assoc_constant: %empty_struct_type = impl_witness_assoc_constant constants.%empty_struct [concrete = constants.%empty_struct] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness.loc8 +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @i32.as.I.impl: %i32 as %.loc10_15 { +// CHECK:STDOUT: impl @i32.as.I.impl: %i32 as %.loc10_15.1 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @i32.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.d2b] +// CHECK:STDOUT: %impl.elem0.loc10_15: %.dbf = impl_witness_access constants.%ImplicitAs.impl_witness.57f, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0] +// CHECK:STDOUT: %bound_method.loc10_15.1: = bound_method constants.%int_0.5c6, %impl.elem0.loc10_15 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc10_15, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_15.2: = bound_method constants.%int_0.5c6, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc10_15.2(constants.%int_0.5c6) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc10_15.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc10_15.3: %i32 = converted constants.%int_0.5c6, %.loc10_15.2 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %impl_witness_assoc_constant: %i32 = impl_witness_assoc_constant constants.%int_0.6a9 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness.loc10 +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @V(constants.%Self.dba) { @@ -291,7 +293,7 @@ fn CallF() { // CHECK:STDOUT: %impl.elem0: %.Self.binding.as_type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %int_0> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @empty_struct_type.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %I.facet: %I.type = facet_value %empty_struct_type, (%I.impl_witness) [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] @@ -325,15 +327,11 @@ fn CallF() { // CHECK:STDOUT: %.loc15_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type] // CHECK:STDOUT: %impl.elem0: %.Self.binding.as_type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc15_14: type = where_expr %.Self [concrete = constants.%I_where.type] { +// CHECK:STDOUT: %.loc15_14.1: type = where_expr %.Self [concrete = constants.%I_where.type] { // CHECK:STDOUT: requirement_base_facet_type constants.%I.type // CHECK:STDOUT: requirement_rewrite %impl.elem0, %int_0 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @empty_struct_type.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] -// CHECK:STDOUT: %.loc15: %empty_struct_type = converted constants.%int_0, [concrete = ] -// CHECK:STDOUT: %impl_witness_assoc_constant: = impl_witness_assoc_constant [concrete = ] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -358,9 +356,14 @@ fn CallF() { // CHECK:STDOUT: assoc_const V:! @V.%Self.binding.as_type (%Self.binding.as_type.a79); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc15_7.2 as %.loc15_14 { +// CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc15_7.2 as %.loc15_14.1 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @empty_struct_type.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: %.loc15_14.2: %empty_struct_type = converted constants.%int_0, [concrete = ] +// CHECK:STDOUT: %impl_witness_assoc_constant: = impl_witness_assoc_constant [concrete = ] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @V(constants.%Self.dba) { @@ -398,7 +401,7 @@ fn CallF() { // 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.9e2: type = facet_type <@ImplicitAs, @ImplicitAs(%C)> [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness file.%ImplicitAs.impl_witness_table [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness @empty_tuple.type.as.ImplicitAs.impl.%ImplicitAs.impl_witness_table [concrete] // CHECK:STDOUT: %ImplicitAs.Convert.type.f13: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%C) [concrete] // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete] @@ -413,7 +416,7 @@ fn CallF() { // CHECK:STDOUT: %require_complete.a39: = require_complete_type %.Self.binding.as_type [symbolic_self] // CHECK:STDOUT: %impl.elem0: %.Self.binding.as_type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete] // CHECK:STDOUT: %.980: type = fn_type_with_self_type %ImplicitAs.Convert.type.f13, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %empty_tuple.type.as.ImplicitAs.impl.Convert.bound: = bound_method %empty_tuple, %empty_tuple.type.as.ImplicitAs.impl.Convert [concrete] @@ -445,8 +448,6 @@ fn CallF() { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%C)> [concrete = constants.%ImplicitAs.type.9e2] // CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (@empty_tuple.type.as.ImplicitAs.impl.%empty_tuple.type.as.ImplicitAs.impl.Convert.decl), @empty_tuple.type.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness] // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] @@ -455,25 +456,15 @@ fn CallF() { // CHECK:STDOUT: %V.ref: %I.assoc_type = name_ref V, @V.%assoc0 [concrete = constants.%assoc0.4e5] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type] // CHECK:STDOUT: %.loc18_19: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type] -// CHECK:STDOUT: %impl.elem0: %.Self.binding.as_type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0.loc18_19: %.Self.binding.as_type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] // CHECK:STDOUT: %.loc18_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc18_25.2: %empty_tuple.type = converted %.loc18_25.1, %empty_tuple [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc18_13: type = where_expr %.Self [concrete = constants.%I_where.type] { +// CHECK:STDOUT: %.loc18_13.1: type = where_expr %.Self [concrete = constants.%I_where.type] { // CHECK:STDOUT: requirement_base_facet_type constants.%I.type -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc18_25.2 +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc18_19, %.loc18_25.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] -// CHECK:STDOUT: %impl.elem0: %.980 = impl_witness_access constants.%ImplicitAs.impl_witness, element0 [concrete = constants.%empty_tuple.type.as.ImplicitAs.impl.Convert] -// CHECK:STDOUT: %bound_method: = bound_method constants.%empty_tuple, %impl.elem0 [concrete = constants.%empty_tuple.type.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %.loc18_13.1: ref %C = temporary_storage -// CHECK:STDOUT: %empty_tuple.type.as.ImplicitAs.impl.Convert.call: init %C = call %bound_method(constants.%empty_tuple) to %.loc18_13.1 -// CHECK:STDOUT: %.loc18_13.2: init %C = converted constants.%empty_tuple, %empty_tuple.type.as.ImplicitAs.impl.Convert.call -// CHECK:STDOUT: %.loc18_13.3: ref %C = temporary %.loc18_13.1, %.loc18_13.2 -// CHECK:STDOUT: %.loc18_13.4: %C = acquire_value %.loc18_13.3 -// CHECK:STDOUT: %impl_witness_assoc_constant: = impl_witness_assoc_constant [concrete = ] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -515,16 +506,29 @@ fn CallF() { // CHECK:STDOUT: %return.param: ref %C = out_param call_param1 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%empty_tuple.type.as.ImplicitAs.impl.Convert.decl), @empty_tuple.type.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = // CHECK:STDOUT: .Convert = %empty_tuple.type.as.ImplicitAs.impl.Convert.decl -// CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness +// CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @C.as.I.impl: %C.ref as %.loc18_13 { +// CHECK:STDOUT: impl @C.as.I.impl: %C.ref as %.loc18_13.1 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: %impl.elem0.loc18_13: %.980 = impl_witness_access constants.%ImplicitAs.impl_witness, element0 [concrete = constants.%empty_tuple.type.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %bound_method: = bound_method constants.%empty_tuple, %impl.elem0.loc18_13 [concrete = constants.%empty_tuple.type.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %.loc18_13.2: ref %C = temporary_storage +// CHECK:STDOUT: %empty_tuple.type.as.ImplicitAs.impl.Convert.call: init %C = call %bound_method(constants.%empty_tuple) to %.loc18_13.2 +// CHECK:STDOUT: %.loc18_13.3: init %C = converted constants.%empty_tuple, %empty_tuple.type.as.ImplicitAs.impl.Convert.call +// CHECK:STDOUT: %.loc18_13.4: ref %C = temporary %.loc18_13.2, %.loc18_13.3 +// CHECK:STDOUT: %.loc18_13.5: %C = acquire_value %.loc18_13.4 +// CHECK:STDOUT: %impl_witness_assoc_constant: = impl_witness_assoc_constant [concrete = ] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/impl/basic.carbon b/toolchain/check/testdata/impl/basic.carbon index 9a1b6978b34b9..2b6820ecd6946 100644 --- a/toolchain/check/testdata/impl/basic.carbon +++ b/toolchain/check/testdata/impl/basic.carbon @@ -115,7 +115,7 @@ final impl C(invalid) as I {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %Simple.type: type = facet_type <@Simple> [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %Simple.impl_witness: = impl_witness file.%Simple.impl_witness_table [concrete] +// CHECK:STDOUT: %Simple.impl_witness: = impl_witness @C.as.Simple.impl.%Simple.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.Simple.impl.F.type: type = fn_type @C.as.Simple.impl.F [concrete] // CHECK:STDOUT: %C.as.Simple.impl.F: %C.as.Simple.impl.F.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -125,16 +125,16 @@ final impl C(invalid) as I {} // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [concrete = constants.%Simple.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Simple.impl_witness_table = impl_witness_table (@C.as.Simple.impl.%C.as.Simple.impl.F.decl), @C.as.Simple.impl [concrete] -// CHECK:STDOUT: %Simple.impl_witness: = impl_witness %Simple.impl_witness_table [concrete = constants.%Simple.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.Simple.impl: %C.ref as %Simple.ref { // CHECK:STDOUT: %C.as.Simple.impl.F.decl: %C.as.Simple.impl.F.type = fn_decl @C.as.Simple.impl.F [concrete = constants.%C.as.Simple.impl.F] {} {} +// CHECK:STDOUT: %Simple.impl_witness_table = impl_witness_table (%C.as.Simple.impl.F.decl), @C.as.Simple.impl [concrete] +// CHECK:STDOUT: %Simple.impl_witness: = impl_witness %Simple.impl_witness_table [concrete = constants.%Simple.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %C.as.Simple.impl.F.decl -// CHECK:STDOUT: witness = file.%Simple.impl_witness +// CHECK:STDOUT: witness = %Simple.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.Simple.impl.F() { diff --git a/toolchain/check/testdata/impl/compound.carbon b/toolchain/check/testdata/impl/compound.carbon index fc9cbdc3087a1..99022bfd74799 100644 --- a/toolchain/check/testdata/impl/compound.carbon +++ b/toolchain/check/testdata/impl/compound.carbon @@ -231,7 +231,7 @@ fn InstanceCallFail() { // CHECK:STDOUT: %assoc0: %NonInstance1.assoc_type = assoc_entity element0, @NonInstance1.%NonInstance1.F1.decl [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_tuple.type} [concrete] -// CHECK:STDOUT: %NonInstance1.impl_witness: = impl_witness file.%NonInstance1.impl_witness_table [concrete] +// CHECK:STDOUT: %NonInstance1.impl_witness: = impl_witness @struct_type.a.as.NonInstance1.impl.%NonInstance1.impl_witness_table [concrete] // CHECK:STDOUT: %struct_type.a.as.NonInstance1.impl.F1.type: type = fn_type @struct_type.a.as.NonInstance1.impl.F1 [concrete] // CHECK:STDOUT: %struct_type.a.as.NonInstance1.impl.F1: %struct_type.a.as.NonInstance1.impl.F1.type = struct_value () [concrete] // CHECK:STDOUT: %NonInstance1.facet: %NonInstance1.type = facet_value %struct_type.a, (%NonInstance1.impl_witness) [concrete] @@ -252,8 +252,6 @@ fn InstanceCallFail() { // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_tuple.type} [concrete = constants.%struct_type.a] // CHECK:STDOUT: %NonInstance1.ref: type = name_ref NonInstance1, file.%NonInstance1.decl [concrete = constants.%NonInstance1.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %NonInstance1.impl_witness_table = impl_witness_table (@struct_type.a.as.NonInstance1.impl.%struct_type.a.as.NonInstance1.impl.F1.decl), @struct_type.a.as.NonInstance1.impl [concrete] -// CHECK:STDOUT: %NonInstance1.impl_witness: = impl_witness %NonInstance1.impl_witness_table [concrete = constants.%NonInstance1.impl_witness] // CHECK:STDOUT: %NonInstanceCall1.decl: %NonInstanceCall1.type = fn_decl @NonInstanceCall1 [concrete = constants.%NonInstanceCall1] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -272,10 +270,12 @@ fn InstanceCallFail() { // CHECK:STDOUT: // CHECK:STDOUT: impl @struct_type.a.as.NonInstance1.impl: %struct_type.a as %NonInstance1.ref { // CHECK:STDOUT: %struct_type.a.as.NonInstance1.impl.F1.decl: %struct_type.a.as.NonInstance1.impl.F1.type = fn_decl @struct_type.a.as.NonInstance1.impl.F1 [concrete = constants.%struct_type.a.as.NonInstance1.impl.F1] {} {} +// CHECK:STDOUT: %NonInstance1.impl_witness_table = impl_witness_table (%struct_type.a.as.NonInstance1.impl.F1.decl), @struct_type.a.as.NonInstance1.impl [concrete] +// CHECK:STDOUT: %NonInstance1.impl_witness: = impl_witness %NonInstance1.impl_witness_table [concrete = constants.%NonInstance1.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F1 = %struct_type.a.as.NonInstance1.impl.F1.decl -// CHECK:STDOUT: witness = file.%NonInstance1.impl_witness +// CHECK:STDOUT: witness = %NonInstance1.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @NonInstance1.F1(@NonInstance1.%Self: %NonInstance1.type) { @@ -317,7 +317,7 @@ fn InstanceCallFail() { // CHECK:STDOUT: %assoc0.a61: %NonInstance2.assoc_type = assoc_entity element0, @NonInstance2.%NonInstance2.F2.decl [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %struct_type.b: type = struct_type {.b: %empty_tuple.type} [concrete] -// CHECK:STDOUT: %NonInstance2.impl_witness: = impl_witness file.%NonInstance2.impl_witness_table [concrete] +// CHECK:STDOUT: %NonInstance2.impl_witness: = impl_witness @struct_type.b.as.NonInstance2.impl.%NonInstance2.impl_witness_table [concrete] // CHECK:STDOUT: %struct_type.b.as.NonInstance2.impl.F2.type: type = fn_type @struct_type.b.as.NonInstance2.impl.F2 [concrete] // CHECK:STDOUT: %struct_type.b.as.NonInstance2.impl.F2: %struct_type.b.as.NonInstance2.impl.F2.type = struct_value () [concrete] // CHECK:STDOUT: %NonInstance2.facet: %NonInstance2.type = facet_value %struct_type.b, (%NonInstance2.impl_witness) [concrete] @@ -375,8 +375,6 @@ fn InstanceCallFail() { // CHECK:STDOUT: %struct_type.b: type = struct_type {.b: %empty_tuple.type} [concrete = constants.%struct_type.b] // CHECK:STDOUT: %NonInstance2.ref: type = name_ref NonInstance2, file.%NonInstance2.decl [concrete = constants.%NonInstance2.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %NonInstance2.impl_witness_table = impl_witness_table (@struct_type.b.as.NonInstance2.impl.%struct_type.b.as.NonInstance2.impl.F2.decl), @struct_type.b.as.NonInstance2.impl [concrete] -// CHECK:STDOUT: %NonInstance2.impl_witness: = impl_witness %NonInstance2.impl_witness_table [concrete = constants.%NonInstance2.impl_witness] // CHECK:STDOUT: %NonInstanceCall2.decl: %NonInstanceCall2.type = fn_decl @NonInstanceCall2 [concrete = constants.%NonInstanceCall2] { // CHECK:STDOUT: %n.patt: %pattern_type.d5c = value_binding_pattern n [concrete] // CHECK:STDOUT: %n.param_patt: %pattern_type.d5c = value_param_pattern %n.patt, call_param0 [concrete] @@ -427,10 +425,12 @@ fn InstanceCallFail() { // CHECK:STDOUT: // CHECK:STDOUT: impl @struct_type.b.as.NonInstance2.impl: %struct_type.b as %NonInstance2.ref { // CHECK:STDOUT: %struct_type.b.as.NonInstance2.impl.F2.decl: %struct_type.b.as.NonInstance2.impl.F2.type = fn_decl @struct_type.b.as.NonInstance2.impl.F2 [concrete = constants.%struct_type.b.as.NonInstance2.impl.F2] {} {} +// CHECK:STDOUT: %NonInstance2.impl_witness_table = impl_witness_table (%struct_type.b.as.NonInstance2.impl.F2.decl), @struct_type.b.as.NonInstance2.impl [concrete] +// CHECK:STDOUT: %NonInstance2.impl_witness: = impl_witness %NonInstance2.impl_witness_table [concrete = constants.%NonInstance2.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F2 = %struct_type.b.as.NonInstance2.impl.F2.decl -// CHECK:STDOUT: witness = file.%NonInstance2.impl_witness +// CHECK:STDOUT: witness = %NonInstance2.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @NonInstance2.F2(@NonInstance2.%Self: %NonInstance2.type) { @@ -503,7 +503,7 @@ fn InstanceCallFail() { // CHECK:STDOUT: %assoc0.1b9: %NonInstance3.assoc_type = assoc_entity element0, @NonInstance3.%NonInstance3.F3.decl [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %empty_tuple.type} [concrete] -// CHECK:STDOUT: %NonInstance3.impl_witness: = impl_witness file.%NonInstance3.impl_witness_table [concrete] +// CHECK:STDOUT: %NonInstance3.impl_witness: = impl_witness @struct_type.c.as.NonInstance3.impl.%NonInstance3.impl_witness_table [concrete] // CHECK:STDOUT: %struct_type.c.as.NonInstance3.impl.F3.type: type = fn_type @struct_type.c.as.NonInstance3.impl.F3 [concrete] // CHECK:STDOUT: %struct_type.c.as.NonInstance3.impl.F3: %struct_type.c.as.NonInstance3.impl.F3.type = struct_value () [concrete] // CHECK:STDOUT: %NonInstance3.facet: %NonInstance3.type = facet_value %struct_type.c, (%NonInstance3.impl_witness) [concrete] @@ -562,8 +562,6 @@ fn InstanceCallFail() { // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %empty_tuple.type} [concrete = constants.%struct_type.c] // CHECK:STDOUT: %NonInstance3.ref: type = name_ref NonInstance3, file.%NonInstance3.decl [concrete = constants.%NonInstance3.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %NonInstance3.impl_witness_table = impl_witness_table (@struct_type.c.as.NonInstance3.impl.%struct_type.c.as.NonInstance3.impl.F3.decl), @struct_type.c.as.NonInstance3.impl [concrete] -// CHECK:STDOUT: %NonInstance3.impl_witness: = impl_witness %NonInstance3.impl_witness_table [concrete = constants.%NonInstance3.impl_witness] // CHECK:STDOUT: %NonInstanceCallIndirect.decl: %NonInstanceCallIndirect.type = fn_decl @NonInstanceCallIndirect [concrete = constants.%NonInstanceCallIndirect] { // CHECK:STDOUT: %p.patt: %pattern_type.5f5 = value_binding_pattern p [concrete] // CHECK:STDOUT: %p.param_patt: %pattern_type.5f5 = value_param_pattern %p.patt, call_param0 [concrete] @@ -615,10 +613,12 @@ fn InstanceCallFail() { // CHECK:STDOUT: // CHECK:STDOUT: impl @struct_type.c.as.NonInstance3.impl: %struct_type.c as %NonInstance3.ref { // CHECK:STDOUT: %struct_type.c.as.NonInstance3.impl.F3.decl: %struct_type.c.as.NonInstance3.impl.F3.type = fn_decl @struct_type.c.as.NonInstance3.impl.F3 [concrete = constants.%struct_type.c.as.NonInstance3.impl.F3] {} {} +// CHECK:STDOUT: %NonInstance3.impl_witness_table = impl_witness_table (%struct_type.c.as.NonInstance3.impl.F3.decl), @struct_type.c.as.NonInstance3.impl [concrete] +// CHECK:STDOUT: %NonInstance3.impl_witness: = impl_witness %NonInstance3.impl_witness_table [concrete = constants.%NonInstance3.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F3 = %struct_type.c.as.NonInstance3.impl.F3.decl -// CHECK:STDOUT: witness = file.%NonInstance3.impl_witness +// CHECK:STDOUT: witness = %NonInstance3.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @NonInstance3.F3(@NonInstance3.%Self: %NonInstance3.type) { @@ -694,7 +694,7 @@ fn InstanceCallFail() { // CHECK:STDOUT: %assoc0: %Instance1.assoc_type = assoc_entity element0, @Instance1.%Instance1.G1.decl [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %struct_type.d: type = struct_type {.d: %empty_tuple.type} [concrete] -// CHECK:STDOUT: %Instance1.impl_witness: = impl_witness file.%Instance1.impl_witness_table [concrete] +// CHECK:STDOUT: %Instance1.impl_witness: = impl_witness @struct_type.d.as.Instance1.impl.%Instance1.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.515: type = pattern_type %struct_type.d [concrete] // CHECK:STDOUT: %struct_type.d.as.Instance1.impl.G1.type: type = fn_type @struct_type.d.as.Instance1.impl.G1 [concrete] // CHECK:STDOUT: %struct_type.d.as.Instance1.impl.G1: %struct_type.d.as.Instance1.impl.G1.type = struct_value () [concrete] @@ -722,8 +722,6 @@ fn InstanceCallFail() { // CHECK:STDOUT: %struct_type.d: type = struct_type {.d: %empty_tuple.type} [concrete = constants.%struct_type.d] // CHECK:STDOUT: %Instance1.ref: type = name_ref Instance1, file.%Instance1.decl [concrete = constants.%Instance1.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Instance1.impl_witness_table = impl_witness_table (@struct_type.d.as.Instance1.impl.%struct_type.d.as.Instance1.impl.G1.decl), @struct_type.d.as.Instance1.impl [concrete] -// CHECK:STDOUT: %Instance1.impl_witness: = impl_witness %Instance1.impl_witness_table [concrete = constants.%Instance1.impl_witness] // CHECK:STDOUT: %InstanceCall.decl: %InstanceCall.type = fn_decl @InstanceCall [concrete = constants.%InstanceCall] { // CHECK:STDOUT: %n.patt: %pattern_type.515 = value_binding_pattern n [concrete] // CHECK:STDOUT: %n.param_patt: %pattern_type.515 = value_param_pattern %n.patt, call_param0 [concrete] @@ -784,10 +782,12 @@ fn InstanceCallFail() { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @struct_type.d.as.Instance1.impl.%struct_type.d [concrete = constants.%struct_type.d] // CHECK:STDOUT: %self: %struct_type.d = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Instance1.impl_witness_table = impl_witness_table (%struct_type.d.as.Instance1.impl.G1.decl), @struct_type.d.as.Instance1.impl [concrete] +// CHECK:STDOUT: %Instance1.impl_witness: = impl_witness %Instance1.impl_witness_table [concrete = constants.%Instance1.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G1 = %struct_type.d.as.Instance1.impl.G1.decl -// CHECK:STDOUT: witness = file.%Instance1.impl_witness +// CHECK:STDOUT: witness = %Instance1.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Instance1.G1(@Instance1.%Self: %Instance1.type) { @@ -857,7 +857,7 @@ fn InstanceCallFail() { // CHECK:STDOUT: %assoc0: %Instance2.assoc_type = assoc_entity element0, @Instance2.%Instance2.G2.decl [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %struct_type.e: type = struct_type {.e: %empty_tuple.type} [concrete] -// CHECK:STDOUT: %Instance2.impl_witness: = impl_witness file.%Instance2.impl_witness_table [concrete] +// CHECK:STDOUT: %Instance2.impl_witness: = impl_witness @struct_type.e.as.Instance2.impl.%Instance2.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.efd: type = pattern_type %struct_type.e [concrete] // CHECK:STDOUT: %struct_type.e.as.Instance2.impl.G2.type: type = fn_type @struct_type.e.as.Instance2.impl.G2 [concrete] // CHECK:STDOUT: %struct_type.e.as.Instance2.impl.G2: %struct_type.e.as.Instance2.impl.G2.type = struct_value () [concrete] @@ -878,8 +878,6 @@ fn InstanceCallFail() { // CHECK:STDOUT: %struct_type.e: type = struct_type {.e: %empty_tuple.type} [concrete = constants.%struct_type.e] // CHECK:STDOUT: %Instance2.ref: type = name_ref Instance2, file.%Instance2.decl [concrete = constants.%Instance2.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Instance2.impl_witness_table = impl_witness_table (@struct_type.e.as.Instance2.impl.%struct_type.e.as.Instance2.impl.G2.decl), @struct_type.e.as.Instance2.impl [concrete] -// CHECK:STDOUT: %Instance2.impl_witness: = impl_witness %Instance2.impl_witness_table [concrete = constants.%Instance2.impl_witness] // CHECK:STDOUT: %InstanceCallFail.decl: %InstanceCallFail.type = fn_decl @InstanceCallFail [concrete = constants.%InstanceCallFail] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -916,10 +914,12 @@ fn InstanceCallFail() { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @struct_type.e.as.Instance2.impl.%struct_type.e [concrete = constants.%struct_type.e] // CHECK:STDOUT: %self: %struct_type.e = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Instance2.impl_witness_table = impl_witness_table (%struct_type.e.as.Instance2.impl.G2.decl), @struct_type.e.as.Instance2.impl [concrete] +// CHECK:STDOUT: %Instance2.impl_witness: = impl_witness %Instance2.impl_witness_table [concrete = constants.%Instance2.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G2 = %struct_type.e.as.Instance2.impl.G2.decl -// CHECK:STDOUT: witness = file.%Instance2.impl_witness +// CHECK:STDOUT: witness = %Instance2.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Instance2.G2(@Instance2.%Self: %Instance2.type) { diff --git a/toolchain/check/testdata/impl/declaration.carbon b/toolchain/check/testdata/impl/declaration.carbon index b58e307102ae1..ddb2c7dd5cf28 100644 --- a/toolchain/check/testdata/impl/declaration.carbon +++ b/toolchain/check/testdata/impl/declaration.carbon @@ -27,7 +27,7 @@ impl i32 as I {} // 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: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @i32.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -51,8 +51,6 @@ impl i32 as I {} // CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %I.ref.loc17: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @i32.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: impl_decl @i32.as.I.impl [concrete] {} { // CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] @@ -71,7 +69,10 @@ impl i32 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @i32.as.I.impl: %i32.loc17 as %I.ref.loc17 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @i32.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/empty.carbon b/toolchain/check/testdata/impl/empty.carbon index dfb6629033dc0..fb1e408e19056 100644 --- a/toolchain/check/testdata/impl/empty.carbon +++ b/toolchain/check/testdata/impl/empty.carbon @@ -27,7 +27,7 @@ impl i32 as Empty { // 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: %Empty.impl_witness: = impl_witness file.%Empty.impl_witness_table [concrete] +// CHECK:STDOUT: %Empty.impl_witness: = impl_witness @i32.as.Empty.impl.%Empty.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -51,8 +51,6 @@ impl i32 as Empty { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [concrete = constants.%Empty.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Empty.impl_witness_table = impl_witness_table (), @i32.as.Empty.impl [concrete] -// CHECK:STDOUT: %Empty.impl_witness: = impl_witness %Empty.impl_witness_table [concrete = constants.%Empty.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Empty { @@ -66,7 +64,10 @@ impl i32 as Empty { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @i32.as.Empty.impl: %i32 as %Empty.ref { +// CHECK:STDOUT: %Empty.impl_witness_table = impl_witness_table (), @i32.as.Empty.impl [concrete] +// CHECK:STDOUT: %Empty.impl_witness: = impl_witness %Empty.impl_witness_table [concrete = constants.%Empty.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Empty.impl_witness +// CHECK:STDOUT: witness = %Empty.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/error_recovery.carbon b/toolchain/check/testdata/impl/error_recovery.carbon index 8ffdba97c45ec..fb42394c0fc48 100644 --- a/toolchain/check/testdata/impl/error_recovery.carbon +++ b/toolchain/check/testdata/impl/error_recovery.carbon @@ -135,7 +135,7 @@ impl C as I { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -143,13 +143,14 @@ impl C as I { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.I.impl: %C.ref as %I.ref { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_nonfinal_lookup_impl_witness_error_in_import.carbon @@ -273,7 +274,7 @@ impl C as I { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] -// CHECK:STDOUT: %Z.impl_witness.b73: = impl_witness file.%Z.impl_witness_table, @T.as.Z.impl(%empty_tuple.type) [concrete] +// CHECK:STDOUT: %Z.impl_witness.b73: = impl_witness @T.as.Z.impl.%Z.impl_witness_table, @T.as.Z.impl(%empty_tuple.type) [concrete] // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %empty_tuple.type, (%Z.impl_witness.b73) [concrete] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%Z.facet) [concrete] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/extend_impl.carbon b/toolchain/check/testdata/impl/extend_impl.carbon index aa79d505b944f..0f81522171408 100644 --- a/toolchain/check/testdata/impl/extend_impl.carbon +++ b/toolchain/check/testdata/impl/extend_impl.carbon @@ -112,7 +112,7 @@ extend impl nonexistent* as I {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness @C.%HasF.impl_witness_table [concrete] +// CHECK:STDOUT: %HasF.impl_witness: = impl_witness @C.as.HasF.impl.%HasF.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.HasF.impl.F.type: type = fn_type @C.as.HasF.impl.F [concrete] // CHECK:STDOUT: %C.as.HasF.impl.F: %C.as.HasF.impl.F.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] @@ -125,10 +125,12 @@ extend impl nonexistent* as I {} // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.HasF.impl: %Self.ref as %HasF.ref { // CHECK:STDOUT: %C.as.HasF.impl.F.decl: %C.as.HasF.impl.F.type = fn_decl @C.as.HasF.impl.F [concrete = constants.%C.as.HasF.impl.F] {} {} +// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%C.as.HasF.impl.F.decl), @C.as.HasF.impl [concrete] +// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table [concrete = constants.%HasF.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %C.as.HasF.impl.F.decl -// CHECK:STDOUT: witness = @C.%HasF.impl_witness +// CHECK:STDOUT: witness = %HasF.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -136,8 +138,6 @@ extend impl nonexistent* as I {} // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@C.as.HasF.impl.%C.as.HasF.impl.F.decl), @C.as.HasF.impl [concrete] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table [concrete = constants.%HasF.impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/extend_impl_generic.carbon b/toolchain/check/testdata/impl/extend_impl_generic.carbon index 5b3c4a82ff06d..be13a18944a8f 100644 --- a/toolchain/check/testdata/impl/extend_impl_generic.carbon +++ b/toolchain/check/testdata/impl/extend_impl_generic.carbon @@ -79,7 +79,7 @@ class X(U:! type) { // CHECK:STDOUT: %complete_type.1ec: = complete_type_witness %struct_type.x.ed6 [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %HasF.type.31f: type = facet_type <@HasF, @HasF(%Param)> [concrete] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness @C.%HasF.impl_witness_table [concrete] +// CHECK:STDOUT: %HasF.impl_witness: = impl_witness @C.as.HasF.impl.%HasF.impl_witness_table [concrete] // CHECK:STDOUT: %Self.e81: %HasF.type.31f = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %HasF.F.type.f31: type = fn_type @HasF.F, @HasF(%Param) [concrete] // CHECK:STDOUT: %HasF.F.85a: %HasF.F.type.f31 = struct_value () [concrete] @@ -227,11 +227,13 @@ class X(U:! type) { // CHECK:STDOUT: %return.param: ref %Param = out_param call_param0 // CHECK:STDOUT: %return: ref %Param = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%C.as.HasF.impl.F.decl), @C.as.HasF.impl [concrete] +// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table [concrete = constants.%HasF.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Param = // CHECK:STDOUT: .F = %C.as.HasF.impl.F.decl -// CHECK:STDOUT: witness = @C.%HasF.impl_witness +// CHECK:STDOUT: witness = %HasF.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Param { @@ -253,8 +255,6 @@ class X(U:! type) { // CHECK:STDOUT: %Param.ref: type = name_ref Param, file.%Param.decl [concrete = constants.%Param] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(constants.%Param)> [concrete = constants.%HasF.type.31f] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@C.as.HasF.impl.%C.as.HasF.impl.F.decl), @C.as.HasF.impl [concrete] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table [concrete = constants.%HasF.impl_witness] // 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: @@ -400,7 +400,7 @@ class X(U:! type) { // CHECK:STDOUT: %X.generic: %X.type = struct_value () [concrete] // CHECK:STDOUT: %X: type = class_type @X, @X(%U) [symbolic] // CHECK:STDOUT: %I.type.d71ca1.2: type = facet_type <@I, @I(%U)> [symbolic] -// CHECK:STDOUT: %I.impl_witness: = impl_witness @X.%I.impl_witness_table, @X.as.I.impl(%U) [symbolic] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @X.as.I.impl.%I.impl_witness_table, @X.as.I.impl(%U) [symbolic] // CHECK:STDOUT: %Self.bb7324.2: %I.type.d71ca1.2 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %I.F.type.93703d.2: type = fn_type @I.F, @I(%U) [symbolic] // CHECK:STDOUT: %I.F.a37974.2: %I.F.type.93703d.2 = struct_value () [symbolic] @@ -494,7 +494,7 @@ class X(U:! type) { // CHECK:STDOUT: %U: type = symbolic_binding U, 0 [symbolic = %U (constants.%U)] // CHECK:STDOUT: %X: type = class_type @X, @X(%U) [symbolic = %X (constants.%X)] // CHECK:STDOUT: %I.type.loc9_21.1: type = facet_type <@I, @I(%U)> [symbolic = %I.type.loc9_21.1 (constants.%I.type.d71ca1.2)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness @X.%I.impl_witness_table, @X.as.I.impl(%U) [symbolic = %I.impl_witness (constants.%I.impl_witness)] +// CHECK:STDOUT: %I.impl_witness.loc9_23.2: = impl_witness %I.impl_witness_table, @X.as.I.impl(%U) [symbolic = %I.impl_witness.loc9_23.2 (constants.%I.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %I.type.loc9_21.1 [symbolic = %require_complete (constants.%require_complete.073)] @@ -518,11 +518,13 @@ class X(U:! type) { // CHECK:STDOUT: %U.ref: type = name_ref U, @X.%U.loc8_9.2 [symbolic = %U (constants.%U)] // CHECK:STDOUT: %t: @X.as.I.impl.F.%U (%U) = value_binding t, %t.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%X.as.I.impl.F.decl), @X.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness.loc9_23.1: = impl_witness %I.impl_witness_table, @X.as.I.impl(constants.%U) [symbolic = %I.impl_witness.loc9_23.2 (constants.%I.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .U = // CHECK:STDOUT: .F = %X.as.I.impl.F.decl -// CHECK:STDOUT: witness = @X.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness.loc9_23.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -540,8 +542,6 @@ class X(U:! type) { // CHECK:STDOUT: %U.ref: type = name_ref U, @X.%U.loc8_9.2 [symbolic = %U (constants.%U)] // CHECK:STDOUT: %I.type.loc9_21.2: type = facet_type <@I, @I(constants.%U)> [symbolic = %I.type.loc9_21.1 (constants.%I.type.d71ca1.2)] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@X.as.I.impl.%X.as.I.impl.F.decl), @X.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table, @X.as.I.impl(constants.%U) [symbolic = @X.as.I.impl.%I.impl_witness (constants.%I.impl_witness)] // CHECK:STDOUT: %.loc9: type = specific_constant @X.as.I.impl.%I.type.loc9_21.2, @X.as.I.impl(constants.%U) [symbolic = %I.type (constants.%I.type.d71ca1.2)] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type @@ -620,7 +620,7 @@ class X(U:! type) { // CHECK:STDOUT: %U => constants.%U // CHECK:STDOUT: %X => constants.%X // CHECK:STDOUT: %I.type.loc9_21.1 => constants.%I.type.d71ca1.2 -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness +// CHECK:STDOUT: %I.impl_witness.loc9_23.2 => constants.%I.impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete.073 diff --git a/toolchain/check/testdata/impl/fail_alias.carbon b/toolchain/check/testdata/impl/fail_alias.carbon index c769da1e299bc..4938488d252d3 100644 --- a/toolchain/check/testdata/impl/fail_alias.carbon +++ b/toolchain/check/testdata/impl/fail_alias.carbon @@ -37,7 +37,7 @@ impl AC as AI {} // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.518eb8.1.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -57,8 +57,6 @@ impl AC as AI {} // CHECK:STDOUT: %AC.ref: type = name_ref AC, file.%AC [concrete = constants.%C] // CHECK:STDOUT: %AI.ref: type = name_ref AI, file.%AI [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl.518eb8.1 [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: impl_decl @C.as.I.impl.518eb8.2 [concrete] {} { // CHECK:STDOUT: %AC.ref: type = name_ref AC, file.%AC [concrete = constants.%C] // CHECK:STDOUT: %AI.ref: type = name_ref AI, file.%AI [concrete = constants.%I.type] @@ -76,8 +74,11 @@ impl AC as AI {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.I.impl.518eb8.1: %AC.ref as %AI.ref { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl.518eb8.1 [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.I.impl.518eb8.2: %AC.ref as %AI.ref { diff --git a/toolchain/check/testdata/impl/fail_call_invalid.carbon b/toolchain/check/testdata/impl/fail_call_invalid.carbon index f996a89b4bca5..73c4fbef14aa7 100644 --- a/toolchain/check/testdata/impl/fail_call_invalid.carbon +++ b/toolchain/check/testdata/impl/fail_call_invalid.carbon @@ -44,7 +44,7 @@ fn InstanceCall(n: i32) { // 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: %Simple.impl_witness: = impl_witness file.%Simple.impl_witness_table [concrete] +// CHECK:STDOUT: %Simple.impl_witness: = impl_witness @i32.as.Simple.impl.%Simple.impl_witness_table [concrete] // CHECK:STDOUT: %i32.as.Simple.impl.G.type.85d775.1: type = fn_type @i32.as.Simple.impl.G.loc24_27.1 [concrete] // CHECK:STDOUT: %i32.as.Simple.impl.G.38af97.1: %i32.as.Simple.impl.G.type.85d775.1 = struct_value () [concrete] // CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %i32, (%Simple.impl_witness) [concrete] @@ -79,8 +79,6 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [concrete = constants.%Simple.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Simple.impl_witness_table = impl_witness_table (@i32.as.Simple.impl.%i32.as.Simple.impl.G.decl.loc24_27.2), @i32.as.Simple.impl [concrete] -// CHECK:STDOUT: %Simple.impl_witness: = impl_witness %Simple.impl_witness_table [concrete = constants.%Simple.impl_witness] // CHECK:STDOUT: %InstanceCall.decl: %InstanceCall.type = fn_decl @InstanceCall [concrete = constants.%InstanceCall] { // CHECK:STDOUT: %n.patt: %pattern_type.7ce = value_binding_pattern n [concrete] // CHECK:STDOUT: %n.param_patt: %pattern_type.7ce = value_param_pattern %n.patt, call_param0 [concrete] @@ -134,11 +132,13 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %self.param: %i32 = value_param call_param0 // CHECK:STDOUT: %self: %i32 = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Simple.impl_witness_table = impl_witness_table (%i32.as.Simple.impl.G.decl.loc24_27.2), @i32.as.Simple.impl [concrete] +// CHECK:STDOUT: %Simple.impl_witness: = impl_witness %Simple.impl_witness_table [concrete = constants.%Simple.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Undeclared = // CHECK:STDOUT: .G = %i32.as.Simple.impl.G.decl.loc24_27.1 -// CHECK:STDOUT: witness = file.%Simple.impl_witness +// CHECK:STDOUT: witness = %Simple.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Simple.G(@Simple.%Self: %Simple.type) { diff --git a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon index c1513cfe71e9d..acd9d5c21bca5 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon @@ -43,7 +43,7 @@ class C { // CHECK:STDOUT: %GenericInterface.assoc_type: type = assoc_entity_type @GenericInterface, @GenericInterface(%T) [symbolic] // CHECK:STDOUT: %assoc0: %GenericInterface.assoc_type = assoc_entity element0, @GenericInterface.%GenericInterface.F.decl [symbolic] // CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %GenericInterface.impl_witness: = impl_witness @C.%GenericInterface.impl_witness_table, @C.as.GenericInterface.impl(%T) [symbolic] +// CHECK:STDOUT: %GenericInterface.impl_witness: = impl_witness @C.as.GenericInterface.impl.%GenericInterface.impl_witness_table, @C.as.GenericInterface.impl(%T) [symbolic] // CHECK:STDOUT: %C.as.GenericInterface.impl.F.type: type = fn_type @C.as.GenericInterface.impl.F, @C.as.GenericInterface.impl(%T) [symbolic] // CHECK:STDOUT: %C.as.GenericInterface.impl.F: %C.as.GenericInterface.impl.F.type = struct_value () [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] @@ -101,7 +101,7 @@ class C { // CHECK:STDOUT: generic impl @C.as.GenericInterface.impl(%T.loc24_23.2: type) { // CHECK:STDOUT: %T.loc24_23.1: type = symbolic_binding T, 0 [symbolic = %T.loc24_23.1 (constants.%T)] // CHECK:STDOUT: %GenericInterface.type.loc24_54.1: type = facet_type <@GenericInterface, @GenericInterface(%T.loc24_23.1)> [symbolic = %GenericInterface.type.loc24_54.1 (constants.%GenericInterface.type.690)] -// CHECK:STDOUT: %GenericInterface.impl_witness: = impl_witness @C.%GenericInterface.impl_witness_table, @C.as.GenericInterface.impl(%T.loc24_23.1) [symbolic = %GenericInterface.impl_witness (constants.%GenericInterface.impl_witness)] +// CHECK:STDOUT: %GenericInterface.impl_witness.loc24_56.2: = impl_witness %GenericInterface.impl_witness_table, @C.as.GenericInterface.impl(%T.loc24_23.1) [symbolic = %GenericInterface.impl_witness.loc24_56.2 (constants.%GenericInterface.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %C.as.GenericInterface.impl.F.type: type = fn_type @C.as.GenericInterface.impl.F, @C.as.GenericInterface.impl(%T.loc24_23.1) [symbolic = %C.as.GenericInterface.impl.F.type (constants.%C.as.GenericInterface.impl.F.type)] @@ -116,6 +116,8 @@ class C { // CHECK:STDOUT: %T.ref: type = name_ref T, @C.as.GenericInterface.impl.%T.loc24_23.2 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %x: @C.as.GenericInterface.impl.F.%T (%T) = value_binding x, %x.param // CHECK:STDOUT: } +// CHECK:STDOUT: %GenericInterface.impl_witness_table = impl_witness_table (), @C.as.GenericInterface.impl [concrete] +// CHECK:STDOUT: %GenericInterface.impl_witness.loc24_56.1: = impl_witness %GenericInterface.impl_witness_table, @C.as.GenericInterface.impl(constants.%T) [symbolic = %GenericInterface.impl_witness.loc24_56.2 (constants.%GenericInterface.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .T = @@ -135,8 +137,6 @@ class C { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc24_23.2: type = symbolic_binding T, 0 [symbolic = %T.loc24_23.1 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %GenericInterface.impl_witness_table = impl_witness_table (), @C.as.GenericInterface.impl [concrete] -// CHECK:STDOUT: %GenericInterface.impl_witness: = impl_witness %GenericInterface.impl_witness_table, @C.as.GenericInterface.impl(constants.%T) [symbolic = @C.as.GenericInterface.impl.%GenericInterface.impl_witness (constants.%GenericInterface.impl_witness)] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -178,7 +178,7 @@ class C { // CHECK:STDOUT: specific @C.as.GenericInterface.impl(constants.%T) { // CHECK:STDOUT: %T.loc24_23.1 => constants.%T // CHECK:STDOUT: %GenericInterface.type.loc24_54.1 => constants.%GenericInterface.type.690 -// CHECK:STDOUT: %GenericInterface.impl_witness => constants.%GenericInterface.impl_witness +// CHECK:STDOUT: %GenericInterface.impl_witness.loc24_56.2 => constants.%GenericInterface.impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %C.as.GenericInterface.impl.F.type => constants.%C.as.GenericInterface.impl.F.type diff --git a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon index bf1755e028b20..c60f4efeff1e6 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon @@ -71,7 +71,7 @@ fn F() { // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @empty_tuple.type.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -93,8 +93,6 @@ fn F() { // CHECK:STDOUT: %.loc9_14.2: type = converted %.loc9_14.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -108,6 +106,9 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_tuple.type.as.I.impl: %.loc9_14.2 as %I.ref { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = // CHECK:STDOUT: } @@ -121,7 +122,7 @@ fn F() { // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness @F.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness @empty_struct_type.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -153,6 +154,9 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_struct_type.as.J.impl: %.loc10_16.2 as %J.ref { +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (), @empty_struct_type.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = // CHECK:STDOUT: } @@ -164,8 +168,6 @@ fn F() { // CHECK:STDOUT: %.loc10_16.2: type = converted %.loc10_16.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (), @empty_struct_type.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -182,7 +184,7 @@ fn F() { // CHECK:STDOUT: %.as.Z.impl.Zero.type: type = fn_type @.as.Z.impl.Zero, @.as.Z.impl(%Self.001) [symbolic] // CHECK:STDOUT: %.as.Z.impl.Zero: %.as.Z.impl.Zero.type = struct_value () [symbolic] // CHECK:STDOUT: %Point: type = class_type @Point [concrete] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness @Point.%Z.impl_witness_table [concrete] +// CHECK:STDOUT: %Z.impl_witness: = impl_witness @Point.as.Z.impl.%Z.impl_witness_table [concrete] // CHECK:STDOUT: %Point.as.Z.impl.Zero.type: type = fn_type @Point.as.Z.impl.Zero [concrete] // CHECK:STDOUT: %Point.as.Z.impl.Zero: %Point.as.Z.impl.Zero.type = struct_value () [concrete] // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %Point, (%Z.impl_witness) [concrete] @@ -257,10 +259,12 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: impl @Point.as.Z.impl: %Self.ref as %Z.ref { // CHECK:STDOUT: %Point.as.Z.impl.Zero.decl: %Point.as.Z.impl.Zero.type = fn_decl @Point.as.Z.impl.Zero [concrete = constants.%Point.as.Z.impl.Zero] {} {} +// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%Point.as.Z.impl.Zero.decl), @Point.as.Z.impl [concrete] +// CHECK:STDOUT: %Z.impl_witness: = impl_witness %Z.impl_witness_table [concrete = constants.%Z.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Zero = %Point.as.Z.impl.Zero.decl -// CHECK:STDOUT: witness = @Point.%Z.impl_witness +// CHECK:STDOUT: witness = %Z.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Point { @@ -268,8 +272,6 @@ fn F() { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Point [concrete = constants.%Point] // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (@Point.as.Z.impl.%Point.as.Z.impl.Zero.decl), @Point.as.Z.impl [concrete] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness %Z.impl_witness_table [concrete = constants.%Z.impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon index 35b9a1739606d..8b9d805d02eae 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon @@ -61,9 +61,8 @@ class E { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %D: type = class_type @D [concrete] -// CHECK:STDOUT: %I.impl_witness.e21: = impl_witness @D.%I.impl_witness_table [concrete] // CHECK:STDOUT: %E: type = class_type @E [concrete] -// CHECK:STDOUT: %I.impl_witness.d4b: = impl_witness @E.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness.d4b: = impl_witness @E.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -108,8 +107,11 @@ class E { // CHECK:STDOUT: impl @D.as.I.impl: %D.ref as %I.ref; // CHECK:STDOUT: // CHECK:STDOUT: impl @E.as.I.impl: %Self.ref as %I.ref { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @E.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.d4b] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = @E.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -132,8 +134,6 @@ class E { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @D.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.e21] // 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: @@ -149,8 +149,6 @@ class E { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @E.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.d4b] // 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: diff --git a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon index 2ef11a6e176b2..abdfb5c01d9a3 100644 --- a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon @@ -31,7 +31,7 @@ interface I { // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic] -// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.%I.impl_witness_table, @C.as.I.impl(%Self) [symbolic] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table, @C.as.I.impl(%Self) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: } @@ -59,7 +59,7 @@ interface I { // CHECK:STDOUT: generic impl @C.as.I.impl(@I.%Self: %I.type) { // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.%I.impl_witness_table, @C.as.I.impl(%Self) [symbolic = %I.impl_witness (constants.%I.impl_witness)] +// CHECK:STDOUT: %I.impl_witness.loc24_21.2: = impl_witness %I.impl_witness_table, @C.as.I.impl(%Self) [symbolic = %I.impl_witness.loc24_21.2 (constants.%I.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %Self.ref as %I.ref; // CHECK:STDOUT: } @@ -72,8 +72,6 @@ interface I { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [symbolic = %C (constants.%C)] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%Self) [symbolic = @C.as.I.impl.%I.impl_witness (constants.%I.impl_witness)] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -89,6 +87,6 @@ interface I { // CHECK:STDOUT: specific @C.as.I.impl(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: %C => constants.%C -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness +// CHECK:STDOUT: %I.impl_witness.loc24_21.2 => constants.%I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon index 6e32d4d94f6e0..0fa4519ca92b2 100644 --- a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon @@ -35,7 +35,6 @@ fn F(c: C) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.%I.impl_witness_table [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete] @@ -70,8 +69,6 @@ fn F(c: C) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon index ff1d52d597bcf..2fed3fb2ee810 100644 --- a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon +++ b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon @@ -244,7 +244,7 @@ class X { // CHECK:STDOUT: %.as.Z.impl.Method: %.as.Z.impl.Method.type = struct_value () [symbolic] // CHECK:STDOUT: %require_complete.604: = require_complete_type %Self.binding.as_type.f61 [symbolic] // CHECK:STDOUT: %Point: type = class_type @Point [concrete] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness @Point.%Z.impl_witness_table [concrete] +// CHECK:STDOUT: %Z.impl_witness: = impl_witness @Point.as.Z.impl.%Z.impl_witness_table [concrete] // CHECK:STDOUT: %Point.as.Z.impl.Zero.type: type = fn_type @Point.as.Z.impl.Zero [concrete] // CHECK:STDOUT: %Point.as.Z.impl.Zero: %Point.as.Z.impl.Zero.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.c86: type = pattern_type %Point [concrete] @@ -360,11 +360,13 @@ class X { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Point [concrete = constants.%Point] // CHECK:STDOUT: %self: %Point = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%Point.as.Z.impl.Zero.decl, %Point.as.Z.impl.Method.decl), @Point.as.Z.impl [concrete] +// CHECK:STDOUT: %Z.impl_witness: = impl_witness %Z.impl_witness_table [concrete = constants.%Z.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Zero = %Point.as.Z.impl.Zero.decl // CHECK:STDOUT: .Method = %Point.as.Z.impl.Method.decl -// CHECK:STDOUT: witness = @Point.%Z.impl_witness +// CHECK:STDOUT: witness = %Z.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Point { @@ -372,8 +374,6 @@ class X { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Point [concrete = constants.%Point] // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (@Point.as.Z.impl.%Point.as.Z.impl.Zero.decl, @Point.as.Z.impl.%Point.as.Z.impl.Method.decl), @Point.as.Z.impl [concrete] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness %Z.impl_witness_table [concrete = constants.%Z.impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -503,7 +503,7 @@ class X { // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %X: type = class_type @X [concrete] -// CHECK:STDOUT: %A.impl_witness: = impl_witness @X.%A.impl_witness_table [concrete] +// CHECK:STDOUT: %A.impl_witness: = impl_witness @X.as.A.impl.%A.impl_witness_table [concrete] // CHECK:STDOUT: %X.as.A.impl.B.type: type = fn_type @X.as.A.impl.B [concrete] // CHECK:STDOUT: %X.as.A.impl.B: %X.as.A.impl.B.type = struct_value () [concrete] // CHECK:STDOUT: %A.facet: %A.type = facet_value %X, (%A.impl_witness) [concrete] @@ -561,12 +561,14 @@ class X { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C.type] // CHECK:STDOUT: } // CHECK:STDOUT: %X.as.A.impl.B.decl: %X.as.A.impl.B.type = fn_decl @X.as.A.impl.B [concrete = constants.%X.as.A.impl.B] {} {} +// CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (%X.as.A.impl.B.decl), @X.as.A.impl [concrete] +// CHECK:STDOUT: %A.impl_witness: = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = // CHECK:STDOUT: .B = %X.as.A.impl.B.decl // CHECK:STDOUT: .G = -// CHECK:STDOUT: witness = @X.%A.impl_witness +// CHECK:STDOUT: witness = %A.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @.as.C.impl: as %C.ref { @@ -579,8 +581,6 @@ class X { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%X [concrete = constants.%X] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (@X.as.A.impl.%X.as.A.impl.B.decl), @X.as.A.impl [concrete] -// CHECK:STDOUT: %A.impl_witness: = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon index 610eb01629823..78b91969de5c5 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon @@ -32,7 +32,7 @@ impl () as I {} // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @empty_tuple.type.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -45,8 +45,6 @@ impl () as I {} // CHECK:STDOUT: %.loc24_7.2: type = converted %.loc24_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -68,8 +66,11 @@ impl () as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_tuple.type.as.I.impl: %.loc24_7.2 as %I.ref { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @T(constants.%Self) {} diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon index 4c9f0643f500b..9f491c4aca162 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -251,18 +251,18 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] // CHECK:STDOUT: %assoc0.524: %I.assoc_type = assoc_entity element0, @I.%I.F.decl [concrete] // CHECK:STDOUT: %NoF: type = class_type @NoF [concrete] -// CHECK:STDOUT: %I.impl_witness.64d: = impl_witness @NoF.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness.64d: = impl_witness @NoF.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %FNotFunction: type = class_type @FNotFunction [concrete] -// CHECK:STDOUT: %I.impl_witness.240: = impl_witness @FNotFunction.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness.240: = impl_witness @FNotFunction.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %F: type = class_type @F [concrete] // CHECK:STDOUT: %PossiblyF.type: type = fn_type @PossiblyF [concrete] // CHECK:STDOUT: %PossiblyF: %PossiblyF.type = struct_value () [concrete] // CHECK:STDOUT: %FAlias: type = class_type @FAlias [concrete] -// CHECK:STDOUT: %I.impl_witness.d12: = impl_witness @FAlias.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness.d12: = impl_witness @FAlias.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %FExtraParam: type = class_type @FExtraParam [concrete] -// CHECK:STDOUT: %I.impl_witness.f4f: = impl_witness @FExtraParam.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness.f4f: = impl_witness @FExtraParam.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] @@ -272,7 +272,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %FExtraParam.as.I.impl.F.type.194208.2: type = fn_type @FExtraParam.as.I.impl.F.loc69_18.2 [concrete] // CHECK:STDOUT: %FExtraParam.as.I.impl.F.1edd3c.2: %FExtraParam.as.I.impl.F.type.194208.2 = struct_value () [concrete] // CHECK:STDOUT: %FExtraImplicitParam: type = class_type @FExtraImplicitParam [concrete] -// CHECK:STDOUT: %I.impl_witness.63c: = impl_witness @FExtraImplicitParam.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness.63c: = impl_witness @FExtraImplicitParam.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.235: type = pattern_type %FExtraImplicitParam [concrete] // CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.type.9f0929.1: type = fn_type @FExtraImplicitParam.as.I.impl.F.loc85_23.1 [concrete] // CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.c70c0d.1: %FExtraImplicitParam.as.I.impl.F.type.9f0929.1 = struct_value () [concrete] @@ -280,7 +280,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.type.9f0929.2: type = fn_type @FExtraImplicitParam.as.I.impl.F.loc85_23.2 [concrete] // CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.c70c0d.2: %FExtraImplicitParam.as.I.impl.F.type.9f0929.2 = struct_value () [concrete] // CHECK:STDOUT: %FExtraReturnType: type = class_type @FExtraReturnType [concrete] -// CHECK:STDOUT: %I.impl_witness.ea9: = impl_witness @FExtraReturnType.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness.ea9: = impl_witness @FExtraReturnType.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %FExtraReturnType.as.I.impl.F.type: type = fn_type @FExtraReturnType.as.I.impl.F [concrete] // CHECK:STDOUT: %FExtraReturnType.as.I.impl.F: %FExtraReturnType.as.I.impl.F.type = struct_value () [concrete] // CHECK:STDOUT: %I.facet.bdc: %I.type = facet_value %FExtraReturnType, (%I.impl_witness.ea9) [concrete] @@ -291,21 +291,21 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete] // CHECK:STDOUT: %assoc0.5fd: %J.assoc_type = assoc_entity element0, @J.%J.F.decl [concrete] // CHECK:STDOUT: %FMissingParam: type = class_type @FMissingParam [concrete] -// CHECK:STDOUT: %J.impl_witness.b6a: = impl_witness @FMissingParam.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness.b6a: = impl_witness @FMissingParam.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %FMissingParam.as.J.impl.F.type.3232a8.1: type = fn_type @FMissingParam.as.J.impl.F.loc117_31.1 [concrete] // CHECK:STDOUT: %FMissingParam.as.J.impl.F.470f47.1: %FMissingParam.as.J.impl.F.type.3232a8.1 = struct_value () [concrete] // CHECK:STDOUT: %J.facet.bf1: %J.type = facet_value %FMissingParam, (%J.impl_witness.b6a) [concrete] // CHECK:STDOUT: %FMissingParam.as.J.impl.F.type.3232a8.2: type = fn_type @FMissingParam.as.J.impl.F.loc117_31.2 [concrete] // CHECK:STDOUT: %FMissingParam.as.J.impl.F.470f47.2: %FMissingParam.as.J.impl.F.type.3232a8.2 = struct_value () [concrete] // CHECK:STDOUT: %FMissingImplicitParam: type = class_type @FMissingImplicitParam [concrete] -// CHECK:STDOUT: %J.impl_witness.032: = impl_witness @FMissingImplicitParam.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness.032: = impl_witness @FMissingImplicitParam.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %FMissingImplicitParam.as.J.impl.F.type.0f1a25.1: type = fn_type @FMissingImplicitParam.as.J.impl.F.loc130_26.1 [concrete] // CHECK:STDOUT: %FMissingImplicitParam.as.J.impl.F.10e0af.1: %FMissingImplicitParam.as.J.impl.F.type.0f1a25.1 = struct_value () [concrete] // CHECK:STDOUT: %J.facet.96a: %J.type = facet_value %FMissingImplicitParam, (%J.impl_witness.032) [concrete] // CHECK:STDOUT: %FMissingImplicitParam.as.J.impl.F.type.0f1a25.2: type = fn_type @FMissingImplicitParam.as.J.impl.F.loc130_26.2 [concrete] // CHECK:STDOUT: %FMissingImplicitParam.as.J.impl.F.10e0af.2: %FMissingImplicitParam.as.J.impl.F.type.0f1a25.2 = struct_value () [concrete] // CHECK:STDOUT: %FMissingReturnType: type = class_type @FMissingReturnType [concrete] -// CHECK:STDOUT: %J.impl_witness.0e1: = impl_witness @FMissingReturnType.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness.0e1: = impl_witness @FMissingReturnType.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.type.5580d8.1: type = fn_type @FMissingReturnType.as.J.impl.F.loc152_30.1 [concrete] // CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.9e1cca.1: %FMissingReturnType.as.J.impl.F.type.5580d8.1 = struct_value () [concrete] // CHECK:STDOUT: %J.facet.56c: %J.type = facet_value %FMissingReturnType, (%J.impl_witness.0e1) [concrete] @@ -314,7 +314,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] // CHECK:STDOUT: %FDifferentParamType: type = class_type @FDifferentParamType [concrete] -// CHECK:STDOUT: %J.impl_witness.47d: = impl_witness @FDifferentParamType.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness.47d: = impl_witness @FDifferentParamType.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.b79: type = pattern_type %FDifferentParamType [concrete] // CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.type.644304.1: type = fn_type @FDifferentParamType.as.J.impl.F.loc171_38.1 [concrete] // CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.026f51.1: %FDifferentParamType.as.J.impl.F.type.644304.1 = struct_value () [concrete] @@ -322,7 +322,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.type.644304.2: type = fn_type @FDifferentParamType.as.J.impl.F.loc171_38.2 [concrete] // CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.026f51.2: %FDifferentParamType.as.J.impl.F.type.644304.2 = struct_value () [concrete] // CHECK:STDOUT: %FDifferentImplicitParamType: type = class_type @FDifferentImplicitParamType [concrete] -// CHECK:STDOUT: %J.impl_witness.6ff: = impl_witness @FDifferentImplicitParamType.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness.6ff: = impl_witness @FDifferentImplicitParamType.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.b8f: type = pattern_type %FDifferentImplicitParamType [concrete] // CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.type.a10327.1: type = fn_type @FDifferentImplicitParamType.as.J.impl.F.loc184_38.1 [concrete] // CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.5fa54a.1: %FDifferentImplicitParamType.as.J.impl.F.type.a10327.1 = struct_value () [concrete] @@ -330,7 +330,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.type.a10327.2: type = fn_type @FDifferentImplicitParamType.as.J.impl.F.loc184_38.2 [concrete] // CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.5fa54a.2: %FDifferentImplicitParamType.as.J.impl.F.type.a10327.2 = struct_value () [concrete] // CHECK:STDOUT: %FDifferentReturnType: type = class_type @FDifferentReturnType [concrete] -// CHECK:STDOUT: %J.impl_witness.e7b: = impl_witness @FDifferentReturnType.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness.e7b: = impl_witness @FDifferentReturnType.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.5c8: type = pattern_type %FDifferentReturnType [concrete] // CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.type.d37750.1: type = fn_type @FDifferentReturnType.as.J.impl.F.loc200_38.1 [concrete] // CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.dab19b.1: %FDifferentReturnType.as.J.impl.F.type.d37750.1 = struct_value () [concrete] @@ -358,7 +358,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %SelfNested.assoc_type: type = assoc_entity_type @SelfNested [concrete] // CHECK:STDOUT: %assoc0.92f: %SelfNested.assoc_type = assoc_entity element0, @SelfNested.%SelfNested.F.decl [concrete] // CHECK:STDOUT: %SelfNestedBadParam: type = class_type @SelfNestedBadParam [concrete] -// CHECK:STDOUT: %SelfNested.impl_witness.ff1: = impl_witness @SelfNestedBadParam.%SelfNested.impl_witness_table [concrete] +// CHECK:STDOUT: %SelfNested.impl_witness.ff1: = impl_witness @SelfNestedBadParam.as.SelfNested.impl.%SelfNested.impl_witness_table [concrete] // CHECK:STDOUT: %ptr.cf2: type = ptr_type %SelfNestedBadParam [concrete] // CHECK:STDOUT: %struct_type.x.y.871: type = struct_type {.x: %i32, .y: %i32} [concrete] // CHECK:STDOUT: %tuple.bb3: %tuple.type.24b = tuple_value (%ptr.cf2, %struct_type.x.y.871) [concrete] @@ -376,7 +376,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %SelfNestedBadParam.as.SelfNested.impl.F.type.612817.2: type = fn_type @SelfNestedBadParam.as.SelfNested.impl.F.loc223_87.2 [concrete] // CHECK:STDOUT: %SelfNestedBadParam.as.SelfNested.impl.F.7f50a1.2: %SelfNestedBadParam.as.SelfNested.impl.F.type.612817.2 = struct_value () [concrete] // CHECK:STDOUT: %SelfNestedBadReturnType: type = class_type @SelfNestedBadReturnType [concrete] -// CHECK:STDOUT: %SelfNested.impl_witness.238: = impl_witness @SelfNestedBadReturnType.%SelfNested.impl_witness_table [concrete] +// CHECK:STDOUT: %SelfNested.impl_witness.238: = impl_witness @SelfNestedBadReturnType.as.SelfNested.impl.%SelfNested.impl_witness_table [concrete] // CHECK:STDOUT: %ptr.cbe: type = ptr_type %SelfNestedBadReturnType [concrete] // CHECK:STDOUT: %struct_type.x.y.cfa: type = struct_type {.x: %SelfNestedBadReturnType, .y: %i32} [concrete] // CHECK:STDOUT: %tuple.c42: %tuple.type.24b = tuple_value (%ptr.cbe, %struct_type.x.y.cfa) [concrete] @@ -543,27 +543,34 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @NoF.as.I.impl: %Self.ref as %I.ref { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @NoF.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.64d] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = -// CHECK:STDOUT: witness = @NoF.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FNotFunction.as.I.impl: %Self.ref as %I.ref { // CHECK:STDOUT: %F.decl: type = class_decl @F [concrete = constants.%F] {} {} +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @FNotFunction.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.240] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = @FNotFunction.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FAlias.as.I.impl: %Self.ref as %I.ref { // CHECK:STDOUT: %PossiblyF.ref: %PossiblyF.type = name_ref PossiblyF, file.%PossiblyF.decl [concrete = constants.%PossiblyF] // CHECK:STDOUT: %F: %PossiblyF.type = alias_binding F, file.%PossiblyF.decl [concrete = constants.%PossiblyF] +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @FAlias.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.d12] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .PossiblyF = // CHECK:STDOUT: .F = %F -// CHECK:STDOUT: witness = @FAlias.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FExtraParam.as.I.impl: %Self.ref as %I.ref { @@ -580,10 +587,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %b: bool = value_binding b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %FExtraParam.as.I.impl.F.decl.loc69_18.2: %FExtraParam.as.I.impl.F.type.194208.2 = fn_decl @FExtraParam.as.I.impl.F.loc69_18.2 [concrete = constants.%FExtraParam.as.I.impl.F.1edd3c.2] {} {} +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%FExtraParam.as.I.impl.F.decl.loc69_18.2), @FExtraParam.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.f4f] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %FExtraParam.as.I.impl.F.decl.loc69_18.1 -// CHECK:STDOUT: witness = @FExtraParam.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FExtraImplicitParam.as.I.impl: %Self.ref as %I.ref { @@ -596,10 +605,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %self: %FExtraImplicitParam = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.decl.loc85_23.2: %FExtraImplicitParam.as.I.impl.F.type.9f0929.2 = fn_decl @FExtraImplicitParam.as.I.impl.F.loc85_23.2 [concrete = constants.%FExtraImplicitParam.as.I.impl.F.c70c0d.2] {} {} +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%FExtraImplicitParam.as.I.impl.F.decl.loc85_23.2), @FExtraImplicitParam.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.63c] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %FExtraImplicitParam.as.I.impl.F.decl.loc85_23.1 -// CHECK:STDOUT: witness = @FExtraImplicitParam.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FExtraReturnType.as.I.impl: %Self.ref as %I.ref { @@ -613,10 +624,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param0 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @FExtraReturnType.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.ea9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %FExtraReturnType.as.I.impl.F.decl -// CHECK:STDOUT: witness = @FExtraReturnType.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FMissingParam.as.J.impl: %Self.ref as %J.ref { @@ -655,10 +668,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FMissingParam.as.J.impl.F.decl.loc117_31.2), @FMissingParam.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.b6a] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %FMissingParam.as.J.impl.F.decl.loc117_31.1 -// CHECK:STDOUT: witness = @FMissingParam.%J.impl_witness +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FMissingImplicitParam.as.J.impl: %Self.ref as %J.ref { @@ -697,10 +712,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FMissingImplicitParam.as.J.impl.F.decl.loc130_26.2), @FMissingImplicitParam.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.032] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %FMissingImplicitParam.as.J.impl.F.decl.loc130_26.1 -// CHECK:STDOUT: witness = @FMissingImplicitParam.%J.impl_witness +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FMissingReturnType.as.J.impl: %Self.ref as %J.ref { @@ -741,10 +758,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FMissingReturnType.as.J.impl.F.decl.loc152_30.2), @FMissingReturnType.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.0e1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %FMissingReturnType.as.J.impl.F.decl.loc152_30.1 -// CHECK:STDOUT: witness = @FMissingReturnType.%J.impl_witness +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FDifferentParamType.as.J.impl: %Self.ref as %J.ref { @@ -788,10 +807,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FDifferentParamType.as.J.impl.F.decl.loc171_38.2), @FDifferentParamType.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.47d] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %FDifferentParamType.as.J.impl.F.decl.loc171_38.1 -// CHECK:STDOUT: witness = @FDifferentParamType.%J.impl_witness +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FDifferentImplicitParamType.as.J.impl: %Self.ref as %J.ref { @@ -835,10 +856,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FDifferentImplicitParamType.as.J.impl.F.decl.loc184_38.2), @FDifferentImplicitParamType.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.6ff] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %FDifferentImplicitParamType.as.J.impl.F.decl.loc184_38.1 -// CHECK:STDOUT: witness = @FDifferentImplicitParamType.%J.impl_witness +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FDifferentReturnType.as.J.impl: %Self.ref as %J.ref { @@ -884,10 +907,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FDifferentReturnType.as.J.impl.F.decl.loc200_38.2), @FDifferentReturnType.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.e7b] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %FDifferentReturnType.as.J.impl.F.decl.loc200_38.1 -// CHECK:STDOUT: witness = @FDifferentReturnType.%J.impl_witness +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @SelfNestedBadParam.as.SelfNested.impl: %Self.ref as %SelfNested.ref { @@ -928,11 +953,13 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref %array_type.388 = out_param call_param1 // CHECK:STDOUT: %return: ref %array_type.388 = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %SelfNested.impl_witness_table = impl_witness_table (%SelfNestedBadParam.as.SelfNested.impl.F.decl.loc223_87.2), @SelfNestedBadParam.as.SelfNested.impl [concrete] +// CHECK:STDOUT: %SelfNested.impl_witness: = impl_witness %SelfNested.impl_witness_table [concrete = constants.%SelfNested.impl_witness.ff1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .SelfNestedBadParam = // CHECK:STDOUT: .F = %SelfNestedBadParam.as.SelfNested.impl.F.decl.loc223_87.1 -// CHECK:STDOUT: witness = @SelfNestedBadParam.%SelfNested.impl_witness +// CHECK:STDOUT: witness = %SelfNested.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @SelfNestedBadReturnType.as.SelfNested.impl: %Self.ref as %SelfNested.ref { @@ -972,12 +999,14 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref %array_type.31b = out_param call_param1 // CHECK:STDOUT: %return: ref %array_type.31b = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %SelfNested.impl_witness_table = impl_witness_table (%SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc239_112.2), @SelfNestedBadReturnType.as.SelfNested.impl [concrete] +// CHECK:STDOUT: %SelfNested.impl_witness: = impl_witness %SelfNested.impl_witness_table [concrete = constants.%SelfNested.impl_witness.238] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .SelfNestedBadReturnType = // CHECK:STDOUT: .SelfNestedBadParam = // CHECK:STDOUT: .F = %SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc239_112.1 -// CHECK:STDOUT: witness = @SelfNestedBadReturnType.%SelfNested.impl_witness +// CHECK:STDOUT: witness = %SelfNested.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NoF { @@ -985,8 +1014,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%NoF [concrete = constants.%NoF] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @NoF.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.64d] // 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: @@ -1000,8 +1027,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FNotFunction [concrete = constants.%FNotFunction] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @FNotFunction.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.240] // 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: @@ -1017,8 +1042,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FAlias [concrete = constants.%FAlias] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @FAlias.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.d12] // 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: @@ -1033,8 +1056,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraParam [concrete = constants.%FExtraParam] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@FExtraParam.as.I.impl.%FExtraParam.as.I.impl.F.decl.loc69_18.2), @FExtraParam.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.f4f] // 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: @@ -1048,8 +1069,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraImplicitParam [concrete = constants.%FExtraImplicitParam] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@FExtraImplicitParam.as.I.impl.%FExtraImplicitParam.as.I.impl.F.decl.loc85_23.2), @FExtraImplicitParam.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.63c] // 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: @@ -1063,8 +1082,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraReturnType [concrete = constants.%FExtraReturnType] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @FExtraReturnType.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.ea9] // 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: @@ -1078,8 +1095,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingParam [concrete = constants.%FMissingParam] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (@FMissingParam.as.J.impl.%FMissingParam.as.J.impl.F.decl.loc117_31.2), @FMissingParam.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.b6a] // 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: @@ -1093,8 +1108,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingImplicitParam [concrete = constants.%FMissingImplicitParam] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (@FMissingImplicitParam.as.J.impl.%FMissingImplicitParam.as.J.impl.F.decl.loc130_26.2), @FMissingImplicitParam.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.032] // 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: @@ -1108,8 +1121,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingReturnType [concrete = constants.%FMissingReturnType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (@FMissingReturnType.as.J.impl.%FMissingReturnType.as.J.impl.F.decl.loc152_30.2), @FMissingReturnType.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.0e1] // 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: @@ -1123,8 +1134,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamType [concrete = constants.%FDifferentParamType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (@FDifferentParamType.as.J.impl.%FDifferentParamType.as.J.impl.F.decl.loc171_38.2), @FDifferentParamType.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.47d] // 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: @@ -1138,8 +1147,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentImplicitParamType [concrete = constants.%FDifferentImplicitParamType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (@FDifferentImplicitParamType.as.J.impl.%FDifferentImplicitParamType.as.J.impl.F.decl.loc184_38.2), @FDifferentImplicitParamType.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.6ff] // 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: @@ -1153,8 +1160,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentReturnType [concrete = constants.%FDifferentReturnType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (@FDifferentReturnType.as.J.impl.%FDifferentReturnType.as.J.impl.F.decl.loc200_38.2), @FDifferentReturnType.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.e7b] // 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: @@ -1168,8 +1173,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SelfNestedBadParam [concrete = constants.%SelfNestedBadParam] // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [concrete = constants.%SelfNested.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %SelfNested.impl_witness_table = impl_witness_table (@SelfNestedBadParam.as.SelfNested.impl.%SelfNestedBadParam.as.SelfNested.impl.F.decl.loc223_87.2), @SelfNestedBadParam.as.SelfNested.impl [concrete] -// CHECK:STDOUT: %SelfNested.impl_witness: = impl_witness %SelfNested.impl_witness_table [concrete = constants.%SelfNested.impl_witness.ff1] // 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: @@ -1184,8 +1187,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SelfNestedBadReturnType [concrete = constants.%SelfNestedBadReturnType] // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [concrete = constants.%SelfNested.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %SelfNested.impl_witness_table = impl_witness_table (@SelfNestedBadReturnType.as.SelfNested.impl.%SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc239_112.2), @SelfNestedBadReturnType.as.SelfNested.impl [concrete] -// CHECK:STDOUT: %SelfNested.impl_witness: = impl_witness %SelfNested.impl_witness_table [concrete = constants.%SelfNested.impl_witness.238] // 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: diff --git a/toolchain/check/testdata/impl/fail_redefinition.carbon b/toolchain/check/testdata/impl/fail_redefinition.carbon index c9a6c021ab0c0..856becdb40e79 100644 --- a/toolchain/check/testdata/impl/fail_redefinition.carbon +++ b/toolchain/check/testdata/impl/fail_redefinition.carbon @@ -34,7 +34,7 @@ impl i32 as I {} // 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: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @i32.as.I.impl.f4bdd9.1.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -58,8 +58,6 @@ impl i32 as I {} // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @i32.as.I.impl.f4bdd9.1 [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: impl_decl @i32.as.I.impl.f4bdd9.2 [concrete] {} { // 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] @@ -78,8 +76,11 @@ impl i32 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @i32.as.I.impl.f4bdd9.1: %i32 as %I.ref { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @i32.as.I.impl.f4bdd9.1 [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @i32.as.I.impl.f4bdd9.2: %i32 as %I.ref { diff --git a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon index d556b8e63f11f..e299a77345124 100644 --- a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon +++ b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon @@ -69,7 +69,7 @@ impl i32 as I { // CHECK:STDOUT: %assoc0.524: %I.assoc_type = assoc_entity element0, @I.%I.F.decl [concrete] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] -// CHECK:STDOUT: %I.impl_witness.dac: = impl_witness file.%I.impl_witness_table.loc28 [concrete] +// CHECK:STDOUT: %I.impl_witness.dac: = impl_witness @bool.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %I.facet.8da: %I.type = facet_value bool, (%I.impl_witness.dac) [concrete] // CHECK:STDOUT: %C.fb0: type = class_type @C, @C(%I.type, %I.facet.8da) [concrete] // CHECK:STDOUT: %pattern_type.a26: type = pattern_type %C.fb0 [concrete] @@ -79,7 +79,7 @@ impl i32 as I { // 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: %I.impl_witness.5e1: = impl_witness file.%I.impl_witness_table.loc35 [concrete] +// CHECK:STDOUT: %I.impl_witness.5e1: = impl_witness @i32.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %C.899: type = class_type @C, @C(type, %i32) [concrete] // CHECK:STDOUT: %pattern_type.619: type = pattern_type %C.899 [concrete] // CHECK:STDOUT: %i32.as.I.impl.F.type.cea5c5.1: type = fn_type @i32.as.I.impl.F.loc43_18.1 [concrete] @@ -132,15 +132,11 @@ impl i32 as I { // CHECK:STDOUT: %.loc28_6.2: type = converted %Bool.call, %.loc28_6.1 [concrete = bool] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table.loc28 = impl_witness_table (@bool.as.I.impl.%bool.as.I.impl.F.decl), @bool.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness.loc28: = impl_witness %I.impl_witness_table.loc28 [concrete = constants.%I.impl_witness.dac] // CHECK:STDOUT: impl_decl @i32.as.I.impl [concrete] {} { // 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: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table.loc35 = impl_witness_table (@i32.as.I.impl.%i32.as.I.impl.F.decl.loc43_18.2), @i32.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness.loc35: = impl_witness %I.impl_witness_table.loc35 [concrete = constants.%I.impl_witness.5e1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -184,12 +180,14 @@ impl i32 as I { // CHECK:STDOUT: } // CHECK:STDOUT: %c: %C.fb0 = value_binding c, %c.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%bool.as.I.impl.F.decl), @bool.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.dac] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = // CHECK:STDOUT: .I = // CHECK:STDOUT: .F = %bool.as.I.impl.F.decl -// CHECK:STDOUT: witness = file.%I.impl_witness.loc28 +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @i32.as.I.impl: %i32 as %I.ref { @@ -213,11 +211,13 @@ impl i32 as I { // CHECK:STDOUT: %c.param: %C.469 = value_param call_param0 // CHECK:STDOUT: %c: %C.469 = value_binding c, %c.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%i32.as.I.impl.F.decl.loc43_18.2), @i32.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.5e1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = // CHECK:STDOUT: .F = %i32.as.I.impl.F.decl.loc43_18.1 -// CHECK:STDOUT: witness = file.%I.impl_witness.loc35 +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%T.loc15_9.2: type, %X.loc15_19.2: @C.%T.loc15_9.1 (%T)) { diff --git a/toolchain/check/testdata/impl/forward_decls.carbon b/toolchain/check/testdata/impl/forward_decls.carbon index 54915b31a0000..74d1e935cc798 100644 --- a/toolchain/check/testdata/impl/forward_decls.carbon +++ b/toolchain/check/testdata/impl/forward_decls.carbon @@ -285,7 +285,7 @@ interface I { // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @empty_struct_type.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -308,8 +308,6 @@ interface I { // CHECK:STDOUT: %.loc4_7.2: type = converted %.loc4_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %I.ref.loc4: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @empty_struct_type.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: %I.decl.loc6: type = interface_decl @I [concrete = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} { // CHECK:STDOUT: %.loc7_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] @@ -329,8 +327,11 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc4_7.2 as %I.ref.loc4 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @empty_struct_type.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- method.carbon @@ -339,7 +340,7 @@ interface I { // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @empty_struct_type.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %I.G.type: type = fn_type @I.G [concrete] // CHECK:STDOUT: %I.G: %I.G.type = struct_value () [concrete] @@ -369,8 +370,6 @@ interface I { // CHECK:STDOUT: %.loc4_7.2: type = converted %.loc4_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %I.ref.loc4: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@empty_struct_type.as.I.impl.%empty_struct_type.as.I.impl.G.decl), @empty_struct_type.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: %I.decl.loc6: type = interface_decl @I [concrete = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} { // CHECK:STDOUT: %.loc9_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] @@ -394,10 +393,12 @@ interface I { // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc4_7.2 as %I.ref.loc4 { // CHECK:STDOUT: %empty_struct_type.as.I.impl.G.decl: %empty_struct_type.as.I.impl.G.type = fn_decl @empty_struct_type.as.I.impl.G [concrete = constants.%empty_struct_type.as.I.impl.G] {} {} +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%empty_struct_type.as.I.impl.G.decl), @empty_struct_type.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G = %empty_struct_type.as.I.impl.G.decl -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @I.G(@I.%Self: %I.type) { @@ -429,7 +430,7 @@ interface I { // 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 %I.type, %type.as.BitAndWith.impl.Op [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @empty_struct_type.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %Self.dba: %I.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -462,8 +463,6 @@ interface I { // CHECK:STDOUT: %bound_method.loc4: = bound_method %I.ref.loc4_12, %impl.elem0.loc4 [concrete = constants.%type.as.BitAndWith.impl.Op.bound] // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc4: init type = call %bound_method.loc4(%I.ref.loc4_12, %I.ref.loc4_16) [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @empty_struct_type.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: %I.decl.loc6: type = interface_decl @I [concrete = constants.%I.type] {} {} // CHECK:STDOUT: %.loc7_14.1: type = value_of_initializer @empty_struct_type.as.I.impl.%type.as.BitAndWith.impl.Op.call.loc7 [concrete = constants.%I.type] // CHECK:STDOUT: %.loc7_14.2: type = converted @empty_struct_type.as.I.impl.%type.as.BitAndWith.impl.Op.call.loc7, %.loc7_14.1 [concrete = constants.%I.type] @@ -489,8 +488,11 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc4_7.2 as file.%.loc4_14.2 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @empty_struct_type.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- associated_const.carbon @@ -509,7 +511,7 @@ interface I { // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @empty_struct_type.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -543,9 +545,6 @@ interface I { // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc6, %.loc6_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @empty_struct_type.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} { // CHECK:STDOUT: %.loc8_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] @@ -584,8 +583,12 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc6_7.2 as %.loc6_14 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @empty_struct_type.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @T(constants.%Self) {} @@ -609,7 +612,7 @@ interface I { // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete] // CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: } @@ -647,9 +650,6 @@ interface I { // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc7, %.loc7_25.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type = value_binding_pattern x [concrete] // CHECK:STDOUT: } @@ -701,8 +701,12 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.I.impl: %C.ref.loc7 as %.loc7_13 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -742,7 +746,7 @@ interface I { // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete] // CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: } @@ -780,9 +784,6 @@ interface I { // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc7, %.loc7_25.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type = value_binding_pattern x [concrete] // CHECK:STDOUT: } @@ -836,8 +837,12 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.I.impl: %C.ref.loc7 as %.loc7_13 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -870,7 +875,7 @@ interface I { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] @@ -897,8 +902,6 @@ interface I { // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %I.ref.loc7: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: = value_binding_pattern x [concrete] // CHECK:STDOUT: } @@ -938,8 +941,11 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.I.impl: %C.ref.loc7 as %I.ref.loc7 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -1075,7 +1081,7 @@ interface I { // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %.Self.615, @I, @I(%C) [symbolic_self] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %I_where.type: type = facet_type <@I, @I(%C) where %impl.elem0 = %C> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @D.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1119,9 +1125,6 @@ interface I { // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc8, %C.ref.loc8_27 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @D.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C [concrete = constants.%C] // CHECK:STDOUT: %C.decl.loc10: type = class_decl @C [concrete = constants.%C] {} {} // CHECK:STDOUT: impl_decl @D.as.I.impl [concrete] {} { // CHECK:STDOUT: %D.ref.loc11: type = name_ref D, file.%D.decl [concrete = constants.%D] @@ -1172,8 +1175,12 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @D.as.I.impl: %D.ref.loc8 as %.loc8_16 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @D.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C [concrete = constants.%C] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -1217,7 +1224,7 @@ interface I { // CHECK:STDOUT: %D: type = class_type @D [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @D.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %T: %I.type = symbolic_binding T, 0 [symbolic] @@ -1255,8 +1262,6 @@ interface I { // CHECK:STDOUT: %D.ref.loc5: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %I.ref.loc5: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @D.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: %C.decl.loc6: %C.type = class_decl @C [concrete = constants.%C.generic] { // CHECK:STDOUT: %T.patt: %pattern_type.a15 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { @@ -1321,8 +1326,11 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @D.as.I.impl: %D.ref.loc5 as %I.ref.loc5 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @D.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { @@ -1459,7 +1467,7 @@ interface I { // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1494,9 +1502,6 @@ interface I { // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc9, %.loc9_25.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, ), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} { // CHECK:STDOUT: %C.ref.loc18: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %I.ref.loc18: type = name_ref I, file.%I.decl [concrete = constants.%I.type] @@ -1542,8 +1547,12 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.I.impl: %C.ref.loc9 as %.loc9_13 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, ), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -1576,7 +1585,7 @@ interface I { // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %X.impl_witness: = impl_witness file.%X.impl_witness_table [concrete] +// CHECK:STDOUT: %X.impl_witness: = impl_witness @C.as.X.impl.%X.impl_witness_table [concrete] // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete] // CHECK:STDOUT: %Self.35a: %X.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] @@ -1589,7 +1598,7 @@ interface I { // CHECK:STDOUT: %G.specific_fn: = specific_function %G, @G(%X.facet) [concrete] // CHECK:STDOUT: %Self.1f7: %Y.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %require_complete: = require_complete_type %U.binding.as_type [symbolic] -// CHECK:STDOUT: %Y.impl_witness: = impl_witness file.%Y.impl_witness_table [concrete] +// CHECK:STDOUT: %Y.impl_witness: = impl_witness @C.as.Y.impl.%Y.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1643,8 +1652,6 @@ interface I { // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C] // CHECK:STDOUT: %X.ref.loc12: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %X.impl_witness_table = impl_witness_table (), @C.as.X.impl [concrete] -// CHECK:STDOUT: %X.impl_witness: = impl_witness %X.impl_witness_table [concrete = constants.%X.impl_witness] // CHECK:STDOUT: %Y.decl.loc14: type = interface_decl @Y [concrete = constants.%Y.type] {} {} // CHECK:STDOUT: %X.decl.loc16: type = interface_decl @X [concrete = constants.%X.type] {} {} // CHECK:STDOUT: %C.decl.loc23: type = class_decl @C [concrete = constants.%C] {} {} @@ -1688,8 +1695,6 @@ interface I { // CHECK:STDOUT: %C.ref.loc36: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C] // CHECK:STDOUT: %Y.ref.loc36: type = name_ref Y, file.%Y.decl.loc14 [concrete = constants.%Y.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (), @C.as.Y.impl [concrete] -// CHECK:STDOUT: %Y.impl_witness: = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness] // CHECK:STDOUT: impl_decl @C.as.X.impl [concrete] {} { // CHECK:STDOUT: %C.ref.loc37: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C] // CHECK:STDOUT: %X.ref.loc37: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type] @@ -1721,13 +1726,19 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.X.impl: %C.ref.loc12 as %X.ref.loc12 { +// CHECK:STDOUT: %X.impl_witness_table = impl_witness_table (), @C.as.X.impl [concrete] +// CHECK:STDOUT: %X.impl_witness: = impl_witness %X.impl_witness_table [concrete = constants.%X.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%X.impl_witness +// CHECK:STDOUT: witness = %X.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.Y.impl: %C.ref.loc36 as %Y.ref.loc36 { +// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (), @C.as.Y.impl [concrete] +// CHECK:STDOUT: %Y.impl_witness: = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Y.impl_witness +// CHECK:STDOUT: witness = %Y.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -1819,7 +1830,7 @@ interface I { // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness @I.F.%I.impl_witness_table, @C.as.I.impl(%Self) [symbolic] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table, @C.as.I.impl(%Self) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1855,14 +1866,17 @@ interface I { // CHECK:STDOUT: generic impl @C.as.I.impl(@I.%Self: %I.type) { // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness @I.F.%I.impl_witness_table, @C.as.I.impl(%Self) [symbolic = %I.impl_witness (constants.%I.impl_witness)] +// CHECK:STDOUT: %I.impl_witness.loc11_16.2: = impl_witness %I.impl_witness_table, @C.as.I.impl(%Self) [symbolic = %I.impl_witness.loc11_16.2 (constants.%I.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref.loc11 as %I.ref.loc11 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness.loc11_16.1: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%Self) [symbolic = %I.impl_witness.loc11_16.2 (constants.%I.impl_witness)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = -// CHECK:STDOUT: witness = @I.F.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness.loc11_16.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1890,8 +1904,6 @@ interface I { // CHECK:STDOUT: %C.ref.loc11: type = name_ref C, @I.F.%C.decl [symbolic = %C (constants.%C)] // CHECK:STDOUT: %I.ref.loc11: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%Self) [symbolic = @C.as.I.impl.%I.impl_witness (constants.%I.impl_witness)] // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} { // CHECK:STDOUT: %C.ref.loc20: type = name_ref C, @I.F.%C.decl [symbolic = %C (constants.%C)] // CHECK:STDOUT: %I.ref.loc20: type = name_ref I, file.%I.decl [concrete = constants.%I.type] @@ -1907,7 +1919,7 @@ interface I { // CHECK:STDOUT: specific @C.as.I.impl(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: %C => constants.%C -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness +// CHECK:STDOUT: %I.impl_witness.loc11_16.2 => constants.%I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_impl_in_interface_definition_with_associated.carbon @@ -1928,7 +1940,7 @@ interface I { // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %.Self, @I [symbolic_self] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %C> [symbolic] -// CHECK:STDOUT: %I.impl_witness: = impl_witness @I.F.%I.impl_witness_table, @C.as.I.impl(%Self) [symbolic] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table, @C.as.I.impl(%Self) [symbolic] // CHECK:STDOUT: %require_complete: = require_complete_type %I_where.type [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1974,15 +1986,19 @@ interface I { // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where constants.%impl.elem0 = %C> [symbolic = %I_where.type (constants.%I_where.type)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness @I.F.%I.impl_witness_table, @C.as.I.impl(%Self) [symbolic = %I.impl_witness (constants.%I.impl_witness)] +// CHECK:STDOUT: %I.impl_witness.loc12_29.2: = impl_witness %I.impl_witness_table, @C.as.I.impl(%Self) [symbolic = %I.impl_witness.loc12_29.2 (constants.%I.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %I_where.type [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref.loc12_10 as %.loc12_17 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, ), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness.loc12_29.1: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%Self) [symbolic = %I.impl_witness.loc12_29.2 (constants.%I.impl_witness)] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C [symbolic = %C (constants.%C)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = -// CHECK:STDOUT: witness = @I.F.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness.loc12_29.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2021,9 +2037,6 @@ interface I { // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc12, %C.ref.loc12_28 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, ), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%Self) [symbolic = @C.as.I.impl.%I.impl_witness (constants.%I.impl_witness)] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C [symbolic = @C.as.I.impl.%C (constants.%C)] // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} { // CHECK:STDOUT: %C.ref.loc21_10: type = name_ref C, @I.F.%C.decl [symbolic = %C (constants.%C)] // CHECK:STDOUT: %I.ref.loc21: type = name_ref I, file.%I.decl [concrete = constants.%I.type] @@ -2055,6 +2068,6 @@ interface I { // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: %C => constants.%C // CHECK:STDOUT: %I_where.type => constants.%I_where.type -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness +// CHECK:STDOUT: %I.impl_witness.loc12_29.2 => constants.%I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/generic_redeclaration.carbon b/toolchain/check/testdata/impl/generic_redeclaration.carbon index e3b1a11979afe..a9629165a58ef 100644 --- a/toolchain/check/testdata/impl/generic_redeclaration.carbon +++ b/toolchain/check/testdata/impl/generic_redeclaration.carbon @@ -136,19 +136,19 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: %T.50f: %I.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.a15: type = pattern_type %I.type [concrete] // CHECK:STDOUT: %T.binding.as_type.419: type = symbolic_binding_type T, 0, %T.50f [symbolic] -// CHECK:STDOUT: %Interface.impl_witness.a00: = impl_witness file.%Interface.impl_witness_table.loc12, @T.binding.as_type.as.Interface.impl.c44(%T.50f) [symbolic] +// CHECK:STDOUT: %Interface.impl_witness.a00: = impl_witness @T.binding.as_type.as.Interface.impl.c44.%Interface.impl_witness_table, @T.binding.as_type.as.Interface.impl.c44(%T.50f) [symbolic] // CHECK:STDOUT: %T.a68: %J.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.70b: type = pattern_type %J.type [concrete] // CHECK:STDOUT: %T.binding.as_type.735: type = symbolic_binding_type T, 0, %T.a68 [symbolic] -// CHECK:STDOUT: %Interface.impl_witness.7ca: = impl_witness file.%Interface.impl_witness_table.loc13, @T.binding.as_type.as.Interface.impl.888(%T.a68) [symbolic] +// CHECK:STDOUT: %Interface.impl_witness.7ca: = impl_witness @T.binding.as_type.as.Interface.impl.888.%Interface.impl_witness_table, @T.binding.as_type.as.Interface.impl.888(%T.a68) [symbolic] // CHECK:STDOUT: %T.744: %K.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.0e9: type = pattern_type %K.type [concrete] // CHECK:STDOUT: %T.binding.as_type.a89: type = symbolic_binding_type T, 0, %T.744 [symbolic] -// CHECK:STDOUT: %Interface.impl_witness.21d: = impl_witness file.%Interface.impl_witness_table.loc14, @T.binding.as_type.as.Interface.impl.d4f(%T.744) [symbolic] +// CHECK:STDOUT: %Interface.impl_witness.21d: = impl_witness @T.binding.as_type.as.Interface.impl.d4f.%Interface.impl_witness_table, @T.binding.as_type.as.Interface.impl.d4f(%T.744) [symbolic] // CHECK:STDOUT: %T.4e4: %L.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.307: type = pattern_type %L.type [concrete] // CHECK:STDOUT: %T.binding.as_type.b5a: type = symbolic_binding_type T, 0, %T.4e4 [symbolic] -// CHECK:STDOUT: %Interface.impl_witness.d90: = impl_witness file.%Interface.impl_witness_table.loc15, @T.binding.as_type.as.Interface.impl.0b1(%T.4e4) [symbolic] +// CHECK:STDOUT: %Interface.impl_witness.d90: = impl_witness @T.binding.as_type.as.Interface.impl.0b1.%Interface.impl_witness_table, @T.binding.as_type.as.Interface.impl.0b1(%T.4e4) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -186,8 +186,6 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc12_14.1: %I.type = symbolic_binding T, 0 [symbolic = %T.loc12_14.2 (constants.%T.50f)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Interface.impl_witness_table.loc12 = impl_witness_table (), @T.binding.as_type.as.Interface.impl.c44 [concrete] -// CHECK:STDOUT: %Interface.impl_witness.loc12: = impl_witness %Interface.impl_witness_table.loc12, @T.binding.as_type.as.Interface.impl.c44(constants.%T.50f) [symbolic = @T.binding.as_type.as.Interface.impl.c44.%Interface.impl_witness (constants.%Interface.impl_witness.a00)] // CHECK:STDOUT: impl_decl @T.binding.as_type.as.Interface.impl.888 [concrete] { // CHECK:STDOUT: %T.patt: %pattern_type.70b = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { @@ -201,8 +199,6 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc13_14.1: %J.type = symbolic_binding T, 0 [symbolic = %T.loc13_14.2 (constants.%T.a68)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Interface.impl_witness_table.loc13 = impl_witness_table (), @T.binding.as_type.as.Interface.impl.888 [concrete] -// CHECK:STDOUT: %Interface.impl_witness.loc13: = impl_witness %Interface.impl_witness_table.loc13, @T.binding.as_type.as.Interface.impl.888(constants.%T.a68) [symbolic = @T.binding.as_type.as.Interface.impl.888.%Interface.impl_witness (constants.%Interface.impl_witness.7ca)] // CHECK:STDOUT: impl_decl @T.binding.as_type.as.Interface.impl.d4f [concrete] { // CHECK:STDOUT: %T.patt: %pattern_type.0e9 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { @@ -216,8 +212,6 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc14_14.1: %K.type = symbolic_binding T, 0 [symbolic = %T.loc14_14.2 (constants.%T.744)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Interface.impl_witness_table.loc14 = impl_witness_table (), @T.binding.as_type.as.Interface.impl.d4f [concrete] -// CHECK:STDOUT: %Interface.impl_witness.loc14: = impl_witness %Interface.impl_witness_table.loc14, @T.binding.as_type.as.Interface.impl.d4f(constants.%T.744) [symbolic = @T.binding.as_type.as.Interface.impl.d4f.%Interface.impl_witness (constants.%Interface.impl_witness.21d)] // CHECK:STDOUT: impl_decl @T.binding.as_type.as.Interface.impl.0b1 [concrete] { // CHECK:STDOUT: %T.patt: %pattern_type.307 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { @@ -231,8 +225,6 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc15_14.1: %L.type = symbolic_binding T, 0 [symbolic = %T.loc15_14.2 (constants.%T.4e4)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Interface.impl_witness_table.loc15 = impl_witness_table (), @T.binding.as_type.as.Interface.impl.0b1 [concrete] -// CHECK:STDOUT: %Interface.impl_witness.loc15: = impl_witness %Interface.impl_witness_table.loc15, @T.binding.as_type.as.Interface.impl.0b1(constants.%T.4e4) [symbolic = @T.binding.as_type.as.Interface.impl.0b1.%Interface.impl_witness (constants.%Interface.impl_witness.d90)] // CHECK:STDOUT: impl_decl @T.binding.as_type.as.Interface.impl.c44 [concrete] { // CHECK:STDOUT: %T.patt: %pattern_type.a15 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { @@ -340,77 +332,89 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: generic impl @T.binding.as_type.as.Interface.impl.c44(%T.loc12_14.1: %I.type) { // CHECK:STDOUT: %T.loc12_14.2: %I.type = symbolic_binding T, 0 [symbolic = %T.loc12_14.2 (constants.%T.50f)] // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc12_14.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.419)] -// CHECK:STDOUT: %Interface.impl_witness: = impl_witness file.%Interface.impl_witness_table.loc12, @T.binding.as_type.as.Interface.impl.c44(%T.loc12_14.2) [symbolic = %Interface.impl_witness (constants.%Interface.impl_witness.a00)] +// CHECK:STDOUT: %Interface.impl_witness.loc12_35.2: = impl_witness %Interface.impl_witness_table, @T.binding.as_type.as.Interface.impl.c44(%T.loc12_14.2) [symbolic = %Interface.impl_witness.loc12_35.2 (constants.%Interface.impl_witness.a00)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc12_21 as %Interface.ref.loc12 { +// CHECK:STDOUT: %Interface.impl_witness_table = impl_witness_table (), @T.binding.as_type.as.Interface.impl.c44 [concrete] +// CHECK:STDOUT: %Interface.impl_witness.loc12_35.1: = impl_witness %Interface.impl_witness_table, @T.binding.as_type.as.Interface.impl.c44(constants.%T.50f) [symbolic = %Interface.impl_witness.loc12_35.2 (constants.%Interface.impl_witness.a00)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Interface.impl_witness.loc12 +// CHECK:STDOUT: witness = %Interface.impl_witness.loc12_35.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @T.binding.as_type.as.Interface.impl.888(%T.loc13_14.1: %J.type) { // CHECK:STDOUT: %T.loc13_14.2: %J.type = symbolic_binding T, 0 [symbolic = %T.loc13_14.2 (constants.%T.a68)] // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc13_14.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.735)] -// CHECK:STDOUT: %Interface.impl_witness: = impl_witness file.%Interface.impl_witness_table.loc13, @T.binding.as_type.as.Interface.impl.888(%T.loc13_14.2) [symbolic = %Interface.impl_witness (constants.%Interface.impl_witness.7ca)] +// CHECK:STDOUT: %Interface.impl_witness.loc13_35.2: = impl_witness %Interface.impl_witness_table, @T.binding.as_type.as.Interface.impl.888(%T.loc13_14.2) [symbolic = %Interface.impl_witness.loc13_35.2 (constants.%Interface.impl_witness.7ca)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc13_21 as %Interface.ref.loc13 { +// CHECK:STDOUT: %Interface.impl_witness_table = impl_witness_table (), @T.binding.as_type.as.Interface.impl.888 [concrete] +// CHECK:STDOUT: %Interface.impl_witness.loc13_35.1: = impl_witness %Interface.impl_witness_table, @T.binding.as_type.as.Interface.impl.888(constants.%T.a68) [symbolic = %Interface.impl_witness.loc13_35.2 (constants.%Interface.impl_witness.7ca)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Interface.impl_witness.loc13 +// CHECK:STDOUT: witness = %Interface.impl_witness.loc13_35.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @T.binding.as_type.as.Interface.impl.d4f(%T.loc14_14.1: %K.type) { // CHECK:STDOUT: %T.loc14_14.2: %K.type = symbolic_binding T, 0 [symbolic = %T.loc14_14.2 (constants.%T.744)] // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc14_14.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.a89)] -// CHECK:STDOUT: %Interface.impl_witness: = impl_witness file.%Interface.impl_witness_table.loc14, @T.binding.as_type.as.Interface.impl.d4f(%T.loc14_14.2) [symbolic = %Interface.impl_witness (constants.%Interface.impl_witness.21d)] +// CHECK:STDOUT: %Interface.impl_witness.loc14_35.2: = impl_witness %Interface.impl_witness_table, @T.binding.as_type.as.Interface.impl.d4f(%T.loc14_14.2) [symbolic = %Interface.impl_witness.loc14_35.2 (constants.%Interface.impl_witness.21d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc14_21 as %Interface.ref.loc14 { +// CHECK:STDOUT: %Interface.impl_witness_table = impl_witness_table (), @T.binding.as_type.as.Interface.impl.d4f [concrete] +// CHECK:STDOUT: %Interface.impl_witness.loc14_35.1: = impl_witness %Interface.impl_witness_table, @T.binding.as_type.as.Interface.impl.d4f(constants.%T.744) [symbolic = %Interface.impl_witness.loc14_35.2 (constants.%Interface.impl_witness.21d)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Interface.impl_witness.loc14 +// CHECK:STDOUT: witness = %Interface.impl_witness.loc14_35.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @T.binding.as_type.as.Interface.impl.0b1(%T.loc15_14.1: %L.type) { // CHECK:STDOUT: %T.loc15_14.2: %L.type = symbolic_binding T, 0 [symbolic = %T.loc15_14.2 (constants.%T.4e4)] // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc15_14.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.b5a)] -// CHECK:STDOUT: %Interface.impl_witness: = impl_witness file.%Interface.impl_witness_table.loc15, @T.binding.as_type.as.Interface.impl.0b1(%T.loc15_14.2) [symbolic = %Interface.impl_witness (constants.%Interface.impl_witness.d90)] +// CHECK:STDOUT: %Interface.impl_witness.loc15_35.2: = impl_witness %Interface.impl_witness_table, @T.binding.as_type.as.Interface.impl.0b1(%T.loc15_14.2) [symbolic = %Interface.impl_witness.loc15_35.2 (constants.%Interface.impl_witness.d90)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc15_21 as %Interface.ref.loc15 { +// CHECK:STDOUT: %Interface.impl_witness_table = impl_witness_table (), @T.binding.as_type.as.Interface.impl.0b1 [concrete] +// CHECK:STDOUT: %Interface.impl_witness.loc15_35.1: = impl_witness %Interface.impl_witness_table, @T.binding.as_type.as.Interface.impl.0b1(constants.%T.4e4) [symbolic = %Interface.impl_witness.loc15_35.2 (constants.%Interface.impl_witness.d90)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Interface.impl_witness.loc15 +// CHECK:STDOUT: witness = %Interface.impl_witness.loc15_35.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @T.binding.as_type.as.Interface.impl.c44(constants.%T.50f) { // CHECK:STDOUT: %T.loc12_14.2 => constants.%T.50f // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type.419 -// CHECK:STDOUT: %Interface.impl_witness => constants.%Interface.impl_witness.a00 +// CHECK:STDOUT: %Interface.impl_witness.loc12_35.2 => constants.%Interface.impl_witness.a00 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @T.binding.as_type.as.Interface.impl.888(constants.%T.a68) { // CHECK:STDOUT: %T.loc13_14.2 => constants.%T.a68 // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type.735 -// CHECK:STDOUT: %Interface.impl_witness => constants.%Interface.impl_witness.7ca +// CHECK:STDOUT: %Interface.impl_witness.loc13_35.2 => constants.%Interface.impl_witness.7ca // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @T.binding.as_type.as.Interface.impl.d4f(constants.%T.744) { // CHECK:STDOUT: %T.loc14_14.2 => constants.%T.744 // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type.a89 -// CHECK:STDOUT: %Interface.impl_witness => constants.%Interface.impl_witness.21d +// CHECK:STDOUT: %Interface.impl_witness.loc14_35.2 => constants.%Interface.impl_witness.21d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @T.binding.as_type.as.Interface.impl.0b1(constants.%T.4e4) { // CHECK:STDOUT: %T.loc15_14.2 => constants.%T.4e4 // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type.b5a -// CHECK:STDOUT: %Interface.impl_witness => constants.%Interface.impl_witness.d90 +// CHECK:STDOUT: %Interface.impl_witness.loc15_35.2 => constants.%Interface.impl_witness.d90 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_same_self_and_interface_redefined.carbon @@ -425,7 +429,7 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: %T: %I.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type: type = pattern_type %I.type [concrete] // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic] -// CHECK:STDOUT: %J.impl_witness: = impl_witness file.%J.impl_witness_table, @T.binding.as_type.as.J.impl.04a1a2.1(%T) [symbolic] +// CHECK:STDOUT: %J.impl_witness: = impl_witness @T.binding.as_type.as.J.impl.04a1a2.1.%J.impl_witness_table, @T.binding.as_type.as.J.impl.04a1a2.1(%T) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -457,8 +461,6 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc7_14.1: %I.type = symbolic_binding T, 0 [symbolic = %T.loc7_14.2 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (), @T.binding.as_type.as.J.impl.04a1a2.1 [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table, @T.binding.as_type.as.J.impl.04a1a2.1(constants.%T) [symbolic = @T.binding.as_type.as.J.impl.04a1a2.1.%J.impl_witness (constants.%J.impl_witness)] // CHECK:STDOUT: impl_decl @T.binding.as_type.as.J.impl.04a1a2.2 [concrete] { // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { @@ -497,13 +499,16 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: generic impl @T.binding.as_type.as.J.impl.04a1a2.1(%T.loc7_14.1: %I.type) { // CHECK:STDOUT: %T.loc7_14.2: %I.type = symbolic_binding T, 0 [symbolic = %T.loc7_14.2 (constants.%T)] // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc7_14.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %J.impl_witness: = impl_witness file.%J.impl_witness_table, @T.binding.as_type.as.J.impl.04a1a2.1(%T.loc7_14.2) [symbolic = %J.impl_witness (constants.%J.impl_witness)] +// CHECK:STDOUT: %J.impl_witness.loc7_28.2: = impl_witness %J.impl_witness_table, @T.binding.as_type.as.J.impl.04a1a2.1(%T.loc7_14.2) [symbolic = %J.impl_witness.loc7_28.2 (constants.%J.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc7_21 as %J.ref { +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (), @T.binding.as_type.as.J.impl.04a1a2.1 [concrete] +// CHECK:STDOUT: %J.impl_witness.loc7_28.1: = impl_witness %J.impl_witness_table, @T.binding.as_type.as.J.impl.04a1a2.1(constants.%T) [symbolic = %J.impl_witness.loc7_28.2 (constants.%J.impl_witness)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%J.impl_witness +// CHECK:STDOUT: witness = %J.impl_witness.loc7_28.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -522,7 +527,7 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: specific @T.binding.as_type.as.J.impl.04a1a2.1(constants.%T) { // CHECK:STDOUT: %T.loc7_14.2 => constants.%T // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type -// CHECK:STDOUT: %J.impl_witness => constants.%J.impl_witness +// CHECK:STDOUT: %J.impl_witness.loc7_28.2 => constants.%J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @T.binding.as_type.as.J.impl.04a1a2.2(constants.%T) { @@ -536,11 +541,11 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %I.impl_witness.2fa5bf.1: = impl_witness file.%I.impl_witness_table.loc9 [concrete] +// CHECK:STDOUT: %I.impl_witness.2fa5bf.1: = impl_witness @C.as.I.impl.518eb8.1.%I.impl_witness_table [concrete] // CHECK:STDOUT: %tuple.type: type = tuple_type (type, type) [concrete] // CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%C, %C) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] -// CHECK:STDOUT: %I.impl_witness.2fa5bf.2: = impl_witness file.%I.impl_witness_table.loc17 [concrete] +// CHECK:STDOUT: %I.impl_witness.2fa5bf.2: = impl_witness @C.as.I.impl.518eb8.2.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -563,8 +568,6 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table.loc9 = impl_witness_table (), @C.as.I.impl.518eb8.1 [concrete] -// CHECK:STDOUT: %I.impl_witness.loc9: = impl_witness %I.impl_witness_table.loc9 [concrete = constants.%I.impl_witness.2fa5bf.1] // CHECK:STDOUT: impl_decl @C.as.I.impl.518eb8.2 [concrete] {} { // CHECK:STDOUT: %C.ref.loc17_7: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %C.ref.loc17_10: type = name_ref C, file.%C.decl [concrete = constants.%C] @@ -575,8 +578,6 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: %tuple.elem0: type = tuple_access %.loc17_11.2, element0 [concrete = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table.loc17 = impl_witness_table (), @C.as.I.impl.518eb8.2 [concrete] -// CHECK:STDOUT: %I.impl_witness.loc17: = impl_witness %I.impl_witness_table.loc17 [concrete = constants.%I.impl_witness.2fa5bf.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -590,13 +591,19 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.I.impl.518eb8.1: %C.ref as %I.ref { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl.518eb8.1 [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.2fa5bf.1] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness.loc9 +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.I.impl.518eb8.2: %tuple.elem0 as %I.ref { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl.518eb8.2 [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.2fa5bf.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness.loc17 +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C; @@ -610,7 +617,7 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @T.as.I.impl.415ff1.1(%T) [symbolic] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @T.as.I.impl.415ff1.1.%I.impl_witness_table, @T.as.I.impl.415ff1.1(%T) [symbolic] // CHECK:STDOUT: %T.as.I.impl.A.type: type = fn_type @T.as.I.impl.A, @T.as.I.impl.415ff1.1(%T) [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %T.as.I.impl.A: %T.as.I.impl.A.type = struct_value () [symbolic] @@ -647,8 +654,6 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc4_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_14.1 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @T.as.I.impl.415ff1.1 [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table, @T.as.I.impl.415ff1.1(constants.%T) [symbolic = @T.as.I.impl.415ff1.1.%I.impl_witness (constants.%I.impl_witness)] // CHECK:STDOUT: impl_decl @T.as.I.impl.415ff1.2 [concrete] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { @@ -671,7 +676,7 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: // CHECK:STDOUT: generic impl @T.as.I.impl.415ff1.1(%T.loc4_14.2: type) { // CHECK:STDOUT: %T.loc4_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_14.1 (constants.%T)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @T.as.I.impl.415ff1.1(%T.loc4_14.1) [symbolic = %I.impl_witness (constants.%I.impl_witness)] +// CHECK:STDOUT: %I.impl_witness.loc4_31.2: = impl_witness %I.impl_witness_table, @T.as.I.impl.415ff1.1(%T.loc4_14.1) [symbolic = %I.impl_witness.loc4_31.2 (constants.%I.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as.I.impl.A.type: type = fn_type @T.as.I.impl.A, @T.as.I.impl.415ff1.1(%T.loc4_14.1) [symbolic = %T.as.I.impl.A.type (constants.%T.as.I.impl.A.type)] @@ -679,10 +684,12 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref as %I.ref { // CHECK:STDOUT: %T.as.I.impl.A.decl: @T.as.I.impl.415ff1.1.%T.as.I.impl.A.type (%T.as.I.impl.A.type) = fn_decl @T.as.I.impl.A [symbolic = @T.as.I.impl.415ff1.1.%T.as.I.impl.A (constants.%T.as.I.impl.A)] {} {} +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @T.as.I.impl.415ff1.1 [concrete] +// CHECK:STDOUT: %I.impl_witness.loc4_31.1: = impl_witness %I.impl_witness_table, @T.as.I.impl.415ff1.1(constants.%T) [symbolic = %I.impl_witness.loc4_31.2 (constants.%I.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .A = %T.as.I.impl.A.decl -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness.loc4_31.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -775,7 +782,7 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: // CHECK:STDOUT: specific @T.as.I.impl.415ff1.1(constants.%T) { // CHECK:STDOUT: %T.loc4_14.1 => constants.%T -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness +// CHECK:STDOUT: %I.impl_witness.loc4_31.2 => constants.%I.impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as.I.impl.A.type => constants.%T.as.I.impl.A.type diff --git a/toolchain/check/testdata/impl/impl_as.carbon b/toolchain/check/testdata/impl/impl_as.carbon index d521ad0606505..a206fca6e95f2 100644 --- a/toolchain/check/testdata/impl/impl_as.carbon +++ b/toolchain/check/testdata/impl/impl_as.carbon @@ -36,7 +36,7 @@ class C { // CHECK:STDOUT: %Simple.assoc_type: type = assoc_entity_type @Simple [concrete] // CHECK:STDOUT: %assoc0.e8d: %Simple.assoc_type = assoc_entity element0, @Simple.%Simple.F.decl [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %Simple.impl_witness: = impl_witness @C.%Simple.impl_witness_table [concrete] +// CHECK:STDOUT: %Simple.impl_witness: = impl_witness @C.as.Simple.impl.%Simple.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.Simple.impl.F.type: type = fn_type @C.as.Simple.impl.F [concrete] // CHECK:STDOUT: %C.as.Simple.impl.F: %C.as.Simple.impl.F.type = struct_value () [concrete] // CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %C, (%Simple.impl_witness) [concrete] @@ -88,11 +88,13 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.Simple.impl: %Self.ref as %Simple.ref { // CHECK:STDOUT: %C.as.Simple.impl.F.decl: %C.as.Simple.impl.F.type = fn_decl @C.as.Simple.impl.F [concrete = constants.%C.as.Simple.impl.F] {} {} +// CHECK:STDOUT: %Simple.impl_witness_table = impl_witness_table (%C.as.Simple.impl.F.decl), @C.as.Simple.impl [concrete] +// CHECK:STDOUT: %Simple.impl_witness: = impl_witness %Simple.impl_witness_table [concrete = constants.%Simple.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %C.as.Simple.impl.F.decl // CHECK:STDOUT: .C = -// CHECK:STDOUT: witness = @C.%Simple.impl_witness +// CHECK:STDOUT: witness = %Simple.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -100,8 +102,6 @@ class C { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [concrete = constants.%Simple.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Simple.impl_witness_table = impl_witness_table (@C.as.Simple.impl.%C.as.Simple.impl.F.decl), @C.as.Simple.impl [concrete] -// CHECK:STDOUT: %Simple.impl_witness: = impl_witness %Simple.impl_witness_table [concrete = constants.%Simple.impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/impl_assoc_const_with_prelude.carbon b/toolchain/check/testdata/impl/impl_assoc_const_with_prelude.carbon index 831412d0a98e9..a3d4d84cbc070 100644 --- a/toolchain/check/testdata/impl/impl_assoc_const_with_prelude.carbon +++ b/toolchain/check/testdata/impl/impl_assoc_const_with_prelude.carbon @@ -105,7 +105,7 @@ impl () as I where .X = {.a = true, .b = (1, 2)} and .X = {.a = false, .b = (3, // CHECK:STDOUT: %Core.IntLiteral.as.DivWith.impl.Op: %Core.IntLiteral.as.DivWith.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.DivWith.impl.Op.bound: = bound_method %int_4, %Core.IntLiteral.as.DivWith.impl.Op [concrete] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0.71a = %struct.682> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @empty_tuple.type.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -221,9 +221,6 @@ impl () as I where .X = {.a = true, .b = (1, 2)} and .X = {.a = false, .b = (3, // CHECK:STDOUT: requirement_rewrite %impl.elem0.subst, %.loc6_95.3 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @empty_tuple.type.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.a.b.fe2 = impl_witness_assoc_constant constants.%struct.682 [concrete = constants.%struct.682] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -245,8 +242,12 @@ impl () as I where .X = {.a = true, .b = (1, 2)} and .X = {.a = false, .b = (3, // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_tuple.type.as.I.impl: %.loc6_7.2 as %.loc6_14 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @empty_tuple.type.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.a.b.fe2 = impl_witness_assoc_constant constants.%struct.682 [concrete = constants.%struct.682] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @X(constants.%Self.dba) {} diff --git a/toolchain/check/testdata/impl/impl_forall.carbon b/toolchain/check/testdata/impl/impl_forall.carbon index 2d42d81c98990..8c8c32b4656b2 100644 --- a/toolchain/check/testdata/impl/impl_forall.carbon +++ b/toolchain/check/testdata/impl/impl_forall.carbon @@ -33,7 +33,7 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type: type = pattern_type type [concrete] -// CHECK:STDOUT: %Simple.impl_witness: = impl_witness file.%Simple.impl_witness_table, @T.as.Simple.impl(%T) [symbolic] +// CHECK:STDOUT: %Simple.impl_witness: = impl_witness @T.as.Simple.impl.%Simple.impl_witness_table, @T.as.Simple.impl(%T) [symbolic] // CHECK:STDOUT: %T.as.Simple.impl.F.type: type = fn_type @T.as.Simple.impl.F, @T.as.Simple.impl(%T) [symbolic] // CHECK:STDOUT: %T.as.Simple.impl.F: %T.as.Simple.impl.F.type = struct_value () [symbolic] // CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %T, (%Simple.impl_witness) [symbolic] @@ -52,8 +52,6 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc19_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc19_14.1 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Simple.impl_witness_table = impl_witness_table (@T.as.Simple.impl.%T.as.Simple.impl.F.decl), @T.as.Simple.impl [concrete] -// CHECK:STDOUT: %Simple.impl_witness: = impl_witness %Simple.impl_witness_table, @T.as.Simple.impl(constants.%T) [symbolic = @T.as.Simple.impl.%Simple.impl_witness (constants.%Simple.impl_witness)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Simple { @@ -71,7 +69,7 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: // CHECK:STDOUT: generic impl @T.as.Simple.impl(%T.loc19_14.2: type) { // CHECK:STDOUT: %T.loc19_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc19_14.1 (constants.%T)] -// CHECK:STDOUT: %Simple.impl_witness: = impl_witness file.%Simple.impl_witness_table, @T.as.Simple.impl(%T.loc19_14.1) [symbolic = %Simple.impl_witness (constants.%Simple.impl_witness)] +// CHECK:STDOUT: %Simple.impl_witness.loc19_36.2: = impl_witness %Simple.impl_witness_table, @T.as.Simple.impl(%T.loc19_14.1) [symbolic = %Simple.impl_witness.loc19_36.2 (constants.%Simple.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as.Simple.impl.F.type: type = fn_type @T.as.Simple.impl.F, @T.as.Simple.impl(%T.loc19_14.1) [symbolic = %T.as.Simple.impl.F.type (constants.%T.as.Simple.impl.F.type)] @@ -79,10 +77,12 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref as %Simple.ref { // CHECK:STDOUT: %T.as.Simple.impl.F.decl: @T.as.Simple.impl.%T.as.Simple.impl.F.type (%T.as.Simple.impl.F.type) = fn_decl @T.as.Simple.impl.F [symbolic = @T.as.Simple.impl.%T.as.Simple.impl.F (constants.%T.as.Simple.impl.F)] {} {} +// CHECK:STDOUT: %Simple.impl_witness_table = impl_witness_table (%T.as.Simple.impl.F.decl), @T.as.Simple.impl [concrete] +// CHECK:STDOUT: %Simple.impl_witness.loc19_36.1: = impl_witness %Simple.impl_witness_table, @T.as.Simple.impl(constants.%T) [symbolic = %Simple.impl_witness.loc19_36.2 (constants.%Simple.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %T.as.Simple.impl.F.decl -// CHECK:STDOUT: witness = file.%Simple.impl_witness +// CHECK:STDOUT: witness = %Simple.impl_witness.loc19_36.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -103,7 +103,7 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: // CHECK:STDOUT: specific @T.as.Simple.impl(constants.%T) { // CHECK:STDOUT: %T.loc19_14.1 => constants.%T -// CHECK:STDOUT: %Simple.impl_witness => constants.%Simple.impl_witness +// CHECK:STDOUT: %Simple.impl_witness.loc19_36.2 => constants.%Simple.impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as.Simple.impl.F.type => constants.%T.as.Simple.impl.F.type diff --git a/toolchain/check/testdata/impl/impl_thunk.carbon b/toolchain/check/testdata/impl/impl_thunk.carbon index 063200a0ac653..2b86dc244efc6 100644 --- a/toolchain/check/testdata/impl/impl_thunk.carbon +++ b/toolchain/check/testdata/impl/impl_thunk.carbon @@ -380,10 +380,11 @@ impl () as I({}) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %empty_tuple.type.as.I.impl.F.decl.loc10_48.1 -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @empty_tuple.type.as.I.impl.F.loc10_48.1(%y.param: %struct_type.b.a.40c) -> %return.param: %struct_type.d.c.b36; @@ -476,12 +477,13 @@ impl () as I({}) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .A = // CHECK:STDOUT: .C = // CHECK:STDOUT: .F = %B.as.X.impl.F.decl.loc14_37.1 -// CHECK:STDOUT: witness = file.%X.impl_witness +// CHECK:STDOUT: witness = %X.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @B.as.X.impl.F.loc14_37.1(%self.param: %A, %other.param: %ptr.643) -> %ptr.31e; @@ -542,11 +544,12 @@ impl () as I({}) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .A = // CHECK:STDOUT: .F = %B.as.X.impl.F.decl.loc13_26.1 -// CHECK:STDOUT: witness = file.%X.impl_witness +// CHECK:STDOUT: witness = %X.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @B.as.X.impl.F.loc13_26.1(%self.param: %A, %other.param: %A); @@ -624,12 +627,13 @@ impl () as I({}) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .A = // CHECK:STDOUT: .C = // CHECK:STDOUT: .F = %B.as.X.impl.F.decl.loc14_37.1 -// CHECK:STDOUT: witness = file.%X.impl_witness +// CHECK:STDOUT: witness = %X.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @B.as.X.impl.F.loc14_37.1(%self.param: %A, %other.param: %ptr.643) -> %ptr.31e; @@ -718,12 +722,13 @@ impl () as I({}) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .A = // CHECK:STDOUT: .C = // CHECK:STDOUT: .F = %B.as.X.impl.F.decl.loc14_37.1 -// CHECK:STDOUT: witness = file.%X.impl_witness +// CHECK:STDOUT: witness = %X.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @B.as.X.impl.F.loc14_37.1(%self.param: %A, %other.param: %ptr.643) -> %ptr.31e; @@ -784,11 +789,12 @@ impl () as I({}) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .B = // CHECK:STDOUT: .F = %A.as.X.impl.F.decl.loc23_14.1 -// CHECK:STDOUT: witness = file.%X.impl_witness +// CHECK:STDOUT: witness = %X.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A.as.X.impl.F.loc23_14.1() -> %return.param: %B; @@ -883,10 +889,11 @@ impl () as I({}) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %empty_tuple.type.as.I.impl.F.decl.loc10_34.1 -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @empty_tuple.type.as.I.impl.F.loc10_34.1(%U.loc10_8.2: %Copy.type) { @@ -1047,10 +1054,11 @@ impl () as I({}) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %empty_tuple.type.as.I.impl.F.decl.loc10_44.1 -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @empty_tuple.type.as.I.impl.F.loc10_44.1(%U.loc10_18.2: %Copy.type) { @@ -1171,10 +1179,11 @@ impl () as I({}) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %empty_tuple.type.as.I.impl.F.decl.loc10_29.1 -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @empty_tuple.type.as.I.impl.F.loc10_29.1() -> %return.param: %struct_type.b.a.1b0; diff --git a/toolchain/check/testdata/impl/import_builtin_call.carbon b/toolchain/check/testdata/impl/import_builtin_call.carbon index 726de242dc96e..8cc9737a94d6b 100644 --- a/toolchain/check/testdata/impl/import_builtin_call.carbon +++ b/toolchain/check/testdata/impl/import_builtin_call.carbon @@ -100,7 +100,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %iN.builtin: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %require_complete.269: = require_complete_type %iN.builtin [symbolic] // CHECK:STDOUT: %complete_type: = complete_type_witness %iN.builtin [symbolic] -// CHECK:STDOUT: %Add.impl_witness: = impl_witness file.%Add.impl_witness_table, @MyInt.as.Add.impl(%N) [symbolic] +// CHECK:STDOUT: %Add.impl_witness: = impl_witness @MyInt.as.Add.impl.%Add.impl_witness_table, @MyInt.as.Add.impl(%N) [symbolic] // CHECK:STDOUT: %pattern_type.1a3: type = pattern_type %MyInt [symbolic] // CHECK:STDOUT: %MyInt.as.Add.impl.Op.type: type = fn_type @MyInt.as.Add.impl.Op, @MyInt.as.Add.impl(%N) [symbolic] // CHECK:STDOUT: %MyInt.as.Add.impl.Op: %MyInt.as.Add.impl.Op.type = struct_value () [symbolic] @@ -177,8 +177,6 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc15_14.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc15_14.1 (constants.%N)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Add.impl_witness_table = impl_witness_table (@MyInt.as.Add.impl.%MyInt.as.Add.impl.Op.decl), @MyInt.as.Add.impl [concrete] -// CHECK:STDOUT: %Add.impl_witness: = impl_witness %Add.impl_witness_table, @MyInt.as.Add.impl(constants.%N) [symbolic = @MyInt.as.Add.impl.%Add.impl_witness (constants.%Add.impl_witness)] // CHECK:STDOUT: %Double.decl: %Double.type = fn_decl @Double [concrete = constants.%Double] { // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = symbolic_binding_pattern N, 0 [concrete] // CHECK:STDOUT: %x.patt: @Double.%pattern_type (%pattern_type.1a3) = value_binding_pattern x [concrete] @@ -252,7 +250,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: generic impl @MyInt.as.Add.impl(%N.loc15_14.2: Core.IntLiteral) { // CHECK:STDOUT: %N.loc15_14.1: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc15_14.1 (constants.%N)] // CHECK:STDOUT: %MyInt.loc15_39.1: type = class_type @MyInt, @MyInt(%N.loc15_14.1) [symbolic = %MyInt.loc15_39.1 (constants.%MyInt)] -// CHECK:STDOUT: %Add.impl_witness: = impl_witness file.%Add.impl_witness_table, @MyInt.as.Add.impl(%N.loc15_14.1) [symbolic = %Add.impl_witness (constants.%Add.impl_witness)] +// CHECK:STDOUT: %Add.impl_witness.loc15_48.2: = impl_witness %Add.impl_witness_table, @MyInt.as.Add.impl(%N.loc15_14.1) [symbolic = %Add.impl_witness.loc15_48.2 (constants.%Add.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %MyInt.as.Add.impl.Op.type: type = fn_type @MyInt.as.Add.impl.Op, @MyInt.as.Add.impl(%N.loc15_14.1) [symbolic = %MyInt.as.Add.impl.Op.type (constants.%MyInt.as.Add.impl.Op.type)] @@ -278,10 +276,12 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %return.param: ref @MyInt.as.Add.impl.Op.%MyInt (%MyInt) = out_param call_param2 // CHECK:STDOUT: %return: ref @MyInt.as.Add.impl.Op.%MyInt (%MyInt) = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Add.impl_witness_table = impl_witness_table (%MyInt.as.Add.impl.Op.decl), @MyInt.as.Add.impl [concrete] +// CHECK:STDOUT: %Add.impl_witness.loc15_48.1: = impl_witness %Add.impl_witness_table, @MyInt.as.Add.impl(constants.%N) [symbolic = %Add.impl_witness.loc15_48.2 (constants.%Add.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %MyInt.as.Add.impl.Op.decl -// CHECK:STDOUT: witness = file.%Add.impl_witness +// CHECK:STDOUT: witness = %Add.impl_witness.loc15_48.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -383,7 +383,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: specific @MyInt.as.Add.impl(constants.%N) { // CHECK:STDOUT: %N.loc15_14.1 => constants.%N // CHECK:STDOUT: %MyInt.loc15_39.1 => constants.%MyInt -// CHECK:STDOUT: %Add.impl_witness => constants.%Add.impl_witness +// CHECK:STDOUT: %Add.impl_witness.loc15_48.2 => constants.%Add.impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %MyInt.as.Add.impl.Op.type => constants.%MyInt.as.Add.impl.Op.type diff --git a/toolchain/check/testdata/impl/import_compound.carbon b/toolchain/check/testdata/impl/import_compound.carbon index 9482bb2793d95..08d3a618d62f0 100644 --- a/toolchain/check/testdata/impl/import_compound.carbon +++ b/toolchain/check/testdata/impl/import_compound.carbon @@ -110,7 +110,7 @@ fn InstanceCallImportFail() { // CHECK:STDOUT: %assoc0.8b2: %NonInstance.assoc_type = assoc_entity element0, @NonInstance.%NonInstance.F.decl [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %struct_type.i: type = struct_type {.i: %empty_tuple.type} [concrete] -// CHECK:STDOUT: %NonInstance.impl_witness: = impl_witness file.%NonInstance.impl_witness_table [concrete] +// CHECK:STDOUT: %NonInstance.impl_witness: = impl_witness @struct_type.i.as.NonInstance.impl.%NonInstance.impl_witness_table [concrete] // CHECK:STDOUT: %struct_type.i.as.NonInstance.impl.F.type: type = fn_type @struct_type.i.as.NonInstance.impl.F [concrete] // CHECK:STDOUT: %struct_type.i.as.NonInstance.impl.F: %struct_type.i.as.NonInstance.impl.F.type = struct_value () [concrete] // CHECK:STDOUT: %NonInstance.facet: %NonInstance.type = facet_value %struct_type.i, (%NonInstance.impl_witness) [concrete] @@ -122,7 +122,7 @@ fn InstanceCallImportFail() { // CHECK:STDOUT: %Instance.G: %Instance.G.type = struct_value () [concrete] // CHECK:STDOUT: %Instance.assoc_type: type = assoc_entity_type @Instance [concrete] // CHECK:STDOUT: %assoc0.2e5: %Instance.assoc_type = assoc_entity element0, @Instance.%Instance.G.decl [concrete] -// CHECK:STDOUT: %Instance.impl_witness: = impl_witness file.%Instance.impl_witness_table [concrete] +// CHECK:STDOUT: %Instance.impl_witness: = impl_witness @struct_type.i.as.Instance.impl.%Instance.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.9b2: type = pattern_type %struct_type.i [concrete] // CHECK:STDOUT: %struct_type.i.as.Instance.impl.G.type: type = fn_type @struct_type.i.as.Instance.impl.G [concrete] // CHECK:STDOUT: %struct_type.i.as.Instance.impl.G: %struct_type.i.as.Instance.impl.G.type = struct_value () [concrete] @@ -150,8 +150,6 @@ fn InstanceCallImportFail() { // CHECK:STDOUT: %struct_type.i: type = struct_type {.i: %empty_tuple.type} [concrete = constants.%struct_type.i] // CHECK:STDOUT: %NonInstance.ref: type = name_ref NonInstance, file.%NonInstance.decl [concrete = constants.%NonInstance.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %NonInstance.impl_witness_table = impl_witness_table (@struct_type.i.as.NonInstance.impl.%struct_type.i.as.NonInstance.impl.F.decl), @struct_type.i.as.NonInstance.impl [concrete] -// CHECK:STDOUT: %NonInstance.impl_witness: = impl_witness %NonInstance.impl_witness_table [concrete = constants.%NonInstance.impl_witness] // CHECK:STDOUT: %Instance.decl: type = interface_decl @Instance [concrete = constants.%Instance.type] {} {} // CHECK:STDOUT: impl_decl @struct_type.i.as.Instance.impl [concrete] {} { // CHECK:STDOUT: %.loc15_12.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] @@ -159,8 +157,6 @@ fn InstanceCallImportFail() { // CHECK:STDOUT: %struct_type.i: type = struct_type {.i: %empty_tuple.type} [concrete = constants.%struct_type.i] // CHECK:STDOUT: %Instance.ref: type = name_ref Instance, file.%Instance.decl [concrete = constants.%Instance.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Instance.impl_witness_table = impl_witness_table (@struct_type.i.as.Instance.impl.%struct_type.i.as.Instance.impl.G.decl), @struct_type.i.as.Instance.impl [concrete] -// CHECK:STDOUT: %Instance.impl_witness: = impl_witness %Instance.impl_witness_table [concrete = constants.%Instance.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @NonInstance { @@ -202,10 +198,12 @@ fn InstanceCallImportFail() { // CHECK:STDOUT: // CHECK:STDOUT: impl @struct_type.i.as.NonInstance.impl: %struct_type.i as %NonInstance.ref { // CHECK:STDOUT: %struct_type.i.as.NonInstance.impl.F.decl: %struct_type.i.as.NonInstance.impl.F.type = fn_decl @struct_type.i.as.NonInstance.impl.F [concrete = constants.%struct_type.i.as.NonInstance.impl.F] {} {} +// CHECK:STDOUT: %NonInstance.impl_witness_table = impl_witness_table (%struct_type.i.as.NonInstance.impl.F.decl), @struct_type.i.as.NonInstance.impl [concrete] +// CHECK:STDOUT: %NonInstance.impl_witness: = impl_witness %NonInstance.impl_witness_table [concrete = constants.%NonInstance.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %struct_type.i.as.NonInstance.impl.F.decl -// CHECK:STDOUT: witness = file.%NonInstance.impl_witness +// CHECK:STDOUT: witness = %NonInstance.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @struct_type.i.as.Instance.impl: %struct_type.i as %Instance.ref { @@ -217,10 +215,12 @@ fn InstanceCallImportFail() { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @struct_type.i.as.Instance.impl.%struct_type.i [concrete = constants.%struct_type.i] // CHECK:STDOUT: %self: %struct_type.i = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Instance.impl_witness_table = impl_witness_table (%struct_type.i.as.Instance.impl.G.decl), @struct_type.i.as.Instance.impl [concrete] +// CHECK:STDOUT: %Instance.impl_witness: = impl_witness %Instance.impl_witness_table [concrete = constants.%Instance.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G = %struct_type.i.as.Instance.impl.G.decl -// CHECK:STDOUT: witness = file.%Instance.impl_witness +// CHECK:STDOUT: witness = %Instance.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @NonInstance.F(@NonInstance.%Self: %NonInstance.type) { diff --git a/toolchain/check/testdata/impl/import_extend_impl.carbon b/toolchain/check/testdata/impl/import_extend_impl.carbon index a28d91229d254..e4bce36e3e07d 100644 --- a/toolchain/check/testdata/impl/import_extend_impl.carbon +++ b/toolchain/check/testdata/impl/import_extend_impl.carbon @@ -47,7 +47,7 @@ fn G(c: C) { // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%I.F.decl [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.I.impl.F.type: type = fn_type @C.as.I.impl.F [concrete] // CHECK:STDOUT: %C.as.I.impl.F: %C.as.I.impl.F.type = struct_value () [concrete] // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete] @@ -79,10 +79,12 @@ fn G(c: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.I.impl: %Self.ref as %I.ref { // CHECK:STDOUT: %C.as.I.impl.F.decl: %C.as.I.impl.F.type = fn_decl @C.as.I.impl.F [concrete = constants.%C.as.I.impl.F] {} {} +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%C.as.I.impl.F.decl), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %C.as.I.impl.F.decl -// CHECK:STDOUT: witness = @C.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -90,8 +92,6 @@ fn G(c: C) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@C.as.I.impl.%C.as.I.impl.F.decl), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/import_generic.carbon b/toolchain/check/testdata/impl/import_generic.carbon index 50d8f54a30ef6..71e32203031ad 100644 --- a/toolchain/check/testdata/impl/import_generic.carbon +++ b/toolchain/check/testdata/impl/import_generic.carbon @@ -317,7 +317,7 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %require_complete: = require_complete_type %I.type.d71 [symbolic] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %J.type.a71: type = facet_type <@J, @J(%empty_struct_type)> [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness file.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness @C.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %Self.b35: %J.type.a71 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %I.type.a51: type = facet_type <@I, @I(%empty_struct_type)> [concrete] // CHECK:STDOUT: %Self.8b9: %I.type.a51 = symbolic_binding Self, 1 [symbolic] @@ -353,8 +353,6 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %.loc5_15: type = converted %.loc5_14, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %J.type: type = facet_type <@J, @J(constants.%empty_struct_type)> [concrete = constants.%J.type.a71] // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (), @C.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @J(imports.%Main.import_ref.b3bc94.3: type) [from "basic_import_generic_interface.carbon"] { @@ -403,8 +401,11 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.J.impl: %C.ref as %J.type { +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (), @C.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%J.impl_witness +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -587,7 +588,7 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %empty_struct.a40: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %J.type.b8d23b.2: type = facet_type <@J, @J(%empty_struct_type)> [concrete] // CHECK:STDOUT: %I.type.a51: type = facet_type <@I, @I(%empty_struct_type)> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %Self.84c873.2: %J.type.b8d23b.2 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %Self.8b9: %I.type.a51 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %complete_type.f92: = complete_type_witness %I.type.a51 [concrete] @@ -622,8 +623,6 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %.loc5_15: type = converted %.loc5_14, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %J.type: type = facet_type <@J, @J(constants.%empty_struct_type)> [concrete = constants.%J.type.b8d23b.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.b3bc94.1: type) [from "basic_import_generic_constraint.carbon"] { @@ -671,8 +670,11 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.I.impl: %C.ref as %J.type { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -743,11 +745,11 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %I.generic: %I.type.609 = struct_value () [concrete] // CHECK:STDOUT: %I.type.d71: type = facet_type <@I, @I(%T)> [symbolic] // CHECK:STDOUT: %Self.bb7: %I.type.d71 = symbolic_binding Self, 1 [symbolic] -// CHECK:STDOUT: %I.impl_witness.fd6: = impl_witness file.%I.impl_witness_table.loc8, @C.as.I.impl.cd0(%T) [symbolic] +// CHECK:STDOUT: %I.impl_witness.fd6: = impl_witness @C.as.I.impl.cd0.%I.impl_witness_table, @C.as.I.impl.cd0(%T) [symbolic] // CHECK:STDOUT: %require_complete.073: = require_complete_type %I.type.d71 [symbolic] // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic] // CHECK:STDOUT: %I.type.db5: type = facet_type <@I, @I(%ptr)> [symbolic] -// CHECK:STDOUT: %I.impl_witness.2af: = impl_witness file.%I.impl_witness_table.loc12, @C.as.I.impl.ffb(%T) [symbolic] +// CHECK:STDOUT: %I.impl_witness.2af: = impl_witness @C.as.I.impl.ffb.%I.impl_witness_table, @C.as.I.impl.ffb(%T) [symbolic] // CHECK:STDOUT: %Self.198: %I.type.db5 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %require_complete.d1e: = require_complete_type %I.type.db5 [symbolic] // CHECK:STDOUT: %N.type.b47: type = generic_named_constaint_type @N [concrete] @@ -780,8 +782,6 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc8_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table.loc8 = impl_witness_table (), @C.as.I.impl.cd0 [concrete] -// CHECK:STDOUT: %I.impl_witness.loc8: = impl_witness %I.impl_witness_table.loc8, @C.as.I.impl.cd0(constants.%T) [symbolic = @C.as.I.impl.cd0.%I.impl_witness (constants.%I.impl_witness.fd6)] // CHECK:STDOUT: impl_decl @C.as.I.impl.cd0 [concrete] { // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { @@ -803,8 +803,6 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc12_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc12_14.2 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table.loc12 = impl_witness_table (), @C.as.I.impl.ffb [concrete] -// CHECK:STDOUT: %I.impl_witness.loc12: = impl_witness %I.impl_witness_table.loc12, @C.as.I.impl.ffb(constants.%T) [symbolic = @C.as.I.impl.ffb.%I.impl_witness (constants.%I.impl_witness.2af)] // CHECK:STDOUT: %N.decl: %N.type.b47 = constraint_decl @N [concrete = constants.%empty_struct] { // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { @@ -874,14 +872,17 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: generic impl @C.as.I.impl.cd0(%T.loc8_14.1: type) { // CHECK:STDOUT: %T.loc8_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc8_14.2 (constants.%T)] // CHECK:STDOUT: %I.type.loc8_32.2: type = facet_type <@I, @I(%T.loc8_14.2)> [symbolic = %I.type.loc8_32.2 (constants.%I.type.d71)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table.loc8, @C.as.I.impl.cd0(%T.loc8_14.2) [symbolic = %I.impl_witness (constants.%I.impl_witness.fd6)] +// CHECK:STDOUT: %I.impl_witness.loc8_33.2: = impl_witness %I.impl_witness_table, @C.as.I.impl.cd0(%T.loc8_14.2) [symbolic = %I.impl_witness.loc8_33.2 (constants.%I.impl_witness.fd6)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %I.type.loc8_32.2 [symbolic = %require_complete (constants.%require_complete.073)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref.loc8 as %I.type.loc8_32.1 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl.cd0 [concrete] +// CHECK:STDOUT: %I.impl_witness.loc8_33.1: = impl_witness %I.impl_witness_table, @C.as.I.impl.cd0(constants.%T) [symbolic = %I.impl_witness.loc8_33.2 (constants.%I.impl_witness.fd6)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness.loc8 +// CHECK:STDOUT: witness = %I.impl_witness.loc8_33.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -889,14 +890,17 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %T.loc12_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc12_14.2 (constants.%T)] // CHECK:STDOUT: %ptr.loc12_32.2: type = ptr_type %T.loc12_14.2 [symbolic = %ptr.loc12_32.2 (constants.%ptr)] // CHECK:STDOUT: %I.type.loc12_33.2: type = facet_type <@I, @I(%ptr.loc12_32.2)> [symbolic = %I.type.loc12_33.2 (constants.%I.type.db5)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table.loc12, @C.as.I.impl.ffb(%T.loc12_14.2) [symbolic = %I.impl_witness (constants.%I.impl_witness.2af)] +// CHECK:STDOUT: %I.impl_witness.loc12_35.2: = impl_witness %I.impl_witness_table, @C.as.I.impl.ffb(%T.loc12_14.2) [symbolic = %I.impl_witness.loc12_35.2 (constants.%I.impl_witness.2af)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %I.type.loc12_33.2 [symbolic = %require_complete (constants.%require_complete.d1e)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref as %I.type.loc12_33.1 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl.ffb [concrete] +// CHECK:STDOUT: %I.impl_witness.loc12_35.1: = impl_witness %I.impl_witness_table, @C.as.I.impl.ffb(constants.%T) [symbolic = %I.impl_witness.loc12_35.2 (constants.%I.impl_witness.2af)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness.loc12 +// CHECK:STDOUT: witness = %I.impl_witness.loc12_35.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -919,7 +923,7 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: specific @C.as.I.impl.cd0(constants.%T) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T // CHECK:STDOUT: %I.type.loc8_32.2 => constants.%I.type.d71 -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness.fd6 +// CHECK:STDOUT: %I.impl_witness.loc8_33.2 => constants.%I.impl_witness.fd6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%ptr) { @@ -934,7 +938,7 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %T.loc12_14.2 => constants.%T // CHECK:STDOUT: %ptr.loc12_32.2 => constants.%ptr // CHECK:STDOUT: %I.type.loc12_33.2 => constants.%I.type.db5 -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness.2af +// CHECK:STDOUT: %I.impl_witness.loc12_35.2 => constants.%I.impl_witness.2af // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @N(constants.%T) { @@ -1312,7 +1316,7 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %I.generic: %I.type.609 = struct_value () [concrete] // CHECK:STDOUT: %I.type.d71: type = facet_type <@I, @I(%T)> [symbolic] // CHECK:STDOUT: %Self.bb7: %I.type.d71 = symbolic_binding Self, 1 [symbolic] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%T) [symbolic] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table, @C.as.I.impl(%T) [symbolic] // CHECK:STDOUT: %require_complete: = require_complete_type %I.type.d71 [symbolic] // CHECK:STDOUT: %N.type.b47: type = generic_named_constaint_type @N [concrete] // CHECK:STDOUT: %empty_struct: %N.type.b47 = struct_value () [concrete] @@ -1344,8 +1348,6 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc7_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc7_14.2 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%T) [symbolic = @C.as.I.impl.%I.impl_witness (constants.%I.impl_witness)] // CHECK:STDOUT: %N.decl: %N.type.b47 = constraint_decl @N [concrete = constants.%empty_struct] { // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { @@ -1415,14 +1417,17 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: generic impl @C.as.I.impl(%T.loc7_14.1: type) { // CHECK:STDOUT: %T.loc7_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc7_14.2 (constants.%T)] // CHECK:STDOUT: %I.type.loc7_32.2: type = facet_type <@I, @I(%T.loc7_14.2)> [symbolic = %I.type.loc7_32.2 (constants.%I.type.d71)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%T.loc7_14.2) [symbolic = %I.impl_witness (constants.%I.impl_witness)] +// CHECK:STDOUT: %I.impl_witness.loc7_34.2: = impl_witness %I.impl_witness_table, @C.as.I.impl(%T.loc7_14.2) [symbolic = %I.impl_witness.loc7_34.2 (constants.%I.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %I.type.loc7_32.2 [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref as %I.type.loc7_32.1 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness.loc7_34.1: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%T) [symbolic = %I.impl_witness.loc7_34.2 (constants.%I.impl_witness)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness.loc7_34.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1445,7 +1450,7 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: specific @C.as.I.impl(constants.%T) { // CHECK:STDOUT: %T.loc7_14.2 => constants.%T // CHECK:STDOUT: %I.type.loc7_32.2 => constants.%I.type.d71 -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness +// CHECK:STDOUT: %I.impl_witness.loc7_34.2 => constants.%I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @N(constants.%T) { @@ -1478,7 +1483,7 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %ptr.e8f: type = ptr_type %T [symbolic] // CHECK:STDOUT: %I.type.db5: type = facet_type <@I, @I(%ptr.e8f)> [symbolic] -// CHECK:STDOUT: %I.impl_witness.2af: = impl_witness file.%I.impl_witness_table.loc5, @C.as.I.impl.ffb(%T) [symbolic] +// CHECK:STDOUT: %I.impl_witness.2af: = impl_witness @C.as.I.impl.ffb.%I.impl_witness_table, @C.as.I.impl.ffb(%T) [symbolic] // CHECK:STDOUT: %Self.ae2: %I.type.db5 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %require_complete.d1e: = require_complete_type %I.type.db5 [symbolic] // CHECK:STDOUT: %N.type.b47: type = generic_named_constaint_type @N [concrete] @@ -1489,7 +1494,7 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %ptr.125: type = ptr_type %ptr.e8f [symbolic] // CHECK:STDOUT: %N.type.b8d23b.2: type = facet_type <@N, @N(%ptr.125)> [symbolic] // CHECK:STDOUT: %I.type.1b3: type = facet_type <@I, @I(%ptr.125)> [symbolic] -// CHECK:STDOUT: %I.impl_witness.0bb: = impl_witness file.%I.impl_witness_table.loc6, @C.as.I.impl.e11(%T) [symbolic] +// CHECK:STDOUT: %I.impl_witness.0bb: = impl_witness @C.as.I.impl.e11.%I.impl_witness_table, @C.as.I.impl.e11(%T) [symbolic] // CHECK:STDOUT: %Self.84c873.2: %N.type.b8d23b.2 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %require_complete.ea0: = require_complete_type %I.type.1b3 [symbolic] // CHECK:STDOUT: %require_complete.a37: = require_complete_type %N.type.b8d23b.2 [symbolic] @@ -1535,8 +1540,6 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc5_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc5_14.2 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table.loc5 = impl_witness_table (), @C.as.I.impl.ffb [concrete] -// CHECK:STDOUT: %I.impl_witness.loc5: = impl_witness %I.impl_witness_table.loc5, @C.as.I.impl.ffb(constants.%T) [symbolic = @C.as.I.impl.ffb.%I.impl_witness (constants.%I.impl_witness.2af)] // CHECK:STDOUT: impl_decl @C.as.I.impl.e11 [concrete] { // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { @@ -1549,8 +1552,6 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc6_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc6_14.2 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table.loc6 = impl_witness_table (), @C.as.I.impl.e11 [concrete] -// CHECK:STDOUT: %I.impl_witness.loc6: = impl_witness %I.impl_witness_table.loc6, @C.as.I.impl.e11(constants.%T) [symbolic = @C.as.I.impl.e11.%I.impl_witness (constants.%I.impl_witness.0bb)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.b3bc94.1: type) [from "import_generic_with_different_specific.carbon"] { @@ -1615,14 +1616,17 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %T.loc5_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc5_14.2 (constants.%T)] // CHECK:STDOUT: %ptr.loc5_32.2: type = ptr_type %T.loc5_14.2 [symbolic = %ptr.loc5_32.2 (constants.%ptr.e8f)] // CHECK:STDOUT: %I.type.loc5_33.2: type = facet_type <@I, @I(%ptr.loc5_32.2)> [symbolic = %I.type.loc5_33.2 (constants.%I.type.db5)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table.loc5, @C.as.I.impl.ffb(%T.loc5_14.2) [symbolic = %I.impl_witness (constants.%I.impl_witness.2af)] +// CHECK:STDOUT: %I.impl_witness.loc5_35.2: = impl_witness %I.impl_witness_table, @C.as.I.impl.ffb(%T.loc5_14.2) [symbolic = %I.impl_witness.loc5_35.2 (constants.%I.impl_witness.2af)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %I.type.loc5_33.2 [symbolic = %require_complete (constants.%require_complete.d1e)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref as %I.type.loc5_33.1 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl.ffb [concrete] +// CHECK:STDOUT: %I.impl_witness.loc5_35.1: = impl_witness %I.impl_witness_table, @C.as.I.impl.ffb(constants.%T) [symbolic = %I.impl_witness.loc5_35.2 (constants.%I.impl_witness.2af)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness.loc5 +// CHECK:STDOUT: witness = %I.impl_witness.loc5_35.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1631,14 +1635,17 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %ptr.loc6_32.2: type = ptr_type %T.loc6_14.2 [symbolic = %ptr.loc6_32.2 (constants.%ptr.e8f)] // CHECK:STDOUT: %ptr.loc6_33.2: type = ptr_type %ptr.loc6_32.2 [symbolic = %ptr.loc6_33.2 (constants.%ptr.125)] // CHECK:STDOUT: %N.type.loc6_34.2: type = facet_type <@N, @N(%ptr.loc6_33.2)> [symbolic = %N.type.loc6_34.2 (constants.%N.type.b8d23b.2)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table.loc6, @C.as.I.impl.e11(%T.loc6_14.2) [symbolic = %I.impl_witness (constants.%I.impl_witness.0bb)] +// CHECK:STDOUT: %I.impl_witness.loc6_36.2: = impl_witness %I.impl_witness_table, @C.as.I.impl.e11(%T.loc6_14.2) [symbolic = %I.impl_witness.loc6_36.2 (constants.%I.impl_witness.0bb)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %N.type.loc6_34.2 [symbolic = %require_complete (constants.%require_complete.a37)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref as %N.type.loc6_34.1 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl.e11 [concrete] +// CHECK:STDOUT: %I.impl_witness.loc6_36.1: = impl_witness %I.impl_witness_table, @C.as.I.impl.e11(constants.%T) [symbolic = %I.impl_witness.loc6_36.2 (constants.%I.impl_witness.0bb)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness.loc6 +// CHECK:STDOUT: witness = %I.impl_witness.loc6_36.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1675,7 +1682,7 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %T.loc5_14.2 => constants.%T // CHECK:STDOUT: %ptr.loc5_32.2 => constants.%ptr.e8f // CHECK:STDOUT: %I.type.loc5_33.2 => constants.%I.type.db5 -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness.2af +// CHECK:STDOUT: %I.impl_witness.loc5_35.2 => constants.%I.impl_witness.2af // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @N(constants.%T) { @@ -1717,7 +1724,7 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %ptr.loc6_32.2 => constants.%ptr.e8f // CHECK:STDOUT: %ptr.loc6_33.2 => constants.%ptr.125 // CHECK:STDOUT: %N.type.loc6_34.2 => constants.%N.type.b8d23b.2 -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness.0bb +// CHECK:STDOUT: %I.impl_witness.loc6_36.2 => constants.%I.impl_witness.0bb // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_generic_decl.carbon @@ -1740,10 +1747,10 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %Self.535: %N.type.b8d = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 1, %Self.535 [symbolic] // CHECK:STDOUT: %require_complete: = require_complete_type %J.type.cb9 [symbolic] -// CHECK:STDOUT: %J.impl_witness.f50: = impl_witness file.%J.impl_witness_table.loc15, @D.as.J.impl.b73(%T) [symbolic] +// CHECK:STDOUT: %J.impl_witness.f50: = impl_witness @D.as.J.impl.b73.%J.impl_witness_table, @D.as.J.impl.b73(%T) [symbolic] // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic] // CHECK:STDOUT: %J.type.8da: type = facet_type <@J, @J(%ptr)> [symbolic] -// CHECK:STDOUT: %J.impl_witness.a5d: = impl_witness file.%J.impl_witness_table.loc21, @D.as.J.impl.1ba(%T) [symbolic] +// CHECK:STDOUT: %J.impl_witness.a5d: = impl_witness @D.as.J.impl.1ba.%J.impl_witness_table, @D.as.J.impl.1ba(%T) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1775,8 +1782,6 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc15_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc15_14.2 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table.loc15 = impl_witness_table (), @D.as.J.impl.b73 [concrete] -// CHECK:STDOUT: %J.impl_witness.loc15: = impl_witness %J.impl_witness_table.loc15, @D.as.J.impl.b73(constants.%T) [symbolic = @D.as.J.impl.b73.%J.impl_witness (constants.%J.impl_witness.f50)] // CHECK:STDOUT: impl_decl @D.as.J.impl.1ba [concrete] { // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { @@ -1788,8 +1793,6 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc21_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc21_14.2 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table.loc21 = impl_witness_table (), @D.as.J.impl.1ba [concrete] -// CHECK:STDOUT: %J.impl_witness.loc21: = impl_witness %J.impl_witness_table.loc21, @D.as.J.impl.1ba(constants.%T) [symbolic = @D.as.J.impl.1ba.%J.impl_witness (constants.%J.impl_witness.a5d)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @J(%T.loc5_13.2: type) { @@ -1853,7 +1856,7 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: generic impl @D.as.J.impl.b73(%T.loc15_14.1: type) { // CHECK:STDOUT: %T.loc15_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc15_14.2 (constants.%T)] // CHECK:STDOUT: %J.type.loc15_32.2: type = facet_type <@J, @J(%T.loc15_14.2)> [symbolic = %J.type.loc15_32.2 (constants.%J.type.cb9)] -// CHECK:STDOUT: %J.impl_witness: = impl_witness file.%J.impl_witness_table.loc15, @D.as.J.impl.b73(%T.loc15_14.2) [symbolic = %J.impl_witness (constants.%J.impl_witness.f50)] +// CHECK:STDOUT: %J.impl_witness.loc15_33.2: = impl_witness %J.impl_witness_table, @D.as.J.impl.b73(%T.loc15_14.2) [symbolic = %J.impl_witness.loc15_33.2 (constants.%J.impl_witness.f50)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %D.ref as %J.type.loc15_32.1; // CHECK:STDOUT: } @@ -1862,7 +1865,7 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %T.loc21_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc21_14.2 (constants.%T)] // CHECK:STDOUT: %ptr.loc21_32.2: type = ptr_type %T.loc21_14.2 [symbolic = %ptr.loc21_32.2 (constants.%ptr)] // CHECK:STDOUT: %J.type.loc21_33.2: type = facet_type <@J, @J(%ptr.loc21_32.2)> [symbolic = %J.type.loc21_33.2 (constants.%J.type.8da)] -// CHECK:STDOUT: %J.impl_witness: = impl_witness file.%J.impl_witness_table.loc21, @D.as.J.impl.1ba(%T.loc21_14.2) [symbolic = %J.impl_witness (constants.%J.impl_witness.a5d)] +// CHECK:STDOUT: %J.impl_witness.loc21_34.2: = impl_witness %J.impl_witness_table, @D.as.J.impl.1ba(%T.loc21_14.2) [symbolic = %J.impl_witness.loc21_34.2 (constants.%J.impl_witness.a5d)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %D.ref as %J.type.loc21_33.1; // CHECK:STDOUT: } @@ -1898,7 +1901,7 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: specific @D.as.J.impl.b73(constants.%T) { // CHECK:STDOUT: %T.loc15_14.2 => constants.%T // CHECK:STDOUT: %J.type.loc15_32.2 => constants.%J.type.cb9 -// CHECK:STDOUT: %J.impl_witness => constants.%J.impl_witness.f50 +// CHECK:STDOUT: %J.impl_witness.loc15_33.2 => constants.%J.impl_witness.f50 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @J(constants.%ptr) { @@ -1909,7 +1912,7 @@ impl forall [T:! type] D as N(T*) {} // CHECK:STDOUT: %T.loc21_14.2 => constants.%T // CHECK:STDOUT: %ptr.loc21_32.2 => constants.%ptr // CHECK:STDOUT: %J.type.loc21_33.2 => constants.%J.type.8da -// CHECK:STDOUT: %J.impl_witness => constants.%J.impl_witness.a5d +// CHECK:STDOUT: %J.impl_witness.loc21_34.2 => constants.%J.impl_witness.a5d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_generic_decl.impl.carbon diff --git a/toolchain/check/testdata/impl/import_interface_assoc_const.carbon b/toolchain/check/testdata/impl/import_interface_assoc_const.carbon index bd6a213c5d96c..b4d64c6a139f0 100644 --- a/toolchain/check/testdata/impl/import_interface_assoc_const.carbon +++ b/toolchain/check/testdata/impl/import_interface_assoc_const.carbon @@ -330,7 +330,7 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_struct_type> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C1.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -370,9 +370,6 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc5_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C1.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I [from "interface.carbon"] { @@ -389,8 +386,12 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C1.as.I.impl: %C1.ref as %.loc5_14 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C1.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C1 { @@ -421,7 +422,7 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_struct_type> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C2.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -461,9 +462,6 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc5, %.loc5_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C2.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: impl_decl @C2.as.I.impl [concrete] {} { // CHECK:STDOUT: %C2.ref.loc6: type = name_ref C2, file.%C2.decl [concrete = constants.%C2] // CHECK:STDOUT: %I.ref.loc6: type = name_ref I, imports.%Main.I [concrete = constants.%I.type] @@ -496,8 +494,12 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C2.as.I.impl: %C2.ref.loc5 as %.loc5_14 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C2.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C2 { @@ -520,7 +522,6 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %I.impl_witness.440: = impl_witness file.%I.impl_witness_table.loc9 [concrete] // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.be8 [concrete] @@ -529,7 +530,7 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_struct_type> [concrete] -// CHECK:STDOUT: %I.impl_witness.27c: = impl_witness file.%I.impl_witness_table.loc10 [concrete] +// CHECK:STDOUT: %I.impl_witness.27c: = impl_witness @C3.as.I.impl.048.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -557,8 +558,6 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: %C3.ref: type = name_ref C3, file.%C3.decl [concrete = constants.%C3] // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table.loc9 = impl_witness_table (), @C3.as.I.impl.7fe [concrete] -// CHECK:STDOUT: %I.impl_witness.loc9: = impl_witness %I.impl_witness_table.loc9 [concrete = constants.%I.impl_witness.440] // CHECK:STDOUT: impl_decl @C3.as.I.impl.048 [concrete] {} { // CHECK:STDOUT: %C3.ref: type = name_ref C3, file.%C3.decl [concrete = constants.%C3] // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type] @@ -575,9 +574,6 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table.loc10 = impl_witness_table (%impl_witness_assoc_constant), @C3.as.I.impl.048 [concrete] -// CHECK:STDOUT: %I.impl_witness.loc10: = impl_witness %I.impl_witness_table.loc10 [concrete = constants.%I.impl_witness.27c] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I [from "interface.carbon"] { @@ -596,8 +592,12 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: impl @C3.as.I.impl.7fe: %C3.ref as %I.ref; // CHECK:STDOUT: // CHECK:STDOUT: impl @C3.as.I.impl.048: %C3.ref as %.loc10_14 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C3.as.I.impl.048 [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.27c] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness.loc10 +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C3 { @@ -629,10 +629,9 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %I_where.type.aa2: type = facet_type <@I where %impl.elem0 = %empty_struct_type> [concrete] -// CHECK:STDOUT: %I.impl_witness.49d: = impl_witness file.%I.impl_witness_table.loc9 [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %I_where.type.a10: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete] -// CHECK:STDOUT: %I.impl_witness.969: = impl_witness file.%I.impl_witness_table.loc10 [concrete] +// CHECK:STDOUT: %I.impl_witness.969: = impl_witness @C4.as.I.impl.49c.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -672,9 +671,6 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table.loc9 = impl_witness_table (%impl_witness_assoc_constant.loc9), @C4.as.I.impl.944 [concrete] -// CHECK:STDOUT: %I.impl_witness.loc9: = impl_witness %I.impl_witness_table.loc9 [concrete = constants.%I.impl_witness.49d] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc9: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: impl_decl @C4.as.I.impl.49c [concrete] {} { // CHECK:STDOUT: %C4.ref: type = name_ref C4, file.%C4.decl [concrete = constants.%C4] // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type] @@ -691,9 +687,6 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table.loc10 = impl_witness_table (%impl_witness_assoc_constant.loc10), @C4.as.I.impl.49c [concrete] -// CHECK:STDOUT: %I.impl_witness.loc10: = impl_witness %I.impl_witness_table.loc10 [concrete = constants.%I.impl_witness.969] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc10: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I [from "interface.carbon"] { @@ -712,8 +705,12 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: impl @C4.as.I.impl.944: %C4.ref as %.loc9_14; // CHECK:STDOUT: // CHECK:STDOUT: impl @C4.as.I.impl.49c: %C4.ref as %.loc10_14 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C4.as.I.impl.49c [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.969] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness.loc10 +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C4 { @@ -916,8 +913,7 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_struct_type> [concrete] -// CHECK:STDOUT: %I.impl_witness.ab8: = impl_witness file.%I.impl_witness_table.loc5 [concrete] -// CHECK:STDOUT: %I.impl_witness.ffb: = impl_witness file.%I.impl_witness_table.loc18 [concrete] +// CHECK:STDOUT: %I.impl_witness.ffb: = impl_witness @C6.as.I.impl.08e.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -957,15 +953,10 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc5_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table.loc5 = impl_witness_table (%impl_witness_assoc_constant), @C6.as.I.impl.6a9 [concrete] -// CHECK:STDOUT: %I.impl_witness.loc5: = impl_witness %I.impl_witness_table.loc5 [concrete = constants.%I.impl_witness.ab8] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: impl_decl @C6.as.I.impl.08e [concrete] {} { // CHECK:STDOUT: %C6.ref: type = name_ref C6, file.%C6.decl [concrete = constants.%C6] // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table.loc18 = impl_witness_table (), @C6.as.I.impl.08e [concrete] -// CHECK:STDOUT: %I.impl_witness.loc18: = impl_witness %I.impl_witness_table.loc18 [concrete = constants.%I.impl_witness.ffb] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I [from "interface.carbon"] { @@ -984,8 +975,11 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: impl @C6.as.I.impl.6a9: %C6.ref as %.loc5_14; // CHECK:STDOUT: // CHECK:STDOUT: impl @C6.as.I.impl.08e: %C6.ref as %I.ref { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C6.as.I.impl.08e [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.ffb] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness.loc18 +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C6 { @@ -1398,7 +1392,7 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_struct_type> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @CB.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1447,9 +1441,6 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: requirement_rewrite %impl.elem0.subst, %.loc6_38.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @CB.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I [from "interface.carbon"] { @@ -1466,8 +1457,12 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @CB.as.I.impl: %CB.ref as %.loc6_14 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @CB.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @CB { @@ -1500,7 +1495,7 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %struct: %struct_type.a.225 = struct_value (%empty_struct) [concrete] // CHECK:STDOUT: %NonType_where.type: type = facet_type <@NonType where %impl.elem0 = %struct> [concrete] -// CHECK:STDOUT: %NonType.impl_witness: = impl_witness file.%NonType.impl_witness_table [concrete] +// CHECK:STDOUT: %NonType.impl_witness: = impl_witness @CC.as.NonType.impl.%NonType.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1544,9 +1539,6 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc6_39.3 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %NonType.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @CC.as.NonType.impl [concrete] -// CHECK:STDOUT: %NonType.impl_witness: = impl_witness %NonType.impl_witness_table [concrete = constants.%NonType.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.a.225 = impl_witness_assoc_constant constants.%struct [concrete = constants.%struct] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @NonType [from "interface.carbon"] { @@ -1563,8 +1555,12 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @CC.as.NonType.impl: %CC.ref as %.loc6_20 { +// CHECK:STDOUT: %NonType.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @CC.as.NonType.impl [concrete] +// CHECK:STDOUT: %NonType.impl_witness: = impl_witness %NonType.impl_witness_table [concrete = constants.%NonType.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.a.225 = impl_witness_assoc_constant constants.%struct [concrete = constants.%struct] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%NonType.impl_witness +// CHECK:STDOUT: witness = %NonType.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @CC { @@ -1635,7 +1631,7 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: %impl.elem0: %.45b = impl_witness_access %IF.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %IF_where.type: type = facet_type <@IF where %impl.elem0 = %int_0> [concrete] -// CHECK:STDOUT: %IF.impl_witness: = impl_witness file.%IF.impl_witness_table [concrete] +// CHECK:STDOUT: %IF.impl_witness: = impl_witness @CD.as.IF.impl.%IF.impl_witness_table [concrete] // CHECK:STDOUT: %CD.as.IF.impl.F.type: type = fn_type @CD.as.IF.impl.F [concrete] // CHECK:STDOUT: %CD.as.IF.impl.F: %CD.as.IF.impl.F.type = struct_value () [concrete] // CHECK:STDOUT: %IF.facet: %IF.type = facet_value %CD, (%IF.impl_witness) [concrete] @@ -1672,8 +1668,6 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %int_0 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %IF.impl_witness_table = impl_witness_table (@CD.as.IF.impl.%CD.as.IF.impl.F.decl), @CD.as.IF.impl [concrete] -// CHECK:STDOUT: %IF.impl_witness: = impl_witness %IF.impl_witness_table [concrete = constants.%IF.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @IF [from "interface_with_function.carbon"] { @@ -1687,10 +1681,12 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: // CHECK:STDOUT: impl @CD.as.IF.impl: %CD.ref as %.loc10_15 { // CHECK:STDOUT: %CD.as.IF.impl.F.decl: %CD.as.IF.impl.F.type = fn_decl @CD.as.IF.impl.F [concrete = constants.%CD.as.IF.impl.F] {} {} +// CHECK:STDOUT: %IF.impl_witness_table = impl_witness_table (%CD.as.IF.impl.F.decl), @CD.as.IF.impl [concrete] +// CHECK:STDOUT: %IF.impl_witness: = impl_witness %IF.impl_witness_table [concrete = constants.%IF.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %CD.as.IF.impl.F.decl -// CHECK:STDOUT: witness = file.%IF.impl_witness +// CHECK:STDOUT: witness = %IF.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @CD { diff --git a/toolchain/check/testdata/impl/import_self.carbon b/toolchain/check/testdata/impl/import_self.carbon index d195d82d5b1ac..c28b1651146d2 100644 --- a/toolchain/check/testdata/impl/import_self.carbon +++ b/toolchain/check/testdata/impl/import_self.carbon @@ -128,7 +128,7 @@ fn F(x: C, y: C) -> C { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_tuple.type [concrete] // CHECK:STDOUT: %Add.type: type = facet_type <@Add> [concrete] // CHECK:STDOUT: %Self: %Add.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Add.impl_witness: = impl_witness file.%Add.impl_witness_table [concrete] +// CHECK:STDOUT: %Add.impl_witness: = impl_witness @C.as.Add.impl.%Add.impl_witness_table [concrete] // CHECK:STDOUT: %Add.Op.type: type = fn_type @Add.Op [concrete] // CHECK:STDOUT: %Add.Op: %Add.Op.type = struct_value () [concrete] // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic] @@ -172,8 +172,6 @@ fn F(x: C, y: C) -> C { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%Main.Add [concrete = constants.%Add.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Add.impl_witness_table = impl_witness_table (@C.as.Add.impl.%C.as.Add.impl.Op.decl), @C.as.Add.impl [concrete] -// CHECK:STDOUT: %Add.impl_witness: = impl_witness %Add.impl_witness_table [concrete = constants.%Add.impl_witness] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %x.patt: %pattern_type.7c7 = value_binding_pattern x [concrete] // CHECK:STDOUT: %x.param_patt: %pattern_type.7c7 = value_param_pattern %x.patt, call_param0 [concrete] @@ -222,11 +220,13 @@ fn F(x: C, y: C) -> C { // CHECK:STDOUT: %return.param: ref %C = out_param call_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Add.impl_witness_table = impl_witness_table (%C.as.Add.impl.Op.decl), @C.as.Add.impl [concrete] +// CHECK:STDOUT: %Add.impl_witness: = impl_witness %Add.impl_witness_table [concrete = constants.%Add.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %C.as.Add.impl.Op.decl // CHECK:STDOUT: .C = -// CHECK:STDOUT: witness = file.%Add.impl_witness +// CHECK:STDOUT: witness = %Add.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/impl/import_self_specific.carbon b/toolchain/check/testdata/impl/import_self_specific.carbon index 19a0b009b1f15..c416d383df584 100644 --- a/toolchain/check/testdata/impl/import_self_specific.carbon +++ b/toolchain/check/testdata/impl/import_self_specific.carbon @@ -71,11 +71,11 @@ impl forall [N:! E] D(N) as I where .Assoc = () { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] -// CHECK:STDOUT: %Y.impl_witness: = impl_witness file.%Y.impl_witness_table, @T.as.Y.impl(%T) [symbolic] +// CHECK:STDOUT: %Y.impl_witness: = impl_witness @T.as.Y.impl.%Y.impl_witness_table, @T.as.Y.impl(%T) [symbolic] // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete] // CHECK:STDOUT: %Self.001: %Z.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %U: type = symbolic_binding U, 0 [symbolic] -// CHECK:STDOUT: %Z.impl_witness.353: = impl_witness file.%Z.impl_witness_table, @U.as.Z.impl(%U) [symbolic] +// CHECK:STDOUT: %Z.impl_witness.353: = impl_witness @U.as.Z.impl.%Z.impl_witness_table, @U.as.Z.impl(%U) [symbolic] // CHECK:STDOUT: %V: %Z.type = symbolic_binding V, 0 [symbolic] // CHECK:STDOUT: %pattern_type.fe6: type = pattern_type %Z.type [concrete] // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete] @@ -91,7 +91,7 @@ impl forall [N:! E] D(N) as I where .Assoc = () { // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %Self.dba, @I [symbolic] // CHECK:STDOUT: %impl.elem0: %Y.type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic] // CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0 [symbolic] -// CHECK:STDOUT: %Z.impl_witness.cc4: = impl_witness file.%Z.impl_witness_table, @U.as.Z.impl(%as_type) [symbolic] +// CHECK:STDOUT: %Z.impl_witness.cc4: = impl_witness @U.as.Z.impl.%Z.impl_witness_table, @U.as.Z.impl(%as_type) [symbolic] // CHECK:STDOUT: %.12b: require_specific_def_type = require_specific_def @U.as.Z.impl(%as_type) [symbolic] // CHECK:STDOUT: %Z.lookup_impl_witness: = lookup_impl_witness %impl.elem0, @Z [symbolic] // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %as_type, (%Z.lookup_impl_witness) [symbolic] @@ -118,8 +118,6 @@ impl forall [N:! E] D(N) as I where .Assoc = () { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc5_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc5_14.2 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (), @T.as.Y.impl [concrete] -// CHECK:STDOUT: %Y.impl_witness: = impl_witness %Y.impl_witness_table, @T.as.Y.impl(constants.%T) [symbolic = @T.as.Y.impl.%Y.impl_witness (constants.%Y.impl_witness)] // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {} // CHECK:STDOUT: impl_decl @U.as.Z.impl [concrete] { // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [concrete] @@ -129,8 +127,6 @@ impl forall [N:! E] D(N) as I where .Assoc = () { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %U.loc9_14.1: type = symbolic_binding U, 0 [symbolic = %U.loc9_14.2 (constants.%U)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (), @U.as.Z.impl [concrete] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness %Z.impl_witness_table, @U.as.Z.impl(constants.%U) [symbolic = @U.as.Z.impl.%Z.impl_witness (constants.%Z.impl_witness.353)] // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] { // CHECK:STDOUT: %V.patt: %pattern_type.fe6 = symbolic_binding_pattern V, 0 [concrete] // CHECK:STDOUT: } { @@ -203,25 +199,31 @@ impl forall [N:! E] D(N) as I where .Assoc = () { // CHECK:STDOUT: // CHECK:STDOUT: generic impl @T.as.Y.impl(%T.loc5_14.1: type) { // CHECK:STDOUT: %T.loc5_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc5_14.2 (constants.%T)] -// CHECK:STDOUT: %Y.impl_witness: = impl_witness file.%Y.impl_witness_table, @T.as.Y.impl(%T.loc5_14.2) [symbolic = %Y.impl_witness (constants.%Y.impl_witness)] +// CHECK:STDOUT: %Y.impl_witness.loc5_31.2: = impl_witness %Y.impl_witness_table, @T.as.Y.impl(%T.loc5_14.2) [symbolic = %Y.impl_witness.loc5_31.2 (constants.%Y.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref as %Y.ref { +// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (), @T.as.Y.impl [concrete] +// CHECK:STDOUT: %Y.impl_witness.loc5_31.1: = impl_witness %Y.impl_witness_table, @T.as.Y.impl(constants.%T) [symbolic = %Y.impl_witness.loc5_31.2 (constants.%Y.impl_witness)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Y.impl_witness +// CHECK:STDOUT: witness = %Y.impl_witness.loc5_31.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @U.as.Z.impl(%U.loc9_14.1: type) { // CHECK:STDOUT: %U.loc9_14.2: type = symbolic_binding U, 0 [symbolic = %U.loc9_14.2 (constants.%U)] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness file.%Z.impl_witness_table, @U.as.Z.impl(%U.loc9_14.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.353)] +// CHECK:STDOUT: %Z.impl_witness.loc9_31.2: = impl_witness %Z.impl_witness_table, @U.as.Z.impl(%U.loc9_14.2) [symbolic = %Z.impl_witness.loc9_31.2 (constants.%Z.impl_witness.353)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %U.ref as %Z.ref { +// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (), @U.as.Z.impl [concrete] +// CHECK:STDOUT: %Z.impl_witness.loc9_31.1: = impl_witness %Z.impl_witness_table, @U.as.Z.impl(constants.%U) [symbolic = %Z.impl_witness.loc9_31.2 (constants.%Z.impl_witness.353)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Z.impl_witness +// CHECK:STDOUT: witness = %Z.impl_witness.loc9_31.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -258,12 +260,12 @@ impl forall [N:! E] D(N) as I where .Assoc = () { // CHECK:STDOUT: // CHECK:STDOUT: specific @T.as.Y.impl(constants.%T) { // CHECK:STDOUT: %T.loc5_14.2 => constants.%T -// CHECK:STDOUT: %Y.impl_witness => constants.%Y.impl_witness +// CHECK:STDOUT: %Y.impl_witness.loc5_31.2 => constants.%Y.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @U.as.Z.impl(constants.%U) { // CHECK:STDOUT: %U.loc9_14.2 => constants.%U -// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.353 +// CHECK:STDOUT: %Z.impl_witness.loc9_31.2 => constants.%Z.impl_witness.353 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%V) { @@ -274,7 +276,7 @@ impl forall [N:! E] D(N) as I where .Assoc = () { // CHECK:STDOUT: // CHECK:STDOUT: specific @U.as.Z.impl(constants.%as_type) { // CHECK:STDOUT: %U.loc9_14.2 => constants.%as_type -// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.cc4 +// CHECK:STDOUT: %Z.impl_witness.loc9_31.2 => constants.%Z.impl_witness.cc4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -342,7 +344,7 @@ impl forall [N:! E] D(N) as I where .Assoc = () { // CHECK:STDOUT: %Z.impl_witness.353: = impl_witness imports.%Z.impl_witness_table, @U.as.Z.impl(%U) [symbolic] // CHECK:STDOUT: %.92a: require_specific_def_type = require_specific_def @U.as.Z.impl(%as_type) [symbolic] // CHECK:STDOUT: %Z.impl_witness.c17: = impl_witness imports.%Z.impl_witness_table, @U.as.Z.impl(%as_type) [symbolic] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @D.as.I.impl(%N) [symbolic] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @D.as.I.impl.%I.impl_witness_table, @D.as.I.impl(%N) [symbolic] // CHECK:STDOUT: %Z.impl_witness.b73: = impl_witness imports.%Z.impl_witness_table, @U.as.Z.impl(%empty_tuple.type) [concrete] // CHECK:STDOUT: %.27b: require_specific_def_type = require_specific_def @U.as.Z.impl(%empty_tuple.type) [concrete] // CHECK:STDOUT: %Z.facet.48e: %Z.type = facet_value %empty_tuple.type, (%Z.impl_witness.b73) [concrete] @@ -430,9 +432,6 @@ impl forall [N:! E] D(N) as I where .Assoc = () { // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc20_14.2: %E = symbolic_binding N, 0 [symbolic = %N.loc20_14.1 (constants.%N)] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @D.as.I.impl.%D.as.I.impl.F.decl), @D.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table, @D.as.I.impl(constants.%N) [symbolic = @D.as.I.impl.%I.impl_witness (constants.%I.impl_witness)] -// CHECK:STDOUT: %impl_witness_assoc_constant: %Y.type = impl_witness_assoc_constant constants.%Y.facet [concrete = constants.%Y.facet] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I [from "impl_def.carbon"] { @@ -492,7 +491,7 @@ impl forall [N:! E] D(N) as I where .Assoc = () { // CHECK:STDOUT: generic impl @D.as.I.impl(%N.loc20_14.2: %E) { // CHECK:STDOUT: %N.loc20_14.1: %E = symbolic_binding N, 0 [symbolic = %N.loc20_14.1 (constants.%N)] // CHECK:STDOUT: %D.loc20_24.1: type = class_type @D, @D(%N.loc20_14.1) [symbolic = %D.loc20_24.1 (constants.%D)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @D.as.I.impl(%N.loc20_14.1) [symbolic = %I.impl_witness (constants.%I.impl_witness)] +// CHECK:STDOUT: %I.impl_witness.loc20_49.2: = impl_witness %I.impl_witness_table, @D.as.I.impl(%N.loc20_14.1) [symbolic = %I.impl_witness.loc20_49.2 (constants.%I.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %D.as.I.impl.F.type: type = fn_type @D.as.I.impl.F, @D.as.I.impl(%N.loc20_14.1) [symbolic = %D.as.I.impl.F.type (constants.%D.as.I.impl.F.type)] @@ -513,11 +512,14 @@ impl forall [N:! E] D(N) as I where .Assoc = () { // CHECK:STDOUT: } // CHECK:STDOUT: %c: %C.1ed = value_binding c, %c.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %D.as.I.impl.F.decl), @D.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness.loc20_49.1: = impl_witness %I.impl_witness_table, @D.as.I.impl(constants.%N) [symbolic = %I.impl_witness.loc20_49.2 (constants.%I.impl_witness)] +// CHECK:STDOUT: %impl_witness_assoc_constant: %Y.type = impl_witness_assoc_constant constants.%Y.facet [concrete = constants.%Y.facet] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = // CHECK:STDOUT: .F = %D.as.I.impl.F.decl -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness.loc20_49.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -602,7 +604,7 @@ impl forall [N:! E] D(N) as I where .Assoc = () { // CHECK:STDOUT: specific @D.as.I.impl(constants.%N) { // CHECK:STDOUT: %N.loc20_14.1 => constants.%N // CHECK:STDOUT: %D.loc20_24.1 => constants.%D -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness +// CHECK:STDOUT: %I.impl_witness.loc20_49.2 => constants.%I.impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %D.as.I.impl.F.type => constants.%D.as.I.impl.F.type diff --git a/toolchain/check/testdata/impl/import_thunk.carbon b/toolchain/check/testdata/impl/import_thunk.carbon index c5ffd0af3cd31..6b3d2a03c9541 100644 --- a/toolchain/check/testdata/impl/import_thunk.carbon +++ b/toolchain/check/testdata/impl/import_thunk.carbon @@ -118,7 +118,7 @@ fn G() { // CHECK:STDOUT: %C.c8540f.2: type = class_type @C, @C(%Y) [symbolic] // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] // CHECK:STDOUT: %Self.50f: %I.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%Y) [symbolic] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table, @C.as.I.impl(%Y) [symbolic] // CHECK:STDOUT: %I.F.type: type = fn_type @I.F [concrete] // CHECK:STDOUT: %I.F: %I.F.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] @@ -200,8 +200,6 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: %Y.loc7_14.2: %empty_tuple.type = symbolic_binding Y, 0 [symbolic = %Y.loc7_14.1 (constants.%Y)] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@C.as.I.impl.%C.as.I.impl.F.decl.loc8_17.2), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%Y) [symbolic = @C.as.I.impl.%I.impl_witness (constants.%I.impl_witness)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I [from "a.carbon"] { @@ -216,7 +214,7 @@ fn G() { // CHECK:STDOUT: generic impl @C.as.I.impl(%Y.loc7_14.2: %empty_tuple.type) { // CHECK:STDOUT: %Y.loc7_14.1: %empty_tuple.type = symbolic_binding Y, 0 [symbolic = %Y.loc7_14.1 (constants.%Y)] // CHECK:STDOUT: %C.loc7_25.1: type = class_type @C, @C(%Y.loc7_14.1) [symbolic = %C.loc7_25.1 (constants.%C.c8540f.2)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%Y.loc7_14.1) [symbolic = %I.impl_witness (constants.%I.impl_witness)] +// CHECK:STDOUT: %I.impl_witness.loc7_32.2: = impl_witness %I.impl_witness_table, @C.as.I.impl(%Y.loc7_14.1) [symbolic = %I.impl_witness.loc7_32.2 (constants.%I.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %C.as.I.impl.F.type.loc8_17.1: type = fn_type @C.as.I.impl.F.loc8_17.1, @C.as.I.impl(%Y.loc7_14.1) [symbolic = %C.as.I.impl.F.type.loc8_17.1 (constants.%C.as.I.impl.F.type.503216.1)] @@ -244,12 +242,14 @@ fn G() { // CHECK:STDOUT: %x.param: %empty_struct_type = value_param call_param0 // CHECK:STDOUT: %x: %empty_struct_type = value_binding x, %x.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%C.as.I.impl.F.decl.loc8_17.2), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness.loc7_32.1: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%Y) [symbolic = %I.impl_witness.loc7_32.2 (constants.%I.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = // CHECK:STDOUT: .Y = // CHECK:STDOUT: .F = %C.as.I.impl.F.decl.loc8_17.1 -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness.loc7_32.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -338,7 +338,7 @@ fn G() { // CHECK:STDOUT: specific @C.as.I.impl(constants.%Y) { // CHECK:STDOUT: %Y.loc7_14.1 => constants.%Y // CHECK:STDOUT: %C.loc7_25.1 => constants.%C.c8540f.2 -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness +// CHECK:STDOUT: %I.impl_witness.loc7_32.2 => constants.%I.impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %C.as.I.impl.F.type.loc8_17.1 => constants.%C.as.I.impl.F.type.503216.1 diff --git a/toolchain/check/testdata/impl/import_use_generic.carbon b/toolchain/check/testdata/impl/import_use_generic.carbon index c35822a350822..3de9429b00ce9 100644 --- a/toolchain/check/testdata/impl/import_use_generic.carbon +++ b/toolchain/check/testdata/impl/import_use_generic.carbon @@ -71,7 +71,7 @@ fn H() -> C({}).(I.F)() {} // CHECK:STDOUT: %I.F: %I.F.type = struct_value () [concrete] // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%I.F.decl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%T) [symbolic] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table, @C.as.I.impl(%T) [symbolic] // CHECK:STDOUT: %C.as.I.impl.F.type: type = fn_type @C.as.I.impl.F, @C.as.I.impl(%T) [symbolic] // CHECK:STDOUT: %C.as.I.impl.F: %C.as.I.impl.F.type = struct_value () [symbolic] // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [symbolic] @@ -99,8 +99,6 @@ fn H() -> C({}).(I.F)() {} // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc10_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc10_14.1 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@C.as.I.impl.%C.as.I.impl.F.decl), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%T) [symbolic = @C.as.I.impl.%I.impl_witness (constants.%I.impl_witness)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -119,7 +117,7 @@ fn H() -> C({}).(I.F)() {} // CHECK:STDOUT: generic impl @C.as.I.impl(%T.loc10_14.2: type) { // CHECK:STDOUT: %T.loc10_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc10_14.1 (constants.%T)] // CHECK:STDOUT: %C.loc10_27.1: type = class_type @C, @C(%T.loc10_14.1) [symbolic = %C.loc10_27.1 (constants.%C)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%T.loc10_14.1) [symbolic = %I.impl_witness (constants.%I.impl_witness)] +// CHECK:STDOUT: %I.impl_witness.loc10_34.2: = impl_witness %I.impl_witness_table, @C.as.I.impl(%T.loc10_14.1) [symbolic = %I.impl_witness.loc10_34.2 (constants.%I.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %C.as.I.impl.F.type: type = fn_type @C.as.I.impl.F, @C.as.I.impl(%T.loc10_14.1) [symbolic = %C.as.I.impl.F.type (constants.%C.as.I.impl.F.type)] @@ -127,10 +125,12 @@ fn H() -> C({}).(I.F)() {} // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.loc10_27.2 as %I.ref { // CHECK:STDOUT: %C.as.I.impl.F.decl: @C.as.I.impl.%C.as.I.impl.F.type (%C.as.I.impl.F.type) = fn_decl @C.as.I.impl.F [symbolic = @C.as.I.impl.%C.as.I.impl.F (constants.%C.as.I.impl.F)] {} {} +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%C.as.I.impl.F.decl), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness.loc10_34.1: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%T) [symbolic = %I.impl_witness.loc10_34.2 (constants.%I.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %C.as.I.impl.F.decl -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness.loc10_34.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -170,7 +170,7 @@ fn H() -> C({}).(I.F)() {} // CHECK:STDOUT: specific @C.as.I.impl(constants.%T) { // CHECK:STDOUT: %T.loc10_14.1 => constants.%T // CHECK:STDOUT: %C.loc10_27.1 => constants.%C -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness +// CHECK:STDOUT: %I.impl_witness.loc10_34.2 => constants.%I.impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %C.as.I.impl.F.type => constants.%C.as.I.impl.F.type diff --git a/toolchain/check/testdata/impl/incomplete.carbon b/toolchain/check/testdata/impl/incomplete.carbon index fa985ca4fef04..4d7783acbcac9 100644 --- a/toolchain/check/testdata/impl/incomplete.carbon +++ b/toolchain/check/testdata/impl/incomplete.carbon @@ -214,7 +214,7 @@ interface B { // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @empty_struct_type.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -227,8 +227,6 @@ interface B { // CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %I.ref.loc6: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @empty_struct_type.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} { // CHECK:STDOUT: %.loc15_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc15_7.2: type = converted %.loc15_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] @@ -239,6 +237,9 @@ interface B { // CHECK:STDOUT: interface @I; // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc6_7.2 as %I.ref.loc6 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @empty_struct_type.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = // CHECK:STDOUT: } @@ -250,7 +251,7 @@ interface B { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness file.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness @C.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -269,8 +270,6 @@ interface B { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (), @C.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @J; @@ -278,6 +277,9 @@ interface B { // CHECK:STDOUT: impl @C.as..impl: %C.ref as ; // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.J.impl: %C.ref as %J.ref { +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (), @C.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = // CHECK:STDOUT: } @@ -297,7 +299,7 @@ interface B { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness file.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness @C.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -311,13 +313,14 @@ interface B { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (), @C.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @J; // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.J.impl: %C.ref as %J.ref { +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (), @C.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = // CHECK:STDOUT: } @@ -442,7 +445,7 @@ interface B { // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where .Self impls @Incomplete> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -467,8 +470,6 @@ interface B { // CHECK:STDOUT: requirement_impls %.loc8_19, %Incomplete.ref // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -484,8 +485,11 @@ interface B { // CHECK:STDOUT: interface @Incomplete; // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.I.impl: %C.ref as %.loc8_13 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -514,7 +518,7 @@ interface B { // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %J_where.type: type = facet_type <@J where .Self impls @Incomplete and %impl.elem0 = %empty_tuple.type> [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness file.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness @C.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -547,9 +551,6 @@ interface B { // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc8, %.loc8_52.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: impl_decl @C.as.J.impl [concrete] {} { // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %J.ref.loc10: type = name_ref J, file.%J.decl [concrete = constants.%J.type] @@ -594,8 +595,12 @@ interface B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.J.impl: %C.ref.loc8 as %.loc8_13 { +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%J.impl_witness +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -622,7 +627,7 @@ interface B { // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where .Self impls @Incomplete> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.I.impl.F.type: type = fn_type @C.as.I.impl.F [concrete] // CHECK:STDOUT: %C.as.I.impl.F: %C.as.I.impl.F.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -649,8 +654,6 @@ interface B { // CHECK:STDOUT: requirement_impls %.loc8_19, %Incomplete.ref // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -676,11 +679,13 @@ interface B { // CHECK:STDOUT: %return.param: ref = out_param call_param0 // CHECK:STDOUT: %return: ref = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Incomplete = // CHECK:STDOUT: .F = %C.as.I.impl.F.decl -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -740,7 +745,7 @@ interface B { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %X.impl_witness: = impl_witness file.%X.impl_witness_table [concrete] +// CHECK:STDOUT: %X.impl_witness: = impl_witness @C.as.X.impl.%X.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -758,8 +763,6 @@ interface B { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %X.impl_witness_table = impl_witness_table (), @C.as.X.impl [concrete] -// CHECK:STDOUT: %X.impl_witness: = impl_witness %X.impl_witness_table [concrete = constants.%X.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Z; @@ -814,8 +817,11 @@ interface B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.X.impl: %C.ref as %X.ref { +// CHECK:STDOUT: %X.impl_witness_table = impl_witness_table (), @C.as.X.impl [concrete] +// CHECK:STDOUT: %X.impl_witness: = impl_witness %X.impl_witness_table [concrete = constants.%X.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%X.impl_witness +// CHECK:STDOUT: witness = %X.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/impl/interface_args.carbon b/toolchain/check/testdata/impl/interface_args.carbon index 89da7164695f4..79f3a3d109274 100644 --- a/toolchain/check/testdata/impl/interface_args.carbon +++ b/toolchain/check/testdata/impl/interface_args.carbon @@ -230,7 +230,7 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %B: type = class_type @B [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %Action.type.15e: type = facet_type <@Action, @Action(%B)> [concrete] -// CHECK:STDOUT: %Action.impl_witness: = impl_witness file.%Action.impl_witness_table [concrete] +// CHECK:STDOUT: %Action.impl_witness: = impl_witness @A.as.Action.impl.%Action.impl_witness_table [concrete] // CHECK:STDOUT: %Self.b1b: %Action.type.15e = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %Action.Op.type.30c: type = fn_type @Action.Op, @Action(%B) [concrete] // CHECK:STDOUT: %Action.Op.aa4: %Action.Op.type.30c = struct_value () [concrete] @@ -277,8 +277,6 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B] // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%B)> [concrete = constants.%Action.type.15e] // CHECK:STDOUT: } -// CHECK:STDOUT: %Action.impl_witness_table = impl_witness_table (@A.as.Action.impl.%A.as.Action.impl.Op.decl), @A.as.Action.impl [concrete] -// CHECK:STDOUT: %Action.impl_witness: = impl_witness %Action.impl_witness_table [concrete = constants.%Action.impl_witness] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %a.patt: %pattern_type.1ab = value_binding_pattern a [concrete] // CHECK:STDOUT: %a.param_patt: %pattern_type.1ab = value_param_pattern %a.patt, call_param0 [concrete] @@ -335,10 +333,12 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @A.as.Action.impl.%A.ref [concrete = constants.%A] // CHECK:STDOUT: %self: %A = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Action.impl_witness_table = impl_witness_table (%A.as.Action.impl.Op.decl), @A.as.Action.impl [concrete] +// CHECK:STDOUT: %Action.impl_witness: = impl_witness %Action.impl_witness_table [concrete = constants.%Action.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %A.as.Action.impl.Op.decl -// CHECK:STDOUT: witness = file.%Action.impl_witness +// CHECK:STDOUT: witness = %Action.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { @@ -829,7 +829,7 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %B: type = class_type @B [concrete] // CHECK:STDOUT: %Factory.type.345: type = facet_type <@Factory, @Factory(%B)> [concrete] -// CHECK:STDOUT: %Factory.impl_witness: = impl_witness file.%Factory.impl_witness_table [concrete] +// CHECK:STDOUT: %Factory.impl_witness: = impl_witness @A.as.Factory.impl.%Factory.impl_witness_table [concrete] // CHECK:STDOUT: %Self.d2a: %Factory.type.345 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %Factory.Make.type.662: type = fn_type @Factory.Make, @Factory(%B) [concrete] // CHECK:STDOUT: %Factory.Make.e72: %Factory.Make.type.662 = struct_value () [concrete] @@ -876,8 +876,6 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B] // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(constants.%B)> [concrete = constants.%Factory.type.345] // CHECK:STDOUT: } -// CHECK:STDOUT: %Factory.impl_witness_table = impl_witness_table (@A.as.Factory.impl.%A.as.Factory.impl.Make.decl, @A.as.Factory.impl.%A.as.Factory.impl.Method.decl), @A.as.Factory.impl [concrete] -// CHECK:STDOUT: %Factory.impl_witness: = impl_witness %Factory.impl_witness_table [concrete = constants.%Factory.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @Factory(%T.loc4_19.2: type) { @@ -958,12 +956,14 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %return.param: ref %B = out_param call_param1 // CHECK:STDOUT: %return: ref %B = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Factory.impl_witness_table = impl_witness_table (%A.as.Factory.impl.Make.decl, %A.as.Factory.impl.Method.decl), @A.as.Factory.impl [concrete] +// CHECK:STDOUT: %Factory.impl_witness: = impl_witness %Factory.impl_witness_table [concrete = constants.%Factory.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .B = // CHECK:STDOUT: .Make = %A.as.Factory.impl.Make.decl // CHECK:STDOUT: .Method = %A.as.Factory.impl.Method.decl -// CHECK:STDOUT: witness = file.%Factory.impl_witness +// CHECK:STDOUT: witness = %Factory.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { diff --git a/toolchain/check/testdata/impl/lookup/alias.carbon b/toolchain/check/testdata/impl/lookup/alias.carbon index 86020422217f8..f65a1d4db593c 100644 --- a/toolchain/check/testdata/impl/lookup/alias.carbon +++ b/toolchain/check/testdata/impl/lookup/alias.carbon @@ -42,7 +42,7 @@ fn G(c: C) { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table [concrete] +// CHECK:STDOUT: %HasF.impl_witness: = impl_witness @C.as.HasF.impl.%HasF.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.HasF.impl.F.type: type = fn_type @C.as.HasF.impl.F [concrete] // CHECK:STDOUT: %C.as.HasF.impl.F: %C.as.HasF.impl.F.type = struct_value () [concrete] // CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C, (%HasF.impl_witness) [concrete] @@ -64,8 +64,6 @@ fn G(c: C) { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@C.as.HasF.impl.%C.as.HasF.impl.F.decl), @C.as.HasF.impl [concrete] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table [concrete = constants.%HasF.impl_witness] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %c.patt: %pattern_type = value_binding_pattern c [concrete] // CHECK:STDOUT: %c.param_patt: %pattern_type = value_param_pattern %c.patt, call_param0 [concrete] @@ -91,10 +89,12 @@ fn G(c: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.HasF.impl: %C.ref as %HasF.ref { // CHECK:STDOUT: %C.as.HasF.impl.F.decl: %C.as.HasF.impl.F.type = fn_decl @C.as.HasF.impl.F [concrete = constants.%C.as.HasF.impl.F] {} {} +// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%C.as.HasF.impl.F.decl), @C.as.HasF.impl [concrete] +// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table [concrete = constants.%HasF.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %C.as.HasF.impl.F.decl -// CHECK:STDOUT: witness = file.%HasF.impl_witness +// CHECK:STDOUT: witness = %HasF.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon b/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon index adcd3024e7629..49e5ec509006d 100644 --- a/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon +++ b/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon @@ -96,12 +96,12 @@ fn G() { // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.893: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.as.I.impl.II.type: type = fn_type @C.as.I.impl.II [concrete] // CHECK:STDOUT: %C.as.I.impl.II: %C.as.I.impl.II.type = struct_value () [concrete] // CHECK:STDOUT: %I.facet.0f8: %I.type = facet_value %C, (%I.impl_witness) [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness @C.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness @C.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.J.impl.JJ.type: type = fn_type @C.as.J.impl.JJ [concrete] // CHECK:STDOUT: %C.as.J.impl.JJ: %C.as.J.impl.JJ.type = struct_value () [concrete] // CHECK:STDOUT: %J.facet.72c: %J.type = facet_value %C, (%J.impl_witness) [concrete] @@ -230,10 +230,12 @@ fn G() { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] // CHECK:STDOUT: %self: %C = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%C.as.I.impl.II.decl), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .II = %C.as.I.impl.II.decl -// CHECK:STDOUT: witness = @C.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.J.impl: %Self.ref as %J.ref { @@ -245,10 +247,12 @@ fn G() { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] // CHECK:STDOUT: %self: %C = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%C.as.J.impl.JJ.decl), @C.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .JJ = %C.as.J.impl.JJ.decl -// CHECK:STDOUT: witness = @C.%J.impl_witness +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -256,14 +260,10 @@ fn G() { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@C.as.I.impl.%C.as.I.impl.II.decl), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: impl_decl @C.as.J.impl [concrete] {} { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (@C.as.J.impl.%C.as.J.impl.JJ.decl), @C.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon index 2f8e845139af2..662886e0f7d46 100644 --- a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon @@ -58,14 +58,14 @@ fn G() { // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%I.F.decl [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %I.impl_witness.563: = impl_witness @C.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness.563: = impl_witness @C.as.I.impl.865.%I.impl_witness_table [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %I.facet.d5f: %I.type = facet_value %C, (%I.impl_witness.563) [concrete] // CHECK:STDOUT: %.776: type = fn_type_with_self_type %I.F.type, %I.facet.d5f [concrete] -// CHECK:STDOUT: %I.impl_witness.fe3: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness.fe3: = impl_witness @C.as.I.impl.518.%I.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.I.impl.F.type: type = fn_type @C.as.I.impl.F [concrete] // CHECK:STDOUT: %C.as.I.impl.F: %C.as.I.impl.F.type = struct_value () [concrete] // CHECK:STDOUT: %I.facet.1ca: %I.type = facet_value %C, (%I.impl_witness.fe3) [concrete] @@ -87,8 +87,6 @@ fn G() { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@C.as.I.impl.518.%C.as.I.impl.F.decl), @C.as.I.impl.518 [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.fe3] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -109,10 +107,12 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.I.impl.518: %C.ref as %I.ref { // CHECK:STDOUT: %C.as.I.impl.F.decl: %C.as.I.impl.F.type = fn_decl @C.as.I.impl.F [concrete = constants.%C.as.I.impl.F] {} {} +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%C.as.I.impl.F.decl), @C.as.I.impl.518 [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.fe3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %C.as.I.impl.F.decl -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -120,8 +120,6 @@ fn G() { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl.865 [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.563] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/generic.carbon b/toolchain/check/testdata/impl/lookup/generic.carbon index c2701692aa2e7..70afd52bea03d 100644 --- a/toolchain/check/testdata/impl/lookup/generic.carbon +++ b/toolchain/check/testdata/impl/lookup/generic.carbon @@ -143,7 +143,7 @@ fn G(x: A) { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] -// CHECK:STDOUT: %HasF.impl_witness.d89: = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T) [symbolic] +// CHECK:STDOUT: %HasF.impl_witness.d89: = impl_witness @T.as.HasF.impl.%HasF.impl_witness_table, @T.as.HasF.impl(%T) [symbolic] // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [symbolic] // CHECK:STDOUT: %T.as.HasF.impl.F.type.6a3: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%T) [symbolic] // CHECK:STDOUT: %T.as.HasF.impl.F.f61: %T.as.HasF.impl.F.type.6a3 = struct_value () [symbolic] @@ -154,7 +154,7 @@ fn G(x: A) { // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] -// CHECK:STDOUT: %HasF.impl_witness.620: = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%empty_struct_type) [concrete] +// CHECK:STDOUT: %HasF.impl_witness.620: = impl_witness @T.as.HasF.impl.%HasF.impl_witness_table, @T.as.HasF.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %T.as.HasF.impl.F.type.b10: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %T.as.HasF.impl.F.0c6: %T.as.HasF.impl.F.type.b10 = struct_value () [concrete] // CHECK:STDOUT: %HasF.facet.ca2: %HasF.type = facet_value %empty_struct_type, (%HasF.impl_witness.620) [concrete] @@ -186,8 +186,6 @@ fn G(x: A) { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc8_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc8_14.1 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@T.as.HasF.impl.%T.as.HasF.impl.F.decl), @T.as.HasF.impl [concrete] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table, @T.as.HasF.impl(constants.%T) [symbolic = @T.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness.d89)] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %x.patt: %pattern_type.a96 = value_binding_pattern x [concrete] // CHECK:STDOUT: %x.param_patt: %pattern_type.a96 = value_param_pattern %x.patt, call_param0 [concrete] @@ -227,7 +225,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: generic impl @T.as.HasF.impl(%T.loc8_14.2: type) { // CHECK:STDOUT: %T.loc8_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc8_14.1 (constants.%T)] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T.loc8_14.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness.d89)] +// CHECK:STDOUT: %HasF.impl_witness.loc8_34.2: = impl_witness %HasF.impl_witness_table, @T.as.HasF.impl(%T.loc8_14.1) [symbolic = %HasF.impl_witness.loc8_34.2 (constants.%HasF.impl_witness.d89)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as.HasF.impl.F.type: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%T.loc8_14.1) [symbolic = %T.as.HasF.impl.F.type (constants.%T.as.HasF.impl.F.type.6a3)] @@ -242,10 +240,12 @@ fn G(x: A) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @T.as.HasF.impl.%T.ref [symbolic = %T (constants.%T)] // CHECK:STDOUT: %self: @T.as.HasF.impl.F.%T (%T) = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%T.as.HasF.impl.F.decl), @T.as.HasF.impl [concrete] +// CHECK:STDOUT: %HasF.impl_witness.loc8_34.1: = impl_witness %HasF.impl_witness_table, @T.as.HasF.impl(constants.%T) [symbolic = %HasF.impl_witness.loc8_34.2 (constants.%HasF.impl_witness.d89)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %T.as.HasF.impl.F.decl -// CHECK:STDOUT: witness = file.%HasF.impl_witness +// CHECK:STDOUT: witness = %HasF.impl_witness.loc8_34.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -291,7 +291,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @T.as.HasF.impl(constants.%T) { // CHECK:STDOUT: %T.loc8_14.1 => constants.%T -// CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.d89 +// CHECK:STDOUT: %HasF.impl_witness.loc8_34.2 => constants.%HasF.impl_witness.d89 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as.HasF.impl.F.type => constants.%T.as.HasF.impl.F.type.6a3 @@ -311,7 +311,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @T.as.HasF.impl(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc8_14.1 => constants.%empty_struct_type -// CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.620 +// CHECK:STDOUT: %HasF.impl_witness.loc8_34.2 => constants.%HasF.impl_witness.620 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as.HasF.impl.F.type => constants.%T.as.HasF.impl.F.type.b10 @@ -342,7 +342,7 @@ fn G(x: A) { // CHECK:STDOUT: %T.67d: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %ptr.e8f: type = ptr_type %T.67d [symbolic] -// CHECK:STDOUT: %HasF.impl_witness.241: = impl_witness file.%HasF.impl_witness_table, @ptr.as.HasF.impl(%T.67d) [symbolic] +// CHECK:STDOUT: %HasF.impl_witness.241: = impl_witness @ptr.as.HasF.impl.%HasF.impl_witness_table, @ptr.as.HasF.impl(%T.67d) [symbolic] // CHECK:STDOUT: %pattern_type.4f4: type = pattern_type %ptr.e8f [symbolic] // CHECK:STDOUT: %ptr.as.HasF.impl.F.type.67d: type = fn_type @ptr.as.HasF.impl.F, @ptr.as.HasF.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.HasF.impl.F.e69: %ptr.as.HasF.impl.F.type.67d = struct_value () [symbolic] @@ -364,7 +364,7 @@ fn G(x: A) { // CHECK:STDOUT: %pattern_type.1cc: type = pattern_type %ptr.c28 [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] -// CHECK:STDOUT: %HasF.impl_witness.a16: = impl_witness file.%HasF.impl_witness_table, @ptr.as.HasF.impl(%empty_struct_type) [concrete] +// CHECK:STDOUT: %HasF.impl_witness.a16: = impl_witness @ptr.as.HasF.impl.%HasF.impl_witness_table, @ptr.as.HasF.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %ptr.as.HasF.impl.F.type.4d7: type = fn_type @ptr.as.HasF.impl.F, @ptr.as.HasF.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %ptr.as.HasF.impl.F.77d: %ptr.as.HasF.impl.F.type.4d7 = struct_value () [concrete] // CHECK:STDOUT: %HasF.facet.702: %HasF.type = facet_value %ptr.c28, (%HasF.impl_witness.a16) [concrete] @@ -408,8 +408,6 @@ fn G(x: A) { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc8_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc8_14.1 (constants.%T.67d)] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@ptr.as.HasF.impl.%ptr.as.HasF.impl.F.decl), @ptr.as.HasF.impl [concrete] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table, @ptr.as.HasF.impl(constants.%T.67d) [symbolic = @ptr.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness.241)] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %x.patt: %pattern_type.1cc = value_binding_pattern x [concrete] // CHECK:STDOUT: %x.param_patt: %pattern_type.1cc = value_param_pattern %x.patt, call_param0 [concrete] @@ -465,7 +463,7 @@ fn G(x: A) { // CHECK:STDOUT: generic impl @ptr.as.HasF.impl(%T.loc8_14.2: type) { // CHECK:STDOUT: %T.loc8_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc8_14.1 (constants.%T.67d)] // CHECK:STDOUT: %ptr.loc8_25.1: type = ptr_type %T.loc8_14.1 [symbolic = %ptr.loc8_25.1 (constants.%ptr.e8f)] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table, @ptr.as.HasF.impl(%T.loc8_14.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness.241)] +// CHECK:STDOUT: %HasF.impl_witness.loc8_35.2: = impl_witness %HasF.impl_witness_table, @ptr.as.HasF.impl(%T.loc8_14.1) [symbolic = %HasF.impl_witness.loc8_35.2 (constants.%HasF.impl_witness.241)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ptr.as.HasF.impl.F.type: type = fn_type @ptr.as.HasF.impl.F, @ptr.as.HasF.impl(%T.loc8_14.1) [symbolic = %ptr.as.HasF.impl.F.type (constants.%ptr.as.HasF.impl.F.type.67d)] @@ -486,11 +484,13 @@ fn G(x: A) { // CHECK:STDOUT: %return.param: ref @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.e8f) = out_param call_param1 // CHECK:STDOUT: %return: ref @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.e8f) = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%ptr.as.HasF.impl.F.decl), @ptr.as.HasF.impl [concrete] +// CHECK:STDOUT: %HasF.impl_witness.loc8_35.1: = impl_witness %HasF.impl_witness_table, @ptr.as.HasF.impl(constants.%T.67d) [symbolic = %HasF.impl_witness.loc8_35.2 (constants.%HasF.impl_witness.241)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .T = // CHECK:STDOUT: .F = %ptr.as.HasF.impl.F.decl -// CHECK:STDOUT: witness = file.%HasF.impl_witness +// CHECK:STDOUT: witness = %HasF.impl_witness.loc8_35.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -550,7 +550,7 @@ fn G(x: A) { // CHECK:STDOUT: specific @ptr.as.HasF.impl(constants.%T.67d) { // CHECK:STDOUT: %T.loc8_14.1 => constants.%T.67d // CHECK:STDOUT: %ptr.loc8_25.1 => constants.%ptr.e8f -// CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.241 +// CHECK:STDOUT: %HasF.impl_witness.loc8_35.2 => constants.%HasF.impl_witness.241 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ptr.as.HasF.impl.F.type => constants.%ptr.as.HasF.impl.F.type.67d @@ -572,7 +572,7 @@ fn G(x: A) { // CHECK:STDOUT: specific @ptr.as.HasF.impl(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc8_14.1 => constants.%empty_struct_type // CHECK:STDOUT: %ptr.loc8_25.1 => constants.%ptr.c28 -// CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.a16 +// CHECK:STDOUT: %HasF.impl_witness.loc8_35.2 => constants.%HasF.impl_witness.a16 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ptr.as.HasF.impl.F.type => constants.%ptr.as.HasF.impl.F.type.4d7 @@ -615,7 +615,7 @@ fn G(x: A) { // CHECK:STDOUT: %C.5a3: type = class_type @C, @C(%T) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %HasF.impl_witness.d16: = impl_witness file.%HasF.impl_witness_table, @C.as.HasF.impl(%T) [symbolic] +// CHECK:STDOUT: %HasF.impl_witness.d16: = impl_witness @C.as.HasF.impl.%HasF.impl_witness_table, @C.as.HasF.impl(%T) [symbolic] // CHECK:STDOUT: %pattern_type.3d5: type = pattern_type %C.5a3 [symbolic] // CHECK:STDOUT: %C.as.HasF.impl.F.type.b4c: type = fn_type @C.as.HasF.impl.F, @C.as.HasF.impl(%T) [symbolic] // CHECK:STDOUT: %C.as.HasF.impl.F.e79: %C.as.HasF.impl.F.type.b4c = struct_value () [symbolic] @@ -626,7 +626,7 @@ fn G(x: A) { // CHECK:STDOUT: %pattern_type.526: type = pattern_type %C.850 [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] -// CHECK:STDOUT: %HasF.impl_witness.7bd: = impl_witness file.%HasF.impl_witness_table, @C.as.HasF.impl(%empty_struct_type) [concrete] +// CHECK:STDOUT: %HasF.impl_witness.7bd: = impl_witness @C.as.HasF.impl.%HasF.impl_witness_table, @C.as.HasF.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %C.as.HasF.impl.F.type.d4d: type = fn_type @C.as.HasF.impl.F, @C.as.HasF.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %C.as.HasF.impl.F.8f9: %C.as.HasF.impl.F.type.d4d = struct_value () [concrete] // CHECK:STDOUT: %HasF.facet.82f: %HasF.type = facet_value %C.850, (%HasF.impl_witness.7bd) [concrete] @@ -666,8 +666,6 @@ fn G(x: A) { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc10_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc10_14.1 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@C.as.HasF.impl.%C.as.HasF.impl.F.decl), @C.as.HasF.impl [concrete] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table, @C.as.HasF.impl(constants.%T) [symbolic = @C.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness.d16)] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %x.patt: %pattern_type.526 = value_binding_pattern x [concrete] // CHECK:STDOUT: %x.param_patt: %pattern_type.526 = value_param_pattern %x.patt, call_param0 [concrete] @@ -710,7 +708,7 @@ fn G(x: A) { // CHECK:STDOUT: generic impl @C.as.HasF.impl(%T.loc10_14.2: type) { // CHECK:STDOUT: %T.loc10_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc10_14.1 (constants.%T)] // CHECK:STDOUT: %C.loc10_27.1: type = class_type @C, @C(%T.loc10_14.1) [symbolic = %C.loc10_27.1 (constants.%C.5a3)] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table, @C.as.HasF.impl(%T.loc10_14.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness.d16)] +// CHECK:STDOUT: %HasF.impl_witness.loc10_37.2: = impl_witness %HasF.impl_witness_table, @C.as.HasF.impl(%T.loc10_14.1) [symbolic = %HasF.impl_witness.loc10_37.2 (constants.%HasF.impl_witness.d16)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %C.as.HasF.impl.F.type: type = fn_type @C.as.HasF.impl.F, @C.as.HasF.impl(%T.loc10_14.1) [symbolic = %C.as.HasF.impl.F.type (constants.%C.as.HasF.impl.F.type.b4c)] @@ -725,10 +723,12 @@ fn G(x: A) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.HasF.impl.%C.loc10_27.2 [symbolic = %C (constants.%C.5a3)] // CHECK:STDOUT: %self: @C.as.HasF.impl.F.%C (%C.5a3) = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%C.as.HasF.impl.F.decl), @C.as.HasF.impl [concrete] +// CHECK:STDOUT: %HasF.impl_witness.loc10_37.1: = impl_witness %HasF.impl_witness_table, @C.as.HasF.impl(constants.%T) [symbolic = %HasF.impl_witness.loc10_37.2 (constants.%HasF.impl_witness.d16)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %C.as.HasF.impl.F.decl -// CHECK:STDOUT: witness = file.%HasF.impl_witness +// CHECK:STDOUT: witness = %HasF.impl_witness.loc10_37.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -796,7 +796,7 @@ fn G(x: A) { // CHECK:STDOUT: specific @C.as.HasF.impl(constants.%T) { // CHECK:STDOUT: %T.loc10_14.1 => constants.%T // CHECK:STDOUT: %C.loc10_27.1 => constants.%C.5a3 -// CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.d16 +// CHECK:STDOUT: %HasF.impl_witness.loc10_37.2 => constants.%HasF.impl_witness.d16 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %C.as.HasF.impl.F.type => constants.%C.as.HasF.impl.F.type.b4c @@ -824,7 +824,7 @@ fn G(x: A) { // CHECK:STDOUT: specific @C.as.HasF.impl(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc10_14.1 => constants.%empty_struct_type // CHECK:STDOUT: %C.loc10_27.1 => constants.%C.850 -// CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.7bd +// CHECK:STDOUT: %HasF.impl_witness.loc10_37.2 => constants.%HasF.impl_witness.7bd // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %C.as.HasF.impl.F.type => constants.%C.as.HasF.impl.F.type.d4d @@ -860,7 +860,7 @@ fn G(x: A) { // CHECK:STDOUT: %assoc0.303: %HasF.assoc_type.196 = assoc_entity element0, @HasF.%HasF.F.decl [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] -// CHECK:STDOUT: %HasF.impl_witness.554: = impl_witness file.%HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(%T) [symbolic] +// CHECK:STDOUT: %HasF.impl_witness.554: = impl_witness @empty_struct_type.as.HasF.impl.%HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(%T) [symbolic] // CHECK:STDOUT: %require_complete: = require_complete_type %HasF.type.4b7 [symbolic] // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.type.637: type = fn_type @empty_struct_type.as.HasF.impl.F, @empty_struct_type.as.HasF.impl(%T) [symbolic] @@ -874,7 +874,7 @@ fn G(x: A) { // CHECK:STDOUT: %HasF.F.6a4: %HasF.F.type.9d7 = struct_value () [concrete] // CHECK:STDOUT: %HasF.assoc_type.78b: type = assoc_entity_type @HasF, @HasF(%empty_struct_type) [concrete] // CHECK:STDOUT: %assoc0.ed4: %HasF.assoc_type.78b = assoc_entity element0, @HasF.%HasF.F.decl [concrete] -// CHECK:STDOUT: %HasF.impl_witness.70c: = impl_witness file.%HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(%empty_struct_type) [concrete] +// CHECK:STDOUT: %HasF.impl_witness.70c: = impl_witness @empty_struct_type.as.HasF.impl.%HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %HasF.type.370 [concrete] // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.type.ea9: type = fn_type @empty_struct_type.as.HasF.impl.F, @empty_struct_type.as.HasF.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.efe: %empty_struct_type.as.HasF.impl.F.type.ea9 = struct_value () [concrete] @@ -914,8 +914,6 @@ fn G(x: A) { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc8_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc8_14.1 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@empty_struct_type.as.HasF.impl.%empty_struct_type.as.HasF.impl.F.decl), @empty_struct_type.as.HasF.impl [concrete] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(constants.%T) [symbolic = @empty_struct_type.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness.554)] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %x.patt: %pattern_type.a96 = value_binding_pattern x [concrete] // CHECK:STDOUT: %x.param_patt: %pattern_type.a96 = value_param_pattern %x.patt, call_param0 [concrete] @@ -969,7 +967,7 @@ fn G(x: A) { // CHECK:STDOUT: generic impl @empty_struct_type.as.HasF.impl(%T.loc8_14.2: type) { // CHECK:STDOUT: %T.loc8_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc8_14.1 (constants.%T)] // CHECK:STDOUT: %HasF.type.loc8_36.1: type = facet_type <@HasF, @HasF(%T.loc8_14.1)> [symbolic = %HasF.type.loc8_36.1 (constants.%HasF.type.4b7)] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(%T.loc8_14.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness.554)] +// CHECK:STDOUT: %HasF.impl_witness.loc8_38.2: = impl_witness %HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(%T.loc8_14.1) [symbolic = %HasF.impl_witness.loc8_38.2 (constants.%HasF.impl_witness.554)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %HasF.type.loc8_36.1 [symbolic = %require_complete (constants.%require_complete)] @@ -985,10 +983,12 @@ fn G(x: A) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_struct_type.as.HasF.impl.%.loc8_25.2 [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %self: %empty_struct_type = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%empty_struct_type.as.HasF.impl.F.decl), @empty_struct_type.as.HasF.impl [concrete] +// CHECK:STDOUT: %HasF.impl_witness.loc8_38.1: = impl_witness %HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(constants.%T) [symbolic = %HasF.impl_witness.loc8_38.2 (constants.%HasF.impl_witness.554)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %empty_struct_type.as.HasF.impl.F.decl -// CHECK:STDOUT: witness = file.%HasF.impl_witness +// CHECK:STDOUT: witness = %HasF.impl_witness.loc8_38.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1051,7 +1051,7 @@ fn G(x: A) { // CHECK:STDOUT: specific @empty_struct_type.as.HasF.impl(constants.%T) { // CHECK:STDOUT: %T.loc8_14.1 => constants.%T // CHECK:STDOUT: %HasF.type.loc8_36.1 => constants.%HasF.type.4b7 -// CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.554 +// CHECK:STDOUT: %HasF.impl_witness.loc8_38.2 => constants.%HasF.impl_witness.554 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete @@ -1084,7 +1084,7 @@ fn G(x: A) { // CHECK:STDOUT: specific @empty_struct_type.as.HasF.impl(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc8_14.1 => constants.%empty_struct_type // CHECK:STDOUT: %HasF.type.loc8_36.1 => constants.%HasF.type.370 -// CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.70c +// CHECK:STDOUT: %HasF.impl_witness.loc8_38.2 => constants.%HasF.impl_witness.70c // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type @@ -1112,7 +1112,7 @@ fn G(x: A) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %U: type = symbolic_binding U, 1 [symbolic] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T, %U) [symbolic] +// CHECK:STDOUT: %HasF.impl_witness: = impl_witness @T.as.HasF.impl.%HasF.impl_witness_table, @T.as.HasF.impl(%T, %U) [symbolic] // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [symbolic] // CHECK:STDOUT: %T.as.HasF.impl.F.type: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%T, %U) [symbolic] // CHECK:STDOUT: %T.as.HasF.impl.F: %T.as.HasF.impl.F.type = struct_value () [symbolic] @@ -1150,8 +1150,6 @@ fn G(x: A) { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %U.loc12_24.2: type = symbolic_binding U, 1 [symbolic = %U.loc12_24.1 (constants.%U)] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (), @T.as.HasF.impl [concrete] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table, @T.as.HasF.impl(constants.%T, constants.%U) [symbolic = @T.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness)] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %x.patt: %pattern_type.a96 = value_binding_pattern x [concrete] // CHECK:STDOUT: %x.param_patt: %pattern_type.a96 = value_param_pattern %x.patt, call_param0 [concrete] @@ -1192,7 +1190,7 @@ fn G(x: A) { // CHECK:STDOUT: generic impl @T.as.HasF.impl(%T.loc12_14.2: type, %U.loc12_24.2: type) { // CHECK:STDOUT: %T.loc12_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc12_14.1 (constants.%T)] // CHECK:STDOUT: %U.loc12_24.1: type = symbolic_binding U, 1 [symbolic = %U.loc12_24.1 (constants.%U)] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T.loc12_14.1, %U.loc12_24.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness)] +// CHECK:STDOUT: %HasF.impl_witness.loc12_44.2: = impl_witness %HasF.impl_witness_table, @T.as.HasF.impl(%T.loc12_14.1, %U.loc12_24.1) [symbolic = %HasF.impl_witness.loc12_44.2 (constants.%HasF.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as.HasF.impl.F.type: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%T.loc12_14.1, %U.loc12_24.1) [symbolic = %T.as.HasF.impl.F.type (constants.%T.as.HasF.impl.F.type)] @@ -1207,6 +1205,8 @@ fn G(x: A) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @T.as.HasF.impl.%T.ref [symbolic = %T (constants.%T)] // CHECK:STDOUT: %self: @T.as.HasF.impl.F.%T (%T) = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (), @T.as.HasF.impl [concrete] +// CHECK:STDOUT: %HasF.impl_witness.loc12_44.1: = impl_witness %HasF.impl_witness_table, @T.as.HasF.impl(constants.%T, constants.%U) [symbolic = %HasF.impl_witness.loc12_44.2 (constants.%HasF.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %T.as.HasF.impl.F.decl @@ -1252,7 +1252,7 @@ fn G(x: A) { // CHECK:STDOUT: specific @T.as.HasF.impl(constants.%T, constants.%U) { // CHECK:STDOUT: %T.loc12_14.1 => constants.%T // CHECK:STDOUT: %U.loc12_24.1 => constants.%U -// CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness +// CHECK:STDOUT: %HasF.impl_witness.loc12_44.2 => constants.%HasF.impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as.HasF.impl.F.type => constants.%T.as.HasF.impl.F.type @@ -1281,7 +1281,7 @@ fn G(x: A) { // CHECK:STDOUT: %HasF.F.39f: %HasF.F.type.607 = struct_value () [symbolic] // CHECK:STDOUT: %HasF.assoc_type.196: type = assoc_entity_type @HasF, @HasF(%T) [symbolic] // CHECK:STDOUT: %assoc0.303: %HasF.assoc_type.196 = assoc_entity element0, @HasF.%HasF.F.decl [symbolic] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T) [symbolic] +// CHECK:STDOUT: %HasF.impl_witness: = impl_witness @T.as.HasF.impl.%HasF.impl_witness_table, @T.as.HasF.impl(%T) [symbolic] // CHECK:STDOUT: %require_complete.967: = require_complete_type %HasF.type.4b7 [symbolic] // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [symbolic] // CHECK:STDOUT: %T.as.HasF.impl.F.type: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%T) [symbolic] @@ -1335,8 +1335,6 @@ fn G(x: A) { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc8_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc8_14.1 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@T.as.HasF.impl.%T.as.HasF.impl.F.decl), @T.as.HasF.impl [concrete] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table, @T.as.HasF.impl(constants.%T) [symbolic = @T.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness)] // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {} // CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { @@ -1389,7 +1387,7 @@ fn G(x: A) { // CHECK:STDOUT: generic impl @T.as.HasF.impl(%T.loc8_14.2: type) { // CHECK:STDOUT: %T.loc8_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc8_14.1 (constants.%T)] // CHECK:STDOUT: %HasF.type.loc8_35.1: type = facet_type <@HasF, @HasF(%T.loc8_14.1)> [symbolic = %HasF.type.loc8_35.1 (constants.%HasF.type.4b7)] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T.loc8_14.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness)] +// CHECK:STDOUT: %HasF.impl_witness.loc8_37.2: = impl_witness %HasF.impl_witness_table, @T.as.HasF.impl(%T.loc8_14.1) [symbolic = %HasF.impl_witness.loc8_37.2 (constants.%HasF.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %HasF.type.loc8_35.1 [symbolic = %require_complete (constants.%require_complete.967)] @@ -1405,10 +1403,12 @@ fn G(x: A) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @T.as.HasF.impl.%T.ref.loc8_24 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %self: @T.as.HasF.impl.F.%T (%T) = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%T.as.HasF.impl.F.decl), @T.as.HasF.impl [concrete] +// CHECK:STDOUT: %HasF.impl_witness.loc8_37.1: = impl_witness %HasF.impl_witness_table, @T.as.HasF.impl(constants.%T) [symbolic = %HasF.impl_witness.loc8_37.2 (constants.%HasF.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %T.as.HasF.impl.F.decl -// CHECK:STDOUT: witness = file.%HasF.impl_witness +// CHECK:STDOUT: witness = %HasF.impl_witness.loc8_37.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1485,7 +1485,7 @@ fn G(x: A) { // CHECK:STDOUT: specific @T.as.HasF.impl(constants.%T) { // CHECK:STDOUT: %T.loc8_14.1 => constants.%T // CHECK:STDOUT: %HasF.type.loc8_35.1 => constants.%HasF.type.4b7 -// CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness +// CHECK:STDOUT: %HasF.impl_witness.loc8_37.2 => constants.%HasF.impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete.967 diff --git a/toolchain/check/testdata/impl/lookup/impl_forall.carbon b/toolchain/check/testdata/impl/lookup/impl_forall.carbon index 41f8ba9db0dca..3cca22c6d019c 100644 --- a/toolchain/check/testdata/impl/lookup/impl_forall.carbon +++ b/toolchain/check/testdata/impl/lookup/impl_forall.carbon @@ -53,7 +53,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %V.67d: type = symbolic_binding V, 0 [symbolic] // CHECK:STDOUT: %A.95c0c7.2: type = class_type @A, @A(%V.67d) [symbolic] // CHECK:STDOUT: %I.type.d71ca1.2: type = facet_type <@I, @I(%V.67d)> [symbolic] -// CHECK:STDOUT: %I.impl_witness.7e5ea5.1: = impl_witness file.%I.impl_witness_table, @A.as.I.impl(%V.67d) [symbolic] +// CHECK:STDOUT: %I.impl_witness.7e5ea5.1: = impl_witness @A.as.I.impl.%I.impl_witness_table, @A.as.I.impl(%V.67d) [symbolic] // CHECK:STDOUT: %require_complete.073574.1: = require_complete_type %I.type.d71ca1.2 [symbolic] // CHECK:STDOUT: %pattern_type.2c404c.1: type = pattern_type %A.95c0c7.2 [symbolic] // CHECK:STDOUT: %ptr.e8f8f9.2: type = ptr_type %V.67d [symbolic] @@ -84,7 +84,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %I.assoc_type.76c031.3: type = assoc_entity_type @I, @I(%W) [symbolic] // CHECK:STDOUT: %assoc0.6a687a.3: %I.assoc_type.76c031.3 = assoc_entity element0, @I.%I.F.decl [symbolic] // CHECK:STDOUT: %require_complete.073574.2: = require_complete_type %I.type.d71ca1.3 [symbolic] -// CHECK:STDOUT: %I.impl_witness.7e5ea5.2: = impl_witness file.%I.impl_witness_table, @A.as.I.impl(%W) [symbolic] +// CHECK:STDOUT: %I.impl_witness.7e5ea5.2: = impl_witness @A.as.I.impl.%I.impl_witness_table, @A.as.I.impl(%W) [symbolic] // CHECK:STDOUT: %A.as.I.impl.F.type.56f154.2: type = fn_type @A.as.I.impl.F, @A.as.I.impl(%W) [symbolic] // CHECK:STDOUT: %A.as.I.impl.F.5dc139.2: %A.as.I.impl.F.type.56f154.2 = struct_value () [symbolic] // CHECK:STDOUT: %.2d6: require_specific_def_type = require_specific_def @A.as.I.impl(%W) [symbolic] @@ -104,7 +104,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %I.F.type.550: type = fn_type @I.F, @I(%empty_struct_type) [concrete] // CHECK:STDOUT: %I.assoc_type.294: type = assoc_entity_type @I, @I(%empty_struct_type) [concrete] // CHECK:STDOUT: %assoc0.130: %I.assoc_type.294 = assoc_entity element0, @I.%I.F.decl [concrete] -// CHECK:STDOUT: %I.impl_witness.804: = impl_witness file.%I.impl_witness_table, @A.as.I.impl(%empty_struct_type) [concrete] +// CHECK:STDOUT: %I.impl_witness.804: = impl_witness @A.as.I.impl.%I.impl_witness_table, @A.as.I.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %complete_type.f92: = complete_type_witness %I.type.a51 [concrete] // CHECK:STDOUT: %A.as.I.impl.F.type.d7f: type = fn_type @A.as.I.impl.F, @A.as.I.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %A.as.I.impl.F.08d: %A.as.I.impl.F.type.d7f = struct_value () [concrete] @@ -143,15 +143,13 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: // CHECK:STDOUT: %V.loc12_14.2: type = symbolic_binding V, 0 [symbolic = %V.loc12_14.1 (constants.%V.67d)] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@A.as.I.impl.%A.as.I.impl.F.decl), @A.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table, @A.as.I.impl(constants.%V.67d) [symbolic = @A.as.I.impl.%I.impl_witness (constants.%I.impl_witness.7e5ea5.1)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @A.as.I.impl(%V.loc12_14.2: type) { // CHECK:STDOUT: %V.loc12_14.1: type = symbolic_binding V, 0 [symbolic = %V.loc12_14.1 (constants.%V.67d)] // CHECK:STDOUT: %A.loc12_27.1: type = class_type @A, @A(%V.loc12_14.1) [symbolic = %A.loc12_27.1 (constants.%A.95c0c7.2)] // CHECK:STDOUT: %I.type.loc12_35.1: type = facet_type <@I, @I(%V.loc12_14.1)> [symbolic = %I.type.loc12_35.1 (constants.%I.type.d71ca1.2)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @A.as.I.impl(%V.loc12_14.1) [symbolic = %I.impl_witness (constants.%I.impl_witness.7e5ea5.1)] +// CHECK:STDOUT: %I.impl_witness.loc12_37.2: = impl_witness %I.impl_witness_table, @A.as.I.impl(%V.loc12_14.1) [symbolic = %I.impl_witness.loc12_37.2 (constants.%I.impl_witness.7e5ea5.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %I.type.loc12_35.1 [symbolic = %require_complete (constants.%require_complete.073574.1)] @@ -173,11 +171,13 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %return.param: ref @A.as.I.impl.F.%ptr.loc13_30.1 (%ptr.e8f8f9.2) = out_param call_param1 // CHECK:STDOUT: %return: ref @A.as.I.impl.F.%ptr.loc13_30.1 (%ptr.e8f8f9.2) = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%A.as.I.impl.F.decl), @A.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness.loc12_37.1: = impl_witness %I.impl_witness_table, @A.as.I.impl(constants.%V.67d) [symbolic = %I.impl_witness.loc12_37.2 (constants.%I.impl_witness.7e5ea5.1)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .V = // CHECK:STDOUT: .F = %A.as.I.impl.F.decl -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness.loc12_37.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -272,7 +272,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %V.loc12_14.1 => constants.%V.67d // CHECK:STDOUT: %A.loc12_27.1 => constants.%A.95c0c7.2 // CHECK:STDOUT: %I.type.loc12_35.1 => constants.%I.type.d71ca1.2 -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness.7e5ea5.1 +// CHECK:STDOUT: %I.impl_witness.loc12_37.2 => constants.%I.impl_witness.7e5ea5.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete.073574.1 @@ -301,7 +301,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %V.loc12_14.1 => constants.%W // CHECK:STDOUT: %A.loc12_27.1 => constants.%A.95c0c7.3 // CHECK:STDOUT: %I.type.loc12_35.1 => constants.%I.type.d71ca1.3 -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness.7e5ea5.2 +// CHECK:STDOUT: %I.impl_witness.loc12_37.2 => constants.%I.impl_witness.7e5ea5.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete.073574.2 @@ -313,7 +313,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %V.loc12_14.1 => constants.%empty_struct_type // CHECK:STDOUT: %A.loc12_27.1 => constants.%A.ed7 // CHECK:STDOUT: %I.type.loc12_35.1 => constants.%I.type.a51 -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness.804 +// CHECK:STDOUT: %I.impl_witness.loc12_37.2 => constants.%I.impl_witness.804 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.f92 diff --git a/toolchain/check/testdata/impl/lookup/import.carbon b/toolchain/check/testdata/impl/lookup/import.carbon index 58cd6ab66b51f..31cc60b21a352 100644 --- a/toolchain/check/testdata/impl/lookup/import.carbon +++ b/toolchain/check/testdata/impl/lookup/import.carbon @@ -237,7 +237,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table [concrete] +// CHECK:STDOUT: %HasF.impl_witness: = impl_witness @C.as.HasF.impl.%HasF.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.039: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.as.HasF.impl.F.type: type = fn_type @C.as.HasF.impl.F [concrete] // CHECK:STDOUT: %C.as.HasF.impl.F: %C.as.HasF.impl.F.type = struct_value () [concrete] @@ -264,8 +264,6 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@C.as.HasF.impl.%C.as.HasF.impl.F.decl), @C.as.HasF.impl [concrete] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table [concrete = constants.%HasF.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { @@ -301,10 +299,12 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.HasF.impl.%C.ref [concrete = constants.%C] // CHECK:STDOUT: %self: %C = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%C.as.HasF.impl.F.decl), @C.as.HasF.impl [concrete] +// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table [concrete = constants.%HasF.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %C.as.HasF.impl.F.decl -// CHECK:STDOUT: witness = file.%HasF.impl_witness +// CHECK:STDOUT: witness = %HasF.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -355,14 +355,14 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %HasG.impl_witness.330: = impl_witness file.%HasG.impl_witness_table.loc13 [concrete] +// CHECK:STDOUT: %HasG.impl_witness.330: = impl_witness @C.as.HasG.impl.%HasG.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.8e5: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.as.HasG.impl.G.type: type = fn_type @C.as.HasG.impl.G [concrete] // CHECK:STDOUT: %C.as.HasG.impl.G: %C.as.HasG.impl.G.type = struct_value () [concrete] // CHECK:STDOUT: %HasG.facet.a3a: %HasG.type = facet_value %C, (%HasG.impl_witness.330) [concrete] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete] // CHECK:STDOUT: %Self.f50: %HasF.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table [concrete] +// CHECK:STDOUT: %HasF.impl_witness: = impl_witness @D.as.HasF.impl.%HasF.impl_witness_table [concrete] // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F [concrete] // CHECK:STDOUT: %HasF.F: %HasF.F.type = struct_value () [concrete] // CHECK:STDOUT: %Self.binding.as_type.0b1: type = symbolic_binding_type Self, 0, %Self.f50 [symbolic] @@ -371,7 +371,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %D.as.HasF.impl.F.type: type = fn_type @D.as.HasF.impl.F [concrete] // CHECK:STDOUT: %D.as.HasF.impl.F: %D.as.HasF.impl.F.type = struct_value () [concrete] // CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %D, (%HasF.impl_witness) [concrete] -// CHECK:STDOUT: %HasG.impl_witness.a0b: = impl_witness file.%HasG.impl_witness_table.loc23 [concrete] +// CHECK:STDOUT: %HasG.impl_witness.a0b: = impl_witness @D.as.HasG.impl.%HasG.impl_witness_table [concrete] // CHECK:STDOUT: %D.as.HasG.impl.G.type: type = fn_type @D.as.HasG.impl.G [concrete] // CHECK:STDOUT: %D.as.HasG.impl.G: %D.as.HasG.impl.G.type = struct_value () [concrete] // CHECK:STDOUT: %HasG.facet.8c2: %HasG.type = facet_value %D, (%HasG.impl_witness.a0b) [concrete] @@ -413,21 +413,15 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%PackageA.C [concrete = constants.%C] // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, file.%HasG.decl [concrete = constants.%HasG.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasG.impl_witness_table.loc13 = impl_witness_table (@C.as.HasG.impl.%C.as.HasG.impl.G.decl), @C.as.HasG.impl [concrete] -// CHECK:STDOUT: %HasG.impl_witness.loc13: = impl_witness %HasG.impl_witness_table.loc13 [concrete = constants.%HasG.impl_witness.330] // CHECK:STDOUT: impl_decl @D.as.HasF.impl [concrete] {} { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %PackageA.ref: = name_ref PackageA, imports.%PackageA [concrete = imports.%PackageA] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%PackageA.HasF [concrete = constants.%HasF.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@D.as.HasF.impl.%D.as.HasF.impl.F.decl), @D.as.HasF.impl [concrete] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table [concrete = constants.%HasF.impl_witness] // CHECK:STDOUT: impl_decl @D.as.HasG.impl [concrete] {} { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, file.%HasG.decl [concrete = constants.%HasG.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasG.impl_witness_table.loc23 = impl_witness_table (@D.as.HasG.impl.%D.as.HasG.impl.G.decl), @D.as.HasG.impl [concrete] -// CHECK:STDOUT: %HasG.impl_witness.loc23: = impl_witness %HasG.impl_witness_table.loc23 [concrete = constants.%HasG.impl_witness.a0b] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasG { @@ -472,10 +466,12 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.HasG.impl.%C.ref [concrete = constants.%C] // CHECK:STDOUT: %self: %C = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %HasG.impl_witness_table = impl_witness_table (%C.as.HasG.impl.G.decl), @C.as.HasG.impl [concrete] +// CHECK:STDOUT: %HasG.impl_witness: = impl_witness %HasG.impl_witness_table [concrete = constants.%HasG.impl_witness.330] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G = %C.as.HasG.impl.G.decl -// CHECK:STDOUT: witness = file.%HasG.impl_witness.loc13 +// CHECK:STDOUT: witness = %HasG.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @D.as.HasF.impl: %D.ref as %HasF.ref { @@ -487,10 +483,12 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @D.as.HasF.impl.%D.ref [concrete = constants.%D] // CHECK:STDOUT: %self: %D = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%D.as.HasF.impl.F.decl), @D.as.HasF.impl [concrete] +// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table [concrete = constants.%HasF.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %D.as.HasF.impl.F.decl -// CHECK:STDOUT: witness = file.%HasF.impl_witness +// CHECK:STDOUT: witness = %HasF.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @D.as.HasG.impl: %D.ref as %HasG.ref { @@ -502,10 +500,12 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @D.as.HasG.impl.%D.ref [concrete = constants.%D] // CHECK:STDOUT: %self: %D = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %HasG.impl_witness_table = impl_witness_table (%D.as.HasG.impl.G.decl), @D.as.HasG.impl [concrete] +// CHECK:STDOUT: %HasG.impl_witness: = impl_witness %HasG.impl_witness_table [concrete = constants.%HasG.impl_witness.a0b] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G = %D.as.HasG.impl.G.decl -// CHECK:STDOUT: witness = file.%HasG.impl_witness.loc23 +// CHECK:STDOUT: witness = %HasG.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { @@ -1145,7 +1145,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z [concrete] // CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, @Z.%Z.H.decl [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness file.%Z.impl_witness_table [concrete] +// CHECK:STDOUT: %Z.impl_witness: = impl_witness @empty_tuple.type.as.Z.impl.%Z.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %empty_tuple.type.as.Z.impl.H.type: type = fn_type @empty_tuple.type.as.Z.impl.H [concrete] // CHECK:STDOUT: %empty_tuple.type.as.Z.impl.H: %empty_tuple.type.as.Z.impl.H.type = struct_value () [concrete] @@ -1171,8 +1171,6 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (@empty_tuple.type.as.Z.impl.%empty_tuple.type.as.Z.impl.H.decl), @empty_tuple.type.as.Z.impl [concrete] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness %Z.impl_witness_table [concrete = constants.%Z.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Z { @@ -1208,10 +1206,12 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.Z.impl.%.loc8_7.2 [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%empty_tuple.type.as.Z.impl.H.decl), @empty_tuple.type.as.Z.impl [concrete] +// CHECK:STDOUT: %Z.impl_witness: = impl_witness %Z.impl_witness_table [concrete = constants.%Z.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .H = %empty_tuple.type.as.Z.impl.H.decl -// CHECK:STDOUT: witness = file.%Z.impl_witness +// CHECK:STDOUT: witness = %Z.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Z.H(@Z.%Self: %Z.type) { @@ -1482,7 +1482,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %AnyParam.33d: type = class_type @AnyParam, @AnyParam(%GenericInterface.type.9e8, %GenericInterface.generic) [concrete] // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete] // CHECK:STDOUT: %Self.1b8: %Y.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Y.impl_witness: = impl_witness file.%Y.impl_witness_table [concrete] +// CHECK:STDOUT: %Y.impl_witness: = impl_witness @AnyParam.as.Y.impl.%Y.impl_witness_table [concrete] // CHECK:STDOUT: %Y.K.type: type = fn_type @Y.K [concrete] // CHECK:STDOUT: %Y.K: %Y.K.type = struct_value () [concrete] // CHECK:STDOUT: %Self.binding.as_type.6ce: type = symbolic_binding_type Self, 0, %Self.1b8 [symbolic] @@ -1555,8 +1555,6 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageHasParam.ref.loc8_52: = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam] // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [concrete = constants.%Y.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (@AnyParam.as.Y.impl.%AnyParam.as.Y.impl.K.decl), @AnyParam.as.Y.impl [concrete] -// CHECK:STDOUT: %Y.impl_witness: = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness] // CHECK:STDOUT: %L.decl: %L.type = fn_decl @L [concrete = constants.%L] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1596,10 +1594,12 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @AnyParam.as.Y.impl.%AnyParam [concrete = constants.%AnyParam.33d] // CHECK:STDOUT: %self: %AnyParam.33d = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (%AnyParam.as.Y.impl.K.decl), @AnyParam.as.Y.impl [concrete] +// CHECK:STDOUT: %Y.impl_witness: = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .K = %AnyParam.as.Y.impl.K.decl -// CHECK:STDOUT: witness = file.%Y.impl_witness +// CHECK:STDOUT: witness = %Y.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @AnyParam(imports.%PackageHasParam.import_ref.b3b: type, imports.%PackageHasParam.import_ref.b42: @AnyParam.%T (%T)) [from "has_param.carbon"] { @@ -1929,7 +1929,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %AnyParam.8e0: type = class_type @AnyParam, @AnyParam(%GenericClass.type, %GenericClass.generic) [concrete] // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete] // CHECK:STDOUT: %Self.1b8: %Y.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Y.impl_witness: = impl_witness file.%Y.impl_witness_table [concrete] +// CHECK:STDOUT: %Y.impl_witness: = impl_witness @AnyParam.as.Y.impl.%Y.impl_witness_table [concrete] // CHECK:STDOUT: %Y.K.type: type = fn_type @Y.K [concrete] // CHECK:STDOUT: %Y.K: %Y.K.type = struct_value () [concrete] // CHECK:STDOUT: %Self.binding.as_type.6ce: type = symbolic_binding_type Self, 0, %Self.1b8 [symbolic] @@ -2002,8 +2002,6 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageHasParam.ref.loc8_48: = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam] // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [concrete = constants.%Y.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (@AnyParam.as.Y.impl.%AnyParam.as.Y.impl.K.decl), @AnyParam.as.Y.impl [concrete] -// CHECK:STDOUT: %Y.impl_witness: = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness] // CHECK:STDOUT: %L.decl: %L.type = fn_decl @L [concrete = constants.%L] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2025,10 +2023,12 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @AnyParam.as.Y.impl.%AnyParam [concrete = constants.%AnyParam.8e0] // CHECK:STDOUT: %self: %AnyParam.8e0 = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (%AnyParam.as.Y.impl.K.decl), @AnyParam.as.Y.impl [concrete] +// CHECK:STDOUT: %Y.impl_witness: = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .K = %AnyParam.as.Y.impl.K.decl -// CHECK:STDOUT: witness = file.%Y.impl_witness +// CHECK:STDOUT: witness = %Y.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @GenericClass(%U.loc6_20.2: type) { @@ -2386,7 +2386,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %tuple: %tuple.type.c53 = tuple_value (%Extra1.type, %Extra2.type, %Extra3.type, %Extra4.type, %Extra5.type, %Extra6.type, %Extra7.type, %Extra8.type) [concrete] // CHECK:STDOUT: %tuple.type.5db: type = tuple_type (%Extra1.type, %Extra2.type, %Extra3.type, %Extra4.type, %Extra5.type, %Extra6.type, %Extra7.type, %Extra8.type) [concrete] // CHECK:STDOUT: %C.e62: type = class_type @C, @C(%tuple.type.5db) [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.bb3: type = pattern_type %C.e62 [concrete] // CHECK:STDOUT: %C.as.I.impl.F.type: type = fn_type @C.as.I.impl.F [concrete] // CHECK:STDOUT: %C.as.I.impl.F: %C.as.I.impl.F.type = struct_value () [concrete] @@ -2445,8 +2445,6 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple.type.5db) [concrete = constants.%C.e62] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@C.as.I.impl.%C.as.I.impl.F.decl), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra1 { @@ -2562,10 +2560,12 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.I.impl.%C [concrete = constants.%C.e62] // CHECK:STDOUT: %self: %C.e62 = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%C.as.I.impl.F.decl), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %C.as.I.impl.F.decl -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%T.loc13_9.2: type) { diff --git a/toolchain/check/testdata/impl/lookup/instance_method.carbon b/toolchain/check/testdata/impl/lookup/instance_method.carbon index c975095f85d40..c8f670ba07b9c 100644 --- a/toolchain/check/testdata/impl/lookup/instance_method.carbon +++ b/toolchain/check/testdata/impl/lookup/instance_method.carbon @@ -45,7 +45,7 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %I.F: %I.F.type = struct_value () [concrete] // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%I.F.decl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.as.I.impl.F.type: type = fn_type @C.as.I.impl.F [concrete] // CHECK:STDOUT: %C.as.I.impl.F: %C.as.I.impl.F.type = struct_value () [concrete] @@ -138,10 +138,12 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%C.as.I.impl.F.decl), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %C.as.I.impl.F.decl -// CHECK:STDOUT: witness = @C.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -149,8 +151,6 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@C.as.I.impl.%C.as.I.impl.F.decl), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // 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: diff --git a/toolchain/check/testdata/impl/lookup/lookup_interface_with_enclosing_generic_inside_rewrite_constraint.carbon b/toolchain/check/testdata/impl/lookup/lookup_interface_with_enclosing_generic_inside_rewrite_constraint.carbon index 234ae110f383c..2ac78970f80dc 100644 --- a/toolchain/check/testdata/impl/lookup/lookup_interface_with_enclosing_generic_inside_rewrite_constraint.carbon +++ b/toolchain/check/testdata/impl/lookup/lookup_interface_with_enclosing_generic_inside_rewrite_constraint.carbon @@ -141,7 +141,7 @@ fn F() { // CHECK:STDOUT: %Y.lookup_impl_witness.0e6: = lookup_impl_witness %.Self.a43, @Y, @Y(%empty_tuple.type) [symbolic_self] // CHECK:STDOUT: %impl.elem0.dcf: type = impl_witness_access %Y.lookup_impl_witness.0e6, element0 [symbolic_self] // CHECK:STDOUT: %Y_where.type.b68: type = facet_type <@Y, @Y(%empty_tuple.type) where %impl.elem0.dcf = %empty_tuple.type> [concrete] -// CHECK:STDOUT: %Y.impl_witness: = impl_witness file.%Y.impl_witness_table [concrete] +// CHECK:STDOUT: %Y.impl_witness: = impl_witness @C.as.Y.impl.%Y.impl_witness_table [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %facet_value: %Y_where.type.b68 = facet_value %C, (%Y.impl_witness) [concrete] @@ -194,9 +194,6 @@ fn F() { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc58_35.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C.as.Y.impl [concrete] -// CHECK:STDOUT: %Y.impl_witness: = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -228,8 +225,12 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.Y.impl: %C.ref as %.loc58_23 { +// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C.as.Y.impl [concrete] +// CHECK:STDOUT: %Y.impl_witness: = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Y.impl_witness +// CHECK:STDOUT: witness = %Y.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Outer(%OuterParam.loc49_13.2: type) { @@ -420,12 +421,12 @@ fn F() { // CHECK:STDOUT: %Outer.G.type.5ca: type = fn_type @Outer.G, @Outer(%OuterParam) [symbolic] // CHECK:STDOUT: %Outer.G.48d: %Outer.G.type.5ca = struct_value () [symbolic] // CHECK:STDOUT: %C.8e5: type = class_type @C, @C(%OuterParam) [symbolic] -// CHECK:STDOUT: %Y.impl_witness.6ff: = impl_witness @Outer.%Y.impl_witness_table, @C.as.Y.impl(%OuterParam) [symbolic] +// CHECK:STDOUT: %Y.impl_witness.6ff: = impl_witness @C.as.Y.impl.%Y.impl_witness_table, @C.as.Y.impl(%OuterParam) [symbolic] // CHECK:STDOUT: %require_complete.6ab: = require_complete_type %Y_where.type.28c [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %Z1.impl_witness: = impl_witness file.%Z1.impl_witness_table [concrete] -// CHECK:STDOUT: %Z2.impl_witness: = impl_witness file.%Z2.impl_witness_table [concrete] +// CHECK:STDOUT: %Z1.impl_witness: = impl_witness @empty_tuple.type.as.Z1.impl.%Z1.impl_witness_table [concrete] +// CHECK:STDOUT: %Z2.impl_witness: = impl_witness @empty_tuple.type.as.Z2.impl.%Z2.impl_witness_table [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete] @@ -455,7 +456,7 @@ fn F() { // CHECK:STDOUT: %assoc0.452: %Y.assoc_type.816 = assoc_entity element0, @Y.%T [concrete] // CHECK:STDOUT: %complete_type.43b: = complete_type_witness %Y.type.199 [concrete] // CHECK:STDOUT: %.Self.binding.as_type.49e: type = symbolic_binding_type .Self, %.Self.d68 [symbolic_self] -// CHECK:STDOUT: %Y.impl_witness.f24: = impl_witness @Outer.%Y.impl_witness_table, @C.as.Y.impl(%Z1.facet) [concrete] +// CHECK:STDOUT: %Y.impl_witness.f24: = impl_witness @C.as.Y.impl.%Y.impl_witness_table, @C.as.Y.impl(%Z1.facet) [concrete] // CHECK:STDOUT: %complete_type.7bc: = complete_type_witness %Y_where.type.424 [concrete] // CHECK:STDOUT: %facet_value.3b1: %Y_where.type.424 = facet_value %C.498, (%Y.impl_witness.f24) [concrete] // CHECK:STDOUT: %pattern_type.a59: type = pattern_type %Y_where.type.424 [concrete] @@ -498,15 +499,11 @@ fn F() { // CHECK:STDOUT: %.loc17_7.2: type = converted %.loc17_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %Z1.ref: type = name_ref Z1, file.%Z1.decl [concrete = constants.%Z1.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Z1.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.Z1.impl [concrete] -// CHECK:STDOUT: %Z1.impl_witness: = impl_witness %Z1.impl_witness_table [concrete = constants.%Z1.impl_witness] // CHECK:STDOUT: impl_decl @empty_tuple.type.as.Z2.impl [concrete] {} { // CHECK:STDOUT: %.loc18_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc18_7.2: type = converted %.loc18_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %Z2.ref: type = name_ref Z2, file.%Z2.decl [concrete = constants.%Z2.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Z2.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.Z2.impl [concrete] -// CHECK:STDOUT: %Z2.impl_witness: = impl_witness %Z2.impl_witness_table [concrete = constants.%Z2.impl_witness] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -569,25 +566,35 @@ fn F() { // CHECK:STDOUT: %Y.lookup_impl_witness: = lookup_impl_witness %.Self.2, @Y, @Y(%OuterParam) [symbolic = %Y.lookup_impl_witness (constants.%Y.lookup_impl_witness.157)] // CHECK:STDOUT: %impl.elem0.loc14_21.2: type = impl_witness_access %Y.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_21.2 (constants.%impl.elem0.b14)] // CHECK:STDOUT: %Y_where.type: type = facet_type <@Y, @Y(%OuterParam) where %impl.elem0.loc14_21.2 = constants.%empty_tuple.type> [symbolic = %Y_where.type (constants.%Y_where.type.28c)] -// CHECK:STDOUT: %Y.impl_witness: = impl_witness @Outer.%Y.impl_witness_table, @C.as.Y.impl(%OuterParam) [symbolic = %Y.impl_witness (constants.%Y.impl_witness.6ff)] +// CHECK:STDOUT: %Y.impl_witness.loc14_29.2: = impl_witness %Y.impl_witness_table, @C.as.Y.impl(%OuterParam) [symbolic = %Y.impl_witness.loc14_29.2 (constants.%Y.impl_witness.6ff)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc14_15: = require_complete_type %Y_where.type [symbolic = %require_complete.loc14_15 (constants.%require_complete.6ab)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref as %.loc14_15 { +// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C.as.Y.impl [concrete] +// CHECK:STDOUT: %Y.impl_witness.loc14_29.1: = impl_witness %Y.impl_witness_table, @C.as.Y.impl(constants.%OuterParam) [symbolic = %Y.impl_witness.loc14_29.2 (constants.%Y.impl_witness.6ff)] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = @Outer.%Y.impl_witness +// CHECK:STDOUT: witness = %Y.impl_witness.loc14_29.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_tuple.type.as.Z1.impl: %.loc17_7.2 as %Z1.ref { +// CHECK:STDOUT: %Z1.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.Z1.impl [concrete] +// CHECK:STDOUT: %Z1.impl_witness: = impl_witness %Z1.impl_witness_table [concrete = constants.%Z1.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Z1.impl_witness +// CHECK:STDOUT: witness = %Z1.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_tuple.type.as.Z2.impl: %.loc18_7.2 as %Z2.ref { +// CHECK:STDOUT: %Z2.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.Z2.impl [concrete] +// CHECK:STDOUT: %Z2.impl_witness: = impl_witness %Z2.impl_witness_table [concrete = constants.%Z2.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Z2.impl_witness +// CHECK:STDOUT: witness = %Z2.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Outer(%OuterParam.loc6_13.2: %Z1.type) { @@ -644,9 +651,6 @@ fn F() { // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc14_21.1, %.loc14_27.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C.as.Y.impl [concrete] -// CHECK:STDOUT: %Y.impl_witness: = impl_witness %Y.impl_witness_table, @C.as.Y.impl(constants.%OuterParam) [symbolic = @C.as.Y.impl.%Y.impl_witness (constants.%Y.impl_witness.6ff)] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // 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: @@ -779,7 +783,7 @@ fn F() { // CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.lookup_impl_witness.157 // CHECK:STDOUT: %impl.elem0.loc14_21.2 => constants.%impl.elem0.b14 // CHECK:STDOUT: %Y_where.type => constants.%Y_where.type.28c -// CHECK:STDOUT: %Y.impl_witness => constants.%Y.impl_witness.6ff +// CHECK:STDOUT: %Y.impl_witness.loc14_29.2 => constants.%Y.impl_witness.6ff // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(constants.%Z1.facet) { @@ -815,7 +819,7 @@ fn F() { // CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.lookup_impl_witness.6f0 // CHECK:STDOUT: %impl.elem0.loc14_21.2 => constants.%impl.elem0.44d // CHECK:STDOUT: %Y_where.type => constants.%Y_where.type.424 -// CHECK:STDOUT: %Y.impl_witness => constants.%Y.impl_witness.f24 +// CHECK:STDOUT: %Y.impl_witness.loc14_29.2 => constants.%Y.impl_witness.f24 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc14_15 => constants.%complete_type.7bc diff --git a/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon b/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon index acd78f5065035..d3c573de61be7 100644 --- a/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon +++ b/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon @@ -123,7 +123,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %impl.elem0.c10: type = impl_witness_access %Z.lookup_impl_witness.8e4, element0 [symbolic] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %Z_where.type.7b1: type = facet_type <@Z, @Z(%S) where %impl.elem0.c10 = %empty_tuple.type> [symbolic] -// CHECK:STDOUT: %Z.impl_witness.b73: = impl_witness file.%Z.impl_witness_table.loc9, @T.as.Z.impl.5b7(%T.67d, %S) [symbolic] +// CHECK:STDOUT: %Z.impl_witness.b73: = impl_witness @T.as.Z.impl.5b7.%Z.impl_witness_table, @T.as.Z.impl.5b7(%T.67d, %S) [symbolic] // CHECK:STDOUT: %require_complete.761: = require_complete_type %Z_where.type.7b1 [symbolic] // CHECK:STDOUT: %Z.type.9f9: type = facet_type <@Z, @Z(%C)> [concrete] // CHECK:STDOUT: %.Self.574: %Z.type.9f9 = symbolic_binding .Self [symbolic_self] @@ -134,7 +134,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %Z.lookup_impl_witness.b01: = lookup_impl_witness %.Self.574, @Z, @Z(%C) [symbolic_self] // CHECK:STDOUT: %impl.elem0.0c3: type = impl_witness_access %Z.lookup_impl_witness.b01, element0 [symbolic_self] // CHECK:STDOUT: %Z_where.type.447: type = facet_type <@Z, @Z(%C) where %impl.elem0.0c3 = %T.67d> [symbolic] -// CHECK:STDOUT: %Z.impl_witness.c75: = impl_witness file.%Z.impl_witness_table.loc11, @T.as.Z.impl.294(%T.67d) [symbolic] +// CHECK:STDOUT: %Z.impl_witness.c75: = impl_witness @T.as.Z.impl.294.%Z.impl_witness_table, @T.as.Z.impl.294(%T.67d) [symbolic] // CHECK:STDOUT: %require_complete.d06: = require_complete_type %Z_where.type.447 [symbolic] // CHECK:STDOUT: %T.f89: %Z.type.9f9 = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.865: type = pattern_type %Z.type.9f9 [concrete] @@ -144,7 +144,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %require_complete.d5c: = require_complete_type %T.binding.as_type [symbolic] // CHECK:STDOUT: %Z_where.type.4a4: type = facet_type <@Z, @Z(%C) where %impl.elem0.0c3 = %T.binding.as_type> [symbolic] -// CHECK:STDOUT: %Z.impl_witness.ad1: = impl_witness file.%Z.impl_witness_table.loc11, @T.as.Z.impl.294(%T.binding.as_type) [symbolic] +// CHECK:STDOUT: %Z.impl_witness.ad1: = impl_witness @T.as.Z.impl.294.%Z.impl_witness_table, @T.as.Z.impl.294(%T.binding.as_type) [symbolic] // CHECK:STDOUT: %require_complete.6b0: = require_complete_type %Z_where.type.4a4 [symbolic] // CHECK:STDOUT: %.c6f: require_specific_def_type = require_specific_def @T.as.Z.impl.294(%T.binding.as_type) [symbolic] // CHECK:STDOUT: } @@ -197,9 +197,6 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %.Self.3: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c97] // CHECK:STDOUT: %S.loc9_24.1: type = symbolic_binding S, 1 [symbolic = %S.loc9_24.2 (constants.%S)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Z.impl_witness_table.loc9 = impl_witness_table (%impl_witness_assoc_constant.loc9), @T.as.Z.impl.5b7 [concrete] -// CHECK:STDOUT: %Z.impl_witness.loc9: = impl_witness %Z.impl_witness_table.loc9, @T.as.Z.impl.5b7(constants.%T.67d, constants.%S) [symbolic = @T.as.Z.impl.5b7.%Z.impl_witness (constants.%Z.impl_witness.b73)] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc9: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: impl_decl @T.as.Z.impl.294 [concrete] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { @@ -222,9 +219,6 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c97] // CHECK:STDOUT: %T.loc11_20.1: type = symbolic_binding T, 0 [symbolic = %T.loc11_20.2 (constants.%T.67d)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Z.impl_witness_table.loc11 = impl_witness_table (%impl_witness_assoc_constant.loc11), @T.as.Z.impl.294 [concrete] -// CHECK:STDOUT: %Z.impl_witness.loc11: = impl_witness %Z.impl_witness_table.loc11, @T.as.Z.impl.294(constants.%T.67d) [symbolic = @T.as.Z.impl.294.%Z.impl_witness (constants.%Z.impl_witness.c75)] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc11: type = impl_witness_assoc_constant constants.%T.67d [symbolic = @T.as.Z.impl.294.%T.loc11_20.2 (constants.%T.67d)] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %T.patt: %pattern_type.865 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %t.patt: @F.%pattern_type (%pattern_type.56b) = value_binding_pattern t [concrete] @@ -287,28 +281,36 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %Z.lookup_impl_witness: = lookup_impl_witness %.Self.4, @Z, @Z(%S.loc9_24.2) [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness.8e4)] // CHECK:STDOUT: %impl.elem0.loc9_50.2: type = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_50.2 (constants.%impl.elem0.c10)] // CHECK:STDOUT: %Z_where.type: type = facet_type <@Z, @Z(%S.loc9_24.2) where %impl.elem0.loc9_50.2 = constants.%empty_tuple.type> [symbolic = %Z_where.type (constants.%Z_where.type.7b1)] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness file.%Z.impl_witness_table.loc9, @T.as.Z.impl.5b7(%T.loc9_14.2, %S.loc9_24.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.b73)] +// CHECK:STDOUT: %Z.impl_witness.loc9_58.2: = impl_witness %Z.impl_witness_table, @T.as.Z.impl.5b7(%T.loc9_14.2, %S.loc9_24.2) [symbolic = %Z.impl_witness.loc9_58.2 (constants.%Z.impl_witness.b73)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc9_44: = require_complete_type %Z_where.type [symbolic = %require_complete.loc9_44 (constants.%require_complete.761)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref as %.loc9_44 { +// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @T.as.Z.impl.5b7 [concrete] +// CHECK:STDOUT: %Z.impl_witness.loc9_58.1: = impl_witness %Z.impl_witness_table, @T.as.Z.impl.5b7(constants.%T.67d, constants.%S) [symbolic = %Z.impl_witness.loc9_58.2 (constants.%Z.impl_witness.b73)] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Z.impl_witness.loc9 +// CHECK:STDOUT: witness = %Z.impl_witness.loc9_58.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @T.as.Z.impl.294(%T.loc11_20.1: type) { // CHECK:STDOUT: %T.loc11_20.2: type = symbolic_binding T, 0 [symbolic = %T.loc11_20.2 (constants.%T.67d)] // CHECK:STDOUT: %Z_where.type: type = facet_type <@Z, @Z(constants.%C) where constants.%impl.elem0.0c3 = %T.loc11_20.2> [symbolic = %Z_where.type (constants.%Z_where.type.447)] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness file.%Z.impl_witness_table.loc11, @T.as.Z.impl.294(%T.loc11_20.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.c75)] +// CHECK:STDOUT: %Z.impl_witness.loc11_53.2: = impl_witness %Z.impl_witness_table, @T.as.Z.impl.294(%T.loc11_20.2) [symbolic = %Z.impl_witness.loc11_53.2 (constants.%Z.impl_witness.c75)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %Z_where.type [symbolic = %require_complete (constants.%require_complete.d06)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref.loc11_30 as %.loc11_40 { +// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @T.as.Z.impl.294 [concrete] +// CHECK:STDOUT: %Z.impl_witness.loc11_53.1: = impl_witness %Z.impl_witness_table, @T.as.Z.impl.294(constants.%T.67d) [symbolic = %Z.impl_witness.loc11_53.2 (constants.%Z.impl_witness.c75)] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%T.67d [symbolic = %T.loc11_20.2 (constants.%T.67d)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Z.impl_witness.loc11 +// CHECK:STDOUT: witness = %Z.impl_witness.loc11_53.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -328,7 +330,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T.binding.as_type [symbolic = %require_complete (constants.%require_complete.d5c)] // CHECK:STDOUT: %.loc15_11.4: require_specific_def_type = require_specific_def @T.as.Z.impl.294(%T.binding.as_type) [symbolic = %.loc15_11.4 (constants.%.c6f)] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness file.%Z.impl_witness_table.loc11, @T.as.Z.impl.294(%T.binding.as_type) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.ad1)] +// CHECK:STDOUT: %Z.impl_witness: = impl_witness @T.as.Z.impl.294.%Z.impl_witness_table, @T.as.Z.impl.294(%T.binding.as_type) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.ad1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%t.param: @F.%T.binding.as_type (%T.binding.as_type)) { // CHECK:STDOUT: !entry: @@ -379,7 +381,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %Z.lookup_impl_witness => constants.%Z.lookup_impl_witness.8e4 // CHECK:STDOUT: %impl.elem0.loc9_50.2 => constants.%impl.elem0.c10 // CHECK:STDOUT: %Z_where.type => constants.%Z_where.type.7b1 -// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.b73 +// CHECK:STDOUT: %Z.impl_witness.loc9_58.2 => constants.%Z.impl_witness.b73 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Z(constants.%C) { @@ -397,7 +399,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: specific @T.as.Z.impl.294(constants.%T.67d) { // CHECK:STDOUT: %T.loc11_20.2 => constants.%T.67d // CHECK:STDOUT: %Z_where.type => constants.%Z_where.type.447 -// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.c75 +// CHECK:STDOUT: %Z.impl_witness.loc11_53.2 => constants.%Z.impl_witness.c75 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.f89) { @@ -409,7 +411,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: specific @T.as.Z.impl.294(constants.%T.binding.as_type) { // CHECK:STDOUT: %T.loc11_20.2 => constants.%T.binding.as_type // CHECK:STDOUT: %Z_where.type => constants.%Z_where.type.4a4 -// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.ad1 +// CHECK:STDOUT: %Z.impl_witness.loc11_53.2 => constants.%Z.impl_witness.ad1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete.6b0 @@ -448,7 +450,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %impl.elem0.c10: type = impl_witness_access %Z.lookup_impl_witness.8e4, element0 [symbolic] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %Z_where.type.7b1: type = facet_type <@Z, @Z(%S) where %impl.elem0.c10 = %empty_tuple.type> [symbolic] -// CHECK:STDOUT: %Z.impl_witness.b73: = impl_witness file.%Z.impl_witness_table.loc10, @T.as.Z.impl.5b7(%T.67d, %S) [symbolic] +// CHECK:STDOUT: %Z.impl_witness.b73: = impl_witness @T.as.Z.impl.5b7.%Z.impl_witness_table, @T.as.Z.impl.5b7(%T.67d, %S) [symbolic] // CHECK:STDOUT: %require_complete.761: = require_complete_type %Z_where.type.7b1 [symbolic] // CHECK:STDOUT: %Z.type.9f9: type = facet_type <@Z, @Z(%C)> [concrete] // CHECK:STDOUT: %.Self.574: %Z.type.9f9 = symbolic_binding .Self [symbolic_self] @@ -459,7 +461,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %Z.lookup_impl_witness.b01: = lookup_impl_witness %.Self.574, @Z, @Z(%C) [symbolic_self] // CHECK:STDOUT: %impl.elem0.0c3: type = impl_witness_access %Z.lookup_impl_witness.b01, element0 [symbolic_self] // CHECK:STDOUT: %Z_where.type.447: type = facet_type <@Z, @Z(%C) where %impl.elem0.0c3 = %T.67d> [symbolic] -// CHECK:STDOUT: %Z.impl_witness.c75: = impl_witness file.%Z.impl_witness_table.loc12, @T.as.Z.impl.294(%T.67d) [symbolic] +// CHECK:STDOUT: %Z.impl_witness.c75: = impl_witness @T.as.Z.impl.294.%Z.impl_witness_table, @T.as.Z.impl.294(%T.67d) [symbolic] // CHECK:STDOUT: %require_complete.d06: = require_complete_type %Z_where.type.447 [symbolic] // CHECK:STDOUT: %T.f89: %Z.type.9f9 = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.865: type = pattern_type %Z.type.9f9 [concrete] @@ -540,9 +542,6 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %.Self.3: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c97] // CHECK:STDOUT: %S.loc10_24.1: type = symbolic_binding S, 1 [symbolic = %S.loc10_24.2 (constants.%S)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Z.impl_witness_table.loc10 = impl_witness_table (%impl_witness_assoc_constant.loc10), @T.as.Z.impl.5b7 [concrete] -// CHECK:STDOUT: %Z.impl_witness.loc10: = impl_witness %Z.impl_witness_table.loc10, @T.as.Z.impl.5b7(constants.%T.67d, constants.%S) [symbolic = @T.as.Z.impl.5b7.%Z.impl_witness (constants.%Z.impl_witness.b73)] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc10: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: impl_decl @T.as.Z.impl.294 [concrete] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { @@ -565,9 +564,6 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c97] // CHECK:STDOUT: %T.loc12_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc12_14.2 (constants.%T.67d)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Z.impl_witness_table.loc12 = impl_witness_table (%impl_witness_assoc_constant.loc12), @T.as.Z.impl.294 [concrete] -// CHECK:STDOUT: %Z.impl_witness.loc12: = impl_witness %Z.impl_witness_table.loc12, @T.as.Z.impl.294(constants.%T.67d) [symbolic = @T.as.Z.impl.294.%Z.impl_witness (constants.%Z.impl_witness.c75)] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc12: type = impl_witness_assoc_constant constants.%T.67d [symbolic = @T.as.Z.impl.294.%T.loc12_14.2 (constants.%T.67d)] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %T.patt: %pattern_type.865 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %t.patt: @F.%pattern_type.loc14 (%pattern_type.56b) = value_binding_pattern t [concrete] @@ -640,28 +636,36 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %Z.lookup_impl_witness: = lookup_impl_witness %.Self.4, @Z, @Z(%S.loc10_24.2) [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness.8e4)] // CHECK:STDOUT: %impl.elem0.loc10_50.2: type = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_50.2 (constants.%impl.elem0.c10)] // CHECK:STDOUT: %Z_where.type: type = facet_type <@Z, @Z(%S.loc10_24.2) where %impl.elem0.loc10_50.2 = constants.%empty_tuple.type> [symbolic = %Z_where.type (constants.%Z_where.type.7b1)] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness file.%Z.impl_witness_table.loc10, @T.as.Z.impl.5b7(%T.loc10_14.2, %S.loc10_24.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.b73)] +// CHECK:STDOUT: %Z.impl_witness.loc10_58.2: = impl_witness %Z.impl_witness_table, @T.as.Z.impl.5b7(%T.loc10_14.2, %S.loc10_24.2) [symbolic = %Z.impl_witness.loc10_58.2 (constants.%Z.impl_witness.b73)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc10_44: = require_complete_type %Z_where.type [symbolic = %require_complete.loc10_44 (constants.%require_complete.761)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref as %.loc10_44 { +// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @T.as.Z.impl.5b7 [concrete] +// CHECK:STDOUT: %Z.impl_witness.loc10_58.1: = impl_witness %Z.impl_witness_table, @T.as.Z.impl.5b7(constants.%T.67d, constants.%S) [symbolic = %Z.impl_witness.loc10_58.2 (constants.%Z.impl_witness.b73)] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Z.impl_witness.loc10 +// CHECK:STDOUT: witness = %Z.impl_witness.loc10_58.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @T.as.Z.impl.294(%T.loc12_14.1: type) { // CHECK:STDOUT: %T.loc12_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc12_14.2 (constants.%T.67d)] // CHECK:STDOUT: %Z_where.type: type = facet_type <@Z, @Z(constants.%C) where constants.%impl.elem0.0c3 = %T.loc12_14.2> [symbolic = %Z_where.type (constants.%Z_where.type.447)] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness file.%Z.impl_witness_table.loc12, @T.as.Z.impl.294(%T.loc12_14.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.c75)] +// CHECK:STDOUT: %Z.impl_witness.loc12_47.2: = impl_witness %Z.impl_witness_table, @T.as.Z.impl.294(%T.loc12_14.2) [symbolic = %Z.impl_witness.loc12_47.2 (constants.%Z.impl_witness.c75)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %Z_where.type [symbolic = %require_complete (constants.%require_complete.d06)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref.loc12_24 as %.loc12_34 { +// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @T.as.Z.impl.294 [concrete] +// CHECK:STDOUT: %Z.impl_witness.loc12_47.1: = impl_witness %Z.impl_witness_table, @T.as.Z.impl.294(constants.%T.67d) [symbolic = %Z.impl_witness.loc12_47.2 (constants.%Z.impl_witness.c75)] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%T.67d [symbolic = %T.loc12_14.2 (constants.%T.67d)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Z.impl_witness.loc12 +// CHECK:STDOUT: witness = %Z.impl_witness.loc12_47.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -742,7 +746,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %Z.lookup_impl_witness => constants.%Z.lookup_impl_witness.8e4 // CHECK:STDOUT: %impl.elem0.loc10_50.2 => constants.%impl.elem0.c10 // CHECK:STDOUT: %Z_where.type => constants.%Z_where.type.7b1 -// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.b73 +// CHECK:STDOUT: %Z.impl_witness.loc10_58.2 => constants.%Z.impl_witness.b73 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Z(constants.%C) { @@ -760,7 +764,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: specific @T.as.Z.impl.294(constants.%T.67d) { // CHECK:STDOUT: %T.loc12_14.2 => constants.%T.67d // CHECK:STDOUT: %Z_where.type => constants.%Z_where.type.447 -// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.c75 +// CHECK:STDOUT: %Z.impl_witness.loc12_47.2 => constants.%Z.impl_witness.c75 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.f89) { @@ -788,13 +792,13 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %impl.elem0.49e: type = impl_witness_access %Ptr.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %ptr.e8f8f9.1: type = ptr_type %U.67d [symbolic] // CHECK:STDOUT: %Ptr_where.type.571194.1: type = facet_type <@Ptr where %impl.elem0.49e = %ptr.e8f8f9.1> [symbolic] -// CHECK:STDOUT: %Ptr.impl_witness.a01d06.1: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%U.67d) [symbolic] +// CHECK:STDOUT: %Ptr.impl_witness.a01d06.1: = impl_witness @U.as.Ptr.impl.%Ptr.impl_witness_table, @U.as.Ptr.impl(%U.67d) [symbolic] // CHECK:STDOUT: %require_complete.f8161c.1: = require_complete_type %Ptr_where.type.571194.1 [symbolic] // CHECK:STDOUT: %T.67d: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T.67d [symbolic] // CHECK:STDOUT: %ptr.e8f8f9.2: type = ptr_type %T.67d [symbolic] // CHECK:STDOUT: %Ptr_where.type.571194.2: type = facet_type <@Ptr where %impl.elem0.49e = %ptr.e8f8f9.2> [symbolic] -// CHECK:STDOUT: %Ptr.impl_witness.a01d06.2: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.67d) [symbolic] +// CHECK:STDOUT: %Ptr.impl_witness.a01d06.2: = impl_witness @U.as.Ptr.impl.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.67d) [symbolic] // CHECK:STDOUT: %require_complete.f8161c.2: = require_complete_type %Ptr_where.type.571194.2 [symbolic] // CHECK:STDOUT: %.c5b: require_specific_def_type = require_specific_def @U.as.Ptr.impl(%T.67d) [symbolic] // CHECK:STDOUT: %Ptr.facet: %Ptr.type = facet_value %T.67d, (%Ptr.impl_witness.a01d06.2) [symbolic] @@ -850,9 +854,6 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c97] // CHECK:STDOUT: %U.loc7_20.1: type = symbolic_binding U, 0 [symbolic = %U.loc7_20.2 (constants.%U.67d)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Ptr.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @U.as.Ptr.impl [concrete] -// CHECK:STDOUT: %Ptr.impl_witness: = impl_witness %Ptr.impl_witness_table, @U.as.Ptr.impl(constants.%U.67d) [symbolic = @U.as.Ptr.impl.%Ptr.impl_witness (constants.%Ptr.impl_witness.a01d06.1)] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%ptr.e8f8f9.1 [symbolic = @U.as.Ptr.impl.%ptr.loc7_54.2 (constants.%ptr.e8f8f9.1)] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %t.patt: @F.%pattern_type.loc9_20 (%pattern_type.51d) = ref_binding_pattern t [concrete] @@ -899,14 +900,18 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %U.loc7_20.2: type = symbolic_binding U, 0 [symbolic = %U.loc7_20.2 (constants.%U.67d)] // CHECK:STDOUT: %ptr.loc7_54.2: type = ptr_type %U.loc7_20.2 [symbolic = %ptr.loc7_54.2 (constants.%ptr.e8f8f9.1)] // CHECK:STDOUT: %Ptr_where.type: type = facet_type <@Ptr where constants.%impl.elem0.49e = %ptr.loc7_54.2> [symbolic = %Ptr_where.type (constants.%Ptr_where.type.571194.1)] -// CHECK:STDOUT: %Ptr.impl_witness: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%U.loc7_20.2) [symbolic = %Ptr.impl_witness (constants.%Ptr.impl_witness.a01d06.1)] +// CHECK:STDOUT: %Ptr.impl_witness.loc7_56.2: = impl_witness %Ptr.impl_witness_table, @U.as.Ptr.impl(%U.loc7_20.2) [symbolic = %Ptr.impl_witness.loc7_56.2 (constants.%Ptr.impl_witness.a01d06.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %Ptr_where.type [symbolic = %require_complete (constants.%require_complete.f8161c.1)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %U.ref.loc7_30 as %.loc7_39 { +// CHECK:STDOUT: %Ptr.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @U.as.Ptr.impl [concrete] +// CHECK:STDOUT: %Ptr.impl_witness.loc7_56.1: = impl_witness %Ptr.impl_witness_table, @U.as.Ptr.impl(constants.%U.67d) [symbolic = %Ptr.impl_witness.loc7_56.2 (constants.%Ptr.impl_witness.a01d06.1)] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%ptr.e8f8f9.1 [symbolic = %ptr.loc7_54.2 (constants.%ptr.e8f8f9.1)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Ptr.impl_witness +// CHECK:STDOUT: witness = %Ptr.impl_witness.loc7_56.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -914,7 +919,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %T.loc9_6.1: type = symbolic_binding T, 0 [symbolic = %T.loc9_6.1 (constants.%T.67d)] // CHECK:STDOUT: %pattern_type.loc9_20: type = pattern_type %T.loc9_6.1 [symbolic = %pattern_type.loc9_20 (constants.%pattern_type.51d)] // CHECK:STDOUT: %.loc9_30.1: require_specific_def_type = require_specific_def @U.as.Ptr.impl(%T.loc9_6.1) [symbolic = %.loc9_30.1 (constants.%.c5b)] -// CHECK:STDOUT: %Ptr.impl_witness: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.loc9_6.1) [symbolic = %Ptr.impl_witness (constants.%Ptr.impl_witness.a01d06.2)] +// CHECK:STDOUT: %Ptr.impl_witness: = impl_witness @U.as.Ptr.impl.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.loc9_6.1) [symbolic = %Ptr.impl_witness (constants.%Ptr.impl_witness.a01d06.2)] // CHECK:STDOUT: %Ptr.facet.loc9_30.1: %Ptr.type = facet_value %T.loc9_6.1, (%Ptr.impl_witness) [symbolic = %Ptr.facet.loc9_30.1 (constants.%Ptr.facet)] // CHECK:STDOUT: %ptr: type = ptr_type %T.loc9_6.1 [symbolic = %ptr (constants.%ptr.e8f8f9.2)] // CHECK:STDOUT: %pattern_type.loc9_26: type = pattern_type %ptr [symbolic = %pattern_type.loc9_26 (constants.%pattern_type.4f4)] @@ -950,14 +955,14 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %U.loc7_20.2 => constants.%U.67d // CHECK:STDOUT: %ptr.loc7_54.2 => constants.%ptr.e8f8f9.1 // CHECK:STDOUT: %Ptr_where.type => constants.%Ptr_where.type.571194.1 -// CHECK:STDOUT: %Ptr.impl_witness => constants.%Ptr.impl_witness.a01d06.1 +// CHECK:STDOUT: %Ptr.impl_witness.loc7_56.2 => constants.%Ptr.impl_witness.a01d06.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @U.as.Ptr.impl(constants.%T.67d) { // CHECK:STDOUT: %U.loc7_20.2 => constants.%T.67d // CHECK:STDOUT: %ptr.loc7_54.2 => constants.%ptr.e8f8f9.2 // CHECK:STDOUT: %Ptr_where.type => constants.%Ptr_where.type.571194.2 -// CHECK:STDOUT: %Ptr.impl_witness => constants.%Ptr.impl_witness.a01d06.2 +// CHECK:STDOUT: %Ptr.impl_witness.loc7_56.2 => constants.%Ptr.impl_witness.a01d06.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete.f8161c.2 @@ -992,7 +997,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %impl.elem0.49e: type = impl_witness_access %Ptr.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %ptr.e8f8f9.1: type = ptr_type %U.67d [symbolic] // CHECK:STDOUT: %Ptr_where.type.571: type = facet_type <@Ptr where %impl.elem0.49e = %ptr.e8f8f9.1> [symbolic] -// CHECK:STDOUT: %Ptr.impl_witness.a01: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%U.67d) [symbolic] +// CHECK:STDOUT: %Ptr.impl_witness.a01: = impl_witness @U.as.Ptr.impl.%Ptr.impl_witness_table, @U.as.Ptr.impl(%U.67d) [symbolic] // CHECK:STDOUT: %require_complete.f81: = require_complete_type %Ptr_where.type.571 [symbolic] // CHECK:STDOUT: %T.c78: %Ptr.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.d66: type = pattern_type %Ptr.type [concrete] @@ -1000,7 +1005,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %pattern_type.c84: type = pattern_type %T.binding.as_type.564 [symbolic] // CHECK:STDOUT: %ptr.886: type = ptr_type %T.binding.as_type.564 [symbolic] // CHECK:STDOUT: %Ptr_where.type.f99: type = facet_type <@Ptr where %impl.elem0.49e = %ptr.886> [symbolic] -// CHECK:STDOUT: %Ptr.impl_witness.1b8: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.binding.as_type.564) [symbolic] +// CHECK:STDOUT: %Ptr.impl_witness.1b8: = impl_witness @U.as.Ptr.impl.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.binding.as_type.564) [symbolic] // CHECK:STDOUT: %require_complete.a27: = require_complete_type %Ptr_where.type.f99 [symbolic] // CHECK:STDOUT: %.ac3: require_specific_def_type = require_specific_def @U.as.Ptr.impl(%T.binding.as_type.564) [symbolic] // CHECK:STDOUT: %pattern_type.f9f: type = pattern_type %ptr.886 [symbolic] @@ -1055,9 +1060,6 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c97] // CHECK:STDOUT: %U.loc7_20.1: type = symbolic_binding U, 0 [symbolic = %U.loc7_20.2 (constants.%U.67d)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Ptr.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @U.as.Ptr.impl [concrete] -// CHECK:STDOUT: %Ptr.impl_witness: = impl_witness %Ptr.impl_witness_table, @U.as.Ptr.impl(constants.%U.67d) [symbolic = @U.as.Ptr.impl.%Ptr.impl_witness (constants.%Ptr.impl_witness.a01)] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%ptr.e8f8f9.1 [symbolic = @U.as.Ptr.impl.%ptr.loc7_54.2 (constants.%ptr.e8f8f9.1)] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %T.patt: %pattern_type.d66 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %t.patt: @F.%pattern_type.loc9_19 (%pattern_type.c84) = ref_binding_pattern t [concrete] @@ -1110,14 +1112,18 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %U.loc7_20.2: type = symbolic_binding U, 0 [symbolic = %U.loc7_20.2 (constants.%U.67d)] // CHECK:STDOUT: %ptr.loc7_54.2: type = ptr_type %U.loc7_20.2 [symbolic = %ptr.loc7_54.2 (constants.%ptr.e8f8f9.1)] // CHECK:STDOUT: %Ptr_where.type: type = facet_type <@Ptr where constants.%impl.elem0.49e = %ptr.loc7_54.2> [symbolic = %Ptr_where.type (constants.%Ptr_where.type.571)] -// CHECK:STDOUT: %Ptr.impl_witness: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%U.loc7_20.2) [symbolic = %Ptr.impl_witness (constants.%Ptr.impl_witness.a01)] +// CHECK:STDOUT: %Ptr.impl_witness.loc7_56.2: = impl_witness %Ptr.impl_witness_table, @U.as.Ptr.impl(%U.loc7_20.2) [symbolic = %Ptr.impl_witness.loc7_56.2 (constants.%Ptr.impl_witness.a01)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %Ptr_where.type [symbolic = %require_complete (constants.%require_complete.f81)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %U.ref.loc7_30 as %.loc7_39 { +// CHECK:STDOUT: %Ptr.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @U.as.Ptr.impl [concrete] +// CHECK:STDOUT: %Ptr.impl_witness.loc7_56.1: = impl_witness %Ptr.impl_witness_table, @U.as.Ptr.impl(constants.%U.67d) [symbolic = %Ptr.impl_witness.loc7_56.2 (constants.%Ptr.impl_witness.a01)] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%ptr.e8f8f9.1 [symbolic = %ptr.loc7_54.2 (constants.%ptr.e8f8f9.1)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Ptr.impl_witness +// CHECK:STDOUT: witness = %Ptr.impl_witness.loc7_56.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1126,7 +1132,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc9_6.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.564)] // CHECK:STDOUT: %pattern_type.loc9_19: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc9_19 (constants.%pattern_type.c84)] // CHECK:STDOUT: %.loc9_29.1: require_specific_def_type = require_specific_def @U.as.Ptr.impl(%T.binding.as_type) [symbolic = %.loc9_29.1 (constants.%.ac3)] -// CHECK:STDOUT: %Ptr.impl_witness: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.binding.as_type) [symbolic = %Ptr.impl_witness (constants.%Ptr.impl_witness.1b8)] +// CHECK:STDOUT: %Ptr.impl_witness: = impl_witness @U.as.Ptr.impl.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.binding.as_type) [symbolic = %Ptr.impl_witness (constants.%Ptr.impl_witness.1b8)] // CHECK:STDOUT: %ptr: type = ptr_type %T.binding.as_type [symbolic = %ptr (constants.%ptr.886)] // CHECK:STDOUT: %pattern_type.loc9_25: type = pattern_type %ptr [symbolic = %pattern_type.loc9_25 (constants.%pattern_type.f9f)] // CHECK:STDOUT: @@ -1161,14 +1167,14 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %U.loc7_20.2 => constants.%U.67d // CHECK:STDOUT: %ptr.loc7_54.2 => constants.%ptr.e8f8f9.1 // CHECK:STDOUT: %Ptr_where.type => constants.%Ptr_where.type.571 -// CHECK:STDOUT: %Ptr.impl_witness => constants.%Ptr.impl_witness.a01 +// CHECK:STDOUT: %Ptr.impl_witness.loc7_56.2 => constants.%Ptr.impl_witness.a01 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @U.as.Ptr.impl(constants.%T.binding.as_type.564) { // CHECK:STDOUT: %U.loc7_20.2 => constants.%T.binding.as_type.564 // CHECK:STDOUT: %ptr.loc7_54.2 => constants.%ptr.886 // CHECK:STDOUT: %Ptr_where.type => constants.%Ptr_where.type.f99 -// CHECK:STDOUT: %Ptr.impl_witness => constants.%Ptr.impl_witness.1b8 +// CHECK:STDOUT: %Ptr.impl_witness.loc7_56.2 => constants.%Ptr.impl_witness.1b8 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete.a27 @@ -1203,7 +1209,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %impl.elem0.49e: type = impl_witness_access %Ptr.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %ptr.e8f8f9.1: type = ptr_type %U.67d [symbolic] // CHECK:STDOUT: %Ptr_where.type.571: type = facet_type <@Ptr where %impl.elem0.49e = %ptr.e8f8f9.1> [symbolic] -// CHECK:STDOUT: %Ptr.impl_witness.a01: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%U.67d) [symbolic] +// CHECK:STDOUT: %Ptr.impl_witness.a01: = impl_witness @U.as.Ptr.impl.%Ptr.impl_witness_table, @U.as.Ptr.impl(%U.67d) [symbolic] // CHECK:STDOUT: %require_complete.f81: = require_complete_type %Ptr_where.type.571 [symbolic] // CHECK:STDOUT: %T.c78: %Ptr.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.d66: type = pattern_type %Ptr.type [concrete] @@ -1211,7 +1217,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %pattern_type.c84: type = pattern_type %T.binding.as_type.564 [symbolic] // CHECK:STDOUT: %ptr.886: type = ptr_type %T.binding.as_type.564 [symbolic] // CHECK:STDOUT: %Ptr_where.type.f99: type = facet_type <@Ptr where %impl.elem0.49e = %ptr.886> [symbolic] -// CHECK:STDOUT: %Ptr.impl_witness.1b8: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.binding.as_type.564) [symbolic] +// CHECK:STDOUT: %Ptr.impl_witness.1b8: = impl_witness @U.as.Ptr.impl.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.binding.as_type.564) [symbolic] // CHECK:STDOUT: %require_complete.a27: = require_complete_type %Ptr_where.type.f99 [symbolic] // CHECK:STDOUT: %.ac3: require_specific_def_type = require_specific_def @U.as.Ptr.impl(%T.binding.as_type.564) [symbolic] // CHECK:STDOUT: %pattern_type.f9f: type = pattern_type %ptr.886 [symbolic] @@ -1266,9 +1272,6 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c97] // CHECK:STDOUT: %U.loc7_20.1: type = symbolic_binding U, 0 [symbolic = %U.loc7_20.2 (constants.%U.67d)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Ptr.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @U.as.Ptr.impl [concrete] -// CHECK:STDOUT: %Ptr.impl_witness: = impl_witness %Ptr.impl_witness_table, @U.as.Ptr.impl(constants.%U.67d) [symbolic = @U.as.Ptr.impl.%Ptr.impl_witness (constants.%Ptr.impl_witness.a01)] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%ptr.e8f8f9.1 [symbolic = @U.as.Ptr.impl.%ptr.loc7_54.2 (constants.%ptr.e8f8f9.1)] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %T.patt: %pattern_type.d66 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %t.patt: @F.%pattern_type.loc9_19 (%pattern_type.c84) = ref_binding_pattern t [concrete] @@ -1320,14 +1323,18 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %U.loc7_20.2: type = symbolic_binding U, 0 [symbolic = %U.loc7_20.2 (constants.%U.67d)] // CHECK:STDOUT: %ptr.loc7_54.2: type = ptr_type %U.loc7_20.2 [symbolic = %ptr.loc7_54.2 (constants.%ptr.e8f8f9.1)] // CHECK:STDOUT: %Ptr_where.type: type = facet_type <@Ptr where constants.%impl.elem0.49e = %ptr.loc7_54.2> [symbolic = %Ptr_where.type (constants.%Ptr_where.type.571)] -// CHECK:STDOUT: %Ptr.impl_witness: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%U.loc7_20.2) [symbolic = %Ptr.impl_witness (constants.%Ptr.impl_witness.a01)] +// CHECK:STDOUT: %Ptr.impl_witness.loc7_56.2: = impl_witness %Ptr.impl_witness_table, @U.as.Ptr.impl(%U.loc7_20.2) [symbolic = %Ptr.impl_witness.loc7_56.2 (constants.%Ptr.impl_witness.a01)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %Ptr_where.type [symbolic = %require_complete (constants.%require_complete.f81)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %U.ref.loc7_30 as %.loc7_39 { +// CHECK:STDOUT: %Ptr.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @U.as.Ptr.impl [concrete] +// CHECK:STDOUT: %Ptr.impl_witness.loc7_56.1: = impl_witness %Ptr.impl_witness_table, @U.as.Ptr.impl(constants.%U.67d) [symbolic = %Ptr.impl_witness.loc7_56.2 (constants.%Ptr.impl_witness.a01)] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%ptr.e8f8f9.1 [symbolic = %ptr.loc7_54.2 (constants.%ptr.e8f8f9.1)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Ptr.impl_witness +// CHECK:STDOUT: witness = %Ptr.impl_witness.loc7_56.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1336,7 +1343,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc9_6.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.564)] // CHECK:STDOUT: %pattern_type.loc9_19: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc9_19 (constants.%pattern_type.c84)] // CHECK:STDOUT: %.loc9_29: require_specific_def_type = require_specific_def @U.as.Ptr.impl(%T.binding.as_type) [symbolic = %.loc9_29 (constants.%.ac3)] -// CHECK:STDOUT: %Ptr.impl_witness: = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.binding.as_type) [symbolic = %Ptr.impl_witness (constants.%Ptr.impl_witness.1b8)] +// CHECK:STDOUT: %Ptr.impl_witness: = impl_witness @U.as.Ptr.impl.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.binding.as_type) [symbolic = %Ptr.impl_witness (constants.%Ptr.impl_witness.1b8)] // CHECK:STDOUT: %ptr: type = ptr_type %T.binding.as_type [symbolic = %ptr (constants.%ptr.886)] // CHECK:STDOUT: %pattern_type.loc9_25: type = pattern_type %ptr [symbolic = %pattern_type.loc9_25 (constants.%pattern_type.f9f)] // CHECK:STDOUT: @@ -1371,14 +1378,14 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %U.loc7_20.2 => constants.%U.67d // CHECK:STDOUT: %ptr.loc7_54.2 => constants.%ptr.e8f8f9.1 // CHECK:STDOUT: %Ptr_where.type => constants.%Ptr_where.type.571 -// CHECK:STDOUT: %Ptr.impl_witness => constants.%Ptr.impl_witness.a01 +// CHECK:STDOUT: %Ptr.impl_witness.loc7_56.2 => constants.%Ptr.impl_witness.a01 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @U.as.Ptr.impl(constants.%T.binding.as_type.564) { // CHECK:STDOUT: %U.loc7_20.2 => constants.%T.binding.as_type.564 // CHECK:STDOUT: %ptr.loc7_54.2 => constants.%ptr.886 // CHECK:STDOUT: %Ptr_where.type => constants.%Ptr_where.type.f99 -// CHECK:STDOUT: %Ptr.impl_witness => constants.%Ptr.impl_witness.1b8 +// CHECK:STDOUT: %Ptr.impl_witness.loc7_56.2 => constants.%Ptr.impl_witness.1b8 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete.a27 diff --git a/toolchain/check/testdata/impl/lookup/specific_args.carbon b/toolchain/check/testdata/impl/lookup/specific_args.carbon index eac155c00185b..72e2f768f3127 100644 --- a/toolchain/check/testdata/impl/lookup/specific_args.carbon +++ b/toolchain/check/testdata/impl/lookup/specific_args.carbon @@ -205,7 +205,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 1, %Self.ae1 [symbolic] // CHECK:STDOUT: %pattern_type.79a: type = pattern_type %Self.binding.as_type [symbolic] // CHECK:STDOUT: %I.type.a76: type = facet_type <@I, @I(%InInterfaceArgs)> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @X.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %Self.b24: %I.type.a76 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %I.F.type.606: type = fn_type @I.F, @I(%InInterfaceArgs) [concrete] // CHECK:STDOUT: %I.F.e0c: %I.F.type.606 = struct_value () [concrete] @@ -247,8 +247,6 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %InInterfaceArgs.ref: type = name_ref InInterfaceArgs, file.%InInterfaceArgs.decl [concrete = constants.%InInterfaceArgs] // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%InInterfaceArgs)> [concrete = constants.%I.type.a76] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@X.as.I.impl.%X.as.I.impl.F.decl), @X.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.b3bc94.1: type) [from "types.carbon"] { @@ -281,10 +279,12 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %Self.ref: type = name_ref Self, @X.as.I.impl.%X.ref [concrete = constants.%X] // CHECK:STDOUT: %self: %X = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%X.as.I.impl.F.decl), @X.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %X.as.I.impl.F.decl -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @InInterfaceArgs { @@ -540,7 +540,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %pattern_type.79a: type = pattern_type %Self.binding.as_type [symbolic] // CHECK:STDOUT: %X: type = class_type @X [concrete] // CHECK:STDOUT: %I.type.ce9: type = facet_type <@I, @I(%X)> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %Self.732: %I.type.ce9 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %I.F.type.cf1: type = fn_type @I.F, @I(%X) [concrete] // CHECK:STDOUT: %I.F.28b: %I.F.type.cf1 = struct_value () [concrete] @@ -587,8 +587,6 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %X.ref: type = name_ref X, imports.%Main.X [concrete = constants.%X] // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%X)> [concrete = constants.%I.type.ce9] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@C.as.I.impl.%C.as.I.impl.F.decl), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.b3bc94.2: type) [from "types.carbon"] { @@ -621,10 +619,12 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.I.impl.%C [concrete = constants.%C.83f] // CHECK:STDOUT: %self: %C.83f = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%C.as.I.impl.F.decl), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %C.as.I.impl.F.decl -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @InClassArgs { diff --git a/toolchain/check/testdata/impl/lookup/transitive.carbon b/toolchain/check/testdata/impl/lookup/transitive.carbon index 15c0ba2dddac2..44f6b5c85e84b 100644 --- a/toolchain/check/testdata/impl/lookup/transitive.carbon +++ b/toolchain/check/testdata/impl/lookup/transitive.carbon @@ -122,7 +122,7 @@ fn Call() { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %I.F.type: type = fn_type @I.F [concrete] // CHECK:STDOUT: %I.F: %I.F.type = struct_value () [concrete] // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic] @@ -158,8 +158,6 @@ fn Call() { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@C.as.I.impl.%C.as.I.impl.F.decl), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I [from "i.carbon"] { @@ -180,10 +178,12 @@ fn Call() { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.I.impl.%C.ref [concrete = constants.%C] // CHECK:STDOUT: %self: %C = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%C.as.I.impl.F.decl), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %C.as.I.impl.F.decl -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/impl/multiple_extend.carbon b/toolchain/check/testdata/impl/multiple_extend.carbon index e6775ad86584c..ece8beca5d7bb 100644 --- a/toolchain/check/testdata/impl/multiple_extend.carbon +++ b/toolchain/check/testdata/impl/multiple_extend.carbon @@ -181,11 +181,11 @@ fn P(o: O) { // CHECK:STDOUT: %HasG.assoc_type: type = assoc_entity_type @HasG [concrete] // CHECK:STDOUT: %assoc0.949: %HasG.assoc_type = assoc_entity element0, @HasG.%HasG.G.decl [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness @C.%HasF.impl_witness_table [concrete] +// CHECK:STDOUT: %HasF.impl_witness: = impl_witness @C.as.HasF.impl.%HasF.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.HasF.impl.F.type: type = fn_type @C.as.HasF.impl.F [concrete] // CHECK:STDOUT: %C.as.HasF.impl.F: %C.as.HasF.impl.F.type = struct_value () [concrete] // CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C, (%HasF.impl_witness) [concrete] -// CHECK:STDOUT: %HasG.impl_witness: = impl_witness @C.%HasG.impl_witness_table [concrete] +// CHECK:STDOUT: %HasG.impl_witness: = impl_witness @C.as.HasG.impl.%HasG.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.HasG.impl.G.type: type = fn_type @C.as.HasG.impl.G [concrete] // CHECK:STDOUT: %C.as.HasG.impl.G: %C.as.HasG.impl.G.type = struct_value () [concrete] // CHECK:STDOUT: %HasG.facet: %HasG.type = facet_value %C, (%HasG.impl_witness) [concrete] @@ -249,18 +249,22 @@ fn P(o: O) { // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.HasF.impl: %Self.ref as %HasF.ref { // CHECK:STDOUT: %C.as.HasF.impl.F.decl: %C.as.HasF.impl.F.type = fn_decl @C.as.HasF.impl.F [concrete = constants.%C.as.HasF.impl.F] {} {} +// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%C.as.HasF.impl.F.decl), @C.as.HasF.impl [concrete] +// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table [concrete = constants.%HasF.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %C.as.HasF.impl.F.decl -// CHECK:STDOUT: witness = @C.%HasF.impl_witness +// CHECK:STDOUT: witness = %HasF.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.HasG.impl: %Self.ref as %HasG.ref { // CHECK:STDOUT: %C.as.HasG.impl.G.decl: %C.as.HasG.impl.G.type = fn_decl @C.as.HasG.impl.G [concrete = constants.%C.as.HasG.impl.G] {} {} +// CHECK:STDOUT: %HasG.impl_witness_table = impl_witness_table (%C.as.HasG.impl.G.decl), @C.as.HasG.impl [concrete] +// CHECK:STDOUT: %HasG.impl_witness: = impl_witness %HasG.impl_witness_table [concrete = constants.%HasG.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G = %C.as.HasG.impl.G.decl -// CHECK:STDOUT: witness = @C.%HasG.impl_witness +// CHECK:STDOUT: witness = %HasG.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -268,14 +272,10 @@ fn P(o: O) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@C.as.HasF.impl.%C.as.HasF.impl.F.decl), @C.as.HasF.impl [concrete] -// CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table [concrete = constants.%HasF.impl_witness] // CHECK:STDOUT: impl_decl @C.as.HasG.impl [concrete] {} { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, file.%HasG.decl [concrete = constants.%HasG.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasG.impl_witness_table = impl_witness_table (@C.as.HasG.impl.%C.as.HasG.impl.G.decl), @C.as.HasG.impl [concrete] -// CHECK:STDOUT: %HasG.impl_witness: = impl_witness %HasG.impl_witness_table [concrete = constants.%HasG.impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -352,11 +352,11 @@ fn P(o: O) { // CHECK:STDOUT: %HasA2.assoc_type: type = assoc_entity_type @HasA2 [concrete] // CHECK:STDOUT: %assoc0.2a1: %HasA2.assoc_type = assoc_entity element0, @HasA2.%HasA2.A.decl [concrete] // CHECK:STDOUT: %D: type = class_type @D [concrete] -// CHECK:STDOUT: %HasA1.impl_witness: = impl_witness @D.%HasA1.impl_witness_table [concrete] +// CHECK:STDOUT: %HasA1.impl_witness: = impl_witness @D.as.HasA1.impl.%HasA1.impl_witness_table [concrete] // CHECK:STDOUT: %D.as.HasA1.impl.A.type: type = fn_type @D.as.HasA1.impl.A [concrete] // CHECK:STDOUT: %D.as.HasA1.impl.A: %D.as.HasA1.impl.A.type = struct_value () [concrete] // CHECK:STDOUT: %HasA1.facet: %HasA1.type = facet_value %D, (%HasA1.impl_witness) [concrete] -// CHECK:STDOUT: %HasA2.impl_witness: = impl_witness @D.%HasA2.impl_witness_table [concrete] +// CHECK:STDOUT: %HasA2.impl_witness: = impl_witness @D.as.HasA2.impl.%HasA2.impl_witness_table [concrete] // CHECK:STDOUT: %D.as.HasA2.impl.A.type: type = fn_type @D.as.HasA2.impl.A [concrete] // CHECK:STDOUT: %D.as.HasA2.impl.A: %D.as.HasA2.impl.A.type = struct_value () [concrete] // CHECK:STDOUT: %HasA2.facet: %HasA2.type = facet_value %D, (%HasA2.impl_witness) [concrete] @@ -416,18 +416,22 @@ fn P(o: O) { // CHECK:STDOUT: // CHECK:STDOUT: impl @D.as.HasA1.impl: %Self.ref as %HasA1.ref { // CHECK:STDOUT: %D.as.HasA1.impl.A.decl: %D.as.HasA1.impl.A.type = fn_decl @D.as.HasA1.impl.A [concrete = constants.%D.as.HasA1.impl.A] {} {} +// CHECK:STDOUT: %HasA1.impl_witness_table = impl_witness_table (%D.as.HasA1.impl.A.decl), @D.as.HasA1.impl [concrete] +// CHECK:STDOUT: %HasA1.impl_witness: = impl_witness %HasA1.impl_witness_table [concrete = constants.%HasA1.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .A = %D.as.HasA1.impl.A.decl -// CHECK:STDOUT: witness = @D.%HasA1.impl_witness +// CHECK:STDOUT: witness = %HasA1.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @D.as.HasA2.impl: %Self.ref as %HasA2.ref { // CHECK:STDOUT: %D.as.HasA2.impl.A.decl: %D.as.HasA2.impl.A.type = fn_decl @D.as.HasA2.impl.A [concrete = constants.%D.as.HasA2.impl.A] {} {} +// CHECK:STDOUT: %HasA2.impl_witness_table = impl_witness_table (%D.as.HasA2.impl.A.decl), @D.as.HasA2.impl [concrete] +// CHECK:STDOUT: %HasA2.impl_witness: = impl_witness %HasA2.impl_witness_table [concrete = constants.%HasA2.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .A = %D.as.HasA2.impl.A.decl -// CHECK:STDOUT: witness = @D.%HasA2.impl_witness +// CHECK:STDOUT: witness = %HasA2.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { @@ -435,14 +439,10 @@ fn P(o: O) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%D [concrete = constants.%D] // CHECK:STDOUT: %HasA1.ref: type = name_ref HasA1, file.%HasA1.decl [concrete = constants.%HasA1.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasA1.impl_witness_table = impl_witness_table (@D.as.HasA1.impl.%D.as.HasA1.impl.A.decl), @D.as.HasA1.impl [concrete] -// CHECK:STDOUT: %HasA1.impl_witness: = impl_witness %HasA1.impl_witness_table [concrete = constants.%HasA1.impl_witness] // CHECK:STDOUT: impl_decl @D.as.HasA2.impl [concrete] {} { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%D [concrete = constants.%D] // CHECK:STDOUT: %HasA2.ref: type = name_ref HasA2, file.%HasA2.decl [concrete = constants.%HasA2.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasA2.impl_witness_table = impl_witness_table (@D.as.HasA2.impl.%D.as.HasA2.impl.A.decl), @D.as.HasA2.impl [concrete] -// CHECK:STDOUT: %HasA2.impl_witness: = impl_witness %HasA2.impl_witness_table [concrete = constants.%HasA2.impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -507,7 +507,7 @@ fn P(o: O) { // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %E: type = class_type @E [concrete] // CHECK:STDOUT: %E.elem: type = unbound_element_type %E, %B [concrete] -// CHECK:STDOUT: %HasI.impl_witness: = impl_witness @E.%HasI.impl_witness_table [concrete] +// CHECK:STDOUT: %HasI.impl_witness: = impl_witness @E.as.HasI.impl.%HasI.impl_witness_table [concrete] // CHECK:STDOUT: %E.as.HasI.impl.I.type: type = fn_type @E.as.HasI.impl.I [concrete] // CHECK:STDOUT: %E.as.HasI.impl.I: %E.as.HasI.impl.I.type = struct_value () [concrete] // CHECK:STDOUT: %HasI.facet: %HasI.type = facet_value %E, (%HasI.impl_witness) [concrete] @@ -555,10 +555,12 @@ fn P(o: O) { // CHECK:STDOUT: // CHECK:STDOUT: impl @E.as.HasI.impl: %Self.ref as %HasI.ref { // CHECK:STDOUT: %E.as.HasI.impl.I.decl: %E.as.HasI.impl.I.type = fn_decl @E.as.HasI.impl.I [concrete = constants.%E.as.HasI.impl.I] {} {} +// CHECK:STDOUT: %HasI.impl_witness_table = impl_witness_table (%E.as.HasI.impl.I.decl), @E.as.HasI.impl [concrete] +// CHECK:STDOUT: %HasI.impl_witness: = impl_witness %HasI.impl_witness_table [concrete = constants.%HasI.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .I = %E.as.HasI.impl.I.decl -// CHECK:STDOUT: witness = @E.%HasI.impl_witness +// CHECK:STDOUT: witness = %HasI.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { @@ -580,8 +582,6 @@ fn P(o: O) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E] // CHECK:STDOUT: %HasI.ref: type = name_ref HasI, file.%HasI.decl [concrete = constants.%HasI.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasI.impl_witness_table = impl_witness_table (@E.as.HasI.impl.%E.as.HasI.impl.I.decl), @E.as.HasI.impl [concrete] -// CHECK:STDOUT: %HasI.impl_witness: = impl_witness %HasI.impl_witness_table [concrete = constants.%HasI.impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%struct_type.base.64a [concrete = constants.%complete_type.021] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -649,7 +649,7 @@ fn P(o: O) { // CHECK:STDOUT: %assoc0: %HasK.assoc_type = assoc_entity element0, @HasK.%HasK.K.decl [concrete] // CHECK:STDOUT: %L: type = class_type @L [concrete] // CHECK:STDOUT: %L.elem: type = unbound_element_type %L, %Base [concrete] -// CHECK:STDOUT: %HasK.impl_witness: = impl_witness @L.%HasK.impl_witness_table [concrete] +// CHECK:STDOUT: %HasK.impl_witness: = impl_witness @L.as.HasK.impl.%HasK.impl_witness_table [concrete] // CHECK:STDOUT: %L.as.HasK.impl.K.type: type = fn_type @L.as.HasK.impl.K [concrete] // CHECK:STDOUT: %L.as.HasK.impl.K: %L.as.HasK.impl.K.type = struct_value () [concrete] // CHECK:STDOUT: %HasK.facet: %HasK.type = facet_value %L, (%HasK.impl_witness) [concrete] @@ -695,10 +695,12 @@ fn P(o: O) { // CHECK:STDOUT: // CHECK:STDOUT: impl @L.as.HasK.impl: %Self.ref as %HasK.ref { // CHECK:STDOUT: %L.as.HasK.impl.K.decl: %L.as.HasK.impl.K.type = fn_decl @L.as.HasK.impl.K [concrete = constants.%L.as.HasK.impl.K] {} {} +// CHECK:STDOUT: %HasK.impl_witness_table = impl_witness_table (%L.as.HasK.impl.K.decl), @L.as.HasK.impl [concrete] +// CHECK:STDOUT: %HasK.impl_witness: = impl_witness %HasK.impl_witness_table [concrete = constants.%HasK.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .K = %L.as.HasK.impl.K.decl -// CHECK:STDOUT: witness = @L.%HasK.impl_witness +// CHECK:STDOUT: witness = %HasK.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { @@ -719,8 +721,6 @@ fn P(o: O) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%L [concrete = constants.%L] // CHECK:STDOUT: %HasK.ref: type = name_ref HasK, file.%HasK.decl [concrete = constants.%HasK.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasK.impl_witness_table = impl_witness_table (@L.as.HasK.impl.%L.as.HasK.impl.K.decl), @L.as.HasK.impl [concrete] -// CHECK:STDOUT: %HasK.impl_witness: = impl_witness %HasK.impl_witness_table [concrete = constants.%HasK.impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%struct_type.base.27a [concrete = constants.%complete_type.5a1] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -784,11 +784,11 @@ fn P(o: O) { // CHECK:STDOUT: %assoc0.b53: %HasN2.assoc_type = assoc_entity element0, @HasN2.%HasN2.N.decl [concrete] // CHECK:STDOUT: %O: type = class_type @O [concrete] // CHECK:STDOUT: %O.elem: type = unbound_element_type %O, %NBase [concrete] -// CHECK:STDOUT: %HasN1.impl_witness: = impl_witness @O.%HasN1.impl_witness_table [concrete] +// CHECK:STDOUT: %HasN1.impl_witness: = impl_witness @O.as.HasN1.impl.%HasN1.impl_witness_table [concrete] // CHECK:STDOUT: %O.as.HasN1.impl.N.type: type = fn_type @O.as.HasN1.impl.N [concrete] // CHECK:STDOUT: %O.as.HasN1.impl.N: %O.as.HasN1.impl.N.type = struct_value () [concrete] // CHECK:STDOUT: %HasN1.facet: %HasN1.type = facet_value %O, (%HasN1.impl_witness) [concrete] -// CHECK:STDOUT: %HasN2.impl_witness: = impl_witness @O.%HasN2.impl_witness_table [concrete] +// CHECK:STDOUT: %HasN2.impl_witness: = impl_witness @O.as.HasN2.impl.%HasN2.impl_witness_table [concrete] // CHECK:STDOUT: %O.as.HasN2.impl.N.type: type = fn_type @O.as.HasN2.impl.N [concrete] // CHECK:STDOUT: %O.as.HasN2.impl.N: %O.as.HasN2.impl.N.type = struct_value () [concrete] // CHECK:STDOUT: %HasN2.facet: %HasN2.type = facet_value %O, (%HasN2.impl_witness) [concrete] @@ -852,18 +852,22 @@ fn P(o: O) { // CHECK:STDOUT: // CHECK:STDOUT: impl @O.as.HasN1.impl: %Self.ref as %HasN1.ref { // CHECK:STDOUT: %O.as.HasN1.impl.N.decl: %O.as.HasN1.impl.N.type = fn_decl @O.as.HasN1.impl.N [concrete = constants.%O.as.HasN1.impl.N] {} {} +// CHECK:STDOUT: %HasN1.impl_witness_table = impl_witness_table (%O.as.HasN1.impl.N.decl), @O.as.HasN1.impl [concrete] +// CHECK:STDOUT: %HasN1.impl_witness: = impl_witness %HasN1.impl_witness_table [concrete = constants.%HasN1.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .N = %O.as.HasN1.impl.N.decl -// CHECK:STDOUT: witness = @O.%HasN1.impl_witness +// CHECK:STDOUT: witness = %HasN1.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @O.as.HasN2.impl: %Self.ref as %HasN2.ref { // CHECK:STDOUT: %O.as.HasN2.impl.N.decl: %O.as.HasN2.impl.N.type = fn_decl @O.as.HasN2.impl.N [concrete = constants.%O.as.HasN2.impl.N] {} {} +// CHECK:STDOUT: %HasN2.impl_witness_table = impl_witness_table (%O.as.HasN2.impl.N.decl), @O.as.HasN2.impl [concrete] +// CHECK:STDOUT: %HasN2.impl_witness: = impl_witness %HasN2.impl_witness_table [concrete = constants.%HasN2.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .N = %O.as.HasN2.impl.N.decl -// CHECK:STDOUT: witness = @O.%HasN2.impl_witness +// CHECK:STDOUT: witness = %HasN2.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NBase { @@ -885,14 +889,10 @@ fn P(o: O) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%O [concrete = constants.%O] // CHECK:STDOUT: %HasN1.ref: type = name_ref HasN1, file.%HasN1.decl [concrete = constants.%HasN1.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasN1.impl_witness_table = impl_witness_table (@O.as.HasN1.impl.%O.as.HasN1.impl.N.decl), @O.as.HasN1.impl [concrete] -// CHECK:STDOUT: %HasN1.impl_witness: = impl_witness %HasN1.impl_witness_table [concrete = constants.%HasN1.impl_witness] // CHECK:STDOUT: impl_decl @O.as.HasN2.impl [concrete] {} { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%O [concrete = constants.%O] // CHECK:STDOUT: %HasN2.ref: type = name_ref HasN2, file.%HasN2.decl [concrete = constants.%HasN2.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %HasN2.impl_witness_table = impl_witness_table (@O.as.HasN2.impl.%O.as.HasN2.impl.N.decl), @O.as.HasN2.impl [concrete] -// CHECK:STDOUT: %HasN2.impl_witness: = impl_witness %HasN2.impl_witness_table [concrete = constants.%HasN2.impl_witness] // CHECK:STDOUT: %O.N.decl: %O.N.type = fn_decl @O.N [concrete = constants.%O.N] {} {} // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%struct_type.base.df9 [concrete = constants.%complete_type.0fc] // CHECK:STDOUT: complete_type_witness = %complete_type diff --git a/toolchain/check/testdata/impl/no_definition_in_impl_file.carbon b/toolchain/check/testdata/impl/no_definition_in_impl_file.carbon index e03fc33afb9b2..59ba9f9889efa 100644 --- a/toolchain/check/testdata/impl/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/impl/no_definition_in_impl_file.carbon @@ -111,7 +111,6 @@ impl () as D; // CHECK:STDOUT: %Self: %A.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] -// CHECK:STDOUT: %A.impl_witness: = impl_witness file.%A.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -124,8 +123,6 @@ impl () as D; // CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.A.impl [concrete] -// CHECK:STDOUT: %A.impl_witness: = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @A { @@ -217,7 +214,6 @@ impl () as D; // CHECK:STDOUT: %Self: %B.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] -// CHECK:STDOUT: %B.impl_witness: = impl_witness file.%B.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -230,8 +226,6 @@ impl () as D; // CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %B.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.B.impl [concrete] -// CHECK:STDOUT: %B.impl_witness: = impl_witness %B.impl_witness_table [concrete = constants.%B.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @B { @@ -285,7 +279,6 @@ impl () as D; // CHECK:STDOUT: %Self: %C.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] -// CHECK:STDOUT: %C.impl_witness: = impl_witness file.%C.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -298,8 +291,6 @@ impl () as D; // CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %C.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.C.impl [concrete] -// CHECK:STDOUT: %C.impl_witness: = impl_witness %C.impl_witness_table [concrete = constants.%C.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @C { @@ -367,7 +358,6 @@ impl () as D; // CHECK:STDOUT: %Self: %D.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] -// CHECK:STDOUT: %D.impl_witness: = impl_witness file.%D.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -382,8 +372,6 @@ impl () as D; // CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %D.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.D.impl [concrete] -// CHECK:STDOUT: %D.impl_witness: = impl_witness %D.impl_witness_table [concrete = constants.%D.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @D { diff --git a/toolchain/check/testdata/impl/redeclaration.carbon b/toolchain/check/testdata/impl/redeclaration.carbon index 35eaa85aec66b..9d9966d7088ad 100644 --- a/toolchain/check/testdata/impl/redeclaration.carbon +++ b/toolchain/check/testdata/impl/redeclaration.carbon @@ -31,7 +31,7 @@ impl i32 as I {} // 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: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @i32.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %X: type = class_type @X [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] @@ -59,8 +59,6 @@ impl i32 as I {} // CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %I.ref.loc17: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @i32.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: %X.decl: type = class_decl @X [concrete = constants.%X] {} {} // CHECK:STDOUT: impl_decl @i32.as.I.impl [concrete] {} { // CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] @@ -80,8 +78,11 @@ impl i32 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @i32.as.I.impl: %i32.loc17 as %I.ref.loc17 { +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @i32.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { diff --git a/toolchain/check/testdata/impl/self_in_class.carbon b/toolchain/check/testdata/impl/self_in_class.carbon index e0c9a01dd5b9d..f8bc593c81ca0 100644 --- a/toolchain/check/testdata/impl/self_in_class.carbon +++ b/toolchain/check/testdata/impl/self_in_class.carbon @@ -41,7 +41,7 @@ class A { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %A: type = class_type @A [concrete] -// CHECK:STDOUT: %DefaultConstructible.impl_witness: = impl_witness @A.%DefaultConstructible.impl_witness_table [concrete] +// CHECK:STDOUT: %DefaultConstructible.impl_witness: = impl_witness @C.as.DefaultConstructible.impl.%DefaultConstructible.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.as.DefaultConstructible.impl.Make.type: type = fn_type @C.as.DefaultConstructible.impl.Make [concrete] // CHECK:STDOUT: %C.as.DefaultConstructible.impl.Make: %C.as.DefaultConstructible.impl.Make.type = struct_value () [concrete] @@ -92,10 +92,12 @@ class A { // CHECK:STDOUT: %return.param: ref %C = out_param call_param0 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %DefaultConstructible.impl_witness_table = impl_witness_table (%C.as.DefaultConstructible.impl.Make.decl), @C.as.DefaultConstructible.impl [concrete] +// CHECK:STDOUT: %DefaultConstructible.impl_witness: = impl_witness %DefaultConstructible.impl_witness_table [concrete = constants.%DefaultConstructible.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Make = %C.as.DefaultConstructible.impl.Make.decl -// CHECK:STDOUT: witness = @A.%DefaultConstructible.impl_witness +// CHECK:STDOUT: witness = %DefaultConstructible.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -111,8 +113,6 @@ class A { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %DefaultConstructible.ref: type = name_ref DefaultConstructible, file.%DefaultConstructible.decl [concrete = constants.%DefaultConstructible.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %DefaultConstructible.impl_witness_table = impl_witness_table (@C.as.DefaultConstructible.impl.%C.as.DefaultConstructible.impl.Make.decl), @C.as.DefaultConstructible.impl [concrete] -// CHECK:STDOUT: %DefaultConstructible.impl_witness: = impl_witness %DefaultConstructible.impl_witness_table [concrete = constants.%DefaultConstructible.impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/self_in_signature.carbon b/toolchain/check/testdata/impl/self_in_signature.carbon index bc142f5db8626..f48e7fac195af 100644 --- a/toolchain/check/testdata/impl/self_in_signature.carbon +++ b/toolchain/check/testdata/impl/self_in_signature.carbon @@ -56,14 +56,14 @@ impl D as SelfNested { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %D: type = class_type @D [concrete] -// CHECK:STDOUT: %UseSelf.impl_witness.dd8: = impl_witness file.%UseSelf.impl_witness_table.loc23 [concrete] +// CHECK:STDOUT: %UseSelf.impl_witness.dd8: = impl_witness @C.as.UseSelf.impl.%UseSelf.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.as.UseSelf.impl.F.type: type = fn_type @C.as.UseSelf.impl.F [concrete] // CHECK:STDOUT: %C.as.UseSelf.impl.F: %C.as.UseSelf.impl.F.type = struct_value () [concrete] // CHECK:STDOUT: %UseSelf.facet.bd3: %UseSelf.type = facet_value %C, (%UseSelf.impl_witness.dd8) [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] -// CHECK:STDOUT: %UseSelf.impl_witness.d3e: = impl_witness file.%UseSelf.impl_witness_table.loc27 [concrete] +// CHECK:STDOUT: %UseSelf.impl_witness.d3e: = impl_witness @D.as.UseSelf.impl.%UseSelf.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.9c8: type = pattern_type %D [concrete] // CHECK:STDOUT: %D.as.UseSelf.impl.F.type: type = fn_type @D.as.UseSelf.impl.F [concrete] // CHECK:STDOUT: %D.as.UseSelf.impl.F: %D.as.UseSelf.impl.F.type = struct_value () [concrete] @@ -83,7 +83,7 @@ impl D as SelfNested { // CHECK:STDOUT: %SelfNested.F: %SelfNested.F.type = struct_value () [concrete] // CHECK:STDOUT: %SelfNested.assoc_type: type = assoc_entity_type @SelfNested [concrete] // CHECK:STDOUT: %assoc0.92f: %SelfNested.assoc_type = assoc_entity element0, @SelfNested.%SelfNested.F.decl [concrete] -// CHECK:STDOUT: %SelfNested.impl_witness.d55: = impl_witness file.%SelfNested.impl_witness_table.loc35 [concrete] +// CHECK:STDOUT: %SelfNested.impl_witness.d55: = impl_witness @C.as.SelfNested.impl.%SelfNested.impl_witness_table [concrete] // CHECK:STDOUT: %ptr.31e: type = ptr_type %C [concrete] // CHECK:STDOUT: %struct_type.x.y.710: type = struct_type {.x: %C, .y: %empty_tuple.type} [concrete] // CHECK:STDOUT: %tuple.509: %tuple.type.24b = tuple_value (%ptr.31e, %struct_type.x.y.710) [concrete] @@ -92,7 +92,7 @@ impl D as SelfNested { // CHECK:STDOUT: %C.as.SelfNested.impl.F.type: type = fn_type @C.as.SelfNested.impl.F [concrete] // CHECK:STDOUT: %C.as.SelfNested.impl.F: %C.as.SelfNested.impl.F.type = struct_value () [concrete] // CHECK:STDOUT: %SelfNested.facet.abf: %SelfNested.type = facet_value %C, (%SelfNested.impl_witness.d55) [concrete] -// CHECK:STDOUT: %SelfNested.impl_witness.a53: = impl_witness file.%SelfNested.impl_witness_table.loc39 [concrete] +// CHECK:STDOUT: %SelfNested.impl_witness.a53: = impl_witness @D.as.SelfNested.impl.%SelfNested.impl_witness_table [concrete] // CHECK:STDOUT: %ptr.805: type = ptr_type %D [concrete] // CHECK:STDOUT: %struct_type.x.y.3e1: type = struct_type {.x: %D, .y: %empty_tuple.type} [concrete] // CHECK:STDOUT: %tuple.21a: %tuple.type.24b = tuple_value (%ptr.805, %struct_type.x.y.3e1) [concrete] @@ -117,27 +117,19 @@ impl D as SelfNested { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %UseSelf.ref: type = name_ref UseSelf, file.%UseSelf.decl [concrete = constants.%UseSelf.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %UseSelf.impl_witness_table.loc23 = impl_witness_table (@C.as.UseSelf.impl.%C.as.UseSelf.impl.F.decl), @C.as.UseSelf.impl [concrete] -// CHECK:STDOUT: %UseSelf.impl_witness.loc23: = impl_witness %UseSelf.impl_witness_table.loc23 [concrete = constants.%UseSelf.impl_witness.dd8] // CHECK:STDOUT: impl_decl @D.as.UseSelf.impl [concrete] {} { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %UseSelf.ref: type = name_ref UseSelf, file.%UseSelf.decl [concrete = constants.%UseSelf.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %UseSelf.impl_witness_table.loc27 = impl_witness_table (@D.as.UseSelf.impl.%D.as.UseSelf.impl.F.decl), @D.as.UseSelf.impl [concrete] -// CHECK:STDOUT: %UseSelf.impl_witness.loc27: = impl_witness %UseSelf.impl_witness_table.loc27 [concrete = constants.%UseSelf.impl_witness.d3e] // CHECK:STDOUT: %SelfNested.decl: type = interface_decl @SelfNested [concrete = constants.%SelfNested.type] {} {} // CHECK:STDOUT: impl_decl @C.as.SelfNested.impl [concrete] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [concrete = constants.%SelfNested.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %SelfNested.impl_witness_table.loc35 = impl_witness_table (@C.as.SelfNested.impl.%C.as.SelfNested.impl.F.decl), @C.as.SelfNested.impl [concrete] -// CHECK:STDOUT: %SelfNested.impl_witness.loc35: = impl_witness %SelfNested.impl_witness_table.loc35 [concrete = constants.%SelfNested.impl_witness.d55] // CHECK:STDOUT: impl_decl @D.as.SelfNested.impl [concrete] {} { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [concrete = constants.%SelfNested.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %SelfNested.impl_witness_table.loc39 = impl_witness_table (@D.as.SelfNested.impl.%D.as.SelfNested.impl.F.decl), @D.as.SelfNested.impl [concrete] -// CHECK:STDOUT: %SelfNested.impl_witness.loc39: = impl_witness %SelfNested.impl_witness_table.loc39 [concrete = constants.%SelfNested.impl_witness.a53] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @UseSelf { @@ -232,11 +224,13 @@ impl D as SelfNested { // CHECK:STDOUT: %return.param: ref %C = out_param call_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %UseSelf.impl_witness_table = impl_witness_table (%C.as.UseSelf.impl.F.decl), @C.as.UseSelf.impl [concrete] +// CHECK:STDOUT: %UseSelf.impl_witness: = impl_witness %UseSelf.impl_witness_table [concrete = constants.%UseSelf.impl_witness.dd8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = // CHECK:STDOUT: .F = %C.as.UseSelf.impl.F.decl -// CHECK:STDOUT: witness = file.%UseSelf.impl_witness.loc23 +// CHECK:STDOUT: witness = %UseSelf.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @D.as.UseSelf.impl: %D.ref as %UseSelf.ref { @@ -258,10 +252,12 @@ impl D as SelfNested { // CHECK:STDOUT: %return.param: ref %D = out_param call_param2 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %UseSelf.impl_witness_table = impl_witness_table (%D.as.UseSelf.impl.F.decl), @D.as.UseSelf.impl [concrete] +// CHECK:STDOUT: %UseSelf.impl_witness: = impl_witness %UseSelf.impl_witness_table [concrete = constants.%UseSelf.impl_witness.d3e] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %D.as.UseSelf.impl.F.decl -// CHECK:STDOUT: witness = file.%UseSelf.impl_witness.loc27 +// CHECK:STDOUT: witness = %UseSelf.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.SelfNested.impl: %C.ref as %SelfNested.ref { @@ -282,11 +278,13 @@ impl D as SelfNested { // CHECK:STDOUT: } // CHECK:STDOUT: %x: %tuple.type.2f1 = value_binding x, %x.param // CHECK:STDOUT: } +// CHECK:STDOUT: %SelfNested.impl_witness_table = impl_witness_table (%C.as.SelfNested.impl.F.decl), @C.as.SelfNested.impl [concrete] +// CHECK:STDOUT: %SelfNested.impl_witness: = impl_witness %SelfNested.impl_witness_table [concrete = constants.%SelfNested.impl_witness.d55] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = // CHECK:STDOUT: .F = %C.as.SelfNested.impl.F.decl -// CHECK:STDOUT: witness = file.%SelfNested.impl_witness.loc35 +// CHECK:STDOUT: witness = %SelfNested.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @D.as.SelfNested.impl: %D.ref as %SelfNested.ref { @@ -307,10 +305,12 @@ impl D as SelfNested { // CHECK:STDOUT: } // CHECK:STDOUT: %x: %tuple.type.e0d = value_binding x, %x.param // CHECK:STDOUT: } +// CHECK:STDOUT: %SelfNested.impl_witness_table = impl_witness_table (%D.as.SelfNested.impl.F.decl), @D.as.SelfNested.impl [concrete] +// CHECK:STDOUT: %SelfNested.impl_witness: = impl_witness %SelfNested.impl_witness_table [concrete = constants.%SelfNested.impl_witness.a53] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %D.as.SelfNested.impl.F.decl -// CHECK:STDOUT: witness = file.%SelfNested.impl_witness.loc39 +// CHECK:STDOUT: witness = %SelfNested.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/impl/todo_impl_with_unrelated_fn.carbon b/toolchain/check/testdata/impl/todo_impl_with_unrelated_fn.carbon index 8c0cd051d5710..1e10c19ea003f 100644 --- a/toolchain/check/testdata/impl/todo_impl_with_unrelated_fn.carbon +++ b/toolchain/check/testdata/impl/todo_impl_with_unrelated_fn.carbon @@ -35,7 +35,7 @@ class X { // CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A [concrete] // CHECK:STDOUT: %assoc0: %A.assoc_type = assoc_entity element0, @A.%A.B.decl [concrete] // CHECK:STDOUT: %X: type = class_type @X [concrete] -// CHECK:STDOUT: %A.impl_witness: = impl_witness @X.%A.impl_witness_table [concrete] +// CHECK:STDOUT: %A.impl_witness: = impl_witness @X.as.A.impl.%A.impl_witness_table [concrete] // CHECK:STDOUT: %X.as.A.impl.B.type: type = fn_type @X.as.A.impl.B [concrete] // CHECK:STDOUT: %X.as.A.impl.B: %X.as.A.impl.B.type = struct_value () [concrete] // CHECK:STDOUT: %X.as.A.impl.F.type: type = fn_type @X.as.A.impl.F [concrete] @@ -70,11 +70,13 @@ class X { // CHECK:STDOUT: impl @X.as.A.impl: %Self.ref as %A.ref { // CHECK:STDOUT: %X.as.A.impl.B.decl: %X.as.A.impl.B.type = fn_decl @X.as.A.impl.B [concrete = constants.%X.as.A.impl.B] {} {} // CHECK:STDOUT: %X.as.A.impl.F.decl: %X.as.A.impl.F.type = fn_decl @X.as.A.impl.F [concrete = constants.%X.as.A.impl.F] {} {} +// CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (%X.as.A.impl.B.decl), @X.as.A.impl [concrete] +// CHECK:STDOUT: %A.impl_witness: = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .B = %X.as.A.impl.B.decl // CHECK:STDOUT: .F = %X.as.A.impl.F.decl -// CHECK:STDOUT: witness = @X.%A.impl_witness +// CHECK:STDOUT: witness = %A.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { @@ -82,8 +84,6 @@ class X { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%X [concrete = constants.%X] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (@X.as.A.impl.%X.as.A.impl.B.decl), @X.as.A.impl [concrete] -// CHECK:STDOUT: %A.impl_witness: = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/use_assoc_entity.carbon b/toolchain/check/testdata/impl/use_assoc_entity.carbon index d82667f4fc7bf..1587880a84ad2 100644 --- a/toolchain/check/testdata/impl/use_assoc_entity.carbon +++ b/toolchain/check/testdata/impl/use_assoc_entity.carbon @@ -373,7 +373,7 @@ fn F() { // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %J_where.type.3cb: type = facet_type <@J where %impl.elem0.68a = %i32> [concrete] -// CHECK:STDOUT: %J.impl_witness.643: = impl_witness file.%J.impl_witness_table.loc8 [concrete] +// CHECK:STDOUT: %J.impl_witness.643: = impl_witness @empty_tuple.type.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %empty_tuple.type.as.J.impl.F.type: type = fn_type @empty_tuple.type.as.J.impl.F [concrete] @@ -414,7 +414,7 @@ fn F() { // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %J_where.type.d63: type = facet_type <@J where %impl.elem0.68a = %C> [concrete] -// CHECK:STDOUT: %J.impl_witness.101: = impl_witness file.%J.impl_witness_table.loc21 [concrete] +// CHECK:STDOUT: %J.impl_witness.101: = impl_witness @C.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.as.J.impl.F.type: type = fn_type @C.as.J.impl.F [concrete] // CHECK:STDOUT: %C.as.J.impl.F: %C.as.J.impl.F.type = struct_value () [concrete] @@ -466,9 +466,6 @@ fn F() { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table.loc8 = impl_witness_table (%impl_witness_assoc_constant.loc8, @empty_tuple.type.as.J.impl.%empty_tuple.type.as.J.impl.F.decl), @empty_tuple.type.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness.loc8: = impl_witness %J.impl_witness_table.loc8 [concrete = constants.%J.impl_witness.643] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc8: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %CallMethod.decl: %CallMethod.type = fn_decl @CallMethod [concrete = constants.%CallMethod] { // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = value_binding_pattern x [concrete] // CHECK:STDOUT: %x.param_patt: %pattern_type.cb1 = value_param_pattern %x.patt, call_param0 [concrete] @@ -502,9 +499,6 @@ fn F() { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %C.ref.loc21_24 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table.loc21 = impl_witness_table (%impl_witness_assoc_constant.loc21, @C.as.J.impl.%C.as.J.impl.F.decl), @C.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness.loc21: = impl_witness %J.impl_witness_table.loc21 [concrete = constants.%J.impl_witness.101] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc21: type = impl_witness_assoc_constant constants.%C [concrete = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @J { @@ -576,10 +570,13 @@ fn F() { // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.J.impl.F.decl), @empty_tuple.type.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.643] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %empty_tuple.type.as.J.impl.F.decl -// CHECK:STDOUT: witness = file.%J.impl_witness.loc8 +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.J.impl: %C.ref.loc21_6 as %.loc21_13 { @@ -601,11 +598,14 @@ fn F() { // CHECK:STDOUT: %return.param: ref %C = out_param call_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %C.as.J.impl.F.decl), @C.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.101] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C [concrete = constants.%C] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = // CHECK:STDOUT: .F = %C.as.J.impl.F.decl -// CHECK:STDOUT: witness = file.%J.impl_witness.loc21 +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -728,7 +728,7 @@ fn F() { // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.68a = %i32> [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness file.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness @D.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %D.as.J.impl.F.type: type = fn_type @D.as.J.impl.F [concrete] // CHECK:STDOUT: %D.as.J.impl.F: %D.as.J.impl.F.type = struct_value () [concrete] @@ -809,9 +809,6 @@ fn F() { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @D.as.J.impl.%D.as.J.impl.F.decl), @D.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %CallFunction.decl: %CallFunction.type = fn_decl @CallFunction [concrete = constants.%CallFunction] { // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete] @@ -878,10 +875,13 @@ fn F() { // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %D.as.J.impl.F.decl), @D.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %D.as.J.impl.F.decl -// CHECK:STDOUT: witness = file.%J.impl_witness +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { @@ -979,7 +979,7 @@ fn F() { // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.68a = %i32> [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness @E.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness @E.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %E.as.J.impl.F.type: type = fn_type @E.as.J.impl.F [concrete] // CHECK:STDOUT: %E.as.J.impl.F: %E.as.J.impl.F.type = struct_value () [concrete] @@ -1256,11 +1256,14 @@ fn F() { // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %E.as.J.impl.F.decl, %E.as.J.impl.G.decl), @E.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %E.as.J.impl.F.decl // CHECK:STDOUT: .G = %E.as.J.impl.G.decl -// CHECK:STDOUT: witness = @E.%J.impl_witness +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @E { @@ -1280,9 +1283,6 @@ fn F() { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @E.as.J.impl.%E.as.J.impl.F.decl, @E.as.J.impl.%E.as.J.impl.G.decl), @E.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32] // 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: @@ -2364,7 +2364,7 @@ fn F() { // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.68a = %i32> [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness @E.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness @E.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] // CHECK:STDOUT: %E.as.J.impl.F.type.f88ba0.1: type = fn_type @E.as.J.impl.F.loc27_21.1 [concrete] @@ -2466,11 +2466,14 @@ fn F() { // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %E.as.J.impl.F.decl.loc27_21.2), @E.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .U = // CHECK:STDOUT: .F = %E.as.J.impl.F.decl.loc27_21.1 -// CHECK:STDOUT: witness = @E.%J.impl_witness +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @E { @@ -2490,9 +2493,6 @@ fn F() { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @E.as.J.impl.%E.as.J.impl.F.decl.loc27_21.2), @E.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32] // 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: @@ -2555,7 +2555,7 @@ fn F() { // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete] // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%J.F.decl [concrete] // CHECK:STDOUT: %E: type = class_type @E [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness @E.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness @E.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %E.as.J.impl.F.type: type = fn_type @E.as.J.impl.F [concrete] // CHECK:STDOUT: %E.as.J.impl.F: %E.as.J.impl.F.type = struct_value () [concrete] // CHECK:STDOUT: %J.facet: %J.type = facet_value %E, (%J.impl_witness) [concrete] @@ -2598,10 +2598,12 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: impl @E.as.J.impl: %Self.ref as %J.ref { // CHECK:STDOUT: %E.as.J.impl.F.decl: %E.as.J.impl.F.type = fn_decl @E.as.J.impl.F [concrete = constants.%E.as.J.impl.F] {} {} +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%E.as.J.impl.F.decl), @E.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %E.as.J.impl.F.decl -// CHECK:STDOUT: witness = @E.%J.impl_witness +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @E { @@ -2609,8 +2611,6 @@ fn F() { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (@E.as.J.impl.%E.as.J.impl.F.decl), @E.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] // CHECK:STDOUT: %E.G.decl: %E.G.type = fn_decl @E.G [concrete = constants.%E.G] {} {} // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type @@ -2661,7 +2661,7 @@ fn F() { // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%J.F.decl [concrete] // CHECK:STDOUT: %require_complete: = require_complete_type %Self.binding.as_type [symbolic] // CHECK:STDOUT: %E: type = class_type @E [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness @E.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness @E.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.99f: type = pattern_type %E [concrete] // CHECK:STDOUT: %E.as.J.impl.F.type: type = fn_type @E.as.J.impl.F [concrete] // CHECK:STDOUT: %E.as.J.impl.F: %E.as.J.impl.F.type = struct_value () [concrete] @@ -2724,10 +2724,12 @@ fn F() { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E] // CHECK:STDOUT: %self: %E = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%E.as.J.impl.F.decl), @E.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %E.as.J.impl.F.decl -// CHECK:STDOUT: witness = @E.%J.impl_witness +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @E { @@ -2735,8 +2737,6 @@ fn F() { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (@E.as.J.impl.%E.as.J.impl.F.decl), @E.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] // CHECK:STDOUT: %E.G.decl: %E.G.type = fn_decl @E.G [concrete = constants.%E.G] { // CHECK:STDOUT: %self.patt: %pattern_type.99f = value_binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: %pattern_type.99f = value_param_pattern %self.patt, call_param0 [concrete] @@ -2812,7 +2812,7 @@ fn F() { // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0 = %empty_tuple.type> [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness @E.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness @E.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] // CHECK:STDOUT: %E.G.type: type = fn_type @E.G [concrete] @@ -2860,8 +2860,12 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @E.as.J.impl: %Self.ref as %.loc8_20 { +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @E.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = @E.%J.impl_witness +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @E { @@ -2881,9 +2885,6 @@ fn F() { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc8_32.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @E.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %E.G.decl: %E.G.type = fn_decl @E.G [concrete = constants.%E.G] { // CHECK:STDOUT: %return.patt: = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: = out_param_pattern %return.patt, call_param0 [concrete] @@ -2935,7 +2936,7 @@ fn F() { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %J2_where.type.15e: type = facet_type <@J2 where %impl.elem0 = %empty_struct_type> [concrete] -// CHECK:STDOUT: %J2.impl_witness.ff7: = impl_witness file.%J2.impl_witness_table.loc22 [concrete] +// CHECK:STDOUT: %J2.impl_witness.ff7: = impl_witness @empty_tuple.type.as.J2.impl.%J2.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.type.c30be6.1: type = fn_type @empty_tuple.type.as.J2.impl.F.loc23_33.1 [concrete] @@ -2946,7 +2947,7 @@ fn F() { // CHECK:STDOUT: %C2: type = class_type @C2 [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %J2_where.type.c51: type = facet_type <@J2 where %impl.elem0 = %C2> [concrete] -// CHECK:STDOUT: %J2.impl_witness.642: = impl_witness file.%J2.impl_witness_table.loc31 [concrete] +// CHECK:STDOUT: %J2.impl_witness.642: = impl_witness @C2.as.J2.impl.%J2.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.8df: type = pattern_type %C2 [concrete] // CHECK:STDOUT: %C2.as.J2.impl.F.type.faa6c6.1: type = fn_type @C2.as.J2.impl.F.loc32_33.1 [concrete] // CHECK:STDOUT: %C2.as.J2.impl.F.ffaba1.1: %C2.as.J2.impl.F.type.faa6c6.1 = struct_value () [concrete] @@ -2988,9 +2989,6 @@ fn F() { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc22_28.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %J2.impl_witness_table.loc22 = impl_witness_table (%impl_witness_assoc_constant.loc22, @empty_tuple.type.as.J2.impl.%empty_tuple.type.as.J2.impl.F.decl.loc23_33.2), @empty_tuple.type.as.J2.impl [concrete] -// CHECK:STDOUT: %J2.impl_witness.loc22: = impl_witness %J2.impl_witness_table.loc22 [concrete = constants.%J2.impl_witness.ff7] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc22: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %C2.decl: type = class_decl @C2 [concrete = constants.%C2] {} {} // CHECK:STDOUT: impl_decl @C2.as.J2.impl [concrete] {} { // CHECK:STDOUT: %C2.ref.loc31_6: type = name_ref C2, file.%C2.decl [concrete = constants.%C2] @@ -3007,9 +3005,6 @@ fn F() { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %C2.ref.loc31_27 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %J2.impl_witness_table.loc31 = impl_witness_table (%impl_witness_assoc_constant.loc31, @C2.as.J2.impl.%C2.as.J2.impl.F.decl.loc32_33.2), @C2.as.J2.impl [concrete] -// CHECK:STDOUT: %J2.impl_witness.loc31: = impl_witness %J2.impl_witness_table.loc31 [concrete = constants.%J2.impl_witness.642] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc31: type = impl_witness_assoc_constant constants.%C2 [concrete = constants.%C2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @J2 { @@ -3091,10 +3086,13 @@ fn F() { // CHECK:STDOUT: %return.param: ref = out_param call_param2 // CHECK:STDOUT: %return: ref = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %J2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.J2.impl.F.decl.loc23_33.2), @empty_tuple.type.as.J2.impl [concrete] +// CHECK:STDOUT: %J2.impl_witness: = impl_witness %J2.impl_witness_table [concrete = constants.%J2.impl_witness.ff7] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %empty_tuple.type.as.J2.impl.F.decl.loc23_33.1 -// CHECK:STDOUT: witness = file.%J2.impl_witness.loc22 +// CHECK:STDOUT: witness = %J2.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C2.as.J2.impl: %C2.ref.loc31_6 as %.loc31_15 { @@ -3130,11 +3128,14 @@ fn F() { // CHECK:STDOUT: %return.param: ref = out_param call_param2 // CHECK:STDOUT: %return: ref = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %J2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %C2.as.J2.impl.F.decl.loc32_33.2), @C2.as.J2.impl [concrete] +// CHECK:STDOUT: %J2.impl_witness: = impl_witness %J2.impl_witness_table [concrete = constants.%J2.impl_witness.642] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C2 [concrete = constants.%C2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C2 = // CHECK:STDOUT: .F = %C2.as.J2.impl.F.decl.loc32_33.1 -// CHECK:STDOUT: witness = file.%J2.impl_witness.loc31 +// CHECK:STDOUT: witness = %J2.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C2 { @@ -3242,7 +3243,7 @@ fn F() { // CHECK:STDOUT: %impl.elem0.0e3: type = impl_witness_access %K.lookup_impl_witness.70a, element0 [symbolic_self] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_tuple.type} [concrete] // CHECK:STDOUT: %K_where.type: type = facet_type <@K where %impl.elem0.0e3 = %struct_type.a> [concrete] -// CHECK:STDOUT: %K.impl_witness: = impl_witness file.%K.impl_witness_table [concrete] +// CHECK:STDOUT: %K.impl_witness: = impl_witness @empty_tuple.type.as.K.impl.%K.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete] // CHECK:STDOUT: %pattern_type.414: type = pattern_type %struct_type.x [concrete] @@ -3295,9 +3296,6 @@ fn F() { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %struct_type.a // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %K.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @empty_tuple.type.as.K.impl.%empty_tuple.type.as.K.impl.F.decl.loc26_45.2), @empty_tuple.type.as.K.impl [concrete] -// CHECK:STDOUT: %K.impl_witness: = impl_witness %K.impl_witness_table [concrete = constants.%K.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%struct_type.a [concrete = constants.%struct_type.a] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @K { @@ -3387,10 +3385,13 @@ fn F() { // CHECK:STDOUT: %return.param: ref %struct_type.a = out_param call_param2 // CHECK:STDOUT: %return: ref %struct_type.a = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %K.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.K.impl.F.decl.loc26_45.2), @empty_tuple.type.as.K.impl [concrete] +// CHECK:STDOUT: %K.impl_witness: = impl_witness %K.impl_witness_table [concrete = constants.%K.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%struct_type.a [concrete = constants.%struct_type.a] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %empty_tuple.type.as.K.impl.F.decl.loc26_45.1 -// CHECK:STDOUT: witness = file.%K.impl_witness +// CHECK:STDOUT: witness = %K.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @K.F(@K.%Self: %K.type) { @@ -3477,7 +3478,7 @@ fn F() { // CHECK:STDOUT: %impl.elem0: %struct_type.b.347 = impl_witness_access %M.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %struct: %struct_type.b.347 = struct_value (%empty_struct) [concrete] // CHECK:STDOUT: %M_where.type: type = facet_type <@M where %impl.elem0 = %struct> [concrete] -// CHECK:STDOUT: %M.impl_witness: = impl_witness file.%M.impl_witness_table [concrete] +// CHECK:STDOUT: %M.impl_witness: = impl_witness @empty_tuple.type.as.M.impl.%M.impl_witness_table [concrete] // CHECK:STDOUT: %empty_tuple.type.as.M.impl.G.type: type = fn_type @empty_tuple.type.as.M.impl.G [concrete] // CHECK:STDOUT: %empty_tuple.type.as.M.impl.G: %empty_tuple.type.as.M.impl.G.type = struct_value () [concrete] // CHECK:STDOUT: %M.facet: %M.type = facet_value %empty_tuple.type, (%M.impl_witness) [concrete] @@ -3518,9 +3519,6 @@ fn F() { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc8_33.3 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %M.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @empty_tuple.type.as.M.impl.%empty_tuple.type.as.M.impl.G.decl), @empty_tuple.type.as.M.impl [concrete] -// CHECK:STDOUT: %M.impl_witness: = impl_witness %M.impl_witness_table [concrete = constants.%M.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.b.347 = impl_witness_assoc_constant constants.%struct [concrete = constants.%struct] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @M { @@ -3562,11 +3560,14 @@ fn F() { // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param0 // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %M.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.M.impl.G.decl), @empty_tuple.type.as.M.impl [concrete] +// CHECK:STDOUT: %M.impl_witness: = impl_witness %M.impl_witness_table [concrete = constants.%M.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.b.347 = impl_witness_assoc_constant constants.%struct [concrete = constants.%struct] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G = %empty_tuple.type.as.M.impl.G.decl // CHECK:STDOUT: .M = -// CHECK:STDOUT: witness = file.%M.impl_witness +// CHECK:STDOUT: witness = %M.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @M.G(@M.%Self: %M.type) { @@ -3631,7 +3632,7 @@ fn F() { // CHECK:STDOUT: %struct_type.b.161: type = struct_type {.b: %empty_tuple.type} [concrete] // CHECK:STDOUT: %struct.0f3: %struct_type.b.86f = struct_value (%empty_struct_type) [concrete] // CHECK:STDOUT: %M_where.type.6f2: type = facet_type <@M where %impl.elem0.302 = %struct.0f3> [concrete] -// CHECK:STDOUT: %M.impl_witness.1f8: = impl_witness file.%M.impl_witness_table.loc10 [concrete] +// CHECK:STDOUT: %M.impl_witness.1f8: = impl_witness @C.as.M.impl.d3b.%M.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.M.impl.G.type.e94: type = fn_type @C.as.M.impl.G.loc11 [concrete] // CHECK:STDOUT: %C.as.M.impl.G.a65: %C.as.M.impl.G.type.e94 = struct_value () [concrete] // CHECK:STDOUT: %M.facet.caf: %M.type = facet_value %C.850, (%M.impl_witness.1f8) [concrete] @@ -3648,7 +3649,7 @@ fn F() { // CHECK:STDOUT: %struct.63c: %struct_type.b.161 = struct_value (%empty_tuple) [concrete] // CHECK:STDOUT: %struct.c94: %struct_type.b.86f = struct_value (%empty_tuple.type) [concrete] // CHECK:STDOUT: %M_where.type.4b6: type = facet_type <@M where %impl.elem0.302 = %struct.c94> [concrete] -// CHECK:STDOUT: %M.impl_witness.c31: = impl_witness file.%M.impl_witness_table.loc16 [concrete] +// CHECK:STDOUT: %M.impl_witness.c31: = impl_witness @C.as.M.impl.4b1.%M.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.M.impl.G.type.c24: type = fn_type @C.as.M.impl.G.loc17 [concrete] // CHECK:STDOUT: %C.as.M.impl.G.e52: %C.as.M.impl.G.type.c24 = struct_value () [concrete] // CHECK:STDOUT: %M.facet.414: %M.type = facet_value %C.e8f, (%M.impl_witness.c31) [concrete] @@ -3702,9 +3703,6 @@ fn F() { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_36.3 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %M.impl_witness_table.loc10 = impl_witness_table (%impl_witness_assoc_constant.loc10, @C.as.M.impl.d3b.%C.as.M.impl.G.decl), @C.as.M.impl.d3b [concrete] -// CHECK:STDOUT: %M.impl_witness.loc10: = impl_witness %M.impl_witness_table.loc10 [concrete = constants.%M.impl_witness.1f8] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc10: %struct_type.b.86f = impl_witness_assoc_constant constants.%struct.0f3 [concrete = constants.%struct.0f3] // CHECK:STDOUT: impl_decl @C.as.M.impl.4b1 [concrete] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %.loc16_9: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] @@ -3727,9 +3725,6 @@ fn F() { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc16_36.3 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %M.impl_witness_table.loc16 = impl_witness_table (%impl_witness_assoc_constant.loc16, @C.as.M.impl.4b1.%C.as.M.impl.G.decl), @C.as.M.impl.4b1 [concrete] -// CHECK:STDOUT: %M.impl_witness.loc16: = impl_witness %M.impl_witness_table.loc16 [concrete = constants.%M.impl_witness.c31] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc16: %struct_type.b.86f = impl_witness_assoc_constant constants.%struct.c94 [concrete = constants.%struct.c94] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @M { @@ -3767,11 +3762,14 @@ fn F() { // CHECK:STDOUT: %return.param: ref type = out_param call_param0 // CHECK:STDOUT: %return: ref type = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %M.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %C.as.M.impl.G.decl), @C.as.M.impl.d3b [concrete] +// CHECK:STDOUT: %M.impl_witness: = impl_witness %M.impl_witness_table [concrete = constants.%M.impl_witness.1f8] +// CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.b.86f = impl_witness_assoc_constant constants.%struct.0f3 [concrete = constants.%struct.0f3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G = %C.as.M.impl.G.decl // CHECK:STDOUT: .M = -// CHECK:STDOUT: witness = file.%M.impl_witness.loc10 +// CHECK:STDOUT: witness = %M.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.M.impl.4b1: %C as %.loc16_17 { @@ -3782,11 +3780,14 @@ fn F() { // CHECK:STDOUT: %return.param: ref type = out_param call_param0 // CHECK:STDOUT: %return: ref type = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %M.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %C.as.M.impl.G.decl), @C.as.M.impl.4b1 [concrete] +// CHECK:STDOUT: %M.impl_witness: = impl_witness %M.impl_witness_table [concrete = constants.%M.impl_witness.c31] +// CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.b.86f = impl_witness_assoc_constant constants.%struct.c94 [concrete = constants.%struct.c94] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G = %C.as.M.impl.G.decl // CHECK:STDOUT: .M = -// CHECK:STDOUT: witness = file.%M.impl_witness.loc16 +// CHECK:STDOUT: witness = %M.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%T.loc3_9.2: type) { @@ -3927,7 +3928,7 @@ fn F() { // CHECK:STDOUT: %bound_method.6f5: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0.862 = %int_2.ef8> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @empty_tuple.type.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %array_type.c9b: type = array_type %int_2.ecc, bool [concrete] // CHECK:STDOUT: %pattern_type.5d5: type = pattern_type %array_type.c9b [concrete] @@ -4005,9 +4006,6 @@ fn F() { // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc8_20, %.loc8_25.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl), @empty_tuple.type.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: %i32 = impl_witness_assoc_constant constants.%int_2.ef8 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -4077,10 +4075,13 @@ fn F() { // CHECK:STDOUT: %return.param: ref %array_type.c9b = out_param call_param1 // CHECK:STDOUT: %return: ref %array_type.c9b = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.I.impl.F.decl), @empty_tuple.type.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: %i32 = impl_witness_assoc_constant constants.%int_2.ef8 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %empty_tuple.type.as.I.impl.F.decl -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @I.F(@I.%Self: %I.type) { @@ -4173,13 +4174,13 @@ fn F() { // CHECK:STDOUT: %Z.lookup_impl_witness: = lookup_impl_witness %.Self.2db, @Z [symbolic_self] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %Z_where.type.930: type = facet_type <@Z where %impl.elem0 = %C.5a3> [symbolic] -// CHECK:STDOUT: %Z.impl_witness.7c7: = impl_witness file.%Z.impl_witness_table, @T.as.Z.impl(%T) [symbolic] +// CHECK:STDOUT: %Z.impl_witness.7c7: = impl_witness @T.as.Z.impl.%Z.impl_witness_table, @T.as.Z.impl(%T) [symbolic] // CHECK:STDOUT: %require_complete.f25: = require_complete_type %Z_where.type.930 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %C.302: type = class_type @C, @C(%D) [concrete] // CHECK:STDOUT: %Z_where.type.530: type = facet_type <@Z where %impl.elem0 = %C.302> [concrete] -// CHECK:STDOUT: %Z.impl_witness.01b: = impl_witness file.%Z.impl_witness_table, @T.as.Z.impl(%D) [concrete] +// CHECK:STDOUT: %Z.impl_witness.01b: = impl_witness @T.as.Z.impl.%Z.impl_witness_table, @T.as.Z.impl(%D) [concrete] // CHECK:STDOUT: %complete_type.ea2: = complete_type_witness %Z_where.type.530 [concrete] // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %D, (%Z.impl_witness.01b) [concrete] // CHECK:STDOUT: %pattern_type.a7e: type = pattern_type %C.302 [concrete] @@ -4240,9 +4241,6 @@ fn F() { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c97] // CHECK:STDOUT: %T.loc9_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc9_14.2 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @T.as.Z.impl [concrete] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness %Z.impl_witness_table, @T.as.Z.impl(constants.%T) [symbolic = @T.as.Z.impl.%Z.impl_witness (constants.%Z.impl_witness.7c7)] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C.5a3 [symbolic = @T.as.Z.impl.%C.loc9_45.2 (constants.%C.5a3)] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4268,14 +4266,18 @@ fn F() { // CHECK:STDOUT: %T.loc9_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc9_14.2 (constants.%T)] // CHECK:STDOUT: %C.loc9_45.2: type = class_type @C, @C(%T.loc9_14.2) [symbolic = %C.loc9_45.2 (constants.%C.5a3)] // CHECK:STDOUT: %Z_where.type: type = facet_type <@Z where constants.%impl.elem0 = %C.loc9_45.2> [symbolic = %Z_where.type (constants.%Z_where.type.930)] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness file.%Z.impl_witness_table, @T.as.Z.impl(%T.loc9_14.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.7c7)] +// CHECK:STDOUT: %Z.impl_witness.loc9_47.2: = impl_witness %Z.impl_witness_table, @T.as.Z.impl(%T.loc9_14.2) [symbolic = %Z.impl_witness.loc9_47.2 (constants.%Z.impl_witness.7c7)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %Z_where.type [symbolic = %require_complete (constants.%require_complete.f25)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref.loc9_24 as %.loc9_31 { +// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @T.as.Z.impl [concrete] +// CHECK:STDOUT: %Z.impl_witness.loc9_47.1: = impl_witness %Z.impl_witness_table, @T.as.Z.impl(constants.%T) [symbolic = %Z.impl_witness.loc9_47.2 (constants.%Z.impl_witness.7c7)] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C.5a3 [symbolic = %C.loc9_45.2 (constants.%C.5a3)] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Z.impl_witness +// CHECK:STDOUT: witness = %Z.impl_witness.loc9_47.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4343,14 +4345,14 @@ fn F() { // CHECK:STDOUT: %T.loc9_14.2 => constants.%T // CHECK:STDOUT: %C.loc9_45.2 => constants.%C.5a3 // CHECK:STDOUT: %Z_where.type => constants.%Z_where.type.930 -// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.7c7 +// CHECK:STDOUT: %Z.impl_witness.loc9_47.2 => constants.%Z.impl_witness.7c7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @T.as.Z.impl(constants.%D) { // CHECK:STDOUT: %T.loc9_14.2 => constants.%D // CHECK:STDOUT: %C.loc9_45.2 => constants.%C.302 // CHECK:STDOUT: %Z_where.type => constants.%Z_where.type.530 -// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.01b +// CHECK:STDOUT: %Z.impl_witness.loc9_47.2 => constants.%Z.impl_witness.01b // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.ea2 diff --git a/toolchain/check/testdata/interface/as_type_of_type.carbon b/toolchain/check/testdata/interface/as_type_of_type.carbon index 48490d994a736..041140855a0a4 100644 --- a/toolchain/check/testdata/interface/as_type_of_type.carbon +++ b/toolchain/check/testdata/interface/as_type_of_type.carbon @@ -30,7 +30,7 @@ fn F(T:! Empty) { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %Empty.impl_witness: = impl_witness file.%Empty.impl_witness_table [concrete] +// CHECK:STDOUT: %Empty.impl_witness: = impl_witness @C.as.Empty.impl.%Empty.impl_witness_table [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %T: %Empty.type = symbolic_binding T, 0 [symbolic] @@ -83,8 +83,6 @@ fn F(T:! Empty) { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [concrete = constants.%Empty.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Empty.impl_witness_table = impl_witness_table (), @C.as.Empty.impl [concrete] -// CHECK:STDOUT: %Empty.impl_witness: = impl_witness %Empty.impl_witness_table [concrete = constants.%Empty.impl_witness] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %T.patt: %pattern_type.917 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { @@ -107,8 +105,11 @@ fn F(T:! Empty) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.Empty.impl: %C.ref as %Empty.ref { +// CHECK:STDOUT: %Empty.impl_witness_table = impl_witness_table (), @C.as.Empty.impl [concrete] +// CHECK:STDOUT: %Empty.impl_witness: = impl_witness %Empty.impl_witness_table [concrete = constants.%Empty.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Empty.impl_witness +// CHECK:STDOUT: witness = %Empty.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/interface/compound_member_access.carbon b/toolchain/check/testdata/interface/compound_member_access.carbon index 65200e4737213..f540c8c066f39 100644 --- a/toolchain/check/testdata/interface/compound_member_access.carbon +++ b/toolchain/check/testdata/interface/compound_member_access.carbon @@ -1179,7 +1179,7 @@ fn Works() { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %A.impl_witness: = impl_witness file.%A.impl_witness_table [concrete] +// CHECK:STDOUT: %A.impl_witness: = impl_witness @C.as.A.impl.%A.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.A.impl.G.type: type = fn_type @C.as.A.impl.G [concrete] // CHECK:STDOUT: %C.as.A.impl.G: %C.as.A.impl.G.type = struct_value () [concrete] // CHECK:STDOUT: %A.facet: %A.type = facet_value %C, (%A.impl_witness) [concrete] @@ -1236,8 +1236,6 @@ fn Works() { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (@C.as.A.impl.%C.as.A.impl.G.decl), @C.as.A.impl [concrete] -// CHECK:STDOUT: %A.impl_witness: = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness] // CHECK:STDOUT: %Fails.decl: %Fails.type = fn_decl @Fails [concrete = constants.%Fails] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1256,10 +1254,12 @@ fn Works() { // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.A.impl: %C.ref as %A.ref { // CHECK:STDOUT: %C.as.A.impl.G.decl: %C.as.A.impl.G.type = fn_decl @C.as.A.impl.G [concrete = constants.%C.as.A.impl.G] {} {} +// CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (%C.as.A.impl.G.decl), @C.as.A.impl [concrete] +// CHECK:STDOUT: %A.impl_witness: = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G = %C.as.A.impl.G.decl -// CHECK:STDOUT: witness = file.%A.impl_witness +// CHECK:STDOUT: witness = %A.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -1372,7 +1372,7 @@ fn Works() { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %A.impl_witness: = impl_witness file.%A.impl_witness_table [concrete] +// CHECK:STDOUT: %A.impl_witness: = impl_witness @C.as.A.impl.%A.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.A.impl.G.type: type = fn_type @C.as.A.impl.G [concrete] // CHECK:STDOUT: %C.as.A.impl.G: %C.as.A.impl.G.type = struct_value () [concrete] // CHECK:STDOUT: %A.facet: %A.type = facet_value %C, (%A.impl_witness) [concrete] @@ -1416,8 +1416,6 @@ fn Works() { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (@C.as.A.impl.%C.as.A.impl.G.decl), @C.as.A.impl [concrete] -// CHECK:STDOUT: %A.impl_witness: = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness] // CHECK:STDOUT: %Works.decl: %Works.type = fn_decl @Works [concrete = constants.%Works] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1436,10 +1434,12 @@ fn Works() { // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.A.impl: %C.ref as %A.ref { // CHECK:STDOUT: %C.as.A.impl.G.decl: %C.as.A.impl.G.type = fn_decl @C.as.A.impl.G [concrete = constants.%C.as.A.impl.G] {} {} +// CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (%C.as.A.impl.G.decl), @C.as.A.impl [concrete] +// CHECK:STDOUT: %A.impl_witness: = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G = %C.as.A.impl.G.decl -// CHECK:STDOUT: witness = file.%A.impl_witness +// CHECK:STDOUT: witness = %A.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/interface/default_fn.carbon b/toolchain/check/testdata/interface/default_fn.carbon index 764282d43f159..2c17e462b44d4 100644 --- a/toolchain/check/testdata/interface/default_fn.carbon +++ b/toolchain/check/testdata/interface/default_fn.carbon @@ -40,7 +40,7 @@ class C { // CHECK:STDOUT: %I.F: %I.F.type = struct_value () [concrete] // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] // CHECK:STDOUT: %assoc0.ab7: %I.assoc_type = assoc_entity element0, @I.%I.F.decl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.as.I.impl.F.type: type = fn_type @C.as.I.impl.F [concrete] // CHECK:STDOUT: %C.as.I.impl.F: %C.as.I.impl.F.type = struct_value () [concrete] @@ -112,10 +112,12 @@ class C { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.I.impl.%C.ref [concrete = constants.%C] // CHECK:STDOUT: %self: %C = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%C.as.I.impl.F.decl), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %C.as.I.impl.F.decl -// CHECK:STDOUT: witness = @C.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -124,8 +126,6 @@ class C { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, @C.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@C.as.I.impl.%C.as.I.impl.F.decl), @C.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon b/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon index 3f23c55779bbc..fa7796f2d14b8 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon @@ -296,10 +296,10 @@ interface C { // CHECK:STDOUT: %impl.elem0.5f0: type = impl_witness_access %I2.lookup_impl_witness.92f, element0 [symbolic_self] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %I2_where.type: type = facet_type <@I2 where %impl.elem0.5f0 = %empty_tuple.type> [concrete] -// CHECK:STDOUT: %I2.impl_witness.d15: = impl_witness file.%I2.impl_witness_table, @V.binding.as_type.as.I2.impl(%V) [symbolic] +// CHECK:STDOUT: %I2.impl_witness.d15: = impl_witness @V.binding.as_type.as.I2.impl.%I2.impl_witness_table, @V.binding.as_type.as.I2.impl(%V) [symbolic] // CHECK:STDOUT: %Self.e01: %J2.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self.e01 [symbolic] -// CHECK:STDOUT: %I2.impl_witness.ab2: = impl_witness file.%I2.impl_witness_table, @V.binding.as_type.as.I2.impl(%Self.e01) [symbolic] +// CHECK:STDOUT: %I2.impl_witness.ab2: = impl_witness @V.binding.as_type.as.I2.impl.%I2.impl_witness_table, @V.binding.as_type.as.I2.impl(%Self.e01) [symbolic] // CHECK:STDOUT: %.d20: require_specific_def_type = require_specific_def @V.binding.as_type.as.I2.impl(%Self.e01) [symbolic] // CHECK:STDOUT: %I2.lookup_impl_witness.67b: = lookup_impl_witness %Self.e01, @I2 [symbolic] // CHECK:STDOUT: %I2.facet: %I2.type = facet_value %Self.binding.as_type, (%I2.lookup_impl_witness.67b) [symbolic] @@ -351,9 +351,6 @@ interface C { // CHECK:STDOUT: } // CHECK:STDOUT: %V.loc11_14.1: %J2.type = symbolic_binding V, 0 [symbolic = %V.loc11_14.2 (constants.%V)] // CHECK:STDOUT: } -// CHECK:STDOUT: %I2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @V.binding.as_type.as.I2.impl [concrete] -// CHECK:STDOUT: %I2.impl_witness: = impl_witness %I2.impl_witness_table, @V.binding.as_type.as.I2.impl(constants.%V) [symbolic = @V.binding.as_type.as.I2.impl.%I2.impl_witness (constants.%I2.impl_witness.d15)] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %J2.decl.loc13: type = interface_decl @J2 [concrete = constants.%J2.type] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -407,13 +404,17 @@ interface C { // CHECK:STDOUT: generic impl @V.binding.as_type.as.I2.impl(%V.loc11_14.1: %J2.type) { // CHECK:STDOUT: %V.loc11_14.2: %J2.type = symbolic_binding V, 0 [symbolic = %V.loc11_14.2 (constants.%V)] // CHECK:STDOUT: %V.binding.as_type: type = symbolic_binding_type V, 0, %V.loc11_14.2 [symbolic = %V.binding.as_type (constants.%V.binding.as_type)] -// CHECK:STDOUT: %I2.impl_witness: = impl_witness file.%I2.impl_witness_table, @V.binding.as_type.as.I2.impl(%V.loc11_14.2) [symbolic = %I2.impl_witness (constants.%I2.impl_witness.d15)] +// CHECK:STDOUT: %I2.impl_witness.loc11_45.2: = impl_witness %I2.impl_witness_table, @V.binding.as_type.as.I2.impl(%V.loc11_14.2) [symbolic = %I2.impl_witness.loc11_45.2 (constants.%I2.impl_witness.d15)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc11_22 as %.loc11_30 { +// CHECK:STDOUT: %I2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @V.binding.as_type.as.I2.impl [concrete] +// CHECK:STDOUT: %I2.impl_witness.loc11_45.1: = impl_witness %I2.impl_witness_table, @V.binding.as_type.as.I2.impl(constants.%V) [symbolic = %I2.impl_witness.loc11_45.2 (constants.%I2.impl_witness.d15)] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I2.impl_witness +// CHECK:STDOUT: witness = %I2.impl_witness.loc11_45.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -436,13 +437,13 @@ interface C { // CHECK:STDOUT: specific @V.binding.as_type.as.I2.impl(constants.%V) { // CHECK:STDOUT: %V.loc11_14.2 => constants.%V // CHECK:STDOUT: %V.binding.as_type => constants.%V.binding.as_type -// CHECK:STDOUT: %I2.impl_witness => constants.%I2.impl_witness.d15 +// CHECK:STDOUT: %I2.impl_witness.loc11_45.2 => constants.%I2.impl_witness.d15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @V.binding.as_type.as.I2.impl(constants.%Self.e01) { // CHECK:STDOUT: %V.loc11_14.2 => constants.%Self.e01 // CHECK:STDOUT: %V.binding.as_type => constants.%Self.binding.as_type -// CHECK:STDOUT: %I2.impl_witness => constants.%I2.impl_witness.ab2 +// CHECK:STDOUT: %I2.impl_witness.loc11_45.2 => constants.%I2.impl_witness.ab2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/final.carbon b/toolchain/check/testdata/interface/final.carbon index 64dcdc9cfc2a8..9fb8842f38024 100644 --- a/toolchain/check/testdata/interface/final.carbon +++ b/toolchain/check/testdata/interface/final.carbon @@ -45,7 +45,7 @@ fn Use() { UseJ(C); } // CHECK:STDOUT: %T.a68: %J.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.70b: type = pattern_type %J.type [concrete] // CHECK:STDOUT: %T.binding.as_type.735: type = symbolic_binding_type T, 0, %T.a68 [symbolic] -// CHECK:STDOUT: %I.impl_witness.234: = impl_witness file.%I.impl_witness_table, @T.binding.as_type.as.I.impl(%T.a68) [symbolic] +// CHECK:STDOUT: %I.impl_witness.234: = impl_witness @T.binding.as_type.as.I.impl.%I.impl_witness_table, @T.binding.as_type.as.I.impl(%T.a68) [symbolic] // CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.type.746: type = fn_type @T.binding.as_type.as.I.impl.F, @T.binding.as_type.as.I.impl(%T.a68) [symbolic] // CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.5ca: %T.binding.as_type.as.I.impl.F.type.746 = struct_value () [symbolic] // CHECK:STDOUT: %I.facet.077: %I.type = facet_value %T.binding.as_type.735, (%I.impl_witness.234) [symbolic] @@ -65,14 +65,14 @@ fn Use() { UseJ(C); } // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness file.%J.impl_witness_table [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness @C.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %Use.type: type = fn_type @Use [concrete] // CHECK:STDOUT: %Use: %Use.type = struct_value () [concrete] // CHECK:STDOUT: %J.facet: %J.type = facet_value %C, (%J.impl_witness) [concrete] // CHECK:STDOUT: %UseJ.specific_fn: = specific_function %UseJ, @UseJ(%J.facet) [concrete] // CHECK:STDOUT: %.fdb: type = fn_type_with_self_type %I.F.type, %I.facet.077 [symbolic] // CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.specific_fn.0af: = specific_function %T.binding.as_type.as.I.impl.F.5ca, @T.binding.as_type.as.I.impl.F(%T.a68) [symbolic] -// CHECK:STDOUT: %I.impl_witness.3e0: = impl_witness file.%I.impl_witness_table, @T.binding.as_type.as.I.impl(%J.facet) [concrete] +// CHECK:STDOUT: %I.impl_witness.3e0: = impl_witness @T.binding.as_type.as.I.impl.%I.impl_witness_table, @T.binding.as_type.as.I.impl(%J.facet) [concrete] // CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.type.479: type = fn_type @T.binding.as_type.as.I.impl.F, @T.binding.as_type.as.I.impl(%J.facet) [concrete] // CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.bac: %T.binding.as_type.as.I.impl.F.type.479 = struct_value () [concrete] // CHECK:STDOUT: %.ac1: require_specific_def_type = require_specific_def @T.binding.as_type.as.I.impl(%J.facet) [concrete] @@ -115,8 +115,6 @@ fn Use() { UseJ(C); } // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc7_20.2: %J.type = symbolic_binding T, 0 [symbolic = %T.loc7_20.1 (constants.%T.a68)] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@T.binding.as_type.as.I.impl.%T.binding.as_type.as.I.impl.F.decl), @T.binding.as_type.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table, @T.binding.as_type.as.I.impl(constants.%T.a68) [symbolic = @T.binding.as_type.as.I.impl.%I.impl_witness (constants.%I.impl_witness.234)] // CHECK:STDOUT: %UseI.decl: %UseI.type = fn_decl @UseI [concrete = constants.%UseI] { // CHECK:STDOUT: %T.patt: %pattern_type.a15 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { @@ -140,8 +138,6 @@ fn Use() { UseJ(C); } // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (), @C.as.J.impl [concrete] -// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] // CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [concrete = constants.%Use] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -171,7 +167,7 @@ fn Use() { UseJ(C); } // CHECK:STDOUT: generic impl @T.binding.as_type.as.I.impl(%T.loc7_20.2: %J.type) { // CHECK:STDOUT: %T.loc7_20.1: %J.type = symbolic_binding T, 0 [symbolic = %T.loc7_20.1 (constants.%T.a68)] // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc7_20.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.735)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @T.binding.as_type.as.I.impl(%T.loc7_20.1) [symbolic = %I.impl_witness (constants.%I.impl_witness.234)] +// CHECK:STDOUT: %I.impl_witness.loc7_34.2: = impl_witness %I.impl_witness_table, @T.binding.as_type.as.I.impl(%T.loc7_20.1) [symbolic = %I.impl_witness.loc7_34.2 (constants.%I.impl_witness.234)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.type: type = fn_type @T.binding.as_type.as.I.impl.F, @T.binding.as_type.as.I.impl(%T.loc7_20.1) [symbolic = %T.binding.as_type.as.I.impl.F.type (constants.%T.binding.as_type.as.I.impl.F.type.746)] @@ -179,16 +175,21 @@ fn Use() { UseJ(C); } // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc7_27 as %I.ref { // CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.decl: @T.binding.as_type.as.I.impl.%T.binding.as_type.as.I.impl.F.type (%T.binding.as_type.as.I.impl.F.type.746) = fn_decl @T.binding.as_type.as.I.impl.F [symbolic = @T.binding.as_type.as.I.impl.%T.binding.as_type.as.I.impl.F (constants.%T.binding.as_type.as.I.impl.F.5ca)] {} {} +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%T.binding.as_type.as.I.impl.F.decl), @T.binding.as_type.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness.loc7_34.1: = impl_witness %I.impl_witness_table, @T.binding.as_type.as.I.impl(constants.%T.a68) [symbolic = %I.impl_witness.loc7_34.2 (constants.%I.impl_witness.234)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %T.binding.as_type.as.I.impl.F.decl -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness.loc7_34.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.J.impl: %C.ref as %J.ref { +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (), @C.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%J.impl_witness +// CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -241,7 +242,7 @@ fn Use() { UseJ(C); } // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc12_9.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.735)] // CHECK:STDOUT: %.loc12_24.2: require_specific_def_type = require_specific_def @T.binding.as_type.as.I.impl(%T.loc12_9.1) [symbolic = %.loc12_24.2 (constants.%.5bd)] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table, @T.binding.as_type.as.I.impl(%T.loc12_9.1) [symbolic = %I.impl_witness (constants.%I.impl_witness.234)] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @T.binding.as_type.as.I.impl.%I.impl_witness_table, @T.binding.as_type.as.I.impl(%T.loc12_9.1) [symbolic = %I.impl_witness (constants.%I.impl_witness.234)] // CHECK:STDOUT: %I.facet.loc12_24.2: %I.type = facet_value %T.binding.as_type, (%I.impl_witness) [symbolic = %I.facet.loc12_24.2 (constants.%I.facet.077)] // CHECK:STDOUT: %UseI.specific_fn.loc12_18.2: = specific_function constants.%UseI, @UseI(%I.facet.loc12_24.2) [symbolic = %UseI.specific_fn.loc12_18.2 (constants.%UseI.specific_fn.8ea)] // CHECK:STDOUT: @@ -274,7 +275,7 @@ fn Use() { UseJ(C); } // CHECK:STDOUT: specific @T.binding.as_type.as.I.impl(constants.%T.a68) { // CHECK:STDOUT: %T.loc7_20.1 => constants.%T.a68 // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type.735 -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness.234 +// CHECK:STDOUT: %I.impl_witness.loc7_34.2 => constants.%I.impl_witness.234 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.type => constants.%T.binding.as_type.as.I.impl.F.type.746 @@ -322,7 +323,7 @@ fn Use() { UseJ(C); } // CHECK:STDOUT: specific @T.binding.as_type.as.I.impl(constants.%J.facet) { // CHECK:STDOUT: %T.loc7_20.1 => constants.%J.facet // CHECK:STDOUT: %T.binding.as_type => constants.%C -// CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness.3e0 +// CHECK:STDOUT: %I.impl_witness.loc7_34.2 => constants.%I.impl_witness.3e0 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.binding.as_type.as.I.impl.F.type => constants.%T.binding.as_type.as.I.impl.F.type.479 diff --git a/toolchain/check/testdata/interface/generic.carbon b/toolchain/check/testdata/interface/generic.carbon index 1fc9d64152992..503fde2e0082d 100644 --- a/toolchain/check/testdata/interface/generic.carbon +++ b/toolchain/check/testdata/interface/generic.carbon @@ -102,10 +102,10 @@ fn F(T:! Generic((), ())) {} // CHECK:STDOUT: %assoc0.62d: %WithAssocFn.assoc_type.b93 = assoc_entity element0, @WithAssocFn.%WithAssocFn.F.decl [symbolic] // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %Simple.type.1a3: type = facet_type <@Simple, @Simple(%C)> [concrete] -// CHECK:STDOUT: %Simple.impl_witness: = impl_witness @C.%Simple.impl_witness_table [concrete] +// CHECK:STDOUT: %Simple.impl_witness: = impl_witness @C.as.Simple.impl.%Simple.impl_witness_table [concrete] // CHECK:STDOUT: %Self.25c: %Simple.type.1a3 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %WithAssocFn.type.e28: type = facet_type <@WithAssocFn, @WithAssocFn(%C)> [concrete] -// CHECK:STDOUT: %WithAssocFn.impl_witness: = impl_witness @C.%WithAssocFn.impl_witness_table [concrete] +// CHECK:STDOUT: %WithAssocFn.impl_witness: = impl_witness @C.as.WithAssocFn.impl.%WithAssocFn.impl_witness_table [concrete] // CHECK:STDOUT: %Self.062: %WithAssocFn.type.e28 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %WithAssocFn.F.type.233: type = fn_type @WithAssocFn.F, @WithAssocFn(%C) [concrete] // CHECK:STDOUT: %WithAssocFn.F.5a8: %WithAssocFn.F.type.233 = struct_value () [concrete] @@ -249,8 +249,11 @@ fn F(T:! Generic((), ())) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.Simple.impl: %Self.ref as %Simple.type { +// CHECK:STDOUT: %Simple.impl_witness_table = impl_witness_table (), @C.as.Simple.impl [concrete] +// CHECK:STDOUT: %Simple.impl_witness: = impl_witness %Simple.impl_witness_table [concrete = constants.%Simple.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = @C.%Simple.impl_witness +// CHECK:STDOUT: witness = %Simple.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.WithAssocFn.impl: %Self.ref as %WithAssocFn.type { @@ -262,11 +265,13 @@ fn F(T:! Generic((), ())) {} // CHECK:STDOUT: %return.param: ref %X = out_param call_param0 // CHECK:STDOUT: %return: ref %X = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %WithAssocFn.impl_witness_table = impl_witness_table (%C.as.WithAssocFn.impl.F.decl), @C.as.WithAssocFn.impl [concrete] +// CHECK:STDOUT: %WithAssocFn.impl_witness: = impl_witness %WithAssocFn.impl_witness_table [concrete = constants.%WithAssocFn.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .X = // CHECK:STDOUT: .F = %C.as.WithAssocFn.impl.F.decl -// CHECK:STDOUT: witness = @C.%WithAssocFn.impl_witness +// CHECK:STDOUT: witness = %WithAssocFn.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { @@ -284,16 +289,12 @@ fn F(T:! Generic((), ())) {} // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %Simple.type: type = facet_type <@Simple, @Simple(constants.%C)> [concrete = constants.%Simple.type.1a3] // CHECK:STDOUT: } -// CHECK:STDOUT: %Simple.impl_witness_table = impl_witness_table (), @C.as.Simple.impl [concrete] -// CHECK:STDOUT: %Simple.impl_witness: = impl_witness %Simple.impl_witness_table [concrete = constants.%Simple.impl_witness] // CHECK:STDOUT: impl_decl @C.as.WithAssocFn.impl [concrete] {} { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] // CHECK:STDOUT: %WithAssocFn.ref: %WithAssocFn.type.daa = name_ref WithAssocFn, file.%WithAssocFn.decl [concrete = constants.%WithAssocFn.generic] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %WithAssocFn.type: type = facet_type <@WithAssocFn, @WithAssocFn(constants.%C)> [concrete = constants.%WithAssocFn.type.e28] // CHECK:STDOUT: } -// CHECK:STDOUT: %WithAssocFn.impl_witness_table = impl_witness_table (@C.as.WithAssocFn.impl.%C.as.WithAssocFn.impl.F.decl), @C.as.WithAssocFn.impl [concrete] -// CHECK:STDOUT: %WithAssocFn.impl_witness: = impl_witness %WithAssocFn.impl_witness_table [concrete = constants.%WithAssocFn.impl_witness] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/generic_import.carbon b/toolchain/check/testdata/interface/generic_import.carbon index 710f21fde6dad..8c382cac43a0f 100644 --- a/toolchain/check/testdata/interface/generic_import.carbon +++ b/toolchain/check/testdata/interface/generic_import.carbon @@ -111,7 +111,7 @@ impl C as AddWith(C) { // CHECK:STDOUT: %AddWith.F.type.b80: type = fn_type @AddWith.F, @AddWith(%T) [symbolic] // CHECK:STDOUT: %AddWith.F.349: %AddWith.F.type.b80 = struct_value () [symbolic] // CHECK:STDOUT: %AddWith.type.8b5: type = facet_type <@AddWith, @AddWith(%C)> [concrete] -// CHECK:STDOUT: %AddWith.impl_witness: = impl_witness file.%AddWith.impl_witness_table [concrete] +// CHECK:STDOUT: %AddWith.impl_witness: = impl_witness @C.as.AddWith.impl.%AddWith.impl_witness_table [concrete] // CHECK:STDOUT: %Self.bbf: %AddWith.type.8b5 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %AddWith.F.type.b42: type = fn_type @AddWith.F, @AddWith(%C) [concrete] // CHECK:STDOUT: %AddWith.F.3d6: %AddWith.F.type.b42 = struct_value () [concrete] @@ -146,8 +146,6 @@ impl C as AddWith(C) { // CHECK:STDOUT: %C.ref.loc7_19: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %AddWith.type: type = facet_type <@AddWith, @AddWith(constants.%C)> [concrete = constants.%AddWith.type.8b5] // CHECK:STDOUT: } -// CHECK:STDOUT: %AddWith.impl_witness_table = impl_witness_table (@C.as.AddWith.impl.%C.as.AddWith.impl.F.decl), @C.as.AddWith.impl [concrete] -// CHECK:STDOUT: %AddWith.impl_witness: = impl_witness %AddWith.impl_witness_table [concrete = constants.%AddWith.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @AddWith(imports.%Main.import_ref.b3bc94.1: type) [from "a.carbon"] { @@ -173,10 +171,12 @@ impl C as AddWith(C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.AddWith.impl: %C.ref.loc7_6 as %AddWith.type { // CHECK:STDOUT: %C.as.AddWith.impl.F.decl: %C.as.AddWith.impl.F.type = fn_decl @C.as.AddWith.impl.F [concrete = constants.%C.as.AddWith.impl.F] {} {} +// CHECK:STDOUT: %AddWith.impl_witness_table = impl_witness_table (%C.as.AddWith.impl.F.decl), @C.as.AddWith.impl [concrete] +// CHECK:STDOUT: %AddWith.impl_witness: = impl_witness %AddWith.impl_witness_table [concrete = constants.%AddWith.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %C.as.AddWith.impl.F.decl -// CHECK:STDOUT: witness = file.%AddWith.impl_witness +// CHECK:STDOUT: witness = %AddWith.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/interface/generic_method.carbon b/toolchain/check/testdata/interface/generic_method.carbon index 778ac05f36900..3863c849ad2ef 100644 --- a/toolchain/check/testdata/interface/generic_method.carbon +++ b/toolchain/check/testdata/interface/generic_method.carbon @@ -113,7 +113,7 @@ fn CallIndirect() { // CHECK:STDOUT: %Y: type = class_type @Y [concrete] // CHECK:STDOUT: %Z: type = class_type @Z [concrete] // CHECK:STDOUT: %A.type.f82: type = facet_type <@A, @A(%X)> [concrete] -// CHECK:STDOUT: %A.impl_witness: = impl_witness file.%A.impl_witness_table [concrete] +// CHECK:STDOUT: %A.impl_witness: = impl_witness @Y.as.A.impl.%A.impl_witness_table [concrete] // CHECK:STDOUT: %Self.aab: %A.type.f82 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %A.F.type.49b: type = fn_type @A.F, @A(%X) [concrete] // CHECK:STDOUT: %A.F.768: %A.F.type.49b = struct_value () [concrete] @@ -254,8 +254,6 @@ fn CallIndirect() { // 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.f82] // CHECK:STDOUT: } -// CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (@Y.as.A.impl.%Y.as.A.impl.F.decl), @Y.as.A.impl [concrete] -// 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.e04 = symbolic_binding_pattern T, 0 [concrete] @@ -348,12 +346,14 @@ fn CallIndirect() { // CHECK:STDOUT: %return.param: ref @Y.as.A.impl.F.%tuple.type.loc16 (%tuple.type.244) = out_param call_param1 // CHECK:STDOUT: %return: ref @Y.as.A.impl.F.%tuple.type.loc16 (%tuple.type.244) = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (%Y.as.A.impl.F.decl), @Y.as.A.impl [concrete] +// CHECK:STDOUT: %A.impl_witness: = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .X = // CHECK:STDOUT: .Y = // CHECK:STDOUT: .F = %Y.as.A.impl.F.decl -// CHECK:STDOUT: witness = file.%A.impl_witness +// CHECK:STDOUT: witness = %A.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { @@ -706,7 +706,7 @@ fn CallIndirect() { // CHECK:STDOUT: %tuple.4b9: %tuple.type.24b = tuple_value (%V1, %V2) [symbolic] // CHECK:STDOUT: %tuple.type.a5e: type = tuple_type (%V1, %V2) [symbolic] // CHECK:STDOUT: %A.type.62d: type = facet_type <@A, @A(%W)> [symbolic] -// CHECK:STDOUT: %A.impl_witness.d95: = impl_witness file.%A.impl_witness_table, @tuple.type.as.A.impl(%V1, %V2, %W) [symbolic] +// CHECK:STDOUT: %A.impl_witness.d95: = impl_witness @tuple.type.as.A.impl.%A.impl_witness_table, @tuple.type.as.A.impl(%V1, %V2, %W) [symbolic] // CHECK:STDOUT: %Self.6ee: %A.type.62d = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %A.F.type.0cd: type = fn_type @A.F, @A(%W) [symbolic] // CHECK:STDOUT: %A.F.cef: %A.F.type.0cd = struct_value () [symbolic] @@ -732,7 +732,7 @@ fn CallIndirect() { // CHECK:STDOUT: %tuple.dd5: %tuple.type.24b = tuple_value (%Y1, %Y2) [concrete] // CHECK:STDOUT: %tuple.type.ab2: type = tuple_type (%Y1, %Y2) [concrete] // CHECK:STDOUT: %A.type.f82: type = facet_type <@A, @A(%X)> [concrete] -// CHECK:STDOUT: %A.impl_witness.098: = impl_witness file.%A.impl_witness_table, @tuple.type.as.A.impl(%Y1, %Y2, %X) [concrete] +// CHECK:STDOUT: %A.impl_witness.098: = impl_witness @tuple.type.as.A.impl.%A.impl_witness_table, @tuple.type.as.A.impl(%Y1, %Y2, %X) [concrete] // CHECK:STDOUT: %Self.aab: %A.type.f82 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %A.F.type.49b: type = fn_type @A.F, @A(%X) [concrete] // CHECK:STDOUT: %A.F.768: %A.F.type.49b = struct_value () [concrete] @@ -850,8 +850,6 @@ fn CallIndirect() { // CHECK:STDOUT: %.Self.3: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %W.loc14_36.2: type = symbolic_binding W, 2 [symbolic = %W.loc14_36.1 (constants.%W)] // CHECK:STDOUT: } -// CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (@tuple.type.as.A.impl.%tuple.type.as.A.impl.F.decl), @tuple.type.as.A.impl [concrete] -// 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.d95)] // 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.e04 = symbolic_binding_pattern T, 0 [concrete] @@ -922,7 +920,7 @@ fn CallIndirect() { // CHECK:STDOUT: %tuple: %tuple.type.24b = tuple_value (%V1.loc14_14.1, %V2.loc14_25.1) [symbolic = %tuple (constants.%tuple.4b9)] // CHECK:STDOUT: %tuple.type: type = tuple_type (%V1.loc14_14.1, %V2.loc14_25.1) [symbolic = %tuple.type (constants.%tuple.type.a5e)] // CHECK:STDOUT: %A.type.loc14_61.1: type = facet_type <@A, @A(%W.loc14_36.1)> [symbolic = %A.type.loc14_61.1 (constants.%A.type.62d)] -// CHECK:STDOUT: %A.impl_witness: = impl_witness file.%A.impl_witness_table, @tuple.type.as.A.impl(%V1.loc14_14.1, %V2.loc14_25.1, %W.loc14_36.1) [symbolic = %A.impl_witness (constants.%A.impl_witness.d95)] +// CHECK:STDOUT: %A.impl_witness.loc14_63.2: = impl_witness %A.impl_witness_table, @tuple.type.as.A.impl(%V1.loc14_14.1, %V2.loc14_25.1, %W.loc14_36.1) [symbolic = %A.impl_witness.loc14_63.2 (constants.%A.impl_witness.d95)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %A.type.loc14_61.1 [symbolic = %require_complete (constants.%require_complete.4be)] @@ -953,13 +951,15 @@ fn CallIndirect() { // CHECK:STDOUT: %return.param: ref @tuple.type.as.A.impl.F.%tuple.type.loc17_42.2 (%tuple.type.897) = out_param call_param1 // CHECK:STDOUT: %return: ref @tuple.type.as.A.impl.F.%tuple.type.loc17_42.2 (%tuple.type.897) = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (%tuple.type.as.A.impl.F.decl), @tuple.type.as.A.impl [concrete] +// CHECK:STDOUT: %A.impl_witness.loc14_63.1: = impl_witness %A.impl_witness_table, @tuple.type.as.A.impl(constants.%V1, constants.%V2, constants.%W) [symbolic = %A.impl_witness.loc14_63.2 (constants.%A.impl_witness.d95)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .W = // CHECK:STDOUT: .V1 = // CHECK:STDOUT: .V2 = // CHECK:STDOUT: .F = %tuple.type.as.A.impl.F.decl -// CHECK:STDOUT: witness = file.%A.impl_witness +// CHECK:STDOUT: witness = %A.impl_witness.loc14_63.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1182,7 +1182,7 @@ fn CallIndirect() { // CHECK:STDOUT: %tuple => constants.%tuple.4b9 // CHECK:STDOUT: %tuple.type => constants.%tuple.type.a5e // CHECK:STDOUT: %A.type.loc14_61.1 => constants.%A.type.62d -// CHECK:STDOUT: %A.impl_witness => constants.%A.impl_witness.d95 +// CHECK:STDOUT: %A.impl_witness.loc14_63.2 => constants.%A.impl_witness.d95 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete.4be @@ -1242,7 +1242,7 @@ fn CallIndirect() { // CHECK:STDOUT: %tuple => constants.%tuple.dd5 // CHECK:STDOUT: %tuple.type => constants.%tuple.type.ab2 // CHECK:STDOUT: %A.type.loc14_61.1 => constants.%A.type.f82 -// CHECK:STDOUT: %A.impl_witness => constants.%A.impl_witness.098 +// CHECK:STDOUT: %A.impl_witness.loc14_63.2 => constants.%A.impl_witness.098 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.df7 diff --git a/toolchain/check/testdata/interface/generic_vs_params.carbon b/toolchain/check/testdata/interface/generic_vs_params.carbon index 57d55bd31928f..3f869699d2e6e 100644 --- a/toolchain/check/testdata/interface/generic_vs_params.carbon +++ b/toolchain/check/testdata/interface/generic_vs_params.carbon @@ -102,19 +102,19 @@ interface Bar[T:! type] {} // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %X: type = class_type @X [concrete] -// CHECK:STDOUT: %NotGenericNoParams.impl_witness: = impl_witness file.%NotGenericNoParams.impl_witness_table [concrete] -// CHECK:STDOUT: %NotGenericButParams.impl_witness: = impl_witness file.%NotGenericButParams.impl_witness_table [concrete] +// CHECK:STDOUT: %NotGenericNoParams.impl_witness: = impl_witness @X.as.NotGenericNoParams.impl.%NotGenericNoParams.impl_witness_table [concrete] +// CHECK:STDOUT: %NotGenericButParams.impl_witness: = impl_witness @X.as.NotGenericButParams.impl.%NotGenericButParams.impl_witness_table [concrete] // CHECK:STDOUT: %GenericAndParams.type.332: type = facet_type <@GenericAndParams.loc6, @GenericAndParams.loc6(%X)> [concrete] -// CHECK:STDOUT: %GenericAndParams.impl_witness.ba4: = impl_witness file.%GenericAndParams.impl_witness_table.loc16 [concrete] +// CHECK:STDOUT: %GenericAndParams.impl_witness.ba4: = impl_witness @X.as.GenericAndParams.impl.26f.%GenericAndParams.impl_witness_table [concrete] // CHECK:STDOUT: %Self.1ed: %GenericAndParams.type.332 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %C.513: type = class_type @C, @C(%X) [concrete] // CHECK:STDOUT: %GenericNoParams.type.156: type = facet_type <@GenericNoParams, @GenericNoParams(%X)> [concrete] // CHECK:STDOUT: %GenericAndParams.type.8ab: type = generic_interface_type @GenericAndParams.loc10, @C(%X) [concrete] // CHECK:STDOUT: %GenericAndParams.generic.22e: %GenericAndParams.type.8ab = struct_value () [concrete] -// CHECK:STDOUT: %GenericNoParams.impl_witness: = impl_witness file.%GenericNoParams.impl_witness_table [concrete] +// CHECK:STDOUT: %GenericNoParams.impl_witness: = impl_witness @X.as.GenericNoParams.impl.%GenericNoParams.impl_witness_table [concrete] // CHECK:STDOUT: %Self.4a5: %GenericNoParams.type.156 = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %GenericAndParams.type.90e: type = facet_type <@GenericAndParams.loc10, @GenericAndParams.loc10(%X, %X)> [concrete] -// CHECK:STDOUT: %GenericAndParams.impl_witness.d80: = impl_witness file.%GenericAndParams.impl_witness_table.loc18 [concrete] +// CHECK:STDOUT: %GenericAndParams.impl_witness.d80: = impl_witness @X.as.GenericAndParams.impl.b51.%GenericAndParams.impl_witness_table [concrete] // CHECK:STDOUT: %Self.349: %GenericAndParams.type.90e = symbolic_binding Self, 2 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -145,23 +145,17 @@ interface Bar[T:! type] {} // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %NotGenericNoParams.ref: type = name_ref NotGenericNoParams, file.%NotGenericNoParams.decl [concrete = constants.%NotGenericNoParams.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %NotGenericNoParams.impl_witness_table = impl_witness_table (), @X.as.NotGenericNoParams.impl [concrete] -// CHECK:STDOUT: %NotGenericNoParams.impl_witness: = impl_witness %NotGenericNoParams.impl_witness_table [concrete = constants.%NotGenericNoParams.impl_witness] // CHECK:STDOUT: impl_decl @X.as.NotGenericButParams.impl [concrete] {} { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %NotGenericButParams.ref: %NotGenericButParams.type.647 = name_ref NotGenericButParams, file.%NotGenericButParams.decl [concrete = constants.%NotGenericButParams.generic] // CHECK:STDOUT: %NotGenericButParams.type: type = facet_type <@NotGenericButParams> [concrete = constants.%NotGenericButParams.type.8d8] // CHECK:STDOUT: } -// CHECK:STDOUT: %NotGenericButParams.impl_witness_table = impl_witness_table (), @X.as.NotGenericButParams.impl [concrete] -// CHECK:STDOUT: %NotGenericButParams.impl_witness: = impl_witness %NotGenericButParams.impl_witness_table [concrete = constants.%NotGenericButParams.impl_witness] // CHECK:STDOUT: impl_decl @X.as.GenericAndParams.impl.26f [concrete] {} { // CHECK:STDOUT: %X.ref.loc16_6: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %GenericAndParams.ref: %GenericAndParams.type.17f = name_ref GenericAndParams, file.%GenericAndParams.decl [concrete = constants.%GenericAndParams.generic.253] // CHECK:STDOUT: %X.ref.loc16_28: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %GenericAndParams.type: type = facet_type <@GenericAndParams.loc6, @GenericAndParams.loc6(constants.%X)> [concrete = constants.%GenericAndParams.type.332] // CHECK:STDOUT: } -// CHECK:STDOUT: %GenericAndParams.impl_witness_table.loc16 = impl_witness_table (), @X.as.GenericAndParams.impl.26f [concrete] -// CHECK:STDOUT: %GenericAndParams.impl_witness.loc16: = impl_witness %GenericAndParams.impl_witness_table.loc16 [concrete = constants.%GenericAndParams.impl_witness.ba4] // CHECK:STDOUT: impl_decl @X.as.GenericNoParams.impl [concrete] {} { // CHECK:STDOUT: %X.ref.loc17_6: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] @@ -170,8 +164,6 @@ interface Bar[T:! type] {} // CHECK:STDOUT: %.loc17: type = specific_constant @C.%GenericNoParams.decl, @C(constants.%X) [concrete = constants.%GenericNoParams.type.156] // CHECK:STDOUT: %GenericNoParams.ref: type = name_ref GenericNoParams, %.loc17 [concrete = constants.%GenericNoParams.type.156] // CHECK:STDOUT: } -// CHECK:STDOUT: %GenericNoParams.impl_witness_table = impl_witness_table (), @X.as.GenericNoParams.impl [concrete] -// CHECK:STDOUT: %GenericNoParams.impl_witness: = impl_witness %GenericNoParams.impl_witness_table [concrete = constants.%GenericNoParams.impl_witness] // CHECK:STDOUT: impl_decl @X.as.GenericAndParams.impl.b51 [concrete] {} { // CHECK:STDOUT: %X.ref.loc18_6: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] @@ -182,8 +174,6 @@ interface Bar[T:! type] {} // CHECK:STDOUT: %X.ref.loc18_33: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %GenericAndParams.type: type = facet_type <@GenericAndParams.loc10, @GenericAndParams.loc10(constants.%X, constants.%X)> [concrete = constants.%GenericAndParams.type.90e] // CHECK:STDOUT: } -// CHECK:STDOUT: %GenericAndParams.impl_witness_table.loc18 = impl_witness_table (), @X.as.GenericAndParams.impl.b51 [concrete] -// CHECK:STDOUT: %GenericAndParams.impl_witness.loc18: = impl_witness %GenericAndParams.impl_witness_table.loc18 [concrete = constants.%GenericAndParams.impl_witness.d80] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @NotGenericNoParams { @@ -261,28 +251,43 @@ interface Bar[T:! type] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @X.as.NotGenericNoParams.impl: %X.ref as %NotGenericNoParams.ref { +// CHECK:STDOUT: %NotGenericNoParams.impl_witness_table = impl_witness_table (), @X.as.NotGenericNoParams.impl [concrete] +// CHECK:STDOUT: %NotGenericNoParams.impl_witness: = impl_witness %NotGenericNoParams.impl_witness_table [concrete = constants.%NotGenericNoParams.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%NotGenericNoParams.impl_witness +// CHECK:STDOUT: witness = %NotGenericNoParams.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @X.as.NotGenericButParams.impl: %X.ref as %NotGenericButParams.type { +// CHECK:STDOUT: %NotGenericButParams.impl_witness_table = impl_witness_table (), @X.as.NotGenericButParams.impl [concrete] +// CHECK:STDOUT: %NotGenericButParams.impl_witness: = impl_witness %NotGenericButParams.impl_witness_table [concrete = constants.%NotGenericButParams.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%NotGenericButParams.impl_witness +// CHECK:STDOUT: witness = %NotGenericButParams.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @X.as.GenericAndParams.impl.26f: %X.ref.loc16_6 as %GenericAndParams.type { +// CHECK:STDOUT: %GenericAndParams.impl_witness_table = impl_witness_table (), @X.as.GenericAndParams.impl.26f [concrete] +// CHECK:STDOUT: %GenericAndParams.impl_witness: = impl_witness %GenericAndParams.impl_witness_table [concrete = constants.%GenericAndParams.impl_witness.ba4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%GenericAndParams.impl_witness.loc16 +// CHECK:STDOUT: witness = %GenericAndParams.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @X.as.GenericNoParams.impl: %X.ref.loc17_6 as %GenericNoParams.ref { +// CHECK:STDOUT: %GenericNoParams.impl_witness_table = impl_witness_table (), @X.as.GenericNoParams.impl [concrete] +// CHECK:STDOUT: %GenericNoParams.impl_witness: = impl_witness %GenericNoParams.impl_witness_table [concrete = constants.%GenericNoParams.impl_witness] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%GenericNoParams.impl_witness +// CHECK:STDOUT: witness = %GenericNoParams.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @X.as.GenericAndParams.impl.b51: %X.ref.loc18_6 as %GenericAndParams.type { +// CHECK:STDOUT: %GenericAndParams.impl_witness_table = impl_witness_table (), @X.as.GenericAndParams.impl.b51 [concrete] +// CHECK:STDOUT: %GenericAndParams.impl_witness: = impl_witness %GenericAndParams.impl_witness_table [concrete = constants.%GenericAndParams.impl_witness.d80] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%GenericAndParams.impl_witness.loc18 +// CHECK:STDOUT: witness = %GenericAndParams.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%T.loc8_9.2: type) { diff --git a/toolchain/check/testdata/interface/local.carbon b/toolchain/check/testdata/interface/local.carbon index a6b7dc7d328aa..1bb02ec9125e7 100644 --- a/toolchain/check/testdata/interface/local.carbon +++ b/toolchain/check/testdata/interface/local.carbon @@ -37,7 +37,7 @@ fn F() { // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%I.G.decl [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness @F.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness @empty_tuple.type.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %empty_tuple.type.as.I.impl.G.type: type = fn_type @empty_tuple.type.as.I.impl.G [concrete] // CHECK:STDOUT: %empty_tuple.type.as.I.impl.G: %empty_tuple.type.as.I.impl.G.type = struct_value () [concrete] @@ -86,10 +86,12 @@ fn F() { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.I.impl.%.loc19_9.2 [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%empty_tuple.type.as.I.impl.G.decl), @empty_tuple.type.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .G = %empty_tuple.type.as.I.impl.G.decl -// CHECK:STDOUT: witness = @F.%I.impl_witness +// CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -100,8 +102,6 @@ fn F() { // CHECK:STDOUT: %.loc19_9.2: type = converted %.loc19_9.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %I.ref: type = name_ref I, @F.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.G.decl), @empty_tuple.type.as.I.impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] // CHECK:STDOUT: %.loc22_4.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [concrete = constants.%I.type] // CHECK:STDOUT: %G.ref: %I.assoc_type = name_ref G, @I.%assoc0 [concrete = constants.%assoc0] diff --git a/toolchain/check/testdata/let/compile_time_bindings.carbon b/toolchain/check/testdata/let/compile_time_bindings.carbon index 9df3cda285a71..afac7deaf9a0a 100644 --- a/toolchain/check/testdata/let/compile_time_bindings.carbon +++ b/toolchain/check/testdata/let/compile_time_bindings.carbon @@ -696,7 +696,7 @@ impl i32 as Empty { // 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: %Empty.impl_witness: = impl_witness file.%Empty.impl_witness_table [concrete] +// CHECK:STDOUT: %Empty.impl_witness: = impl_witness @i32.as.Empty.impl.%Empty.impl_witness_table [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] @@ -744,8 +744,6 @@ impl i32 as Empty { // CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [concrete = constants.%Empty.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Empty.impl_witness_table = impl_witness_table (), @i32.as.Empty.impl [concrete] -// CHECK:STDOUT: %Empty.impl_witness: = impl_witness %Empty.impl_witness_table [concrete = constants.%Empty.impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Empty { @@ -776,9 +774,11 @@ impl i32 as Empty { // CHECK:STDOUT: %.loc11_20.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc11_20.2: %i32 = converted %int_0, %.loc11_20.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %Zero: %i32 = value_binding Zero, %.loc11_20.2 +// CHECK:STDOUT: %Empty.impl_witness_table = impl_witness_table (), @i32.as.Empty.impl [concrete] +// CHECK:STDOUT: %Empty.impl_witness: = impl_witness %Empty.impl_witness_table [concrete = constants.%Empty.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Zero = %Zero -// CHECK:STDOUT: witness = file.%Empty.impl_witness +// CHECK:STDOUT: witness = %Empty.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/add.carbon b/toolchain/check/testdata/operators/overloaded/add.carbon index 104e4d911b68f..4bec1c868f429 100644 --- a/toolchain/check/testdata/operators/overloaded/add.carbon +++ b/toolchain/check/testdata/operators/overloaded/add.carbon @@ -46,12 +46,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %AddWith.type.9d3: type = facet_type <@AddWith, @AddWith(%C)> [concrete] // CHECK:STDOUT: %AddWith.Op.type.4ab: type = fn_type @AddWith.Op, @AddWith(%C) [concrete] -// CHECK:STDOUT: %AddWith.impl_witness: = impl_witness file.%AddWith.impl_witness_table [concrete] +// CHECK:STDOUT: %AddWith.impl_witness: = impl_witness @C.as.AddWith.impl.%AddWith.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.AddWith.impl.Op.type: type = fn_type @C.as.AddWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.AddWith.impl.Op: %C.as.AddWith.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %AddWith.facet: %AddWith.type.9d3 = facet_value %C, (%AddWith.impl_witness) [concrete] // CHECK:STDOUT: %AddAssignWith.type.dbd: type = facet_type <@AddAssignWith, @AddAssignWith(%C)> [concrete] -// CHECK:STDOUT: %AddAssignWith.impl_witness: = impl_witness file.%AddAssignWith.impl_witness_table [concrete] +// CHECK:STDOUT: %AddAssignWith.impl_witness: = impl_witness @C.as.AddAssignWith.impl.%AddAssignWith.impl_witness_table [concrete] // CHECK:STDOUT: %AddAssignWith.Op.type.98e: type = fn_type @AddAssignWith.Op, @AddAssignWith(%C) [concrete] // CHECK:STDOUT: %C.as.AddAssignWith.impl.Op.type: type = fn_type @C.as.AddAssignWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.AddAssignWith.impl.Op: %C.as.AddAssignWith.impl.Op.type = struct_value () [concrete] diff --git a/toolchain/check/testdata/operators/overloaded/bit_and.carbon b/toolchain/check/testdata/operators/overloaded/bit_and.carbon index d39ad2f223c48..aa8f83f17eeaf 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_and.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_and.carbon @@ -46,12 +46,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %BitAndWith.type.bb8: type = facet_type <@BitAndWith, @BitAndWith(%C)> [concrete] // CHECK:STDOUT: %BitAndWith.Op.type.76e: type = fn_type @BitAndWith.Op, @BitAndWith(%C) [concrete] -// CHECK:STDOUT: %BitAndWith.impl_witness: = impl_witness file.%BitAndWith.impl_witness_table [concrete] +// CHECK:STDOUT: %BitAndWith.impl_witness: = impl_witness @C.as.BitAndWith.impl.%BitAndWith.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.BitAndWith.impl.Op.type: type = fn_type @C.as.BitAndWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.BitAndWith.impl.Op: %C.as.BitAndWith.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %BitAndWith.facet: %BitAndWith.type.bb8 = facet_value %C, (%BitAndWith.impl_witness) [concrete] // CHECK:STDOUT: %BitAndAssignWith.type.93f: type = facet_type <@BitAndAssignWith, @BitAndAssignWith(%C)> [concrete] -// CHECK:STDOUT: %BitAndAssignWith.impl_witness: = impl_witness file.%BitAndAssignWith.impl_witness_table [concrete] +// CHECK:STDOUT: %BitAndAssignWith.impl_witness: = impl_witness @C.as.BitAndAssignWith.impl.%BitAndAssignWith.impl_witness_table [concrete] // CHECK:STDOUT: %BitAndAssignWith.Op.type.72c: type = fn_type @BitAndAssignWith.Op, @BitAndAssignWith(%C) [concrete] // CHECK:STDOUT: %C.as.BitAndAssignWith.impl.Op.type: type = fn_type @C.as.BitAndAssignWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.BitAndAssignWith.impl.Op: %C.as.BitAndAssignWith.impl.Op.type = struct_value () [concrete] diff --git a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon index de230743fee64..6b54da7c57f93 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon @@ -36,7 +36,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %BitComplement.type: type = facet_type <@BitComplement> [concrete] // CHECK:STDOUT: %BitComplement.Op.type: type = fn_type @BitComplement.Op [concrete] -// CHECK:STDOUT: %BitComplement.impl_witness: = impl_witness file.%BitComplement.impl_witness_table [concrete] +// CHECK:STDOUT: %BitComplement.impl_witness: = impl_witness @C.as.BitComplement.impl.%BitComplement.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.BitComplement.impl.Op.type: type = fn_type @C.as.BitComplement.impl.Op [concrete] // CHECK:STDOUT: %C.as.BitComplement.impl.Op: %C.as.BitComplement.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %BitComplement.facet: %BitComplement.type = facet_value %C, (%BitComplement.impl_witness) [concrete] diff --git a/toolchain/check/testdata/operators/overloaded/bit_or.carbon b/toolchain/check/testdata/operators/overloaded/bit_or.carbon index bc09f430e9669..799e6ab112a07 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_or.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_or.carbon @@ -46,12 +46,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %BitOrWith.type.6db: type = facet_type <@BitOrWith, @BitOrWith(%C)> [concrete] // CHECK:STDOUT: %BitOrWith.Op.type.3c8: type = fn_type @BitOrWith.Op, @BitOrWith(%C) [concrete] -// CHECK:STDOUT: %BitOrWith.impl_witness: = impl_witness file.%BitOrWith.impl_witness_table [concrete] +// CHECK:STDOUT: %BitOrWith.impl_witness: = impl_witness @C.as.BitOrWith.impl.%BitOrWith.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.BitOrWith.impl.Op.type: type = fn_type @C.as.BitOrWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.BitOrWith.impl.Op: %C.as.BitOrWith.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %BitOrWith.facet: %BitOrWith.type.6db = facet_value %C, (%BitOrWith.impl_witness) [concrete] // CHECK:STDOUT: %BitOrAssignWith.type.6d3: type = facet_type <@BitOrAssignWith, @BitOrAssignWith(%C)> [concrete] -// CHECK:STDOUT: %BitOrAssignWith.impl_witness: = impl_witness file.%BitOrAssignWith.impl_witness_table [concrete] +// CHECK:STDOUT: %BitOrAssignWith.impl_witness: = impl_witness @C.as.BitOrAssignWith.impl.%BitOrAssignWith.impl_witness_table [concrete] // CHECK:STDOUT: %BitOrAssignWith.Op.type.9b9: type = fn_type @BitOrAssignWith.Op, @BitOrAssignWith(%C) [concrete] // CHECK:STDOUT: %C.as.BitOrAssignWith.impl.Op.type: type = fn_type @C.as.BitOrAssignWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.BitOrAssignWith.impl.Op: %C.as.BitOrAssignWith.impl.Op.type = struct_value () [concrete] diff --git a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon index 905149ec649f5..0ce33dfb41428 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon @@ -46,12 +46,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %BitXorWith.type.da0: type = facet_type <@BitXorWith, @BitXorWith(%C)> [concrete] // CHECK:STDOUT: %BitXorWith.Op.type.c3b: type = fn_type @BitXorWith.Op, @BitXorWith(%C) [concrete] -// CHECK:STDOUT: %BitXorWith.impl_witness: = impl_witness file.%BitXorWith.impl_witness_table [concrete] +// CHECK:STDOUT: %BitXorWith.impl_witness: = impl_witness @C.as.BitXorWith.impl.%BitXorWith.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.BitXorWith.impl.Op.type: type = fn_type @C.as.BitXorWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.BitXorWith.impl.Op: %C.as.BitXorWith.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %BitXorWith.facet: %BitXorWith.type.da0 = facet_value %C, (%BitXorWith.impl_witness) [concrete] // CHECK:STDOUT: %BitXorAssignWith.type.123: type = facet_type <@BitXorAssignWith, @BitXorAssignWith(%C)> [concrete] -// CHECK:STDOUT: %BitXorAssignWith.impl_witness: = impl_witness file.%BitXorAssignWith.impl_witness_table [concrete] +// CHECK:STDOUT: %BitXorAssignWith.impl_witness: = impl_witness @C.as.BitXorAssignWith.impl.%BitXorAssignWith.impl_witness_table [concrete] // CHECK:STDOUT: %BitXorAssignWith.Op.type.803: type = fn_type @BitXorAssignWith.Op, @BitXorAssignWith(%C) [concrete] // CHECK:STDOUT: %C.as.BitXorAssignWith.impl.Op.type: type = fn_type @C.as.BitXorAssignWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.BitXorAssignWith.impl.Op: %C.as.BitXorAssignWith.impl.Op.type = struct_value () [concrete] diff --git a/toolchain/check/testdata/operators/overloaded/dec.carbon b/toolchain/check/testdata/operators/overloaded/dec.carbon index 197e58a3d23fd..e5095c6dc7bed 100644 --- a/toolchain/check/testdata/operators/overloaded/dec.carbon +++ b/toolchain/check/testdata/operators/overloaded/dec.carbon @@ -35,7 +35,7 @@ fn TestOp() { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Dec.type: type = facet_type <@Dec> [concrete] -// CHECK:STDOUT: %Dec.impl_witness: = impl_witness file.%Dec.impl_witness_table [concrete] +// CHECK:STDOUT: %Dec.impl_witness: = impl_witness @C.as.Dec.impl.%Dec.impl_witness_table [concrete] // CHECK:STDOUT: %Dec.Op.type: type = fn_type @Dec.Op [concrete] // CHECK:STDOUT: %C.as.Dec.impl.Op.type: type = fn_type @C.as.Dec.impl.Op [concrete] // CHECK:STDOUT: %C.as.Dec.impl.Op: %C.as.Dec.impl.Op.type = struct_value () [concrete] diff --git a/toolchain/check/testdata/operators/overloaded/div.carbon b/toolchain/check/testdata/operators/overloaded/div.carbon index b84ce416542d1..8573695713148 100644 --- a/toolchain/check/testdata/operators/overloaded/div.carbon +++ b/toolchain/check/testdata/operators/overloaded/div.carbon @@ -46,12 +46,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %DivWith.type.79c: type = facet_type <@DivWith, @DivWith(%C)> [concrete] // CHECK:STDOUT: %DivWith.Op.type.11b: type = fn_type @DivWith.Op, @DivWith(%C) [concrete] -// CHECK:STDOUT: %DivWith.impl_witness: = impl_witness file.%DivWith.impl_witness_table [concrete] +// CHECK:STDOUT: %DivWith.impl_witness: = impl_witness @C.as.DivWith.impl.%DivWith.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.DivWith.impl.Op.type: type = fn_type @C.as.DivWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.DivWith.impl.Op: %C.as.DivWith.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %DivWith.facet: %DivWith.type.79c = facet_value %C, (%DivWith.impl_witness) [concrete] // CHECK:STDOUT: %DivAssignWith.type.c3e: type = facet_type <@DivAssignWith, @DivAssignWith(%C)> [concrete] -// CHECK:STDOUT: %DivAssignWith.impl_witness: = impl_witness file.%DivAssignWith.impl_witness_table [concrete] +// CHECK:STDOUT: %DivAssignWith.impl_witness: = impl_witness @C.as.DivAssignWith.impl.%DivAssignWith.impl_witness_table [concrete] // CHECK:STDOUT: %DivAssignWith.Op.type.c42: type = fn_type @DivAssignWith.Op, @DivAssignWith(%C) [concrete] // CHECK:STDOUT: %C.as.DivAssignWith.impl.Op.type: type = fn_type @C.as.DivAssignWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.DivAssignWith.impl.Op: %C.as.DivAssignWith.impl.Op.type = struct_value () [concrete] diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index dd7ecc9462aad..f613effa639f2 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -91,7 +91,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %EqWith.generic: %EqWith.type.c2e = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %EqWith.type.6f2: type = facet_type <@EqWith, @EqWith(%C)> [concrete] -// CHECK:STDOUT: %EqWith.impl_witness: = impl_witness file.%EqWith.impl_witness_table [concrete] +// CHECK:STDOUT: %EqWith.impl_witness: = impl_witness @C.as.EqWith.impl.%EqWith.impl_witness_table [concrete] // CHECK:STDOUT: %EqWith.Equal.type.ab8: type = fn_type @EqWith.Equal, @EqWith(%C) [concrete] // CHECK:STDOUT: %EqWith.NotEqual.type.d5e: type = fn_type @EqWith.NotEqual, @EqWith(%C) [concrete] // CHECK:STDOUT: %pattern_type.476: type = pattern_type %C [concrete] @@ -137,8 +137,6 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %C.ref.loc6_23: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %EqWith.type: type = facet_type <@EqWith, @EqWith(constants.%C)> [concrete = constants.%EqWith.type.6f2] // CHECK:STDOUT: } -// CHECK:STDOUT: %EqWith.impl_witness_table = impl_witness_table (@C.as.EqWith.impl.%C.as.EqWith.impl.Equal.decl, @C.as.EqWith.impl.%C.as.EqWith.impl.NotEqual.decl), @C.as.EqWith.impl [concrete] -// CHECK:STDOUT: %EqWith.impl_witness: = impl_witness %EqWith.impl_witness_table [concrete = constants.%EqWith.impl_witness] // CHECK:STDOUT: %TestEqual.decl: %TestEqual.type = fn_decl @TestEqual [concrete = constants.%TestEqual] { // CHECK:STDOUT: %a.patt: %pattern_type.476 = value_binding_pattern a [concrete] // CHECK:STDOUT: %a.param_patt: %pattern_type.476 = value_param_pattern %a.patt, call_param0 [concrete] @@ -222,12 +220,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %EqWith.impl_witness_table = impl_witness_table (%C.as.EqWith.impl.Equal.decl, %C.as.EqWith.impl.NotEqual.decl), @C.as.EqWith.impl [concrete] +// CHECK:STDOUT: %EqWith.impl_witness: = impl_witness %EqWith.impl_witness_table [concrete = constants.%EqWith.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = // CHECK:STDOUT: .Equal = %C.as.EqWith.impl.Equal.decl // CHECK:STDOUT: .NotEqual = %C.as.EqWith.impl.NotEqual.decl -// CHECK:STDOUT: witness = file.%EqWith.impl_witness +// CHECK:STDOUT: witness = %EqWith.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -375,7 +375,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %EqWith.generic: %EqWith.type.c2e = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %EqWith.type.8a7: type = facet_type <@EqWith, @EqWith(%C)> [concrete] -// CHECK:STDOUT: %EqWith.impl_witness: = impl_witness file.%EqWith.impl_witness_table [concrete] +// CHECK:STDOUT: %EqWith.impl_witness: = impl_witness @C.as.EqWith.impl.%EqWith.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.224: type = pattern_type %C [concrete] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] @@ -419,8 +419,6 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %C.ref.loc7_23: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %EqWith.type: type = facet_type <@EqWith, @EqWith(constants.%C)> [concrete = constants.%EqWith.type.8a7] // CHECK:STDOUT: } -// CHECK:STDOUT: %EqWith.impl_witness_table = impl_witness_table (@C.as.EqWith.impl.%C.as.EqWith.impl.Equal.decl, @C.as.EqWith.impl.%C.as.EqWith.impl.NotEqual.decl), @C.as.EqWith.impl [concrete] -// CHECK:STDOUT: %EqWith.impl_witness: = impl_witness %EqWith.impl_witness_table [concrete = constants.%EqWith.impl_witness] // CHECK:STDOUT: %TestRhsBad.decl: %TestRhsBad.type = fn_decl @TestRhsBad [concrete = constants.%TestRhsBad] { // CHECK:STDOUT: %a.patt: %pattern_type.224 = value_binding_pattern a [concrete] // CHECK:STDOUT: %a.param_patt: %pattern_type.224 = value_param_pattern %a.patt, call_param0 [concrete] @@ -504,12 +502,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %EqWith.impl_witness_table = impl_witness_table (%C.as.EqWith.impl.Equal.decl, %C.as.EqWith.impl.NotEqual.decl), @C.as.EqWith.impl [concrete] +// CHECK:STDOUT: %EqWith.impl_witness: = impl_witness %EqWith.impl_witness_table [concrete = constants.%EqWith.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = // CHECK:STDOUT: .Equal = %C.as.EqWith.impl.Equal.decl // CHECK:STDOUT: .NotEqual = %C.as.EqWith.impl.NotEqual.decl -// CHECK:STDOUT: witness = file.%EqWith.impl_witness +// CHECK:STDOUT: witness = %EqWith.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon index 38988f3864ff1..08ec37821c108 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -53,7 +53,7 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Inc.type: type = facet_type <@Inc> [concrete] -// CHECK:STDOUT: %Inc.impl_witness: = impl_witness file.%Inc.impl_witness_table [concrete] +// CHECK:STDOUT: %Inc.impl_witness: = impl_witness @C.as.Inc.impl.%Inc.impl_witness_table [concrete] // CHECK:STDOUT: %Inc.Op.type: type = fn_type @Inc.Op [concrete] // CHECK:STDOUT: %pattern_type.476: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.as.Inc.impl.Op.type: type = fn_type @C.as.Inc.impl.Op [concrete] @@ -62,7 +62,7 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %AddAssignWith.type.fc6: type = generic_interface_type @AddAssignWith [concrete] // CHECK:STDOUT: %AddAssignWith.generic: %AddAssignWith.type.fc6 = struct_value () [concrete] // CHECK:STDOUT: %AddAssignWith.type.dbd: type = facet_type <@AddAssignWith, @AddAssignWith(%C)> [concrete] -// CHECK:STDOUT: %AddAssignWith.impl_witness: = impl_witness file.%AddAssignWith.impl_witness_table [concrete] +// CHECK:STDOUT: %AddAssignWith.impl_witness: = impl_witness @C.as.AddAssignWith.impl.%AddAssignWith.impl_witness_table [concrete] // CHECK:STDOUT: %AddAssignWith.Op.type.98e: type = fn_type @AddAssignWith.Op, @AddAssignWith(%C) [concrete] // CHECK:STDOUT: %C.as.AddAssignWith.impl.Op.type: type = fn_type @C.as.AddAssignWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.AddAssignWith.impl.Op: %C.as.AddAssignWith.impl.Op.type = struct_value () [concrete] @@ -100,8 +100,6 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Inc.ref: type = name_ref Inc, imports.%Core.Inc [concrete = constants.%Inc.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %Inc.impl_witness_table = impl_witness_table (@C.as.Inc.impl.%C.as.Inc.impl.Op.decl), @C.as.Inc.impl [concrete] -// CHECK:STDOUT: %Inc.impl_witness: = impl_witness %Inc.impl_witness_table [concrete = constants.%Inc.impl_witness] // CHECK:STDOUT: impl_decl @C.as.AddAssignWith.impl [concrete] {} { // CHECK:STDOUT: %C.ref.loc22_6: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] @@ -109,8 +107,6 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %C.ref.loc22_30: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %AddAssignWith.type: type = facet_type <@AddAssignWith, @AddAssignWith(constants.%C)> [concrete = constants.%AddAssignWith.type.dbd] // CHECK:STDOUT: } -// CHECK:STDOUT: %AddAssignWith.impl_witness_table = impl_witness_table (@C.as.AddAssignWith.impl.%C.as.AddAssignWith.impl.Op.decl), @C.as.AddAssignWith.impl [concrete] -// CHECK:STDOUT: %AddAssignWith.impl_witness: = impl_witness %AddAssignWith.impl_witness_table [concrete = constants.%AddAssignWith.impl_witness] // CHECK:STDOUT: %TestIncNonRef.decl: %TestIncNonRef.type = fn_decl @TestIncNonRef [concrete = constants.%TestIncNonRef] { // CHECK:STDOUT: %a.patt: %pattern_type.476 = value_binding_pattern a [concrete] // CHECK:STDOUT: %a.param_patt: %pattern_type.476 = value_param_pattern %a.patt, call_param0 [concrete] @@ -143,11 +139,13 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %self: ref %C = ref_binding self, %self.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Inc.impl_witness_table = impl_witness_table (%C.as.Inc.impl.Op.decl), @C.as.Inc.impl [concrete] +// CHECK:STDOUT: %Inc.impl_witness: = impl_witness %Inc.impl_witness_table [concrete = constants.%Inc.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = // CHECK:STDOUT: .Op = %C.as.Inc.impl.Op.decl -// CHECK:STDOUT: witness = file.%Inc.impl_witness +// CHECK:STDOUT: witness = %Inc.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.AddAssignWith.impl: %C.ref.loc22_6 as %AddAssignWith.type { @@ -164,11 +162,13 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %C.ref.loc23_29: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %other: %C = value_binding other, %other.param // CHECK:STDOUT: } +// CHECK:STDOUT: %AddAssignWith.impl_witness_table = impl_witness_table (%C.as.AddAssignWith.impl.Op.decl), @C.as.AddAssignWith.impl [concrete] +// CHECK:STDOUT: %AddAssignWith.impl_witness: = impl_witness %AddAssignWith.impl_witness_table [concrete = constants.%AddAssignWith.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = // CHECK:STDOUT: .Op = %C.as.AddAssignWith.impl.Op.decl -// CHECK:STDOUT: witness = file.%AddAssignWith.impl_witness +// CHECK:STDOUT: witness = %AddAssignWith.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon index db3df5b5fc9be..f13183fafbd33 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -54,7 +54,7 @@ fn Test() { // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %ImplicitAs.type.37a: type = facet_type <@ImplicitAs, @ImplicitAs(%X)> [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.960: = impl_witness file.%ImplicitAs.impl_witness_table.loc19 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.960: = impl_witness @i32.as.ImplicitAs.impl.%ImplicitAs.impl_witness_table [concrete] // CHECK:STDOUT: %ImplicitAs.Convert.type.9f8: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%X) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %pattern_type.05f: type = pattern_type %X [concrete] @@ -73,7 +73,7 @@ fn Test() { // CHECK:STDOUT: %.958: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.c85, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.7b3: = impl_witness file.%ImplicitAs.impl_witness_table.loc23 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.7b3: = impl_witness @X.as.ImplicitAs.impl.%ImplicitAs.impl_witness_table [concrete] // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete] // CHECK:STDOUT: %X.as.ImplicitAs.impl.Convert.type: type = fn_type @X.as.ImplicitAs.impl.Convert [concrete] // CHECK:STDOUT: %X.as.ImplicitAs.impl.Convert: %X.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] @@ -139,8 +139,6 @@ fn Test() { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%X)> [concrete = constants.%ImplicitAs.type.37a] // CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.loc19 = impl_witness_table (@i32.as.ImplicitAs.impl.%i32.as.ImplicitAs.impl.Convert.decl), @i32.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.loc19: = impl_witness %ImplicitAs.impl_witness_table.loc19 [concrete = constants.%ImplicitAs.impl_witness.960] // CHECK:STDOUT: impl_decl @X.as.ImplicitAs.impl [concrete] {} { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] @@ -149,8 +147,6 @@ fn Test() { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32)> [concrete = constants.%ImplicitAs.type.d14] // CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.loc23 = impl_witness_table (@X.as.ImplicitAs.impl.%X.as.ImplicitAs.impl.Convert.decl), @X.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.loc23: = impl_witness %ImplicitAs.impl_witness_table.loc23 [concrete = constants.%ImplicitAs.impl_witness.7b3] // CHECK:STDOUT: %Sink_i32.decl: %Sink_i32.type = fn_decl @Sink_i32 [concrete = constants.%Sink_i32] { // CHECK:STDOUT: %n.patt: %pattern_type.7ce = value_binding_pattern n [concrete] // CHECK:STDOUT: %n.param_patt: %pattern_type.7ce = value_param_pattern %n.patt, call_param0 [concrete] @@ -201,11 +197,13 @@ fn Test() { // CHECK:STDOUT: %return.param: ref %X = out_param call_param1 // CHECK:STDOUT: %return: ref %X = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%i32.as.ImplicitAs.impl.Convert.decl), @i32.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness.960] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .X = // CHECK:STDOUT: .Convert = %i32.as.ImplicitAs.impl.Convert.decl -// CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness.loc19 +// CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @X.as.ImplicitAs.impl: %X.ref as %ImplicitAs.type { @@ -223,11 +221,13 @@ fn Test() { // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%X.as.ImplicitAs.impl.Convert.decl), @X.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness.7b3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .X = // CHECK:STDOUT: .Convert = %X.as.ImplicitAs.impl.Convert.decl -// CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness.loc23 +// CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { diff --git a/toolchain/check/testdata/operators/overloaded/inc.carbon b/toolchain/check/testdata/operators/overloaded/inc.carbon index 83d2a6ad6a2cf..5e8a1646ce30d 100644 --- a/toolchain/check/testdata/operators/overloaded/inc.carbon +++ b/toolchain/check/testdata/operators/overloaded/inc.carbon @@ -35,7 +35,7 @@ fn TestOp() { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Inc.type: type = facet_type <@Inc> [concrete] -// CHECK:STDOUT: %Inc.impl_witness: = impl_witness file.%Inc.impl_witness_table [concrete] +// CHECK:STDOUT: %Inc.impl_witness: = impl_witness @C.as.Inc.impl.%Inc.impl_witness_table [concrete] // CHECK:STDOUT: %Inc.Op.type: type = fn_type @Inc.Op [concrete] // CHECK:STDOUT: %C.as.Inc.impl.Op.type: type = fn_type @C.as.Inc.impl.Op [concrete] // CHECK:STDOUT: %C.as.Inc.impl.Op: %C.as.Inc.impl.Op.type = struct_value () [concrete] diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index a6434e977c667..71a3fd761c808 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -317,7 +317,7 @@ fn F() { // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %SubscriptType [symbolic] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %IndexWith.type.5ee: type = facet_type <@IndexWith, @IndexWith(%empty_tuple.type, %empty_tuple.type)> [concrete] -// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness file.%IndexWith.impl_witness_table [concrete] +// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness @C.as.IndexWith.impl.%IndexWith.impl_witness_table [concrete] // CHECK:STDOUT: %Self.a75: %IndexWith.type.5ee = symbolic_binding Self, 2 [symbolic] // CHECK:STDOUT: %IndexWith.At.type.1a9: type = fn_type @IndexWith.At, @IndexWith(%empty_tuple.type, %empty_tuple.type) [concrete] // CHECK:STDOUT: %IndexWith.At.721: %IndexWith.At.type.1a9 = struct_value () [concrete] @@ -379,8 +379,6 @@ fn F() { // CHECK:STDOUT: %.loc8_32.2: type = converted %.loc8_31, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%empty_tuple.type, constants.%empty_tuple.type)> [concrete = constants.%IndexWith.type.5ee] // CHECK:STDOUT: } -// CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (@C.as.IndexWith.impl.%C.as.IndexWith.impl.At.decl), @C.as.IndexWith.impl [concrete] -// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -429,10 +427,12 @@ fn F() { // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param2 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (%C.as.IndexWith.impl.At.decl), @C.as.IndexWith.impl [concrete] +// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .At = %C.as.IndexWith.impl.At.decl -// CHECK:STDOUT: witness = file.%IndexWith.impl_witness +// CHECK:STDOUT: witness = %IndexWith.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon b/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon index f10707e185076..624886bc2593b 100644 --- a/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon +++ b/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon @@ -104,7 +104,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %IndexWith.lookup_impl_witness.16d: = lookup_impl_witness %.Self, @IndexWith, @IndexWith(%SubscriptType.9ec) [symbolic_self] // CHECK:STDOUT: %impl.elem0.2a7: type = impl_witness_access %IndexWith.lookup_impl_witness.16d, element0 [symbolic_self] // CHECK:STDOUT: %IndexWith_where.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType.9ec) where %impl.elem0.2a7 = %ElementType> [concrete] -// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness file.%IndexWith.impl_witness_table [concrete] +// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness @C.as.IndexWith.impl.%IndexWith.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete] // CHECK:STDOUT: %pattern_type.541: type = pattern_type %SubscriptType.9ec [concrete] // CHECK:STDOUT: %pattern_type.fde: type = pattern_type %ElementType [concrete] @@ -164,9 +164,6 @@ let x: i32 = c[0]; // CHECK:STDOUT: requirement_rewrite %impl.elem0, %ElementType.ref.loc8_62 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @C.as.IndexWith.impl.%C.as.IndexWith.impl.At.decl), @C.as.IndexWith.impl [concrete] -// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%ElementType [concrete = constants.%ElementType] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %s.patt: %pattern_type.541 = value_binding_pattern s [concrete] // CHECK:STDOUT: } @@ -215,12 +212,15 @@ let x: i32 = c[0]; // CHECK:STDOUT: %return.param: ref %ElementType = out_param call_param2 // CHECK:STDOUT: %return: ref %ElementType = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %C.as.IndexWith.impl.At.decl), @C.as.IndexWith.impl [concrete] +// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%ElementType [concrete = constants.%ElementType] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .SubscriptType = // CHECK:STDOUT: .ElementType = // CHECK:STDOUT: .At = %C.as.IndexWith.impl.At.decl -// CHECK:STDOUT: witness = file.%IndexWith.impl_witness +// CHECK:STDOUT: witness = %IndexWith.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -294,7 +294,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %IndexWith.lookup_impl_witness.e03: = lookup_impl_witness %.Self, @IndexWith, @IndexWith(Core.IntLiteral) [symbolic_self] // CHECK:STDOUT: %impl.elem0.f03: type = impl_witness_access %IndexWith.lookup_impl_witness.e03, element0 [symbolic_self] // CHECK:STDOUT: %IndexWith_where.type: type = facet_type <@IndexWith, @IndexWith(Core.IntLiteral) where %impl.elem0.f03 = %C> [concrete] -// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness file.%IndexWith.impl_witness_table [concrete] +// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness @tuple.type.as.IndexWith.impl.%IndexWith.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.c3b: type = pattern_type %tuple.type.d23 [concrete] // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete] @@ -357,9 +357,6 @@ let x: i32 = c[0]; // CHECK:STDOUT: requirement_rewrite %impl.elem0, %C.ref.loc8_71 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @tuple.type.as.IndexWith.impl.%tuple.type.as.IndexWith.impl.At.decl), @tuple.type.as.IndexWith.impl [concrete] -// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C [concrete = constants.%C] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %s.patt: %pattern_type.c3b = value_binding_pattern s [concrete] // CHECK:STDOUT: } @@ -410,11 +407,14 @@ let x: i32 = c[0]; // CHECK:STDOUT: %return.param: ref %C = out_param call_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %tuple.type.as.IndexWith.impl.At.decl), @tuple.type.as.IndexWith.impl [concrete] +// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C [concrete = constants.%C] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = // CHECK:STDOUT: .At = %tuple.type.as.IndexWith.impl.At.decl -// CHECK:STDOUT: witness = file.%IndexWith.impl_witness +// CHECK:STDOUT: witness = %IndexWith.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -483,7 +483,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %IndexWith.lookup_impl_witness.16d: = lookup_impl_witness %.Self, @IndexWith, @IndexWith(%SubscriptType.9ec) [symbolic_self] // CHECK:STDOUT: %impl.elem0.2a7: type = impl_witness_access %IndexWith.lookup_impl_witness.16d, element0 [symbolic_self] // CHECK:STDOUT: %IndexWith_where.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType.9ec) where %impl.elem0.2a7 = %ElementType> [concrete] -// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness file.%IndexWith.impl_witness_table [concrete] +// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness @C.as.IndexWith.impl.%IndexWith.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete] // CHECK:STDOUT: %pattern_type.541: type = pattern_type %SubscriptType.9ec [concrete] // CHECK:STDOUT: %pattern_type.fde: type = pattern_type %ElementType [concrete] @@ -540,9 +540,6 @@ let x: i32 = c[0]; // CHECK:STDOUT: requirement_rewrite %impl.elem0, %ElementType.ref.loc8_62 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @C.as.IndexWith.impl.%C.as.IndexWith.impl.At.decl), @C.as.IndexWith.impl [concrete] -// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%ElementType [concrete = constants.%ElementType] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c.patt: %pattern_type.7c7 = value_binding_pattern c [concrete] // CHECK:STDOUT: } @@ -579,12 +576,15 @@ let x: i32 = c[0]; // CHECK:STDOUT: %return.param: ref %ElementType = out_param call_param2 // CHECK:STDOUT: %return: ref %ElementType = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %C.as.IndexWith.impl.At.decl), @C.as.IndexWith.impl [concrete] +// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%ElementType [concrete = constants.%ElementType] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .SubscriptType = // CHECK:STDOUT: .ElementType = // CHECK:STDOUT: .At = %C.as.IndexWith.impl.At.decl -// CHECK:STDOUT: witness = file.%IndexWith.impl_witness +// CHECK:STDOUT: witness = %IndexWith.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/operators/overloaded/left_shift.carbon b/toolchain/check/testdata/operators/overloaded/left_shift.carbon index d5ffedd33d3a5..9ae35580eec45 100644 --- a/toolchain/check/testdata/operators/overloaded/left_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/left_shift.carbon @@ -46,12 +46,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %LeftShiftWith.type.2f6: type = facet_type <@LeftShiftWith, @LeftShiftWith(%C)> [concrete] // CHECK:STDOUT: %LeftShiftWith.Op.type.2b8: type = fn_type @LeftShiftWith.Op, @LeftShiftWith(%C) [concrete] -// CHECK:STDOUT: %LeftShiftWith.impl_witness: = impl_witness file.%LeftShiftWith.impl_witness_table [concrete] +// CHECK:STDOUT: %LeftShiftWith.impl_witness: = impl_witness @C.as.LeftShiftWith.impl.%LeftShiftWith.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.LeftShiftWith.impl.Op.type: type = fn_type @C.as.LeftShiftWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.LeftShiftWith.impl.Op: %C.as.LeftShiftWith.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %LeftShiftWith.facet: %LeftShiftWith.type.2f6 = facet_value %C, (%LeftShiftWith.impl_witness) [concrete] // CHECK:STDOUT: %LeftShiftAssignWith.type.2a5: type = facet_type <@LeftShiftAssignWith, @LeftShiftAssignWith(%C)> [concrete] -// CHECK:STDOUT: %LeftShiftAssignWith.impl_witness: = impl_witness file.%LeftShiftAssignWith.impl_witness_table [concrete] +// CHECK:STDOUT: %LeftShiftAssignWith.impl_witness: = impl_witness @C.as.LeftShiftAssignWith.impl.%LeftShiftAssignWith.impl_witness_table [concrete] // CHECK:STDOUT: %LeftShiftAssignWith.Op.type.057: type = fn_type @LeftShiftAssignWith.Op, @LeftShiftAssignWith(%C) [concrete] // CHECK:STDOUT: %C.as.LeftShiftAssignWith.impl.Op.type: type = fn_type @C.as.LeftShiftAssignWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.LeftShiftAssignWith.impl.Op: %C.as.LeftShiftAssignWith.impl.Op.type = struct_value () [concrete] diff --git a/toolchain/check/testdata/operators/overloaded/mod.carbon b/toolchain/check/testdata/operators/overloaded/mod.carbon index d2c559878336e..b3b90ee99c75e 100644 --- a/toolchain/check/testdata/operators/overloaded/mod.carbon +++ b/toolchain/check/testdata/operators/overloaded/mod.carbon @@ -46,12 +46,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %ModWith.type.ea5: type = facet_type <@ModWith, @ModWith(%C)> [concrete] // CHECK:STDOUT: %ModWith.Op.type.ac7: type = fn_type @ModWith.Op, @ModWith(%C) [concrete] -// CHECK:STDOUT: %ModWith.impl_witness: = impl_witness file.%ModWith.impl_witness_table [concrete] +// CHECK:STDOUT: %ModWith.impl_witness: = impl_witness @C.as.ModWith.impl.%ModWith.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.ModWith.impl.Op.type: type = fn_type @C.as.ModWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.ModWith.impl.Op: %C.as.ModWith.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %ModWith.facet: %ModWith.type.ea5 = facet_value %C, (%ModWith.impl_witness) [concrete] // CHECK:STDOUT: %ModAssignWith.type.724: type = facet_type <@ModAssignWith, @ModAssignWith(%C)> [concrete] -// CHECK:STDOUT: %ModAssignWith.impl_witness: = impl_witness file.%ModAssignWith.impl_witness_table [concrete] +// CHECK:STDOUT: %ModAssignWith.impl_witness: = impl_witness @C.as.ModAssignWith.impl.%ModAssignWith.impl_witness_table [concrete] // CHECK:STDOUT: %ModAssignWith.Op.type.b51: type = fn_type @ModAssignWith.Op, @ModAssignWith(%C) [concrete] // CHECK:STDOUT: %C.as.ModAssignWith.impl.Op.type: type = fn_type @C.as.ModAssignWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.ModAssignWith.impl.Op: %C.as.ModAssignWith.impl.Op.type = struct_value () [concrete] diff --git a/toolchain/check/testdata/operators/overloaded/mul.carbon b/toolchain/check/testdata/operators/overloaded/mul.carbon index 4d832733e27d5..97ff22bbcf3bf 100644 --- a/toolchain/check/testdata/operators/overloaded/mul.carbon +++ b/toolchain/check/testdata/operators/overloaded/mul.carbon @@ -46,12 +46,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %MulWith.type.a86: type = facet_type <@MulWith, @MulWith(%C)> [concrete] // CHECK:STDOUT: %MulWith.Op.type.0fb: type = fn_type @MulWith.Op, @MulWith(%C) [concrete] -// CHECK:STDOUT: %MulWith.impl_witness: = impl_witness file.%MulWith.impl_witness_table [concrete] +// CHECK:STDOUT: %MulWith.impl_witness: = impl_witness @C.as.MulWith.impl.%MulWith.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.MulWith.impl.Op.type: type = fn_type @C.as.MulWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.MulWith.impl.Op: %C.as.MulWith.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %MulWith.facet: %MulWith.type.a86 = facet_value %C, (%MulWith.impl_witness) [concrete] // CHECK:STDOUT: %MulAssignWith.type.150: type = facet_type <@MulAssignWith, @MulAssignWith(%C)> [concrete] -// CHECK:STDOUT: %MulAssignWith.impl_witness: = impl_witness file.%MulAssignWith.impl_witness_table [concrete] +// CHECK:STDOUT: %MulAssignWith.impl_witness: = impl_witness @C.as.MulAssignWith.impl.%MulAssignWith.impl_witness_table [concrete] // CHECK:STDOUT: %MulAssignWith.Op.type.680: type = fn_type @MulAssignWith.Op, @MulAssignWith(%C) [concrete] // CHECK:STDOUT: %C.as.MulAssignWith.impl.Op.type: type = fn_type @C.as.MulAssignWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.MulAssignWith.impl.Op: %C.as.MulAssignWith.impl.Op.type = struct_value () [concrete] diff --git a/toolchain/check/testdata/operators/overloaded/negate.carbon b/toolchain/check/testdata/operators/overloaded/negate.carbon index bf4b882e5a197..642601048e254 100644 --- a/toolchain/check/testdata/operators/overloaded/negate.carbon +++ b/toolchain/check/testdata/operators/overloaded/negate.carbon @@ -36,7 +36,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [concrete] // CHECK:STDOUT: %Negate.Op.type: type = fn_type @Negate.Op [concrete] -// CHECK:STDOUT: %Negate.impl_witness: = impl_witness file.%Negate.impl_witness_table [concrete] +// CHECK:STDOUT: %Negate.impl_witness: = impl_witness @C.as.Negate.impl.%Negate.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.Negate.impl.Op.type: type = fn_type @C.as.Negate.impl.Op [concrete] // CHECK:STDOUT: %C.as.Negate.impl.Op: %C.as.Negate.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value %C, (%Negate.impl_witness) [concrete] diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index 6e5093ea68acc..bd1680a46e50a 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -89,7 +89,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %OrderedWith.generic: %OrderedWith.type.270 = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %OrderedWith.type.069: type = facet_type <@OrderedWith, @OrderedWith(%C)> [concrete] -// CHECK:STDOUT: %OrderedWith.impl_witness: = impl_witness file.%OrderedWith.impl_witness_table [concrete] +// CHECK:STDOUT: %OrderedWith.impl_witness: = impl_witness @C.as.OrderedWith.impl.%OrderedWith.impl_witness_table [concrete] // CHECK:STDOUT: %OrderedWith.Less.type.65f: type = fn_type @OrderedWith.Less, @OrderedWith(%C) [concrete] // CHECK:STDOUT: %OrderedWith.LessOrEquivalent.type.554: type = fn_type @OrderedWith.LessOrEquivalent, @OrderedWith(%C) [concrete] // CHECK:STDOUT: %OrderedWith.Greater.type.58c: type = fn_type @OrderedWith.Greater, @OrderedWith(%C) [concrete] @@ -149,8 +149,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %C.ref.loc6_28: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %OrderedWith.type: type = facet_type <@OrderedWith, @OrderedWith(constants.%C)> [concrete = constants.%OrderedWith.type.069] // CHECK:STDOUT: } -// CHECK:STDOUT: %OrderedWith.impl_witness_table = impl_witness_table (@C.as.OrderedWith.impl.%C.as.OrderedWith.impl.Less.decl, @C.as.OrderedWith.impl.%C.as.OrderedWith.impl.LessOrEquivalent.decl, @C.as.OrderedWith.impl.%C.as.OrderedWith.impl.Greater.decl, @C.as.OrderedWith.impl.%C.as.OrderedWith.impl.GreaterOrEquivalent.decl), @C.as.OrderedWith.impl [concrete] -// CHECK:STDOUT: %OrderedWith.impl_witness: = impl_witness %OrderedWith.impl_witness_table [concrete = constants.%OrderedWith.impl_witness] // CHECK:STDOUT: %TestLess.decl: %TestLess.type = fn_decl @TestLess [concrete = constants.%TestLess] { // CHECK:STDOUT: %a.patt: %pattern_type.476 = value_binding_pattern a [concrete] // CHECK:STDOUT: %a.param_patt: %pattern_type.476 = value_param_pattern %a.patt, call_param0 [concrete] @@ -314,6 +312,8 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %OrderedWith.impl_witness_table = impl_witness_table (%C.as.OrderedWith.impl.Less.decl, %C.as.OrderedWith.impl.LessOrEquivalent.decl, %C.as.OrderedWith.impl.Greater.decl, %C.as.OrderedWith.impl.GreaterOrEquivalent.decl), @C.as.OrderedWith.impl [concrete] +// CHECK:STDOUT: %OrderedWith.impl_witness: = impl_witness %OrderedWith.impl_witness_table [concrete = constants.%OrderedWith.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = @@ -321,7 +321,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: .LessOrEquivalent = %C.as.OrderedWith.impl.LessOrEquivalent.decl // CHECK:STDOUT: .Greater = %C.as.OrderedWith.impl.Greater.decl // CHECK:STDOUT: .GreaterOrEquivalent = %C.as.OrderedWith.impl.GreaterOrEquivalent.decl -// CHECK:STDOUT: witness = file.%OrderedWith.impl_witness +// CHECK:STDOUT: witness = %OrderedWith.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/operators/overloaded/right_shift.carbon b/toolchain/check/testdata/operators/overloaded/right_shift.carbon index df87ddd5306de..9a7a0cae6c806 100644 --- a/toolchain/check/testdata/operators/overloaded/right_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/right_shift.carbon @@ -46,12 +46,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %RightShiftWith.type.e0e: type = facet_type <@RightShiftWith, @RightShiftWith(%C)> [concrete] // CHECK:STDOUT: %RightShiftWith.Op.type.5d5: type = fn_type @RightShiftWith.Op, @RightShiftWith(%C) [concrete] -// CHECK:STDOUT: %RightShiftWith.impl_witness: = impl_witness file.%RightShiftWith.impl_witness_table [concrete] +// CHECK:STDOUT: %RightShiftWith.impl_witness: = impl_witness @C.as.RightShiftWith.impl.%RightShiftWith.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.RightShiftWith.impl.Op.type: type = fn_type @C.as.RightShiftWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.RightShiftWith.impl.Op: %C.as.RightShiftWith.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %RightShiftWith.facet: %RightShiftWith.type.e0e = facet_value %C, (%RightShiftWith.impl_witness) [concrete] // CHECK:STDOUT: %RightShiftAssignWith.type.269: type = facet_type <@RightShiftAssignWith, @RightShiftAssignWith(%C)> [concrete] -// CHECK:STDOUT: %RightShiftAssignWith.impl_witness: = impl_witness file.%RightShiftAssignWith.impl_witness_table [concrete] +// CHECK:STDOUT: %RightShiftAssignWith.impl_witness: = impl_witness @C.as.RightShiftAssignWith.impl.%RightShiftAssignWith.impl_witness_table [concrete] // CHECK:STDOUT: %RightShiftAssignWith.Op.type.3f3: type = fn_type @RightShiftAssignWith.Op, @RightShiftAssignWith(%C) [concrete] // CHECK:STDOUT: %C.as.RightShiftAssignWith.impl.Op.type: type = fn_type @C.as.RightShiftAssignWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.RightShiftAssignWith.impl.Op: %C.as.RightShiftAssignWith.impl.Op.type = struct_value () [concrete] diff --git a/toolchain/check/testdata/operators/overloaded/sub.carbon b/toolchain/check/testdata/operators/overloaded/sub.carbon index 0cf985bf7ffd0..ab8d9c979563e 100644 --- a/toolchain/check/testdata/operators/overloaded/sub.carbon +++ b/toolchain/check/testdata/operators/overloaded/sub.carbon @@ -46,12 +46,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %SubWith.type.3ad: type = facet_type <@SubWith, @SubWith(%C)> [concrete] // CHECK:STDOUT: %SubWith.Op.type.0e0: type = fn_type @SubWith.Op, @SubWith(%C) [concrete] -// CHECK:STDOUT: %SubWith.impl_witness: = impl_witness file.%SubWith.impl_witness_table [concrete] +// CHECK:STDOUT: %SubWith.impl_witness: = impl_witness @C.as.SubWith.impl.%SubWith.impl_witness_table [concrete] // CHECK:STDOUT: %C.as.SubWith.impl.Op.type: type = fn_type @C.as.SubWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.SubWith.impl.Op: %C.as.SubWith.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %SubWith.facet: %SubWith.type.3ad = facet_value %C, (%SubWith.impl_witness) [concrete] // CHECK:STDOUT: %SubAssignWith.type.4e1: type = facet_type <@SubAssignWith, @SubAssignWith(%C)> [concrete] -// CHECK:STDOUT: %SubAssignWith.impl_witness: = impl_witness file.%SubAssignWith.impl_witness_table [concrete] +// CHECK:STDOUT: %SubAssignWith.impl_witness: = impl_witness @C.as.SubAssignWith.impl.%SubAssignWith.impl_witness_table [concrete] // CHECK:STDOUT: %SubAssignWith.Op.type.235: type = fn_type @SubAssignWith.Op, @SubAssignWith(%C) [concrete] // CHECK:STDOUT: %C.as.SubAssignWith.impl.Op.type: type = fn_type @C.as.SubAssignWith.impl.Op [concrete] // CHECK:STDOUT: %C.as.SubAssignWith.impl.Op: %C.as.SubAssignWith.impl.Op.type = struct_value () [concrete] diff --git a/toolchain/check/testdata/return/import_convert_function.carbon b/toolchain/check/testdata/return/import_convert_function.carbon index e6979397a038d..b1f44751930b3 100644 --- a/toolchain/check/testdata/return/import_convert_function.carbon +++ b/toolchain/check/testdata/return/import_convert_function.carbon @@ -92,7 +92,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %D.val: %D = struct_value (%int_0.6a9, %int_0.6a9) [concrete] // CHECK:STDOUT: %C.4f5: type = class_type @C, @C(%int_0.6a9) [concrete] // CHECK:STDOUT: %ImplicitAs.type.aef: type = facet_type <@ImplicitAs, @ImplicitAs(%D)> [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.046: = impl_witness file.%ImplicitAs.impl_witness_table.loc8 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.046: = impl_witness @C.as.ImplicitAs.impl.fe6.%ImplicitAs.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.2de: type = pattern_type %C.4f5 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.19e: type = fn_type @C.as.ImplicitAs.impl.Convert.loc8 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.43d: %C.as.ImplicitAs.impl.Convert.type.19e = struct_value () [concrete] @@ -101,7 +101,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %bound_method.d3a: = 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.95b: type = class_type @C, @C(%int_1.5d2) [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.659: = impl_witness file.%ImplicitAs.impl_witness_table.loc9 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.659: = impl_witness @C.as.ImplicitAs.impl.4f7.%ImplicitAs.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.4f8: type = pattern_type %C.95b [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.ddc: type = fn_type @C.as.ImplicitAs.impl.Convert.loc9 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.0fe: %C.as.ImplicitAs.impl.Convert.type.ddc = struct_value () [concrete] @@ -110,7 +110,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %bound_method.6f5: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %C.a93: type = class_type @C, @C(%int_2.ef8) [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.0ca: = impl_witness file.%ImplicitAs.impl_witness_table.loc10 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.0ca: = impl_witness @C.as.ImplicitAs.impl.a07.%ImplicitAs.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.97c: type = pattern_type %C.a93 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.611: type = fn_type @C.as.ImplicitAs.impl.Convert.loc10 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.afa: %C.as.ImplicitAs.impl.Convert.type.611 = struct_value () [concrete] @@ -119,7 +119,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %bound_method.7cb: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %C.1d7: type = class_type @C, @C(%int_3.822) [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.d91: = impl_witness file.%ImplicitAs.impl_witness_table.loc11 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.d91: = impl_witness @C.as.ImplicitAs.impl.6ac.%ImplicitAs.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.00b: type = pattern_type %C.1d7 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.763: type = fn_type @C.as.ImplicitAs.impl.Convert.loc11 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.b65: %C.as.ImplicitAs.impl.Convert.type.763 = struct_value () [concrete] @@ -128,7 +128,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %bound_method.a9f: = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %C.e40: type = class_type @C, @C(%int_4.940) [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.b10: = impl_witness file.%ImplicitAs.impl_witness_table.loc12 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.b10: = impl_witness @C.as.ImplicitAs.impl.833.%ImplicitAs.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.9d7: type = pattern_type %C.e40 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.f49: type = fn_type @C.as.ImplicitAs.impl.Convert.loc12 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.2eb: %C.as.ImplicitAs.impl.Convert.type.f49 = struct_value () [concrete] @@ -137,7 +137,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %bound_method.06d: = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete] // CHECK:STDOUT: %C.3f1: type = class_type @C, @C(%int_5.0f6) [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.6df: = impl_witness file.%ImplicitAs.impl_witness_table.loc13 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.6df: = impl_witness @C.as.ImplicitAs.impl.d89.%ImplicitAs.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.ed0: type = pattern_type %C.3f1 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.8f3: type = fn_type @C.as.ImplicitAs.impl.Convert.loc13 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.f8a: %C.as.ImplicitAs.impl.Convert.type.8f3 = struct_value () [concrete] @@ -146,7 +146,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %bound_method.280: = bound_method %int_6.462, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_6.e56: %i32 = int_value 6 [concrete] // CHECK:STDOUT: %C.0fa: type = class_type @C, @C(%int_6.e56) [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.963: = impl_witness file.%ImplicitAs.impl_witness_table.loc14 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.963: = impl_witness @C.as.ImplicitAs.impl.be1.%ImplicitAs.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.6f3: type = pattern_type %C.0fa [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.c07: type = fn_type @C.as.ImplicitAs.impl.Convert.loc14 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.40f: %C.as.ImplicitAs.impl.Convert.type.c07 = struct_value () [concrete] @@ -155,7 +155,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %bound_method.abe: = bound_method %int_7.29f, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_7.0b1: %i32 = int_value 7 [concrete] // CHECK:STDOUT: %C.2b7: type = class_type @C, @C(%int_7.0b1) [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.44a: = impl_witness file.%ImplicitAs.impl_witness_table.loc15 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.44a: = impl_witness @C.as.ImplicitAs.impl.62d.%ImplicitAs.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.aa6: type = pattern_type %C.2b7 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.8ee: type = fn_type @C.as.ImplicitAs.impl.Convert.loc15 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.0f5: %C.as.ImplicitAs.impl.Convert.type.8ee = struct_value () [concrete] @@ -217,8 +217,6 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%D)> [concrete = constants.%ImplicitAs.type.aef] // CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.loc8 = impl_witness_table (@C.as.ImplicitAs.impl.fe6.%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl.fe6 [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.loc8: = impl_witness %ImplicitAs.impl_witness_table.loc8 [concrete = constants.%ImplicitAs.impl_witness.046] // CHECK:STDOUT: impl_decl @C.as.ImplicitAs.impl.4f7 [concrete] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] @@ -235,8 +233,6 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%D)> [concrete = constants.%ImplicitAs.type.aef] // CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.loc9 = impl_witness_table (@C.as.ImplicitAs.impl.4f7.%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl.4f7 [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.loc9: = impl_witness %ImplicitAs.impl_witness_table.loc9 [concrete = constants.%ImplicitAs.impl_witness.659] // CHECK:STDOUT: impl_decl @C.as.ImplicitAs.impl.a07 [concrete] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] @@ -253,8 +249,6 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%D)> [concrete = constants.%ImplicitAs.type.aef] // CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.loc10 = impl_witness_table (@C.as.ImplicitAs.impl.a07.%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl.a07 [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.loc10: = impl_witness %ImplicitAs.impl_witness_table.loc10 [concrete = constants.%ImplicitAs.impl_witness.0ca] // CHECK:STDOUT: impl_decl @C.as.ImplicitAs.impl.6ac [concrete] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] @@ -271,8 +265,6 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%D)> [concrete = constants.%ImplicitAs.type.aef] // CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.loc11 = impl_witness_table (@C.as.ImplicitAs.impl.6ac.%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl.6ac [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.loc11: = impl_witness %ImplicitAs.impl_witness_table.loc11 [concrete = constants.%ImplicitAs.impl_witness.d91] // CHECK:STDOUT: impl_decl @C.as.ImplicitAs.impl.833 [concrete] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] @@ -289,8 +281,6 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%D)> [concrete = constants.%ImplicitAs.type.aef] // CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.loc12 = impl_witness_table (@C.as.ImplicitAs.impl.833.%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl.833 [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.loc12: = impl_witness %ImplicitAs.impl_witness_table.loc12 [concrete = constants.%ImplicitAs.impl_witness.b10] // CHECK:STDOUT: impl_decl @C.as.ImplicitAs.impl.d89 [concrete] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b] @@ -307,8 +297,6 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%D)> [concrete = constants.%ImplicitAs.type.aef] // CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.loc13 = impl_witness_table (@C.as.ImplicitAs.impl.d89.%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl.d89 [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.loc13: = impl_witness %ImplicitAs.impl_witness_table.loc13 [concrete = constants.%ImplicitAs.impl_witness.6df] // CHECK:STDOUT: impl_decl @C.as.ImplicitAs.impl.be1 [concrete] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6.462] @@ -325,8 +313,6 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%D)> [concrete = constants.%ImplicitAs.type.aef] // CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.loc14 = impl_witness_table (@C.as.ImplicitAs.impl.be1.%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl.be1 [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.loc14: = impl_witness %ImplicitAs.impl_witness_table.loc14 [concrete = constants.%ImplicitAs.impl_witness.963] // CHECK:STDOUT: impl_decl @C.as.ImplicitAs.impl.62d [concrete] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [concrete = constants.%int_7.29f] @@ -343,8 +329,6 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%D)> [concrete = constants.%ImplicitAs.type.aef] // CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.loc15 = impl_witness_table (@C.as.ImplicitAs.impl.62d.%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl.62d [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.loc15: = impl_witness %ImplicitAs.impl_witness_table.loc15 [concrete = constants.%ImplicitAs.impl_witness.44a] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.ImplicitAs.impl.fe6: %C as %ImplicitAs.type { @@ -361,12 +345,14 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param call_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl.fe6 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness.046] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .D = // CHECK:STDOUT: .Convert = %C.as.ImplicitAs.impl.Convert.decl // CHECK:STDOUT: .Make = -// CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness.loc8 +// CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.ImplicitAs.impl.4f7: %C as %ImplicitAs.type { @@ -383,12 +369,14 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param call_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl.4f7 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness.659] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .D = // CHECK:STDOUT: .Convert = %C.as.ImplicitAs.impl.Convert.decl // CHECK:STDOUT: .Make = -// CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness.loc9 +// CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.ImplicitAs.impl.a07: %C as %ImplicitAs.type { @@ -405,12 +393,14 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param call_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl.a07 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness.0ca] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .D = // CHECK:STDOUT: .Convert = %C.as.ImplicitAs.impl.Convert.decl // CHECK:STDOUT: .Make = -// CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness.loc10 +// CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.ImplicitAs.impl.6ac: %C as %ImplicitAs.type { @@ -427,12 +417,14 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param call_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl.6ac [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness.d91] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .D = // CHECK:STDOUT: .Convert = %C.as.ImplicitAs.impl.Convert.decl // CHECK:STDOUT: .Make = -// CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness.loc11 +// CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.ImplicitAs.impl.833: %C as %ImplicitAs.type { @@ -449,12 +441,14 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param call_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl.833 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness.b10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .D = // CHECK:STDOUT: .Convert = %C.as.ImplicitAs.impl.Convert.decl // CHECK:STDOUT: .Make = -// CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness.loc12 +// CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.ImplicitAs.impl.d89: %C as %ImplicitAs.type { @@ -471,12 +465,14 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param call_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl.d89 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness.6df] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .D = // CHECK:STDOUT: .Convert = %C.as.ImplicitAs.impl.Convert.decl // CHECK:STDOUT: .Make = -// CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness.loc13 +// CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.ImplicitAs.impl.be1: %C as %ImplicitAs.type { @@ -493,12 +489,14 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param call_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl.be1 [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness.963] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .D = // CHECK:STDOUT: .Convert = %C.as.ImplicitAs.impl.Convert.decl // CHECK:STDOUT: .Make = -// CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness.loc14 +// CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C.as.ImplicitAs.impl.62d: %C as %ImplicitAs.type { @@ -515,12 +513,14 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param call_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl.62d [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness.44a] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .D = // CHECK:STDOUT: .Convert = %C.as.ImplicitAs.impl.Convert.decl // CHECK:STDOUT: .Make = -// CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness.loc15 +// CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%N.loc4_9.2: %i32) { diff --git a/toolchain/sem_ir/formatter.cpp b/toolchain/sem_ir/formatter.cpp index a5043317fcfc3..45e5a6d750cb1 100644 --- a/toolchain/sem_ir/formatter.cpp +++ b/toolchain/sem_ir/formatter.cpp @@ -519,6 +519,7 @@ auto Formatter::FormatImpl(ImplId id, const Impl& impl_info) -> void { out_ << ' '; OpenBrace(); FormatCodeBlock(impl_info.body_block_id); + FormatCodeBlock(impl_info.witness_block_id); // Print the !members label even if the name scope is empty because we // always list the witness in this section. diff --git a/toolchain/sem_ir/impl.h b/toolchain/sem_ir/impl.h index 7eb2e4025943a..ffc4f80264e27 100644 --- a/toolchain/sem_ir/impl.h +++ b/toolchain/sem_ir/impl.h @@ -32,6 +32,9 @@ struct ImplFields { // reference. Note that the entries in the witness are updated at the end of // the impl definition. InstId witness_id = InstId::None; + // A block for instructions that make up the impl's witness so that they can + // be formatted as part of the impl. + InstBlockId witness_block_id = InstBlockId::None; // The following members are set at the `{` of the impl definition. diff --git a/toolchain/sem_ir/inst_namer.cpp b/toolchain/sem_ir/inst_namer.cpp index 1de4e72a9dd68..c8f852d3702a0 100644 --- a/toolchain/sem_ir/inst_namer.cpp +++ b/toolchain/sem_ir/inst_namer.cpp @@ -673,6 +673,7 @@ auto InstNamer::PushEntity(ImplId impl_id, ScopeId scope_id, Scope& scope) // Push blocks in reverse order. PushGeneric(scope_id, impl.generic_id); + PushBlockId(scope_id, impl.witness_block_id); PushBlockId(scope_id, impl.body_block_id); PushBlockId(scope_id, impl.pattern_block_id); }