Sfoglia il codice sorgente

Defer RequireCompleteType to impl definition (Refactor Impl construction 7/7) (#6470)

Explicitly run `RequireCompleteType` for an impl's facet type constraint
in two places:
- For a new `Impl` declaration that is `extend`
- At the start of the `Impl` definition

Stop trying to RequireCompleteType in the definition when constructing
the witness. If we have a rewrite of a name in `.Self`, then we can
construct a full witness, otherwise we defer to the definition.

Now GetOrAddImpl does not need to track `is_definition` anymore, so we
remove a lot of plumbing.

We inline the `AllocateFacetTypeImplWitness` since it has a single
caller and it is just 2 lines, to help improve understanding of the
steps and comments in setting up the impl definition.

Note that this puts the `RequreCompleteType` instruction into the
definition's generic eval block always, avoiding the issue of ensuring
that each generic redecl has the exact same instructions, and forcing
coordination to have `RequireCompleteType` inserted into every
declaration's eval block or none. The result also more closely matches
the design, with the complete type not being required until inside the
definition.

This is part of #6420 which is being split up into a chain of smaller
PRs. It is based on #6469.
Dana Jansens 4 mesi fa
parent
commit
fbcaf34494
56 ha cambiato i file con 244 aggiunte e 298 eliminazioni
  1. 23 60
      toolchain/check/facet_type.cpp
  2. 7 21
      toolchain/check/facet_type.h
  3. 6 8
      toolchain/check/handle_impl.cpp
  4. 55 30
      toolchain/check/impl.cpp
  5. 3 4
      toolchain/check/impl.h
  6. 1 1
      toolchain/check/testdata/as/basics.carbon
  7. 1 1
      toolchain/check/testdata/as/var_init.carbon
  8. 6 6
      toolchain/check/testdata/class/generic/member_type.carbon
  9. 2 2
      toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon
  10. 7 9
      toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon
  11. 6 7
      toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon
  12. 1 1
      toolchain/check/testdata/facet/fail_convert_class_type_to_generic_facet_value.carbon
  13. 1 1
      toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon
  14. 3 3
      toolchain/check/testdata/for/actual.carbon
  15. 4 4
      toolchain/check/testdata/function/builtin/call_from_operator.carbon
  16. 1 1
      toolchain/check/testdata/function/generic/call_method_on_generic_facet.carbon
  17. 2 3
      toolchain/check/testdata/generic/dot_self_symbolic_type.carbon
  18. 1 1
      toolchain/check/testdata/generic/template/convert.carbon
  19. 1 1
      toolchain/check/testdata/impl/assoc_const_self.carbon
  20. 4 4
      toolchain/check/testdata/impl/extend_impl_generic.carbon
  21. 3 14
      toolchain/check/testdata/impl/fail_extend_impl_forall.carbon
  22. 2 3
      toolchain/check/testdata/impl/forward_decls.carbon
  23. 12 18
      toolchain/check/testdata/impl/import_generic.carbon
  24. 1 1
      toolchain/check/testdata/impl/import_self.carbon
  25. 1 1
      toolchain/check/testdata/impl/import_thunk.carbon
  26. 6 0
      toolchain/check/testdata/impl/incomplete.carbon
  27. 2 2
      toolchain/check/testdata/impl/interface_args.carbon
  28. 9 9
      toolchain/check/testdata/impl/lookup/generic.carbon
  29. 6 6
      toolchain/check/testdata/impl/lookup/impl_forall.carbon
  30. 3 3
      toolchain/check/testdata/impl/lookup/import.carbon
  31. 4 5
      toolchain/check/testdata/impl/lookup/lookup_interface_with_enclosing_generic_inside_rewrite_constraint.carbon
  32. 22 29
      toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon
  33. 2 2
      toolchain/check/testdata/impl/lookup/specific_args.carbon
  34. 1 1
      toolchain/check/testdata/impl/lookup/transitive.carbon
  35. 4 5
      toolchain/check/testdata/impl/use_assoc_entity.carbon
  36. 2 2
      toolchain/check/testdata/interface/generic.carbon
  37. 1 1
      toolchain/check/testdata/interface/generic_import.carbon
  38. 6 6
      toolchain/check/testdata/interface/generic_method.carbon
  39. 3 3
      toolchain/check/testdata/interface/generic_vs_params.carbon
  40. 1 1
      toolchain/check/testdata/operators/overloaded/add.carbon
  41. 1 1
      toolchain/check/testdata/operators/overloaded/bit_and.carbon
  42. 1 1
      toolchain/check/testdata/operators/overloaded/bit_or.carbon
  43. 1 1
      toolchain/check/testdata/operators/overloaded/bit_xor.carbon
  44. 1 1
      toolchain/check/testdata/operators/overloaded/dec.carbon
  45. 1 1
      toolchain/check/testdata/operators/overloaded/div.carbon
  46. 1 1
      toolchain/check/testdata/operators/overloaded/eq.carbon
  47. 2 2
      toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon
  48. 2 2
      toolchain/check/testdata/operators/overloaded/implicit_as.carbon
  49. 1 1
      toolchain/check/testdata/operators/overloaded/inc.carbon
  50. 1 1
      toolchain/check/testdata/operators/overloaded/index.carbon
  51. 1 1
      toolchain/check/testdata/operators/overloaded/left_shift.carbon
  52. 1 1
      toolchain/check/testdata/operators/overloaded/mod.carbon
  53. 1 1
      toolchain/check/testdata/operators/overloaded/mul.carbon
  54. 1 1
      toolchain/check/testdata/operators/overloaded/ordered.carbon
  55. 1 1
      toolchain/check/testdata/operators/overloaded/right_shift.carbon
  56. 1 1
      toolchain/check/testdata/operators/overloaded/sub.carbon

+ 23 - 60
toolchain/check/facet_type.cpp

@@ -52,20 +52,6 @@ static auto WitnessQueryMatchesInterface(
          context.specific_interfaces().Get(lookup.query_specific_interface_id);
 }
 
-static auto IncompleteFacetTypeDiagnosticBuilder(
-    Context& context, SemIR::LocId loc_id, SemIR::TypeInstId facet_type_inst_id,
-    bool is_definition) -> DiagnosticBuilder {
-  // TODO: Remove this parameter. Facet types don't need to be complete for impl
-  // declarations, unless there's a rewrite into `.Self`. But that completeness
-  // is checked/required by the member access of the rewrite.
-  CARBON_CHECK(is_definition);
-  CARBON_DIAGNOSTIC(ImplAsIncompleteFacetTypeDefinition, Error,
-                    "definition of impl as incomplete facet type {0}",
-                    InstIdAsType);
-  return context.emitter().Build(loc_id, ImplAsIncompleteFacetTypeDefinition,
-                                 facet_type_inst_id);
-}
-
 auto GetImplWitnessAccessWithoutSubstitution(Context& context,
                                              SemIR::InstId inst_id)
     -> SemIR::InstId {
@@ -80,7 +66,7 @@ auto InitialFacetTypeImplWitness(
     Context& context, SemIR::LocId witness_loc_id,
     SemIR::TypeInstId facet_type_inst_id, SemIR::TypeInstId self_type_inst_id,
     const SemIR::SpecificInterface& interface_to_witness,
-    SemIR::SpecificId self_specific_id, bool is_definition) -> SemIR::InstId {
+    SemIR::SpecificId self_specific_id) -> SemIR::InstId {
   auto facet_type_id =
       context.types().GetTypeIdForTypeInstId(facet_type_inst_id);
   CARBON_CHECK(facet_type_id != SemIR::ErrorInst::TypeId);
@@ -88,7 +74,21 @@ auto InitialFacetTypeImplWitness(
   const auto& facet_type_info =
       context.facet_types().Get(facet_type.facet_type_id);
 
-  if (!is_definition && facet_type_info.rewrite_constraints.empty()) {
+  // An iterator over the rewrite_constraints where the LHS of the rewrite names
+  // a member of the `interface_to_witness`. This filters out rewrites of names
+  // from other interfaces, as they do not set values in the witness table.
+  auto rewrites_into_interface_to_witness = llvm::make_filter_range(
+      facet_type_info.rewrite_constraints,
+      [&](const SemIR::FacetTypeInfo::RewriteConstraint& rewrite) {
+        auto access = context.insts().GetAs<SemIR::ImplWitnessAccess>(
+            GetImplWitnessAccessWithoutSubstitution(context, rewrite.lhs_id));
+        return WitnessQueryMatchesInterface(context, access.witness_id,
+                                            interface_to_witness);
+      });
+
+  if (rewrites_into_interface_to_witness.empty()) {
+    // The witness table is not needed until the definition. Make a placeholder
+    // for the declaration.
     auto witness_table_inst_id = AddInst<SemIR::ImplWitnessTable>(
         context, witness_loc_id,
         {.elements_id = context.inst_blocks().AddPlaceholder(),
@@ -100,19 +100,15 @@ auto InitialFacetTypeImplWitness(
          .specific_id = self_specific_id});
   }
 
-  // The presence of any rewrite constraints requires that we know how many
-  // entries to allocate in the witness table, which requires the entire facet
-  // type to be complete, even if this was a declaration.
-  if (!RequireCompleteType(
-          context, facet_type_id, SemIR::LocId(facet_type_inst_id), [&] {
-            return IncompleteFacetTypeDiagnosticBuilder(
-                context, witness_loc_id, facet_type_inst_id, is_definition);
-          })) {
+  const auto& interface =
+      context.interfaces().Get(interface_to_witness.interface_id);
+  if (!interface.is_complete()) {
+    // This is a declaration with rewrite constraints into `.Self`, but the
+    // interface is not complete. Those rewrites have already been diagnosed as
+    // an error in their member access.
     return SemIR::ErrorInst::InstId;
   }
 
-  const auto& interface =
-      context.interfaces().Get(interface_to_witness.interface_id);
   auto assoc_entities =
       context.inst_blocks().Get(interface.associated_entities_id);
   // TODO: When this function is used for things other than just impls, may want
@@ -143,13 +139,9 @@ auto InitialFacetTypeImplWitness(
          .specific_id = self_specific_id});
   }
 
-  for (auto rewrite : facet_type_info.rewrite_constraints) {
+  for (auto rewrite : rewrites_into_interface_to_witness) {
     auto access = context.insts().GetAs<SemIR::ImplWitnessAccess>(
         GetImplWitnessAccessWithoutSubstitution(context, rewrite.lhs_id));
-    if (!WitnessQueryMatchesInterface(context, access.witness_id,
-                                      interface_to_witness)) {
-      continue;
-    }
     auto& table_entry = table[access.index.index];
     if (table_entry == SemIR::ErrorInst::InstId) {
       // Don't overwrite an error value. This prioritizes not generating
@@ -243,35 +235,6 @@ auto InitialFacetTypeImplWitness(
   return witness_inst_id;
 }
 
-auto RequireCompleteFacetTypeForImplDefinition(
-    Context& context, SemIR::LocId loc_id, SemIR::TypeInstId facet_type_inst_id)
-    -> bool {
-  auto facet_type_id =
-      context.types().GetTypeIdForTypeInstId(facet_type_inst_id);
-  return RequireCompleteType(
-      context, facet_type_id, SemIR::LocId(facet_type_inst_id), [&] {
-        return IncompleteFacetTypeDiagnosticBuilder(context, loc_id,
-                                                    facet_type_inst_id,
-                                                    /*is_definition=*/true);
-      });
-}
-
-auto AllocateFacetTypeImplWitness(Context& context,
-                                  SemIR::InterfaceId interface_id,
-                                  SemIR::InstBlockId witness_id) -> void {
-  const auto& interface = context.interfaces().Get(interface_id);
-  CARBON_CHECK(interface.is_complete());
-  auto assoc_entities =
-      context.inst_blocks().Get(interface.associated_entities_id);
-  for (auto decl_id : assoc_entities) {
-    LoadImportRef(context, decl_id);
-  }
-
-  llvm::SmallVector<SemIR::InstId> empty_table(
-      assoc_entities.size(), SemIR::InstId::ImplWitnessTablePlaceholder);
-  context.inst_blocks().ReplacePlaceholder(witness_id, empty_table);
-}
-
 // A mapping of each associated constant (represented as `ImplWitnessAccess`) to
 // its value (represented as an `InstId`). Used to track rewrite constraints,
 // with the LHS mapping to the resolved value of the RHS.

+ 7 - 21
toolchain/check/facet_type.h

@@ -39,10 +39,10 @@ auto GetImplWitnessAccessWithoutSubstitution(Context& context,
                                              SemIR::InstId inst_id)
     -> SemIR::InstId;
 
-// Creates a impl witness instruction for a facet type. The facet type is
-// required to be complete if `is_definition` is true or the facet type has
-// rewrites. Otherwise a placeholder witness is created, and
-// `AllocateFacetTypeImplWitness` can be used at the `impl` definition.
+// Creates and returns an impl witness instruction for an impl declaration.
+//
+// If there are no rewrites into a name of the interface being implemented, a
+// placeholder witness table is created, to be replaced in the impl definition.
 //
 // Adds and returns an `ImplWitness` instruction (created with location set to
 // `witness_loc_id`) that shows "`Self` type" of type "facet type" (the value of
@@ -59,27 +59,13 @@ auto GetImplWitnessAccessWithoutSubstitution(Context& context,
 // bind the inner `.Self` to the outer `.Self`.
 //
 // If the facet type contains a rewrite, we may have deferred converting the
-// rewritten value to the type of the associated constant. That conversion
-// will also be performed as part of resolution, and may depend on the
-// `Self` type.
+// rewritten value to the type of the associated constant. That conversion will
+// also be performed as part of resolution, and may depend on the `Self` type.
 auto InitialFacetTypeImplWitness(
     Context& context, SemIR::LocId witness_loc_id,
     SemIR::TypeInstId facet_type_inst_id, SemIR::TypeInstId self_type_inst_id,
     const SemIR::SpecificInterface& interface_to_witness,
-    SemIR::SpecificId self_specific_id, bool is_definition) -> SemIR::InstId;
-
-// Returns `true` if the facet type is complete. Otherwise issues a diagnostic
-// and returns `false`.
-auto RequireCompleteFacetTypeForImplDefinition(
-    Context& context, SemIR::LocId loc_id, SemIR::TypeInstId facet_type_inst_id)
-    -> bool;
-
-// Replaces the placeholder created by `InitialFacetTypeImplWitness` with an
-// empty witness table of the right size. Requires the interface designated by
-// `interface_id` to be complete.
-auto AllocateFacetTypeImplWitness(Context& context,
-                                  SemIR::InterfaceId interface_id,
-                                  SemIR::InstBlockId witness_id) -> void;
+    SemIR::SpecificId self_specific_id) -> SemIR::InstId;
 
 // Perform rewrite constraint resolution for a facet type. The rewrite
 // constraints resolution is described here:

+ 6 - 8
toolchain/check/handle_impl.cpp

@@ -18,9 +18,11 @@
 #include "toolchain/check/pattern_match.h"
 #include "toolchain/check/type.h"
 #include "toolchain/check/type_completion.h"
+#include "toolchain/parse/node_ids.h"
 #include "toolchain/parse/typed_nodes.h"
 #include "toolchain/sem_ir/generic.h"
 #include "toolchain/sem_ir/ids.h"
+#include "toolchain/sem_ir/specific_interface.h"
 #include "toolchain/sem_ir/typed_insts.h"
 
 namespace Carbon::Check {
@@ -190,8 +192,7 @@ static auto PopImplIntroducerAndParamsAsNameComponent(
 
 // Build an ImplDecl describing the signature of an impl. This handles the
 // common logic shared by impl forward declarations and impl definitions.
-static auto BuildImplDecl(Context& context, Parse::AnyImplDeclId node_id,
-                          bool is_definition)
+static auto BuildImplDecl(Context& context, Parse::AnyImplDeclId node_id)
     -> std::pair<SemIR::ImplId, SemIR::InstId> {
   auto [constraint_node, constraint_id] =
       context.node_stack().PopExprWithNodeId();
@@ -243,7 +244,7 @@ static auto BuildImplDecl(Context& context, Parse::AnyImplDeclId node_id,
          .is_final = is_final}};
     auto extend_node = introducer.modifier_node_id(ModifierOrder::Extend);
     impl_id = GetOrAddImpl(context, node_id, name.implicit_params_loc_id,
-                           impl_info, is_definition, extend_node);
+                           impl_info, extend_node);
   }
 
   // `GetOrAddImpl` either filled in the `impl_info` and returned a fresh
@@ -257,8 +258,7 @@ static auto BuildImplDecl(Context& context, Parse::AnyImplDeclId node_id,
 }
 
 auto HandleParseNode(Context& context, Parse::ImplDeclId node_id) -> bool {
-  auto [impl_id, impl_decl_id] =
-      BuildImplDecl(context, node_id, /*is_definition=*/false);
+  auto [impl_id, impl_decl_id] = BuildImplDecl(context, node_id);
   auto& impl = context.impls().Get(impl_id);
 
   context.decl_name_stack().PopScope();
@@ -275,8 +275,7 @@ auto HandleParseNode(Context& context, Parse::ImplDeclId node_id) -> bool {
 
 auto HandleParseNode(Context& context, Parse::ImplDefinitionStartId node_id)
     -> bool {
-  auto [impl_id, impl_decl_id] =
-      BuildImplDecl(context, node_id, /*is_definition=*/true);
+  auto [impl_id, impl_decl_id] = BuildImplDecl(context, node_id);
   auto& impl = context.impls().Get(impl_id);
 
   CARBON_CHECK(!impl.has_definition_started());
@@ -289,7 +288,6 @@ auto HandleParseNode(Context& context, Parse::ImplDefinitionStartId node_id)
       impl_decl_id, impl.scope_id,
       context.generics().GetSelfSpecific(impl.generic_id));
   StartGenericDefinition(context, impl.generic_id);
-  // This requires that the facet type is complete.
   ImplWitnessStartDefinition(context, impl);
   context.inst_block_stack().Push();
   context.node_stack().Push(node_id, impl_id);

+ 55 - 30
toolchain/check/impl.cpp

@@ -86,8 +86,8 @@ auto CheckAssociatedFunctionImplementation(
 }
 
 // Builds an initial witness from the rewrites in the facet type, if any.
-auto ImplWitnessForDeclaration(Context& context, const SemIR::Impl& impl,
-                               bool has_definition) -> SemIR::InstId {
+auto ImplWitnessForDeclaration(Context& context, const SemIR::Impl& impl)
+    -> SemIR::InstId {
   CARBON_CHECK(!impl.has_definition_started());
 
   auto self_type_id = context.types().GetTypeIdForTypeInstId(impl.self_id);
@@ -99,7 +99,7 @@ auto ImplWitnessForDeclaration(Context& context, const SemIR::Impl& impl,
   return InitialFacetTypeImplWitness(
       context, SemIR::LocId(impl.latest_decl_id()), impl.constraint_id,
       impl.self_id, impl.interface,
-      context.generics().GetSelfSpecific(impl.generic_id), has_definition);
+      context.generics().GetSelfSpecific(impl.generic_id));
 }
 
 auto ImplWitnessStartDefinition(Context& context, SemIR::Impl& impl) -> void {
@@ -108,33 +108,53 @@ auto ImplWitnessStartDefinition(Context& context, SemIR::Impl& impl) -> void {
   if (impl.witness_id == SemIR::ErrorInst::InstId) {
     return;
   }
+
+  if (!RequireCompleteType(
+          context, context.types().GetTypeIdForTypeInstId(impl.constraint_id),
+          SemIR::LocId(impl.constraint_id), [&] {
+            CARBON_DIAGNOSTIC(ImplAsIncompleteFacetTypeDefinition, Error,
+                              "definition of impl as incomplete facet type {0}",
+                              InstIdAsType);
+            return context.emitter().Build(SemIR::LocId(impl.latest_decl_id()),
+                                           ImplAsIncompleteFacetTypeDefinition,
+                                           impl.constraint_id);
+          })) {
+    FillImplWitnessWithErrors(context, impl);
+    return;
+  }
+
+  const auto& interface = context.interfaces().Get(impl.interface.interface_id);
+
+  auto assoc_entities =
+      context.inst_blocks().Get(interface.associated_entities_id);
+  for (auto decl_id : assoc_entities) {
+    LoadImportRef(context, decl_id);
+  }
+
   auto witness = context.insts().GetAs<SemIR::ImplWitness>(impl.witness_id);
   auto witness_table =
       context.insts().GetAs<SemIR::ImplWitnessTable>(witness.witness_table_id);
   auto witness_block =
       context.inst_blocks().GetMutable(witness_table.elements_id);
-  // `witness_table.elements_id` will be `SemIR::InstBlockId::Empty` when the
-  // definition is the first declaration and the interface has no members. The
-  // other case where `witness_block` will be empty is when we are using a
-  // placeholder witness. This happens when there is a forward declaration of
-  // the impl and the facet type has no rewrite constraints and so it wasn't
-  // required to be complete.
-  if (witness_table.elements_id != SemIR::InstBlockId::Empty &&
-      witness_block.empty()) {
-    if (!RequireCompleteFacetTypeForImplDefinition(
-            context, SemIR::LocId(impl.latest_decl_id()), impl.constraint_id)) {
-      FillImplWitnessWithErrors(context, impl);
-      return;
-    }
 
-    AllocateFacetTypeImplWitness(context, impl.interface.interface_id,
-                                 witness_table.elements_id);
+  // The impl declaration may have created a placeholder witness table, or a
+  // full witness table. We can detect that the witness table is a placeholder
+  // table if it's not the `Empty` id, but it is empty still. If it was a
+  // placeholder, we can replace the placeholder here with a table of the proper
+  // size, since the interface must be complete for the impl definition.
+  bool witness_table_is_placeholder =
+      witness_table.elements_id != SemIR::InstBlockId::Empty &&
+      witness_block.empty();
+  if (witness_table_is_placeholder) {
+    // TODO: Since our `empty_table` repeats the same value throughout, we could
+    // skip an allocation here if there was a `ReplacePlaceholder` function that
+    // took a size and value instead of an array of values.
+    llvm::SmallVector<SemIR::InstId> empty_table(
+        assoc_entities.size(), SemIR::InstId::ImplWitnessTablePlaceholder);
+    context.inst_blocks().ReplacePlaceholder(witness_table.elements_id,
+                                             empty_table);
     witness_block = context.inst_blocks().GetMutable(witness_table.elements_id);
   }
-  const auto& interface = context.interfaces().Get(impl.interface.interface_id);
-  auto assoc_entities =
-      context.inst_blocks().Get(interface.associated_entities_id);
-  CARBON_CHECK(witness_block.size() == assoc_entities.size());
 
   // Check we have a value for all non-function associated constants in the
   // witness.
@@ -306,7 +326,8 @@ auto CheckConstraintIsInterface(Context& context, SemIR::InstId impl_decl_id,
 }
 
 // Returns true if impl redeclaration parameters match.
-static auto CheckImplRedeclParamsMatch(Context& context, SemIR::Impl& new_impl,
+static auto CheckImplRedeclParamsMatch(Context& context,
+                                       const SemIR::Impl& new_impl,
                                        SemIR::ImplId prev_impl_id) -> bool {
   auto& prev_impl = context.impls().Get(prev_impl_id);
 
@@ -324,7 +345,7 @@ static auto CheckImplRedeclParamsMatch(Context& context, SemIR::Impl& new_impl,
 
 // Returns whether an impl can be redeclared. For example, defined impls
 // cannot be redeclared.
-static auto IsValidImplRedecl(Context& context, SemIR::Impl& new_impl,
+static auto IsValidImplRedecl(Context& context, const SemIR::Impl& new_impl,
                               SemIR::ImplId prev_impl_id) -> bool {
   auto& prev_impl = context.impls().Get(prev_impl_id);
 
@@ -488,11 +509,10 @@ static auto ApplyExtendImplAs(Context& context, SemIR::LocId loc_id,
 
 auto GetOrAddImpl(Context& context, SemIR::LocId loc_id,
                   SemIR::LocId implicit_params_loc_id, SemIR::Impl impl,
-                  bool is_definition, Parse::NodeId extend_node)
-    -> SemIR::ImplId {
+                  Parse::NodeId extend_node) -> SemIR::ImplId {
   auto impl_id = SemIR::ImplId::None;
 
-  // Add the impl declaration.
+  // Look for an existing matching declaration.
   auto lookup_bucket_ref = context.impls().GetOrAddLookupBucket(impl);
   // TODO: Detect two impl declarations with the same self type and interface,
   // and issue an error if they don't match.
@@ -538,12 +558,17 @@ auto GetOrAddImpl(Context& context, SemIR::LocId loc_id,
   }
 
   if (impl.witness_id != SemIR::ErrorInst::InstId) {
-    impl.witness_id = ImplWitnessForDeclaration(context, impl, is_definition);
+    // This makes either a placeholder witness 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 associated constants in the
+    // interface.
+    impl.witness_id = ImplWitnessForDeclaration(context, impl);
   }
+
   FinishGenericDecl(context, SemIR::LocId(impl.latest_decl_id()),
                     impl.generic_id);
-  // From here on, use the `Impl` from the `ImplStore` instead of `impl`
-  // in order to make and see any changes to the `Impl`.
+  // From here on, use the `Impl` from the `ImplStore` instead of `impl` in
+  // order to make and see any changes to the `Impl`.
   impl_id = context.impls().Add(impl);
   lookup_bucket_ref.push_back(impl_id);
   AssignImplIdInWitness(context, impl_id, impl.witness_id);

+ 3 - 4
toolchain/check/impl.h

@@ -14,8 +14,8 @@ namespace Carbon::Check {
 //
 // `has_definition` is whether this declaration is immediately followed by the
 // opening of the definition.
-auto ImplWitnessForDeclaration(Context& context, const SemIR::Impl& impl,
-                               bool has_definition) -> SemIR::InstId;
+auto ImplWitnessForDeclaration(Context& context, const SemIR::Impl& impl)
+    -> SemIR::InstId;
 
 // Update `impl`'s witness at the start of a definition.
 auto ImplWitnessStartDefinition(Context& context, SemIR::Impl& impl) -> void;
@@ -56,8 +56,7 @@ auto CheckConstraintIsInterface(Context& context, SemIR::InstId impl_decl_id,
 // with it.
 auto GetOrAddImpl(Context& context, SemIR::LocId loc_id,
                   SemIR::LocId implicit_params_loc_id, SemIR::Impl impl,
-                  bool is_definition, Parse::NodeId extend_node)
-    -> SemIR::ImplId;
+                  Parse::NodeId extend_node) -> SemIR::ImplId;
 
 }  // namespace Carbon::Check
 

+ 1 - 1
toolchain/check/testdata/as/basics.carbon

@@ -381,8 +381,8 @@ 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.d60: type = facet_type <@As, @As(%Y)> [concrete]
-// CHECK:STDOUT:   %As.Convert.type.d2d: type = fn_type @As.Convert, @As(%Y) [concrete]
 // CHECK:STDOUT:   %As.impl_witness.3fa: <witness> = impl_witness file.%As.impl_witness_table.loc14 [concrete]
+// CHECK:STDOUT:   %As.Convert.type.d2d: 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]
 // CHECK:STDOUT:   %As.facet.2fd: %As.type.d60 = facet_value %X, (%As.impl_witness.3fa) [concrete]

+ 1 - 1
toolchain/check/testdata/as/var_init.carbon

@@ -34,8 +34,8 @@ 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.179: type = facet_type <@ImplicitAs, @ImplicitAs(%X)> [concrete]
-// CHECK:STDOUT:   %ImplicitAs.Convert.type.665: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%X) [concrete]
 // CHECK:STDOUT:   %ImplicitAs.impl_witness: <witness> = impl_witness @X.%ImplicitAs.impl_witness_table [concrete]
+// CHECK:STDOUT:   %ImplicitAs.Convert.type.665: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%X) [concrete]
 // CHECK:STDOUT:   %pattern_type.019: 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]
 // CHECK:STDOUT:   %empty_tuple.type.as.ImplicitAs.impl.Convert: %empty_tuple.type.as.ImplicitAs.impl.Convert.type = struct_value () [concrete]

+ 6 - 6
toolchain/check/testdata/class/generic/member_type.carbon

@@ -430,8 +430,8 @@ fn Test() -> i32 {
 // CHECK:STDOUT:   %Inner.assoc_type.073: type = assoc_entity_type @Inner, @Inner(%T) [symbolic]
 // CHECK:STDOUT:   %assoc0.600: %Inner.assoc_type.073 = assoc_entity element0, @Inner.%Inner.F.decl [symbolic]
 // CHECK:STDOUT:   %C.f7b: type = class_type @C, @C(%T) [symbolic]
-// CHECK:STDOUT:   %require_complete.b33: <witness> = require_complete_type %Inner.type.83d [symbolic]
 // CHECK:STDOUT:   %Inner.impl_witness.cd1: <witness> = impl_witness @C.%Inner.impl_witness_table, @C.as.Inner.impl(%T) [symbolic]
+// CHECK:STDOUT:   %require_complete.b33: <witness> = require_complete_type %Inner.type.83d [symbolic]
 // CHECK:STDOUT:   %pattern_type.394: type = pattern_type %C.f7b [symbolic]
 // CHECK:STDOUT:   %C.as.Inner.impl.F.type.eb9: type = fn_type @C.as.Inner.impl.F, @C.as.Inner.impl(%T) [symbolic]
 // CHECK:STDOUT:   %C.as.Inner.impl.F.345: %C.as.Inner.impl.F.type.eb9 = struct_value () [symbolic]
@@ -454,12 +454,12 @@ fn Test() -> i32 {
 // CHECK:STDOUT:   %Outer.545: type = class_type @Outer, @Outer(%i32) [concrete]
 // CHECK:STDOUT:   %Inner.type.56c: type = facet_type <@Inner, @Inner(%i32)> [concrete]
 // CHECK:STDOUT:   %C.70f: type = class_type @C, @C(%i32) [concrete]
+// CHECK:STDOUT:   %Inner.impl_witness.01d: <witness> = impl_witness @D.%Inner.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.0c6: %Inner.type.56c = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %Inner.F.type.86e: type = fn_type @Inner.F, @Inner(%i32) [concrete]
 // CHECK:STDOUT:   %Inner.F.11d: %Inner.F.type.86e = struct_value () [concrete]
 // CHECK:STDOUT:   %Inner.assoc_type.215: type = assoc_entity_type @Inner, @Inner(%i32) [concrete]
 // CHECK:STDOUT:   %assoc0.bd5: %Inner.assoc_type.215 = assoc_entity element0, @Inner.%Inner.F.decl [concrete]
-// CHECK:STDOUT:   %Inner.impl_witness.01d: <witness> = impl_witness @D.%Inner.impl_witness_table [concrete]
 // CHECK:STDOUT:   %pattern_type.510: type = pattern_type %D [concrete]
 // CHECK:STDOUT:   %pattern_type.7ce: type = pattern_type %i32 [concrete]
 // CHECK:STDOUT:   %D.as.Inner.impl.F.type: type = fn_type @D.as.Inner.impl.F [concrete]
@@ -472,8 +472,8 @@ fn Test() -> i32 {
 // CHECK:STDOUT:   %pattern_type.de9: type = pattern_type %C.70f [concrete]
 // CHECK:STDOUT:   %empty_struct: %empty_struct_type = struct_value () [concrete]
 // CHECK:STDOUT:   %C.val: %C.70f = struct_value () [concrete]
-// CHECK:STDOUT:   %complete_type.619: <witness> = complete_type_witness %Inner.type.56c [concrete]
 // CHECK:STDOUT:   %Inner.impl_witness.662: <witness> = impl_witness @C.%Inner.impl_witness_table, @C.as.Inner.impl(%i32) [concrete]
+// CHECK:STDOUT:   %complete_type.619: <witness> = complete_type_witness %Inner.type.56c [concrete]
 // CHECK:STDOUT:   %C.as.Inner.impl.F.type.22a: type = fn_type @C.as.Inner.impl.F, @C.as.Inner.impl(%i32) [concrete]
 // CHECK:STDOUT:   %C.as.Inner.impl.F.bd7: %C.as.Inner.impl.F.type.22a = struct_value () [concrete]
 // CHECK:STDOUT:   %.b0b: require_specific_def_type = require_specific_def @C.as.Inner.impl(%i32) [concrete]
@@ -571,10 +571,10 @@ 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.f7b)]
 // CHECK:STDOUT:   %Inner.type: type = facet_type <@Inner, @Inner(%T)> [symbolic = %Inner.type (constants.%Inner.type.83d)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %Inner.type [symbolic = %require_complete (constants.%require_complete.b33)]
 // CHECK:STDOUT:   %Inner.impl_witness: <witness> = impl_witness @C.%Inner.impl_witness_table, @C.as.Inner.impl(%T) [symbolic = %Inner.impl_witness (constants.%Inner.impl_witness.cd1)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %Inner.type [symbolic = %require_complete (constants.%require_complete.b33)]
 // CHECK:STDOUT:   %C.as.Inner.impl.F.type: type = fn_type @C.as.Inner.impl.F, @C.as.Inner.impl(%T) [symbolic = %C.as.Inner.impl.F.type (constants.%C.as.Inner.impl.F.type.eb9)]
 // CHECK:STDOUT:   %C.as.Inner.impl.F: @C.as.Inner.impl.%C.as.Inner.impl.F.type (%C.as.Inner.impl.F.type.eb9) = struct_value () [symbolic = %C.as.Inner.impl.F (constants.%C.as.Inner.impl.F.345)]
 // CHECK:STDOUT:
@@ -820,10 +820,10 @@ fn Test() -> i32 {
 // CHECK:STDOUT:   %T => constants.%T
 // CHECK:STDOUT:   %C => constants.%C.f7b
 // CHECK:STDOUT:   %Inner.type => constants.%Inner.type.83d
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.b33
 // CHECK:STDOUT:   %Inner.impl_witness => constants.%Inner.impl_witness.cd1
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%require_complete.b33
 // CHECK:STDOUT:   %C.as.Inner.impl.F.type => constants.%C.as.Inner.impl.F.type.eb9
 // CHECK:STDOUT:   %C.as.Inner.impl.F => constants.%C.as.Inner.impl.F.345
 // CHECK:STDOUT: }
@@ -889,10 +889,10 @@ fn Test() -> i32 {
 // CHECK:STDOUT:   %T => constants.%i32
 // CHECK:STDOUT:   %C => constants.%C.70f
 // CHECK:STDOUT:   %Inner.type => constants.%Inner.type.56c
-// CHECK:STDOUT:   %require_complete => constants.%complete_type.619
 // CHECK:STDOUT:   %Inner.impl_witness => constants.%Inner.impl_witness.662
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%complete_type.619
 // CHECK:STDOUT:   %C.as.Inner.impl.F.type => constants.%C.as.Inner.impl.F.type.22a
 // CHECK:STDOUT:   %C.as.Inner.impl.F => constants.%C.as.Inner.impl.F.bd7
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon

@@ -83,12 +83,12 @@ fn G() {
 // CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
 // CHECK:STDOUT:   %ImplsGeneric: type = class_type @ImplsGeneric [concrete]
 // CHECK:STDOUT:   %Generic.type.621: type = facet_type <@Generic, @Generic(%GenericParam)> [concrete]
+// CHECK:STDOUT:   %Generic.impl_witness: <witness> = impl_witness file.%Generic.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.473: %Generic.type.621 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %Generic.F.type.4cf: type = fn_type @Generic.F, @Generic(%GenericParam) [concrete]
 // CHECK:STDOUT:   %Generic.F.118: %Generic.F.type.4cf = struct_value () [concrete]
 // CHECK:STDOUT:   %Generic.assoc_type.713: type = assoc_entity_type @Generic, @Generic(%GenericParam) [concrete]
 // CHECK:STDOUT:   %assoc0.4e0: %Generic.assoc_type.713 = assoc_entity element0, @Generic.%Generic.F.decl [concrete]
-// CHECK:STDOUT:   %Generic.impl_witness: <witness> = impl_witness file.%Generic.impl_witness_table [concrete]
 // CHECK:STDOUT:   %ImplsGeneric.as.Generic.impl.F.type: type = fn_type @ImplsGeneric.as.Generic.impl.F [concrete]
 // CHECK:STDOUT:   %ImplsGeneric.as.Generic.impl.F: %ImplsGeneric.as.Generic.impl.F.type = struct_value () [concrete]
 // CHECK:STDOUT:   %Generic.facet: %Generic.type.621 = facet_value %ImplsGeneric, (%Generic.impl_witness) [concrete]
@@ -386,12 +386,12 @@ fn G() {
 // CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
 // CHECK:STDOUT:   %ImplsGeneric: type = class_type @ImplsGeneric [concrete]
 // CHECK:STDOUT:   %Generic.type.621: type = facet_type <@Generic, @Generic(%GenericParam)> [concrete]
+// CHECK:STDOUT:   %Generic.impl_witness: <witness> = impl_witness file.%Generic.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.473: %Generic.type.621 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %Generic.F.type.4cf: type = fn_type @Generic.F, @Generic(%GenericParam) [concrete]
 // CHECK:STDOUT:   %Generic.F.118: %Generic.F.type.4cf = struct_value () [concrete]
 // CHECK:STDOUT:   %Generic.assoc_type.713: type = assoc_entity_type @Generic, @Generic(%GenericParam) [concrete]
 // CHECK:STDOUT:   %assoc0.4e0: %Generic.assoc_type.713 = assoc_entity element0, @Generic.%Generic.F.decl [concrete]
-// CHECK:STDOUT:   %Generic.impl_witness: <witness> = impl_witness file.%Generic.impl_witness_table [concrete]
 // CHECK:STDOUT:   %ImplsGeneric.as.Generic.impl.F.type: type = fn_type @ImplsGeneric.as.Generic.impl.F [concrete]
 // CHECK:STDOUT:   %ImplsGeneric.as.Generic.impl.F: %ImplsGeneric.as.Generic.impl.F.type = struct_value () [concrete]
 // CHECK:STDOUT:   %Generic.facet: %Generic.type.621 = facet_value %ImplsGeneric, (%Generic.impl_witness) [concrete]

+ 7 - 9
toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon

@@ -115,12 +115,12 @@ fn B() {
 // CHECK:STDOUT:   %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
 // CHECK:STDOUT:   %ImplsGeneric: type = class_type @ImplsGeneric [concrete]
 // CHECK:STDOUT:   %Generic.type.621: type = facet_type <@Generic, @Generic(%GenericParam)> [concrete]
+// CHECK:STDOUT:   %Generic.impl_witness: <witness> = impl_witness file.%Generic.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.473: %Generic.type.621 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %Generic.F.type.4cf: type = fn_type @Generic.F, @Generic(%GenericParam) [concrete]
 // CHECK:STDOUT:   %Generic.F.118: %Generic.F.type.4cf = struct_value () [concrete]
 // CHECK:STDOUT:   %Generic.assoc_type.713: type = assoc_entity_type @Generic, @Generic(%GenericParam) [concrete]
 // CHECK:STDOUT:   %assoc0.4e0: %Generic.assoc_type.713 = assoc_entity element0, @Generic.%Generic.F.decl [concrete]
-// CHECK:STDOUT:   %Generic.impl_witness: <witness> = impl_witness file.%Generic.impl_witness_table [concrete]
 // CHECK:STDOUT:   %ImplsGeneric.as.Generic.impl.F.type: type = fn_type @ImplsGeneric.as.Generic.impl.F [concrete]
 // CHECK:STDOUT:   %ImplsGeneric.as.Generic.impl.F: %ImplsGeneric.as.Generic.impl.F.type = struct_value () [concrete]
 // CHECK:STDOUT:   %Generic.facet: %Generic.type.621 = facet_value %ImplsGeneric, (%Generic.impl_witness) [concrete]
@@ -444,9 +444,9 @@ 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.3b7: type = facet_type <@I, @I(%T.67d, %empty_tuple.type)> [symbolic]
+// CHECK:STDOUT:   %I.impl_witness.5fb: <witness> = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%T.67d) [symbolic]
 // CHECK:STDOUT:   %Self.1b5: %I.type.3b7 = symbolic_binding Self, 2 [symbolic]
 // CHECK:STDOUT:   %require_complete.2ca: <witness> = require_complete_type %I.type.3b7 [symbolic]
-// CHECK:STDOUT:   %I.impl_witness.5fb: <witness> = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%T.67d) [symbolic]
 // CHECK:STDOUT:   %empty_struct: %empty_struct_type = struct_value () [concrete]
 // CHECK:STDOUT:   %I.type.302: type = facet_type <@I, @I(%empty_struct_type, %empty_tuple.type)> [concrete]
 // CHECK:STDOUT:   %T.23c: %I.type.302 = symbolic_binding T, 0 [symbolic]
@@ -460,8 +460,8 @@ 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:   %complete_type.ab3: <witness> = complete_type_witness %I.type.302 [concrete]
 // CHECK:STDOUT:   %I.impl_witness.3e1: <witness> = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%empty_struct_type) [concrete]
+// CHECK:STDOUT:   %complete_type.ab3: <witness> = complete_type_witness %I.type.302 [concrete]
 // CHECK:STDOUT:   %I.facet: %I.type.302 = facet_value %C, (%I.impl_witness.3e1) [concrete]
 // CHECK:STDOUT:   %pattern_type.c48: type = pattern_type %C [concrete]
 // CHECK:STDOUT:   %A.specific_fn: <specific function> = specific_function %A, @A(%I.facet) [concrete]
@@ -563,10 +563,10 @@ 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.3b7)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type.loc7_36.2 [symbolic = %require_complete (constants.%require_complete.2ca)]
 // CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%T.loc7_14.2) [symbolic = %I.impl_witness (constants.%I.impl_witness.5fb)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type.loc7_36.2 [symbolic = %require_complete (constants.%require_complete.2ca)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   impl: %C.ref as %I.type.loc7_36.1 {
 // CHECK:STDOUT:   !members:
@@ -636,7 +636,6 @@ 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.3b7
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.2ca
 // CHECK:STDOUT:   %I.impl_witness => constants.%I.impl_witness.5fb
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -658,10 +657,10 @@ 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.302
-// CHECK:STDOUT:   %require_complete => constants.%complete_type.ab3
 // CHECK:STDOUT:   %I.impl_witness => constants.%I.impl_witness.3e1
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%complete_type.ab3
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @A(constants.%I.facet) {
@@ -692,9 +691,9 @@ 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.3b7: type = facet_type <@I, @I(%T.67d, %empty_tuple.type)> [symbolic]
+// CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%T.67d) [symbolic]
 // CHECK:STDOUT:   %Self.1b5: %I.type.3b7 = symbolic_binding Self, 2 [symbolic]
 // CHECK:STDOUT:   %require_complete.2ca: <witness> = require_complete_type %I.type.3b7 [symbolic]
-// CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%T.67d) [symbolic]
 // CHECK:STDOUT:   %empty_struct: %empty_struct_type = struct_value () [concrete]
 // CHECK:STDOUT:   %I.type.1c6: type = facet_type <@I, @I(%empty_struct_type, %empty_struct_type)> [concrete]
 // CHECK:STDOUT:   %T.98b: %I.type.1c6 = symbolic_binding T, 0 [symbolic]
@@ -806,10 +805,10 @@ 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.3b7)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type.loc7_36.2 [symbolic = %require_complete (constants.%require_complete.2ca)]
 // CHECK:STDOUT:   %I.impl_witness: <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:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type.loc7_36.2 [symbolic = %require_complete (constants.%require_complete.2ca)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   impl: %C.ref as %I.type.loc7_36.1 {
 // CHECK:STDOUT:   !members:
@@ -872,7 +871,6 @@ 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.3b7
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.2ca
 // CHECK:STDOUT:   %I.impl_witness => constants.%I.impl_witness
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 6 - 7
toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon

@@ -62,9 +62,9 @@ fn F() {
 // CHECK:STDOUT:   %T.binding.as_type.38d: type = symbolic_binding_type T, 0, %T.182 [symbolic]
 // CHECK:STDOUT:   %U.binding.as_type: type = symbolic_binding_type U, 1, %U [symbolic]
 // CHECK:STDOUT:   %Eats.type.797e0d.1: type = facet_type <@Eats, @Eats(%U.binding.as_type)> [symbolic]
+// CHECK:STDOUT:   %Eats.impl_witness.bf3c30.1: <witness> = impl_witness file.%Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(%T.182, %U) [symbolic]
 // CHECK:STDOUT:   %Self.780: %Eats.type.797e0d.1 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %require_complete.ba97e8.1: <witness> = require_complete_type %Eats.type.797e0d.1 [symbolic]
-// CHECK:STDOUT:   %Eats.impl_witness.bf3c30.1: <witness> = impl_witness file.%Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(%T.182, %U) [symbolic]
 // CHECK:STDOUT:   %Goat: type = class_type @Goat [concrete]
 // CHECK:STDOUT:   %Animal.impl_witness: <witness> = impl_witness file.%Animal.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Food.80d: %Edible.type = symbolic_binding Food, 0 [symbolic]
@@ -91,8 +91,8 @@ fn F() {
 // CHECK:STDOUT:   %require_complete.d93: <witness> = require_complete_type %A.binding.as_type [symbolic]
 // CHECK:STDOUT:   %require_complete.ce5: <witness> = require_complete_type %Food.binding.as_type.1b8 [symbolic]
 // CHECK:STDOUT:   %Eats.type.797e0d.2: type = facet_type <@Eats, @Eats(%Food.binding.as_type.1b8)> [symbolic]
-// CHECK:STDOUT:   %require_complete.ba97e8.2: <witness> = require_complete_type %Eats.type.797e0d.2 [symbolic]
 // CHECK:STDOUT:   %Eats.impl_witness.bf3c30.2: <witness> = impl_witness file.%Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(%A, %Food.81f) [symbolic]
+// CHECK:STDOUT:   %require_complete.ba97e8.2: <witness> = require_complete_type %Eats.type.797e0d.2 [symbolic]
 // CHECK:STDOUT:   %.fdb: require_specific_def_type = require_specific_def @T.binding.as_type.as.Eats.impl(%A, %Food.81f) [symbolic]
 // CHECK:STDOUT:   %Eats.lookup_impl_witness: <witness> = lookup_impl_witness %A, @Eats, @Eats(%Food.binding.as_type.1b8) [symbolic]
 // CHECK:STDOUT:   %Eats.facet.2c1: %Eats.type.797e0d.2 = facet_value %A.binding.as_type, (%Eats.lookup_impl_witness) [symbolic]
@@ -119,9 +119,9 @@ fn F() {
 // CHECK:STDOUT:   %DestroyT.binding.as_type.as.Destroy.impl.Op.8d7: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.ae8 = struct_value () [concrete]
 // CHECK:STDOUT:   %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.56d: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.8d7, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.8dd) [concrete]
 // CHECK:STDOUT:   %Eats.type.cee: type = facet_type <@Eats, @Eats(%Grass)> [concrete]
+// CHECK:STDOUT:   %Eats.impl_witness.6b7: <witness> = impl_witness file.%Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(%Animal.facet, %Edible.facet) [concrete]
 // CHECK:STDOUT:   %Self.3eb: %Eats.type.cee = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %complete_type.eba: <witness> = complete_type_witness %Eats.type.cee [concrete]
-// CHECK:STDOUT:   %Eats.impl_witness.6b7: <witness> = impl_witness file.%Eats.impl_witness_table, @T.binding.as_type.as.Eats.impl(%Animal.facet, %Edible.facet) [concrete]
 // CHECK:STDOUT:   %.dd4: require_specific_def_type = require_specific_def @T.binding.as_type.as.Eats.impl(%Animal.facet, %Edible.facet) [concrete]
 // CHECK:STDOUT:   %Eats.facet.b0e: %Eats.type.cee = facet_value %Goat, (%Eats.impl_witness.6b7) [concrete]
 // CHECK:STDOUT:   %pattern_type.cf8: type = pattern_type %Eats.type.cee [concrete]
@@ -319,10 +319,10 @@ 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.38d)]
 // 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.797e0d.1)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %Eats.type.loc26_49.2 [symbolic = %require_complete (constants.%require_complete.ba97e8.1)]
 // CHECK:STDOUT:   %Eats.impl_witness: <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.bf3c30.1)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %Eats.type.loc26_49.2 [symbolic = %require_complete (constants.%require_complete.ba97e8.1)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   impl: %.loc26_38 as %Eats.type.loc26_49.1 {
 // CHECK:STDOUT:   !members:
@@ -459,7 +459,6 @@ fn F() {
 // CHECK:STDOUT:   %T.binding.as_type => constants.%T.binding.as_type.38d
 // CHECK:STDOUT:   %U.binding.as_type => constants.%U.binding.as_type
 // CHECK:STDOUT:   %Eats.type.loc26_49.2 => constants.%Eats.type.797e0d.1
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.ba97e8.1
 // CHECK:STDOUT:   %Eats.impl_witness => constants.%Eats.impl_witness.bf3c30.1
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -501,10 +500,10 @@ fn F() {
 // CHECK:STDOUT:   %T.binding.as_type => constants.%A.binding.as_type
 // CHECK:STDOUT:   %U.binding.as_type => constants.%Food.binding.as_type.1b8
 // CHECK:STDOUT:   %Eats.type.loc26_49.2 => constants.%Eats.type.797e0d.2
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.ba97e8.2
 // CHECK:STDOUT:   %Eats.impl_witness => constants.%Eats.impl_witness.bf3c30.2
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%require_complete.ba97e8.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @Feed(constants.%Food.81f, constants.%Eats.facet.2c1) {
@@ -546,10 +545,10 @@ 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.cee
-// CHECK:STDOUT:   %require_complete => constants.%complete_type.eba
 // CHECK:STDOUT:   %Eats.impl_witness => constants.%Eats.impl_witness.6b7
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%complete_type.eba
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @Eats(constants.%Grass) {

+ 1 - 1
toolchain/check/testdata/facet/fail_convert_class_type_to_generic_facet_value.carbon

@@ -58,12 +58,12 @@ fn G() {
 // CHECK:STDOUT:   %WrongGenericParam: type = class_type @WrongGenericParam [concrete]
 // CHECK:STDOUT:   %ImplsGeneric: type = class_type @ImplsGeneric [concrete]
 // CHECK:STDOUT:   %Generic.type.621: type = facet_type <@Generic, @Generic(%GenericParam)> [concrete]
+// CHECK:STDOUT:   %Generic.impl_witness: <witness> = impl_witness file.%Generic.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.473: %Generic.type.621 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %Generic.F.type.4cf: type = fn_type @Generic.F, @Generic(%GenericParam) [concrete]
 // CHECK:STDOUT:   %Generic.F.118: %Generic.F.type.4cf = struct_value () [concrete]
 // CHECK:STDOUT:   %Generic.assoc_type.713: type = assoc_entity_type @Generic, @Generic(%GenericParam) [concrete]
 // CHECK:STDOUT:   %assoc0.4e0: %Generic.assoc_type.713 = assoc_entity element0, @Generic.%Generic.F.decl [concrete]
-// CHECK:STDOUT:   %Generic.impl_witness: <witness> = impl_witness file.%Generic.impl_witness_table [concrete]
 // CHECK:STDOUT:   %ImplsGeneric.as.Generic.impl.F.type: type = fn_type @ImplsGeneric.as.Generic.impl.F [concrete]
 // CHECK:STDOUT:   %ImplsGeneric.as.Generic.impl.F: %ImplsGeneric.as.Generic.impl.F.type = struct_value () [concrete]
 // CHECK:STDOUT:   %Generic.facet: %Generic.type.621 = facet_value %ImplsGeneric, (%Generic.impl_witness) [concrete]

+ 1 - 1
toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon

@@ -60,8 +60,8 @@ 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.b66: type = facet_type <@ImplicitAs, @ImplicitAs(%RuntimeConvertTo)> [concrete]
-// CHECK:STDOUT:   %ImplicitAs.Convert.type.50a: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%RuntimeConvertTo) [concrete]
 // CHECK:STDOUT:   %ImplicitAs.impl_witness: <witness> = impl_witness file.%ImplicitAs.impl_witness_table [concrete]
+// CHECK:STDOUT:   %ImplicitAs.Convert.type.50a: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%RuntimeConvertTo) [concrete]
 // CHECK:STDOUT:   %pattern_type.f64: type = pattern_type %RuntimeConvertFrom [concrete]
 // CHECK:STDOUT:   %pattern_type.109: type = pattern_type %RuntimeConvertTo [concrete]
 // CHECK:STDOUT:   %RuntimeConvertFrom.as.ImplicitAs.impl.Convert.type: type = fn_type @RuntimeConvertFrom.as.ImplicitAs.impl.Convert [concrete]

+ 3 - 3
toolchain/check/testdata/for/actual.carbon

@@ -87,7 +87,6 @@ fn Read(y:! Core.IntLiteral()) {
 // CHECK:STDOUT:   %Copy.lookup_impl_witness.7a8: <witness> = lookup_impl_witness %Int.fc6021.1, @Copy [symbolic]
 // CHECK:STDOUT:   %Copy.facet.118: %Copy.type = facet_value %Int.fc6021.1, (%Copy.lookup_impl_witness.7a8) [symbolic]
 // CHECK:STDOUT:   %Iterate_where.type: type = facet_type <@Iterate where %impl.elem1.ff5 = %Int.fc6021.1 and %impl.elem0.546 = %Copy.facet.118> [symbolic]
-// CHECK:STDOUT:   %require_complete.fbb: <witness> = require_complete_type %Iterate_where.type [symbolic]
 // CHECK:STDOUT:   %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete]
 // CHECK:STDOUT:   %Optional.type: type = generic_class_type @Optional [concrete]
 // CHECK:STDOUT:   %Optional.generic: %Optional.type = struct_value () [concrete]
@@ -97,6 +96,7 @@ fn Read(y:! Core.IntLiteral()) {
 // 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: <witness> = impl_witness @IntRange.%Iterate.impl_witness_table, @IntRange.as.Iterate.impl(%N) [symbolic]
+// CHECK:STDOUT:   %require_complete.fbb: <witness> = 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]
 // CHECK:STDOUT:   %ptr.c9c: type = ptr_type %Int.fc6021.1 [symbolic]
@@ -303,10 +303,10 @@ fn Read(y:! Core.IntLiteral()) {
 // CHECK:STDOUT:   %Copy.lookup_impl_witness: <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:   %require_complete: <witness> = require_complete_type %Iterate_where.type [symbolic = %require_complete (constants.%require_complete.fbb)]
 // CHECK:STDOUT:   %Iterate.impl_witness: <witness> = impl_witness @IntRange.%Iterate.impl_witness_table, @IntRange.as.Iterate.impl(%N) [symbolic = %Iterate.impl_witness (constants.%Iterate.impl_witness)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %Iterate_where.type [symbolic = %require_complete (constants.%require_complete.fbb)]
 // CHECK:STDOUT:   %IntRange.as.Iterate.impl.NewCursor.type: type = fn_type @IntRange.as.Iterate.impl.NewCursor, @IntRange.as.Iterate.impl(%N) [symbolic = %IntRange.as.Iterate.impl.NewCursor.type (constants.%IntRange.as.Iterate.impl.NewCursor.type)]
 // CHECK:STDOUT:   %IntRange.as.Iterate.impl.NewCursor: @IntRange.as.Iterate.impl.%IntRange.as.Iterate.impl.NewCursor.type (%IntRange.as.Iterate.impl.NewCursor.type) = struct_value () [symbolic = %IntRange.as.Iterate.impl.NewCursor (constants.%IntRange.as.Iterate.impl.NewCursor)]
 // CHECK:STDOUT:   %.loc11: require_specific_def_type = require_specific_def @T.binding.as_type.as.OptionalStorage.impl(%Copy.facet.loc9_85.1) [symbolic = %.loc11 (constants.%.4f3)]
@@ -766,10 +766,10 @@ 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:   %require_complete => constants.%require_complete.fbb
 // CHECK:STDOUT:   %Iterate.impl_witness => constants.%Iterate.impl_witness
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%require_complete.fbb
 // CHECK:STDOUT:   %IntRange.as.Iterate.impl.NewCursor.type => constants.%IntRange.as.Iterate.impl.NewCursor.type
 // CHECK:STDOUT:   %IntRange.as.Iterate.impl.NewCursor => constants.%IntRange.as.Iterate.impl.NewCursor
 // CHECK:STDOUT:   %.loc11 => constants.%.4f3

+ 4 - 4
toolchain/check/testdata/function/builtin/call_from_operator.carbon

@@ -99,43 +99,43 @@ 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.f1c: type = facet_type <@AddWith, @AddWith(%i32.builtin)> [concrete]
+// CHECK:STDOUT:   %AddWith.impl_witness: <witness> = impl_witness file.%AddWith.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.0e1: %AddWith.type.f1c = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %AddWith.Op.type.efc: type = fn_type @AddWith.Op, @AddWith(%i32.builtin) [concrete]
 // CHECK:STDOUT:   %AddWith.Op.a62: %AddWith.Op.type.efc = struct_value () [concrete]
 // CHECK:STDOUT:   %AddWith.assoc_type.a65: type = assoc_entity_type @AddWith, @AddWith(%i32.builtin) [concrete]
 // CHECK:STDOUT:   %assoc0.e6d: %AddWith.assoc_type.a65 = assoc_entity element0, @AddWith.%AddWith.Op.decl [concrete]
-// CHECK:STDOUT:   %AddWith.impl_witness: <witness> = impl_witness file.%AddWith.impl_witness_table [concrete]
 // CHECK:STDOUT:   %pattern_type.956: type = pattern_type %i32.builtin [concrete]
 // CHECK:STDOUT:   %i32.builtin.as.AddWith.impl.Op.type: type = fn_type @i32.builtin.as.AddWith.impl.Op [concrete]
 // CHECK:STDOUT:   %i32.builtin.as.AddWith.impl.Op: %i32.builtin.as.AddWith.impl.Op.type = struct_value () [concrete]
 // CHECK:STDOUT:   %AddWith.facet: %AddWith.type.f1c = facet_value %i32.builtin, (%AddWith.impl_witness) [concrete]
 // CHECK:STDOUT:   %As.type.cf8: type = facet_type <@As, @As(%i32.builtin)> [concrete]
+// CHECK:STDOUT:   %As.impl_witness: <witness> = impl_witness file.%As.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.311: %As.type.cf8 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %As.Convert.type.c0d: type = fn_type @As.Convert, @As(%i32.builtin) [concrete]
 // CHECK:STDOUT:   %As.Convert.713: %As.Convert.type.c0d = struct_value () [concrete]
 // CHECK:STDOUT:   %As.assoc_type.b9b: type = assoc_entity_type @As, @As(%i32.builtin) [concrete]
 // CHECK:STDOUT:   %assoc0.779: %As.assoc_type.b9b = assoc_entity element0, @As.%As.Convert.decl [concrete]
-// CHECK:STDOUT:   %As.impl_witness: <witness> = impl_witness file.%As.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Core.IntLiteral.as.As.impl.Convert.type: type = fn_type @Core.IntLiteral.as.As.impl.Convert [concrete]
 // CHECK:STDOUT:   %Core.IntLiteral.as.As.impl.Convert: %Core.IntLiteral.as.As.impl.Convert.type = struct_value () [concrete]
 // CHECK:STDOUT:   %As.facet: %As.type.cf8 = facet_value Core.IntLiteral, (%As.impl_witness) [concrete]
 // CHECK:STDOUT:   %ImplicitAs.type.adc: type = facet_type <@ImplicitAs, @ImplicitAs(%i32.builtin)> [concrete]
+// CHECK:STDOUT:   %ImplicitAs.impl_witness.a3a: <witness> = impl_witness file.%ImplicitAs.impl_witness_table.loc27 [concrete]
 // CHECK:STDOUT:   %Self.a59: %ImplicitAs.type.adc = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %ImplicitAs.Convert.type.752: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32.builtin) [concrete]
 // CHECK:STDOUT:   %ImplicitAs.Convert.fcc: %ImplicitAs.Convert.type.752 = struct_value () [concrete]
 // CHECK:STDOUT:   %ImplicitAs.assoc_type.1cf: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%i32.builtin) [concrete]
 // CHECK:STDOUT:   %assoc0.2cb: %ImplicitAs.assoc_type.1cf = assoc_entity element0, @ImplicitAs.%ImplicitAs.Convert.decl [concrete]
-// CHECK:STDOUT:   %ImplicitAs.impl_witness.a3a: <witness> = impl_witness file.%ImplicitAs.impl_witness_table.loc27 [concrete]
 // CHECK:STDOUT:   %Core.IntLiteral.as.ImplicitAs.impl.Convert.type: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert [concrete]
 // CHECK:STDOUT:   %Core.IntLiteral.as.ImplicitAs.impl.Convert: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type = struct_value () [concrete]
 // CHECK:STDOUT:   %ImplicitAs.facet.7c0: %ImplicitAs.type.adc = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.a3a) [concrete]
 // CHECK:STDOUT:   %ImplicitAs.type.0d7: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete]
+// CHECK:STDOUT:   %ImplicitAs.impl_witness.942: <witness> = impl_witness file.%ImplicitAs.impl_witness_table.loc31 [concrete]
 // CHECK:STDOUT:   %Self.fba: %ImplicitAs.type.0d7 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %ImplicitAs.Convert.type.60e: type = fn_type @ImplicitAs.Convert, @ImplicitAs(Core.IntLiteral) [concrete]
 // CHECK:STDOUT:   %ImplicitAs.Convert.c73: %ImplicitAs.Convert.type.60e = struct_value () [concrete]
 // CHECK:STDOUT:   %ImplicitAs.assoc_type.014: type = assoc_entity_type @ImplicitAs, @ImplicitAs(Core.IntLiteral) [concrete]
 // CHECK:STDOUT:   %assoc0.46c: %ImplicitAs.assoc_type.014 = assoc_entity element0, @ImplicitAs.%ImplicitAs.Convert.decl [concrete]
-// CHECK:STDOUT:   %ImplicitAs.impl_witness.942: <witness> = impl_witness file.%ImplicitAs.impl_witness_table.loc31 [concrete]
 // CHECK:STDOUT:   %i32.builtin.as.ImplicitAs.impl.Convert.type: type = fn_type @i32.builtin.as.ImplicitAs.impl.Convert [concrete]
 // CHECK:STDOUT:   %i32.builtin.as.ImplicitAs.impl.Convert: %i32.builtin.as.ImplicitAs.impl.Convert.type = struct_value () [concrete]
 // CHECK:STDOUT:   %ImplicitAs.facet.4f3: %ImplicitAs.type.0d7 = facet_value %i32.builtin, (%ImplicitAs.impl_witness.942) [concrete]

+ 1 - 1
toolchain/check/testdata/function/generic/call_method_on_generic_facet.carbon

@@ -59,12 +59,12 @@ fn G() {
 // CHECK:STDOUT:   %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
 // CHECK:STDOUT:   %ImplsGeneric: type = class_type @ImplsGeneric [concrete]
 // CHECK:STDOUT:   %Generic.type.621: type = facet_type <@Generic, @Generic(%GenericParam)> [concrete]
+// CHECK:STDOUT:   %Generic.impl_witness: <witness> = impl_witness file.%Generic.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.473: %Generic.type.621 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %Generic.F.type.4cf: type = fn_type @Generic.F, @Generic(%GenericParam) [concrete]
 // CHECK:STDOUT:   %Generic.F.118: %Generic.F.type.4cf = struct_value () [concrete]
 // CHECK:STDOUT:   %Generic.assoc_type.713: type = assoc_entity_type @Generic, @Generic(%GenericParam) [concrete]
 // CHECK:STDOUT:   %assoc0.4e0: %Generic.assoc_type.713 = assoc_entity element0, @Generic.%Generic.F.decl [concrete]
-// CHECK:STDOUT:   %Generic.impl_witness: <witness> = impl_witness file.%Generic.impl_witness_table [concrete]
 // CHECK:STDOUT:   %ImplsGeneric.as.Generic.impl.F.type: type = fn_type @ImplsGeneric.as.Generic.impl.F [concrete]
 // CHECK:STDOUT:   %ImplsGeneric.as.Generic.impl.F: %ImplsGeneric.as.Generic.impl.F.type = struct_value () [concrete]
 // CHECK:STDOUT:   %Generic.facet: %Generic.type.621 = facet_value %ImplsGeneric, (%Generic.impl_witness) [concrete]

+ 2 - 3
toolchain/check/testdata/generic/dot_self_symbolic_type.carbon

@@ -330,8 +330,8 @@ fn H(T:! type) {
 // CHECK:STDOUT:   %BB.binding.as_type: type = symbolic_binding_type BB, 1, %BB.965 [symbolic]
 // CHECK:STDOUT:   %ptr.e8f8f9.1: type = ptr_type %AA [symbolic]
 // CHECK:STDOUT:   %B.type.32966c.1: type = facet_type <@B, @B(%ptr.e8f8f9.1)> [symbolic]
-// CHECK:STDOUT:   %require_complete.f59d26.1: <witness> = require_complete_type %B.type.32966c.1 [symbolic]
 // CHECK:STDOUT:   %B.impl_witness.1e2: <witness> = impl_witness file.%B.impl_witness_table.loc9, @BB.binding.as_type.as.B.impl(%AA, %BB.965) [symbolic]
+// CHECK:STDOUT:   %require_complete.f59d26.1: <witness> = require_complete_type %B.type.32966c.1 [symbolic]
 // CHECK:STDOUT:   %DD: type = symbolic_binding DD, 0 [symbolic]
 // CHECK:STDOUT:   %D.9b4: type = class_type @D, @D(%DD) [symbolic]
 // CHECK:STDOUT:   %T.091: type = symbolic_binding T, 1 [symbolic]
@@ -408,10 +408,10 @@ 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.32966c.1)]
-// CHECK:STDOUT:   %require_complete.loc9_62: <witness> = require_complete_type %B.type.loc9_62.2 [symbolic = %require_complete.loc9_62 (constants.%require_complete.f59d26.1)]
 // CHECK:STDOUT:   %B.impl_witness: <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.1e2)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete.loc9_62: <witness> = require_complete_type %B.type.loc9_62.2 [symbolic = %require_complete.loc9_62 (constants.%require_complete.f59d26.1)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   impl: %.loc9_51 as %B.type.loc9_62.1 {
 // CHECK:STDOUT:   !members:
@@ -477,7 +477,6 @@ 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.32966c.1
-// CHECK:STDOUT:   %require_complete.loc9_62 => constants.%require_complete.f59d26.1
 // CHECK:STDOUT:   %B.impl_witness => constants.%B.impl_witness.1e2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 1 - 1
toolchain/check/testdata/generic/template/convert.carbon

@@ -98,8 +98,8 @@ 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.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
 // CHECK:STDOUT:   %ImplicitAs.impl_witness.f19: <witness> = impl_witness @C.%ImplicitAs.impl_witness_table [concrete]
+// CHECK:STDOUT:   %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
 // CHECK:STDOUT:   %pattern_type.c48: type = pattern_type %C [concrete]
 // CHECK:STDOUT:   %C.as.ImplicitAs.impl.Convert.type: type = fn_type @C.as.ImplicitAs.impl.Convert [concrete]
 // CHECK:STDOUT:   %C.as.ImplicitAs.impl.Convert: %C.as.ImplicitAs.impl.Convert.type = struct_value () [concrete]

+ 1 - 1
toolchain/check/testdata/impl/assoc_const_self.carbon

@@ -398,8 +398,8 @@ 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.396: type = facet_type <@ImplicitAs, @ImplicitAs(%C)> [concrete]
-// CHECK:STDOUT:   %ImplicitAs.Convert.type.56d: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%C) [concrete]
 // CHECK:STDOUT:   %ImplicitAs.impl_witness: <witness> = impl_witness file.%ImplicitAs.impl_witness_table [concrete]
+// CHECK:STDOUT:   %ImplicitAs.Convert.type.56d: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%C) [concrete]
 // CHECK:STDOUT:   %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
 // CHECK:STDOUT:   %pattern_type.c48: type = pattern_type %C [concrete]
 // CHECK:STDOUT:   %empty_tuple.type.as.ImplicitAs.impl.Convert.type: type = fn_type @empty_tuple.type.as.ImplicitAs.impl.Convert [concrete]

+ 4 - 4
toolchain/check/testdata/impl/extend_impl_generic.carbon

@@ -79,12 +79,12 @@ class X(U:! type) {
 // CHECK:STDOUT:   %complete_type.1ec: <witness> = complete_type_witness %struct_type.x.ed6 [concrete]
 // CHECK:STDOUT:   %C: type = class_type @C [concrete]
 // CHECK:STDOUT:   %HasF.type.aca: type = facet_type <@HasF, @HasF(%Param)> [concrete]
+// CHECK:STDOUT:   %HasF.impl_witness: <witness> = impl_witness @C.%HasF.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.866: %HasF.type.aca = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %HasF.F.type.7f1: type = fn_type @HasF.F, @HasF(%Param) [concrete]
 // CHECK:STDOUT:   %HasF.F.eff: %HasF.F.type.7f1 = struct_value () [concrete]
 // CHECK:STDOUT:   %HasF.assoc_type.257: type = assoc_entity_type @HasF, @HasF(%Param) [concrete]
 // CHECK:STDOUT:   %assoc0.65a: %HasF.assoc_type.257 = assoc_entity element0, @HasF.%HasF.F.decl [concrete]
-// CHECK:STDOUT:   %HasF.impl_witness: <witness> = impl_witness @C.%HasF.impl_witness_table [concrete]
 // CHECK:STDOUT:   %pattern_type.b01: type = pattern_type %Param [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]
@@ -400,13 +400,13 @@ 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.17e1af.2: type = facet_type <@I, @I(%U)> [symbolic]
+// CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness @X.%I.impl_witness_table, @X.as.I.impl(%U) [symbolic]
 // CHECK:STDOUT:   %Self.4d2d4e.2: %I.type.17e1af.2 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %I.F.type.224f2c.2: type = fn_type @I.F, @I(%U) [symbolic]
 // CHECK:STDOUT:   %I.F.56f2ca.2: %I.F.type.224f2c.2 = struct_value () [symbolic]
 // CHECK:STDOUT:   %I.assoc_type.3157fa.2: type = assoc_entity_type @I, @I(%U) [symbolic]
 // CHECK:STDOUT:   %assoc0.2fb04f.2: %I.assoc_type.3157fa.2 = assoc_entity element0, @I.%I.F.decl [symbolic]
 // CHECK:STDOUT:   %require_complete.78e: <witness> = require_complete_type %I.type.17e1af.2 [symbolic]
-// CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness @X.%I.impl_witness_table, @X.as.I.impl(%U) [symbolic]
 // CHECK:STDOUT:   %pattern_type.acb: type = pattern_type %X [symbolic]
 // CHECK:STDOUT:   %pattern_type.51d1c4.2: type = pattern_type %U [symbolic]
 // CHECK:STDOUT:   %X.as.I.impl.F.type: type = fn_type @X.as.I.impl.F, @X.as.I.impl(%U) [symbolic]
@@ -494,10 +494,10 @@ 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.17e1af.2)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type.loc9_21.1 [symbolic = %require_complete (constants.%require_complete.78e)]
 // CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness @X.%I.impl_witness_table, @X.as.I.impl(%U) [symbolic = %I.impl_witness (constants.%I.impl_witness)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type.loc9_21.1 [symbolic = %require_complete (constants.%require_complete.78e)]
 // CHECK:STDOUT:   %X.as.I.impl.F.type: type = fn_type @X.as.I.impl.F, @X.as.I.impl(%U) [symbolic = %X.as.I.impl.F.type (constants.%X.as.I.impl.F.type)]
 // CHECK:STDOUT:   %X.as.I.impl.F: @X.as.I.impl.%X.as.I.impl.F.type (%X.as.I.impl.F.type) = struct_value () [symbolic = %X.as.I.impl.F (constants.%X.as.I.impl.F)]
 // CHECK:STDOUT:
@@ -620,10 +620,10 @@ class X(U:! type) {
 // CHECK:STDOUT:   %U => constants.%U
 // CHECK:STDOUT:   %X => constants.%X
 // CHECK:STDOUT:   %I.type.loc9_21.1 => constants.%I.type.17e1af.2
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.78e
 // CHECK:STDOUT:   %I.impl_witness => constants.%I.impl_witness
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%require_complete.78e
 // CHECK:STDOUT:   %X.as.I.impl.F.type => constants.%X.as.I.impl.F.type
 // CHECK:STDOUT:   %X.as.I.impl.F => constants.%X.as.I.impl.F
 // CHECK:STDOUT: }

+ 3 - 14
toolchain/check/testdata/impl/fail_extend_impl_forall.carbon

@@ -43,13 +43,12 @@ 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:   %require_complete.e87: <witness> = require_complete_type %GenericInterface.type.6bb [symbolic]
 // CHECK:STDOUT:   %GenericInterface.impl_witness: <witness> = impl_witness @C.%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]
 // CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
-// CHECK:STDOUT:   %require_complete.944: <witness> = require_complete_type %T [symbolic]
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %T [symbolic]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -102,7 +101,6 @@ 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.6bb)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %GenericInterface.type.loc24_54.1 [symbolic = %require_complete (constants.%require_complete.e87)]
 // CHECK:STDOUT:   %GenericInterface.impl_witness: <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:
 // CHECK:STDOUT: !definition:
@@ -137,7 +135,7 @@ 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 (<error>), @C.as.GenericInterface.impl [concrete]
+// CHECK:STDOUT:   %GenericInterface.impl_witness_table = impl_witness_table (), @C.as.GenericInterface.impl [concrete]
 // CHECK:STDOUT:   %GenericInterface.impl_witness: <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: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
 // CHECK:STDOUT:   complete_type_witness = %complete_type
@@ -160,7 +158,7 @@ class C {
 // CHECK:STDOUT:   %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.51d)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %T [symbolic = %require_complete (constants.%require_complete.944)]
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %T [symbolic = %require_complete (constants.%require_complete)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   fn(%x.param: @C.as.GenericInterface.impl.F.%T (%T)) {
 // CHECK:STDOUT:   !entry:
@@ -170,14 +168,6 @@ class C {
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @GenericInterface(constants.%T) {
 // CHECK:STDOUT:   %T.loc15_28.1 => constants.%T
-// CHECK:STDOUT:
-// CHECK:STDOUT: !definition:
-// CHECK:STDOUT:   %GenericInterface.type => constants.%GenericInterface.type.6bb
-// CHECK:STDOUT:   %Self.loc15_38.2 => constants.%Self
-// CHECK:STDOUT:   %GenericInterface.F.type => constants.%GenericInterface.F.type
-// CHECK:STDOUT:   %GenericInterface.F => constants.%GenericInterface.F
-// CHECK:STDOUT:   %GenericInterface.assoc_type => constants.%GenericInterface.assoc_type
-// CHECK:STDOUT:   %assoc0.loc16_13.2 => constants.%assoc0
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @GenericInterface.F(constants.%T, constants.%Self) {
@@ -188,7 +178,6 @@ 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.6bb
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.e87
 // CHECK:STDOUT:   %GenericInterface.impl_witness => constants.%GenericInterface.impl_witness
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:

+ 2 - 3
toolchain/check/testdata/impl/forward_decls.carbon

@@ -1928,8 +1928,8 @@ interface I {
 // CHECK:STDOUT:   %I.lookup_impl_witness: <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:   %require_complete: <witness> = require_complete_type %I_where.type [symbolic]
 // CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness @I.F.%I.impl_witness_table, @C.as.I.impl(%Self) [symbolic]
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I_where.type [symbolic]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
@@ -1974,10 +1974,10 @@ 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:   %require_complete: <witness> = require_complete_type %I_where.type [symbolic = %require_complete (constants.%require_complete)]
 // CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness @I.F.%I.impl_witness_table, @C.as.I.impl(%Self) [symbolic = %I.impl_witness (constants.%I.impl_witness)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = 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:   !members:
@@ -2055,7 +2055,6 @@ interface I {
 // CHECK:STDOUT:   %Self => constants.%Self
 // CHECK:STDOUT:   %C => constants.%C
 // CHECK:STDOUT:   %I_where.type => constants.%I_where.type
-// CHECK:STDOUT:   %require_complete => constants.%require_complete
 // CHECK:STDOUT:   %I.impl_witness => constants.%I.impl_witness
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 12 - 18
toolchain/check/testdata/impl/import_generic.carbon

@@ -317,11 +317,11 @@ impl forall [T:! type] D as N(T*) {}
 // CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type.17e [symbolic]
 // CHECK:STDOUT:   %empty_struct: %empty_struct_type = struct_value () [concrete]
 // CHECK:STDOUT:   %J.type.457: type = facet_type <@J, @J(%empty_struct_type)> [concrete]
+// CHECK:STDOUT:   %J.impl_witness: <witness> = impl_witness file.%J.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.5cb: %J.type.457 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %I.type.399: type = facet_type <@I, @I(%empty_struct_type)> [concrete]
 // CHECK:STDOUT:   %Self.5c3: %I.type.399 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %complete_type.e4b: <witness> = complete_type_witness %I.type.399 [concrete]
-// CHECK:STDOUT:   %J.impl_witness: <witness> = impl_witness file.%J.impl_witness_table [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
@@ -587,10 +587,10 @@ 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.399: type = facet_type <@I, @I(%empty_struct_type)> [concrete]
+// CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.84c873.2: %J.type.b8d23b.2 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %Self.5c3: %I.type.399 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %complete_type.e4b: <witness> = complete_type_witness %I.type.399 [concrete]
-// CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
@@ -747,9 +747,9 @@ impl forall [T:! type] D as N(T*) {}
 // CHECK:STDOUT:   %require_complete.78e: <witness> = require_complete_type %I.type.17e [symbolic]
 // CHECK:STDOUT:   %ptr: type = ptr_type %T [symbolic]
 // CHECK:STDOUT:   %I.type.dc0: type = facet_type <@I, @I(%ptr)> [symbolic]
+// CHECK:STDOUT:   %I.impl_witness.919: <witness> = impl_witness file.%I.impl_witness_table.loc12, @C.as.I.impl.747(%T) [symbolic]
 // CHECK:STDOUT:   %Self.075: %I.type.dc0 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %require_complete.ad1: <witness> = require_complete_type %I.type.dc0 [symbolic]
-// CHECK:STDOUT:   %I.impl_witness.919: <witness> = impl_witness file.%I.impl_witness_table.loc12, @C.as.I.impl.747(%T) [symbolic]
 // CHECK:STDOUT:   %N.type.673: type = generic_named_constaint_type @N [concrete]
 // CHECK:STDOUT:   %empty_struct: %N.type.673 = struct_value () [concrete]
 // CHECK:STDOUT:   %N.type.b8d: type = facet_type <@N, @N(%T)> [symbolic]
@@ -889,10 +889,10 @@ 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.dc0)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type.loc12_33.2 [symbolic = %require_complete (constants.%require_complete.ad1)]
 // CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table.loc12, @C.as.I.impl.747(%T.loc12_14.2) [symbolic = %I.impl_witness (constants.%I.impl_witness.919)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type.loc12_33.2 [symbolic = %require_complete (constants.%require_complete.ad1)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   impl: %C.ref as %I.type.loc12_33.1 {
 // CHECK:STDOUT:   !members:
@@ -934,7 +934,6 @@ 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.dc0
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.ad1
 // CHECK:STDOUT:   %I.impl_witness => constants.%I.impl_witness.919
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -1140,10 +1139,10 @@ impl forall [T:! type] D as N(T*) {}
 // CHECK:STDOUT:   %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
 // CHECK:STDOUT:   %ptr: type = ptr_type %T [symbolic = %ptr (constants.%ptr)]
 // CHECK:STDOUT:   %I.type: type = facet_type <@I, @I(%ptr)> [symbolic = %I.type (constants.%I.type.dc0)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type [symbolic = %require_complete (constants.%require_complete.ad1)]
 // CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness imports.%I.impl_witness_table.a32, @C.as.I.impl.7478ee.1(%T) [symbolic = %I.impl_witness (constants.%I.impl_witness.919)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type [symbolic = %require_complete (constants.%require_complete.ad1)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   impl: imports.%Main.import_ref.29aca8.2 as imports.%Main.import_ref.96b {
 // CHECK:STDOUT:   !members:
@@ -1239,7 +1238,6 @@ impl forall [T:! type] D as N(T*) {}
 // CHECK:STDOUT:   %T => constants.%T
 // CHECK:STDOUT:   %ptr => constants.%ptr
 // CHECK:STDOUT:   %I.type => constants.%I.type.dc0
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.ad1
 // CHECK:STDOUT:   %I.impl_witness => constants.%I.impl_witness.919
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -1314,8 +1312,8 @@ impl forall [T:! type] D as N(T*) {}
 // CHECK:STDOUT:   %I.generic: %I.type.dac = struct_value () [concrete]
 // CHECK:STDOUT:   %I.type.17e: type = facet_type <@I, @I(%T)> [symbolic]
 // CHECK:STDOUT:   %Self.4d2: %I.type.17e = symbolic_binding Self, 1 [symbolic]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type.17e [symbolic]
 // CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%T) [symbolic]
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type.17e [symbolic]
 // CHECK:STDOUT:   %N.type.673: type = generic_named_constaint_type @N [concrete]
 // CHECK:STDOUT:   %empty_struct: %N.type.673 = struct_value () [concrete]
 // CHECK:STDOUT:   %N.type.b8d: type = facet_type <@N, @N(%T)> [symbolic]
@@ -1417,10 +1415,10 @@ 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.17e)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type.loc7_32.2 [symbolic = %require_complete (constants.%require_complete)]
 // CHECK:STDOUT:   %I.impl_witness: <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:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = 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:   !members:
@@ -1447,7 +1445,6 @@ 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.17e
-// CHECK:STDOUT:   %require_complete => constants.%require_complete
 // CHECK:STDOUT:   %I.impl_witness => constants.%I.impl_witness
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -1481,9 +1478,9 @@ 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.dc0: type = facet_type <@I, @I(%ptr.e8f)> [symbolic]
+// CHECK:STDOUT:   %I.impl_witness.919: <witness> = impl_witness file.%I.impl_witness_table.loc5, @C.as.I.impl.747(%T) [symbolic]
 // CHECK:STDOUT:   %Self.c3a: %I.type.dc0 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %require_complete.ad1: <witness> = require_complete_type %I.type.dc0 [symbolic]
-// CHECK:STDOUT:   %I.impl_witness.919: <witness> = impl_witness file.%I.impl_witness_table.loc5, @C.as.I.impl.747(%T) [symbolic]
 // CHECK:STDOUT:   %N.type.673: type = generic_named_constaint_type @N [concrete]
 // CHECK:STDOUT:   %empty_struct: %N.type.673 = struct_value () [concrete]
 // CHECK:STDOUT:   %N.type.b8d23b.1: type = facet_type <@N, @N(%T)> [symbolic]
@@ -1492,10 +1489,10 @@ 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.31b: type = facet_type <@I, @I(%ptr.125)> [symbolic]
+// CHECK:STDOUT:   %I.impl_witness.7a3: <witness> = impl_witness file.%I.impl_witness_table.loc6, @C.as.I.impl.3f8(%T) [symbolic]
 // CHECK:STDOUT:   %Self.84c873.2: %N.type.b8d23b.2 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %require_complete.f5e: <witness> = require_complete_type %I.type.31b [symbolic]
 // CHECK:STDOUT:   %require_complete.a37: <witness> = require_complete_type %N.type.b8d23b.2 [symbolic]
-// CHECK:STDOUT:   %I.impl_witness.7a3: <witness> = impl_witness file.%I.impl_witness_table.loc6, @C.as.I.impl.3f8(%T) [symbolic]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
@@ -1603,10 +1600,10 @@ impl forall [T:! type] D as N(T*) {}
 // CHECK:STDOUT: generic impl @C.as.I.impl.e59(imports.%Main.import_ref.b3bc94.2: type) [from "import_generic_with_different_specific.carbon"] {
 // CHECK:STDOUT:   %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
 // CHECK:STDOUT:   %I.type: type = facet_type <@I, @I(%T)> [symbolic = %I.type (constants.%I.type.17e)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type [symbolic = %require_complete (constants.%require_complete.78e)]
 // CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness imports.%I.impl_witness_table, @C.as.I.impl.e59(%T) [symbolic = %I.impl_witness (constants.%I.impl_witness.ff6)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type [symbolic = %require_complete (constants.%require_complete.78e)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   impl: imports.%Main.import_ref.29a as imports.%Main.import_ref.022367.1 {
 // CHECK:STDOUT:   !members:
@@ -1618,10 +1615,10 @@ 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.dc0)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type.loc5_33.2 [symbolic = %require_complete (constants.%require_complete.ad1)]
 // CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table.loc5, @C.as.I.impl.747(%T.loc5_14.2) [symbolic = %I.impl_witness (constants.%I.impl_witness.919)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type.loc5_33.2 [symbolic = %require_complete (constants.%require_complete.ad1)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   impl: %C.ref as %I.type.loc5_33.1 {
 // CHECK:STDOUT:   !members:
@@ -1634,10 +1631,10 @@ 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:   %require_complete: <witness> = require_complete_type %N.type.loc6_34.2 [symbolic = %require_complete (constants.%require_complete.a37)]
 // CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table.loc6, @C.as.I.impl.3f8(%T.loc6_14.2) [symbolic = %I.impl_witness (constants.%I.impl_witness.7a3)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = 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:   !members:
@@ -1663,7 +1660,6 @@ impl forall [T:! type] D as N(T*) {}
 // CHECK:STDOUT: specific @C.as.I.impl.e59(constants.%T) {
 // CHECK:STDOUT:   %T => constants.%T
 // CHECK:STDOUT:   %I.type => constants.%I.type.17e
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.78e
 // CHECK:STDOUT:   %I.impl_witness => constants.%I.impl_witness.ff6
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -1679,7 +1675,6 @@ 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.dc0
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.ad1
 // CHECK:STDOUT:   %I.impl_witness => constants.%I.impl_witness.919
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -1722,7 +1717,6 @@ 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:   %require_complete => constants.%require_complete.a37
 // CHECK:STDOUT:   %I.impl_witness => constants.%I.impl_witness.7a3
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 1 - 1
toolchain/check/testdata/impl/import_self.carbon

@@ -128,11 +128,11 @@ fn F(x: C, y: C) -> C {
 // CHECK:STDOUT:   %complete_type: <witness> = 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: <witness> = impl_witness file.%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]
 // CHECK:STDOUT:   %pattern_type.327: type = pattern_type %Self.binding.as_type [symbolic]
-// CHECK:STDOUT:   %Add.impl_witness: <witness> = impl_witness file.%Add.impl_witness_table [concrete]
 // CHECK:STDOUT:   %pattern_type.c48: type = pattern_type %C [concrete]
 // CHECK:STDOUT:   %C.as.Add.impl.Op.type: type = fn_type @C.as.Add.impl.Op [concrete]
 // CHECK:STDOUT:   %C.as.Add.impl.Op: %C.as.Add.impl.Op.type = struct_value () [concrete]

+ 1 - 1
toolchain/check/testdata/impl/import_thunk.carbon

@@ -118,10 +118,10 @@ fn G() {
 // CHECK:STDOUT:   %C.ba4d67.2: type = class_type @C, @C(%Y) [symbolic]
 // CHECK:STDOUT:   %I.type: type = facet_type <@I> [concrete]
 // CHECK:STDOUT:   %Self.cfb: %I.type = symbolic_binding Self, 0 [symbolic]
+// CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%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]
-// CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%Y) [symbolic]
 // CHECK:STDOUT:   %pattern_type.1f0: type = pattern_type %C.ba4d67.2 [symbolic]
 // CHECK:STDOUT:   %C.as.I.impl.F.type.daf36e.1: type = fn_type @C.as.I.impl.F.loc8_17.1, @C.as.I.impl(%Y) [symbolic]
 // CHECK:STDOUT:   %C.as.I.impl.F.4ad35d.1: %C.as.I.impl.F.type.daf36e.1 = struct_value () [symbolic]

+ 6 - 0
toolchain/check/testdata/impl/incomplete.carbon

@@ -250,6 +250,7 @@ interface B {
 // CHECK:STDOUT:   %C: type = class_type @C [concrete]
 // CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
 // CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
+// CHECK:STDOUT:   %J.impl_witness: <witness> = impl_witness file.%J.impl_witness_table [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -268,6 +269,8 @@ 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: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: interface @J;
@@ -294,6 +297,7 @@ interface B {
 // CHECK:STDOUT:   %C: type = class_type @C [concrete]
 // CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
 // CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
+// CHECK:STDOUT:   %J.impl_witness: <witness> = impl_witness file.%J.impl_witness_table [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -307,6 +311,8 @@ 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: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: interface @J;

+ 2 - 2
toolchain/check/testdata/impl/interface_args.carbon

@@ -230,12 +230,12 @@ 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.74f: type = facet_type <@Action, @Action(%B)> [concrete]
+// CHECK:STDOUT:   %Action.impl_witness: <witness> = impl_witness file.%Action.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.cdb: %Action.type.74f = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %Action.Op.type.54d: type = fn_type @Action.Op, @Action(%B) [concrete]
 // CHECK:STDOUT:   %Action.Op.dba: %Action.Op.type.54d = struct_value () [concrete]
 // CHECK:STDOUT:   %Action.assoc_type.4ee: type = assoc_entity_type @Action, @Action(%B) [concrete]
 // CHECK:STDOUT:   %assoc0.c5f: %Action.assoc_type.4ee = assoc_entity element0, @Action.%Action.Op.decl [concrete]
-// CHECK:STDOUT:   %Action.impl_witness: <witness> = impl_witness file.%Action.impl_witness_table [concrete]
 // CHECK:STDOUT:   %pattern_type.c10: type = pattern_type %A [concrete]
 // CHECK:STDOUT:   %A.as.Action.impl.Op.type: type = fn_type @A.as.Action.impl.Op [concrete]
 // CHECK:STDOUT:   %A.as.Action.impl.Op: %A.as.Action.impl.Op.type = struct_value () [concrete]
@@ -829,6 +829,7 @@ fn InstanceC(a: A) -> C {
 // CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
 // CHECK:STDOUT:   %B: type = class_type @B [concrete]
 // CHECK:STDOUT:   %Factory.type.3cb: type = facet_type <@Factory, @Factory(%B)> [concrete]
+// CHECK:STDOUT:   %Factory.impl_witness: <witness> = impl_witness file.%Factory.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.bbe: %Factory.type.3cb = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %Factory.Make.type.c59: type = fn_type @Factory.Make, @Factory(%B) [concrete]
 // CHECK:STDOUT:   %Factory.Make.efe: %Factory.Make.type.c59 = struct_value () [concrete]
@@ -837,7 +838,6 @@ fn InstanceC(a: A) -> C {
 // CHECK:STDOUT:   %Factory.Method.type.117: type = fn_type @Factory.Method, @Factory(%B) [concrete]
 // CHECK:STDOUT:   %Factory.Method.ea9: %Factory.Method.type.117 = struct_value () [concrete]
 // CHECK:STDOUT:   %assoc1.f1d: %Factory.assoc_type.579 = assoc_entity element1, @Factory.%Factory.Method.decl [concrete]
-// CHECK:STDOUT:   %Factory.impl_witness: <witness> = impl_witness file.%Factory.impl_witness_table [concrete]
 // CHECK:STDOUT:   %pattern_type.049: type = pattern_type %B [concrete]
 // CHECK:STDOUT:   %A.as.Factory.impl.Make.type: type = fn_type @A.as.Factory.impl.Make [concrete]
 // CHECK:STDOUT:   %A.as.Factory.impl.Make: %A.as.Factory.impl.Make.type = struct_value () [concrete]

+ 9 - 9
toolchain/check/testdata/impl/lookup/generic.carbon

@@ -860,8 +860,8 @@ fn G(x: A) {
 // CHECK:STDOUT:   %assoc0.5fd: %HasF.assoc_type.b89 = 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:   %require_complete: <witness> = require_complete_type %HasF.type.70a [symbolic]
 // CHECK:STDOUT:   %HasF.impl_witness.18a: <witness> = impl_witness file.%HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(%T) [symbolic]
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %HasF.type.70a [symbolic]
 // CHECK:STDOUT:   %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
 // CHECK:STDOUT:   %empty_struct_type.as.HasF.impl.F.type.b46: type = fn_type @empty_struct_type.as.HasF.impl.F, @empty_struct_type.as.HasF.impl(%T) [symbolic]
 // CHECK:STDOUT:   %empty_struct_type.as.HasF.impl.F.d27: %empty_struct_type.as.HasF.impl.F.type.b46 = struct_value () [symbolic]
@@ -874,8 +874,8 @@ fn G(x: A) {
 // CHECK:STDOUT:   %HasF.F.418: %HasF.F.type.b0b = struct_value () [concrete]
 // CHECK:STDOUT:   %HasF.assoc_type.9e4: type = assoc_entity_type @HasF, @HasF(%empty_struct_type) [concrete]
 // CHECK:STDOUT:   %assoc0.3d8: %HasF.assoc_type.9e4 = assoc_entity element0, @HasF.%HasF.F.decl [concrete]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %HasF.type.48b [concrete]
 // CHECK:STDOUT:   %HasF.impl_witness.139: <witness> = impl_witness file.%HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(%empty_struct_type) [concrete]
+// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %HasF.type.48b [concrete]
 // CHECK:STDOUT:   %empty_struct_type.as.HasF.impl.F.type.5e5: 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.5b8: %empty_struct_type.as.HasF.impl.F.type.5e5 = struct_value () [concrete]
 // CHECK:STDOUT:   %HasF.facet.752: %HasF.type.48b = facet_value %empty_struct_type, (%HasF.impl_witness.139) [concrete]
@@ -969,10 +969,10 @@ 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.70a)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %HasF.type.loc8_36.1 [symbolic = %require_complete (constants.%require_complete)]
 // CHECK:STDOUT:   %HasF.impl_witness: <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.18a)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %HasF.type.loc8_36.1 [symbolic = %require_complete (constants.%require_complete)]
 // CHECK:STDOUT:   %empty_struct_type.as.HasF.impl.F.type: type = fn_type @empty_struct_type.as.HasF.impl.F, @empty_struct_type.as.HasF.impl(%T.loc8_14.1) [symbolic = %empty_struct_type.as.HasF.impl.F.type (constants.%empty_struct_type.as.HasF.impl.F.type.b46)]
 // CHECK:STDOUT:   %empty_struct_type.as.HasF.impl.F: @empty_struct_type.as.HasF.impl.%empty_struct_type.as.HasF.impl.F.type (%empty_struct_type.as.HasF.impl.F.type.b46) = struct_value () [symbolic = %empty_struct_type.as.HasF.impl.F (constants.%empty_struct_type.as.HasF.impl.F.d27)]
 // CHECK:STDOUT:
@@ -1051,10 +1051,10 @@ 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.70a
-// CHECK:STDOUT:   %require_complete => constants.%require_complete
 // CHECK:STDOUT:   %HasF.impl_witness => constants.%HasF.impl_witness.18a
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%require_complete
 // CHECK:STDOUT:   %empty_struct_type.as.HasF.impl.F.type => constants.%empty_struct_type.as.HasF.impl.F.type.b46
 // CHECK:STDOUT:   %empty_struct_type.as.HasF.impl.F => constants.%empty_struct_type.as.HasF.impl.F.d27
 // CHECK:STDOUT: }
@@ -1084,10 +1084,10 @@ 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.48b
-// CHECK:STDOUT:   %require_complete => constants.%complete_type
 // CHECK:STDOUT:   %HasF.impl_witness => constants.%HasF.impl_witness.139
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%complete_type
 // CHECK:STDOUT:   %empty_struct_type.as.HasF.impl.F.type => constants.%empty_struct_type.as.HasF.impl.F.type.5e5
 // CHECK:STDOUT:   %empty_struct_type.as.HasF.impl.F => constants.%empty_struct_type.as.HasF.impl.F.5b8
 // CHECK:STDOUT: }
@@ -1150,7 +1150,7 @@ 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 (<error>), @T.as.HasF.impl [concrete]
+// CHECK:STDOUT:   %HasF.impl_witness_table = impl_witness_table (), @T.as.HasF.impl [concrete]
 // CHECK:STDOUT:   %HasF.impl_witness: <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]
@@ -1281,8 +1281,8 @@ fn G(x: A) {
 // CHECK:STDOUT:   %HasF.F.8e5: %HasF.F.type.626 = struct_value () [symbolic]
 // CHECK:STDOUT:   %HasF.assoc_type.b89: type = assoc_entity_type @HasF, @HasF(%T) [symbolic]
 // CHECK:STDOUT:   %assoc0.5fd: %HasF.assoc_type.b89 = assoc_entity element0, @HasF.%HasF.F.decl [symbolic]
-// CHECK:STDOUT:   %require_complete.62b: <witness> = require_complete_type %HasF.type.70a [symbolic]
 // CHECK:STDOUT:   %HasF.impl_witness: <witness> = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T) [symbolic]
+// CHECK:STDOUT:   %require_complete.62b: <witness> = require_complete_type %HasF.type.70a [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]
 // CHECK:STDOUT:   %T.as.HasF.impl.F: %T.as.HasF.impl.F.type = struct_value () [symbolic]
@@ -1389,10 +1389,10 @@ 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.70a)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %HasF.type.loc8_35.1 [symbolic = %require_complete (constants.%require_complete.62b)]
 // CHECK:STDOUT:   %HasF.impl_witness: <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:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %HasF.type.loc8_35.1 [symbolic = %require_complete (constants.%require_complete.62b)]
 // 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)]
 // CHECK:STDOUT:   %T.as.HasF.impl.F: @T.as.HasF.impl.%T.as.HasF.impl.F.type (%T.as.HasF.impl.F.type) = struct_value () [symbolic = %T.as.HasF.impl.F (constants.%T.as.HasF.impl.F)]
 // CHECK:STDOUT:
@@ -1485,10 +1485,10 @@ 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.70a
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.62b
 // CHECK:STDOUT:   %HasF.impl_witness => constants.%HasF.impl_witness
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%require_complete.62b
 // CHECK:STDOUT:   %T.as.HasF.impl.F.type => constants.%T.as.HasF.impl.F.type
 // CHECK:STDOUT:   %T.as.HasF.impl.F => constants.%T.as.HasF.impl.F
 // CHECK:STDOUT: }

+ 6 - 6
toolchain/check/testdata/impl/lookup/impl_forall.carbon

@@ -53,8 +53,8 @@ fn TestSpecific(a: A({})*) -> {}* {
 // CHECK:STDOUT:   %V.67d: type = symbolic_binding V, 0 [symbolic]
 // CHECK:STDOUT:   %A.53a34d.2: type = class_type @A, @A(%V.67d) [symbolic]
 // CHECK:STDOUT:   %I.type.17e1af.2: type = facet_type <@I, @I(%V.67d)> [symbolic]
-// CHECK:STDOUT:   %require_complete.78e5ab.1: <witness> = require_complete_type %I.type.17e1af.2 [symbolic]
 // CHECK:STDOUT:   %I.impl_witness.0bfe08.1: <witness> = impl_witness file.%I.impl_witness_table, @A.as.I.impl(%V.67d) [symbolic]
+// CHECK:STDOUT:   %require_complete.78e5ab.1: <witness> = require_complete_type %I.type.17e1af.2 [symbolic]
 // CHECK:STDOUT:   %pattern_type.cd82af.1: type = pattern_type %A.53a34d.2 [symbolic]
 // CHECK:STDOUT:   %ptr.e8f8f9.2: type = ptr_type %V.67d [symbolic]
 // CHECK:STDOUT:   %pattern_type.4f4b84.2: type = pattern_type %ptr.e8f8f9.2 [symbolic]
@@ -104,8 +104,8 @@ fn TestSpecific(a: A({})*) -> {}* {
 // CHECK:STDOUT:   %I.F.type.684: type = fn_type @I.F, @I(%empty_struct_type) [concrete]
 // CHECK:STDOUT:   %I.assoc_type.22c: type = assoc_entity_type @I, @I(%empty_struct_type) [concrete]
 // CHECK:STDOUT:   %assoc0.703: %I.assoc_type.22c = assoc_entity element0, @I.%I.F.decl [concrete]
-// CHECK:STDOUT:   %complete_type.e4b: <witness> = complete_type_witness %I.type.399 [concrete]
 // CHECK:STDOUT:   %I.impl_witness.276: <witness> = impl_witness file.%I.impl_witness_table, @A.as.I.impl(%empty_struct_type) [concrete]
+// CHECK:STDOUT:   %complete_type.e4b: <witness> = complete_type_witness %I.type.399 [concrete]
 // CHECK:STDOUT:   %A.as.I.impl.F.type.152: type = fn_type @A.as.I.impl.F, @A.as.I.impl(%empty_struct_type) [concrete]
 // CHECK:STDOUT:   %A.as.I.impl.F.da7: %A.as.I.impl.F.type.152 = struct_value () [concrete]
 // CHECK:STDOUT:   %I.facet.bef: %I.type.399 = facet_value %A.235, (%I.impl_witness.276) [concrete]
@@ -151,10 +151,10 @@ fn TestSpecific(a: A({})*) -> {}* {
 // 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.53a34d.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.17e1af.2)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type.loc12_35.1 [symbolic = %require_complete (constants.%require_complete.78e5ab.1)]
 // CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table, @A.as.I.impl(%V.loc12_14.1) [symbolic = %I.impl_witness (constants.%I.impl_witness.0bfe08.1)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %I.type.loc12_35.1 [symbolic = %require_complete (constants.%require_complete.78e5ab.1)]
 // CHECK:STDOUT:   %A.as.I.impl.F.type: type = fn_type @A.as.I.impl.F, @A.as.I.impl(%V.loc12_14.1) [symbolic = %A.as.I.impl.F.type (constants.%A.as.I.impl.F.type.ba58cf.1)]
 // CHECK:STDOUT:   %A.as.I.impl.F: @A.as.I.impl.%A.as.I.impl.F.type (%A.as.I.impl.F.type.ba58cf.1) = struct_value () [symbolic = %A.as.I.impl.F (constants.%A.as.I.impl.F.cdfcf8.1)]
 // CHECK:STDOUT:
@@ -272,10 +272,10 @@ fn TestSpecific(a: A({})*) -> {}* {
 // CHECK:STDOUT:   %V.loc12_14.1 => constants.%V.67d
 // CHECK:STDOUT:   %A.loc12_27.1 => constants.%A.53a34d.2
 // CHECK:STDOUT:   %I.type.loc12_35.1 => constants.%I.type.17e1af.2
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.78e5ab.1
 // CHECK:STDOUT:   %I.impl_witness => constants.%I.impl_witness.0bfe08.1
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%require_complete.78e5ab.1
 // CHECK:STDOUT:   %A.as.I.impl.F.type => constants.%A.as.I.impl.F.type.ba58cf.1
 // CHECK:STDOUT:   %A.as.I.impl.F => constants.%A.as.I.impl.F.cdfcf8.1
 // CHECK:STDOUT: }
@@ -301,10 +301,10 @@ fn TestSpecific(a: A({})*) -> {}* {
 // CHECK:STDOUT:   %V.loc12_14.1 => constants.%W
 // CHECK:STDOUT:   %A.loc12_27.1 => constants.%A.53a34d.3
 // CHECK:STDOUT:   %I.type.loc12_35.1 => constants.%I.type.17e1af.3
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.78e5ab.2
 // CHECK:STDOUT:   %I.impl_witness => constants.%I.impl_witness.0bfe08.2
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%require_complete.78e5ab.2
 // CHECK:STDOUT:   %A.as.I.impl.F.type => constants.%A.as.I.impl.F.type.ba58cf.2
 // CHECK:STDOUT:   %A.as.I.impl.F => constants.%A.as.I.impl.F.cdfcf8.2
 // CHECK:STDOUT: }
@@ -313,10 +313,10 @@ fn TestSpecific(a: A({})*) -> {}* {
 // CHECK:STDOUT:   %V.loc12_14.1 => constants.%empty_struct_type
 // CHECK:STDOUT:   %A.loc12_27.1 => constants.%A.235
 // CHECK:STDOUT:   %I.type.loc12_35.1 => constants.%I.type.399
-// CHECK:STDOUT:   %require_complete => constants.%complete_type.e4b
 // CHECK:STDOUT:   %I.impl_witness => constants.%I.impl_witness.276
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%complete_type.e4b
 // CHECK:STDOUT:   %A.as.I.impl.F.type => constants.%A.as.I.impl.F.type.152
 // CHECK:STDOUT:   %A.as.I.impl.F => constants.%A.as.I.impl.F.da7
 // CHECK:STDOUT: }

+ 3 - 3
toolchain/check/testdata/impl/lookup/import.carbon

@@ -362,11 +362,11 @@ fn Test(c: HasExtraInterfaces.C(type)) {
 // CHECK:STDOUT:   %HasG.facet.a10: %HasG.type = facet_value %C, (%HasG.impl_witness.c63) [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: <witness> = impl_witness file.%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]
 // CHECK:STDOUT:   %pattern_type.81a: type = pattern_type %Self.binding.as_type.0b1 [symbolic]
-// CHECK:STDOUT:   %HasF.impl_witness: <witness> = impl_witness file.%HasF.impl_witness_table [concrete]
 // CHECK:STDOUT:   %pattern_type.510: type = pattern_type %D [concrete]
 // 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]
@@ -1482,12 +1482,12 @@ fn Test(c: HasExtraInterfaces.C(type)) {
 // CHECK:STDOUT:   %AnyParam.241: type = class_type @AnyParam, @AnyParam(%GenericInterface.type.c92, %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: <witness> = impl_witness file.%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]
 // CHECK:STDOUT:   %pattern_type.125: type = pattern_type %Self.binding.as_type.6ce [symbolic]
 // CHECK:STDOUT:   %require_complete.bbd: <witness> = require_complete_type %Self.binding.as_type.6ce [symbolic]
-// CHECK:STDOUT:   %Y.impl_witness: <witness> = impl_witness file.%Y.impl_witness_table [concrete]
 // CHECK:STDOUT:   %pattern_type.004: type = pattern_type %AnyParam.241 [concrete]
 // CHECK:STDOUT:   %AnyParam.as.Y.impl.K.type: type = fn_type @AnyParam.as.Y.impl.K [concrete]
 // CHECK:STDOUT:   %AnyParam.as.Y.impl.K: %AnyParam.as.Y.impl.K.type = struct_value () [concrete]
@@ -1929,12 +1929,12 @@ fn Test(c: HasExtraInterfaces.C(type)) {
 // CHECK:STDOUT:   %AnyParam.0dd: 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: <witness> = impl_witness file.%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]
 // CHECK:STDOUT:   %pattern_type.125: type = pattern_type %Self.binding.as_type.6ce [symbolic]
 // CHECK:STDOUT:   %require_complete.bbd: <witness> = require_complete_type %Self.binding.as_type.6ce [symbolic]
-// CHECK:STDOUT:   %Y.impl_witness: <witness> = impl_witness file.%Y.impl_witness_table [concrete]
 // CHECK:STDOUT:   %pattern_type.64f: type = pattern_type %AnyParam.0dd [concrete]
 // CHECK:STDOUT:   %AnyParam.as.Y.impl.K.type: type = fn_type @AnyParam.as.Y.impl.K [concrete]
 // CHECK:STDOUT:   %AnyParam.as.Y.impl.K: %AnyParam.as.Y.impl.K.type = struct_value () [concrete]

+ 4 - 5
toolchain/check/testdata/impl/lookup/lookup_interface_with_enclosing_generic_inside_rewrite_constraint.carbon

@@ -420,8 +420,8 @@ fn F() {
 // CHECK:STDOUT:   %Outer.G.type.c9b: type = fn_type @Outer.G, @Outer(%OuterParam) [symbolic]
 // CHECK:STDOUT:   %Outer.G.c0d: %Outer.G.type.c9b = struct_value () [symbolic]
 // CHECK:STDOUT:   %C.dde: type = class_type @C, @C(%OuterParam) [symbolic]
-// CHECK:STDOUT:   %require_complete.44e: <witness> = require_complete_type %Y_where.type.725 [symbolic]
 // CHECK:STDOUT:   %Y.impl_witness.c7c: <witness> = impl_witness @Outer.%Y.impl_witness_table, @C.as.Y.impl(%OuterParam) [symbolic]
+// CHECK:STDOUT:   %require_complete.44e: <witness> = require_complete_type %Y_where.type.725 [symbolic]
 // CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
 // CHECK:STDOUT:   %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
 // CHECK:STDOUT:   %Z1.impl_witness: <witness> = impl_witness file.%Z1.impl_witness_table [concrete]
@@ -455,8 +455,8 @@ fn F() {
 // CHECK:STDOUT:   %assoc0.84b: %Y.assoc_type.38c = assoc_entity element0, @Y.%T [concrete]
 // CHECK:STDOUT:   %complete_type.7f3: <witness> = complete_type_witness %Y.type.048 [concrete]
 // CHECK:STDOUT:   %.Self.binding.as_type.40e: type = symbolic_binding_type .Self, %.Self.7f5 [symbolic_self]
-// CHECK:STDOUT:   %complete_type.1f8: <witness> = complete_type_witness %Y_where.type.973 [concrete]
 // CHECK:STDOUT:   %Y.impl_witness.5ad: <witness> = impl_witness @Outer.%Y.impl_witness_table, @C.as.Y.impl(%Z1.facet) [concrete]
+// CHECK:STDOUT:   %complete_type.1f8: <witness> = complete_type_witness %Y_where.type.973 [concrete]
 // CHECK:STDOUT:   %facet_value.ea5: %Y_where.type.973 = facet_value %C.b33, (%Y.impl_witness.5ad) [concrete]
 // CHECK:STDOUT:   %pattern_type.395a: type = pattern_type %Y_where.type.973 [concrete]
 // CHECK:STDOUT:   %Outer.G.specific_fn: <specific function> = specific_function %Outer.G.2d7, @Outer.G(%Z1.facet, %facet_value.ea5) [concrete]
@@ -569,10 +569,10 @@ fn F() {
 // CHECK:STDOUT:   %Y.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.2, @Y, @Y(%OuterParam) [symbolic = %Y.lookup_impl_witness (constants.%Y.lookup_impl_witness.77f)]
 // 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.419)]
 // 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.725)]
-// CHECK:STDOUT:   %require_complete.loc14_15: <witness> = require_complete_type %Y_where.type [symbolic = %require_complete.loc14_15 (constants.%require_complete.44e)]
 // CHECK:STDOUT:   %Y.impl_witness: <witness> = impl_witness @Outer.%Y.impl_witness_table, @C.as.Y.impl(%OuterParam) [symbolic = %Y.impl_witness (constants.%Y.impl_witness.c7c)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete.loc14_15: <witness> = require_complete_type %Y_where.type [symbolic = %require_complete.loc14_15 (constants.%require_complete.44e)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   impl: %C.ref as %.loc14_15 {
 // CHECK:STDOUT:   !members:
@@ -779,7 +779,6 @@ fn F() {
 // CHECK:STDOUT:   %Y.lookup_impl_witness => constants.%Y.lookup_impl_witness.77f
 // CHECK:STDOUT:   %impl.elem0.loc14_21.2 => constants.%impl.elem0.419
 // CHECK:STDOUT:   %Y_where.type => constants.%Y_where.type.725
-// CHECK:STDOUT:   %require_complete.loc14_15 => constants.%require_complete.44e
 // CHECK:STDOUT:   %Y.impl_witness => constants.%Y.impl_witness.c7c
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -816,10 +815,10 @@ fn F() {
 // CHECK:STDOUT:   %Y.lookup_impl_witness => constants.%Y.lookup_impl_witness.bd2
 // CHECK:STDOUT:   %impl.elem0.loc14_21.2 => constants.%impl.elem0.92a
 // CHECK:STDOUT:   %Y_where.type => constants.%Y_where.type.973
-// CHECK:STDOUT:   %require_complete.loc14_15 => constants.%complete_type.1f8
 // CHECK:STDOUT:   %Y.impl_witness => constants.%Y.impl_witness.5ad
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete.loc14_15 => constants.%complete_type.1f8
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @Outer.G(constants.%Z1.facet, constants.%facet_value.ea5) {

+ 22 - 29
toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon

@@ -123,8 +123,8 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT:   %impl.elem0.4fb: type = impl_witness_access %Z.lookup_impl_witness.165, element0 [symbolic]
 // CHECK:STDOUT:   %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
 // CHECK:STDOUT:   %Z_where.type.949: type = facet_type <@Z, @Z(%S) where %impl.elem0.4fb = %empty_tuple.type> [symbolic]
-// CHECK:STDOUT:   %require_complete.a66: <witness> = require_complete_type %Z_where.type.949 [symbolic]
 // CHECK:STDOUT:   %Z.impl_witness.20c: <witness> = impl_witness file.%Z.impl_witness_table.loc9, @T.as.Z.impl.506(%T.67d, %S) [symbolic]
+// CHECK:STDOUT:   %require_complete.a66: <witness> = require_complete_type %Z_where.type.949 [symbolic]
 // CHECK:STDOUT:   %Z.type.a71: type = facet_type <@Z, @Z(%C)> [concrete]
 // CHECK:STDOUT:   %.Self.dc9: %Z.type.a71 = symbolic_binding .Self [symbolic_self]
 // CHECK:STDOUT:   %Self.44a: %Z.type.a71 = symbolic_binding Self, 1 [symbolic]
@@ -134,8 +134,8 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT:   %Z.lookup_impl_witness.309: <witness> = lookup_impl_witness %.Self.dc9, @Z, @Z(%C) [symbolic_self]
 // CHECK:STDOUT:   %impl.elem0.dd6: type = impl_witness_access %Z.lookup_impl_witness.309, element0 [symbolic_self]
 // CHECK:STDOUT:   %Z_where.type.3a7: type = facet_type <@Z, @Z(%C) where %impl.elem0.dd6 = %T.67d> [symbolic]
-// CHECK:STDOUT:   %require_complete.4bc: <witness> = require_complete_type %Z_where.type.3a7 [symbolic]
 // CHECK:STDOUT:   %Z.impl_witness.ae6: <witness> = impl_witness file.%Z.impl_witness_table.loc11, @T.as.Z.impl.365(%T.67d) [symbolic]
+// CHECK:STDOUT:   %require_complete.4bc: <witness> = require_complete_type %Z_where.type.3a7 [symbolic]
 // CHECK:STDOUT:   %T.5ba: %Z.type.a71 = symbolic_binding T, 0 [symbolic]
 // CHECK:STDOUT:   %pattern_type.6dc: type = pattern_type %Z.type.a71 [concrete]
 // CHECK:STDOUT:   %T.binding.as_type: type = symbolic_binding_type T, 0, %T.5ba [symbolic]
@@ -144,8 +144,8 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT:   %F: %F.type = struct_value () [concrete]
 // CHECK:STDOUT:   %require_complete.244: <witness> = require_complete_type %T.binding.as_type [symbolic]
 // CHECK:STDOUT:   %Z_where.type.6de: type = facet_type <@Z, @Z(%C) where %impl.elem0.dd6 = %T.binding.as_type> [symbolic]
-// CHECK:STDOUT:   %require_complete.435: <witness> = require_complete_type %Z_where.type.6de [symbolic]
 // CHECK:STDOUT:   %Z.impl_witness.c63: <witness> = impl_witness file.%Z.impl_witness_table.loc11, @T.as.Z.impl.365(%T.binding.as_type) [symbolic]
+// CHECK:STDOUT:   %require_complete.435: <witness> = require_complete_type %Z_where.type.6de [symbolic]
 // CHECK:STDOUT:   %.69b: require_specific_def_type = require_specific_def @T.as.Z.impl.365(%T.binding.as_type) [symbolic]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -287,10 +287,10 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT:   %Z.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.4, @Z, @Z(%S.loc9_24.2) [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness.165)]
 // 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.4fb)]
 // 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.949)]
-// CHECK:STDOUT:   %require_complete.loc9_44: <witness> = require_complete_type %Z_where.type [symbolic = %require_complete.loc9_44 (constants.%require_complete.a66)]
 // CHECK:STDOUT:   %Z.impl_witness: <witness> = impl_witness file.%Z.impl_witness_table.loc9, @T.as.Z.impl.506(%T.loc9_14.2, %S.loc9_24.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.20c)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete.loc9_44: <witness> = require_complete_type %Z_where.type [symbolic = %require_complete.loc9_44 (constants.%require_complete.a66)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   impl: %T.ref as %.loc9_44 {
 // CHECK:STDOUT:   !members:
@@ -301,10 +301,10 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT: generic impl @T.as.Z.impl.365(%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.dd6 = %T.loc11_20.2> [symbolic = %Z_where.type (constants.%Z_where.type.3a7)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %Z_where.type [symbolic = %require_complete (constants.%require_complete.4bc)]
 // CHECK:STDOUT:   %Z.impl_witness: <witness> = impl_witness file.%Z.impl_witness_table.loc11, @T.as.Z.impl.365(%T.loc11_20.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.ae6)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %Z_where.type [symbolic = %require_complete (constants.%require_complete.4bc)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   impl: %T.ref.loc11_30 as %.loc11_40 {
 // CHECK:STDOUT:   !members:
@@ -379,7 +379,6 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT:   %Z.lookup_impl_witness => constants.%Z.lookup_impl_witness.165
 // CHECK:STDOUT:   %impl.elem0.loc9_50.2 => constants.%impl.elem0.4fb
 // CHECK:STDOUT:   %Z_where.type => constants.%Z_where.type.949
-// CHECK:STDOUT:   %require_complete.loc9_44 => constants.%require_complete.a66
 // CHECK:STDOUT:   %Z.impl_witness => constants.%Z.impl_witness.20c
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -398,7 +397,6 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT: specific @T.as.Z.impl.365(constants.%T.67d) {
 // CHECK:STDOUT:   %T.loc11_20.2 => constants.%T.67d
 // CHECK:STDOUT:   %Z_where.type => constants.%Z_where.type.3a7
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.4bc
 // CHECK:STDOUT:   %Z.impl_witness => constants.%Z.impl_witness.ae6
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -411,10 +409,10 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT: specific @T.as.Z.impl.365(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.6de
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.435
 // CHECK:STDOUT:   %Z.impl_witness => constants.%Z.impl_witness.c63
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%require_complete.435
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @X(constants.%C, constants.%T.5ba) {}
@@ -450,8 +448,8 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT:   %impl.elem0.4fb: type = impl_witness_access %Z.lookup_impl_witness.165, element0 [symbolic]
 // CHECK:STDOUT:   %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
 // CHECK:STDOUT:   %Z_where.type.949: type = facet_type <@Z, @Z(%S) where %impl.elem0.4fb = %empty_tuple.type> [symbolic]
-// CHECK:STDOUT:   %require_complete.a66: <witness> = require_complete_type %Z_where.type.949 [symbolic]
 // CHECK:STDOUT:   %Z.impl_witness.20c: <witness> = impl_witness file.%Z.impl_witness_table.loc10, @T.as.Z.impl.506(%T.67d, %S) [symbolic]
+// CHECK:STDOUT:   %require_complete.a66: <witness> = require_complete_type %Z_where.type.949 [symbolic]
 // CHECK:STDOUT:   %Z.type.a71: type = facet_type <@Z, @Z(%C)> [concrete]
 // CHECK:STDOUT:   %.Self.dc9: %Z.type.a71 = symbolic_binding .Self [symbolic_self]
 // CHECK:STDOUT:   %Self.44a: %Z.type.a71 = symbolic_binding Self, 1 [symbolic]
@@ -461,8 +459,8 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT:   %Z.lookup_impl_witness.309: <witness> = lookup_impl_witness %.Self.dc9, @Z, @Z(%C) [symbolic_self]
 // CHECK:STDOUT:   %impl.elem0.dd6: type = impl_witness_access %Z.lookup_impl_witness.309, element0 [symbolic_self]
 // CHECK:STDOUT:   %Z_where.type.3a7: type = facet_type <@Z, @Z(%C) where %impl.elem0.dd6 = %T.67d> [symbolic]
-// CHECK:STDOUT:   %require_complete.4bc: <witness> = require_complete_type %Z_where.type.3a7 [symbolic]
 // CHECK:STDOUT:   %Z.impl_witness.ae6: <witness> = impl_witness file.%Z.impl_witness_table.loc12, @T.as.Z.impl.365(%T.67d) [symbolic]
+// CHECK:STDOUT:   %require_complete.4bc: <witness> = require_complete_type %Z_where.type.3a7 [symbolic]
 // CHECK:STDOUT:   %T.5ba: %Z.type.a71 = symbolic_binding T, 0 [symbolic]
 // CHECK:STDOUT:   %pattern_type.6dc: type = pattern_type %Z.type.a71 [concrete]
 // CHECK:STDOUT:   %T.binding.as_type: type = symbolic_binding_type T, 0, %T.5ba [symbolic]
@@ -642,10 +640,10 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT:   %Z.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.4, @Z, @Z(%S.loc10_24.2) [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness.165)]
 // 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.4fb)]
 // 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.949)]
-// CHECK:STDOUT:   %require_complete.loc10_44: <witness> = require_complete_type %Z_where.type [symbolic = %require_complete.loc10_44 (constants.%require_complete.a66)]
 // CHECK:STDOUT:   %Z.impl_witness: <witness> = impl_witness file.%Z.impl_witness_table.loc10, @T.as.Z.impl.506(%T.loc10_14.2, %S.loc10_24.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.20c)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete.loc10_44: <witness> = require_complete_type %Z_where.type [symbolic = %require_complete.loc10_44 (constants.%require_complete.a66)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   impl: %T.ref as %.loc10_44 {
 // CHECK:STDOUT:   !members:
@@ -656,10 +654,10 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT: generic impl @T.as.Z.impl.365(%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.dd6 = %T.loc12_14.2> [symbolic = %Z_where.type (constants.%Z_where.type.3a7)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %Z_where.type [symbolic = %require_complete (constants.%require_complete.4bc)]
 // CHECK:STDOUT:   %Z.impl_witness: <witness> = impl_witness file.%Z.impl_witness_table.loc12, @T.as.Z.impl.365(%T.loc12_14.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.ae6)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %Z_where.type [symbolic = %require_complete (constants.%require_complete.4bc)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   impl: %T.ref.loc12_24 as %.loc12_34 {
 // CHECK:STDOUT:   !members:
@@ -744,7 +742,6 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT:   %Z.lookup_impl_witness => constants.%Z.lookup_impl_witness.165
 // CHECK:STDOUT:   %impl.elem0.loc10_50.2 => constants.%impl.elem0.4fb
 // CHECK:STDOUT:   %Z_where.type => constants.%Z_where.type.949
-// CHECK:STDOUT:   %require_complete.loc10_44 => constants.%require_complete.a66
 // CHECK:STDOUT:   %Z.impl_witness => constants.%Z.impl_witness.20c
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -763,7 +760,6 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT: specific @T.as.Z.impl.365(constants.%T.67d) {
 // CHECK:STDOUT:   %T.loc12_14.2 => constants.%T.67d
 // CHECK:STDOUT:   %Z_where.type => constants.%Z_where.type.3a7
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.4bc
 // CHECK:STDOUT:   %Z.impl_witness => constants.%Z.impl_witness.ae6
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -792,14 +788,14 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT:   %impl.elem0.5f5: 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.300a2d.1: type = facet_type <@Ptr where %impl.elem0.5f5 = %ptr.e8f8f9.1> [symbolic]
-// CHECK:STDOUT:   %require_complete.49f764.1: <witness> = require_complete_type %Ptr_where.type.300a2d.1 [symbolic]
 // CHECK:STDOUT:   %Ptr.impl_witness.31e287.1: <witness> = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%U.67d) [symbolic]
+// CHECK:STDOUT:   %require_complete.49f764.1: <witness> = require_complete_type %Ptr_where.type.300a2d.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.300a2d.2: type = facet_type <@Ptr where %impl.elem0.5f5 = %ptr.e8f8f9.2> [symbolic]
-// CHECK:STDOUT:   %require_complete.49f764.2: <witness> = require_complete_type %Ptr_where.type.300a2d.2 [symbolic]
 // CHECK:STDOUT:   %Ptr.impl_witness.31e287.2: <witness> = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.67d) [symbolic]
+// CHECK:STDOUT:   %require_complete.49f764.2: <witness> = require_complete_type %Ptr_where.type.300a2d.2 [symbolic]
 // CHECK:STDOUT:   %.45d: 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.31e287.2) [symbolic]
 // CHECK:STDOUT:   %pattern_type.4f4: type = pattern_type %ptr.e8f8f9.2 [symbolic]
@@ -903,10 +899,10 @@ 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.5f5 = %ptr.loc7_54.2> [symbolic = %Ptr_where.type (constants.%Ptr_where.type.300a2d.1)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %Ptr_where.type [symbolic = %require_complete (constants.%require_complete.49f764.1)]
 // CHECK:STDOUT:   %Ptr.impl_witness: <witness> = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%U.loc7_20.2) [symbolic = %Ptr.impl_witness (constants.%Ptr.impl_witness.31e287.1)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %Ptr_where.type [symbolic = %require_complete (constants.%require_complete.49f764.1)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   impl: %U.ref.loc7_30 as %.loc7_39 {
 // CHECK:STDOUT:   !members:
@@ -954,7 +950,6 @@ 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.300a2d.1
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.49f764.1
 // CHECK:STDOUT:   %Ptr.impl_witness => constants.%Ptr.impl_witness.31e287.1
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -962,10 +957,10 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // 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.300a2d.2
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.49f764.2
 // CHECK:STDOUT:   %Ptr.impl_witness => constants.%Ptr.impl_witness.31e287.2
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%require_complete.49f764.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @Type(constants.%Ptr.facet) {}
@@ -997,16 +992,16 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT:   %impl.elem0.5f5: 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.300: type = facet_type <@Ptr where %impl.elem0.5f5 = %ptr.e8f8f9.1> [symbolic]
-// CHECK:STDOUT:   %require_complete.49f: <witness> = require_complete_type %Ptr_where.type.300 [symbolic]
 // CHECK:STDOUT:   %Ptr.impl_witness.31e: <witness> = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%U.67d) [symbolic]
+// CHECK:STDOUT:   %require_complete.49f: <witness> = require_complete_type %Ptr_where.type.300 [symbolic]
 // CHECK:STDOUT:   %T.52c: %Ptr.type = symbolic_binding T, 0 [symbolic]
 // CHECK:STDOUT:   %pattern_type.3d8: type = pattern_type %Ptr.type [concrete]
 // CHECK:STDOUT:   %T.binding.as_type.cdd: type = symbolic_binding_type T, 0, %T.52c [symbolic]
 // CHECK:STDOUT:   %pattern_type.e55: type = pattern_type %T.binding.as_type.cdd [symbolic]
 // CHECK:STDOUT:   %ptr.586: type = ptr_type %T.binding.as_type.cdd [symbolic]
 // CHECK:STDOUT:   %Ptr_where.type.793: type = facet_type <@Ptr where %impl.elem0.5f5 = %ptr.586> [symbolic]
-// CHECK:STDOUT:   %require_complete.cc6: <witness> = require_complete_type %Ptr_where.type.793 [symbolic]
 // CHECK:STDOUT:   %Ptr.impl_witness.682: <witness> = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.binding.as_type.cdd) [symbolic]
+// CHECK:STDOUT:   %require_complete.cc6: <witness> = require_complete_type %Ptr_where.type.793 [symbolic]
 // CHECK:STDOUT:   %.672: require_specific_def_type = require_specific_def @U.as.Ptr.impl(%T.binding.as_type.cdd) [symbolic]
 // CHECK:STDOUT:   %pattern_type.cd0: type = pattern_type %ptr.586 [symbolic]
 // CHECK:STDOUT:   %F.type: type = fn_type @F [concrete]
@@ -1115,10 +1110,10 @@ 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.5f5 = %ptr.loc7_54.2> [symbolic = %Ptr_where.type (constants.%Ptr_where.type.300)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %Ptr_where.type [symbolic = %require_complete (constants.%require_complete.49f)]
 // CHECK:STDOUT:   %Ptr.impl_witness: <witness> = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%U.loc7_20.2) [symbolic = %Ptr.impl_witness (constants.%Ptr.impl_witness.31e)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %Ptr_where.type [symbolic = %require_complete (constants.%require_complete.49f)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   impl: %U.ref.loc7_30 as %.loc7_39 {
 // CHECK:STDOUT:   !members:
@@ -1166,7 +1161,6 @@ 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.300
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.49f
 // CHECK:STDOUT:   %Ptr.impl_witness => constants.%Ptr.impl_witness.31e
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -1174,10 +1168,10 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT:   %U.loc7_20.2 => constants.%T.binding.as_type.cdd
 // CHECK:STDOUT:   %ptr.loc7_54.2 => constants.%ptr.586
 // CHECK:STDOUT:   %Ptr_where.type => constants.%Ptr_where.type.793
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.cc6
 // CHECK:STDOUT:   %Ptr.impl_witness => constants.%Ptr.impl_witness.682
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%require_complete.cc6
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @Type(constants.%T.52c) {}
@@ -1209,16 +1203,16 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT:   %impl.elem0.5f5: 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.300: type = facet_type <@Ptr where %impl.elem0.5f5 = %ptr.e8f8f9.1> [symbolic]
-// CHECK:STDOUT:   %require_complete.49f: <witness> = require_complete_type %Ptr_where.type.300 [symbolic]
 // CHECK:STDOUT:   %Ptr.impl_witness.31e: <witness> = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%U.67d) [symbolic]
+// CHECK:STDOUT:   %require_complete.49f: <witness> = require_complete_type %Ptr_where.type.300 [symbolic]
 // CHECK:STDOUT:   %T.52c: %Ptr.type = symbolic_binding T, 0 [symbolic]
 // CHECK:STDOUT:   %pattern_type.3d8: type = pattern_type %Ptr.type [concrete]
 // CHECK:STDOUT:   %T.binding.as_type.cdd: type = symbolic_binding_type T, 0, %T.52c [symbolic]
 // CHECK:STDOUT:   %pattern_type.e55: type = pattern_type %T.binding.as_type.cdd [symbolic]
 // CHECK:STDOUT:   %ptr.586: type = ptr_type %T.binding.as_type.cdd [symbolic]
 // CHECK:STDOUT:   %Ptr_where.type.793: type = facet_type <@Ptr where %impl.elem0.5f5 = %ptr.586> [symbolic]
-// CHECK:STDOUT:   %require_complete.cc6: <witness> = require_complete_type %Ptr_where.type.793 [symbolic]
 // CHECK:STDOUT:   %Ptr.impl_witness.682: <witness> = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%T.binding.as_type.cdd) [symbolic]
+// CHECK:STDOUT:   %require_complete.cc6: <witness> = require_complete_type %Ptr_where.type.793 [symbolic]
 // CHECK:STDOUT:   %.672: require_specific_def_type = require_specific_def @U.as.Ptr.impl(%T.binding.as_type.cdd) [symbolic]
 // CHECK:STDOUT:   %pattern_type.cd0: type = pattern_type %ptr.586 [symbolic]
 // CHECK:STDOUT:   %F.type: type = fn_type @F [concrete]
@@ -1326,10 +1320,10 @@ 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.5f5 = %ptr.loc7_54.2> [symbolic = %Ptr_where.type (constants.%Ptr_where.type.300)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %Ptr_where.type [symbolic = %require_complete (constants.%require_complete.49f)]
 // CHECK:STDOUT:   %Ptr.impl_witness: <witness> = impl_witness file.%Ptr.impl_witness_table, @U.as.Ptr.impl(%U.loc7_20.2) [symbolic = %Ptr.impl_witness (constants.%Ptr.impl_witness.31e)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %Ptr_where.type [symbolic = %require_complete (constants.%require_complete.49f)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   impl: %U.ref.loc7_30 as %.loc7_39 {
 // CHECK:STDOUT:   !members:
@@ -1377,7 +1371,6 @@ 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.300
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.49f
 // CHECK:STDOUT:   %Ptr.impl_witness => constants.%Ptr.impl_witness.31e
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -1385,10 +1378,10 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
 // CHECK:STDOUT:   %U.loc7_20.2 => constants.%T.binding.as_type.cdd
 // CHECK:STDOUT:   %ptr.loc7_54.2 => constants.%ptr.586
 // CHECK:STDOUT:   %Ptr_where.type => constants.%Ptr_where.type.793
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.cc6
 // CHECK:STDOUT:   %Ptr.impl_witness => constants.%Ptr.impl_witness.682
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%require_complete.cc6
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @Type(constants.%T.52c) {}

+ 2 - 2
toolchain/check/testdata/impl/lookup/specific_args.carbon

@@ -205,12 +205,12 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
 // CHECK:STDOUT:   %Self.binding.as_type: type = symbolic_binding_type Self, 1, %Self.213 [symbolic]
 // CHECK:STDOUT:   %pattern_type.527: type = pattern_type %Self.binding.as_type [symbolic]
 // CHECK:STDOUT:   %I.type.c61: type = facet_type <@I, @I(%InInterfaceArgs)> [concrete]
+// CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.330: %I.type.c61 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %I.F.type.14f: type = fn_type @I.F, @I(%InInterfaceArgs) [concrete]
 // CHECK:STDOUT:   %I.F.b81: %I.F.type.14f = struct_value () [concrete]
 // CHECK:STDOUT:   %I.assoc_type.521: type = assoc_entity_type @I, @I(%InInterfaceArgs) [concrete]
 // CHECK:STDOUT:   %assoc0.f82: %I.assoc_type.521 = assoc_entity element0, imports.%Main.import_ref.df4 [concrete]
-// CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
 // CHECK:STDOUT:   %pattern_type.019: type = pattern_type %X [concrete]
 // CHECK:STDOUT:   %X.as.I.impl.F.type: type = fn_type @X.as.I.impl.F [concrete]
 // CHECK:STDOUT:   %X.as.I.impl.F: %X.as.I.impl.F.type = struct_value () [concrete]
@@ -540,12 +540,12 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
 // CHECK:STDOUT:   %pattern_type.527: type = pattern_type %Self.binding.as_type [symbolic]
 // CHECK:STDOUT:   %X: type = class_type @X [concrete]
 // CHECK:STDOUT:   %I.type.95a: type = facet_type <@I, @I(%X)> [concrete]
+// CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.471: %I.type.95a = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %I.F.type.56a: type = fn_type @I.F, @I(%X) [concrete]
 // CHECK:STDOUT:   %I.F.a79: %I.F.type.56a = struct_value () [concrete]
 // CHECK:STDOUT:   %I.assoc_type.2db: type = assoc_entity_type @I, @I(%X) [concrete]
 // CHECK:STDOUT:   %assoc0.b0a: %I.assoc_type.2db = assoc_entity element0, imports.%Main.import_ref.df4 [concrete]
-// CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
 // CHECK:STDOUT:   %pattern_type.e06: type = pattern_type %C.23b [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]

+ 1 - 1
toolchain/check/testdata/impl/lookup/transitive.carbon

@@ -122,11 +122,11 @@ fn Call() {
 // CHECK:STDOUT:   %complete_type: <witness> = 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: <witness> = impl_witness file.%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]
 // CHECK:STDOUT:   %pattern_type.1f0: type = pattern_type %Self.binding.as_type [symbolic]
-// CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
 // CHECK:STDOUT:   %pattern_type.c48: 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]

+ 4 - 5
toolchain/check/testdata/impl/use_assoc_entity.carbon

@@ -4173,14 +4173,14 @@ fn F() {
 // CHECK:STDOUT:   %Z.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.a1a, @Z [symbolic_self]
 // CHECK:STDOUT:   %impl.elem0: type = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic_self]
 // CHECK:STDOUT:   %Z_where.type.bb0: type = facet_type <@Z where %impl.elem0 = %C.20b> [symbolic]
-// CHECK:STDOUT:   %require_complete.4fe: <witness> = require_complete_type %Z_where.type.bb0 [symbolic]
 // CHECK:STDOUT:   %Z.impl_witness.f43: <witness> = impl_witness file.%Z.impl_witness_table, @T.as.Z.impl(%T) [symbolic]
+// CHECK:STDOUT:   %require_complete.4fe: <witness> = require_complete_type %Z_where.type.bb0 [symbolic]
 // CHECK:STDOUT:   %F.type: type = fn_type @F [concrete]
 // CHECK:STDOUT:   %F: %F.type = struct_value () [concrete]
 // CHECK:STDOUT:   %C.131: type = class_type @C, @C(%D) [concrete]
 // CHECK:STDOUT:   %Z_where.type.a77: type = facet_type <@Z where %impl.elem0 = %C.131> [concrete]
-// CHECK:STDOUT:   %complete_type.bcc: <witness> = complete_type_witness %Z_where.type.a77 [concrete]
 // CHECK:STDOUT:   %Z.impl_witness.18a: <witness> = impl_witness file.%Z.impl_witness_table, @T.as.Z.impl(%D) [concrete]
+// CHECK:STDOUT:   %complete_type.bcc: <witness> = complete_type_witness %Z_where.type.a77 [concrete]
 // CHECK:STDOUT:   %Z.facet: %Z.type = facet_value %D, (%Z.impl_witness.18a) [concrete]
 // CHECK:STDOUT:   %pattern_type.7f8: type = pattern_type %C.131 [concrete]
 // CHECK:STDOUT:   %empty_struct: %empty_struct_type = struct_value () [concrete]
@@ -4268,10 +4268,10 @@ 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.20b)]
 // 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.bb0)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %Z_where.type [symbolic = %require_complete (constants.%require_complete.4fe)]
 // CHECK:STDOUT:   %Z.impl_witness: <witness> = impl_witness file.%Z.impl_witness_table, @T.as.Z.impl(%T.loc9_14.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.f43)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %Z_where.type [symbolic = %require_complete (constants.%require_complete.4fe)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   impl: %T.ref.loc9_24 as %.loc9_31 {
 // CHECK:STDOUT:   !members:
@@ -4343,7 +4343,6 @@ fn F() {
 // CHECK:STDOUT:   %T.loc9_14.2 => constants.%T
 // CHECK:STDOUT:   %C.loc9_45.2 => constants.%C.20b
 // CHECK:STDOUT:   %Z_where.type => constants.%Z_where.type.bb0
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.4fe
 // CHECK:STDOUT:   %Z.impl_witness => constants.%Z.impl_witness.f43
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -4351,10 +4350,10 @@ fn F() {
 // CHECK:STDOUT:   %T.loc9_14.2 => constants.%D
 // CHECK:STDOUT:   %C.loc9_45.2 => constants.%C.131
 // CHECK:STDOUT:   %Z_where.type => constants.%Z_where.type.a77
-// CHECK:STDOUT:   %require_complete => constants.%complete_type.bcc
 // CHECK:STDOUT:   %Z.impl_witness => constants.%Z.impl_witness.18a
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%complete_type.bcc
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @C(constants.%D) {

+ 2 - 2
toolchain/check/testdata/interface/generic.carbon

@@ -102,15 +102,15 @@ fn F(T:! Generic((), ())) {}
 // CHECK:STDOUT:   %assoc0.61f: %WithAssocFn.assoc_type.416 = assoc_entity element0, @WithAssocFn.%WithAssocFn.F.decl [symbolic]
 // CHECK:STDOUT:   %C: type = class_type @C [concrete]
 // CHECK:STDOUT:   %Simple.type.ebf: type = facet_type <@Simple, @Simple(%C)> [concrete]
-// CHECK:STDOUT:   %Self.95a: %Simple.type.ebf = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %Simple.impl_witness: <witness> = impl_witness @C.%Simple.impl_witness_table [concrete]
+// CHECK:STDOUT:   %Self.95a: %Simple.type.ebf = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %WithAssocFn.type.fc9: type = facet_type <@WithAssocFn, @WithAssocFn(%C)> [concrete]
+// CHECK:STDOUT:   %WithAssocFn.impl_witness: <witness> = impl_witness @C.%WithAssocFn.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.4b8: %WithAssocFn.type.fc9 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %WithAssocFn.F.type.18c: type = fn_type @WithAssocFn.F, @WithAssocFn(%C) [concrete]
 // CHECK:STDOUT:   %WithAssocFn.F.e46: %WithAssocFn.F.type.18c = struct_value () [concrete]
 // CHECK:STDOUT:   %WithAssocFn.assoc_type.9ea: type = assoc_entity_type @WithAssocFn, @WithAssocFn(%C) [concrete]
 // CHECK:STDOUT:   %assoc0.f33: %WithAssocFn.assoc_type.9ea = assoc_entity element0, @WithAssocFn.%WithAssocFn.F.decl [concrete]
-// CHECK:STDOUT:   %WithAssocFn.impl_witness: <witness> = impl_witness @C.%WithAssocFn.impl_witness_table [concrete]
 // CHECK:STDOUT:   %C.as.WithAssocFn.impl.F.type: type = fn_type @C.as.WithAssocFn.impl.F [concrete]
 // CHECK:STDOUT:   %C.as.WithAssocFn.impl.F: %C.as.WithAssocFn.impl.F.type = struct_value () [concrete]
 // CHECK:STDOUT:   %WithAssocFn.facet: %WithAssocFn.type.fc9 = facet_value %C, (%WithAssocFn.impl_witness) [concrete]

+ 1 - 1
toolchain/check/testdata/interface/generic_import.carbon

@@ -111,12 +111,12 @@ impl C as AddWith(C) {
 // CHECK:STDOUT:   %AddWith.F.type.d00: type = fn_type @AddWith.F, @AddWith(%T) [symbolic]
 // CHECK:STDOUT:   %AddWith.F.c8e: %AddWith.F.type.d00 = struct_value () [symbolic]
 // CHECK:STDOUT:   %AddWith.type.bf6: type = facet_type <@AddWith, @AddWith(%C)> [concrete]
+// CHECK:STDOUT:   %AddWith.impl_witness: <witness> = impl_witness file.%AddWith.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.f66: %AddWith.type.bf6 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %AddWith.F.type.cd2: type = fn_type @AddWith.F, @AddWith(%C) [concrete]
 // CHECK:STDOUT:   %AddWith.F.b58: %AddWith.F.type.cd2 = struct_value () [concrete]
 // CHECK:STDOUT:   %AddWith.assoc_type.3f0: type = assoc_entity_type @AddWith, @AddWith(%C) [concrete]
 // CHECK:STDOUT:   %assoc0.d0b: %AddWith.assoc_type.3f0 = assoc_entity element0, imports.%Main.import_ref.4af [concrete]
-// CHECK:STDOUT:   %AddWith.impl_witness: <witness> = impl_witness file.%AddWith.impl_witness_table [concrete]
 // CHECK:STDOUT:   %C.as.AddWith.impl.F.type: type = fn_type @C.as.AddWith.impl.F [concrete]
 // CHECK:STDOUT:   %C.as.AddWith.impl.F: %C.as.AddWith.impl.F.type = struct_value () [concrete]
 // CHECK:STDOUT:   %AddWith.facet: %AddWith.type.bf6 = facet_value %C, (%AddWith.impl_witness) [concrete]

+ 6 - 6
toolchain/check/testdata/interface/generic_method.carbon

@@ -113,12 +113,12 @@ fn CallIndirect() {
 // CHECK:STDOUT:   %Y: type = class_type @Y [concrete]
 // CHECK:STDOUT:   %Z: type = class_type @Z [concrete]
 // CHECK:STDOUT:   %A.type.0a4: type = facet_type <@A, @A(%X)> [concrete]
+// CHECK:STDOUT:   %A.impl_witness: <witness> = impl_witness file.%A.impl_witness_table [concrete]
 // CHECK:STDOUT:   %Self.4d7: %A.type.0a4 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %A.F.type.13d: type = fn_type @A.F, @A(%X) [concrete]
 // CHECK:STDOUT:   %A.F.d83: %A.F.type.13d = struct_value () [concrete]
 // CHECK:STDOUT:   %A.assoc_type.296: type = assoc_entity_type @A, @A(%X) [concrete]
 // CHECK:STDOUT:   %assoc0.cef: %A.assoc_type.296 = assoc_entity element0, @A.%A.F.decl [concrete]
-// CHECK:STDOUT:   %A.impl_witness: <witness> = impl_witness file.%A.impl_witness_table [concrete]
 // CHECK:STDOUT:   %U.67d: type = symbolic_binding U, 0 [symbolic]
 // CHECK:STDOUT:   %ptr.e8f8f9.1: type = ptr_type %U.67d [symbolic]
 // CHECK:STDOUT:   %pattern_type.4f4b84.1: type = pattern_type %ptr.e8f8f9.1 [symbolic]
@@ -706,13 +706,13 @@ 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.ae9: type = facet_type <@A, @A(%W)> [symbolic]
+// CHECK:STDOUT:   %A.impl_witness.8c0: <witness> = impl_witness file.%A.impl_witness_table, @tuple.type.as.A.impl(%V1, %V2, %W) [symbolic]
 // CHECK:STDOUT:   %Self.bf9: %A.type.ae9 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %A.F.type.1a0: type = fn_type @A.F, @A(%W) [symbolic]
 // CHECK:STDOUT:   %A.F.b94: %A.F.type.1a0 = struct_value () [symbolic]
 // CHECK:STDOUT:   %A.assoc_type.bdc: type = assoc_entity_type @A, @A(%W) [symbolic]
 // CHECK:STDOUT:   %assoc0.200: %A.assoc_type.bdc = assoc_entity element0, @A.%A.F.decl [symbolic]
 // CHECK:STDOUT:   %require_complete.517: <witness> = require_complete_type %A.type.ae9 [symbolic]
-// CHECK:STDOUT:   %A.impl_witness.8c0: <witness> = impl_witness file.%A.impl_witness_table, @tuple.type.as.A.impl(%V1, %V2, %W) [symbolic]
 // CHECK:STDOUT:   %U.ce4: type = symbolic_binding U, 3 [symbolic]
 // CHECK:STDOUT:   %pattern_type.e4a: type = pattern_type %U.ce4 [symbolic]
 // CHECK:STDOUT:   %tuple.type.11f: type = tuple_type (type, %tuple.type.24b, type) [concrete]
@@ -732,13 +732,13 @@ fn CallIndirect() {
 // CHECK:STDOUT:   %tuple.821: %tuple.type.24b = tuple_value (%Y1, %Y2) [concrete]
 // CHECK:STDOUT:   %tuple.type.a46: type = tuple_type (%Y1, %Y2) [concrete]
 // CHECK:STDOUT:   %A.type.0a4: type = facet_type <@A, @A(%X)> [concrete]
+// CHECK:STDOUT:   %A.impl_witness.a77: <witness> = impl_witness file.%A.impl_witness_table, @tuple.type.as.A.impl(%Y1, %Y2, %X) [concrete]
 // CHECK:STDOUT:   %Self.4d7: %A.type.0a4 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %A.F.type.13d: type = fn_type @A.F, @A(%X) [concrete]
 // CHECK:STDOUT:   %A.F.d83: %A.F.type.13d = struct_value () [concrete]
 // CHECK:STDOUT:   %A.assoc_type.296: type = assoc_entity_type @A, @A(%X) [concrete]
 // CHECK:STDOUT:   %assoc0.cef: %A.assoc_type.296 = assoc_entity element0, @A.%A.F.decl [concrete]
 // CHECK:STDOUT:   %complete_type.e2d: <witness> = complete_type_witness %A.type.0a4 [concrete]
-// CHECK:STDOUT:   %A.impl_witness.a77: <witness> = impl_witness file.%A.impl_witness_table, @tuple.type.as.A.impl(%Y1, %Y2, %X) [concrete]
 // CHECK:STDOUT:   %tuple.type.as.A.impl.F.type.172: type = fn_type @tuple.type.as.A.impl.F, @tuple.type.as.A.impl(%Y1, %Y2, %X) [concrete]
 // CHECK:STDOUT:   %tuple.type.as.A.impl.F.506: %tuple.type.as.A.impl.F.type.172 = struct_value () [concrete]
 // CHECK:STDOUT:   %A.facet.8b5: %A.type.0a4 = facet_value %tuple.type.a46, (%A.impl_witness.a77) [concrete]
@@ -922,10 +922,10 @@ 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.ae9)]
-// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %A.type.loc14_61.1 [symbolic = %require_complete (constants.%require_complete.517)]
 // CHECK:STDOUT:   %A.impl_witness: <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.8c0)]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete: <witness> = require_complete_type %A.type.loc14_61.1 [symbolic = %require_complete (constants.%require_complete.517)]
 // CHECK:STDOUT:   %tuple.type.as.A.impl.F.type: type = fn_type @tuple.type.as.A.impl.F, @tuple.type.as.A.impl(%V1.loc14_14.1, %V2.loc14_25.1, %W.loc14_36.1) [symbolic = %tuple.type.as.A.impl.F.type (constants.%tuple.type.as.A.impl.F.type.52a)]
 // CHECK:STDOUT:   %tuple.type.as.A.impl.F: @tuple.type.as.A.impl.%tuple.type.as.A.impl.F.type (%tuple.type.as.A.impl.F.type.52a) = struct_value () [symbolic = %tuple.type.as.A.impl.F (constants.%tuple.type.as.A.impl.F.b6b)]
 // CHECK:STDOUT:
@@ -1182,10 +1182,10 @@ 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.ae9
-// CHECK:STDOUT:   %require_complete => constants.%require_complete.517
 // CHECK:STDOUT:   %A.impl_witness => constants.%A.impl_witness.8c0
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%require_complete.517
 // CHECK:STDOUT:   %tuple.type.as.A.impl.F.type => constants.%tuple.type.as.A.impl.F.type.52a
 // CHECK:STDOUT:   %tuple.type.as.A.impl.F => constants.%tuple.type.as.A.impl.F.b6b
 // CHECK:STDOUT: }
@@ -1242,10 +1242,10 @@ fn CallIndirect() {
 // CHECK:STDOUT:   %tuple => constants.%tuple.821
 // CHECK:STDOUT:   %tuple.type => constants.%tuple.type.a46
 // CHECK:STDOUT:   %A.type.loc14_61.1 => constants.%A.type.0a4
-// CHECK:STDOUT:   %require_complete => constants.%complete_type.e2d
 // CHECK:STDOUT:   %A.impl_witness => constants.%A.impl_witness.a77
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %require_complete => constants.%complete_type.e2d
 // CHECK:STDOUT:   %tuple.type.as.A.impl.F.type => constants.%tuple.type.as.A.impl.F.type.172
 // CHECK:STDOUT:   %tuple.type.as.A.impl.F => constants.%tuple.type.as.A.impl.F.506
 // CHECK:STDOUT: }

+ 3 - 3
toolchain/check/testdata/interface/generic_vs_params.carbon

@@ -105,17 +105,17 @@ interface Bar[T:! type] {}
 // CHECK:STDOUT:   %NotGenericNoParams.impl_witness: <witness> = impl_witness file.%NotGenericNoParams.impl_witness_table [concrete]
 // CHECK:STDOUT:   %NotGenericButParams.impl_witness: <witness> = impl_witness file.%NotGenericButParams.impl_witness_table [concrete]
 // CHECK:STDOUT:   %GenericAndParams.type.674: type = facet_type <@GenericAndParams.loc6, @GenericAndParams.loc6(%X)> [concrete]
-// CHECK:STDOUT:   %Self.503: %GenericAndParams.type.674 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %GenericAndParams.impl_witness.4a7: <witness> = impl_witness file.%GenericAndParams.impl_witness_table.loc16 [concrete]
+// CHECK:STDOUT:   %Self.503: %GenericAndParams.type.674 = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %C.fac: type = class_type @C, @C(%X) [concrete]
 // CHECK:STDOUT:   %GenericNoParams.type.7ce: type = facet_type <@GenericNoParams, @GenericNoParams(%X)> [concrete]
 // CHECK:STDOUT:   %GenericAndParams.type.425: type = generic_interface_type @GenericAndParams.loc10, @C(%X) [concrete]
 // CHECK:STDOUT:   %GenericAndParams.generic.b50: %GenericAndParams.type.425 = struct_value () [concrete]
-// CHECK:STDOUT:   %Self.ac0: %GenericNoParams.type.7ce = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %GenericNoParams.impl_witness: <witness> = impl_witness file.%GenericNoParams.impl_witness_table [concrete]
+// CHECK:STDOUT:   %Self.ac0: %GenericNoParams.type.7ce = symbolic_binding Self, 1 [symbolic]
 // CHECK:STDOUT:   %GenericAndParams.type.57c: type = facet_type <@GenericAndParams.loc10, @GenericAndParams.loc10(%X, %X)> [concrete]
-// CHECK:STDOUT:   %Self.db2: %GenericAndParams.type.57c = symbolic_binding Self, 2 [symbolic]
 // CHECK:STDOUT:   %GenericAndParams.impl_witness.970: <witness> = impl_witness file.%GenericAndParams.impl_witness_table.loc18 [concrete]
+// CHECK:STDOUT:   %Self.db2: %GenericAndParams.type.57c = symbolic_binding Self, 2 [symbolic]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 1 - 1
toolchain/check/testdata/operators/overloaded/add.carbon

@@ -51,8 +51,8 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %C.as.AddWith.impl.Op: %C.as.AddWith.impl.Op.type = struct_value () [concrete]
 // CHECK:STDOUT:   %AddWith.facet: %AddWith.type.bfd = facet_value %C, (%AddWith.impl_witness) [concrete]
 // CHECK:STDOUT:   %AddAssignWith.type.133: type = facet_type <@AddAssignWith, @AddAssignWith(%C)> [concrete]
-// CHECK:STDOUT:   %AddAssignWith.Op.type.5af: type = fn_type @AddAssignWith.Op, @AddAssignWith(%C) [concrete]
 // CHECK:STDOUT:   %AddAssignWith.impl_witness: <witness> = impl_witness file.%AddAssignWith.impl_witness_table [concrete]
+// CHECK:STDOUT:   %AddAssignWith.Op.type.5af: 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]
 // CHECK:STDOUT:   %AddAssignWith.facet: %AddAssignWith.type.133 = facet_value %C, (%AddAssignWith.impl_witness) [concrete]

+ 1 - 1
toolchain/check/testdata/operators/overloaded/bit_and.carbon

@@ -51,8 +51,8 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %C.as.BitAndWith.impl.Op: %C.as.BitAndWith.impl.Op.type = struct_value () [concrete]
 // CHECK:STDOUT:   %BitAndWith.facet: %BitAndWith.type.488 = facet_value %C, (%BitAndWith.impl_witness) [concrete]
 // CHECK:STDOUT:   %BitAndAssignWith.type.bc6: type = facet_type <@BitAndAssignWith, @BitAndAssignWith(%C)> [concrete]
-// CHECK:STDOUT:   %BitAndAssignWith.Op.type.73d: type = fn_type @BitAndAssignWith.Op, @BitAndAssignWith(%C) [concrete]
 // CHECK:STDOUT:   %BitAndAssignWith.impl_witness: <witness> = impl_witness file.%BitAndAssignWith.impl_witness_table [concrete]
+// CHECK:STDOUT:   %BitAndAssignWith.Op.type.73d: 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]
 // CHECK:STDOUT:   %BitAndAssignWith.facet: %BitAndAssignWith.type.bc6 = facet_value %C, (%BitAndAssignWith.impl_witness) [concrete]

+ 1 - 1
toolchain/check/testdata/operators/overloaded/bit_or.carbon

@@ -51,8 +51,8 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %C.as.BitOrWith.impl.Op: %C.as.BitOrWith.impl.Op.type = struct_value () [concrete]
 // CHECK:STDOUT:   %BitOrWith.facet: %BitOrWith.type.499 = facet_value %C, (%BitOrWith.impl_witness) [concrete]
 // CHECK:STDOUT:   %BitOrAssignWith.type.de7: type = facet_type <@BitOrAssignWith, @BitOrAssignWith(%C)> [concrete]
-// CHECK:STDOUT:   %BitOrAssignWith.Op.type.efc: type = fn_type @BitOrAssignWith.Op, @BitOrAssignWith(%C) [concrete]
 // CHECK:STDOUT:   %BitOrAssignWith.impl_witness: <witness> = impl_witness file.%BitOrAssignWith.impl_witness_table [concrete]
+// CHECK:STDOUT:   %BitOrAssignWith.Op.type.efc: 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]
 // CHECK:STDOUT:   %BitOrAssignWith.facet: %BitOrAssignWith.type.de7 = facet_value %C, (%BitOrAssignWith.impl_witness) [concrete]

+ 1 - 1
toolchain/check/testdata/operators/overloaded/bit_xor.carbon

@@ -51,8 +51,8 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %C.as.BitXorWith.impl.Op: %C.as.BitXorWith.impl.Op.type = struct_value () [concrete]
 // CHECK:STDOUT:   %BitXorWith.facet: %BitXorWith.type.bf8 = facet_value %C, (%BitXorWith.impl_witness) [concrete]
 // CHECK:STDOUT:   %BitXorAssignWith.type.38a: type = facet_type <@BitXorAssignWith, @BitXorAssignWith(%C)> [concrete]
-// CHECK:STDOUT:   %BitXorAssignWith.Op.type.ad0: type = fn_type @BitXorAssignWith.Op, @BitXorAssignWith(%C) [concrete]
 // CHECK:STDOUT:   %BitXorAssignWith.impl_witness: <witness> = impl_witness file.%BitXorAssignWith.impl_witness_table [concrete]
+// CHECK:STDOUT:   %BitXorAssignWith.Op.type.ad0: 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]
 // CHECK:STDOUT:   %BitXorAssignWith.facet: %BitXorAssignWith.type.38a = facet_value %C, (%BitXorAssignWith.impl_witness) [concrete]

+ 1 - 1
toolchain/check/testdata/operators/overloaded/dec.carbon

@@ -35,8 +35,8 @@ 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.Op.type: type = fn_type @Dec.Op [concrete]
 // CHECK:STDOUT:   %Dec.impl_witness: <witness> = impl_witness file.%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]
 // CHECK:STDOUT:   %Dec.facet: %Dec.type = facet_value %C, (%Dec.impl_witness) [concrete]

+ 1 - 1
toolchain/check/testdata/operators/overloaded/div.carbon

@@ -51,8 +51,8 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %C.as.DivWith.impl.Op: %C.as.DivWith.impl.Op.type = struct_value () [concrete]
 // CHECK:STDOUT:   %DivWith.facet: %DivWith.type.75d = facet_value %C, (%DivWith.impl_witness) [concrete]
 // CHECK:STDOUT:   %DivAssignWith.type.226: type = facet_type <@DivAssignWith, @DivAssignWith(%C)> [concrete]
-// CHECK:STDOUT:   %DivAssignWith.Op.type.629: type = fn_type @DivAssignWith.Op, @DivAssignWith(%C) [concrete]
 // CHECK:STDOUT:   %DivAssignWith.impl_witness: <witness> = impl_witness file.%DivAssignWith.impl_witness_table [concrete]
+// CHECK:STDOUT:   %DivAssignWith.Op.type.629: 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]
 // CHECK:STDOUT:   %DivAssignWith.facet: %DivAssignWith.type.226 = facet_value %C, (%DivAssignWith.impl_witness) [concrete]

+ 1 - 1
toolchain/check/testdata/operators/overloaded/eq.carbon

@@ -91,9 +91,9 @@ 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.164: type = facet_type <@EqWith, @EqWith(%C)> [concrete]
+// CHECK:STDOUT:   %EqWith.impl_witness: <witness> = impl_witness file.%EqWith.impl_witness_table [concrete]
 // CHECK:STDOUT:   %EqWith.Equal.type.170: type = fn_type @EqWith.Equal, @EqWith(%C) [concrete]
 // CHECK:STDOUT:   %EqWith.NotEqual.type.694: type = fn_type @EqWith.NotEqual, @EqWith(%C) [concrete]
-// CHECK:STDOUT:   %EqWith.impl_witness: <witness> = impl_witness file.%EqWith.impl_witness_table [concrete]
 // CHECK:STDOUT:   %pattern_type.c48: type = pattern_type %C [concrete]
 // CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
 // CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]

+ 2 - 2
toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon

@@ -53,8 +53,8 @@ fn TestAddAssignNonRef(a: C, b: C) {
 // CHECK:STDOUT:   %complete_type: <witness> = 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.Op.type: type = fn_type @Inc.Op [concrete]
 // CHECK:STDOUT:   %Inc.impl_witness: <witness> = impl_witness file.%Inc.impl_witness_table [concrete]
+// CHECK:STDOUT:   %Inc.Op.type: type = fn_type @Inc.Op [concrete]
 // CHECK:STDOUT:   %pattern_type.c48: type = pattern_type %C [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]
@@ -62,8 +62,8 @@ 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.133: type = facet_type <@AddAssignWith, @AddAssignWith(%C)> [concrete]
-// CHECK:STDOUT:   %AddAssignWith.Op.type.5af: type = fn_type @AddAssignWith.Op, @AddAssignWith(%C) [concrete]
 // CHECK:STDOUT:   %AddAssignWith.impl_witness: <witness> = impl_witness file.%AddAssignWith.impl_witness_table [concrete]
+// CHECK:STDOUT:   %AddAssignWith.Op.type.5af: 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]
 // CHECK:STDOUT:   %AddAssignWith.facet: %AddAssignWith.type.133 = facet_value %C, (%AddAssignWith.impl_witness) [concrete]

+ 2 - 2
toolchain/check/testdata/operators/overloaded/implicit_as.carbon

@@ -54,8 +54,8 @@ 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.179: type = facet_type <@ImplicitAs, @ImplicitAs(%X)> [concrete]
-// CHECK:STDOUT:   %ImplicitAs.Convert.type.665: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%X) [concrete]
 // CHECK:STDOUT:   %ImplicitAs.impl_witness.8b6: <witness> = impl_witness file.%ImplicitAs.impl_witness_table.loc19 [concrete]
+// CHECK:STDOUT:   %ImplicitAs.Convert.type.665: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%X) [concrete]
 // CHECK:STDOUT:   %pattern_type.7ce: type = pattern_type %i32 [concrete]
 // CHECK:STDOUT:   %pattern_type.019: type = pattern_type %X [concrete]
 // CHECK:STDOUT:   %i32.as.ImplicitAs.impl.Convert.type: type = fn_type @i32.as.ImplicitAs.impl.Convert [concrete]
@@ -73,8 +73,8 @@ fn Test() {
 // CHECK:STDOUT:   %.fe5: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete]
 // CHECK:STDOUT:   %Int.as.Copy.impl.Op.specific_fn: <specific function> = 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.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
 // CHECK:STDOUT:   %ImplicitAs.impl_witness.cbe: <witness> = impl_witness file.%ImplicitAs.impl_witness_table.loc23 [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]
 // CHECK:STDOUT:   %ImplicitAs.facet.81e: %ImplicitAs.type.d14 = facet_value %X, (%ImplicitAs.impl_witness.cbe) [concrete]

+ 1 - 1
toolchain/check/testdata/operators/overloaded/inc.carbon

@@ -35,8 +35,8 @@ 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.Op.type: type = fn_type @Inc.Op [concrete]
 // CHECK:STDOUT:   %Inc.impl_witness: <witness> = impl_witness file.%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]
 // CHECK:STDOUT:   %Inc.facet: %Inc.type = facet_value %C, (%Inc.impl_witness) [concrete]

+ 1 - 1
toolchain/check/testdata/operators/overloaded/index.carbon

@@ -317,12 +317,12 @@ 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: <witness> = impl_witness file.%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]
 // CHECK:STDOUT:   %IndexWith.assoc_type.d10: type = assoc_entity_type @IndexWith, @IndexWith(%empty_tuple.type, %empty_tuple.type) [concrete]
 // CHECK:STDOUT:   %assoc0.78f: %IndexWith.assoc_type.d10 = assoc_entity element0, imports.%Core.import_ref.e47 [concrete]
-// CHECK:STDOUT:   %IndexWith.impl_witness: <witness> = impl_witness file.%IndexWith.impl_witness_table [concrete]
 // CHECK:STDOUT:   %pattern_type.c48: type = pattern_type %C [concrete]
 // CHECK:STDOUT:   %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
 // CHECK:STDOUT:   %C.as.IndexWith.impl.At.type: type = fn_type @C.as.IndexWith.impl.At [concrete]

+ 1 - 1
toolchain/check/testdata/operators/overloaded/left_shift.carbon

@@ -51,8 +51,8 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %C.as.LeftShiftWith.impl.Op: %C.as.LeftShiftWith.impl.Op.type = struct_value () [concrete]
 // CHECK:STDOUT:   %LeftShiftWith.facet: %LeftShiftWith.type.dad = facet_value %C, (%LeftShiftWith.impl_witness) [concrete]
 // CHECK:STDOUT:   %LeftShiftAssignWith.type.981: type = facet_type <@LeftShiftAssignWith, @LeftShiftAssignWith(%C)> [concrete]
-// CHECK:STDOUT:   %LeftShiftAssignWith.Op.type.30f: type = fn_type @LeftShiftAssignWith.Op, @LeftShiftAssignWith(%C) [concrete]
 // CHECK:STDOUT:   %LeftShiftAssignWith.impl_witness: <witness> = impl_witness file.%LeftShiftAssignWith.impl_witness_table [concrete]
+// CHECK:STDOUT:   %LeftShiftAssignWith.Op.type.30f: 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]
 // CHECK:STDOUT:   %LeftShiftAssignWith.facet: %LeftShiftAssignWith.type.981 = facet_value %C, (%LeftShiftAssignWith.impl_witness) [concrete]

+ 1 - 1
toolchain/check/testdata/operators/overloaded/mod.carbon

@@ -51,8 +51,8 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %C.as.ModWith.impl.Op: %C.as.ModWith.impl.Op.type = struct_value () [concrete]
 // CHECK:STDOUT:   %ModWith.facet: %ModWith.type.a0d = facet_value %C, (%ModWith.impl_witness) [concrete]
 // CHECK:STDOUT:   %ModAssignWith.type.444: type = facet_type <@ModAssignWith, @ModAssignWith(%C)> [concrete]
-// CHECK:STDOUT:   %ModAssignWith.Op.type.dd0: type = fn_type @ModAssignWith.Op, @ModAssignWith(%C) [concrete]
 // CHECK:STDOUT:   %ModAssignWith.impl_witness: <witness> = impl_witness file.%ModAssignWith.impl_witness_table [concrete]
+// CHECK:STDOUT:   %ModAssignWith.Op.type.dd0: 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]
 // CHECK:STDOUT:   %ModAssignWith.facet: %ModAssignWith.type.444 = facet_value %C, (%ModAssignWith.impl_witness) [concrete]

+ 1 - 1
toolchain/check/testdata/operators/overloaded/mul.carbon

@@ -51,8 +51,8 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %C.as.MulWith.impl.Op: %C.as.MulWith.impl.Op.type = struct_value () [concrete]
 // CHECK:STDOUT:   %MulWith.facet: %MulWith.type.c1e = facet_value %C, (%MulWith.impl_witness) [concrete]
 // CHECK:STDOUT:   %MulAssignWith.type.c63: type = facet_type <@MulAssignWith, @MulAssignWith(%C)> [concrete]
-// CHECK:STDOUT:   %MulAssignWith.Op.type.5c8: type = fn_type @MulAssignWith.Op, @MulAssignWith(%C) [concrete]
 // CHECK:STDOUT:   %MulAssignWith.impl_witness: <witness> = impl_witness file.%MulAssignWith.impl_witness_table [concrete]
+// CHECK:STDOUT:   %MulAssignWith.Op.type.5c8: 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]
 // CHECK:STDOUT:   %MulAssignWith.facet: %MulAssignWith.type.c63 = facet_value %C, (%MulAssignWith.impl_witness) [concrete]

+ 1 - 1
toolchain/check/testdata/operators/overloaded/ordered.carbon

@@ -89,11 +89,11 @@ 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.b75: type = facet_type <@OrderedWith, @OrderedWith(%C)> [concrete]
+// CHECK:STDOUT:   %OrderedWith.impl_witness: <witness> = impl_witness file.%OrderedWith.impl_witness_table [concrete]
 // CHECK:STDOUT:   %OrderedWith.Less.type.ef8: type = fn_type @OrderedWith.Less, @OrderedWith(%C) [concrete]
 // CHECK:STDOUT:   %OrderedWith.LessOrEquivalent.type.718: type = fn_type @OrderedWith.LessOrEquivalent, @OrderedWith(%C) [concrete]
 // CHECK:STDOUT:   %OrderedWith.Greater.type.394: type = fn_type @OrderedWith.Greater, @OrderedWith(%C) [concrete]
 // CHECK:STDOUT:   %OrderedWith.GreaterOrEquivalent.type.f2b: type = fn_type @OrderedWith.GreaterOrEquivalent, @OrderedWith(%C) [concrete]
-// CHECK:STDOUT:   %OrderedWith.impl_witness: <witness> = impl_witness file.%OrderedWith.impl_witness_table [concrete]
 // CHECK:STDOUT:   %pattern_type.c48: type = pattern_type %C [concrete]
 // CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
 // CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]

+ 1 - 1
toolchain/check/testdata/operators/overloaded/right_shift.carbon

@@ -51,8 +51,8 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %C.as.RightShiftWith.impl.Op: %C.as.RightShiftWith.impl.Op.type = struct_value () [concrete]
 // CHECK:STDOUT:   %RightShiftWith.facet: %RightShiftWith.type.a33 = facet_value %C, (%RightShiftWith.impl_witness) [concrete]
 // CHECK:STDOUT:   %RightShiftAssignWith.type.df5: type = facet_type <@RightShiftAssignWith, @RightShiftAssignWith(%C)> [concrete]
-// CHECK:STDOUT:   %RightShiftAssignWith.Op.type.ae9: type = fn_type @RightShiftAssignWith.Op, @RightShiftAssignWith(%C) [concrete]
 // CHECK:STDOUT:   %RightShiftAssignWith.impl_witness: <witness> = impl_witness file.%RightShiftAssignWith.impl_witness_table [concrete]
+// CHECK:STDOUT:   %RightShiftAssignWith.Op.type.ae9: 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]
 // CHECK:STDOUT:   %RightShiftAssignWith.facet: %RightShiftAssignWith.type.df5 = facet_value %C, (%RightShiftAssignWith.impl_witness) [concrete]

+ 1 - 1
toolchain/check/testdata/operators/overloaded/sub.carbon

@@ -51,8 +51,8 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %C.as.SubWith.impl.Op: %C.as.SubWith.impl.Op.type = struct_value () [concrete]
 // CHECK:STDOUT:   %SubWith.facet: %SubWith.type.c5d = facet_value %C, (%SubWith.impl_witness) [concrete]
 // CHECK:STDOUT:   %SubAssignWith.type.9f4: type = facet_type <@SubAssignWith, @SubAssignWith(%C)> [concrete]
-// CHECK:STDOUT:   %SubAssignWith.Op.type.ffe: type = fn_type @SubAssignWith.Op, @SubAssignWith(%C) [concrete]
 // CHECK:STDOUT:   %SubAssignWith.impl_witness: <witness> = impl_witness file.%SubAssignWith.impl_witness_table [concrete]
+// CHECK:STDOUT:   %SubAssignWith.Op.type.ffe: 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]
 // CHECK:STDOUT:   %SubAssignWith.facet: %SubAssignWith.type.9f4 = facet_value %C, (%SubAssignWith.impl_witness) [concrete]