From fdb188ccfd033ee9bbeff6807efdf0863a9318cf Mon Sep 17 00:00:00 2001 From: Burak Emir Date: Fri, 20 Feb 2026 00:33:36 +0100 Subject: [PATCH] Implement unused pattern bindings, continued (#6518) Implementation of unused pattern bindings #2022, continued. Whereas previous PR #6460 took care of parsing, and PR #6479 prepared the stage by using _ in some test cases, this PR has the the actual implementation, using a simple dataflow analysis. --------- Co-authored-by: Burak Emir Co-authored-by: jonmeow --- core/prelude/iterate.carbon | 2 +- core/prelude/types/cpp/nullptr.carbon | 4 +- toolchain/check/BUILD | 37 +- toolchain/check/check_unit.cpp | 3 +- toolchain/check/context.cpp | 2 +- toolchain/check/cpp/import.cpp | 6 +- toolchain/check/decl_name_stack.cpp | 8 +- toolchain/check/decl_name_stack.h | 4 +- toolchain/check/facet_type.cpp | 13 +- toolchain/check/function.cpp | 9 +- toolchain/check/function.h | 3 +- toolchain/check/handle_binding_pattern.cpp | 79 +- toolchain/check/handle_choice.cpp | 3 +- toolchain/check/handle_codeblock.cpp | 3 +- toolchain/check/handle_function.cpp | 76 +- toolchain/check/handle_struct.cpp | 5 +- toolchain/check/handle_where.cpp | 3 +- toolchain/check/import_ref.cpp | 2 +- toolchain/check/interface.cpp | 3 +- toolchain/check/lexical_lookup.h | 19 +- toolchain/check/merge.cpp | 15 +- toolchain/check/name_lookup.cpp | 16 +- toolchain/check/pattern.cpp | 8 +- toolchain/check/pattern.h | 7 +- toolchain/check/return.cpp | 5 +- toolchain/check/return.h | 2 +- toolchain/check/scope_stack.cpp | 127 +- toolchain/check/scope_stack.h | 57 +- toolchain/check/testdata/array/basics.carbon | 102 +- .../array/init_dependent_bound.carbon | 52 +- .../testdata/as/adapter_conversion.carbon | 40 +- toolchain/check/testdata/as/basics.carbon | 116 +- toolchain/check/testdata/as/const.carbon | 164 +-- .../check/testdata/as/maybe_unformed.carbon | 246 ++-- toolchain/check/testdata/as/partial.carbon | 228 ++-- toolchain/check/testdata/as/var_init.carbon | 16 +- .../testdata/basics/dump_sem_ir_ranges.carbon | 2 +- .../basics/duplicate_name_same_line.carbon | 32 +- .../testdata/basics/include_in_dumps.carbon | 24 +- .../basics/raw_sem_ir/cpp_interop.carbon | 8 +- .../basics/raw_sem_ir/multifile.carbon | 2 +- .../multifile_with_textual_ir.carbon | 2 +- .../basics/raw_sem_ir/one_file.carbon | 128 +- .../one_file_with_textual_ir.carbon | 2 +- .../testdata/builtins/float/negate.carbon | 2 +- .../testdata/builtins/int/snegate.carbon | 2 +- .../testdata/builtins/int/unegate.carbon | 2 +- .../check/testdata/builtins/read/char.carbon | 20 +- .../check/testdata/builtins/type/and.carbon | 16 +- .../testdata/class/access_modifers.carbon | 16 +- .../class/adapter/convert_incomplete.carbon | 18 +- .../testdata/class/derived_to_base.carbon | 102 +- .../check/testdata/class/destroy_calls.carbon | 36 +- .../check/testdata/class/fail_abstract.carbon | 76 +- .../class/fail_abstract_in_struct.carbon | 12 +- .../class/fail_abstract_in_tuple.carbon | 94 +- .../testdata/class/fail_error_recovery.carbon | 10 +- .../testdata/class/fail_generic_method.carbon | 20 +- .../testdata/class/fail_incomplete.carbon | 8 +- .../testdata/class/fail_modifiers.carbon | 18 +- .../check/testdata/class/fail_self.carbon | 8 +- .../check/testdata/class/field_access.carbon | 28 +- .../class/field_access_in_value.carbon | 28 +- .../class/generic/base_is_generic.carbon | 44 +- .../generic/complete_in_conversion.carbon | 20 +- .../testdata/class/generic/import.carbon | 16 +- .../class/generic/member_out_of_line.carbon | 80 +- .../check/testdata/class/generic/self.carbon | 56 +- .../testdata/class/generic_method.carbon | 12 +- toolchain/check/testdata/class/import.carbon | 18 +- .../check/testdata/class/import_access.carbon | 18 +- .../testdata/class/import_member_cycle.carbon | 2 +- toolchain/check/testdata/class/nested.carbon | 12 +- .../check/testdata/class/nested_name.carbon | 2 +- .../check/testdata/class/raw_self_type.carbon | 24 +- .../check/testdata/class/redeclaration.carbon | 8 +- .../testdata/class/reorder_qualified.carbon | 80 +- toolchain/check/testdata/class/scope.carbon | 4 +- .../testdata/class/virtual_modifiers.carbon | 570 ++++----- toolchain/check/testdata/const/basics.carbon | 4 +- .../check/testdata/dataflow/unused.carbon | 261 +++- toolchain/check/testdata/deduce/array.carbon | 230 ++-- .../testdata/deduce/binding_pattern.carbon | 78 +- .../check/testdata/deduce/generic_type.carbon | 42 +- .../check/testdata/deduce/int_float.carbon | 72 +- .../testdata/deduce/symbolic_facets.carbon | 14 +- toolchain/check/testdata/deduce/tuple.carbon | 54 +- .../value_with_type_through_access.carbon | 214 ++-- toolchain/check/testdata/deduce/where.carbon | 8 +- .../check/testdata/eval/aggregates.carbon | 102 +- toolchain/check/testdata/eval/call.carbon | 22 +- toolchain/check/testdata/eval/symbolic.carbon | 4 +- toolchain/check/testdata/facet/access.carbon | 16 +- toolchain/check/testdata/facet/combine.carbon | 34 +- .../convert_class_type_to_facet_type.carbon | 12 +- ...t_class_type_to_generic_facet_value.carbon | 98 +- ...rt_class_value_to_facet_value_value.carbon | 6 +- ..._value_to_generic_facet_value_value.carbon | 62 +- .../convert_facet_type_to_facet_value.carbon | 27 +- ...t_value_as_type_knows_original_type.carbon | 4 +- .../convert_facet_value_to_facet_value.carbon | 2 +- .../convert_facet_value_to_itself.carbon | 39 +- ..._facet_value_to_narrowed_facet_type.carbon | 108 +- ...t_facet_value_value_to_blanket_impl.carbon | 6 +- ..._value_to_generic_facet_value_value.carbon | 50 +- ...convert_facet_value_value_to_itself.carbon | 6 +- .../testdata/facet/convert_interface.carbon | 2 +- .../testdata/facet/early_rewrites.carbon | 20 +- .../testdata/facet/facet_assoc_const.carbon | 240 ++-- ...t_class_type_to_generic_facet_value.carbon | 24 +- ...convert_facet_value_to_missing_impl.carbon | 10 +- ...l_convert_type_erased_type_to_facet.carbon | 4 +- ...uction_uses_runtime_type_conversion.carbon | 82 +- .../testdata/facet/fail_incomplete.carbon | 8 +- .../testdata/facet/fail_namespace_type.carbon | 8 +- .../testdata/facet/nested_facet_types.carbon | 74 +- .../check/testdata/facet/period_self.carbon | 72 +- .../testdata/facet/require_import.carbon | 12 +- .../check/testdata/facet/runtime_value.carbon | 20 +- .../tuple_and_struct_type_literal.carbon | 40 +- .../facet/tuple_and_struct_type_value.carbon | 24 +- .../facet/validate_impl_constraints.carbon | 36 +- .../facet/validate_rewrite_constraints.carbon | 258 ++-- toolchain/check/testdata/for/actual.carbon | 20 +- toolchain/check/testdata/for/basic.carbon | 20 +- toolchain/check/testdata/for/pattern.carbon | 38 +- .../function/builtin/fail_redefined.carbon | 48 +- .../check/testdata/function/call/alias.carbon | 8 +- .../function/call/eval_musteval.carbon | 22 +- .../function/call/fail_not_callable.carbon | 8 +- .../function/call/fail_param_count.carbon | 32 +- .../function/call/fail_param_type.carbon | 8 +- .../call/fail_return_type_mismatch.carbon | 12 +- .../check/testdata/function/call/i32.carbon | 16 +- .../function/call/more_param_ir.carbon | 14 +- .../testdata/function/call/params_one.carbon | 2 +- .../function/call/params_one_comma.carbon | 2 +- .../testdata/function/call/params_two.carbon | 14 +- .../function/call/params_two_comma.carbon | 14 +- .../check/testdata/function/call/ref.carbon | 8 +- .../function/call/return_implicit.carbon | 8 +- .../declaration/pattern_in_signature.carbon | 22 +- .../testdata/function/declaration/ref.carbon | 2 +- .../function/definition/basics.carbon | 8 +- .../fail_decl_param_mismatch.carbon | 20 +- .../definition/fail_local_decl.carbon | 20 +- .../function/definition/params_one.carbon | 2 +- .../definition/params_one_comma.carbon | 2 +- .../function/definition/params_two.carbon | 14 +- .../definition/params_two_comma.carbon | 14 +- .../definition/syntactic_merge.carbon | 89 +- .../testdata/function/generic/deduce.carbon | 134 +- .../fail_deduce_imported_function.carbon | 52 +- .../generic/fail_type_param_mismatch.carbon | 14 +- .../function/generic/import_specific.carbon | 66 +- .../function/generic/redeclare.carbon | 48 +- .../function/generic/resolve_used.carbon | 28 +- .../function/generic/return_slot.carbon | 42 +- .../function/generic/template_param.carbon | 12 +- .../function/generic/type_param.carbon | 10 +- .../function/generic/undefined.carbon | 4 +- .../testdata/generic/call_basic_depth.carbon | 4 +- .../testdata/generic/complete_type.carbon | 14 +- .../generic/dot_self_symbolic_type.carbon | 48 +- .../testdata/generic/fail_generic_copy.carbon | 14 +- .../testdata/generic/forward_decl.carbon | 2 +- toolchain/check/testdata/generic/local.carbon | 22 +- .../generic/template/unimplemented.carbon | 26 +- .../if_expr/fail_partial_constant.carbon | 60 +- .../testdata/impl/assoc_const_self.carbon | 18 +- toolchain/check/testdata/impl/basic.carbon | 4 +- toolchain/check/testdata/impl/compound.carbon | 4 +- .../check/testdata/impl/error_recovery.carbon | 6 +- .../check/testdata/impl/eval_musteval.carbon | 96 +- .../check/testdata/impl/extend_final.carbon | 2 +- .../testdata/impl/extend_impl_generic.carbon | 94 +- .../impl/fail_extend_impl_forall.carbon | 2 +- .../testdata/impl/fail_impl_as_scope.carbon | 8 +- .../check/testdata/impl/forward_decls.carbon | 37 +- toolchain/check/testdata/impl/impl_as.carbon | 8 +- .../testdata/impl/impl_assoc_const.carbon | 8 +- .../check/testdata/impl/impl_thunk.carbon | 136 +- .../impl/impl_thunk_min_prelude.carbon | 4 +- .../impl/import_canonical_witnesses.carbon | 6 +- .../testdata/impl/import_compound.carbon | 4 +- .../impl/import_impl_with_no_interface.carbon | 2 +- .../check/testdata/impl/import_self.carbon | 26 +- .../testdata/impl/import_self_specific.carbon | 8 +- .../check/testdata/impl/import_thunk.carbon | 96 +- .../check/testdata/impl/incomplete.carbon | 22 +- .../check/testdata/impl/interface_args.carbon | 8 +- .../impl/lookup/canonical_query_self.carbon | 4 +- .../testdata/impl/lookup/find_in_final.carbon | 6 +- .../check/testdata/impl/lookup/generic.carbon | 10 +- .../testdata/impl/lookup/impl_cycle.carbon | 28 +- .../check/testdata/impl/lookup/import.carbon | 52 +- .../testdata/impl/lookup/import_error.carbon | 16 +- .../testdata/impl/lookup/import_final.carbon | 4 +- ...g_generic_inside_rewrite_constraint.carbon | 84 +- .../impl/lookup/specialization.carbon | 74 +- .../impl/lookup/specialization_poison.carbon | 22 +- ...pecialization_with_symbolic_rewrite.carbon | 58 +- .../testdata/impl/lookup/specific_args.carbon | 8 +- .../check/testdata/impl/lookup/struct.carbon | 6 +- .../impl/lookup/symbolic_lookup.carbon | 4 +- .../testdata/impl/lookup/transitive.carbon | 4 +- .../impl/lookup/unused_generic_binding.carbon | 12 +- .../testdata/impl/self_in_signature.carbon | 36 +- .../testdata/impl/use_assoc_entity.carbon | 384 +++--- .../impl/using_invalid_interface.carbon | 16 +- .../check/testdata/index/expr_category.carbon | 44 +- .../testdata/index/fail_expr_category.carbon | 108 +- .../testdata/index/fail_name_not_found.carbon | 8 +- .../check/testdata/interface/as_type.carbon | 2 +- .../testdata/interface/as_type_of_type.carbon | 22 +- .../interface/compound_member_access.carbon | 44 +- .../testdata/interface/default_fn.carbon | 8 +- .../testdata/interface/export_name.carbon | 2 +- .../interface/fail_member_lookup.carbon | 14 +- ..._todo_define_default_fn_out_of_line.carbon | 42 +- .../check/testdata/interface/generic.carbon | 52 +- .../interface/generic_default_fn.carbon | 6 +- .../check/testdata/interface/import.carbon | 6 +- .../testdata/interface/import_access.carbon | 66 +- .../check/testdata/interface/local.carbon | 2 +- .../testdata/interface/name_poisoning.carbon | 2 +- .../testdata/interop/cpp/builtins.carbon | 44 +- .../interop/cpp/builtins.llp64.carbon | 482 +++---- .../testdata/interop/cpp/builtins.lp64.carbon | 410 +++--- .../interop/cpp/class/abstract.carbon | 6 +- .../testdata/interop/cpp/class/access.carbon | 204 +-- .../testdata/interop/cpp/class/class.carbon | 38 +- .../interop/cpp/class/constructor.carbon | 566 ++++----- .../testdata/interop/cpp/class/field.carbon | 8 +- .../testdata/interop/cpp/class/method.carbon | 138 +- .../testdata/interop/cpp/class/union.carbon | 38 +- .../testdata/interop/cpp/enum/convert.carbon | 66 +- .../testdata/interop/cpp/enum/fixed.carbon | 18 +- .../interop/cpp/enum/incomplete.carbon | 8 +- .../testdata/interop/cpp/enum/member.carbon | 26 +- .../testdata/interop/cpp/enum/scoped.carbon | 20 +- .../testdata/interop/cpp/enum/unscoped.carbon | 54 +- .../testdata/interop/cpp/enum/using.carbon | 40 +- .../function/arithmetic_types_bridged.carbon | 64 +- .../interop/cpp/function/class.carbon | 4 +- .../interop/cpp/function/default_arg.carbon | 108 +- .../interop/cpp/function/full_semir.carbon | 20 +- .../interop/cpp/function/inline.carbon | 154 +-- .../interop/cpp/function/operators.carbon | 1106 ++++++++--------- .../interop/cpp/function/overloads.carbon | 422 +++---- .../interop/cpp/function/pointer.carbon | 78 +- .../interop/cpp/function/reference.carbon | 32 +- .../interop/cpp/function/return.carbon | 14 +- .../interop/cpp/function/struct.carbon | 4 +- .../interop/cpp/function/union.carbon | 4 +- .../interop/cpp/function/void_pointer.carbon | 36 +- .../testdata/interop/cpp/impls/destroy.carbon | 78 +- .../check/testdata/interop/cpp/import.carbon | 10 +- .../check/testdata/interop/cpp/macros.carbon | 342 ++--- .../interop/cpp/template/generic_call.carbon | 10 +- .../cpp/template/non_type_param.carbon | 2 +- .../check/testdata/interop/cpp/typedef.carbon | 24 +- .../testdata/interop/cpp/var/global.carbon | 64 +- .../testdata/interop/cpp/var/namespace.carbon | 2 +- .../check/testdata/interop/cpp/void.carbon | 10 +- .../testdata/interop/cpp/void_pointer.carbon | 196 +-- .../testdata/let/compile_time_bindings.carbon | 8 +- toolchain/check/testdata/let/convert.carbon | 11 +- .../testdata/let/fail_duplicate_decl.carbon | 44 +- .../check/testdata/let/fail_generic.carbon | 2 +- .../testdata/let/fail_missing_value.carbon | 8 +- .../testdata/let/fail_use_in_init.carbon | 17 +- toolchain/check/testdata/let/generic.carbon | 2 +- toolchain/check/testdata/let/local.carbon | 2 +- toolchain/check/testdata/let/ref.carbon | 34 +- .../check/testdata/let/shadowed_decl.carbon | 14 +- .../main_run/fail_mismatch_params.carbon | 18 +- .../check/testdata/main_run/no_return.carbon | 16 +- .../check/testdata/main_run/return_i32.carbon | 40 +- .../testdata/named_constraint/convert.carbon | 22 +- .../testdata/named_constraint/empty.carbon | 20 +- .../named_constraint/empty_generic.carbon | 40 +- .../testdata/named_constraint/generic.carbon | 8 +- .../import_constraint_decl.carbon | 10 +- .../named_constraint/invalid_members.carbon | 2 +- .../testdata/namespace/fail_params.carbon | 27 +- .../testdata/namespace/name_poisoning.carbon | 2 +- .../testdata/operators/builtin/and.carbon | 208 ++-- .../testdata/operators/builtin/bit_and.carbon | 20 +- .../fail_and_or_partial_constant.carbon | 158 +-- .../builtin/fail_type_mismatch.carbon | 24 +- .../testdata/operators/builtin/or.carbon | 218 ++-- .../testdata/operators/builtin/ref.carbon | 16 +- .../operators/builtin/unary_op.carbon | 62 +- .../testdata/operators/overloaded/add.carbon | 4 +- .../overloaded/binary_op.carbon.tmpl | 4 +- .../operators/overloaded/bit_and.carbon | 4 +- .../overloaded/bit_complement.carbon | 2 +- .../operators/overloaded/bit_or.carbon | 4 +- .../operators/overloaded/bit_xor.carbon | 4 +- .../testdata/operators/overloaded/div.carbon | 4 +- .../overloaded/fail_no_impl_for_arg.carbon | 4 +- .../operators/overloaded/index.carbon | 14 +- .../overloaded/index_with_prelude.carbon | 14 +- .../operators/overloaded/left_shift.carbon | 4 +- .../testdata/operators/overloaded/mod.carbon | 4 +- .../testdata/operators/overloaded/mul.carbon | 4 +- .../operators/overloaded/negate.carbon | 2 +- .../operators/overloaded/right_shift.carbon | 4 +- .../overloaded/string_indexing.carbon | 60 +- .../testdata/operators/overloaded/sub.carbon | 4 +- .../operators/overloaded/unary_op.carbon.tmpl | 2 +- .../package_expr/fail_not_found.carbon | 8 +- .../check/testdata/package_expr/syntax.carbon | 16 +- .../packages/cross_package_import.carbon | 12 +- .../testdata/packages/missing_prelude.carbon | 54 +- .../patterns/unused_underscore.carbon | 25 + .../testdata/pointer/address_of_lvalue.carbon | 60 +- .../pointer/fail_address_of_value.carbon | 8 +- .../primitives/numeric_literals.carbon | 4 +- .../return/code_after_return_value.carbon | 10 +- .../fail_returned_var_no_return_type.carbon | 32 +- .../return/fail_returned_var_shadow.carbon | 20 +- .../return/import_convert_function.carbon | 122 +- .../struct/nested_struct_in_place.carbon | 54 +- .../testdata/tuple/element_access.carbon | 12 +- .../testdata/tuple/in_place_tuple_init.carbon | 116 +- .../check/testdata/tuple/tuple_pattern.carbon | 224 ++-- toolchain/check/testdata/var/decl.carbon | 8 +- .../check/testdata/var/decl_with_init.carbon | 14 +- .../testdata/var/fail_duplicate_decl.carbon | 40 +- .../testdata/var/fail_init_with_self.carbon | 21 +- .../var/fail_lookup_outside_scope.carbon | 8 +- .../testdata/var/fail_not_copyable.carbon | 14 +- .../var/fail_storage_is_literal.carbon | 20 +- .../var/global_lookup_in_scope.carbon | 20 +- toolchain/check/testdata/var/shadowing.carbon | 14 +- .../check/testdata/var/var_pattern.carbon | 298 ++--- .../testdata/where_expr/constraints.carbon | 10 +- .../testdata/where_expr/designator.carbon | 12 +- .../testdata/where_expr/dot_self_impls.carbon | 12 +- .../testdata/where_expr/dot_self_index.carbon | 66 +- .../testdata/where_expr/equal_rewrite.carbon | 76 +- .../testdata/where_expr/non_generic.carbon | 8 +- toolchain/check/thunk.cpp | 3 +- toolchain/check/unused.cpp | 54 + toolchain/check/unused.h | 23 + toolchain/diagnostics/kind.def | 7 + .../driver/testdata/fail_flush_errors.carbon | 2 +- toolchain/lower/testdata/array/iterate.carbon | 2 +- toolchain/lower/testdata/class/virtual.carbon | 12 +- toolchain/lower/testdata/for/bindings.carbon | 4 +- .../function/generic/call_basic.carbon | 8 +- .../function/generic/call_method.carbon | 2 +- .../generic/call_recursive_basic.carbon | 8 +- .../generic/call_specific_in_class.carbon | 2 +- .../function/generic/reverse_canonical.carbon | 4 +- .../function/generic/self_canonical.carbon | 8 +- .../generic/type_representation.carbon | 2 +- toolchain/lower/testdata/impl/impl.carbon | 28 +- .../lower/testdata/impl/import_facet.carbon | 6 +- toolchain/lower/testdata/impl/thunk.carbon | 30 +- toolchain/lower/testdata/let/local.carbon | 4 +- .../interface/final_member_definition.carbon | 17 +- .../named_constraint/invalid_method.carbon | 17 +- toolchain/sem_ir/entity_name.h | 25 +- 366 files changed, 8453 insertions(+), 7996 deletions(-) create mode 100644 toolchain/check/testdata/patterns/unused_underscore.carbon create mode 100644 toolchain/check/unused.cpp create mode 100644 toolchain/check/unused.h diff --git a/core/prelude/iterate.carbon b/core/prelude/iterate.carbon index 15129c606867..b5081091c238 100644 --- a/core/prelude/iterate.carbon +++ b/core/prelude/iterate.carbon @@ -20,7 +20,7 @@ interface Iterate { impl forall [T:! Copy & Destroy, N:! IntLiteral()] array(T, N) as Iterate where .ElementType = T and .CursorType = i32 { - fn NewCursor[self: Self]() -> i32 { return 0; } + fn NewCursor[unused self: Self]() -> i32 { return 0; } fn Next[self: Self](cursor: i32*) -> Optional(T) { if (*cursor < N) { ++*cursor; diff --git a/core/prelude/types/cpp/nullptr.carbon b/core/prelude/types/cpp/nullptr.carbon index 329e9e9d6c06..3535443b0997 100644 --- a/core/prelude/types/cpp/nullptr.carbon +++ b/core/prelude/types/cpp/nullptr.carbon @@ -35,7 +35,7 @@ class CppCompat.NullptrT { } impl as Copy { - fn Op[self: Self]() -> Self { + fn Op[unused self: Self]() -> Self { return Make(); } } @@ -43,7 +43,7 @@ class CppCompat.NullptrT { // TODO: impl as EqWith(Self) impl forall [T:! type] as ImplicitAs(Optional(T*)) { - fn Convert[self: Self]() -> Optional(T*) { + fn Convert[unused self: Self]() -> Optional(T*) { return Optional(T*).None(); } } diff --git a/toolchain/check/BUILD b/toolchain/check/BUILD index a26b713b4a9d..a54f9a55d4d4 100644 --- a/toolchain/check/BUILD +++ b/toolchain/check/BUILD @@ -66,11 +66,13 @@ cc_library( "pattern_match.cpp", "pointer_dereference.cpp", "return.cpp", + "scope_stack.cpp", "subst.cpp", "thunk.cpp", "type.cpp", "type_completion.cpp", "type_structure.cpp", + "unused.cpp", ], hdrs = [ "action.h", @@ -101,6 +103,7 @@ cc_library( "eval.h", "eval_inst.h", "facet_type.h", + "full_pattern_stack.h", "function.h", "generic.h", "global_init.h", @@ -113,6 +116,7 @@ cc_library( "inst_block_stack.h", "interface.h", "keyword_modifier_set.h", + "lexical_lookup.h", "literal.h", "member_access.h", "merge.h", @@ -129,11 +133,14 @@ cc_library( "pointer_dereference.h", "region_stack.h", "return.h", + "scope_index.h", + "scope_stack.h", "subst.h", "thunk.h", "type.h", "type_completion.h", "type_structure.h", + "unused.h", ], deps = [ ":core_identifier", @@ -146,6 +153,7 @@ cc_library( "//common:find", "//common:growing_range", "//common:map", + "//common:move_only", "//common:ostream", "//common:raw_string_ostream", "//common:set", @@ -158,7 +166,6 @@ cc_library( "//toolchain/base:value_ids", "//toolchain/base:value_store", "//toolchain/check:generic_region_stack", - "//toolchain/check:scope_stack", "//toolchain/diagnostics:emitter", "//toolchain/diagnostics:format_providers", "//toolchain/lex:token_info", @@ -224,7 +231,6 @@ cc_library( ":core_identifier", ":dump", ":emitter", - ":scope_stack", "//common:check", "//common:error", "//common:find", @@ -301,33 +307,6 @@ cc_library( ], ) -cc_library( - name = "scope_stack", - srcs = ["scope_stack.cpp"], - hdrs = [ - "full_pattern_stack.h", - "lexical_lookup.h", - "scope_index.h", - "scope_stack.h", - ], - deps = [ - "//common:array_stack", - "//common:check", - "//common:move_only", - "//common:ostream", - "//common:set", - "//common:vlog", - "//toolchain/base:canonical_value_store", - "//toolchain/base:index_base", - "//toolchain/base:shared_value_stores", - "//toolchain/base:value_ids", - "//toolchain/base:value_store", - "//toolchain/sem_ir:file", - "//toolchain/sem_ir:typed_insts", - "@llvm-project//llvm:Support", - ], -) - cc_library( name = "core_identifier", srcs = ["core_identifier.cpp"], diff --git a/toolchain/check/check_unit.cpp b/toolchain/check/check_unit.cpp index 872d6e0f2667..249a52be81da 100644 --- a/toolchain/check/check_unit.cpp +++ b/toolchain/check/check_unit.cpp @@ -31,6 +31,7 @@ #include "toolchain/check/node_id_traversal.h" #include "toolchain/check/type.h" #include "toolchain/check/type_structure.h" +#include "toolchain/check/unused.h" #include "toolchain/diagnostics/diagnostic.h" #include "toolchain/sem_ir/function.h" #include "toolchain/sem_ir/ids.h" @@ -593,7 +594,7 @@ auto CheckUnit::FinishRun() -> void { // Pop information for the file-level scope. context_.sem_ir().set_top_inst_block_id(context_.inst_block_stack().Pop()); - context_.scope_stack().Pop(); + context_.scope_stack().Pop(/*check_unused=*/true); // Finalizes the list of exports on the IR. context_.inst_blocks().ReplacePlaceholder(SemIR::InstBlockId::Exports, diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index c8273b5208db..a1c1a01da2b3 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -29,7 +29,7 @@ Context::Context(DiagnosticEmitterBase* emitter, param_and_arg_refs_stack_(*sem_ir, vlog_stream, node_stack_), args_type_info_stack_("args_type_info_stack_", *sem_ir, vlog_stream), decl_name_stack_(this), - scope_stack_(sem_ir_), + scope_stack_(*this), deferred_definition_worklist_(vlog_stream), generic_region_stack_(vlog_stream), vtable_stack_("vtable_stack_", *sem_ir, vlog_stream), diff --git a/toolchain/check/cpp/import.cpp b/toolchain/check/cpp/import.cpp index 0ade0a840073..4adfb0169b54 100644 --- a/toolchain/check/cpp/import.cpp +++ b/toolchain/check/cpp/import.cpp @@ -53,6 +53,7 @@ #include "toolchain/check/pattern_match.h" #include "toolchain/check/type.h" #include "toolchain/check/type_completion.h" +#include "toolchain/check/unused.h" #include "toolchain/parse/node_ids.h" #include "toolchain/sem_ir/clang_decl.h" #include "toolchain/sem_ir/class.h" @@ -1448,7 +1449,8 @@ static auto ImportFunction(Context& context, SemIR::LocId loc_id, auto function_params_insts = CreateFunctionSignatureInsts(context, loc_id, clang_decl, signature); - auto [pattern_block_id, decl_block_id] = FinishFunctionSignature(context); + auto [pattern_block_id, decl_block_id] = + FinishFunctionSignature(context, /*check_unused=*/false); if (!function_params_insts.has_value()) { return std::nullopt; @@ -1706,7 +1708,7 @@ static auto ImportVarDecl(Context& context, SemIR::LocId loc_id, SemIR::EntityNameId entity_name_id = context.entity_names().AddSymbolicBindingName( var_name_id, GetParentNameScopeId(context, var_decl), - SemIR::CompileTimeBindIndex::None, false); + SemIR::CompileTimeBindIndex::None, false, /*is_unused=*/false); // Create `RefBindingPattern` and `VarPattern`. Mirror the behavior of // import_ref and don't create a `NameBindingDecl` here; we'd never use it for diff --git a/toolchain/check/decl_name_stack.cpp b/toolchain/check/decl_name_stack.cpp index 05915e561569..8e468af6c688 100644 --- a/toolchain/check/decl_name_stack.cpp +++ b/toolchain/check/decl_name_stack.cpp @@ -14,6 +14,7 @@ #include "toolchain/check/name_component.h" #include "toolchain/check/name_lookup.h" #include "toolchain/check/type_completion.h" +#include "toolchain/check/unused.h" #include "toolchain/diagnostics/diagnostic.h" #include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/name_scope.h" @@ -86,10 +87,11 @@ auto DeclNameStack::FinishImplName() -> NameContext { return result; } -auto DeclNameStack::PopScope() -> void { +auto DeclNameStack::PopScope(bool check_unused) -> void { CARBON_CHECK(decl_name_stack_.back().state == NameContext::State::Finished, "Missing call to FinishName before PopScope"); - context_->scope_stack().PopTo(decl_name_stack_.back().initial_scope_index); + context_->scope_stack().PopTo(decl_name_stack_.back().initial_scope_index, + check_unused); decl_name_stack_.pop_back(); } @@ -248,7 +250,7 @@ static auto PushNameQualifierScope(Context& context, SemIR::LocId loc_id, -> SemIR::NameScopeId { // If the qualifier has no parameters, we don't need to keep around a // parameter scope. - context.scope_stack().PopIfEmpty(); + context.scope_stack().PopIfEmpty(/*check_unused=*/true); auto self_specific_id = SemIR::SpecificId::None; if (generic_id.has_value()) { diff --git a/toolchain/check/decl_name_stack.h b/toolchain/check/decl_name_stack.h index 936c923674bc..ef9412c7e42c 100644 --- a/toolchain/check/decl_name_stack.h +++ b/toolchain/check/decl_name_stack.h @@ -217,7 +217,9 @@ class DeclNameStack { // the `A.B` in `fn A.B.F()`. // // This should be called at the end of the declaration. - auto PopScope() -> void; + // If check_unused is true, then performs unused bindings checks and emits + // associated diagnostics. + auto PopScope(bool check_unused = false) -> void; // Peeks the current parent scope of the name on top of the stack. Note // that if we're still processing the name qualifiers, this can change before diff --git a/toolchain/check/facet_type.cpp b/toolchain/check/facet_type.cpp index 620fd21783fa..0945538c3daf 100644 --- a/toolchain/check/facet_type.cpp +++ b/toolchain/check/facet_type.cpp @@ -4,13 +4,9 @@ #include "toolchain/check/facet_type.h" -#include - -#include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/STLExtras.h" #include "toolchain/base/kind_switch.h" -#include "toolchain/check/convert.h" -#include "toolchain/check/diagnostic_helpers.h" +#include "toolchain/check/context.h" +#include "toolchain/check/control_flow.h" #include "toolchain/check/generic.h" #include "toolchain/check/import_ref.h" #include "toolchain/check/inst.h" @@ -418,8 +414,9 @@ auto MakePeriodSelfFacetValue(Context& context, SemIR::TypeId self_type_id) // `None` because there is no equivalent non-symbolic value. .value_id = SemIR::InstId::None, })); - auto existing = - context.scope_stack().LookupOrAddName(SemIR::NameId::PeriodSelf, inst_id); + auto existing = context.scope_stack().LookupOrAddName( + SemIR::NameId::PeriodSelf, inst_id, ScopeIndex::None, + IsCurrentPositionReachable(context)); // Shouldn't have any names in newly created scope. CARBON_CHECK(!existing.has_value()); return inst_id; diff --git a/toolchain/check/function.cpp b/toolchain/check/function.cpp index 3cb7e95b58f3..b56bec0a0aaa 100644 --- a/toolchain/check/function.cpp +++ b/toolchain/check/function.cpp @@ -153,7 +153,8 @@ auto MakeBuiltinFunction(Context& context, SemIR::LocId loc_id, return_patterns_id); context.full_pattern_stack().PopFullPattern(); - auto [pattern_block_id, decl_block_id] = FinishFunctionSignature(context); + auto [pattern_block_id, decl_block_id] = + FinishFunctionSignature(context, /*check_unused=*/false); // Add the function declaration. // TODO: This should probably handle generics. @@ -409,11 +410,11 @@ auto StartFunctionSignature(Context& context) -> void { context.pattern_block_stack().Push(); } -auto FinishFunctionSignature(Context& context) +auto FinishFunctionSignature(Context& context, bool check_unused) -> FinishFunctionSignatureResult { auto pattern_block_id = context.pattern_block_stack().Pop(); auto decl_block_id = context.inst_block_stack().Pop(); - context.scope_stack().Pop(); + context.scope_stack().Pop(check_unused); return {.pattern_block_id = pattern_block_id, .decl_block_id = decl_block_id}; } @@ -461,7 +462,7 @@ auto StartFunctionDefinition(Context& context, SemIR::InstId decl_id, auto FinishFunctionDefinition(Context& context, SemIR::FunctionId function_id) -> void { context.inst_block_stack().Pop(); - context.scope_stack().Pop(); + context.scope_stack().Pop(/*check_unused=*/true); auto& function = context.functions().Get(function_id); function.body_block_ids = context.region_stack().PopRegion(); diff --git a/toolchain/check/function.h b/toolchain/check/function.h index ba1d61b1c97e..49a88ce47abd 100644 --- a/toolchain/check/function.h +++ b/toolchain/check/function.h @@ -112,7 +112,8 @@ struct FinishFunctionSignatureResult { }; // Finishes signatures started by `StartFunctionSignature`. -auto FinishFunctionSignature(Context& context) -> FinishFunctionSignatureResult; +auto FinishFunctionSignature(Context& context, bool check_unused = true) + -> FinishFunctionSignatureResult; // Creates a function object for the given function declaration. The caller must // add the returned `decl_id` to a block (typically the current block or diff --git a/toolchain/check/handle_binding_pattern.cpp b/toolchain/check/handle_binding_pattern.cpp index cf278c716700..9223114ffd87 100644 --- a/toolchain/check/handle_binding_pattern.cpp +++ b/toolchain/check/handle_binding_pattern.cpp @@ -2,6 +2,9 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include + +#include "toolchain/base/kind_switch.h" #include "toolchain/check/context.h" #include "toolchain/check/convert.h" #include "toolchain/check/facet_type.h" @@ -13,6 +16,7 @@ #include "toolchain/check/return.h" #include "toolchain/check/type.h" #include "toolchain/check/type_completion.h" +#include "toolchain/check/unused.h" #include "toolchain/diagnostics/format_providers.h" #include "toolchain/parse/node_ids.h" #include "toolchain/sem_ir/ids.h" @@ -102,7 +106,8 @@ static auto IsValidParamForIntroducer(Context& context, Parse::NodeId node_id, // TODO: make this function shorter by factoring pieces out. static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, - Parse::NodeKind node_kind) -> bool { + Parse::NodeKind node_kind, + bool is_unused = false) -> bool { // TODO: split this into smaller, more focused functions. auto [type_node, parsed_type_id] = context.node_stack().PopExprWithNodeId(); auto [cast_type_inst_id, cast_type_id] = @@ -134,9 +139,9 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, auto make_binding_pattern = [&]() -> SemIR::InstId { // TODO: Eventually the name will need to support associations with other // scopes, but right now we don't support qualified names here. - auto binding = - AddBindingPattern(context, name_node, name_id, cast_type_id, - type_expr_region_id, pattern_inst_kind, is_template); + auto binding = AddBindingPattern(context, name_node, name_id, cast_type_id, + type_expr_region_id, pattern_inst_kind, + is_template, is_unused); // TODO: If `is_generic`, then `binding.bind_id is a SymbolicBinding. Subst // the `.Self` of type `type` in the `cast_type_id` type (a `FacetType`) @@ -279,7 +284,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, .bind_name_id; RegisterReturnedVar(context, introducer.modifier_node_id(ModifierOrder::Decl), - type_node, cast_type_id, bind_id); + type_node, cast_type_id, bind_id, name_id); } } context.node_stack().Push(node_id, binding_pattern_id); @@ -328,7 +333,7 @@ auto HandleParseNode(Context& context, Parse::CompileTimeBindingPatternId node_id) -> bool { // Pop the `.Self` facet value name introduced by the // CompileTimeBindingPatternStart. - context.scope_stack().Pop(); + context.scope_stack().Pop(/*check_unused=*/true); auto node_kind = Parse::NodeKind::CompileTimeBindingPattern; const DeclIntroducerState& introducer = @@ -449,8 +454,68 @@ auto HandleParseNode(Context& context, Parse::TemplateBindingNameId node_id) return true; } +// Within a pattern with an unused modifier, sets the is_unused on all +// entity names and also returns whether any names were found. The result +// is needed to emit a diagnostic when the unused modifier is +// unnecessary. +static auto MarkPatternUnused(Context& context, SemIR::InstId inst_id) -> bool { + bool found_name = false; + llvm::SmallVector worklist; + worklist.push_back(inst_id); + while (!worklist.empty()) { + auto current_inst_id = worklist.pop_back_val(); + auto inst = context.insts().Get(current_inst_id); + CARBON_KIND_SWITCH(inst) { + case SemIR::OutParamPattern::Kind: + case SemIR::RefParamPattern::Kind: + case SemIR::ValueParamPattern::Kind: + case SemIR::VarParamPattern::Kind: { + auto param = inst.As(); + worklist.push_back(param.subpattern_id); + break; + } + case SemIR::RefBindingPattern::Kind: + case SemIR::SymbolicBindingPattern::Kind: + case SemIR::ValueBindingPattern::Kind: { + auto bind = inst.As(); + auto& name = context.entity_names().Get(bind.entity_name_id); + name.is_unused = true; + // We treat `_` as not marking the pattern as unused for the purpose of + // deciding whether to issue a warning for `unused` on a pattern that + // doesn't contain any bindings. `_` is implicitly unused, so marking it + // `unused` is redundant but harmless. + if (name.name_id != SemIR::NameId::Underscore) { + found_name = true; + } + break; + } + case CARBON_KIND(SemIR::TuplePattern tuple): { + for (auto elem_id : context.inst_blocks().Get(tuple.elements_id)) { + worklist.push_back(elem_id); + } + break; + } + case CARBON_KIND(SemIR::VarPattern var): { + worklist.push_back(var.subpattern_id); + break; + } + default: + break; + } + } + return found_name; +} + auto HandleParseNode(Context& context, Parse::UnusedPatternId node_id) -> bool { - return context.TODO(node_id, "unused"); + auto [child_node, child_inst_id] = + context.node_stack().PopPatternWithNodeId(); + if (!MarkPatternUnused(context, child_inst_id)) { + CARBON_DIAGNOSTIC(UnusedPatternNoBindings, Warning, + "`unused` modifier on pattern without bindings"); + context.emitter().Emit(node_id, UnusedPatternNoBindings); + } + context.node_stack().Push(node_id, child_inst_id); + return true; } } // namespace Carbon::Check diff --git a/toolchain/check/handle_choice.cpp b/toolchain/check/handle_choice.cpp index 231a4b1e92e6..e08295d55b07 100644 --- a/toolchain/check/handle_choice.cpp +++ b/toolchain/check/handle_choice.cpp @@ -12,6 +12,7 @@ #include "toolchain/check/literal.h" #include "toolchain/check/name_component.h" #include "toolchain/check/type.h" +#include "toolchain/check/unused.h" #include "toolchain/diagnostics/diagnostic.h" #include "toolchain/lex/token_kind.h" #include "toolchain/sem_ir/ids.h" @@ -307,7 +308,7 @@ auto HandleParseNode(Context& context, Parse::ChoiceDefinitionId node_id) // The scopes and blocks for the choice itself. context.inst_block_stack().Pop(); context.decl_introducer_state_stack().Pop(); - context.scope_stack().Pop(); + context.scope_stack().Pop(/*check_unused=*/true); context.decl_name_stack().PopScope(); FinishGenericDefinition(context, class_info.generic_id); diff --git a/toolchain/check/handle_codeblock.cpp b/toolchain/check/handle_codeblock.cpp index 99e94424af2f..639e2dd033bd 100644 --- a/toolchain/check/handle_codeblock.cpp +++ b/toolchain/check/handle_codeblock.cpp @@ -4,6 +4,7 @@ #include "toolchain/check/context.h" #include "toolchain/check/handle.h" +#include "toolchain/check/unused.h" namespace Carbon::Check { @@ -15,7 +16,7 @@ auto HandleParseNode(Context& context, Parse::CodeBlockStartId node_id) } auto HandleParseNode(Context& context, Parse::CodeBlockId /*node_id*/) -> bool { - context.scope_stack().Pop(); + context.scope_stack().Pop(/*check_unused=*/true); context.node_stack() .PopAndDiscardSoloNodeId(); return true; diff --git a/toolchain/check/handle_function.cpp b/toolchain/check/handle_function.cpp index d061b2f7c60a..f534548f904b 100644 --- a/toolchain/check/handle_function.cpp +++ b/toolchain/check/handle_function.cpp @@ -10,22 +10,19 @@ #include "toolchain/check/control_flow.h" #include "toolchain/check/convert.h" #include "toolchain/check/decl_introducer_state.h" -#include "toolchain/check/decl_name_stack.h" -#include "toolchain/check/function.h" #include "toolchain/check/generic.h" #include "toolchain/check/handle.h" -#include "toolchain/check/import.h" #include "toolchain/check/import_ref.h" -#include "toolchain/check/inst.h" #include "toolchain/check/interface.h" -#include "toolchain/check/keyword_modifier_set.h" #include "toolchain/check/literal.h" #include "toolchain/check/merge.h" #include "toolchain/check/modifiers.h" #include "toolchain/check/name_component.h" #include "toolchain/check/name_lookup.h" +#include "toolchain/check/return.h" #include "toolchain/check/type.h" #include "toolchain/check/type_completion.h" +#include "toolchain/check/unused.h" #include "toolchain/lex/token_kind.h" #include "toolchain/parse/node_ids.h" #include "toolchain/sem_ir/builtin_function_kind.h" @@ -607,8 +604,73 @@ static auto BuildFunctionDecl(Context& context, return {function_decl.function_id, decl_id}; } +// Checks that "unused" marker is only used in definitions, and emits a +// diagnostic for every binding that is marked unused. +static auto CheckUnusedBindingsInPattern(Context& context, + SemIR::InstId pattern_id) -> void { + llvm::SmallVector work_list; + work_list.push_back(pattern_id); + + while (!work_list.empty()) { + auto current_id = work_list.pop_back_val(); + auto inst = context.insts().Get(current_id); + CARBON_KIND_SWITCH(inst) { + case SemIR::OutParamPattern::Kind: + case SemIR::RefParamPattern::Kind: + case SemIR::ValueParamPattern::Kind: + case SemIR::VarParamPattern::Kind: { + auto param = inst.As(); + work_list.push_back(param.subpattern_id); + break; + } + case SemIR::RefBindingPattern::Kind: + case SemIR::SymbolicBindingPattern::Kind: + case SemIR::ValueBindingPattern::Kind: { + auto bind = inst.As(); + auto& entity_name = context.entity_names().Get(bind.entity_name_id); + // We need special treatment for the name "_" which is implicitly + // unused but actually permitted in declarations. + if (entity_name.is_unused && + entity_name.name_id != SemIR::NameId::Underscore) { + CARBON_DIAGNOSTIC(UnusedModifierOnDeclaration, Error, + "`unused` modifier on declaration"); + context.emitter().Emit(current_id, UnusedModifierOnDeclaration); + } + break; + } + case CARBON_KIND(SemIR::VarPattern var_pattern): { + work_list.push_back(var_pattern.subpattern_id); + break; + } + case CARBON_KIND(SemIR::TuplePattern tuple_pattern): { + auto elements = context.inst_blocks().Get(tuple_pattern.elements_id); + for (auto element_id : llvm::reverse(elements)) { + work_list.push_back(element_id); + } + break; + } + default: + break; + } + } +} + +static auto DiagnoseUnusedMarkersInDeclaration(Context& context, + SemIR::FunctionId function_id) + -> void { + const auto& function = context.functions().Get(function_id); + if (function.param_patterns_id.has_value()) { + for (auto pattern_id : + context.inst_blocks().Get(function.param_patterns_id)) { + CheckUnusedBindingsInPattern(context, pattern_id); + } + } +} + auto HandleParseNode(Context& context, Parse::FunctionDeclId node_id) -> bool { - BuildFunctionDecl(context, node_id, /*is_definition=*/false); + auto [function_id, decl_id] = + BuildFunctionDecl(context, node_id, /*is_definition=*/false); + DiagnoseUnusedMarkersInDeclaration(context, function_id); context.decl_name_stack().PopScope(); return true; } @@ -672,7 +734,7 @@ auto HandleParseNode(Context& context, Parse::FunctionDefinitionId node_id) } FinishFunctionDefinition(context, function_id); - context.decl_name_stack().PopScope(); + context.decl_name_stack().PopScope(/*check_unused=*/true); return true; } diff --git a/toolchain/check/handle_struct.cpp b/toolchain/check/handle_struct.cpp index 92a36119ffdf..08801eaaa77c 100644 --- a/toolchain/check/handle_struct.cpp +++ b/toolchain/check/handle_struct.cpp @@ -8,6 +8,7 @@ #include "toolchain/check/handle.h" #include "toolchain/check/inst.h" #include "toolchain/check/type.h" +#include "toolchain/check/unused.h" #include "toolchain/diagnostics/format_providers.h" namespace Carbon::Check { @@ -137,7 +138,7 @@ auto HandleParseNode(Context& context, Parse::StructLiteralId node_id) -> bool { auto elements_id = context.param_and_arg_refs_stack().EndAndPop( Parse::NodeKind::StructLiteralStart); - context.scope_stack().Pop(); + context.scope_stack().Pop(/*check_unused=*/true); context.node_stack() .PopAndDiscardSoloNodeId(); @@ -163,7 +164,7 @@ auto HandleParseNode(Context& context, Parse::StructTypeLiteralId node_id) llvm::SmallVector field_name_nodes = PopFieldNameNodes(context, fields.size()); - context.scope_stack().Pop(); + context.scope_stack().Pop(/*check_unused=*/true); context.node_stack() .PopAndDiscardSoloNodeId(); diff --git a/toolchain/check/handle_where.cpp b/toolchain/check/handle_where.cpp index b87227b52c4e..3cc7e40d63e7 100644 --- a/toolchain/check/handle_where.cpp +++ b/toolchain/check/handle_where.cpp @@ -9,6 +9,7 @@ #include "toolchain/check/handle.h" #include "toolchain/check/inst.h" #include "toolchain/check/type.h" +#include "toolchain/check/unused.h" #include "toolchain/sem_ir/facet_type_info.h" #include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/inst.h" @@ -188,7 +189,7 @@ auto HandleParseNode(Context& context, Parse::WhereExprId node_id) -> bool { context.rewrites_stack().pop_back(); // Remove `PeriodSelf` from name lookup, undoing the `Push` done for the // `WhereOperand`. - context.scope_stack().Pop(); + context.scope_stack().Pop(/*check_unused=*/true); SemIR::InstId period_self_id = context.node_stack().Pop(); SemIR::InstBlockId requirements_id = context.args_type_info_stack().Pop(); diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index cf1404826039..bf5c95bcda78 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -644,7 +644,7 @@ static auto GetLocalSymbolicEntityNameId( auto name_id = GetLocalNameId(context, import_entity_name.name_id); return context.local_entity_names().AddSymbolicBindingName( name_id, SemIR::NameScopeId::None, import_entity_name.bind_index(), - import_entity_name.is_template); + import_entity_name.is_template, import_entity_name.is_unused); } // Gets the local constant values corresponding to an imported inst block. diff --git a/toolchain/check/interface.cpp b/toolchain/check/interface.cpp index 083e6ee6c990..c5d85ecf2c85 100644 --- a/toolchain/check/interface.cpp +++ b/toolchain/check/interface.cpp @@ -139,7 +139,8 @@ auto AddSelfSymbolicBindingToScope(Context& context, bool is_template) -> SemIR::InstId { auto entity_name_id = context.entity_names().AddSymbolicBindingName( SemIR::NameId::SelfType, scope_id, - context.scope_stack().AddCompileTimeBinding(), is_template); + context.scope_stack().AddCompileTimeBinding(), is_template, + /*is_unused=*/false); // Because there is no equivalent non-symbolic value, we use `None` as // the `value_id` on the `SymbolicBinding`. auto self_param_inst_id = diff --git a/toolchain/check/lexical_lookup.h b/toolchain/check/lexical_lookup.h index c5b6d2ce07d6..b81bc8f49b08 100644 --- a/toolchain/check/lexical_lookup.h +++ b/toolchain/check/lexical_lookup.h @@ -29,6 +29,10 @@ class LexicalLookup { SemIR::InstId inst_id; // The scope in which the instruction was added. ScopeIndex scope_index; + // Whether the name was declared in a reachable position. + bool is_decl_reachable = true; + // The location of the first use of the name, if any. + SemIR::LocId use_loc_id = SemIR::LocId::None; }; // A lookup result that has been temporarily removed from scope. @@ -38,6 +42,10 @@ class LexicalLookup { uint32_t index; // The lookup result. SemIR::InstId inst_id; + // Whether the name was declared in a reachable position. + bool is_decl_reachable; + // The location of the first use of the name, if any. + SemIR::LocId use_loc_id; }; explicit LexicalLookup(const SharedValueStores::IdentifierStore& identifiers) @@ -65,14 +73,19 @@ class LexicalLookup { name_id); CARBON_CHECK(index <= std::numeric_limits::max(), "Unexpectedly large index {0} for name ID", index); + auto result = results.pop_back_val(); return {.index = static_cast(index), - .inst_id = results.pop_back_val().inst_id}; + .inst_id = result.inst_id, + .is_decl_reachable = result.is_decl_reachable, + .use_loc_id = result.use_loc_id}; } // Restore a previously-suspended lookup result. auto Restore(SuspendedResult sus, ScopeIndex index) -> void { - lookup_[sus.index].push_back( - {.inst_id = sus.inst_id, .scope_index = index}); + lookup_[sus.index].push_back({.inst_id = sus.inst_id, + .scope_index = index, + .is_decl_reachable = sus.is_decl_reachable, + .use_loc_id = sus.use_loc_id}); } private: diff --git a/toolchain/check/merge.cpp b/toolchain/check/merge.cpp index b9b419bc3e11..46b992ea38f3 100644 --- a/toolchain/check/merge.cpp +++ b/toolchain/check/merge.cpp @@ -450,12 +450,23 @@ static auto CheckRedeclParamSyntax(Context& context, for (; new_iter != new_end && prev_iter != prev_end; ++new_iter, ++prev_iter) { auto new_node_id = *new_iter; + auto new_node_kind = context.parse_tree().node_kind(new_node_id); + // Skip over "unused" markers. + if (new_node_kind == Parse::NodeKind::UnusedPattern) { + ++new_iter; + new_node_id = *new_iter; + new_node_kind = context.parse_tree().node_kind(new_node_id); + } auto prev_node_id = *prev_iter; + auto prev_node_kind = context.parse_tree().node_kind(prev_node_id); + if (prev_node_kind == Parse::NodeKind::UnusedPattern) { + ++prev_iter; + prev_node_id = *prev_iter; + prev_node_kind = context.parse_tree().node_kind(prev_node_id); + } if (!IsNodeSyntaxEqual(context, new_node_id, prev_node_id)) { // Skip difference if it is `Self as` vs. `as` in an `impl` declaration. // https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p3763.md#redeclarations - auto new_node_kind = context.parse_tree().node_kind(new_node_id); - auto prev_node_kind = context.parse_tree().node_kind(prev_node_id); if (new_node_kind == Parse::NodeKind::ImplDefaultSelfAs && prev_node_kind == Parse::NodeKind::SelfTypeNameExpr && context.parse_tree().node_kind(prev_iter[1]) == diff --git a/toolchain/check/name_lookup.cpp b/toolchain/check/name_lookup.cpp index 6d1f4490734b..a5839295b753 100644 --- a/toolchain/check/name_lookup.cpp +++ b/toolchain/check/name_lookup.cpp @@ -7,6 +7,7 @@ #include #include "common/raw_string_ostream.h" +#include "toolchain/check/control_flow.h" #include "toolchain/check/cpp/import.h" #include "toolchain/check/facet_type.h" #include "toolchain/check/generic.h" @@ -26,8 +27,8 @@ namespace Carbon::Check { auto AddNameToLookup(Context& context, SemIR::NameId name_id, SemIR::InstId target_id, ScopeIndex scope_index) -> void { - if (auto existing = context.scope_stack().LookupOrAddName(name_id, target_id, - scope_index); + if (auto existing = context.scope_stack().LookupOrAddName( + name_id, target_id, scope_index, IsCurrentPositionReachable(context)); existing.has_value()) { // TODO: Add coverage to this use case and use the location of the name // instead of the target. @@ -72,10 +73,12 @@ auto LookupNameInDecl(Context& context, SemIR::LocId loc_id, // class C(C:! type); // } // - // In this case, the class C is not a redeclaration of its parameter, but - // we find the parameter in order to diagnose a redeclaration error. + // In this case, the class C is not a redeclaration of its parameter, but + // we find the parameter in order to diagnose a redeclaration error. return SemIR::ScopeLookupResult::MakeWrappedLookupResult( - context.scope_stack().LookupInLexicalScopesWithin(name_id, scope_index), + context.scope_stack().LookupInLexicalScopesWithin( + name_id, scope_index, /*use_loc_id=*/SemIR::LocId::None, + /*is_reachable=*/true), SemIR::AccessKind::Public); } else { // We do not look into `extend`ed scopes here. A qualified name in a @@ -101,7 +104,8 @@ auto LookupUnqualifiedName(Context& context, SemIR::LocId loc_id, // Find the results from ancestor lexical scopes. These will be combined with // results from non-lexical scopes such as namespaces and classes. auto [lexical_result, non_lexical_scopes] = - context.scope_stack().LookupInLexicalScopes(name_id); + context.scope_stack().LookupInLexicalScopes( + name_id, loc_id, IsCurrentPositionReachable(context)); // Walk the non-lexical scopes and perform lookups into each of them. for (auto [index, lookup_scope_id, specific_id] : diff --git a/toolchain/check/pattern.cpp b/toolchain/check/pattern.cpp index 2d8627d5ddab..2338571f476d 100644 --- a/toolchain/check/pattern.cpp +++ b/toolchain/check/pattern.cpp @@ -49,8 +49,8 @@ auto EndSubpatternAsNonExpr(Context& context) -> void { auto AddBindingPattern(Context& context, SemIR::LocId name_loc, SemIR::NameId name_id, SemIR::TypeId type_id, SemIR::ExprRegionId type_region_id, - SemIR::InstKind pattern_kind, bool is_template) - -> BindingPatternInfo { + SemIR::InstKind pattern_kind, bool is_template, + bool is_unused) -> BindingPatternInfo { SemIR::InstKind bind_name_kind; switch (pattern_kind) { case SemIR::InstKind::RefBindingPattern: @@ -71,7 +71,7 @@ auto AddBindingPattern(Context& context, SemIR::LocId name_loc, name_id, context.scope_stack().PeekNameScopeId(), is_generic ? context.scope_stack().AddCompileTimeBinding() : SemIR::CompileTimeBindIndex::None, - is_template); + is_template, is_unused || name_id == SemIR::NameId::Underscore); auto bind_id = AddInstInNoBlock( context, @@ -147,7 +147,7 @@ auto AddParamPattern(Context& context, SemIR::LocId loc_id, SemIR::InstId pattern_id = AddBindingPattern(context, loc_id, name_id, type_id, type_expr_region_id, binding_pattern_kind, - /*is_template=*/false) + /*is_template=*/false, /*is_unused=*/false) .pattern_id; const auto& param_pattern_kind = diff --git a/toolchain/check/pattern.h b/toolchain/check/pattern.h index 6e254d4b442e..6571e392c8ac 100644 --- a/toolchain/check/pattern.h +++ b/toolchain/check/pattern.h @@ -37,13 +37,16 @@ struct BindingPatternInfo { // Creates a binding pattern. Returns the binding pattern and the bind name // instruction. +// - `pattern_kind` specifies the kind of instruction to create. +// - `is_template` indicates whether this is a template binding. +// - `is_unused` indicates whether the binding was explicitly marked `unused`. // TODO: remove is_template once we have a separate InstKind for template // bindings. auto AddBindingPattern(Context& context, SemIR::LocId name_loc, SemIR::NameId name_id, SemIR::TypeId type_id, SemIR::ExprRegionId type_region_id, - SemIR::InstKind pattern_kind, bool is_template) - -> BindingPatternInfo; + SemIR::InstKind pattern_kind, bool is_template, + bool is_unused) -> BindingPatternInfo; // Creates storage for `var` patterns nested within the given pattern at the // current location in the output SemIR. For a `returned var`, this diff --git a/toolchain/check/return.cpp b/toolchain/check/return.cpp index cf5997fb744b..2894b58ef3bd 100644 --- a/toolchain/check/return.cpp +++ b/toolchain/check/return.cpp @@ -73,7 +73,7 @@ static auto NoteReturnedVar(DiagnosticBuilder& diag, auto RegisterReturnedVar(Context& context, Parse::NodeId returned_node, Parse::NodeId type_node, SemIR::TypeId type_id, - SemIR::InstId bind_id) -> void { + SemIR::InstId bind_id, SemIR::NameId name_id) -> void { auto& function = GetCurrentFunctionForReturn(context); auto return_type_id = function.GetDeclaredReturnType(context.sem_ir()); @@ -111,7 +111,8 @@ auto RegisterReturnedVar(Context& context, Parse::NodeId returned_node, diag.Emit(); } - auto existing_id = context.scope_stack().SetReturnedVarOrGetExisting(bind_id); + auto existing_id = + context.scope_stack().SetReturnedVarOrGetExisting(bind_id, name_id); if (existing_id.has_value()) { CARBON_DIAGNOSTIC(ReturnedVarShadowed, Error, "cannot declare a `returned var` in the scope of " diff --git a/toolchain/check/return.h b/toolchain/check/return.h index 7cf75ef7336d..fc82cf00ba45 100644 --- a/toolchain/check/return.h +++ b/toolchain/check/return.h @@ -24,7 +24,7 @@ auto GetReturnedVarParam(Context& context, const SemIR::Function& function) // var` in this scope. auto RegisterReturnedVar(Context& context, Parse::NodeId returned_node, Parse::NodeId type_node, SemIR::TypeId type_id, - SemIR::InstId bind_id) -> void; + SemIR::InstId bind_id, SemIR::NameId name_id) -> void; // Checks and builds SemIR for a `return;` statement. auto BuildReturnWithNoExpr(Context& context, SemIR::LocId loc_id) -> void; diff --git a/toolchain/check/scope_stack.cpp b/toolchain/check/scope_stack.cpp index 4fca6e91f7b0..d7cc2d58402d 100644 --- a/toolchain/check/scope_stack.cpp +++ b/toolchain/check/scope_stack.cpp @@ -7,10 +7,21 @@ #include #include "common/check.h" +#include "toolchain/check/context.h" +#include "toolchain/check/unused.h" #include "toolchain/sem_ir/ids.h" namespace Carbon::Check { +ScopeStack::ScopeStack(Context& context) + : context_(&context), + lexical_lookup_(context.sem_ir().identifiers()), + full_pattern_stack_(&lexical_lookup_) {} + +auto ScopeStack::sem_ir() const -> const SemIR::File& { + return context_->sem_ir(); +} + auto ScopeStack::VerifyOnFinish() const -> void { CARBON_CHECK(return_scope_stack_.empty(), "{0}", return_scope_stack_.size()); CARBON_CHECK(break_continue_stack_.empty(), "{0}", @@ -88,7 +99,7 @@ auto ScopeStack::PushForEntity(SemIR::InstId scope_inst_id, SemIR::SpecificId specific_id, bool lexical_lookup_has_load_error) -> void { CARBON_CHECK(scope_inst_id.has_value()); - CARBON_DCHECK(!sem_ir_->insts().Is(scope_inst_id)); + CARBON_DCHECK(!sem_ir().insts().Is(scope_inst_id)); Push(scope_inst_id, scope_id, specific_id, lexical_lookup_has_load_error); MarkNestingIfInReturnScope(); } @@ -99,7 +110,7 @@ auto ScopeStack::PushForSameRegion() -> void { } auto ScopeStack::PushForFunctionBody(SemIR::InstId scope_inst_id) -> void { - CARBON_DCHECK(sem_ir_->insts().Is(scope_inst_id)); + CARBON_DCHECK(sem_ir().insts().Is(scope_inst_id)); Push(scope_inst_id, SemIR::NameScopeId::None, SemIR::SpecificId::None, /*lexical_lookup_has_load_error=*/false); @@ -107,13 +118,18 @@ auto ScopeStack::PushForFunctionBody(SemIR::InstId scope_inst_id) -> void { destroy_id_stack_.PushArray(); } -auto ScopeStack::Pop() -> void { +auto ScopeStack::Pop(bool check_unused) -> void { auto scope = scope_stack_.pop_back_val(); - scope.names.ForEach([&](SemIR::NameId str_id) { - auto& lexical_results = lexical_lookup_.Get(str_id); + // TODO: Multiple diagnostics on same line has non-deterministic order. + // Add second sort key in diagnostics sorting. + scope.names.ForEach([&, check_unused](SemIR::NameId name_id) { + auto& lexical_results = lexical_lookup_.Get(name_id); CARBON_CHECK(lexical_results.back().scope_index == scope.index, - "Inconsistent scope index for name {0}", str_id); + "Inconsistent scope index for name {0}", name_id); + if (check_unused) { + CheckUnusedBinding(*context_, name_id, lexical_results.back()); + } lexical_results.pop_back(); }); @@ -144,19 +160,52 @@ auto ScopeStack::Pop() -> void { compile_time_binding_stack_.PopArray(); } -auto ScopeStack::PopTo(ScopeIndex index) -> void { +auto ScopeStack::PopTo(ScopeIndex index, bool check_unused) -> void { while (PeekIndex() > index) { - Pop(); + Pop(check_unused); } CARBON_CHECK(PeekIndex() == index, "Scope index {0} does not enclose the current scope {1}", index, PeekIndex()); } -auto ScopeStack::LookupInLexicalScopesWithin(SemIR::NameId name_id, - ScopeIndex scope_index) - -> SemIR::InstId { +auto ScopeStack::MarkUsed(SemIR::NameId name_id, SemIR::LocId loc_id, + bool is_reachable) -> void { auto& lexical_results = lexical_lookup_.Get(name_id); + if (lexical_results.empty()) { + return; + } + auto& result = lexical_results.back(); + if (result.use_loc_id.has_value()) { + return; + } + + // Determine if we should set use_loc_id. + if (result.inst_id.has_value() && + result.inst_id != SemIR::InstId::InitTombstone) { + if (auto binding = + context_->insts().TryGetAs(result.inst_id)) { + const auto& entity_name = + context_->entity_names().Get(binding->entity_name_id); + if (entity_name.is_unused && !is_reachable) { + return; + } + } + } + // For non-bindings (like namespaces), we just mark them as used. + // If the instruction is not valid (e.g. InitTombstone), we mark it as used + // to avoid spurious "unused" warnings, assuming the invalid state will be + // diagnosed elsewhere (e.g. used before init). + result.use_loc_id = loc_id; +} + +auto ScopeStack::LookupInLexicalScopesWithin(SemIR::NameId name_id, + ScopeIndex scope_index, + SemIR::LocId use_loc_id, + bool is_reachable) + -> SemIR::InstId { + llvm::ArrayRef lexical_results = + lexical_lookup_.Get(name_id); if (lexical_results.empty()) { return SemIR::InstId::None; } @@ -166,10 +215,15 @@ auto ScopeStack::LookupInLexicalScopesWithin(SemIR::NameId name_id, return SemIR::InstId::None; } + if (use_loc_id.has_value()) { + MarkUsed(name_id, use_loc_id, is_reachable); + } return result.inst_id; } -auto ScopeStack::LookupInLexicalScopes(SemIR::NameId name_id) +auto ScopeStack::LookupInLexicalScopes(SemIR::NameId name_id, + SemIR::LocId use_loc_id, + bool is_reachable) -> std::pair> { // Find the results from lexical scopes. These will be combined with results // from non-lexical scopes such as namespaces and classes. @@ -183,6 +237,9 @@ auto ScopeStack::LookupInLexicalScopes(SemIR::NameId name_id) non_lexical_scope_stack_}; } + if (use_loc_id.has_value()) { + MarkUsed(name_id, use_loc_id, is_reachable); + } // Find the first non-lexical scope that is within the scope of the lexical // lookup result. auto* first_non_lexical_scope = llvm::lower_bound( @@ -196,7 +253,8 @@ auto ScopeStack::LookupInLexicalScopes(SemIR::NameId name_id) } auto ScopeStack::LookupOrAddName(SemIR::NameId name_id, SemIR::InstId target_id, - ScopeIndex scope_index) -> SemIR::InstId { + ScopeIndex scope_index, bool is_decl_reachable) + -> SemIR::InstId { // Find the corresponding scope depth. // // TODO: Consider passing in the depth rather than performing a scan for it. @@ -231,23 +289,29 @@ auto ScopeStack::LookupOrAddName(SemIR::NameId name_id, SemIR::InstId target_id, ++scope_stack_[scope_depth].num_names; // Add a corresponding lexical lookup result. - lexical_results.push_back({.inst_id = target_id, .scope_index = scope_index}); + lexical_results.push_back({.inst_id = target_id, + .scope_index = scope_index, + .is_decl_reachable = is_decl_reachable, + .use_loc_id = SemIR::LocId::None}); return SemIR::InstId::None; } -auto ScopeStack::SetReturnedVarOrGetExisting(SemIR::InstId inst_id) +auto ScopeStack::SetReturnedVarOrGetExisting(SemIR::InstId inst_id, + SemIR::NameId name_id) -> SemIR::InstId { CARBON_CHECK(!return_scope_stack_.empty(), "`returned var` in no function"); - auto& returned_var = return_scope_stack_.back().returned_var; - if (returned_var.has_value()) { - return returned_var; + auto& return_scope = return_scope_stack_.back(); + if (return_scope.returned_var.has_value()) { + return return_scope.returned_var; } - returned_var = inst_id; + return_scope.returned_var = inst_id; CARBON_CHECK(!scope_stack_.back().has_returned_var, "Scope has returned var but none is set"); if (inst_id.has_value()) { scope_stack_.back().has_returned_var = true; + MarkUsed(name_id, SemIR::LocId(inst_id), + context_->inst_block_stack().is_current_block_reachable()); } return SemIR::InstId::None; } @@ -264,10 +328,14 @@ auto ScopeStack::Suspend() -> SuspendedScope { peek_compile_time_bindings.size()); result.entry.names.ForEach([&](SemIR::NameId name_id) { - auto [index, inst_id] = lexical_lookup_.Suspend(name_id); - CARBON_CHECK(index != + auto suspended = lexical_lookup_.Suspend(name_id); + CARBON_CHECK(suspended.index != SuspendedScope::ScopeItem::IndexForCompileTimeBinding); - result.suspended_items.push_back({.index = index, .inst_id = inst_id}); + result.suspended_items.push_back( + {.index = suspended.index, + .inst_id = suspended.inst_id, + .is_decl_reachable = suspended.is_decl_reachable, + .use_loc_id = suspended.use_loc_id}); }); CARBON_CHECK(static_cast(result.suspended_items.size()) == result.entry.num_names); @@ -276,7 +344,9 @@ auto ScopeStack::Suspend() -> SuspendedScope { for (auto inst_id : peek_compile_time_bindings) { result.suspended_items.push_back( {.index = SuspendedScope::ScopeItem::IndexForCompileTimeBinding, - .inst_id = inst_id}); + .inst_id = inst_id, + .is_decl_reachable = true, + .use_loc_id = SemIR::LocId::None}); } compile_time_binding_stack_.PopArray(); @@ -288,11 +358,14 @@ auto ScopeStack::Suspend() -> SuspendedScope { auto ScopeStack::Restore(SuspendedScope&& scope) -> void { compile_time_binding_stack_.PushArray(); - for (auto [index, inst_id] : scope.suspended_items) { - if (index == SuspendedScope::ScopeItem::IndexForCompileTimeBinding) { - compile_time_binding_stack_.AppendToTop(inst_id); + for (auto item : scope.suspended_items) { + if (item.index == SuspendedScope::ScopeItem::IndexForCompileTimeBinding) { + compile_time_binding_stack_.AppendToTop(item.inst_id); } else { - lexical_lookup_.Restore({.index = index, .inst_id = inst_id}, + lexical_lookup_.Restore({.index = item.index, + .inst_id = item.inst_id, + .is_decl_reachable = item.is_decl_reachable, + .use_loc_id = item.use_loc_id}, scope.entry.index); } } diff --git a/toolchain/check/scope_stack.h b/toolchain/check/scope_stack.h index 759b4a403fb9..53479bfaebd3 100644 --- a/toolchain/check/scope_stack.h +++ b/toolchain/check/scope_stack.h @@ -17,14 +17,13 @@ namespace Carbon::Check { +class Context; + // A stack of lexical and semantic scopes that we are currently performing // checking within. class ScopeStack { public: - explicit ScopeStack(const SemIR::File* sem_ir) - : sem_ir_(sem_ir), - lexical_lookup_(sem_ir->identifiers()), - full_pattern_stack_(&lexical_lookup_) {} + explicit ScopeStack(Context& context); // A scope in which `break` and `continue` can be used. struct BreakContinueScope { @@ -66,17 +65,18 @@ class ScopeStack { auto PushForFunctionBody(SemIR::InstId scope_inst_id) -> void; // Pops the top scope from scope_stack_. Removes names from lexical_lookup_. - auto Pop() -> void; + // If `check_unused` is set, checks and emits diagnostics for unused names. + auto Pop(bool check_unused = false) -> void; // Pops the top scope from scope_stack_ if it contains no names. - auto PopIfEmpty() -> void { + auto PopIfEmpty(bool check_unused = false) -> void { if (scope_stack_.back().num_names == 0) { - Pop(); + Pop(check_unused); } } // Pops scopes until we return to the specified scope index. - auto PopTo(ScopeIndex index) -> void; + auto PopTo(ScopeIndex index, bool check_unused = false) -> void; // Returns the scope index associated with the current scope. auto PeekIndex() const -> ScopeIndex { return Peek().index; } @@ -111,7 +111,7 @@ class ScopeStack { if (!inst_id.has_value()) { return std::nullopt; } - return sem_ir_->insts().TryGetAs(inst_id); + return sem_ir().insts().TryGetAs(inst_id); } // Returns the current scope, assuming it is of the specified kind. @@ -121,13 +121,14 @@ class ScopeStack { auto GetCurrentScopeAs() -> InstT { auto inst_id = PeekInstId(); CARBON_CHECK(inst_id.has_value()); - return sem_ir_->insts().GetAs(inst_id); + return sem_ir().insts().GetAs(inst_id); } // If there is no `returned var` in scope, sets the given instruction to be // the current `returned var` and returns an `None`. If there // is already a `returned var`, returns it instead. - auto SetReturnedVarOrGetExisting(SemIR::InstId inst_id) -> SemIR::InstId; + auto SetReturnedVarOrGetExisting(SemIR::InstId inst_id, SemIR::NameId name_id) + -> SemIR::InstId; // Returns the `returned var` instruction that's currently in scope, or `None` // if there isn't one. @@ -144,23 +145,29 @@ class ScopeStack { // Looks up the name `name_id` in the current scope and enclosing scopes, but // do not look past `scope_index`. Returns the existing lookup result, if any. + // If `use_loc_id` is specified, the name is marked as used at that location. auto LookupInLexicalScopesWithin(SemIR::NameId name_id, - ScopeIndex scope_index) -> SemIR::InstId; + ScopeIndex scope_index, + SemIR::LocId use_loc_id, bool is_reachable) + -> SemIR::InstId; // Looks up the name `name_id` in the current scope and related lexical // scopes. Returns the innermost lexical lookup result, if any, along with a // list of non-lexical scopes in which lookup should also be performed, - // ordered from outermost to innermost. - auto LookupInLexicalScopes(SemIR::NameId name_id) + // ordered from outermost to innermost. If `use_loc_id` is specified, the + // name is marked as used at that location. + auto LookupInLexicalScopes(SemIR::NameId name_id, SemIR::LocId use_loc_id, + bool is_reachable) -> std::pair>; // Looks up the name `name_id` in the current scope, or in `scope_index` if // specified. Returns the existing instruction if the name is already declared // in that scope or any unfinished scope within it, and otherwise adds the - // name with the value `target_id` and returns `None`. + // name with the value `target_id` and returns `None`. `is_decl_reachable` + // indicates whether the name was declared in a reachable position. auto LookupOrAddName(SemIR::NameId name_id, SemIR::InstId target_id, - ScopeIndex scope_index = ScopeIndex::None) - -> SemIR::InstId; + ScopeIndex scope_index = ScopeIndex::None, + bool is_decl_reachable = true) -> SemIR::InstId; // Prepares to add a compile-time binding in the current scope, and returns // its index. The added binding must then be pushed using @@ -200,6 +207,10 @@ class ScopeStack { auto full_pattern_stack() -> FullPatternStack& { return full_pattern_stack_; } private: + auto sem_ir() const -> const SemIR::File&; + + auto lexical_lookup() -> LexicalLookup& { return lexical_lookup_; } + // An entry in scope_stack_. struct ScopeStackEntry : public MoveOnly { auto is_lexical_scope() const -> bool { return !scope_id.has_value(); } @@ -286,6 +297,10 @@ class ScopeStack { } } + // Marks the name `name_id` as used at the given location. + auto MarkUsed(SemIR::NameId name_id, SemIR::LocId loc_id, bool is_reachable) + -> void; + // Checks that the provided scope's `next_compile_time_bind_index` matches the // full size of the current `compile_time_binding_stack_`. The values should // always match, and this is used to validate the correspondence during @@ -293,8 +308,8 @@ class ScopeStack { auto VerifyNextCompileTimeBindIndex(llvm::StringLiteral label, const ScopeStackEntry& scope) -> void; - // The current file. - const SemIR::File* sem_ir_; + // Context, used only for checks and emitting diagnostics. + Context* context_; // A stack of scopes from which we can `return`. llvm::SmallVector return_scope_stack_; @@ -344,6 +359,10 @@ struct ScopeStack::SuspendedScope : public MoveOnly { uint32_t index; // The instruction within the scope. SemIR::InstId inst_id; + // Whether the name was declared in a reachable position. + bool is_decl_reachable; + // The location of the first use of the name, if any. + SemIR::LocId use_loc_id; }; // The suspended scope stack entry. diff --git a/toolchain/check/testdata/array/basics.carbon b/toolchain/check/testdata/array/basics.carbon index 7905c55ed1c7..3dfc67fb04fd 100644 --- a/toolchain/check/testdata/array/basics.carbon +++ b/toolchain/check/testdata/array/basics.carbon @@ -35,7 +35,7 @@ fn F() -> (C, C, C); fn G() { //@dump-sem-ir-begin - var v: array((C, C, C), 2) = (F(), F()); + var unused v: array((C, C, C), 2) = (F(), F()); //@dump-sem-ir-end } @@ -46,8 +46,8 @@ library "[[@TEST_NAME]]"; fn G() { // These should have two different constant values. //@dump-sem-ir-begin - var a: array((), 3); - var b: ((), (), ()); + var unused a: array((), 3); + var unused b: ((), (), ()); //@dump-sem-ir-end } @@ -59,7 +59,7 @@ fn F() -> ((),) { return ((),); } fn Run() { //@dump-sem-ir-begin - var t: array((), 1) = F(); + var unused t: array((), 1) = F(); //@dump-sem-ir-end } @@ -195,30 +195,30 @@ var a: array(1, 1); // CHECK:STDOUT: %v.var_patt: %pattern_type.709 = var_pattern %v.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %array_type = var %v.var_patt -// CHECK:STDOUT: %F.ref.loc10_33: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %.loc10_41.1: ref %tuple.type.e56 = splice_block %.loc10_41.6 { +// CHECK:STDOUT: %F.ref.loc10_40: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] +// CHECK:STDOUT: %.loc10_48.1: ref %tuple.type.e56 = splice_block %.loc10_48.6 { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc10_41.6: ref %tuple.type.e56 = array_index %v.var, %int_0 +// CHECK:STDOUT: %.loc10_48.6: ref %tuple.type.e56 = array_index %v.var, %int_0 // CHECK:STDOUT: } -// CHECK:STDOUT: %F.call.loc10_35: init %tuple.type.e56 to %.loc10_41.1 = call %F.ref.loc10_33() -// CHECK:STDOUT: %F.ref.loc10_38: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %.loc10_41.2: ref %tuple.type.e56 = splice_block %.loc10_41.5 { +// CHECK:STDOUT: %F.call.loc10_42: init %tuple.type.e56 to %.loc10_48.1 = call %F.ref.loc10_40() +// CHECK:STDOUT: %F.ref.loc10_45: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] +// CHECK:STDOUT: %.loc10_48.2: ref %tuple.type.e56 = splice_block %.loc10_48.5 { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] -// CHECK:STDOUT: %.loc10_41.5: ref %tuple.type.e56 = array_index %v.var, %int_1 +// CHECK:STDOUT: %.loc10_48.5: ref %tuple.type.e56 = array_index %v.var, %int_1 // CHECK:STDOUT: } -// CHECK:STDOUT: %F.call.loc10_40: init %tuple.type.e56 to %.loc10_41.2 = call %F.ref.loc10_38() -// CHECK:STDOUT: %.loc10_41.3: %tuple.type.708 = tuple_literal (%F.call.loc10_35, %F.call.loc10_40) -// CHECK:STDOUT: %.loc10_41.4: init %array_type to %v.var = array_init (%F.call.loc10_35, %F.call.loc10_40) -// CHECK:STDOUT: %.loc10_3: init %array_type = converted %.loc10_41.3, %.loc10_41.4 +// CHECK:STDOUT: %F.call.loc10_47: init %tuple.type.e56 to %.loc10_48.2 = call %F.ref.loc10_45() +// CHECK:STDOUT: %.loc10_48.3: %tuple.type.708 = tuple_literal (%F.call.loc10_42, %F.call.loc10_47) +// CHECK:STDOUT: %.loc10_48.4: init %array_type to %v.var = array_init (%F.call.loc10_42, %F.call.loc10_47) +// CHECK:STDOUT: %.loc10_3: init %array_type = converted %.loc10_48.3, %.loc10_48.4 // CHECK:STDOUT: assign %v.var, %.loc10_3 -// CHECK:STDOUT: %.loc10_28: type = splice_block %array_type [concrete = constants.%array_type] { -// CHECK:STDOUT: %C.ref.loc10_17: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %C.ref.loc10_20: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %C.ref.loc10_23: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc10_24.1: %tuple.type.ff9 = tuple_literal (%C.ref.loc10_17, %C.ref.loc10_20, %C.ref.loc10_23) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc10_35: type = splice_block %array_type [concrete = constants.%array_type] { +// CHECK:STDOUT: %C.ref.loc10_24: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc10_27: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc10_30: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc10_31.1: %tuple.type.ff9 = tuple_literal (%C.ref.loc10_24, %C.ref.loc10_27, %C.ref.loc10_30) [concrete = constants.%tuple] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2] -// CHECK:STDOUT: %.loc10_24.2: type = converted %.loc10_24.1, constants.%tuple.type.e56 [concrete = constants.%tuple.type.e56] -// CHECK:STDOUT: %array_type: type = array_type %int_2, %.loc10_24.2 [concrete = constants.%array_type] +// CHECK:STDOUT: %.loc10_31.2: type = converted %.loc10_31.1, constants.%tuple.type.e56 [concrete = constants.%tuple.type.e56] +// CHECK:STDOUT: %array_type: type = array_type %int_2, %.loc10_31.2 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref %array_type = ref_binding v, %v.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %v.var, constants.%DestroyOp @@ -255,11 +255,11 @@ var a: array(1, 1); // CHECK:STDOUT: %a.var_patt: %pattern_type.035 = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %array_type = var %a.var_patt -// CHECK:STDOUT: %.loc7_21: type = splice_block %array_type [concrete = constants.%array_type] { -// CHECK:STDOUT: %.loc7_17.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_28: type = splice_block %array_type [concrete = constants.%array_type] { +// CHECK:STDOUT: %.loc7_24.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3] -// CHECK:STDOUT: %.loc7_17.2: type = converted %.loc7_17.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %array_type: type = array_type %int_3, %.loc7_17.2 [concrete = constants.%array_type] +// CHECK:STDOUT: %.loc7_24.2: type = converted %.loc7_24.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %array_type: type = array_type %int_3, %.loc7_24.2 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var // CHECK:STDOUT: name_binding_decl { @@ -267,15 +267,15 @@ var a: array(1, 1); // CHECK:STDOUT: %b.var_patt: %pattern_type.8c1 = var_pattern %b.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref %tuple.type = var %b.var_patt -// CHECK:STDOUT: %.loc8_21.1: type = splice_block %.loc8_21.6 [concrete = constants.%tuple.type] { -// CHECK:STDOUT: %.loc8_12: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_16: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_20: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_21.2: %tuple.type = tuple_literal (%.loc8_12, %.loc8_16, %.loc8_20) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc8_21.3: type = converted constants.%empty_tuple, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc8_21.4: type = converted constants.%empty_tuple, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc8_21.5: type = converted constants.%empty_tuple, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc8_21.6: type = converted %.loc8_21.2, constants.%tuple.type [concrete = constants.%tuple.type] +// CHECK:STDOUT: %.loc8_28.1: type = splice_block %.loc8_28.6 [concrete = constants.%tuple.type] { +// CHECK:STDOUT: %.loc8_19: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_23: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_27: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_28.2: %tuple.type = tuple_literal (%.loc8_19, %.loc8_23, %.loc8_27) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc8_28.3: type = converted constants.%empty_tuple, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc8_28.4: type = converted constants.%empty_tuple, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc8_28.5: type = converted constants.%empty_tuple, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc8_28.6: type = converted %.loc8_28.2, constants.%tuple.type [concrete = constants.%tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %b: ref %tuple.type = ref_binding b, %b.var // CHECK:STDOUT: %DestroyOp.bound.loc8: = bound_method %b.var, constants.%DestroyOp.b0ebf8.1 @@ -302,7 +302,7 @@ var a: array(1, 1); // CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%empty_tuple) [concrete] -// CHECK:STDOUT: %DestroyOp.type.3e79c2.1: type = fn_type @DestroyOp.loc8_27 [concrete] +// CHECK:STDOUT: %DestroyOp.type.3e79c2.1: type = fn_type @DestroyOp.loc8_34 [concrete] // CHECK:STDOUT: %DestroyOp.b0ebf8.1: %DestroyOp.type.3e79c2.1 = struct_value () [concrete] // CHECK:STDOUT: %DestroyOp.type.3e79c2.2: type = fn_type @DestroyOp.loc8_3 [concrete] // CHECK:STDOUT: %DestroyOp.b0ebf8.2: %DestroyOp.type.3e79c2.2 = struct_value () [concrete] @@ -320,31 +320,31 @@ var a: array(1, 1); // CHECK:STDOUT: %t.var: ref %array_type = var %t.var_patt // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] // CHECK:STDOUT: %F.call: init %tuple.type = call %F.ref() -// CHECK:STDOUT: %.loc8_27.1: ref %tuple.type = temporary_storage -// CHECK:STDOUT: %.loc8_27.2: ref %tuple.type = temporary %.loc8_27.1, %F.call -// CHECK:STDOUT: %tuple.elem0: ref %empty_tuple.type = tuple_access %.loc8_27.2, element0 +// CHECK:STDOUT: %.loc8_34.1: ref %tuple.type = temporary_storage +// CHECK:STDOUT: %.loc8_34.2: ref %tuple.type = temporary %.loc8_34.1, %F.call +// CHECK:STDOUT: %tuple.elem0: ref %empty_tuple.type = tuple_access %.loc8_34.2, element0 // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc8_27.3: ref %empty_tuple.type = array_index %t.var, %int_0 -// CHECK:STDOUT: %.loc8_27.4: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_27.5: init %empty_tuple.type = converted %tuple.elem0, %.loc8_27.4 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_27.6: init %array_type to %t.var = array_init (%.loc8_27.5) [concrete = constants.%array] -// CHECK:STDOUT: %.loc8_3: init %array_type = converted %F.call, %.loc8_27.6 [concrete = constants.%array] +// CHECK:STDOUT: %.loc8_34.3: ref %empty_tuple.type = array_index %t.var, %int_0 +// CHECK:STDOUT: %.loc8_34.4: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_34.5: init %empty_tuple.type = converted %tuple.elem0, %.loc8_34.4 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_34.6: init %array_type to %t.var = array_init (%.loc8_34.5) [concrete = constants.%array] +// CHECK:STDOUT: %.loc8_3: init %array_type = converted %F.call, %.loc8_34.6 [concrete = constants.%array] // CHECK:STDOUT: assign %t.var, %.loc8_3 -// CHECK:STDOUT: %.loc8_21: type = splice_block %array_type [concrete = constants.%array_type] { -// CHECK:STDOUT: %.loc8_17.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_28: type = splice_block %array_type [concrete = constants.%array_type] { +// CHECK:STDOUT: %.loc8_24.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] -// CHECK:STDOUT: %.loc8_17.2: type = converted %.loc8_17.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %array_type: type = array_type %int_1, %.loc8_17.2 [concrete = constants.%array_type] +// CHECK:STDOUT: %.loc8_24.2: type = converted %.loc8_24.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %array_type: type = array_type %int_1, %.loc8_24.2 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %t: ref %array_type = ref_binding t, %t.var -// CHECK:STDOUT: %DestroyOp.bound.loc8_27: = bound_method %.loc8_27.2, constants.%DestroyOp.b0ebf8.1 -// CHECK:STDOUT: %DestroyOp.call.loc8_27: init %empty_tuple.type = call %DestroyOp.bound.loc8_27(%.loc8_27.2) +// CHECK:STDOUT: %DestroyOp.bound.loc8_34: = bound_method %.loc8_34.2, constants.%DestroyOp.b0ebf8.1 +// CHECK:STDOUT: %DestroyOp.call.loc8_34: init %empty_tuple.type = call %DestroyOp.bound.loc8_34(%.loc8_34.2) // CHECK:STDOUT: %DestroyOp.bound.loc8_3: = bound_method %t.var, constants.%DestroyOp.b0ebf8.2 // CHECK:STDOUT: %DestroyOp.call.loc8_3: init %empty_tuple.type = call %DestroyOp.bound.loc8_3(%t.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @DestroyOp.loc8_27(%self.param: ref %tuple.type) = "no_op"; +// CHECK:STDOUT: fn @DestroyOp.loc8_34(%self.param: ref %tuple.type) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: fn @DestroyOp.loc8_3(%self.param: ref %array_type) = "no_op"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/init_dependent_bound.carbon b/toolchain/check/testdata/array/init_dependent_bound.carbon index 3502288d84ab..52f175ef9bfe 100644 --- a/toolchain/check/testdata/array/init_dependent_bound.carbon +++ b/toolchain/check/testdata/array/init_dependent_bound.carbon @@ -17,7 +17,7 @@ library "[[@TEST_NAME]]"; fn G(T:! type) { // We can initialize this without knowing T. //@dump-sem-ir-begin - var arr: array(T, 0) = (); + var unused arr: array(T, 0) = (); //@dump-sem-ir-end } @@ -32,11 +32,11 @@ fn H() { library "[[@TEST_NAME]]"; fn F(N:! i32) { - // CHECK:STDERR: fail_init_dependent_bound.carbon:[[@LINE+4]]:28: error: cannot initialize array with dependent bound from a list of initializers [ArrayInitDependentBound] - // CHECK:STDERR: var arr: array(i32, N) = (1, 2, 3); - // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: fail_init_dependent_bound.carbon:[[@LINE+4]]:35: error: cannot initialize array with dependent bound from a list of initializers [ArrayInitDependentBound] + // CHECK:STDERR: var unused arr: array(i32, N) = (1, 2, 3); + // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: - var arr: array(i32, N) = (1, 2, 3); + var unused arr: array(i32, N) = (1, 2, 3); } // --- fail_todo_init_template_dependent_bound.carbon @@ -46,11 +46,11 @@ library "[[@TEST_NAME]]"; // TODO: This should be valid. fn G(template N:! i32) { //@dump-sem-ir-begin - // CHECK:STDERR: fail_todo_init_template_dependent_bound.carbon:[[@LINE+4]]:12: error: cannot evaluate type expression [TypeExprEvaluationFailure] - // CHECK:STDERR: var arr: array(i32, N) = (1, 2, 3); - // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_init_template_dependent_bound.carbon:[[@LINE+4]]:19: error: cannot evaluate type expression [TypeExprEvaluationFailure] + // CHECK:STDERR: var unused arr: array(i32, N) = (1, 2, 3); + // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: - var arr: array(i32, N) = (1, 2, 3); + var unused arr: array(i32, N) = (1, 2, 3); //@dump-sem-ir-end } @@ -94,12 +94,12 @@ fn H() { G(3); } // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %array_type.loc7_22.2: type = array_type constants.%int_0, %T.loc4_6.1 [symbolic = %array_type.loc7_22.2 (constants.%array_type.1b3)] -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc7_22.2 [symbolic = %require_complete (constants.%require_complete)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc7_22.2 [symbolic = %pattern_type (constants.%pattern_type.bd6)] -// CHECK:STDOUT: %array: @G.%array_type.loc7_22.2 (%array_type.1b3) = tuple_value () [symbolic = %array (constants.%array.ca4)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %array_type.loc7_22.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %array_type.loc7_22.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.15e)] +// CHECK:STDOUT: %array_type.loc7_29.2: type = array_type constants.%int_0, %T.loc4_6.1 [symbolic = %array_type.loc7_29.2 (constants.%array_type.1b3)] +// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc7_29.2 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc7_29.2 [symbolic = %pattern_type (constants.%pattern_type.bd6)] +// CHECK:STDOUT: %array: @G.%array_type.loc7_29.2 (%array_type.1b3) = tuple_value () [symbolic = %array (constants.%array.ca4)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %array_type.loc7_29.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %array_type.loc7_29.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.15e)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.427)] // CHECK:STDOUT: %.loc7_3.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc7_3.2 (constants.%.6d6)] // CHECK:STDOUT: %impl.elem0.loc7_3.2: @G.%.loc7_3.2 (%.6d6) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0)] @@ -111,17 +111,17 @@ fn H() { G(3); } // CHECK:STDOUT: %arr.patt: @G.%pattern_type (%pattern_type.bd6) = ref_binding_pattern arr [concrete] // CHECK:STDOUT: %arr.var_patt: @G.%pattern_type (%pattern_type.bd6) = var_pattern %arr.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref @G.%array_type.loc7_22.2 (%array_type.1b3) = var %arr.var_patt -// CHECK:STDOUT: %.loc7_27.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc7_27.2: init @G.%array_type.loc7_22.2 (%array_type.1b3) to %arr.var = array_init () [symbolic = %array (constants.%array.ca4)] -// CHECK:STDOUT: %.loc7_3.1: init @G.%array_type.loc7_22.2 (%array_type.1b3) = converted %.loc7_27.1, %.loc7_27.2 [symbolic = %array (constants.%array.ca4)] +// CHECK:STDOUT: %arr.var: ref @G.%array_type.loc7_29.2 (%array_type.1b3) = var %arr.var_patt +// CHECK:STDOUT: %.loc7_34.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_34.2: init @G.%array_type.loc7_29.2 (%array_type.1b3) to %arr.var = array_init () [symbolic = %array (constants.%array.ca4)] +// CHECK:STDOUT: %.loc7_3.1: init @G.%array_type.loc7_29.2 (%array_type.1b3) = converted %.loc7_34.1, %.loc7_34.2 [symbolic = %array (constants.%array.ca4)] // CHECK:STDOUT: assign %arr.var, %.loc7_3.1 -// CHECK:STDOUT: %.loc7_22: type = splice_block %array_type.loc7_22.1 [symbolic = %array_type.loc7_22.2 (constants.%array_type.1b3)] { +// CHECK:STDOUT: %.loc7_29: type = splice_block %array_type.loc7_29.1 [symbolic = %array_type.loc7_29.2 (constants.%array_type.1b3)] { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %array_type.loc7_22.1: type = array_type %int_0, %T.ref [symbolic = %array_type.loc7_22.2 (constants.%array_type.1b3)] +// CHECK:STDOUT: %array_type.loc7_29.1: type = array_type %int_0, %T.ref [symbolic = %array_type.loc7_29.2 (constants.%array_type.1b3)] // CHECK:STDOUT: } -// CHECK:STDOUT: %arr: ref @G.%array_type.loc7_22.2 (%array_type.1b3) = ref_binding arr, %arr.var +// CHECK:STDOUT: %arr: ref @G.%array_type.loc7_29.2 (%array_type.1b3) = ref_binding arr, %arr.var // CHECK:STDOUT: %impl.elem0.loc7_3.1: @G.%.loc7_3.2 (%.6d6) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %arr.var, %impl.elem0.loc7_3.1 // CHECK:STDOUT: %specific_impl_fn.loc7_3.1: = specific_impl_function %impl.elem0.loc7_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.15e) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn)] @@ -141,7 +141,7 @@ fn H() { G(3); } // CHECK:STDOUT: %T.loc4_6.1 => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %array_type.loc7_22.2 => constants.%array_type.70a +// CHECK:STDOUT: %array_type.loc7_29.2 => constants.%array_type.70a // CHECK:STDOUT: %require_complete => constants.%complete_type.95b // CHECK:STDOUT: %pattern_type => constants.%pattern_type.f2c // CHECK:STDOUT: %array => constants.%array.40f @@ -200,7 +200,7 @@ fn H() { G(3); } // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc11_23.2: = convert_to_value_action %N.ref, Core.IntLiteral [template] +// CHECK:STDOUT: %.loc11_30.2: = convert_to_value_action %N.ref, Core.IntLiteral [template] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -212,7 +212,7 @@ fn H() { G(3); } // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] -// CHECK:STDOUT: %.loc11_36: %tuple.type = tuple_literal (%int_1, %int_2, %int_3) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc11_43: %tuple.type = tuple_literal (%int_1, %int_2, %int_3) [concrete = constants.%tuple] // CHECK:STDOUT: assign %arr.var, // CHECK:STDOUT: // CHECK:STDOUT: %arr: ref = ref_binding arr, [concrete = ] @@ -228,6 +228,6 @@ fn H() { G(3); } // CHECK:STDOUT: %N.loc5_15.1 => constants.%int_3.822 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc11_23.2 => constants.%inst.splice_block +// CHECK:STDOUT: %.loc11_30.2 => constants.%inst.splice_block // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index 41104f629677..94a7f12221a4 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -123,7 +123,7 @@ class A { fn F(a: A) { //@dump-sem-ir-begin - let a_value: A = (a as ({}, Noncopyable)) as A; + let unused a_value: A = (a as ({}, Noncopyable)) as A; //@dump-sem-ir-end } @@ -146,16 +146,16 @@ fn F(a: A) { // behavior. // CHECK:STDERR: fail_init_tuple_variable.carbon:[[@LINE+10]]:3: error: cannot copy value of type `Noncopyable` [CopyOfUncopyableType] - // CHECK:STDERR: var a_init: A = (a as ({}, Noncopyable)) as A; - // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: var unused a_init: A = (a as ({}, Noncopyable)) as A; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_init_tuple_variable.carbon:[[@LINE+7]]:3: note: type `Noncopyable` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] - // CHECK:STDERR: var a_init: A = (a as ({}, Noncopyable)) as A; - // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_init_tuple_variable.carbon:[[@LINE+4]]:19: note: in copy of `A` [InCopy] - // CHECK:STDERR: var a_init: A = (a as ({}, Noncopyable)) as A; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: var unused a_init: A = (a as ({}, Noncopyable)) as A; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_init_tuple_variable.carbon:[[@LINE+4]]:26: note: in copy of `A` [InCopy] + // CHECK:STDERR: var unused a_init: A = (a as ({}, Noncopyable)) as A; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var a_init: A = (a as ({}, Noncopyable)) as A; + var unused a_init: A = (a as ({}, Noncopyable)) as A; } // --- fail_adapt_init_from_struct.carbon @@ -446,18 +446,18 @@ var b: B = {.x = ()} as B; // CHECK:STDOUT: %a_value.patt: %pattern_type = value_binding_pattern a_value [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.ref: %A = name_ref a, %a -// CHECK:STDOUT: %.loc14_28: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc14_35: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %Noncopyable.ref: type = name_ref Noncopyable, file.%Noncopyable.decl [concrete = constants.%Noncopyable] -// CHECK:STDOUT: %.loc14_42.1: %tuple.type.c8c = tuple_literal (%.loc14_28, %Noncopyable.ref) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc14_42.2: type = converted constants.%empty_struct, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc14_42.3: type = converted %.loc14_42.1, constants.%tuple.type.037 [concrete = constants.%tuple.type.037] -// CHECK:STDOUT: %.loc14_23.1: %tuple.type.037 = as_compatible %a.ref -// CHECK:STDOUT: %.loc14_23.2: %tuple.type.037 = converted %a.ref, %.loc14_23.1 -// CHECK:STDOUT: %A.ref.loc14_48: type = name_ref A, file.%A.decl [concrete = constants.%A] -// CHECK:STDOUT: %.loc14_45.1: %A = as_compatible %.loc14_23.2 -// CHECK:STDOUT: %.loc14_45.2: %A = converted %.loc14_23.2, %.loc14_45.1 -// CHECK:STDOUT: %A.ref.loc14_16: type = name_ref A, file.%A.decl [concrete = constants.%A] -// CHECK:STDOUT: %a_value: %A = value_binding a_value, %.loc14_45.2 +// CHECK:STDOUT: %.loc14_49.1: %tuple.type.c8c = tuple_literal (%.loc14_35, %Noncopyable.ref) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc14_49.2: type = converted constants.%empty_struct, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc14_49.3: type = converted %.loc14_49.1, constants.%tuple.type.037 [concrete = constants.%tuple.type.037] +// CHECK:STDOUT: %.loc14_30.1: %tuple.type.037 = as_compatible %a.ref +// CHECK:STDOUT: %.loc14_30.2: %tuple.type.037 = converted %a.ref, %.loc14_30.1 +// CHECK:STDOUT: %A.ref.loc14_55: type = name_ref A, file.%A.decl [concrete = constants.%A] +// CHECK:STDOUT: %.loc14_52.1: %A = as_compatible %.loc14_30.2 +// CHECK:STDOUT: %.loc14_52.2: %A = converted %.loc14_30.2, %.loc14_52.1 +// CHECK:STDOUT: %A.ref.loc14_23: type = name_ref A, file.%A.decl [concrete = constants.%A] +// CHECK:STDOUT: %a_value: %A = value_binding a_value, %.loc14_52.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/basics.carbon b/toolchain/check/testdata/as/basics.carbon index afe4511d079f..de67852b75a2 100644 --- a/toolchain/check/testdata/as/basics.carbon +++ b/toolchain/check/testdata/as/basics.carbon @@ -41,14 +41,14 @@ fn Make() -> X; fn Let() { // This should create value bindings for both tuple elements. //@dump-sem-ir-begin - let a: (X, X) = (Make(), Make()) as (X, X); + let unused a: (X, X) = (Make(), Make()) as (X, X); //@dump-sem-ir-end } fn Var() { // This should initialize both tuple elements in place. //@dump-sem-ir-begin - var b: (X, X) = (Make(), Make()) as (X, X); + var unused b: (X, X) = (Make(), Make()) as (X, X); //@dump-sem-ir-end } @@ -62,13 +62,13 @@ class X { fn Value(n: X) { //@dump-sem-ir-begin - let m: X = n as X; + let unused m: X = n as X; //@dump-sem-ir-end } fn Reference(p: X*) { //@dump-sem-ir-begin - let q: X* = &(*p as X); + let unused q: X* = &(*p as X); //@dump-sem-ir-end } @@ -76,7 +76,7 @@ fn Make() -> X; fn Initializing() { //@dump-sem-ir-begin - var x: X = (Make() as X); + var unused x: X = (Make() as X); //@dump-sem-ir-end } @@ -227,34 +227,34 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.e9d = value_binding_pattern a [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Make.ref.loc13_20: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc13_25.1: ref %X = temporary_storage -// CHECK:STDOUT: %Make.call.loc13_25: init %X to %.loc13_25.1 = call %Make.ref.loc13_20() -// CHECK:STDOUT: %Make.ref.loc13_28: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc13_33.1: ref %X = temporary_storage -// CHECK:STDOUT: %Make.call.loc13_33: init %X to %.loc13_33.1 = call %Make.ref.loc13_28() -// CHECK:STDOUT: %.loc13_34.1: %tuple.type.2de = tuple_literal (%Make.call.loc13_25, %Make.call.loc13_33) -// CHECK:STDOUT: %X.ref.loc13_40: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %X.ref.loc13_43: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc13_44.1: %tuple.type.24b = tuple_literal (%X.ref.loc13_40, %X.ref.loc13_43) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc13_44.2: type = converted %.loc13_44.1, constants.%tuple.type.2de [concrete = constants.%tuple.type.2de] -// CHECK:STDOUT: %.loc13_15.1: type = splice_block %.loc13_15.3 [concrete = constants.%tuple.type.2de] { -// CHECK:STDOUT: %X.ref.loc13_11: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %X.ref.loc13_14: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc13_15.2: %tuple.type.24b = tuple_literal (%X.ref.loc13_11, %X.ref.loc13_14) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc13_15.3: type = converted %.loc13_15.2, constants.%tuple.type.2de [concrete = constants.%tuple.type.2de] +// CHECK:STDOUT: %Make.ref.loc13_27: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] +// CHECK:STDOUT: %.loc13_32.1: ref %X = temporary_storage +// CHECK:STDOUT: %Make.call.loc13_32: init %X to %.loc13_32.1 = call %Make.ref.loc13_27() +// CHECK:STDOUT: %Make.ref.loc13_35: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] +// CHECK:STDOUT: %.loc13_40.1: ref %X = temporary_storage +// CHECK:STDOUT: %Make.call.loc13_40: init %X to %.loc13_40.1 = call %Make.ref.loc13_35() +// CHECK:STDOUT: %.loc13_41.1: %tuple.type.2de = tuple_literal (%Make.call.loc13_32, %Make.call.loc13_40) +// CHECK:STDOUT: %X.ref.loc13_47: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %X.ref.loc13_50: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc13_51.1: %tuple.type.24b = tuple_literal (%X.ref.loc13_47, %X.ref.loc13_50) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc13_51.2: type = converted %.loc13_51.1, constants.%tuple.type.2de [concrete = constants.%tuple.type.2de] +// CHECK:STDOUT: %.loc13_22.1: type = splice_block %.loc13_22.3 [concrete = constants.%tuple.type.2de] { +// CHECK:STDOUT: %X.ref.loc13_18: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %X.ref.loc13_21: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc13_22.2: %tuple.type.24b = tuple_literal (%X.ref.loc13_18, %X.ref.loc13_21) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc13_22.3: type = converted %.loc13_22.2, constants.%tuple.type.2de [concrete = constants.%tuple.type.2de] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13_25.2: ref %X = temporary %.loc13_25.1, %Make.call.loc13_25 -// CHECK:STDOUT: %.loc13_25.3: %X = acquire_value %.loc13_25.2 -// CHECK:STDOUT: %.loc13_33.2: ref %X = temporary %.loc13_33.1, %Make.call.loc13_33 -// CHECK:STDOUT: %.loc13_33.3: %X = acquire_value %.loc13_33.2 -// CHECK:STDOUT: %tuple: %tuple.type.2de = tuple_value (%.loc13_25.3, %.loc13_33.3) -// CHECK:STDOUT: %.loc13_34.2: %tuple.type.2de = converted %.loc13_34.1, %tuple -// CHECK:STDOUT: %a: %tuple.type.2de = value_binding a, %.loc13_34.2 -// CHECK:STDOUT: %DestroyOp.bound.loc13_33: = bound_method %.loc13_33.2, constants.%DestroyOp.b0ebf8.1 -// CHECK:STDOUT: %DestroyOp.call.loc13_33: init %empty_tuple.type = call %DestroyOp.bound.loc13_33(%.loc13_33.2) -// CHECK:STDOUT: %DestroyOp.bound.loc13_25: = bound_method %.loc13_25.2, constants.%DestroyOp.b0ebf8.1 -// CHECK:STDOUT: %DestroyOp.call.loc13_25: init %empty_tuple.type = call %DestroyOp.bound.loc13_25(%.loc13_25.2) +// CHECK:STDOUT: %.loc13_32.2: ref %X = temporary %.loc13_32.1, %Make.call.loc13_32 +// CHECK:STDOUT: %.loc13_32.3: %X = acquire_value %.loc13_32.2 +// CHECK:STDOUT: %.loc13_40.2: ref %X = temporary %.loc13_40.1, %Make.call.loc13_40 +// CHECK:STDOUT: %.loc13_40.3: %X = acquire_value %.loc13_40.2 +// CHECK:STDOUT: %tuple: %tuple.type.2de = tuple_value (%.loc13_32.3, %.loc13_40.3) +// CHECK:STDOUT: %.loc13_41.2: %tuple.type.2de = converted %.loc13_41.1, %tuple +// CHECK:STDOUT: %a: %tuple.type.2de = value_binding a, %.loc13_41.2 +// CHECK:STDOUT: %DestroyOp.bound.loc13_40: = bound_method %.loc13_40.2, constants.%DestroyOp.b0ebf8.1 +// CHECK:STDOUT: %DestroyOp.call.loc13_40: init %empty_tuple.type = call %DestroyOp.bound.loc13_40(%.loc13_40.2) +// CHECK:STDOUT: %DestroyOp.bound.loc13_32: = bound_method %.loc13_32.2, constants.%DestroyOp.b0ebf8.1 +// CHECK:STDOUT: %DestroyOp.call.loc13_32: init %empty_tuple.type = call %DestroyOp.bound.loc13_32(%.loc13_32.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -267,25 +267,25 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: %b.var_patt: %pattern_type.e9d = var_pattern %b.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref %tuple.type.2de = var %b.var_patt -// CHECK:STDOUT: %Make.ref.loc20_20: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] +// CHECK:STDOUT: %Make.ref.loc20_27: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] // CHECK:STDOUT: %tuple.elem0: ref %X = tuple_access %b.var, element0 -// CHECK:STDOUT: %Make.call.loc20_25: init %X to %tuple.elem0 = call %Make.ref.loc20_20() -// CHECK:STDOUT: %Make.ref.loc20_28: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] +// CHECK:STDOUT: %Make.call.loc20_32: init %X to %tuple.elem0 = call %Make.ref.loc20_27() +// CHECK:STDOUT: %Make.ref.loc20_35: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] // CHECK:STDOUT: %tuple.elem1: ref %X = tuple_access %b.var, element1 -// CHECK:STDOUT: %Make.call.loc20_33: init %X to %tuple.elem1 = call %Make.ref.loc20_28() -// CHECK:STDOUT: %.loc20_34.1: %tuple.type.2de = tuple_literal (%Make.call.loc20_25, %Make.call.loc20_33) -// CHECK:STDOUT: %X.ref.loc20_40: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %X.ref.loc20_43: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc20_44.1: %tuple.type.24b = tuple_literal (%X.ref.loc20_40, %X.ref.loc20_43) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc20_44.2: type = converted %.loc20_44.1, constants.%tuple.type.2de [concrete = constants.%tuple.type.2de] -// CHECK:STDOUT: %.loc20_34.2: init %tuple.type.2de to %b.var = tuple_init (%Make.call.loc20_25, %Make.call.loc20_33) -// CHECK:STDOUT: %.loc20_3: init %tuple.type.2de = converted %.loc20_34.1, %.loc20_34.2 +// CHECK:STDOUT: %Make.call.loc20_40: init %X to %tuple.elem1 = call %Make.ref.loc20_35() +// CHECK:STDOUT: %.loc20_41.1: %tuple.type.2de = tuple_literal (%Make.call.loc20_32, %Make.call.loc20_40) +// CHECK:STDOUT: %X.ref.loc20_47: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %X.ref.loc20_50: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc20_51.1: %tuple.type.24b = tuple_literal (%X.ref.loc20_47, %X.ref.loc20_50) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc20_51.2: type = converted %.loc20_51.1, constants.%tuple.type.2de [concrete = constants.%tuple.type.2de] +// CHECK:STDOUT: %.loc20_41.2: init %tuple.type.2de to %b.var = tuple_init (%Make.call.loc20_32, %Make.call.loc20_40) +// CHECK:STDOUT: %.loc20_3: init %tuple.type.2de = converted %.loc20_41.1, %.loc20_41.2 // CHECK:STDOUT: assign %b.var, %.loc20_3 -// CHECK:STDOUT: %.loc20_15.1: type = splice_block %.loc20_15.3 [concrete = constants.%tuple.type.2de] { -// CHECK:STDOUT: %X.ref.loc20_11: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %X.ref.loc20_14: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc20_15.2: %tuple.type.24b = tuple_literal (%X.ref.loc20_11, %X.ref.loc20_14) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc20_15.3: type = converted %.loc20_15.2, constants.%tuple.type.2de [concrete = constants.%tuple.type.2de] +// CHECK:STDOUT: %.loc20_22.1: type = splice_block %.loc20_22.3 [concrete = constants.%tuple.type.2de] { +// CHECK:STDOUT: %X.ref.loc20_18: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %X.ref.loc20_21: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc20_22.2: %tuple.type.24b = tuple_literal (%X.ref.loc20_18, %X.ref.loc20_21) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc20_22.3: type = converted %.loc20_22.2, constants.%tuple.type.2de [concrete = constants.%tuple.type.2de] // CHECK:STDOUT: } // CHECK:STDOUT: %b: ref %tuple.type.2de = ref_binding b, %b.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %b.var, constants.%DestroyOp.b0ebf8.2 @@ -318,8 +318,8 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: %m.patt: %pattern_type.05f = value_binding_pattern m [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %n.ref: %X = name_ref n, %n -// CHECK:STDOUT: %X.ref.loc10_19: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %X.ref.loc10_10: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %X.ref.loc10_26: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %X.ref.loc10_17: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %m: %X = value_binding m, %n.ref // CHECK:STDOUT: // CHECK:STDOUT: } @@ -330,12 +330,12 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: %q.patt: %pattern_type.37f = value_binding_pattern q [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %p.ref: %ptr.2a9 = name_ref p, %p -// CHECK:STDOUT: %.loc16_17: ref %X = deref %p.ref -// CHECK:STDOUT: %X.ref.loc16_23: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %addr: %ptr.2a9 = addr_of %.loc16_17 -// CHECK:STDOUT: %.loc16_11: type = splice_block %ptr.loc16 [concrete = constants.%ptr.2a9] { -// CHECK:STDOUT: %X.ref.loc16_10: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %ptr.loc16: type = ptr_type %X.ref.loc16_10 [concrete = constants.%ptr.2a9] +// CHECK:STDOUT: %.loc16_24: ref %X = deref %p.ref +// CHECK:STDOUT: %X.ref.loc16_30: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %addr: %ptr.2a9 = addr_of %.loc16_24 +// CHECK:STDOUT: %.loc16_18: type = splice_block %ptr.loc16 [concrete = constants.%ptr.2a9] { +// CHECK:STDOUT: %X.ref.loc16_17: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %ptr.loc16: type = ptr_type %X.ref.loc16_17 [concrete = constants.%ptr.2a9] // CHECK:STDOUT: } // CHECK:STDOUT: %q: %ptr.2a9 = value_binding q, %addr // CHECK:STDOUT: @@ -351,9 +351,9 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] // CHECK:STDOUT: %.loc24: ref %X = splice_block %x.var {} // CHECK:STDOUT: %Make.call: init %X to %.loc24 = call %Make.ref() -// CHECK:STDOUT: %X.ref.loc24_25: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %X.ref.loc24_32: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: assign %x.var, %Make.call -// CHECK:STDOUT: %X.ref.loc24_10: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %X.ref.loc24_17: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %x: ref %X = ref_binding x, %x.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %x.var, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%x.var) diff --git a/toolchain/check/testdata/as/const.carbon b/toolchain/check/testdata/as/const.carbon index 703aaf3cfef1..f58abcecdeac 100644 --- a/toolchain/check/testdata/as/const.carbon +++ b/toolchain/check/testdata/as/const.carbon @@ -24,10 +24,10 @@ let ptr: X* = &reference; fn Use() { // TODO: Should some of these be valid without the `as`? //@dump-sem-ir-begin - var i: const X = Init() as const X; - let v: const X = value as const X; - let a: const X* = &(reference as const X); - let b: const X* = ptr as const X*; + var unused i: const X = Init() as const X; + let unused v: const X = value as const X; + let unused a: const X* = &(reference as const X); + let unused b: const X* = ptr as const X*; //@dump-sem-ir-end } @@ -43,8 +43,8 @@ let value: const X = Init(); fn Use() { // TODO: Should some of these be valid without the `as`? //@dump-sem-ir-begin - var i: X = Init() as X; - let v: X = value as X; + var unused i: X = Init() as X; + let unused v: X = value as X; //@dump-sem-ir-end } @@ -58,22 +58,22 @@ var reference: const X; let ptr: const X* = &reference; fn Use() { - // CHECK:STDERR: fail_cannot_remove_const.carbon:[[@LINE+7]]:17: error: cannot convert expression of type `const X` to `X` with `as` [ConversionFailure] - // CHECK:STDERR: let a: X* = &(reference as X); - // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_cannot_remove_const.carbon:[[@LINE+4]]:17: note: type `const X` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let a: X* = &(reference as X); - // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: fail_cannot_remove_const.carbon:[[@LINE+7]]:24: error: cannot convert expression of type `const X` to `X` with `as` [ConversionFailure] + // CHECK:STDERR: let unused a: X* = &(reference as X); + // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: fail_cannot_remove_const.carbon:[[@LINE+4]]:24: note: type `const X` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused a: X* = &(reference as X); + // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: - let a: X* = &(reference as X); - // CHECK:STDERR: fail_cannot_remove_const.carbon:[[@LINE+7]]:15: error: cannot convert expression of type `const X*` to `X*` with `as` [ConversionFailure] - // CHECK:STDERR: let b: X* = ptr as X*; - // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_cannot_remove_const.carbon:[[@LINE+4]]:15: note: type `const X*` does not implement interface `Core.As(X*)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let b: X* = ptr as X*; - // CHECK:STDERR: ^~~~~~~~~ + let unused a: X* = &(reference as X); + // CHECK:STDERR: fail_cannot_remove_const.carbon:[[@LINE+7]]:22: error: cannot convert expression of type `const X*` to `X*` with `as` [ConversionFailure] + // CHECK:STDERR: let unused b: X* = ptr as X*; + // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: fail_cannot_remove_const.carbon:[[@LINE+4]]:22: note: type `const X*` does not implement interface `Core.As(X*)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused b: X* = ptr as X*; + // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: - let b: X* = ptr as X*; + let unused b: X* = ptr as X*; } // --- unsafe_remove_const.carbon @@ -87,8 +87,8 @@ let ptr: const X* = &reference; fn Use() { //@dump-sem-ir-begin - let a: X* = &(reference unsafe as X); - let b: X* = ptr unsafe as X*; + let unused a: X* = &(reference unsafe as X); + let unused b: X* = ptr unsafe as X*; //@dump-sem-ir-end } @@ -123,59 +123,59 @@ fn Use() { // CHECK:STDOUT: %Init.ref: %Init.type = name_ref Init, file.%Init.decl [concrete = constants.%Init] // CHECK:STDOUT: %.loc14_3: ref %const = splice_block %i.var {} // CHECK:STDOUT: %Init.call: init %X to %.loc14_3 = call %Init.ref() -// CHECK:STDOUT: %X.ref.loc14_36: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %const.loc14_30: type = const_type %X.ref.loc14_36 [concrete = constants.%const] -// CHECK:STDOUT: %.loc14_27.1: init %const = as_compatible %Init.call -// CHECK:STDOUT: %.loc14_27.2: init %const = converted %Init.call, %.loc14_27.1 -// CHECK:STDOUT: assign %i.var, %.loc14_27.2 -// CHECK:STDOUT: %.loc14_10: type = splice_block %const.loc14_10 [concrete = constants.%const] { -// CHECK:STDOUT: %X.ref.loc14_16: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %const.loc14_10: type = const_type %X.ref.loc14_16 [concrete = constants.%const] +// CHECK:STDOUT: %X.ref.loc14_43: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %const.loc14_37: type = const_type %X.ref.loc14_43 [concrete = constants.%const] +// CHECK:STDOUT: %.loc14_34.1: init %const = as_compatible %Init.call +// CHECK:STDOUT: %.loc14_34.2: init %const = converted %Init.call, %.loc14_34.1 +// CHECK:STDOUT: assign %i.var, %.loc14_34.2 +// CHECK:STDOUT: %.loc14_17: type = splice_block %const.loc14_17 [concrete = constants.%const] { +// CHECK:STDOUT: %X.ref.loc14_23: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %const.loc14_17: type = const_type %X.ref.loc14_23 [concrete = constants.%const] // CHECK:STDOUT: } // CHECK:STDOUT: %i: ref %const = ref_binding i, %i.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %v.patt: %pattern_type.c9e = value_binding_pattern v [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %value.ref: %X = name_ref value, file.%value -// CHECK:STDOUT: %X.ref.loc15_35: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %const.loc15_29: type = const_type %X.ref.loc15_35 [concrete = constants.%const] -// CHECK:STDOUT: %.loc15_26.1: %const = as_compatible %value.ref -// CHECK:STDOUT: %.loc15_26.2: %const = converted %value.ref, %.loc15_26.1 -// CHECK:STDOUT: %.loc15_10: type = splice_block %const.loc15_10 [concrete = constants.%const] { -// CHECK:STDOUT: %X.ref.loc15_16: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %const.loc15_10: type = const_type %X.ref.loc15_16 [concrete = constants.%const] +// CHECK:STDOUT: %X.ref.loc15_42: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %const.loc15_36: type = const_type %X.ref.loc15_42 [concrete = constants.%const] +// CHECK:STDOUT: %.loc15_33.1: %const = as_compatible %value.ref +// CHECK:STDOUT: %.loc15_33.2: %const = converted %value.ref, %.loc15_33.1 +// CHECK:STDOUT: %.loc15_17: type = splice_block %const.loc15_17 [concrete = constants.%const] { +// CHECK:STDOUT: %X.ref.loc15_23: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %const.loc15_17: type = const_type %X.ref.loc15_23 [concrete = constants.%const] // CHECK:STDOUT: } -// CHECK:STDOUT: %v: %const = value_binding v, %.loc15_26.2 +// CHECK:STDOUT: %v: %const = value_binding v, %.loc15_33.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.bf1 = value_binding_pattern a [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %reference.ref: ref %X = name_ref reference, file.%reference [concrete = file.%reference.var] -// CHECK:STDOUT: %X.ref.loc16_42: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %const.loc16_36: type = const_type %X.ref.loc16_42 [concrete = constants.%const] -// CHECK:STDOUT: %.loc16_33.1: ref %const = as_compatible %reference.ref [concrete = constants.%reference.var] -// CHECK:STDOUT: %.loc16_33.2: ref %const = converted %reference.ref, %.loc16_33.1 [concrete = constants.%reference.var] -// CHECK:STDOUT: %addr: %ptr.d4c = addr_of %.loc16_33.2 [concrete = constants.%addr.160] -// CHECK:STDOUT: %.loc16_17: type = splice_block %ptr.loc16 [concrete = constants.%ptr.d4c] { -// CHECK:STDOUT: %X.ref.loc16_16: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %const.loc16_10: type = const_type %X.ref.loc16_16 [concrete = constants.%const] -// CHECK:STDOUT: %ptr.loc16: type = ptr_type %const.loc16_10 [concrete = constants.%ptr.d4c] +// CHECK:STDOUT: %X.ref.loc16_49: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %const.loc16_43: type = const_type %X.ref.loc16_49 [concrete = constants.%const] +// CHECK:STDOUT: %.loc16_40.1: ref %const = as_compatible %reference.ref [concrete = constants.%reference.var] +// CHECK:STDOUT: %.loc16_40.2: ref %const = converted %reference.ref, %.loc16_40.1 [concrete = constants.%reference.var] +// CHECK:STDOUT: %addr: %ptr.d4c = addr_of %.loc16_40.2 [concrete = constants.%addr.160] +// CHECK:STDOUT: %.loc16_24: type = splice_block %ptr.loc16 [concrete = constants.%ptr.d4c] { +// CHECK:STDOUT: %X.ref.loc16_23: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %const.loc16_17: type = const_type %X.ref.loc16_23 [concrete = constants.%const] +// CHECK:STDOUT: %ptr.loc16: type = ptr_type %const.loc16_17 [concrete = constants.%ptr.d4c] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.d4c = value_binding a, %addr // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.bf1 = value_binding_pattern b [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %ptr.ref: %ptr.2a9 = name_ref ptr, file.%ptr.loc9_5 -// CHECK:STDOUT: %X.ref.loc17_34: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %const.loc17_28: type = const_type %X.ref.loc17_34 [concrete = constants.%const] -// CHECK:STDOUT: %ptr.loc17_35: type = ptr_type %const.loc17_28 [concrete = constants.%ptr.d4c] -// CHECK:STDOUT: %.loc17_25.1: %ptr.d4c = as_compatible %ptr.ref -// CHECK:STDOUT: %.loc17_25.2: %ptr.d4c = converted %ptr.ref, %.loc17_25.1 -// CHECK:STDOUT: %.loc17_17: type = splice_block %ptr.loc17_17 [concrete = constants.%ptr.d4c] { -// CHECK:STDOUT: %X.ref.loc17_16: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %const.loc17_10: type = const_type %X.ref.loc17_16 [concrete = constants.%const] -// CHECK:STDOUT: %ptr.loc17_17: type = ptr_type %const.loc17_10 [concrete = constants.%ptr.d4c] +// CHECK:STDOUT: %X.ref.loc17_41: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %const.loc17_35: type = const_type %X.ref.loc17_41 [concrete = constants.%const] +// CHECK:STDOUT: %ptr.loc17_42: type = ptr_type %const.loc17_35 [concrete = constants.%ptr.d4c] +// CHECK:STDOUT: %.loc17_32.1: %ptr.d4c = as_compatible %ptr.ref +// CHECK:STDOUT: %.loc17_32.2: %ptr.d4c = converted %ptr.ref, %.loc17_32.1 +// CHECK:STDOUT: %.loc17_24: type = splice_block %ptr.loc17_24 [concrete = constants.%ptr.d4c] { +// CHECK:STDOUT: %X.ref.loc17_23: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %const.loc17_17: type = const_type %X.ref.loc17_23 [concrete = constants.%const] +// CHECK:STDOUT: %ptr.loc17_24: type = ptr_type %const.loc17_17 [concrete = constants.%ptr.d4c] // CHECK:STDOUT: } -// CHECK:STDOUT: %b: %ptr.d4c = value_binding b, %.loc17_25.2 +// CHECK:STDOUT: %b: %ptr.d4c = value_binding b, %.loc17_32.2 // CHECK:STDOUT: %DestroyOp.bound: = bound_method %i.var, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%i.var) // CHECK:STDOUT: @@ -214,21 +214,21 @@ fn Use() { // CHECK:STDOUT: %Init.ref: %Init.type = name_ref Init, file.%Init.decl [concrete = constants.%Init] // CHECK:STDOUT: %.loc12_3: ref %X = splice_block %i.var {} // CHECK:STDOUT: %Init.call: init %const to %.loc12_3 = call %Init.ref() -// CHECK:STDOUT: %X.ref.loc12_24: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc12_21.1: init %X = as_compatible %Init.call -// CHECK:STDOUT: %.loc12_21.2: init %X = converted %Init.call, %.loc12_21.1 -// CHECK:STDOUT: assign %i.var, %.loc12_21.2 -// CHECK:STDOUT: %X.ref.loc12_10: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %X.ref.loc12_31: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc12_28.1: init %X = as_compatible %Init.call +// CHECK:STDOUT: %.loc12_28.2: init %X = converted %Init.call, %.loc12_28.1 +// CHECK:STDOUT: assign %i.var, %.loc12_28.2 +// CHECK:STDOUT: %X.ref.loc12_17: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %i: ref %X = ref_binding i, %i.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %v.patt: %pattern_type.05f = value_binding_pattern v [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %value.ref: %const = name_ref value, file.%value -// CHECK:STDOUT: %X.ref.loc13_23: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc13_20.1: %X = as_compatible %value.ref -// CHECK:STDOUT: %.loc13_20.2: %X = converted %value.ref, %.loc13_20.1 -// CHECK:STDOUT: %X.ref.loc13_10: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %v: %X = value_binding v, %.loc13_20.2 +// CHECK:STDOUT: %X.ref.loc13_30: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc13_27.1: %X = as_compatible %value.ref +// CHECK:STDOUT: %.loc13_27.2: %X = converted %value.ref, %.loc13_27.1 +// CHECK:STDOUT: %X.ref.loc13_17: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %v: %X = value_binding v, %.loc13_27.2 // CHECK:STDOUT: %DestroyOp.bound: = bound_method %i.var, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%i.var) // CHECK:STDOUT: @@ -262,28 +262,28 @@ fn Use() { // CHECK:STDOUT: %a.patt: %pattern_type.37f = value_binding_pattern a [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %reference.ref: ref %const = name_ref reference, file.%reference [concrete = file.%reference.var] -// CHECK:STDOUT: %X.ref.loc11_37: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc11_34.1: ref %X = as_compatible %reference.ref [concrete = constants.%reference.var] -// CHECK:STDOUT: %.loc11_34.2: ref %X = converted %reference.ref, %.loc11_34.1 [concrete = constants.%reference.var] -// CHECK:STDOUT: %addr: %ptr.2a9 = addr_of %.loc11_34.2 [concrete = constants.%addr.806] -// CHECK:STDOUT: %.loc11_11: type = splice_block %ptr.loc11 [concrete = constants.%ptr.2a9] { -// CHECK:STDOUT: %X.ref.loc11_10: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %ptr.loc11: type = ptr_type %X.ref.loc11_10 [concrete = constants.%ptr.2a9] +// CHECK:STDOUT: %X.ref.loc11_44: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc11_41.1: ref %X = as_compatible %reference.ref [concrete = constants.%reference.var] +// CHECK:STDOUT: %.loc11_41.2: ref %X = converted %reference.ref, %.loc11_41.1 [concrete = constants.%reference.var] +// CHECK:STDOUT: %addr: %ptr.2a9 = addr_of %.loc11_41.2 [concrete = constants.%addr.806] +// CHECK:STDOUT: %.loc11_18: type = splice_block %ptr.loc11 [concrete = constants.%ptr.2a9] { +// CHECK:STDOUT: %X.ref.loc11_17: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %ptr.loc11: type = ptr_type %X.ref.loc11_17 [concrete = constants.%ptr.2a9] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.2a9 = value_binding a, %addr // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.37f = value_binding_pattern b [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %ptr.ref: %ptr.d4c = name_ref ptr, file.%ptr.loc7_5 -// CHECK:STDOUT: %X.ref.loc12_29: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %ptr.loc12_30: type = ptr_type %X.ref.loc12_29 [concrete = constants.%ptr.2a9] -// CHECK:STDOUT: %.loc12_26.1: %ptr.2a9 = as_compatible %ptr.ref -// CHECK:STDOUT: %.loc12_26.2: %ptr.2a9 = converted %ptr.ref, %.loc12_26.1 -// CHECK:STDOUT: %.loc12_11: type = splice_block %ptr.loc12_11 [concrete = constants.%ptr.2a9] { -// CHECK:STDOUT: %X.ref.loc12_10: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %ptr.loc12_11: type = ptr_type %X.ref.loc12_10 [concrete = constants.%ptr.2a9] +// CHECK:STDOUT: %X.ref.loc12_36: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %ptr.loc12_37: type = ptr_type %X.ref.loc12_36 [concrete = constants.%ptr.2a9] +// CHECK:STDOUT: %.loc12_33.1: %ptr.2a9 = as_compatible %ptr.ref +// CHECK:STDOUT: %.loc12_33.2: %ptr.2a9 = converted %ptr.ref, %.loc12_33.1 +// CHECK:STDOUT: %.loc12_18: type = splice_block %ptr.loc12_18 [concrete = constants.%ptr.2a9] { +// CHECK:STDOUT: %X.ref.loc12_17: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %ptr.loc12_18: type = ptr_type %X.ref.loc12_17 [concrete = constants.%ptr.2a9] // CHECK:STDOUT: } -// CHECK:STDOUT: %b: %ptr.2a9 = value_binding b, %.loc12_26.2 +// CHECK:STDOUT: %b: %ptr.2a9 = value_binding b, %.loc12_33.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/maybe_unformed.carbon b/toolchain/check/testdata/as/maybe_unformed.carbon index 048988f13705..50adea806e6e 100644 --- a/toolchain/check/testdata/as/maybe_unformed.carbon +++ b/toolchain/check/testdata/as/maybe_unformed.carbon @@ -22,8 +22,8 @@ let ptr: X* = &reference; fn Use() { // TODO: Should some of these be valid without the `as`? //@dump-sem-ir-begin - let a: Core.MaybeUnformed(X)* = &(reference as Core.MaybeUnformed(X)); - let b: Core.MaybeUnformed(X)* = ptr as Core.MaybeUnformed(X)*; + let unused a: Core.MaybeUnformed(X)* = &(reference as Core.MaybeUnformed(X)); + let unused b: Core.MaybeUnformed(X)* = ptr as Core.MaybeUnformed(X)*; //@dump-sem-ir-end } @@ -39,22 +39,22 @@ let value: X = Init(); fn Use() { // TODO: These should probably be valid. //@dump-sem-ir-begin - // CHECK:STDERR: fail_todo_add_unformed_nonref.carbon:[[@LINE+7]]:34: error: cannot convert expression of type `X` to `Core.MaybeUnformed(X)` with `as` [ConversionFailure] - // CHECK:STDERR: var i: Core.MaybeUnformed(X) = Init() as Core.MaybeUnformed(X); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_add_unformed_nonref.carbon:[[@LINE+4]]:34: note: type `X` does not implement interface `Core.As(Core.MaybeUnformed(X))` [MissingImplInMemberAccessNote] - // CHECK:STDERR: var i: Core.MaybeUnformed(X) = Init() as Core.MaybeUnformed(X); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_add_unformed_nonref.carbon:[[@LINE+7]]:41: error: cannot convert expression of type `X` to `Core.MaybeUnformed(X)` with `as` [ConversionFailure] + // CHECK:STDERR: var unused i: Core.MaybeUnformed(X) = Init() as Core.MaybeUnformed(X); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_add_unformed_nonref.carbon:[[@LINE+4]]:41: note: type `X` does not implement interface `Core.As(Core.MaybeUnformed(X))` [MissingImplInMemberAccessNote] + // CHECK:STDERR: var unused i: Core.MaybeUnformed(X) = Init() as Core.MaybeUnformed(X); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var i: Core.MaybeUnformed(X) = Init() as Core.MaybeUnformed(X); - // CHECK:STDERR: fail_todo_add_unformed_nonref.carbon:[[@LINE+7]]:34: error: cannot convert expression of type `X` to `Core.MaybeUnformed(X)` with `as` [ConversionFailure] - // CHECK:STDERR: let v: Core.MaybeUnformed(X) = value as Core.MaybeUnformed(X); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_add_unformed_nonref.carbon:[[@LINE+4]]:34: note: type `X` does not implement interface `Core.As(Core.MaybeUnformed(X))` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let v: Core.MaybeUnformed(X) = value as Core.MaybeUnformed(X); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var unused i: Core.MaybeUnformed(X) = Init() as Core.MaybeUnformed(X); + // CHECK:STDERR: fail_todo_add_unformed_nonref.carbon:[[@LINE+7]]:41: error: cannot convert expression of type `X` to `Core.MaybeUnformed(X)` with `as` [ConversionFailure] + // CHECK:STDERR: let unused v: Core.MaybeUnformed(X) = value as Core.MaybeUnformed(X); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_add_unformed_nonref.carbon:[[@LINE+4]]:41: note: type `X` does not implement interface `Core.As(Core.MaybeUnformed(X))` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused v: Core.MaybeUnformed(X) = value as Core.MaybeUnformed(X); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let v: Core.MaybeUnformed(X) = value as Core.MaybeUnformed(X); + let unused v: Core.MaybeUnformed(X) = value as Core.MaybeUnformed(X); //@dump-sem-ir-end } @@ -70,48 +70,48 @@ var reference: Core.MaybeUnformed(X); let ptr: Core.MaybeUnformed(X)* = &reference; fn Use() { - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:14: error: cannot convert expression of type `Core.MaybeUnformed(X)` to `X` with `as` [ConversionFailure] - // CHECK:STDERR: var i: X = Init() as X; - // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:14: note: type `Core.MaybeUnformed(X)` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: var i: X = Init() as X; - // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:21: error: cannot convert expression of type `Core.MaybeUnformed(X)` to `X` with `as` [ConversionFailure] + // CHECK:STDERR: var unused i: X = Init() as X; + // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:21: note: type `Core.MaybeUnformed(X)` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: var unused i: X = Init() as X; + // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: - var i: X = Init() as X; + var unused i: X = Init() as X; // TODO: The diagnostic should explain that the reason we can't perform this // conversion is due to the expression category. - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:14: error: cannot convert expression of type `Core.MaybeUnformed(X)` to `X` with `unsafe as` [ConversionFailure] - // CHECK:STDERR: var j: X = Init() unsafe as X; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:14: note: type `Core.MaybeUnformed(X)` does not implement interface `Core.UnsafeAs(X)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: var j: X = Init() unsafe as X; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:21: error: cannot convert expression of type `Core.MaybeUnformed(X)` to `X` with `unsafe as` [ConversionFailure] + // CHECK:STDERR: var unused j: X = Init() unsafe as X; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:21: note: type `Core.MaybeUnformed(X)` does not implement interface `Core.UnsafeAs(X)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: var unused j: X = Init() unsafe as X; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var j: X = Init() unsafe as X; - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:14: error: cannot convert expression of type `Core.MaybeUnformed(X)` to `X` with `as` [ConversionFailure] - // CHECK:STDERR: let v: X = value as X; - // CHECK:STDERR: ^~~~~~~~~~ - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:14: note: type `Core.MaybeUnformed(X)` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let v: X = value as X; - // CHECK:STDERR: ^~~~~~~~~~ + var unused j: X = Init() unsafe as X; + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:21: error: cannot convert expression of type `Core.MaybeUnformed(X)` to `X` with `as` [ConversionFailure] + // CHECK:STDERR: let unused v: X = value as X; + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:21: note: type `Core.MaybeUnformed(X)` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused v: X = value as X; + // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: - let v: X = value as X; - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:17: error: cannot convert expression of type `Core.MaybeUnformed(X)` to `X` with `as` [ConversionFailure] - // CHECK:STDERR: let a: X* = &(reference as X); - // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:17: note: type `Core.MaybeUnformed(X)` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let a: X* = &(reference as X); - // CHECK:STDERR: ^~~~~~~~~~~~~~ + let unused v: X = value as X; + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:24: error: cannot convert expression of type `Core.MaybeUnformed(X)` to `X` with `as` [ConversionFailure] + // CHECK:STDERR: let unused a: X* = &(reference as X); + // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:24: note: type `Core.MaybeUnformed(X)` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused a: X* = &(reference as X); + // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: - let a: X* = &(reference as X); - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:15: error: cannot convert expression of type `Core.MaybeUnformed(X)*` to `X*` with `as` [ConversionFailure] - // CHECK:STDERR: let b: X* = ptr as X*; - // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:15: note: type `Core.MaybeUnformed(X)*` does not implement interface `Core.As(X*)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let b: X* = ptr as X*; - // CHECK:STDERR: ^~~~~~~~~ + let unused a: X* = &(reference as X); + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+7]]:22: error: cannot convert expression of type `Core.MaybeUnformed(X)*` to `X*` with `as` [ConversionFailure] + // CHECK:STDERR: let unused b: X* = ptr as X*; + // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: fail_cannot_remove_unformed.carbon:[[@LINE+4]]:22: note: type `Core.MaybeUnformed(X)*` does not implement interface `Core.As(X*)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused b: X* = ptr as X*; + // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: - let b: X* = ptr as X*; + let unused b: X* = ptr as X*; } // --- unsafe_remove_unformed.carbon @@ -127,9 +127,9 @@ let ptr: Core.MaybeUnformed(X)* = &reference; fn Use() { //@dump-sem-ir-begin - let v: X = value unsafe as X; - let a: X* = &(reference unsafe as X); - let b: X* = ptr unsafe as X*; + let unused v: X = value unsafe as X; + let unused a: X* = &(reference unsafe as X); + let unused b: X* = ptr unsafe as X*; //@dump-sem-ir-end } @@ -162,40 +162,40 @@ fn Use() { // CHECK:STDOUT: %a.patt: %pattern_type.396 = value_binding_pattern a [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %reference.ref: ref %X = name_ref reference, file.%reference [concrete = file.%reference.var] -// CHECK:STDOUT: %Core.ref.loc12_50: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %MaybeUnformed.ref.loc12_54: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] -// CHECK:STDOUT: %X.ref.loc12_69: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc12_70: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.b49] -// CHECK:STDOUT: %.loc12_47.1: ref %MaybeUnformed.b49 = as_compatible %reference.ref [concrete = constants.%reference.var] -// CHECK:STDOUT: %.loc12_47.2: ref %MaybeUnformed.b49 = converted %reference.ref, %.loc12_47.1 [concrete = constants.%reference.var] -// CHECK:STDOUT: %addr: %ptr.045 = addr_of %.loc12_47.2 [concrete = constants.%addr.25c] -// CHECK:STDOUT: %.loc12_31: type = splice_block %ptr.loc12 [concrete = constants.%ptr.045] { -// CHECK:STDOUT: %Core.ref.loc12_10: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %MaybeUnformed.ref.loc12_14: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] -// CHECK:STDOUT: %X.ref.loc12_29: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc12_30: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.b49] -// CHECK:STDOUT: %ptr.loc12: type = ptr_type %MaybeUnformed.loc12_30 [concrete = constants.%ptr.045] +// CHECK:STDOUT: %Core.ref.loc12_57: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %MaybeUnformed.ref.loc12_61: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] +// CHECK:STDOUT: %X.ref.loc12_76: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %MaybeUnformed.loc12_77: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.b49] +// CHECK:STDOUT: %.loc12_54.1: ref %MaybeUnformed.b49 = as_compatible %reference.ref [concrete = constants.%reference.var] +// CHECK:STDOUT: %.loc12_54.2: ref %MaybeUnformed.b49 = converted %reference.ref, %.loc12_54.1 [concrete = constants.%reference.var] +// CHECK:STDOUT: %addr: %ptr.045 = addr_of %.loc12_54.2 [concrete = constants.%addr.25c] +// CHECK:STDOUT: %.loc12_38: type = splice_block %ptr.loc12 [concrete = constants.%ptr.045] { +// CHECK:STDOUT: %Core.ref.loc12_17: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %MaybeUnformed.ref.loc12_21: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] +// CHECK:STDOUT: %X.ref.loc12_36: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %MaybeUnformed.loc12_37: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.b49] +// CHECK:STDOUT: %ptr.loc12: type = ptr_type %MaybeUnformed.loc12_37 [concrete = constants.%ptr.045] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.045 = value_binding a, %addr // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.396 = value_binding_pattern b [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %ptr.ref: %ptr.2a9 = name_ref ptr, file.%ptr.loc7_5 -// CHECK:STDOUT: %Core.ref.loc13_42: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %MaybeUnformed.ref.loc13_46: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] -// CHECK:STDOUT: %X.ref.loc13_61: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc13_62: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.b49] -// CHECK:STDOUT: %ptr.loc13_63: type = ptr_type %MaybeUnformed.loc13_62 [concrete = constants.%ptr.045] -// CHECK:STDOUT: %.loc13_39.1: %ptr.045 = as_compatible %ptr.ref -// CHECK:STDOUT: %.loc13_39.2: %ptr.045 = converted %ptr.ref, %.loc13_39.1 -// CHECK:STDOUT: %.loc13_31: type = splice_block %ptr.loc13_31 [concrete = constants.%ptr.045] { -// CHECK:STDOUT: %Core.ref.loc13_10: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %MaybeUnformed.ref.loc13_14: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] -// CHECK:STDOUT: %X.ref.loc13_29: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc13_30: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.b49] -// CHECK:STDOUT: %ptr.loc13_31: type = ptr_type %MaybeUnformed.loc13_30 [concrete = constants.%ptr.045] +// CHECK:STDOUT: %Core.ref.loc13_49: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %MaybeUnformed.ref.loc13_53: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] +// CHECK:STDOUT: %X.ref.loc13_68: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %MaybeUnformed.loc13_69: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.b49] +// CHECK:STDOUT: %ptr.loc13_70: type = ptr_type %MaybeUnformed.loc13_69 [concrete = constants.%ptr.045] +// CHECK:STDOUT: %.loc13_46.1: %ptr.045 = as_compatible %ptr.ref +// CHECK:STDOUT: %.loc13_46.2: %ptr.045 = converted %ptr.ref, %.loc13_46.1 +// CHECK:STDOUT: %.loc13_38: type = splice_block %ptr.loc13_38 [concrete = constants.%ptr.045] { +// CHECK:STDOUT: %Core.ref.loc13_17: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %MaybeUnformed.ref.loc13_21: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] +// CHECK:STDOUT: %X.ref.loc13_36: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %MaybeUnformed.loc13_37: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.b49] +// CHECK:STDOUT: %ptr.loc13_38: type = ptr_type %MaybeUnformed.loc13_37 [concrete = constants.%ptr.045] // CHECK:STDOUT: } -// CHECK:STDOUT: %b: %ptr.045 = value_binding b, %.loc13_39.2 +// CHECK:STDOUT: %b: %ptr.045 = value_binding b, %.loc13_46.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -243,35 +243,35 @@ fn Use() { // CHECK:STDOUT: } // CHECK:STDOUT: %i.var: ref %MaybeUnformed.b49 = var %i.var_patt // CHECK:STDOUT: %Init.ref: %Init.type = name_ref Init, file.%Init.decl [concrete = constants.%Init] -// CHECK:STDOUT: %.loc19_39: ref %X = temporary_storage -// CHECK:STDOUT: %Init.call: init %X to %.loc19_39 = call %Init.ref() -// CHECK:STDOUT: %Core.ref.loc19_44: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %MaybeUnformed.ref.loc19_48: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] -// CHECK:STDOUT: %X.ref.loc19_63: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc19_64: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.b49] -// CHECK:STDOUT: %.loc19_41: %MaybeUnformed.b49 = converted %Init.call, [concrete = ] +// CHECK:STDOUT: %.loc19_46: ref %X = temporary_storage +// CHECK:STDOUT: %Init.call: init %X to %.loc19_46 = call %Init.ref() +// CHECK:STDOUT: %Core.ref.loc19_51: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %MaybeUnformed.ref.loc19_55: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] +// CHECK:STDOUT: %X.ref.loc19_70: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %MaybeUnformed.loc19_71: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.b49] +// CHECK:STDOUT: %.loc19_48: %MaybeUnformed.b49 = converted %Init.call, [concrete = ] // CHECK:STDOUT: assign %i.var, -// CHECK:STDOUT: %.loc19_30: type = splice_block %MaybeUnformed.loc19_30 [concrete = constants.%MaybeUnformed.b49] { -// CHECK:STDOUT: %Core.ref.loc19_10: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %MaybeUnformed.ref.loc19_14: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] -// CHECK:STDOUT: %X.ref.loc19_29: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc19_30: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.b49] +// CHECK:STDOUT: %.loc19_37: type = splice_block %MaybeUnformed.loc19_37 [concrete = constants.%MaybeUnformed.b49] { +// CHECK:STDOUT: %Core.ref.loc19_17: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %MaybeUnformed.ref.loc19_21: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] +// CHECK:STDOUT: %X.ref.loc19_36: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %MaybeUnformed.loc19_37: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.b49] // CHECK:STDOUT: } // CHECK:STDOUT: %i: ref %MaybeUnformed.b49 = ref_binding i, %i.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %v.patt: %pattern_type.de9 = value_binding_pattern v [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %value.ref: %X = name_ref value, file.%value -// CHECK:STDOUT: %Core.ref.loc27_43: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %MaybeUnformed.ref.loc27_47: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] -// CHECK:STDOUT: %X.ref.loc27_62: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc27_63: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.b49] -// CHECK:STDOUT: %.loc27_40: %MaybeUnformed.b49 = converted %value.ref, [concrete = ] -// CHECK:STDOUT: %.loc27_30: type = splice_block %MaybeUnformed.loc27_30 [concrete = constants.%MaybeUnformed.b49] { -// CHECK:STDOUT: %Core.ref.loc27_10: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %MaybeUnformed.ref.loc27_14: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] -// CHECK:STDOUT: %X.ref.loc27_29: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc27_30: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.b49] +// CHECK:STDOUT: %Core.ref.loc27_50: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %MaybeUnformed.ref.loc27_54: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] +// CHECK:STDOUT: %X.ref.loc27_69: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %MaybeUnformed.loc27_70: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.b49] +// CHECK:STDOUT: %.loc27_47: %MaybeUnformed.b49 = converted %value.ref, [concrete = ] +// CHECK:STDOUT: %.loc27_37: type = splice_block %MaybeUnformed.loc27_37 [concrete = constants.%MaybeUnformed.b49] { +// CHECK:STDOUT: %Core.ref.loc27_17: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %MaybeUnformed.ref.loc27_21: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] +// CHECK:STDOUT: %X.ref.loc27_36: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %MaybeUnformed.loc27_37: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.b49] // CHECK:STDOUT: } // CHECK:STDOUT: %v: %MaybeUnformed.b49 = value_binding v, [concrete = ] // CHECK:STDOUT: %DestroyOp.bound: = bound_method %i.var, constants.%DestroyOp @@ -308,37 +308,37 @@ fn Use() { // CHECK:STDOUT: %v.patt: %pattern_type.05f = value_binding_pattern v [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %value.ref: %MaybeUnformed.b49 = name_ref value, file.%value -// CHECK:STDOUT: %X.ref.loc13_30: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc13_27.1: %X = as_compatible %value.ref -// CHECK:STDOUT: %.loc13_27.2: %X = converted %value.ref, %.loc13_27.1 -// CHECK:STDOUT: %X.ref.loc13_10: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %v: %X = value_binding v, %.loc13_27.2 +// CHECK:STDOUT: %X.ref.loc13_37: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc13_34.1: %X = as_compatible %value.ref +// CHECK:STDOUT: %.loc13_34.2: %X = converted %value.ref, %.loc13_34.1 +// CHECK:STDOUT: %X.ref.loc13_17: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %v: %X = value_binding v, %.loc13_34.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.37f = value_binding_pattern a [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %reference.ref: ref %MaybeUnformed.b49 = name_ref reference, file.%reference [concrete = file.%reference.var] -// CHECK:STDOUT: %X.ref.loc14_37: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc14_34.1: ref %X = as_compatible %reference.ref [concrete = constants.%reference.var] -// CHECK:STDOUT: %.loc14_34.2: ref %X = converted %reference.ref, %.loc14_34.1 [concrete = constants.%reference.var] -// CHECK:STDOUT: %addr: %ptr.2a9 = addr_of %.loc14_34.2 [concrete = constants.%addr.6f7] -// CHECK:STDOUT: %.loc14_11: type = splice_block %ptr.loc14 [concrete = constants.%ptr.2a9] { -// CHECK:STDOUT: %X.ref.loc14_10: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %ptr.loc14: type = ptr_type %X.ref.loc14_10 [concrete = constants.%ptr.2a9] +// CHECK:STDOUT: %X.ref.loc14_44: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc14_41.1: ref %X = as_compatible %reference.ref [concrete = constants.%reference.var] +// CHECK:STDOUT: %.loc14_41.2: ref %X = converted %reference.ref, %.loc14_41.1 [concrete = constants.%reference.var] +// CHECK:STDOUT: %addr: %ptr.2a9 = addr_of %.loc14_41.2 [concrete = constants.%addr.6f7] +// CHECK:STDOUT: %.loc14_18: type = splice_block %ptr.loc14 [concrete = constants.%ptr.2a9] { +// CHECK:STDOUT: %X.ref.loc14_17: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %ptr.loc14: type = ptr_type %X.ref.loc14_17 [concrete = constants.%ptr.2a9] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.2a9 = value_binding a, %addr // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.37f = value_binding_pattern b [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %ptr.ref: %ptr.045 = name_ref ptr, file.%ptr.loc9_5 -// CHECK:STDOUT: %X.ref.loc15_29: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %ptr.loc15_30: type = ptr_type %X.ref.loc15_29 [concrete = constants.%ptr.2a9] -// CHECK:STDOUT: %.loc15_26.1: %ptr.2a9 = as_compatible %ptr.ref -// CHECK:STDOUT: %.loc15_26.2: %ptr.2a9 = converted %ptr.ref, %.loc15_26.1 -// CHECK:STDOUT: %.loc15_11: type = splice_block %ptr.loc15_11 [concrete = constants.%ptr.2a9] { -// CHECK:STDOUT: %X.ref.loc15_10: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %ptr.loc15_11: type = ptr_type %X.ref.loc15_10 [concrete = constants.%ptr.2a9] +// CHECK:STDOUT: %X.ref.loc15_36: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %ptr.loc15_37: type = ptr_type %X.ref.loc15_36 [concrete = constants.%ptr.2a9] +// CHECK:STDOUT: %.loc15_33.1: %ptr.2a9 = as_compatible %ptr.ref +// CHECK:STDOUT: %.loc15_33.2: %ptr.2a9 = converted %ptr.ref, %.loc15_33.1 +// CHECK:STDOUT: %.loc15_18: type = splice_block %ptr.loc15_18 [concrete = constants.%ptr.2a9] { +// CHECK:STDOUT: %X.ref.loc15_17: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %ptr.loc15_18: type = ptr_type %X.ref.loc15_17 [concrete = constants.%ptr.2a9] // CHECK:STDOUT: } -// CHECK:STDOUT: %b: %ptr.2a9 = value_binding b, %.loc15_26.2 +// CHECK:STDOUT: %b: %ptr.2a9 = value_binding b, %.loc15_33.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/partial.carbon b/toolchain/check/testdata/as/partial.carbon index 185fede367e2..872dee86949a 100644 --- a/toolchain/check/testdata/as/partial.carbon +++ b/toolchain/check/testdata/as/partial.carbon @@ -24,10 +24,10 @@ let ptr: X* = &reference; fn Use() { // TODO: Should some of these be valid without the `as`? //@dump-sem-ir-begin - var i: partial X = Init() as partial X; - let v: partial X = value as partial X; - let a: partial X* = &(reference as partial X); - let b: partial X* = ptr as partial X*; + var unused i: partial X = Init() as partial X; + let unused v: partial X = value as partial X; + let unused a: partial X* = &(reference as partial X); + let unused b: partial X* = ptr as partial X*; //@dump-sem-ir-end } @@ -43,29 +43,29 @@ fn Use() { //@dump-sem-ir-begin // TODO: This should be valid, and should initialize the vptr. The explicit `as` should probably not be necessary. // CHECK:STDERR: fail_todo_remove_partial_in_init.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `partial X` to `X` [ConversionFailure] - // CHECK:STDERR: var i: X = Init(); - // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: var unused i: X = Init(); + // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_remove_partial_in_init.carbon:[[@LINE+4]]:3: note: type `partial X` does not implement interface `Core.ImplicitAs(X)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: var i: X = Init(); - // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: var unused i: X = Init(); + // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: - var i: X = Init(); - // CHECK:STDERR: fail_todo_remove_partial_in_init.carbon:[[@LINE+7]]:14: error: cannot convert expression of type `partial X` to `X` with `as` [ConversionFailure] - // CHECK:STDERR: var j: X = Init() as X; - // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_todo_remove_partial_in_init.carbon:[[@LINE+4]]:14: note: type `partial X` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: var j: X = Init() as X; - // CHECK:STDERR: ^~~~~~~~~~~ + var unused i: X = Init(); + // CHECK:STDERR: fail_todo_remove_partial_in_init.carbon:[[@LINE+7]]:21: error: cannot convert expression of type `partial X` to `X` with `as` [ConversionFailure] + // CHECK:STDERR: var unused j: X = Init() as X; + // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: fail_todo_remove_partial_in_init.carbon:[[@LINE+4]]:21: note: type `partial X` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: var unused j: X = Init() as X; + // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: - var j: X = Init() as X; - // CHECK:STDERR: fail_todo_remove_partial_in_init.carbon:[[@LINE+7]]:14: error: cannot convert expression of type `partial X` to `X` with `unsafe as` [ConversionFailure] - // CHECK:STDERR: var k: X = Init() unsafe as X; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_remove_partial_in_init.carbon:[[@LINE+4]]:14: note: type `partial X` does not implement interface `Core.UnsafeAs(X)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: var k: X = Init() unsafe as X; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ + var unused j: X = Init() as X; + // CHECK:STDERR: fail_todo_remove_partial_in_init.carbon:[[@LINE+7]]:21: error: cannot convert expression of type `partial X` to `X` with `unsafe as` [ConversionFailure] + // CHECK:STDERR: var unused k: X = Init() unsafe as X; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_remove_partial_in_init.carbon:[[@LINE+4]]:21: note: type `partial X` does not implement interface `Core.UnsafeAs(X)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: var unused k: X = Init() unsafe as X; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var k: X = Init() unsafe as X; + var unused k: X = Init() unsafe as X; //@dump-sem-ir-end } @@ -82,30 +82,30 @@ var reference: partial X; let ptr: partial X* = &reference; fn Use() { - // CHECK:STDERR: fail_cannot_remove_partial.carbon:[[@LINE+7]]:14: error: cannot convert expression of type `partial X` to `X` with `as` [ConversionFailure] - // CHECK:STDERR: let v: X = value as X; - // CHECK:STDERR: ^~~~~~~~~~ - // CHECK:STDERR: fail_cannot_remove_partial.carbon:[[@LINE+4]]:14: note: type `partial X` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let v: X = value as X; - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fail_cannot_remove_partial.carbon:[[@LINE+7]]:21: error: cannot convert expression of type `partial X` to `X` with `as` [ConversionFailure] + // CHECK:STDERR: let unused v: X = value as X; + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fail_cannot_remove_partial.carbon:[[@LINE+4]]:21: note: type `partial X` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused v: X = value as X; + // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: - let v: X = value as X; - // CHECK:STDERR: fail_cannot_remove_partial.carbon:[[@LINE+7]]:17: error: cannot convert expression of type `partial X` to `X` with `as` [ConversionFailure] - // CHECK:STDERR: let a: X* = &(reference as X); - // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_cannot_remove_partial.carbon:[[@LINE+4]]:17: note: type `partial X` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let a: X* = &(reference as X); - // CHECK:STDERR: ^~~~~~~~~~~~~~ + let unused v: X = value as X; + // CHECK:STDERR: fail_cannot_remove_partial.carbon:[[@LINE+7]]:24: error: cannot convert expression of type `partial X` to `X` with `as` [ConversionFailure] + // CHECK:STDERR: let unused a: X* = &(reference as X); + // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: fail_cannot_remove_partial.carbon:[[@LINE+4]]:24: note: type `partial X` does not implement interface `Core.As(X)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused a: X* = &(reference as X); + // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: - let a: X* = &(reference as X); - // CHECK:STDERR: fail_cannot_remove_partial.carbon:[[@LINE+7]]:15: error: cannot convert expression of type `partial X*` to `X*` with `as` [ConversionFailure] - // CHECK:STDERR: let b: X* = ptr as X*; - // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_cannot_remove_partial.carbon:[[@LINE+4]]:15: note: type `partial X*` does not implement interface `Core.As(X*)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let b: X* = ptr as X*; - // CHECK:STDERR: ^~~~~~~~~ + let unused a: X* = &(reference as X); + // CHECK:STDERR: fail_cannot_remove_partial.carbon:[[@LINE+7]]:22: error: cannot convert expression of type `partial X*` to `X*` with `as` [ConversionFailure] + // CHECK:STDERR: let unused b: X* = ptr as X*; + // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: fail_cannot_remove_partial.carbon:[[@LINE+4]]:22: note: type `partial X*` does not implement interface `Core.As(X*)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused b: X* = ptr as X*; + // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: - let b: X* = ptr as X*; + let unused b: X* = ptr as X*; } // --- unsafe_remove_partial.carbon @@ -122,9 +122,9 @@ let ptr: partial X* = &reference; fn Use() { //@dump-sem-ir-begin - let v: X = value unsafe as X; - let a: X* = &(reference unsafe as X); - let b: X* = ptr unsafe as X*; + let unused v: X = value unsafe as X; + let unused a: X* = &(reference unsafe as X); + let unused b: X* = ptr unsafe as X*; //@dump-sem-ir-end } @@ -159,59 +159,59 @@ fn Use() { // CHECK:STDOUT: %Init.ref: %Init.type = name_ref Init, file.%Init.decl [concrete = constants.%Init] // CHECK:STDOUT: %.loc14_3: ref %.4b5 = splice_block %i.var {} // CHECK:STDOUT: %Init.call: init %X to %.loc14_3 = call %Init.ref() -// CHECK:STDOUT: %X.ref.loc14_40: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc14_32: type = partial_type %X.ref.loc14_40 [concrete = constants.%.4b5] -// CHECK:STDOUT: %.loc14_29.1: init %.4b5 = as_compatible %Init.call -// CHECK:STDOUT: %.loc14_29.2: init %.4b5 = converted %Init.call, %.loc14_29.1 -// CHECK:STDOUT: assign %i.var, %.loc14_29.2 -// CHECK:STDOUT: %.loc14_10.1: type = splice_block %.loc14_10.2 [concrete = constants.%.4b5] { -// CHECK:STDOUT: %X.ref.loc14_18: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc14_10.2: type = partial_type %X.ref.loc14_18 [concrete = constants.%.4b5] +// CHECK:STDOUT: %X.ref.loc14_47: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc14_39: type = partial_type %X.ref.loc14_47 [concrete = constants.%.4b5] +// CHECK:STDOUT: %.loc14_36.1: init %.4b5 = as_compatible %Init.call +// CHECK:STDOUT: %.loc14_36.2: init %.4b5 = converted %Init.call, %.loc14_36.1 +// CHECK:STDOUT: assign %i.var, %.loc14_36.2 +// CHECK:STDOUT: %.loc14_17.1: type = splice_block %.loc14_17.2 [concrete = constants.%.4b5] { +// CHECK:STDOUT: %X.ref.loc14_25: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc14_17.2: type = partial_type %X.ref.loc14_25 [concrete = constants.%.4b5] // CHECK:STDOUT: } // CHECK:STDOUT: %i: ref %.4b5 = ref_binding i, %i.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %v.patt: %pattern_type.bc5 = value_binding_pattern v [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %value.ref: %X = name_ref value, file.%value -// CHECK:STDOUT: %X.ref.loc15_39: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc15_31: type = partial_type %X.ref.loc15_39 [concrete = constants.%.4b5] -// CHECK:STDOUT: %.loc15_28.1: %.4b5 = as_compatible %value.ref -// CHECK:STDOUT: %.loc15_28.2: %.4b5 = converted %value.ref, %.loc15_28.1 -// CHECK:STDOUT: %.loc15_10.1: type = splice_block %.loc15_10.2 [concrete = constants.%.4b5] { -// CHECK:STDOUT: %X.ref.loc15_18: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc15_10.2: type = partial_type %X.ref.loc15_18 [concrete = constants.%.4b5] +// CHECK:STDOUT: %X.ref.loc15_46: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc15_38: type = partial_type %X.ref.loc15_46 [concrete = constants.%.4b5] +// CHECK:STDOUT: %.loc15_35.1: %.4b5 = as_compatible %value.ref +// CHECK:STDOUT: %.loc15_35.2: %.4b5 = converted %value.ref, %.loc15_35.1 +// CHECK:STDOUT: %.loc15_17.1: type = splice_block %.loc15_17.2 [concrete = constants.%.4b5] { +// CHECK:STDOUT: %X.ref.loc15_25: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc15_17.2: type = partial_type %X.ref.loc15_25 [concrete = constants.%.4b5] // CHECK:STDOUT: } -// CHECK:STDOUT: %v: %.4b5 = value_binding v, %.loc15_28.2 +// CHECK:STDOUT: %v: %.4b5 = value_binding v, %.loc15_35.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.408 = value_binding_pattern a [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %reference.ref: ref %X = name_ref reference, file.%reference [concrete = file.%reference.var] -// CHECK:STDOUT: %X.ref.loc16_46: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc16_38: type = partial_type %X.ref.loc16_46 [concrete = constants.%.4b5] -// CHECK:STDOUT: %.loc16_35.1: ref %.4b5 = as_compatible %reference.ref [concrete = constants.%reference.var] -// CHECK:STDOUT: %.loc16_35.2: ref %.4b5 = converted %reference.ref, %.loc16_35.1 [concrete = constants.%reference.var] -// CHECK:STDOUT: %addr: %ptr.314 = addr_of %.loc16_35.2 [concrete = constants.%addr.315] -// CHECK:STDOUT: %.loc16_19: type = splice_block %ptr.loc16 [concrete = constants.%ptr.314] { -// CHECK:STDOUT: %X.ref.loc16_18: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc16_10: type = partial_type %X.ref.loc16_18 [concrete = constants.%.4b5] -// CHECK:STDOUT: %ptr.loc16: type = ptr_type %.loc16_10 [concrete = constants.%ptr.314] +// CHECK:STDOUT: %X.ref.loc16_53: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc16_45: type = partial_type %X.ref.loc16_53 [concrete = constants.%.4b5] +// CHECK:STDOUT: %.loc16_42.1: ref %.4b5 = as_compatible %reference.ref [concrete = constants.%reference.var] +// CHECK:STDOUT: %.loc16_42.2: ref %.4b5 = converted %reference.ref, %.loc16_42.1 [concrete = constants.%reference.var] +// CHECK:STDOUT: %addr: %ptr.314 = addr_of %.loc16_42.2 [concrete = constants.%addr.315] +// CHECK:STDOUT: %.loc16_26: type = splice_block %ptr.loc16 [concrete = constants.%ptr.314] { +// CHECK:STDOUT: %X.ref.loc16_25: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc16_17: type = partial_type %X.ref.loc16_25 [concrete = constants.%.4b5] +// CHECK:STDOUT: %ptr.loc16: type = ptr_type %.loc16_17 [concrete = constants.%ptr.314] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.314 = value_binding a, %addr // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.408 = value_binding_pattern b [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %ptr.ref: %ptr.2a9 = name_ref ptr, file.%ptr.loc9_5 -// CHECK:STDOUT: %X.ref.loc17_38: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc17_30: type = partial_type %X.ref.loc17_38 [concrete = constants.%.4b5] -// CHECK:STDOUT: %ptr.loc17_39: type = ptr_type %.loc17_30 [concrete = constants.%ptr.314] -// CHECK:STDOUT: %.loc17_27.1: %ptr.314 = as_compatible %ptr.ref -// CHECK:STDOUT: %.loc17_27.2: %ptr.314 = converted %ptr.ref, %.loc17_27.1 -// CHECK:STDOUT: %.loc17_19: type = splice_block %ptr.loc17_19 [concrete = constants.%ptr.314] { -// CHECK:STDOUT: %X.ref.loc17_18: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc17_10: type = partial_type %X.ref.loc17_18 [concrete = constants.%.4b5] -// CHECK:STDOUT: %ptr.loc17_19: type = ptr_type %.loc17_10 [concrete = constants.%ptr.314] +// CHECK:STDOUT: %X.ref.loc17_45: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc17_37: type = partial_type %X.ref.loc17_45 [concrete = constants.%.4b5] +// CHECK:STDOUT: %ptr.loc17_46: type = ptr_type %.loc17_37 [concrete = constants.%ptr.314] +// CHECK:STDOUT: %.loc17_34.1: %ptr.314 = as_compatible %ptr.ref +// CHECK:STDOUT: %.loc17_34.2: %ptr.314 = converted %ptr.ref, %.loc17_34.1 +// CHECK:STDOUT: %.loc17_26: type = splice_block %ptr.loc17_26 [concrete = constants.%ptr.314] { +// CHECK:STDOUT: %X.ref.loc17_25: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc17_17: type = partial_type %X.ref.loc17_25 [concrete = constants.%.4b5] +// CHECK:STDOUT: %ptr.loc17_26: type = ptr_type %.loc17_17 [concrete = constants.%ptr.314] // CHECK:STDOUT: } -// CHECK:STDOUT: %b: %ptr.314 = value_binding b, %.loc17_27.2 +// CHECK:STDOUT: %b: %ptr.314 = value_binding b, %.loc17_34.2 // CHECK:STDOUT: %DestroyOp.bound: = bound_method %i.var, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%i.var) // CHECK:STDOUT: @@ -248,8 +248,8 @@ fn Use() { // CHECK:STDOUT: } // CHECK:STDOUT: %i.var: ref %X = var %i.var_patt // CHECK:STDOUT: %Init.ref.loc18: %Init.type = name_ref Init, file.%Init.decl [concrete = constants.%Init] -// CHECK:STDOUT: %.loc18_19: ref %.4b5 = temporary_storage -// CHECK:STDOUT: %Init.call.loc18: init %.4b5 to %.loc18_19 = call %Init.ref.loc18() +// CHECK:STDOUT: %.loc18_26: ref %.4b5 = temporary_storage +// CHECK:STDOUT: %Init.call.loc18: init %.4b5 to %.loc18_26 = call %Init.ref.loc18() // CHECK:STDOUT: %.loc18_3: %X = converted %Init.call.loc18, [concrete = ] // CHECK:STDOUT: assign %i.var, // CHECK:STDOUT: %X.ref.loc18: type = name_ref X, file.%X.decl [concrete = constants.%X] @@ -260,12 +260,12 @@ fn Use() { // CHECK:STDOUT: } // CHECK:STDOUT: %j.var: ref %X = var %j.var_patt // CHECK:STDOUT: %Init.ref.loc26: %Init.type = name_ref Init, file.%Init.decl [concrete = constants.%Init] -// CHECK:STDOUT: %.loc26_19: ref %.4b5 = temporary_storage -// CHECK:STDOUT: %Init.call.loc26: init %.4b5 to %.loc26_19 = call %Init.ref.loc26() -// CHECK:STDOUT: %X.ref.loc26_24: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc26_21: %X = converted %Init.call.loc26, [concrete = ] +// CHECK:STDOUT: %.loc26_26: ref %.4b5 = temporary_storage +// CHECK:STDOUT: %Init.call.loc26: init %.4b5 to %.loc26_26 = call %Init.ref.loc26() +// CHECK:STDOUT: %X.ref.loc26_31: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc26_28: %X = converted %Init.call.loc26, [concrete = ] // CHECK:STDOUT: assign %j.var, -// CHECK:STDOUT: %X.ref.loc26_10: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %X.ref.loc26_17: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %j: ref %X = ref_binding j, %j.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %k.patt: %pattern_type.05f = ref_binding_pattern k [concrete] @@ -273,12 +273,12 @@ fn Use() { // CHECK:STDOUT: } // CHECK:STDOUT: %k.var: ref %X = var %k.var_patt // CHECK:STDOUT: %Init.ref.loc34: %Init.type = name_ref Init, file.%Init.decl [concrete = constants.%Init] -// CHECK:STDOUT: %.loc34_19: ref %.4b5 = temporary_storage -// CHECK:STDOUT: %Init.call.loc34: init %.4b5 to %.loc34_19 = call %Init.ref.loc34() -// CHECK:STDOUT: %X.ref.loc34_31: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc34_28: %X = converted %Init.call.loc34, [concrete = ] +// CHECK:STDOUT: %.loc34_26: ref %.4b5 = temporary_storage +// CHECK:STDOUT: %Init.call.loc34: init %.4b5 to %.loc34_26 = call %Init.ref.loc34() +// CHECK:STDOUT: %X.ref.loc34_38: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc34_35: %X = converted %Init.call.loc34, [concrete = ] // CHECK:STDOUT: assign %k.var, -// CHECK:STDOUT: %X.ref.loc34_10: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %X.ref.loc34_17: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %k: ref %X = ref_binding k, %k.var // CHECK:STDOUT: %DestroyOp.bound.loc34: = bound_method %k.var, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call.loc34: init %empty_tuple.type = call %DestroyOp.bound.loc34(%k.var) @@ -313,37 +313,37 @@ fn Use() { // CHECK:STDOUT: %v.patt: %pattern_type.05f = value_binding_pattern v [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %value.ref: %.4b5 = name_ref value, file.%value -// CHECK:STDOUT: %X.ref.loc14_30: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc14_27.1: %X = as_compatible %value.ref -// CHECK:STDOUT: %.loc14_27.2: %X = converted %value.ref, %.loc14_27.1 -// CHECK:STDOUT: %X.ref.loc14_10: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %v: %X = value_binding v, %.loc14_27.2 +// CHECK:STDOUT: %X.ref.loc14_37: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc14_34.1: %X = as_compatible %value.ref +// CHECK:STDOUT: %.loc14_34.2: %X = converted %value.ref, %.loc14_34.1 +// CHECK:STDOUT: %X.ref.loc14_17: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %v: %X = value_binding v, %.loc14_34.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.37f = value_binding_pattern a [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %reference.ref: ref %.4b5 = name_ref reference, file.%reference [concrete = file.%reference.var] -// CHECK:STDOUT: %X.ref.loc15_37: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc15_34.1: ref %X = as_compatible %reference.ref [concrete = constants.%reference.var] -// CHECK:STDOUT: %.loc15_34.2: ref %X = converted %reference.ref, %.loc15_34.1 [concrete = constants.%reference.var] -// CHECK:STDOUT: %addr: %ptr.2a9 = addr_of %.loc15_34.2 [concrete = constants.%addr.9cd] -// CHECK:STDOUT: %.loc15_11: type = splice_block %ptr.loc15 [concrete = constants.%ptr.2a9] { -// CHECK:STDOUT: %X.ref.loc15_10: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %ptr.loc15: type = ptr_type %X.ref.loc15_10 [concrete = constants.%ptr.2a9] +// CHECK:STDOUT: %X.ref.loc15_44: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %.loc15_41.1: ref %X = as_compatible %reference.ref [concrete = constants.%reference.var] +// CHECK:STDOUT: %.loc15_41.2: ref %X = converted %reference.ref, %.loc15_41.1 [concrete = constants.%reference.var] +// CHECK:STDOUT: %addr: %ptr.2a9 = addr_of %.loc15_41.2 [concrete = constants.%addr.9cd] +// CHECK:STDOUT: %.loc15_18: type = splice_block %ptr.loc15 [concrete = constants.%ptr.2a9] { +// CHECK:STDOUT: %X.ref.loc15_17: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %ptr.loc15: type = ptr_type %X.ref.loc15_17 [concrete = constants.%ptr.2a9] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.2a9 = value_binding a, %addr // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.37f = value_binding_pattern b [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %ptr.ref: %ptr.314 = name_ref ptr, file.%ptr.loc10_5 -// CHECK:STDOUT: %X.ref.loc16_29: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %ptr.loc16_30: type = ptr_type %X.ref.loc16_29 [concrete = constants.%ptr.2a9] -// CHECK:STDOUT: %.loc16_26.1: %ptr.2a9 = as_compatible %ptr.ref -// CHECK:STDOUT: %.loc16_26.2: %ptr.2a9 = converted %ptr.ref, %.loc16_26.1 -// CHECK:STDOUT: %.loc16_11: type = splice_block %ptr.loc16_11 [concrete = constants.%ptr.2a9] { -// CHECK:STDOUT: %X.ref.loc16_10: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %ptr.loc16_11: type = ptr_type %X.ref.loc16_10 [concrete = constants.%ptr.2a9] +// CHECK:STDOUT: %X.ref.loc16_36: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %ptr.loc16_37: type = ptr_type %X.ref.loc16_36 [concrete = constants.%ptr.2a9] +// CHECK:STDOUT: %.loc16_33.1: %ptr.2a9 = as_compatible %ptr.ref +// CHECK:STDOUT: %.loc16_33.2: %ptr.2a9 = converted %ptr.ref, %.loc16_33.1 +// CHECK:STDOUT: %.loc16_18: type = splice_block %ptr.loc16_18 [concrete = constants.%ptr.2a9] { +// CHECK:STDOUT: %X.ref.loc16_17: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %ptr.loc16_18: type = ptr_type %X.ref.loc16_17 [concrete = constants.%ptr.2a9] // CHECK:STDOUT: } -// CHECK:STDOUT: %b: %ptr.2a9 = value_binding b, %.loc16_26.2 +// CHECK:STDOUT: %b: %ptr.2a9 = value_binding b, %.loc16_33.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/var_init.carbon b/toolchain/check/testdata/as/var_init.carbon index 643167236c13..46831b025fb6 100644 --- a/toolchain/check/testdata/as/var_init.carbon +++ b/toolchain/check/testdata/as/var_init.carbon @@ -16,13 +16,13 @@ library "[[@TEST_NAME]]"; class X { impl () as Core.ImplicitAs(X) { - fn Convert[self: ()]() -> X { return {}; } + fn Convert[unused self: ()]() -> X { return {}; } } } -fn Convert(t: ()) { +fn Convert(unused t: ()) { //@dump-sem-ir-begin - var x: X = (); + var unused x: X = (); //@dump-sem-ir-end } @@ -56,14 +56,14 @@ fn Convert(t: ()) { // CHECK:STDOUT: %x.var_patt: %pattern_type.05f = var_pattern %x.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %x.var: ref %X = var %x.var_patt -// CHECK:STDOUT: %.loc12_15.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc12_22.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %impl.elem0: %.1bd = impl_witness_access constants.%ImplicitAs.impl_witness, element0 [concrete = constants.%empty_tuple.type.as.ImplicitAs.impl.Convert] -// CHECK:STDOUT: %bound_method: = bound_method %.loc12_15.1, %impl.elem0 [concrete = constants.%empty_tuple.type.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %bound_method: = bound_method %.loc12_22.1, %impl.elem0 [concrete = constants.%empty_tuple.type.as.ImplicitAs.impl.Convert.bound] // CHECK:STDOUT: %.loc12_3.1: ref %X = splice_block %x.var {} // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc12_15.2: %empty_tuple.type = converted %.loc12_15.1, %empty_tuple [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %empty_tuple.type.as.ImplicitAs.impl.Convert.call: init %X to %.loc12_3.1 = call %bound_method(%.loc12_15.2) -// CHECK:STDOUT: %.loc12_3.2: init %X = converted %.loc12_15.1, %empty_tuple.type.as.ImplicitAs.impl.Convert.call +// CHECK:STDOUT: %.loc12_22.2: %empty_tuple.type = converted %.loc12_22.1, %empty_tuple [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %empty_tuple.type.as.ImplicitAs.impl.Convert.call: init %X to %.loc12_3.1 = call %bound_method(%.loc12_22.2) +// CHECK:STDOUT: %.loc12_3.2: init %X = converted %.loc12_22.1, %empty_tuple.type.as.ImplicitAs.impl.Convert.call // CHECK:STDOUT: assign %x.var, %.loc12_3.2 // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %x: ref %X = ref_binding x, %x.var diff --git a/toolchain/check/testdata/basics/dump_sem_ir_ranges.carbon b/toolchain/check/testdata/basics/dump_sem_ir_ranges.carbon index cc5e9cf1a6f9..fd64c6ce4545 100644 --- a/toolchain/check/testdata/basics/dump_sem_ir_ranges.carbon +++ b/toolchain/check/testdata/basics/dump_sem_ir_ranges.carbon @@ -20,7 +20,7 @@ library "[[@TEST_NAME]]"; fn A() { - var a: (); + var unused a: (); } fn B() -> () { diff --git a/toolchain/check/testdata/basics/duplicate_name_same_line.carbon b/toolchain/check/testdata/basics/duplicate_name_same_line.carbon index 9a13cf3b1215..51baf68dec6b 100644 --- a/toolchain/check/testdata/basics/duplicate_name_same_line.carbon +++ b/toolchain/check/testdata/basics/duplicate_name_same_line.carbon @@ -15,7 +15,7 @@ fn A() { // This declares `n` in two different scopes, it's just showing the IR // behavior of having both on the same line. //@dump-sem-ir-begin - var n: (); } else { var n: (); + var unused n: (); } else { var unused n: (); //@dump-sem-ir-end } } @@ -39,33 +39,33 @@ fn A() { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %n.patt.loc18_9: %pattern_type.cb1 = ref_binding_pattern n [concrete] -// CHECK:STDOUT: %n.var_patt.loc18_5: %pattern_type.cb1 = var_pattern %n.patt.loc18_9 [concrete] +// CHECK:STDOUT: %n.patt.loc18_16: %pattern_type.cb1 = ref_binding_pattern n [concrete] +// CHECK:STDOUT: %n.var_patt.loc18_5: %pattern_type.cb1 = var_pattern %n.patt.loc18_16 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %n.var.loc18_5: ref %empty_tuple.type = var %n.var_patt.loc18_5 -// CHECK:STDOUT: %.loc18_13.1: type = splice_block %.loc18_13.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc18_13.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc18_13.3: type = converted %.loc18_13.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc18_20.1: type = splice_block %.loc18_20.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc18_20.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc18_20.3: type = converted %.loc18_20.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %n.loc18_9: ref %empty_tuple.type = ref_binding n, %n.var.loc18_5 +// CHECK:STDOUT: %n.loc18_16: ref %empty_tuple.type = ref_binding n, %n.var.loc18_5 // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %n.patt.loc18_29: %pattern_type.cb1 = ref_binding_pattern n [concrete] -// CHECK:STDOUT: %n.var_patt.loc18_25: %pattern_type.cb1 = var_pattern %n.patt.loc18_29 [concrete] +// CHECK:STDOUT: %n.patt.loc18_43: %pattern_type.cb1 = ref_binding_pattern n [concrete] +// CHECK:STDOUT: %n.var_patt.loc18_32: %pattern_type.cb1 = var_pattern %n.patt.loc18_43 [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %n.var.loc18_25: ref %empty_tuple.type = var %n.var_patt.loc18_25 -// CHECK:STDOUT: %.loc18_33.1: type = splice_block %.loc18_33.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc18_33.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc18_33.3: type = converted %.loc18_33.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %n.var.loc18_32: ref %empty_tuple.type = var %n.var_patt.loc18_32 +// CHECK:STDOUT: %.loc18_47.1: type = splice_block %.loc18_47.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc18_47.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc18_47.3: type = converted %.loc18_47.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %n.loc18_29: ref %empty_tuple.type = ref_binding n, %n.var.loc18_25 +// CHECK:STDOUT: %n.loc18_43: ref %empty_tuple.type = ref_binding n, %n.var.loc18_32 // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !if.done: -// CHECK:STDOUT: %DestroyOp.bound.loc18_25: = bound_method %n.var.loc18_25, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc18_25: init %empty_tuple.type = call %DestroyOp.bound.loc18_25(%n.var.loc18_25) +// CHECK:STDOUT: %DestroyOp.bound.loc18_32: = bound_method %n.var.loc18_32, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc18_32: init %empty_tuple.type = call %DestroyOp.bound.loc18_32(%n.var.loc18_32) // CHECK:STDOUT: %DestroyOp.bound.loc18_5: = bound_method %n.var.loc18_5, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call.loc18_5: init %empty_tuple.type = call %DestroyOp.bound.loc18_5(%n.var.loc18_5) // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/include_in_dumps.carbon b/toolchain/check/testdata/basics/include_in_dumps.carbon index b785d2af1122..ebba84036085 100644 --- a/toolchain/check/testdata/basics/include_in_dumps.carbon +++ b/toolchain/check/testdata/basics/include_in_dumps.carbon @@ -31,13 +31,13 @@ library "[[@TEST_NAME]]"; //@dump-sem-ir-begin interface I { - fn Op[self: Self](); + fn Op[unused self: Self](); } //@dump-sem-ir-end class C { impl C as I { - fn Op[self: Self]() {} + fn Op[unused self: Self]() {} } } @@ -61,13 +61,13 @@ library "[[@TEST_NAME]]"; //@dump-sem-ir-begin interface I { - fn Op[self: Self](); + fn Op[unused self: Self](); } //@dump-sem-ir-end class C { impl C as I { - fn Op[self: Self]() {} + fn Op[unused self: Self]() {} } } @@ -151,10 +151,10 @@ fn F(c: C) { c.(I.Op)(); } // CHECK:STDOUT: %self.param_patt: @I.WithSelf.Op.%pattern_type (%pattern_type.fa0) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @I.WithSelf.Op.%Self.binding.as_type (%Self.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc8_15.1: type = splice_block %.loc8_15.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] { +// CHECK:STDOUT: %.loc8_22.1: type = splice_block %.loc8_22.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] { // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self.loc7 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] -// CHECK:STDOUT: %.loc8_15.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] +// CHECK:STDOUT: %.loc8_22.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @I.WithSelf.Op.%Self.binding.as_type (%Self.binding.as_type) = value_binding self, %self.param // CHECK:STDOUT: } @@ -238,15 +238,15 @@ fn F(c: C) { c.(I.Op)(); } // CHECK:STDOUT: } // CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//included_with_range, loc16_1, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.743 = import_ref Main//included_with_range, inst{{[0-9A-F]+}} [no loc], unloaded -// CHECK:STDOUT: %Main.import_ref.d09: %I.assoc_type = import_ref Main//included_with_range, loc8_22, loaded [concrete = constants.%assoc0] +// CHECK:STDOUT: %Main.import_ref.d09: %I.assoc_type = import_ref Main//included_with_range, loc8_29, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %Main.Op = import_ref Main//included_with_range, Op, unloaded // CHECK:STDOUT: %Main.import_ref.2362f8.2: %I.type = import_ref Main//included_with_range, loc7_13, loaded [symbolic = constants.%Self] // CHECK:STDOUT: %Main.import_ref.c82 = import_ref Main//included_with_range, loc7_13, unloaded -// CHECK:STDOUT: %Main.import_ref.e26: @I.%I.WithSelf.Op.type (%I.WithSelf.Op.type.f73) = import_ref Main//included_with_range, loc8_22, loaded [symbolic = @I.%I.WithSelf.Op (constants.%I.WithSelf.Op.f53)] +// CHECK:STDOUT: %Main.import_ref.e26: @I.%I.WithSelf.Op.type (%I.WithSelf.Op.type.f73) = import_ref Main//included_with_range, loc8_29, loaded [symbolic = @I.%I.WithSelf.Op (constants.%I.WithSelf.Op.f53)] // CHECK:STDOUT: %Main.import_ref.f72: = import_ref Main//included_with_range, loc13_15, loaded [concrete = constants.%I.impl_witness] // CHECK:STDOUT: %Main.import_ref.61c: type = import_ref Main//included_with_range, loc13_8, loaded [concrete = constants.%C] // CHECK:STDOUT: %Main.import_ref.72a: type = import_ref Main//included_with_range, loc13_13, loaded [concrete = constants.%I.type] -// CHECK:STDOUT: %Main.import_ref.4bc: %C.as.I.impl.Op.type = import_ref Main//included_with_range, loc14_25, loaded [concrete = constants.%C.as.I.impl.Op] +// CHECK:STDOUT: %Main.import_ref.4bc: %C.as.I.impl.Op.type = import_ref Main//included_with_range, loc14_32, loaded [concrete = constants.%C.as.I.impl.Op] // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.4bc), @C.as.I.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -360,9 +360,9 @@ fn F(c: C) { c.(I.Op)(); } // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.import_ref.d09: %I.assoc_type = import_ref Main//excluded_with_range, loc6_22, loaded [concrete = constants.%assoc0] -// CHECK:STDOUT: %Main.import_ref.e26: @I.%I.WithSelf.Op.type (%I.WithSelf.Op.type.f73) = import_ref Main//excluded_with_range, loc6_22, loaded [symbolic = @I.%I.WithSelf.Op (constants.%I.WithSelf.Op.f53)] -// CHECK:STDOUT: %Main.import_ref.4bc: %C.as.I.impl.Op.type = import_ref Main//excluded_with_range, loc12_25, loaded [concrete = constants.%C.as.I.impl.Op] +// CHECK:STDOUT: %Main.import_ref.d09: %I.assoc_type = import_ref Main//excluded_with_range, loc6_29, loaded [concrete = constants.%assoc0] +// CHECK:STDOUT: %Main.import_ref.e26: @I.%I.WithSelf.Op.type (%I.WithSelf.Op.type.f73) = import_ref Main//excluded_with_range, loc6_29, loaded [symbolic = @I.%I.WithSelf.Op (constants.%I.WithSelf.Op.f53)] +// CHECK:STDOUT: %Main.import_ref.4bc: %C.as.I.impl.Op.type = import_ref Main//excluded_with_range, loc12_32, loaded [concrete = constants.%C.as.I.impl.Op] // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.4bc), @C.as.I.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon b/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon index b0c8b6f9266f..4048faa7aee6 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon @@ -66,10 +66,10 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: name_scope60000001: {inst: inst60000011, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name2: inst60000014, name3: inst6000002A, name4: inst6000004E}} // CHECK:STDOUT: name_scope60000002: {inst: inst60000014, parent_scope: name_scope60000001, has_error: false, extended_scopes: [], names: {}} // CHECK:STDOUT: entity_names: -// CHECK:STDOUT: entity_name60000000: {name: name1, parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name60000001: {name: name1, parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name60000002: {name: name1, parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name60000003: {name: name4, parent_scope: name_scope60000001, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name60000000: {name: name1, parent_scope: name_scope, index: -1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000001: {name: name1, parent_scope: name_scope, index: -1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000002: {name: name1, parent_scope: name_scope, index: -1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000003: {name: name4, parent_scope: name_scope60000001, index: -1, is_template: 0, is_unused: 0} // CHECK:STDOUT: cpp_global_vars: // CHECK:STDOUT: cpp_global_var60000000: {key: {entity_name_id: entity_name60000003}, clang_decl_id: clang_decl_id60000007} // CHECK:STDOUT: functions: diff --git a/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon b/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon index 625eeb19fef1..2fa3ece1df72 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon @@ -120,7 +120,7 @@ fn B() { // CHECK:STDOUT: name_scope0: {inst: instF, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name1: inst50000011, name0: inst50000012}} // CHECK:STDOUT: name_scope50000001: {inst: inst50000011, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name1: inst50000017}} // CHECK:STDOUT: entity_names: -// CHECK:STDOUT: entity_name50000000: {name: name1, parent_scope: name_scope50000001, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name50000000: {name: name1, parent_scope: name_scope50000001, index: -1, is_template: 0, is_unused: 0} // CHECK:STDOUT: cpp_global_vars: {} // CHECK:STDOUT: functions: // CHECK:STDOUT: function50000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty, body: [inst_block50000005]} diff --git a/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon b/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon index 5cb199be8526..5de105dd84d9 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon @@ -139,7 +139,7 @@ fn B() { // CHECK:STDOUT: name_scope0: {inst: instF, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name1: inst50000011, name0: inst50000012}} // CHECK:STDOUT: name_scope50000001: {inst: inst50000011, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name1: inst50000017}} // CHECK:STDOUT: entity_names: -// CHECK:STDOUT: entity_name50000000: {name: name1, parent_scope: name_scope50000001, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name50000000: {name: name1, parent_scope: name_scope50000001, index: -1, is_template: 0, is_unused: 0} // CHECK:STDOUT: cpp_global_vars: {} // CHECK:STDOUT: functions: // CHECK:STDOUT: function50000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty, body: [inst_block50000005]} diff --git a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon index fc9db378b7d0..c043cef98cac 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon @@ -270,70 +270,70 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: name_scope6000000C: {inst: inst600000D9, parent_scope: name_scope60000001, has_error: false, extended_scopes: [], names: {}} // CHECK:STDOUT: name_scope6000000D: {inst: inst6000011D, parent_scope: name_scope60000001, has_error: false, extended_scopes: [], names: {}} // CHECK:STDOUT: entity_names: -// CHECK:STDOUT: entity_name60000000: {name: name(PeriodSelf), parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name60000001: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000002: {name: name2, parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name60000003: {name: name3, parent_scope: name_scope60000001, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name60000004: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000005: {name: name4, parent_scope: name_scope60000003, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name60000006: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000007: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000008: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name60000009: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name6000000A: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name6000000B: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name6000000C: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name6000000D: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name6000000E: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name6000000F: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name60000010: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000011: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000012: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000013: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000014: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000015: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000016: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000017: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000018: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000019: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name6000001A: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name6000001B: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name6000001C: {name: name5, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name6000001D: {name: name5, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name6000001E: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name6000001F: {name: name5, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name60000020: {name: name5, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name60000021: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000022: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000023: {name: name5, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name60000024: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000025: {name: name5, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name60000026: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000027: {name: name5, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name60000028: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000029: {name: name5, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name6000002A: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name6000002B: {name: name6, parent_scope: name_scope, index: 2, is_template: 0} -// CHECK:STDOUT: entity_name6000002C: {name: name6, parent_scope: name_scope, index: 2, is_template: 0} -// CHECK:STDOUT: entity_name6000002D: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name6000002E: {name: name6, parent_scope: name_scope, index: 2, is_template: 0} -// CHECK:STDOUT: entity_name6000002F: {name: name6, parent_scope: name_scope, index: 2, is_template: 0} -// CHECK:STDOUT: entity_name60000030: {name: name5, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name60000031: {name: name5, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name60000032: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000033: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000034: {name: name6, parent_scope: name_scope, index: 2, is_template: 0} -// CHECK:STDOUT: entity_name60000035: {name: name5, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name60000036: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name60000037: {name: name6, parent_scope: name_scope, index: 2, is_template: 0} -// CHECK:STDOUT: entity_name60000038: {name: name5, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name60000039: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name6000003A: {name: name6, parent_scope: name_scope, index: 2, is_template: 0} -// CHECK:STDOUT: entity_name6000003B: {name: name5, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name6000003C: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name6000003D: {name: name6, parent_scope: name_scope, index: 2, is_template: 0} -// CHECK:STDOUT: entity_name6000003E: {name: name5, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name6000003F: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000000: {name: name(PeriodSelf), parent_scope: name_scope, index: -1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000001: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000002: {name: name2, parent_scope: name_scope, index: -1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000003: {name: name3, parent_scope: name_scope60000001, index: -1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000004: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000005: {name: name4, parent_scope: name_scope60000003, index: -1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000006: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000007: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000008: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000009: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000000A: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000000B: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000000C: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000000D: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000000E: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000000F: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000010: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000011: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000012: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000013: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000014: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000015: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000016: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000017: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000018: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000019: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000001A: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000001B: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000001C: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000001D: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000001E: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000001F: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000020: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000021: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000022: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000023: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000024: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000025: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000026: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000027: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000028: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000029: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000002A: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000002B: {name: name6, parent_scope: name_scope, index: 2, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000002C: {name: name6, parent_scope: name_scope, index: 2, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000002D: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000002E: {name: name6, parent_scope: name_scope, index: 2, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000002F: {name: name6, parent_scope: name_scope, index: 2, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000030: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000031: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000032: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000033: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000034: {name: name6, parent_scope: name_scope, index: 2, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000035: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000036: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000037: {name: name6, parent_scope: name_scope, index: 2, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000038: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name60000039: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000003A: {name: name6, parent_scope: name_scope, index: 2, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000003B: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000003C: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000003D: {name: name6, parent_scope: name_scope, index: 2, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000003E: {name: name5, parent_scope: name_scope, index: 1, is_template: 0, is_unused: 0} +// CHECK:STDOUT: entity_name6000003F: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0} // CHECK:STDOUT: cpp_global_vars: {} // CHECK:STDOUT: functions: // CHECK:STDOUT: function60000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block60000010, call_params_id: inst_block60000011, return_type_inst_id: inst6000002F, return_form_inst_id: inst60000031, return_patterns_id: inst_block6000000F, body: [inst_block60000018]} diff --git a/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon b/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon index 29c5c1e70d5c..5ec7b77647ba 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon @@ -31,7 +31,7 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: name_scopes: // CHECK:STDOUT: name_scope0: {inst: instF, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst6000002A}} // CHECK:STDOUT: entity_names: -// CHECK:STDOUT: entity_name60000000: {name: name1, parent_scope: name_scope, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name60000000: {name: name1, parent_scope: name_scope, index: -1, is_template: 0, is_unused: 0} // CHECK:STDOUT: cpp_global_vars: {} // CHECK:STDOUT: functions: // CHECK:STDOUT: function60000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block6000000B, call_params_id: inst_block6000000C, return_type_inst_id: inst60000020, return_form_inst_id: inst60000021, return_patterns_id: inst_block6000000A, body: [inst_block6000000F]} diff --git a/toolchain/check/testdata/builtins/float/negate.carbon b/toolchain/check/testdata/builtins/float/negate.carbon index 9e6000ae890b..62a5fa0ac056 100644 --- a/toolchain/check/testdata/builtins/float/negate.carbon +++ b/toolchain/check/testdata/builtins/float/negate.carbon @@ -16,7 +16,7 @@ library "[[@TEST_NAME]]"; fn Negate(a: f64) -> f64 = "float.negate"; -fn RuntimeCallIsValid(a: f64, b: f64) -> f64 { +fn RuntimeCallIsValid(a: f64, unused b: f64) -> f64 { //@dump-sem-ir-begin return Negate(a); //@dump-sem-ir-end diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index d847b945d82a..2570c6591cbd 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -21,7 +21,7 @@ let arr_p: array(i32, 123)* = &arr; let n: i32 = Negate(1); -fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { +fn RuntimeCallIsValid(a: i32, unused b: i32) -> i32 { //@dump-sem-ir-begin return Negate(a); //@dump-sem-ir-end diff --git a/toolchain/check/testdata/builtins/int/unegate.carbon b/toolchain/check/testdata/builtins/int/unegate.carbon index 0a66e47715d7..5b4b96e7db29 100644 --- a/toolchain/check/testdata/builtins/int/unegate.carbon +++ b/toolchain/check/testdata/builtins/int/unegate.carbon @@ -21,7 +21,7 @@ let arr_p: array(u32, 123)* = &arr; let n: u32 = Negate(1); -fn RuntimeCallIsValid(a: u32, b: u32) -> u32 { +fn RuntimeCallIsValid(a: u32, unused b: u32) -> u32 { //@dump-sem-ir-begin return Negate(a); //@dump-sem-ir-end diff --git a/toolchain/check/testdata/builtins/read/char.carbon b/toolchain/check/testdata/builtins/read/char.carbon index 78feed49541e..f0800716c9d6 100644 --- a/toolchain/check/testdata/builtins/read/char.carbon +++ b/toolchain/check/testdata/builtins/read/char.carbon @@ -18,8 +18,8 @@ fn ReadChar() -> i32 = "read.char"; fn Main() { //@dump-sem-ir-begin - let n: i32 = ReadChar(); - let m: i32 = Core.ReadChar(); + let unused n: i32 = ReadChar(); + let unused m: i32 = Core.ReadChar(); //@dump-sem-ir-end } @@ -56,26 +56,26 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %ReadChar.ref.loc8: %ReadChar.type.c36 = name_ref ReadChar, file.%ReadChar.decl [concrete = constants.%ReadChar.6ad] // CHECK:STDOUT: %ReadChar.call.loc8: init %i32 = call %ReadChar.ref.loc8() -// CHECK:STDOUT: %.loc8_10: type = splice_block %i32.loc8 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc8_17: type = splice_block %i32.loc8 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_25.1: %i32 = value_of_initializer %ReadChar.call.loc8 -// CHECK:STDOUT: %.loc8_25.2: %i32 = converted %ReadChar.call.loc8, %.loc8_25.1 -// CHECK:STDOUT: %n: %i32 = value_binding n, %.loc8_25.2 +// CHECK:STDOUT: %.loc8_32.1: %i32 = value_of_initializer %ReadChar.call.loc8 +// CHECK:STDOUT: %.loc8_32.2: %i32 = converted %ReadChar.call.loc8, %.loc8_32.1 +// CHECK:STDOUT: %n: %i32 = value_binding n, %.loc8_32.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %m.patt: %pattern_type.7ce = value_binding_pattern m [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %ReadChar.ref.loc9: %ReadChar.type.9f3 = name_ref ReadChar, imports.%Core.ReadChar [concrete = constants.%ReadChar.01f] // CHECK:STDOUT: %ReadChar.call.loc9: init %i32 = call %ReadChar.ref.loc9() -// CHECK:STDOUT: %.loc9_10: type = splice_block %i32.loc9 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc9_17: type = splice_block %i32.loc9 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc9_30.1: %i32 = value_of_initializer %ReadChar.call.loc9 -// CHECK:STDOUT: %.loc9_30.2: %i32 = converted %ReadChar.call.loc9, %.loc9_30.1 -// CHECK:STDOUT: %m: %i32 = value_binding m, %.loc9_30.2 +// CHECK:STDOUT: %.loc9_37.1: %i32 = value_of_initializer %ReadChar.call.loc9 +// CHECK:STDOUT: %.loc9_37.2: %i32 = converted %ReadChar.call.loc9, %.loc9_37.1 +// CHECK:STDOUT: %m: %i32 = value_binding m, %.loc9_37.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/type/and.carbon b/toolchain/check/testdata/builtins/type/and.carbon index 7ede9a17735b..e2016c2570d4 100644 --- a/toolchain/check/testdata/builtins/type/and.carbon +++ b/toolchain/check/testdata/builtins/type/and.carbon @@ -19,7 +19,7 @@ fn TypeAnd(a: type, b: type) -> type = "type.and"; interface I {} interface J {} -fn TakeIJ(T:! TypeAnd(I, J)) {} +fn TakeIJ(unused T:! TypeAnd(I, J)) {} class IJ { impl as I {} @@ -39,7 +39,7 @@ fn TypeAnd(a: type, b: type) -> type = "type.and"; interface I {} interface J {} -fn TakeIJ(T:! TypeAnd(I, J)) {} +fn TakeIJ(unused T:! TypeAnd(I, J)) {} class JustI { impl as I {} @@ -53,17 +53,17 @@ fn Call() { // CHECK:STDERR: fail_combine_facets_bad_call.carbon:[[@LINE+7]]:3: error: cannot convert type `JustI` into type implementing `I & J` [ConversionFailureTypeToFacet] // CHECK:STDERR: TakeIJ(JustI); // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_combine_facets_bad_call.carbon:[[@LINE-14]]:11: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn TakeIJ(T:! TypeAnd(I, J)) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_combine_facets_bad_call.carbon:[[@LINE-14]]:18: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn TakeIJ(unused T:! TypeAnd(I, J)) {} + // CHECK:STDERR: ^ // CHECK:STDERR: TakeIJ(JustI); // CHECK:STDERR: fail_combine_facets_bad_call.carbon:[[@LINE+7]]:3: error: cannot convert type `JustJ` into type implementing `I & J` [ConversionFailureTypeToFacet] // CHECK:STDERR: TakeIJ(JustJ); // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_combine_facets_bad_call.carbon:[[@LINE-22]]:11: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn TakeIJ(T:! TypeAnd(I, J)) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_combine_facets_bad_call.carbon:[[@LINE-22]]:18: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn TakeIJ(unused T:! TypeAnd(I, J)) {} + // CHECK:STDERR: ^ // CHECK:STDERR: TakeIJ(JustJ); } diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index d09fd4766be4..3a5c464d2f90 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -31,14 +31,14 @@ class Circle { fn Run() { let circle: Circle = Circle.Make(); - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:21: error: cannot access private member `radius` of type `Circle` [ClassInvalidMemberAccess] - // CHECK:STDERR: let radius: i32 = circle.radius; - // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:28: error: cannot access private member `radius` of type `Circle` [ClassInvalidMemberAccess] + // CHECK:STDERR: let unused radius: i32 = circle.radius; + // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-17]]:15: note: declared here [ClassMemberDeclaration] // CHECK:STDERR: private var radius: i32; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: - let radius: i32 = circle.radius; + let unused radius: i32 = circle.radius; // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:3: error: cannot access private member `radius` of type `Circle` [ClassInvalidMemberAccess] // CHECK:STDERR: circle.radius = 5; // CHECK:STDERR: ^~~~~~~~~~~~~ @@ -75,14 +75,14 @@ class A { } fn Run() { - // CHECK:STDERR: fail_protected_field_access.carbon:[[@LINE+7]]:16: error: cannot access protected member `x` of type `A` [ClassInvalidMemberAccess] - // CHECK:STDERR: let x: i32 = A.x; - // CHECK:STDERR: ^~~ + // CHECK:STDERR: fail_protected_field_access.carbon:[[@LINE+7]]:23: error: cannot access protected member `x` of type `A` [ClassInvalidMemberAccess] + // CHECK:STDERR: let unused x: i32 = A.x; + // CHECK:STDERR: ^~~ // CHECK:STDERR: fail_protected_field_access.carbon:[[@LINE-7]]:17: note: declared here [ClassMemberDeclaration] // CHECK:STDERR: protected var x: i32; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: - let x: i32 = A.x; + let unused x: i32 = A.x; } // --- instance_private_field_access_on_self.carbon diff --git a/toolchain/check/testdata/class/adapter/convert_incomplete.carbon b/toolchain/check/testdata/class/adapter/convert_incomplete.carbon index 13732c653e26..4da9f1721810 100644 --- a/toolchain/check/testdata/class/adapter/convert_incomplete.carbon +++ b/toolchain/check/testdata/class/adapter/convert_incomplete.carbon @@ -24,7 +24,7 @@ class X {} var x: Adapter(X); fn F(p: Adapter(X)*) { - let x: X* = *p as X*; + let unused x: X* = *p as X*; } // --- can_be_completed.carbon @@ -40,7 +40,7 @@ class X {} fn F(p: Adapter(X)*) { // The conversion here triggers completion of Adapter(X) // so we can determine what it adapts. - let x: X* = *p as X*; + let unused x: X* = *p as X*; } // --- fail_incomplete.carbon @@ -52,12 +52,12 @@ class Adapter(T:! type); class X {} fn F(p: Adapter(X)*) { - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:15: error: cannot convert expression of type `Adapter(X)` to `X*` with `as` [ConversionFailure] - // CHECK:STDERR: let x: X* = *p as X*; - // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:15: note: type `Adapter(X)` does not implement interface `Core.As(X*)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let x: X* = *p as X*; - // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:22: error: cannot convert expression of type `Adapter(X)` to `X*` with `as` [ConversionFailure] + // CHECK:STDERR: let unused x: X* = *p as X*; + // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:22: note: type `Adapter(X)` does not implement interface `Core.As(X*)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused x: X* = *p as X*; + // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: - let x: X* = *p as X*; + let unused x: X* = *p as X*; } diff --git a/toolchain/check/testdata/class/derived_to_base.carbon b/toolchain/check/testdata/class/derived_to_base.carbon index 1778c5ad08a4..e56daf0ec5aa 100644 --- a/toolchain/check/testdata/class/derived_to_base.carbon +++ b/toolchain/check/testdata/class/derived_to_base.carbon @@ -34,7 +34,7 @@ fn ConvertBToA(p: B*) -> A* { return p; } fn ConvertCToA(p: C*) -> A* { return p; } fn ConvertValue(c: C) { - let a: A = c; + let unused a: A = c; } fn ConvertRef(c: C*) -> A* { @@ -42,7 +42,7 @@ fn ConvertRef(c: C*) -> A* { } fn ConvertInit() { - let a: A = {.base = {.base = {.a = 1}, .b = 2}, .c = 3} as C; + let unused a: A = {.base = {.base = {.a = 1}, .b = 2}, .c = 3} as C; } //@dump-sem-ir-end @@ -345,11 +345,11 @@ fn PassConstB(p: const B) { // CHECK:STDOUT: } // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A] -// CHECK:STDOUT: %.loc24_14.1: ref %B = class_element_access %c.ref, element0 -// CHECK:STDOUT: %.loc24_14.2: ref %A = class_element_access %.loc24_14.1, element0 -// CHECK:STDOUT: %.loc24_14.3: ref %A = converted %c.ref, %.loc24_14.2 -// CHECK:STDOUT: %.loc24_14.4: %A = acquire_value %.loc24_14.3 -// CHECK:STDOUT: %a: %A = value_binding a, %.loc24_14.4 +// CHECK:STDOUT: %.loc24_21.1: ref %B = class_element_access %c.ref, element0 +// CHECK:STDOUT: %.loc24_21.2: ref %A = class_element_access %.loc24_21.1, element0 +// CHECK:STDOUT: %.loc24_21.3: ref %A = converted %c.ref, %.loc24_21.2 +// CHECK:STDOUT: %.loc24_21.4: %A = acquire_value %.loc24_21.3 +// CHECK:STDOUT: %a: %A = value_binding a, %.loc24_21.4 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -376,54 +376,54 @@ fn PassConstB(p: const B) { // CHECK:STDOUT: %a.patt: %pattern_type.1ab = value_binding_pattern a [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc32_39.1: %struct_type.a.a6c = struct_literal (%int_1) [concrete = constants.%struct.48c] +// CHECK:STDOUT: %.loc32_46.1: %struct_type.a.a6c = struct_literal (%int_1) [concrete = constants.%struct.48c] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc32_48.1: %struct_type.base.b.bf0 = struct_literal (%.loc32_39.1, %int_2) [concrete = constants.%struct.ff9] +// CHECK:STDOUT: %.loc32_55.1: %struct_type.base.b.bf0 = struct_literal (%.loc32_46.1, %int_2) [concrete = constants.%struct.ff9] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] -// CHECK:STDOUT: %.loc32_57.1: %struct_type.base.c.136 = struct_literal (%.loc32_48.1, %int_3) [concrete = constants.%struct.2aa] +// CHECK:STDOUT: %.loc32_64.1: %struct_type.base.c.136 = struct_literal (%.loc32_55.1, %int_3) [concrete = constants.%struct.2aa] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %impl.elem0.loc32_39: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc32_39.1: = bound_method %int_1, %impl.elem0.loc32_39 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] -// CHECK:STDOUT: %specific_fn.loc32_39: = specific_function %impl.elem0.loc32_39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc32_39.2: = bound_method %int_1, %specific_fn.loc32_39 [concrete = constants.%bound_method.38b] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_39: init %i32 = call %bound_method.loc32_39.2(%int_1) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc32_39.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_39 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc32_57.2: ref %C = temporary_storage -// CHECK:STDOUT: %.loc32_57.3: ref %B = class_element_access %.loc32_57.2, element0 -// CHECK:STDOUT: %.loc32_48.2: ref %A = class_element_access %.loc32_57.3, element0 -// CHECK:STDOUT: %.loc32_39.3: ref %i32 = class_element_access %.loc32_48.2, element0 -// CHECK:STDOUT: %.loc32_39.4: init %i32 to %.loc32_39.3 = in_place_init %.loc32_39.2 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc32_39.5: init %A to %.loc32_48.2 = class_init (%.loc32_39.4) [concrete = constants.%A.val] -// CHECK:STDOUT: %.loc32_48.3: init %A = converted %.loc32_39.1, %.loc32_39.5 [concrete = constants.%A.val] -// CHECK:STDOUT: %impl.elem0.loc32_48: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc32_48.1: = bound_method %int_2, %impl.elem0.loc32_48 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] -// CHECK:STDOUT: %specific_fn.loc32_48: = specific_function %impl.elem0.loc32_48, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc32_48.2: = bound_method %int_2, %specific_fn.loc32_48 [concrete = constants.%bound_method.646] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_48: init %i32 = call %bound_method.loc32_48.2(%int_2) [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc32_48.4: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_48 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc32_48.5: ref %i32 = class_element_access %.loc32_57.3, element1 -// CHECK:STDOUT: %.loc32_48.6: init %i32 to %.loc32_48.5 = in_place_init %.loc32_48.4 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc32_48.7: init %B to %.loc32_57.3 = class_init (%.loc32_48.3, %.loc32_48.6) [concrete = constants.%B.val] -// CHECK:STDOUT: %.loc32_57.4: init %B = converted %.loc32_48.1, %.loc32_48.7 [concrete = constants.%B.val] -// CHECK:STDOUT: %impl.elem0.loc32_57: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc32_57.1: = bound_method %int_3, %impl.elem0.loc32_57 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] -// CHECK:STDOUT: %specific_fn.loc32_57: = specific_function %impl.elem0.loc32_57, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc32_57.2: = bound_method %int_3, %specific_fn.loc32_57 [concrete = constants.%bound_method.fa7] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_57: init %i32 = call %bound_method.loc32_57.2(%int_3) [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc32_57.5: init %i32 = converted %int_3, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_57 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc32_57.6: ref %i32 = class_element_access %.loc32_57.2, element1 -// CHECK:STDOUT: %.loc32_57.7: init %i32 to %.loc32_57.6 = in_place_init %.loc32_57.5 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc32_57.8: init %C to %.loc32_57.2 = class_init (%.loc32_57.4, %.loc32_57.7) [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc32_57.9: ref %C = temporary %.loc32_57.2, %.loc32_57.8 -// CHECK:STDOUT: %.loc32_59.1: ref %C = converted %.loc32_57.1, %.loc32_57.9 +// CHECK:STDOUT: %impl.elem0.loc32_46: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc32_46.1: = bound_method %int_1, %impl.elem0.loc32_46 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] +// CHECK:STDOUT: %specific_fn.loc32_46: = specific_function %impl.elem0.loc32_46, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc32_46.2: = bound_method %int_1, %specific_fn.loc32_46 [concrete = constants.%bound_method.38b] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_46: init %i32 = call %bound_method.loc32_46.2(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc32_46.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_46 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc32_64.2: ref %C = temporary_storage +// CHECK:STDOUT: %.loc32_64.3: ref %B = class_element_access %.loc32_64.2, element0 +// CHECK:STDOUT: %.loc32_55.2: ref %A = class_element_access %.loc32_64.3, element0 +// CHECK:STDOUT: %.loc32_46.3: ref %i32 = class_element_access %.loc32_55.2, element0 +// CHECK:STDOUT: %.loc32_46.4: init %i32 to %.loc32_46.3 = in_place_init %.loc32_46.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc32_46.5: init %A to %.loc32_55.2 = class_init (%.loc32_46.4) [concrete = constants.%A.val] +// CHECK:STDOUT: %.loc32_55.3: init %A = converted %.loc32_46.1, %.loc32_46.5 [concrete = constants.%A.val] +// CHECK:STDOUT: %impl.elem0.loc32_55: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc32_55.1: = bound_method %int_2, %impl.elem0.loc32_55 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] +// CHECK:STDOUT: %specific_fn.loc32_55: = specific_function %impl.elem0.loc32_55, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc32_55.2: = bound_method %int_2, %specific_fn.loc32_55 [concrete = constants.%bound_method.646] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_55: init %i32 = call %bound_method.loc32_55.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc32_55.4: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_55 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc32_55.5: ref %i32 = class_element_access %.loc32_64.3, element1 +// CHECK:STDOUT: %.loc32_55.6: init %i32 to %.loc32_55.5 = in_place_init %.loc32_55.4 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc32_55.7: init %B to %.loc32_64.3 = class_init (%.loc32_55.3, %.loc32_55.6) [concrete = constants.%B.val] +// CHECK:STDOUT: %.loc32_64.4: init %B = converted %.loc32_55.1, %.loc32_55.7 [concrete = constants.%B.val] +// CHECK:STDOUT: %impl.elem0.loc32_64: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc32_64.1: = bound_method %int_3, %impl.elem0.loc32_64 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] +// CHECK:STDOUT: %specific_fn.loc32_64: = specific_function %impl.elem0.loc32_64, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc32_64.2: = bound_method %int_3, %specific_fn.loc32_64 [concrete = constants.%bound_method.fa7] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_64: init %i32 = call %bound_method.loc32_64.2(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc32_64.5: init %i32 = converted %int_3, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_64 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc32_64.6: ref %i32 = class_element_access %.loc32_64.2, element1 +// CHECK:STDOUT: %.loc32_64.7: init %i32 to %.loc32_64.6 = in_place_init %.loc32_64.5 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc32_64.8: init %C to %.loc32_64.2 = class_init (%.loc32_64.4, %.loc32_64.7) [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc32_64.9: ref %C = temporary %.loc32_64.2, %.loc32_64.8 +// CHECK:STDOUT: %.loc32_66.1: ref %C = converted %.loc32_64.1, %.loc32_64.9 // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A] -// CHECK:STDOUT: %.loc32_59.2: ref %B = class_element_access %.loc32_59.1, element0 -// CHECK:STDOUT: %.loc32_59.3: ref %A = class_element_access %.loc32_59.2, element0 -// CHECK:STDOUT: %.loc32_59.4: ref %A = converted %.loc32_59.1, %.loc32_59.3 -// CHECK:STDOUT: %.loc32_59.5: %A = acquire_value %.loc32_59.4 -// CHECK:STDOUT: %a: %A = value_binding a, %.loc32_59.5 -// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc32_57.9, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc32_57.9) +// CHECK:STDOUT: %.loc32_66.2: ref %B = class_element_access %.loc32_66.1, element0 +// CHECK:STDOUT: %.loc32_66.3: ref %A = class_element_access %.loc32_66.2, element0 +// CHECK:STDOUT: %.loc32_66.4: ref %A = converted %.loc32_66.1, %.loc32_66.3 +// CHECK:STDOUT: %.loc32_66.5: %A = acquire_value %.loc32_66.4 +// CHECK:STDOUT: %a: %A = value_binding a, %.loc32_66.5 +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc32_64.9, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc32_64.9) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/destroy_calls.carbon b/toolchain/check/testdata/class/destroy_calls.carbon index 13e8c2a39613..6d13272499e6 100644 --- a/toolchain/check/testdata/class/destroy_calls.carbon +++ b/toolchain/check/testdata/class/destroy_calls.carbon @@ -20,9 +20,9 @@ class C {} //@dump-sem-ir-begin fn F() { - var a: A; - var b: B; - var c: C; + var unused a: A; + var unused b: B; + var unused c: C; } //@dump-sem-ir-end @@ -36,10 +36,10 @@ class C {} //@dump-sem-ir-begin fn F() { - var a: A; - var b: B; + var unused a: A; + var unused b: B; if (true) { - var c: C; + var unused c: C; } } //@dump-sem-ir-end @@ -71,7 +71,7 @@ class D(template T:! type) {} //@dump-sem-ir-begin fn F() { - var a: D(C); + var unused a: D(C); } //@dump-sem-ir-end @@ -82,7 +82,7 @@ class C(template T:! type) {} //@dump-sem-ir-begin fn F(template T:! type) { - var v: C(T); + var unused v: C(T); } //@dump-sem-ir-end @@ -378,11 +378,11 @@ fn G() { F({}); } // CHECK:STDOUT: %T.loc6_15.1: type = symbolic_binding T, 0, template [template = %T.loc6_15.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %C.loc7_13.2: type = class_type @C, @C(%T.loc6_15.1) [template = %C.loc7_13.2 (constants.%C.5a3)] -// CHECK:STDOUT: %require_complete: = require_complete_type %C.loc7_13.2 [template = %require_complete (constants.%require_complete)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %C.loc7_13.2 [template = %pattern_type (constants.%pattern_type.3d5)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %C.loc7_13.2, @Destroy [template = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %C.loc7_13.2, (%Destroy.lookup_impl_witness) [template = %Destroy.facet (constants.%Destroy.facet.472)] +// CHECK:STDOUT: %C.loc7_20.2: type = class_type @C, @C(%T.loc6_15.1) [template = %C.loc7_20.2 (constants.%C.5a3)] +// CHECK:STDOUT: %require_complete: = require_complete_type %C.loc7_20.2 [template = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %C.loc7_20.2 [template = %pattern_type (constants.%pattern_type.3d5)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %C.loc7_20.2, @Destroy [template = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %C.loc7_20.2, (%Destroy.lookup_impl_witness) [template = %Destroy.facet (constants.%Destroy.facet.472)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy(%Destroy.facet) [template = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.7d1)] // CHECK:STDOUT: %.loc7_3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [template = %.loc7_3 (constants.%.306)] // CHECK:STDOUT: %impl.elem0.loc7_3.2: @F.%.loc7_3 (%.306) = impl_witness_access %Destroy.lookup_impl_witness, element0 [template = %impl.elem0.loc7_3.2 (constants.%impl.elem0)] @@ -394,13 +394,13 @@ fn G() { F({}); } // CHECK:STDOUT: %v.patt: @F.%pattern_type (%pattern_type.3d5) = ref_binding_pattern v [concrete] // CHECK:STDOUT: %v.var_patt: @F.%pattern_type (%pattern_type.3d5) = var_pattern %v.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %v.var: ref @F.%C.loc7_13.2 (%C.5a3) = var %v.var_patt -// CHECK:STDOUT: %.loc7_13: type = splice_block %C.loc7_13.1 [template = %C.loc7_13.2 (constants.%C.5a3)] { +// CHECK:STDOUT: %v.var: ref @F.%C.loc7_20.2 (%C.5a3) = var %v.var_patt +// CHECK:STDOUT: %.loc7_20: type = splice_block %C.loc7_20.1 [template = %C.loc7_20.2 (constants.%C.5a3)] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_15.2 [template = %T.loc6_15.1 (constants.%T)] -// CHECK:STDOUT: %C.loc7_13.1: type = class_type @C, @C(constants.%T) [template = %C.loc7_13.2 (constants.%C.5a3)] +// CHECK:STDOUT: %C.loc7_20.1: type = class_type @C, @C(constants.%T) [template = %C.loc7_20.2 (constants.%C.5a3)] // CHECK:STDOUT: } -// CHECK:STDOUT: %v: ref @F.%C.loc7_13.2 (%C.5a3) = ref_binding v, %v.var +// CHECK:STDOUT: %v: ref @F.%C.loc7_20.2 (%C.5a3) = ref_binding v, %v.var // CHECK:STDOUT: %impl.elem0.loc7_3.1: @F.%.loc7_3 (%.306) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [template = %impl.elem0.loc7_3.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %v.var, %impl.elem0.loc7_3.1 // CHECK:STDOUT: %specific_impl_fn.loc7_3.1: = specific_impl_function %impl.elem0.loc7_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.472) [template = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn)] @@ -420,7 +420,7 @@ fn G() { F({}); } // CHECK:STDOUT: %T.loc6_15.1 => constants.%empty_struct_type // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %C.loc7_13.2 => constants.%C.850 +// CHECK:STDOUT: %C.loc7_20.2 => constants.%C.850 // CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.526 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.809 diff --git a/toolchain/check/testdata/class/fail_abstract.carbon b/toolchain/check/testdata/class/fail_abstract.carbon index 279fd6157e06..c42a11e91aca 100644 --- a/toolchain/check/testdata/class/fail_abstract.carbon +++ b/toolchain/check/testdata/class/fail_abstract.carbon @@ -36,14 +36,14 @@ abstract class Abstract { } fn Var() { - // CHECK:STDERR: fail_abstract_var.carbon:[[@LINE+7]]:10: error: binding pattern has abstract type `Abstract` in `var` pattern [AbstractTypeInVarPattern] - // CHECK:STDERR: var v: Abstract; - // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: fail_abstract_var.carbon:[[@LINE+7]]:17: error: binding pattern has abstract type `Abstract` in `var` pattern [AbstractTypeInVarPattern] + // CHECK:STDERR: var unused v: Abstract; + // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_abstract_var.carbon:[[@LINE-7]]:1: note: class was declared abstract here [ClassAbstractHere] // CHECK:STDERR: abstract class Abstract { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var v: Abstract; + var unused v: Abstract; } // --- fail_abstract_var_function_param.carbon @@ -53,13 +53,13 @@ abstract class Abstract { } // CHECK:STDERR: fail_abstract_var_function_param.carbon:[[@LINE+7]]:13: error: binding pattern has abstract type `Abstract` in `var` pattern [AbstractTypeInVarPattern] -// CHECK:STDERR: fn F(var p: Abstract) { +// CHECK:STDERR: fn F(var _: Abstract) { // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_abstract_var_function_param.carbon:[[@LINE-6]]:1: note: class was declared abstract here [ClassAbstractHere] // CHECK:STDERR: abstract class Abstract { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(var p: Abstract) { +fn F(var _: Abstract) { } // --- fail_todo_abstract_let.carbon @@ -69,14 +69,14 @@ abstract class Abstract { } fn F(a: Abstract) { - // CHECK:STDERR: fail_todo_abstract_let.carbon:[[@LINE+7]]:21: error: initialization of abstract type `Abstract` [AbstractTypeInInit] - // CHECK:STDERR: let l: Abstract = a; - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_todo_abstract_let.carbon:[[@LINE+7]]:28: error: initialization of abstract type `Abstract` [AbstractTypeInInit] + // CHECK:STDERR: let unused l: Abstract = a; + // CHECK:STDERR: ^ // CHECK:STDERR: fail_todo_abstract_let.carbon:[[@LINE-7]]:1: note: class was declared abstract here [ClassAbstractHere] // CHECK:STDERR: abstract class Abstract { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let l: Abstract = a; + let unused l: Abstract = a; } // --- fail_abstract_adapter.carbon @@ -197,18 +197,14 @@ abstract class Abstract { } fn F() { - // An abstract value of a class type that has a pointer value representation - // is allowed, but it has to be initialized from some a value of some concrete - // class type. - // - // CHECK:STDERR: fail_abstract_let_temporary_struct_literal.carbon:[[@LINE+7]]:21: error: initialization of abstract type `Abstract` [AbstractTypeInInit] - // CHECK:STDERR: let l: Abstract = {}; - // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_abstract_let_temporary_struct_literal.carbon:[[@LINE-11]]:1: note: class was declared abstract here [ClassAbstractHere] + // CHECK:STDERR: fail_abstract_let_temporary_struct_literal.carbon:[[@LINE+7]]:28: error: initialization of abstract type `Abstract` [AbstractTypeInInit] + // CHECK:STDERR: let unused l: Abstract = {}; + // CHECK:STDERR: ^~ + // CHECK:STDERR: fail_abstract_let_temporary_struct_literal.carbon:[[@LINE-7]]:1: note: class was declared abstract here [ClassAbstractHere] // CHECK:STDERR: abstract class Abstract { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let l: Abstract = {}; + let unused l: Abstract = {}; } // --- fail_todo_abstract_let_temporary.carbon @@ -226,21 +222,21 @@ fn F() { // to the `Abstract` value since `Abstract` and `Derived` have pointer value // representations. // - // CHECK:STDERR: fail_todo_abstract_let_temporary.carbon:[[@LINE+14]]:21: error: initialization of abstract type `Abstract` [AbstractTypeInInit] - // CHECK:STDERR: let l: Abstract = {.base = {}} as Derived; - // CHECK:STDERR: ^~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_abstract_let_temporary.carbon:[[@LINE+14]]:28: error: initialization of abstract type `Abstract` [AbstractTypeInInit] + // CHECK:STDERR: let unused l: Abstract = {.base = {}} as Derived; + // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fail_todo_abstract_let_temporary.carbon:[[@LINE-15]]:1: note: class was declared abstract here [ClassAbstractHere] // CHECK:STDERR: abstract class Abstract { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_todo_abstract_let_temporary.carbon:[[@LINE+7]]:21: error: initialization of abstract type `Abstract` [AbstractTypeInInit] - // CHECK:STDERR: let l: Abstract = {.base = {}} as Derived; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_abstract_let_temporary.carbon:[[@LINE+7]]:28: error: initialization of abstract type `Abstract` [AbstractTypeInInit] + // CHECK:STDERR: let unused l: Abstract = {.base = {}} as Derived; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_abstract_let_temporary.carbon:[[@LINE-22]]:1: note: class was declared abstract here [ClassAbstractHere] // CHECK:STDERR: abstract class Abstract { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let l: Abstract = {.base = {}} as Derived; + let unused l: Abstract = {.base = {}} as Derived; } // --- fail_call_abstract_return.carbon @@ -389,13 +385,13 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [concrete = constants.%Abstract] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { -// CHECK:STDOUT: %p.patt: = ref_binding_pattern p [concrete] -// CHECK:STDOUT: %p.param_patt: = var_param_pattern %p.patt, call_param0 [concrete] -// CHECK:STDOUT: %p.var_patt: = var_pattern %p.param_patt [concrete] +// CHECK:STDOUT: %_.patt: = ref_binding_pattern _ [concrete] +// CHECK:STDOUT: %_.param_patt: = var_param_pattern %_.patt, call_param0 [concrete] +// CHECK:STDOUT: %_.var_patt: = var_pattern %_.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %p.param: ref = ref_param call_param0 +// CHECK:STDOUT: %_.param: ref = ref_param call_param0 // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [concrete = constants.%Abstract] -// CHECK:STDOUT: %p: ref = ref_binding p, %p.param +// CHECK:STDOUT: %_: ref = ref_binding _, %_.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -407,7 +403,7 @@ fn CallReturnAbstract() { // CHECK:STDOUT: .Self = constants.%Abstract // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%p.param: ref ) { +// CHECK:STDOUT: fn @F(%_.param: ref ) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -878,7 +874,7 @@ fn CallReturnAbstract() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %l.patt: %pattern_type = value_binding_pattern l [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc18: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc14: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [concrete = constants.%Abstract] // CHECK:STDOUT: %l: %Abstract = value_binding l, [concrete = ] // CHECK:STDOUT: return @@ -954,16 +950,16 @@ fn CallReturnAbstract() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %l.patt: %pattern_type.a2e = value_binding_pattern l [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc29_31: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc29_32.1: %struct_type.base.f5e = struct_literal (%.loc29_31) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc29_38: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc29_39.1: %struct_type.base.f5e = struct_literal (%.loc29_38) [concrete = constants.%struct] // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived] -// CHECK:STDOUT: %.loc29_32.2: ref %Derived = temporary_storage -// CHECK:STDOUT: %.loc29_32.3: ref %Derived = temporary %.loc29_32.2, -// CHECK:STDOUT: %.loc29_34: ref %Derived = converted %.loc29_32.1, %.loc29_32.3 +// CHECK:STDOUT: %.loc29_39.2: ref %Derived = temporary_storage +// CHECK:STDOUT: %.loc29_39.3: ref %Derived = temporary %.loc29_39.2, +// CHECK:STDOUT: %.loc29_41: ref %Derived = converted %.loc29_39.1, %.loc29_39.3 // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [concrete = constants.%Abstract] // CHECK:STDOUT: %l: %Abstract = value_binding l, [concrete = ] -// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc29_32.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc29_32.3) +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc29_39.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc29_39.3) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_abstract_in_struct.carbon b/toolchain/check/testdata/class/fail_abstract_in_struct.carbon index 8311c0bf2fa7..70490fa306fd 100644 --- a/toolchain/check/testdata/class/fail_abstract_in_struct.carbon +++ b/toolchain/check/testdata/class/fail_abstract_in_struct.carbon @@ -49,14 +49,14 @@ abstract class Abstract3 { } fn F(a: Abstract3) { - // CHECK:STDERR: fail_todo_abstract_let.carbon:[[@LINE+7]]:29: error: initialization of abstract type `{.m3: Abstract3}` [AbstractTypeInInit] - // CHECK:STDERR: let l: {.m3: Abstract3} = {.m3 = a}; - // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: fail_todo_abstract_let.carbon:[[@LINE+7]]:36: error: initialization of abstract type `{.m3: Abstract3}` [AbstractTypeInInit] + // CHECK:STDERR: let unused l: {.m3: Abstract3} = {.m3 = a}; + // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_todo_abstract_let.carbon:[[@LINE-7]]:1: note: uses class that was declared abstract here [ClassAbstractHere] // CHECK:STDERR: abstract class Abstract3 { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let l: {.m3: Abstract3} = {.m3 = a}; + let unused l: {.m3: Abstract3} = {.m3 = a}; } // --- fail_abstract_twice.carbon @@ -240,8 +240,8 @@ var v5: {.m: Abstract}; // CHECK:STDOUT: %l.patt: %pattern_type.816 = value_binding_pattern l [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.ref: %Abstract3 = name_ref a, %a -// CHECK:STDOUT: %.loc14_37: %struct_type.m3.b1b = struct_literal (%a.ref) -// CHECK:STDOUT: %.loc14_25: type = splice_block %struct_type.m3 [concrete = constants.%struct_type.m3.b1b] { +// CHECK:STDOUT: %.loc14_44: %struct_type.m3.b1b = struct_literal (%a.ref) +// CHECK:STDOUT: %.loc14_32: type = splice_block %struct_type.m3 [concrete = constants.%struct_type.m3.b1b] { // CHECK:STDOUT: %Abstract3.ref.loc14: type = name_ref Abstract3, file.%Abstract3.decl [concrete = constants.%Abstract3] // CHECK:STDOUT: %struct_type.m3: type = struct_type {.m3: %Abstract3} [concrete = constants.%struct_type.m3.b1b] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_abstract_in_tuple.carbon b/toolchain/check/testdata/class/fail_abstract_in_tuple.carbon index 8c6770907b5c..da0110d51327 100644 --- a/toolchain/check/testdata/class/fail_abstract_in_tuple.carbon +++ b/toolchain/check/testdata/class/fail_abstract_in_tuple.carbon @@ -34,14 +34,14 @@ library "[[@TEST_NAME]]"; abstract class Abstract2 {} fn Var() { - // CHECK:STDERR: fail_abstract_var.carbon:[[@LINE+7]]:10: error: binding pattern has abstract type `(Abstract2,)` in `var` pattern [AbstractTypeInVarPattern] - // CHECK:STDERR: var v: (Abstract2,); - // CHECK:STDERR: ^~~~~~~~~~~~ + // CHECK:STDERR: fail_abstract_var.carbon:[[@LINE+7]]:17: error: binding pattern has abstract type `(Abstract2,)` in `var` pattern [AbstractTypeInVarPattern] + // CHECK:STDERR: var unused v: (Abstract2,); + // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fail_abstract_var.carbon:[[@LINE-6]]:1: note: uses class that was declared abstract here [ClassAbstractHere] // CHECK:STDERR: abstract class Abstract2 {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var v: (Abstract2,); + var unused v: (Abstract2,); } // --- fail_todo_abstract_let.carbon @@ -51,14 +51,14 @@ abstract class Abstract3 { } fn F(a: Abstract3) { - // CHECK:STDERR: fail_todo_abstract_let.carbon:[[@LINE+7]]:25: error: initialization of abstract type `(Abstract3,)` [AbstractTypeInInit] - // CHECK:STDERR: let l: (Abstract3,) = (a,); - // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_todo_abstract_let.carbon:[[@LINE+7]]:32: error: initialization of abstract type `(Abstract3,)` [AbstractTypeInInit] + // CHECK:STDERR: let unused l: (Abstract3,) = (a,); + // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_todo_abstract_let.carbon:[[@LINE-7]]:1: note: uses class that was declared abstract here [ClassAbstractHere] // CHECK:STDERR: abstract class Abstract3 { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let l: (Abstract3,) = (a,); + let unused l: (Abstract3,) = (a,); } // --- fail_abstract_twice.carbon @@ -68,14 +68,14 @@ abstract class Abstract4 {} abstract class Abstract5 {} fn Var2() { - // CHECK:STDERR: fail_abstract_twice.carbon:[[@LINE+7]]:11: error: binding pattern has abstract type `(Abstract4, Abstract5)` in `var` pattern [AbstractTypeInVarPattern] - // CHECK:STDERR: var v2: (Abstract4, Abstract5); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_abstract_twice.carbon:[[@LINE+7]]:18: error: binding pattern has abstract type `(Abstract4, Abstract5)` in `var` pattern [AbstractTypeInVarPattern] + // CHECK:STDERR: var unused v2: (Abstract4, Abstract5); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_abstract_twice.carbon:[[@LINE-7]]:1: note: uses class that was declared abstract here [ClassAbstractHere] // CHECK:STDERR: abstract class Abstract4 {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var v2: (Abstract4, Abstract5); + var unused v2: (Abstract4, Abstract5); } // --- fail_abstract_first.carbon @@ -84,14 +84,14 @@ library "[[@TEST_NAME]]"; abstract class Abstract6 {} fn Var3() { - // CHECK:STDERR: fail_abstract_first.carbon:[[@LINE+7]]:11: error: binding pattern has abstract type `(Abstract6, {})` in `var` pattern [AbstractTypeInVarPattern] - // CHECK:STDERR: var v3: (Abstract6, {}); - // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_abstract_first.carbon:[[@LINE+7]]:18: error: binding pattern has abstract type `(Abstract6, {})` in `var` pattern [AbstractTypeInVarPattern] + // CHECK:STDERR: var unused v3: (Abstract6, {}); + // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_abstract_first.carbon:[[@LINE-6]]:1: note: uses class that was declared abstract here [ClassAbstractHere] // CHECK:STDERR: abstract class Abstract6 {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var v3: (Abstract6, {}); + var unused v3: (Abstract6, {}); } // --- fail_abstract_second.carbon @@ -100,14 +100,14 @@ library "[[@TEST_NAME]]"; abstract class Abstract7 {} fn Var4() { - // CHECK:STDERR: fail_abstract_second.carbon:[[@LINE+7]]:11: error: binding pattern has abstract type `({}, Abstract7)` in `var` pattern [AbstractTypeInVarPattern] - // CHECK:STDERR: var v4: ({}, Abstract7); - // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_abstract_second.carbon:[[@LINE+7]]:18: error: binding pattern has abstract type `({}, Abstract7)` in `var` pattern [AbstractTypeInVarPattern] + // CHECK:STDERR: var unused v4: ({}, Abstract7); + // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_abstract_second.carbon:[[@LINE-6]]:1: note: uses class that was declared abstract here [ClassAbstractHere] // CHECK:STDERR: abstract class Abstract7 {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var v4: ({}, Abstract7); + var unused v4: ({}, Abstract7); } // --- lib.carbon @@ -121,15 +121,15 @@ library "[[@TEST_NAME]]"; import library "lib"; fn Var5() { - // CHECK:STDERR: fail_import.carbon:[[@LINE+8]]:11: error: binding pattern has abstract type `(Abstract,)` in `var` pattern [AbstractTypeInVarPattern] - // CHECK:STDERR: var v5: (Abstract,); - // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: fail_import.carbon:[[@LINE+8]]:18: error: binding pattern has abstract type `(Abstract,)` in `var` pattern [AbstractTypeInVarPattern] + // CHECK:STDERR: var unused v5: (Abstract,); + // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: fail_import.carbon:[[@LINE-6]]:1: in import [InImport] // CHECK:STDERR: lib.carbon:3:1: note: uses class that was declared abstract here [ClassAbstractHere] // CHECK:STDERR: abstract class Abstract {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var v5: (Abstract,); + var unused v5: (Abstract,); } // CHECK:STDOUT: --- fail_abstract_field.carbon @@ -233,10 +233,10 @@ fn Var5() { // CHECK:STDOUT: %v.var_patt: = var_pattern %v.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref = var %v.var_patt [concrete = ] -// CHECK:STDOUT: %.loc13_21.1: type = splice_block %.loc13_21.3 [concrete = constants.%tuple.type.d46] { +// CHECK:STDOUT: %.loc13_28.1: type = splice_block %.loc13_28.3 [concrete = constants.%tuple.type.d46] { // CHECK:STDOUT: %Abstract2.ref: type = name_ref Abstract2, file.%Abstract2.decl [concrete = constants.%Abstract2] -// CHECK:STDOUT: %.loc13_21.2: %tuple.type.85c = tuple_literal (%Abstract2.ref) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc13_21.3: type = converted %.loc13_21.2, constants.%tuple.type.d46 [concrete = constants.%tuple.type.d46] +// CHECK:STDOUT: %.loc13_28.2: %tuple.type.85c = tuple_literal (%Abstract2.ref) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc13_28.3: type = converted %.loc13_28.2, constants.%tuple.type.d46 [concrete = constants.%tuple.type.d46] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref = ref_binding v, [concrete = ] // CHECK:STDOUT: return @@ -296,11 +296,11 @@ fn Var5() { // CHECK:STDOUT: %l.patt: %pattern_type.016 = value_binding_pattern l [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.ref: %Abstract3 = name_ref a, %a -// CHECK:STDOUT: %.loc14_28: %tuple.type.c99 = tuple_literal (%a.ref) -// CHECK:STDOUT: %.loc14_21.1: type = splice_block %.loc14_21.3 [concrete = constants.%tuple.type.c99] { +// CHECK:STDOUT: %.loc14_35: %tuple.type.c99 = tuple_literal (%a.ref) +// CHECK:STDOUT: %.loc14_28.1: type = splice_block %.loc14_28.3 [concrete = constants.%tuple.type.c99] { // CHECK:STDOUT: %Abstract3.ref.loc14: type = name_ref Abstract3, file.%Abstract3.decl [concrete = constants.%Abstract3] -// CHECK:STDOUT: %.loc14_21.2: %tuple.type.85c = tuple_literal (%Abstract3.ref.loc14) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc14_21.3: type = converted %.loc14_21.2, constants.%tuple.type.c99 [concrete = constants.%tuple.type.c99] +// CHECK:STDOUT: %.loc14_28.2: %tuple.type.85c = tuple_literal (%Abstract3.ref.loc14) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc14_28.3: type = converted %.loc14_28.2, constants.%tuple.type.c99 [concrete = constants.%tuple.type.c99] // CHECK:STDOUT: } // CHECK:STDOUT: %l: %tuple.type.c99 = value_binding l, [concrete = ] // CHECK:STDOUT: return @@ -366,11 +366,11 @@ fn Var5() { // CHECK:STDOUT: %v2.var_patt: = var_pattern %v2.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %v2.var: ref = var %v2.var_patt [concrete = ] -// CHECK:STDOUT: %.loc14_32.1: type = splice_block %.loc14_32.3 [concrete = constants.%tuple.type.fa1] { +// CHECK:STDOUT: %.loc14_39.1: type = splice_block %.loc14_39.3 [concrete = constants.%tuple.type.fa1] { // CHECK:STDOUT: %Abstract4.ref: type = name_ref Abstract4, file.%Abstract4.decl [concrete = constants.%Abstract4] // CHECK:STDOUT: %Abstract5.ref: type = name_ref Abstract5, file.%Abstract5.decl [concrete = constants.%Abstract5] -// CHECK:STDOUT: %.loc14_32.2: %tuple.type.24b = tuple_literal (%Abstract4.ref, %Abstract5.ref) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc14_32.3: type = converted %.loc14_32.2, constants.%tuple.type.fa1 [concrete = constants.%tuple.type.fa1] +// CHECK:STDOUT: %.loc14_39.2: %tuple.type.24b = tuple_literal (%Abstract4.ref, %Abstract5.ref) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc14_39.3: type = converted %.loc14_39.2, constants.%tuple.type.fa1 [concrete = constants.%tuple.type.fa1] // CHECK:STDOUT: } // CHECK:STDOUT: %v2: ref = ref_binding v2, [concrete = ] // CHECK:STDOUT: return @@ -426,12 +426,12 @@ fn Var5() { // CHECK:STDOUT: %v3.var_patt: = var_pattern %v3.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %v3.var: ref = var %v3.var_patt [concrete = ] -// CHECK:STDOUT: %.loc13_25.1: type = splice_block %.loc13_25.4 [concrete = constants.%tuple.type.a75] { +// CHECK:STDOUT: %.loc13_32.1: type = splice_block %.loc13_32.4 [concrete = constants.%tuple.type.a75] { // CHECK:STDOUT: %Abstract6.ref: type = name_ref Abstract6, file.%Abstract6.decl [concrete = constants.%Abstract6] -// CHECK:STDOUT: %.loc13_24: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc13_25.2: %tuple.type.159 = tuple_literal (%Abstract6.ref, %.loc13_24) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc13_25.3: type = converted constants.%empty_struct, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc13_25.4: type = converted %.loc13_25.2, constants.%tuple.type.a75 [concrete = constants.%tuple.type.a75] +// CHECK:STDOUT: %.loc13_31: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc13_32.2: %tuple.type.159 = tuple_literal (%Abstract6.ref, %.loc13_31) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc13_32.3: type = converted constants.%empty_struct, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc13_32.4: type = converted %.loc13_32.2, constants.%tuple.type.a75 [concrete = constants.%tuple.type.a75] // CHECK:STDOUT: } // CHECK:STDOUT: %v3: ref = ref_binding v3, [concrete = ] // CHECK:STDOUT: return @@ -487,12 +487,12 @@ fn Var5() { // CHECK:STDOUT: %v4.var_patt: = var_pattern %v4.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %v4.var: ref = var %v4.var_patt [concrete = ] -// CHECK:STDOUT: %.loc13_25.1: type = splice_block %.loc13_25.4 [concrete = constants.%tuple.type.ff9] { -// CHECK:STDOUT: %.loc13_13: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc13_32.1: type = splice_block %.loc13_32.4 [concrete = constants.%tuple.type.ff9] { +// CHECK:STDOUT: %.loc13_20: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %Abstract7.ref: type = name_ref Abstract7, file.%Abstract7.decl [concrete = constants.%Abstract7] -// CHECK:STDOUT: %.loc13_25.2: %tuple.type.c8c = tuple_literal (%.loc13_13, %Abstract7.ref) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc13_25.3: type = converted constants.%empty_struct, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc13_25.4: type = converted %.loc13_25.2, constants.%tuple.type.ff9 [concrete = constants.%tuple.type.ff9] +// CHECK:STDOUT: %.loc13_32.2: %tuple.type.c8c = tuple_literal (%.loc13_20, %Abstract7.ref) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc13_32.3: type = converted constants.%empty_struct, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc13_32.4: type = converted %.loc13_32.2, constants.%tuple.type.ff9 [concrete = constants.%tuple.type.ff9] // CHECK:STDOUT: } // CHECK:STDOUT: %v4: ref = ref_binding v4, [concrete = ] // CHECK:STDOUT: return @@ -581,10 +581,10 @@ fn Var5() { // CHECK:STDOUT: %v5.var_patt: = var_pattern %v5.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %v5.var: ref = var %v5.var_patt [concrete = ] -// CHECK:STDOUT: %.loc14_21.1: type = splice_block %.loc14_21.3 [concrete = constants.%tuple.type.e3a] { +// CHECK:STDOUT: %.loc14_28.1: type = splice_block %.loc14_28.3 [concrete = constants.%tuple.type.e3a] { // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, imports.%Main.Abstract [concrete = constants.%Abstract] -// CHECK:STDOUT: %.loc14_21.2: %tuple.type.85c = tuple_literal (%Abstract.ref) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc14_21.3: type = converted %.loc14_21.2, constants.%tuple.type.e3a [concrete = constants.%tuple.type.e3a] +// CHECK:STDOUT: %.loc14_28.2: %tuple.type.85c = tuple_literal (%Abstract.ref) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc14_28.3: type = converted %.loc14_28.2, constants.%tuple.type.e3a [concrete = constants.%tuple.type.e3a] // CHECK:STDOUT: } // CHECK:STDOUT: %v5: ref = ref_binding v5, [concrete = ] // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/fail_error_recovery.carbon b/toolchain/check/testdata/class/fail_error_recovery.carbon index 2747ce3d74cc..c77ca396e69a 100644 --- a/toolchain/check/testdata/class/fail_error_recovery.carbon +++ b/toolchain/check/testdata/class/fail_error_recovery.carbon @@ -12,13 +12,13 @@ // --- fail_virtual_fn_in_invalid_context.carbon -// CHECK:STDERR: fail_virtual_fn_in_invalid_context.carbon:[[@LINE+4]]:10: error: name `error_not_found` not found [NameNotFound] -// CHECK:STDERR: fn F(N:! error_not_found) { -// CHECK:STDERR: ^~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_virtual_fn_in_invalid_context.carbon:[[@LINE+4]]:17: error: name `error_not_found` not found [NameNotFound] +// CHECK:STDERR: fn F(unused N:! error_not_found) { +// CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(N:! error_not_found) { +fn F(unused N:! error_not_found) { base class C { - virtual fn Foo[self: Self]() {} + virtual fn Foo[unused self: Self]() {} } base class D { diff --git a/toolchain/check/testdata/class/fail_generic_method.carbon b/toolchain/check/testdata/class/fail_generic_method.carbon index 3851a0a4f332..47e9b1c6fc76 100644 --- a/toolchain/check/testdata/class/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_generic_method.carbon @@ -19,19 +19,19 @@ class Class(T:! type) { // TODO: The follow-on errors here aren't great. Investigate whether we can // enter the scope anyway if the parameters don't match. -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+15]]:10: error: type `` of parameter 1 in redeclaration differs from previous parameter type `` [RedeclParamDiffersType] -// CHECK:STDERR: fn Class(N:! I).F[self: Self](n: T) {} -// CHECK:STDERR: ^ +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+15]]:17: error: type `` of parameter 1 in redeclaration differs from previous parameter type `` [RedeclParamDiffersType] +// CHECK:STDERR: fn Class(unused N:! I).F[unused self: Self](unused n: T) {} +// CHECK:STDERR: ^ // CHECK:STDERR: fail_generic_method.carbon:[[@LINE-10]]:13: note: previous declaration's corresponding parameter here [RedeclParamPrevious] // CHECK:STDERR: class Class(T:! type) { // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+8]]:25: error: name `Self` not found [NameNotFound] -// CHECK:STDERR: fn Class(N:! I).F[self: Self](n: T) {} -// CHECK:STDERR: ^~~~ +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+8]]:39: error: name `Self` not found [NameNotFound] +// CHECK:STDERR: fn Class(unused N:! I).F[unused self: Self](unused n: T) {} +// CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+4]]:34: error: name `T` not found [NameNotFound] -// CHECK:STDERR: fn Class(N:! I).F[self: Self](n: T) {} -// CHECK:STDERR: ^ +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+4]]:55: error: name `T` not found [NameNotFound] +// CHECK:STDERR: fn Class(unused N:! I).F[unused self: Self](unused n: T) {} +// CHECK:STDERR: ^ // CHECK:STDERR: -fn Class(N:! I).F[self: Self](n: T) {} +fn Class(unused N:! I).F[unused self: Self](unused n: T) {} diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index dfc8536f6995..761652374f23 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -88,14 +88,14 @@ fn Copy(p: Class*) -> Class { } fn Let(p: Class*) { - // CHECK:STDERR: fail_forward_decl.carbon:[[@LINE+7]]:10: error: binding pattern has incomplete type `Class` in name binding declaration [IncompleteTypeInBindingDecl] - // CHECK:STDERR: let c: Class = *p; - // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: fail_forward_decl.carbon:[[@LINE+7]]:17: error: binding pattern has incomplete type `Class` in name binding declaration [IncompleteTypeInBindingDecl] + // CHECK:STDERR: let unused c: Class = *p; + // CHECK:STDERR: ^~~~~ // CHECK:STDERR: fail_forward_decl.carbon:[[@LINE-77]]:1: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: - let c: Class = *p; + let unused c: Class = *p; } fn TakeIncomplete(c: Class); diff --git a/toolchain/check/testdata/class/fail_modifiers.carbon b/toolchain/check/testdata/class/fail_modifiers.carbon index 9f6a17b13ed9..84c7cd2c2004 100644 --- a/toolchain/check/testdata/class/fail_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_modifiers.carbon @@ -85,16 +85,16 @@ abstract protected class WrongOrder { } abstract base class AbstractAndBase {} abstract class AbstractWithDefinition { - // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:31: error: definition of `abstract` function [DefinedAbstractFunction] - // CHECK:STDERR: abstract fn F[self: Self]() {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:38: error: definition of `abstract` function [DefinedAbstractFunction] + // CHECK:STDERR: abstract fn F[unused self: Self]() {} + // CHECK:STDERR: ^ // CHECK:STDERR: - abstract fn F[self: Self]() {} - abstract fn G[self: Self](); + abstract fn F[unused self: Self]() {} + abstract fn G[unused self: Self](); } -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:43: error: definition of `abstract` function [DefinedAbstractFunction] -// CHECK:STDERR: fn AbstractWithDefinition.G[self: Self]() { -// CHECK:STDERR: ^ +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:50: error: definition of `abstract` function [DefinedAbstractFunction] +// CHECK:STDERR: fn AbstractWithDefinition.G[unused self: Self]() { +// CHECK:STDERR: ^ // CHECK:STDERR: -fn AbstractWithDefinition.G[self: Self]() { +fn AbstractWithDefinition.G[unused self: Self]() { } diff --git a/toolchain/check/testdata/class/fail_self.carbon b/toolchain/check/testdata/class/fail_self.carbon index e3e94006c082..0ba235127064 100644 --- a/toolchain/check/testdata/class/fail_self.carbon +++ b/toolchain/check/testdata/class/fail_self.carbon @@ -20,11 +20,11 @@ class Class { fn G() -> Self; } -// CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:12: error: `self` can only be declared in an implicit parameter list [SelfOutsideImplicitParamList] -// CHECK:STDERR: fn Class.F(self: Self) { -// CHECK:STDERR: ^~~~~~~~~~ +// CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:19: error: `self` can only be declared in an implicit parameter list [SelfOutsideImplicitParamList] +// CHECK:STDERR: fn Class.F(unused self: Self) { +// CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: -fn Class.F(self: Self) { +fn Class.F(unused self: Self) { } fn Class.G() -> Self { diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index 46e6156aa9d0..dd19a96f54d7 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -21,8 +21,8 @@ fn Run() { var c: Class; c.j = 1; c.k = 2; - var cj: i32 = c.j; - var ck: i32 = c.k; + var unused cj: i32 = c.j; + var unused ck: i32 = c.k; } // CHECK:STDOUT: --- field_access.carbon @@ -164,15 +164,15 @@ fn Run() { // CHECK:STDOUT: %cj.var: ref %i32 = var %cj.var_patt // CHECK:STDOUT: %c.ref.loc24: ref %Class = name_ref c, %c // CHECK:STDOUT: %j.ref.loc24: %Class.elem = name_ref j, @Class.%.loc16 [concrete = @Class.%.loc16] -// CHECK:STDOUT: %.loc24_18.1: ref %i32 = class_element_access %c.ref.loc24, element0 -// CHECK:STDOUT: %.loc24_18.2: %i32 = acquire_value %.loc24_18.1 +// CHECK:STDOUT: %.loc24_25.1: ref %i32 = class_element_access %c.ref.loc24, element0 +// CHECK:STDOUT: %.loc24_25.2: %i32 = acquire_value %.loc24_25.1 // CHECK:STDOUT: %impl.elem0.loc24: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] -// CHECK:STDOUT: %bound_method.loc24_18.1: = bound_method %.loc24_18.2, %impl.elem0.loc24 +// CHECK:STDOUT: %bound_method.loc24_25.1: = bound_method %.loc24_25.2, %impl.elem0.loc24 // CHECK:STDOUT: %specific_fn.loc24: = specific_function %impl.elem0.loc24, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc24_18.2: = bound_method %.loc24_18.2, %specific_fn.loc24 -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc24: init %i32 = call %bound_method.loc24_18.2(%.loc24_18.2) +// CHECK:STDOUT: %bound_method.loc24_25.2: = bound_method %.loc24_25.2, %specific_fn.loc24 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc24: init %i32 = call %bound_method.loc24_25.2(%.loc24_25.2) // CHECK:STDOUT: assign %cj.var, %Int.as.Copy.impl.Op.call.loc24 -// CHECK:STDOUT: %.loc24_11: type = splice_block %i32.loc24 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc24_18: type = splice_block %i32.loc24 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } @@ -184,15 +184,15 @@ fn Run() { // CHECK:STDOUT: %ck.var: ref %i32 = var %ck.var_patt // CHECK:STDOUT: %c.ref.loc25: ref %Class = name_ref c, %c // CHECK:STDOUT: %k.ref.loc25: %Class.elem = name_ref k, @Class.%.loc17 [concrete = @Class.%.loc17] -// CHECK:STDOUT: %.loc25_18.1: ref %i32 = class_element_access %c.ref.loc25, element1 -// CHECK:STDOUT: %.loc25_18.2: %i32 = acquire_value %.loc25_18.1 +// CHECK:STDOUT: %.loc25_25.1: ref %i32 = class_element_access %c.ref.loc25, element1 +// CHECK:STDOUT: %.loc25_25.2: %i32 = acquire_value %.loc25_25.1 // CHECK:STDOUT: %impl.elem0.loc25: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] -// CHECK:STDOUT: %bound_method.loc25_18.1: = bound_method %.loc25_18.2, %impl.elem0.loc25 +// CHECK:STDOUT: %bound_method.loc25_25.1: = bound_method %.loc25_25.2, %impl.elem0.loc25 // CHECK:STDOUT: %specific_fn.loc25: = specific_function %impl.elem0.loc25, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc25_18.2: = bound_method %.loc25_18.2, %specific_fn.loc25 -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc25: init %i32 = call %bound_method.loc25_18.2(%.loc25_18.2) +// CHECK:STDOUT: %bound_method.loc25_25.2: = bound_method %.loc25_25.2, %specific_fn.loc25 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc25: init %i32 = call %bound_method.loc25_25.2(%.loc25_25.2) // CHECK:STDOUT: assign %ck.var, %Int.as.Copy.impl.Op.call.loc25 -// CHECK:STDOUT: %.loc25_11: type = splice_block %i32.loc25 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc25_18: type = splice_block %i32.loc25 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index 8c2f1316d162..0866d637493a 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -22,8 +22,8 @@ fn Test() { cv.j = 1; cv.k = 2; let c: Class = cv; - var cj: i32 = c.j; - var ck: i32 = c.k; + var unused cj: i32 = c.j; + var unused ck: i32 = c.k; } // CHECK:STDOUT: --- field_access_in_value.carbon @@ -172,15 +172,15 @@ fn Test() { // CHECK:STDOUT: %cj.var: ref %i32 = var %cj.var_patt // CHECK:STDOUT: %c.ref.loc25: %Class = name_ref c, %c // CHECK:STDOUT: %j.ref.loc25: %Class.elem = name_ref j, @Class.%.loc16 [concrete = @Class.%.loc16] -// CHECK:STDOUT: %.loc25_18.1: ref %i32 = class_element_access %c.ref.loc25, element0 -// CHECK:STDOUT: %.loc25_18.2: %i32 = acquire_value %.loc25_18.1 +// CHECK:STDOUT: %.loc25_25.1: ref %i32 = class_element_access %c.ref.loc25, element0 +// CHECK:STDOUT: %.loc25_25.2: %i32 = acquire_value %.loc25_25.1 // CHECK:STDOUT: %impl.elem0.loc25: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] -// CHECK:STDOUT: %bound_method.loc25_18.1: = bound_method %.loc25_18.2, %impl.elem0.loc25 +// CHECK:STDOUT: %bound_method.loc25_25.1: = bound_method %.loc25_25.2, %impl.elem0.loc25 // CHECK:STDOUT: %specific_fn.loc25: = specific_function %impl.elem0.loc25, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc25_18.2: = bound_method %.loc25_18.2, %specific_fn.loc25 -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc25: init %i32 = call %bound_method.loc25_18.2(%.loc25_18.2) +// CHECK:STDOUT: %bound_method.loc25_25.2: = bound_method %.loc25_25.2, %specific_fn.loc25 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc25: init %i32 = call %bound_method.loc25_25.2(%.loc25_25.2) // CHECK:STDOUT: assign %cj.var, %Int.as.Copy.impl.Op.call.loc25 -// CHECK:STDOUT: %.loc25_11: type = splice_block %i32.loc25 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc25_18: type = splice_block %i32.loc25 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } @@ -192,15 +192,15 @@ fn Test() { // CHECK:STDOUT: %ck.var: ref %i32 = var %ck.var_patt // CHECK:STDOUT: %c.ref.loc26: %Class = name_ref c, %c // CHECK:STDOUT: %k.ref.loc26: %Class.elem = name_ref k, @Class.%.loc17 [concrete = @Class.%.loc17] -// CHECK:STDOUT: %.loc26_18.1: ref %i32 = class_element_access %c.ref.loc26, element1 -// CHECK:STDOUT: %.loc26_18.2: %i32 = acquire_value %.loc26_18.1 +// CHECK:STDOUT: %.loc26_25.1: ref %i32 = class_element_access %c.ref.loc26, element1 +// CHECK:STDOUT: %.loc26_25.2: %i32 = acquire_value %.loc26_25.1 // CHECK:STDOUT: %impl.elem0.loc26: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] -// CHECK:STDOUT: %bound_method.loc26_18.1: = bound_method %.loc26_18.2, %impl.elem0.loc26 +// CHECK:STDOUT: %bound_method.loc26_25.1: = bound_method %.loc26_25.2, %impl.elem0.loc26 // CHECK:STDOUT: %specific_fn.loc26: = specific_function %impl.elem0.loc26, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc26_18.2: = bound_method %.loc26_18.2, %specific_fn.loc26 -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc26: init %i32 = call %bound_method.loc26_18.2(%.loc26_18.2) +// CHECK:STDOUT: %bound_method.loc26_25.2: = bound_method %.loc26_25.2, %specific_fn.loc26 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc26: init %i32 = call %bound_method.loc26_25.2(%.loc26_25.2) // CHECK:STDOUT: assign %ck.var, %Int.as.Copy.impl.Op.call.loc26 -// CHECK:STDOUT: %.loc26_11: type = splice_block %i32.loc26 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc26_18: type = splice_block %i32.loc26 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc26: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/generic/base_is_generic.carbon b/toolchain/check/testdata/class/generic/base_is_generic.carbon index d74b0255bf68..95cbd5ce2d62 100644 --- a/toolchain/check/testdata/class/generic/base_is_generic.carbon +++ b/toolchain/check/testdata/class/generic/base_is_generic.carbon @@ -75,7 +75,7 @@ class C(T:! type) { } fn F() { - let i: i32 = C(i32).G(); + let unused i: i32 = C(i32).G(); } @@ -86,7 +86,7 @@ library "[[@TEST_NAME]]"; import library "extend_generic_symbolic_base"; fn H() { - let j: i32 = C(i32).G(); + let unused j: i32 = C(i32).G(); } // CHECK:STDOUT: --- extend_generic_base.carbon @@ -706,20 +706,20 @@ fn H() { // CHECK:STDOUT: %i.patt: %pattern_type.7ce = value_binding_pattern i [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] -// CHECK:STDOUT: %int_32.loc13_18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_18: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc13_25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [concrete = constants.%C.b13] -// CHECK:STDOUT: %.loc13_22: %X.G.type.f75 = specific_constant @X.%X.G.decl, @X(constants.%i32) [concrete = constants.%X.G.e2a] -// CHECK:STDOUT: %G.ref: %X.G.type.f75 = name_ref G, %.loc13_22 [concrete = constants.%X.G.e2a] +// CHECK:STDOUT: %.loc13_29: %X.G.type.f75 = specific_constant @X.%X.G.decl, @X(constants.%i32) [concrete = constants.%X.G.e2a] +// CHECK:STDOUT: %G.ref: %X.G.type.f75 = name_ref G, %.loc13_29 [concrete = constants.%X.G.e2a] // CHECK:STDOUT: %X.G.specific_fn: = specific_function %G.ref, @X.G(constants.%i32) [concrete = constants.%X.G.specific_fn.54d] // CHECK:STDOUT: %X.G.call: init %i32 = call %X.G.specific_fn() -// CHECK:STDOUT: %.loc13_10: type = splice_block %i32.loc13_10 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc13_10: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_10: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc13_17: type = splice_block %i32.loc13_17 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13_25.1: %i32 = value_of_initializer %X.G.call -// CHECK:STDOUT: %.loc13_25.2: %i32 = converted %X.G.call, %.loc13_25.1 -// CHECK:STDOUT: %i: %i32 = value_binding i, %.loc13_25.2 +// CHECK:STDOUT: %.loc13_32.1: %i32 = value_of_initializer %X.G.call +// CHECK:STDOUT: %.loc13_32.2: %i32 = converted %X.G.call, %.loc13_32.1 +// CHECK:STDOUT: %i: %i32 = value_binding i, %.loc13_32.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -909,20 +909,20 @@ fn H() { // CHECK:STDOUT: %j.patt: %pattern_type.7ce = value_binding_pattern j [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Main.C [concrete = constants.%C.generic] -// CHECK:STDOUT: %int_32.loc7_18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_18: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc7_25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [concrete = constants.%C.b13] -// CHECK:STDOUT: %.loc7_22: %X.G.type.f75 = specific_constant imports.%Main.import_ref.940, @X(constants.%i32) [concrete = constants.%X.G.e2a] -// CHECK:STDOUT: %G.ref: %X.G.type.f75 = name_ref G, %.loc7_22 [concrete = constants.%X.G.e2a] +// CHECK:STDOUT: %.loc7_29: %X.G.type.f75 = specific_constant imports.%Main.import_ref.940, @X(constants.%i32) [concrete = constants.%X.G.e2a] +// CHECK:STDOUT: %G.ref: %X.G.type.f75 = name_ref G, %.loc7_29 [concrete = constants.%X.G.e2a] // CHECK:STDOUT: %X.G.specific_fn: = specific_function %G.ref, @X.G(constants.%i32) [concrete = constants.%X.G.specific_fn.54d] // CHECK:STDOUT: %X.G.call: init %i32 = call %X.G.specific_fn() -// CHECK:STDOUT: %.loc7_10: type = splice_block %i32.loc7_10 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_10: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_10: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc7_17: type = splice_block %i32.loc7_17 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc7_25.1: %i32 = value_of_initializer %X.G.call -// CHECK:STDOUT: %.loc7_25.2: %i32 = converted %X.G.call, %.loc7_25.1 -// CHECK:STDOUT: %j: %i32 = value_binding j, %.loc7_25.2 +// CHECK:STDOUT: %.loc7_32.1: %i32 = value_of_initializer %X.G.call +// CHECK:STDOUT: %.loc7_32.2: %i32 = converted %X.G.call, %.loc7_32.1 +// CHECK:STDOUT: %j: %i32 = value_binding j, %.loc7_32.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon index 7fee8346bae1..d6bfc72676c3 100644 --- a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon +++ b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon @@ -28,11 +28,11 @@ class A(N:! i32) { } fn F(a: A(0)*) { - // CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+4]]:15: note: in `A(0)` used here [ResolvingSpecificHere] - // CHECK:STDERR: let b: B* = a; - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+4]]:22: note: in `A(0)` used here [ResolvingSpecificHere] + // CHECK:STDERR: let unused b: B* = a; + // CHECK:STDERR: ^ // CHECK:STDERR: - let b: B* = a; + let unused b: B* = a; } // CHECK:STDOUT: --- fail_derived_to_base.carbon @@ -249,15 +249,15 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %b.patt: %pattern_type.191 = value_binding_pattern b [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.ref: %ptr.0e2 = name_ref a, %a -// CHECK:STDOUT: %.loc20_11: type = splice_block %ptr.loc20 [concrete = constants.%ptr.27c] { +// CHECK:STDOUT: %.loc20_18: type = splice_block %ptr.loc20 [concrete = constants.%ptr.27c] { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B] // CHECK:STDOUT: %ptr.loc20: type = ptr_type %B.ref [concrete = constants.%ptr.27c] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc20_15.1: ref %A.dc6 = deref %a.ref -// CHECK:STDOUT: %.loc20_15.2: ref %B = class_element_access %.loc20_15.1, element0 -// CHECK:STDOUT: %addr: %ptr.27c = addr_of %.loc20_15.2 -// CHECK:STDOUT: %.loc20_15.3: %ptr.27c = converted %a.ref, %addr -// CHECK:STDOUT: %b: %ptr.27c = value_binding b, %.loc20_15.3 +// CHECK:STDOUT: %.loc20_22.1: ref %A.dc6 = deref %a.ref +// CHECK:STDOUT: %.loc20_22.2: ref %B = class_element_access %.loc20_22.1, element0 +// CHECK:STDOUT: %addr: %ptr.27c = addr_of %.loc20_22.2 +// CHECK:STDOUT: %.loc20_22.3: %ptr.27c = converted %a.ref, %addr +// CHECK:STDOUT: %b: %ptr.27c = value_binding b, %.loc20_22.3 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 94a894f89b96..c2fe920c52e3 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -60,13 +60,13 @@ import library "foo"; fn Use() { // TODO: Include the generic arguments in the formatted type name. // CHECK:STDERR: fail_generic_arg_mismatch.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `CompleteClass(i32)` to `CompleteClass(i32*)` [ConversionFailure] - // CHECK:STDERR: var v: CompleteClass(i32*) = F(); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: var unused v: CompleteClass(i32*) = F(); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_generic_arg_mismatch.carbon:[[@LINE+4]]:3: note: type `CompleteClass(i32)` does not implement interface `Core.ImplicitAs(CompleteClass(i32*))` [MissingImplInMemberAccessNote] - // CHECK:STDERR: var v: CompleteClass(i32*) = F(); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: var unused v: CompleteClass(i32*) = F(); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var v: CompleteClass(i32*) = F(); + var unused v: CompleteClass(i32*) = F(); } // --- fail_foo.impl.carbon @@ -778,11 +778,11 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %CompleteClass.582 = var %v.var_patt // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%Main.F [concrete = constants.%F] -// CHECK:STDOUT: %.loc14_34: ref %CompleteClass.667 = temporary_storage -// CHECK:STDOUT: %F.call: init %CompleteClass.667 to %.loc14_34 = call %F.ref() +// CHECK:STDOUT: %.loc14_41: ref %CompleteClass.667 = temporary_storage +// CHECK:STDOUT: %F.call: init %CompleteClass.667 to %.loc14_41 = call %F.ref() // CHECK:STDOUT: %.loc14_3: %CompleteClass.582 = converted %F.call, [concrete = ] // CHECK:STDOUT: assign %v.var, -// CHECK:STDOUT: %.loc14_28: type = splice_block %CompleteClass [concrete = constants.%CompleteClass.582] { +// CHECK:STDOUT: %.loc14_35: type = splice_block %CompleteClass [concrete = constants.%CompleteClass.582] { // CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%Main.CompleteClass [concrete = constants.%CompleteClass.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] diff --git a/toolchain/check/testdata/class/generic/member_out_of_line.carbon b/toolchain/check/testdata/class/generic/member_out_of_line.carbon index ee4311c007d4..9de40af4c916 100644 --- a/toolchain/check/testdata/class/generic/member_out_of_line.carbon +++ b/toolchain/check/testdata/class/generic/member_out_of_line.carbon @@ -36,12 +36,12 @@ library "[[@TEST_NAME]]"; //@dump-sem-ir-begin class A(T:! type) { - class B(N:! T) { + class B(_:! T) { fn F[self: Self](a: T); } } -fn A(T:! type).B(N:! T).F[self: Self](a: T) {} +fn A(T:! type).B(_:! T).F[unused self: Self](unused a: T) {} //@dump-sem-ir-end // --- fail_mismatched_not_generic_vs_generic.carbon @@ -53,19 +53,19 @@ class NotGeneric { } // CHECK:STDERR: fail_mismatched_not_generic_vs_generic.carbon:[[@LINE+7]]:4: error: redeclaration differs because of parameter list [RedeclParamListDiffers] -// CHECK:STDERR: fn NotGeneric(T:! type).F() {} +// CHECK:STDERR: fn NotGeneric(unused T:! type).F() {} // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: fail_mismatched_not_generic_vs_generic.carbon:[[@LINE-7]]:1: note: previously declared without parameter list [RedeclParamListPrevious] // CHECK:STDERR: class NotGeneric { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn NotGeneric(T:! type).F() {} +fn NotGeneric(unused T:! type).F() {} // --- fail_mismatched_too_few_args.carbon library "[[@TEST_NAME]]"; -class Generic(T:! type) { +class Generic(unused T:! type) { fn TooFew(); } @@ -73,8 +73,8 @@ class Generic(T:! type) { // CHECK:STDERR: fn Generic().TooFew() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_mismatched_too_few_args.carbon:[[@LINE-7]]:1: note: previously declared with parameter count of 1 [RedeclParamCountPrevious] -// CHECK:STDERR: class Generic(T:! type) { -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: class Generic(unused T:! type) { +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn Generic().TooFew() {} @@ -87,30 +87,30 @@ class Generic(T:! type) { } // CHECK:STDERR: fail_mismatched_too_many_args.carbon:[[@LINE+7]]:4: error: redeclaration differs because of parameter count of 2 [RedeclParamCountDiffers] -// CHECK:STDERR: fn Generic(T:! type, U:! type).TooMany() {} +// CHECK:STDERR: fn Generic(unused T:! type, unused U:! type).TooMany() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_mismatched_too_many_args.carbon:[[@LINE-7]]:1: note: previously declared with parameter count of 1 [RedeclParamCountPrevious] // CHECK:STDERR: class Generic(T:! type) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Generic(T:! type, U:! type).TooMany() {} +fn Generic(unused T:! type, unused U:! type).TooMany() {} // --- fail_mismatched_wrong_arg_type.carbon library "[[@TEST_NAME]]"; -class Generic(T:! type) { +class Generic(unused T:! type) { fn WrongType(); } -// CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE+7]]:12: error: type `` of parameter 1 in redeclaration differs from previous parameter type `` [RedeclParamDiffersType] -// CHECK:STDERR: fn Generic(T:! ()).WrongType() {} -// CHECK:STDERR: ^ -// CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE-7]]:15: note: previous declaration's corresponding parameter here [RedeclParamPrevious] -// CHECK:STDERR: class Generic(T:! type) { -// CHECK:STDERR: ^ +// CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE+7]]:19: error: type `` of parameter 1 in redeclaration differs from previous parameter type `` [RedeclParamDiffersType] +// CHECK:STDERR: fn Generic(unused T:! ()).WrongType() {} +// CHECK:STDERR: ^ +// CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE-7]]:22: note: previous declaration's corresponding parameter here [RedeclParamPrevious] +// CHECK:STDERR: class Generic(unused T:! type) { +// CHECK:STDERR: ^ // CHECK:STDERR: -fn Generic(T:! ()).WrongType() {} +fn Generic(unused T:! ()).WrongType() {} // CHECK:STDOUT: --- basic.carbon // CHECK:STDOUT: @@ -386,13 +386,13 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %A.type: type = generic_class_type @A [concrete] // CHECK:STDOUT: %A.generic: %A.type = struct_value () [concrete] // CHECK:STDOUT: %A: type = class_type @A, @A(%T) [symbolic] -// CHECK:STDOUT: %N: %T = symbolic_binding N, 1 [symbolic] +// CHECK:STDOUT: %_: %T = symbolic_binding _, 1 [symbolic] // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [symbolic] // CHECK:STDOUT: %B.type: type = generic_class_type @B, @A(%T) [symbolic] // CHECK:STDOUT: %B.generic: %B.type = struct_value () [symbolic] -// CHECK:STDOUT: %B: type = class_type @B, @B(%T, %N) [symbolic] +// CHECK:STDOUT: %B: type = class_type @B, @B(%T, %_) [symbolic] // CHECK:STDOUT: %pattern_type.830: type = pattern_type %B [symbolic] -// CHECK:STDOUT: %B.F.type: type = fn_type @B.F, @B(%T, %N) [symbolic] +// CHECK:STDOUT: %B.F.type: type = fn_type @B.F, @B(%T, %_) [symbolic] // CHECK:STDOUT: %B.F: %B.F.type = struct_value () [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] @@ -422,15 +422,15 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: %T.ref.loc11_22: type = name_ref T, %T.loc11 [symbolic = @B.%T (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc11: @B.%T (%T) = symbolic_binding N, 1 [symbolic = @B.%N.loc6_11.1 (constants.%N)] +// CHECK:STDOUT: %_.loc11: @B.%T (%T) = symbolic_binding _, 1 [symbolic = @B.%_.loc6_11.1 (constants.%_)] // CHECK:STDOUT: %self.param.loc11: @B.F.%B (%B) = value_param call_param0 -// CHECK:STDOUT: %.loc11_33.1: type = splice_block %Self.ref.loc11 [symbolic = %B (constants.%B)] { -// CHECK:STDOUT: %.loc11_33.2: type = specific_constant constants.%B, @B(constants.%T, constants.%N) [symbolic = %B (constants.%B)] -// CHECK:STDOUT: %Self.ref.loc11: type = name_ref Self, %.loc11_33.2 [symbolic = %B (constants.%B)] +// CHECK:STDOUT: %.loc11_40.1: type = splice_block %Self.ref.loc11 [symbolic = %B (constants.%B)] { +// CHECK:STDOUT: %.loc11_40.2: type = specific_constant constants.%B, @B(constants.%T, constants.%_) [symbolic = %B (constants.%B)] +// CHECK:STDOUT: %Self.ref.loc11: type = name_ref Self, %.loc11_40.2 [symbolic = %B (constants.%B)] // CHECK:STDOUT: } // CHECK:STDOUT: %self.loc11: @B.F.%B (%B) = value_binding self, %self.param.loc11 // CHECK:STDOUT: %a.param.loc11: @B.F.%T.loc7 (%T) = value_param call_param1 -// CHECK:STDOUT: %T.ref.loc11_42: type = name_ref T, %T.loc11 [symbolic = %T.loc7 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc11_56: type = name_ref T, %T.loc11 [symbolic = %T.loc7 (constants.%T)] // CHECK:STDOUT: %a.loc11: @B.F.%T.loc7 (%T) = value_binding a, %a.param.loc11 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -444,13 +444,13 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %B.decl: @A.%B.type (%B.type) = class_decl @B [symbolic = @A.%B.generic (constants.%B.generic)] { -// CHECK:STDOUT: %N.patt: @B.%pattern_type (%pattern_type.51d) = symbolic_binding_pattern N, 1 [concrete] +// CHECK:STDOUT: %_.patt: @B.%pattern_type (%pattern_type.51d) = symbolic_binding_pattern _, 1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc6: type = splice_block %T.ref [symbolic = %T (constants.%T)] { // CHECK:STDOUT: // CHECK:STDOUT: %T.ref: type = name_ref T, @A.%T.loc5_9.2 [symbolic = %T (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc6_11.2: @B.%T (%T) = symbolic_binding N, 1 [symbolic = %N.loc6_11.1 (constants.%N)] +// CHECK:STDOUT: %_.loc6_11.2: @B.%T (%T) = symbolic_binding _, 1 [symbolic = %_.loc6_11.1 (constants.%_)] // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type @@ -462,13 +462,13 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @B(@A.%T.loc5_9.2: type, %N.loc6_11.2: @B.%T (%T)) { +// CHECK:STDOUT: generic class @B(@A.%T.loc5_9.2: type, %_.loc6_11.2: @B.%T (%T)) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %N.loc6_11.1: @B.%T (%T) = symbolic_binding N, 1 [symbolic = %N.loc6_11.1 (constants.%N)] +// CHECK:STDOUT: %_.loc6_11.1: @B.%T (%T) = symbolic_binding _, 1 [symbolic = %_.loc6_11.1 (constants.%_)] // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.51d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %B.F.type: type = fn_type @B.F, @B(%T, %N.loc6_11.1) [symbolic = %B.F.type (constants.%B.F.type)] +// CHECK:STDOUT: %B.F.type: type = fn_type @B.F, @B(%T, %_.loc6_11.1) [symbolic = %B.F.type (constants.%B.F.type)] // CHECK:STDOUT: %B.F: @B.%B.F.type (%B.F.type) = struct_value () [symbolic = %B.F (constants.%B.F)] // CHECK:STDOUT: // CHECK:STDOUT: class { @@ -480,7 +480,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param.loc7: @B.F.%B (%B) = value_param call_param0 // CHECK:STDOUT: %.loc7_16.1: type = splice_block %Self.ref.loc7 [symbolic = %B (constants.%B)] { -// CHECK:STDOUT: %.loc7_16.2: type = specific_constant constants.%B, @B(constants.%T, constants.%N) [symbolic = %B (constants.%B)] +// CHECK:STDOUT: %.loc7_16.2: type = specific_constant constants.%B, @B(constants.%T, constants.%_) [symbolic = %B (constants.%B)] // CHECK:STDOUT: %Self.ref.loc7: type = name_ref Self, %.loc7_16.2 [symbolic = %B (constants.%B)] // CHECK:STDOUT: } // CHECK:STDOUT: %self.loc7: @B.F.%B (%B) = value_binding self, %self.param.loc7 @@ -498,16 +498,16 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @B.F(@A.%T.loc5_9.2: type, @B.%N.loc6_11.2: @B.%T (%T)) { +// CHECK:STDOUT: generic fn @B.F(@A.%T.loc5_9.2: type, @B.%_.loc6_11.2: @B.%T (%T)) { // CHECK:STDOUT: %T.loc7: type = symbolic_binding T, 0 [symbolic = %T.loc7 (constants.%T)] -// CHECK:STDOUT: %N.loc7: @B.F.%T.loc7 (%T) = symbolic_binding N, 1 [symbolic = %N.loc7 (constants.%N)] -// CHECK:STDOUT: %B: type = class_type @B, @B(%T.loc7, %N.loc7) [symbolic = %B (constants.%B)] +// CHECK:STDOUT: %_.loc7: @B.F.%T.loc7 (%T) = symbolic_binding _, 1 [symbolic = %_.loc7 (constants.%_)] +// CHECK:STDOUT: %B: type = class_type @B, @B(%T.loc7, %_.loc7) [symbolic = %B (constants.%B)] // CHECK:STDOUT: %pattern_type.loc7_10: type = pattern_type %B [symbolic = %pattern_type.loc7_10 (constants.%pattern_type.830)] // CHECK:STDOUT: %pattern_type.loc7_22: type = pattern_type %T.loc7 [symbolic = %pattern_type.loc7_22 (constants.%pattern_type.51d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc11_31: = require_complete_type %B [symbolic = %require_complete.loc11_31 (constants.%require_complete.7cc)] -// CHECK:STDOUT: %require_complete.loc11_40: = require_complete_type %T.loc7 [symbolic = %require_complete.loc11_40 (constants.%require_complete.944)] +// CHECK:STDOUT: %require_complete.loc11_38: = require_complete_type %B [symbolic = %require_complete.loc11_38 (constants.%require_complete.7cc)] +// CHECK:STDOUT: %require_complete.loc11_54: = require_complete_type %T.loc7 [symbolic = %require_complete.loc11_54 (constants.%require_complete.944)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param.loc11: @B.F.%B (%B), %a.param.loc11: @B.F.%T.loc7 (%T)) { // CHECK:STDOUT: !entry: @@ -523,9 +523,9 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %B.generic => constants.%B.generic // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @B(constants.%T, constants.%N) { +// CHECK:STDOUT: specific @B(constants.%T, constants.%_) { // CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %N.loc6_11.1 => constants.%N +// CHECK:STDOUT: %_.loc6_11.1 => constants.%_ // CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -533,9 +533,9 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %B.F => constants.%B.F // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @B.F(constants.%T, constants.%N) { +// CHECK:STDOUT: specific @B.F(constants.%T, constants.%_) { // CHECK:STDOUT: %T.loc7 => constants.%T -// CHECK:STDOUT: %N.loc7 => constants.%N +// CHECK:STDOUT: %_.loc7 => constants.%_ // CHECK:STDOUT: %B => constants.%B // CHECK:STDOUT: %pattern_type.loc7_10 => constants.%pattern_type.830 // CHECK:STDOUT: %pattern_type.loc7_22 => constants.%pattern_type.51d diff --git a/toolchain/check/testdata/class/generic/self.carbon b/toolchain/check/testdata/class/generic/self.carbon index acf1062ff99a..497d6e25cc79 100644 --- a/toolchain/check/testdata/class/generic/self.carbon +++ b/toolchain/check/testdata/class/generic/self.carbon @@ -18,8 +18,8 @@ class Class(T:! type) { fn MakeSelf() -> Self { return {}; } fn MakeClass() -> Class(T) { return {}; } fn F() { - var c: Class(T) = MakeSelf(); - var s: Self = MakeClass(); + var unused c: Class(T) = MakeSelf(); + var unused s: Self = MakeClass(); } } @@ -169,17 +169,17 @@ class Class(T:! type) { // CHECK:STDOUT: generic fn @Class.F(@Class.%T.loc15_13.2: type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %Class.loc21_19.2: type = class_type @Class, @Class(%T) [symbolic = %Class.loc21_19.2 (constants.%Class)] -// CHECK:STDOUT: %require_complete: = require_complete_type %Class.loc21_19.2 [symbolic = %require_complete (constants.%require_complete)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Class.loc21_19.2 [symbolic = %pattern_type (constants.%pattern_type.466)] +// CHECK:STDOUT: %Class.loc21_26.2: type = class_type @Class, @Class(%T) [symbolic = %Class.loc21_26.2 (constants.%Class)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Class.loc21_26.2 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Class.loc21_26.2 [symbolic = %pattern_type (constants.%pattern_type.466)] // CHECK:STDOUT: %Class.MakeSelf.type: type = fn_type @Class.MakeSelf, @Class(%T) [symbolic = %Class.MakeSelf.type (constants.%Class.MakeSelf.type)] // CHECK:STDOUT: %Class.MakeSelf: @Class.F.%Class.MakeSelf.type (%Class.MakeSelf.type) = struct_value () [symbolic = %Class.MakeSelf (constants.%Class.MakeSelf)] -// CHECK:STDOUT: %Class.MakeSelf.specific_fn.loc21_23.2: = specific_function %Class.MakeSelf, @Class.MakeSelf(%T) [symbolic = %Class.MakeSelf.specific_fn.loc21_23.2 (constants.%Class.MakeSelf.specific_fn)] +// CHECK:STDOUT: %Class.MakeSelf.specific_fn.loc21_30.2: = specific_function %Class.MakeSelf, @Class.MakeSelf(%T) [symbolic = %Class.MakeSelf.specific_fn.loc21_30.2 (constants.%Class.MakeSelf.specific_fn)] // CHECK:STDOUT: %Class.MakeClass.type: type = fn_type @Class.MakeClass, @Class(%T) [symbolic = %Class.MakeClass.type (constants.%Class.MakeClass.type)] // CHECK:STDOUT: %Class.MakeClass: @Class.F.%Class.MakeClass.type (%Class.MakeClass.type) = struct_value () [symbolic = %Class.MakeClass (constants.%Class.MakeClass)] -// CHECK:STDOUT: %Class.MakeClass.specific_fn.loc22_19.2: = specific_function %Class.MakeClass, @Class.MakeClass(%T) [symbolic = %Class.MakeClass.specific_fn.loc22_19.2 (constants.%Class.MakeClass.specific_fn)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Class.loc21_19.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Class.loc21_19.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet)] +// CHECK:STDOUT: %Class.MakeClass.specific_fn.loc22_26.2: = specific_function %Class.MakeClass, @Class.MakeClass(%T) [symbolic = %Class.MakeClass.specific_fn.loc22_26.2 (constants.%Class.MakeClass.specific_fn)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Class.loc21_26.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Class.loc21_26.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.609)] // CHECK:STDOUT: %.loc22_5.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc22_5.2 (constants.%.2f5)] // CHECK:STDOUT: %impl.elem0.loc22_5.2: @Class.F.%.loc22_5.2 (%.2f5) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_5.2 (constants.%impl.elem0)] @@ -191,35 +191,35 @@ class Class(T:! type) { // CHECK:STDOUT: %c.patt: @Class.F.%pattern_type (%pattern_type.466) = ref_binding_pattern c [concrete] // CHECK:STDOUT: %c.var_patt: @Class.F.%pattern_type (%pattern_type.466) = var_pattern %c.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %c.var: ref @Class.F.%Class.loc21_19.2 (%Class) = var %c.var_patt -// CHECK:STDOUT: %.loc21_23: @Class.F.%Class.MakeSelf.type (%Class.MakeSelf.type) = specific_constant @Class.%Class.MakeSelf.decl, @Class(constants.%T) [symbolic = %Class.MakeSelf (constants.%Class.MakeSelf)] -// CHECK:STDOUT: %MakeSelf.ref: @Class.F.%Class.MakeSelf.type (%Class.MakeSelf.type) = name_ref MakeSelf, %.loc21_23 [symbolic = %Class.MakeSelf (constants.%Class.MakeSelf)] -// CHECK:STDOUT: %Class.MakeSelf.specific_fn.loc21_23.1: = specific_function %MakeSelf.ref, @Class.MakeSelf(constants.%T) [symbolic = %Class.MakeSelf.specific_fn.loc21_23.2 (constants.%Class.MakeSelf.specific_fn)] -// CHECK:STDOUT: %.loc21_5: ref @Class.F.%Class.loc21_19.2 (%Class) = splice_block %c.var {} -// CHECK:STDOUT: %Class.MakeSelf.call: init @Class.F.%Class.loc21_19.2 (%Class) to %.loc21_5 = call %Class.MakeSelf.specific_fn.loc21_23.1() +// CHECK:STDOUT: %c.var: ref @Class.F.%Class.loc21_26.2 (%Class) = var %c.var_patt +// CHECK:STDOUT: %.loc21_30: @Class.F.%Class.MakeSelf.type (%Class.MakeSelf.type) = specific_constant @Class.%Class.MakeSelf.decl, @Class(constants.%T) [symbolic = %Class.MakeSelf (constants.%Class.MakeSelf)] +// CHECK:STDOUT: %MakeSelf.ref: @Class.F.%Class.MakeSelf.type (%Class.MakeSelf.type) = name_ref MakeSelf, %.loc21_30 [symbolic = %Class.MakeSelf (constants.%Class.MakeSelf)] +// CHECK:STDOUT: %Class.MakeSelf.specific_fn.loc21_30.1: = specific_function %MakeSelf.ref, @Class.MakeSelf(constants.%T) [symbolic = %Class.MakeSelf.specific_fn.loc21_30.2 (constants.%Class.MakeSelf.specific_fn)] +// CHECK:STDOUT: %.loc21_5: ref @Class.F.%Class.loc21_26.2 (%Class) = splice_block %c.var {} +// CHECK:STDOUT: %Class.MakeSelf.call: init @Class.F.%Class.loc21_26.2 (%Class) to %.loc21_5 = call %Class.MakeSelf.specific_fn.loc21_30.1() // CHECK:STDOUT: assign %c.var, %Class.MakeSelf.call -// CHECK:STDOUT: %.loc21_19: type = splice_block %Class.loc21_19.1 [symbolic = %Class.loc21_19.2 (constants.%Class)] { +// CHECK:STDOUT: %.loc21_26: type = splice_block %Class.loc21_26.1 [symbolic = %Class.loc21_26.2 (constants.%Class)] { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [concrete = constants.%Class.generic] // CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc15_13.2 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %Class.loc21_19.1: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.loc21_19.2 (constants.%Class)] +// CHECK:STDOUT: %Class.loc21_26.1: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.loc21_26.2 (constants.%Class)] // CHECK:STDOUT: } -// CHECK:STDOUT: %c: ref @Class.F.%Class.loc21_19.2 (%Class) = ref_binding c, %c.var +// CHECK:STDOUT: %c: ref @Class.F.%Class.loc21_26.2 (%Class) = ref_binding c, %c.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %s.patt: @Class.F.%pattern_type (%pattern_type.466) = ref_binding_pattern s [concrete] // CHECK:STDOUT: %s.var_patt: @Class.F.%pattern_type (%pattern_type.466) = var_pattern %s.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %s.var: ref @Class.F.%Class.loc21_19.2 (%Class) = var %s.var_patt -// CHECK:STDOUT: %.loc22_19: @Class.F.%Class.MakeClass.type (%Class.MakeClass.type) = specific_constant @Class.%Class.MakeClass.decl, @Class(constants.%T) [symbolic = %Class.MakeClass (constants.%Class.MakeClass)] -// CHECK:STDOUT: %MakeClass.ref: @Class.F.%Class.MakeClass.type (%Class.MakeClass.type) = name_ref MakeClass, %.loc22_19 [symbolic = %Class.MakeClass (constants.%Class.MakeClass)] -// CHECK:STDOUT: %Class.MakeClass.specific_fn.loc22_19.1: = specific_function %MakeClass.ref, @Class.MakeClass(constants.%T) [symbolic = %Class.MakeClass.specific_fn.loc22_19.2 (constants.%Class.MakeClass.specific_fn)] -// CHECK:STDOUT: %.loc22_5.1: ref @Class.F.%Class.loc21_19.2 (%Class) = splice_block %s.var {} -// CHECK:STDOUT: %Class.MakeClass.call: init @Class.F.%Class.loc21_19.2 (%Class) to %.loc22_5.1 = call %Class.MakeClass.specific_fn.loc22_19.1() +// CHECK:STDOUT: %s.var: ref @Class.F.%Class.loc21_26.2 (%Class) = var %s.var_patt +// CHECK:STDOUT: %.loc22_26: @Class.F.%Class.MakeClass.type (%Class.MakeClass.type) = specific_constant @Class.%Class.MakeClass.decl, @Class(constants.%T) [symbolic = %Class.MakeClass (constants.%Class.MakeClass)] +// CHECK:STDOUT: %MakeClass.ref: @Class.F.%Class.MakeClass.type (%Class.MakeClass.type) = name_ref MakeClass, %.loc22_26 [symbolic = %Class.MakeClass (constants.%Class.MakeClass)] +// CHECK:STDOUT: %Class.MakeClass.specific_fn.loc22_26.1: = specific_function %MakeClass.ref, @Class.MakeClass(constants.%T) [symbolic = %Class.MakeClass.specific_fn.loc22_26.2 (constants.%Class.MakeClass.specific_fn)] +// CHECK:STDOUT: %.loc22_5.1: ref @Class.F.%Class.loc21_26.2 (%Class) = splice_block %s.var {} +// CHECK:STDOUT: %Class.MakeClass.call: init @Class.F.%Class.loc21_26.2 (%Class) to %.loc22_5.1 = call %Class.MakeClass.specific_fn.loc22_26.1() // CHECK:STDOUT: assign %s.var, %Class.MakeClass.call -// CHECK:STDOUT: %.loc22_12.1: type = splice_block %Self.ref [symbolic = %Class.loc21_19.2 (constants.%Class)] { -// CHECK:STDOUT: %.loc22_12.2: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class.loc21_19.2 (constants.%Class)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc22_12.2 [symbolic = %Class.loc21_19.2 (constants.%Class)] +// CHECK:STDOUT: %.loc22_19.1: type = splice_block %Self.ref [symbolic = %Class.loc21_26.2 (constants.%Class)] { +// CHECK:STDOUT: %.loc22_19.2: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class.loc21_26.2 (constants.%Class)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc22_19.2 [symbolic = %Class.loc21_26.2 (constants.%Class)] // CHECK:STDOUT: } -// CHECK:STDOUT: %s: ref @Class.F.%Class.loc21_19.2 (%Class) = ref_binding s, %s.var +// CHECK:STDOUT: %s: ref @Class.F.%Class.loc21_26.2 (%Class) = ref_binding s, %s.var // CHECK:STDOUT: %impl.elem0.loc22_5.1: @Class.F.%.loc22_5.2 (%.2f5) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_5.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc22_5.1: = bound_method %s.var, %impl.elem0.loc22_5.1 // CHECK:STDOUT: %specific_impl_fn.loc22_5.1: = specific_impl_function %impl.elem0.loc22_5.1, @Destroy.WithSelf.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.loc22_5.2 (constants.%specific_impl_fn)] diff --git a/toolchain/check/testdata/class/generic_method.carbon b/toolchain/check/testdata/class/generic_method.carbon index ceb7fb12be08..ada0ce6c50ab 100644 --- a/toolchain/check/testdata/class/generic_method.carbon +++ b/toolchain/check/testdata/class/generic_method.carbon @@ -17,7 +17,7 @@ class Class(T:! type) { fn F[self: Self](n: T); } -fn Class(T:! type).F[self: Self](n: T) {} +fn Class(T:! type).F[unused self: Self](unused n: T) {} // CHECK:STDOUT: --- generic_method.carbon // CHECK:STDOUT: @@ -68,9 +68,9 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc20: type = symbolic_binding T, 0 [symbolic = @Class.%T.loc15_13.1 (constants.%T)] // CHECK:STDOUT: %self.param.loc20: @Class.F.%Class (%Class) = value_param call_param0 -// CHECK:STDOUT: %.loc20_28.1: type = splice_block %Self.ref.loc20 [symbolic = %Class (constants.%Class)] { -// CHECK:STDOUT: %.loc20_28.2: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, %.loc20_28.2 [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %.loc20_35.1: type = splice_block %Self.ref.loc20 [symbolic = %Class (constants.%Class)] { +// CHECK:STDOUT: %.loc20_35.2: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, %.loc20_35.2 [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: } // CHECK:STDOUT: %self.loc20: @Class.F.%Class (%Class) = value_binding self, %self.param.loc20 // CHECK:STDOUT: %n.param.loc20: @Class.F.%T.loc17 (%T) = value_param call_param1 @@ -128,8 +128,8 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %pattern_type.loc17_20: type = pattern_type %T.loc17 [symbolic = %pattern_type.loc17_20 (constants.%pattern_type.51d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc20_26: = require_complete_type %Class [symbolic = %require_complete.loc20_26 (constants.%require_complete.43d)] -// CHECK:STDOUT: %require_complete.loc20_35: = require_complete_type %T.loc17 [symbolic = %require_complete.loc20_35 (constants.%require_complete.944)] +// CHECK:STDOUT: %require_complete.loc20_33: = require_complete_type %Class [symbolic = %require_complete.loc20_33 (constants.%require_complete.43d)] +// CHECK:STDOUT: %require_complete.loc20_49: = require_complete_type %T.loc17 [symbolic = %require_complete.loc20_49 (constants.%require_complete.944)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param.loc20: @Class.F.%Class (%Class), %n.param.loc20: @Class.F.%T.loc17 (%T)) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index 58515fdad794..0fe0103e1669 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -39,7 +39,7 @@ library "[[@TEST_NAME]]"; import library "a"; fn Run() { - var a: Empty = {}; + var unused a: Empty = {}; var b: Field = {.x = 1}; b.x = 2; @@ -48,9 +48,9 @@ fn Run() { c.F(); c.G(); - var d: ForwardDeclared* = &c; + var unused d: ForwardDeclared* = &c; - var e: Incomplete*; + var unused e: Incomplete*; } // CHECK:STDOUT: --- a.carbon @@ -323,9 +323,9 @@ fn Run() { // CHECK:STDOUT: %a.var_patt: %pattern_type.37d = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %Empty = var %a.var_patt -// CHECK:STDOUT: %.loc7_19.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc7_19.2: init %Empty to %a.var = class_init () [concrete = constants.%Empty.val] -// CHECK:STDOUT: %.loc7_3: init %Empty = converted %.loc7_19.1, %.loc7_19.2 [concrete = constants.%Empty.val] +// CHECK:STDOUT: %.loc7_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc7_26.2: init %Empty to %a.var = class_init () [concrete = constants.%Empty.val] +// CHECK:STDOUT: %.loc7_3: init %Empty = converted %.loc7_26.1, %.loc7_26.2 [concrete = constants.%Empty.val] // CHECK:STDOUT: assign %a.var, %.loc7_3 // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, imports.%Main.Empty [concrete = constants.%Empty] // CHECK:STDOUT: %a: ref %Empty = ref_binding a, %a.var @@ -388,10 +388,10 @@ fn Run() { // CHECK:STDOUT: %c.ref.loc16: ref %ForwardDeclared.20f323.1 = name_ref c, %c // CHECK:STDOUT: %addr: %ptr.006 = addr_of %c.ref.loc16 // CHECK:STDOUT: %impl.elem0.loc16: %.89b = impl_witness_access constants.%Copy.impl_witness.bef, element0 [concrete = constants.%ptr.as.Copy.impl.Op.d3c] -// CHECK:STDOUT: %bound_method.loc16_29.1: = bound_method %addr, %impl.elem0.loc16 +// CHECK:STDOUT: %bound_method.loc16_36.1: = bound_method %addr, %impl.elem0.loc16 // CHECK:STDOUT: %specific_fn.loc16: = specific_function %impl.elem0.loc16, @ptr.as.Copy.impl.Op(constants.%ForwardDeclared.20f323.1) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc16_29.2: = bound_method %addr, %specific_fn.loc16 -// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.006 = call %bound_method.loc16_29.2(%addr) +// CHECK:STDOUT: %bound_method.loc16_36.2: = bound_method %addr, %specific_fn.loc16 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.006 = call %bound_method.loc16_36.2(%addr) // CHECK:STDOUT: assign %d.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: %.loc16: type = splice_block %ptr.loc16 [concrete = constants.%ptr.006] { // CHECK:STDOUT: %ForwardDeclared.ref.loc16: type = name_ref ForwardDeclared, imports.%Main.ForwardDeclared [concrete = constants.%ForwardDeclared.20f323.1] diff --git a/toolchain/check/testdata/class/import_access.carbon b/toolchain/check/testdata/class/import_access.carbon index 435490086fc7..8b812543f973 100644 --- a/toolchain/check/testdata/class/import_access.carbon +++ b/toolchain/check/testdata/class/import_access.carbon @@ -104,7 +104,7 @@ var c: Test.ForwardWithDef = {}; impl package Test library "[[@TEST_NAME]]"; -fn F(c: Forward*) {} +fn F(unused c: Forward*) {} class Forward {} @@ -114,11 +114,11 @@ package Test library "[[@TEST_NAME]]"; import library "forward"; -// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:9: error: name `Forward` not found [NameNotFound] -// CHECK:STDERR: fn F(c: Forward*) {} -// CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:16: error: name `Forward` not found [NameNotFound] +// CHECK:STDERR: fn F(unused c: Forward*) {} +// CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -fn F(c: Forward*) {} +fn F(unused c: Forward*) {} // --- fail_other_forward.carbon @@ -126,11 +126,11 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward"; -// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+4]]:9: error: member name `Forward` not found in `Test` [MemberNameNotFoundInInstScope] -// CHECK:STDERR: fn F(c: Test.Forward*) {} -// CHECK:STDERR: ^~~~~~~~~~~~ +// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+4]]:16: error: member name `Forward` not found in `Test` [MemberNameNotFoundInInstScope] +// CHECK:STDERR: fn F(unused c: Test.Forward*) {} +// CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: -fn F(c: Test.Forward*) {} +fn F(unused c: Test.Forward*) {} // --- todo_fail_private_on_redecl.carbon diff --git a/toolchain/check/testdata/class/import_member_cycle.carbon b/toolchain/check/testdata/class/import_member_cycle.carbon index d4146a226f4d..dacaa476d446 100644 --- a/toolchain/check/testdata/class/import_member_cycle.carbon +++ b/toolchain/check/testdata/class/import_member_cycle.carbon @@ -27,7 +27,7 @@ library "[[@TEST_NAME]]"; import library "a"; fn Run() { - var a: Cycle*; + var unused a: Cycle*; } // CHECK:STDOUT: --- a.carbon diff --git a/toolchain/check/testdata/class/nested.carbon b/toolchain/check/testdata/class/nested.carbon index a96e26ad0536..fb47db569a24 100644 --- a/toolchain/check/testdata/class/nested.carbon +++ b/toolchain/check/testdata/class/nested.carbon @@ -15,8 +15,8 @@ class Outer { fn F() { // Outer and Inner are both complete here. - var o: Outer; - var i: Inner; + var unused o: Outer; + var unused i: Inner; } class Inner { @@ -26,15 +26,15 @@ class Outer { fn G() { // Outer and Inner are both complete here. - var o: Outer; - var i: Inner; + var unused o: Outer; + var unused i: Inner; } } fn H() { // Outer and Inner are both complete here. - var o: Outer; - var i: Inner; + var unused o: Outer; + var unused i: Inner; } var po: Self*; diff --git a/toolchain/check/testdata/class/nested_name.carbon b/toolchain/check/testdata/class/nested_name.carbon index 5e02fd90a8bd..1db91adf394b 100644 --- a/toolchain/check/testdata/class/nested_name.carbon +++ b/toolchain/check/testdata/class/nested_name.carbon @@ -23,7 +23,7 @@ fn F(oi: Outer.Inner) -> i32 { } fn G(o: Outer) { - var i: o.Inner; + var unused i: o.Inner; } // CHECK:STDOUT: --- nested_name.carbon diff --git a/toolchain/check/testdata/class/raw_self_type.carbon b/toolchain/check/testdata/class/raw_self_type.carbon index 567952154fc6..d2360fe02380 100644 --- a/toolchain/check/testdata/class/raw_self_type.carbon +++ b/toolchain/check/testdata/class/raw_self_type.carbon @@ -15,7 +15,7 @@ class Class { fn F() { var r#Self: Self*; - var p: Self* = r#Self; + var unused p: Self* = r#Self; } } @@ -25,7 +25,7 @@ class MemberNamedSelf { fn F(x: Self, y: r#Self); } -fn MemberNamedSelf.F(x: Self, y: r#Self) {} +fn MemberNamedSelf.F(unused x: Self, unused y: r#Self) {} // CHECK:STDOUT: --- raw_self_type.carbon // CHECK:STDOUT: @@ -89,10 +89,10 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: %y.param_patt: %pattern_type.f56 = value_param_pattern %y.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %x.param.loc28: %MemberNamedSelf = value_param call_param0 -// CHECK:STDOUT: %Self.ref.loc28_25: type = name_ref Self, constants.%MemberNamedSelf [concrete = constants.%MemberNamedSelf] +// CHECK:STDOUT: %Self.ref.loc28_32: type = name_ref Self, constants.%MemberNamedSelf [concrete = constants.%MemberNamedSelf] // CHECK:STDOUT: %x.loc28: %MemberNamedSelf = value_binding x, %x.param.loc28 // CHECK:STDOUT: %y.param.loc28: %Self.0d4 = value_param call_param1 -// CHECK:STDOUT: %Self.ref.loc28_34: type = name_ref r#Self, @MemberNamedSelf.%Self.decl [concrete = constants.%Self.0d4] +// CHECK:STDOUT: %Self.ref.loc28_48: type = name_ref r#Self, @MemberNamedSelf.%Self.decl [concrete = constants.%Self.0d4] // CHECK:STDOUT: %y.loc28: %Self.0d4 = value_binding y, %y.param.loc28 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -156,17 +156,17 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: %p.var_patt: %pattern_type.018 = var_pattern %p.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %p.var: ref %ptr.8e5 = var %p.var_patt -// CHECK:STDOUT: %Self.ref.loc18_20: ref %ptr.8e5 = name_ref r#Self, %Self -// CHECK:STDOUT: %.loc18_20: %ptr.8e5 = acquire_value %Self.ref.loc18_20 +// CHECK:STDOUT: %Self.ref.loc18_27: ref %ptr.8e5 = name_ref r#Self, %Self +// CHECK:STDOUT: %.loc18_27: %ptr.8e5 = acquire_value %Self.ref.loc18_27 // CHECK:STDOUT: %impl.elem0: %.370 = impl_witness_access constants.%Copy.impl_witness.9d3, element0 [concrete = constants.%ptr.as.Copy.impl.Op.120] -// CHECK:STDOUT: %bound_method.loc18_20.1: = bound_method %.loc18_20, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc18_27.1: = bound_method %.loc18_27, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%Class) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc18_20.2: = bound_method %.loc18_20, %specific_fn -// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.8e5 = call %bound_method.loc18_20.2(%.loc18_20) +// CHECK:STDOUT: %bound_method.loc18_27.2: = bound_method %.loc18_27, %specific_fn +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.8e5 = call %bound_method.loc18_27.2(%.loc18_27) // CHECK:STDOUT: assign %p.var, %ptr.as.Copy.impl.Op.call -// CHECK:STDOUT: %.loc18_16: type = splice_block %ptr.loc18 [concrete = constants.%ptr.8e5] { -// CHECK:STDOUT: %Self.ref.loc18_12: type = name_ref Self, constants.%Class [concrete = constants.%Class] -// CHECK:STDOUT: %ptr.loc18: type = ptr_type %Self.ref.loc18_12 [concrete = constants.%ptr.8e5] +// CHECK:STDOUT: %.loc18_23: type = splice_block %ptr.loc18 [concrete = constants.%ptr.8e5] { +// CHECK:STDOUT: %Self.ref.loc18_19: type = name_ref Self, constants.%Class [concrete = constants.%Class] +// CHECK:STDOUT: %ptr.loc18: type = ptr_type %Self.ref.loc18_19 [concrete = constants.%ptr.8e5] // CHECK:STDOUT: } // CHECK:STDOUT: %p: ref %ptr.8e5 = ref_binding p, %p.var // CHECK:STDOUT: %DestroyOp.bound.loc18: = bound_method %p.var, constants.%DestroyOp diff --git a/toolchain/check/testdata/class/redeclaration.carbon b/toolchain/check/testdata/class/redeclaration.carbon index a4eda07561b4..154ee8e44d06 100644 --- a/toolchain/check/testdata/class/redeclaration.carbon +++ b/toolchain/check/testdata/class/redeclaration.carbon @@ -18,7 +18,7 @@ class Class { fn F[self: Self](b: ()); } -fn Class.F[self: Self](b: ()) {} +fn Class.F[unused self: Self](unused b: ()) {} // CHECK:STDOUT: --- redeclaration.carbon // CHECK:STDOUT: @@ -59,9 +59,9 @@ fn Class.F[self: Self](b: ()) {} // CHECK:STDOUT: %Self.ref.loc21: type = name_ref Self, constants.%Class [concrete = constants.%Class] // CHECK:STDOUT: %self.loc21: %Class = value_binding self, %self.param.loc21 // CHECK:STDOUT: %b.param.loc21: %empty_tuple.type = value_param call_param1 -// CHECK:STDOUT: %.loc21_28.1: type = splice_block %.loc21_28.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc21_28.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc21_28.3: type = converted %.loc21_28.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc21_42.1: type = splice_block %.loc21_42.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc21_42.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc21_42.3: type = converted %.loc21_42.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %b.loc21: %empty_tuple.type = value_binding b, %b.param.loc21 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/reorder_qualified.carbon b/toolchain/check/testdata/class/reorder_qualified.carbon index 6bdd3c30eab7..9badb39d3ffb 100644 --- a/toolchain/check/testdata/class/reorder_qualified.carbon +++ b/toolchain/check/testdata/class/reorder_qualified.carbon @@ -30,10 +30,10 @@ class A { fn D.DF() { // A, B, C, and D are complete here. - var a: A = {.a = 1}; - var b: B = {.b = 2}; - var c: C = {.c = 3}; - var d: D = {.d = 4}; + var unused a: A = {.a = 1}; + var unused b: B = {.b = 2}; + var unused c: C = {.c = 3}; + var unused d: D = {.d = 4}; // Unqualified lookup looks in all of them. AF(); @@ -258,17 +258,17 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %A = var %a.var_patt // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc33_25.1: %struct_type.a.a6c = struct_literal (%int_1) [concrete = constants.%struct.48c] +// CHECK:STDOUT: %.loc33_32.1: %struct_type.a.a6c = struct_literal (%int_1) [concrete = constants.%struct.48c] // CHECK:STDOUT: %impl.elem0.loc33: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc33_25.1: = bound_method %int_1, %impl.elem0.loc33 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] +// CHECK:STDOUT: %bound_method.loc33_32.1: = bound_method %int_1, %impl.elem0.loc33 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] // CHECK:STDOUT: %specific_fn.loc33: = specific_function %impl.elem0.loc33, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc33_25.2: = bound_method %int_1, %specific_fn.loc33 [concrete = constants.%bound_method.38b] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc33: init %i32 = call %bound_method.loc33_25.2(%int_1) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc33_25.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc33 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc33_25.3: ref %i32 = class_element_access %a.var, element0 -// CHECK:STDOUT: %.loc33_25.4: init %i32 to %.loc33_25.3 = in_place_init %.loc33_25.2 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc33_25.5: init %A to %a.var = class_init (%.loc33_25.4) [concrete = constants.%A.val] -// CHECK:STDOUT: %.loc33_7: init %A = converted %.loc33_25.1, %.loc33_25.5 [concrete = constants.%A.val] +// CHECK:STDOUT: %bound_method.loc33_32.2: = bound_method %int_1, %specific_fn.loc33 [concrete = constants.%bound_method.38b] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc33: init %i32 = call %bound_method.loc33_32.2(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc33_32.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc33 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc33_32.3: ref %i32 = class_element_access %a.var, element0 +// CHECK:STDOUT: %.loc33_32.4: init %i32 to %.loc33_32.3 = in_place_init %.loc33_32.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc33_32.5: init %A to %a.var = class_init (%.loc33_32.4) [concrete = constants.%A.val] +// CHECK:STDOUT: %.loc33_7: init %A = converted %.loc33_32.1, %.loc33_32.5 [concrete = constants.%A.val] // CHECK:STDOUT: assign %a.var, %.loc33_7 // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A] // CHECK:STDOUT: %a: ref %A = ref_binding a, %a.var @@ -278,17 +278,17 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref %B = var %b.var_patt // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc34_25.1: %struct_type.b.a15 = struct_literal (%int_2) [concrete = constants.%struct.26f] +// CHECK:STDOUT: %.loc34_32.1: %struct_type.b.a15 = struct_literal (%int_2) [concrete = constants.%struct.26f] // CHECK:STDOUT: %impl.elem0.loc34: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc34_25.1: = bound_method %int_2, %impl.elem0.loc34 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] +// CHECK:STDOUT: %bound_method.loc34_32.1: = bound_method %int_2, %impl.elem0.loc34 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc34: = specific_function %impl.elem0.loc34, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc34_25.2: = bound_method %int_2, %specific_fn.loc34 [concrete = constants.%bound_method.646] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc34: init %i32 = call %bound_method.loc34_25.2(%int_2) [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc34_25.2: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc34 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc34_25.3: ref %i32 = class_element_access %b.var, element0 -// CHECK:STDOUT: %.loc34_25.4: init %i32 to %.loc34_25.3 = in_place_init %.loc34_25.2 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc34_25.5: init %B to %b.var = class_init (%.loc34_25.4) [concrete = constants.%B.val] -// CHECK:STDOUT: %.loc34_7: init %B = converted %.loc34_25.1, %.loc34_25.5 [concrete = constants.%B.val] +// CHECK:STDOUT: %bound_method.loc34_32.2: = bound_method %int_2, %specific_fn.loc34 [concrete = constants.%bound_method.646] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc34: init %i32 = call %bound_method.loc34_32.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc34_32.2: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc34 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc34_32.3: ref %i32 = class_element_access %b.var, element0 +// CHECK:STDOUT: %.loc34_32.4: init %i32 to %.loc34_32.3 = in_place_init %.loc34_32.2 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc34_32.5: init %B to %b.var = class_init (%.loc34_32.4) [concrete = constants.%B.val] +// CHECK:STDOUT: %.loc34_7: init %B = converted %.loc34_32.1, %.loc34_32.5 [concrete = constants.%B.val] // CHECK:STDOUT: assign %b.var, %.loc34_7 // CHECK:STDOUT: %B.ref: type = name_ref B, @A.%B.decl [concrete = constants.%B] // CHECK:STDOUT: %b: ref %B = ref_binding b, %b.var @@ -298,17 +298,17 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: %c.var: ref %C = var %c.var_patt // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] -// CHECK:STDOUT: %.loc35_25.1: %struct_type.c.5b8 = struct_literal (%int_3) [concrete = constants.%struct.d98] +// CHECK:STDOUT: %.loc35_32.1: %struct_type.c.5b8 = struct_literal (%int_3) [concrete = constants.%struct.d98] // CHECK:STDOUT: %impl.elem0.loc35: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc35_25.1: = bound_method %int_3, %impl.elem0.loc35 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] +// CHECK:STDOUT: %bound_method.loc35_32.1: = bound_method %int_3, %impl.elem0.loc35 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] // CHECK:STDOUT: %specific_fn.loc35: = specific_function %impl.elem0.loc35, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc35_25.2: = bound_method %int_3, %specific_fn.loc35 [concrete = constants.%bound_method.fa7] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc35: init %i32 = call %bound_method.loc35_25.2(%int_3) [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc35_25.2: init %i32 = converted %int_3, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc35 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc35_25.3: ref %i32 = class_element_access %c.var, element0 -// CHECK:STDOUT: %.loc35_25.4: init %i32 to %.loc35_25.3 = in_place_init %.loc35_25.2 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc35_25.5: init %C to %c.var = class_init (%.loc35_25.4) [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc35_7: init %C = converted %.loc35_25.1, %.loc35_25.5 [concrete = constants.%C.val] +// CHECK:STDOUT: %bound_method.loc35_32.2: = bound_method %int_3, %specific_fn.loc35 [concrete = constants.%bound_method.fa7] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc35: init %i32 = call %bound_method.loc35_32.2(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc35_32.2: init %i32 = converted %int_3, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc35 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc35_32.3: ref %i32 = class_element_access %c.var, element0 +// CHECK:STDOUT: %.loc35_32.4: init %i32 to %.loc35_32.3 = in_place_init %.loc35_32.2 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc35_32.5: init %C to %c.var = class_init (%.loc35_32.4) [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc35_7: init %C = converted %.loc35_32.1, %.loc35_32.5 [concrete = constants.%C.val] // CHECK:STDOUT: assign %c.var, %.loc35_7 // CHECK:STDOUT: %C.ref: type = name_ref C, @B.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %c: ref %C = ref_binding c, %c.var @@ -318,17 +318,17 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: %d.var: ref %D = var %d.var_patt // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] -// CHECK:STDOUT: %.loc36_25.1: %struct_type.d.3ea = struct_literal (%int_4) [concrete = constants.%struct.5a9] +// CHECK:STDOUT: %.loc36_32.1: %struct_type.d.3ea = struct_literal (%int_4) [concrete = constants.%struct.5a9] // CHECK:STDOUT: %impl.elem0.loc36: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc36_25.1: = bound_method %int_4, %impl.elem0.loc36 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c] +// CHECK:STDOUT: %bound_method.loc36_32.1: = bound_method %int_4, %impl.elem0.loc36 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c] // CHECK:STDOUT: %specific_fn.loc36: = specific_function %impl.elem0.loc36, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc36_25.2: = bound_method %int_4, %specific_fn.loc36 [concrete = constants.%bound_method.6d7] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc36: init %i32 = call %bound_method.loc36_25.2(%int_4) [concrete = constants.%int_4.940] -// CHECK:STDOUT: %.loc36_25.2: init %i32 = converted %int_4, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc36 [concrete = constants.%int_4.940] -// CHECK:STDOUT: %.loc36_25.3: ref %i32 = class_element_access %d.var, element0 -// CHECK:STDOUT: %.loc36_25.4: init %i32 to %.loc36_25.3 = in_place_init %.loc36_25.2 [concrete = constants.%int_4.940] -// CHECK:STDOUT: %.loc36_25.5: init %D to %d.var = class_init (%.loc36_25.4) [concrete = constants.%D.val] -// CHECK:STDOUT: %.loc36_7: init %D = converted %.loc36_25.1, %.loc36_25.5 [concrete = constants.%D.val] +// CHECK:STDOUT: %bound_method.loc36_32.2: = bound_method %int_4, %specific_fn.loc36 [concrete = constants.%bound_method.6d7] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc36: init %i32 = call %bound_method.loc36_32.2(%int_4) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %.loc36_32.2: init %i32 = converted %int_4, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc36 [concrete = constants.%int_4.940] +// CHECK:STDOUT: %.loc36_32.3: ref %i32 = class_element_access %d.var, element0 +// CHECK:STDOUT: %.loc36_32.4: init %i32 to %.loc36_32.3 = in_place_init %.loc36_32.2 [concrete = constants.%int_4.940] +// CHECK:STDOUT: %.loc36_32.5: init %D to %d.var = class_init (%.loc36_32.4) [concrete = constants.%D.val] +// CHECK:STDOUT: %.loc36_7: init %D = converted %.loc36_32.1, %.loc36_32.5 [concrete = constants.%D.val] // CHECK:STDOUT: assign %d.var, %.loc36_7 // CHECK:STDOUT: %D.ref: type = name_ref D, @C.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %d: ref %D = ref_binding d, %d.var diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index f71d1ec843df..fe5a02fc9a1f 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -27,8 +27,8 @@ fn F() -> i32 { } fn Run() { - var a: i32 = F(); - var b: i32 = Class.F(); + var unused a: i32 = F(); + var unused b: i32 = Class.F(); } // CHECK:STDOUT: --- scope.carbon diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index b0eb287e6934..c2a846701df4 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -38,7 +38,7 @@ class Derived { } fn Use() { - var d: Derived = {.base = {}}; + var unused d: Derived = {.base = {}}; } // --- todo_fail_later_base.carbon @@ -59,7 +59,7 @@ library "[[@TEST_NAME]]"; import Modifiers; fn F() { - var v: Modifiers.Base = {}; + var unused v: Modifiers.Base = {}; } // --- impl_abstract.carbon @@ -94,9 +94,9 @@ class C { } fn Use() { - var b1: B1 = {}; - var b2: B2 = {.base = {}}; - var c: C = {.base = {.base = {}}}; + var unused b1: B1 = {}; + var unused b2: B2 = {.base = {}}; + var unused c: C = {.base = {.base = {}}}; } // --- fail_modifiers.carbon @@ -125,7 +125,7 @@ base class Base { fn F() { var i: i32 = 3; var b1: Base = {.m2 = i, .m1 = i}; - var b2: Base = {.m2 = 3, .m1 = 5}; + var unused b2: Base = {.m2 = 3, .m1 = 5}; b1.m2 = 4; } @@ -211,7 +211,7 @@ class T2 { } impl T2 as Core.ImplicitAs(T1) { - fn Convert[self: Self]() -> T1 { + fn Convert[unused self: Self]() -> T1 { return {}; } } @@ -256,12 +256,12 @@ class T1 { } base class Base(T:! type) { - virtual fn F[self: Self](t: T) { } + virtual fn F[unused self: Self](unused t: T) { } } class Derived { extend base: Base(T1); - override fn F[self: Self](t: T1) { } + override fn F[unused self: Self](unused t: T1) { } } // --- fail_virtual_without_self.carbon @@ -339,7 +339,7 @@ base class T1(T:! type) { library "[[@TEST_NAME]]"; base class T1(T:! type) { - virtual fn F[self: Self]() { } + virtual fn F[unused self: Self]() { } } // --- with_dependent_arg.carbon @@ -347,7 +347,7 @@ base class T1(T:! type) { library "[[@TEST_NAME]]"; base class T1(T:! type) { - virtual fn F[self: Self](t: T) { } + virtual fn F[unused self: Self](unused t: T) { } } // --- vtable_import_unneeded.carbon @@ -363,14 +363,14 @@ fn F(b: Modifiers.Base); library "[[@TEST_NAME]]"; base class NonGenericBase { - virtual fn F1[self: Self]() { } - virtual fn F2[self: Self]() { } + virtual fn F1[unused self: Self]() { } + virtual fn F2[unused self: Self]() { } } base class GenericDerived(T:! type) { extend base: NonGenericBase; - override fn F2[self: Self]() { } - virtual fn F3[self: Self]() { } + override fn F2[unused self: Self]() { } + virtual fn F3[unused self: Self]() { } } // --- nongeneric_derived_from_generic.carbon @@ -378,16 +378,16 @@ base class GenericDerived(T:! type) { library "[[@TEST_NAME]]"; base class GenericBase(T:! type) { - virtual fn F1[self: Self]() { } - virtual fn F2[self: Self]() { } + virtual fn F1[unused self: Self]() { } + virtual fn F2[unused self: Self]() { } } class T1; base class NonGenericDerived { extend base: GenericBase(T1); - override fn F2[self: Self]() { } - virtual fn F3[self: Self]() { } + override fn F2[unused self: Self]() { } + virtual fn F3[unused self: Self]() { } } // --- impl_generic_specifically.carbon @@ -395,12 +395,12 @@ base class NonGenericDerived { library "[[@TEST_NAME]]"; base class Base(T:! type) { - virtual fn F[self: Self](t: Base(T)*) { } + virtual fn F[unused self: Self](unused t: Base(T)*) { } } class T1; class D1 { extend base: Base(T1); - override fn F[self: Self](t: Base(T1)*) { } + override fn F[unused self: Self](unused t: Base(T1)*) { } } // --- fail_impl_generic_specifically_mismatch.carbon @@ -411,19 +411,19 @@ class T1; class T2; base class Base(T:! type) { - virtual fn F[self: Self](t: T1*) { } + virtual fn F[unused self: Self](unused t: T1*) { } } class D1 { extend base: Base(T1); - // CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon:[[@LINE+7]]:29: error: type `` of parameter 1 in redeclaration differs from previous parameter type `` [RedeclParamDiffersType] - // CHECK:STDERR: override fn F[self: Self](t: T2*) { } - // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon:[[@LINE-8]]:28: note: previous declaration's corresponding parameter here [RedeclParamPrevious] - // CHECK:STDERR: virtual fn F[self: Self](t: T1*) { } - // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon:[[@LINE+7]]:43: error: type `` of parameter 1 in redeclaration differs from previous parameter type `` [RedeclParamDiffersType] + // CHECK:STDERR: override fn F[unused self: Self](unused t: T2*) { } + // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon:[[@LINE-8]]:42: note: previous declaration's corresponding parameter here [RedeclParamPrevious] + // CHECK:STDERR: virtual fn F[unused self: Self](unused t: T1*) { } + // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: - override fn F[self: Self](t: T2*) { } + override fn F[unused self: Self](unused t: T2*) { } } // --- fail_impl_generic_generic_mismatch.carbon @@ -431,18 +431,18 @@ class D1 { library "[[@TEST_NAME]]"; abstract class Base(T:! type) { - virtual fn F[self: Self](t: T*) { } + virtual fn F[unused self: Self](unused t: T*) { } } class Derived(T:! type) { extend base: Base(T); - // CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon:[[@LINE+7]]:29: error: type `` of parameter 1 in redeclaration differs from previous parameter type `` [RedeclParamDiffersType] - // CHECK:STDERR: override fn F[self: Self](t: T) { } - // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon:[[@LINE-7]]:28: note: previous declaration's corresponding parameter here [RedeclParamPrevious] - // CHECK:STDERR: virtual fn F[self: Self](t: T*) { } - // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon:[[@LINE+7]]:43: error: type `` of parameter 1 in redeclaration differs from previous parameter type `` [RedeclParamDiffersType] + // CHECK:STDERR: override fn F[unused self: Self](unused t: T) { } + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon:[[@LINE-7]]:42: note: previous declaration's corresponding parameter here [RedeclParamPrevious] + // CHECK:STDERR: virtual fn F[unused self: Self](unused t: T*) { } + // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - override fn F[self: Self](t: T) { } + override fn F[unused self: Self](unused t: T) { } } // --- impl_generic_generic.carbon @@ -450,11 +450,11 @@ class Derived(T:! type) { library "[[@TEST_NAME]]"; abstract class Base(T:! type) { - virtual fn F[self: Self](t: T) { } + virtual fn F[unused self: Self](unused t: T) { } } class Derived(T:! type) { extend base: Base(T*); - override fn F[self: Self](t: T*) { } + override fn F[unused self: Self](unused t: T*) { } } // --- abstract_generic_undefined.carbon @@ -469,7 +469,7 @@ class T1; class Derived { extend base: Base(T1); - override fn F[self: Self]() { } + override fn F[unused self: Self]() { } } // --- generic_lib.carbon @@ -477,7 +477,7 @@ class Derived { library "[[@TEST_NAME]]"; base class Base(T:! type) { - virtual fn F[self: Self]() { } + virtual fn F[unused self: Self]() { } } // --- generic_import.carbon @@ -494,7 +494,7 @@ var v: Base(T1) = {}; library "[[@TEST_NAME]]"; base class T1(G1:! type) { - virtual fn F[self: Self]() { } + virtual fn F[unused self: Self]() { } } class T2(G2:! type) { @@ -506,7 +506,7 @@ class T2(G2:! type) { library "[[@TEST_NAME]]"; base class T1(G1:! type) { - virtual fn F[self: Self]() { } + virtual fn F[unused self: Self]() { } } class T2(G2:! type) { @@ -733,16 +733,16 @@ class T2(G2:! type) { // CHECK:STDOUT: %d.var_patt: %pattern_type.9f6 = var_pattern %d.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %d.var: ref %Derived = var %d.var_patt -// CHECK:STDOUT: %.loc12_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc12_31.1: %struct_type.base.f5e = struct_literal (%.loc12_30.1) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc12_31.2: ref %Base = class_element_access %d.var, element0 -// CHECK:STDOUT: %.loc12_30.2: ref %ptr.454 = class_element_access %.loc12_31.2, element0 +// CHECK:STDOUT: %.loc12_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc12_38.1: %struct_type.base.f5e = struct_literal (%.loc12_37.1) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc12_38.2: ref %Base = class_element_access %d.var, element0 +// CHECK:STDOUT: %.loc12_37.2: ref %ptr.454 = class_element_access %.loc12_38.2, element0 // CHECK:STDOUT: %Derived.vtable_ptr: ref %ptr.454 = vtable_ptr @Derived.vtable [concrete = constants.%Derived.vtable_ptr] -// CHECK:STDOUT: %.loc12_30.3: init %ptr.454 to %.loc12_30.2 = in_place_init %Derived.vtable_ptr [concrete = constants.%Derived.vtable_ptr] -// CHECK:STDOUT: %.loc12_30.4: init %Base to %.loc12_31.2 = class_init (%.loc12_30.3) [concrete = constants.%Base.val] -// CHECK:STDOUT: %.loc12_31.3: init %Base = converted %.loc12_30.1, %.loc12_30.4 [concrete = constants.%Base.val] -// CHECK:STDOUT: %.loc12_31.4: init %Derived to %d.var = class_init (%.loc12_31.3) [concrete = constants.%Derived.val] -// CHECK:STDOUT: %.loc12_3: init %Derived = converted %.loc12_31.1, %.loc12_31.4 [concrete = constants.%Derived.val] +// CHECK:STDOUT: %.loc12_37.3: init %ptr.454 to %.loc12_37.2 = in_place_init %Derived.vtable_ptr [concrete = constants.%Derived.vtable_ptr] +// CHECK:STDOUT: %.loc12_37.4: init %Base to %.loc12_38.2 = class_init (%.loc12_37.3) [concrete = constants.%Base.val] +// CHECK:STDOUT: %.loc12_38.3: init %Base = converted %.loc12_37.1, %.loc12_37.4 [concrete = constants.%Base.val] +// CHECK:STDOUT: %.loc12_38.4: init %Derived to %d.var = class_init (%.loc12_38.3) [concrete = constants.%Derived.val] +// CHECK:STDOUT: %.loc12_3: init %Derived = converted %.loc12_38.1, %.loc12_38.4 [concrete = constants.%Derived.val] // CHECK:STDOUT: assign %d.var, %.loc12_3 // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived] // CHECK:STDOUT: %d: ref %Derived = ref_binding d, %d.var @@ -919,14 +919,14 @@ class T2(G2:! type) { // CHECK:STDOUT: %v.var_patt: %pattern_type.80f = var_pattern %v.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %Base = var %v.var_patt -// CHECK:STDOUT: %.loc7_28.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc7_28.2: ref %ptr.454 = class_element_access %v.var, element0 +// CHECK:STDOUT: %.loc7_35.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc7_35.2: ref %ptr.454 = class_element_access %v.var, element0 // CHECK:STDOUT: %Base.vtable_ptr: ref %ptr.454 = vtable_ptr @Base.vtable [concrete = constants.%Base.vtable_ptr] -// CHECK:STDOUT: %.loc7_28.3: init %ptr.454 to %.loc7_28.2 = in_place_init %Base.vtable_ptr [concrete = constants.%Base.vtable_ptr] -// CHECK:STDOUT: %.loc7_28.4: init %Base to %v.var = class_init (%.loc7_28.3) [concrete = constants.%Base.val] -// CHECK:STDOUT: %.loc7_3: init %Base = converted %.loc7_28.1, %.loc7_28.4 [concrete = constants.%Base.val] +// CHECK:STDOUT: %.loc7_35.3: init %ptr.454 to %.loc7_35.2 = in_place_init %Base.vtable_ptr [concrete = constants.%Base.vtable_ptr] +// CHECK:STDOUT: %.loc7_35.4: init %Base to %v.var = class_init (%.loc7_35.3) [concrete = constants.%Base.val] +// CHECK:STDOUT: %.loc7_3: init %Base = converted %.loc7_35.1, %.loc7_35.4 [concrete = constants.%Base.val] // CHECK:STDOUT: assign %v.var, %.loc7_3 -// CHECK:STDOUT: %.loc7_19: type = splice_block %Base.ref [concrete = constants.%Base] { +// CHECK:STDOUT: %.loc7_26: type = splice_block %Base.ref [concrete = constants.%Base] { // CHECK:STDOUT: %Modifiers.ref: = name_ref Modifiers, imports.%Modifiers [concrete = imports.%Modifiers] // CHECK:STDOUT: %Base.ref: type = name_ref Base, imports.%Modifiers.Base [concrete = constants.%Base] // CHECK:STDOUT: } @@ -1204,12 +1204,12 @@ class T2(G2:! type) { // CHECK:STDOUT: %b1.var_patt: %pattern_type.748 = var_pattern %b1.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %b1.var: ref %B1 = var %b1.var_patt -// CHECK:STDOUT: %.loc19_17.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc19_17.2: ref %ptr.454 = class_element_access %b1.var, element0 +// CHECK:STDOUT: %.loc19_24.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc19_24.2: ref %ptr.454 = class_element_access %b1.var, element0 // CHECK:STDOUT: %B1.vtable_ptr: ref %ptr.454 = vtable_ptr @B1.vtable [concrete = constants.%B1.vtable_ptr] -// CHECK:STDOUT: %.loc19_17.3: init %ptr.454 to %.loc19_17.2 = in_place_init %B1.vtable_ptr [concrete = constants.%B1.vtable_ptr] -// CHECK:STDOUT: %.loc19_17.4: init %B1 to %b1.var = class_init (%.loc19_17.3) [concrete = constants.%B1.val.d17] -// CHECK:STDOUT: %.loc19_3: init %B1 = converted %.loc19_17.1, %.loc19_17.4 [concrete = constants.%B1.val.d17] +// CHECK:STDOUT: %.loc19_24.3: init %ptr.454 to %.loc19_24.2 = in_place_init %B1.vtable_ptr [concrete = constants.%B1.vtable_ptr] +// CHECK:STDOUT: %.loc19_24.4: init %B1 to %b1.var = class_init (%.loc19_24.3) [concrete = constants.%B1.val.d17] +// CHECK:STDOUT: %.loc19_3: init %B1 = converted %.loc19_24.1, %.loc19_24.4 [concrete = constants.%B1.val.d17] // CHECK:STDOUT: assign %b1.var, %.loc19_3 // CHECK:STDOUT: %B1.ref: type = name_ref B1, file.%B1.decl [concrete = constants.%B1] // CHECK:STDOUT: %b1: ref %B1 = ref_binding b1, %b1.var @@ -1218,16 +1218,16 @@ class T2(G2:! type) { // CHECK:STDOUT: %b2.var_patt: %pattern_type.8b5 = var_pattern %b2.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %b2.var: ref %B2 = var %b2.var_patt -// CHECK:STDOUT: %.loc20_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc20_27.1: %struct_type.base.f5e = struct_literal (%.loc20_26.1) [concrete = constants.%struct.6b1] -// CHECK:STDOUT: %.loc20_27.2: ref %B1 = class_element_access %b2.var, element0 -// CHECK:STDOUT: %.loc20_26.2: ref %ptr.454 = class_element_access %.loc20_27.2, element0 +// CHECK:STDOUT: %.loc20_33.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc20_34.1: %struct_type.base.f5e = struct_literal (%.loc20_33.1) [concrete = constants.%struct.6b1] +// CHECK:STDOUT: %.loc20_34.2: ref %B1 = class_element_access %b2.var, element0 +// CHECK:STDOUT: %.loc20_33.2: ref %ptr.454 = class_element_access %.loc20_34.2, element0 // CHECK:STDOUT: %B2.vtable_ptr: ref %ptr.454 = vtable_ptr @B2.vtable [concrete = constants.%B2.vtable_ptr] -// CHECK:STDOUT: %.loc20_26.3: init %ptr.454 to %.loc20_26.2 = in_place_init %B2.vtable_ptr [concrete = constants.%B2.vtable_ptr] -// CHECK:STDOUT: %.loc20_26.4: init %B1 to %.loc20_27.2 = class_init (%.loc20_26.3) [concrete = constants.%B1.val.f0b] -// CHECK:STDOUT: %.loc20_27.3: init %B1 = converted %.loc20_26.1, %.loc20_26.4 [concrete = constants.%B1.val.f0b] -// CHECK:STDOUT: %.loc20_27.4: init %B2 to %b2.var = class_init (%.loc20_27.3) [concrete = constants.%B2.val.e28] -// CHECK:STDOUT: %.loc20_3: init %B2 = converted %.loc20_27.1, %.loc20_27.4 [concrete = constants.%B2.val.e28] +// CHECK:STDOUT: %.loc20_33.3: init %ptr.454 to %.loc20_33.2 = in_place_init %B2.vtable_ptr [concrete = constants.%B2.vtable_ptr] +// CHECK:STDOUT: %.loc20_33.4: init %B1 to %.loc20_34.2 = class_init (%.loc20_33.3) [concrete = constants.%B1.val.f0b] +// CHECK:STDOUT: %.loc20_34.3: init %B1 = converted %.loc20_33.1, %.loc20_33.4 [concrete = constants.%B1.val.f0b] +// CHECK:STDOUT: %.loc20_34.4: init %B2 to %b2.var = class_init (%.loc20_34.3) [concrete = constants.%B2.val.e28] +// CHECK:STDOUT: %.loc20_3: init %B2 = converted %.loc20_34.1, %.loc20_34.4 [concrete = constants.%B2.val.e28] // CHECK:STDOUT: assign %b2.var, %.loc20_3 // CHECK:STDOUT: %B2.ref: type = name_ref B2, file.%B2.decl [concrete = constants.%B2] // CHECK:STDOUT: %b2: ref %B2 = ref_binding b2, %b2.var @@ -1236,20 +1236,20 @@ class T2(G2:! type) { // CHECK:STDOUT: %c.var_patt: %pattern_type.7c7 = var_pattern %c.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c.var: ref %C = var %c.var_patt -// CHECK:STDOUT: %.loc21_33.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc21_34.1: %struct_type.base.f5e = struct_literal (%.loc21_33.1) [concrete = constants.%struct.6b1] -// CHECK:STDOUT: %.loc21_35.1: %struct_type.base.a0c = struct_literal (%.loc21_34.1) [concrete = constants.%struct.83e] -// CHECK:STDOUT: %.loc21_35.2: ref %B2 = class_element_access %c.var, element0 -// CHECK:STDOUT: %.loc21_34.2: ref %B1 = class_element_access %.loc21_35.2, element0 -// CHECK:STDOUT: %.loc21_33.2: ref %ptr.454 = class_element_access %.loc21_34.2, element0 +// CHECK:STDOUT: %.loc21_40.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc21_41.1: %struct_type.base.f5e = struct_literal (%.loc21_40.1) [concrete = constants.%struct.6b1] +// CHECK:STDOUT: %.loc21_42.1: %struct_type.base.a0c = struct_literal (%.loc21_41.1) [concrete = constants.%struct.83e] +// CHECK:STDOUT: %.loc21_42.2: ref %B2 = class_element_access %c.var, element0 +// CHECK:STDOUT: %.loc21_41.2: ref %B1 = class_element_access %.loc21_42.2, element0 +// CHECK:STDOUT: %.loc21_40.2: ref %ptr.454 = class_element_access %.loc21_41.2, element0 // CHECK:STDOUT: %C.vtable_ptr: ref %ptr.454 = vtable_ptr @C.vtable [concrete = constants.%C.vtable_ptr] -// CHECK:STDOUT: %.loc21_33.3: init %ptr.454 to %.loc21_33.2 = in_place_init %C.vtable_ptr [concrete = constants.%C.vtable_ptr] -// CHECK:STDOUT: %.loc21_33.4: init %B1 to %.loc21_34.2 = class_init (%.loc21_33.3) [concrete = constants.%B1.val.dd4] -// CHECK:STDOUT: %.loc21_34.3: init %B1 = converted %.loc21_33.1, %.loc21_33.4 [concrete = constants.%B1.val.dd4] -// CHECK:STDOUT: %.loc21_34.4: init %B2 to %.loc21_35.2 = class_init (%.loc21_34.3) [concrete = constants.%B2.val.b52] -// CHECK:STDOUT: %.loc21_35.3: init %B2 = converted %.loc21_34.1, %.loc21_34.4 [concrete = constants.%B2.val.b52] -// CHECK:STDOUT: %.loc21_35.4: init %C to %c.var = class_init (%.loc21_35.3) [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc21_3: init %C = converted %.loc21_35.1, %.loc21_35.4 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc21_40.3: init %ptr.454 to %.loc21_40.2 = in_place_init %C.vtable_ptr [concrete = constants.%C.vtable_ptr] +// CHECK:STDOUT: %.loc21_40.4: init %B1 to %.loc21_41.2 = class_init (%.loc21_40.3) [concrete = constants.%B1.val.dd4] +// CHECK:STDOUT: %.loc21_41.3: init %B1 = converted %.loc21_40.1, %.loc21_40.4 [concrete = constants.%B1.val.dd4] +// CHECK:STDOUT: %.loc21_41.4: init %B2 to %.loc21_42.2 = class_init (%.loc21_41.3) [concrete = constants.%B2.val.b52] +// CHECK:STDOUT: %.loc21_42.3: init %B2 = converted %.loc21_41.1, %.loc21_41.4 [concrete = constants.%B2.val.b52] +// CHECK:STDOUT: %.loc21_42.4: init %C to %c.var = class_init (%.loc21_42.3) [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc21_3: init %C = converted %.loc21_42.1, %.loc21_42.4 [concrete = constants.%C.val] // CHECK:STDOUT: assign %c.var, %.loc21_3 // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %c: ref %C = ref_binding c, %c.var @@ -1504,28 +1504,28 @@ class T2(G2:! type) { // CHECK:STDOUT: %b2.var: ref %Base = var %b2.var_patt // CHECK:STDOUT: %int_3.loc14: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b] -// CHECK:STDOUT: %.loc14_35.1: %struct_type.m2.m1.5f2 = struct_literal (%int_3.loc14, %int_5) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc14_35.2: ref %ptr.454 = class_element_access %b2.var, element0 +// CHECK:STDOUT: %.loc14_42.1: %struct_type.m2.m1.5f2 = struct_literal (%int_3.loc14, %int_5) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc14_42.2: ref %ptr.454 = class_element_access %b2.var, element0 // CHECK:STDOUT: %Base.vtable_ptr.loc14: ref %ptr.454 = vtable_ptr @Base.vtable [concrete = constants.%Base.vtable_ptr] -// CHECK:STDOUT: %.loc14_35.3: init %ptr.454 to %.loc14_35.2 = in_place_init %Base.vtable_ptr.loc14 [concrete = constants.%Base.vtable_ptr] -// CHECK:STDOUT: %impl.elem0.loc14_35.1: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc14_35.1: = bound_method %int_5, %impl.elem0.loc14_35.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.005] -// CHECK:STDOUT: %specific_fn.loc14_35.1: = specific_function %impl.elem0.loc14_35.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc14_35.2: = bound_method %int_5, %specific_fn.loc14_35.1 [concrete = constants.%bound_method.e9d] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_35.1: init %i32 = call %bound_method.loc14_35.2(%int_5) [concrete = constants.%int_5.0f6] -// CHECK:STDOUT: %.loc14_35.4: init %i32 = converted %int_5, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_35.1 [concrete = constants.%int_5.0f6] -// CHECK:STDOUT: %.loc14_35.5: ref %i32 = class_element_access %b2.var, element2 -// CHECK:STDOUT: %.loc14_35.6: init %i32 to %.loc14_35.5 = in_place_init %.loc14_35.4 [concrete = constants.%int_5.0f6] -// CHECK:STDOUT: %impl.elem0.loc14_35.2: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc14_35.3: = bound_method %int_3.loc14, %impl.elem0.loc14_35.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] -// CHECK:STDOUT: %specific_fn.loc14_35.2: = specific_function %impl.elem0.loc14_35.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc14_35.4: = bound_method %int_3.loc14, %specific_fn.loc14_35.2 [concrete = constants.%bound_method.fa7] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_35.2: init %i32 = call %bound_method.loc14_35.4(%int_3.loc14) [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc14_35.7: init %i32 = converted %int_3.loc14, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_35.2 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc14_35.8: ref %i32 = class_element_access %b2.var, element1 -// CHECK:STDOUT: %.loc14_35.9: init %i32 to %.loc14_35.8 = in_place_init %.loc14_35.7 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc14_35.10: init %Base to %b2.var = class_init (%.loc14_35.3, %.loc14_35.6, %.loc14_35.9) [concrete = constants.%Base.val] -// CHECK:STDOUT: %.loc14_3: init %Base = converted %.loc14_35.1, %.loc14_35.10 [concrete = constants.%Base.val] +// CHECK:STDOUT: %.loc14_42.3: init %ptr.454 to %.loc14_42.2 = in_place_init %Base.vtable_ptr.loc14 [concrete = constants.%Base.vtable_ptr] +// CHECK:STDOUT: %impl.elem0.loc14_42.1: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc14_42.1: = bound_method %int_5, %impl.elem0.loc14_42.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.005] +// CHECK:STDOUT: %specific_fn.loc14_42.1: = specific_function %impl.elem0.loc14_42.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_42.2: = bound_method %int_5, %specific_fn.loc14_42.1 [concrete = constants.%bound_method.e9d] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_42.1: init %i32 = call %bound_method.loc14_42.2(%int_5) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %.loc14_42.4: init %i32 = converted %int_5, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_42.1 [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %.loc14_42.5: ref %i32 = class_element_access %b2.var, element2 +// CHECK:STDOUT: %.loc14_42.6: init %i32 to %.loc14_42.5 = in_place_init %.loc14_42.4 [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %impl.elem0.loc14_42.2: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc14_42.3: = bound_method %int_3.loc14, %impl.elem0.loc14_42.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] +// CHECK:STDOUT: %specific_fn.loc14_42.2: = specific_function %impl.elem0.loc14_42.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_42.4: = bound_method %int_3.loc14, %specific_fn.loc14_42.2 [concrete = constants.%bound_method.fa7] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_42.2: init %i32 = call %bound_method.loc14_42.4(%int_3.loc14) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc14_42.7: init %i32 = converted %int_3.loc14, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_42.2 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc14_42.8: ref %i32 = class_element_access %b2.var, element1 +// CHECK:STDOUT: %.loc14_42.9: init %i32 to %.loc14_42.8 = in_place_init %.loc14_42.7 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc14_42.10: init %Base to %b2.var = class_init (%.loc14_42.3, %.loc14_42.6, %.loc14_42.9) [concrete = constants.%Base.val] +// CHECK:STDOUT: %.loc14_3: init %Base = converted %.loc14_42.1, %.loc14_42.10 [concrete = constants.%Base.val] // CHECK:STDOUT: assign %b2.var, %.loc14_3 // CHECK:STDOUT: %Base.ref.loc14: type = name_ref Base, file.%Base.decl [concrete = constants.%Base] // CHECK:STDOUT: %b2: ref %Base = ref_binding b2, %b2.var @@ -2337,15 +2337,15 @@ class T2(G2:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %Base.F.decl: @Base.%Base.F.type (%Base.F.type.0f1) = fn_decl @Base.F [symbolic = @Base.%Base.F (constants.%Base.F.cd3)] { -// CHECK:STDOUT: %self.patt: @Base.F.%pattern_type.loc8_16 (%pattern_type.2f0) = value_binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: @Base.F.%pattern_type.loc8_16 (%pattern_type.2f0) = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %t.patt: @Base.F.%pattern_type.loc8_28 (%pattern_type.51d) = value_binding_pattern t [concrete] -// CHECK:STDOUT: %t.param_patt: @Base.F.%pattern_type.loc8_28 (%pattern_type.51d) = value_param_pattern %t.patt, call_param1 [concrete] +// CHECK:STDOUT: %self.patt: @Base.F.%pattern_type.loc8_23 (%pattern_type.2f0) = value_binding_pattern self [concrete] +// CHECK:STDOUT: %self.param_patt: @Base.F.%pattern_type.loc8_23 (%pattern_type.2f0) = value_param_pattern %self.patt, call_param0 [concrete] +// CHECK:STDOUT: %t.patt: @Base.F.%pattern_type.loc8_42 (%pattern_type.51d) = value_binding_pattern t [concrete] +// CHECK:STDOUT: %t.param_patt: @Base.F.%pattern_type.loc8_42 (%pattern_type.51d) = value_param_pattern %t.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @Base.F.%Base (%Base.d0c) = value_param call_param0 -// CHECK:STDOUT: %.loc8_22.1: type = splice_block %Self.ref [symbolic = %Base (constants.%Base.d0c)] { -// CHECK:STDOUT: %.loc8_22.2: type = specific_constant constants.%Base.d0c, @Base(constants.%T) [symbolic = %Base (constants.%Base.d0c)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc8_22.2 [symbolic = %Base (constants.%Base.d0c)] +// CHECK:STDOUT: %.loc8_29.1: type = splice_block %Self.ref [symbolic = %Base (constants.%Base.d0c)] { +// CHECK:STDOUT: %.loc8_29.2: type = specific_constant constants.%Base.d0c, @Base(constants.%T) [symbolic = %Base (constants.%Base.d0c)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc8_29.2 [symbolic = %Base (constants.%Base.d0c)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @Base.F.%Base (%Base.d0c) = value_binding self, %self.param // CHECK:STDOUT: %t.param: @Base.F.%T (%T) = value_param call_param1 @@ -2409,12 +2409,12 @@ class T2(G2:! type) { // CHECK:STDOUT: generic virtual fn @Base.F(@Base.%T.loc7_17.2: type) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T) [symbolic = %Base (constants.%Base.d0c)] -// CHECK:STDOUT: %pattern_type.loc8_16: type = pattern_type %Base [symbolic = %pattern_type.loc8_16 (constants.%pattern_type.2f0)] -// CHECK:STDOUT: %pattern_type.loc8_28: type = pattern_type %T [symbolic = %pattern_type.loc8_28 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %pattern_type.loc8_23: type = pattern_type %Base [symbolic = %pattern_type.loc8_23 (constants.%pattern_type.2f0)] +// CHECK:STDOUT: %pattern_type.loc8_42: type = pattern_type %T [symbolic = %pattern_type.loc8_42 (constants.%pattern_type.51d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc8_20: = require_complete_type %Base [symbolic = %require_complete.loc8_20 (constants.%require_complete.1e0)] -// CHECK:STDOUT: %require_complete.loc8_29: = require_complete_type %T [symbolic = %require_complete.loc8_29 (constants.%require_complete.944)] +// CHECK:STDOUT: %require_complete.loc8_27: = require_complete_type %Base [symbolic = %require_complete.loc8_27 (constants.%require_complete.1e0)] +// CHECK:STDOUT: %require_complete.loc8_43: = require_complete_type %T [symbolic = %require_complete.loc8_43 (constants.%require_complete.944)] // CHECK:STDOUT: // CHECK:STDOUT: virtual fn(%self.param: @Base.F.%Base (%Base.d0c), %t.param: @Base.F.%T (%T)) { // CHECK:STDOUT: !entry: @@ -2439,12 +2439,12 @@ class T2(G2:! type) { // CHECK:STDOUT: specific @Base.F(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Base => constants.%Base.d0c -// CHECK:STDOUT: %pattern_type.loc8_16 => constants.%pattern_type.2f0 -// CHECK:STDOUT: %pattern_type.loc8_28 => constants.%pattern_type.51d +// CHECK:STDOUT: %pattern_type.loc8_23 => constants.%pattern_type.2f0 +// CHECK:STDOUT: %pattern_type.loc8_42 => constants.%pattern_type.51d // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc8_20 => constants.%require_complete.1e0 -// CHECK:STDOUT: %require_complete.loc8_29 => constants.%require_complete.944 +// CHECK:STDOUT: %require_complete.loc8_27 => constants.%require_complete.1e0 +// CHECK:STDOUT: %require_complete.loc8_43 => constants.%require_complete.944 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Base(constants.%T1) { @@ -2459,12 +2459,12 @@ class T2(G2:! type) { // CHECK:STDOUT: specific @Base.F(constants.%T1) { // CHECK:STDOUT: %T => constants.%T1 // CHECK:STDOUT: %Base => constants.%Base.d5d -// CHECK:STDOUT: %pattern_type.loc8_16 => constants.%pattern_type.64f -// CHECK:STDOUT: %pattern_type.loc8_28 => constants.%pattern_type.818 +// CHECK:STDOUT: %pattern_type.loc8_23 => constants.%pattern_type.64f +// CHECK:STDOUT: %pattern_type.loc8_42 => constants.%pattern_type.818 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc8_20 => constants.%complete_type.513 -// CHECK:STDOUT: %require_complete.loc8_29 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc8_27 => constants.%complete_type.513 +// CHECK:STDOUT: %require_complete.loc8_43 => constants.%complete_type.357 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_virtual_without_self.carbon @@ -2837,9 +2837,9 @@ class T2(G2:! type) { // CHECK:STDOUT: %self.param_patt: @T1.F.%pattern_type (%pattern_type.253) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @T1.F.%T1 (%T1) = value_param call_param0 -// CHECK:STDOUT: %.loc5_22.1: type = splice_block %Self.ref [symbolic = %T1 (constants.%T1)] { -// CHECK:STDOUT: %.loc5_22.2: type = specific_constant constants.%T1, @T1(constants.%T) [symbolic = %T1 (constants.%T1)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_22.2 [symbolic = %T1 (constants.%T1)] +// CHECK:STDOUT: %.loc5_29.1: type = splice_block %Self.ref [symbolic = %T1 (constants.%T1)] { +// CHECK:STDOUT: %.loc5_29.2: type = specific_constant constants.%T1, @T1(constants.%T) [symbolic = %T1 (constants.%T1)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_29.2 [symbolic = %T1 (constants.%T1)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @T1.F.%T1 (%T1) = value_binding self, %self.param // CHECK:STDOUT: } @@ -2945,15 +2945,15 @@ class T2(G2:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %T1.F.decl: @T1.%T1.F.type (%T1.F.type) = fn_decl @T1.F [symbolic = @T1.%T1.F (constants.%T1.F)] { -// CHECK:STDOUT: %self.patt: @T1.F.%pattern_type.loc5_16 (%pattern_type.253) = value_binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: @T1.F.%pattern_type.loc5_16 (%pattern_type.253) = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %t.patt: @T1.F.%pattern_type.loc5_28 (%pattern_type.51d) = value_binding_pattern t [concrete] -// CHECK:STDOUT: %t.param_patt: @T1.F.%pattern_type.loc5_28 (%pattern_type.51d) = value_param_pattern %t.patt, call_param1 [concrete] +// CHECK:STDOUT: %self.patt: @T1.F.%pattern_type.loc5_23 (%pattern_type.253) = value_binding_pattern self [concrete] +// CHECK:STDOUT: %self.param_patt: @T1.F.%pattern_type.loc5_23 (%pattern_type.253) = value_param_pattern %self.patt, call_param0 [concrete] +// CHECK:STDOUT: %t.patt: @T1.F.%pattern_type.loc5_42 (%pattern_type.51d) = value_binding_pattern t [concrete] +// CHECK:STDOUT: %t.param_patt: @T1.F.%pattern_type.loc5_42 (%pattern_type.51d) = value_param_pattern %t.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @T1.F.%T1 (%T1) = value_param call_param0 -// CHECK:STDOUT: %.loc5_22.1: type = splice_block %Self.ref [symbolic = %T1 (constants.%T1)] { -// CHECK:STDOUT: %.loc5_22.2: type = specific_constant constants.%T1, @T1(constants.%T) [symbolic = %T1 (constants.%T1)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_22.2 [symbolic = %T1 (constants.%T1)] +// CHECK:STDOUT: %.loc5_29.1: type = splice_block %Self.ref [symbolic = %T1 (constants.%T1)] { +// CHECK:STDOUT: %.loc5_29.2: type = specific_constant constants.%T1, @T1(constants.%T) [symbolic = %T1 (constants.%T1)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_29.2 [symbolic = %T1 (constants.%T1)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @T1.F.%T1 (%T1) = value_binding self, %self.param // CHECK:STDOUT: %t.param: @T1.F.%T (%T) = value_param call_param1 @@ -2980,12 +2980,12 @@ class T2(G2:! type) { // CHECK:STDOUT: generic virtual fn @T1.F(@T1.%T.loc4_15.2: type) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %T1: type = class_type @T1, @T1(%T) [symbolic = %T1 (constants.%T1)] -// CHECK:STDOUT: %pattern_type.loc5_16: type = pattern_type %T1 [symbolic = %pattern_type.loc5_16 (constants.%pattern_type.253)] -// CHECK:STDOUT: %pattern_type.loc5_28: type = pattern_type %T [symbolic = %pattern_type.loc5_28 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %pattern_type.loc5_23: type = pattern_type %T1 [symbolic = %pattern_type.loc5_23 (constants.%pattern_type.253)] +// CHECK:STDOUT: %pattern_type.loc5_42: type = pattern_type %T [symbolic = %pattern_type.loc5_42 (constants.%pattern_type.51d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc5_20: = require_complete_type %T1 [symbolic = %require_complete.loc5_20 (constants.%require_complete.6d2)] -// CHECK:STDOUT: %require_complete.loc5_29: = require_complete_type %T [symbolic = %require_complete.loc5_29 (constants.%require_complete.944)] +// CHECK:STDOUT: %require_complete.loc5_27: = require_complete_type %T1 [symbolic = %require_complete.loc5_27 (constants.%require_complete.6d2)] +// CHECK:STDOUT: %require_complete.loc5_43: = require_complete_type %T [symbolic = %require_complete.loc5_43 (constants.%require_complete.944)] // CHECK:STDOUT: // CHECK:STDOUT: virtual fn(%self.param: @T1.F.%T1 (%T1), %t.param: @T1.F.%T (%T)) { // CHECK:STDOUT: !entry: @@ -3005,12 +3005,12 @@ class T2(G2:! type) { // CHECK:STDOUT: specific @T1.F(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %T1 => constants.%T1 -// CHECK:STDOUT: %pattern_type.loc5_16 => constants.%pattern_type.253 -// CHECK:STDOUT: %pattern_type.loc5_28 => constants.%pattern_type.51d +// CHECK:STDOUT: %pattern_type.loc5_23 => constants.%pattern_type.253 +// CHECK:STDOUT: %pattern_type.loc5_42 => constants.%pattern_type.51d // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc5_20 => constants.%require_complete.6d2 -// CHECK:STDOUT: %require_complete.loc5_29 => constants.%require_complete.944 +// CHECK:STDOUT: %require_complete.loc5_27 => constants.%require_complete.6d2 +// CHECK:STDOUT: %require_complete.loc5_43 => constants.%require_complete.944 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- vtable_import_unneeded.carbon @@ -3179,9 +3179,9 @@ class T2(G2:! type) { // CHECK:STDOUT: %self.param_patt: @GenericDerived.F2.%pattern_type (%pattern_type.945) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @GenericDerived.F2.%GenericDerived (%GenericDerived) = value_param call_param0 -// CHECK:STDOUT: %.loc11_24.1: type = splice_block %Self.ref [symbolic = %GenericDerived (constants.%GenericDerived)] { -// CHECK:STDOUT: %.loc11_24.2: type = specific_constant constants.%GenericDerived, @GenericDerived(constants.%T) [symbolic = %GenericDerived (constants.%GenericDerived)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc11_24.2 [symbolic = %GenericDerived (constants.%GenericDerived)] +// CHECK:STDOUT: %.loc11_31.1: type = splice_block %Self.ref [symbolic = %GenericDerived (constants.%GenericDerived)] { +// CHECK:STDOUT: %.loc11_31.2: type = specific_constant constants.%GenericDerived, @GenericDerived(constants.%T) [symbolic = %GenericDerived (constants.%GenericDerived)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc11_31.2 [symbolic = %GenericDerived (constants.%GenericDerived)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @GenericDerived.F2.%GenericDerived (%GenericDerived) = value_binding self, %self.param // CHECK:STDOUT: } @@ -3190,9 +3190,9 @@ class T2(G2:! type) { // CHECK:STDOUT: %self.param_patt: @GenericDerived.F3.%pattern_type (%pattern_type.945) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @GenericDerived.F3.%GenericDerived (%GenericDerived) = value_param call_param0 -// CHECK:STDOUT: %.loc12_23.1: type = splice_block %Self.ref [symbolic = %GenericDerived (constants.%GenericDerived)] { -// CHECK:STDOUT: %.loc12_23.2: type = specific_constant constants.%GenericDerived, @GenericDerived(constants.%T) [symbolic = %GenericDerived (constants.%GenericDerived)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc12_23.2 [symbolic = %GenericDerived (constants.%GenericDerived)] +// CHECK:STDOUT: %.loc12_30.1: type = splice_block %Self.ref [symbolic = %GenericDerived (constants.%GenericDerived)] { +// CHECK:STDOUT: %.loc12_30.2: type = specific_constant constants.%GenericDerived, @GenericDerived(constants.%T) [symbolic = %GenericDerived (constants.%GenericDerived)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc12_30.2 [symbolic = %GenericDerived (constants.%GenericDerived)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @GenericDerived.F3.%GenericDerived (%GenericDerived) = value_binding self, %self.param // CHECK:STDOUT: } @@ -3379,9 +3379,9 @@ class T2(G2:! type) { // CHECK:STDOUT: %self.param_patt: @GenericBase.F1.%pattern_type (%pattern_type.3f7) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @GenericBase.F1.%GenericBase (%GenericBase.5e3) = value_param call_param0 -// CHECK:STDOUT: %.loc5_23.1: type = splice_block %Self.ref [symbolic = %GenericBase (constants.%GenericBase.5e3)] { -// CHECK:STDOUT: %.loc5_23.2: type = specific_constant constants.%GenericBase.5e3, @GenericBase(constants.%T) [symbolic = %GenericBase (constants.%GenericBase.5e3)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_23.2 [symbolic = %GenericBase (constants.%GenericBase.5e3)] +// CHECK:STDOUT: %.loc5_30.1: type = splice_block %Self.ref [symbolic = %GenericBase (constants.%GenericBase.5e3)] { +// CHECK:STDOUT: %.loc5_30.2: type = specific_constant constants.%GenericBase.5e3, @GenericBase(constants.%T) [symbolic = %GenericBase (constants.%GenericBase.5e3)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_30.2 [symbolic = %GenericBase (constants.%GenericBase.5e3)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @GenericBase.F1.%GenericBase (%GenericBase.5e3) = value_binding self, %self.param // CHECK:STDOUT: } @@ -3390,9 +3390,9 @@ class T2(G2:! type) { // CHECK:STDOUT: %self.param_patt: @GenericBase.F2.%pattern_type (%pattern_type.3f7) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @GenericBase.F2.%GenericBase (%GenericBase.5e3) = value_param call_param0 -// CHECK:STDOUT: %.loc6_23.1: type = splice_block %Self.ref [symbolic = %GenericBase (constants.%GenericBase.5e3)] { -// CHECK:STDOUT: %.loc6_23.2: type = specific_constant constants.%GenericBase.5e3, @GenericBase(constants.%T) [symbolic = %GenericBase (constants.%GenericBase.5e3)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc6_23.2 [symbolic = %GenericBase (constants.%GenericBase.5e3)] +// CHECK:STDOUT: %.loc6_30.1: type = splice_block %Self.ref [symbolic = %GenericBase (constants.%GenericBase.5e3)] { +// CHECK:STDOUT: %.loc6_30.2: type = specific_constant constants.%GenericBase.5e3, @GenericBase(constants.%T) [symbolic = %GenericBase (constants.%GenericBase.5e3)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc6_30.2 [symbolic = %GenericBase (constants.%GenericBase.5e3)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @GenericBase.F2.%GenericBase (%GenericBase.5e3) = value_binding self, %self.param // CHECK:STDOUT: } @@ -3633,25 +3633,25 @@ class T2(G2:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %Base.F.decl: @Base.%Base.F.type (%Base.F.type.0f1) = fn_decl @Base.F [symbolic = @Base.%Base.F (constants.%Base.F.cd3)] { -// CHECK:STDOUT: %self.patt: @Base.F.%pattern_type.loc5_16 (%pattern_type.2f0) = value_binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: @Base.F.%pattern_type.loc5_16 (%pattern_type.2f0) = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %t.patt: @Base.F.%pattern_type.loc5_28 (%pattern_type.cf5) = value_binding_pattern t [concrete] -// CHECK:STDOUT: %t.param_patt: @Base.F.%pattern_type.loc5_28 (%pattern_type.cf5) = value_param_pattern %t.patt, call_param1 [concrete] +// CHECK:STDOUT: %self.patt: @Base.F.%pattern_type.loc5_23 (%pattern_type.2f0) = value_binding_pattern self [concrete] +// CHECK:STDOUT: %self.param_patt: @Base.F.%pattern_type.loc5_23 (%pattern_type.2f0) = value_param_pattern %self.patt, call_param0 [concrete] +// CHECK:STDOUT: %t.patt: @Base.F.%pattern_type.loc5_42 (%pattern_type.cf5) = value_binding_pattern t [concrete] +// CHECK:STDOUT: %t.param_patt: @Base.F.%pattern_type.loc5_42 (%pattern_type.cf5) = value_param_pattern %t.patt, call_param1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @Base.F.%Base.loc5_22 (%Base.d0c) = value_param call_param0 -// CHECK:STDOUT: %.loc5_22.1: type = splice_block %Self.ref [symbolic = %Base.loc5_22 (constants.%Base.d0c)] { -// CHECK:STDOUT: %.loc5_22.2: type = specific_constant constants.%Base.d0c, @Base(constants.%T) [symbolic = %Base.loc5_22 (constants.%Base.d0c)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_22.2 [symbolic = %Base.loc5_22 (constants.%Base.d0c)] +// CHECK:STDOUT: %self.param: @Base.F.%Base.loc5_29 (%Base.d0c) = value_param call_param0 +// CHECK:STDOUT: %.loc5_29.1: type = splice_block %Self.ref [symbolic = %Base.loc5_29 (constants.%Base.d0c)] { +// CHECK:STDOUT: %.loc5_29.2: type = specific_constant constants.%Base.d0c, @Base(constants.%T) [symbolic = %Base.loc5_29 (constants.%Base.d0c)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_29.2 [symbolic = %Base.loc5_29 (constants.%Base.d0c)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Base.F.%Base.loc5_22 (%Base.d0c) = value_binding self, %self.param -// CHECK:STDOUT: %t.param: @Base.F.%ptr.loc5_38.1 (%ptr.4b1) = value_param call_param1 -// CHECK:STDOUT: %.loc5_38: type = splice_block %ptr.loc5_38.2 [symbolic = %ptr.loc5_38.1 (constants.%ptr.4b1)] { +// CHECK:STDOUT: %self: @Base.F.%Base.loc5_29 (%Base.d0c) = value_binding self, %self.param +// CHECK:STDOUT: %t.param: @Base.F.%ptr.loc5_52.1 (%ptr.4b1) = value_param call_param1 +// CHECK:STDOUT: %.loc5_52: type = splice_block %ptr.loc5_52.2 [symbolic = %ptr.loc5_52.1 (constants.%ptr.4b1)] { // CHECK:STDOUT: %Base.ref: %Base.type = name_ref Base, file.%Base.decl [concrete = constants.%Base.generic] // CHECK:STDOUT: %T.ref: type = name_ref T, @Base.%T.loc4_17.2 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %Base.loc5_37: type = class_type @Base, @Base(constants.%T) [symbolic = %Base.loc5_22 (constants.%Base.d0c)] -// CHECK:STDOUT: %ptr.loc5_38.2: type = ptr_type %Base.loc5_37 [symbolic = %ptr.loc5_38.1 (constants.%ptr.4b1)] +// CHECK:STDOUT: %Base.loc5_51: type = class_type @Base, @Base(constants.%T) [symbolic = %Base.loc5_29 (constants.%Base.d0c)] +// CHECK:STDOUT: %ptr.loc5_52.2: type = ptr_type %Base.loc5_51 [symbolic = %ptr.loc5_52.1 (constants.%ptr.4b1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %t: @Base.F.%ptr.loc5_38.1 (%ptr.4b1) = value_binding t, %t.param +// CHECK:STDOUT: %t: @Base.F.%ptr.loc5_52.1 (%ptr.4b1) = value_binding t, %t.param // CHECK:STDOUT: } // CHECK:STDOUT: %Base.F.specific_fn.loc6_1.1: = specific_function %Base.F.decl, @Base.F(constants.%T) [symbolic = %Base.F.specific_fn.loc6_1.2 (constants.%Base.F.specific_fn.f8c)] // CHECK:STDOUT: %vtable_decl: ref %ptr.454 = vtable_decl @Base.vtable [concrete = constants.%Base.vtable_decl] @@ -3717,16 +3717,16 @@ class T2(G2:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic virtual fn @Base.F(@Base.%T.loc4_17.2: type) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %Base.loc5_22: type = class_type @Base, @Base(%T) [symbolic = %Base.loc5_22 (constants.%Base.d0c)] -// CHECK:STDOUT: %pattern_type.loc5_16: type = pattern_type %Base.loc5_22 [symbolic = %pattern_type.loc5_16 (constants.%pattern_type.2f0)] -// CHECK:STDOUT: %ptr.loc5_38.1: type = ptr_type %Base.loc5_22 [symbolic = %ptr.loc5_38.1 (constants.%ptr.4b1)] -// CHECK:STDOUT: %pattern_type.loc5_28: type = pattern_type %ptr.loc5_38.1 [symbolic = %pattern_type.loc5_28 (constants.%pattern_type.cf5)] +// CHECK:STDOUT: %Base.loc5_29: type = class_type @Base, @Base(%T) [symbolic = %Base.loc5_29 (constants.%Base.d0c)] +// CHECK:STDOUT: %pattern_type.loc5_23: type = pattern_type %Base.loc5_29 [symbolic = %pattern_type.loc5_23 (constants.%pattern_type.2f0)] +// CHECK:STDOUT: %ptr.loc5_52.1: type = ptr_type %Base.loc5_29 [symbolic = %ptr.loc5_52.1 (constants.%ptr.4b1)] +// CHECK:STDOUT: %pattern_type.loc5_42: type = pattern_type %ptr.loc5_52.1 [symbolic = %pattern_type.loc5_42 (constants.%pattern_type.cf5)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc5_20: = require_complete_type %Base.loc5_22 [symbolic = %require_complete.loc5_20 (constants.%require_complete.1e0)] -// CHECK:STDOUT: %require_complete.loc5_29: = require_complete_type %ptr.loc5_38.1 [symbolic = %require_complete.loc5_29 (constants.%require_complete.3cf)] +// CHECK:STDOUT: %require_complete.loc5_27: = require_complete_type %Base.loc5_29 [symbolic = %require_complete.loc5_27 (constants.%require_complete.1e0)] +// CHECK:STDOUT: %require_complete.loc5_43: = require_complete_type %ptr.loc5_52.1 [symbolic = %require_complete.loc5_43 (constants.%require_complete.3cf)] // CHECK:STDOUT: -// CHECK:STDOUT: virtual fn(%self.param: @Base.F.%Base.loc5_22 (%Base.d0c), %t.param: @Base.F.%ptr.loc5_38.1 (%ptr.4b1)) { +// CHECK:STDOUT: virtual fn(%self.param: @Base.F.%Base.loc5_29 (%Base.d0c), %t.param: @Base.F.%ptr.loc5_52.1 (%ptr.4b1)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -3748,14 +3748,14 @@ class T2(G2:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Base.F(constants.%T) { // CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %Base.loc5_22 => constants.%Base.d0c -// CHECK:STDOUT: %pattern_type.loc5_16 => constants.%pattern_type.2f0 -// CHECK:STDOUT: %ptr.loc5_38.1 => constants.%ptr.4b1 -// CHECK:STDOUT: %pattern_type.loc5_28 => constants.%pattern_type.cf5 +// CHECK:STDOUT: %Base.loc5_29 => constants.%Base.d0c +// CHECK:STDOUT: %pattern_type.loc5_23 => constants.%pattern_type.2f0 +// CHECK:STDOUT: %ptr.loc5_52.1 => constants.%ptr.4b1 +// CHECK:STDOUT: %pattern_type.loc5_42 => constants.%pattern_type.cf5 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc5_20 => constants.%require_complete.1e0 -// CHECK:STDOUT: %require_complete.loc5_29 => constants.%require_complete.3cf +// CHECK:STDOUT: %require_complete.loc5_27 => constants.%require_complete.1e0 +// CHECK:STDOUT: %require_complete.loc5_43 => constants.%require_complete.3cf // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Base(constants.%T1) { @@ -3769,14 +3769,14 @@ class T2(G2:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Base.F(constants.%T1) { // CHECK:STDOUT: %T => constants.%T1 -// CHECK:STDOUT: %Base.loc5_22 => constants.%Base.d5d -// CHECK:STDOUT: %pattern_type.loc5_16 => constants.%pattern_type.64f -// CHECK:STDOUT: %ptr.loc5_38.1 => constants.%ptr.6e0 -// CHECK:STDOUT: %pattern_type.loc5_28 => constants.%pattern_type.912 +// CHECK:STDOUT: %Base.loc5_29 => constants.%Base.d5d +// CHECK:STDOUT: %pattern_type.loc5_23 => constants.%pattern_type.64f +// CHECK:STDOUT: %ptr.loc5_52.1 => constants.%ptr.6e0 +// CHECK:STDOUT: %pattern_type.loc5_42 => constants.%pattern_type.912 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc5_20 => constants.%complete_type.513 -// CHECK:STDOUT: %require_complete.loc5_29 => constants.%complete_type.96e +// CHECK:STDOUT: %require_complete.loc5_27 => constants.%complete_type.513 +// CHECK:STDOUT: %require_complete.loc5_43 => constants.%complete_type.96e // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_impl_generic_specifically_mismatch.carbon @@ -3866,13 +3866,13 @@ class T2(G2:! type) { // CHECK:STDOUT: %t.param_patt: %pattern_type.c16 = value_param_pattern %t.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @Base.F.%Base (%Base.d0c) = value_param call_param0 -// CHECK:STDOUT: %.loc8_22.1: type = splice_block %Self.ref [symbolic = %Base (constants.%Base.d0c)] { -// CHECK:STDOUT: %.loc8_22.2: type = specific_constant constants.%Base.d0c, @Base(constants.%T) [symbolic = %Base (constants.%Base.d0c)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc8_22.2 [symbolic = %Base (constants.%Base.d0c)] +// CHECK:STDOUT: %.loc8_29.1: type = splice_block %Self.ref [symbolic = %Base (constants.%Base.d0c)] { +// CHECK:STDOUT: %.loc8_29.2: type = specific_constant constants.%Base.d0c, @Base(constants.%T) [symbolic = %Base (constants.%Base.d0c)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc8_29.2 [symbolic = %Base (constants.%Base.d0c)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @Base.F.%Base (%Base.d0c) = value_binding self, %self.param // CHECK:STDOUT: %t.param: %ptr.9ce = value_param call_param1 -// CHECK:STDOUT: %.loc8_33: type = splice_block %ptr [concrete = constants.%ptr.9ce] { +// CHECK:STDOUT: %.loc8_47: type = splice_block %ptr [concrete = constants.%ptr.9ce] { // CHECK:STDOUT: %T1.ref: type = name_ref T1, file.%T1.decl [concrete = constants.%T1] // CHECK:STDOUT: %ptr: type = ptr_type %T1.ref [concrete = constants.%ptr.9ce] // CHECK:STDOUT: } @@ -4067,23 +4067,23 @@ class T2(G2:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %Base.F.decl: @Base.%Base.F.type (%Base.F.type) = fn_decl @Base.F [symbolic = @Base.%Base.F (constants.%Base.F)] { -// CHECK:STDOUT: %self.patt: @Base.F.%pattern_type.loc5_16 (%pattern_type.2f0) = value_binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: @Base.F.%pattern_type.loc5_16 (%pattern_type.2f0) = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %t.patt: @Base.F.%pattern_type.loc5_28 (%pattern_type.4f4) = value_binding_pattern t [concrete] -// CHECK:STDOUT: %t.param_patt: @Base.F.%pattern_type.loc5_28 (%pattern_type.4f4) = value_param_pattern %t.patt, call_param1 [concrete] +// CHECK:STDOUT: %self.patt: @Base.F.%pattern_type.loc5_23 (%pattern_type.2f0) = value_binding_pattern self [concrete] +// CHECK:STDOUT: %self.param_patt: @Base.F.%pattern_type.loc5_23 (%pattern_type.2f0) = value_param_pattern %self.patt, call_param0 [concrete] +// CHECK:STDOUT: %t.patt: @Base.F.%pattern_type.loc5_42 (%pattern_type.4f4) = value_binding_pattern t [concrete] +// CHECK:STDOUT: %t.param_patt: @Base.F.%pattern_type.loc5_42 (%pattern_type.4f4) = value_param_pattern %t.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @Base.F.%Base (%Base) = value_param call_param0 -// CHECK:STDOUT: %.loc5_22.1: type = splice_block %Self.ref [symbolic = %Base (constants.%Base)] { -// CHECK:STDOUT: %.loc5_22.2: type = specific_constant constants.%Base, @Base(constants.%T) [symbolic = %Base (constants.%Base)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_22.2 [symbolic = %Base (constants.%Base)] +// CHECK:STDOUT: %.loc5_29.1: type = splice_block %Self.ref [symbolic = %Base (constants.%Base)] { +// CHECK:STDOUT: %.loc5_29.2: type = specific_constant constants.%Base, @Base(constants.%T) [symbolic = %Base (constants.%Base)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_29.2 [symbolic = %Base (constants.%Base)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @Base.F.%Base (%Base) = value_binding self, %self.param -// CHECK:STDOUT: %t.param: @Base.F.%ptr.loc5_32.1 (%ptr.e8f) = value_param call_param1 -// CHECK:STDOUT: %.loc5_32: type = splice_block %ptr.loc5_32.2 [symbolic = %ptr.loc5_32.1 (constants.%ptr.e8f)] { +// CHECK:STDOUT: %t.param: @Base.F.%ptr.loc5_46.1 (%ptr.e8f) = value_param call_param1 +// CHECK:STDOUT: %.loc5_46: type = splice_block %ptr.loc5_46.2 [symbolic = %ptr.loc5_46.1 (constants.%ptr.e8f)] { // CHECK:STDOUT: %T.ref: type = name_ref T, @Base.%T.loc4_21.2 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %ptr.loc5_32.2: type = ptr_type %T.ref [symbolic = %ptr.loc5_32.1 (constants.%ptr.e8f)] +// CHECK:STDOUT: %ptr.loc5_46.2: type = ptr_type %T.ref [symbolic = %ptr.loc5_46.1 (constants.%ptr.e8f)] // CHECK:STDOUT: } -// CHECK:STDOUT: %t: @Base.F.%ptr.loc5_32.1 (%ptr.e8f) = value_binding t, %t.param +// CHECK:STDOUT: %t: @Base.F.%ptr.loc5_46.1 (%ptr.e8f) = value_binding t, %t.param // CHECK:STDOUT: } // CHECK:STDOUT: %Base.F.specific_fn.loc6_1.1: = specific_function %Base.F.decl, @Base.F(constants.%T) [symbolic = %Base.F.specific_fn.loc6_1.2 (constants.%Base.F.specific_fn)] // CHECK:STDOUT: %vtable_decl: ref %ptr.454 = vtable_decl @Base.vtable [concrete = constants.%Base.vtable_decl] @@ -4118,15 +4118,15 @@ class T2(G2:! type) { // CHECK:STDOUT: %Base.loc8_22.1: type = class_type @Base, @Base(constants.%T) [symbolic = %Base.loc8_22.2 (constants.%Base)] // CHECK:STDOUT: %.loc8: @Derived.%Derived.elem (%Derived.elem) = base_decl %Base.loc8_22.1, element0 [concrete] // CHECK:STDOUT: %Derived.F.decl: @Derived.%Derived.F.type (%Derived.F.type) = fn_decl @Derived.F [symbolic = @Derived.%Derived.F (constants.%Derived.F)] { -// CHECK:STDOUT: %self.patt: @Derived.F.%pattern_type.loc16_17 (%pattern_type.b9d) = value_binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: @Derived.F.%pattern_type.loc16_17 (%pattern_type.b9d) = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %t.patt: @Derived.F.%pattern_type.loc16_29 (%pattern_type.51d) = value_binding_pattern t [concrete] -// CHECK:STDOUT: %t.param_patt: @Derived.F.%pattern_type.loc16_29 (%pattern_type.51d) = value_param_pattern %t.patt, call_param1 [concrete] +// CHECK:STDOUT: %self.patt: @Derived.F.%pattern_type.loc16_24 (%pattern_type.b9d) = value_binding_pattern self [concrete] +// CHECK:STDOUT: %self.param_patt: @Derived.F.%pattern_type.loc16_24 (%pattern_type.b9d) = value_param_pattern %self.patt, call_param0 [concrete] +// CHECK:STDOUT: %t.patt: @Derived.F.%pattern_type.loc16_43 (%pattern_type.51d) = value_binding_pattern t [concrete] +// CHECK:STDOUT: %t.param_patt: @Derived.F.%pattern_type.loc16_43 (%pattern_type.51d) = value_param_pattern %t.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @Derived.F.%Derived (%Derived) = value_param call_param0 -// CHECK:STDOUT: %.loc16_23.1: type = splice_block %Self.ref [symbolic = %Derived (constants.%Derived)] { -// CHECK:STDOUT: %.loc16_23.2: type = specific_constant constants.%Derived, @Derived(constants.%T) [symbolic = %Derived (constants.%Derived)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc16_23.2 [symbolic = %Derived (constants.%Derived)] +// CHECK:STDOUT: %.loc16_30.1: type = splice_block %Self.ref [symbolic = %Derived (constants.%Derived)] { +// CHECK:STDOUT: %.loc16_30.2: type = specific_constant constants.%Derived, @Derived(constants.%T) [symbolic = %Derived (constants.%Derived)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc16_30.2 [symbolic = %Derived (constants.%Derived)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @Derived.F.%Derived (%Derived) = value_binding self, %self.param // CHECK:STDOUT: %t.param: @Derived.F.%T (%T) = value_param call_param1 @@ -4160,15 +4160,15 @@ class T2(G2:! type) { // CHECK:STDOUT: generic virtual fn @Base.F(@Base.%T.loc4_21.2: type) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T) [symbolic = %Base (constants.%Base)] -// CHECK:STDOUT: %pattern_type.loc5_16: type = pattern_type %Base [symbolic = %pattern_type.loc5_16 (constants.%pattern_type.2f0)] -// CHECK:STDOUT: %ptr.loc5_32.1: type = ptr_type %T [symbolic = %ptr.loc5_32.1 (constants.%ptr.e8f)] -// CHECK:STDOUT: %pattern_type.loc5_28: type = pattern_type %ptr.loc5_32.1 [symbolic = %pattern_type.loc5_28 (constants.%pattern_type.4f4)] +// CHECK:STDOUT: %pattern_type.loc5_23: type = pattern_type %Base [symbolic = %pattern_type.loc5_23 (constants.%pattern_type.2f0)] +// CHECK:STDOUT: %ptr.loc5_46.1: type = ptr_type %T [symbolic = %ptr.loc5_46.1 (constants.%ptr.e8f)] +// CHECK:STDOUT: %pattern_type.loc5_42: type = pattern_type %ptr.loc5_46.1 [symbolic = %pattern_type.loc5_42 (constants.%pattern_type.4f4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc5_20: = require_complete_type %Base [symbolic = %require_complete.loc5_20 (constants.%require_complete.1e0)] -// CHECK:STDOUT: %require_complete.loc5_29: = require_complete_type %ptr.loc5_32.1 [symbolic = %require_complete.loc5_29 (constants.%require_complete.ef1)] +// CHECK:STDOUT: %require_complete.loc5_27: = require_complete_type %Base [symbolic = %require_complete.loc5_27 (constants.%require_complete.1e0)] +// CHECK:STDOUT: %require_complete.loc5_43: = require_complete_type %ptr.loc5_46.1 [symbolic = %require_complete.loc5_43 (constants.%require_complete.ef1)] // CHECK:STDOUT: -// CHECK:STDOUT: virtual fn(%self.param: @Base.F.%Base (%Base), %t.param: @Base.F.%ptr.loc5_32.1 (%ptr.e8f)) { +// CHECK:STDOUT: virtual fn(%self.param: @Base.F.%Base (%Base), %t.param: @Base.F.%ptr.loc5_46.1 (%ptr.e8f)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -4177,14 +4177,14 @@ class T2(G2:! type) { // CHECK:STDOUT: generic override fn @Derived.F(@Derived.%T.loc7_15.2: type) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %Derived: type = class_type @Derived, @Derived(%T) [symbolic = %Derived (constants.%Derived)] -// CHECK:STDOUT: %pattern_type.loc16_17: type = pattern_type %Derived [symbolic = %pattern_type.loc16_17 (constants.%pattern_type.b9d)] +// CHECK:STDOUT: %pattern_type.loc16_24: type = pattern_type %Derived [symbolic = %pattern_type.loc16_24 (constants.%pattern_type.b9d)] // CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T) [symbolic = %Base (constants.%Base)] -// CHECK:STDOUT: %require_complete.loc16_32: = require_complete_type %Base [symbolic = %require_complete.loc16_32 (constants.%require_complete.1e0)] -// CHECK:STDOUT: %pattern_type.loc16_29: type = pattern_type %T [symbolic = %pattern_type.loc16_29 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %require_complete.loc16_46: = require_complete_type %Base [symbolic = %require_complete.loc16_46 (constants.%require_complete.1e0)] +// CHECK:STDOUT: %pattern_type.loc16_43: type = pattern_type %T [symbolic = %pattern_type.loc16_43 (constants.%pattern_type.51d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc16_21: = require_complete_type %Derived [symbolic = %require_complete.loc16_21 (constants.%require_complete.a43)] -// CHECK:STDOUT: %require_complete.loc16_30: = require_complete_type %T [symbolic = %require_complete.loc16_30 (constants.%require_complete.944)] +// CHECK:STDOUT: %require_complete.loc16_28: = require_complete_type %Derived [symbolic = %require_complete.loc16_28 (constants.%require_complete.a43)] +// CHECK:STDOUT: %require_complete.loc16_44: = require_complete_type %T [symbolic = %require_complete.loc16_44 (constants.%require_complete.944)] // CHECK:STDOUT: // CHECK:STDOUT: override fn(%self.param: @Derived.F.%Derived (%Derived), %t.param: @Derived.F.%T (%T)) { // CHECK:STDOUT: !entry: @@ -4204,13 +4204,13 @@ class T2(G2:! type) { // CHECK:STDOUT: specific @Base.F(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Base => constants.%Base -// CHECK:STDOUT: %pattern_type.loc5_16 => constants.%pattern_type.2f0 -// CHECK:STDOUT: %ptr.loc5_32.1 => constants.%ptr.e8f -// CHECK:STDOUT: %pattern_type.loc5_28 => constants.%pattern_type.4f4 +// CHECK:STDOUT: %pattern_type.loc5_23 => constants.%pattern_type.2f0 +// CHECK:STDOUT: %ptr.loc5_46.1 => constants.%ptr.e8f +// CHECK:STDOUT: %pattern_type.loc5_42 => constants.%pattern_type.4f4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc5_20 => constants.%require_complete.1e0 -// CHECK:STDOUT: %require_complete.loc5_29 => constants.%require_complete.ef1 +// CHECK:STDOUT: %require_complete.loc5_27 => constants.%require_complete.1e0 +// CHECK:STDOUT: %require_complete.loc5_43 => constants.%require_complete.ef1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Derived(constants.%T) { @@ -4231,14 +4231,14 @@ class T2(G2:! type) { // CHECK:STDOUT: specific @Derived.F(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Derived => constants.%Derived -// CHECK:STDOUT: %pattern_type.loc16_17 => constants.%pattern_type.b9d +// CHECK:STDOUT: %pattern_type.loc16_24 => constants.%pattern_type.b9d // CHECK:STDOUT: %Base => constants.%Base -// CHECK:STDOUT: %require_complete.loc16_32 => constants.%require_complete.1e0 -// CHECK:STDOUT: %pattern_type.loc16_29 => constants.%pattern_type.51d +// CHECK:STDOUT: %require_complete.loc16_46 => constants.%require_complete.1e0 +// CHECK:STDOUT: %pattern_type.loc16_43 => constants.%pattern_type.51d // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc16_21 => constants.%require_complete.a43 -// CHECK:STDOUT: %require_complete.loc16_30 => constants.%require_complete.944 +// CHECK:STDOUT: %require_complete.loc16_28 => constants.%require_complete.a43 +// CHECK:STDOUT: %require_complete.loc16_44 => constants.%require_complete.944 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- impl_generic_generic.carbon @@ -4323,15 +4323,15 @@ class T2(G2:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %Base.F.decl: @Base.%Base.F.type (%Base.F.type.0f1) = fn_decl @Base.F [symbolic = @Base.%Base.F (constants.%Base.F.cd3)] { -// CHECK:STDOUT: %self.patt: @Base.F.%pattern_type.loc5_16 (%pattern_type.2f0) = value_binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: @Base.F.%pattern_type.loc5_16 (%pattern_type.2f0) = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %t.patt: @Base.F.%pattern_type.loc5_28 (%pattern_type.51d) = value_binding_pattern t [concrete] -// CHECK:STDOUT: %t.param_patt: @Base.F.%pattern_type.loc5_28 (%pattern_type.51d) = value_param_pattern %t.patt, call_param1 [concrete] +// CHECK:STDOUT: %self.patt: @Base.F.%pattern_type.loc5_23 (%pattern_type.2f0) = value_binding_pattern self [concrete] +// CHECK:STDOUT: %self.param_patt: @Base.F.%pattern_type.loc5_23 (%pattern_type.2f0) = value_param_pattern %self.patt, call_param0 [concrete] +// CHECK:STDOUT: %t.patt: @Base.F.%pattern_type.loc5_42 (%pattern_type.51d) = value_binding_pattern t [concrete] +// CHECK:STDOUT: %t.param_patt: @Base.F.%pattern_type.loc5_42 (%pattern_type.51d) = value_param_pattern %t.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @Base.F.%Base (%Base.d0c) = value_param call_param0 -// CHECK:STDOUT: %.loc5_22.1: type = splice_block %Self.ref [symbolic = %Base (constants.%Base.d0c)] { -// CHECK:STDOUT: %.loc5_22.2: type = specific_constant constants.%Base.d0c, @Base(constants.%T) [symbolic = %Base (constants.%Base.d0c)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_22.2 [symbolic = %Base (constants.%Base.d0c)] +// CHECK:STDOUT: %.loc5_29.1: type = splice_block %Self.ref [symbolic = %Base (constants.%Base.d0c)] { +// CHECK:STDOUT: %.loc5_29.2: type = specific_constant constants.%Base.d0c, @Base(constants.%T) [symbolic = %Base (constants.%Base.d0c)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_29.2 [symbolic = %Base (constants.%Base.d0c)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @Base.F.%Base (%Base.d0c) = value_binding self, %self.param // CHECK:STDOUT: %t.param: @Base.F.%T (%T) = value_param call_param1 @@ -4373,23 +4373,23 @@ class T2(G2:! type) { // CHECK:STDOUT: %Base.loc8_23.1: type = class_type @Base, @Base(constants.%ptr.e8f) [symbolic = %Base.loc8_23.2 (constants.%Base.f29)] // CHECK:STDOUT: %.loc8: @Derived.%Derived.elem (%Derived.elem) = base_decl %Base.loc8_23.1, element0 [concrete] // CHECK:STDOUT: %Derived.F.decl: @Derived.%Derived.F.type (%Derived.F.type) = fn_decl @Derived.F [symbolic = @Derived.%Derived.F (constants.%Derived.F)] { -// CHECK:STDOUT: %self.patt: @Derived.F.%pattern_type.loc9_17 (%pattern_type.b9d) = value_binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: @Derived.F.%pattern_type.loc9_17 (%pattern_type.b9d) = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %t.patt: @Derived.F.%pattern_type.loc9_29 (%pattern_type.4f4) = value_binding_pattern t [concrete] -// CHECK:STDOUT: %t.param_patt: @Derived.F.%pattern_type.loc9_29 (%pattern_type.4f4) = value_param_pattern %t.patt, call_param1 [concrete] +// CHECK:STDOUT: %self.patt: @Derived.F.%pattern_type.loc9_24 (%pattern_type.b9d) = value_binding_pattern self [concrete] +// CHECK:STDOUT: %self.param_patt: @Derived.F.%pattern_type.loc9_24 (%pattern_type.b9d) = value_param_pattern %self.patt, call_param0 [concrete] +// CHECK:STDOUT: %t.patt: @Derived.F.%pattern_type.loc9_43 (%pattern_type.4f4) = value_binding_pattern t [concrete] +// CHECK:STDOUT: %t.param_patt: @Derived.F.%pattern_type.loc9_43 (%pattern_type.4f4) = value_param_pattern %t.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @Derived.F.%Derived (%Derived) = value_param call_param0 -// CHECK:STDOUT: %.loc9_23.1: type = splice_block %Self.ref [symbolic = %Derived (constants.%Derived)] { -// CHECK:STDOUT: %.loc9_23.2: type = specific_constant constants.%Derived, @Derived(constants.%T) [symbolic = %Derived (constants.%Derived)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc9_23.2 [symbolic = %Derived (constants.%Derived)] +// CHECK:STDOUT: %.loc9_30.1: type = splice_block %Self.ref [symbolic = %Derived (constants.%Derived)] { +// CHECK:STDOUT: %.loc9_30.2: type = specific_constant constants.%Derived, @Derived(constants.%T) [symbolic = %Derived (constants.%Derived)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc9_30.2 [symbolic = %Derived (constants.%Derived)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @Derived.F.%Derived (%Derived) = value_binding self, %self.param -// CHECK:STDOUT: %t.param: @Derived.F.%ptr.loc9_32 (%ptr.e8f) = value_param call_param1 -// CHECK:STDOUT: %.loc9_33: type = splice_block %ptr.loc9_33 [symbolic = %ptr.loc9_32 (constants.%ptr.e8f)] { +// CHECK:STDOUT: %t.param: @Derived.F.%ptr.loc9_46 (%ptr.e8f) = value_param call_param1 +// CHECK:STDOUT: %.loc9_47: type = splice_block %ptr.loc9_47 [symbolic = %ptr.loc9_46 (constants.%ptr.e8f)] { // CHECK:STDOUT: %T.ref: type = name_ref T, @Derived.%T.loc7_15.2 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %ptr.loc9_33: type = ptr_type %T.ref [symbolic = %ptr.loc9_32 (constants.%ptr.e8f)] +// CHECK:STDOUT: %ptr.loc9_47: type = ptr_type %T.ref [symbolic = %ptr.loc9_46 (constants.%ptr.e8f)] // CHECK:STDOUT: } -// CHECK:STDOUT: %t: @Derived.F.%ptr.loc9_32 (%ptr.e8f) = value_binding t, %t.param +// CHECK:STDOUT: %t: @Derived.F.%ptr.loc9_46 (%ptr.e8f) = value_binding t, %t.param // CHECK:STDOUT: } // CHECK:STDOUT: %Derived.F.specific_fn.loc10_1.1: = specific_function %Derived.F.decl, @Derived.F(constants.%T) [symbolic = %Derived.F.specific_fn.loc10_1.2 (constants.%Derived.F.specific_fn)] // CHECK:STDOUT: %vtable_decl: ref %ptr.454 = vtable_decl @Derived.vtable [concrete = constants.%Derived.vtable_decl] @@ -4418,12 +4418,12 @@ class T2(G2:! type) { // CHECK:STDOUT: generic virtual fn @Base.F(@Base.%T.loc4_21.2: type) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T) [symbolic = %Base (constants.%Base.d0c)] -// CHECK:STDOUT: %pattern_type.loc5_16: type = pattern_type %Base [symbolic = %pattern_type.loc5_16 (constants.%pattern_type.2f0)] -// CHECK:STDOUT: %pattern_type.loc5_28: type = pattern_type %T [symbolic = %pattern_type.loc5_28 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %pattern_type.loc5_23: type = pattern_type %Base [symbolic = %pattern_type.loc5_23 (constants.%pattern_type.2f0)] +// CHECK:STDOUT: %pattern_type.loc5_42: type = pattern_type %T [symbolic = %pattern_type.loc5_42 (constants.%pattern_type.51d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc5_20: = require_complete_type %Base [symbolic = %require_complete.loc5_20 (constants.%require_complete.1e0)] -// CHECK:STDOUT: %require_complete.loc5_29: = require_complete_type %T [symbolic = %require_complete.loc5_29 (constants.%require_complete.944)] +// CHECK:STDOUT: %require_complete.loc5_27: = require_complete_type %Base [symbolic = %require_complete.loc5_27 (constants.%require_complete.1e0)] +// CHECK:STDOUT: %require_complete.loc5_43: = require_complete_type %T [symbolic = %require_complete.loc5_43 (constants.%require_complete.944)] // CHECK:STDOUT: // CHECK:STDOUT: virtual fn(%self.param: @Base.F.%Base (%Base.d0c), %t.param: @Base.F.%T (%T)) { // CHECK:STDOUT: !entry: @@ -4434,17 +4434,17 @@ class T2(G2:! type) { // CHECK:STDOUT: generic override fn @Derived.F(@Derived.%T.loc7_15.2: type) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %Derived: type = class_type @Derived, @Derived(%T) [symbolic = %Derived (constants.%Derived)] -// CHECK:STDOUT: %pattern_type.loc9_17: type = pattern_type %Derived [symbolic = %pattern_type.loc9_17 (constants.%pattern_type.b9d)] -// CHECK:STDOUT: %ptr.loc9_32: type = ptr_type %T [symbolic = %ptr.loc9_32 (constants.%ptr.e8f)] -// CHECK:STDOUT: %Base: type = class_type @Base, @Base(%ptr.loc9_32) [symbolic = %Base (constants.%Base.f29)] -// CHECK:STDOUT: %require_complete.loc9_32: = require_complete_type %Base [symbolic = %require_complete.loc9_32 (constants.%require_complete.b3c)] -// CHECK:STDOUT: %pattern_type.loc9_29: type = pattern_type %ptr.loc9_32 [symbolic = %pattern_type.loc9_29 (constants.%pattern_type.4f4)] +// CHECK:STDOUT: %pattern_type.loc9_24: type = pattern_type %Derived [symbolic = %pattern_type.loc9_24 (constants.%pattern_type.b9d)] +// CHECK:STDOUT: %ptr.loc9_46: type = ptr_type %T [symbolic = %ptr.loc9_46 (constants.%ptr.e8f)] +// CHECK:STDOUT: %Base: type = class_type @Base, @Base(%ptr.loc9_46) [symbolic = %Base (constants.%Base.f29)] +// CHECK:STDOUT: %require_complete.loc9_46: = require_complete_type %Base [symbolic = %require_complete.loc9_46 (constants.%require_complete.b3c)] +// CHECK:STDOUT: %pattern_type.loc9_43: type = pattern_type %ptr.loc9_46 [symbolic = %pattern_type.loc9_43 (constants.%pattern_type.4f4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc9_21: = require_complete_type %Derived [symbolic = %require_complete.loc9_21 (constants.%require_complete.a43)] -// CHECK:STDOUT: %require_complete.loc9_30: = require_complete_type %ptr.loc9_32 [symbolic = %require_complete.loc9_30 (constants.%require_complete.ef1)] +// CHECK:STDOUT: %require_complete.loc9_28: = require_complete_type %Derived [symbolic = %require_complete.loc9_28 (constants.%require_complete.a43)] +// CHECK:STDOUT: %require_complete.loc9_44: = require_complete_type %ptr.loc9_46 [symbolic = %require_complete.loc9_44 (constants.%require_complete.ef1)] // CHECK:STDOUT: -// CHECK:STDOUT: override fn(%self.param: @Derived.F.%Derived (%Derived), %t.param: @Derived.F.%ptr.loc9_32 (%ptr.e8f)) { +// CHECK:STDOUT: override fn(%self.param: @Derived.F.%Derived (%Derived), %t.param: @Derived.F.%ptr.loc9_46 (%ptr.e8f)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -4462,12 +4462,12 @@ class T2(G2:! type) { // CHECK:STDOUT: specific @Base.F(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Base => constants.%Base.d0c -// CHECK:STDOUT: %pattern_type.loc5_16 => constants.%pattern_type.2f0 -// CHECK:STDOUT: %pattern_type.loc5_28 => constants.%pattern_type.51d +// CHECK:STDOUT: %pattern_type.loc5_23 => constants.%pattern_type.2f0 +// CHECK:STDOUT: %pattern_type.loc5_42 => constants.%pattern_type.51d // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc5_20 => constants.%require_complete.1e0 -// CHECK:STDOUT: %require_complete.loc5_29 => constants.%require_complete.944 +// CHECK:STDOUT: %require_complete.loc5_27 => constants.%require_complete.1e0 +// CHECK:STDOUT: %require_complete.loc5_43 => constants.%require_complete.944 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Derived(constants.%T) { @@ -4498,26 +4498,26 @@ class T2(G2:! type) { // CHECK:STDOUT: specific @Base.F(constants.%ptr.e8f) { // CHECK:STDOUT: %T => constants.%ptr.e8f // CHECK:STDOUT: %Base => constants.%Base.f29 -// CHECK:STDOUT: %pattern_type.loc5_16 => constants.%pattern_type.d96 -// CHECK:STDOUT: %pattern_type.loc5_28 => constants.%pattern_type.4f4 +// CHECK:STDOUT: %pattern_type.loc5_23 => constants.%pattern_type.d96 +// CHECK:STDOUT: %pattern_type.loc5_42 => constants.%pattern_type.4f4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc5_20 => constants.%require_complete.b3c -// CHECK:STDOUT: %require_complete.loc5_29 => constants.%require_complete.ef1 +// CHECK:STDOUT: %require_complete.loc5_27 => constants.%require_complete.b3c +// CHECK:STDOUT: %require_complete.loc5_43 => constants.%require_complete.ef1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Derived.F(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Derived => constants.%Derived -// CHECK:STDOUT: %pattern_type.loc9_17 => constants.%pattern_type.b9d -// CHECK:STDOUT: %ptr.loc9_32 => constants.%ptr.e8f +// CHECK:STDOUT: %pattern_type.loc9_24 => constants.%pattern_type.b9d +// CHECK:STDOUT: %ptr.loc9_46 => constants.%ptr.e8f // CHECK:STDOUT: %Base => constants.%Base.f29 -// CHECK:STDOUT: %require_complete.loc9_32 => constants.%require_complete.b3c -// CHECK:STDOUT: %pattern_type.loc9_29 => constants.%pattern_type.4f4 +// CHECK:STDOUT: %require_complete.loc9_46 => constants.%require_complete.b3c +// CHECK:STDOUT: %pattern_type.loc9_43 => constants.%pattern_type.4f4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc9_21 => constants.%require_complete.a43 -// CHECK:STDOUT: %require_complete.loc9_30 => constants.%require_complete.ef1 +// CHECK:STDOUT: %require_complete.loc9_28 => constants.%require_complete.a43 +// CHECK:STDOUT: %require_complete.loc9_44 => constants.%require_complete.ef1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- abstract_generic_undefined.carbon @@ -4742,9 +4742,9 @@ class T2(G2:! type) { // CHECK:STDOUT: %self.param_patt: @Base.F.%pattern_type (%pattern_type.2f0) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @Base.F.%Base (%Base) = value_param call_param0 -// CHECK:STDOUT: %.loc5_22.1: type = splice_block %Self.ref [symbolic = %Base (constants.%Base)] { -// CHECK:STDOUT: %.loc5_22.2: type = specific_constant constants.%Base, @Base(constants.%T) [symbolic = %Base (constants.%Base)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_22.2 [symbolic = %Base (constants.%Base)] +// CHECK:STDOUT: %.loc5_29.1: type = splice_block %Self.ref [symbolic = %Base (constants.%Base)] { +// CHECK:STDOUT: %.loc5_29.2: type = specific_constant constants.%Base, @Base(constants.%T) [symbolic = %Base (constants.%Base)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_29.2 [symbolic = %Base (constants.%Base)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @Base.F.%Base (%Base) = value_binding self, %self.param // CHECK:STDOUT: } @@ -4835,7 +4835,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %Main.import_ref.462: ref %ptr.454 = import_ref Main//generic_lib, loc6_1, loaded [concrete = constants.%Base.vtable_decl] // CHECK:STDOUT: %Main.import_ref.05e: = import_ref Main//generic_lib, loc6_1, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.2af = import_ref Main//generic_lib, inst{{[0-9A-F]+}} [no loc], unloaded -// CHECK:STDOUT: %Main.import_ref.1cf = import_ref Main//generic_lib, loc5_30, unloaded +// CHECK:STDOUT: %Main.import_ref.1cf = import_ref Main//generic_lib, loc5_37, unloaded // CHECK:STDOUT: %Main.import_ref.b3bc94.2: type = import_ref Main//generic_lib, loc4_17, loaded [symbolic = @Base.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.4f0: = import_ref Main//generic_lib, loc6_1, loaded [symbolic = constants.%Base.F.specific_fn.f8c] // CHECK:STDOUT: } @@ -5023,9 +5023,9 @@ class T2(G2:! type) { // CHECK:STDOUT: %self.param_patt: @T1.F.%pattern_type (%pattern_type.253617.1) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @T1.F.%T1 (%T1.6d4458.1) = value_param call_param0 -// CHECK:STDOUT: %.loc5_22.1: type = splice_block %Self.ref [symbolic = %T1 (constants.%T1.6d4458.1)] { -// CHECK:STDOUT: %.loc5_22.2: type = specific_constant constants.%T1.6d4458.1, @T1(constants.%G1) [symbolic = %T1 (constants.%T1.6d4458.1)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_22.2 [symbolic = %T1 (constants.%T1.6d4458.1)] +// CHECK:STDOUT: %.loc5_29.1: type = splice_block %Self.ref [symbolic = %T1 (constants.%T1.6d4458.1)] { +// CHECK:STDOUT: %.loc5_29.2: type = specific_constant constants.%T1.6d4458.1, @T1(constants.%G1) [symbolic = %T1 (constants.%T1.6d4458.1)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_29.2 [symbolic = %T1 (constants.%T1.6d4458.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @T1.F.%T1 (%T1.6d4458.1) = value_binding self, %self.param // CHECK:STDOUT: } @@ -5217,9 +5217,9 @@ class T2(G2:! type) { // CHECK:STDOUT: %self.param_patt: @T1.F.%pattern_type (%pattern_type.253617.1) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @T1.F.%T1 (%T1.6d4458.1) = value_param call_param0 -// CHECK:STDOUT: %.loc5_22.1: type = splice_block %Self.ref [symbolic = %T1 (constants.%T1.6d4458.1)] { -// CHECK:STDOUT: %.loc5_22.2: type = specific_constant constants.%T1.6d4458.1, @T1(constants.%G1) [symbolic = %T1 (constants.%T1.6d4458.1)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_22.2 [symbolic = %T1 (constants.%T1.6d4458.1)] +// CHECK:STDOUT: %.loc5_29.1: type = splice_block %Self.ref [symbolic = %T1 (constants.%T1.6d4458.1)] { +// CHECK:STDOUT: %.loc5_29.2: type = specific_constant constants.%T1.6d4458.1, @T1(constants.%G1) [symbolic = %T1 (constants.%T1.6d4458.1)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_29.2 [symbolic = %T1 (constants.%T1.6d4458.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @T1.F.%T1 (%T1.6d4458.1) = value_binding self, %self.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/const/basics.carbon b/toolchain/check/testdata/const/basics.carbon index dd387153d6c3..a0b6024dbbec 100644 --- a/toolchain/check/testdata/const/basics.carbon +++ b/toolchain/check/testdata/const/basics.carbon @@ -66,8 +66,8 @@ library "[[@TEST_NAME]]"; class X {} -fn TakeValue(x: X) {} -fn TakeConstValue(x: const X) {} +fn TakeValue(unused x: X) {} +fn TakeConstValue(unused x: const X) {} fn PassConstValueToValue(a: const X) { TakeValue(a); diff --git a/toolchain/check/testdata/dataflow/unused.carbon b/toolchain/check/testdata/dataflow/unused.carbon index ea70025488ca..1bfcede0ff31 100644 --- a/toolchain/check/testdata/dataflow/unused.carbon +++ b/toolchain/check/testdata/dataflow/unused.carbon @@ -17,134 +17,143 @@ fn ReturnVar() -> i32 { var x: i32 = 0; x = 1; return x; - // TODO: ensure no warning. } fn ReturnLet() -> i32 { let y: i32 = 1; return y; - // TODO: ensure no warning. } fn RefParam(ref x: i32) { x = 1; - // TODO: ensure no warning. } fn ReturnedVar() -> i32 { returned var x: i32 = 0; return var; - // TODO: ensure no warning. } fn ReturnVarExplicit() -> i32 { var x: i32 = 0; return x; - // TODO: ensure no warning. } fn FieldAccess() { var x: {.a: i32} = {.a = 0}; // Accessing a field should count as a use of x. - var y: i32 = x.a; - // TODO: ensure no warning. + var _: i32 = x.a; } fn ParametersUsed(x: i32) -> i32 { - // TODO: ensure no warning. return x; } -// --- fail_todo_unused_ref_param.carbon +// --- unused_ref_param.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_unused_ref_param.carbon:[[@LINE+4]]:19: error: semantics TODO: `unused` [SemanticsTodo] -// CHECK:STDERR: fn RefParamUnused(unused ref y: i32) { -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fn RefParamUnused(unused ref y: i32) { - // TODO: ensure no warning } -// --- todo_fail_local_let_named_not_used.carbon +// --- local_let_named_not_used.carbon library "[[@TEST_NAME]]"; fn F() { + // CHECK:STDERR: local_let_named_not_used.carbon:[[@LINE+4]]:7: warning: binding `x` unused [UnusedBinding] + // CHECK:STDERR: let x: i32 = 0; + // CHECK:STDERR: ^ + // CHECK:STDERR: let x: i32 = 0; - // TODO: warning, x is unused. } -// --- todo_fail_local_var_named_not_used.carbon +// --- local_var_named_not_used.carbon library "[[@TEST_NAME]]"; fn F() { + // CHECK:STDERR: local_var_named_not_used.carbon:[[@LINE+4]]:7: warning: binding `a` unused [UnusedBinding] + // CHECK:STDERR: var a: i32 = 0; + // CHECK:STDERR: ^ + // CHECK:STDERR: var a: i32 = 0; - // TODO: warning, a is unused. } -// --- todo_fail_local_var_shadowed_not_used.carbon +// --- local_var_shadowed_not_used.carbon library "[[@TEST_NAME]]"; fn F() { var x: i32 = 0; if (true) { + // CHECK:STDERR: local_var_shadowed_not_used.carbon:[[@LINE+4]]:9: warning: binding `x` unused [UnusedBinding] + // CHECK:STDERR: var x: i32 = 1; + // CHECK:STDERR: ^ + // CHECK:STDERR: var x: i32 = 1; - // TODO: warning, x is unused. } x = 2; - // TODO: warning, x is unused. } -// --- todo_fail_param_let_named_not_used.carbon +// --- param_let_named_not_used.carbon library "[[@TEST_NAME]]"; -fn F(p: i32) { - // TODO: warning, p is unused. -} - -// --- todo_fail_param_ref_named_not_used.carbon -library "[[@TEST_NAME]]"; - -fn F(ref y: i32) { - // TODO: warning, y is unused. -} - -// --- fail_todo_read_from_param_unused_ref.carbon -library "[[@TEST_NAME]]"; - -// CHECK:STDERR: fail_todo_read_from_param_unused_ref.carbon:[[@LINE+4]]:19: error: semantics TODO: `unused` [SemanticsTodo] -// CHECK:STDERR: fn RefParamUnused(unused ref y: i32) { -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~ +// CHECK:STDERR: param_let_named_not_used.carbon:[[@LINE+4]]:6: warning: binding `p` unused [UnusedBinding] +// CHECK:STDERR: fn F(p: i32) { +// CHECK:STDERR: ^ // CHECK:STDERR: -fn RefParamUnused(unused ref y: i32) { - var _: i32 = y; - // TODO: ensure error, marked "unused" but used. +fn F(p: i32) { } -// --- fail_todo_fail_unused_returned_var.carbon +// --- param_ref_named_not_used.carbon +library "[[@TEST_NAME]]"; + +// CHECK:STDERR: param_ref_named_not_used.carbon:[[@LINE+4]]:10: warning: binding `y` unused [UnusedBinding] +// CHECK:STDERR: fn F(ref y: i32) { +// CHECK:STDERR: ^ +// CHECK:STDERR: +fn F(ref y: i32) { +} + +// --- fail_read_from_param_unused_ref.carbon +library "[[@TEST_NAME]]"; + +// CHECK:STDERR: fail_read_from_param_unused_ref.carbon:[[@LINE+3]]:30: error: variable `y` marked `unused` but used [UnusedButUsed] +// CHECK:STDERR: fn RefParamUnused(unused ref y: i32) { +// CHECK:STDERR: ^ +fn RefParamUnused(unused ref y: i32) { + // CHECK:STDERR: fail_read_from_param_unused_ref.carbon:[[@LINE+4]]:16: note: usage here [UnusedButUsedHere] + // CHECK:STDERR: var _: i32 = y; + // CHECK:STDERR: ^ + // CHECK:STDERR: + var _: i32 = y; +} + +// --- fail_unused_returned_var.carbon library "[[@TEST_NAME]]"; fn F() -> i32 { - // CHECK:STDERR: fail_todo_fail_unused_returned_var.carbon:[[@LINE+4]]:16: error: semantics TODO: `unused` [SemanticsTodo] + // CHECK:STDERR: fail_unused_returned_var.carbon:[[@LINE+7]]:23: error: variable `x` marked `unused` but used [UnusedButUsed] // CHECK:STDERR: returned var unused x: i32 = 0; - // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_unused_returned_var.carbon:[[@LINE+4]]:23: note: usage here [UnusedButUsedHere] + // CHECK:STDERR: returned var unused x: i32 = 0; + // CHECK:STDERR: ^ // CHECK:STDERR: returned var unused x: i32 = 0; - // TODO: ensure error, marked "unused" but used. return var; } -// --- fail_todo_fail_read_from_unused_local_var.carbon +// --- fail_read_from_unused_local_var.carbon library "[[@TEST_NAME]]"; fn F(x: i32) { var _: i32 = x; - // CHECK:STDERR: fail_todo_fail_read_from_unused_local_var.carbon:[[@LINE+4]]:7: error: semantics TODO: `unused` [SemanticsTodo] + // CHECK:STDERR: fail_read_from_unused_local_var.carbon:[[@LINE+3]]:14: error: variable `y` marked `unused` but used [UnusedButUsed] // CHECK:STDERR: var unused y: i32 = x; - // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: + // CHECK:STDERR: ^ var unused y: i32 = x; // TODO: error, marked "unused", but used + // CHECK:STDERR: fail_read_from_unused_local_var.carbon:[[@LINE+4]]:23: note: usage here [UnusedButUsedHere] + // CHECK:STDERR: var unused z: i32 = y; + // CHECK:STDERR: ^ + // CHECK:STDERR: var unused z: i32 = y; } @@ -166,3 +175,155 @@ fn F() -> i32 { return 0; // TODO: ensure no warning (after match is implemented). } + +// --- fail_unused_decl.carbon +library "[[@TEST_NAME]]"; + +// CHECK:STDERR: fail_unused_decl.carbon:[[@LINE+4]]:13: error: `unused` modifier on declaration [UnusedModifierOnDeclaration] +// CHECK:STDERR: fn F(unused x: i32); +// CHECK:STDERR: ^ +// CHECK:STDERR: +fn F(unused x: i32); + +// --- fail_multiple_uses_of_unused.carbon +library "[[@TEST_NAME]]"; + +fn F() { + // CHECK:STDERR: fail_multiple_uses_of_unused.carbon:[[@LINE+3]]:14: error: variable `x` marked `unused` but used [UnusedButUsed] + // CHECK:STDERR: var unused x: i32 = 0; + // CHECK:STDERR: ^ + var unused x: i32 = 0; + // CHECK:STDERR: fail_multiple_uses_of_unused.carbon:[[@LINE+4]]:3: note: usage here [UnusedButUsedHere] + // CHECK:STDERR: x; + // CHECK:STDERR: ^ + // CHECK:STDERR: + x; + x; +} + +// --- fail_unused_does_not_affect_redeclaration.carbon +library "[[@TEST_NAME]]"; + +fn F(x: i32); +// CHECK:STDERR: fail_unused_does_not_affect_redeclaration.carbon:[[@LINE+7]]:13: error: redeclaration differs at parameter 1 [RedeclParamDiffers] +// CHECK:STDERR: fn F(unused y: i32) {} +// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_unused_does_not_affect_redeclaration.carbon:[[@LINE-4]]:6: note: previous declaration's corresponding parameter here [RedeclParamPrevious] +// CHECK:STDERR: fn F(x: i32); +// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: +fn F(unused y: i32) {} + +// --- unreachable.carbon +library "[[@TEST_NAME]]"; + +fn F(x: i32) { + return; + // Unreachable use suppresses the UnusedBinding warning. + var y: i32 = x; +} + +fn G(unused x: i32) { + return; + // Unreachable use is ignored, so no UnusedButUsed error. + var y: i32 = x; +} + +fn H(ref x: i32) { + return; + // Unreachable assignment suppresses the UnusedBinding warning. + x = 0; +} + +// --- fail_todo_unused_generic.carbon +library "[[@TEST_NAME]]"; + +fn F(T:! type); + +// CHECK:STDERR: fail_todo_unused_generic.carbon:[[@LINE+4]]:13: error: semantics TODO: `generic redeclaration differs from previous declaration` [SemanticsTodo] +// CHECK:STDERR: fn F(unused T:! type) {} +// CHECK:STDERR: ^ +// CHECK:STDERR: +fn F(unused T:! type) {} + +class C(T:! type); + +// CHECK:STDERR: fail_todo_unused_generic.carbon:[[@LINE+4]]:16: error: semantics TODO: `generic redeclaration differs from previous declaration` [SemanticsTodo] +// CHECK:STDERR: class C(unused T:! type) {} +// CHECK:STDERR: ^ +// CHECK:STDERR: +class C(unused T:! type) {} + +// TODO: Multiple diagnostics on same line has non-deterministic order. +// Uncomment after adding second sort key in diagnostics sorting. +// +// // --- fail_unused_let_multiple_uses.carbon +// library "[[@TEST_NAME]]"; +// +// fn F() { +// // CHECK:STDERR: fail_unused_let_multiple_uses.carbon:[[@LINE+3]]:14: error: variable `x` marked `unused` but used [UnusedButUsed] +// // CHECK:STDERR: let unused x: i32 = 0; +// // CHECK:STDERR: ^ +// let unused x: i32 = 0; +// // CHECK:STDERR: fail_unused_let_multiple_uses.carbon:[[@LINE+8]]:16: note: usage here [UnusedButUsedHere] +// // CHECK:STDERR: var y: i32 = x; +// // CHECK:STDERR: ^ +// // CHECK:STDERR: +// // CHECK:STDERR: fail_unused_let_multiple_uses.carbon:[[@LINE+4]]:7: warning: binding `y` unused [UnusedBinding] +// // CHECK:STDERR: var y: i32 = x; +// // CHECK:STDERR: ^ +// // CHECK:STDERR: +// var y: i32 = x; +// // CHECK:STDERR: fail_unused_let_multiple_uses.carbon:[[@LINE+4]]:7: warning: binding `z` unused [UnusedBinding] +// // CHECK:STDERR: var z: i32 = x; +// // CHECK:STDERR: ^ +// // CHECK:STDERR: +// var z: i32 = x; +// } + +// TODO: Multiple diagnostics on same line has non-deterministic order. +// Uncomment after adding second sort key in diagnostics sorting. +// +// // --- multiple_unused_bindings.carbon +// library "[[@TEST_NAME]]"; +// +// fn F() { +// // CHECK:STDERR: multiple_unused_bindings.carbon:[[@LINE+4]]:7: warning: binding `x` unused [UnusedBinding] +// // CHECK:STDERR: var x: i32 = 0; +// // CHECK:STDERR: ^ +// // CHECK:STDERR: +// var x: i32 = 0; +// // CHECK:STDERR: multiple_unused_bindings.carbon:[[@LINE+4]]:7: warning: binding `y` unused [UnusedBinding] +// // CHECK:STDERR: var y: i32 = 0; +// // CHECK:STDERR: ^ +// // CHECK:STDERR: +// var y: i32 = 0; +// } + +// TODO: Multiple diagnostics on same line has non-deterministic order. +// Uncomment after adding second sort key in diagnostics sorting. +// +// // --- fail_unused_tuple.carbon +// library "[[@TEST_NAME]]"; +// +// fn F() -> i32 { +// // CHECK:STDERR: fail_unused_tuple.carbon:[[@LINE+3]]:15: error: variable `a` marked `unused` but used [UnusedButUsed] +// // CHECK:STDERR: let unused (a: i32, +// // CHECK:STDERR: ^ +// let unused (a: i32, +// b: i32) = (1, 2); +// // CHECK:STDERR: fail_unused_tuple.carbon:[[@LINE+7]]:16: note: usage here [UnusedButUsedHere] +// // CHECK:STDERR: let i: i32 = a; +// // CHECK:STDERR: ^ +// // CHECK:STDERR: +// // CHECK:STDERR: fail_unused_tuple.carbon:[[@LINE-5]]:15: error: variable `b` marked `unused` but used [UnusedButUsed] +// // CHECK:STDERR: b: i32) = (1, 2); +// // CHECK:STDERR: ^ +// let i: i32 = a; +// // CHECK:STDERR: fail_unused_tuple.carbon:[[@LINE+4]]:23: note: usage here [UnusedButUsedHere] +// // CHECK:STDERR: let unused j: i32 = b; +// // CHECK:STDERR: ^ +// // CHECK:STDERR: +// let unused j: i32 = b; +// return i; +// } diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index 05d2d855e5cc..699e5d178dbf 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -31,7 +31,7 @@ library "[[@TEST_NAME]]"; class C {} -fn F[N:! Core.IntLiteral()](a: array(C, N)) -> i32 { return N; } +fn F[N:! Core.IntLiteral()](unused a: array(C, N)) -> i32 { return N; } fn G() -> i32 { var a: array(C, 3) = ({}, {}, {}); @@ -44,7 +44,7 @@ library "[[@TEST_NAME]]"; class C {} -fn F[T:! type, N:! Core.IntLiteral()](a: array(T, N)) {} +fn F[T:! type, N:! Core.IntLiteral()](unused a: array(T, N)) {} fn G() { var a: array(C, 3) = ({}, {}, {}); @@ -82,7 +82,7 @@ library "[[@TEST_NAME]]"; class C {} class D {} -fn F[N:! Core.IntLiteral()](a: array(C, N)) -> i32 { return N; } +fn F[N:! Core.IntLiteral()](unused a: array(C, N)) -> i32 { return N; } fn G() -> i32 { // TODO: We succeed at deducing N here but fail to convert. Is this the right behavior? @@ -93,9 +93,9 @@ fn G() -> i32 { // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:12: note: type `array(D, 3)` does not implement interface `Core.ImplicitAs(array(C, 3))` [MissingImplInMemberAccessNote] // CHECK:STDERR: return F(a); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE-11]]:29: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fn F[N:! Core.IntLiteral()](a: array(C, N)) -> i32 { return N; } - // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE-11]]:36: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: fn F[N:! Core.IntLiteral()](unused a: array(C, N)) -> i32 { return N; } + // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: return F(a); } @@ -106,7 +106,7 @@ library "[[@TEST_NAME]]"; class C {} -fn F[N:! i32](a: array(C, N)) -> i32 { return N; } +fn F[N:! i32](unused a: array(C, N)) -> i32 { return N; } fn G() -> i32 { var a: array(C, 3) = ({}, {}, {}); @@ -119,8 +119,8 @@ fn G() -> i32 { // CHECK:STDERR: return F(a); // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_bound_type_mismatch.carbon:[[@LINE-12]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn F[N:! i32](a: array(C, N)) -> i32 { return N; } - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn F[N:! i32](unused a: array(C, N)) -> i32 { return N; } + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: return F(a); } @@ -130,7 +130,7 @@ library "[[@TEST_NAME]]"; class C {} -fn F[N:! i32](a: array(C, N)) {} +fn F[N:! i32](unused a: array(C, N)) {} fn G() { // TODO: Deduce N as 3 from the tuple's size. @@ -139,8 +139,8 @@ fn G() { // CHECK:STDERR: F(({}, {}, {})); // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_array_length_from_tuple.carbon:[[@LINE-8]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn F[N:! i32](a: array(C, N)) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn F[N:! i32](unused a: array(C, N)) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: F(({}, {}, {})); } @@ -439,7 +439,7 @@ fn G() { // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc6_48: Core.Form = init_form %i32, call_param1 [concrete = constants.%.e54] +// CHECK:STDOUT: %.loc6_55: Core.Form = init_form %i32, call_param1 [concrete = constants.%.e54] // CHECK:STDOUT: %.loc6_26.1: type = splice_block %.loc6_26.3 [concrete = Core.IntLiteral] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] @@ -449,13 +449,13 @@ fn G() { // CHECK:STDOUT: %.loc6_26.3: type = converted %IntLiteral.call, %.loc6_26.2 [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc6_6.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc6_6.1 (constants.%N)] -// CHECK:STDOUT: %a.param: @F.%array_type.loc6_42.1 (%array_type.c79) = value_param call_param0 -// CHECK:STDOUT: %.loc6_42: type = splice_block %array_type.loc6_42.2 [symbolic = %array_type.loc6_42.1 (constants.%array_type.c79)] { +// CHECK:STDOUT: %a.param: @F.%array_type.loc6_49.1 (%array_type.c79) = value_param call_param0 +// CHECK:STDOUT: %.loc6_49: type = splice_block %array_type.loc6_49.2 [symbolic = %array_type.loc6_49.1 (constants.%array_type.c79)] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %N.ref.loc6_41: Core.IntLiteral = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N)] -// CHECK:STDOUT: %array_type.loc6_42.2: type = array_type %N.ref.loc6_41, %C.ref [symbolic = %array_type.loc6_42.1 (constants.%array_type.c79)] +// CHECK:STDOUT: %N.ref.loc6_48: Core.IntLiteral = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N)] +// CHECK:STDOUT: %array_type.loc6_49.2: type = array_type %N.ref.loc6_48, %C.ref [symbolic = %array_type.loc6_49.1 (constants.%array_type.c79)] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: @F.%array_type.loc6_42.1 (%array_type.c79) = value_binding a, %a.param +// CHECK:STDOUT: %a: @F.%array_type.loc6_49.1 (%array_type.c79) = value_binding a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -481,25 +481,25 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc6_6.2: Core.IntLiteral) { // CHECK:STDOUT: %N.loc6_6.1: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc6_6.1 (constants.%N)] -// CHECK:STDOUT: %array_type.loc6_42.1: type = array_type %N.loc6_6.1, constants.%C [symbolic = %array_type.loc6_42.1 (constants.%array_type.c79)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_42.1 [symbolic = %pattern_type (constants.%pattern_type.cc9)] +// CHECK:STDOUT: %array_type.loc6_49.1: type = array_type %N.loc6_6.1, constants.%C [symbolic = %array_type.loc6_49.1 (constants.%array_type.c79)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_49.1 [symbolic = %pattern_type (constants.%pattern_type.cc9)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc6_42.1 [symbolic = %require_complete (constants.%require_complete.d0d)] +// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc6_49.1 [symbolic = %require_complete (constants.%require_complete.d0d)] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %N.loc6_6.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.d6e)] -// CHECK:STDOUT: %bound_method.loc6_62.3: = bound_method %N.loc6_6.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc6_62.3 (constants.%bound_method.7fa)] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.2: init %i32 = call %bound_method.loc6_62.3(%N.loc6_6.1) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %bound_method.loc6_69.3: = bound_method %N.loc6_6.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc6_69.3 (constants.%bound_method.7fa)] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_69.2: init %i32 = call %bound_method.loc6_69.3(%N.loc6_6.1) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_69.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_42.1 (%array_type.c79)) -> out %return.param: %i32 { +// CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_49.1 (%array_type.c79)) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %N.ref.loc6_61: Core.IntLiteral = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N)] +// CHECK:STDOUT: %N.ref.loc6_68: Core.IntLiteral = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N)] // CHECK:STDOUT: %impl.elem0: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc6_62.1: = bound_method %N.ref.loc6_61, %impl.elem0 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.d6e)] +// CHECK:STDOUT: %bound_method.loc6_69.1: = bound_method %N.ref.loc6_68, %impl.elem0 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.d6e)] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc6_62.2: = bound_method %N.ref.loc6_61, %specific_fn [symbolic = %bound_method.loc6_62.3 (constants.%bound_method.7fa)] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.1: init %i32 = call %bound_method.loc6_62.2(%N.ref.loc6_61) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %.loc6_62: init %i32 = converted %N.ref.loc6_61, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: return %.loc6_62 +// CHECK:STDOUT: %bound_method.loc6_69.2: = bound_method %N.ref.loc6_68, %specific_fn [symbolic = %bound_method.loc6_69.3 (constants.%bound_method.7fa)] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_69.1: init %i32 = call %bound_method.loc6_69.2(%N.ref.loc6_68) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_69.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %.loc6_69: init %i32 = converted %N.ref.loc6_68, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_69.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_69.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: return %.loc6_69 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -549,20 +549,20 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc6_6.1 => constants.%N -// CHECK:STDOUT: %array_type.loc6_42.1 => constants.%array_type.c79 +// CHECK:STDOUT: %array_type.loc6_49.1 => constants.%array_type.c79 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cc9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%int_3.1ba) { // CHECK:STDOUT: %N.loc6_6.1 => constants.%int_3.1ba -// CHECK:STDOUT: %array_type.loc6_42.1 => constants.%array_type.931 +// CHECK:STDOUT: %array_type.loc6_49.1 => constants.%array_type.931 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.f21 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.c7a // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound => constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061 -// CHECK:STDOUT: %bound_method.loc6_62.3 => constants.%bound_method.fa7 -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.2 => constants.%int_3.822 +// CHECK:STDOUT: %bound_method.loc6_69.3 => constants.%bound_method.fa7 +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_69.2 => constants.%int_3.822 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- type_and_bound.carbon @@ -642,13 +642,13 @@ fn G() { // CHECK:STDOUT: %.loc6_36.3: type = converted %IntLiteral.call, %.loc6_36.2 [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc6_16.2: Core.IntLiteral = symbolic_binding N, 1 [symbolic = %N.loc6_16.1 (constants.%N)] -// CHECK:STDOUT: %a.param: @F.%array_type.loc6_52.1 (%array_type.6d2) = value_param call_param0 -// CHECK:STDOUT: %.loc6_52: type = splice_block %array_type.loc6_52.2 [symbolic = %array_type.loc6_52.1 (constants.%array_type.6d2)] { +// CHECK:STDOUT: %a.param: @F.%array_type.loc6_59.1 (%array_type.6d2) = value_param call_param0 +// CHECK:STDOUT: %.loc6_59: type = splice_block %array_type.loc6_59.2 [symbolic = %array_type.loc6_59.1 (constants.%array_type.6d2)] { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_6.2 [symbolic = %T.loc6_6.1 (constants.%T)] // CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc6_16.2 [symbolic = %N.loc6_16.1 (constants.%N)] -// CHECK:STDOUT: %array_type.loc6_52.2: type = array_type %N.ref, %T.ref [symbolic = %array_type.loc6_52.1 (constants.%array_type.6d2)] +// CHECK:STDOUT: %array_type.loc6_59.2: type = array_type %N.ref, %T.ref [symbolic = %array_type.loc6_59.1 (constants.%array_type.6d2)] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: @F.%array_type.loc6_52.1 (%array_type.6d2) = value_binding a, %a.param +// CHECK:STDOUT: %a: @F.%array_type.loc6_59.1 (%array_type.6d2) = value_binding a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {} // CHECK:STDOUT: } @@ -664,13 +664,13 @@ fn G() { // CHECK:STDOUT: generic fn @F(%T.loc6_6.2: type, %N.loc6_16.2: Core.IntLiteral) { // CHECK:STDOUT: %T.loc6_6.1: type = symbolic_binding T, 0 [symbolic = %T.loc6_6.1 (constants.%T)] // CHECK:STDOUT: %N.loc6_16.1: Core.IntLiteral = symbolic_binding N, 1 [symbolic = %N.loc6_16.1 (constants.%N)] -// CHECK:STDOUT: %array_type.loc6_52.1: type = array_type %N.loc6_16.1, %T.loc6_6.1 [symbolic = %array_type.loc6_52.1 (constants.%array_type.6d2)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_52.1 [symbolic = %pattern_type (constants.%pattern_type.4d8)] +// CHECK:STDOUT: %array_type.loc6_59.1: type = array_type %N.loc6_16.1, %T.loc6_6.1 [symbolic = %array_type.loc6_59.1 (constants.%array_type.6d2)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_59.1 [symbolic = %pattern_type (constants.%pattern_type.4d8)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc6_52.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc6_59.1 [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_52.1 (%array_type.6d2)) { +// CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_59.1 (%array_type.6d2)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -723,14 +723,14 @@ fn G() { // CHECK:STDOUT: specific @F(constants.%T, constants.%N) { // CHECK:STDOUT: %T.loc6_6.1 => constants.%T // CHECK:STDOUT: %N.loc6_16.1 => constants.%N -// CHECK:STDOUT: %array_type.loc6_52.1 => constants.%array_type.6d2 +// CHECK:STDOUT: %array_type.loc6_59.1 => constants.%array_type.6d2 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.4d8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%C, constants.%int_3) { // CHECK:STDOUT: %T.loc6_6.1 => constants.%C // CHECK:STDOUT: %N.loc6_16.1 => constants.%int_3 -// CHECK:STDOUT: %array_type.loc6_52.1 => constants.%array_type.931 +// CHECK:STDOUT: %array_type.loc6_59.1 => constants.%array_type.931 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.f21 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -1042,7 +1042,7 @@ fn G() { // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc7_48: Core.Form = init_form %i32, call_param1 [concrete = constants.%.e54] +// CHECK:STDOUT: %.loc7_55: Core.Form = init_form %i32, call_param1 [concrete = constants.%.e54] // CHECK:STDOUT: %.loc7_26.1: type = splice_block %.loc7_26.3 [concrete = Core.IntLiteral] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] @@ -1052,13 +1052,13 @@ fn G() { // CHECK:STDOUT: %.loc7_26.3: type = converted %IntLiteral.call, %.loc7_26.2 [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc7_6.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc7_6.1 (constants.%N)] -// CHECK:STDOUT: %a.param: @F.%array_type.loc7_42.1 (%array_type.c79) = value_param call_param0 -// CHECK:STDOUT: %.loc7_42: type = splice_block %array_type.loc7_42.2 [symbolic = %array_type.loc7_42.1 (constants.%array_type.c79)] { +// CHECK:STDOUT: %a.param: @F.%array_type.loc7_49.1 (%array_type.c79) = value_param call_param0 +// CHECK:STDOUT: %.loc7_49: type = splice_block %array_type.loc7_49.2 [symbolic = %array_type.loc7_49.1 (constants.%array_type.c79)] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %N.ref.loc7_41: Core.IntLiteral = name_ref N, %N.loc7_6.2 [symbolic = %N.loc7_6.1 (constants.%N)] -// CHECK:STDOUT: %array_type.loc7_42.2: type = array_type %N.ref.loc7_41, %C.ref [symbolic = %array_type.loc7_42.1 (constants.%array_type.c79)] +// CHECK:STDOUT: %N.ref.loc7_48: Core.IntLiteral = name_ref N, %N.loc7_6.2 [symbolic = %N.loc7_6.1 (constants.%N)] +// CHECK:STDOUT: %array_type.loc7_49.2: type = array_type %N.ref.loc7_48, %C.ref [symbolic = %array_type.loc7_49.1 (constants.%array_type.c79)] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: @F.%array_type.loc7_42.1 (%array_type.c79) = value_binding a, %a.param +// CHECK:STDOUT: %a: @F.%array_type.loc7_49.1 (%array_type.c79) = value_binding a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -1092,25 +1092,25 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc7_6.2: Core.IntLiteral) { // CHECK:STDOUT: %N.loc7_6.1: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc7_6.1 (constants.%N)] -// CHECK:STDOUT: %array_type.loc7_42.1: type = array_type %N.loc7_6.1, constants.%C [symbolic = %array_type.loc7_42.1 (constants.%array_type.c79)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc7_42.1 [symbolic = %pattern_type (constants.%pattern_type.cc9)] +// CHECK:STDOUT: %array_type.loc7_49.1: type = array_type %N.loc7_6.1, constants.%C [symbolic = %array_type.loc7_49.1 (constants.%array_type.c79)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc7_49.1 [symbolic = %pattern_type (constants.%pattern_type.cc9)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc7_42.1 [symbolic = %require_complete (constants.%require_complete.d0d)] +// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc7_49.1 [symbolic = %require_complete (constants.%require_complete.d0d)] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %N.loc7_6.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.d6e)] -// CHECK:STDOUT: %bound_method.loc7_62.3: = bound_method %N.loc7_6.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc7_62.3 (constants.%bound_method.7fa)] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.2: init %i32 = call %bound_method.loc7_62.3(%N.loc7_6.1) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %bound_method.loc7_69.3: = bound_method %N.loc7_6.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc7_69.3 (constants.%bound_method.7fa)] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_69.2: init %i32 = call %bound_method.loc7_69.3(%N.loc7_6.1) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_69.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%a.param: @F.%array_type.loc7_42.1 (%array_type.c79)) -> out %return.param: %i32 { +// CHECK:STDOUT: fn(%a.param: @F.%array_type.loc7_49.1 (%array_type.c79)) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %N.ref.loc7_61: Core.IntLiteral = name_ref N, %N.loc7_6.2 [symbolic = %N.loc7_6.1 (constants.%N)] +// CHECK:STDOUT: %N.ref.loc7_68: Core.IntLiteral = name_ref N, %N.loc7_6.2 [symbolic = %N.loc7_6.1 (constants.%N)] // CHECK:STDOUT: %impl.elem0: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc7_62.1: = bound_method %N.ref.loc7_61, %impl.elem0 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.d6e)] +// CHECK:STDOUT: %bound_method.loc7_69.1: = bound_method %N.ref.loc7_68, %impl.elem0 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.d6e)] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc7_62.2: = bound_method %N.ref.loc7_61, %specific_fn [symbolic = %bound_method.loc7_62.3 (constants.%bound_method.7fa)] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.1: init %i32 = call %bound_method.loc7_62.2(%N.ref.loc7_61) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %.loc7_62: init %i32 = converted %N.ref.loc7_61, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: return %.loc7_62 +// CHECK:STDOUT: %bound_method.loc7_69.2: = bound_method %N.ref.loc7_68, %specific_fn [symbolic = %bound_method.loc7_69.3 (constants.%bound_method.7fa)] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_69.1: init %i32 = call %bound_method.loc7_69.2(%N.ref.loc7_68) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_69.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %.loc7_69: init %i32 = converted %N.ref.loc7_68, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_69.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_69.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: return %.loc7_69 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1160,20 +1160,20 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc7_6.1 => constants.%N -// CHECK:STDOUT: %array_type.loc7_42.1 => constants.%array_type.c79 +// CHECK:STDOUT: %array_type.loc7_49.1 => constants.%array_type.c79 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cc9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%int_3.1ba) { // CHECK:STDOUT: %N.loc7_6.1 => constants.%int_3.1ba -// CHECK:STDOUT: %array_type.loc7_42.1 => constants.%array_type.931 +// CHECK:STDOUT: %array_type.loc7_49.1 => constants.%array_type.931 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.f21 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.c7a // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound => constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061 -// CHECK:STDOUT: %bound_method.loc7_62.3 => constants.%bound_method.fa7 -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.2 => constants.%int_3.822 +// CHECK:STDOUT: %bound_method.loc7_69.3 => constants.%bound_method.fa7 +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_69.2 => constants.%int_3.822 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_bound_type_mismatch.carbon @@ -1280,29 +1280,29 @@ fn G() { // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_34: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_34: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc6_34: Core.Form = init_form %i32.loc6_34, call_param1 [concrete = constants.%.e54] +// CHECK:STDOUT: %int_32.loc6_41: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_41: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc6_41: Core.Form = init_form %i32.loc6_41, call_param1 [concrete = constants.%.e54] // CHECK:STDOUT: %.loc6_10: type = splice_block %i32.loc6_10 [concrete = constants.%i32] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc6_6.2: %i32 = symbolic_binding N, 0 [symbolic = %N.loc6_6.1 (constants.%N.5de)] -// CHECK:STDOUT: %a.param: @F.%array_type.loc6_28.1 (%array_type.8c3) = value_param call_param0 -// CHECK:STDOUT: %.loc6_28: type = splice_block %array_type.loc6_28.2 [symbolic = %array_type.loc6_28.1 (constants.%array_type.8c3)] { +// CHECK:STDOUT: %a.param: @F.%array_type.loc6_35.1 (%array_type.8c3) = value_param call_param0 +// CHECK:STDOUT: %.loc6_35: type = splice_block %array_type.loc6_35.2 [symbolic = %array_type.loc6_35.1 (constants.%array_type.8c3)] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %N.ref.loc6_27: %i32 = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N.5de)] -// CHECK:STDOUT: %impl.elem0.loc6_27: %.0a7 = impl_witness_access constants.%ImplicitAs.impl_witness.640, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.dd4] -// CHECK:STDOUT: %bound_method.loc6_27.2: = bound_method %N.ref.loc6_27, %impl.elem0.loc6_27 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound)] -// CHECK:STDOUT: %specific_fn.loc6_27: = specific_function %impl.elem0.loc6_27, @Int.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Int.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc6_27.3: = bound_method %N.ref.loc6_27, %specific_fn.loc6_27 [symbolic = %bound_method.loc6_27.1 (constants.%bound_method.d76)] -// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc6_27.2: init Core.IntLiteral = call %bound_method.loc6_27.3(%N.ref.loc6_27) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %.loc6_27.1: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call.loc6_27.2 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %.loc6_27.2: Core.IntLiteral = converted %N.ref.loc6_27, %.loc6_27.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %array_type.loc6_28.2: type = array_type %.loc6_27.2, %C.ref [symbolic = %array_type.loc6_28.1 (constants.%array_type.8c3)] +// CHECK:STDOUT: %N.ref.loc6_34: %i32 = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N.5de)] +// CHECK:STDOUT: %impl.elem0.loc6_34: %.0a7 = impl_witness_access constants.%ImplicitAs.impl_witness.640, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.dd4] +// CHECK:STDOUT: %bound_method.loc6_34.2: = bound_method %N.ref.loc6_34, %impl.elem0.loc6_34 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound)] +// CHECK:STDOUT: %specific_fn.loc6_34: = specific_function %impl.elem0.loc6_34, @Int.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Int.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_34.3: = bound_method %N.ref.loc6_34, %specific_fn.loc6_34 [symbolic = %bound_method.loc6_34.1 (constants.%bound_method.d76)] +// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc6_34.2: init Core.IntLiteral = call %bound_method.loc6_34.3(%N.ref.loc6_34) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc6_34.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %.loc6_34.1: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call.loc6_34.2 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc6_34.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %.loc6_34.2: Core.IntLiteral = converted %N.ref.loc6_34, %.loc6_34.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc6_34.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %array_type.loc6_35.2: type = array_type %.loc6_34.2, %C.ref [symbolic = %array_type.loc6_35.1 (constants.%array_type.8c3)] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: @F.%array_type.loc6_28.1 (%array_type.8c3) = value_binding a, %a.param +// CHECK:STDOUT: %a: @F.%array_type.loc6_35.1 (%array_type.8c3) = value_binding a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -1329,24 +1329,24 @@ fn G() { // CHECK:STDOUT: generic fn @F(%N.loc6_6.2: %i32) { // CHECK:STDOUT: %N.loc6_6.1: %i32 = symbolic_binding N, 0 [symbolic = %N.loc6_6.1 (constants.%N.5de)] // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound: = bound_method %N.loc6_6.1, constants.%Int.as.ImplicitAs.impl.Convert.dd4 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound)] -// CHECK:STDOUT: %bound_method.loc6_27.1: = bound_method %N.loc6_6.1, constants.%Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc6_27.1 (constants.%bound_method.d76)] -// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1: init Core.IntLiteral = call %bound_method.loc6_27.1(%N.loc6_6.1) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %array_type.loc6_28.1: type = array_type %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1, constants.%C [symbolic = %array_type.loc6_28.1 (constants.%array_type.8c3)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_28.1 [symbolic = %pattern_type (constants.%pattern_type.0fb)] +// CHECK:STDOUT: %bound_method.loc6_34.1: = bound_method %N.loc6_6.1, constants.%Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc6_34.1 (constants.%bound_method.d76)] +// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc6_34.1: init Core.IntLiteral = call %bound_method.loc6_34.1(%N.loc6_6.1) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc6_34.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %array_type.loc6_35.1: type = array_type %Int.as.ImplicitAs.impl.Convert.call.loc6_34.1, constants.%C [symbolic = %array_type.loc6_35.1 (constants.%array_type.8c3)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_35.1 [symbolic = %pattern_type (constants.%pattern_type.0fb)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc6_28.1 [symbolic = %require_complete (constants.%require_complete.a24)] +// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc6_35.1 [symbolic = %require_complete (constants.%require_complete.a24)] // CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: = bound_method %N.loc6_6.1, constants.%Int.as.Copy.impl.Op.664 [symbolic = %Int.as.Copy.impl.Op.bound (constants.%Int.as.Copy.impl.Op.bound)] -// CHECK:STDOUT: %bound_method.loc6_47.3: = bound_method %N.loc6_6.1, constants.%Int.as.Copy.impl.Op.specific_fn [symbolic = %bound_method.loc6_47.3 (constants.%bound_method.207)] +// CHECK:STDOUT: %bound_method.loc6_54.3: = bound_method %N.loc6_6.1, constants.%Int.as.Copy.impl.Op.specific_fn [symbolic = %bound_method.loc6_54.3 (constants.%bound_method.207)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_28.1 (%array_type.8c3)) -> out %return.param: %i32 { +// CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_35.1 (%array_type.8c3)) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %N.ref.loc6_47: %i32 = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N.5de)] -// CHECK:STDOUT: %impl.elem0.loc6_47: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] -// CHECK:STDOUT: %bound_method.loc6_47.1: = bound_method %N.ref.loc6_47, %impl.elem0.loc6_47 [symbolic = %Int.as.Copy.impl.Op.bound (constants.%Int.as.Copy.impl.Op.bound)] -// CHECK:STDOUT: %specific_fn.loc6_47: = specific_function %impl.elem0.loc6_47, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc6_47.2: = bound_method %N.ref.loc6_47, %specific_fn.loc6_47 [symbolic = %bound_method.loc6_47.3 (constants.%bound_method.207)] -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_47.2(%N.ref.loc6_47) [symbolic = %N.loc6_6.1 (constants.%N.5de)] +// CHECK:STDOUT: %N.ref.loc6_54: %i32 = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N.5de)] +// CHECK:STDOUT: %impl.elem0.loc6_54: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] +// CHECK:STDOUT: %bound_method.loc6_54.1: = bound_method %N.ref.loc6_54, %impl.elem0.loc6_54 [symbolic = %Int.as.Copy.impl.Op.bound (constants.%Int.as.Copy.impl.Op.bound)] +// CHECK:STDOUT: %specific_fn.loc6_54: = specific_function %impl.elem0.loc6_54, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_54.2: = bound_method %N.ref.loc6_54, %specific_fn.loc6_54 [symbolic = %bound_method.loc6_54.3 (constants.%bound_method.207)] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_54.2(%N.ref.loc6_54) [symbolic = %N.loc6_6.1 (constants.%N.5de)] // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1395,9 +1395,9 @@ fn G() { // CHECK:STDOUT: specific @F(constants.%N.5de) { // CHECK:STDOUT: %N.loc6_6.1 => constants.%N.5de // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound => constants.%Int.as.ImplicitAs.impl.Convert.bound -// CHECK:STDOUT: %bound_method.loc6_27.1 => constants.%bound_method.d76 -// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1 => constants.%Int.as.ImplicitAs.impl.Convert.call -// CHECK:STDOUT: %array_type.loc6_28.1 => constants.%array_type.8c3 +// CHECK:STDOUT: %bound_method.loc6_34.1 => constants.%bound_method.d76 +// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc6_34.1 => constants.%Int.as.ImplicitAs.impl.Convert.call +// CHECK:STDOUT: %array_type.loc6_35.1 => constants.%array_type.8c3 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.0fb // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1476,20 +1476,20 @@ fn G() { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc5_6.2: %i32 = symbolic_binding N, 0 [symbolic = %N.loc5_6.1 (constants.%N.5de)] -// CHECK:STDOUT: %a.param: @F.%array_type.loc5_28.1 (%array_type) = value_param call_param0 -// CHECK:STDOUT: %.loc5_28: type = splice_block %array_type.loc5_28.2 [symbolic = %array_type.loc5_28.1 (constants.%array_type)] { +// CHECK:STDOUT: %a.param: @F.%array_type.loc5_35.1 (%array_type) = value_param call_param0 +// CHECK:STDOUT: %.loc5_35: type = splice_block %array_type.loc5_35.2 [symbolic = %array_type.loc5_35.1 (constants.%array_type)] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc5_6.2 [symbolic = %N.loc5_6.1 (constants.%N.5de)] // CHECK:STDOUT: %impl.elem0: %.0a7 = impl_witness_access constants.%ImplicitAs.impl_witness.640, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.dd4] -// CHECK:STDOUT: %bound_method.loc5_27.2: = bound_method %N.ref, %impl.elem0 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound)] +// CHECK:STDOUT: %bound_method.loc5_34.2: = bound_method %N.ref, %impl.elem0 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound)] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Int.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc5_27.3: = bound_method %N.ref, %specific_fn [symbolic = %bound_method.loc5_27.1 (constants.%bound_method)] -// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc5_27.2: init Core.IntLiteral = call %bound_method.loc5_27.3(%N.ref) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc5_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %.loc5_27.1: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call.loc5_27.2 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc5_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %.loc5_27.2: Core.IntLiteral = converted %N.ref, %.loc5_27.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc5_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %array_type.loc5_28.2: type = array_type %.loc5_27.2, %C.ref [symbolic = %array_type.loc5_28.1 (constants.%array_type)] +// CHECK:STDOUT: %bound_method.loc5_34.3: = bound_method %N.ref, %specific_fn [symbolic = %bound_method.loc5_34.1 (constants.%bound_method)] +// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc5_34.2: init Core.IntLiteral = call %bound_method.loc5_34.3(%N.ref) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc5_34.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %.loc5_34.1: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call.loc5_34.2 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc5_34.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %.loc5_34.2: Core.IntLiteral = converted %N.ref, %.loc5_34.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc5_34.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %array_type.loc5_35.2: type = array_type %.loc5_34.2, %C.ref [symbolic = %array_type.loc5_35.1 (constants.%array_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: @F.%array_type.loc5_28.1 (%array_type) = value_binding a, %a.param +// CHECK:STDOUT: %a: @F.%array_type.loc5_35.1 (%array_type) = value_binding a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {} // CHECK:STDOUT: } @@ -1505,15 +1505,15 @@ fn G() { // CHECK:STDOUT: generic fn @F(%N.loc5_6.2: %i32) { // CHECK:STDOUT: %N.loc5_6.1: %i32 = symbolic_binding N, 0 [symbolic = %N.loc5_6.1 (constants.%N.5de)] // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound: = bound_method %N.loc5_6.1, constants.%Int.as.ImplicitAs.impl.Convert.dd4 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound)] -// CHECK:STDOUT: %bound_method.loc5_27.1: = bound_method %N.loc5_6.1, constants.%Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc5_27.1 (constants.%bound_method)] -// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc5_27.1: init Core.IntLiteral = call %bound_method.loc5_27.1(%N.loc5_6.1) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc5_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %array_type.loc5_28.1: type = array_type %Int.as.ImplicitAs.impl.Convert.call.loc5_27.1, constants.%C [symbolic = %array_type.loc5_28.1 (constants.%array_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc5_28.1 [symbolic = %pattern_type (constants.%pattern_type.0fb)] +// CHECK:STDOUT: %bound_method.loc5_34.1: = bound_method %N.loc5_6.1, constants.%Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc5_34.1 (constants.%bound_method)] +// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc5_34.1: init Core.IntLiteral = call %bound_method.loc5_34.1(%N.loc5_6.1) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc5_34.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %array_type.loc5_35.1: type = array_type %Int.as.ImplicitAs.impl.Convert.call.loc5_34.1, constants.%C [symbolic = %array_type.loc5_35.1 (constants.%array_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc5_35.1 [symbolic = %pattern_type (constants.%pattern_type.0fb)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc5_28.1 [symbolic = %require_complete (constants.%require_complete.a24)] +// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc5_35.1 [symbolic = %require_complete (constants.%require_complete.a24)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%a.param: @F.%array_type.loc5_28.1 (%array_type)) { +// CHECK:STDOUT: fn(%a.param: @F.%array_type.loc5_35.1 (%array_type)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1532,9 +1532,9 @@ fn G() { // CHECK:STDOUT: specific @F(constants.%N.5de) { // CHECK:STDOUT: %N.loc5_6.1 => constants.%N.5de // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound => constants.%Int.as.ImplicitAs.impl.Convert.bound -// CHECK:STDOUT: %bound_method.loc5_27.1 => constants.%bound_method -// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc5_27.1 => constants.%Int.as.ImplicitAs.impl.Convert.call -// CHECK:STDOUT: %array_type.loc5_28.1 => constants.%array_type +// CHECK:STDOUT: %bound_method.loc5_34.1 => constants.%bound_method +// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc5_34.1 => constants.%Int.as.ImplicitAs.impl.Convert.call +// CHECK:STDOUT: %array_type.loc5_35.1 => constants.%array_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.0fb // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/binding_pattern.carbon b/toolchain/check/testdata/deduce/binding_pattern.carbon index 797d2d697370..33bf2f587186 100644 --- a/toolchain/check/testdata/deduce/binding_pattern.carbon +++ b/toolchain/check/testdata/deduce/binding_pattern.carbon @@ -17,19 +17,19 @@ library "[[@TEST_NAME]]"; class C(T:! type) { - fn Create(value: T) {} + fn Create(unused value: T) {} } -fn F(U:! type, V:! type) { +fn F(unused U:! type, V:! type) { // CHECK:STDERR: fail_incompatible_deduce.carbon:[[@LINE+10]]:15: error: cannot implicitly convert expression of type `{}` to `V` [ConversionFailure] // CHECK:STDERR: C(V).Create({}); // CHECK:STDERR: ^~ // CHECK:STDERR: fail_incompatible_deduce.carbon:[[@LINE+7]]:15: note: type `{}` does not implement interface `Core.ImplicitAs(V)` [MissingImplInMemberAccessNote] // CHECK:STDERR: C(V).Create({}); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_incompatible_deduce.carbon:[[@LINE-10]]:13: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fn Create(value: T) {} - // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: fail_incompatible_deduce.carbon:[[@LINE-10]]:20: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: fn Create(unused value: T) {} + // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: C(V).Create({}); } @@ -39,20 +39,20 @@ fn F(U:! type, V:! type) { library "[[@TEST_NAME]]"; class C(T:! type) { - fn Create(value: T) {} + fn Create(unused value: T) {} } // TODO: This `where` should be sufficient to say that `{} as V` works. -fn F(U:! type, V:! type where {} impls Core.ImplicitAs(.Self)) { +fn F(unused U:! type, V:! type where {} impls Core.ImplicitAs(.Self)) { // CHECK:STDERR: fail_todo_compatible_deduce.carbon:[[@LINE+10]]:15: error: cannot implicitly convert expression of type `{}` to `V` [ConversionFailure] // CHECK:STDERR: C(V).Create({}); // CHECK:STDERR: ^~ // CHECK:STDERR: fail_todo_compatible_deduce.carbon:[[@LINE+7]]:15: note: type `{}` does not implement interface `Core.ImplicitAs(V)` [MissingImplInMemberAccessNote] // CHECK:STDERR: C(V).Create({}); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_todo_compatible_deduce.carbon:[[@LINE-11]]:13: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fn Create(value: T) {} - // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: fail_todo_compatible_deduce.carbon:[[@LINE-11]]:20: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: fn Create(unused value: T) {} + // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: C(V).Create({}); } @@ -131,9 +131,9 @@ fn F(U:! type, V:! type where {} impls Core.ImplicitAs(.Self)) { // CHECK:STDOUT: %V.patt: %pattern_type.98f = symbolic_binding_pattern V, 1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %U.loc8_6.2: type = symbolic_binding U, 0 [symbolic = %U.loc8_6.1 (constants.%U)] +// CHECK:STDOUT: %U.loc8_13.2: type = symbolic_binding U, 0 [symbolic = %U.loc8_13.1 (constants.%U)] // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %V.loc8_16.2: type = symbolic_binding V, 1 [symbolic = %V.loc8_16.1 (constants.%V)] +// CHECK:STDOUT: %V.loc8_23.2: type = symbolic_binding V, 1 [symbolic = %V.loc8_23.1 (constants.%V)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -176,26 +176,26 @@ fn F(U:! type, V:! type where {} impls Core.ImplicitAs(.Self)) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%U.loc8_6.2: type, %V.loc8_16.2: type) { -// CHECK:STDOUT: %U.loc8_6.1: type = symbolic_binding U, 0 [symbolic = %U.loc8_6.1 (constants.%U)] -// CHECK:STDOUT: %V.loc8_16.1: type = symbolic_binding V, 1 [symbolic = %V.loc8_16.1 (constants.%V)] +// CHECK:STDOUT: generic fn @F(%U.loc8_13.2: type, %V.loc8_23.2: type) { +// CHECK:STDOUT: %U.loc8_13.1: type = symbolic_binding U, 0 [symbolic = %U.loc8_13.1 (constants.%U)] +// CHECK:STDOUT: %V.loc8_23.1: type = symbolic_binding V, 1 [symbolic = %V.loc8_23.1 (constants.%V)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %C.loc19_6.2: type = class_type @C, @C(%V.loc8_16.1) [symbolic = %C.loc19_6.2 (constants.%C.ee9)] +// CHECK:STDOUT: %C.loc19_6.2: type = class_type @C, @C(%V.loc8_23.1) [symbolic = %C.loc19_6.2 (constants.%C.ee9)] // CHECK:STDOUT: %require_complete.loc19_7: = require_complete_type %C.loc19_6.2 [symbolic = %require_complete.loc19_7 (constants.%require_complete.1fc)] -// CHECK:STDOUT: %C.Create.type: type = fn_type @C.Create, @C(%V.loc8_16.1) [symbolic = %C.Create.type (constants.%C.Create.type.c3d)] +// CHECK:STDOUT: %C.Create.type: type = fn_type @C.Create, @C(%V.loc8_23.1) [symbolic = %C.Create.type (constants.%C.Create.type.c3d)] // CHECK:STDOUT: %C.Create: @F.%C.Create.type (%C.Create.type.c3d) = struct_value () [symbolic = %C.Create (constants.%C.Create.b40)] -// CHECK:STDOUT: %C.Create.specific_fn.loc19_7.2: = specific_function %C.Create, @C.Create(%V.loc8_16.1) [symbolic = %C.Create.specific_fn.loc19_7.2 (constants.%C.Create.specific_fn)] -// CHECK:STDOUT: %require_complete.loc19_16.1: = require_complete_type %V.loc8_16.1 [symbolic = %require_complete.loc19_16.1 (constants.%require_complete.441)] -// CHECK:STDOUT: %ImplicitAs.type.loc19_16.2: type = facet_type <@ImplicitAs, @ImplicitAs(%V.loc8_16.1)> [symbolic = %ImplicitAs.type.loc19_16.2 (constants.%ImplicitAs.type.1e5)] +// CHECK:STDOUT: %C.Create.specific_fn.loc19_7.2: = specific_function %C.Create, @C.Create(%V.loc8_23.1) [symbolic = %C.Create.specific_fn.loc19_7.2 (constants.%C.Create.specific_fn)] +// CHECK:STDOUT: %require_complete.loc19_16.1: = require_complete_type %V.loc8_23.1 [symbolic = %require_complete.loc19_16.1 (constants.%require_complete.441)] +// CHECK:STDOUT: %ImplicitAs.type.loc19_16.2: type = facet_type <@ImplicitAs, @ImplicitAs(%V.loc8_23.1)> [symbolic = %ImplicitAs.type.loc19_16.2 (constants.%ImplicitAs.type.1e5)] // CHECK:STDOUT: %require_complete.loc19_16.2: = require_complete_type %ImplicitAs.type.loc19_16.2 [symbolic = %require_complete.loc19_16.2 (constants.%require_complete.cc6)] -// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%V.loc8_16.1) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.d88)] +// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%V.loc8_23.1) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.d88)] // CHECK:STDOUT: %assoc0: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.d88) = assoc_entity element0, imports.%Core.import_ref.201 [symbolic = %assoc0 (constants.%assoc0.3d8)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] -// CHECK:STDOUT: %V.ref: type = name_ref V, %V.loc8_16.2 [symbolic = %V.loc8_16.1 (constants.%V)] +// CHECK:STDOUT: %V.ref: type = name_ref V, %V.loc8_23.2 [symbolic = %V.loc8_23.1 (constants.%V)] // CHECK:STDOUT: %C.loc19_6.1: type = class_type @C, @C(constants.%V) [symbolic = %C.loc19_6.2 (constants.%C.ee9)] // CHECK:STDOUT: %.loc19_7: @F.%C.Create.type (%C.Create.type.c3d) = specific_constant @C.%C.Create.decl, @C(constants.%V) [symbolic = %C.Create (constants.%C.Create.b40)] // CHECK:STDOUT: %Create.ref: @F.%C.Create.type (%C.Create.type.c3d) = name_ref Create, %.loc19_7 [symbolic = %C.Create (constants.%C.Create.b40)] @@ -204,7 +204,7 @@ fn F(U:! type, V:! type where {} impls Core.ImplicitAs(.Self)) { // CHECK:STDOUT: %ImplicitAs.type.loc19_16.1: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%V)> [symbolic = %ImplicitAs.type.loc19_16.2 (constants.%ImplicitAs.type.1e5)] // CHECK:STDOUT: %.loc19_16.2: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.d88) = specific_constant imports.%Core.import_ref.178, @ImplicitAs(constants.%V, constants.%Self.738) [symbolic = %assoc0 (constants.%assoc0.3d8)] // CHECK:STDOUT: %Convert.ref: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.d88) = name_ref Convert, %.loc19_16.2 [symbolic = %assoc0 (constants.%assoc0.3d8)] -// CHECK:STDOUT: %.loc19_16.3: @F.%V.loc8_16.1 (%V) = converted %.loc19_16.1, [concrete = ] +// CHECK:STDOUT: %.loc19_16.3: @F.%V.loc8_23.1 (%V) = converted %.loc19_16.1, [concrete = ] // CHECK:STDOUT: %C.Create.call: init %empty_tuple.type = call %C.Create.specific_fn.loc19_7.1() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -224,8 +224,8 @@ fn F(U:! type, V:! type where {} impls Core.ImplicitAs(.Self)) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%U, constants.%V) { -// CHECK:STDOUT: %U.loc8_6.1 => constants.%U -// CHECK:STDOUT: %V.loc8_16.1 => constants.%V +// CHECK:STDOUT: %U.loc8_13.1 => constants.%U +// CHECK:STDOUT: %V.loc8_23.1 => constants.%V // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%V) { @@ -323,22 +323,22 @@ fn F(U:! type, V:! type where {} impls Core.ImplicitAs(.Self)) { // CHECK:STDOUT: %V.patt: %pattern_type.354 = symbolic_binding_pattern V, 1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39] -// CHECK:STDOUT: %U.loc9_6.2: type = symbolic_binding U, 0 [symbolic = %U.loc9_6.1 (constants.%U)] -// CHECK:STDOUT: %.loc9_25.1: type = splice_block %.loc9_25.2 [concrete = constants.%type_where] { +// CHECK:STDOUT: %U.loc9_13.2: type = symbolic_binding U, 0 [symbolic = %U.loc9_13.1 (constants.%U)] +// CHECK:STDOUT: %.loc9_32.1: type = splice_block %.loc9_32.2 [concrete = constants.%type_where] { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39] // CHECK:STDOUT: %.Self.3: type = symbolic_binding .Self [symbolic_self = constants.%.Self.16f] -// CHECK:STDOUT: %.loc9_32.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc9_39.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.cc7 = name_ref ImplicitAs, imports.%Core.ImplicitAs [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self.3 [symbolic_self = constants.%.Self.16f] // CHECK:STDOUT: %ImplicitAs.type.loc9: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%.Self.16f)> [symbolic_self = constants.%ImplicitAs.type.f60] -// CHECK:STDOUT: %.loc9_32.2: type = converted %.loc9_32.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc9_25.2: type = where_expr %.Self.3 [concrete = constants.%type_where] { +// CHECK:STDOUT: %.loc9_39.2: type = converted %.loc9_39.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc9_32.2: type = where_expr %.Self.3 [concrete = constants.%type_where] { // CHECK:STDOUT: requirement_base_facet_type type -// CHECK:STDOUT: requirement_impls %.loc9_32.2, %ImplicitAs.type.loc9 +// CHECK:STDOUT: requirement_impls %.loc9_39.2, %ImplicitAs.type.loc9 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %V.loc9_16.2: %type_where = symbolic_binding V, 1 [symbolic = %V.loc9_16.1 (constants.%V)] +// CHECK:STDOUT: %V.loc9_23.2: %type_where = symbolic_binding V, 1 [symbolic = %V.loc9_23.1 (constants.%V)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -381,12 +381,12 @@ fn F(U:! type, V:! type where {} impls Core.ImplicitAs(.Self)) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%U.loc9_6.2: type, %V.loc9_16.2: %type_where) { -// CHECK:STDOUT: %U.loc9_6.1: type = symbolic_binding U, 0 [symbolic = %U.loc9_6.1 (constants.%U)] -// CHECK:STDOUT: %V.loc9_16.1: %type_where = symbolic_binding V, 1 [symbolic = %V.loc9_16.1 (constants.%V)] +// CHECK:STDOUT: generic fn @F(%U.loc9_13.2: type, %V.loc9_23.2: %type_where) { +// CHECK:STDOUT: %U.loc9_13.1: type = symbolic_binding U, 0 [symbolic = %U.loc9_13.1 (constants.%U)] +// CHECK:STDOUT: %V.loc9_23.1: %type_where = symbolic_binding V, 1 [symbolic = %V.loc9_23.1 (constants.%V)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %V.binding.as_type: type = symbolic_binding_type V, 1, %V.loc9_16.1 [symbolic = %V.binding.as_type (constants.%V.binding.as_type)] +// CHECK:STDOUT: %V.binding.as_type: type = symbolic_binding_type V, 1, %V.loc9_23.1 [symbolic = %V.binding.as_type (constants.%V.binding.as_type)] // CHECK:STDOUT: %C.loc20_6.2: type = class_type @C, @C(%V.binding.as_type) [symbolic = %C.loc20_6.2 (constants.%C.bca)] // CHECK:STDOUT: %require_complete.loc20_7: = require_complete_type %C.loc20_6.2 [symbolic = %require_complete.loc20_7 (constants.%require_complete.232)] // CHECK:STDOUT: %C.Create.type: type = fn_type @C.Create, @C(%V.binding.as_type) [symbolic = %C.Create.type (constants.%C.Create.type.242)] @@ -401,7 +401,7 @@ fn F(U:! type, V:! type where {} impls Core.ImplicitAs(.Self)) { // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] -// CHECK:STDOUT: %V.ref: %type_where = name_ref V, %V.loc9_16.2 [symbolic = %V.loc9_16.1 (constants.%V)] +// CHECK:STDOUT: %V.ref: %type_where = name_ref V, %V.loc9_23.2 [symbolic = %V.loc9_23.1 (constants.%V)] // CHECK:STDOUT: %V.as_type: type = facet_access_type %V.ref [symbolic = %V.binding.as_type (constants.%V.binding.as_type)] // CHECK:STDOUT: %.loc20_6: type = converted %V.ref, %V.as_type [symbolic = %V.binding.as_type (constants.%V.binding.as_type)] // CHECK:STDOUT: %C.loc20_6.1: type = class_type @C, @C(constants.%V.binding.as_type) [symbolic = %C.loc20_6.2 (constants.%C.bca)] @@ -432,8 +432,8 @@ fn F(U:! type, V:! type where {} impls Core.ImplicitAs(.Self)) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%U, constants.%V) { -// CHECK:STDOUT: %U.loc9_6.1 => constants.%U -// CHECK:STDOUT: %V.loc9_16.1 => constants.%V +// CHECK:STDOUT: %U.loc9_13.1 => constants.%U +// CHECK:STDOUT: %V.loc9_23.1 => constants.%V // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%V.binding.as_type) { diff --git a/toolchain/check/testdata/deduce/generic_type.carbon b/toolchain/check/testdata/deduce/generic_type.carbon index a3209ed40b81..837df4f82f41 100644 --- a/toolchain/check/testdata/deduce/generic_type.carbon +++ b/toolchain/check/testdata/deduce/generic_type.carbon @@ -63,7 +63,7 @@ library "[[@TEST_NAME]]"; class WithNontype(N:! i32) {} -fn F[N:! i32](x: WithNontype(N)) -> i32 { return N; } +fn F[N:! i32](unused x: WithNontype(N)) -> i32 { return N; } fn G() -> i32 { return F({} as WithNontype(0)); @@ -831,22 +831,22 @@ fn G() -> i32 { // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_37: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_37: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc6_37: Core.Form = init_form %i32.loc6_37, call_param1 [concrete = constants.%.e54] +// CHECK:STDOUT: %int_32.loc6_44: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_44: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc6_44: Core.Form = init_form %i32.loc6_44, call_param1 [concrete = constants.%.e54] // CHECK:STDOUT: %.loc6_10: type = splice_block %i32.loc6_10 [concrete = constants.%i32] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc6_6.2: %i32 = symbolic_binding N, 0 [symbolic = %N.loc6_6.1 (constants.%N.5de)] -// CHECK:STDOUT: %x.param: @F.%WithNontype.loc6_31.1 (%WithNontype.205) = value_param call_param0 -// CHECK:STDOUT: %.loc6_31: type = splice_block %WithNontype.loc6_31.2 [symbolic = %WithNontype.loc6_31.1 (constants.%WithNontype.205)] { +// CHECK:STDOUT: %x.param: @F.%WithNontype.loc6_38.1 (%WithNontype.205) = value_param call_param0 +// CHECK:STDOUT: %.loc6_38: type = splice_block %WithNontype.loc6_38.2 [symbolic = %WithNontype.loc6_38.1 (constants.%WithNontype.205)] { // CHECK:STDOUT: %WithNontype.ref: %WithNontype.type = name_ref WithNontype, file.%WithNontype.decl [concrete = constants.%WithNontype.generic] -// CHECK:STDOUT: %N.ref.loc6_30: %i32 = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N.5de)] -// CHECK:STDOUT: %WithNontype.loc6_31.2: type = class_type @WithNontype, @WithNontype(constants.%N.5de) [symbolic = %WithNontype.loc6_31.1 (constants.%WithNontype.205)] +// CHECK:STDOUT: %N.ref.loc6_37: %i32 = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N.5de)] +// CHECK:STDOUT: %WithNontype.loc6_38.2: type = class_type @WithNontype, @WithNontype(constants.%N.5de) [symbolic = %WithNontype.loc6_38.1 (constants.%WithNontype.205)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @F.%WithNontype.loc6_31.1 (%WithNontype.205) = value_binding x, %x.param +// CHECK:STDOUT: %x: @F.%WithNontype.loc6_38.1 (%WithNontype.205) = value_binding x, %x.param // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -878,22 +878,22 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc6_6.2: %i32) { // CHECK:STDOUT: %N.loc6_6.1: %i32 = symbolic_binding N, 0 [symbolic = %N.loc6_6.1 (constants.%N.5de)] -// CHECK:STDOUT: %WithNontype.loc6_31.1: type = class_type @WithNontype, @WithNontype(%N.loc6_6.1) [symbolic = %WithNontype.loc6_31.1 (constants.%WithNontype.205)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %WithNontype.loc6_31.1 [symbolic = %pattern_type (constants.%pattern_type.43d)] +// CHECK:STDOUT: %WithNontype.loc6_38.1: type = class_type @WithNontype, @WithNontype(%N.loc6_6.1) [symbolic = %WithNontype.loc6_38.1 (constants.%WithNontype.205)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %WithNontype.loc6_38.1 [symbolic = %pattern_type (constants.%pattern_type.43d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %WithNontype.loc6_31.1 [symbolic = %require_complete (constants.%require_complete.643)] +// CHECK:STDOUT: %require_complete: = require_complete_type %WithNontype.loc6_38.1 [symbolic = %require_complete (constants.%require_complete.643)] // CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: = bound_method %N.loc6_6.1, constants.%Int.as.Copy.impl.Op.664 [symbolic = %Int.as.Copy.impl.Op.bound (constants.%Int.as.Copy.impl.Op.bound.e78)] -// CHECK:STDOUT: %bound_method.loc6_50.3: = bound_method %N.loc6_6.1, constants.%Int.as.Copy.impl.Op.specific_fn [symbolic = %bound_method.loc6_50.3 (constants.%bound_method.207)] +// CHECK:STDOUT: %bound_method.loc6_57.3: = bound_method %N.loc6_6.1, constants.%Int.as.Copy.impl.Op.specific_fn [symbolic = %bound_method.loc6_57.3 (constants.%bound_method.207)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @F.%WithNontype.loc6_31.1 (%WithNontype.205)) -> out %return.param: %i32 { +// CHECK:STDOUT: fn(%x.param: @F.%WithNontype.loc6_38.1 (%WithNontype.205)) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %N.ref.loc6_50: %i32 = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N.5de)] +// CHECK:STDOUT: %N.ref.loc6_57: %i32 = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N.5de)] // CHECK:STDOUT: %impl.elem0: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] -// CHECK:STDOUT: %bound_method.loc6_50.1: = bound_method %N.ref.loc6_50, %impl.elem0 [symbolic = %Int.as.Copy.impl.Op.bound (constants.%Int.as.Copy.impl.Op.bound.e78)] +// CHECK:STDOUT: %bound_method.loc6_57.1: = bound_method %N.ref.loc6_57, %impl.elem0 [symbolic = %Int.as.Copy.impl.Op.bound (constants.%Int.as.Copy.impl.Op.bound.e78)] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc6_50.2: = bound_method %N.ref.loc6_50, %specific_fn [symbolic = %bound_method.loc6_50.3 (constants.%bound_method.207)] -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_50.2(%N.ref.loc6_50) [symbolic = %N.loc6_6.1 (constants.%N.5de)] +// CHECK:STDOUT: %bound_method.loc6_57.2: = bound_method %N.ref.loc6_57, %specific_fn [symbolic = %bound_method.loc6_57.3 (constants.%bound_method.207)] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_57.2(%N.ref.loc6_57) [symbolic = %N.loc6_6.1 (constants.%N.5de)] // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -934,7 +934,7 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N.5de) { // CHECK:STDOUT: %N.loc6_6.1 => constants.%N.5de -// CHECK:STDOUT: %WithNontype.loc6_31.1 => constants.%WithNontype.205 +// CHECK:STDOUT: %WithNontype.loc6_38.1 => constants.%WithNontype.205 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.43d // CHECK:STDOUT: } // CHECK:STDOUT: @@ -946,12 +946,12 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%int_0.6a9) { // CHECK:STDOUT: %N.loc6_6.1 => constants.%int_0.6a9 -// CHECK:STDOUT: %WithNontype.loc6_31.1 => constants.%WithNontype.6bb +// CHECK:STDOUT: %WithNontype.loc6_38.1 => constants.%WithNontype.6bb // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7a0 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.357 // CHECK:STDOUT: %Int.as.Copy.impl.Op.bound => constants.%Int.as.Copy.impl.Op.bound.06d -// CHECK:STDOUT: %bound_method.loc6_50.3 => constants.%bound_method.5f6 +// CHECK:STDOUT: %bound_method.loc6_57.3 => constants.%bound_method.5f6 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/int_float.carbon b/toolchain/check/testdata/deduce/int_float.carbon index 527eceb64d23..9ae7177d23af 100644 --- a/toolchain/check/testdata/deduce/int_float.carbon +++ b/toolchain/check/testdata/deduce/int_float.carbon @@ -16,7 +16,7 @@ library "[[@TEST_NAME]]"; -fn F[N:! Core.IntLiteral()](n: Core.Int(N)) -> Core.IntLiteral() { +fn F[N:! Core.IntLiteral()](unused n: Core.Int(N)) -> Core.IntLiteral() { return N; } @@ -28,7 +28,7 @@ fn G(a: i64) -> Core.IntLiteral() { library "[[@TEST_NAME]]"; -fn F[N:! Core.IntLiteral()](n: Core.Float(N)) -> Core.IntLiteral() { +fn F[N:! Core.IntLiteral()](unused n: Core.Float(N)) -> Core.IntLiteral() { return N; } @@ -101,12 +101,12 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.dc0 = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Core.ref.loc4_48: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref.loc4_52: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call.loc4_64: init type = call %IntLiteral.ref.loc4_52() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_64.1: type = value_of_initializer %IntLiteral.call.loc4_64 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_64.2: type = converted %IntLiteral.call.loc4_64, %.loc4_64.1 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_64.3: Core.Form = init_form %.loc4_64.2, call_param1 [concrete = constants.%.7dc] +// CHECK:STDOUT: %Core.ref.loc4_55: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %IntLiteral.ref.loc4_59: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] +// CHECK:STDOUT: %IntLiteral.call.loc4_71: init type = call %IntLiteral.ref.loc4_59() [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc4_71.1: type = value_of_initializer %IntLiteral.call.loc4_71 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc4_71.2: type = converted %IntLiteral.call.loc4_71, %.loc4_71.1 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc4_71.3: Core.Form = init_form %.loc4_71.2, call_param1 [concrete = constants.%.7dc] // CHECK:STDOUT: %.loc4_26.1: type = splice_block %.loc4_26.3 [concrete = Core.IntLiteral] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Core.ref.loc4_10: = name_ref Core, imports.%Core [concrete = imports.%Core] @@ -116,14 +116,14 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %.loc4_26.3: type = converted %IntLiteral.call.loc4_26, %.loc4_26.2 [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc4_6.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc4_6.1 (constants.%N)] -// CHECK:STDOUT: %n.param: @F.%Int.loc4_42.1 (%Int) = value_param call_param0 -// CHECK:STDOUT: %.loc4_42: type = splice_block %Int.loc4_42.2 [symbolic = %Int.loc4_42.1 (constants.%Int)] { -// CHECK:STDOUT: %Core.ref.loc4_32: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %n.param: @F.%Int.loc4_49.1 (%Int) = value_param call_param0 +// CHECK:STDOUT: %.loc4_49: type = splice_block %Int.loc4_49.2 [symbolic = %Int.loc4_49.1 (constants.%Int)] { +// CHECK:STDOUT: %Core.ref.loc4_39: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc4: Core.IntLiteral = name_ref N, %N.loc4_6.2 [symbolic = %N.loc4_6.1 (constants.%N)] -// CHECK:STDOUT: %Int.loc4_42.2: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc4_42.1 (constants.%Int)] +// CHECK:STDOUT: %Int.loc4_49.2: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc4_49.1 (constants.%Int)] // CHECK:STDOUT: } -// CHECK:STDOUT: %n: @F.%Int.loc4_42.1 (%Int) = value_binding n, %n.param +// CHECK:STDOUT: %n: @F.%Int.loc4_49.1 (%Int) = value_binding n, %n.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param call_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param // CHECK:STDOUT: } @@ -152,14 +152,14 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc4_6.2: Core.IntLiteral) { // CHECK:STDOUT: %N.loc4_6.1: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc4_6.1 (constants.%N)] -// CHECK:STDOUT: %Int.loc4_42.1: type = class_type @Int, @Int(%N.loc4_6.1) [symbolic = %Int.loc4_42.1 (constants.%Int)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Int.loc4_42.1 [symbolic = %pattern_type (constants.%pattern_type.764)] +// CHECK:STDOUT: %Int.loc4_49.1: type = class_type @Int, @Int(%N.loc4_6.1) [symbolic = %Int.loc4_49.1 (constants.%Int)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Int.loc4_49.1 [symbolic = %pattern_type (constants.%pattern_type.764)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %Int.loc4_42.1 [symbolic = %require_complete (constants.%require_complete.901)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Int.loc4_49.1 [symbolic = %require_complete (constants.%require_complete.901)] // CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.bound: = bound_method %N.loc4_6.1, constants.%Core.IntLiteral.as.Copy.impl.Op [symbolic = %Core.IntLiteral.as.Copy.impl.Op.bound (constants.%Core.IntLiteral.as.Copy.impl.Op.bound.555)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%n.param: @F.%Int.loc4_42.1 (%Int)) -> out %return.param: Core.IntLiteral { +// CHECK:STDOUT: fn(%n.param: @F.%Int.loc4_49.1 (%Int)) -> out %return.param: Core.IntLiteral { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref.loc5: Core.IntLiteral = name_ref N, %N.loc4_6.2 [symbolic = %N.loc4_6.1 (constants.%N)] // CHECK:STDOUT: %impl.elem0: %.5e6 = impl_witness_access constants.%Copy.impl_witness.98e, element0 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op] @@ -180,13 +180,13 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc4_6.1 => constants.%N -// CHECK:STDOUT: %Int.loc4_42.1 => constants.%Int +// CHECK:STDOUT: %Int.loc4_49.1 => constants.%Int // CHECK:STDOUT: %pattern_type => constants.%pattern_type.764 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%int_64) { // CHECK:STDOUT: %N.loc4_6.1 => constants.%int_64 -// CHECK:STDOUT: %Int.loc4_42.1 => constants.%i64 +// CHECK:STDOUT: %Int.loc4_49.1 => constants.%i64 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.95b // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -259,12 +259,12 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.dc0 = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Core.ref.loc4_50: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref.loc4_54: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call.loc4_66: init type = call %IntLiteral.ref.loc4_54() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_66.1: type = value_of_initializer %IntLiteral.call.loc4_66 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_66.2: type = converted %IntLiteral.call.loc4_66, %.loc4_66.1 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_66.3: Core.Form = init_form %.loc4_66.2, call_param1 [concrete = constants.%.7dc] +// CHECK:STDOUT: %Core.ref.loc4_57: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %IntLiteral.ref.loc4_61: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] +// CHECK:STDOUT: %IntLiteral.call.loc4_73: init type = call %IntLiteral.ref.loc4_61() [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc4_73.1: type = value_of_initializer %IntLiteral.call.loc4_73 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc4_73.2: type = converted %IntLiteral.call.loc4_73, %.loc4_73.1 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc4_73.3: Core.Form = init_form %.loc4_73.2, call_param1 [concrete = constants.%.7dc] // CHECK:STDOUT: %.loc4_26.1: type = splice_block %.loc4_26.3 [concrete = Core.IntLiteral] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Core.ref.loc4_10: = name_ref Core, imports.%Core [concrete = imports.%Core] @@ -274,14 +274,14 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %.loc4_26.3: type = converted %IntLiteral.call.loc4_26, %.loc4_26.2 [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc4_6.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc4_6.1 (constants.%N)] -// CHECK:STDOUT: %n.param: @F.%Float.loc4_44.1 (%Float) = value_param call_param0 -// CHECK:STDOUT: %.loc4_44: type = splice_block %Float.loc4_44.2 [symbolic = %Float.loc4_44.1 (constants.%Float)] { -// CHECK:STDOUT: %Core.ref.loc4_32: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %n.param: @F.%Float.loc4_51.1 (%Float) = value_param call_param0 +// CHECK:STDOUT: %.loc4_51: type = splice_block %Float.loc4_51.2 [symbolic = %Float.loc4_51.1 (constants.%Float)] { +// CHECK:STDOUT: %Core.ref.loc4_39: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%Core.Float [concrete = constants.%Float.generic] // CHECK:STDOUT: %N.ref.loc4: Core.IntLiteral = name_ref N, %N.loc4_6.2 [symbolic = %N.loc4_6.1 (constants.%N)] -// CHECK:STDOUT: %Float.loc4_44.2: type = class_type @Float, @Float(constants.%N) [symbolic = %Float.loc4_44.1 (constants.%Float)] +// CHECK:STDOUT: %Float.loc4_51.2: type = class_type @Float, @Float(constants.%N) [symbolic = %Float.loc4_51.1 (constants.%Float)] // CHECK:STDOUT: } -// CHECK:STDOUT: %n: @F.%Float.loc4_44.1 (%Float) = value_binding n, %n.param +// CHECK:STDOUT: %n: @F.%Float.loc4_51.1 (%Float) = value_binding n, %n.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param call_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param // CHECK:STDOUT: } @@ -310,14 +310,14 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc4_6.2: Core.IntLiteral) { // CHECK:STDOUT: %N.loc4_6.1: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc4_6.1 (constants.%N)] -// CHECK:STDOUT: %Float.loc4_44.1: type = class_type @Float, @Float(%N.loc4_6.1) [symbolic = %Float.loc4_44.1 (constants.%Float)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Float.loc4_44.1 [symbolic = %pattern_type (constants.%pattern_type.7d0)] +// CHECK:STDOUT: %Float.loc4_51.1: type = class_type @Float, @Float(%N.loc4_6.1) [symbolic = %Float.loc4_51.1 (constants.%Float)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Float.loc4_51.1 [symbolic = %pattern_type (constants.%pattern_type.7d0)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %Float.loc4_44.1 [symbolic = %require_complete (constants.%require_complete.dc0)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Float.loc4_51.1 [symbolic = %require_complete (constants.%require_complete.dc0)] // CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.bound: = bound_method %N.loc4_6.1, constants.%Core.IntLiteral.as.Copy.impl.Op [symbolic = %Core.IntLiteral.as.Copy.impl.Op.bound (constants.%Core.IntLiteral.as.Copy.impl.Op.bound.555)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%n.param: @F.%Float.loc4_44.1 (%Float)) -> out %return.param: Core.IntLiteral { +// CHECK:STDOUT: fn(%n.param: @F.%Float.loc4_51.1 (%Float)) -> out %return.param: Core.IntLiteral { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref.loc5: Core.IntLiteral = name_ref N, %N.loc4_6.2 [symbolic = %N.loc4_6.1 (constants.%N)] // CHECK:STDOUT: %impl.elem0: %.5e6 = impl_witness_access constants.%Copy.impl_witness.98e, element0 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op] @@ -338,13 +338,13 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc4_6.1 => constants.%N -// CHECK:STDOUT: %Float.loc4_44.1 => constants.%Float +// CHECK:STDOUT: %Float.loc4_51.1 => constants.%Float // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7d0 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%int_64) { // CHECK:STDOUT: %N.loc4_6.1 => constants.%int_64 -// CHECK:STDOUT: %Float.loc4_44.1 => constants.%f64.d77 +// CHECK:STDOUT: %Float.loc4_51.1 => constants.%f64.d77 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.0ae // CHECK:STDOUT: // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/deduce/symbolic_facets.carbon b/toolchain/check/testdata/deduce/symbolic_facets.carbon index d090d13eddf6..06da29f0d640 100644 --- a/toolchain/check/testdata/deduce/symbolic_facets.carbon +++ b/toolchain/check/testdata/deduce/symbolic_facets.carbon @@ -20,7 +20,7 @@ library "[[@TEST_NAME]]"; class C(CC:! type) { interface A {} - fn F(T:! A) {} + fn F(unused T:! A) {} } class D(DD:! type) { @@ -33,8 +33,8 @@ class D(DD:! type) { // CHECK:STDERR: C(()).F(T); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: fail_missing_interface.carbon:[[@LINE-12]]:3: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn F(T:! A) {} - // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: fn F(unused T:! A) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: C(()).F(T); } @@ -45,7 +45,7 @@ library "[[@TEST_NAME]]"; class C(CC:! type) { interface A {} - fn F(T:! A) {} + fn F(unused T:! A) {} } class D(DD:! type) { @@ -58,8 +58,8 @@ class D(DD:! type) { // CHECK:STDERR: C(()).F(T); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: fail_interface_wrong_generic_param.carbon:[[@LINE-12]]:3: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn F(T:! A) {} - // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: fn F(unused T:! A) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: C(()).F(T); } @@ -70,7 +70,7 @@ library "[[@TEST_NAME]]"; class C(CC:! type) { interface A {} - fn F(T:! A) {} + fn F(unused T:! A) {} } class D(DD:! type) { diff --git a/toolchain/check/testdata/deduce/tuple.carbon b/toolchain/check/testdata/deduce/tuple.carbon index 6128944dc2ee..554823a4b209 100644 --- a/toolchain/check/testdata/deduce/tuple.carbon +++ b/toolchain/check/testdata/deduce/tuple.carbon @@ -31,7 +31,7 @@ library "[[@TEST_NAME]]"; class HasPair(Pair:! (i32, i32)) {} -fn F[A:! i32, B:! i32](h: HasPair((A, B))) -> i32 { return B; } +fn F[A:! i32, B:! i32](unused h: HasPair((A, B))) -> i32 { return B; } fn G(h: HasPair((1, 2))) -> i32 { return F(h); @@ -358,9 +358,9 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_47: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_47: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc6_47: Core.Form = init_form %i32.loc6_47, call_param1 [concrete = constants.%.e54] +// CHECK:STDOUT: %int_32.loc6_54: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_54: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc6_54: Core.Form = init_form %i32.loc6_54, call_param1 [concrete = constants.%.e54] // CHECK:STDOUT: %.loc6_10: type = splice_block %i32.loc6_10 [concrete = constants.%i32] { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] @@ -373,17 +373,17 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %i32.loc6_19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %B.loc6_15.2: %i32 = symbolic_binding B, 1 [symbolic = %B.loc6_15.1 (constants.%B)] -// CHECK:STDOUT: %h.param: @F.%HasPair.loc6_41.1 (%HasPair.2e7) = value_param call_param0 -// CHECK:STDOUT: %.loc6_41.1: type = splice_block %HasPair.loc6_41.2 [symbolic = %HasPair.loc6_41.1 (constants.%HasPair.2e7)] { +// CHECK:STDOUT: %h.param: @F.%HasPair.loc6_48.1 (%HasPair.2e7) = value_param call_param0 +// CHECK:STDOUT: %.loc6_48.1: type = splice_block %HasPair.loc6_48.2 [symbolic = %HasPair.loc6_48.1 (constants.%HasPair.2e7)] { // CHECK:STDOUT: %HasPair.ref: %HasPair.type = name_ref HasPair, file.%HasPair.decl [concrete = constants.%HasPair.generic] // CHECK:STDOUT: %A.ref: %i32 = name_ref A, %A.loc6_6.2 [symbolic = %A.loc6_6.1 (constants.%A)] -// CHECK:STDOUT: %B.ref.loc6_39: %i32 = name_ref B, %B.loc6_15.2 [symbolic = %B.loc6_15.1 (constants.%B)] -// CHECK:STDOUT: %.loc6_40: %tuple.type.d07 = tuple_literal (%A.ref, %B.ref.loc6_39) [symbolic = %tuple.loc6_40.1 (constants.%tuple.9c9)] -// CHECK:STDOUT: %tuple.loc6_40.2: %tuple.type.d07 = tuple_value (%A.ref, %B.ref.loc6_39) [symbolic = %tuple.loc6_40.1 (constants.%tuple.9c9)] -// CHECK:STDOUT: %.loc6_41.2: %tuple.type.d07 = converted %.loc6_40, %tuple.loc6_40.2 [symbolic = %tuple.loc6_40.1 (constants.%tuple.9c9)] -// CHECK:STDOUT: %HasPair.loc6_41.2: type = class_type @HasPair, @HasPair(constants.%tuple.9c9) [symbolic = %HasPair.loc6_41.1 (constants.%HasPair.2e7)] +// CHECK:STDOUT: %B.ref.loc6_46: %i32 = name_ref B, %B.loc6_15.2 [symbolic = %B.loc6_15.1 (constants.%B)] +// CHECK:STDOUT: %.loc6_47: %tuple.type.d07 = tuple_literal (%A.ref, %B.ref.loc6_46) [symbolic = %tuple.loc6_47.1 (constants.%tuple.9c9)] +// CHECK:STDOUT: %tuple.loc6_47.2: %tuple.type.d07 = tuple_value (%A.ref, %B.ref.loc6_46) [symbolic = %tuple.loc6_47.1 (constants.%tuple.9c9)] +// CHECK:STDOUT: %.loc6_48.2: %tuple.type.d07 = converted %.loc6_47, %tuple.loc6_47.2 [symbolic = %tuple.loc6_47.1 (constants.%tuple.9c9)] +// CHECK:STDOUT: %HasPair.loc6_48.2: type = class_type @HasPair, @HasPair(constants.%tuple.9c9) [symbolic = %HasPair.loc6_48.1 (constants.%HasPair.2e7)] // CHECK:STDOUT: } -// CHECK:STDOUT: %h: @F.%HasPair.loc6_41.1 (%HasPair.2e7) = value_binding h, %h.param +// CHECK:STDOUT: %h: @F.%HasPair.loc6_48.1 (%HasPair.2e7) = value_binding h, %h.param // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -443,23 +443,23 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: generic fn @F(%A.loc6_6.2: %i32, %B.loc6_15.2: %i32) { // CHECK:STDOUT: %A.loc6_6.1: %i32 = symbolic_binding A, 0 [symbolic = %A.loc6_6.1 (constants.%A)] // CHECK:STDOUT: %B.loc6_15.1: %i32 = symbolic_binding B, 1 [symbolic = %B.loc6_15.1 (constants.%B)] -// CHECK:STDOUT: %tuple.loc6_40.1: %tuple.type.d07 = tuple_value (%A.loc6_6.1, %B.loc6_15.1) [symbolic = %tuple.loc6_40.1 (constants.%tuple.9c9)] -// CHECK:STDOUT: %HasPair.loc6_41.1: type = class_type @HasPair, @HasPair(%tuple.loc6_40.1) [symbolic = %HasPair.loc6_41.1 (constants.%HasPair.2e7)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %HasPair.loc6_41.1 [symbolic = %pattern_type (constants.%pattern_type.dc2)] +// CHECK:STDOUT: %tuple.loc6_47.1: %tuple.type.d07 = tuple_value (%A.loc6_6.1, %B.loc6_15.1) [symbolic = %tuple.loc6_47.1 (constants.%tuple.9c9)] +// CHECK:STDOUT: %HasPair.loc6_48.1: type = class_type @HasPair, @HasPair(%tuple.loc6_47.1) [symbolic = %HasPair.loc6_48.1 (constants.%HasPair.2e7)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %HasPair.loc6_48.1 [symbolic = %pattern_type (constants.%pattern_type.dc2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %HasPair.loc6_41.1 [symbolic = %require_complete (constants.%require_complete.76f)] +// CHECK:STDOUT: %require_complete: = require_complete_type %HasPair.loc6_48.1 [symbolic = %require_complete (constants.%require_complete.76f)] // CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: = bound_method %B.loc6_15.1, constants.%Int.as.Copy.impl.Op.664 [symbolic = %Int.as.Copy.impl.Op.bound (constants.%Int.as.Copy.impl.Op.bound.5f8)] -// CHECK:STDOUT: %bound_method.loc6_60.3: = bound_method %B.loc6_15.1, constants.%Int.as.Copy.impl.Op.specific_fn [symbolic = %bound_method.loc6_60.3 (constants.%bound_method.dfb)] +// CHECK:STDOUT: %bound_method.loc6_67.3: = bound_method %B.loc6_15.1, constants.%Int.as.Copy.impl.Op.specific_fn [symbolic = %bound_method.loc6_67.3 (constants.%bound_method.dfb)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%h.param: @F.%HasPair.loc6_41.1 (%HasPair.2e7)) -> out %return.param: %i32 { +// CHECK:STDOUT: fn(%h.param: @F.%HasPair.loc6_48.1 (%HasPair.2e7)) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %B.ref.loc6_60: %i32 = name_ref B, %B.loc6_15.2 [symbolic = %B.loc6_15.1 (constants.%B)] +// CHECK:STDOUT: %B.ref.loc6_67: %i32 = name_ref B, %B.loc6_15.2 [symbolic = %B.loc6_15.1 (constants.%B)] // CHECK:STDOUT: %impl.elem0: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] -// CHECK:STDOUT: %bound_method.loc6_60.1: = bound_method %B.ref.loc6_60, %impl.elem0 [symbolic = %Int.as.Copy.impl.Op.bound (constants.%Int.as.Copy.impl.Op.bound.5f8)] +// CHECK:STDOUT: %bound_method.loc6_67.1: = bound_method %B.ref.loc6_67, %impl.elem0 [symbolic = %Int.as.Copy.impl.Op.bound (constants.%Int.as.Copy.impl.Op.bound.5f8)] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc6_60.2: = bound_method %B.ref.loc6_60, %specific_fn [symbolic = %bound_method.loc6_60.3 (constants.%bound_method.dfb)] -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_60.2(%B.ref.loc6_60) [symbolic = %B.loc6_15.1 (constants.%B)] +// CHECK:STDOUT: %bound_method.loc6_67.2: = bound_method %B.ref.loc6_67, %specific_fn [symbolic = %bound_method.loc6_67.3 (constants.%bound_method.dfb)] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_67.2(%B.ref.loc6_67) [symbolic = %B.loc6_15.1 (constants.%B)] // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -486,8 +486,8 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: specific @F(constants.%A, constants.%B) { // CHECK:STDOUT: %A.loc6_6.1 => constants.%A // CHECK:STDOUT: %B.loc6_15.1 => constants.%B -// CHECK:STDOUT: %tuple.loc6_40.1 => constants.%tuple.9c9 -// CHECK:STDOUT: %HasPair.loc6_41.1 => constants.%HasPair.2e7 +// CHECK:STDOUT: %tuple.loc6_47.1 => constants.%tuple.9c9 +// CHECK:STDOUT: %HasPair.loc6_48.1 => constants.%HasPair.2e7 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.dc2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -500,14 +500,14 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: specific @F(constants.%int_1.5d2, constants.%int_2.ef8) { // CHECK:STDOUT: %A.loc6_6.1 => constants.%int_1.5d2 // CHECK:STDOUT: %B.loc6_15.1 => constants.%int_2.ef8 -// CHECK:STDOUT: %tuple.loc6_40.1 => constants.%tuple.21c -// CHECK:STDOUT: %HasPair.loc6_41.1 => constants.%HasPair.867 +// CHECK:STDOUT: %tuple.loc6_47.1 => constants.%tuple.21c +// CHECK:STDOUT: %HasPair.loc6_48.1 => constants.%HasPair.867 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.530 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.357 // CHECK:STDOUT: %Int.as.Copy.impl.Op.bound => constants.%Int.as.Copy.impl.Op.bound.5e8 -// CHECK:STDOUT: %bound_method.loc6_60.3 => constants.%bound_method.f15 +// CHECK:STDOUT: %bound_method.loc6_67.3 => constants.%bound_method.f15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_inconsistent.carbon diff --git a/toolchain/check/testdata/deduce/value_with_type_through_access.carbon b/toolchain/check/testdata/deduce/value_with_type_through_access.carbon index 46df39b2a81a..ec3530d4d4bd 100644 --- a/toolchain/check/testdata/deduce/value_with_type_through_access.carbon +++ b/toolchain/check/testdata/deduce/value_with_type_through_access.carbon @@ -20,7 +20,7 @@ class HoldsType(T:! (type, )) {} // `a` is received as a value, and has a type that requires going through // TupleAccess. Building the value representation must handle this indirection. -fn F[T:! (type, )](x: HoldsType(T), a: T.0) {} +fn F[T:! (type, )](unused x: HoldsType(T), unused a: T.0) {} class C {} @@ -36,7 +36,7 @@ class HoldsType(T:! {.t: type}) {} // `a` is received as a value, and has a type that requires going through // StructAccess. Building the value representation must handle this indirection. -fn F[T:! {.t: type}](x: HoldsType(T), a: T.t) {} +fn F[T:! {.t: type}](unused x: HoldsType(T), unused a: T.t) {} class C {} @@ -61,11 +61,11 @@ class HoldsType(T:! Class) {} // should be able to eval to a type. We would expect the `.` in `T.t` to be a // ClassElementAccess but it is an AcquireValue, which has a runtime value. // -// CHECK:STDERR: fail_todo_class_access.carbon:[[@LINE+4]]:37: error: cannot evaluate type expression [TypeExprEvaluationFailure] -// CHECK:STDERR: fn F[T:! Class](x: HoldsType(T), a: T.t) {} -// CHECK:STDERR: ^~~ +// CHECK:STDERR: fail_todo_class_access.carbon:[[@LINE+4]]:51: error: cannot evaluate type expression [TypeExprEvaluationFailure] +// CHECK:STDERR: fn F[T:! Class](unused x: HoldsType(T), unused a: T.t) {} +// CHECK:STDERR: ^~~ // CHECK:STDERR: -fn F[T:! Class](x: HoldsType(T), a: T.t) {} +fn F[T:! Class](unused x: HoldsType(T), unused a: T.t) {} class C {} @@ -92,11 +92,11 @@ class HoldsType(T:! array(type, 1)) {} // `a` is received as a value, and has a type that requires going through // ArrayIndex. Building the value representation must handle this indirection. -// CHECK:STDERR: fail_todo_array_index.carbon:[[@LINE+4]]:46: error: cannot evaluate type expression [TypeExprEvaluationFailure] -// CHECK:STDERR: fn F[T:! array(type, 1)](x: HoldsType(T), a: T[0]) {} -// CHECK:STDERR: ^~~~ +// CHECK:STDERR: fail_todo_array_index.carbon:[[@LINE+4]]:60: error: cannot evaluate type expression [TypeExprEvaluationFailure] +// CHECK:STDERR: fn F[T:! array(type, 1)](unused x: HoldsType(T), unused a: T[0]) {} +// CHECK:STDERR: ^~~~ // CHECK:STDERR: -fn F[T:! array(type, 1)](x: HoldsType(T), a: T[0]) {} +fn F[T:! array(type, 1)](unused x: HoldsType(T), unused a: T[0]) {} class C {} @@ -183,10 +183,10 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %T.patt: %pattern_type.f1e = symbolic_binding_pattern T, 0 [concrete] -// CHECK:STDOUT: %x.patt: @F.%pattern_type.loc8_20 (%pattern_type.17d) = value_binding_pattern x [concrete] -// CHECK:STDOUT: %x.param_patt: @F.%pattern_type.loc8_20 (%pattern_type.17d) = value_param_pattern %x.patt, call_param0 [concrete] -// CHECK:STDOUT: %a.patt: @F.%pattern_type.loc8_37 (%pattern_type.e66) = value_binding_pattern a [concrete] -// CHECK:STDOUT: %a.param_patt: @F.%pattern_type.loc8_37 (%pattern_type.e66) = value_param_pattern %a.patt, call_param1 [concrete] +// CHECK:STDOUT: %x.patt: @F.%pattern_type.loc8_27 (%pattern_type.17d) = value_binding_pattern x [concrete] +// CHECK:STDOUT: %x.param_patt: @F.%pattern_type.loc8_27 (%pattern_type.17d) = value_param_pattern %x.patt, call_param0 [concrete] +// CHECK:STDOUT: %a.patt: @F.%pattern_type.loc8_51 (%pattern_type.e66) = value_binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: @F.%pattern_type.loc8_51 (%pattern_type.e66) = value_param_pattern %a.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc8_17.1: type = splice_block %.loc8_17.3 [concrete = constants.%tuple.type] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] @@ -194,20 +194,20 @@ fn G() { // CHECK:STDOUT: %.loc8_17.3: type = converted %.loc8_17.2, constants.%tuple.type [concrete = constants.%tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc8_6.2: %tuple.type = symbolic_binding T, 0 [symbolic = %T.loc8_6.1 (constants.%T)] -// CHECK:STDOUT: %x.param: @F.%HoldsType.loc8_34.1 (%HoldsType.f6a) = value_param call_param0 -// CHECK:STDOUT: %.loc8_34: type = splice_block %HoldsType.loc8_34.2 [symbolic = %HoldsType.loc8_34.1 (constants.%HoldsType.f6a)] { +// CHECK:STDOUT: %x.param: @F.%HoldsType.loc8_41.1 (%HoldsType.f6a) = value_param call_param0 +// CHECK:STDOUT: %.loc8_41: type = splice_block %HoldsType.loc8_41.2 [symbolic = %HoldsType.loc8_41.1 (constants.%HoldsType.f6a)] { // CHECK:STDOUT: %HoldsType.ref: %HoldsType.type = name_ref HoldsType, file.%HoldsType.decl [concrete = constants.%HoldsType.generic] -// CHECK:STDOUT: %T.ref.loc8_33: %tuple.type = name_ref T, %T.loc8_6.2 [symbolic = %T.loc8_6.1 (constants.%T)] -// CHECK:STDOUT: %HoldsType.loc8_34.2: type = class_type @HoldsType, @HoldsType(constants.%T) [symbolic = %HoldsType.loc8_34.1 (constants.%HoldsType.f6a)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %x: @F.%HoldsType.loc8_34.1 (%HoldsType.f6a) = value_binding x, %x.param -// CHECK:STDOUT: %a.param: @F.%tuple.elem0.loc8_41.1 (%tuple.elem0) = value_param call_param1 -// CHECK:STDOUT: %.loc8_41: type = splice_block %tuple.elem0.loc8_41.2 [symbolic = %tuple.elem0.loc8_41.1 (constants.%tuple.elem0)] { // CHECK:STDOUT: %T.ref.loc8_40: %tuple.type = name_ref T, %T.loc8_6.2 [symbolic = %T.loc8_6.1 (constants.%T)] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %tuple.elem0.loc8_41.2: type = tuple_access %T.ref.loc8_40, element0 [symbolic = %tuple.elem0.loc8_41.1 (constants.%tuple.elem0)] +// CHECK:STDOUT: %HoldsType.loc8_41.2: type = class_type @HoldsType, @HoldsType(constants.%T) [symbolic = %HoldsType.loc8_41.1 (constants.%HoldsType.f6a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: @F.%tuple.elem0.loc8_41.1 (%tuple.elem0) = value_binding a, %a.param +// CHECK:STDOUT: %x: @F.%HoldsType.loc8_41.1 (%HoldsType.f6a) = value_binding x, %x.param +// CHECK:STDOUT: %a.param: @F.%tuple.elem0.loc8_55.1 (%tuple.elem0) = value_param call_param1 +// CHECK:STDOUT: %.loc8_55: type = splice_block %tuple.elem0.loc8_55.2 [symbolic = %tuple.elem0.loc8_55.1 (constants.%tuple.elem0)] { +// CHECK:STDOUT: %T.ref.loc8_54: %tuple.type = name_ref T, %T.loc8_6.2 [symbolic = %T.loc8_6.1 (constants.%T)] +// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] +// CHECK:STDOUT: %tuple.elem0.loc8_55.2: type = tuple_access %T.ref.loc8_54, element0 [symbolic = %tuple.elem0.loc8_55.1 (constants.%tuple.elem0)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: @F.%tuple.elem0.loc8_55.1 (%tuple.elem0) = value_binding a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {} @@ -237,16 +237,16 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc8_6.2: %tuple.type) { // CHECK:STDOUT: %T.loc8_6.1: %tuple.type = symbolic_binding T, 0 [symbolic = %T.loc8_6.1 (constants.%T)] -// CHECK:STDOUT: %HoldsType.loc8_34.1: type = class_type @HoldsType, @HoldsType(%T.loc8_6.1) [symbolic = %HoldsType.loc8_34.1 (constants.%HoldsType.f6a)] -// CHECK:STDOUT: %pattern_type.loc8_20: type = pattern_type %HoldsType.loc8_34.1 [symbolic = %pattern_type.loc8_20 (constants.%pattern_type.17d)] -// CHECK:STDOUT: %tuple.elem0.loc8_41.1: type = tuple_access %T.loc8_6.1, element0 [symbolic = %tuple.elem0.loc8_41.1 (constants.%tuple.elem0)] -// CHECK:STDOUT: %pattern_type.loc8_37: type = pattern_type %tuple.elem0.loc8_41.1 [symbolic = %pattern_type.loc8_37 (constants.%pattern_type.e66)] +// CHECK:STDOUT: %HoldsType.loc8_41.1: type = class_type @HoldsType, @HoldsType(%T.loc8_6.1) [symbolic = %HoldsType.loc8_41.1 (constants.%HoldsType.f6a)] +// CHECK:STDOUT: %pattern_type.loc8_27: type = pattern_type %HoldsType.loc8_41.1 [symbolic = %pattern_type.loc8_27 (constants.%pattern_type.17d)] +// CHECK:STDOUT: %tuple.elem0.loc8_55.1: type = tuple_access %T.loc8_6.1, element0 [symbolic = %tuple.elem0.loc8_55.1 (constants.%tuple.elem0)] +// CHECK:STDOUT: %pattern_type.loc8_51: type = pattern_type %tuple.elem0.loc8_55.1 [symbolic = %pattern_type.loc8_51 (constants.%pattern_type.e66)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc8_21: = require_complete_type %HoldsType.loc8_34.1 [symbolic = %require_complete.loc8_21 (constants.%require_complete.7bf)] -// CHECK:STDOUT: %require_complete.loc8_38: = require_complete_type %tuple.elem0.loc8_41.1 [symbolic = %require_complete.loc8_38 (constants.%require_complete.e7a)] +// CHECK:STDOUT: %require_complete.loc8_28: = require_complete_type %HoldsType.loc8_41.1 [symbolic = %require_complete.loc8_28 (constants.%require_complete.7bf)] +// CHECK:STDOUT: %require_complete.loc8_52: = require_complete_type %tuple.elem0.loc8_55.1 [symbolic = %require_complete.loc8_52 (constants.%require_complete.e7a)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @F.%HoldsType.loc8_34.1 (%HoldsType.f6a), %a.param: @F.%tuple.elem0.loc8_41.1 (%tuple.elem0)) { +// CHECK:STDOUT: fn(%x.param: @F.%HoldsType.loc8_41.1 (%HoldsType.f6a), %a.param: @F.%tuple.elem0.loc8_55.1 (%tuple.elem0)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -294,10 +294,10 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc8_6.1 => constants.%T -// CHECK:STDOUT: %HoldsType.loc8_34.1 => constants.%HoldsType.f6a -// CHECK:STDOUT: %pattern_type.loc8_20 => constants.%pattern_type.17d -// CHECK:STDOUT: %tuple.elem0.loc8_41.1 => constants.%tuple.elem0 -// CHECK:STDOUT: %pattern_type.loc8_37 => constants.%pattern_type.e66 +// CHECK:STDOUT: %HoldsType.loc8_41.1 => constants.%HoldsType.f6a +// CHECK:STDOUT: %pattern_type.loc8_27 => constants.%pattern_type.17d +// CHECK:STDOUT: %tuple.elem0.loc8_55.1 => constants.%tuple.elem0 +// CHECK:STDOUT: %pattern_type.loc8_51 => constants.%pattern_type.e66 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HoldsType(constants.%tuple.1f1) { @@ -308,14 +308,14 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%tuple.1f1) { // CHECK:STDOUT: %T.loc8_6.1 => constants.%tuple.1f1 -// CHECK:STDOUT: %HoldsType.loc8_34.1 => constants.%HoldsType.a31 -// CHECK:STDOUT: %pattern_type.loc8_20 => constants.%pattern_type.a646 -// CHECK:STDOUT: %tuple.elem0.loc8_41.1 => constants.%C -// CHECK:STDOUT: %pattern_type.loc8_37 => constants.%pattern_type.7c7 +// CHECK:STDOUT: %HoldsType.loc8_41.1 => constants.%HoldsType.a31 +// CHECK:STDOUT: %pattern_type.loc8_27 => constants.%pattern_type.a646 +// CHECK:STDOUT: %tuple.elem0.loc8_55.1 => constants.%C +// CHECK:STDOUT: %pattern_type.loc8_51 => constants.%pattern_type.7c7 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc8_21 => constants.%complete_type -// CHECK:STDOUT: %require_complete.loc8_38 => constants.%complete_type +// CHECK:STDOUT: %require_complete.loc8_28 => constants.%complete_type +// CHECK:STDOUT: %require_complete.loc8_52 => constants.%complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- struct_access.carbon @@ -386,29 +386,29 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %T.patt: %pattern_type.7f2 = symbolic_binding_pattern T, 0 [concrete] -// CHECK:STDOUT: %x.patt: @F.%pattern_type.loc8_22 (%pattern_type.2de) = value_binding_pattern x [concrete] -// CHECK:STDOUT: %x.param_patt: @F.%pattern_type.loc8_22 (%pattern_type.2de) = value_param_pattern %x.patt, call_param0 [concrete] -// CHECK:STDOUT: %a.patt: @F.%pattern_type.loc8_39 (%pattern_type.92c) = value_binding_pattern a [concrete] -// CHECK:STDOUT: %a.param_patt: @F.%pattern_type.loc8_39 (%pattern_type.92c) = value_param_pattern %a.patt, call_param1 [concrete] +// CHECK:STDOUT: %x.patt: @F.%pattern_type.loc8_29 (%pattern_type.2de) = value_binding_pattern x [concrete] +// CHECK:STDOUT: %x.param_patt: @F.%pattern_type.loc8_29 (%pattern_type.2de) = value_param_pattern %x.patt, call_param0 [concrete] +// CHECK:STDOUT: %a.patt: @F.%pattern_type.loc8_53 (%pattern_type.92c) = value_binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: @F.%pattern_type.loc8_53 (%pattern_type.92c) = value_param_pattern %a.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc8_19: type = splice_block %struct_type.t [concrete = constants.%struct_type.t] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %struct_type.t: type = struct_type {.t: type} [concrete = constants.%struct_type.t] // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc8_6.2: %struct_type.t = symbolic_binding T, 0 [symbolic = %T.loc8_6.1 (constants.%T)] -// CHECK:STDOUT: %x.param: @F.%HoldsType.loc8_36.1 (%HoldsType.cac) = value_param call_param0 -// CHECK:STDOUT: %.loc8_36: type = splice_block %HoldsType.loc8_36.2 [symbolic = %HoldsType.loc8_36.1 (constants.%HoldsType.cac)] { +// CHECK:STDOUT: %x.param: @F.%HoldsType.loc8_43.1 (%HoldsType.cac) = value_param call_param0 +// CHECK:STDOUT: %.loc8_43: type = splice_block %HoldsType.loc8_43.2 [symbolic = %HoldsType.loc8_43.1 (constants.%HoldsType.cac)] { // CHECK:STDOUT: %HoldsType.ref: %HoldsType.type = name_ref HoldsType, file.%HoldsType.decl [concrete = constants.%HoldsType.generic] -// CHECK:STDOUT: %T.ref.loc8_35: %struct_type.t = name_ref T, %T.loc8_6.2 [symbolic = %T.loc8_6.1 (constants.%T)] -// CHECK:STDOUT: %HoldsType.loc8_36.2: type = class_type @HoldsType, @HoldsType(constants.%T) [symbolic = %HoldsType.loc8_36.1 (constants.%HoldsType.cac)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %x: @F.%HoldsType.loc8_36.1 (%HoldsType.cac) = value_binding x, %x.param -// CHECK:STDOUT: %a.param: @F.%.loc8_43.1 (%.424) = value_param call_param1 -// CHECK:STDOUT: %.loc8_43.2: type = splice_block %.loc8_43.3 [symbolic = %.loc8_43.1 (constants.%.424)] { // CHECK:STDOUT: %T.ref.loc8_42: %struct_type.t = name_ref T, %T.loc8_6.2 [symbolic = %T.loc8_6.1 (constants.%T)] -// CHECK:STDOUT: %.loc8_43.3: type = struct_access %T.ref.loc8_42, element0 [symbolic = %.loc8_43.1 (constants.%.424)] +// CHECK:STDOUT: %HoldsType.loc8_43.2: type = class_type @HoldsType, @HoldsType(constants.%T) [symbolic = %HoldsType.loc8_43.1 (constants.%HoldsType.cac)] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: @F.%.loc8_43.1 (%.424) = value_binding a, %a.param +// CHECK:STDOUT: %x: @F.%HoldsType.loc8_43.1 (%HoldsType.cac) = value_binding x, %x.param +// CHECK:STDOUT: %a.param: @F.%.loc8_57.1 (%.424) = value_param call_param1 +// CHECK:STDOUT: %.loc8_57.2: type = splice_block %.loc8_57.3 [symbolic = %.loc8_57.1 (constants.%.424)] { +// CHECK:STDOUT: %T.ref.loc8_56: %struct_type.t = name_ref T, %T.loc8_6.2 [symbolic = %T.loc8_6.1 (constants.%T)] +// CHECK:STDOUT: %.loc8_57.3: type = struct_access %T.ref.loc8_56, element0 [symbolic = %.loc8_57.1 (constants.%.424)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: @F.%.loc8_57.1 (%.424) = value_binding a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {} @@ -438,16 +438,16 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc8_6.2: %struct_type.t) { // CHECK:STDOUT: %T.loc8_6.1: %struct_type.t = symbolic_binding T, 0 [symbolic = %T.loc8_6.1 (constants.%T)] -// CHECK:STDOUT: %HoldsType.loc8_36.1: type = class_type @HoldsType, @HoldsType(%T.loc8_6.1) [symbolic = %HoldsType.loc8_36.1 (constants.%HoldsType.cac)] -// CHECK:STDOUT: %pattern_type.loc8_22: type = pattern_type %HoldsType.loc8_36.1 [symbolic = %pattern_type.loc8_22 (constants.%pattern_type.2de)] -// CHECK:STDOUT: %.loc8_43.1: type = struct_access %T.loc8_6.1, element0 [symbolic = %.loc8_43.1 (constants.%.424)] -// CHECK:STDOUT: %pattern_type.loc8_39: type = pattern_type %.loc8_43.1 [symbolic = %pattern_type.loc8_39 (constants.%pattern_type.92c)] +// CHECK:STDOUT: %HoldsType.loc8_43.1: type = class_type @HoldsType, @HoldsType(%T.loc8_6.1) [symbolic = %HoldsType.loc8_43.1 (constants.%HoldsType.cac)] +// CHECK:STDOUT: %pattern_type.loc8_29: type = pattern_type %HoldsType.loc8_43.1 [symbolic = %pattern_type.loc8_29 (constants.%pattern_type.2de)] +// CHECK:STDOUT: %.loc8_57.1: type = struct_access %T.loc8_6.1, element0 [symbolic = %.loc8_57.1 (constants.%.424)] +// CHECK:STDOUT: %pattern_type.loc8_53: type = pattern_type %.loc8_57.1 [symbolic = %pattern_type.loc8_53 (constants.%pattern_type.92c)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc8_23: = require_complete_type %HoldsType.loc8_36.1 [symbolic = %require_complete.loc8_23 (constants.%require_complete.276)] -// CHECK:STDOUT: %require_complete.loc8_40: = require_complete_type %.loc8_43.1 [symbolic = %require_complete.loc8_40 (constants.%require_complete.ba0)] +// CHECK:STDOUT: %require_complete.loc8_30: = require_complete_type %HoldsType.loc8_43.1 [symbolic = %require_complete.loc8_30 (constants.%require_complete.276)] +// CHECK:STDOUT: %require_complete.loc8_54: = require_complete_type %.loc8_57.1 [symbolic = %require_complete.loc8_54 (constants.%require_complete.ba0)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @F.%HoldsType.loc8_36.1 (%HoldsType.cac), %a.param: @F.%.loc8_43.1 (%.424)) { +// CHECK:STDOUT: fn(%x.param: @F.%HoldsType.loc8_43.1 (%HoldsType.cac), %a.param: @F.%.loc8_57.1 (%.424)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -495,10 +495,10 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc8_6.1 => constants.%T -// CHECK:STDOUT: %HoldsType.loc8_36.1 => constants.%HoldsType.cac -// CHECK:STDOUT: %pattern_type.loc8_22 => constants.%pattern_type.2de -// CHECK:STDOUT: %.loc8_43.1 => constants.%.424 -// CHECK:STDOUT: %pattern_type.loc8_39 => constants.%pattern_type.92c +// CHECK:STDOUT: %HoldsType.loc8_43.1 => constants.%HoldsType.cac +// CHECK:STDOUT: %pattern_type.loc8_29 => constants.%pattern_type.2de +// CHECK:STDOUT: %.loc8_57.1 => constants.%.424 +// CHECK:STDOUT: %pattern_type.loc8_53 => constants.%pattern_type.92c // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HoldsType(constants.%struct) { @@ -509,14 +509,14 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%struct) { // CHECK:STDOUT: %T.loc8_6.1 => constants.%struct -// CHECK:STDOUT: %HoldsType.loc8_36.1 => constants.%HoldsType.673 -// CHECK:STDOUT: %pattern_type.loc8_22 => constants.%pattern_type.4e6 -// CHECK:STDOUT: %.loc8_43.1 => constants.%C -// CHECK:STDOUT: %pattern_type.loc8_39 => constants.%pattern_type.7c7 +// CHECK:STDOUT: %HoldsType.loc8_43.1 => constants.%HoldsType.673 +// CHECK:STDOUT: %pattern_type.loc8_29 => constants.%pattern_type.4e6 +// CHECK:STDOUT: %.loc8_57.1 => constants.%C +// CHECK:STDOUT: %pattern_type.loc8_53 => constants.%pattern_type.7c7 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc8_23 => constants.%complete_type -// CHECK:STDOUT: %require_complete.loc8_40 => constants.%complete_type +// CHECK:STDOUT: %require_complete.loc8_30 => constants.%complete_type +// CHECK:STDOUT: %require_complete.loc8_54 => constants.%complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_class_access.carbon @@ -618,19 +618,19 @@ fn G() { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc21_6.2: %Class = symbolic_binding T, 0 [symbolic = %T.loc21_6.1 (constants.%T.d7d)] -// CHECK:STDOUT: %x.param: @F.%HoldsType.loc21_31.1 (%HoldsType.47b504.1) = value_param call_param0 -// CHECK:STDOUT: %.loc21_31: type = splice_block %HoldsType.loc21_31.2 [symbolic = %HoldsType.loc21_31.1 (constants.%HoldsType.47b504.1)] { +// CHECK:STDOUT: %x.param: @F.%HoldsType.loc21_38.1 (%HoldsType.47b504.1) = value_param call_param0 +// CHECK:STDOUT: %.loc21_38: type = splice_block %HoldsType.loc21_38.2 [symbolic = %HoldsType.loc21_38.1 (constants.%HoldsType.47b504.1)] { // CHECK:STDOUT: %HoldsType.ref: %HoldsType.type = name_ref HoldsType, file.%HoldsType.decl [concrete = constants.%HoldsType.generic] -// CHECK:STDOUT: %T.ref.loc21_30: %Class = name_ref T, %T.loc21_6.2 [symbolic = %T.loc21_6.1 (constants.%T.d7d)] -// CHECK:STDOUT: %HoldsType.loc21_31.2: type = class_type @HoldsType, @HoldsType(constants.%T.d7d) [symbolic = %HoldsType.loc21_31.1 (constants.%HoldsType.47b504.1)] +// CHECK:STDOUT: %T.ref.loc21_37: %Class = name_ref T, %T.loc21_6.2 [symbolic = %T.loc21_6.1 (constants.%T.d7d)] +// CHECK:STDOUT: %HoldsType.loc21_38.2: type = class_type @HoldsType, @HoldsType(constants.%T.d7d) [symbolic = %HoldsType.loc21_38.1 (constants.%HoldsType.47b504.1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @F.%HoldsType.loc21_31.1 (%HoldsType.47b504.1) = value_binding x, %x.param +// CHECK:STDOUT: %x: @F.%HoldsType.loc21_38.1 (%HoldsType.47b504.1) = value_binding x, %x.param // CHECK:STDOUT: %a.param: = value_param call_param1 // CHECK:STDOUT: %.1: = splice_block [concrete = ] { -// CHECK:STDOUT: %T.ref.loc21_37: %Class = name_ref T, %T.loc21_6.2 [symbolic = %T.loc21_6.1 (constants.%T.d7d)] +// CHECK:STDOUT: %T.ref.loc21_51: %Class = name_ref T, %T.loc21_6.2 [symbolic = %T.loc21_6.1 (constants.%T.d7d)] // CHECK:STDOUT: %t.ref: %Class.elem = name_ref t, @Class.%.loc5 [concrete = @Class.%.loc5] -// CHECK:STDOUT: %.loc21_38.2: ref type = class_element_access %T.ref.loc21_37, element0 [symbolic = %.loc21_38.1 (constants.%.208)] -// CHECK:STDOUT: %.loc21_38.3: type = acquire_value %.loc21_38.2 +// CHECK:STDOUT: %.loc21_52.2: ref type = class_element_access %T.ref.loc21_51, element0 [symbolic = %.loc21_52.1 (constants.%.208)] +// CHECK:STDOUT: %.loc21_52.3: type = acquire_value %.loc21_52.2 // CHECK:STDOUT: } // CHECK:STDOUT: %a: = value_binding a, %a.param // CHECK:STDOUT: } @@ -681,14 +681,14 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc21_6.2: %Class) { // CHECK:STDOUT: %T.loc21_6.1: %Class = symbolic_binding T, 0 [symbolic = %T.loc21_6.1 (constants.%T.d7d)] -// CHECK:STDOUT: %HoldsType.loc21_31.1: type = class_type @HoldsType, @HoldsType(%T.loc21_6.1) [symbolic = %HoldsType.loc21_31.1 (constants.%HoldsType.47b504.1)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %HoldsType.loc21_31.1 [symbolic = %pattern_type (constants.%pattern_type.3b8c03.1)] -// CHECK:STDOUT: %.loc21_38.1: ref type = class_element_access %T.loc21_6.1, element0 [symbolic = %.loc21_38.1 (constants.%.208)] +// CHECK:STDOUT: %HoldsType.loc21_38.1: type = class_type @HoldsType, @HoldsType(%T.loc21_6.1) [symbolic = %HoldsType.loc21_38.1 (constants.%HoldsType.47b504.1)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %HoldsType.loc21_38.1 [symbolic = %pattern_type (constants.%pattern_type.3b8c03.1)] +// CHECK:STDOUT: %.loc21_52.1: ref type = class_element_access %T.loc21_6.1, element0 [symbolic = %.loc21_52.1 (constants.%.208)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %HoldsType.loc21_31.1 [symbolic = %require_complete (constants.%require_complete.9b8c71.1)] +// CHECK:STDOUT: %require_complete: = require_complete_type %HoldsType.loc21_38.1 [symbolic = %require_complete (constants.%require_complete.9b8c71.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @F.%HoldsType.loc21_31.1 (%HoldsType.47b504.1), %a.param: ) { +// CHECK:STDOUT: fn(%x.param: @F.%HoldsType.loc21_38.1 (%HoldsType.47b504.1), %a.param: ) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -759,9 +759,9 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.d7d) { // CHECK:STDOUT: %T.loc21_6.1 => constants.%T.d7d -// CHECK:STDOUT: %HoldsType.loc21_31.1 => constants.%HoldsType.47b504.1 +// CHECK:STDOUT: %HoldsType.loc21_38.1 => constants.%HoldsType.47b504.1 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.3b8c03.1 -// CHECK:STDOUT: %.loc21_38.1 => constants.%.208 +// CHECK:STDOUT: %.loc21_52.1 => constants.%.208 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%c) { @@ -885,29 +885,29 @@ fn G() { // CHECK:STDOUT: %array_type: type = array_type %int_1, type [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc12_6.2: %array_type = symbolic_binding T, 0 [symbolic = %T.loc12_6.1 (constants.%T.9b7)] -// CHECK:STDOUT: %x.param: @F.%HoldsType.loc12_40.1 (%HoldsType) = value_param call_param0 -// CHECK:STDOUT: %.loc12_40: type = splice_block %HoldsType.loc12_40.2 [symbolic = %HoldsType.loc12_40.1 (constants.%HoldsType)] { +// CHECK:STDOUT: %x.param: @F.%HoldsType.loc12_47.1 (%HoldsType) = value_param call_param0 +// CHECK:STDOUT: %.loc12_47: type = splice_block %HoldsType.loc12_47.2 [symbolic = %HoldsType.loc12_47.1 (constants.%HoldsType)] { // CHECK:STDOUT: %HoldsType.ref: %HoldsType.type = name_ref HoldsType, file.%HoldsType.decl [concrete = constants.%HoldsType.generic] -// CHECK:STDOUT: %T.ref.loc12_39: %array_type = name_ref T, %T.loc12_6.2 [symbolic = %T.loc12_6.1 (constants.%T.9b7)] -// CHECK:STDOUT: %HoldsType.loc12_40.2: type = class_type @HoldsType, @HoldsType(constants.%T.9b7) [symbolic = %HoldsType.loc12_40.1 (constants.%HoldsType)] +// CHECK:STDOUT: %T.ref.loc12_46: %array_type = name_ref T, %T.loc12_6.2 [symbolic = %T.loc12_6.1 (constants.%T.9b7)] +// CHECK:STDOUT: %HoldsType.loc12_47.2: type = class_type @HoldsType, @HoldsType(constants.%T.9b7) [symbolic = %HoldsType.loc12_47.1 (constants.%HoldsType)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @F.%HoldsType.loc12_40.1 (%HoldsType) = value_binding x, %x.param +// CHECK:STDOUT: %x: @F.%HoldsType.loc12_47.1 (%HoldsType) = value_binding x, %x.param // CHECK:STDOUT: %a.param: = value_param call_param1 // CHECK:STDOUT: %.1: = splice_block [concrete = ] { -// CHECK:STDOUT: %T.ref.loc12_46: %array_type = name_ref T, %T.loc12_6.2 [symbolic = %T.loc12_6.1 (constants.%T.9b7)] +// CHECK:STDOUT: %T.ref.loc12_60: %array_type = name_ref T, %T.loc12_6.2 [symbolic = %T.loc12_6.1 (constants.%T.9b7)] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc12_48.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %bound_method.loc12_62.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc12_48.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc12_48.2(%int_0) [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc12_48.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc12_48.2: %i32 = converted %int_0, %.loc12_48.1 [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc12_49.1: ref %array_type = value_as_ref %T.ref.loc12_46 -// CHECK:STDOUT: %.loc12_49.2: ref type = array_index %.loc12_49.1, %.loc12_48.2 -// CHECK:STDOUT: %.loc12_49.3: type = acquire_value %.loc12_49.2 +// CHECK:STDOUT: %bound_method.loc12_62.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc12_62.2(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc12_62.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc12_62.2: %i32 = converted %int_0, %.loc12_62.1 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc12_63.1: ref %array_type = value_as_ref %T.ref.loc12_60 +// CHECK:STDOUT: %.loc12_63.2: ref type = array_index %.loc12_63.1, %.loc12_62.2 +// CHECK:STDOUT: %.loc12_63.3: type = acquire_value %.loc12_63.2 // CHECK:STDOUT: } // CHECK:STDOUT: %a: = value_binding a, %a.param // CHECK:STDOUT: } @@ -939,13 +939,13 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc12_6.2: %array_type) { // CHECK:STDOUT: %T.loc12_6.1: %array_type = symbolic_binding T, 0 [symbolic = %T.loc12_6.1 (constants.%T.9b7)] -// CHECK:STDOUT: %HoldsType.loc12_40.1: type = class_type @HoldsType, @HoldsType(%T.loc12_6.1) [symbolic = %HoldsType.loc12_40.1 (constants.%HoldsType)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %HoldsType.loc12_40.1 [symbolic = %pattern_type (constants.%pattern_type.342)] +// CHECK:STDOUT: %HoldsType.loc12_47.1: type = class_type @HoldsType, @HoldsType(%T.loc12_6.1) [symbolic = %HoldsType.loc12_47.1 (constants.%HoldsType)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %HoldsType.loc12_47.1 [symbolic = %pattern_type (constants.%pattern_type.342)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %HoldsType.loc12_40.1 [symbolic = %require_complete (constants.%require_complete.bd5)] +// CHECK:STDOUT: %require_complete: = require_complete_type %HoldsType.loc12_47.1 [symbolic = %require_complete (constants.%require_complete.bd5)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @F.%HoldsType.loc12_40.1 (%HoldsType), %a.param: ) { +// CHECK:STDOUT: fn(%x.param: @F.%HoldsType.loc12_47.1 (%HoldsType), %a.param: ) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -987,7 +987,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.9b7) { // CHECK:STDOUT: %T.loc12_6.1 => constants.%T.9b7 -// CHECK:STDOUT: %HoldsType.loc12_40.1 => constants.%HoldsType +// CHECK:STDOUT: %HoldsType.loc12_47.1 => constants.%HoldsType // CHECK:STDOUT: %pattern_type => constants.%pattern_type.342 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/where.carbon b/toolchain/check/testdata/deduce/where.carbon index e5e03e6d8c3b..4b39bfba4e5c 100644 --- a/toolchain/check/testdata/deduce/where.carbon +++ b/toolchain/check/testdata/deduce/where.carbon @@ -17,9 +17,9 @@ interface Z { let Z1:! type; } -class C(T:! type) {} +class C(unused T:! type) {} -fn F[U:! type](T:! Z where .Z1 = C(U)) {} +fn F[U:! type](unused T:! Z where .Z1 = C(U)) {} class D {} final impl () as Z where .Z1 = C(D) {} @@ -32,8 +32,8 @@ fn G() { // CHECK:STDERR: F(() as type); // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_where.carbon:[[@LINE-12]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn F[U:! type](T:! Z where .Z1 = C(U)) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn F[U:! type](unused T:! Z where .Z1 = C(U)) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: F(() as type); } diff --git a/toolchain/check/testdata/eval/aggregates.carbon b/toolchain/check/testdata/eval/aggregates.carbon index f490be1f4f0a..4c7b1252f9fa 100644 --- a/toolchain/check/testdata/eval/aggregates.carbon +++ b/toolchain/check/testdata/eval/aggregates.carbon @@ -41,15 +41,15 @@ library "[[@TEST_NAME]]"; // Check that we propagate the `symbolic` tag through evaluations. fn F(T:! type) { //@dump-sem-ir-begin - var u: (T*, const T); - var v: {.a: T}; - var w: array(T, 5); + var unused u: (T*, const T); + var unused v: {.a: T}; + var unused w: array(T, 5); //@dump-sem-ir-end } fn G(N:! i32) { //@dump-sem-ir-begin - var k: array(i32, N); + var unused k: array(i32, N); //@dump-sem-ir-end } @@ -574,26 +574,26 @@ fn G(N:! i32) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ptr.loc6_12.2: type = ptr_type %T.loc4_6.1 [symbolic = %ptr.loc6_12.2 (constants.%ptr.e8f)] -// CHECK:STDOUT: %const.loc6_15.2: type = const_type %T.loc4_6.1 [symbolic = %const.loc6_15.2 (constants.%const)] -// CHECK:STDOUT: %tuple: %tuple.type.24b = tuple_value (%ptr.loc6_12.2, %const.loc6_15.2) [symbolic = %tuple (constants.%tuple)] -// CHECK:STDOUT: %tuple.type: type = tuple_type (%ptr.loc6_12.2, %const.loc6_15.2) [symbolic = %tuple.type (constants.%tuple.type.3c8)] +// CHECK:STDOUT: %ptr.loc6_19.2: type = ptr_type %T.loc4_6.1 [symbolic = %ptr.loc6_19.2 (constants.%ptr.e8f)] +// CHECK:STDOUT: %const.loc6_22.2: type = const_type %T.loc4_6.1 [symbolic = %const.loc6_22.2 (constants.%const)] +// CHECK:STDOUT: %tuple: %tuple.type.24b = tuple_value (%ptr.loc6_19.2, %const.loc6_22.2) [symbolic = %tuple (constants.%tuple)] +// CHECK:STDOUT: %tuple.type: type = tuple_type (%ptr.loc6_19.2, %const.loc6_22.2) [symbolic = %tuple.type (constants.%tuple.type.3c8)] // CHECK:STDOUT: %require_complete.loc6: = require_complete_type %tuple.type [symbolic = %require_complete.loc6 (constants.%require_complete.666)] // CHECK:STDOUT: %pattern_type.loc6: type = pattern_type %tuple.type [symbolic = %pattern_type.loc6 (constants.%pattern_type.4ac)] -// CHECK:STDOUT: %struct_type.a.loc7_16.2: type = struct_type {.a: @F.%T.loc4_6.1 (%T)} [symbolic = %struct_type.a.loc7_16.2 (constants.%struct_type.a)] -// CHECK:STDOUT: %require_complete.loc7: = require_complete_type %struct_type.a.loc7_16.2 [symbolic = %require_complete.loc7 (constants.%require_complete.5d6)] -// CHECK:STDOUT: %pattern_type.loc7: type = pattern_type %struct_type.a.loc7_16.2 [symbolic = %pattern_type.loc7 (constants.%pattern_type.7b9)] -// CHECK:STDOUT: %array_type.loc8_20.2: type = array_type constants.%int_5, %T.loc4_6.1 [symbolic = %array_type.loc8_20.2 (constants.%array_type.742)] -// CHECK:STDOUT: %require_complete.loc8: = require_complete_type %array_type.loc8_20.2 [symbolic = %require_complete.loc8 (constants.%require_complete.345)] -// CHECK:STDOUT: %pattern_type.loc8: type = pattern_type %array_type.loc8_20.2 [symbolic = %pattern_type.loc8 (constants.%pattern_type.d52)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc8: = lookup_impl_witness %array_type.loc8_20.2, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc8 (constants.%Destroy.lookup_impl_witness.b29)] -// CHECK:STDOUT: %Destroy.facet.loc8: %Destroy.type = facet_value %array_type.loc8_20.2, (%Destroy.lookup_impl_witness.loc8) [symbolic = %Destroy.facet.loc8 (constants.%Destroy.facet.ddc)] +// CHECK:STDOUT: %struct_type.a.loc7_23.2: type = struct_type {.a: @F.%T.loc4_6.1 (%T)} [symbolic = %struct_type.a.loc7_23.2 (constants.%struct_type.a)] +// CHECK:STDOUT: %require_complete.loc7: = require_complete_type %struct_type.a.loc7_23.2 [symbolic = %require_complete.loc7 (constants.%require_complete.5d6)] +// CHECK:STDOUT: %pattern_type.loc7: type = pattern_type %struct_type.a.loc7_23.2 [symbolic = %pattern_type.loc7 (constants.%pattern_type.7b9)] +// CHECK:STDOUT: %array_type.loc8_27.2: type = array_type constants.%int_5, %T.loc4_6.1 [symbolic = %array_type.loc8_27.2 (constants.%array_type.742)] +// CHECK:STDOUT: %require_complete.loc8: = require_complete_type %array_type.loc8_27.2 [symbolic = %require_complete.loc8 (constants.%require_complete.345)] +// CHECK:STDOUT: %pattern_type.loc8: type = pattern_type %array_type.loc8_27.2 [symbolic = %pattern_type.loc8 (constants.%pattern_type.d52)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc8: = lookup_impl_witness %array_type.loc8_27.2, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc8 (constants.%Destroy.lookup_impl_witness.b29)] +// CHECK:STDOUT: %Destroy.facet.loc8: %Destroy.type = facet_value %array_type.loc8_27.2, (%Destroy.lookup_impl_witness.loc8) [symbolic = %Destroy.facet.loc8 (constants.%Destroy.facet.ddc)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc8: type = fn_type @Destroy.WithSelf.Op, @Destroy(%Destroy.facet.loc8) [symbolic = %Destroy.WithSelf.Op.type.loc8 (constants.%Destroy.WithSelf.Op.type.3c6)] // CHECK:STDOUT: %.loc8_3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc8, %Destroy.facet.loc8 [symbolic = %.loc8_3 (constants.%.950)] // CHECK:STDOUT: %impl.elem0.loc8_3.2: @F.%.loc8_3 (%.950) = impl_witness_access %Destroy.lookup_impl_witness.loc8, element0 [symbolic = %impl.elem0.loc8_3.2 (constants.%impl.elem0.fa5)] // CHECK:STDOUT: %specific_impl_fn.loc8_3.2: = specific_impl_function %impl.elem0.loc8_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc8) [symbolic = %specific_impl_fn.loc8_3.2 (constants.%specific_impl_fn.ede)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc7: = lookup_impl_witness %struct_type.a.loc7_16.2, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc7 (constants.%Destroy.lookup_impl_witness.bed)] -// CHECK:STDOUT: %Destroy.facet.loc7: %Destroy.type = facet_value %struct_type.a.loc7_16.2, (%Destroy.lookup_impl_witness.loc7) [symbolic = %Destroy.facet.loc7 (constants.%Destroy.facet.d21)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc7: = lookup_impl_witness %struct_type.a.loc7_23.2, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc7 (constants.%Destroy.lookup_impl_witness.bed)] +// CHECK:STDOUT: %Destroy.facet.loc7: %Destroy.type = facet_value %struct_type.a.loc7_23.2, (%Destroy.lookup_impl_witness.loc7) [symbolic = %Destroy.facet.loc7 (constants.%Destroy.facet.d21)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc7: type = fn_type @Destroy.WithSelf.Op, @Destroy(%Destroy.facet.loc7) [symbolic = %Destroy.WithSelf.Op.type.loc7 (constants.%Destroy.WithSelf.Op.type.873)] // CHECK:STDOUT: %.loc7_3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc7, %Destroy.facet.loc7 [symbolic = %.loc7_3 (constants.%.511)] // CHECK:STDOUT: %impl.elem0.loc7_3.2: @F.%.loc7_3 (%.511) = impl_witness_access %Destroy.lookup_impl_witness.loc7, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0.12c)] @@ -612,36 +612,36 @@ fn G(N:! i32) { // CHECK:STDOUT: %u.var_patt: @F.%pattern_type.loc6 (%pattern_type.4ac) = var_pattern %u.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %u.var: ref @F.%tuple.type (%tuple.type.3c8) = var %u.var_patt -// CHECK:STDOUT: %.loc6_22.1: type = splice_block %.loc6_22.3 [symbolic = %tuple.type (constants.%tuple.type.3c8)] { -// CHECK:STDOUT: %T.ref.loc6_11: type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] -// CHECK:STDOUT: %ptr.loc6_12.1: type = ptr_type %T.ref.loc6_11 [symbolic = %ptr.loc6_12.2 (constants.%ptr.e8f)] -// CHECK:STDOUT: %T.ref.loc6_21: type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] -// CHECK:STDOUT: %const.loc6_15.1: type = const_type %T.ref.loc6_21 [symbolic = %const.loc6_15.2 (constants.%const)] -// CHECK:STDOUT: %.loc6_22.2: %tuple.type.24b = tuple_literal (%ptr.loc6_12.1, %const.loc6_15.1) [symbolic = %tuple (constants.%tuple)] -// CHECK:STDOUT: %.loc6_22.3: type = converted %.loc6_22.2, constants.%tuple.type.3c8 [symbolic = %tuple.type (constants.%tuple.type.3c8)] +// CHECK:STDOUT: %.loc6_29.1: type = splice_block %.loc6_29.3 [symbolic = %tuple.type (constants.%tuple.type.3c8)] { +// CHECK:STDOUT: %T.ref.loc6_18: type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] +// CHECK:STDOUT: %ptr.loc6_19.1: type = ptr_type %T.ref.loc6_18 [symbolic = %ptr.loc6_19.2 (constants.%ptr.e8f)] +// CHECK:STDOUT: %T.ref.loc6_28: type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] +// CHECK:STDOUT: %const.loc6_22.1: type = const_type %T.ref.loc6_28 [symbolic = %const.loc6_22.2 (constants.%const)] +// CHECK:STDOUT: %.loc6_29.2: %tuple.type.24b = tuple_literal (%ptr.loc6_19.1, %const.loc6_22.1) [symbolic = %tuple (constants.%tuple)] +// CHECK:STDOUT: %.loc6_29.3: type = converted %.loc6_29.2, constants.%tuple.type.3c8 [symbolic = %tuple.type (constants.%tuple.type.3c8)] // CHECK:STDOUT: } // CHECK:STDOUT: %u: ref @F.%tuple.type (%tuple.type.3c8) = ref_binding u, %u.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %v.patt: @F.%pattern_type.loc7 (%pattern_type.7b9) = ref_binding_pattern v [concrete] // CHECK:STDOUT: %v.var_patt: @F.%pattern_type.loc7 (%pattern_type.7b9) = var_pattern %v.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %v.var: ref @F.%struct_type.a.loc7_16.2 (%struct_type.a) = var %v.var_patt -// CHECK:STDOUT: %.loc7_16: type = splice_block %struct_type.a.loc7_16.1 [symbolic = %struct_type.a.loc7_16.2 (constants.%struct_type.a)] { +// CHECK:STDOUT: %v.var: ref @F.%struct_type.a.loc7_23.2 (%struct_type.a) = var %v.var_patt +// CHECK:STDOUT: %.loc7_23: type = splice_block %struct_type.a.loc7_23.1 [symbolic = %struct_type.a.loc7_23.2 (constants.%struct_type.a)] { // CHECK:STDOUT: %T.ref.loc7: type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] -// CHECK:STDOUT: %struct_type.a.loc7_16.1: type = struct_type {.a: @F.%T.loc4_6.1 (%T)} [symbolic = %struct_type.a.loc7_16.2 (constants.%struct_type.a)] +// CHECK:STDOUT: %struct_type.a.loc7_23.1: type = struct_type {.a: @F.%T.loc4_6.1 (%T)} [symbolic = %struct_type.a.loc7_23.2 (constants.%struct_type.a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %v: ref @F.%struct_type.a.loc7_16.2 (%struct_type.a) = ref_binding v, %v.var +// CHECK:STDOUT: %v: ref @F.%struct_type.a.loc7_23.2 (%struct_type.a) = ref_binding v, %v.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %w.patt: @F.%pattern_type.loc8 (%pattern_type.d52) = ref_binding_pattern w [concrete] // CHECK:STDOUT: %w.var_patt: @F.%pattern_type.loc8 (%pattern_type.d52) = var_pattern %w.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %w.var: ref @F.%array_type.loc8_20.2 (%array_type.742) = var %w.var_patt -// CHECK:STDOUT: %.loc8_20: type = splice_block %array_type.loc8_20.1 [symbolic = %array_type.loc8_20.2 (constants.%array_type.742)] { +// CHECK:STDOUT: %w.var: ref @F.%array_type.loc8_27.2 (%array_type.742) = var %w.var_patt +// CHECK:STDOUT: %.loc8_27: type = splice_block %array_type.loc8_27.1 [symbolic = %array_type.loc8_27.2 (constants.%array_type.742)] { // CHECK:STDOUT: %T.ref.loc8: type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5] -// CHECK:STDOUT: %array_type.loc8_20.1: type = array_type %int_5, %T.ref.loc8 [symbolic = %array_type.loc8_20.2 (constants.%array_type.742)] +// CHECK:STDOUT: %array_type.loc8_27.1: type = array_type %int_5, %T.ref.loc8 [symbolic = %array_type.loc8_27.2 (constants.%array_type.742)] // CHECK:STDOUT: } -// CHECK:STDOUT: %w: ref @F.%array_type.loc8_20.2 (%array_type.742) = ref_binding w, %w.var +// CHECK:STDOUT: %w: ref @F.%array_type.loc8_27.2 (%array_type.742) = ref_binding w, %w.var // CHECK:STDOUT: %impl.elem0.loc8_3.1: @F.%.loc8_3 (%.950) = impl_witness_access constants.%Destroy.lookup_impl_witness.b29, element0 [symbolic = %impl.elem0.loc8_3.2 (constants.%impl.elem0.fa5)] // CHECK:STDOUT: %bound_method.loc8_3.1: = bound_method %w.var, %impl.elem0.loc8_3.1 // CHECK:STDOUT: %specific_impl_fn.loc8_3.1: = specific_impl_function %impl.elem0.loc8_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.ddc) [symbolic = %specific_impl_fn.loc8_3.2 (constants.%specific_impl_fn.ede)] @@ -666,13 +666,13 @@ fn G(N:! i32) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound: = bound_method %N.loc12_6.1, constants.%Int.as.ImplicitAs.impl.Convert.dd4 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound)] -// CHECK:STDOUT: %bound_method.loc14_21.3: = bound_method %N.loc12_6.1, constants.%Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc14_21.3 (constants.%bound_method)] -// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc14_21.2: init Core.IntLiteral = call %bound_method.loc14_21.3(%N.loc12_6.1) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc14_21.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %array_type.loc14_22.2: type = array_type %Int.as.ImplicitAs.impl.Convert.call.loc14_21.2, constants.%i32 [symbolic = %array_type.loc14_22.2 (constants.%array_type.2ec)] -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc14_22.2 [symbolic = %require_complete (constants.%require_complete.5d1)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc14_22.2 [symbolic = %pattern_type (constants.%pattern_type.99c)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %array_type.loc14_22.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.f5c)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %array_type.loc14_22.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.d1e)] +// CHECK:STDOUT: %bound_method.loc14_28.3: = bound_method %N.loc12_6.1, constants.%Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc14_28.3 (constants.%bound_method)] +// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc14_28.2: init Core.IntLiteral = call %bound_method.loc14_28.3(%N.loc12_6.1) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc14_28.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %array_type.loc14_29.2: type = array_type %Int.as.ImplicitAs.impl.Convert.call.loc14_28.2, constants.%i32 [symbolic = %array_type.loc14_29.2 (constants.%array_type.2ec)] +// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc14_29.2 [symbolic = %require_complete (constants.%require_complete.5d1)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc14_29.2 [symbolic = %pattern_type (constants.%pattern_type.99c)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %array_type.loc14_29.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.f5c)] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %array_type.loc14_29.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.d1e)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.ff9)] // CHECK:STDOUT: %.loc14_3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc14_3 (constants.%.63e)] // CHECK:STDOUT: %impl.elem0.loc14_3.2: @G.%.loc14_3 (%.63e) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_3.2 (constants.%impl.elem0.2bf)] @@ -684,21 +684,21 @@ fn G(N:! i32) { // CHECK:STDOUT: %k.patt: @G.%pattern_type (%pattern_type.99c) = ref_binding_pattern k [concrete] // CHECK:STDOUT: %k.var_patt: @G.%pattern_type (%pattern_type.99c) = var_pattern %k.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %k.var: ref @G.%array_type.loc14_22.2 (%array_type.2ec) = var %k.var_patt -// CHECK:STDOUT: %.loc14_22: type = splice_block %array_type.loc14_22.1 [symbolic = %array_type.loc14_22.2 (constants.%array_type.2ec)] { +// CHECK:STDOUT: %k.var: ref @G.%array_type.loc14_29.2 (%array_type.2ec) = var %k.var_patt +// CHECK:STDOUT: %.loc14_29: type = splice_block %array_type.loc14_29.1 [symbolic = %array_type.loc14_29.2 (constants.%array_type.2ec)] { // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc12_6.2 [symbolic = %N.loc12_6.1 (constants.%N.5de)] -// CHECK:STDOUT: %impl.elem0.loc14_21: %.0a7 = impl_witness_access constants.%ImplicitAs.impl_witness.640, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.dd4] -// CHECK:STDOUT: %bound_method.loc14_21.1: = bound_method %N.ref, %impl.elem0.loc14_21 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound)] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc14_21, @Int.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Int.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc14_21.2: = bound_method %N.ref, %specific_fn [symbolic = %bound_method.loc14_21.3 (constants.%bound_method)] -// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc14_21.1: init Core.IntLiteral = call %bound_method.loc14_21.2(%N.ref) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc14_21.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %.loc14_21.1: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call.loc14_21.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc14_21.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %.loc14_21.2: Core.IntLiteral = converted %N.ref, %.loc14_21.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc14_21.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %array_type.loc14_22.1: type = array_type %.loc14_21.2, %i32.loc14 [symbolic = %array_type.loc14_22.2 (constants.%array_type.2ec)] +// CHECK:STDOUT: %impl.elem0.loc14_28: %.0a7 = impl_witness_access constants.%ImplicitAs.impl_witness.640, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.dd4] +// CHECK:STDOUT: %bound_method.loc14_28.1: = bound_method %N.ref, %impl.elem0.loc14_28 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound)] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc14_28, @Int.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Int.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_28.2: = bound_method %N.ref, %specific_fn [symbolic = %bound_method.loc14_28.3 (constants.%bound_method)] +// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc14_28.1: init Core.IntLiteral = call %bound_method.loc14_28.2(%N.ref) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc14_28.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %.loc14_28.1: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call.loc14_28.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc14_28.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %.loc14_28.2: Core.IntLiteral = converted %N.ref, %.loc14_28.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc14_28.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %array_type.loc14_29.1: type = array_type %.loc14_28.2, %i32.loc14 [symbolic = %array_type.loc14_29.2 (constants.%array_type.2ec)] // CHECK:STDOUT: } -// CHECK:STDOUT: %k: ref @G.%array_type.loc14_22.2 (%array_type.2ec) = ref_binding k, %k.var +// CHECK:STDOUT: %k: ref @G.%array_type.loc14_29.2 (%array_type.2ec) = ref_binding k, %k.var // CHECK:STDOUT: %impl.elem0.loc14_3.1: @G.%.loc14_3 (%.63e) = impl_witness_access constants.%Destroy.lookup_impl_witness.f5c, element0 [symbolic = %impl.elem0.loc14_3.2 (constants.%impl.elem0.2bf)] // CHECK:STDOUT: %bound_method.loc14_3.1: = bound_method %k.var, %impl.elem0.loc14_3.1 // CHECK:STDOUT: %specific_impl_fn.loc14_3.1: = specific_impl_function %impl.elem0.loc14_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.d1e) [symbolic = %specific_impl_fn.loc14_3.2 (constants.%specific_impl_fn.0a5)] diff --git a/toolchain/check/testdata/eval/call.carbon b/toolchain/check/testdata/eval/call.carbon index c8b90436dd13..0aaf3554eb2f 100644 --- a/toolchain/check/testdata/eval/call.carbon +++ b/toolchain/check/testdata/eval/call.carbon @@ -72,11 +72,11 @@ library "[[@TEST_NAME]]"; eval fn F(x: i32) -> i32 { return x; } fn G(N:! i32) { - // CHECK:STDERR: fail_todo_dependent_call.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] - // CHECK:STDERR: var a: array(i32, F(N)) = (0, 1, 2); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_dependent_call.carbon:[[@LINE+4]]:17: error: cannot evaluate type expression [TypeExprEvaluationFailure] + // CHECK:STDERR: var unused a: array(i32, F(N)) = (0, 1, 2); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: - var a: array(i32, F(N)) = (0, 1, 2); + var unused a: array(i32, F(N)) = (0, 1, 2); } fn H() { G(3); } @@ -92,18 +92,18 @@ eval fn F(_: i32) -> type { fn UseFGenerically(X:! i32) { // CHECK:STDERR: fail_todo_dependent_call_type.carbon:[[@LINE+12]]:3: error: member name of type `` in compound member access is not an instance member or an interface member [CompoundMemberAccessDoesNotUseBase] - // CHECK:STDERR: var v: F(X) = {}; - // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: var unused v: F(X) = {}; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_todo_dependent_call_type.carbon:[[@LINE+8]]:3: error: value of type `` is not callable [CallToNonCallable] - // CHECK:STDERR: var v: F(X) = {}; - // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: var unused v: F(X) = {}; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_todo_dependent_call_type.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.Destroy` in type `` that does not implement that interface [MissingImplInMemberAccess] - // CHECK:STDERR: var v: F(X) = {}; - // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: var unused v: F(X) = {}; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var v: F(X) = {}; + var unused v: F(X) = {}; } fn UseFSpecifically() { diff --git a/toolchain/check/testdata/eval/symbolic.carbon b/toolchain/check/testdata/eval/symbolic.carbon index 7cd0f7b1a88c..776627aa7f95 100644 --- a/toolchain/check/testdata/eval/symbolic.carbon +++ b/toolchain/check/testdata/eval/symbolic.carbon @@ -20,7 +20,7 @@ eval fn F(B:! bool) -> type { } fn G(B:! bool) { - let n: F(B) = ({}, {}); + let unused n: F(B) = ({}, {}); } fn H() { @@ -40,7 +40,7 @@ eval fn F(B:! bool) -> type { } fn G(B:! bool) { - let n: F(B) = ({}, {}); + let unused n: F(B) = ({}, {}); } fn H() { diff --git a/toolchain/check/testdata/facet/access.carbon b/toolchain/check/testdata/facet/access.carbon index 53aabea4c253..2a39482431ac 100644 --- a/toolchain/check/testdata/facet/access.carbon +++ b/toolchain/check/testdata/facet/access.carbon @@ -123,9 +123,9 @@ interface I { fn G() -> X*; } -fn F2[U:! I](V: U*) {} +fn F2[U:! I](unused V: U*) {} -fn F(U:! I where .X = .Self, V: U) { +fn F(U:! I where .X = .Self, unused V: U) { // The returned value of `G` type `U` which has access to the methods of `I`. U.G()->G(); (U as type).G()->G(); @@ -142,10 +142,10 @@ interface I { fn G() -> X*; } -fn F2[U:! I](V: U*) {} -fn F3[U:! I where .X = .Self](V: U*) {} +fn F2[U:! I](unused V: U*) {} +fn F3[U:! I where .X = .Self](unused V: U*) {} -fn F(U:! I where .X = .Self, V: U*) { +fn F(U:! I where .X = .Self, unused V: U*) { // The returned value of `G` type `U` which has access to the methods of `I`. // // TODO: These should work. @@ -184,8 +184,8 @@ fn F(U:! I where .X = .Self, V: U*) { // CHECK:STDERR: F3(U.G()); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_todo_access_through_call.carbon:[[@LINE-40]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn F3[U:! I where .X = .Self](V: U*) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn F3[U:! I where .X = .Self](unused V: U*) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: F3(U.G()); // CHECK:STDERR: fail_todo_access_through_call.carbon:[[@LINE+4]]:6: error: type `.(I.X)` does not support qualified expressions [QualifiedExprUnsupported] @@ -404,7 +404,7 @@ interface Z { // This requires that `SymbolicBindingType` evaluation correctly handles // arbitrary facet value instructions. Not just the common case of `FacetValue` // or `SymbolicBinding`. -fn F1(T:! Y, t: T*) {} +fn F1(T:! Y, unused t: T*) {} fn F2(U:! Z) { F1(U.Y1, U.G()); diff --git a/toolchain/check/testdata/facet/combine.carbon b/toolchain/check/testdata/facet/combine.carbon index 722c0ca55eb2..fe4f8100aea7 100644 --- a/toolchain/check/testdata/facet/combine.carbon +++ b/toolchain/check/testdata/facet/combine.carbon @@ -49,10 +49,10 @@ interface B { class C {} impl C as A {} impl C as B { - fn BB[self: Self]() {} + fn BB[unused self: Self]() {} } -fn G[T:! A & B](t: T) {} +fn G[T:! A & B](unused t: T) {} fn F() { ({} as C).((A & B).BB)(); @@ -76,7 +76,7 @@ class C {} impl C as A(P1) {} impl C as B {} -fn G[T:! A(P1) & B](t: T) {} +fn G[T:! A(P1) & B](unused t: T) {} fn F() { G({} as C); @@ -95,15 +95,15 @@ class C {} impl C as A(P1) {} impl C as B {} -fn G[T:! A(P2) & B](t: T) {} +fn G[T:! A(P2) & B](unused t: T) {} fn F() { // CHECK:STDERR: fail_wrong_generic_interface.carbon:[[@LINE+7]]:3: error: cannot convert type `C` into type implementing `A(P2) & B` [ConversionFailureTypeToFacet] // CHECK:STDERR: G({} as C); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: fail_wrong_generic_interface.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn G[T:! A(P2) & B](t: T) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn G[T:! A(P2) & B](unused t: T) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: G({} as C); } @@ -124,7 +124,7 @@ impl C as Iface {} impl forall [IfaceType:! Iface] C as GenericIface(GenericClass(IfaceType)) {} -fn G[T:! Iface & GenericIface(GenericClass(ImplIface))](t: T) {} +fn G[T:! Iface & GenericIface(GenericClass(ImplIface))](unused t: T) {} fn F() { G({} as C); @@ -134,7 +134,7 @@ fn F() { library "[[@TEST_NAME]]"; class WrapType(T:! type) {} -fn AssertSame[T:! type](a: WrapType(T), b: WrapType(T)) {} +fn AssertSame[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {} fn Type(T:! type) -> WrapType(T) { return {}; } interface I; @@ -171,7 +171,7 @@ fn TestComplete() { library "[[@TEST_NAME]]"; class WrapType(T:! type) {} -fn Same[T:! type](a: WrapType(T), b: WrapType(T)) {} +fn Same[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {} fn Type(T:! type) -> WrapType(T) { return {}; } interface I {} @@ -183,8 +183,8 @@ fn Test() { // CHECK:STDERR: Same(Type(I & J), Type(K & I & J)); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_compare_not_equal.carbon:[[@LINE-11]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Same[T:! type](a: WrapType(T), b: WrapType(T)) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Same[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Same(Type(I & J), Type(K & I & J)); } @@ -193,7 +193,7 @@ fn Test() { library "[[@TEST_NAME]]"; class WrapType(T:! type) {} -fn Same[T:! type](a: WrapType(T), b: WrapType(T)) {} +fn Same[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {} fn Type(T:! type) -> WrapType(T) { return {}; } interface I {} @@ -204,8 +204,8 @@ fn Test() { // CHECK:STDERR: Same(Type(I & J(())), Type(J({}) & I)); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_compare_not_equal_parameterized.carbon:[[@LINE-10]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Same[T:! type](a: WrapType(T), b: WrapType(T)) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Same[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Same(Type(I & J(())), Type(J({}) & I)); } @@ -214,7 +214,7 @@ fn Test() { library "[[@TEST_NAME]]"; class WrapType(T:! type) {} -fn Same[T:! type](a: WrapType(T), b: WrapType(T)) {} +fn Same[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {} fn Type(T:! type) -> WrapType(T) { return {}; } interface I {} @@ -225,8 +225,8 @@ fn Test() { // CHECK:STDERR: Same(Type(I & J(())), Type(J(()) & J({}) & I)); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_compare_not_equal_parameterized_extra.carbon:[[@LINE-10]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Same[T:! type](a: WrapType(T), b: WrapType(T)) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Same[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Same(Type(I & J(())), Type(J(()) & J({}) & I)); } diff --git a/toolchain/check/testdata/facet/convert_class_type_to_facet_type.carbon b/toolchain/check/testdata/facet/convert_class_type_to_facet_type.carbon index c1d22a3cf8c3..ebb66e1c3066 100644 --- a/toolchain/check/testdata/facet/convert_class_type_to_facet_type.carbon +++ b/toolchain/check/testdata/facet/convert_class_type_to_facet_type.carbon @@ -17,7 +17,7 @@ interface Animal {} class Goat {} impl Goat as Animal {} -fn WalkAnimal(A:! Animal) {} +fn WalkAnimal(unused A:! Animal) {} fn F() { WalkAnimal(Goat); @@ -74,7 +74,7 @@ fn F() { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %A.loc20_15.2: %Animal.type = symbolic_binding A, 0 [symbolic = %A.loc20_15.1 (constants.%A)] +// CHECK:STDOUT: %A.loc20_22.2: %Animal.type = symbolic_binding A, 0 [symbolic = %A.loc20_22.1 (constants.%A)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: } @@ -106,8 +106,8 @@ fn F() { // CHECK:STDOUT: .Self = constants.%Goat // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @WalkAnimal(%A.loc20_15.2: %Animal.type) { -// CHECK:STDOUT: %A.loc20_15.1: %Animal.type = symbolic_binding A, 0 [symbolic = %A.loc20_15.1 (constants.%A)] +// CHECK:STDOUT: generic fn @WalkAnimal(%A.loc20_22.2: %Animal.type) { +// CHECK:STDOUT: %A.loc20_22.1: %Animal.type = symbolic_binding A, 0 [symbolic = %A.loc20_22.1 (constants.%A)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -137,11 +137,11 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @WalkAnimal(constants.%A) { -// CHECK:STDOUT: %A.loc20_15.1 => constants.%A +// CHECK:STDOUT: %A.loc20_22.1 => constants.%A // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @WalkAnimal(constants.%Animal.facet) { -// CHECK:STDOUT: %A.loc20_15.1 => constants.%Animal.facet +// CHECK:STDOUT: %A.loc20_22.1 => constants.%Animal.facet // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon b/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon index 14de5b550f0c..4a7c95e15f19 100644 --- a/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon +++ b/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon @@ -27,7 +27,7 @@ impl ImplsGeneric as Generic(GenericParam) { fn F() {} } -fn CallGenericMethod(T:! type, U:! Generic(T)) {} +fn CallGenericMethod(T:! type, unused U:! Generic(T)) {} fn G() { CallGenericMethod(GenericParam, ImplsGeneric); @@ -56,7 +56,7 @@ impl ImplsGeneric as Generic(GenericParam) { fn F() {} } -fn CallGenericMethod[T:! type](U:! Generic(T), t: T) {} +fn CallGenericMethod[T:! type](unused U:! Generic(T), unused t: T) {} fn G() { CallGenericMethod(ImplsGeneric, {} as GenericParam); @@ -96,7 +96,7 @@ fn G() { // CHECK:STDOUT: %Generic.WithSelf.F.1fd: %Generic.WithSelf.F.type.c86 = struct_value () [concrete] // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %Generic.type.03dff7.2: type = facet_type <@Generic, @Generic(%T)> [symbolic] -// CHECK:STDOUT: %U: %Generic.type.03dff7.2 = symbolic_binding U, 1 [symbolic] +// CHECK:STDOUT: %U.0f2266.1: %Generic.type.03dff7.2 = symbolic_binding U, 1 [symbolic] // CHECK:STDOUT: %pattern_type.c49: type = pattern_type %Generic.type.03dff7.2 [symbolic] // CHECK:STDOUT: %CallGenericMethod.type: type = fn_type @CallGenericMethod [concrete] // CHECK:STDOUT: %CallGenericMethod: %CallGenericMethod.type = struct_value () [concrete] @@ -104,6 +104,7 @@ fn G() { // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.cba: type = pattern_type %Generic.type.498 [concrete] // CHECK:STDOUT: %CallGenericMethod.specific_fn.d64: = specific_function %CallGenericMethod, @CallGenericMethod(%GenericParam, %Generic.facet) [concrete] +// CHECK:STDOUT: %U.0f2266.2: %Generic.type.03dff7.2 = symbolic_binding U, 1 [symbolic] // CHECK:STDOUT: %PassThroughToGenericMethod.type: type = fn_type @PassThroughToGenericMethod [concrete] // CHECK:STDOUT: %PassThroughToGenericMethod: %PassThroughToGenericMethod.type = struct_value () [concrete] // CHECK:STDOUT: %Self.15d2d5.2: %Generic.type.03dff7.2 = symbolic_binding Self, 1 [symbolic] @@ -111,7 +112,7 @@ fn G() { // CHECK:STDOUT: %Generic.WithSelf.F.baf95a.2: %Generic.WithSelf.F.type.74390a.2 = struct_value () [symbolic] // CHECK:STDOUT: %Generic.assoc_type.22afda.2: type = assoc_entity_type @Generic, @Generic(%T) [symbolic] // CHECK:STDOUT: %assoc0.e0dc00.2: %Generic.assoc_type.22afda.2 = assoc_entity element0, @Generic.%Generic.WithSelf.F.decl [symbolic] -// CHECK:STDOUT: %CallGenericMethod.specific_fn.6c1: = specific_function %CallGenericMethod, @CallGenericMethod(%T, %U) [symbolic] +// CHECK:STDOUT: %CallGenericMethod.specific_fn.6c1: = specific_function %CallGenericMethod, @CallGenericMethod(%T, %U.0f2266.2) [symbolic] // CHECK:STDOUT: %H.type: type = fn_type @H [concrete] // CHECK:STDOUT: %H: %H.type = struct_value () [concrete] // CHECK:STDOUT: %PassThroughToGenericMethod.specific_fn: = specific_function %PassThroughToGenericMethod, @PassThroughToGenericMethod(%GenericParam, %Generic.facet) [concrete] @@ -156,13 +157,13 @@ fn G() { // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc15_22.2: type = symbolic_binding T, 0 [symbolic = %T.loc15_22.1 (constants.%T)] -// CHECK:STDOUT: %.loc15: type = splice_block %Generic.type.loc15_45.2 [symbolic = %Generic.type.loc15_45.1 (constants.%Generic.type.03dff7.2)] { +// CHECK:STDOUT: %.loc15: type = splice_block %Generic.type.loc15_52.2 [symbolic = %Generic.type.loc15_52.1 (constants.%Generic.type.03dff7.2)] { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Generic.ref: %Generic.type.835 = name_ref Generic, file.%Generic.decl [concrete = constants.%Generic.generic] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc15_22.2 [symbolic = %T.loc15_22.1 (constants.%T)] -// CHECK:STDOUT: %Generic.type.loc15_45.2: type = facet_type <@Generic, @Generic(constants.%T)> [symbolic = %Generic.type.loc15_45.1 (constants.%Generic.type.03dff7.2)] +// CHECK:STDOUT: %Generic.type.loc15_52.2: type = facet_type <@Generic, @Generic(constants.%T)> [symbolic = %Generic.type.loc15_52.1 (constants.%Generic.type.03dff7.2)] // CHECK:STDOUT: } -// CHECK:STDOUT: %U.loc15_32.2: @CallGenericMethod.%Generic.type.loc15_45.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc15_32.1 (constants.%U)] +// CHECK:STDOUT: %U.loc15_39.2: @CallGenericMethod.%Generic.type.loc15_52.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc15_39.1 (constants.%U.0f2266.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {} // CHECK:STDOUT: %PassThroughToGenericMethod.decl: %PassThroughToGenericMethod.type = fn_decl @PassThroughToGenericMethod [concrete = constants.%PassThroughToGenericMethod] { @@ -177,7 +178,7 @@ fn G() { // CHECK:STDOUT: %T.ref.loc21: type = name_ref T, %T.loc21_31.2 [symbolic = %T.loc21_31.1 (constants.%T)] // CHECK:STDOUT: %Generic.type.loc21_54.2: type = facet_type <@Generic, @Generic(constants.%T)> [symbolic = %Generic.type.loc21_54.1 (constants.%Generic.type.03dff7.2)] // CHECK:STDOUT: } -// CHECK:STDOUT: %U.loc21_41.2: @PassThroughToGenericMethod.%Generic.type.loc21_54.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc21_41.1 (constants.%U)] +// CHECK:STDOUT: %U.loc21_41.2: @PassThroughToGenericMethod.%Generic.type.loc21_54.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc21_41.1 (constants.%U.0f2266.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [concrete = constants.%H] {} {} // CHECK:STDOUT: } @@ -241,11 +242,11 @@ fn G() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @CallGenericMethod(%T.loc15_22.2: type, %U.loc15_32.2: @CallGenericMethod.%Generic.type.loc15_45.1 (%Generic.type.03dff7.2)) { +// CHECK:STDOUT: generic fn @CallGenericMethod(%T.loc15_22.2: type, %U.loc15_39.2: @CallGenericMethod.%Generic.type.loc15_52.1 (%Generic.type.03dff7.2)) { // CHECK:STDOUT: %T.loc15_22.1: type = symbolic_binding T, 0 [symbolic = %T.loc15_22.1 (constants.%T)] -// CHECK:STDOUT: %Generic.type.loc15_45.1: type = facet_type <@Generic, @Generic(%T.loc15_22.1)> [symbolic = %Generic.type.loc15_45.1 (constants.%Generic.type.03dff7.2)] -// CHECK:STDOUT: %U.loc15_32.1: @CallGenericMethod.%Generic.type.loc15_45.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc15_32.1 (constants.%U)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Generic.type.loc15_45.1 [symbolic = %pattern_type (constants.%pattern_type.c49)] +// CHECK:STDOUT: %Generic.type.loc15_52.1: type = facet_type <@Generic, @Generic(%T.loc15_22.1)> [symbolic = %Generic.type.loc15_52.1 (constants.%Generic.type.03dff7.2)] +// CHECK:STDOUT: %U.loc15_39.1: @CallGenericMethod.%Generic.type.loc15_52.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc15_39.1 (constants.%U.0f2266.1)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Generic.type.loc15_52.1 [symbolic = %pattern_type (constants.%pattern_type.c49)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -270,7 +271,7 @@ fn G() { // CHECK:STDOUT: generic fn @PassThroughToGenericMethod(%T.loc21_31.2: type, %U.loc21_41.2: @PassThroughToGenericMethod.%Generic.type.loc21_54.1 (%Generic.type.03dff7.2)) { // CHECK:STDOUT: %T.loc21_31.1: type = symbolic_binding T, 0 [symbolic = %T.loc21_31.1 (constants.%T)] // CHECK:STDOUT: %Generic.type.loc21_54.1: type = facet_type <@Generic, @Generic(%T.loc21_31.1)> [symbolic = %Generic.type.loc21_54.1 (constants.%Generic.type.03dff7.2)] -// CHECK:STDOUT: %U.loc21_41.1: @PassThroughToGenericMethod.%Generic.type.loc21_54.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc21_41.1 (constants.%U)] +// CHECK:STDOUT: %U.loc21_41.1: @PassThroughToGenericMethod.%Generic.type.loc21_54.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc21_41.1 (constants.%U.0f2266.2)] // CHECK:STDOUT: %pattern_type: type = pattern_type %Generic.type.loc21_54.1 [symbolic = %pattern_type (constants.%pattern_type.c49)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -280,8 +281,8 @@ fn G() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %CallGenericMethod.ref: %CallGenericMethod.type = name_ref CallGenericMethod, file.%CallGenericMethod.decl [concrete = constants.%CallGenericMethod] // CHECK:STDOUT: %T.ref.loc22: type = name_ref T, %T.loc21_31.2 [symbolic = %T.loc21_31.1 (constants.%T)] -// CHECK:STDOUT: %U.ref: @PassThroughToGenericMethod.%Generic.type.loc21_54.1 (%Generic.type.03dff7.2) = name_ref U, %U.loc21_41.2 [symbolic = %U.loc21_41.1 (constants.%U)] -// CHECK:STDOUT: %CallGenericMethod.specific_fn.loc22_3.1: = specific_function %CallGenericMethod.ref, @CallGenericMethod(constants.%T, constants.%U) [symbolic = %CallGenericMethod.specific_fn.loc22_3.2 (constants.%CallGenericMethod.specific_fn.6c1)] +// CHECK:STDOUT: %U.ref: @PassThroughToGenericMethod.%Generic.type.loc21_54.1 (%Generic.type.03dff7.2) = name_ref U, %U.loc21_41.2 [symbolic = %U.loc21_41.1 (constants.%U.0f2266.2)] +// CHECK:STDOUT: %CallGenericMethod.specific_fn.loc22_3.1: = specific_function %CallGenericMethod.ref, @CallGenericMethod(constants.%T, constants.%U.0f2266.2) [symbolic = %CallGenericMethod.specific_fn.loc22_3.2 (constants.%CallGenericMethod.specific_fn.6c1)] // CHECK:STDOUT: %CallGenericMethod.call: init %empty_tuple.type = call %CallGenericMethod.specific_fn.loc22_3.1() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -347,28 +348,26 @@ fn G() { // CHECK:STDOUT: %Self.loc4_34.2 => constants.%Self.15d2d5.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @CallGenericMethod(constants.%T, constants.%U) { +// CHECK:STDOUT: specific @CallGenericMethod(constants.%T, constants.%U.0f2266.1) { // CHECK:STDOUT: %T.loc15_22.1 => constants.%T -// CHECK:STDOUT: %Generic.type.loc15_45.1 => constants.%Generic.type.03dff7.2 -// CHECK:STDOUT: %U.loc15_32.1 => constants.%U +// CHECK:STDOUT: %Generic.type.loc15_52.1 => constants.%Generic.type.03dff7.2 +// CHECK:STDOUT: %U.loc15_39.1 => constants.%U.0f2266.1 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c49 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CallGenericMethod(constants.%GenericParam, constants.%Generic.facet) { // CHECK:STDOUT: %T.loc15_22.1 => constants.%GenericParam -// CHECK:STDOUT: %Generic.type.loc15_45.1 => constants.%Generic.type.498 -// CHECK:STDOUT: %U.loc15_32.1 => constants.%Generic.facet +// CHECK:STDOUT: %Generic.type.loc15_52.1 => constants.%Generic.type.498 +// CHECK:STDOUT: %U.loc15_39.1 => constants.%Generic.facet // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cba // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @PassThroughToGenericMethod(constants.%T, constants.%U) { +// CHECK:STDOUT: specific @PassThroughToGenericMethod(constants.%T, constants.%U.0f2266.2) { // CHECK:STDOUT: %T.loc21_31.1 => constants.%T // CHECK:STDOUT: %Generic.type.loc21_54.1 => constants.%Generic.type.03dff7.2 -// CHECK:STDOUT: %U.loc21_41.1 => constants.%U +// CHECK:STDOUT: %U.loc21_41.1 => constants.%U.0f2266.2 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c49 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -383,6 +382,15 @@ fn G() { // CHECK:STDOUT: %assoc0.loc5_9.2 => constants.%assoc0.e0dc00.2 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @CallGenericMethod(constants.%T, constants.%U.0f2266.2) { +// CHECK:STDOUT: %T.loc15_22.1 => constants.%T +// CHECK:STDOUT: %Generic.type.loc15_52.1 => constants.%Generic.type.03dff7.2 +// CHECK:STDOUT: %U.loc15_39.1 => constants.%U.0f2266.2 +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.c49 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @PassThroughToGenericMethod(constants.%GenericParam, constants.%Generic.facet) { // CHECK:STDOUT: %T.loc21_31.1 => constants.%GenericParam // CHECK:STDOUT: %Generic.type.loc21_54.1 => constants.%Generic.type.498 @@ -480,21 +488,21 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: %CallGenericMethod.decl: %CallGenericMethod.type = fn_decl @CallGenericMethod [concrete = constants.%CallGenericMethod] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] -// CHECK:STDOUT: %U.patt: @CallGenericMethod.%pattern_type.loc15_32 (%pattern_type.c49) = symbolic_binding_pattern U, 1 [concrete] -// CHECK:STDOUT: %t.patt: @CallGenericMethod.%pattern_type.loc15_48 (%pattern_type.51d) = value_binding_pattern t [concrete] -// CHECK:STDOUT: %t.param_patt: @CallGenericMethod.%pattern_type.loc15_48 (%pattern_type.51d) = value_param_pattern %t.patt, call_param0 [concrete] +// CHECK:STDOUT: %U.patt: @CallGenericMethod.%pattern_type.loc15_39 (%pattern_type.c49) = symbolic_binding_pattern U, 1 [concrete] +// CHECK:STDOUT: %t.patt: @CallGenericMethod.%pattern_type.loc15_62 (%pattern_type.51d) = value_binding_pattern t [concrete] +// CHECK:STDOUT: %t.param_patt: @CallGenericMethod.%pattern_type.loc15_62 (%pattern_type.51d) = value_param_pattern %t.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc15_22.2: type = symbolic_binding T, 0 [symbolic = %T.loc15_22.1 (constants.%T)] -// CHECK:STDOUT: %.loc15: type = splice_block %Generic.type.loc15_45.2 [symbolic = %Generic.type.loc15_45.1 (constants.%Generic.type.03dff7.2)] { +// CHECK:STDOUT: %.loc15: type = splice_block %Generic.type.loc15_52.2 [symbolic = %Generic.type.loc15_52.1 (constants.%Generic.type.03dff7.2)] { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Generic.ref: %Generic.type.835 = name_ref Generic, file.%Generic.decl [concrete = constants.%Generic.generic] -// CHECK:STDOUT: %T.ref.loc15_44: type = name_ref T, %T.loc15_22.2 [symbolic = %T.loc15_22.1 (constants.%T)] -// CHECK:STDOUT: %Generic.type.loc15_45.2: type = facet_type <@Generic, @Generic(constants.%T)> [symbolic = %Generic.type.loc15_45.1 (constants.%Generic.type.03dff7.2)] +// CHECK:STDOUT: %T.ref.loc15_51: type = name_ref T, %T.loc15_22.2 [symbolic = %T.loc15_22.1 (constants.%T)] +// CHECK:STDOUT: %Generic.type.loc15_52.2: type = facet_type <@Generic, @Generic(constants.%T)> [symbolic = %Generic.type.loc15_52.1 (constants.%Generic.type.03dff7.2)] // CHECK:STDOUT: } -// CHECK:STDOUT: %U.loc15_32.2: @CallGenericMethod.%Generic.type.loc15_45.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc15_32.1 (constants.%U)] +// CHECK:STDOUT: %U.loc15_39.2: @CallGenericMethod.%Generic.type.loc15_52.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc15_39.1 (constants.%U)] // CHECK:STDOUT: %t.param: @CallGenericMethod.%T.loc15_22.1 (%T) = value_param call_param0 -// CHECK:STDOUT: %T.ref.loc15_51: type = name_ref T, %T.loc15_22.2 [symbolic = %T.loc15_22.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc15_65: type = name_ref T, %T.loc15_22.2 [symbolic = %T.loc15_22.1 (constants.%T)] // CHECK:STDOUT: %t: @CallGenericMethod.%T.loc15_22.1 (%T) = value_binding t, %t.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {} @@ -559,12 +567,12 @@ fn G() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @CallGenericMethod(%T.loc15_22.2: type, %U.loc15_32.2: @CallGenericMethod.%Generic.type.loc15_45.1 (%Generic.type.03dff7.2)) { +// CHECK:STDOUT: generic fn @CallGenericMethod(%T.loc15_22.2: type, %U.loc15_39.2: @CallGenericMethod.%Generic.type.loc15_52.1 (%Generic.type.03dff7.2)) { // CHECK:STDOUT: %T.loc15_22.1: type = symbolic_binding T, 0 [symbolic = %T.loc15_22.1 (constants.%T)] -// CHECK:STDOUT: %Generic.type.loc15_45.1: type = facet_type <@Generic, @Generic(%T.loc15_22.1)> [symbolic = %Generic.type.loc15_45.1 (constants.%Generic.type.03dff7.2)] -// CHECK:STDOUT: %U.loc15_32.1: @CallGenericMethod.%Generic.type.loc15_45.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc15_32.1 (constants.%U)] -// CHECK:STDOUT: %pattern_type.loc15_32: type = pattern_type %Generic.type.loc15_45.1 [symbolic = %pattern_type.loc15_32 (constants.%pattern_type.c49)] -// CHECK:STDOUT: %pattern_type.loc15_48: type = pattern_type %T.loc15_22.1 [symbolic = %pattern_type.loc15_48 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %Generic.type.loc15_52.1: type = facet_type <@Generic, @Generic(%T.loc15_22.1)> [symbolic = %Generic.type.loc15_52.1 (constants.%Generic.type.03dff7.2)] +// CHECK:STDOUT: %U.loc15_39.1: @CallGenericMethod.%Generic.type.loc15_52.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc15_39.1 (constants.%U)] +// CHECK:STDOUT: %pattern_type.loc15_39: type = pattern_type %Generic.type.loc15_52.1 [symbolic = %pattern_type.loc15_39 (constants.%pattern_type.c49)] +// CHECK:STDOUT: %pattern_type.loc15_62: type = pattern_type %T.loc15_22.1 [symbolic = %pattern_type.loc15_62 (constants.%pattern_type.51d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T.loc15_22.1 [symbolic = %require_complete (constants.%require_complete)] @@ -643,18 +651,18 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @CallGenericMethod(constants.%T, constants.%U) { // CHECK:STDOUT: %T.loc15_22.1 => constants.%T -// CHECK:STDOUT: %Generic.type.loc15_45.1 => constants.%Generic.type.03dff7.2 -// CHECK:STDOUT: %U.loc15_32.1 => constants.%U -// CHECK:STDOUT: %pattern_type.loc15_32 => constants.%pattern_type.c49 -// CHECK:STDOUT: %pattern_type.loc15_48 => constants.%pattern_type.51d +// CHECK:STDOUT: %Generic.type.loc15_52.1 => constants.%Generic.type.03dff7.2 +// CHECK:STDOUT: %U.loc15_39.1 => constants.%U +// CHECK:STDOUT: %pattern_type.loc15_39 => constants.%pattern_type.c49 +// CHECK:STDOUT: %pattern_type.loc15_62 => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CallGenericMethod(constants.%GenericParam, constants.%Generic.facet) { // CHECK:STDOUT: %T.loc15_22.1 => constants.%GenericParam -// CHECK:STDOUT: %Generic.type.loc15_45.1 => constants.%Generic.type.498 -// CHECK:STDOUT: %U.loc15_32.1 => constants.%Generic.facet -// CHECK:STDOUT: %pattern_type.loc15_32 => constants.%pattern_type.cba -// CHECK:STDOUT: %pattern_type.loc15_48 => constants.%pattern_type.27a +// CHECK:STDOUT: %Generic.type.loc15_52.1 => constants.%Generic.type.498 +// CHECK:STDOUT: %U.loc15_39.1 => constants.%Generic.facet +// CHECK:STDOUT: %pattern_type.loc15_39 => constants.%pattern_type.cba +// CHECK:STDOUT: %pattern_type.loc15_62 => constants.%pattern_type.27a // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type diff --git a/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon b/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon index 030977ad8b02..c5506ec282ae 100644 --- a/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon +++ b/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon @@ -14,7 +14,7 @@ interface Animal {} -fn WalkAnimal[T:! Animal](a: T) {} +fn WalkAnimal[T:! Animal](unused a: T) {} class Goat {} impl Goat as Animal {} @@ -84,10 +84,10 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc17_15.2: %Animal.type = symbolic_binding T, 0 [symbolic = %T.loc17_15.1 (constants.%T)] // CHECK:STDOUT: %a.param: @WalkAnimal.%T.binding.as_type (%T.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc17_30.1: type = splice_block %.loc17_30.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { +// CHECK:STDOUT: %.loc17_37.1: type = splice_block %.loc17_37.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { // CHECK:STDOUT: %T.ref: %Animal.type = name_ref T, %T.loc17_15.2 [symbolic = %T.loc17_15.1 (constants.%T)] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc17_30.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc17_37.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %a: @WalkAnimal.%T.binding.as_type (%T.binding.as_type) = value_binding a, %a.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon b/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon index 14df347fdc0b..c9677e357e72 100644 --- a/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon +++ b/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon @@ -27,7 +27,7 @@ impl ImplsGeneric as Generic(GenericParam) { fn F() {} } -fn CallGenericMethod[T:! type, U:! Generic(T)](a: U, s: T) { +fn CallGenericMethod[T:! type, U:! Generic(T)](unused a: U, unused s: T) { U.F(); } @@ -44,7 +44,7 @@ class C {} impl forall [T:! type] C as I(T, ()) {} -fn A[T:! I({}, ())](t: T) {} +fn A[T:! I({}, ())](unused t: T) {} fn B() { A({} as C); @@ -59,15 +59,15 @@ class C {} impl forall [T:! type] C as I(T, ()) {} -fn A[T:! I({}, {})](t: T) {} +fn A[T:! I({}, {})](unused t: T) {} fn B() { // CHECK:STDERR: fail_mismatch_impl_constraint_with_fixed_specific.carbon:[[@LINE+7]]:3: error: cannot convert type `C` into type implementing `I({}, {})` [ConversionFailureTypeToFacet] // CHECK:STDERR: A({} as C); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: fail_mismatch_impl_constraint_with_fixed_specific.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn A[T:! I({}, {})](t: T) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn A[T:! I({}, {})](unused t: T) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: A({} as C); } @@ -81,15 +81,15 @@ class C(V:! type, W:! type) {} impl forall [T:! type] C(T, ()) as I {} -fn A[T:! I](t: T) {} +fn A[T:! I](unused t: T) {} fn B() { // CHECK:STDERR: fail_mismatch_impl_self_with_fixed_specific.carbon:[[@LINE+7]]:3: error: cannot convert type `C({}, {})` into type implementing `I` [ConversionFailureTypeToFacet] // CHECK:STDERR: A({} as C({}, {})); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_mismatch_impl_self_with_fixed_specific.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn A[T:! I](t: T) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn A[T:! I](unused t: T) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: A({} as C({}, {})); } @@ -203,10 +203,10 @@ fn B() { // CHECK:STDOUT: %CallGenericMethod.decl: %CallGenericMethod.type = fn_decl @CallGenericMethod [concrete = constants.%CallGenericMethod] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %U.patt: @CallGenericMethod.%pattern_type.loc15_32 (%pattern_type.c49) = symbolic_binding_pattern U, 1 [concrete] -// CHECK:STDOUT: %a.patt: @CallGenericMethod.%pattern_type.loc15_48 (%pattern_type.46f) = value_binding_pattern a [concrete] -// CHECK:STDOUT: %a.param_patt: @CallGenericMethod.%pattern_type.loc15_48 (%pattern_type.46f) = value_param_pattern %a.patt, call_param0 [concrete] -// CHECK:STDOUT: %s.patt: @CallGenericMethod.%pattern_type.loc15_54 (%pattern_type.51d) = value_binding_pattern s [concrete] -// CHECK:STDOUT: %s.param_patt: @CallGenericMethod.%pattern_type.loc15_54 (%pattern_type.51d) = value_param_pattern %s.patt, call_param1 [concrete] +// CHECK:STDOUT: %a.patt: @CallGenericMethod.%pattern_type.loc15_55 (%pattern_type.46f) = value_binding_pattern a [concrete] +// CHECK:STDOUT: %a.param_patt: @CallGenericMethod.%pattern_type.loc15_55 (%pattern_type.46f) = value_param_pattern %a.patt, call_param0 [concrete] +// CHECK:STDOUT: %s.patt: @CallGenericMethod.%pattern_type.loc15_68 (%pattern_type.51d) = value_binding_pattern s [concrete] +// CHECK:STDOUT: %s.param_patt: @CallGenericMethod.%pattern_type.loc15_68 (%pattern_type.51d) = value_param_pattern %s.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc15_22.2: type = symbolic_binding T, 0 [symbolic = %T.loc15_22.1 (constants.%T)] @@ -218,14 +218,14 @@ fn B() { // CHECK:STDOUT: } // CHECK:STDOUT: %U.loc15_32.2: @CallGenericMethod.%Generic.type.loc15_45.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc15_32.1 (constants.%U)] // CHECK:STDOUT: %a.param: @CallGenericMethod.%U.binding.as_type (%U.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc15_51.1: type = splice_block %.loc15_51.2 [symbolic = %U.binding.as_type (constants.%U.binding.as_type)] { +// CHECK:STDOUT: %.loc15_58.1: type = splice_block %.loc15_58.2 [symbolic = %U.binding.as_type (constants.%U.binding.as_type)] { // CHECK:STDOUT: %U.ref.loc15: @CallGenericMethod.%Generic.type.loc15_45.1 (%Generic.type.03dff7.2) = name_ref U, %U.loc15_32.2 [symbolic = %U.loc15_32.1 (constants.%U)] // CHECK:STDOUT: %U.as_type.loc15: type = facet_access_type %U.ref.loc15 [symbolic = %U.binding.as_type (constants.%U.binding.as_type)] -// CHECK:STDOUT: %.loc15_51.2: type = converted %U.ref.loc15, %U.as_type.loc15 [symbolic = %U.binding.as_type (constants.%U.binding.as_type)] +// CHECK:STDOUT: %.loc15_58.2: type = converted %U.ref.loc15, %U.as_type.loc15 [symbolic = %U.binding.as_type (constants.%U.binding.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %a: @CallGenericMethod.%U.binding.as_type (%U.binding.as_type) = value_binding a, %a.param // CHECK:STDOUT: %s.param: @CallGenericMethod.%T.loc15_22.1 (%T) = value_param call_param1 -// CHECK:STDOUT: %T.ref.loc15_57: type = name_ref T, %T.loc15_22.2 [symbolic = %T.loc15_22.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc15_71: type = name_ref T, %T.loc15_22.2 [symbolic = %T.loc15_22.1 (constants.%T)] // CHECK:STDOUT: %s: @CallGenericMethod.%T.loc15_22.1 (%T) = value_binding s, %s.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {} @@ -296,12 +296,12 @@ fn B() { // CHECK:STDOUT: %U.loc15_32.1: @CallGenericMethod.%Generic.type.loc15_45.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc15_32.1 (constants.%U)] // CHECK:STDOUT: %pattern_type.loc15_32: type = pattern_type %Generic.type.loc15_45.1 [symbolic = %pattern_type.loc15_32 (constants.%pattern_type.c49)] // CHECK:STDOUT: %U.binding.as_type: type = symbolic_binding_type U, 1, %U.loc15_32.1 [symbolic = %U.binding.as_type (constants.%U.binding.as_type)] -// CHECK:STDOUT: %pattern_type.loc15_48: type = pattern_type %U.binding.as_type [symbolic = %pattern_type.loc15_48 (constants.%pattern_type.46f)] -// CHECK:STDOUT: %pattern_type.loc15_54: type = pattern_type %T.loc15_22.1 [symbolic = %pattern_type.loc15_54 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %pattern_type.loc15_55: type = pattern_type %U.binding.as_type [symbolic = %pattern_type.loc15_55 (constants.%pattern_type.46f)] +// CHECK:STDOUT: %pattern_type.loc15_68: type = pattern_type %T.loc15_22.1 [symbolic = %pattern_type.loc15_68 (constants.%pattern_type.51d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc15_49: = require_complete_type %U.binding.as_type [symbolic = %require_complete.loc15_49 (constants.%require_complete.186)] -// CHECK:STDOUT: %require_complete.loc15_55: = require_complete_type %T.loc15_22.1 [symbolic = %require_complete.loc15_55 (constants.%require_complete.944)] +// CHECK:STDOUT: %require_complete.loc15_56: = require_complete_type %U.binding.as_type [symbolic = %require_complete.loc15_56 (constants.%require_complete.186)] +// CHECK:STDOUT: %require_complete.loc15_69: = require_complete_type %T.loc15_22.1 [symbolic = %require_complete.loc15_69 (constants.%require_complete.944)] // CHECK:STDOUT: %require_complete.loc16: = require_complete_type %Generic.type.loc15_45.1 [symbolic = %require_complete.loc16 (constants.%require_complete.7da)] // CHECK:STDOUT: %Generic.assoc_type: type = assoc_entity_type @Generic, @Generic(%T.loc15_22.1) [symbolic = %Generic.assoc_type (constants.%Generic.assoc_type.22afda.2)] // CHECK:STDOUT: %assoc0: @CallGenericMethod.%Generic.assoc_type (%Generic.assoc_type.22afda.2) = assoc_entity element0, @Generic.%Generic.WithSelf.F.decl [symbolic = %assoc0 (constants.%assoc0.e0dc00.2)] @@ -422,8 +422,8 @@ fn B() { // CHECK:STDOUT: %U.loc15_32.1 => constants.%U // CHECK:STDOUT: %pattern_type.loc15_32 => constants.%pattern_type.c49 // CHECK:STDOUT: %U.binding.as_type => constants.%U.binding.as_type -// CHECK:STDOUT: %pattern_type.loc15_48 => constants.%pattern_type.46f -// CHECK:STDOUT: %pattern_type.loc15_54 => constants.%pattern_type.51d +// CHECK:STDOUT: %pattern_type.loc15_55 => constants.%pattern_type.46f +// CHECK:STDOUT: %pattern_type.loc15_68 => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%T, constants.%U) { @@ -445,12 +445,12 @@ fn B() { // CHECK:STDOUT: %U.loc15_32.1 => constants.%Generic.facet // CHECK:STDOUT: %pattern_type.loc15_32 => constants.%pattern_type.cba // CHECK:STDOUT: %U.binding.as_type => constants.%ImplsGeneric -// CHECK:STDOUT: %pattern_type.loc15_48 => constants.%pattern_type.4da -// CHECK:STDOUT: %pattern_type.loc15_54 => constants.%pattern_type.27a +// CHECK:STDOUT: %pattern_type.loc15_55 => constants.%pattern_type.4da +// CHECK:STDOUT: %pattern_type.loc15_68 => constants.%pattern_type.27a // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc15_49 => constants.%complete_type.357 -// CHECK:STDOUT: %require_complete.loc15_55 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc15_56 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc15_69 => constants.%complete_type.357 // CHECK:STDOUT: %require_complete.loc16 => constants.%complete_type.57a // CHECK:STDOUT: %Generic.assoc_type => constants.%Generic.assoc_type.6dc // CHECK:STDOUT: %assoc0 => constants.%assoc0.717 @@ -563,10 +563,10 @@ fn B() { // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc9_6.2: %I.type.5f7 = symbolic_binding T, 0 [symbolic = %T.loc9_6.1 (constants.%T.bc3)] // CHECK:STDOUT: %t.param: @A.%T.binding.as_type (%T.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc9_24.1: type = splice_block %.loc9_24.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { +// CHECK:STDOUT: %.loc9_31.1: type = splice_block %.loc9_31.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { // CHECK:STDOUT: %T.ref: %I.type.5f7 = name_ref T, %T.loc9_6.2 [symbolic = %T.loc9_6.1 (constants.%T.bc3)] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc9_24.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc9_31.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %t: @A.%T.binding.as_type (%T.binding.as_type) = value_binding t, %t.param // CHECK:STDOUT: } @@ -819,10 +819,10 @@ fn B() { // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc9_6.2: %I.type.7b9 = symbolic_binding T, 0 [symbolic = %T.loc9_6.1 (constants.%T.274)] // CHECK:STDOUT: %t.param: @A.%T.binding.as_type (%T.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc9_24.1: type = splice_block %.loc9_24.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { +// CHECK:STDOUT: %.loc9_31.1: type = splice_block %.loc9_31.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { // CHECK:STDOUT: %T.ref: %I.type.7b9 = name_ref T, %T.loc9_6.2 [symbolic = %T.loc9_6.1 (constants.%T.274)] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc9_24.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc9_31.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %t: @A.%T.binding.as_type (%T.binding.as_type) = value_binding t, %t.param // CHECK:STDOUT: } @@ -1042,10 +1042,10 @@ fn B() { // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc9_6.2: %I.type = symbolic_binding T, 0 [symbolic = %T.loc9_6.1 (constants.%T.651)] // CHECK:STDOUT: %t.param: @A.%T.binding.as_type (%T.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc9_16.1: type = splice_block %.loc9_16.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { +// CHECK:STDOUT: %.loc9_23.1: type = splice_block %.loc9_23.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { // CHECK:STDOUT: %T.ref: %I.type = name_ref T, %T.loc9_6.2 [symbolic = %T.loc9_6.1 (constants.%T.651)] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc9_16.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc9_23.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %t: @A.%T.binding.as_type (%T.binding.as_type) = value_binding t, %t.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/facet/convert_facet_type_to_facet_value.carbon b/toolchain/check/testdata/facet/convert_facet_type_to_facet_value.carbon index feefd8663e06..3a1e6d19353d 100644 --- a/toolchain/check/testdata/facet/convert_facet_type_to_facet_value.carbon +++ b/toolchain/check/testdata/facet/convert_facet_type_to_facet_value.carbon @@ -20,8 +20,7 @@ interface Animal {} // https://github.com/carbon-language/carbon-lang/issues/4853 impl Animal as Eats {} -fn Feed(e:! Eats) {} - +fn Feed(unused e:! Eats) {} fn F() { Feed(Animal); } @@ -36,8 +35,7 @@ interface Animal {} // https://github.com/carbon-language/carbon-lang/issues/4853 impl Animal as Eats {} -fn Feed(e:! Eats) {} - +fn Feed(unused e:! Eats) {} class Goat {} impl Goat as Animal {} @@ -45,9 +43,9 @@ fn F() { // CHECK:STDERR: fail_facet_value_to_facet_type.carbon:[[@LINE+7]]:3: error: cannot convert type `Goat as Animal` that implements `Animal` into type implementing `Eats` [ConversionFailureFacetToFacet] // CHECK:STDERR: Feed(Goat as Animal); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_facet_value_to_facet_type.carbon:[[@LINE-9]]:9: note: initializing generic parameter `e` declared here [InitializingGenericParam] - // CHECK:STDERR: fn Feed(e:! Eats) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_facet_value_to_facet_type.carbon:[[@LINE-8]]:16: note: initializing generic parameter `e` declared here [InitializingGenericParam] + // CHECK:STDERR: fn Feed(unused e:! Eats) {} + // CHECK:STDERR: ^ // CHECK:STDERR: Feed(Goat as Animal); } @@ -63,8 +61,7 @@ interface Climbs {} // https://github.com/carbon-language/carbon-lang/issues/4853 impl Animal as Eats {} -fn Feed(e:! Eats) {} - +fn Feed(unused e:! Eats) {} class Goat {} impl Goat as Animal {} impl Goat as Climbs {} @@ -75,18 +72,18 @@ fn F() { // CHECK:STDERR: fail_convert_multi_interface_facet_value_to_facet_value.carbon:[[@LINE+7]]:3: error: cannot convert type `Goat as Animal & Climbs` that implements `Animal & Climbs` into type implementing `Eats` [ConversionFailureFacetToFacet] // CHECK:STDERR: Feed(Goat as (Animal & Climbs)); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_convert_multi_interface_facet_value_to_facet_value.carbon:[[@LINE-12]]:9: note: initializing generic parameter `e` declared here [InitializingGenericParam] - // CHECK:STDERR: fn Feed(e:! Eats) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_convert_multi_interface_facet_value_to_facet_value.carbon:[[@LINE-11]]:16: note: initializing generic parameter `e` declared here [InitializingGenericParam] + // CHECK:STDERR: fn Feed(unused e:! Eats) {} + // CHECK:STDERR: ^ // CHECK:STDERR: Feed(Goat as (Animal & Climbs)); // CHECK:STDERR: fail_convert_multi_interface_facet_value_to_facet_value.carbon:[[@LINE+7]]:3: error: cannot convert type `Animal & Climbs` into type implementing `Eats` [ConversionFailureTypeToFacet] // CHECK:STDERR: Feed(Animal & Climbs); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_convert_multi_interface_facet_value_to_facet_value.carbon:[[@LINE-21]]:9: note: initializing generic parameter `e` declared here [InitializingGenericParam] - // CHECK:STDERR: fn Feed(e:! Eats) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_convert_multi_interface_facet_value_to_facet_value.carbon:[[@LINE-20]]:16: note: initializing generic parameter `e` declared here [InitializingGenericParam] + // CHECK:STDERR: fn Feed(unused e:! Eats) {} + // CHECK:STDERR: ^ // CHECK:STDERR: Feed(Animal & Climbs); } diff --git a/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon b/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon index 68a5bc8eda7b..1d60539592d5 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon @@ -21,7 +21,7 @@ class Goat {} impl Goat as Animal {} impl Goat as Eats {} -fn Feed(e:! Eats) {} +fn Feed(unused e:! Eats) {} fn F() { //@dump-sem-ir-begin @@ -83,7 +83,7 @@ class C(A:! J, B:! A) {} // referring to the same symbolic type and with the same facet type. // Essentially, it allows lossless round trips through a FacetAccessType when // converting back to the type of its original facet value. -fn G[A:! J, B:! A](x: C(A, B)) {} +fn G[A:! J, B:! A](unused x: C(A, B)) {} fn F[A:! J, B:! A](x: C(A, B)) { //@dump-sem-ir-begin diff --git a/toolchain/check/testdata/facet/convert_facet_value_to_facet_value.carbon b/toolchain/check/testdata/facet/convert_facet_value_to_facet_value.carbon index 15ca1d2382b7..5ee78336f71f 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_to_facet_value.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_to_facet_value.carbon @@ -20,7 +20,7 @@ class C {} impl C as Z {} impl C as Y {} -fn G(z:! Z) {} +fn G(unused z:! Z) {} fn F() { G(C); diff --git a/toolchain/check/testdata/facet/convert_facet_value_to_itself.carbon b/toolchain/check/testdata/facet/convert_facet_value_to_itself.carbon index 132fa50635b5..1ed78e50a464 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_to_itself.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_to_itself.carbon @@ -14,7 +14,7 @@ interface Animal {} -fn FeedAnimal(T:! Animal) {} +fn FeedAnimal(unused T:! Animal) {} fn HandleAnimal(T:! Animal) { FeedAnimal(T); } @@ -32,14 +32,15 @@ fn F() { // CHECK:STDOUT: %Self: %Animal.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %T: %Animal.type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %T.99815a.1: %Animal.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type: type = pattern_type %Animal.type [concrete] // CHECK:STDOUT: %FeedAnimal.type: type = fn_type @FeedAnimal [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %FeedAnimal: %FeedAnimal.type = struct_value () [concrete] +// CHECK:STDOUT: %T.99815a.2: %Animal.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %HandleAnimal.type: type = fn_type @HandleAnimal [concrete] // CHECK:STDOUT: %HandleAnimal: %HandleAnimal.type = struct_value () [concrete] -// CHECK:STDOUT: %FeedAnimal.specific_fn.ae9: = specific_function %FeedAnimal, @FeedAnimal(%T) [symbolic] +// CHECK:STDOUT: %FeedAnimal.specific_fn.ae9: = specific_function %FeedAnimal, @FeedAnimal(%T.99815a.2) [symbolic] // CHECK:STDOUT: %Goat: type = class_type @Goat [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] @@ -76,7 +77,7 @@ fn F() { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc17_15.2: %Animal.type = symbolic_binding T, 0 [symbolic = %T.loc17_15.1 (constants.%T)] +// CHECK:STDOUT: %T.loc17_22.2: %Animal.type = symbolic_binding T, 0 [symbolic = %T.loc17_22.1 (constants.%T.99815a.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %HandleAnimal.decl: %HandleAnimal.type = fn_decl @HandleAnimal [concrete = constants.%HandleAnimal] { // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete] @@ -85,7 +86,7 @@ fn F() { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc19_17.2: %Animal.type = symbolic_binding T, 0 [symbolic = %T.loc19_17.1 (constants.%T)] +// CHECK:STDOUT: %T.loc19_17.2: %Animal.type = symbolic_binding T, 0 [symbolic = %T.loc19_17.1 (constants.%T.99815a.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %Goat.decl: type = class_decl @Goat [concrete = constants.%Goat] {} {} // CHECK:STDOUT: impl_decl @Goat.as.Animal.impl [concrete] {} { @@ -122,8 +123,8 @@ fn F() { // CHECK:STDOUT: .Self = constants.%Goat // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @FeedAnimal(%T.loc17_15.2: %Animal.type) { -// CHECK:STDOUT: %T.loc17_15.1: %Animal.type = symbolic_binding T, 0 [symbolic = %T.loc17_15.1 (constants.%T)] +// CHECK:STDOUT: generic fn @FeedAnimal(%T.loc17_22.2: %Animal.type) { +// CHECK:STDOUT: %T.loc17_22.1: %Animal.type = symbolic_binding T, 0 [symbolic = %T.loc17_22.1 (constants.%T.99815a.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -134,7 +135,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @HandleAnimal(%T.loc19_17.2: %Animal.type) { -// CHECK:STDOUT: %T.loc19_17.1: %Animal.type = symbolic_binding T, 0 [symbolic = %T.loc19_17.1 (constants.%T)] +// CHECK:STDOUT: %T.loc19_17.1: %Animal.type = symbolic_binding T, 0 [symbolic = %T.loc19_17.1 (constants.%T.99815a.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %FeedAnimal.specific_fn.loc19_31.2: = specific_function constants.%FeedAnimal, @FeedAnimal(%T.loc19_17.1) [symbolic = %FeedAnimal.specific_fn.loc19_31.2 (constants.%FeedAnimal.specific_fn.ae9)] @@ -142,8 +143,8 @@ fn F() { // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %FeedAnimal.ref: %FeedAnimal.type = name_ref FeedAnimal, file.%FeedAnimal.decl [concrete = constants.%FeedAnimal] -// CHECK:STDOUT: %T.ref: %Animal.type = name_ref T, %T.loc19_17.2 [symbolic = %T.loc19_17.1 (constants.%T)] -// CHECK:STDOUT: %FeedAnimal.specific_fn.loc19_31.1: = specific_function %FeedAnimal.ref, @FeedAnimal(constants.%T) [symbolic = %FeedAnimal.specific_fn.loc19_31.2 (constants.%FeedAnimal.specific_fn.ae9)] +// CHECK:STDOUT: %T.ref: %Animal.type = name_ref T, %T.loc19_17.2 [symbolic = %T.loc19_17.1 (constants.%T.99815a.2)] +// CHECK:STDOUT: %FeedAnimal.specific_fn.loc19_31.1: = specific_function %FeedAnimal.ref, @FeedAnimal(constants.%T.99815a.2) [symbolic = %FeedAnimal.specific_fn.loc19_31.2 (constants.%FeedAnimal.specific_fn.ae9)] // CHECK:STDOUT: %FeedAnimal.call: init %empty_tuple.type = call %FeedAnimal.specific_fn.loc19_31.1() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -164,14 +165,18 @@ fn F() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @FeedAnimal(constants.%T) { -// CHECK:STDOUT: %T.loc17_15.1 => constants.%T -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: +// CHECK:STDOUT: specific @FeedAnimal(constants.%T.99815a.1) { +// CHECK:STDOUT: %T.loc17_22.1 => constants.%T.99815a.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @HandleAnimal(constants.%T) { -// CHECK:STDOUT: %T.loc19_17.1 => constants.%T +// CHECK:STDOUT: specific @HandleAnimal(constants.%T.99815a.2) { +// CHECK:STDOUT: %T.loc19_17.1 => constants.%T.99815a.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @FeedAnimal(constants.%T.99815a.2) { +// CHECK:STDOUT: %T.loc17_22.1 => constants.%T.99815a.2 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Animal(constants.%Animal.facet) { @@ -186,7 +191,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @FeedAnimal(constants.%Animal.facet) { -// CHECK:STDOUT: %T.loc17_15.1 => constants.%Animal.facet +// CHECK:STDOUT: %T.loc17_22.1 => constants.%Animal.facet // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/facet/convert_facet_value_to_narrowed_facet_type.carbon b/toolchain/check/testdata/facet/convert_facet_value_to_narrowed_facet_type.carbon index 812bc138fa0d..1613f624ad26 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_to_narrowed_facet_type.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_to_narrowed_facet_type.carbon @@ -18,7 +18,7 @@ library "[[@TEST_NAME]]"; interface Eats {} interface Animal {} -fn Feed[T:! Eats](e: T) {} +fn Feed[T:! Eats](unused e: T) {} fn HandleAnimal[U:! Animal & Eats](a: U) { Feed(a); } @@ -29,7 +29,7 @@ interface Eats {} interface Animal {} interface Tame {} -fn FeedTame[V:! Tame & Eats](v: V) {} +fn FeedTame[V:! Tame & Eats](unused v: V) {} fn HandleTameAnimal[W:! Eats & Animal & Tame](w: W) { FeedTame(w); @@ -44,7 +44,7 @@ interface Tame {} impl forall [A:! Animal] A as Eats {} -fn FeedTame2[V:! Tame & Eats](v: V) {} +fn FeedTame2[V:! Tame & Eats](unused v: V) {} fn HandleTameAnimal2[W:! Animal & Tame](w: W) { FeedTame2(w); @@ -57,7 +57,7 @@ library "[[@TEST_NAME]]"; interface A {} -fn TakesA[T:! A](x: T) {} +fn TakesA[T:! A](unused x: T) {} fn WithExtraWhere[U:! A where .Self impls type](y: U) { TakesA(y); @@ -66,12 +66,12 @@ fn WithExtraWhere[U:! A where .Self impls type](y: U) { // --- no_interfaces_success.carbon library "[[@TEST_NAME]]"; -fn TakesTypeDeduced[T:! type](x: T) {} +fn TakesTypeDeduced[T:! type](unused x: T) {} fn CallsWithExtraWhere[U:! type where .Self impls type](y: U) { TakesTypeDeduced(y); } -fn TakesTypeExplicit(T:! type) {} +fn TakesTypeExplicit(unused T:! type) {} fn CallsWithExtraWhereExplicit(U:! type where .Self impls type) { TakesTypeExplicit(U); } @@ -79,12 +79,12 @@ fn CallsWithExtraWhereExplicit(U:! type where .Self impls type) { // --- no_interfaces.carbon library "[[@TEST_NAME]]"; -fn TakesExtraWhereDeduced[T:! type where .Self impls type](x: T) {} +fn TakesExtraWhereDeduced[T:! type where .Self impls type](unused x: T) {} fn CallsWithType[U:! type](y: U) { TakesExtraWhereDeduced(y); } -fn TakesExtraWhereExplicit(T:! type where .Self impls type) {} +fn TakesExtraWhereExplicit(unused T:! type where .Self impls type) {} fn CallsWithTypeExplicit(U:! type) { TakesExtraWhereExplicit(U); } @@ -162,10 +162,10 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc6_9.2: %Eats.type = symbolic_binding T, 0 [symbolic = %T.loc6_9.1 (constants.%T)] // CHECK:STDOUT: %e.param: @Feed.%T.binding.as_type (%T.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc6_22.1: type = splice_block %.loc6_22.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { +// CHECK:STDOUT: %.loc6_29.1: type = splice_block %.loc6_29.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { // CHECK:STDOUT: %T.ref: %Eats.type = name_ref T, %T.loc6_9.2 [symbolic = %T.loc6_9.1 (constants.%T)] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc6_22.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc6_29.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %e: @Feed.%T.binding.as_type (%T.binding.as_type) = value_binding e, %e.param // CHECK:STDOUT: } @@ -373,10 +373,10 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %V.loc7_13.2: %facet_type.2db = symbolic_binding V, 0 [symbolic = %V.loc7_13.1 (constants.%V)] // CHECK:STDOUT: %v.param: @FeedTame.%V.binding.as_type (%V.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc7_33.1: type = splice_block %.loc7_33.2 [symbolic = %V.binding.as_type (constants.%V.binding.as_type)] { +// CHECK:STDOUT: %.loc7_40.1: type = splice_block %.loc7_40.2 [symbolic = %V.binding.as_type (constants.%V.binding.as_type)] { // CHECK:STDOUT: %V.ref: %facet_type.2db = name_ref V, %V.loc7_13.2 [symbolic = %V.loc7_13.1 (constants.%V)] // CHECK:STDOUT: %V.as_type: type = facet_access_type %V.ref [symbolic = %V.binding.as_type (constants.%V.binding.as_type)] -// CHECK:STDOUT: %.loc7_33.2: type = converted %V.ref, %V.as_type [symbolic = %V.binding.as_type (constants.%V.binding.as_type)] +// CHECK:STDOUT: %.loc7_40.2: type = converted %V.ref, %V.as_type [symbolic = %V.binding.as_type (constants.%V.binding.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %v: @FeedTame.%V.binding.as_type (%V.binding.as_type) = value_binding v, %v.param // CHECK:STDOUT: } @@ -626,10 +626,10 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %V.loc9_14.2: %facet_type.2db = symbolic_binding V, 0 [symbolic = %V.loc9_14.1 (constants.%V)] // CHECK:STDOUT: %v.param: @FeedTame2.%V.binding.as_type (%V.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc9_34.1: type = splice_block %.loc9_34.2 [symbolic = %V.binding.as_type (constants.%V.binding.as_type)] { +// CHECK:STDOUT: %.loc9_41.1: type = splice_block %.loc9_41.2 [symbolic = %V.binding.as_type (constants.%V.binding.as_type)] { // CHECK:STDOUT: %V.ref: %facet_type.2db = name_ref V, %V.loc9_14.2 [symbolic = %V.loc9_14.1 (constants.%V)] // CHECK:STDOUT: %V.as_type: type = facet_access_type %V.ref [symbolic = %V.binding.as_type (constants.%V.binding.as_type)] -// CHECK:STDOUT: %.loc9_34.2: type = converted %V.ref, %V.as_type [symbolic = %V.binding.as_type (constants.%V.binding.as_type)] +// CHECK:STDOUT: %.loc9_41.2: type = converted %V.ref, %V.as_type [symbolic = %V.binding.as_type (constants.%V.binding.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %v: @FeedTame2.%V.binding.as_type (%V.binding.as_type) = value_binding v, %v.param // CHECK:STDOUT: } @@ -855,10 +855,10 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc7_11.2: %A.type = symbolic_binding T, 0 [symbolic = %T.loc7_11.1 (constants.%T)] // CHECK:STDOUT: %x.param: @TakesA.%T.binding.as_type (%T.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc7_21.1: type = splice_block %.loc7_21.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { +// CHECK:STDOUT: %.loc7_28.1: type = splice_block %.loc7_28.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { // CHECK:STDOUT: %T.ref: %A.type = name_ref T, %T.loc7_11.2 [symbolic = %T.loc7_11.1 (constants.%T)] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc7_21.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc7_28.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %x: @TakesA.%T.binding.as_type (%T.binding.as_type) = value_binding x, %x.param // CHECK:STDOUT: } @@ -966,13 +966,13 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self.c39: %type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %T.67db0b.1: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] -// CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [symbolic] +// CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T.67db0b.1 [symbolic] // CHECK:STDOUT: %TakesTypeDeduced.type: type = fn_type @TakesTypeDeduced [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %TakesTypeDeduced: %TakesTypeDeduced.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete.944: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.944: = require_complete_type %T.67db0b.1 [symbolic] // CHECK:STDOUT: %.Self.16f: type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %U: %type = symbolic_binding U, 0 [symbolic] // CHECK:STDOUT: %pattern_type.9a5: type = pattern_type %type [concrete] @@ -982,6 +982,7 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: %CallsWithExtraWhere: %CallsWithExtraWhere.type = struct_value () [concrete] // CHECK:STDOUT: %require_complete.d55: = require_complete_type %U.binding.as_type [symbolic] // CHECK:STDOUT: %TakesTypeDeduced.specific_fn: = specific_function %TakesTypeDeduced, @TakesTypeDeduced(%U.binding.as_type) [symbolic] +// CHECK:STDOUT: %T.67db0b.2: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %TakesTypeExplicit.type: type = fn_type @TakesTypeExplicit [concrete] // CHECK:STDOUT: %TakesTypeExplicit: %TakesTypeExplicit.type = struct_value () [concrete] // CHECK:STDOUT: %CallsWithExtraWhereExplicit.type: type = fn_type @CallsWithExtraWhereExplicit [concrete] @@ -1011,10 +1012,10 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: %x.param_patt: @TakesTypeDeduced.%pattern_type (%pattern_type.51d) = value_param_pattern %x.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39] -// CHECK:STDOUT: %T.loc3_21.2: type = symbolic_binding T, 0 [symbolic = %T.loc3_21.1 (constants.%T)] -// CHECK:STDOUT: %x.param: @TakesTypeDeduced.%T.loc3_21.1 (%T) = value_param call_param0 -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc3_21.2 [symbolic = %T.loc3_21.1 (constants.%T)] -// CHECK:STDOUT: %x: @TakesTypeDeduced.%T.loc3_21.1 (%T) = value_binding x, %x.param +// CHECK:STDOUT: %T.loc3_21.2: type = symbolic_binding T, 0 [symbolic = %T.loc3_21.1 (constants.%T.67db0b.1)] +// CHECK:STDOUT: %x.param: @TakesTypeDeduced.%T.loc3_21.1 (%T.67db0b.1) = value_param call_param0 +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc3_21.2 [symbolic = %T.loc3_21.1 (constants.%T.67db0b.1)] +// CHECK:STDOUT: %x: @TakesTypeDeduced.%T.loc3_21.1 (%T.67db0b.1) = value_binding x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallsWithExtraWhere.decl: %CallsWithExtraWhere.type = fn_decl @CallsWithExtraWhere [concrete = constants.%CallsWithExtraWhere] { // CHECK:STDOUT: %U.patt: %pattern_type.9a5 = symbolic_binding_pattern U, 0 [concrete] @@ -1043,7 +1044,7 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39] -// CHECK:STDOUT: %T.loc8_22.2: type = symbolic_binding T, 0 [symbolic = %T.loc8_22.1 (constants.%T)] +// CHECK:STDOUT: %T.loc8_29.3: type = symbolic_binding T, 0 [symbolic = %T.loc8_29.2 (constants.%T.67db0b.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %CallsWithExtraWhereExplicit.decl: %CallsWithExtraWhereExplicit.type = fn_decl @CallsWithExtraWhereExplicit [concrete = constants.%CallsWithExtraWhereExplicit] { // CHECK:STDOUT: %U.patt: %pattern_type.9a5 = symbolic_binding_pattern U, 0 [concrete] @@ -1062,13 +1063,13 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @TakesTypeDeduced(%T.loc3_21.2: type) { -// CHECK:STDOUT: %T.loc3_21.1: type = symbolic_binding T, 0 [symbolic = %T.loc3_21.1 (constants.%T)] +// CHECK:STDOUT: %T.loc3_21.1: type = symbolic_binding T, 0 [symbolic = %T.loc3_21.1 (constants.%T.67db0b.1)] // CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc3_21.1 [symbolic = %pattern_type (constants.%pattern_type.51d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T.loc3_21.1 [symbolic = %require_complete (constants.%require_complete.944)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @TakesTypeDeduced.%T.loc3_21.1 (%T)) { +// CHECK:STDOUT: fn(%x.param: @TakesTypeDeduced.%T.loc3_21.1 (%T.67db0b.1)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1093,8 +1094,9 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @TakesTypeExplicit(%T.loc8_22.2: type) { -// CHECK:STDOUT: %T.loc8_22.1: type = symbolic_binding T, 0 [symbolic = %T.loc8_22.1 (constants.%T)] +// CHECK:STDOUT: generic fn @TakesTypeExplicit(%T.loc8_29.3: type) { +// CHECK:STDOUT: %T.loc8_29.1: type = symbolic_binding T, 0 [symbolic = %T.loc8_29.1 (constants.%T.67db0b.1)] +// CHECK:STDOUT: %T.loc8_29.2: type = symbolic_binding T, 0 [symbolic = %T.loc8_29.2 (constants.%T.67db0b.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -1123,8 +1125,8 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @TakesTypeDeduced(constants.%T) { -// CHECK:STDOUT: %T.loc3_21.1 => constants.%T +// CHECK:STDOUT: specific @TakesTypeDeduced(constants.%T.67db0b.1) { +// CHECK:STDOUT: %T.loc3_21.1 => constants.%T.67db0b.1 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1142,8 +1144,9 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: %require_complete => constants.%require_complete.d55 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @TakesTypeExplicit(constants.%T) { -// CHECK:STDOUT: %T.loc8_22.1 => constants.%T +// CHECK:STDOUT: specific @TakesTypeExplicit(constants.%T.67db0b.2) { +// CHECK:STDOUT: %T.loc8_29.1 => constants.%T.67db0b.2 +// CHECK:STDOUT: %T.loc8_29.2 => constants.%T.67db0b.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CallsWithExtraWhereExplicit(constants.%U) { @@ -1151,7 +1154,8 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @TakesTypeExplicit(constants.%U.binding.as_type) { -// CHECK:STDOUT: %T.loc8_22.1 => constants.%U.binding.as_type +// CHECK:STDOUT: %T.loc8_29.1 => constants.%U.binding.as_type +// CHECK:STDOUT: %T.loc8_29.2 => constants.%U.binding.as_type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -1162,9 +1166,9 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self.c39: %type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %.Self.16f: type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %T: %type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %T.f45530.1: %type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.9a5: type = pattern_type %type [concrete] -// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic] +// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.f45530.1 [symbolic] // CHECK:STDOUT: %pattern_type.349: type = pattern_type %T.binding.as_type [symbolic] // CHECK:STDOUT: %TakesExtraWhereDeduced.type: type = fn_type @TakesExtraWhereDeduced [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] @@ -1178,6 +1182,7 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: %require_complete.944: = require_complete_type %U [symbolic] // CHECK:STDOUT: %facet_value: %type = facet_value %U, () [symbolic] // CHECK:STDOUT: %TakesExtraWhereDeduced.specific_fn: = specific_function %TakesExtraWhereDeduced, @TakesExtraWhereDeduced(%facet_value) [symbolic] +// CHECK:STDOUT: %T.f45530.2: %type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %TakesExtraWhereExplicit.type: type = fn_type @TakesExtraWhereExplicit [concrete] // CHECK:STDOUT: %TakesExtraWhereExplicit: %TakesExtraWhereExplicit.type = struct_value () [concrete] // CHECK:STDOUT: %CallsWithTypeExplicit.type: type = fn_type @CallsWithTypeExplicit [concrete] @@ -1215,12 +1220,12 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: requirement_impls %.Self.ref, type // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc3_27.2: %type = symbolic_binding T, 0 [symbolic = %T.loc3_27.1 (constants.%T)] +// CHECK:STDOUT: %T.loc3_27.2: %type = symbolic_binding T, 0 [symbolic = %T.loc3_27.1 (constants.%T.f45530.1)] // CHECK:STDOUT: %x.param: @TakesExtraWhereDeduced.%T.binding.as_type (%T.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc3_63.1: type = splice_block %.loc3_63.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { -// CHECK:STDOUT: %T.ref: %type = name_ref T, %T.loc3_27.2 [symbolic = %T.loc3_27.1 (constants.%T)] +// CHECK:STDOUT: %.loc3_70.1: type = splice_block %.loc3_70.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { +// CHECK:STDOUT: %T.ref: %type = name_ref T, %T.loc3_27.2 [symbolic = %T.loc3_27.1 (constants.%T.f45530.1)] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc3_63.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc3_70.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %x: @TakesExtraWhereDeduced.%T.binding.as_type (%T.binding.as_type) = value_binding x, %x.param // CHECK:STDOUT: } @@ -1238,16 +1243,16 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: %TakesExtraWhereExplicit.decl: %TakesExtraWhereExplicit.type = fn_decl @TakesExtraWhereExplicit [concrete = constants.%TakesExtraWhereExplicit] { // CHECK:STDOUT: %T.patt: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc8_37.1: type = splice_block %.loc8_37.2 [concrete = constants.%type] { +// CHECK:STDOUT: %.loc8_44.1: type = splice_block %.loc8_44.2 [concrete = constants.%type] { // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39] // CHECK:STDOUT: %.Self.2: type = symbolic_binding .Self [symbolic_self = constants.%.Self.16f] // CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.16f] -// CHECK:STDOUT: %.loc8_37.2: type = where_expr %.Self.2 [concrete = constants.%type] { +// CHECK:STDOUT: %.loc8_44.2: type = where_expr %.Self.2 [concrete = constants.%type] { // CHECK:STDOUT: requirement_base_facet_type type // CHECK:STDOUT: requirement_impls %.Self.ref, type // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc8_28.2: %type = symbolic_binding T, 0 [symbolic = %T.loc8_28.1 (constants.%T)] +// CHECK:STDOUT: %T.loc8_35.3: %type = symbolic_binding T, 0 [symbolic = %T.loc8_35.2 (constants.%T.f45530.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %CallsWithTypeExplicit.decl: %CallsWithTypeExplicit.type = fn_decl @CallsWithTypeExplicit [concrete = constants.%CallsWithTypeExplicit] { // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [concrete] @@ -1258,7 +1263,7 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @TakesExtraWhereDeduced(%T.loc3_27.2: %type) { -// CHECK:STDOUT: %T.loc3_27.1: %type = symbolic_binding T, 0 [symbolic = %T.loc3_27.1 (constants.%T)] +// CHECK:STDOUT: %T.loc3_27.1: %type = symbolic_binding T, 0 [symbolic = %T.loc3_27.1 (constants.%T.f45530.1)] // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc3_27.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] // CHECK:STDOUT: %pattern_type: type = pattern_type %T.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.349)] // CHECK:STDOUT: @@ -1294,8 +1299,9 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @TakesExtraWhereExplicit(%T.loc8_28.2: %type) { -// CHECK:STDOUT: %T.loc8_28.1: %type = symbolic_binding T, 0 [symbolic = %T.loc8_28.1 (constants.%T)] +// CHECK:STDOUT: generic fn @TakesExtraWhereExplicit(%T.loc8_35.3: %type) { +// CHECK:STDOUT: %T.loc8_35.1: %type = symbolic_binding T, 0 [symbolic = %T.loc8_35.1 (constants.%T.f45530.1)] +// CHECK:STDOUT: %T.loc8_35.2: %type = symbolic_binding T, 0 [symbolic = %T.loc8_35.2 (constants.%T.f45530.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -1324,8 +1330,8 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @TakesExtraWhereDeduced(constants.%T) { -// CHECK:STDOUT: %T.loc3_27.1 => constants.%T +// CHECK:STDOUT: specific @TakesExtraWhereDeduced(constants.%T.f45530.1) { +// CHECK:STDOUT: %T.loc3_27.1 => constants.%T.f45530.1 // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.349 // CHECK:STDOUT: } @@ -1344,8 +1350,9 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: %require_complete => constants.%require_complete.944 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @TakesExtraWhereExplicit(constants.%T) { -// CHECK:STDOUT: %T.loc8_28.1 => constants.%T +// CHECK:STDOUT: specific @TakesExtraWhereExplicit(constants.%T.f45530.2) { +// CHECK:STDOUT: %T.loc8_35.1 => constants.%T.f45530.2 +// CHECK:STDOUT: %T.loc8_35.2 => constants.%T.f45530.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CallsWithTypeExplicit(constants.%U) { @@ -1353,7 +1360,8 @@ fn CallsWithTypeExplicit(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @TakesExtraWhereExplicit(constants.%facet_value) { -// CHECK:STDOUT: %T.loc8_28.1 => constants.%facet_value +// CHECK:STDOUT: %T.loc8_35.1 => constants.%facet_value +// CHECK:STDOUT: %T.loc8_35.2 => constants.%facet_value // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/facet/convert_facet_value_value_to_blanket_impl.carbon b/toolchain/check/testdata/facet/convert_facet_value_value_to_blanket_impl.carbon index fbcfad081b34..ba17ade0fe21 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_value_to_blanket_impl.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_value_to_blanket_impl.carbon @@ -17,7 +17,7 @@ interface Animal {} impl forall [A:! Animal] A as Eats {} -fn Feed[T:! Eats](e: T) {} +fn Feed[T:! Eats](unused e: T) {} fn HandleAnimal[T:! Animal](a: T) { Feed(a); } @@ -98,10 +98,10 @@ fn HandleAnimal[T:! Animal](a: T) { Feed(a); } // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc20_9.2: %Eats.type = symbolic_binding T, 0 [symbolic = %T.loc20_9.1 (constants.%T.f11)] // CHECK:STDOUT: %e.param: @Feed.%T.binding.as_type (%T.binding.as_type.265) = value_param call_param0 -// CHECK:STDOUT: %.loc20_22.1: type = splice_block %.loc20_22.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.265)] { +// CHECK:STDOUT: %.loc20_29.1: type = splice_block %.loc20_29.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.265)] { // CHECK:STDOUT: %T.ref: %Eats.type = name_ref T, %T.loc20_9.2 [symbolic = %T.loc20_9.1 (constants.%T.f11)] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type.265)] -// CHECK:STDOUT: %.loc20_22.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type.265)] +// CHECK:STDOUT: %.loc20_29.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type.265)] // CHECK:STDOUT: } // CHECK:STDOUT: %e: @Feed.%T.binding.as_type (%T.binding.as_type.265) = value_binding e, %e.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon b/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon index b0c248a012c2..2cad93ae2202 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon @@ -28,7 +28,7 @@ impl forall [T:! Animal, U:! Edible] T as Eats(U) {} class Goat {} impl Goat as Animal {} -fn Feed[Food:! Edible, T:! Eats(Food)](e: T, food: Food) {} +fn Feed[Food:! Edible, T:! Eats(Food)](unused e: T, unused food: Food) {} fn HandleAnimal[A:! Animal, Food:! Edible](a: A, food: Food) { Feed(a, food); } fn F() { @@ -190,10 +190,10 @@ fn F() { // CHECK:STDOUT: %Feed.decl: %Feed.type = fn_decl @Feed [concrete = constants.%Feed] { // CHECK:STDOUT: %Food.patt: %pattern_type.b51 = symbolic_binding_pattern Food, 0 [concrete] // CHECK:STDOUT: %T.patt: @Feed.%pattern_type.loc31_24 (%pattern_type.350) = symbolic_binding_pattern T, 1 [concrete] -// CHECK:STDOUT: %e.patt: @Feed.%pattern_type.loc31_40 (%pattern_type.2b9) = value_binding_pattern e [concrete] -// CHECK:STDOUT: %e.param_patt: @Feed.%pattern_type.loc31_40 (%pattern_type.2b9) = value_param_pattern %e.patt, call_param0 [concrete] -// CHECK:STDOUT: %food.patt: @Feed.%pattern_type.loc31_46 (%pattern_type.12a) = value_binding_pattern food [concrete] -// CHECK:STDOUT: %food.param_patt: @Feed.%pattern_type.loc31_46 (%pattern_type.12a) = value_param_pattern %food.patt, call_param1 [concrete] +// CHECK:STDOUT: %e.patt: @Feed.%pattern_type.loc31_47 (%pattern_type.2b9) = value_binding_pattern e [concrete] +// CHECK:STDOUT: %e.param_patt: @Feed.%pattern_type.loc31_47 (%pattern_type.2b9) = value_param_pattern %e.patt, call_param0 [concrete] +// CHECK:STDOUT: %food.patt: @Feed.%pattern_type.loc31_60 (%pattern_type.12a) = value_binding_pattern food [concrete] +// CHECK:STDOUT: %food.param_patt: @Feed.%pattern_type.loc31_60 (%pattern_type.12a) = value_param_pattern %food.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc31_16: type = splice_block %Edible.ref [concrete = constants.%Edible.type] { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] @@ -210,17 +210,17 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc31_24.2: @Feed.%Eats.type.loc31_37.1 (%Eats.type.570) = symbolic_binding T, 1 [symbolic = %T.loc31_24.1 (constants.%T.2b9)] // CHECK:STDOUT: %e.param: @Feed.%T.binding.as_type (%T.binding.as_type.8ae) = value_param call_param0 -// CHECK:STDOUT: %.loc31_43.1: type = splice_block %.loc31_43.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.8ae)] { +// CHECK:STDOUT: %.loc31_50.1: type = splice_block %.loc31_50.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.8ae)] { // CHECK:STDOUT: %T.ref: @Feed.%Eats.type.loc31_37.1 (%Eats.type.570) = name_ref T, %T.loc31_24.2 [symbolic = %T.loc31_24.1 (constants.%T.2b9)] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type.8ae)] -// CHECK:STDOUT: %.loc31_43.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type.8ae)] +// CHECK:STDOUT: %.loc31_50.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type.8ae)] // CHECK:STDOUT: } // CHECK:STDOUT: %e: @Feed.%T.binding.as_type (%T.binding.as_type.8ae) = value_binding e, %e.param // CHECK:STDOUT: %food.param: @Feed.%Food.binding.as_type (%Food.binding.as_type.8cc) = value_param call_param1 -// CHECK:STDOUT: %.loc31_52.1: type = splice_block %.loc31_52.2 [symbolic = %Food.binding.as_type (constants.%Food.binding.as_type.8cc)] { -// CHECK:STDOUT: %Food.ref.loc31_52: %Edible.type = name_ref Food, %Food.loc31_9.2 [symbolic = %Food.loc31_9.1 (constants.%Food.d1c)] -// CHECK:STDOUT: %Food.as_type.loc31_52: type = facet_access_type %Food.ref.loc31_52 [symbolic = %Food.binding.as_type (constants.%Food.binding.as_type.8cc)] -// CHECK:STDOUT: %.loc31_52.2: type = converted %Food.ref.loc31_52, %Food.as_type.loc31_52 [symbolic = %Food.binding.as_type (constants.%Food.binding.as_type.8cc)] +// CHECK:STDOUT: %.loc31_66.1: type = splice_block %.loc31_66.2 [symbolic = %Food.binding.as_type (constants.%Food.binding.as_type.8cc)] { +// CHECK:STDOUT: %Food.ref.loc31_66: %Edible.type = name_ref Food, %Food.loc31_9.2 [symbolic = %Food.loc31_9.1 (constants.%Food.d1c)] +// CHECK:STDOUT: %Food.as_type.loc31_66: type = facet_access_type %Food.ref.loc31_66 [symbolic = %Food.binding.as_type (constants.%Food.binding.as_type.8cc)] +// CHECK:STDOUT: %.loc31_66.2: type = converted %Food.ref.loc31_66, %Food.as_type.loc31_66 [symbolic = %Food.binding.as_type (constants.%Food.binding.as_type.8cc)] // CHECK:STDOUT: } // CHECK:STDOUT: %food: @Feed.%Food.binding.as_type (%Food.binding.as_type.8cc) = value_binding food, %food.param // CHECK:STDOUT: } @@ -360,12 +360,12 @@ fn F() { // CHECK:STDOUT: %T.loc31_24.1: @Feed.%Eats.type.loc31_37.1 (%Eats.type.570) = symbolic_binding T, 1 [symbolic = %T.loc31_24.1 (constants.%T.2b9)] // CHECK:STDOUT: %pattern_type.loc31_24: type = pattern_type %Eats.type.loc31_37.1 [symbolic = %pattern_type.loc31_24 (constants.%pattern_type.350)] // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 1, %T.loc31_24.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.8ae)] -// CHECK:STDOUT: %pattern_type.loc31_40: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc31_40 (constants.%pattern_type.2b9)] -// CHECK:STDOUT: %pattern_type.loc31_46: type = pattern_type %Food.binding.as_type [symbolic = %pattern_type.loc31_46 (constants.%pattern_type.12a)] +// CHECK:STDOUT: %pattern_type.loc31_47: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc31_47 (constants.%pattern_type.2b9)] +// CHECK:STDOUT: %pattern_type.loc31_60: type = pattern_type %Food.binding.as_type [symbolic = %pattern_type.loc31_60 (constants.%pattern_type.12a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc31_41: = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc31_41 (constants.%require_complete.0c1)] -// CHECK:STDOUT: %require_complete.loc31_50: = require_complete_type %Food.binding.as_type [symbolic = %require_complete.loc31_50 (constants.%require_complete.bd7)] +// CHECK:STDOUT: %require_complete.loc31_48: = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc31_48 (constants.%require_complete.0c1)] +// CHECK:STDOUT: %require_complete.loc31_64: = require_complete_type %Food.binding.as_type [symbolic = %require_complete.loc31_64 (constants.%require_complete.bd7)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%e.param: @Feed.%T.binding.as_type (%T.binding.as_type.8ae), %food.param: @Feed.%Food.binding.as_type (%Food.binding.as_type.8cc)) { // CHECK:STDOUT: !entry: @@ -509,8 +509,8 @@ fn F() { // CHECK:STDOUT: %T.loc31_24.1 => constants.%T.2b9 // CHECK:STDOUT: %pattern_type.loc31_24 => constants.%pattern_type.350 // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type.8ae -// CHECK:STDOUT: %pattern_type.loc31_40 => constants.%pattern_type.2b9 -// CHECK:STDOUT: %pattern_type.loc31_46 => constants.%pattern_type.12a +// CHECK:STDOUT: %pattern_type.loc31_47 => constants.%pattern_type.2b9 +// CHECK:STDOUT: %pattern_type.loc31_60 => constants.%pattern_type.12a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HandleAnimal(constants.%A, constants.%Food.2fc) { @@ -545,12 +545,12 @@ fn F() { // CHECK:STDOUT: %T.loc31_24.1 => constants.%Eats.facet.702 // CHECK:STDOUT: %pattern_type.loc31_24 => constants.%pattern_type.67b // CHECK:STDOUT: %T.binding.as_type => constants.%A.binding.as_type -// CHECK:STDOUT: %pattern_type.loc31_40 => constants.%pattern_type.892 -// CHECK:STDOUT: %pattern_type.loc31_46 => constants.%pattern_type.9ed +// CHECK:STDOUT: %pattern_type.loc31_47 => constants.%pattern_type.892 +// CHECK:STDOUT: %pattern_type.loc31_60 => constants.%pattern_type.9ed // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc31_41 => constants.%require_complete.72f -// CHECK:STDOUT: %require_complete.loc31_50 => constants.%require_complete.0a9 +// CHECK:STDOUT: %require_complete.loc31_48 => constants.%require_complete.72f +// CHECK:STDOUT: %require_complete.loc31_64 => constants.%require_complete.0a9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HandleAnimal(constants.%Animal.facet, constants.%Edible.facet) { @@ -602,11 +602,11 @@ fn F() { // CHECK:STDOUT: %T.loc31_24.1 => constants.%Eats.facet.a4e // CHECK:STDOUT: %pattern_type.loc31_24 => constants.%pattern_type.968 // CHECK:STDOUT: %T.binding.as_type => constants.%Goat -// CHECK:STDOUT: %pattern_type.loc31_40 => constants.%pattern_type.234 -// CHECK:STDOUT: %pattern_type.loc31_46 => constants.%pattern_type.df6 +// CHECK:STDOUT: %pattern_type.loc31_47 => constants.%pattern_type.234 +// CHECK:STDOUT: %pattern_type.loc31_60 => constants.%pattern_type.df6 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc31_41 => constants.%complete_type.357 -// CHECK:STDOUT: %require_complete.loc31_50 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc31_48 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc31_64 => constants.%complete_type.357 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon b/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon index 9a23a200ba8c..ae22c479847a 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon @@ -14,7 +14,7 @@ interface Animal {} -fn FeedAnimal[T:! Animal](a: T) {} +fn FeedAnimal[T:! Animal](unused a: T) {} fn HandleAnimal[T:! Animal](a: T) { FeedAnimal(a); } @@ -91,10 +91,10 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc17_15.2: %Animal.type = symbolic_binding T, 0 [symbolic = %T.loc17_15.1 (constants.%T)] // CHECK:STDOUT: %a.param: @FeedAnimal.%T.binding.as_type (%T.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc17_30.1: type = splice_block %.loc17_30.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { +// CHECK:STDOUT: %.loc17_37.1: type = splice_block %.loc17_37.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { // CHECK:STDOUT: %T.ref: %Animal.type = name_ref T, %T.loc17_15.2 [symbolic = %T.loc17_15.1 (constants.%T)] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc17_30.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc17_37.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %a: @FeedAnimal.%T.binding.as_type (%T.binding.as_type) = value_binding a, %a.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/facet/convert_interface.carbon b/toolchain/check/testdata/facet/convert_interface.carbon index 52a65cfe598d..67f7f2f0398c 100644 --- a/toolchain/check/testdata/facet/convert_interface.carbon +++ b/toolchain/check/testdata/facet/convert_interface.carbon @@ -19,7 +19,7 @@ interface Animal {} // https://github.com/carbon-language/carbon-lang/issues/4853 impl Animal as Eats {} -fn F(e: Eats) {} +fn F(unused e: Eats) {} fn G() { F(Animal); } // CHECK:STDOUT: --- convert_interface.carbon diff --git a/toolchain/check/testdata/facet/early_rewrites.carbon b/toolchain/check/testdata/facet/early_rewrites.carbon index a80cdc429f86..86f00947efb1 100644 --- a/toolchain/check/testdata/facet/early_rewrites.carbon +++ b/toolchain/check/testdata/facet/early_rewrites.carbon @@ -39,7 +39,7 @@ interface J { let J1:! Z where .Z2 = C(.Self); } -fn F(T:! J) {} +fn F(unused T:! J) {} class D; // Satisfies the implied constraint in J.J1. @@ -80,7 +80,7 @@ interface J { let J1:! Z where .Z2 = C(.Z1); } -fn F(T:! J) {} +fn F(unused T:! J) {} class D; // Satisfies the implied constraint in J.J1. @@ -111,7 +111,7 @@ interface J { let J1:! (Z where .Z1 = ()) where .Z2 = C(.Self); } -fn F(T:! J) {} +fn F(unused T:! J) {} class D; // Satisfies the implied constraint in J.J1. @@ -149,7 +149,7 @@ interface J { let J1:! (Z where .Z2 = C(.Self)) where .Z1 = (); } -fn F(T:! J) {} +fn F(unused T:! J) {} class D; // Satisfies the implied constraint in J.J1. @@ -187,7 +187,7 @@ interface J { let J1:! Z where .Z1 = () and .Z2 = C(.Self); } -fn F(T:! J) {} +fn F(unused T:! J) {} class D; // Satisfies the implied constraint in J.J1. @@ -225,7 +225,7 @@ interface J { let J1:! Z where .Z2 = C(.Self) and .Z1 = (); } -fn F(T:! J) {} +fn F(unused T:! J) {} class D; // Satisfies the implied constraint in J.J1. @@ -258,7 +258,7 @@ interface J { let J1:! Z where .Z1 = () and .Z2 = C(.Z1); } -fn F(T:! J) {} +fn F(unused T:! J) {} class D; // Satisfies the implied constraint in J.J1. @@ -284,7 +284,7 @@ interface J { let J1:! (Z where .Z1 = ()) where .Z2 = C(.Z1); } -fn F(T:! J) {} +fn F(unused T:! J) {} class D; // Satisfies the implied constraint in J.J1. @@ -314,7 +314,7 @@ interface J { let J1:! Y & Z where .Y1 = .Self and .Z1 = () and .Z2 = C(.Y1.Z1); } -fn F(T:! J) {} +fn F(unused T:! J) {} class D; // Satisfies the implied constraint in J.J1. @@ -350,7 +350,7 @@ interface J { let J1:! Z & Y where .Y1 = () and .Z1 = .Self and .Z2 = .Z1.Y1 and .Z3 = C(.Z2); } -fn F(T:! J) {} +fn F(unused T:! J) {} class D; // Satisfies the implied constraint in J.J1. diff --git a/toolchain/check/testdata/facet/facet_assoc_const.carbon b/toolchain/check/testdata/facet/facet_assoc_const.carbon index 466ef6064b7e..d753bf7e938a 100644 --- a/toolchain/check/testdata/facet/facet_assoc_const.carbon +++ b/toolchain/check/testdata/facet/facet_assoc_const.carbon @@ -15,95 +15,95 @@ library "[[@TEST_NAME]]"; interface I { let T:! type; } -fn F(T:! I where .T = {}) {} +fn F(unused T:! I where .T = {}) {} // --- success_associated.carbon library "[[@TEST_NAME]]"; interface I { let T:! type; let U:! type; } -fn F(T:! I where .T = .U) {} +fn F(unused T:! I where .T = .U) {} // --- fail_two_different.carbon library "[[@TEST_NAME]]"; interface L { let W:! type; } -// CHECK:STDERR: fail_two_different.carbon:[[@LINE+4]]:10: error: associated constant `.(L.W)` given two different values `{}` and `()` [AssociatedConstantWithDifferentValues] -// CHECK:STDERR: fn F(T:! L where .W = {} and .W = ()) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_two_different.carbon:[[@LINE+4]]:17: error: associated constant `.(L.W)` given two different values `{}` and `()` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: fn F(unused T:! L where .W = {} and .W = ()) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(T:! L where .W = {} and .W = ()) {} +fn F(unused T:! L where .W = {} and .W = ()) {} // --- fail_two_different_first_associated.carbon library "[[@TEST_NAME]]"; interface L { let W:! type; let X:! type; } -// CHECK:STDERR: fail_two_different_first_associated.carbon:[[@LINE+4]]:10: error: associated constant `.(L.W)` given two different values `.(L.X)` and `()` [AssociatedConstantWithDifferentValues] -// CHECK:STDERR: fn F(T:! L where .W = .X and .W = ()) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_two_different_first_associated.carbon:[[@LINE+4]]:17: error: associated constant `.(L.W)` given two different values `.(L.X)` and `()` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: fn F(unused T:! L where .W = .X and .W = ()) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(T:! L where .W = .X and .W = ()) {} +fn F(unused T:! L where .W = .X and .W = ()) {} // --- fail_two_different_second_associated.carbon library "[[@TEST_NAME]]"; interface L { let W:! type; let X:! type; } -// CHECK:STDERR: fail_two_different_second_associated.carbon:[[@LINE+4]]:10: error: associated constant `.(L.W)` given two different values `()` and `.(L.X)` [AssociatedConstantWithDifferentValues] -// CHECK:STDERR: fn F(T:! L where .W = () and .W = .X) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_two_different_second_associated.carbon:[[@LINE+4]]:17: error: associated constant `.(L.W)` given two different values `()` and `.(L.X)` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: fn F(unused T:! L where .W = () and .W = .X) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(T:! L where .W = () and .W = .X) {} +fn F(unused T:! L where .W = () and .W = .X) {} // --- fail_two_different_first_bad.carbon library "[[@TEST_NAME]]"; interface L { let W:! type; } -// CHECK:STDERR: fail_two_different_first_bad.carbon:[[@LINE+4]]:23: error: name `BAD5` not found [NameNotFound] -// CHECK:STDERR: fn F(T:! L where .W = BAD5 and .W = ()) {} -// CHECK:STDERR: ^~~~ +// CHECK:STDERR: fail_two_different_first_bad.carbon:[[@LINE+4]]:30: error: name `BAD5` not found [NameNotFound] +// CHECK:STDERR: fn F(unused T:! L where .W = BAD5 and .W = ()) {} +// CHECK:STDERR: ^~~~ // CHECK:STDERR: -fn F(T:! L where .W = BAD5 and .W = ()) {} +fn F(unused T:! L where .W = BAD5 and .W = ()) {} // --- fail_two_different_second_bad.carbon library "[[@TEST_NAME]]"; interface L { let W:! type; } -// CHECK:STDERR: fail_two_different_second_bad.carbon:[[@LINE+4]]:35: error: name `BAD6` not found [NameNotFound] -// CHECK:STDERR: fn F(T:! L where .W = {} and .W = BAD6) {} -// CHECK:STDERR: ^~~~ +// CHECK:STDERR: fail_two_different_second_bad.carbon:[[@LINE+4]]:42: error: name `BAD6` not found [NameNotFound] +// CHECK:STDERR: fn F(unused T:! L where .W = {} and .W = BAD6) {} +// CHECK:STDERR: ^~~~ // CHECK:STDERR: -fn F(T:! L where .W = {} and .W = BAD6) {} +fn F(unused T:! L where .W = {} and .W = BAD6) {} // --- fail_two_different_both_bad.carbon library "[[@TEST_NAME]]"; interface L { let W:! type; } -// CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+8]]:23: error: name `BAD7` not found [NameNotFound] -// CHECK:STDERR: fn F(T:! L where .W = BAD7 and .W = BAD8) {} -// CHECK:STDERR: ^~~~ +// CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+8]]:30: error: name `BAD7` not found [NameNotFound] +// CHECK:STDERR: fn F(unused T:! L where .W = BAD7 and .W = BAD8) {} +// CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+4]]:37: error: name `BAD8` not found [NameNotFound] -// CHECK:STDERR: fn F(T:! L where .W = BAD7 and .W = BAD8) {} -// CHECK:STDERR: ^~~~ +// CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+4]]:44: error: name `BAD8` not found [NameNotFound] +// CHECK:STDERR: fn F(unused T:! L where .W = BAD7 and .W = BAD8) {} +// CHECK:STDERR: ^~~~ // CHECK:STDERR: -fn F(T:! L where .W = BAD7 and .W = BAD8) {} +fn F(unused T:! L where .W = BAD7 and .W = BAD8) {} // --- fail_two_different_combined_from_bitand.carbon library "[[@TEST_NAME]]"; interface L { let W:! type; } -// CHECK:STDERR: fail_two_different_combined_from_bitand.carbon:[[@LINE+4]]:10: error: associated constant `.(L.W)` given two different values `()` and `{}` [AssociatedConstantWithDifferentValues] -// CHECK:STDERR: fn F(T:! (L where .W = {}) & (L where .W = ())) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_two_different_combined_from_bitand.carbon:[[@LINE+4]]:17: error: associated constant `.(L.W)` given two different values `()` and `{}` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: fn F(unused T:! (L where .W = {}) & (L where .W = ())) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(T:! (L where .W = {}) & (L where .W = ())) {} +fn F(unused T:! (L where .W = {}) & (L where .W = ())) {} // --- two_different_combined_from_impl_and_facet.carbon library "[[@TEST_NAME]]"; @@ -113,7 +113,7 @@ interface L { let W:! type; } interface M {} impl forall [T:! M] T as L where .W = () {} -fn F(T:! M & (L where .W = {})) {} +fn F(unused T:! M & (L where .W = {})) {} class C; impl C as L where .W = {} {} @@ -139,20 +139,20 @@ fn F(T:! M & (L where .W = {}), a: T.W) { // One of `b` or `c` must fail, because `T.W` is either found to be `()` from // the impl or `{}` from the facet type of T. - let b: () = G(T, a); + let unused b: () = G(T, a); // TODO: This diagnostic sucks. Can we make the facet type's value take // precidence over final, since that's what is written in the code and more // likely to show up in diagnostics? Or should we diagnose `T` as being // invalid directly, where we can see both `.W` values and print them? // - // CHECK:STDERR: fail_two_different_combined_from_final_impl_and_facet.carbon:[[@LINE+7]]:15: error: cannot convert type `T` that implements `L & M where .(L.W) = {}` into type implementing `L where .(L.W) = {}` [ConversionFailureFacetToFacet] - // CHECK:STDERR: let c: {} = H(T, a); - // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: fail_two_different_combined_from_final_impl_and_facet.carbon:[[@LINE+7]]:22: error: cannot convert type `T` that implements `L & M where .(L.W) = {}` into type implementing `L where .(L.W) = {}` [ConversionFailureFacetToFacet] + // CHECK:STDERR: let unused c: {} = H(T, a); + // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_two_different_combined_from_final_impl_and_facet.carbon:[[@LINE-15]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] // CHECK:STDERR: fn H(T:! L where .W = {}, a: T.W) -> {} { return a; } // CHECK:STDERR: ^ // CHECK:STDERR: - let c: {} = H(T, a); + let unused c: {} = H(T, a); } // --- fail_many_different.carbon @@ -160,11 +160,11 @@ library "[[@TEST_NAME]]"; interface L { let W:! type; } -// CHECK:STDERR: fail_many_different.carbon:[[@LINE+4]]:10: error: associated constant `.(L.W)` given two different values `((), (), ())` and `({}, (), ())` [AssociatedConstantWithDifferentValues] -// CHECK:STDERR: fn G(T:! L where .W = ((), (), ()) and .W = ({}, (), ()) and .W = ({}, {}, ()) and .W = ({}, (), {})) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_many_different.carbon:[[@LINE+4]]:17: error: associated constant `.(L.W)` given two different values `((), (), ())` and `({}, (), ())` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: fn G(unused T:! L where .W = ((), (), ()) and .W = ({}, (), ()) and .W = ({}, {}, ()) and .W = ({}, (), {})) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn G(T:! L where .W = ((), (), ()) and .W = ({}, (), ()) and .W = ({}, {}, ()) and .W = ({}, (), {})) {} +fn G(unused T:! L where .W = ((), (), ()) and .W = ({}, (), ()) and .W = ({}, {}, ()) and .W = ({}, (), {})) {} // --- rewrite_uses_second_facet.carbon library "[[@TEST_NAME]]"; @@ -180,18 +180,18 @@ library "[[@TEST_NAME]]"; interface M { let X:! type; let Y:! type; } -// CHECK:STDERR: fail_rewrite_conflicts_with_second_facet.carbon:[[@LINE+4]]:31: error: associated constant `.(M.Y)` given two different values `T.(M.X)` and `.(M.X)` [AssociatedConstantWithDifferentValues] -// CHECK:STDERR: fn F(T:! M where .X = (), U:! M where .Y = T.X and .Y = .X) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_rewrite_conflicts_with_second_facet.carbon:[[@LINE+4]]:38: error: associated constant `.(M.Y)` given two different values `T.(M.X)` and `.(M.X)` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: fn F(T:! M where .X = (), unused U:! M where .Y = T.X and .Y = .X) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(T:! M where .X = (), U:! M where .Y = T.X and .Y = .X) {} +fn F(T:! M where .X = (), unused U:! M where .Y = T.X and .Y = .X) {} // --- repeated.carbon library "[[@TEST_NAME]]"; interface M { let X:! type; } -fn F(T:! M where .X = {} and .X = {}) {} +fn F(unused T:! M where .X = {} and .X = {}) {} fn G(T:! M where .X = {}) { F(T); @@ -202,7 +202,7 @@ library "[[@TEST_NAME]]"; interface M { let X:! type; let Y:! type; } -fn F(T:! M where .X = .Y and .X = .Y) {} +fn F(unused T:! M where .X = .Y and .X = .Y) {} fn G(T:! M where .X = () and .Y = ()) { F(T); @@ -213,9 +213,9 @@ library "[[@TEST_NAME]]"; interface M { let X:! type; let Y:! type; } -fn F1(T:! M where .X = () and .Y = .X and .X = .Y) {} +fn F1(unused T:! M where .X = () and .Y = .X and .X = .Y) {} -fn F2(T:! M where .X = () and .X = .X) {} +fn F2(unused T:! M where .X = () and .X = .X) {} fn G(T:! M where .X = () and .Y = ()) { F1(T); @@ -240,11 +240,11 @@ library "[[@TEST_NAME]]"; interface M { let X:! type; } -// CHECK:STDERR: fail_repeated_and_different.carbon:[[@LINE+4]]:10: error: associated constant `.(M.X)` given two different values `{}` and `()` [AssociatedConstantWithDifferentValues] -// CHECK:STDERR: fn F(T:! M where .X = {} and .X = () and .X = {}) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_repeated_and_different.carbon:[[@LINE+4]]:17: error: associated constant `.(M.X)` given two different values `{}` and `()` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: fn F(unused T:! M where .X = {} and .X = () and .X = {}) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(T:! M where .X = {} and .X = () and .X = {}) {} +fn F(unused T:! M where .X = {} and .X = () and .X = {}) {} // --- fail_cycle_single.carbon library "[[@TEST_NAME]]"; @@ -253,20 +253,20 @@ interface M { let X:! type; } // This fails because it resolves to `.X = .X` which is cyclical. // -// CHECK:STDERR: fail_cycle_single.carbon:[[@LINE+4]]:10: error: found cycle in facet type constraint for `.(M.X)` [FacetTypeConstraintCycle] -// CHECK:STDERR: fn F(T:! M where .X = .X) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_cycle_single.carbon:[[@LINE+4]]:17: error: found cycle in facet type constraint for `.(M.X)` [FacetTypeConstraintCycle] +// CHECK:STDERR: fn F(unused T:! M where .X = .X) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(T:! M where .X = .X) {} +fn F(unused T:! M where .X = .X) {} // Even though `.X = ()` is specified, the rewrites are resolved left to right // and a cycle `.X = .X` is found first. // -// CHECK:STDERR: fail_cycle_single.carbon:[[@LINE+4]]:10: error: found cycle in facet type constraint for `.(M.X)` [FacetTypeConstraintCycle] -// CHECK:STDERR: fn G(T:! M where .X = .X and .X = ()) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_cycle_single.carbon:[[@LINE+4]]:17: error: found cycle in facet type constraint for `.(M.X)` [FacetTypeConstraintCycle] +// CHECK:STDERR: fn G(unused T:! M where .X = .X and .X = ()) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn G(T:! M where .X = .X and .X = ()) {} +fn G(unused T:! M where .X = .X and .X = ()) {} // --- fail_cycle.carbon library "[[@TEST_NAME]]"; @@ -277,11 +277,11 @@ interface M { let X:! type; let Y:! type; let Z:! type; } // The value of .X and .Y becomes but .Z is still valid. // //@dump-sem-ir-begin -// CHECK:STDERR: fail_cycle.carbon:[[@LINE+4]]:10: error: found cycle in facet type constraint for `.(M.Y)` [FacetTypeConstraintCycle] -// CHECK:STDERR: fn F(T:! M where .X = .Y and .Y = .X and .Z = ()) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_cycle.carbon:[[@LINE+4]]:17: error: found cycle in facet type constraint for `.(M.Y)` [FacetTypeConstraintCycle] +// CHECK:STDERR: fn F(unused T:! M where .X = .Y and .Y = .X and .Z = ()) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(T:! M where .X = .Y and .Y = .X and .Z = ()) {} +fn F(unused T:! M where .X = .Y and .Y = .X and .Z = ()) {} //@dump-sem-ir-end // --- fail_cycle_between_interfaces.carbon @@ -297,11 +297,11 @@ interface J { // This fails because it resolves to `.X1 = .X1` which is cyclical. // -// CHECK:STDERR: fail_cycle_between_interfaces.carbon:[[@LINE+4]]:10: error: found cycle in facet type constraint for `.(J.X3)` [FacetTypeConstraintCycle] -// CHECK:STDERR: fn G(T:! I & J where .X1 = .X3 and .X2 = .X1 and .X3 = .X2) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_cycle_between_interfaces.carbon:[[@LINE+4]]:17: error: found cycle in facet type constraint for `.(J.X3)` [FacetTypeConstraintCycle] +// CHECK:STDERR: fn G(unused T:! I & J where .X1 = .X3 and .X2 = .X1 and .X3 = .X2) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn G(T:! I & J where .X1 = .X3 and .X2 = .X1 and .X3 = .X2) {} +fn G(unused T:! I & J where .X1 = .X3 and .X2 = .X1 and .X3 = .X2) {} // --- fail_indirect_cycle.carbon library "[[@TEST_NAME]]"; @@ -427,7 +427,7 @@ interface N { let Y:! {.a: {}}; } -fn F(T:! N where .Y = {.a = {}}) { } +fn F(unused T:! N where .Y = {.a = {}}) { } // --- non-type_repeated.carbon library "[[@TEST_NAME]]"; @@ -436,7 +436,7 @@ interface N { let Y:! {.a: {}}; } -fn F(T:! N where .Y = {.a = {}} and .Y = {.a = {}}) { } +fn F(unused T:! N where .Y = {.a = {}} and .Y = {.a = {}}) { } // --- fail_non-type_different.carbon library "[[@TEST_NAME]]"; @@ -445,11 +445,11 @@ interface N { let Y:! {.a: type}; } -// CHECK:STDERR: fail_non-type_different.carbon:[[@LINE+4]]:10: error: associated constant `.(N.Y)` given two different values `{.a = {}}` and `{.a = ()}` [AssociatedConstantWithDifferentValues] -// CHECK:STDERR: fn F(T:! N where .Y = {.a = {}} and .Y = {.a = ()}) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_non-type_different.carbon:[[@LINE+4]]:17: error: associated constant `.(N.Y)` given two different values `{.a = {}}` and `{.a = ()}` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: fn F(unused T:! N where .Y = {.a = {}} and .Y = {.a = ()}) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(T:! N where .Y = {.a = {}} and .Y = {.a = ()}) {} +fn F(unused T:! N where .Y = {.a = {}} and .Y = {.a = ()}) {} // --- self_repeated_explicitly.carbon library "[[@TEST_NAME]]"; @@ -459,7 +459,7 @@ interface N { let Y2:! type; } -fn F(T:! N where .Y2 = .Y1 and .Y2 = .Self.Y1) { } +fn F(unused T:! N where .Y2 = .Y1 and .Y2 = .Self.Y1) { } // --- self_repeated_explicitly_with_value.carbon library "[[@TEST_NAME]]"; @@ -469,7 +469,7 @@ interface N { let Y2:! type; } -fn F(T:! N where .Y1 = () and .Y2 = .Y1 and .Y2 = .Self.Y1) { } +fn F(unused T:! N where .Y1 = () and .Y2 = .Y1 and .Y2 = .Self.Y1) { } // --- fail_cycle_through_self_reference.carbon library "[[@TEST_NAME]]"; @@ -479,11 +479,11 @@ interface Z { let U:! Z; } -// CHECK:STDERR: fail_cycle_through_self_reference.carbon:[[@LINE+4]]:10: error: found cycle in facet type constraint for `.(Z.T)` [FacetTypeConstraintCycle] -// CHECK:STDERR: fn F(A:! Z where .T = .U.T and .U = .Self) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_cycle_through_self_reference.carbon:[[@LINE+4]]:17: error: found cycle in facet type constraint for `.(Z.T)` [FacetTypeConstraintCycle] +// CHECK:STDERR: fn F(unused A:! Z where .T = .U.T and .U = .Self) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(A:! Z where .T = .U.T and .U = .Self) {} +fn F(unused A:! Z where .T = .U.T and .U = .Self) {} // --- reference_same_constant_in_different_self.carbon library "[[@TEST_NAME]]"; @@ -493,7 +493,7 @@ interface Z { let U:! Z; } -fn F(A:! Z where .T = (), B:! Z where .T = .U.T and .U = A) {} +fn F(A:! Z where .T = (), unused B:! Z where .T = .U.T and .U = A) {} // --- non_cycle_with_self_reference.carbon library "[[@TEST_NAME]]"; @@ -518,11 +518,11 @@ interface Z { let T3:! type; } -// CHECK:STDERR: fail_cycle_with_unrelated_associated_constant.carbon:[[@LINE+4]]:10: error: found cycle in facet type constraint for `.(Z.T1)` [FacetTypeConstraintCycle] -// CHECK:STDERR: fn F(T:! Z where .T0 = .T1 and .T1 = .T0 and .T2 = .T3) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_cycle_with_unrelated_associated_constant.carbon:[[@LINE+4]]:17: error: found cycle in facet type constraint for `.(Z.T1)` [FacetTypeConstraintCycle] +// CHECK:STDERR: fn F(unused T:! Z where .T0 = .T1 and .T1 = .T0 and .T2 = .T3) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(T:! Z where .T0 = .T1 and .T1 = .T0 and .T2 = .T3) {} +fn F(unused T:! Z where .T0 = .T1 and .T1 = .T0 and .T2 = .T3) {} // --- fail_cycle_with_branching_in_rhs.carbon library "[[@TEST_NAME]]"; @@ -537,17 +537,17 @@ interface Z { // TODO: There should only be one diagnostic here. // -// CHECK:STDERR: fail_cycle_with_branching_in_rhs.carbon:[[@LINE+4]]:10: error: found cycle in facet type constraint for `.(Z.T3)` [FacetTypeConstraintCycle] -// CHECK:STDERR: fn F(T:! Z where .T0 = .T1 and .T1 = (.T2, .T3) and .T2 = .T4 and .T3 = .T1) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_cycle_with_branching_in_rhs.carbon:[[@LINE+4]]:17: error: found cycle in facet type constraint for `.(Z.T3)` [FacetTypeConstraintCycle] +// CHECK:STDERR: fn F(unused T:! Z where .T0 = .T1 and .T1 = (.T2, .T3) and .T2 = .T4 and .T3 = .T1) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(T:! Z where .T0 = .T1 and .T1 = (.T2, .T3) and .T2 = .T4 and .T3 = .T1) {} +fn F(unused T:! Z where .T0 = .T1 and .T1 = (.T2, .T3) and .T2 = .T4 and .T3 = .T1) {} -// CHECK:STDERR: fail_cycle_with_branching_in_rhs.carbon:[[@LINE+4]]:10: error: found cycle in facet type constraint for `.(Z.T1)` [FacetTypeConstraintCycle] -// CHECK:STDERR: fn G(T:! Z where .T0 = .T1 and .T1 = (.T2, .T3) and .T2 = .T4 and .T3 = .T0) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_cycle_with_branching_in_rhs.carbon:[[@LINE+4]]:17: error: found cycle in facet type constraint for `.(Z.T1)` [FacetTypeConstraintCycle] +// CHECK:STDERR: fn G(unused T:! Z where .T0 = .T1 and .T1 = (.T2, .T3) and .T2 = .T4 and .T3 = .T0) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn G(T:! Z where .T0 = .T1 and .T1 = (.T2, .T3) and .T2 = .T4 and .T3 = .T0) {} +fn G(unused T:! Z where .T0 = .T1 and .T1 = (.T2, .T3) and .T2 = .T4 and .T3 = .T0) {} // --- no_cycle_with_branching_in_rhs.carbon library "[[@TEST_NAME]]"; @@ -637,7 +637,7 @@ interface J { // If we assume the nested `.J1` access will resolve to a facet value, we may // loop forever trying to resolve the `.I2` access. We should gracefully accept // that it does not resolve further. -fn F(T:! I & J where .I1 = .J1.I2) {} +fn F(unused T:! I & J where .I1 = .J1.I2) {} // CHECK:STDOUT: --- fail_cycle.carbon // CHECK:STDOUT: @@ -666,43 +666,43 @@ fn F(T:! I & J where .I1 = .J1.I2) {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %T.patt: = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc13_12.1: type = splice_block %.loc13_12.2 [concrete = ] { +// CHECK:STDOUT: %.loc13_19.1: type = splice_block %.loc13_19.2 [concrete = ] { // CHECK:STDOUT: // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type] // CHECK:STDOUT: -// CHECK:STDOUT: %.Self.ref.loc13_18: %M.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.b4d] -// CHECK:STDOUT: %.Self.as_type.loc13_18: type = facet_access_type %.Self.ref.loc13_18 [symbolic_self = constants.%.Self.binding.as_type] -// CHECK:STDOUT: %.loc13_18: type = converted %.Self.ref.loc13_18, %.Self.as_type.loc13_18 [symbolic_self = constants.%.Self.binding.as_type] -// CHECK:STDOUT: %X.ref.loc13_18: %M.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc13_18: type = impl_witness_access constants.%M.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.Self.ref.loc13_23: %M.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.b4d] -// CHECK:STDOUT: %.Self.as_type.loc13_23: type = facet_access_type %.Self.ref.loc13_23 [symbolic_self = constants.%.Self.binding.as_type] -// CHECK:STDOUT: %.loc13_23: type = converted %.Self.ref.loc13_23, %.Self.as_type.loc13_23 [symbolic_self = constants.%.Self.binding.as_type] -// CHECK:STDOUT: %Y.ref.loc13_23: %M.assoc_type = name_ref Y, @Y.%assoc1 [concrete = constants.%assoc1] -// CHECK:STDOUT: %impl.elem1.loc13_23: type = impl_witness_access constants.%M.lookup_impl_witness, element1 [symbolic_self = constants.%impl.elem1] +// CHECK:STDOUT: %.Self.ref.loc13_25: %M.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.b4d] +// CHECK:STDOUT: %.Self.as_type.loc13_25: type = facet_access_type %.Self.ref.loc13_25 [symbolic_self = constants.%.Self.binding.as_type] +// CHECK:STDOUT: %.loc13_25: type = converted %.Self.ref.loc13_25, %.Self.as_type.loc13_25 [symbolic_self = constants.%.Self.binding.as_type] +// CHECK:STDOUT: %X.ref.loc13_25: %M.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %impl.elem0.loc13_25: type = impl_witness_access constants.%M.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] // CHECK:STDOUT: %.Self.ref.loc13_30: %M.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.b4d] // CHECK:STDOUT: %.Self.as_type.loc13_30: type = facet_access_type %.Self.ref.loc13_30 [symbolic_self = constants.%.Self.binding.as_type] // CHECK:STDOUT: %.loc13_30: type = converted %.Self.ref.loc13_30, %.Self.as_type.loc13_30 [symbolic_self = constants.%.Self.binding.as_type] // CHECK:STDOUT: %Y.ref.loc13_30: %M.assoc_type = name_ref Y, @Y.%assoc1 [concrete = constants.%assoc1] // CHECK:STDOUT: %impl.elem1.loc13_30: type = impl_witness_access constants.%M.lookup_impl_witness, element1 [symbolic_self = constants.%impl.elem1] -// CHECK:STDOUT: %.Self.ref.loc13_35: %M.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.b4d] -// CHECK:STDOUT: %.Self.as_type.loc13_35: type = facet_access_type %.Self.ref.loc13_35 [symbolic_self = constants.%.Self.binding.as_type] -// CHECK:STDOUT: %.loc13_35: type = converted %.Self.ref.loc13_35, %.Self.as_type.loc13_35 [symbolic_self = constants.%.Self.binding.as_type] -// CHECK:STDOUT: %X.ref.loc13_35: %M.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc13_35: type = impl_witness_access constants.%M.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %impl.elem0.subst: type = impl_witness_access_substituted %impl.elem0.loc13_35, %impl.elem1.loc13_23 [symbolic_self = constants.%impl.elem1] +// CHECK:STDOUT: %.Self.ref.loc13_37: %M.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.b4d] +// CHECK:STDOUT: %.Self.as_type.loc13_37: type = facet_access_type %.Self.ref.loc13_37 [symbolic_self = constants.%.Self.binding.as_type] +// CHECK:STDOUT: %.loc13_37: type = converted %.Self.ref.loc13_37, %.Self.as_type.loc13_37 [symbolic_self = constants.%.Self.binding.as_type] +// CHECK:STDOUT: %Y.ref.loc13_37: %M.assoc_type = name_ref Y, @Y.%assoc1 [concrete = constants.%assoc1] +// CHECK:STDOUT: %impl.elem1.loc13_37: type = impl_witness_access constants.%M.lookup_impl_witness, element1 [symbolic_self = constants.%impl.elem1] // CHECK:STDOUT: %.Self.ref.loc13_42: %M.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.b4d] // CHECK:STDOUT: %.Self.as_type.loc13_42: type = facet_access_type %.Self.ref.loc13_42 [symbolic_self = constants.%.Self.binding.as_type] // CHECK:STDOUT: %.loc13_42: type = converted %.Self.ref.loc13_42, %.Self.as_type.loc13_42 [symbolic_self = constants.%.Self.binding.as_type] +// CHECK:STDOUT: %X.ref.loc13_42: %M.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %impl.elem0.loc13_42: type = impl_witness_access constants.%M.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0.subst: type = impl_witness_access_substituted %impl.elem0.loc13_42, %impl.elem1.loc13_30 [symbolic_self = constants.%impl.elem1] +// CHECK:STDOUT: %.Self.ref.loc13_49: %M.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.b4d] +// CHECK:STDOUT: %.Self.as_type.loc13_49: type = facet_access_type %.Self.ref.loc13_49 [symbolic_self = constants.%.Self.binding.as_type] +// CHECK:STDOUT: %.loc13_49: type = converted %.Self.ref.loc13_49, %.Self.as_type.loc13_49 [symbolic_self = constants.%.Self.binding.as_type] // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc2 [concrete = constants.%assoc2] // CHECK:STDOUT: %impl.elem2: type = impl_witness_access constants.%M.lookup_impl_witness, element2 [symbolic_self = constants.%impl.elem2] -// CHECK:STDOUT: %.loc13_48.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc13_48.2: type = converted %.loc13_48.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc13_12.2: type = where_expr %.Self.2 [concrete = ] { +// CHECK:STDOUT: %.loc13_55.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc13_55.2: type = converted %.loc13_55.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc13_19.2: type = where_expr %.Self.2 [concrete = ] { // CHECK:STDOUT: requirement_base_facet_type constants.%M.type -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc13_18, %impl.elem1.loc13_23 -// CHECK:STDOUT: requirement_rewrite %impl.elem1.loc13_30, %impl.elem0.subst -// CHECK:STDOUT: requirement_rewrite %impl.elem2, %.loc13_48.2 +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc13_25, %impl.elem1.loc13_30 +// CHECK:STDOUT: requirement_rewrite %impl.elem1.loc13_37, %impl.elem0.subst +// CHECK:STDOUT: requirement_rewrite %impl.elem2, %.loc13_55.2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %T: = symbolic_binding T, 0 [concrete = ] diff --git a/toolchain/check/testdata/facet/fail_convert_class_type_to_generic_facet_value.carbon b/toolchain/check/testdata/facet/fail_convert_class_type_to_generic_facet_value.carbon index 78df36437257..cb371a684c5e 100644 --- a/toolchain/check/testdata/facet/fail_convert_class_type_to_generic_facet_value.carbon +++ b/toolchain/check/testdata/facet/fail_convert_class_type_to_generic_facet_value.carbon @@ -24,15 +24,15 @@ impl ImplsGeneric as Generic(GenericParam) { fn F() {} } -fn CallGenericMethod(T:! type, U:! Generic(T)) {} +fn CallGenericMethod(T:! type, unused U:! Generic(T)) {} fn G() { // CHECK:STDERR: fail_convert_class_type_to_generic_facet_value.carbon:[[@LINE+7]]:3: error: cannot convert type `ImplsGeneric` into type implementing `Generic(WrongGenericParam)` [ConversionFailureTypeToFacet] // CHECK:STDERR: CallGenericMethod(WrongGenericParam, ImplsGeneric); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_convert_class_type_to_generic_facet_value.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn CallGenericMethod(T:! type, U:! Generic(T)) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn CallGenericMethod(T:! type, unused U:! Generic(T)) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: CallGenericMethod(WrongGenericParam, ImplsGeneric); } @@ -118,13 +118,13 @@ fn G() { // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc27_22.2: type = symbolic_binding T, 0 [symbolic = %T.loc27_22.1 (constants.%T)] -// CHECK:STDOUT: %.loc27: type = splice_block %Generic.type.loc27_45.2 [symbolic = %Generic.type.loc27_45.1 (constants.%Generic.type.03dff7.2)] { +// CHECK:STDOUT: %.loc27: type = splice_block %Generic.type.loc27_52.2 [symbolic = %Generic.type.loc27_52.1 (constants.%Generic.type.03dff7.2)] { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Generic.ref: %Generic.type.835 = name_ref Generic, file.%Generic.decl [concrete = constants.%Generic.generic] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc27_22.2 [symbolic = %T.loc27_22.1 (constants.%T)] -// CHECK:STDOUT: %Generic.type.loc27_45.2: type = facet_type <@Generic, @Generic(constants.%T)> [symbolic = %Generic.type.loc27_45.1 (constants.%Generic.type.03dff7.2)] +// CHECK:STDOUT: %Generic.type.loc27_52.2: type = facet_type <@Generic, @Generic(constants.%T)> [symbolic = %Generic.type.loc27_52.1 (constants.%Generic.type.03dff7.2)] // CHECK:STDOUT: } -// CHECK:STDOUT: %U.loc27_32.2: @CallGenericMethod.%Generic.type.loc27_45.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc27_32.1 (constants.%U)] +// CHECK:STDOUT: %U.loc27_39.2: @CallGenericMethod.%Generic.type.loc27_52.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc27_39.1 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {} // CHECK:STDOUT: } @@ -196,11 +196,11 @@ fn G() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @CallGenericMethod(%T.loc27_22.2: type, %U.loc27_32.2: @CallGenericMethod.%Generic.type.loc27_45.1 (%Generic.type.03dff7.2)) { +// CHECK:STDOUT: generic fn @CallGenericMethod(%T.loc27_22.2: type, %U.loc27_39.2: @CallGenericMethod.%Generic.type.loc27_52.1 (%Generic.type.03dff7.2)) { // CHECK:STDOUT: %T.loc27_22.1: type = symbolic_binding T, 0 [symbolic = %T.loc27_22.1 (constants.%T)] -// CHECK:STDOUT: %Generic.type.loc27_45.1: type = facet_type <@Generic, @Generic(%T.loc27_22.1)> [symbolic = %Generic.type.loc27_45.1 (constants.%Generic.type.03dff7.2)] -// CHECK:STDOUT: %U.loc27_32.1: @CallGenericMethod.%Generic.type.loc27_45.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc27_32.1 (constants.%U)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Generic.type.loc27_45.1 [symbolic = %pattern_type (constants.%pattern_type.c49)] +// CHECK:STDOUT: %Generic.type.loc27_52.1: type = facet_type <@Generic, @Generic(%T.loc27_22.1)> [symbolic = %Generic.type.loc27_52.1 (constants.%Generic.type.03dff7.2)] +// CHECK:STDOUT: %U.loc27_39.1: @CallGenericMethod.%Generic.type.loc27_52.1 (%Generic.type.03dff7.2) = symbolic_binding U, 1 [symbolic = %U.loc27_39.1 (constants.%U)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Generic.type.loc27_52.1 [symbolic = %pattern_type (constants.%pattern_type.c49)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -264,8 +264,8 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @CallGenericMethod(constants.%T, constants.%U) { // CHECK:STDOUT: %T.loc27_22.1 => constants.%T -// CHECK:STDOUT: %Generic.type.loc27_45.1 => constants.%Generic.type.03dff7.2 -// CHECK:STDOUT: %U.loc27_32.1 => constants.%U +// CHECK:STDOUT: %Generic.type.loc27_52.1 => constants.%Generic.type.03dff7.2 +// CHECK:STDOUT: %U.loc27_39.1 => constants.%U // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c49 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/fail_convert_facet_value_to_missing_impl.carbon b/toolchain/check/testdata/facet/fail_convert_facet_value_to_missing_impl.carbon index e493f493cf10..59b32d2c97d4 100644 --- a/toolchain/check/testdata/facet/fail_convert_facet_value_to_missing_impl.carbon +++ b/toolchain/check/testdata/facet/fail_convert_facet_value_to_missing_impl.carbon @@ -15,14 +15,14 @@ interface Eats {} interface Animal {} -fn Feed[T:! Eats](e: T) {} +fn Feed[T:! Eats](unused e: T) {} // CHECK:STDERR: fail_convert_facet_value_to_missing_impl.carbon:[[@LINE+7]]:37: error: cannot convert type `T` that implements `Animal` into type implementing `Eats` [ConversionFailureFacetToFacet] // CHECK:STDERR: fn HandleAnimal[T:! Animal](a: T) { Feed(a); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_convert_facet_value_to_missing_impl.carbon:[[@LINE-5]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] -// CHECK:STDERR: fn Feed[T:! Eats](e: T) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Feed[T:! Eats](unused e: T) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn HandleAnimal[T:! Animal](a: T) { Feed(a); } @@ -80,10 +80,10 @@ fn HandleAnimal[T:! Animal](a: T) { Feed(a); } // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc18_9.2: %Eats.type = symbolic_binding T, 0 [symbolic = %T.loc18_9.1 (constants.%T.f11)] // CHECK:STDOUT: %e.param: @Feed.%T.binding.as_type (%T.binding.as_type.265) = value_param call_param0 -// CHECK:STDOUT: %.loc18_22.1: type = splice_block %.loc18_22.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.265)] { +// CHECK:STDOUT: %.loc18_29.1: type = splice_block %.loc18_29.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type.265)] { // CHECK:STDOUT: %T.ref: %Eats.type = name_ref T, %T.loc18_9.2 [symbolic = %T.loc18_9.1 (constants.%T.f11)] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type.265)] -// CHECK:STDOUT: %.loc18_22.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type.265)] +// CHECK:STDOUT: %.loc18_29.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type.265)] // CHECK:STDOUT: } // CHECK:STDOUT: %e: @Feed.%T.binding.as_type (%T.binding.as_type.265) = value_binding e, %e.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/facet/fail_convert_type_erased_type_to_facet.carbon b/toolchain/check/testdata/facet/fail_convert_type_erased_type_to_facet.carbon index 61eb29676b8a..3464fc2493f4 100644 --- a/toolchain/check/testdata/facet/fail_convert_type_erased_type_to_facet.carbon +++ b/toolchain/check/testdata/facet/fail_convert_type_erased_type_to_facet.carbon @@ -17,7 +17,7 @@ interface Animal {} class Goat {} impl Goat as Animal {} -fn WalkAnimal(a:! Animal) {} +fn WalkAnimal(unused a:! Animal) {} fn F() { // CHECK:STDERR: fail_convert_type_erased_type_to_facet.carbon:[[@LINE+4]]:7: error: semantics TODO: `local `let :!` bindings are currently unsupported` [SemanticsTodo] @@ -68,7 +68,7 @@ fn F() { // CHECK:STDOUT: .Self = constants.%Goat // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @WalkAnimal(.inst{{[0-9A-F]+}}.loc20_15: %Animal.type) { +// CHECK:STDOUT: generic fn @WalkAnimal(.inst{{[0-9A-F]+}}.loc20_22: %Animal.type) { // CHECK:STDOUT: %a: %Animal.type = symbolic_binding a, 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon b/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon index 9775536ccafd..d77ac978a972 100644 --- a/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon +++ b/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon @@ -21,21 +21,21 @@ class RuntimeConvertTo {} impl RuntimeConvertFrom as Core.ImplicitAs(RuntimeConvertTo) { // Runtime conversion function - fn Convert[self: Self]() -> RuntimeConvertTo { return {}; } + fn Convert[unused self: Self]() -> RuntimeConvertTo { return {}; } } -fn F[T:! (type, )](A:! T.0, x: HoldsType(T)) {} +fn F[T:! (type, )](unused A:! T.0, unused x: HoldsType(T)) {} fn G(holds_to: HoldsType((RuntimeConvertTo, )), from:! RuntimeConvertFrom) { // CHECK:STDERR: fail_deduction_uses_runtime_type_conversion.carbon:[[@LINE+10]]:3: error: compile-time value requires runtime conversion, constructing value of type `RuntimeConvertTo` [RuntimeConversionDuringCompTimeDeduction] // CHECK:STDERR: F(from, holds_to); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_deduction_uses_runtime_type_conversion.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn F[T:! (type, )](A:! T.0, x: HoldsType(T)) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn F[T:! (type, )](unused A:! T.0, unused x: HoldsType(T)) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_deduction_uses_runtime_type_conversion.carbon:[[@LINE-9]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn F[T:! (type, )](A:! T.0, x: HoldsType(T)) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn F[T:! (type, )](unused A:! T.0, unused x: HoldsType(T)) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: F(from, holds_to); } @@ -134,9 +134,9 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), from:! RuntimeConvertFrom) { // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %T.patt: %pattern_type.f1e = symbolic_binding_pattern T, 0 [concrete] -// CHECK:STDOUT: %A.patt: @F.%pattern_type.loc27_20 (%pattern_type.e66) = symbolic_binding_pattern A, 1 [concrete] -// CHECK:STDOUT: %x.patt: @F.%pattern_type.loc27_29 (%pattern_type.17d) = value_binding_pattern x [concrete] -// CHECK:STDOUT: %x.param_patt: @F.%pattern_type.loc27_29 (%pattern_type.17d) = value_param_pattern %x.patt, call_param0 [concrete] +// CHECK:STDOUT: %A.patt: @F.%pattern_type.loc27_27 (%pattern_type.e66) = symbolic_binding_pattern A, 1 [concrete] +// CHECK:STDOUT: %x.patt: @F.%pattern_type.loc27_43 (%pattern_type.17d) = value_binding_pattern x [concrete] +// CHECK:STDOUT: %x.param_patt: @F.%pattern_type.loc27_43 (%pattern_type.17d) = value_param_pattern %x.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc27_17.1: type = splice_block %.loc27_17.3 [concrete = constants.%tuple.type] { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] @@ -144,20 +144,20 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), from:! RuntimeConvertFrom) { // CHECK:STDOUT: %.loc27_17.3: type = converted %.loc27_17.2, constants.%tuple.type [concrete = constants.%tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc27_6.2: %tuple.type = symbolic_binding T, 0 [symbolic = %T.loc27_6.1 (constants.%T)] -// CHECK:STDOUT: %.loc27_25: type = splice_block %tuple.elem0.loc27_25.2 [symbolic = %tuple.elem0.loc27_25.1 (constants.%tuple.elem0)] { +// CHECK:STDOUT: %.loc27_32: type = splice_block %tuple.elem0.loc27_32.2 [symbolic = %tuple.elem0.loc27_32.1 (constants.%tuple.elem0)] { // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T.ref.loc27_24: %tuple.type = name_ref T, %T.loc27_6.2 [symbolic = %T.loc27_6.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc27_31: %tuple.type = name_ref T, %T.loc27_6.2 [symbolic = %T.loc27_6.1 (constants.%T)] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %tuple.elem0.loc27_25.2: type = tuple_access %T.ref.loc27_24, element0 [symbolic = %tuple.elem0.loc27_25.1 (constants.%tuple.elem0)] +// CHECK:STDOUT: %tuple.elem0.loc27_32.2: type = tuple_access %T.ref.loc27_31, element0 [symbolic = %tuple.elem0.loc27_32.1 (constants.%tuple.elem0)] // CHECK:STDOUT: } -// CHECK:STDOUT: %A.loc27_20.2: @F.%tuple.elem0.loc27_25.1 (%tuple.elem0) = symbolic_binding A, 1 [symbolic = %A.loc27_20.1 (constants.%A)] -// CHECK:STDOUT: %x.param: @F.%HoldsType.loc27_43.1 (%HoldsType.f6a) = value_param call_param0 -// CHECK:STDOUT: %.loc27_43: type = splice_block %HoldsType.loc27_43.2 [symbolic = %HoldsType.loc27_43.1 (constants.%HoldsType.f6a)] { +// CHECK:STDOUT: %A.loc27_27.2: @F.%tuple.elem0.loc27_32.1 (%tuple.elem0) = symbolic_binding A, 1 [symbolic = %A.loc27_27.1 (constants.%A)] +// CHECK:STDOUT: %x.param: @F.%HoldsType.loc27_57.1 (%HoldsType.f6a) = value_param call_param0 +// CHECK:STDOUT: %.loc27_57: type = splice_block %HoldsType.loc27_57.2 [symbolic = %HoldsType.loc27_57.1 (constants.%HoldsType.f6a)] { // CHECK:STDOUT: %HoldsType.ref: %HoldsType.type = name_ref HoldsType, file.%HoldsType.decl [concrete = constants.%HoldsType.generic] -// CHECK:STDOUT: %T.ref.loc27_42: %tuple.type = name_ref T, %T.loc27_6.2 [symbolic = %T.loc27_6.1 (constants.%T)] -// CHECK:STDOUT: %HoldsType.loc27_43.2: type = class_type @HoldsType, @HoldsType(constants.%T) [symbolic = %HoldsType.loc27_43.1 (constants.%HoldsType.f6a)] +// CHECK:STDOUT: %T.ref.loc27_56: %tuple.type = name_ref T, %T.loc27_6.2 [symbolic = %T.loc27_6.1 (constants.%T)] +// CHECK:STDOUT: %HoldsType.loc27_57.2: type = class_type @HoldsType, @HoldsType(constants.%T) [symbolic = %HoldsType.loc27_57.1 (constants.%HoldsType.f6a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @F.%HoldsType.loc27_43.1 (%HoldsType.f6a) = value_binding x, %x.param +// CHECK:STDOUT: %x: @F.%HoldsType.loc27_57.1 (%HoldsType.f6a) = value_binding x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %holds_to.patt: %pattern_type.c6f = value_binding_pattern holds_to [concrete] @@ -190,7 +190,7 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), from:! RuntimeConvertFrom) { // CHECK:STDOUT: %return.param_patt: %pattern_type.c89 = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %RuntimeConvertTo.ref: type = name_ref RuntimeConvertTo, file.%RuntimeConvertTo.decl [concrete = constants.%RuntimeConvertTo] -// CHECK:STDOUT: %.loc24_31: Core.Form = init_form %RuntimeConvertTo.ref, call_param1 [concrete = constants.%.382] +// CHECK:STDOUT: %.loc24_38: Core.Form = init_form %RuntimeConvertTo.ref, call_param1 [concrete = constants.%.382] // CHECK:STDOUT: %self.param: %RuntimeConvertFrom = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @RuntimeConvertFrom.as.ImplicitAs.impl.%RuntimeConvertFrom.ref [concrete = constants.%RuntimeConvertFrom] // CHECK:STDOUT: %self: %RuntimeConvertFrom = value_binding self, %self.param @@ -238,24 +238,24 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), from:! RuntimeConvertFrom) { // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeConvertFrom.as.ImplicitAs.impl.Convert(%self.param: %RuntimeConvertFrom) -> out %return.param: %RuntimeConvertTo { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc24_58.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc24_58.2: init %RuntimeConvertTo to %return.param = class_init () [concrete = constants.%RuntimeConvertTo.val] -// CHECK:STDOUT: %.loc24_59: init %RuntimeConvertTo = converted %.loc24_58.1, %.loc24_58.2 [concrete = constants.%RuntimeConvertTo.val] -// CHECK:STDOUT: return %.loc24_59 to %return.param +// CHECK:STDOUT: %.loc24_65.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc24_65.2: init %RuntimeConvertTo to %return.param = class_init () [concrete = constants.%RuntimeConvertTo.val] +// CHECK:STDOUT: %.loc24_66: init %RuntimeConvertTo = converted %.loc24_65.1, %.loc24_65.2 [concrete = constants.%RuntimeConvertTo.val] +// CHECK:STDOUT: return %.loc24_66 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%T.loc27_6.2: %tuple.type, %A.loc27_20.2: @F.%tuple.elem0.loc27_25.1 (%tuple.elem0)) { +// CHECK:STDOUT: generic fn @F(%T.loc27_6.2: %tuple.type, %A.loc27_27.2: @F.%tuple.elem0.loc27_32.1 (%tuple.elem0)) { // CHECK:STDOUT: %T.loc27_6.1: %tuple.type = symbolic_binding T, 0 [symbolic = %T.loc27_6.1 (constants.%T)] -// CHECK:STDOUT: %tuple.elem0.loc27_25.1: type = tuple_access %T.loc27_6.1, element0 [symbolic = %tuple.elem0.loc27_25.1 (constants.%tuple.elem0)] -// CHECK:STDOUT: %A.loc27_20.1: @F.%tuple.elem0.loc27_25.1 (%tuple.elem0) = symbolic_binding A, 1 [symbolic = %A.loc27_20.1 (constants.%A)] -// CHECK:STDOUT: %pattern_type.loc27_20: type = pattern_type %tuple.elem0.loc27_25.1 [symbolic = %pattern_type.loc27_20 (constants.%pattern_type.e66)] -// CHECK:STDOUT: %HoldsType.loc27_43.1: type = class_type @HoldsType, @HoldsType(%T.loc27_6.1) [symbolic = %HoldsType.loc27_43.1 (constants.%HoldsType.f6a)] -// CHECK:STDOUT: %pattern_type.loc27_29: type = pattern_type %HoldsType.loc27_43.1 [symbolic = %pattern_type.loc27_29 (constants.%pattern_type.17d)] +// CHECK:STDOUT: %tuple.elem0.loc27_32.1: type = tuple_access %T.loc27_6.1, element0 [symbolic = %tuple.elem0.loc27_32.1 (constants.%tuple.elem0)] +// CHECK:STDOUT: %A.loc27_27.1: @F.%tuple.elem0.loc27_32.1 (%tuple.elem0) = symbolic_binding A, 1 [symbolic = %A.loc27_27.1 (constants.%A)] +// CHECK:STDOUT: %pattern_type.loc27_27: type = pattern_type %tuple.elem0.loc27_32.1 [symbolic = %pattern_type.loc27_27 (constants.%pattern_type.e66)] +// CHECK:STDOUT: %HoldsType.loc27_57.1: type = class_type @HoldsType, @HoldsType(%T.loc27_6.1) [symbolic = %HoldsType.loc27_57.1 (constants.%HoldsType.f6a)] +// CHECK:STDOUT: %pattern_type.loc27_43: type = pattern_type %HoldsType.loc27_57.1 [symbolic = %pattern_type.loc27_43 (constants.%pattern_type.17d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %HoldsType.loc27_43.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %HoldsType.loc27_57.1 [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @F.%HoldsType.loc27_43.1 (%HoldsType.f6a)) { +// CHECK:STDOUT: fn(%x.param: @F.%HoldsType.loc27_57.1 (%HoldsType.f6a)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -299,11 +299,11 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), from:! RuntimeConvertFrom) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%A) { // CHECK:STDOUT: %T.loc27_6.1 => constants.%T -// CHECK:STDOUT: %tuple.elem0.loc27_25.1 => constants.%tuple.elem0 -// CHECK:STDOUT: %A.loc27_20.1 => constants.%A -// CHECK:STDOUT: %pattern_type.loc27_20 => constants.%pattern_type.e66 -// CHECK:STDOUT: %HoldsType.loc27_43.1 => constants.%HoldsType.f6a -// CHECK:STDOUT: %pattern_type.loc27_29 => constants.%pattern_type.17d +// CHECK:STDOUT: %tuple.elem0.loc27_32.1 => constants.%tuple.elem0 +// CHECK:STDOUT: %A.loc27_27.1 => constants.%A +// CHECK:STDOUT: %pattern_type.loc27_27 => constants.%pattern_type.e66 +// CHECK:STDOUT: %HoldsType.loc27_57.1 => constants.%HoldsType.f6a +// CHECK:STDOUT: %pattern_type.loc27_43 => constants.%pattern_type.17d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HoldsType(constants.%tuple.b95) { @@ -318,10 +318,10 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), from:! RuntimeConvertFrom) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%tuple.b95, ) { // CHECK:STDOUT: %T.loc27_6.1 => constants.%tuple.b95 -// CHECK:STDOUT: %tuple.elem0.loc27_25.1 => constants.%RuntimeConvertTo -// CHECK:STDOUT: %A.loc27_20.1 => -// CHECK:STDOUT: %pattern_type.loc27_20 => constants.%pattern_type.c89 -// CHECK:STDOUT: %HoldsType.loc27_43.1 => constants.%HoldsType.0ca -// CHECK:STDOUT: %pattern_type.loc27_29 => constants.%pattern_type.c6f +// CHECK:STDOUT: %tuple.elem0.loc27_32.1 => constants.%RuntimeConvertTo +// CHECK:STDOUT: %A.loc27_27.1 => +// CHECK:STDOUT: %pattern_type.loc27_27 => constants.%pattern_type.c89 +// CHECK:STDOUT: %HoldsType.loc27_57.1 => constants.%HoldsType.0ca +// CHECK:STDOUT: %pattern_type.loc27_43 => constants.%pattern_type.c6f // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/fail_incomplete.carbon b/toolchain/check/testdata/facet/fail_incomplete.carbon index c2c5e88130f1..5d1477f7ecf9 100644 --- a/toolchain/check/testdata/facet/fail_incomplete.carbon +++ b/toolchain/check/testdata/facet/fail_incomplete.carbon @@ -15,7 +15,7 @@ library "[[@TEST_NAME]]"; constraint Z; -fn AsZ(T:! Z) {} +fn AsZ(unused T:! Z) {} fn F() { // Requires Z identified. @@ -25,9 +25,9 @@ fn F() { // CHECK:STDERR: fail_impl_lookup_incomplete.carbon:[[@LINE-9]]:1: note: constraint was forward declared here [NamedConstraintForwardDeclaredHere] // CHECK:STDERR: constraint Z; // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_lookup_incomplete.carbon:[[@LINE-10]]:8: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn AsZ(T:! Z) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_impl_lookup_incomplete.carbon:[[@LINE-10]]:15: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn AsZ(unused T:! Z) {} + // CHECK:STDERR: ^ // CHECK:STDERR: AsZ(()); } diff --git a/toolchain/check/testdata/facet/fail_namespace_type.carbon b/toolchain/check/testdata/facet/fail_namespace_type.carbon index a263ff72f096..003cfb86c160 100644 --- a/toolchain/check/testdata/facet/fail_namespace_type.carbon +++ b/toolchain/check/testdata/facet/fail_namespace_type.carbon @@ -36,15 +36,15 @@ interface Z {} impl forall [T:! type] T as Z {} -fn G[T:! Z](a: T) {} +fn G[T:! Z](unused a: T) {} fn F() { // CHECK:STDERR: fail_namespace_argument.carbon:[[@LINE+7]]:5: error: expression cannot be used as a value [UseOfNonExprAsValue] // CHECK:STDERR: G(N); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_namespace_argument.carbon:[[@LINE-6]]:13: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fn G[T:! Z](a: T) {} - // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_namespace_argument.carbon:[[@LINE-6]]:20: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: fn G[T:! Z](unused a: T) {} + // CHECK:STDERR: ^~~~ // CHECK:STDERR: G(N); } diff --git a/toolchain/check/testdata/facet/nested_facet_types.carbon b/toolchain/check/testdata/facet/nested_facet_types.carbon index 0c296ac3325f..454581329022 100644 --- a/toolchain/check/testdata/facet/nested_facet_types.carbon +++ b/toolchain/check/testdata/facet/nested_facet_types.carbon @@ -41,7 +41,7 @@ interface Z { let U:! type; } -fn F(FF:! ((Z where .T = .U) where .T = .U) where .T = .U) {} +fn F(unused FF:! ((Z where .T = .U) where .T = .U) where .T = .U) {} // --- nested_facet_types_same_two_associated.carbon library "[[@TEST_NAME]]"; @@ -52,7 +52,7 @@ interface Z { let V:! type; } -fn F(FF:! ((Z where .T = .U and .U = .V) where .T = .U and .U = .V) where .T = .U and .U = .V) {} +fn F(unused FF:! ((Z where .T = .U and .U = .V) where .T = .U and .U = .V) where .T = .U and .U = .V) {} // --- nested_facet_types_same_associated_in_generic_parameter.carbon library "[[@TEST_NAME]]"; @@ -63,7 +63,7 @@ interface Z { } class C(T:! type) {} -fn F(FF:! ((Z where .T = C(.U)) where .T = C(.U)) where .T = C(.U)) {} +fn F(unused FF:! ((Z where .T = C(.U)) where .T = C(.U)) where .T = C(.U)) {} // --- fail_nested_facet_types_different.carbon library "[[@TEST_NAME]]"; @@ -72,11 +72,11 @@ interface Z { let T:! type; } -// CHECK:STDERR: fail_nested_facet_types_different.carbon:[[@LINE+4]]:11: error: associated constant `.(Z.T)` given two different values `()` and `{}` [AssociatedConstantWithDifferentValues] -// CHECK:STDERR: fn F(FF:! (Z where .T = ()) where .T = {}) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_nested_facet_types_different.carbon:[[@LINE+4]]:18: error: associated constant `.(Z.T)` given two different values `()` and `{}` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: fn F(unused FF:! (Z where .T = ()) where .T = {}) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(FF:! (Z where .T = ()) where .T = {}) {} +fn F(unused FF:! (Z where .T = ()) where .T = {}) {} // --- fail_nested_facet_types_different_with_associated.carbon library "[[@TEST_NAME]]"; @@ -86,11 +86,11 @@ interface Z { let U:! type; } -// CHECK:STDERR: fail_nested_facet_types_different_with_associated.carbon:[[@LINE+4]]:11: error: associated constant `.(Z.T)` given two different values `.(Z.U)` and `{}` [AssociatedConstantWithDifferentValues] -// CHECK:STDERR: fn F(FF:! (Z where .T = .U) where .T = {}) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_nested_facet_types_different_with_associated.carbon:[[@LINE+4]]:18: error: associated constant `.(Z.T)` given two different values `.(Z.U)` and `{}` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: fn F(unused FF:! (Z where .T = .U) where .T = {}) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(FF:! (Z where .T = .U) where .T = {}) {} +fn F(unused FF:! (Z where .T = .U) where .T = {}) {} // --- fail_nested_facet_types_different_with_associated_in_generic_parameter.carbon library "[[@TEST_NAME]]"; @@ -101,11 +101,11 @@ interface Z { } class C(T:! type) {} -// CHECK:STDERR: fail_nested_facet_types_different_with_associated_in_generic_parameter.carbon:[[@LINE+4]]:11: error: associated constant `.(Z.T)` given two different values `C(.(Z.U))` and `{}` [AssociatedConstantWithDifferentValues] -// CHECK:STDERR: fn F(FF:! (Z where .T = C(.U)) where .T = {}) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_nested_facet_types_different_with_associated_in_generic_parameter.carbon:[[@LINE+4]]:18: error: associated constant `.(Z.T)` given two different values `C(.(Z.U))` and `{}` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: fn F(unused FF:! (Z where .T = C(.U)) where .T = {}) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(FF:! (Z where .T = C(.U)) where .T = {}) {} +fn F(unused FF:! (Z where .T = C(.U)) where .T = {}) {} // --- nested_facet_types_same_with_bitand.carbon library "[[@TEST_NAME]]"; @@ -115,7 +115,7 @@ interface Z { let U:! type; } -fn F(FF:! ((Z where .T = .U) where .T = .U) & (Z where .T = .U)) {} +fn F(unused FF:! ((Z where .T = .U) where .T = .U) & (Z where .T = .U)) {} // --- fail_nested_facet_types_different_with_bitand.carbon library "[[@TEST_NAME]]"; @@ -125,11 +125,11 @@ interface Z { let U:! type; } -// CHECK:STDERR: fail_nested_facet_types_different_with_bitand.carbon:[[@LINE+4]]:11: error: associated constant `.(Z.T)` given two different values `.(Z.U)` and `{}` [AssociatedConstantWithDifferentValues] -// CHECK:STDERR: fn F(FF:! ((Z where .T = .U) where .T = .U) & (Z where .T = {})) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_nested_facet_types_different_with_bitand.carbon:[[@LINE+4]]:18: error: associated constant `.(Z.T)` given two different values `.(Z.U)` and `{}` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: fn F(unused FF:! ((Z where .T = .U) where .T = .U) & (Z where .T = {})) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(FF:! ((Z where .T = .U) where .T = .U) & (Z where .T = {})) {} +fn F(unused FF:! ((Z where .T = .U) where .T = .U) & (Z where .T = {})) {} // --- fail_nested_facet_type_cycle.carbon library "[[@TEST_NAME]]"; @@ -139,11 +139,11 @@ interface Z { let U:! type; } -// CHECK:STDERR: fail_nested_facet_type_cycle.carbon:[[@LINE+4]]:11: error: found cycle in facet type constraint for `.(Z.U)` [FacetTypeConstraintCycle] -// CHECK:STDERR: fn F(FF:! (Z where .T = .U) where .U = .T) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_nested_facet_type_cycle.carbon:[[@LINE+4]]:18: error: found cycle in facet type constraint for `.(Z.U)` [FacetTypeConstraintCycle] +// CHECK:STDERR: fn F(unused FF:! (Z where .T = .U) where .U = .T) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(FF:! (Z where .T = .U) where .U = .T) {} +fn F(unused FF:! (Z where .T = .U) where .U = .T) {} // --- fail_nested_facet_types_different_separated_order_one.carbon library "[[@TEST_NAME]]"; @@ -158,11 +158,11 @@ interface Z { // The ordering here is meant to find a way to insert a LHS between the two `.S` // ids, by producing different orderings to get an id between them. -// CHECK:STDERR: fail_nested_facet_types_different_separated_order_one.carbon:[[@LINE+4]]:11: error: associated constant `.(Z.S)` given two different values `.(Z.U)` and `{}` [AssociatedConstantWithDifferentValues] -// CHECK:STDERR: fn F(FF:! (((Z where .S = .U) where .V = {}) where .T = .U) & (Z where .S = {})) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_nested_facet_types_different_separated_order_one.carbon:[[@LINE+4]]:18: error: associated constant `.(Z.S)` given two different values `.(Z.U)` and `{}` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: fn F(unused FF:! (((Z where .S = .U) where .V = {}) where .T = .U) & (Z where .S = {})) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(FF:! (((Z where .S = .U) where .V = {}) where .T = .U) & (Z where .S = {})) {} +fn F(unused FF:! (((Z where .S = .U) where .V = {}) where .T = .U) & (Z where .S = {})) {} // --- fail_nested_facet_types_different_separated_order_two.carbon library "[[@TEST_NAME]]"; @@ -178,11 +178,11 @@ interface Z { // ids, by producing different orderings to get an id between them. As of today, // this is the case where `.T` is sorted between the two `.S` rewrite rules. -// CHECK:STDERR: fail_nested_facet_types_different_separated_order_two.carbon:[[@LINE+4]]:11: error: associated constant `.(Z.S)` given two different values `{}` and `.(Z.U)` [AssociatedConstantWithDifferentValues] -// CHECK:STDERR: fn F(FF:! (((Z where .V = {}) where .S = .U) where .T = .U) & (Z where .S = {})) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_nested_facet_types_different_separated_order_two.carbon:[[@LINE+4]]:18: error: associated constant `.(Z.S)` given two different values `{}` and `.(Z.U)` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: fn F(unused FF:! (((Z where .V = {}) where .S = .U) where .T = .U) & (Z where .S = {})) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(FF:! (((Z where .V = {}) where .S = .U) where .T = .U) & (Z where .S = {})) {} +fn F(unused FF:! (((Z where .V = {}) where .S = .U) where .T = .U) & (Z where .S = {})) {} // --- fail_nested_facet_types_different_separated_order_three.carbon library "[[@TEST_NAME]]"; @@ -197,11 +197,11 @@ interface Z { // The ordering here is meant to find a way to insert a LHS between the two `.S` // ids, by producing different orderings to get an id between them. -// CHECK:STDERR: fail_nested_facet_types_different_separated_order_three.carbon:[[@LINE+4]]:11: error: associated constant `.(Z.S)` given two different values `{}` and `.(Z.U)` [AssociatedConstantWithDifferentValues] -// CHECK:STDERR: fn F(FF:! (((Z where .V = {}) where .T = .U) where .S = .U) & (Z where .S = {})) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_nested_facet_types_different_separated_order_three.carbon:[[@LINE+4]]:18: error: associated constant `.(Z.S)` given two different values `{}` and `.(Z.U)` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: fn F(unused FF:! (((Z where .V = {}) where .T = .U) where .S = .U) & (Z where .S = {})) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(FF:! (((Z where .V = {}) where .T = .U) where .S = .U) & (Z where .S = {})) {} +fn F(unused FF:! (((Z where .V = {}) where .T = .U) where .S = .U) & (Z where .S = {})) {} // --- repeated_with_value_available.carbon library "[[@TEST_NAME]]"; @@ -249,7 +249,7 @@ interface Z { } class C(T:! type) {} -fn F(FF:! ((Y where .Self impls (Z where .T = C(.U))) +fn F(unused FF:! ((Y where .Self impls (Z where .T = C(.U))) where .Self impls (Z where .T = C(.U))) where .Self impls (Z where .T = C(.U))) {} diff --git a/toolchain/check/testdata/facet/period_self.carbon b/toolchain/check/testdata/facet/period_self.carbon index 8e2b8fc0f833..cef01c5fd96b 100644 --- a/toolchain/check/testdata/facet/period_self.carbon +++ b/toolchain/check/testdata/facet/period_self.carbon @@ -103,7 +103,7 @@ interface J(T:! type) { fn J1() -> T*; } -fn F2[U:! I(.Self)](T: U*) {} +fn F2[U:! I(.Self)](unused T: U*) {} fn F(U:! I(.Self)) { // Caller sees the returned `.Self` type from `F()` as the full `U`. @@ -139,7 +139,7 @@ interface J(T:! type) { fn J1() -> T*; } -fn F2[U:! I(.Self) & J(.Self)](T: U*) {} +fn F2[U:! I(.Self) & J(.Self)](unused T: U*) {} fn F(U:! I(.Self) & J(.Self)) { // TODO: The returned value of `I1` and `J1` has type `U` which has access to @@ -218,14 +218,14 @@ interface I(T:! type) { } fn F(U:! I(.Self)) { - // CHECK:STDERR: fail_todo_return_of_type_period_self_has_type_u.carbon:[[@LINE+7]]:14: error: cannot implicitly convert expression of type `.Self` to `U` [ConversionFailure] - // CHECK:STDERR: let a: U = U.G(); - // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_todo_return_of_type_period_self_has_type_u.carbon:[[@LINE+4]]:14: note: type `.Self` does not implement interface `Core.ImplicitAs(U)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let a: U = U.G(); - // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: fail_todo_return_of_type_period_self_has_type_u.carbon:[[@LINE+7]]:21: error: cannot implicitly convert expression of type `.Self` to `U` [ConversionFailure] + // CHECK:STDERR: let unused a: U = U.G(); + // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: fail_todo_return_of_type_period_self_has_type_u.carbon:[[@LINE+4]]:21: note: type `.Self` does not implement interface `Core.ImplicitAs(U)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused a: U = U.G(); + // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - let a: U = U.G(); + let unused a: U = U.G(); } // --- fail_todo_return_of_type_period_self_assoc_const_has_type_u.carbon @@ -237,14 +237,14 @@ interface I { } fn F(U:! I where .X = .Self) { - // CHECK:STDERR: fail_todo_return_of_type_period_self_assoc_const_has_type_u.carbon:[[@LINE+7]]:14: error: cannot implicitly convert expression of type `.Self` to `U` [ConversionFailure] - // CHECK:STDERR: let a: U = U.G(); - // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_todo_return_of_type_period_self_assoc_const_has_type_u.carbon:[[@LINE+4]]:14: note: type `.Self` does not implement interface `Core.ImplicitAs(U)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let a: U = U.G(); - // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: fail_todo_return_of_type_period_self_assoc_const_has_type_u.carbon:[[@LINE+7]]:21: error: cannot implicitly convert expression of type `.Self` to `U` [ConversionFailure] + // CHECK:STDERR: let unused a: U = U.G(); + // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: fail_todo_return_of_type_period_self_assoc_const_has_type_u.carbon:[[@LINE+4]]:21: note: type `.Self` does not implement interface `Core.ImplicitAs(U)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused a: U = U.G(); + // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - let a: U = U.G(); + let unused a: U = U.G(); } // --- fail_todo_nested_period_self.carbon @@ -261,23 +261,23 @@ interface I(T:! type) { // constraining the binding. fn F(T:! I(.Self) where .A = ((I(.Self) where .B = {}) where .A = {}) and .B = {}, U:! T.A) { // T.G() has type T. - // CHECK:STDERR: fail_todo_nested_period_self.carbon:[[@LINE+7]]:14: error: cannot implicitly convert expression of type `.Self` to `T` [ConversionFailure] - // CHECK:STDERR: let t: T = T.G(); - // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_todo_nested_period_self.carbon:[[@LINE+4]]:14: note: type `.Self` does not implement interface `Core.ImplicitAs(T)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let t: T = T.G(); - // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: fail_todo_nested_period_self.carbon:[[@LINE+7]]:21: error: cannot implicitly convert expression of type `.Self` to `T` [ConversionFailure] + // CHECK:STDERR: let unused t: T = T.G(); + // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: fail_todo_nested_period_self.carbon:[[@LINE+4]]:21: note: type `.Self` does not implement interface `Core.ImplicitAs(T)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused t: T = T.G(); + // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - let t: T = T.G(); + let unused t: T = T.G(); // U.G() has type T. - // CHECK:STDERR: fail_todo_nested_period_self.carbon:[[@LINE+7]]:14: error: cannot implicitly convert expression of type `.Self` to `T` [ConversionFailure] - // CHECK:STDERR: let u: T = U.G(); - // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_todo_nested_period_self.carbon:[[@LINE+4]]:14: note: type `.Self` does not implement interface `Core.ImplicitAs(T)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let u: T = U.G(); - // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: fail_todo_nested_period_self.carbon:[[@LINE+7]]:21: error: cannot implicitly convert expression of type `.Self` to `T` [ConversionFailure] + // CHECK:STDERR: let unused u: T = U.G(); + // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: fail_todo_nested_period_self.carbon:[[@LINE+4]]:21: note: type `.Self` does not implement interface `Core.ImplicitAs(T)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused u: T = U.G(); + // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - let u: T = U.G(); + let unused u: T = U.G(); // Shows both `I(.Self)` are `I(T)`. // CHECK:STDERR: fail_todo_nested_period_self.carbon:[[@LINE+4]]:9: error: found cycle in facet type constraint for `.(I(T).A)` [FacetTypeConstraintCycle] @@ -302,7 +302,7 @@ interface I(T:! type) { // TODO: This should be an error: The third `.Self` becomes is not able to be // bound to anything unambiguous here, as it could refer to `T` or to something // later being constrained by `T.A`. -fn F(T:! I(.Self) where .A = (I(.Self) where .A = I(.Self))) {} +fn F(unused T:! I(.Self) where .A = (I(.Self) where .A = I(.Self))) {} // --- period_self_parameter_sees_lhs_of_where_expr.carbon @@ -311,7 +311,7 @@ library "[[@TEST_NAME]]"; interface I(T:! Core.Destroy) {} // The `.Self` can see the LHS of the `where` to know `U` impls Core.Destroy. -fn F(U:! Core.Destroy where .Self impls I(.Self)) {} +fn F(unused U:! Core.Destroy where .Self impls I(.Self)) {} // --- fail_todo_period_self_parameter_constraint_satisfied_with_type_and.carbon library "[[@TEST_NAME]]"; @@ -321,14 +321,14 @@ interface I(T:! Core.Destroy) {} // TODO: Implied constraints that `.Self` impls `Core.Destroy` are satisfied by // the `&` expression. // -// CHECK:STDERR: fail_todo_period_self_parameter_constraint_satisfied_with_type_and.carbon:[[@LINE+7]]:25: error: cannot convert type `.Self` that implements `type` into type implementing `Core.Destroy` [ConversionFailureFacetToFacet] -// CHECK:STDERR: fn F(U:! Core.Destroy & I(.Self)) {} -// CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: fail_todo_period_self_parameter_constraint_satisfied_with_type_and.carbon:[[@LINE+7]]:32: error: cannot convert type `.Self` that implements `type` into type implementing `Core.Destroy` [ConversionFailureFacetToFacet] +// CHECK:STDERR: fn F(unused U:! Core.Destroy & I(.Self)) {} +// CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_todo_period_self_parameter_constraint_satisfied_with_type_and.carbon:[[@LINE-8]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] // CHECK:STDERR: interface I(T:! Core.Destroy) {} // CHECK:STDERR: ^ // CHECK:STDERR: -fn F(U:! Core.Destroy & I(.Self)) {} +fn F(unused U:! Core.Destroy & I(.Self)) {} // --- fail_todo_compound_lookup_on_returned_period_self_parameter.carbon library "[[@TEST_NAME]]"; diff --git a/toolchain/check/testdata/facet/require_import.carbon b/toolchain/check/testdata/facet/require_import.carbon index 7c3249ba3875..498ef5e9dd50 100644 --- a/toolchain/check/testdata/facet/require_import.carbon +++ b/toolchain/check/testdata/facet/require_import.carbon @@ -29,7 +29,7 @@ constraint X { //@include-in-dumps impl library "[[@TEST_NAME]]"; -fn F(A:! X, B:! Y) { +fn F(A:! X, unused B:! Y) { A.F(); } @@ -141,11 +141,11 @@ fn F(B:! Y) { // CHECK:STDOUT: %X.ref: type = name_ref X, imports.%Main.X [concrete = constants.%X.type] // CHECK:STDOUT: } // CHECK:STDOUT: %A.loc4_6.2: %X.type = symbolic_binding A, 0 [symbolic = %A.loc4_6.1 (constants.%A)] -// CHECK:STDOUT: %.loc4_17: type = splice_block %Y.ref [concrete = constants.%Y.type] { +// CHECK:STDOUT: %.loc4_24: type = splice_block %Y.ref [concrete = constants.%Y.type] { // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%Main.Y [concrete = constants.%Y.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %B.loc4_13.2: %Y.type = symbolic_binding B, 1 [symbolic = %B.loc4_13.1 (constants.%B)] +// CHECK:STDOUT: %B.loc4_20.2: %Y.type = symbolic_binding B, 1 [symbolic = %B.loc4_20.1 (constants.%B)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -206,9 +206,9 @@ fn F(B:! Y) { // CHECK:STDOUT: fn; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%A.loc4_6.2: %X.type, %B.loc4_13.2: %Y.type) { +// CHECK:STDOUT: generic fn @F(%A.loc4_6.2: %X.type, %B.loc4_20.2: %Y.type) { // CHECK:STDOUT: %A.loc4_6.1: %X.type = symbolic_binding A, 0 [symbolic = %A.loc4_6.1 (constants.%A)] -// CHECK:STDOUT: %B.loc4_13.1: %Y.type = symbolic_binding B, 1 [symbolic = %B.loc4_13.1 (constants.%B)] +// CHECK:STDOUT: %B.loc4_20.1: %Y.type = symbolic_binding B, 1 [symbolic = %B.loc4_20.1 (constants.%B)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %A.binding.as_type: type = symbolic_binding_type A, 0, %A.loc4_6.1 [symbolic = %A.binding.as_type (constants.%A.binding.as_type)] @@ -285,7 +285,7 @@ fn F(B:! Y) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%A, constants.%B) { // CHECK:STDOUT: %A.loc4_6.1 => constants.%A -// CHECK:STDOUT: %B.loc4_13.1 => constants.%B +// CHECK:STDOUT: %B.loc4_20.1 => constants.%B // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @X(constants.%A) { diff --git a/toolchain/check/testdata/facet/runtime_value.carbon b/toolchain/check/testdata/facet/runtime_value.carbon index bbcecaa33ef8..40439902c94e 100644 --- a/toolchain/check/testdata/facet/runtime_value.carbon +++ b/toolchain/check/testdata/facet/runtime_value.carbon @@ -23,7 +23,7 @@ fn F(c: C) { // Member access produces a reference, which is copied into the value // binding. //@dump-sem-ir-begin - let a: I = c.i; + let unused a: I = c.i; //@dump-sem-ir-end } @@ -44,11 +44,11 @@ fn F(c: C) { // TODO: This copy should work, but the narrowing prevents it currently. // //@dump-sem-ir-begin - // CHECK:STDERR: fail_todo_facet_copy_narrowing_from_reference.carbon:[[@LINE+4]]:14: error: semantics TODO: `conversion of runtime facet value` [SemanticsTodo] - // CHECK:STDERR: let a: I = c.ij; - // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_todo_facet_copy_narrowing_from_reference.carbon:[[@LINE+4]]:21: error: semantics TODO: `conversion of runtime facet value` [SemanticsTodo] + // CHECK:STDERR: let unused a: I = c.ij; + // CHECK:STDERR: ^~~~ // CHECK:STDERR: - let a: I = c.ij; + let unused a: I = c.ij; //@dump-sem-ir-end } @@ -148,10 +148,10 @@ fn F(T: Z) { // CHECK:STDOUT: } // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %i.ref: %C.elem = name_ref i, @C.%.loc6 [concrete = @C.%.loc6] -// CHECK:STDOUT: %.loc13_15.1: ref %I.type = class_element_access %c.ref, element0 -// CHECK:STDOUT: %.loc13_15.2: %I.type = acquire_value %.loc13_15.1 +// CHECK:STDOUT: %.loc13_22.1: ref %I.type = class_element_access %c.ref, element0 +// CHECK:STDOUT: %.loc13_22.2: %I.type = acquire_value %.loc13_22.1 // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] -// CHECK:STDOUT: %a: %I.type = value_binding a, %.loc13_15.2 +// CHECK:STDOUT: %a: %I.type = value_binding a, %.loc13_22.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -175,8 +175,8 @@ fn F(T: Z) { // CHECK:STDOUT: } // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %ij.ref: %C.elem = name_ref ij, @C.%.loc7_9 [concrete = @C.%.loc7_9] -// CHECK:STDOUT: %.loc21_15.1: ref %facet_type = class_element_access %c.ref, element0 -// CHECK:STDOUT: %.loc21_15.2: %facet_type = acquire_value %.loc21_15.1 +// CHECK:STDOUT: %.loc21_22.1: ref %facet_type = class_element_access %c.ref, element0 +// CHECK:STDOUT: %.loc21_22.2: %facet_type = acquire_value %.loc21_22.1 // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: %a: %I.type = value_binding a, [concrete = ] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/tuple_and_struct_type_literal.carbon b/toolchain/check/testdata/facet/tuple_and_struct_type_literal.carbon index 19165addb57f..85b885ca75fe 100644 --- a/toolchain/check/testdata/facet/tuple_and_struct_type_literal.carbon +++ b/toolchain/check/testdata/facet/tuple_and_struct_type_literal.carbon @@ -106,8 +106,8 @@ impl forall [U:! type] U as Z {} constraint N {} -fn InterfaceParam(U:! Z) {} -fn ConstraintParam(U:! N) {} +fn InterfaceParam(unused U:! Z) {} +fn ConstraintParam(unused U:! N) {} fn F() { InterfaceParam({}); @@ -122,8 +122,8 @@ impl forall [U:! type] U as Z {} constraint N {} -fn InterfaceParam(U:! Z) {} -fn ConstraintParam(U:! N) {} +fn InterfaceParam(unused U:! Z) {} +fn ConstraintParam(unused U:! N) {} fn F() { // CHECK:STDERR: fail_struct_literal_with_field_to_facet_type_parameter.carbon:[[@LINE+10]]:3: error: cannot implicitly convert non-type value of type `{.a: ()}` into type implementing `Z` [ConversionFailureNonTypeToFacet] @@ -132,9 +132,9 @@ fn F() { // CHECK:STDERR: fail_struct_literal_with_field_to_facet_type_parameter.carbon:[[@LINE+7]]:3: note: type `{.a: ()}` does not implement interface `Core.ImplicitAs(Z)` [MissingImplInMemberAccessNote] // CHECK:STDERR: InterfaceParam({.a = ()}); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_struct_literal_with_field_to_facet_type_parameter.carbon:[[@LINE-10]]:19: note: initializing generic parameter `U` declared here [InitializingGenericParam] - // CHECK:STDERR: fn InterfaceParam(U:! Z) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_struct_literal_with_field_to_facet_type_parameter.carbon:[[@LINE-10]]:26: note: initializing generic parameter `U` declared here [InitializingGenericParam] + // CHECK:STDERR: fn InterfaceParam(unused U:! Z) {} + // CHECK:STDERR: ^ // CHECK:STDERR: InterfaceParam({.a = ()}); // CHECK:STDERR: fail_struct_literal_with_field_to_facet_type_parameter.carbon:[[@LINE+10]]:3: error: cannot implicitly convert non-type value of type `{.a: ()}` into type implementing `N` [ConversionFailureNonTypeToFacet] @@ -143,9 +143,9 @@ fn F() { // CHECK:STDERR: fail_struct_literal_with_field_to_facet_type_parameter.carbon:[[@LINE+7]]:3: note: type `{.a: ()}` does not implement interface `Core.ImplicitAs(N)` [MissingImplInMemberAccessNote] // CHECK:STDERR: ConstraintParam({.a = ()}); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_struct_literal_with_field_to_facet_type_parameter.carbon:[[@LINE-20]]:20: note: initializing generic parameter `U` declared here [InitializingGenericParam] - // CHECK:STDERR: fn ConstraintParam(U:! N) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_struct_literal_with_field_to_facet_type_parameter.carbon:[[@LINE-20]]:27: note: initializing generic parameter `U` declared here [InitializingGenericParam] + // CHECK:STDERR: fn ConstraintParam(unused U:! N) {} + // CHECK:STDERR: ^ // CHECK:STDERR: ConstraintParam({.a = ()}); } @@ -158,8 +158,8 @@ impl forall [U:! type] U as Z {} constraint N {} -fn InterfaceParam(U:! Z) {} -fn ConstraintParam(U:! N) {} +fn InterfaceParam(unused U:! Z) {} +fn ConstraintParam(unused U:! N) {} fn F() { InterfaceParam(()); @@ -182,8 +182,8 @@ impl forall [T:! type, U:! type] U as Z(T) {} constraint N(U:! type) {} class C; -fn InterfaceParam(U:! Z(C)) {} -fn ConstraintParam(U:! N(C)) {} +fn InterfaceParam(unused U:! Z(C)) {} +fn ConstraintParam(unused U:! N(C)) {} fn F() { InterfaceParam({}); @@ -199,8 +199,8 @@ impl forall [T:! type, U:! type] U as Z(T) {} constraint N(U:! type) {} class C; -fn InterfaceParam(U:! Z(C)) {} -fn ConstraintParam(U:! N(C)) {} +fn InterfaceParam(unused U:! Z(C)) {} +fn ConstraintParam(unused U:! N(C)) {} fn F() { InterfaceParam(()); @@ -222,8 +222,8 @@ impl forall [T:! type, U:! type] U as Z(T) {} constraint N(U:! type) {} -fn InterfaceParam(T:! type, U:! Z(T)) {} -fn ConstraintParam(T:! type, U:! N(T)) {} +fn InterfaceParam(T:! type, unused U:! Z(T)) {} +fn ConstraintParam(T:! type, unused U:! N(T)) {} fn F(T:! type) { InterfaceParam((), {}); @@ -241,8 +241,8 @@ impl forall [T:! type, U:! type] U as Z(T) {} constraint N(U:! type) {} -fn InterfaceParam(T:! type, U:! Z(T)) {} -fn ConstraintParam(T:! type, U:! N(T)) {} +fn InterfaceParam(T:! type, unused U:! Z(T)) {} +fn ConstraintParam(T:! type, unused U:! N(T)) {} fn F(T:! type) { InterfaceParam({}, ()); diff --git a/toolchain/check/testdata/facet/tuple_and_struct_type_value.carbon b/toolchain/check/testdata/facet/tuple_and_struct_type_value.carbon index 0f1440a73ddb..d86fc42eca31 100644 --- a/toolchain/check/testdata/facet/tuple_and_struct_type_value.carbon +++ b/toolchain/check/testdata/facet/tuple_and_struct_type_value.carbon @@ -18,8 +18,8 @@ impl forall [U:! type] U as Z {} constraint N {} -fn InterfaceParam(U:! Z) {} -fn ConstraintParam(U:! N) {} +fn InterfaceParam(unused U:! Z) {} +fn ConstraintParam(unused U:! N) {} fn F(T:! (type, ), U:! type, Empty:! ()) { // Passes a symbolic binding of type TupleType. @@ -50,8 +50,8 @@ impl forall [U:! type] U as Z {} constraint N {} -fn InterfaceParam(U:! Z) {} -fn ConstraintParam(U:! N) {} +fn InterfaceParam(unused U:! Z) {} +fn ConstraintParam(unused U:! N) {} fn F(T:! {}) { // Passes a symbolic binding of type StructType. @@ -71,8 +71,8 @@ impl forall [U:! type] U as Z {} constraint N {} -fn InterfaceParam(U:! Z) {} -fn ConstraintParam(U:! N) {} +fn InterfaceParam(unused U:! Z) {} +fn ConstraintParam(unused U:! N) {} fn F(T:! {.a: type}) { // CHECK:STDERR: fail_struct_value_with_field_to_facet_value.carbon:[[@LINE+10]]:3: error: cannot implicitly convert non-type value of type `{.a: type}` into type implementing `Z` [ConversionFailureNonTypeToFacet] @@ -81,9 +81,9 @@ fn F(T:! {.a: type}) { // CHECK:STDERR: fail_struct_value_with_field_to_facet_value.carbon:[[@LINE+7]]:3: note: type `{.a: type}` does not implement interface `Core.ImplicitAs(Z)` [MissingImplInMemberAccessNote] // CHECK:STDERR: InterfaceParam(T); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_struct_value_with_field_to_facet_value.carbon:[[@LINE-10]]:19: note: initializing generic parameter `U` declared here [InitializingGenericParam] - // CHECK:STDERR: fn InterfaceParam(U:! Z) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_struct_value_with_field_to_facet_value.carbon:[[@LINE-10]]:26: note: initializing generic parameter `U` declared here [InitializingGenericParam] + // CHECK:STDERR: fn InterfaceParam(unused U:! Z) {} + // CHECK:STDERR: ^ // CHECK:STDERR: InterfaceParam(T); // CHECK:STDERR: fail_struct_value_with_field_to_facet_value.carbon:[[@LINE+10]]:3: error: cannot implicitly convert non-type value of type `{.a: type}` into type implementing `N` [ConversionFailureNonTypeToFacet] @@ -92,9 +92,9 @@ fn F(T:! {.a: type}) { // CHECK:STDERR: fail_struct_value_with_field_to_facet_value.carbon:[[@LINE+7]]:3: note: type `{.a: type}` does not implement interface `Core.ImplicitAs(N)` [MissingImplInMemberAccessNote] // CHECK:STDERR: ConstraintParam(T); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_struct_value_with_field_to_facet_value.carbon:[[@LINE-20]]:20: note: initializing generic parameter `U` declared here [InitializingGenericParam] - // CHECK:STDERR: fn ConstraintParam(U:! N) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_struct_value_with_field_to_facet_value.carbon:[[@LINE-20]]:27: note: initializing generic parameter `U` declared here [InitializingGenericParam] + // CHECK:STDERR: fn ConstraintParam(unused U:! N) {} + // CHECK:STDERR: ^ // CHECK:STDERR: ConstraintParam(T); } diff --git a/toolchain/check/testdata/facet/validate_impl_constraints.carbon b/toolchain/check/testdata/facet/validate_impl_constraints.carbon index b40333d26da9..65821079a5e1 100644 --- a/toolchain/check/testdata/facet/validate_impl_constraints.carbon +++ b/toolchain/check/testdata/facet/validate_impl_constraints.carbon @@ -15,7 +15,7 @@ library "[[@TEST_NAME]]"; interface I { let X:! type; } -fn F(T:! I where .X = ()) {} +fn F(unused T:! I where .X = ()) {} fn G(T:! I where .Self impls (I where .X = ())) { F(T); @@ -26,15 +26,15 @@ library "[[@TEST_NAME]]"; interface I { let X:! type; } -fn F(T:! I where .X = ()) {} +fn F(unused T:! I where .X = ()) {} fn G(T:! I where .Self impls (I where .X = {})) { // CHECK:STDERR: fail_self_impls_modifies_assoc_constant_type_differs.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `I where .(I.X) = {}` into type implementing `I where .(I.X) = ()` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_self_impls_modifies_assoc_constant_type_differs.carbon:[[@LINE-6]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I where .X = ()) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_self_impls_modifies_assoc_constant_type_differs.carbon:[[@LINE-6]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I where .X = ()) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -52,15 +52,15 @@ impl forall [U:! L] C(U) as M where .M0 = {} {} // U requires that C(.Self) impls M. // - C(.Self) impls M can be rewritten as C(U) impls M. // - C(U) impls M if U impls L => Requires U impls L. -fn F(U:! type where C(.Self) impls (M where .M0 = {})) {} +fn F(unused U:! type where C(.Self) impls (M where .M0 = {})) {} fn G(T:! L) { // CHECK:STDERR: fail_todo_where_impls_tests_associated_constant_of_generic_type.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `L` into type implementing `type where...` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_todo_where_impls_tests_associated_constant_of_generic_type.carbon:[[@LINE-6]]:6: note: initializing generic parameter `U` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(U:! type where C(.Self) impls (M where .M0 = {})) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_todo_where_impls_tests_associated_constant_of_generic_type.carbon:[[@LINE-6]]:13: note: initializing generic parameter `U` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused U:! type where C(.Self) impls (M where .M0 = {})) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -78,15 +78,15 @@ impl forall [U:! L] C(U) as M where .M0 = () {} // U requires that C(.Self) impls M. // - C(.Self) impls M can be rewritten as C(U) impls M. // - C(U) impls M if U impls L => Requires U impls L. -fn F(U:! type where C(.Self) impls (M where .M0 = {})) {} +fn F(unused U:! type where C(.Self) impls (M where .M0 = {})) {} fn G(T:! L) { // CHECK:STDERR: fail_where_impls_tests_associated_constant_of_generic_type_type_differs.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `L` into type implementing `type where...` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_where_impls_tests_associated_constant_of_generic_type_type_differs.carbon:[[@LINE-6]]:6: note: initializing generic parameter `U` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(U:! type where C(.Self) impls (M where .M0 = {})) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_where_impls_tests_associated_constant_of_generic_type_type_differs.carbon:[[@LINE-6]]:13: note: initializing generic parameter `U` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused U:! type where C(.Self) impls (M where .M0 = {})) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -97,7 +97,7 @@ library "[[@TEST_NAME]]"; interface Z {} interface I(T:! type) {} -fn F(T:! I(.Self) where .Self impls Z) {} +fn F(unused T:! I(.Self) where .Self impls Z) {} fn G(T:! Z & I(.Self)) { F(T); @@ -111,14 +111,14 @@ interface I(T:! Z) {} // Implied constraint: .Self impls Z, which is satisfied and checked at the end // of the fn signature. -// CHECK:STDERR: fail_todo_self_in_interface_generic_param_constrained.carbon:[[@LINE+7]]:10: error: cannot convert type `.Self` that implements `type` into type implementing `Z` [ConversionFailureFacetToFacet] -// CHECK:STDERR: fn F(T:! I(.Self) where .Self impls Z) {} -// CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: fail_todo_self_in_interface_generic_param_constrained.carbon:[[@LINE+7]]:17: error: cannot convert type `.Self` that implements `type` into type implementing `Z` [ConversionFailureFacetToFacet] +// CHECK:STDERR: fn F(unused T:! I(.Self) where .Self impls Z) {} +// CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_todo_self_in_interface_generic_param_constrained.carbon:[[@LINE-7]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] // CHECK:STDERR: interface I(T:! Z) {} // CHECK:STDERR: ^ // CHECK:STDERR: -fn F(T:! I(.Self) where .Self impls Z) {} +fn F(unused T:! I(.Self) where .Self impls Z) {} // CHECK:STDERR: fail_todo_self_in_interface_generic_param_constrained.carbon:[[@LINE+7]]:14: error: cannot convert type `.Self` that implements `type` into type implementing `Z` [ConversionFailureFacetToFacet] // CHECK:STDERR: fn G(T:! Z & I(.Self)) { diff --git a/toolchain/check/testdata/facet/validate_rewrite_constraints.carbon b/toolchain/check/testdata/facet/validate_rewrite_constraints.carbon index 9a24b24e7431..7cf21c553005 100644 --- a/toolchain/check/testdata/facet/validate_rewrite_constraints.carbon +++ b/toolchain/check/testdata/facet/validate_rewrite_constraints.carbon @@ -15,7 +15,7 @@ library "[[@TEST_NAME]]"; interface I { let X:! type; } -fn F(T:! I where .X = ()) {} +fn F(unused T:! I where .X = ()) {} fn G(T:! I where .X = ()) { F(T); @@ -30,7 +30,7 @@ class C; final impl forall [T:! type] T as I(()) where .X = () {} final impl forall [T:! type] T as I({}) where .X = {} {} -fn F(U:! type, T:! I(U) where .X = ()) {} +fn F(U:! type, unused T:! I(U) where .X = ()) {} fn G() { F((), C); } @@ -44,7 +44,7 @@ class C; final impl forall [T:! type] T as I(()) where .X = () {} final impl forall [T:! type] T as I({}) where .X = {} {} -fn F(U:! type, T:! I(U) where .X = ()) {} +fn F(U:! type, unused T:! I(U) where .X = ()) {} fn G() { // This finds the impl where `.X = {}`, but F requires that `.X = ()`. // @@ -52,8 +52,8 @@ fn G() { // CHECK:STDERR: F({}, C); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_generic_interface_facet_value_wrong_specific_impl.carbon:[[@LINE-7]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn F(U:! type, T:! I(U) where .X = ()) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn F(U:! type, unused T:! I(U) where .X = ()) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: F({}, C); } @@ -75,7 +75,7 @@ library "[[@TEST_NAME]]"; interface I { let X:! type; } -fn F(T:! I where .X = {.a: (), .b: {}}) {} +fn F(unused T:! I where .X = {.a: (), .b: {}}) {} fn H() { class C; @@ -83,9 +83,9 @@ fn H() { // CHECK:STDERR: fail_convert.carbon:[[@LINE+7]]:3: error: cannot convert type `C` into type implementing `I where .(I.X) = {.a: (), .b: {}}` [ConversionFailureTypeToFacet] // CHECK:STDERR: F(C); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_convert.carbon:[[@LINE-8]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I where .X = {.a: (), .b: {}}) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_convert.carbon:[[@LINE-8]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I where .X = {.a: (), .b: {}}) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(C); } @@ -94,9 +94,9 @@ fn G(T:! I where .X = {.b: {}, .a: ()}) { // CHECK:STDERR: fail_convert.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `I where .(I.X) = {.b: {}, .a: ()}` into type implementing `I where .(I.X) = {.a: (), .b: {}}` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_convert.carbon:[[@LINE-19]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I where .X = {.a: (), .b: {}}) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_convert.carbon:[[@LINE-19]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I where .X = {.a: (), .b: {}}) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -128,7 +128,7 @@ interface I(T:! type) { let X:! type; } final impl forall [J:! I(()) where .X = ()] J as I({}) where .X = {} {} -fn F(T:! I({}) where .X = {}) {} +fn F(unused T:! I({}) where .X = {}) {} fn G(T:! I(()) where .X = ()) { F(T); @@ -162,15 +162,15 @@ interface I(T:! type) { let X:! type; } final impl forall [J:! I(()) where .X = {}] J as I({}) where .X = {} {} -fn F(T:! I({}) where .X = {}) {} +fn F(unused T:! I({}) where .X = {}) {} fn G(T:! I(()) where .X = ()) { // CHECK:STDERR: fail_parameterized_interface_with_wrong_where_in_impl_deduction.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `I(()) where .(I(()).X) = ()` into type implementing `I({}) where .(I({}).X) = {}` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_parameterized_interface_with_wrong_where_in_impl_deduction.carbon:[[@LINE-6]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I({}) where .X = {}) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_parameterized_interface_with_wrong_where_in_impl_deduction.carbon:[[@LINE-6]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I({}) where .X = {}) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -183,7 +183,7 @@ interface I { let X2:! type; } -fn F(T:! I where .X1 = () and .X2 = ()) {} +fn F(unused T:! I where .X1 = () and .X2 = ()) {} fn G() { class C; @@ -203,7 +203,7 @@ interface I { let X2:! type; } -fn F(T:! I where .X1 = .X2 and .X2 = ()) {} +fn F(unused T:! I where .X1 = .X2 and .X2 = ()) {} fn G() { class C; @@ -223,7 +223,7 @@ interface I { let X2:! type; } -fn F(T:! I where .X1 = .X2 and .X2 = ()) {} +fn F(unused T:! I where .X1 = .X2 and .X2 = ()) {} fn G() { class C1; @@ -251,7 +251,7 @@ interface I { let X2:! type; } -fn F(T:! I where .X1 = .X2) {} +fn F(unused T:! I where .X1 = .X2) {} class C; // .X2 is not set in the impl definition, so its value is an ErrorInst @@ -270,9 +270,9 @@ fn G() { // CHECK:STDERR: fail_error_in_witness_table.carbon:[[@LINE+7]]:3: error: cannot convert type `C` into type implementing `I where .(I.X1) = .(I.X2)` [ConversionFailureTypeToFacet] // CHECK:STDERR: F(C); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_error_in_witness_table.carbon:[[@LINE-19]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I where .X1 = .X2) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_error_in_witness_table.carbon:[[@LINE-19]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I where .X1 = .X2) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(C); } @@ -287,7 +287,7 @@ class C; final impl forall [T:! I] T as J where .Y = C {} -fn F(T:! I & J where .Y = C) {} +fn F(unused T:! I & J where .Y = C) {} fn G(T:! I) { F(T); } @@ -302,7 +302,7 @@ class C; final impl forall [T:! J] T as I {} -fn F(T:! I & J where .Y = C) {} +fn F(unused T:! I & J where .Y = C) {} fn G(T:! J where .Y = C) { F(T); } @@ -314,7 +314,7 @@ interface I { let X:! type; } impl forall [U:! type] U as I where .X = () {} -fn F(T:! I where .X = ()) {} +fn F(unused T:! I where .X = ()) {} class C(T:! type); @@ -325,9 +325,9 @@ fn G(T:! type) { // CHECK:STDERR: fail_non_final_impl_deduce.carbon:[[@LINE+7]]:3: error: cannot convert type `C(T)` into type implementing `I where .(I.X) = ()` [ConversionFailureTypeToFacet] // CHECK:STDERR: F(C(T)); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_non_final_impl_deduce.carbon:[[@LINE-11]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I where .X = ()) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_non_final_impl_deduce.carbon:[[@LINE-11]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I where .X = ()) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(C(T)); } @@ -359,7 +359,7 @@ interface I { let X:! type; } impl forall [U:! type] U as I where .X = () {} -fn F(T:! I where .X = ()) {} +fn F(unused T:! I where .X = ()) {} fn G() { class C; @@ -385,7 +385,7 @@ interface I { let X:! type; } final impl forall [U:! type] U as I where .X = () {} -fn F(T:! I where .X = ()) {} +fn F(unused T:! I where .X = ()) {} fn G() { class C; @@ -412,7 +412,7 @@ interface I { let X:! type; } class C; impl C as I where .X = () {} -fn F(T:! I where .X = ()) {} +fn F(unused T:! I where .X = ()) {} fn G() { F(C); } @@ -439,7 +439,7 @@ interface I { class C(T:! type); -fn F(T:! I where .X = C(.Y)) {} +fn F(unused T:! I where .X = C(.Y)) {} fn G(T:! I where .X = C(()) and .Y = ()) { F(T); @@ -455,15 +455,15 @@ interface I { class C(T:! type); -fn F(T:! I where .X = C(.Y)) {} +fn F(unused T:! I where .X = C(.Y)) {} fn G(T:! I where .X = C(()) and .Y = {}) { // CHECK:STDERR: fail_wrong_rewrite_value_in_class_param.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `I where .(I.X) = C(()) and .(I.Y) = {}` into type implementing `I where .(I.X) = C(.(I.Y))` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_wrong_rewrite_value_in_class_param.carbon:[[@LINE-6]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I where .X = C(.Y)) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_wrong_rewrite_value_in_class_param.carbon:[[@LINE-6]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I where .X = C(.Y)) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -476,7 +476,7 @@ interface I { fn F(); } -fn F(T:! I where .X = ()) {} +fn F(unused T:! I where .X = ()) {} fn G(T:! I where .X = ()) { F(T); @@ -491,7 +491,7 @@ interface I { fn A(); } -fn F(T:! I where .Y = .A) {} +fn F(unused T:! I where .Y = .A) {} fn G(T:! I where .Y = .A) { F(T); @@ -507,15 +507,15 @@ interface I { fn B(); } -fn F(T:! I where .Y = .A) {} +fn F(unused T:! I where .Y = .A) {} fn G(T:! I where .Y = .B) { // CHECK:STDERR: fail_wrong_function_as_rewrite_value.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `I where .(I.Y) = .(I.B)` into type implementing `I where .(I.Y) = .(I.A)` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_wrong_function_as_rewrite_value.carbon:[[@LINE-6]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I where .Y = .A) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_wrong_function_as_rewrite_value.carbon:[[@LINE-6]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I where .Y = .A) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -537,15 +537,15 @@ interface J { fn B(); } -fn F(T:! I & J where .Y = .A) {} +fn F(unused T:! I & J where .Y = .A) {} fn G(T:! I & J where .Y = .B) { // CHECK:STDERR: fail_wrong_function_as_rewrite_value_in_other_interface.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `I & J where .(I.Y) = .(J.B)` into type implementing `I & J where .(I.Y) = .(I.A)` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_wrong_function_as_rewrite_value_in_other_interface.carbon:[[@LINE-6]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I & J where .Y = .A) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_wrong_function_as_rewrite_value_in_other_interface.carbon:[[@LINE-6]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I & J where .Y = .A) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -556,7 +556,7 @@ library "[[@TEST_NAME]]"; interface I { let X:! type; } interface K(Y:! type) { } -fn F(T:! I where .X = {.k: K(I where .X = ())}) {} +fn F(unused T:! I where .X = {.k: K(I where .X = ())}) {} fn G(T:! I where .X = {.k: K(I where .X = ())}) { F(T); @@ -661,7 +661,7 @@ interface I { class C(T:! type); -fn F(T:! I where .X1 = .X3 and .X2 = C(.X3) and .X3 = ()) {} +fn F(unused T:! I where .X1 = .X3 and .X2 = C(.X3) and .X3 = ()) {} fn G(T:! I where .X1 = () and .X2 = C(()) and .X3 = ()) { F(T); @@ -678,7 +678,7 @@ interface I { class C(T:! type); -fn F(T:! I where .X1 = () and .X2 = C(()) and .X3 = .X1) {} +fn F(unused T:! I where .X1 = () and .X2 = C(()) and .X3 = .X1) {} fn G(T:! I where .X1 = .X3 and .X2 = C(.X1) and .X3 = ()) { F(T); @@ -692,7 +692,7 @@ interface I { let X2:! type; } -fn F(U:! I where .X1 = {}, T:! I where .X1 = () and .X2 = U.X1) {} +fn F(U:! I where .X1 = {}, unused T:! I where .X1 = () and .X2 = U.X1) {} fn G(U:! I where .X1 = {} and .X2 = (), T:! I where .X1 = U.X2 and .X2 = {}) { F(U, T); @@ -707,7 +707,7 @@ interface I { let X3:! type; } -fn F(T:! I where .X1 = .Self and .X2 = .X1.X3 and .X3 = ()) {} +fn F(unused T:! I where .X1 = .Self and .X2 = .X1.X3 and .X3 = ()) {} fn G(T:! I where .X1 = .Self and .X2 = () and .X3 = ()) { F(T); @@ -730,7 +730,7 @@ class C; // This looks for a bug where `.Self.A` resolves to `C` from `.T.A` in the // incoming facet value, which is incorrect. It should be `.T.X.A` which // resolves to `{}`. -fn F(U:! I where .X = (I where .A = {})) {} +fn F(unused U:! I where .X = (I where .A = {})) {} fn G(T:! I where .X = (I where .A = {}) and .A = C) { F(T); @@ -746,7 +746,7 @@ interface I { class C(T:! type); -fn F(T:! I where .X = C(.Y)) {} +fn F(unused T:! I where .X = C(.Y)) {} fn G(T:! I where .X = C({}) and .Y = {}) { F(T); @@ -762,7 +762,7 @@ interface I(T:! type) { class C; -fn F(T:! I(C) where .X = (I(.Y) where .Y = ())) {} +fn F(unused T:! I(C) where .X = (I(.Y) where .Y = ())) {} fn G(T:! I(C) where .X = (I({}) where .Y = ()) and .Y = {}) { // TODO: The T in G should match the T in F, once the .Self reference to the @@ -771,9 +771,9 @@ fn G(T:! I(C) where .X = (I({}) where .Y = ()) and .Y = {}) { // CHECK:STDERR: fail_todo_rewrite_requires_subst_in_nested_facet_type.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `I(C) where .(I(C).X) = I({}) where .(I({}).Y) = () and .(I(C).Y) = {}` into type implementing `I(C) where .(I(C).X) = I(.(I(C).Y)) where .(I(.(I(C).Y)).Y) = ()` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_todo_rewrite_requires_subst_in_nested_facet_type.carbon:[[@LINE-9]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I(C) where .X = (I(.Y) where .Y = ())) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_todo_rewrite_requires_subst_in_nested_facet_type.carbon:[[@LINE-9]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I(C) where .X = (I(.Y) where .Y = ())) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -790,16 +790,16 @@ interface I(T:! type) { let Y:! type; } -fn F(T:! I({}) where .X = (I(.Y) where .X = ())) {} +fn F(unused T:! I({}) where .X = (I(.Y) where .X = ())) {} // I(.Y) is I({}) which doesn't match I(()). fn G(T:! I({}) where .X = (I(()) where .X = ()) and .Y = {}) { // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_facet_type_types_differ.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `I({}) where .(I({}).X) = I(()) where .(I(()).X) = () and .(I({}).Y) = {}` into type implementing `I({}) where .(I({}).X) = I(.(I({}).Y)) where .(I(.(I({}).Y)).X) = ()` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_facet_type_types_differ.carbon:[[@LINE-7]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I({}) where .X = (I(.Y) where .X = ())) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_facet_type_types_differ.carbon:[[@LINE-7]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I({}) where .X = (I(.Y) where .X = ())) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -812,7 +812,7 @@ interface I { let Y:! type; } -fn F(T:! I where .X = (I where .X = () and .Y = ())) {} +fn F(unused T:! I where .X = (I where .X = () and .Y = ())) {} fn G(T:! I where .X = (I where .X = .Y and .Y = ())) { F(T); @@ -827,15 +827,15 @@ interface I { let Z:! type; } -fn F(T:! I where .X = (I where .X = .Y)) {} +fn F(unused T:! I where .X = (I where .X = .Y)) {} fn G(T:! I where .X = (I where .X = () and .Y = () and .Z = {})) { // CHECK:STDERR: fail_facet_type_in_assoc_constant_differs.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `I where .(I.X) = I where .(I.X) = () and .(I.Y) = () and .(I.Z) = {}` into type implementing `I where .(I.X) = I where .(I.X) = .(I.Y)` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_facet_type_in_assoc_constant_differs.carbon:[[@LINE-6]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I where .X = (I where .X = .Y)) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_facet_type_in_assoc_constant_differs.carbon:[[@LINE-6]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I where .X = (I where .X = .Y)) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -849,7 +849,7 @@ interface I { let Z:! type; } -fn F(T:! I where .X = (I where .Y = (I where .X = () and .Y = ()))) {} +fn F(unused T:! I where .X = (I where .Y = (I where .X = () and .Y = ()))) {} fn G(T:! I where .X = (I where .Y = (I where .X = .Y and .Y = ()))) { F(T); @@ -863,7 +863,7 @@ interface I { let Y:! type; } -fn F(T:! I where .Y = ()) {} +fn F(unused T:! I where .Y = ()) {} // The `.Y = ()` is on a different `.Self` than `T` (an unattached self), so // should not satisfy `F`. @@ -871,9 +871,9 @@ fn G(T:! I where .X = (I where .Y = ())) { // CHECK:STDERR: fail_nested_facet_type_assigns_same_assoc_constant.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `I where .(I.X) = I where .(I.Y) = ()` into type implementing `I where .(I.Y) = ()` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_nested_facet_type_assigns_same_assoc_constant.carbon:[[@LINE-8]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I where .Y = ()) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_nested_facet_type_assigns_same_assoc_constant.carbon:[[@LINE-8]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I where .Y = ()) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -887,7 +887,7 @@ interface I { let Z:! type; } -fn F(T:! I where .X = (I where .Y = (I where .X = .Y))) {} +fn F(unused T:! I where .X = (I where .Y = (I where .X = .Y))) {} // `.X = .Y` does not match `.X = () and .Y = ()` as they are different resolved // facet types. @@ -895,9 +895,9 @@ fn G(T:! I where .X = (I where .Y = (I where .X = () and .Y = ()))) { // CHECK:STDERR: fail_nested_facet_type_in_assoc_constant_differs.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `I where .(I.X) = I where .(I.Y) = I where .(I.X) = () and .(I.Y) = ()` into type implementing `I where .(I.X) = I where .(I.Y) = I where .(I.X) = .(I.Y)` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_nested_facet_type_in_assoc_constant_differs.carbon:[[@LINE-8]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I where .X = (I where .Y = (I where .X = .Y))) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_nested_facet_type_in_assoc_constant_differs.carbon:[[@LINE-8]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I where .X = (I where .Y = (I where .X = .Y))) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -908,9 +908,9 @@ fn G2(T:! I where .X = (I where .Y = (I where .X = .Y and .Z = {}))) { // CHECK:STDERR: fail_nested_facet_type_in_assoc_constant_differs.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `I where .(I.X) = I where .(I.Y) = I where .(I.X) = .(I.Y) and .(I.Z) = {}` into type implementing `I where .(I.X) = I where .(I.Y) = I where .(I.X) = .(I.Y)` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_nested_facet_type_in_assoc_constant_differs.carbon:[[@LINE-21]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I where .X = (I where .Y = (I where .X = .Y))) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_nested_facet_type_in_assoc_constant_differs.carbon:[[@LINE-21]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I where .X = (I where .Y = (I where .X = .Y))) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -923,7 +923,7 @@ interface I { let Y:! type; } -fn F(T:! I where .X = (I where .Y = (I where .X = .Y, ))) {} +fn F(unused T:! I where .X = (I where .Y = (I where .X = .Y, ))) {} // References to named constants in a facet type don't work at all. If they did, // then when the `Constant` facet type is put into the RHS of a rewrite @@ -995,7 +995,7 @@ interface I { let Y:! type; } -fn F(T:! I where .X = (I where .Y = (I where .X = .Y, ))) {} +fn F(unused T:! I where .X = (I where .Y = (I where .X = .Y, ))) {} fn G1() { // CHECK:STDERR: fail_nested_facet_type_from_constant_differs.carbon:[[@LINE+4]]:7: error: semantics TODO: `local `let :!` bindings are currently unsupported` [SemanticsTodo] @@ -1025,7 +1025,7 @@ interface K { let K1:! J; } -fn F(T:! I & J & K where .K1 = .Self and .J1 = .Self and .I1 = (.K1.J1).I2) {} +fn F(unused T:! I & J & K where .K1 = .Self and .J1 = .Self and .I1 = (.K1.J1).I2) {} fn G(T:! I & J & K where .K1 = .Self and .J1 = .Self and .I1 = .I2) { F(T); @@ -1047,16 +1047,16 @@ interface K { let K1:! J; } -fn F(T:! I & J & K where .K1 = .Self and .J1 = .Self and .I1 = (.K1.J1).I2) {} +fn F(unused T:! I & J & K where .K1 = .Self and .J1 = .Self and .I1 = (.K1.J1).I2) {} // F's requirement I1 = I2 is not met, as I1 = () and I2 = {} fn G(T:! I & J & K where .K1 = .Self and .J1 = .Self and .I1 = () and .I2 = {}) { // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_self_wrong_type.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `I & J & K where .(K.K1) = .Self as J and .(J.J1) = .Self as I and .(I.I1) = () and .(I.I2) = {}` into type implementing `I & J & K where .(K.K1) = .Self as J and .(J.J1) = .Self as I and .(I.I1) = .(I.I2)` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_self_wrong_type.carbon:[[@LINE-7]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I & J & K where .K1 = .Self and .J1 = .Self and .I1 = (.K1.J1).I2) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_self_wrong_type.carbon:[[@LINE-7]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I & J & K where .K1 = .Self and .J1 = .Self and .I1 = (.K1.J1).I2) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -1066,9 +1066,9 @@ fn G2(T:! I & J & K where .K1 = .Self and .J1 = .Self and .I1 = {}) { // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_self_wrong_type.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `I & J & K where .(K.K1) = .Self as J and .(J.J1) = .Self as I and .(I.I1) = {}` into type implementing `I & J & K where .(K.K1) = .Self as J and .(J.J1) = .Self as I and .(I.I1) = .(I.I2)` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_self_wrong_type.carbon:[[@LINE-19]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I & J & K where .K1 = .Self and .J1 = .Self and .I1 = (.K1.J1).I2) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_self_wrong_type.carbon:[[@LINE-19]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I & J & K where .K1 = .Self and .J1 = .Self and .I1 = (.K1.J1).I2) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -1078,9 +1078,9 @@ fn G3(T:! I & J & K where .K1 = .Self and .J1 = .Self and .I2 = {}) { // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_self_wrong_type.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `I & J & K where .(K.K1) = .Self as J and .(J.J1) = .Self as I and .(I.I2) = {}` into type implementing `I & J & K where .(K.K1) = .Self as J and .(J.J1) = .Self as I and .(I.I1) = .(I.I2)` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_self_wrong_type.carbon:[[@LINE-31]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I & J & K where .K1 = .Self and .J1 = .Self and .I1 = (.K1.J1).I2) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_self_wrong_type.carbon:[[@LINE-31]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I & J & K where .K1 = .Self and .J1 = .Self and .I1 = (.K1.J1).I2) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -1104,15 +1104,15 @@ interface K { // .K1.J1 is an ImplWitnessAccess into Self. The Self witness will be subst'd in // for `U` and it will eval to the ImplWitnessAccess inside of `U.I1`. Then that // will need to be subst'd to find the value of I1 in U's witness. -fn F(U:! I, T:! J & K where .J2 = (.K1.J1).I1) {} +fn F(unused U:! I, unused T:! J & K where .J2 = (.K1.J1).I1) {} fn G(U:! I where .I1 = (), T:! J & K where .K1 = .Self and .J1 = U and .J2 = ()) { // CHECK:STDERR: fail_todo_rewrite_requires_subst_in_nested_access_of_other.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `J & K where .(J.J2) = () and .(K.K1) = .Self as J and .(J.J1) = U as I` into type implementing `J & K where .(J.J2) = .(K.K1).(J.J1).(I.I1)` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(U, T); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_todo_rewrite_requires_subst_in_nested_access_of_other.carbon:[[@LINE-6]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(U:! I, T:! J & K where .J2 = (.K1.J1).I1) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_todo_rewrite_requires_subst_in_nested_access_of_other.carbon:[[@LINE-6]]:27: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused U:! I, unused T:! J & K where .J2 = (.K1.J1).I1) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(U, T); } @@ -1133,16 +1133,16 @@ interface K { let K1:! J; } -fn F(U:! I, T:! J & K where .J2 = (.K1.J1).I1) {} +fn F(unused U:! I, unused T:! J & K where .J2 = (.K1.J1).I1) {} // F's requirement J2 = I1 is not met as J2 = () and I1 = {} fn G(U:! I where .I1 = {}, T:! J & K where .K1 = .Self and .J1 = U and .J2 = ()) { // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_wrong_type.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `J & K where .(J.J2) = () and .(K.K1) = .Self as J and .(J.J1) = U as I` into type implementing `J & K where .(J.J2) = .(K.K1).(J.J1).(I.I1)` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(U, T); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_wrong_type.carbon:[[@LINE-7]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(U:! I, T:! J & K where .J2 = (.K1.J1).I1) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_wrong_type.carbon:[[@LINE-7]]:27: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused U:! I, unused T:! J & K where .J2 = (.K1.J1).I1) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(U, T); } @@ -1152,9 +1152,9 @@ fn G2(U:! I, T:! J & K where .K1 = .Self and .J1 = U and .J2 = ()) { // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_wrong_type.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `J & K where .(J.J2) = () and .(K.K1) = .Self as J and .(J.J1) = U` into type implementing `J & K where .(J.J2) = .(K.K1).(J.J1).(I.I1)` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(U, T); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_wrong_type.carbon:[[@LINE-19]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(U:! I, T:! J & K where .J2 = (.K1.J1).I1) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_wrong_type.carbon:[[@LINE-19]]:27: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused U:! I, unused T:! J & K where .J2 = (.K1.J1).I1) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(U, T); } @@ -1164,9 +1164,9 @@ fn G3(U:! I where .I1 = {}, T:! J & K where .K1 = .Self and .J1 = U) { // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_wrong_type.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `J & K where .(K.K1) = .Self as J and .(J.J1) = U as I` into type implementing `J & K where .(J.J2) = .(K.K1).(J.J1).(I.I1)` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(U, T); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_wrong_type.carbon:[[@LINE-31]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(U:! I, T:! J & K where .J2 = (.K1.J1).I1) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_wrong_type.carbon:[[@LINE-31]]:27: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused U:! I, unused T:! J & K where .J2 = (.K1.J1).I1) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(U, T); } @@ -1188,7 +1188,7 @@ interface K { let K3:! type; } -fn F(U:! I & J, T:! K where .K2 = .K1.I1 and .K3 = .K1.J1) {} +fn F(unused U:! I & J, unused T:! K where .K2 = .K1.I1 and .K3 = .K1.J1) {} fn G(U:! I & J where .I1 = () and .J1 = {}, T:! K where .K1 = U and .K2 = () and .K3 = {}) { F(U, T); @@ -1211,16 +1211,16 @@ interface K { let K3:! type; } -fn F(U:! I & J, T:! K where .K2 = .K1.I1 and .K3 = .K1.J1) {} +fn F(unused U:! I & J, unused T:! K where .K2 = .K1.I1 and .K3 = .K1.J1) {} // K2 = I1 fails since K2 = {} and I1 = () fn G(U:! I & J where .I1 = () and .J1 = {}, T:! K where .K1 = U and .K2 = {} and .K3 = {}) { // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_with_two_witnesses_wrong_type.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `K where .(K.K2) = {} and .(K.K1) = U as I & J and .(K.K3) = {}` into type implementing `K where .(K.K2) = .(K.K1).(I.I1) and .(K.K3) = .(K.K1).(J.J1)` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(U, T); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_with_two_witnesses_wrong_type.carbon:[[@LINE-7]]:17: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(U:! I & J, T:! K where .K2 = .K1.I1 and .K3 = .K1.J1) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_with_two_witnesses_wrong_type.carbon:[[@LINE-7]]:31: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused U:! I & J, unused T:! K where .K2 = .K1.I1 and .K3 = .K1.J1) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(U, T); } @@ -1230,9 +1230,9 @@ fn G2(U:! I & J where .I1 = () and .J1 = {}, T:! K where .K1 = U and .K3 = {}) { // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_with_two_witnesses_wrong_type.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `K where .(K.K1) = U as I & J and .(K.K3) = {}` into type implementing `K where .(K.K2) = .(K.K1).(I.I1) and .(K.K3) = .(K.K1).(J.J1)` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(U, T); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_with_two_witnesses_wrong_type.carbon:[[@LINE-19]]:17: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(U:! I & J, T:! K where .K2 = .K1.I1 and .K3 = .K1.J1) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_with_two_witnesses_wrong_type.carbon:[[@LINE-19]]:31: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused U:! I & J, unused T:! K where .K2 = .K1.I1 and .K3 = .K1.J1) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(U, T); } @@ -1242,9 +1242,9 @@ fn G3(U:! I & J where .J1 = {}, T:! K where .K1 = U and .K2 = () and .K3 = {}) { // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_with_two_witnesses_wrong_type.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `K where .(K.K2) = () and .(K.K1) = U as I & J and .(K.K3) = {}` into type implementing `K where .(K.K2) = .(K.K1).(I.I1) and .(K.K3) = .(K.K1).(J.J1)` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(U, T); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_with_two_witnesses_wrong_type.carbon:[[@LINE-31]]:17: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(U:! I & J, T:! K where .K2 = .K1.I1 and .K3 = .K1.J1) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_with_two_witnesses_wrong_type.carbon:[[@LINE-31]]:31: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused U:! I & J, unused T:! K where .K2 = .K1.I1 and .K3 = .K1.J1) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(U, T); } @@ -1254,9 +1254,9 @@ fn G4(U:! I & J where .I1 = () and .J1 = {}, T:! K where .K1 = U and .K2 = ()) { // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_with_two_witnesses_wrong_type.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `K where .(K.K2) = () and .(K.K1) = U as I & J` into type implementing `K where .(K.K2) = .(K.K1).(I.I1) and .(K.K3) = .(K.K1).(J.J1)` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(U, T); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_with_two_witnesses_wrong_type.carbon:[[@LINE-43]]:17: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(U:! I & J, T:! K where .K2 = .K1.I1 and .K3 = .K1.J1) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_with_two_witnesses_wrong_type.carbon:[[@LINE-43]]:31: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused U:! I & J, unused T:! K where .K2 = .K1.I1 and .K3 = .K1.J1) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(U, T); } @@ -1266,9 +1266,9 @@ fn G5(U:! I & J where .I1 = (), T:! K where .K1 = U and .K2 = () and .K3 = {}) { // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_with_two_witnesses_wrong_type.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `K where .(K.K2) = () and .(K.K1) = U as I & J and .(K.K3) = {}` into type implementing `K where .(K.K2) = .(K.K1).(I.I1) and .(K.K3) = .(K.K1).(J.J1)` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(U, T); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_with_two_witnesses_wrong_type.carbon:[[@LINE-55]]:17: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(U:! I & J, T:! K where .K2 = .K1.I1 and .K3 = .K1.J1) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_rewrite_requires_subst_in_nested_access_of_other_with_two_witnesses_wrong_type.carbon:[[@LINE-55]]:31: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused U:! I & J, unused T:! K where .K2 = .K1.I1 and .K3 = .K1.J1) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(U, T); } @@ -1283,15 +1283,15 @@ interface I { let I4:! type; } -fn F(T:! I where .I1 = () and .I2 = ()) {} +fn F(unused T:! I where .I1 = () and .I2 = ()) {} fn G(T:! I where .I1 = .I2) { // CHECK:STDERR: fail_target_rewrites_dont_apply_to_source.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `I where .(I.I1) = .(I.I2)` into type implementing `I where .(I.I1) = () and .(I.I2) = ()` [ConversionFailureFacetToFacet] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_target_rewrites_dont_apply_to_source.carbon:[[@LINE-6]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: fn F(T:! I where .I1 = () and .I2 = ()) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_target_rewrites_dont_apply_to_source.carbon:[[@LINE-6]]:13: note: initializing generic parameter `T` declared here [InitializingGenericParam] + // CHECK:STDERR: fn F(unused T:! I where .I1 = () and .I2 = ()) {} + // CHECK:STDERR: ^ // CHECK:STDERR: F(T); } @@ -1304,7 +1304,7 @@ interface I { let Y:! type; } -fn F(T:! I where .X = (I where .Y = {}), U:! T.X) {} +fn F(T:! I where .X = (I where .Y = {}), unused U:! T.X) {} fn G(T:! I where .X = (I where .Y = {}), U:! I where .Y = {}) { F(T, U); diff --git a/toolchain/check/testdata/for/actual.carbon b/toolchain/check/testdata/for/actual.carbon index 304173413fc7..77a5d2027df5 100644 --- a/toolchain/check/testdata/for/actual.carbon +++ b/toolchain/check/testdata/for/actual.carbon @@ -46,7 +46,7 @@ fn Range(end: i32) -> IntRange(32) { import library "lib"; fn Read(y:! Core.IntLiteral()) { - var x: IntRange(32) = Range(y); + var unused x: IntRange(32) = Range(y); } // CHECK:STDOUT: --- lib.carbon @@ -1002,8 +1002,8 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %y.loc4_9.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.5f4 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound)] -// CHECK:STDOUT: %bound_method.loc5_31.3: = bound_method %y.loc4_9.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc5_31.3 (constants.%bound_method)] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_31.2: init %i32 = call %bound_method.loc5_31.3(%y.loc4_9.1) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_31.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %bound_method.loc5_38.3: = bound_method %y.loc4_9.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc5_38.3 (constants.%bound_method)] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_38.2: init %i32 = call %bound_method.loc5_38.3(%y.loc4_9.1) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_38.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -1016,15 +1016,15 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: %y.ref: Core.IntLiteral = name_ref y, %y.loc4_9.2 [symbolic = %y.loc4_9.1 (constants.%y)] // CHECK:STDOUT: %.loc5_3: ref %IntRange.a89 = splice_block %x.var {} // CHECK:STDOUT: %impl.elem0: %.7c3 = impl_witness_access constants.%ImplicitAs.impl_witness.58d, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.5f4] -// CHECK:STDOUT: %bound_method.loc5_31.1: = bound_method %y.ref, %impl.elem0 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound)] +// CHECK:STDOUT: %bound_method.loc5_38.1: = bound_method %y.ref, %impl.elem0 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound)] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc5_31.2: = bound_method %y.ref, %specific_fn [symbolic = %bound_method.loc5_31.3 (constants.%bound_method)] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_31.1: init %i32 = call %bound_method.loc5_31.2(%y.ref) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_31.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %.loc5_31.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_31.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_31.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %.loc5_31.2: %i32 = converted %y.ref, %.loc5_31.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_31.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %Range.call: init %IntRange.a89 to %.loc5_3 = call %Range.ref(%.loc5_31.2) +// CHECK:STDOUT: %bound_method.loc5_38.2: = bound_method %y.ref, %specific_fn [symbolic = %bound_method.loc5_38.3 (constants.%bound_method)] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_38.1: init %i32 = call %bound_method.loc5_38.2(%y.ref) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_38.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %.loc5_38.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_38.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_38.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %.loc5_38.2: %i32 = converted %y.ref, %.loc5_38.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5_38.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %Range.call: init %IntRange.a89 to %.loc5_3 = call %Range.ref(%.loc5_38.2) // CHECK:STDOUT: assign %x.var, %Range.call -// CHECK:STDOUT: %.loc5_21: type = splice_block %IntRange [concrete = constants.%IntRange.a89] { +// CHECK:STDOUT: %.loc5_28: type = splice_block %IntRange [concrete = constants.%IntRange.a89] { // CHECK:STDOUT: %IntRange.ref: %IntRange.type = name_ref IntRange, imports.%Main.IntRange [concrete = constants.%IntRange.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %IntRange: type = class_type @IntRange, @IntRange(constants.%int_32) [concrete = constants.%IntRange.a89] diff --git a/toolchain/check/testdata/for/basic.carbon b/toolchain/check/testdata/for/basic.carbon index 10c16516a67e..895fa54c7c6f 100644 --- a/toolchain/check/testdata/for/basic.carbon +++ b/toolchain/check/testdata/for/basic.carbon @@ -17,14 +17,14 @@ library "[[@TEST_NAME]]"; fn Run() { // TODO: These diagnostics could be better. If nothing else, we should only diagnose once. // CHECK:STDERR: fail_not_range.carbon:[[@LINE+8]]:7: error: cannot access member of interface `Core.Iterate` in type `{}` that does not implement that interface [MissingImplInMemberAccess] - // CHECK:STDERR: for (c: {} in {}) { - // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: for (unused c: {} in {}) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_not_range.carbon:[[@LINE+4]]:7: error: cannot access member of interface `Core.Iterate` in type `{}` that does not implement that interface [MissingImplInMemberAccess] - // CHECK:STDERR: for (c: {} in {}) { - // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: for (unused c: {} in {}) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - for (c: {} in {}) { + for (unused c: {} in {}) { } } @@ -34,8 +34,8 @@ library "[[@TEST_NAME]]"; class TrivialRange { impl as Core.Iterate where .CursorType = () and .ElementType = () { - fn NewCursor[self: Self]() {} - fn Next[self: Self](cursor: ()*) -> Core.Optional(()) { + fn NewCursor[unused self: Self]() {} + fn Next[unused self: Self](unused cursor: ()*) -> Core.Optional(()) { return Core.Optional(()).None(); } } @@ -69,7 +69,7 @@ fn Run() { // CHECK:STDOUT: %Copy.impl_witness.927: = impl_witness imports.%Copy.impl_witness_table.951 [concrete] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %empty_tuple.type, (%Copy.impl_witness.927) [concrete] // CHECK:STDOUT: %Iterate.impl_witness: = impl_witness @TrivialRange.as.Iterate.impl.%Iterate.impl_witness_table [concrete] -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.408fa8.1: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_32.1 [concrete] +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.408fa8.1: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_39.1 [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.c71f42.1: %TrivialRange.as.Iterate.impl.NewCursor.type.408fa8.1 = struct_value () [concrete] // CHECK:STDOUT: %ptr.843: type = ptr_type %empty_tuple.type [concrete] // CHECK:STDOUT: %Optional.311: type = class_type @Optional, @Optional(%Copy.facet) [concrete] @@ -79,7 +79,7 @@ fn Run() { // CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.a3c: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate(%Iterate.facet) [concrete] // CHECK:STDOUT: %Iterate.WithSelf.Next.type.9dc: type = fn_type @Iterate.WithSelf.Next, @Iterate(%Iterate.facet) [concrete] // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.408fa8.2: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_32.2 [concrete] +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.408fa8.2: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_39.2 [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.c71f42.2: %TrivialRange.as.Iterate.impl.NewCursor.type.408fa8.2 = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %Optional.HasValue.type.4db: type = fn_type @Optional.HasValue, @Optional(%Copy.facet) [concrete] @@ -127,7 +127,7 @@ fn Run() { // CHECK:STDOUT: %impl.elem2: %.ccd = impl_witness_access constants.%Iterate.impl_witness, element2 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.c71f42.2] // CHECK:STDOUT: %bound_method.loc18_35.1: = bound_method %.loc18_20.1, %impl.elem2 // CHECK:STDOUT: %.loc18_20.2: %TrivialRange = acquire_value %.loc18_20.1 -// CHECK:STDOUT: %NewCursor.ref: %TrivialRange.as.Iterate.impl.NewCursor.type.408fa8.1 = name_ref NewCursor, @TrivialRange.as.Iterate.impl.%TrivialRange.as.Iterate.impl.NewCursor.decl.loc6_32.1 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.c71f42.1] +// CHECK:STDOUT: %NewCursor.ref: %TrivialRange.as.Iterate.impl.NewCursor.type.408fa8.1 = name_ref NewCursor, @TrivialRange.as.Iterate.impl.%TrivialRange.as.Iterate.impl.NewCursor.decl.loc6_39.1 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.c71f42.1] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.bound: = bound_method %.loc18_20.2, %NewCursor.ref // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.call: init %empty_tuple.type = call %TrivialRange.as.Iterate.impl.NewCursor.bound(%.loc18_20.2) // CHECK:STDOUT: %var: ref %empty_tuple.type = var invalid diff --git a/toolchain/check/testdata/for/pattern.carbon b/toolchain/check/testdata/for/pattern.carbon index 81ae14646ac1..210d672cf48c 100644 --- a/toolchain/check/testdata/for/pattern.carbon +++ b/toolchain/check/testdata/for/pattern.carbon @@ -18,10 +18,10 @@ class EmptyRange(T:! Core.Copy) { fn Make() -> Self { return {}; } impl as Core.Iterate where .CursorType = {} and .ElementType = T { - fn NewCursor[self: Self]() -> {} { + fn NewCursor[unused self: Self]() -> {} { return {}; } - fn Next[self: Self](cursor: {}*) -> Core.Optional(T) { + fn Next[unused self: Self](unused cursor: {}*) -> Core.Optional(T) { return Core.Optional(T).None(); } } @@ -29,7 +29,7 @@ class EmptyRange(T:! Core.Copy) { class C { impl as Core.Copy { - fn Op[self: Self]() -> Self { return {}; } + fn Op[unused self: Self]() -> Self { return {}; } } } @@ -107,13 +107,13 @@ class X {} fn Run() { // CHECK:STDERR: fail_bad_pattern.carbon:[[@LINE+7]]:7: error: cannot implicitly convert expression of type `C` to `X` [ConversionFailure] - // CHECK:STDERR: for (x: X in EmptyRange(C).Make()) { - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: for (unused x: X in EmptyRange(C).Make()) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_bad_pattern.carbon:[[@LINE+4]]:7: note: type `C` does not implement interface `Core.ImplicitAs(X)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: for (x: X in EmptyRange(C).Make()) { - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: for (unused x: X in EmptyRange(C).Make()) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - for (x: X in EmptyRange(C).Make()) { + for (unused x: X in EmptyRange(C).Make()) { } } @@ -183,14 +183,14 @@ fn Run() { // CHECK:STDOUT: %Main.EmptyRange: %EmptyRange.type = import_ref Main//empty_range, EmptyRange, loaded [concrete = constants.%EmptyRange.generic] // CHECK:STDOUT: %Main.C: type = import_ref Main//empty_range, C, loaded [concrete = constants.%C] // CHECK:STDOUT: %Main.import_ref.299: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.8d6) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.0dc)] -// CHECK:STDOUT: %Main.import_ref.cb5: %C.as.Copy.impl.Op.type = import_ref Main//empty_range, loc19_33, loaded [concrete = constants.%C.as.Copy.impl.Op] +// CHECK:STDOUT: %Main.import_ref.cb5: %C.as.Copy.impl.Op.type = import_ref Main//empty_range, loc19_40, loaded [concrete = constants.%C.as.Copy.impl.Op] // CHECK:STDOUT: %Copy.impl_witness_table.c52 = impl_witness_table (%Main.import_ref.cb5), @C.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.import_ref.f5d: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.051) = import_ref Core//prelude/parts/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.6ae)] // CHECK:STDOUT: %Core.import_ref.ab7: @Optional.%Optional.Get.type (%Optional.Get.type.1ac) = import_ref Core//prelude/parts/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.748)] // CHECK:STDOUT: %Main.import_ref.888 = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded -// CHECK:STDOUT: %Main.import_ref.868: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.16c) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.cbe)] -// CHECK:STDOUT: %Main.import_ref.574: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.b9d) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.682)] +// CHECK:STDOUT: %Main.import_ref.868: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.16c) = import_ref Main//empty_range, loc8_45, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.cbe)] +// CHECK:STDOUT: %Main.import_ref.574: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.b9d) = import_ref Main//empty_range, loc11_72, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.682)] // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.888, %Main.import_ref.999, %Main.import_ref.868, %Main.import_ref.574), @EmptyRange.as.Iterate.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -346,14 +346,14 @@ fn Run() { // CHECK:STDOUT: %Main.EmptyRange: %EmptyRange.type = import_ref Main//empty_range, EmptyRange, loaded [concrete = constants.%EmptyRange.generic] // CHECK:STDOUT: %Main.C: type = import_ref Main//empty_range, C, loaded [concrete = constants.%C] // CHECK:STDOUT: %Main.import_ref.299: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.8d6) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.0dc)] -// CHECK:STDOUT: %Main.import_ref.cb5: %C.as.Copy.impl.Op.type = import_ref Main//empty_range, loc19_33, loaded [concrete = constants.%C.as.Copy.impl.Op] +// CHECK:STDOUT: %Main.import_ref.cb5: %C.as.Copy.impl.Op.type = import_ref Main//empty_range, loc19_40, loaded [concrete = constants.%C.as.Copy.impl.Op] // CHECK:STDOUT: %Copy.impl_witness_table.c52 = impl_witness_table (%Main.import_ref.cb5), @C.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.import_ref.f5d: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.051) = import_ref Core//prelude/parts/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.6ae)] // CHECK:STDOUT: %Core.import_ref.ab7: @Optional.%Optional.Get.type (%Optional.Get.type.1ac) = import_ref Core//prelude/parts/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.748)] // CHECK:STDOUT: %Main.import_ref.888 = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded -// CHECK:STDOUT: %Main.import_ref.868: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.16c) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.cbe)] -// CHECK:STDOUT: %Main.import_ref.574: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.b9d) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.682)] +// CHECK:STDOUT: %Main.import_ref.868: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.16c) = import_ref Main//empty_range, loc8_45, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.cbe)] +// CHECK:STDOUT: %Main.import_ref.574: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.b9d) = import_ref Main//empty_range, loc11_72, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.682)] // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.888, %Main.import_ref.999, %Main.import_ref.868, %Main.import_ref.574), @EmptyRange.as.Iterate.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -527,8 +527,8 @@ fn Run() { // CHECK:STDOUT: %Core.import_ref.ab7: @Optional.%Optional.Get.type (%Optional.Get.type.1ac) = import_ref Core//prelude/parts/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.748)] // CHECK:STDOUT: %Main.import_ref.888 = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded -// CHECK:STDOUT: %Main.import_ref.868: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.16c) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.cbe)] -// CHECK:STDOUT: %Main.import_ref.574: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.b9d) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.682)] +// CHECK:STDOUT: %Main.import_ref.868: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.16c) = import_ref Main//empty_range, loc8_45, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.cbe)] +// CHECK:STDOUT: %Main.import_ref.574: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.b9d) = import_ref Main//empty_range, loc11_72, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.682)] // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.888, %Main.import_ref.999, %Main.import_ref.868, %Main.import_ref.574), @EmptyRange.as.Iterate.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -712,14 +712,14 @@ fn Run() { // CHECK:STDOUT: %Main.import_ref.299: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.8d6) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.0dc)] // CHECK:STDOUT: %Core.import_ref.445: @tuple.type.as.Copy.impl.da7.%tuple.type.as.Copy.impl.Op.type (%tuple.type.as.Copy.impl.Op.type.57a) = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [symbolic = @tuple.type.as.Copy.impl.da7.%tuple.type.as.Copy.impl.Op (constants.%tuple.type.as.Copy.impl.Op.7f4)] // CHECK:STDOUT: %Copy.impl_witness_table.3c8 = impl_witness_table (%Core.import_ref.445), @tuple.type.as.Copy.impl.da7 [concrete] -// CHECK:STDOUT: %Main.import_ref.cb5: %C.as.Copy.impl.Op.type = import_ref Main//empty_range, loc19_33, loaded [concrete = constants.%C.as.Copy.impl.Op] +// CHECK:STDOUT: %Main.import_ref.cb5: %C.as.Copy.impl.Op.type = import_ref Main//empty_range, loc19_40, loaded [concrete = constants.%C.as.Copy.impl.Op] // CHECK:STDOUT: %Copy.impl_witness_table.c52 = impl_witness_table (%Main.import_ref.cb5), @C.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.import_ref.f5d: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.051) = import_ref Core//prelude/parts/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.6ae)] // CHECK:STDOUT: %Core.import_ref.ab7: @Optional.%Optional.Get.type (%Optional.Get.type.1ac) = import_ref Core//prelude/parts/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.748)] // CHECK:STDOUT: %Main.import_ref.888 = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded -// CHECK:STDOUT: %Main.import_ref.868: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.16c) = import_ref Main//empty_range, loc8_38, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.cbe)] -// CHECK:STDOUT: %Main.import_ref.574: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.b9d) = import_ref Main//empty_range, loc11_58, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.682)] +// CHECK:STDOUT: %Main.import_ref.868: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.16c) = import_ref Main//empty_range, loc8_45, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.cbe)] +// CHECK:STDOUT: %Main.import_ref.574: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.b9d) = import_ref Main//empty_range, loc11_72, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.682)] // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.888, %Main.import_ref.999, %Main.import_ref.868, %Main.import_ref.574), @EmptyRange.as.Iterate.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/fail_redefined.carbon b/toolchain/check/testdata/function/builtin/fail_redefined.carbon index 32f013ab92d5..df928e240be2 100644 --- a/toolchain/check/testdata/function/builtin/fail_redefined.carbon +++ b/toolchain/check/testdata/function/builtin/fail_redefined.carbon @@ -14,21 +14,21 @@ fn A(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: error: redefinition of `fn A` [RedeclRedef] -// CHECK:STDERR: fn A(n: i32, m: i32) -> i32 { return n; } -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn A(n: i32, unused m: i32) -> i32 { return n; } +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: note: previously defined here [RedeclPrevDef] // CHECK:STDERR: fn A(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn A(n: i32, m: i32) -> i32 { return n; } +fn A(n: i32, unused m: i32) -> i32 { return n; } -fn B(n: i32, m: i32) -> i32 { return n; } +fn B(n: i32, unused m: i32) -> i32 { return n; } // CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: error: redefinition of `fn B` [RedeclRedef] // CHECK:STDERR: fn B(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: note: previously defined here [RedeclPrevDef] -// CHECK:STDERR: fn B(n: i32, m: i32) -> i32 { return n; } -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn B(n: i32, unused m: i32) -> i32 { return n; } +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn B(n: i32, m: i32) -> i32 = "int.sadd"; @@ -131,9 +131,9 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc23_25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc23_25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc23_25: Core.Form = init_form %i32.loc23_25, call_param2 [concrete = constants.%.8ef] +// CHECK:STDOUT: %int_32.loc23_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc23_32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc23_32: Core.Form = init_form %i32.loc23_32, call_param2 [concrete = constants.%.8ef] // CHECK:STDOUT: %n.param: %i32 = value_param call_param0 // CHECK:STDOUT: %.loc23_9: type = splice_block %i32.loc23_9 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc23_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] @@ -141,9 +141,9 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = value_binding n, %n.param // CHECK:STDOUT: %m.param: %i32 = value_param call_param1 -// CHECK:STDOUT: %.loc23_17: type = splice_block %i32.loc23_17 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc23_17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc23_17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc23_24: type = splice_block %i32.loc23_24 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc23_24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc23_24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %m: %i32 = value_binding m, %m.param // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2 @@ -157,9 +157,9 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc25_25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc25_25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc25_25: Core.Form = init_form %i32.loc25_25, call_param2 [concrete = constants.%.8ef] +// CHECK:STDOUT: %int_32.loc25_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc25_32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc25_32: Core.Form = init_form %i32.loc25_32, call_param2 [concrete = constants.%.8ef] // CHECK:STDOUT: %n.param: %i32 = value_param call_param0 // CHECK:STDOUT: %.loc25_9: type = splice_block %i32.loc25_9 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc25_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] @@ -167,9 +167,9 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = value_binding n, %n.param // CHECK:STDOUT: %m.param: %i32 = value_param call_param1 -// CHECK:STDOUT: %.loc25_17: type = splice_block %i32.loc25_17 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc25_17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc25_17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc25_24: type = splice_block %i32.loc25_24 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc25_24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc25_24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %m: %i32 = value_binding m, %m.param // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2 @@ -261,10 +261,10 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %impl.elem0: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] -// CHECK:STDOUT: %bound_method.loc23_38.1: = bound_method %n.ref, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc23_45.1: = bound_method %n.ref, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc23_38.2: = bound_method %n.ref, %specific_fn -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc23_38.2(%n.ref) +// CHECK:STDOUT: %bound_method.loc23_45.2: = bound_method %n.ref, %specific_fn +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc23_45.2(%n.ref) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: @@ -272,10 +272,10 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %impl.elem0: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] -// CHECK:STDOUT: %bound_method.loc25_38.1: = bound_method %n.ref, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc25_45.1: = bound_method %n.ref, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc25_38.2: = bound_method %n.ref, %specific_fn -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc25_38.2(%n.ref) +// CHECK:STDOUT: %bound_method.loc25_45.2: = bound_method %n.ref, %specific_fn +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc25_45.2(%n.ref) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/alias.carbon b/toolchain/check/testdata/function/call/alias.carbon index bf3254ddecf0..648043a353b6 100644 --- a/toolchain/check/testdata/function/call/alias.carbon +++ b/toolchain/check/testdata/function/call/alias.carbon @@ -17,7 +17,7 @@ fn A() -> () { return (); } alias B = A; fn Main() { - var b: () = B(); + var unused b: () = B(); } // CHECK:STDOUT: --- alias.carbon @@ -86,9 +86,9 @@ fn Main() { // CHECK:STDOUT: %B.ref: %A.type = name_ref B, file.%B [concrete = constants.%A] // CHECK:STDOUT: %A.call: init %empty_tuple.type = call %B.ref() // CHECK:STDOUT: assign %b.var, %A.call -// CHECK:STDOUT: %.loc20_11.1: type = splice_block %.loc20_11.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc20_11.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc20_11.3: type = converted %.loc20_11.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc20_18.1: type = splice_block %.loc20_18.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc20_18.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc20_18.3: type = converted %.loc20_18.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %b: ref %empty_tuple.type = ref_binding b, %b.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %b.var, constants.%DestroyOp diff --git a/toolchain/check/testdata/function/call/eval_musteval.carbon b/toolchain/check/testdata/function/call/eval_musteval.carbon index b0893c33a46a..d2cd499d86eb 100644 --- a/toolchain/check/testdata/function/call/eval_musteval.carbon +++ b/toolchain/check/testdata/function/call/eval_musteval.carbon @@ -14,8 +14,8 @@ library "[[@TEST_NAME]]"; -fn Basic(n: i32) {} -eval fn Eval(n: i32) {} +fn Basic(unused n: i32) {} +eval fn Eval(unused n: i32) {} fn RuntimeArg(n: i32) { Basic(n); @@ -26,15 +26,15 @@ fn RuntimeArg(n: i32) { library "[[@TEST_NAME]]"; -musteval fn MustEval(n: i32) {} +musteval fn MustEval(unused n: i32) {} fn RuntimeArg(n: i32) { // CHECK:STDERR: fail_no_eval_musteval.carbon:[[@LINE+7]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: MustEval(n); // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: fail_no_eval_musteval.carbon:[[@LINE-6]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] - // CHECK:STDERR: musteval fn MustEval(n: i32) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: musteval fn MustEval(unused n: i32) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: MustEval(n); } @@ -43,9 +43,9 @@ fn RuntimeArg(n: i32) { library "[[@TEST_NAME]]"; -fn Basic(n: i32) {} -eval fn Eval(n: i32) {} -musteval fn MustEval(n: i32) {} +fn Basic(unused n: i32) {} +eval fn Eval(unused n: i32) {} +musteval fn MustEval(unused n: i32) {} fn CompileTimeArg() { Basic(1); @@ -57,7 +57,7 @@ fn CompileTimeArg() { library "[[@TEST_NAME]]"; -musteval fn MustEval(n: i32) {} +musteval fn MustEval(unused n: i32) {} // TODO: This should be accepted. musteval fn CallMustEval(n: i32) { @@ -65,8 +65,8 @@ musteval fn CallMustEval(n: i32) { // CHECK:STDERR: MustEval(n); // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: fail_todo_musteval_calls_musteval.carbon:[[@LINE-7]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] - // CHECK:STDERR: musteval fn MustEval(n: i32) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: musteval fn MustEval(unused n: i32) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: MustEval(n); } diff --git a/toolchain/check/testdata/function/call/fail_not_callable.carbon b/toolchain/check/testdata/function/call/fail_not_callable.carbon index d4cd2a397a8a..c22499bea4d7 100644 --- a/toolchain/check/testdata/function/call/fail_not_callable.carbon +++ b/toolchain/check/testdata/function/call/fail_not_callable.carbon @@ -11,9 +11,9 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/fail_not_callable.carbon fn Run() { - // CHECK:STDERR: fail_not_callable.carbon:[[@LINE+4]]:16: error: value of type `str` is not callable [CallToNonCallable] - // CHECK:STDERR: var x: i32 = "hello"(); - // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: fail_not_callable.carbon:[[@LINE+4]]:23: error: value of type `str` is not callable [CallToNonCallable] + // CHECK:STDERR: var unused x: i32 = "hello"(); + // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: - var x: i32 = "hello"(); + var unused x: i32 = "hello"(); } diff --git a/toolchain/check/testdata/function/call/fail_param_count.carbon b/toolchain/check/testdata/function/call/fail_param_count.carbon index ecd936476efa..d3879d43790d 100644 --- a/toolchain/check/testdata/function/call/fail_param_count.carbon +++ b/toolchain/check/testdata/function/call/fail_param_count.carbon @@ -13,8 +13,8 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/fail_param_count.carbon fn Run0() {} -fn Run1(a: i32) {} -fn Run2(a: i32, b: i32) {} +fn Run1(unused a: i32) {} +fn Run2(unused a: i32, unused b: i32) {} fn Main() { // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 1 argument passed to function expecting 0 arguments [CallArgCountMismatch] @@ -38,16 +38,16 @@ fn Main() { // CHECK:STDERR: Run1(); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_param_count.carbon:[[@LINE-24]]:1: note: calling function declared here [InCallToEntity] - // CHECK:STDERR: fn Run1(a: i32) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Run1(unused a: i32) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Run1(); // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 2 arguments passed to function expecting 1 argument [CallArgCountMismatch] // CHECK:STDERR: Run1(0, 1); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: fail_param_count.carbon:[[@LINE-32]]:1: note: calling function declared here [InCallToEntity] - // CHECK:STDERR: fn Run1(a: i32) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Run1(unused a: i32) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Run1(0, 1); @@ -55,16 +55,16 @@ fn Main() { // CHECK:STDERR: Run2(); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_param_count.carbon:[[@LINE-40]]:1: note: calling function declared here [InCallToEntity] - // CHECK:STDERR: fn Run2(a: i32, b: i32) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Run2(unused a: i32, unused b: i32) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Run2(); // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch] // CHECK:STDERR: Run2(0); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_param_count.carbon:[[@LINE-48]]:1: note: calling function declared here [InCallToEntity] - // CHECK:STDERR: fn Run2(a: i32, b: i32) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Run2(unused a: i32, unused b: i32) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Run2(0); } @@ -126,15 +126,15 @@ fn Main() { // CHECK:STDOUT: %b.param_patt: %pattern_type.7ce = value_param_pattern %b.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %a.param: %i32 = value_param call_param0 -// CHECK:STDOUT: %.loc17_12: type = splice_block %i32.loc17_12 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc17_12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc17_12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc17_19: type = splice_block %i32.loc17_19 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc17_19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc17_19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = value_binding a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param call_param1 -// CHECK:STDOUT: %.loc17_20: type = splice_block %i32.loc17_20 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc17_20: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc17_20: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc17_34: type = splice_block %i32.loc17_34 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc17_34: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc17_34: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = value_binding b, %b.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index e4bc0aabf4a1..259679bfbeaa 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -12,7 +12,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/fail_param_type.carbon -fn G(a: i32) {} +fn G(unused a: i32) {} fn F() { // CHECK:STDERR: fail_param_type.carbon:[[@LINE+10]]:5: error: cannot implicitly convert expression of type `Core.FloatLiteral` to `i32` [ConversionFailure] @@ -21,9 +21,9 @@ fn F() { // CHECK:STDERR: fail_param_type.carbon:[[@LINE+7]]:5: note: type `Core.FloatLiteral` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: G(1.0); // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_param_type.carbon:[[@LINE-9]]:6: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fn G(a: i32) {} - // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: fail_param_type.carbon:[[@LINE-9]]:13: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: fn G(unused a: i32) {} + // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: G(1.0); } diff --git a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon index 36b055472785..de8f3ada55b8 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -16,13 +16,13 @@ fn Foo() -> f64 { return 1.0; } fn Run() { // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `f64` to `i32` [ConversionFailure] - // CHECK:STDERR: var x: i32 = Foo(); - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: var unused x: i32 = Foo(); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+4]]:3: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: var x: i32 = Foo(); - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: var unused x: i32 = Foo(); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var x: i32 = Foo(); + var unused x: i32 = Foo(); } // CHECK:STDOUT: --- fail_return_type_mismatch.carbon @@ -126,7 +126,7 @@ fn Run() { // CHECK:STDOUT: %Foo.call: init %f64.d77 = call %Foo.ref() // CHECK:STDOUT: %.loc25_3: %i32 = converted %Foo.call, [concrete = ] // CHECK:STDOUT: assign %x.var, -// CHECK:STDOUT: %.loc25_10: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc25_17: type = splice_block %i32 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index f5d0b6ed0eec..4bc05952f4ed 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -17,7 +17,7 @@ fn Echo(a: i32) -> i32 { } fn Main() { - var b: i32 = Echo(1); + var unused b: i32 = Echo(1); } // CHECK:STDOUT: --- i32.carbon @@ -135,15 +135,15 @@ fn Main() { // CHECK:STDOUT: %Echo.ref: %Echo.type = name_ref Echo, file.%Echo.decl [concrete = constants.%Echo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc20_21.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %bound_method.loc20_28.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc20_21.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc20_21.2(%int_1) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc20_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc20_21.2: %i32 = converted %int_1, %.loc20_21.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %Echo.call: init %i32 = call %Echo.ref(%.loc20_21.2) +// CHECK:STDOUT: %bound_method.loc20_28.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc20_28.2(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc20_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc20_28.2: %i32 = converted %int_1, %.loc20_28.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %Echo.call: init %i32 = call %Echo.ref(%.loc20_28.2) // CHECK:STDOUT: assign %b.var, %Echo.call -// CHECK:STDOUT: %.loc20_10: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc20_17: type = splice_block %i32 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index 00c36b993148..062c088864be 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -12,7 +12,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/more_param_ir.carbon -fn Foo(a: i32, b: i32) {} +fn Foo(unused a: i32, unused b: i32) {} fn Main() { var x: (i32,) = (1,); @@ -96,15 +96,15 @@ fn Main() { // CHECK:STDOUT: %b.param_patt: %pattern_type.7ce = value_param_pattern %b.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %a.param: %i32 = value_param call_param0 -// CHECK:STDOUT: %.loc15_11: type = splice_block %i32.loc15_11 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc15_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc15_18: type = splice_block %i32.loc15_18 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc15_18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_18: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = value_binding a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param call_param1 -// CHECK:STDOUT: %.loc15_19: type = splice_block %i32.loc15_19 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc15_19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc15_33: type = splice_block %i32.loc15_33 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc15_33: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_33: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = value_binding b, %b.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/params_one.carbon b/toolchain/check/testdata/function/call/params_one.carbon index 9dcc3718c8d9..8f7245e8e7f7 100644 --- a/toolchain/check/testdata/function/call/params_one.carbon +++ b/toolchain/check/testdata/function/call/params_one.carbon @@ -12,7 +12,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/params_one.carbon -fn Foo(a: i32) {} +fn Foo(unused a: i32) {} fn Main() { Foo(1); diff --git a/toolchain/check/testdata/function/call/params_one_comma.carbon b/toolchain/check/testdata/function/call/params_one_comma.carbon index e3da8eb0f1d1..1bb8b16cc243 100644 --- a/toolchain/check/testdata/function/call/params_one_comma.carbon +++ b/toolchain/check/testdata/function/call/params_one_comma.carbon @@ -12,7 +12,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/params_one_comma.carbon -fn Foo(a: i32,) {} +fn Foo(unused a: i32,) {} fn Main() { Foo(1); diff --git a/toolchain/check/testdata/function/call/params_two.carbon b/toolchain/check/testdata/function/call/params_two.carbon index 0475e8c536c5..cf8afb0c038a 100644 --- a/toolchain/check/testdata/function/call/params_two.carbon +++ b/toolchain/check/testdata/function/call/params_two.carbon @@ -12,7 +12,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/params_two.carbon -fn Foo(a: i32, b: i32) {} +fn Foo(unused a: i32, unused b: i32) {} fn Main() { Foo(1, 2); @@ -81,15 +81,15 @@ fn Main() { // CHECK:STDOUT: %b.param_patt: %pattern_type.7ce = value_param_pattern %b.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %a.param: %i32 = value_param call_param0 -// CHECK:STDOUT: %.loc15_11: type = splice_block %i32.loc15_11 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc15_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc15_18: type = splice_block %i32.loc15_18 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc15_18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_18: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = value_binding a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param call_param1 -// CHECK:STDOUT: %.loc15_19: type = splice_block %i32.loc15_19 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc15_19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc15_33: type = splice_block %i32.loc15_33 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc15_33: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_33: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = value_binding b, %b.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/params_two_comma.carbon b/toolchain/check/testdata/function/call/params_two_comma.carbon index 6591d504acf9..6274c999ebf4 100644 --- a/toolchain/check/testdata/function/call/params_two_comma.carbon +++ b/toolchain/check/testdata/function/call/params_two_comma.carbon @@ -12,7 +12,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/params_two_comma.carbon -fn Foo(a: i32, b: i32,) {} +fn Foo(unused a: i32, unused b: i32,) {} fn Main() { Foo(1, 2); @@ -82,15 +82,15 @@ fn Main() { // CHECK:STDOUT: %b.param_patt: %pattern_type.7ce = value_param_pattern %b.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %a.param: %i32 = value_param call_param0 -// CHECK:STDOUT: %.loc15_11: type = splice_block %i32.loc15_11 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc15_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc15_18: type = splice_block %i32.loc15_18 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc15_18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_18: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = value_binding a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param call_param1 -// CHECK:STDOUT: %.loc15_19: type = splice_block %i32.loc15_19 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc15_19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc15_33: type = splice_block %i32.loc15_33 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc15_33: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_33: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = value_binding b, %b.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/ref.carbon b/toolchain/check/testdata/function/call/ref.carbon index c5b36f713e99..9b7c504c3d6b 100644 --- a/toolchain/check/testdata/function/call/ref.carbon +++ b/toolchain/check/testdata/function/call/ref.carbon @@ -86,11 +86,11 @@ fn F(x: i32); fn G() { var y: i32 = 0; - // CHECK:STDERR: fail_unnecessary_ref.carbon:[[@LINE+4]]:20: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam] - // CHECK:STDERR: var z: (i32,) = (ref y,); - // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: fail_unnecessary_ref.carbon:[[@LINE+4]]:27: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam] + // CHECK:STDERR: var unused z: (i32,) = (ref y,); + // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - var z: (i32,) = (ref y,); + var unused z: (i32,) = (ref y,); // CHECK:STDERR: fail_unnecessary_ref.carbon:[[@LINE+7]]:5: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam] // CHECK:STDERR: F(ref y); // CHECK:STDERR: ^~~~~ diff --git a/toolchain/check/testdata/function/call/return_implicit.carbon b/toolchain/check/testdata/function/call/return_implicit.carbon index f85cc551d0bf..90a167749db7 100644 --- a/toolchain/check/testdata/function/call/return_implicit.carbon +++ b/toolchain/check/testdata/function/call/return_implicit.carbon @@ -16,7 +16,7 @@ fn MakeImplicitEmptyTuple() { } fn Main() { - var b: () = MakeImplicitEmptyTuple(); + var unused b: () = MakeImplicitEmptyTuple(); } // CHECK:STDOUT: --- return_implicit.carbon @@ -69,9 +69,9 @@ fn Main() { // CHECK:STDOUT: %MakeImplicitEmptyTuple.ref: %MakeImplicitEmptyTuple.type = name_ref MakeImplicitEmptyTuple, file.%MakeImplicitEmptyTuple.decl [concrete = constants.%MakeImplicitEmptyTuple] // CHECK:STDOUT: %MakeImplicitEmptyTuple.call: init %empty_tuple.type = call %MakeImplicitEmptyTuple.ref() // CHECK:STDOUT: assign %b.var, %MakeImplicitEmptyTuple.call -// CHECK:STDOUT: %.loc19_11.1: type = splice_block %.loc19_11.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc19_11.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc19_11.3: type = converted %.loc19_11.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc19_18.1: type = splice_block %.loc19_18.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc19_18.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc19_18.3: type = converted %.loc19_18.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %b: ref %empty_tuple.type = ref_binding b, %b.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %b.var, constants.%DestroyOp diff --git a/toolchain/check/testdata/function/declaration/pattern_in_signature.carbon b/toolchain/check/testdata/function/declaration/pattern_in_signature.carbon index ca75c39d0afa..5768dd30bf04 100644 --- a/toolchain/check/testdata/function/declaration/pattern_in_signature.carbon +++ b/toolchain/check/testdata/function/declaration/pattern_in_signature.carbon @@ -11,7 +11,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/pattern_in_signature.carbon //@dump-sem-ir-begin -fn F((a: {}, b: {}), c: {}) {} +fn F((unused a: {}, unused b: {}), unused c: {}) {} //@dump-sem-ir-end //@dump-sem-ir-begin @@ -42,26 +42,26 @@ fn CallF(ab: ({}, {}), c: {}) { // CHECK:STDOUT: %a.param_patt: %pattern_type.a96 = value_param_pattern %a.patt, call_param0 [concrete] // CHECK:STDOUT: %b.patt: %pattern_type.a96 = value_binding_pattern b [concrete] // CHECK:STDOUT: %b.param_patt: %pattern_type.a96 = value_param_pattern %b.patt, call_param1 [concrete] -// CHECK:STDOUT: %.loc14_19: %pattern_type.de4 = tuple_pattern (%a.param_patt, %b.param_patt) [concrete] +// CHECK:STDOUT: %.loc14_33: %pattern_type.de4 = tuple_pattern (%a.param_patt, %b.param_patt) [concrete] // CHECK:STDOUT: %c.patt: %pattern_type.a96 = value_binding_pattern c [concrete] // CHECK:STDOUT: %c.param_patt: %pattern_type.a96 = value_param_pattern %c.patt, call_param2 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %a.param: %empty_struct_type = value_param call_param0 -// CHECK:STDOUT: %.loc14_11.1: type = splice_block %.loc14_11.3 [concrete = constants.%empty_struct_type] { -// CHECK:STDOUT: %.loc14_11.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc14_11.3: type = converted %.loc14_11.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %empty_struct_type = value_binding a, %a.param -// CHECK:STDOUT: %b.param: %empty_struct_type = value_param call_param1 // CHECK:STDOUT: %.loc14_18.1: type = splice_block %.loc14_18.3 [concrete = constants.%empty_struct_type] { // CHECK:STDOUT: %.loc14_18.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc14_18.3: type = converted %.loc14_18.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } +// CHECK:STDOUT: %a: %empty_struct_type = value_binding a, %a.param +// CHECK:STDOUT: %b.param: %empty_struct_type = value_param call_param1 +// CHECK:STDOUT: %.loc14_32.1: type = splice_block %.loc14_32.3 [concrete = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc14_32.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc14_32.3: type = converted %.loc14_32.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %empty_struct_type = value_binding b, %b.param // CHECK:STDOUT: %c.param: %empty_struct_type = value_param call_param2 -// CHECK:STDOUT: %.loc14_26.1: type = splice_block %.loc14_26.3 [concrete = constants.%empty_struct_type] { -// CHECK:STDOUT: %.loc14_26.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc14_26.3: type = converted %.loc14_26.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc14_47.1: type = splice_block %.loc14_47.3 [concrete = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc14_47.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc14_47.3: type = converted %.loc14_47.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } // CHECK:STDOUT: %c: %empty_struct_type = value_binding c, %c.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/declaration/ref.carbon b/toolchain/check/testdata/function/declaration/ref.carbon index 38cd67b047c3..3994fb54eb64 100644 --- a/toolchain/check/testdata/function/declaration/ref.carbon +++ b/toolchain/check/testdata/function/declaration/ref.carbon @@ -18,7 +18,7 @@ fn F() -> ref i32; fn G() { - let ref x: i32 = F(); + let unused ref x: i32 = F(); } // CHECK:STDOUT: --- ref_return.carbon diff --git a/toolchain/check/testdata/function/definition/basics.carbon b/toolchain/check/testdata/function/definition/basics.carbon index 12aebd83e8b3..cee6263ebf29 100644 --- a/toolchain/check/testdata/function/definition/basics.carbon +++ b/toolchain/check/testdata/function/definition/basics.carbon @@ -17,14 +17,14 @@ class C; -// CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE+7]]:6: error: parameter has incomplete type `C` in function definition [IncompleteTypeInFunctionParam] -// CHECK:STDERR: fn F(n: C) {} -// CHECK:STDERR: ^~~~ +// CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE+7]]:13: error: parameter has incomplete type `C` in function definition [IncompleteTypeInFunctionParam] +// CHECK:STDERR: fn F(unused n: C) {} +// CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE-5]]:1: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -fn F(n: C) {} +fn F(unused n: C) {} // CHECK:STDOUT: --- fail_incomplete_type.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon b/toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon index b156c87f851a..da88a5b38b30 100644 --- a/toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon +++ b/toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon @@ -14,13 +14,13 @@ fn F(); // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 1 [RedeclParamCountDiffers] -// CHECK:STDERR: fn F(x: ()) {} -// CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: fn F(unused x: ()) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note: previously declared with parameter count of 0 [RedeclParamCountPrevious] // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -fn F(x: ()) {} +fn F(unused x: ()) {} fn G(x: ()); // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 0 [RedeclParamCountDiffers] @@ -33,11 +33,11 @@ fn G(x: ()); fn G() {} fn H(x: ()); -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+4]]:9: error: `Core.Bool` implicitly referenced here, but package `Core` not found [CoreNotFound] -// CHECK:STDERR: fn H(x: bool) {} -// CHECK:STDERR: ^~~~ +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+4]]:16: error: `Core.Bool` implicitly referenced here, but package `Core` not found [CoreNotFound] +// CHECK:STDERR: fn H(unused x: bool) {} +// CHECK:STDERR: ^~~~ // CHECK:STDERR: -fn H(x: bool) {} +fn H(unused x: bool) {} fn I(); // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: function redeclaration differs because return type is `()` [FunctionRedeclReturnTypeDiffers] @@ -121,9 +121,9 @@ fn K() -> {} { return {}; } // CHECK:STDOUT: %x.param_patt: %pattern_type.cb1 = value_param_pattern %x.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %x.param: %empty_tuple.type = value_param call_param0 -// CHECK:STDOUT: %.loc23_10.1: type = splice_block %.loc23_10.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc23_10.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc23_10.3: type = converted %.loc23_10.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc23_17.1: type = splice_block %.loc23_17.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc23_17.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc23_17.3: type = converted %.loc23_17.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %x: %empty_tuple.type = value_binding x, %x.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/fail_local_decl.carbon b/toolchain/check/testdata/function/definition/fail_local_decl.carbon index baf8bbdaa780..3204a2f5c135 100644 --- a/toolchain/check/testdata/function/definition/fail_local_decl.carbon +++ b/toolchain/check/testdata/function/definition/fail_local_decl.carbon @@ -40,15 +40,15 @@ library "[[@TEST_NAME]]"; fn F() { // CHECK:STDERR: fail_access.carbon:[[@LINE+4]]:3: error: `private` not allowed; requires class or file scope [ModifierPrivateNotAllowed] - // CHECK:STDERR: private var v: {}; + // CHECK:STDERR: private var unused v: {}; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: - private var v: {}; + private var unused v: {}; // CHECK:STDERR: fail_access.carbon:[[@LINE+4]]:3: error: `protected` not allowed; requires class scope [ModifierProtectedNotAllowed] - // CHECK:STDERR: protected var w: {}; + // CHECK:STDERR: protected var unused w: {}; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: - protected var w: {}; + protected var unused w: {}; } // CHECK:STDOUT: --- fail_virtual.carbon @@ -133,9 +133,9 @@ fn F() { // CHECK:STDOUT: %v.var_patt: %pattern_type.a96 = var_pattern %v.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %empty_struct_type = var %v.var_patt -// CHECK:STDOUT: %.loc9_19.1: type = splice_block %.loc9_19.3 [concrete = constants.%empty_struct_type] { -// CHECK:STDOUT: %.loc9_19.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc9_19.3: type = converted %.loc9_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc9_26.1: type = splice_block %.loc9_26.3 [concrete = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc9_26.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc9_26.3: type = converted %.loc9_26.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref %empty_struct_type = ref_binding v, %v.var // CHECK:STDOUT: name_binding_decl { @@ -143,9 +143,9 @@ fn F() { // CHECK:STDOUT: %w.var_patt: %pattern_type.a96 = var_pattern %w.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %w.var: ref %empty_struct_type = var %w.var_patt -// CHECK:STDOUT: %.loc14_21.1: type = splice_block %.loc14_21.3 [concrete = constants.%empty_struct_type] { -// CHECK:STDOUT: %.loc14_21.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc14_21.3: type = converted %.loc14_21.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc14_28.1: type = splice_block %.loc14_28.3 [concrete = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc14_28.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc14_28.3: type = converted %.loc14_28.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } // CHECK:STDOUT: %w: ref %empty_struct_type = ref_binding w, %w.var // CHECK:STDOUT: %DestroyOp.bound.loc14: = bound_method %w.var, constants.%DestroyOp diff --git a/toolchain/check/testdata/function/definition/params_one.carbon b/toolchain/check/testdata/function/definition/params_one.carbon index c425b7f2935c..41981bfbfb94 100644 --- a/toolchain/check/testdata/function/definition/params_one.carbon +++ b/toolchain/check/testdata/function/definition/params_one.carbon @@ -12,7 +12,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/params_one.carbon -fn Foo(a: i32) {} +fn Foo(unused a: i32) {} // CHECK:STDOUT: --- params_one.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/definition/params_one_comma.carbon b/toolchain/check/testdata/function/definition/params_one_comma.carbon index 99610a614ad5..c33478695188 100644 --- a/toolchain/check/testdata/function/definition/params_one_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_one_comma.carbon @@ -12,7 +12,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/params_one_comma.carbon -fn Foo(a: i32,) {} +fn Foo(unused a: i32,) {} // CHECK:STDOUT: --- params_one_comma.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/definition/params_two.carbon b/toolchain/check/testdata/function/definition/params_two.carbon index c2215e62d71b..faba73e40249 100644 --- a/toolchain/check/testdata/function/definition/params_two.carbon +++ b/toolchain/check/testdata/function/definition/params_two.carbon @@ -12,7 +12,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/params_two.carbon -fn Foo(a: i32, b: i32) {} +fn Foo(unused a: i32, unused b: i32) {} // CHECK:STDOUT: --- params_two.carbon // CHECK:STDOUT: @@ -48,15 +48,15 @@ fn Foo(a: i32, b: i32) {} // CHECK:STDOUT: %b.param_patt: %pattern_type.7ce = value_param_pattern %b.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %a.param: %i32 = value_param call_param0 -// CHECK:STDOUT: %.loc15_11: type = splice_block %i32.loc15_11 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc15_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc15_18: type = splice_block %i32.loc15_18 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc15_18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_18: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = value_binding a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param call_param1 -// CHECK:STDOUT: %.loc15_19: type = splice_block %i32.loc15_19 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc15_19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc15_33: type = splice_block %i32.loc15_33 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc15_33: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_33: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = value_binding b, %b.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/params_two_comma.carbon b/toolchain/check/testdata/function/definition/params_two_comma.carbon index 236df92e927c..e55e28ddd2e2 100644 --- a/toolchain/check/testdata/function/definition/params_two_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_two_comma.carbon @@ -12,7 +12,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/params_two_comma.carbon -fn Foo(a: i32, b: i32,) {} +fn Foo(unused a: i32, unused b: i32,) {} // CHECK:STDOUT: --- params_two_comma.carbon // CHECK:STDOUT: @@ -48,15 +48,15 @@ fn Foo(a: i32, b: i32,) {} // CHECK:STDOUT: %b.param_patt: %pattern_type.7ce = value_param_pattern %b.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %a.param: %i32 = value_param call_param0 -// CHECK:STDOUT: %.loc15_11: type = splice_block %i32.loc15_11 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc15_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc15_18: type = splice_block %i32.loc15_18 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc15_18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_18: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = value_binding a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param call_param1 -// CHECK:STDOUT: %.loc15_19: type = splice_block %i32.loc15_19 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc15_19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc15_33: type = splice_block %i32.loc15_33 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc15_33: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_33: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = value_binding b, %b.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/syntactic_merge.carbon b/toolchain/check/testdata/function/definition/syntactic_merge.carbon index ba9de2c06ce4..d70c574b55d7 100644 --- a/toolchain/check/testdata/function/definition/syntactic_merge.carbon +++ b/toolchain/check/testdata/function/definition/syntactic_merge.carbon @@ -20,10 +20,10 @@ class C {} alias D = C; fn Foo(a: C); -fn Foo(a: C) {} +fn Foo(unused a: C) {} fn Bar(a: D); -fn Bar(a: D) {} +fn Bar(unused a: D) {} // --- spacing.carbon @@ -32,7 +32,7 @@ library "[[@TEST_NAME]]"; class C {} fn Foo [ ] ( a : C ); -fn Foo[](a: C) {} +fn Foo[](unused a: C) {} // --- fail_parens.carbon @@ -41,14 +41,14 @@ library "[[@TEST_NAME]]"; class C {} fn Foo(a: C); -// CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:11: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] -// CHECK:STDERR: fn Foo(a: (C)) {} -// CHECK:STDERR: ^ +// CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:18: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] +// CHECK:STDERR: fn Foo(unused a: (C)) {} +// CHECK:STDERR: ^ // CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:11: note: comparing with previous declaration here [RedeclParamSyntaxPrevious] // CHECK:STDERR: fn Foo(a: C); // CHECK:STDERR: ^ // CHECK:STDERR: -fn Foo(a: (C)) {} +fn Foo(unused a: (C)) {} // --- fail_only_implicit_params.carbon @@ -82,7 +82,7 @@ library "[[@TEST_NAME]]"; class C {} fn Foo(a: C); -fn Foo(a: r#C) {} +fn Foo(unused a: r#C) {} // --- two_file.carbon @@ -98,8 +98,8 @@ fn Bar(a: D); impl library "[[@TEST_NAME]]"; -fn Foo(a: C) {} -fn Bar(a: D) {} +fn Foo(unused a: C) {} +fn Bar(unused a: D) {} // --- fail_name_mismatch.carbon @@ -109,14 +109,14 @@ class C {} alias D = C; fn Foo(a: C); -// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:8: error: redeclaration differs at parameter 1 [RedeclParamDiffers] -// CHECK:STDERR: fn Foo(b: D) {} -// CHECK:STDERR: ^~~~ +// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:15: error: redeclaration differs at parameter 1 [RedeclParamDiffers] +// CHECK:STDERR: fn Foo(unused b: D) {} +// CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:8: note: previous declaration's corresponding parameter here [RedeclParamPrevious] // CHECK:STDERR: fn Foo(a: C); // CHECK:STDERR: ^~~~ // CHECK:STDERR: -fn Foo(b: D) {} +fn Foo(unused b: D) {} // --- fail_alias.carbon @@ -126,14 +126,14 @@ class C {} alias D = C; fn Foo(a: C); -// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:11: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] -// CHECK:STDERR: fn Foo(a: D) {} -// CHECK:STDERR: ^ +// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:18: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] +// CHECK:STDERR: fn Foo(unused a: D) {} +// CHECK:STDERR: ^ // CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:11: note: comparing with previous declaration here [RedeclParamSyntaxPrevious] // CHECK:STDERR: fn Foo(a: C); // CHECK:STDERR: ^ // CHECK:STDERR: -fn Foo(a: D) {} +fn Foo(unused a: D) {} // --- fail_deduced_alias.carbon @@ -143,14 +143,14 @@ class C {} alias D = C; fn Foo[a:! C](); -// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:12: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] -// CHECK:STDERR: fn Foo[a:! D]() {} -// CHECK:STDERR: ^ +// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:19: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] +// CHECK:STDERR: fn Foo[unused a:! D]() {} +// CHECK:STDERR: ^ // CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:12: note: comparing with previous declaration here [RedeclParamSyntaxPrevious] // CHECK:STDERR: fn Foo[a:! C](); // CHECK:STDERR: ^ // CHECK:STDERR: -fn Foo[a:! D]() {} +fn Foo[unused a:! D]() {} // --- todo_fail_alias_in_return.carbon @@ -176,7 +176,7 @@ impl library "[[@TEST_NAME]]"; alias D = C; -fn Foo(a: D) {} +fn Foo(unused a: D) {} // --- fail_repeat_const.carbon @@ -185,18 +185,18 @@ library "[[@TEST_NAME]]"; class C {} fn Foo(a: const C); -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+11]]:11: warning: `const` applied repeatedly to the same type has no additional effect [RepeatedConst] -// CHECK:STDERR: fn Foo(a: const (const C)) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+11]]:18: warning: `const` applied repeatedly to the same type has no additional effect [RepeatedConst] +// CHECK:STDERR: fn Foo(unused a: const (const C)) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+7]]:17: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] -// CHECK:STDERR: fn Foo(a: const (const C)) {} -// CHECK:STDERR: ^ +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+7]]:24: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] +// CHECK:STDERR: fn Foo(unused a: const (const C)) {} +// CHECK:STDERR: ^ // CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:17: note: comparing with previous declaration here [RedeclParamSyntaxPrevious] // CHECK:STDERR: fn Foo(a: const C); // CHECK:STDERR: ^ // CHECK:STDERR: -fn Foo(a: const (const C)) {} +fn Foo(unused a: const (const C)) {} // CHECK:STDOUT: --- basic.carbon // CHECK:STDOUT: @@ -693,10 +693,11 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %a: %C = symbolic_binding a, 0 [symbolic] +// CHECK:STDOUT: %a.9daf47.1: %C = symbolic_binding a, 0 [symbolic] // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete] // CHECK:STDOUT: %Foo.type.47530a.1: type = fn_type @Foo.loc7 [concrete] // CHECK:STDOUT: %Foo.9ec12f.1: %Foo.type.47530a.1 = struct_value () [concrete] +// CHECK:STDOUT: %a.9daf47.2: %C = symbolic_binding a, 0 [symbolic] // CHECK:STDOUT: %Foo.type.47530a.2: type = fn_type @Foo.loc15 [concrete] // CHECK:STDOUT: %Foo.9ec12f.2: %Foo.type.47530a.2 = struct_value () [concrete] // CHECK:STDOUT: } @@ -717,7 +718,7 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %a.loc7_8.2: %C = symbolic_binding a, 0 [symbolic = %a.loc7_8.1 (constants.%a)] +// CHECK:STDOUT: %a.loc7_8.2: %C = symbolic_binding a, 0 [symbolic = %a.loc7_8.1 (constants.%a.9daf47.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc15: %Foo.type.47530a.2 = fn_decl @Foo.loc15 [concrete = constants.%Foo.9ec12f.2] { // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete] @@ -726,7 +727,7 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %a.loc15_8.2: %C = symbolic_binding a, 0 [symbolic = %a.loc15_8.1 (constants.%a)] +// CHECK:STDOUT: %a.loc15_15.3: %C = symbolic_binding a, 0 [symbolic = %a.loc15_15.2 (constants.%a.9daf47.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -739,13 +740,14 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Foo.loc7(%a.loc7_8.2: %C) { -// CHECK:STDOUT: %a.loc7_8.1: %C = symbolic_binding a, 0 [symbolic = %a.loc7_8.1 (constants.%a)] +// CHECK:STDOUT: %a.loc7_8.1: %C = symbolic_binding a, 0 [symbolic = %a.loc7_8.1 (constants.%a.9daf47.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Foo.loc15(%a.loc15_8.2: %C) { -// CHECK:STDOUT: %a.loc15_8.1: %C = symbolic_binding a, 0 [symbolic = %a.loc15_8.1 (constants.%a)] +// CHECK:STDOUT: generic fn @Foo.loc15(%a.loc15_15.3: %C) { +// CHECK:STDOUT: %a.loc15_15.1: %C = symbolic_binding a, 0 [symbolic = %a.loc15_15.1 (constants.%a.9daf47.1)] +// CHECK:STDOUT: %a.loc15_15.2: %C = symbolic_binding a, 0 [symbolic = %a.loc15_15.2 (constants.%a.9daf47.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -755,12 +757,13 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Foo.loc7(constants.%a) { -// CHECK:STDOUT: %a.loc7_8.1 => constants.%a +// CHECK:STDOUT: specific @Foo.loc7(constants.%a.9daf47.1) { +// CHECK:STDOUT: %a.loc7_8.1 => constants.%a.9daf47.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Foo.loc15(constants.%a) { -// CHECK:STDOUT: %a.loc15_8.1 => constants.%a +// CHECK:STDOUT: specific @Foo.loc15(constants.%a.9daf47.2) { +// CHECK:STDOUT: %a.loc15_15.1 => constants.%a.9daf47.2 +// CHECK:STDOUT: %a.loc15_15.2 => constants.%a.9daf47.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- todo_fail_alias_in_return.carbon @@ -944,10 +947,10 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.param_patt: %pattern_type = value_param_pattern %a.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %a.param: %const = value_param call_param0 -// CHECK:STDOUT: %.loc18: type = splice_block %const.loc18_11 [concrete = constants.%const] { +// CHECK:STDOUT: %.loc18: type = splice_block %const.loc18_18 [concrete = constants.%const] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %const.loc18_18: type = const_type %C.ref [concrete = constants.%const] -// CHECK:STDOUT: %const.loc18_11: type = const_type %const.loc18_18 [concrete = constants.%const] +// CHECK:STDOUT: %const.loc18_25: type = const_type %C.ref [concrete = constants.%const] +// CHECK:STDOUT: %const.loc18_18: type = const_type %const.loc18_25 [concrete = constants.%const] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %const = value_binding a, %a.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index f481c5cafbc1..3921d876a775 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -75,7 +75,7 @@ fn CallImplicitGenericParam(n: i32) -> i32* { library "[[@TEST_NAME]]"; -fn TupleParam[T:! type](x: (T, i32)) {} +fn TupleParam[T:! type](unused x: (T, i32)) {} fn CallTupleParam() { TupleParam((1, 2)); @@ -85,7 +85,7 @@ fn CallTupleParam() { library "[[@TEST_NAME]]"; -fn StructParam[T:! type](x: {.a: T, .b: i32}) {} +fn StructParam[T:! type](unused x: {.a: T, .b: i32}) {} fn CallStructParam() { StructParam({.a = 1, .b = 2}); @@ -95,15 +95,15 @@ fn CallStructParam() { library "[[@TEST_NAME]]"; -fn BigStructParam[T:! type](x: {.c: T, .d: i32, .e: i32}) {} +fn BigStructParam[T:! type](unused x: {.c: T, .d: i32, .e: i32}) {} fn CallBigStructParam() { // CHECK:STDERR: fail_deduce_bigger_struct.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete] // CHECK:STDERR: BigStructParam({.c = 3, .d = 4}); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_deduce_bigger_struct.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn BigStructParam[T:! type](x: {.c: T, .d: i32, .e: i32}) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn BigStructParam[T:! type](unused x: {.c: T, .d: i32, .e: i32}) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: BigStructParam({.c = 3, .d = 4}); } @@ -112,15 +112,15 @@ fn CallBigStructParam() { library "[[@TEST_NAME]]"; -fn SmallStructParam[T:! type](x: {.f: T, .g: i32}) {} +fn SmallStructParam[T:! type](unused x: {.f: T, .g: i32}) {} fn CallSmallStructParam() { // CHECK:STDERR: fail_deduce_smaller_struct.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete] // CHECK:STDERR: SmallStructParam({.f = 5, .g = 6, .h = 7}); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_deduce_smaller_struct.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn SmallStructParam[T:! type](x: {.f: T, .g: i32}) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn SmallStructParam[T:! type](unused x: {.f: T, .g: i32}) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: SmallStructParam({.f = 5, .g = 6, .h = 7}); } @@ -129,15 +129,15 @@ fn CallSmallStructParam() { library "[[@TEST_NAME]]"; -fn WrongNameStructParam[T:! type](x: {.i: T, .different: i32}) {} +fn WrongNameStructParam[T:! type](unused x: {.i: T, .different: i32}) {} fn CallWrongNameStructParam() { // CHECK:STDERR: fail_deduce_struct_wrong_name.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete] // CHECK:STDERR: WrongNameStructParam({.i = 8, .j = 9}); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_deduce_struct_wrong_name.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn WrongNameStructParam[T:! type](x: {.i: T, .different: i32}) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn WrongNameStructParam[T:! type](unused x: {.i: T, .different: i32}) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: WrongNameStructParam({.i = 8, .j = 9}); } @@ -146,15 +146,15 @@ fn CallWrongNameStructParam() { library "[[@TEST_NAME]]"; -fn WrongOrderStructParam[T:! type](x: {.first: T, .second: i32}) {} +fn WrongOrderStructParam[T:! type](unused x: {.first: T, .second: i32}) {} fn CallWrongOrderStructParam() { // CHECK:STDERR: fail_todo_deduce_struct_wrong_order.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete] // CHECK:STDERR: WrongOrderStructParam({.second = 11, .first = 10}); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_deduce_struct_wrong_order.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn WrongOrderStructParam[T:! type](x: {.first: T, .second: i32}) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn WrongOrderStructParam[T:! type](unused x: {.first: T, .second: i32}) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: WrongOrderStructParam({.second = 11, .first = 10}); } @@ -902,12 +902,12 @@ fn F() { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc4_15.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_15.1 (constants.%T)] // CHECK:STDOUT: %x.param: @TupleParam.%tuple.type (%tuple.type.b01) = value_param call_param0 -// CHECK:STDOUT: %.loc4_35.1: type = splice_block %.loc4_35.3 [symbolic = %tuple.type (constants.%tuple.type.b01)] { +// CHECK:STDOUT: %.loc4_42.1: type = splice_block %.loc4_42.3 [symbolic = %tuple.type (constants.%tuple.type.b01)] { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_15.2 [symbolic = %T.loc4_15.1 (constants.%T)] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc4_35.2: %tuple.type.24b = tuple_literal (%T.ref, %i32) [symbolic = %tuple (constants.%tuple.c27)] -// CHECK:STDOUT: %.loc4_35.3: type = converted %.loc4_35.2, constants.%tuple.type.b01 [symbolic = %tuple.type (constants.%tuple.type.b01)] +// CHECK:STDOUT: %.loc4_42.2: %tuple.type.24b = tuple_literal (%T.ref, %i32) [symbolic = %tuple (constants.%tuple.c27)] +// CHECK:STDOUT: %.loc4_42.3: type = converted %.loc4_42.2, constants.%tuple.type.b01 [symbolic = %tuple.type (constants.%tuple.type.b01)] // CHECK:STDOUT: } // CHECK:STDOUT: %x: @TupleParam.%tuple.type (%tuple.type.b01) = value_binding x, %x.param // CHECK:STDOUT: } @@ -1039,27 +1039,27 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc4_16.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_16.1 (constants.%T)] -// CHECK:STDOUT: %x.param: @StructParam.%struct_type.a.b.loc4_44.1 (%struct_type.a.b.702) = value_param call_param0 -// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.a.b.loc4_44.2 [symbolic = %struct_type.a.b.loc4_44.1 (constants.%struct_type.a.b.702)] { +// CHECK:STDOUT: %x.param: @StructParam.%struct_type.a.b.loc4_51.1 (%struct_type.a.b.702) = value_param call_param0 +// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.a.b.loc4_51.2 [symbolic = %struct_type.a.b.loc4_51.1 (constants.%struct_type.a.b.702)] { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.2 [symbolic = %T.loc4_16.1 (constants.%T)] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %struct_type.a.b.loc4_44.2: type = struct_type {.a: @StructParam.%T.loc4_16.1 (%T), .b: %i32} [symbolic = %struct_type.a.b.loc4_44.1 (constants.%struct_type.a.b.702)] +// CHECK:STDOUT: %struct_type.a.b.loc4_51.2: type = struct_type {.a: @StructParam.%T.loc4_16.1 (%T), .b: %i32} [symbolic = %struct_type.a.b.loc4_51.1 (constants.%struct_type.a.b.702)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @StructParam.%struct_type.a.b.loc4_44.1 (%struct_type.a.b.702) = value_binding x, %x.param +// CHECK:STDOUT: %x: @StructParam.%struct_type.a.b.loc4_51.1 (%struct_type.a.b.702) = value_binding x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallStructParam.decl: %CallStructParam.type = fn_decl @CallStructParam [concrete = constants.%CallStructParam] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @StructParam(%T.loc4_16.2: type) { // CHECK:STDOUT: %T.loc4_16.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_16.1 (constants.%T)] -// CHECK:STDOUT: %struct_type.a.b.loc4_44.1: type = struct_type {.a: @StructParam.%T.loc4_16.1 (%T), .b: %i32} [symbolic = %struct_type.a.b.loc4_44.1 (constants.%struct_type.a.b.702)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.a.b.loc4_44.1 [symbolic = %pattern_type (constants.%pattern_type.8a5)] +// CHECK:STDOUT: %struct_type.a.b.loc4_51.1: type = struct_type {.a: @StructParam.%T.loc4_16.1 (%T), .b: %i32} [symbolic = %struct_type.a.b.loc4_51.1 (constants.%struct_type.a.b.702)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.a.b.loc4_51.1 [symbolic = %pattern_type (constants.%pattern_type.8a5)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.a.b.loc4_44.1 [symbolic = %require_complete (constants.%require_complete.19d)] +// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.a.b.loc4_51.1 [symbolic = %require_complete (constants.%require_complete.19d)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @StructParam.%struct_type.a.b.loc4_44.1 (%struct_type.a.b.702)) { +// CHECK:STDOUT: fn(%x.param: @StructParam.%struct_type.a.b.loc4_51.1 (%struct_type.a.b.702)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1087,13 +1087,13 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: specific @StructParam(constants.%T) { // CHECK:STDOUT: %T.loc4_16.1 => constants.%T -// CHECK:STDOUT: %struct_type.a.b.loc4_44.1 => constants.%struct_type.a.b.702 +// CHECK:STDOUT: %struct_type.a.b.loc4_51.1 => constants.%struct_type.a.b.702 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.8a5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @StructParam(Core.IntLiteral) { // CHECK:STDOUT: %T.loc4_16.1 => Core.IntLiteral -// CHECK:STDOUT: %struct_type.a.b.loc4_44.1 => constants.%struct_type.a.b.a13 +// CHECK:STDOUT: %struct_type.a.b.loc4_51.1 => constants.%struct_type.a.b.a13 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cfa // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -1147,29 +1147,29 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc4_19.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_19.1 (constants.%T)] -// CHECK:STDOUT: %x.param: @BigStructParam.%struct_type.c.d.e.loc4_56.1 (%struct_type.c.d.e) = value_param call_param0 -// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.c.d.e.loc4_56.2 [symbolic = %struct_type.c.d.e.loc4_56.1 (constants.%struct_type.c.d.e)] { +// CHECK:STDOUT: %x.param: @BigStructParam.%struct_type.c.d.e.loc4_63.1 (%struct_type.c.d.e) = value_param call_param0 +// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.c.d.e.loc4_63.2 [symbolic = %struct_type.c.d.e.loc4_63.1 (constants.%struct_type.c.d.e)] { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_19.2 [symbolic = %T.loc4_19.1 (constants.%T)] -// CHECK:STDOUT: %int_32.loc4_44: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_44: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_53: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_53: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %struct_type.c.d.e.loc4_56.2: type = struct_type {.c: @BigStructParam.%T.loc4_19.1 (%T), .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_56.1 (constants.%struct_type.c.d.e)] +// CHECK:STDOUT: %int_32.loc4_51: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_51: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc4_60: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_60: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %struct_type.c.d.e.loc4_63.2: type = struct_type {.c: @BigStructParam.%T.loc4_19.1 (%T), .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_63.1 (constants.%struct_type.c.d.e)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @BigStructParam.%struct_type.c.d.e.loc4_56.1 (%struct_type.c.d.e) = value_binding x, %x.param +// CHECK:STDOUT: %x: @BigStructParam.%struct_type.c.d.e.loc4_63.1 (%struct_type.c.d.e) = value_binding x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallBigStructParam.decl: %CallBigStructParam.type = fn_decl @CallBigStructParam [concrete = constants.%CallBigStructParam] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @BigStructParam(%T.loc4_19.2: type) { // CHECK:STDOUT: %T.loc4_19.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_19.1 (constants.%T)] -// CHECK:STDOUT: %struct_type.c.d.e.loc4_56.1: type = struct_type {.c: @BigStructParam.%T.loc4_19.1 (%T), .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_56.1 (constants.%struct_type.c.d.e)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.c.d.e.loc4_56.1 [symbolic = %pattern_type (constants.%pattern_type.1d5)] +// CHECK:STDOUT: %struct_type.c.d.e.loc4_63.1: type = struct_type {.c: @BigStructParam.%T.loc4_19.1 (%T), .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_63.1 (constants.%struct_type.c.d.e)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.c.d.e.loc4_63.1 [symbolic = %pattern_type (constants.%pattern_type.1d5)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.c.d.e.loc4_56.1 [symbolic = %require_complete (constants.%require_complete.32d)] +// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.c.d.e.loc4_63.1 [symbolic = %require_complete (constants.%require_complete.32d)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @BigStructParam.%struct_type.c.d.e.loc4_56.1 (%struct_type.c.d.e)) { +// CHECK:STDOUT: fn(%x.param: @BigStructParam.%struct_type.c.d.e.loc4_63.1 (%struct_type.c.d.e)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1186,7 +1186,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: specific @BigStructParam(constants.%T) { // CHECK:STDOUT: %T.loc4_19.1 => constants.%T -// CHECK:STDOUT: %struct_type.c.d.e.loc4_56.1 => constants.%struct_type.c.d.e +// CHECK:STDOUT: %struct_type.c.d.e.loc4_63.1 => constants.%struct_type.c.d.e // CHECK:STDOUT: %pattern_type => constants.%pattern_type.1d5 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1238,27 +1238,27 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc4_21.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_21.1 (constants.%T)] -// CHECK:STDOUT: %x.param: @SmallStructParam.%struct_type.f.g.loc4_49.1 (%struct_type.f.g) = value_param call_param0 -// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.f.g.loc4_49.2 [symbolic = %struct_type.f.g.loc4_49.1 (constants.%struct_type.f.g)] { +// CHECK:STDOUT: %x.param: @SmallStructParam.%struct_type.f.g.loc4_56.1 (%struct_type.f.g) = value_param call_param0 +// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.f.g.loc4_56.2 [symbolic = %struct_type.f.g.loc4_56.1 (constants.%struct_type.f.g)] { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_21.2 [symbolic = %T.loc4_21.1 (constants.%T)] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %struct_type.f.g.loc4_49.2: type = struct_type {.f: @SmallStructParam.%T.loc4_21.1 (%T), .g: %i32} [symbolic = %struct_type.f.g.loc4_49.1 (constants.%struct_type.f.g)] +// CHECK:STDOUT: %struct_type.f.g.loc4_56.2: type = struct_type {.f: @SmallStructParam.%T.loc4_21.1 (%T), .g: %i32} [symbolic = %struct_type.f.g.loc4_56.1 (constants.%struct_type.f.g)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @SmallStructParam.%struct_type.f.g.loc4_49.1 (%struct_type.f.g) = value_binding x, %x.param +// CHECK:STDOUT: %x: @SmallStructParam.%struct_type.f.g.loc4_56.1 (%struct_type.f.g) = value_binding x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallSmallStructParam.decl: %CallSmallStructParam.type = fn_decl @CallSmallStructParam [concrete = constants.%CallSmallStructParam] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @SmallStructParam(%T.loc4_21.2: type) { // CHECK:STDOUT: %T.loc4_21.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_21.1 (constants.%T)] -// CHECK:STDOUT: %struct_type.f.g.loc4_49.1: type = struct_type {.f: @SmallStructParam.%T.loc4_21.1 (%T), .g: %i32} [symbolic = %struct_type.f.g.loc4_49.1 (constants.%struct_type.f.g)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.f.g.loc4_49.1 [symbolic = %pattern_type (constants.%pattern_type.958)] +// CHECK:STDOUT: %struct_type.f.g.loc4_56.1: type = struct_type {.f: @SmallStructParam.%T.loc4_21.1 (%T), .g: %i32} [symbolic = %struct_type.f.g.loc4_56.1 (constants.%struct_type.f.g)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.f.g.loc4_56.1 [symbolic = %pattern_type (constants.%pattern_type.958)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.f.g.loc4_49.1 [symbolic = %require_complete (constants.%require_complete.ed5)] +// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.f.g.loc4_56.1 [symbolic = %require_complete (constants.%require_complete.ed5)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @SmallStructParam.%struct_type.f.g.loc4_49.1 (%struct_type.f.g)) { +// CHECK:STDOUT: fn(%x.param: @SmallStructParam.%struct_type.f.g.loc4_56.1 (%struct_type.f.g)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1276,7 +1276,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: specific @SmallStructParam(constants.%T) { // CHECK:STDOUT: %T.loc4_21.1 => constants.%T -// CHECK:STDOUT: %struct_type.f.g.loc4_49.1 => constants.%struct_type.f.g +// CHECK:STDOUT: %struct_type.f.g.loc4_56.1 => constants.%struct_type.f.g // CHECK:STDOUT: %pattern_type => constants.%pattern_type.958 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1327,27 +1327,27 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc4_25.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_25.1 (constants.%T)] -// CHECK:STDOUT: %x.param: @WrongNameStructParam.%struct_type.i.different.loc4_61.1 (%struct_type.i.different) = value_param call_param0 -// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.i.different.loc4_61.2 [symbolic = %struct_type.i.different.loc4_61.1 (constants.%struct_type.i.different)] { +// CHECK:STDOUT: %x.param: @WrongNameStructParam.%struct_type.i.different.loc4_68.1 (%struct_type.i.different) = value_param call_param0 +// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.i.different.loc4_68.2 [symbolic = %struct_type.i.different.loc4_68.1 (constants.%struct_type.i.different)] { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_25.2 [symbolic = %T.loc4_25.1 (constants.%T)] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %struct_type.i.different.loc4_61.2: type = struct_type {.i: @WrongNameStructParam.%T.loc4_25.1 (%T), .different: %i32} [symbolic = %struct_type.i.different.loc4_61.1 (constants.%struct_type.i.different)] +// CHECK:STDOUT: %struct_type.i.different.loc4_68.2: type = struct_type {.i: @WrongNameStructParam.%T.loc4_25.1 (%T), .different: %i32} [symbolic = %struct_type.i.different.loc4_68.1 (constants.%struct_type.i.different)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @WrongNameStructParam.%struct_type.i.different.loc4_61.1 (%struct_type.i.different) = value_binding x, %x.param +// CHECK:STDOUT: %x: @WrongNameStructParam.%struct_type.i.different.loc4_68.1 (%struct_type.i.different) = value_binding x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallWrongNameStructParam.decl: %CallWrongNameStructParam.type = fn_decl @CallWrongNameStructParam [concrete = constants.%CallWrongNameStructParam] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @WrongNameStructParam(%T.loc4_25.2: type) { // CHECK:STDOUT: %T.loc4_25.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_25.1 (constants.%T)] -// CHECK:STDOUT: %struct_type.i.different.loc4_61.1: type = struct_type {.i: @WrongNameStructParam.%T.loc4_25.1 (%T), .different: %i32} [symbolic = %struct_type.i.different.loc4_61.1 (constants.%struct_type.i.different)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.i.different.loc4_61.1 [symbolic = %pattern_type (constants.%pattern_type.ce4)] +// CHECK:STDOUT: %struct_type.i.different.loc4_68.1: type = struct_type {.i: @WrongNameStructParam.%T.loc4_25.1 (%T), .different: %i32} [symbolic = %struct_type.i.different.loc4_68.1 (constants.%struct_type.i.different)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.i.different.loc4_68.1 [symbolic = %pattern_type (constants.%pattern_type.ce4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.i.different.loc4_61.1 [symbolic = %require_complete (constants.%require_complete.c84)] +// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.i.different.loc4_68.1 [symbolic = %require_complete (constants.%require_complete.c84)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @WrongNameStructParam.%struct_type.i.different.loc4_61.1 (%struct_type.i.different)) { +// CHECK:STDOUT: fn(%x.param: @WrongNameStructParam.%struct_type.i.different.loc4_68.1 (%struct_type.i.different)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1364,7 +1364,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: specific @WrongNameStructParam(constants.%T) { // CHECK:STDOUT: %T.loc4_25.1 => constants.%T -// CHECK:STDOUT: %struct_type.i.different.loc4_61.1 => constants.%struct_type.i.different +// CHECK:STDOUT: %struct_type.i.different.loc4_68.1 => constants.%struct_type.i.different // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ce4 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1415,27 +1415,27 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc4_26.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_26.1 (constants.%T)] -// CHECK:STDOUT: %x.param: @WrongOrderStructParam.%struct_type.first.second.loc4_63.1 (%struct_type.first.second) = value_param call_param0 -// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.first.second.loc4_63.2 [symbolic = %struct_type.first.second.loc4_63.1 (constants.%struct_type.first.second)] { +// CHECK:STDOUT: %x.param: @WrongOrderStructParam.%struct_type.first.second.loc4_70.1 (%struct_type.first.second) = value_param call_param0 +// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.first.second.loc4_70.2 [symbolic = %struct_type.first.second.loc4_70.1 (constants.%struct_type.first.second)] { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_26.2 [symbolic = %T.loc4_26.1 (constants.%T)] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %struct_type.first.second.loc4_63.2: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_26.1 (%T), .second: %i32} [symbolic = %struct_type.first.second.loc4_63.1 (constants.%struct_type.first.second)] +// CHECK:STDOUT: %struct_type.first.second.loc4_70.2: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_26.1 (%T), .second: %i32} [symbolic = %struct_type.first.second.loc4_70.1 (constants.%struct_type.first.second)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @WrongOrderStructParam.%struct_type.first.second.loc4_63.1 (%struct_type.first.second) = value_binding x, %x.param +// CHECK:STDOUT: %x: @WrongOrderStructParam.%struct_type.first.second.loc4_70.1 (%struct_type.first.second) = value_binding x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallWrongOrderStructParam.decl: %CallWrongOrderStructParam.type = fn_decl @CallWrongOrderStructParam [concrete = constants.%CallWrongOrderStructParam] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @WrongOrderStructParam(%T.loc4_26.2: type) { // CHECK:STDOUT: %T.loc4_26.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_26.1 (constants.%T)] -// CHECK:STDOUT: %struct_type.first.second.loc4_63.1: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_26.1 (%T), .second: %i32} [symbolic = %struct_type.first.second.loc4_63.1 (constants.%struct_type.first.second)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.first.second.loc4_63.1 [symbolic = %pattern_type (constants.%pattern_type.ab3)] +// CHECK:STDOUT: %struct_type.first.second.loc4_70.1: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_26.1 (%T), .second: %i32} [symbolic = %struct_type.first.second.loc4_70.1 (constants.%struct_type.first.second)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.first.second.loc4_70.1 [symbolic = %pattern_type (constants.%pattern_type.ab3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.first.second.loc4_63.1 [symbolic = %require_complete (constants.%require_complete.311)] +// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.first.second.loc4_70.1 [symbolic = %require_complete (constants.%require_complete.311)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @WrongOrderStructParam.%struct_type.first.second.loc4_63.1 (%struct_type.first.second)) { +// CHECK:STDOUT: fn(%x.param: @WrongOrderStructParam.%struct_type.first.second.loc4_70.1 (%struct_type.first.second)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1452,7 +1452,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: specific @WrongOrderStructParam(constants.%T) { // CHECK:STDOUT: %T.loc4_26.1 => constants.%T -// CHECK:STDOUT: %struct_type.first.second.loc4_63.1 => constants.%struct_type.first.second +// CHECK:STDOUT: %struct_type.first.second.loc4_70.1 => constants.%struct_type.first.second // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ab3 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/fail_deduce_imported_function.carbon b/toolchain/check/testdata/function/generic/fail_deduce_imported_function.carbon index aa6b5182d2e7..202581587c52 100644 --- a/toolchain/check/testdata/function/generic/fail_deduce_imported_function.carbon +++ b/toolchain/check/testdata/function/generic/fail_deduce_imported_function.carbon @@ -16,21 +16,21 @@ package Lib; interface Z {} -fn A[T:! Z](x: {.a: T}) {} +fn A[T:! Z](unused x: {.a: T}) {} // --- fail_deduce_imported_function.carbon import Lib; -fn A[T:! Lib.Z](x: {.a: T}) {} +fn A[T:! Lib.Z](unused x: {.a: T}) {} fn B() { // CHECK:STDERR: fail_deduce_imported_function.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete] // CHECK:STDERR: A({.b = {}}); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fail_deduce_imported_function.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn A[T:! Lib.Z](x: {.a: T}) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn A[T:! Lib.Z](unused x: {.a: T}) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: A({.b = {}}); @@ -39,8 +39,8 @@ fn B() { // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_deduce_imported_function.carbon:[[@LINE-17]]:1: in import [InImport] // CHECK:STDERR: lib.carbon:4:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn A[T:! Z](x: {.a: T}) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn A[T:! Z](unused x: {.a: T}) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Lib.A({.b = {}}); } @@ -78,14 +78,14 @@ fn B() { // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type] // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc4_6.2: %Z.type = symbolic_binding T, 0 [symbolic = %T.loc4_6.1 (constants.%T)] -// CHECK:STDOUT: %x.param: @A.%struct_type.a.loc4_22.1 (%struct_type.a) = value_param call_param0 -// CHECK:STDOUT: %.loc4_22: type = splice_block %struct_type.a.loc4_22.2 [symbolic = %struct_type.a.loc4_22.1 (constants.%struct_type.a)] { +// CHECK:STDOUT: %x.param: @A.%struct_type.a.loc4_29.1 (%struct_type.a) = value_param call_param0 +// CHECK:STDOUT: %.loc4_29: type = splice_block %struct_type.a.loc4_29.2 [symbolic = %struct_type.a.loc4_29.1 (constants.%struct_type.a)] { // CHECK:STDOUT: %T.ref: %Z.type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc4_21: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %struct_type.a.loc4_22.2: type = struct_type {.a: @A.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc4_22.1 (constants.%struct_type.a)] +// CHECK:STDOUT: %.loc4_28: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %struct_type.a.loc4_29.2: type = struct_type {.a: @A.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc4_29.1 (constants.%struct_type.a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @A.%struct_type.a.loc4_22.1 (%struct_type.a) = value_binding x, %x.param +// CHECK:STDOUT: %x: @A.%struct_type.a.loc4_29.1 (%struct_type.a) = value_binding x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -103,13 +103,13 @@ fn B() { // CHECK:STDOUT: generic fn @A(%T.loc4_6.2: %Z.type) { // CHECK:STDOUT: %T.loc4_6.1: %Z.type = symbolic_binding T, 0 [symbolic = %T.loc4_6.1 (constants.%T)] // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc4_6.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %struct_type.a.loc4_22.1: type = struct_type {.a: @A.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc4_22.1 (constants.%struct_type.a)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.a.loc4_22.1 [symbolic = %pattern_type (constants.%pattern_type.3fc)] +// CHECK:STDOUT: %struct_type.a.loc4_29.1: type = struct_type {.a: @A.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc4_29.1 (constants.%struct_type.a)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.a.loc4_29.1 [symbolic = %pattern_type (constants.%pattern_type.3fc)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.a.loc4_22.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.a.loc4_29.1 [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @A.%struct_type.a.loc4_22.1 (%struct_type.a)) { +// CHECK:STDOUT: fn(%x.param: @A.%struct_type.a.loc4_29.1 (%struct_type.a)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -122,7 +122,7 @@ fn B() { // CHECK:STDOUT: specific @A(constants.%T) { // CHECK:STDOUT: %T.loc4_6.1 => constants.%T // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type -// CHECK:STDOUT: %struct_type.a.loc4_22.1 => constants.%struct_type.a +// CHECK:STDOUT: %struct_type.a.loc4_29.1 => constants.%struct_type.a // CHECK:STDOUT: %pattern_type => constants.%pattern_type.3fc // CHECK:STDOUT: } // CHECK:STDOUT: @@ -181,14 +181,14 @@ fn B() { // CHECK:STDOUT: %Z.ref: type = name_ref Z, imports.%Lib.Z [concrete = constants.%Z.type] // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc4_6.2: %Z.type = symbolic_binding T, 0 [symbolic = %T.loc4_6.1 (constants.%T)] -// CHECK:STDOUT: %x.param: @A.loc4.%struct_type.a.loc4_26.1 (%struct_type.a) = value_param call_param0 -// CHECK:STDOUT: %.loc4_26: type = splice_block %struct_type.a.loc4_26.2 [symbolic = %struct_type.a.loc4_26.1 (constants.%struct_type.a)] { +// CHECK:STDOUT: %x.param: @A.loc4.%struct_type.a.loc4_33.1 (%struct_type.a) = value_param call_param0 +// CHECK:STDOUT: %.loc4_33: type = splice_block %struct_type.a.loc4_33.2 [symbolic = %struct_type.a.loc4_33.1 (constants.%struct_type.a)] { // CHECK:STDOUT: %T.ref: %Z.type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc4_25: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %struct_type.a.loc4_26.2: type = struct_type {.a: @A.loc4.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc4_26.1 (constants.%struct_type.a)] +// CHECK:STDOUT: %.loc4_32: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %struct_type.a.loc4_33.2: type = struct_type {.a: @A.loc4.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc4_33.1 (constants.%struct_type.a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @A.loc4.%struct_type.a.loc4_26.1 (%struct_type.a) = value_binding x, %x.param +// CHECK:STDOUT: %x: @A.loc4.%struct_type.a.loc4_33.1 (%struct_type.a) = value_binding x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [concrete = constants.%B] {} {} // CHECK:STDOUT: } @@ -204,13 +204,13 @@ fn B() { // CHECK:STDOUT: generic fn @A.loc4(%T.loc4_6.2: %Z.type) { // CHECK:STDOUT: %T.loc4_6.1: %Z.type = symbolic_binding T, 0 [symbolic = %T.loc4_6.1 (constants.%T)] // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc4_6.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %struct_type.a.loc4_26.1: type = struct_type {.a: @A.loc4.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc4_26.1 (constants.%struct_type.a)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.a.loc4_26.1 [symbolic = %pattern_type (constants.%pattern_type.857)] +// CHECK:STDOUT: %struct_type.a.loc4_33.1: type = struct_type {.a: @A.loc4.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc4_33.1 (constants.%struct_type.a)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.a.loc4_33.1 [symbolic = %pattern_type (constants.%pattern_type.857)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.a.loc4_26.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.a.loc4_33.1 [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @A.loc4.%struct_type.a.loc4_26.1 (%struct_type.a)) { +// CHECK:STDOUT: fn(%x.param: @A.loc4.%struct_type.a.loc4_33.1 (%struct_type.a)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -247,7 +247,7 @@ fn B() { // CHECK:STDOUT: specific @A.loc4(constants.%T) { // CHECK:STDOUT: %T.loc4_6.1 => constants.%T // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type -// CHECK:STDOUT: %struct_type.a.loc4_26.1 => constants.%struct_type.a +// CHECK:STDOUT: %struct_type.a.loc4_33.1 => constants.%struct_type.a // CHECK:STDOUT: %pattern_type => constants.%pattern_type.857 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/fail_type_param_mismatch.carbon b/toolchain/check/testdata/function/generic/fail_type_param_mismatch.carbon index f1f3e15a5922..61dd07a3846e 100644 --- a/toolchain/check/testdata/function/generic/fail_type_param_mismatch.carbon +++ b/toolchain/check/testdata/function/generic/fail_type_param_mismatch.carbon @@ -12,12 +12,12 @@ fn F(T:! type, U:! type) { var p: T*; - // CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+7]]:14: error: cannot implicitly convert expression of type `T` to `U` [ConversionFailure] - // CHECK:STDERR: let n: U = *p; - // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+4]]:14: note: type `T` does not implement interface `Core.ImplicitAs(U)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let n: U = *p; - // CHECK:STDERR: ^~ + // CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+7]]:21: error: cannot implicitly convert expression of type `T` to `U` [ConversionFailure] + // CHECK:STDERR: let unused n: U = *p; + // CHECK:STDERR: ^~ + // CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+4]]:21: note: type `T` does not implement interface `Core.ImplicitAs(U)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused n: U = *p; + // CHECK:STDERR: ^~ // CHECK:STDERR: - let n: U = *p; + let unused n: U = *p; } diff --git a/toolchain/check/testdata/function/generic/import_specific.carbon b/toolchain/check/testdata/function/generic/import_specific.carbon index 7c2c235442c2..a93d649688ea 100644 --- a/toolchain/check/testdata/function/generic/import_specific.carbon +++ b/toolchain/check/testdata/function/generic/import_specific.carbon @@ -16,7 +16,7 @@ library "[[@TEST_NAME]]"; -fn F(T:! type) { +fn F(unused T:! type) { } fn G(T:! type) { @@ -43,14 +43,15 @@ fn H() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %T.67db0b.1: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type: type = pattern_type type [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] +// CHECK:STDOUT: %T.67db0b.2: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] -// CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%T) [symbolic] +// CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%T.67db0b.2) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -62,18 +63,18 @@ fn H() { // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T.loc4_6.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_6.1 (constants.%T)] +// CHECK:STDOUT: %T.loc4_13.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_13.1 (constants.%T.67db0b.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T.loc7_6.2: type = symbolic_binding T, 0 [symbolic = %T.loc7_6.1 (constants.%T)] +// CHECK:STDOUT: %T.loc7_6.2: type = symbolic_binding T, 0 [symbolic = %T.loc7_6.1 (constants.%T.67db0b.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%T.loc4_6.2: type) { -// CHECK:STDOUT: %T.loc4_6.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_6.1 (constants.%T)] +// CHECK:STDOUT: generic fn @F(%T.loc4_13.2: type) { +// CHECK:STDOUT: %T.loc4_13.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_13.1 (constants.%T.67db0b.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -84,7 +85,7 @@ fn H() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(%T.loc7_6.2: type) { -// CHECK:STDOUT: %T.loc7_6.1: type = symbolic_binding T, 0 [symbolic = %T.loc7_6.1 (constants.%T)] +// CHECK:STDOUT: %T.loc7_6.1: type = symbolic_binding T, 0 [symbolic = %T.loc7_6.1 (constants.%T.67db0b.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.specific_fn.loc8_3.2: = specific_function constants.%F, @F(%T.loc7_6.1) [symbolic = %F.specific_fn.loc8_3.2 (constants.%F.specific_fn)] @@ -92,21 +93,25 @@ fn H() { // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc7_6.2 [symbolic = %T.loc7_6.1 (constants.%T)] -// CHECK:STDOUT: %F.specific_fn.loc8_3.1: = specific_function %F.ref, @F(constants.%T) [symbolic = %F.specific_fn.loc8_3.2 (constants.%F.specific_fn)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc7_6.2 [symbolic = %T.loc7_6.1 (constants.%T.67db0b.2)] +// CHECK:STDOUT: %F.specific_fn.loc8_3.1: = specific_function %F.ref, @F(constants.%T.67db0b.2) [symbolic = %F.specific_fn.loc8_3.2 (constants.%F.specific_fn)] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn.loc8_3.1() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%T) { -// CHECK:STDOUT: %T.loc4_6.1 => constants.%T -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: +// CHECK:STDOUT: specific @F(constants.%T.67db0b.1) { +// CHECK:STDOUT: %T.loc4_13.1 => constants.%T.67db0b.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @G(constants.%T) { -// CHECK:STDOUT: %T.loc7_6.1 => constants.%T +// CHECK:STDOUT: specific @G(constants.%T.67db0b.2) { +// CHECK:STDOUT: %T.loc7_6.1 => constants.%T.67db0b.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%T.67db0b.2) { +// CHECK:STDOUT: %T.loc4_13.1 => constants.%T.67db0b.2 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- user.carbon @@ -120,19 +125,20 @@ fn H() { // CHECK:STDOUT: %H: %H.type = struct_value () [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %T.67db0b.1: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %F.specific_fn.540: = specific_function %F, @F(%C) [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] -// CHECK:STDOUT: %F.specific_fn.643: = specific_function %F, @F(%T) [symbolic] +// CHECK:STDOUT: %T.67db0b.2: type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %F.specific_fn.643: = specific_function %F, @F(%T.67db0b.2) [symbolic] // CHECK:STDOUT: %G.specific_fn: = specific_function %G, @G(%C) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.F: %F.type = import_ref Main//library, F, loaded [concrete = constants.%F] // CHECK:STDOUT: %Main.G: %G.type = import_ref Main//library, G, loaded [concrete = constants.%G] -// CHECK:STDOUT: %Main.import_ref.b3bc94.1: type = import_ref Main//library, loc4_6, loaded [symbolic = @F.%T (constants.%T)] -// CHECK:STDOUT: %Main.import_ref.b3bc94.2: type = import_ref Main//library, loc7_6, loaded [symbolic = @G.%T (constants.%T)] +// CHECK:STDOUT: %Main.import_ref.b3bc94.1: type = import_ref Main//library, loc4_13, loaded [symbolic = @F.%T (constants.%T.67db0b.1)] +// CHECK:STDOUT: %Main.import_ref.b3bc94.2: type = import_ref Main//library, loc7_6, loaded [symbolic = @G.%T (constants.%T.67db0b.2)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -169,7 +175,7 @@ fn H() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(imports.%Main.import_ref.b3bc94.1: type) [from "library.carbon"] { -// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T.67db0b.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -177,7 +183,7 @@ fn H() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(imports.%Main.import_ref.b3bc94.2: type) [from "library.carbon"] { -// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T.67db0b.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.specific_fn: = specific_function constants.%F, @F(%T) [symbolic = %F.specific_fn (constants.%F.specific_fn.643)] @@ -185,10 +191,8 @@ fn H() { // CHECK:STDOUT: fn; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: +// CHECK:STDOUT: specific @F(constants.%T.67db0b.1) { +// CHECK:STDOUT: %T => constants.%T.67db0b.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%C) { @@ -197,8 +201,14 @@ fn H() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @G(constants.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @F(constants.%T.67db0b.2) { +// CHECK:STDOUT: %T => constants.%T.67db0b.2 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @G(constants.%T.67db0b.2) { +// CHECK:STDOUT: %T => constants.%T.67db0b.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%C) { diff --git a/toolchain/check/testdata/function/generic/redeclare.carbon b/toolchain/check/testdata/function/generic/redeclare.carbon index bbb9e4288284..46de5b7e020a 100644 --- a/toolchain/check/testdata/function/generic/redeclare.carbon +++ b/toolchain/check/testdata/function/generic/redeclare.carbon @@ -52,14 +52,14 @@ library "[[@TEST_NAME]]"; fn F(T:! type, U:! type) -> T*; -// CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:6: error: redeclaration differs at parameter 1 [RedeclParamDiffers] -// CHECK:STDERR: fn F(U:! type, T:! type) -> T* { -// CHECK:STDERR: ^ +// CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:13: error: redeclaration differs at parameter 1 [RedeclParamDiffers] +// CHECK:STDERR: fn F(unused U:! type, T:! type) -> T* { +// CHECK:STDERR: ^ // CHECK:STDERR: fail_reorder.carbon:[[@LINE-5]]:6: note: previous declaration's corresponding parameter here [RedeclParamPrevious] // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^ // CHECK:STDERR: -fn F(U:! type, T:! type) -> T* { +fn F(unused U:! type, T:! type) -> T* { // CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:10: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch] // CHECK:STDERR: return F(T); // CHECK:STDERR: ^~~~ @@ -352,15 +352,15 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: %return.patt: @F.loc13.%pattern_type (%pattern_type.423) = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: @F.loc13.%pattern_type (%pattern_type.423) = out_param_pattern %return.patt, call_param0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, %T.loc13_16.2 [symbolic = %T.loc13_16.1 (constants.%T.091)] -// CHECK:STDOUT: %ptr.loc13_30.2: type = ptr_type %T.ref.loc13 [symbolic = %ptr.loc13_30.1 (constants.%ptr.18e)] -// CHECK:STDOUT: %.loc13_30.2: Core.Form = init_form %ptr.loc13_30.2, call_param0 [symbolic = %.loc13_30.1 (constants.%.a9f)] +// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, %T.loc13_23.2 [symbolic = %T.loc13_23.1 (constants.%T.091)] +// CHECK:STDOUT: %ptr.loc13_37.2: type = ptr_type %T.ref.loc13 [symbolic = %ptr.loc13_37.1 (constants.%ptr.18e)] +// CHECK:STDOUT: %.loc13_37.2: Core.Form = init_form %ptr.loc13_37.2, call_param0 [symbolic = %.loc13_37.1 (constants.%.a9f)] // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %U.loc13_6.2: type = symbolic_binding U, 0 [symbolic = %U.loc13_6.1 (constants.%U.67d)] +// CHECK:STDOUT: %U.loc13_13.2: type = symbolic_binding U, 0 [symbolic = %U.loc13_13.1 (constants.%U.67d)] // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T.loc13_16.2: type = symbolic_binding T, 1 [symbolic = %T.loc13_16.1 (constants.%T.091)] -// CHECK:STDOUT: %return.param: ref @F.loc13.%ptr.loc13_30.1 (%ptr.18e) = out_param call_param0 -// CHECK:STDOUT: %return: ref @F.loc13.%ptr.loc13_30.1 (%ptr.18e) = return_slot %return.param +// CHECK:STDOUT: %T.loc13_23.2: type = symbolic_binding T, 1 [symbolic = %T.loc13_23.1 (constants.%T.091)] +// CHECK:STDOUT: %return.param: ref @F.loc13.%ptr.loc13_37.1 (%ptr.18e) = out_param call_param0 +// CHECK:STDOUT: %return: ref @F.loc13.%ptr.loc13_37.1 (%ptr.18e) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -374,20 +374,20 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: fn() -> out %return.param: @F.loc4.%ptr.loc4_30.1 (%ptr.e8f); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.loc13(%U.loc13_6.2: type, %T.loc13_16.2: type) { -// CHECK:STDOUT: %U.loc13_6.1: type = symbolic_binding U, 0 [symbolic = %U.loc13_6.1 (constants.%U.67d)] -// CHECK:STDOUT: %T.loc13_16.1: type = symbolic_binding T, 1 [symbolic = %T.loc13_16.1 (constants.%T.091)] -// CHECK:STDOUT: %ptr.loc13_30.1: type = ptr_type %T.loc13_16.1 [symbolic = %ptr.loc13_30.1 (constants.%ptr.18e)] -// CHECK:STDOUT: %.loc13_30.1: Core.Form = init_form %ptr.loc13_30.1, call_param0 [symbolic = %.loc13_30.1 (constants.%.a9f)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc13_30.1 [symbolic = %pattern_type (constants.%pattern_type.423)] +// CHECK:STDOUT: generic fn @F.loc13(%U.loc13_13.2: type, %T.loc13_23.2: type) { +// CHECK:STDOUT: %U.loc13_13.1: type = symbolic_binding U, 0 [symbolic = %U.loc13_13.1 (constants.%U.67d)] +// CHECK:STDOUT: %T.loc13_23.1: type = symbolic_binding T, 1 [symbolic = %T.loc13_23.1 (constants.%T.091)] +// CHECK:STDOUT: %ptr.loc13_37.1: type = ptr_type %T.loc13_23.1 [symbolic = %ptr.loc13_37.1 (constants.%ptr.18e)] +// CHECK:STDOUT: %.loc13_37.1: Core.Form = init_form %ptr.loc13_37.1, call_param0 [symbolic = %.loc13_37.1 (constants.%.a9f)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc13_37.1 [symbolic = %pattern_type (constants.%pattern_type.423)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %ptr.loc13_30.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %ptr.loc13_37.1 [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: -// CHECK:STDOUT: fn() -> out %return.param: @F.loc13.%ptr.loc13_30.1 (%ptr.18e) { +// CHECK:STDOUT: fn() -> out %return.param: @F.loc13.%ptr.loc13_37.1 (%ptr.18e) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type.117dbc.1 = name_ref F, file.%F.decl.loc4 [concrete = constants.%F.d98bd5.1] -// CHECK:STDOUT: %T.ref.loc21: type = name_ref T, %T.loc13_16.2 [symbolic = %T.loc13_16.1 (constants.%T.091)] +// CHECK:STDOUT: %T.ref.loc21: type = name_ref T, %T.loc13_23.2 [symbolic = %T.loc13_23.1 (constants.%T.091)] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -401,10 +401,10 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.loc13(constants.%U.67d, constants.%T.091) { -// CHECK:STDOUT: %U.loc13_6.1 => constants.%U.67d -// CHECK:STDOUT: %T.loc13_16.1 => constants.%T.091 -// CHECK:STDOUT: %ptr.loc13_30.1 => constants.%ptr.18e -// CHECK:STDOUT: %.loc13_30.1 => constants.%.a9f +// CHECK:STDOUT: %U.loc13_13.1 => constants.%U.67d +// CHECK:STDOUT: %T.loc13_23.1 => constants.%T.091 +// CHECK:STDOUT: %ptr.loc13_37.1 => constants.%ptr.18e +// CHECK:STDOUT: %.loc13_37.1 => constants.%.a9f // CHECK:STDOUT: %pattern_type => constants.%pattern_type.423 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index 131ccce0d120..9ec5ea462b34 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -24,10 +24,10 @@ fn ErrorIfNIsZero(N:! Core.IntLiteral()) { // CHECK:STDERR: min_prelude/parts/int.carbon:11:9: error: integer type width of 0 is not positive [IntWidthNotPositive] // CHECK:STDERR: adapt MakeInt(N); // CHECK:STDERR: ^~~~~~~~~~ - // CHECK:STDERR: fail_todo_call_monomorphization_error.carbon:[[@LINE+3]]:10: note: in `i0` used here [ResolvingSpecificHere] - // CHECK:STDERR: var v: Core.Int(N); - // CHECK:STDERR: ^~~~~~~~~~~ - var v: Core.Int(N); + // CHECK:STDERR: fail_todo_call_monomorphization_error.carbon:[[@LINE+3]]:17: note: in `i0` used here [ResolvingSpecificHere] + // CHECK:STDERR: var unused v: Core.Int(N); + // CHECK:STDERR: ^~~~~~~~~~~ + var unused v: Core.Int(N); } fn CallNegative() { @@ -117,11 +117,11 @@ fn CallNegative() { // CHECK:STDOUT: %N.loc4_19.1: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc4_19.1 (constants.%N)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Int.loc15_20.2: type = class_type @Int, @Int(%N.loc4_19.1) [symbolic = %Int.loc15_20.2 (constants.%Int)] -// CHECK:STDOUT: %require_complete: = require_complete_type %Int.loc15_20.2 [symbolic = %require_complete (constants.%require_complete.901)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Int.loc15_20.2 [symbolic = %pattern_type (constants.%pattern_type.764)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Int.loc15_20.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Int.loc15_20.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.1c0)] +// CHECK:STDOUT: %Int.loc15_27.2: type = class_type @Int, @Int(%N.loc4_19.1) [symbolic = %Int.loc15_27.2 (constants.%Int)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Int.loc15_27.2 [symbolic = %require_complete (constants.%require_complete.901)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Int.loc15_27.2 [symbolic = %pattern_type (constants.%pattern_type.764)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Int.loc15_27.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Int.loc15_27.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.1c0)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.297)] // CHECK:STDOUT: %.loc15_3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc15_3 (constants.%.e63)] // CHECK:STDOUT: %impl.elem0.loc15_3.2: @ErrorIfNIsZero.%.loc15_3 (%.e63) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc15_3.2 (constants.%impl.elem0)] @@ -133,14 +133,14 @@ fn CallNegative() { // CHECK:STDOUT: %v.patt: @ErrorIfNIsZero.%pattern_type (%pattern_type.764) = ref_binding_pattern v [concrete] // CHECK:STDOUT: %v.var_patt: @ErrorIfNIsZero.%pattern_type (%pattern_type.764) = var_pattern %v.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %v.var: ref @ErrorIfNIsZero.%Int.loc15_20.2 (%Int) = var %v.var_patt -// CHECK:STDOUT: %.loc15_20: type = splice_block %Int.loc15_20.1 [symbolic = %Int.loc15_20.2 (constants.%Int)] { +// CHECK:STDOUT: %v.var: ref @ErrorIfNIsZero.%Int.loc15_27.2 (%Int) = var %v.var_patt +// CHECK:STDOUT: %.loc15_27: type = splice_block %Int.loc15_27.1 [symbolic = %Int.loc15_27.2 (constants.%Int)] { // CHECK:STDOUT: %Core.ref.loc15: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc4_19.2 [symbolic = %N.loc4_19.1 (constants.%N)] -// CHECK:STDOUT: %Int.loc15_20.1: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc15_20.2 (constants.%Int)] +// CHECK:STDOUT: %Int.loc15_27.1: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc15_27.2 (constants.%Int)] // CHECK:STDOUT: } -// CHECK:STDOUT: %v: ref @ErrorIfNIsZero.%Int.loc15_20.2 (%Int) = ref_binding v, %v.var +// CHECK:STDOUT: %v: ref @ErrorIfNIsZero.%Int.loc15_27.2 (%Int) = ref_binding v, %v.var // CHECK:STDOUT: %impl.elem0.loc15_3.1: @ErrorIfNIsZero.%.loc15_3 (%.e63) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc15_3.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc15_3.1: = bound_method %v.var, %impl.elem0.loc15_3.1 // CHECK:STDOUT: %specific_impl_fn.loc15_3.1: = specific_impl_function %impl.elem0.loc15_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.1c0) [symbolic = %specific_impl_fn.loc15_3.2 (constants.%specific_impl_fn)] @@ -169,7 +169,7 @@ fn CallNegative() { // CHECK:STDOUT: %N.loc4_19.1 => constants.%int_0 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Int.loc15_20.2 => constants.%i0 +// CHECK:STDOUT: %Int.loc15_27.2 => constants.%i0 // CHECK:STDOUT: %require_complete => constants.%complete_type.d94 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.47b // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.809 diff --git a/toolchain/check/testdata/function/generic/return_slot.carbon b/toolchain/check/testdata/function/generic/return_slot.carbon index cf1185a47581..b8f7015e00c0 100644 --- a/toolchain/check/testdata/function/generic/return_slot.carbon +++ b/toolchain/check/testdata/function/generic/return_slot.carbon @@ -19,9 +19,9 @@ class Wrap(T:! type) { class C { var arr: array(i32, 100); } fn G() { - var a: i32 = Wrap(i32).Make(); - var b: () = Wrap(()).Make(); - var c: C = Wrap(C).Make(); + var unused a: i32 = Wrap(i32).Make(); + var unused b: () = Wrap(()).Make(); + var unused c: C = Wrap(C).Make(); } // CHECK:STDOUT: --- return_slot.carbon @@ -186,17 +186,17 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %i32 = var %a.var_patt // CHECK:STDOUT: %Wrap.ref.loc22: %Wrap.type = name_ref Wrap, file.%Wrap.decl [concrete = constants.%Wrap.generic] -// CHECK:STDOUT: %int_32.loc22_21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc22_21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc22_28: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc22_28: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %Wrap.loc22: type = class_type @Wrap, @Wrap(constants.%i32) [concrete = constants.%Wrap.e80] -// CHECK:STDOUT: %.loc22_25: %Wrap.Make.type.939 = specific_constant @Wrap.%Wrap.Make.decl, @Wrap(constants.%i32) [concrete = constants.%Wrap.Make.6cb] -// CHECK:STDOUT: %Make.ref.loc22: %Wrap.Make.type.939 = name_ref Make, %.loc22_25 [concrete = constants.%Wrap.Make.6cb] +// CHECK:STDOUT: %.loc22_32: %Wrap.Make.type.939 = specific_constant @Wrap.%Wrap.Make.decl, @Wrap(constants.%i32) [concrete = constants.%Wrap.Make.6cb] +// CHECK:STDOUT: %Make.ref.loc22: %Wrap.Make.type.939 = name_ref Make, %.loc22_32 [concrete = constants.%Wrap.Make.6cb] // CHECK:STDOUT: %Wrap.Make.specific_fn.loc22: = specific_function %Make.ref.loc22, @Wrap.Make(constants.%i32) [concrete = constants.%Wrap.Make.specific_fn.35c] // CHECK:STDOUT: %Wrap.Make.call.loc22: init %i32 = call %Wrap.Make.specific_fn.loc22() // CHECK:STDOUT: assign %a.var, %Wrap.Make.call.loc22 -// CHECK:STDOUT: %.loc22_10: type = splice_block %i32.loc22_10 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc22_10: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc22_10: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc22_17: type = splice_block %i32.loc22_17 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc22_17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc22_17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %i32 = ref_binding a, %a.var // CHECK:STDOUT: name_binding_decl { @@ -205,17 +205,17 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref %empty_tuple.type = var %b.var_patt // CHECK:STDOUT: %Wrap.ref.loc23: %Wrap.type = name_ref Wrap, file.%Wrap.decl [concrete = constants.%Wrap.generic] -// CHECK:STDOUT: %.loc23_21: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc23_22: type = converted %.loc23_21, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc23_28: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc23_29: type = converted %.loc23_28, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %Wrap.loc23: type = class_type @Wrap, @Wrap(constants.%empty_tuple.type) [concrete = constants.%Wrap.0f1] -// CHECK:STDOUT: %.loc23_23: %Wrap.Make.type.fb0 = specific_constant @Wrap.%Wrap.Make.decl, @Wrap(constants.%empty_tuple.type) [concrete = constants.%Wrap.Make.b5c] -// CHECK:STDOUT: %Make.ref.loc23: %Wrap.Make.type.fb0 = name_ref Make, %.loc23_23 [concrete = constants.%Wrap.Make.b5c] +// CHECK:STDOUT: %.loc23_30: %Wrap.Make.type.fb0 = specific_constant @Wrap.%Wrap.Make.decl, @Wrap(constants.%empty_tuple.type) [concrete = constants.%Wrap.Make.b5c] +// CHECK:STDOUT: %Make.ref.loc23: %Wrap.Make.type.fb0 = name_ref Make, %.loc23_30 [concrete = constants.%Wrap.Make.b5c] // CHECK:STDOUT: %Wrap.Make.specific_fn.loc23: = specific_function %Make.ref.loc23, @Wrap.Make(constants.%empty_tuple.type) [concrete = constants.%Wrap.Make.specific_fn.c03] // CHECK:STDOUT: %Wrap.Make.call.loc23: init %empty_tuple.type = call %Wrap.Make.specific_fn.loc23() // CHECK:STDOUT: assign %b.var, %Wrap.Make.call.loc23 -// CHECK:STDOUT: %.loc23_11.1: type = splice_block %.loc23_11.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc23_11.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc23_11.3: type = converted %.loc23_11.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc23_18.1: type = splice_block %.loc23_18.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc23_18.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc23_18.3: type = converted %.loc23_18.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %b: ref %empty_tuple.type = ref_binding b, %b.var // CHECK:STDOUT: name_binding_decl { @@ -224,15 +224,15 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: %c.var: ref %C = var %c.var_patt // CHECK:STDOUT: %Wrap.ref.loc24: %Wrap.type = name_ref Wrap, file.%Wrap.decl [concrete = constants.%Wrap.generic] -// CHECK:STDOUT: %C.ref.loc24_19: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc24_26: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %Wrap.loc24: type = class_type @Wrap, @Wrap(constants.%C) [concrete = constants.%Wrap.3b1] -// CHECK:STDOUT: %.loc24_21: %Wrap.Make.type.a8f = specific_constant @Wrap.%Wrap.Make.decl, @Wrap(constants.%C) [concrete = constants.%Wrap.Make.62a] -// CHECK:STDOUT: %Make.ref.loc24: %Wrap.Make.type.a8f = name_ref Make, %.loc24_21 [concrete = constants.%Wrap.Make.62a] +// CHECK:STDOUT: %.loc24_28: %Wrap.Make.type.a8f = specific_constant @Wrap.%Wrap.Make.decl, @Wrap(constants.%C) [concrete = constants.%Wrap.Make.62a] +// CHECK:STDOUT: %Make.ref.loc24: %Wrap.Make.type.a8f = name_ref Make, %.loc24_28 [concrete = constants.%Wrap.Make.62a] // CHECK:STDOUT: %Wrap.Make.specific_fn.loc24: = specific_function %Make.ref.loc24, @Wrap.Make(constants.%C) [concrete = constants.%Wrap.Make.specific_fn.cb9] // CHECK:STDOUT: %.loc24_3: ref %C = splice_block %c.var {} // CHECK:STDOUT: %Wrap.Make.call.loc24: init %C to %.loc24_3 = call %Wrap.Make.specific_fn.loc24() // CHECK:STDOUT: assign %c.var, %Wrap.Make.call.loc24 -// CHECK:STDOUT: %C.ref.loc24_10: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc24_17: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %c: ref %C = ref_binding c, %c.var // CHECK:STDOUT: %DestroyOp.bound.loc24: = bound_method %c.var, constants.%DestroyOp.b0ebf8.1 // CHECK:STDOUT: %DestroyOp.call.loc24: init %empty_tuple.type = call %DestroyOp.bound.loc24(%c.var) diff --git a/toolchain/check/testdata/function/generic/template_param.carbon b/toolchain/check/testdata/function/generic/template_param.carbon index 08d1958e0ece..00c71be06dc0 100644 --- a/toolchain/check/testdata/function/generic/template_param.carbon +++ b/toolchain/check/testdata/function/generic/template_param.carbon @@ -16,7 +16,7 @@ library "[[@TEST_NAME]]"; -fn F(template T:! type) { +fn F(unused template T:! type) { } fn G() { @@ -49,13 +49,13 @@ fn G() { // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0, template [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T.loc4_15.2: type = symbolic_binding T, 0, template [template = %T.loc4_15.1 (constants.%T)] +// CHECK:STDOUT: %T.loc4_22.2: type = symbolic_binding T, 0, template [template = %T.loc4_22.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%T.loc4_15.2: type) { -// CHECK:STDOUT: %T.loc4_15.1: type = symbolic_binding T, 0, template [template = %T.loc4_15.1 (constants.%T)] +// CHECK:STDOUT: generic fn @F(%T.loc4_22.2: type) { +// CHECK:STDOUT: %T.loc4_22.1: type = symbolic_binding T, 0, template [template = %T.loc4_22.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -76,11 +76,11 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { -// CHECK:STDOUT: %T.loc4_15.1 => constants.%T +// CHECK:STDOUT: %T.loc4_22.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%empty_struct_type) { -// CHECK:STDOUT: %T.loc4_15.1 => constants.%empty_struct_type +// CHECK:STDOUT: %T.loc4_22.1 => constants.%empty_struct_type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/generic/type_param.carbon b/toolchain/check/testdata/function/generic/type_param.carbon index 34c4bd90c7e3..96f65587d88b 100644 --- a/toolchain/check/testdata/function/generic/type_param.carbon +++ b/toolchain/check/testdata/function/generic/type_param.carbon @@ -14,7 +14,7 @@ fn F(T:! type) { var p: T*; - let n: T = *p; + let unused n: T = *p; } // CHECK:STDOUT: --- type_param.carbon @@ -96,11 +96,11 @@ fn F(T:! type) { // CHECK:STDOUT: %n.patt: @F.%pattern_type.loc17 (%pattern_type.51d) = value_binding_pattern n [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %p.ref: ref @F.%ptr.loc16_11.2 (%ptr) = name_ref p, %p -// CHECK:STDOUT: %.loc17_15: @F.%ptr.loc16_11.2 (%ptr) = acquire_value %p.ref -// CHECK:STDOUT: %.loc17_14.1: ref @F.%T.loc15_6.1 (%T) = deref %.loc17_15 +// CHECK:STDOUT: %.loc17_22: @F.%ptr.loc16_11.2 (%ptr) = acquire_value %p.ref +// CHECK:STDOUT: %.loc17_21.1: ref @F.%T.loc15_6.1 (%T) = deref %.loc17_22 // CHECK:STDOUT: %T.ref.loc17: type = name_ref T, %T.loc15_6.2 [symbolic = %T.loc15_6.1 (constants.%T)] -// CHECK:STDOUT: %.loc17_14.2: @F.%T.loc15_6.1 (%T) = acquire_value %.loc17_14.1 -// CHECK:STDOUT: %n: @F.%T.loc15_6.1 (%T) = value_binding n, %.loc17_14.2 +// CHECK:STDOUT: %.loc17_21.2: @F.%T.loc15_6.1 (%T) = acquire_value %.loc17_21.1 +// CHECK:STDOUT: %n: @F.%T.loc15_6.1 (%T) = value_binding n, %.loc17_21.2 // CHECK:STDOUT: %impl.elem0.loc16_3.1: @F.%.loc16_3 (%.c3f) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_3.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc16_3.1: = bound_method %p.var, %impl.elem0.loc16_3.1 // CHECK:STDOUT: %specific_impl_fn.loc16_3.1: = specific_impl_function %impl.elem0.loc16_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.loc16_3.2 (constants.%specific_impl_fn)] diff --git a/toolchain/check/testdata/function/generic/undefined.carbon b/toolchain/check/testdata/function/generic/undefined.carbon index 2dcec42e6b9a..1e9127aade1b 100644 --- a/toolchain/check/testdata/function/generic/undefined.carbon +++ b/toolchain/check/testdata/function/generic/undefined.carbon @@ -14,7 +14,7 @@ library "[[@TEST_NAME]]"; -fn Defined[T:! type](x: T) {} +fn Defined[T:! type](unused x: T) {} fn CallDefined() { Defined(0 as i32); @@ -30,7 +30,7 @@ fn CallDefined() { Defined(0 as i32); } -fn Defined[T:! type](x: T) {} +fn Defined[T:! type](unused x: T) {} // --- fail_call_undefined.carbon diff --git a/toolchain/check/testdata/generic/call_basic_depth.carbon b/toolchain/check/testdata/generic/call_basic_depth.carbon index b36c34164de9..83d428fdefa0 100644 --- a/toolchain/check/testdata/generic/call_basic_depth.carbon +++ b/toolchain/check/testdata/generic/call_basic_depth.carbon @@ -11,12 +11,12 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/generic/call_basic_depth.carbon class C { - fn Cfn[self: Self, T:! type](x: T) { + fn Cfn[unused self: Self, T:! type](unused x: T) { } } //@dump-sem-ir-begin -fn F[T:! type](x: T) { +fn F[T:! type](unused x: T) { } //@dump-sem-ir-end diff --git a/toolchain/check/testdata/generic/complete_type.carbon b/toolchain/check/testdata/generic/complete_type.carbon index 1b0d11fd8057..f0d97738bcd2 100644 --- a/toolchain/check/testdata/generic/complete_type.carbon +++ b/toolchain/check/testdata/generic/complete_type.carbon @@ -28,18 +28,18 @@ class A(T:! type) { var v: T; } -// CHECK:STDERR: fail_incomplete_in_class.carbon:[[@LINE+11]]:6: note: in `A(B)` used here [ResolvingSpecificHere] -// CHECK:STDERR: fn F(x: A(B)) {} -// CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: fail_incomplete_in_class.carbon:[[@LINE+11]]:13: note: in `A(B)` used here [ResolvingSpecificHere] +// CHECK:STDERR: fn F(unused x: A(B)) {} +// CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_incomplete_in_class.carbon:[[@LINE+7]]:6: error: parameter has incomplete type `A(B)` in function definition [IncompleteTypeInFunctionParam] -// CHECK:STDERR: fn F(x: A(B)) {} -// CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: fail_incomplete_in_class.carbon:[[@LINE+7]]:13: error: parameter has incomplete type `A(B)` in function definition [IncompleteTypeInFunctionParam] +// CHECK:STDERR: fn F(unused x: A(B)) {} +// CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_incomplete_in_class.carbon:[[@LINE-19]]:1: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class B; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -fn F(x: A(B)) {} +fn F(unused x: A(B)) {} class B {} diff --git a/toolchain/check/testdata/generic/dot_self_symbolic_type.carbon b/toolchain/check/testdata/generic/dot_self_symbolic_type.carbon index 6d0d9a66a1ae..fc2900e704cf 100644 --- a/toolchain/check/testdata/generic/dot_self_symbolic_type.carbon +++ b/toolchain/check/testdata/generic/dot_self_symbolic_type.carbon @@ -21,7 +21,7 @@ class C(CC:! type) { // The `.Self` bind_symbolic_name here should have a // symbolic constant value, not symbolic_self, because // its type depends on `CC`. - fn F(T:! A(CC) where .X = CC) {} + fn F(unused T:! A(CC) where .X = CC) {} //@dump-sem-ir-end } @@ -32,8 +32,8 @@ class D(DD:! type) { // CHECK:STDERR: C(DD).F(T); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: fail_dot_self_symbolic_type.carbon:[[@LINE-10]]:3: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn F(T:! A(CC) where .X = CC) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn F(unused T:! A(CC) where .X = CC) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: C(DD).F(T); //@dump-sem-ir-end @@ -134,25 +134,25 @@ fn H(T:! type) { // CHECK:STDOUT: %C.F.decl: @C.%C.F.type (%C.F.type.1f899e.1) = fn_decl @C.F [symbolic = @C.%C.F (constants.%C.F.faeec9.1)] { // CHECK:STDOUT: %T.patt: @C.F.%pattern_type (%pattern_type.1d5) = symbolic_binding_pattern T, 1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc11_18.1: type = splice_block %.loc11_18.2 [symbolic = %A_where.type (constants.%A_where.type.4028e0.1)] { +// CHECK:STDOUT: %.loc11_25.1: type = splice_block %.loc11_25.2 [symbolic = %A_where.type (constants.%A_where.type.4028e0.1)] { // CHECK:STDOUT: // CHECK:STDOUT: %A.ref: %A.type.464 = name_ref A, file.%A.decl [concrete = constants.%A.generic] -// CHECK:STDOUT: %CC.ref.loc11_14: type = name_ref CC, @C.%CC.loc6_9.2 [symbolic = %CC (constants.%CC)] -// CHECK:STDOUT: %A.type.loc11_16.2: type = facet_type <@A, @A(constants.%CC)> [symbolic = %A.type.loc11_16.1 (constants.%A.type.ade3d9.2)] +// CHECK:STDOUT: %CC.ref.loc11_21: type = name_ref CC, @C.%CC.loc6_9.2 [symbolic = %CC (constants.%CC)] +// CHECK:STDOUT: %A.type.loc11_23.2: type = facet_type <@A, @A(constants.%CC)> [symbolic = %A.type.loc11_23.1 (constants.%A.type.ade3d9.2)] // CHECK:STDOUT: -// CHECK:STDOUT: %.Self.ref: @C.F.%A.type.loc11_16.1 (%A.type.ade3d9.2) = name_ref .Self, %.Self.3 [symbolic = %.Self.1 (constants.%.Self.660472.1)] +// CHECK:STDOUT: %.Self.ref: @C.F.%A.type.loc11_23.1 (%A.type.ade3d9.2) = name_ref .Self, %.Self.3 [symbolic = %.Self.1 (constants.%.Self.660472.1)] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type)] -// CHECK:STDOUT: %.loc11_24.1: type = converted %.Self.ref, %.Self.as_type [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type)] -// CHECK:STDOUT: %.loc11_24.2: @C.F.%A.assoc_type (%A.assoc_type.9f4820.2) = specific_constant @X.%assoc0, @A(constants.%CC, constants.%.Self.660472.1) [symbolic = %assoc0 (constants.%assoc0.9fa860.2)] -// CHECK:STDOUT: %X.ref: @C.F.%A.assoc_type (%A.assoc_type.9f4820.2) = name_ref X, %.loc11_24.2 [symbolic = %assoc0 (constants.%assoc0.9fa860.2)] -// CHECK:STDOUT: %impl.elem0.loc11_24.2: type = impl_witness_access constants.%A.lookup_impl_witness.04abbb.1, element0 [symbolic = %impl.elem0.loc11_24.1 (constants.%impl.elem0.f51d29.1)] -// CHECK:STDOUT: %CC.ref.loc11_29: type = name_ref CC, @C.%CC.loc6_9.2 [symbolic = %CC (constants.%CC)] -// CHECK:STDOUT: %.loc11_18.2: type = where_expr %.Self.3 [symbolic = %A_where.type (constants.%A_where.type.4028e0.1)] { +// CHECK:STDOUT: %.loc11_31.1: type = converted %.Self.ref, %.Self.as_type [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type)] +// CHECK:STDOUT: %.loc11_31.2: @C.F.%A.assoc_type (%A.assoc_type.9f4820.2) = specific_constant @X.%assoc0, @A(constants.%CC, constants.%.Self.660472.1) [symbolic = %assoc0 (constants.%assoc0.9fa860.2)] +// CHECK:STDOUT: %X.ref: @C.F.%A.assoc_type (%A.assoc_type.9f4820.2) = name_ref X, %.loc11_31.2 [symbolic = %assoc0 (constants.%assoc0.9fa860.2)] +// CHECK:STDOUT: %impl.elem0.loc11_31.2: type = impl_witness_access constants.%A.lookup_impl_witness.04abbb.1, element0 [symbolic = %impl.elem0.loc11_31.1 (constants.%impl.elem0.f51d29.1)] +// CHECK:STDOUT: %CC.ref.loc11_36: type = name_ref CC, @C.%CC.loc6_9.2 [symbolic = %CC (constants.%CC)] +// CHECK:STDOUT: %.loc11_25.2: type = where_expr %.Self.3 [symbolic = %A_where.type (constants.%A_where.type.4028e0.1)] { // CHECK:STDOUT: requirement_base_facet_type constants.%A.type.ade3d9.2 -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc11_24.2, %CC.ref.loc11_29 +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc11_31.2, %CC.ref.loc11_36 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc11_8.2: @C.F.%A_where.type (%A_where.type.4028e0.1) = symbolic_binding T, 1 [symbolic = %T.loc11_8.1 (constants.%T.6c0)] +// CHECK:STDOUT: %T.loc11_15.2: @C.F.%A_where.type (%A_where.type.4028e0.1) = symbolic_binding T, 1 [symbolic = %T.loc11_15.1 (constants.%T.6c0)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: complete_type_witness = %complete_type @@ -183,18 +183,18 @@ fn H(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @C.F(@C.%CC.loc6_9.2: type, %T.loc11_8.2: @C.F.%A_where.type (%A_where.type.4028e0.1)) { +// CHECK:STDOUT: generic fn @C.F(@C.%CC.loc6_9.2: type, %T.loc11_15.2: @C.F.%A_where.type (%A_where.type.4028e0.1)) { // CHECK:STDOUT: %CC: type = symbolic_binding CC, 0 [symbolic = %CC (constants.%CC)] -// CHECK:STDOUT: %A.type.loc11_16.1: type = facet_type <@A, @A(%CC)> [symbolic = %A.type.loc11_16.1 (constants.%A.type.ade3d9.2)] +// CHECK:STDOUT: %A.type.loc11_23.1: type = facet_type <@A, @A(%CC)> [symbolic = %A.type.loc11_23.1 (constants.%A.type.ade3d9.2)] // CHECK:STDOUT: -// CHECK:STDOUT: %require_complete: = require_complete_type %A.type.loc11_16.1 [symbolic = %require_complete (constants.%require_complete.f58)] +// CHECK:STDOUT: %require_complete: = require_complete_type %A.type.loc11_23.1 [symbolic = %require_complete (constants.%require_complete.f58)] // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self.1 [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type)] // CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A, @A(%CC) [symbolic = %A.assoc_type (constants.%A.assoc_type.9f4820.2)] // CHECK:STDOUT: %assoc0: @C.F.%A.assoc_type (%A.assoc_type.9f4820.2) = assoc_entity element0, @A.%X [symbolic = %assoc0 (constants.%assoc0.9fa860.2)] // CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %.Self.1, @A, @A(%CC) [symbolic = %A.lookup_impl_witness (constants.%A.lookup_impl_witness.04abbb.1)] -// CHECK:STDOUT: %impl.elem0.loc11_24.1: type = impl_witness_access %A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_24.1 (constants.%impl.elem0.f51d29.1)] -// CHECK:STDOUT: %A_where.type: type = facet_type <@A, @A(%CC) where %impl.elem0.loc11_24.1 = %CC> [symbolic = %A_where.type (constants.%A_where.type.4028e0.1)] -// CHECK:STDOUT: %T.loc11_8.1: @C.F.%A_where.type (%A_where.type.4028e0.1) = symbolic_binding T, 1 [symbolic = %T.loc11_8.1 (constants.%T.6c0)] +// CHECK:STDOUT: %impl.elem0.loc11_31.1: type = impl_witness_access %A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_31.1 (constants.%impl.elem0.f51d29.1)] +// CHECK:STDOUT: %A_where.type: type = facet_type <@A, @A(%CC) where %impl.elem0.loc11_31.1 = %CC> [symbolic = %A_where.type (constants.%A_where.type.4028e0.1)] +// CHECK:STDOUT: %T.loc11_15.1: @C.F.%A_where.type (%A_where.type.4028e0.1) = symbolic_binding T, 1 [symbolic = %T.loc11_15.1 (constants.%T.6c0)] // CHECK:STDOUT: %pattern_type: type = pattern_type %A_where.type [symbolic = %pattern_type (constants.%pattern_type.1d5)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -241,16 +241,16 @@ fn H(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @C.F(constants.%CC, constants.%T.6c0) { // CHECK:STDOUT: %CC => constants.%CC -// CHECK:STDOUT: %A.type.loc11_16.1 => constants.%A.type.ade3d9.2 +// CHECK:STDOUT: %A.type.loc11_23.1 => constants.%A.type.ade3d9.2 // CHECK:STDOUT: %.Self.1 => constants.%.Self.660472.1 // CHECK:STDOUT: %require_complete => constants.%require_complete.f58 // CHECK:STDOUT: %.Self.binding.as_type => constants.%.Self.binding.as_type // CHECK:STDOUT: %A.assoc_type => constants.%A.assoc_type.9f4820.2 // CHECK:STDOUT: %assoc0 => constants.%assoc0.9fa860.2 // CHECK:STDOUT: %A.lookup_impl_witness => constants.%A.lookup_impl_witness.04abbb.1 -// CHECK:STDOUT: %impl.elem0.loc11_24.1 => constants.%impl.elem0.f51d29.1 +// CHECK:STDOUT: %impl.elem0.loc11_31.1 => constants.%impl.elem0.f51d29.1 // CHECK:STDOUT: %A_where.type => constants.%A_where.type.4028e0.1 -// CHECK:STDOUT: %T.loc11_8.1 => constants.%T.6c0 +// CHECK:STDOUT: %T.loc11_15.1 => constants.%T.6c0 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.1d5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/generic/fail_generic_copy.carbon b/toolchain/check/testdata/generic/fail_generic_copy.carbon index a9311aeb8f3c..41fd93d963fd 100644 --- a/toolchain/check/testdata/generic/fail_generic_copy.carbon +++ b/toolchain/check/testdata/generic/fail_generic_copy.carbon @@ -30,12 +30,12 @@ fn F[T:! type](x: T) -> T { library "[[@TEST_NAME]]"; fn F[T:! Core.Destroy](x: T) { - // CHECK:STDERR: fail_var.carbon:[[@LINE+7]]:14: error: cannot copy value of type `T` [CopyOfUncopyableType] - // CHECK:STDERR: var y: T = x; - // CHECK:STDERR: ^ - // CHECK:STDERR: fail_var.carbon:[[@LINE+4]]:14: note: type `T` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] - // CHECK:STDERR: var y: T = x; - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_var.carbon:[[@LINE+7]]:21: error: cannot copy value of type `T` [CopyOfUncopyableType] + // CHECK:STDERR: var unused y: T = x; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_var.carbon:[[@LINE+4]]:21: note: type `T` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] + // CHECK:STDERR: var unused y: T = x; + // CHECK:STDERR: ^ // CHECK:STDERR: - var y: T = x; + var unused y: T = x; } diff --git a/toolchain/check/testdata/generic/forward_decl.carbon b/toolchain/check/testdata/generic/forward_decl.carbon index f6fbf166812f..10435fa47c48 100644 --- a/toolchain/check/testdata/generic/forward_decl.carbon +++ b/toolchain/check/testdata/generic/forward_decl.carbon @@ -21,4 +21,4 @@ fn F() { G({} as C); } -fn G[T:! Z](p: T) {} +fn G[T:! Z](unused p: T) {} diff --git a/toolchain/check/testdata/generic/local.carbon b/toolchain/check/testdata/generic/local.carbon index 76ff8c4e2657..2b2aa97e8dee 100644 --- a/toolchain/check/testdata/generic/local.carbon +++ b/toolchain/check/testdata/generic/local.carbon @@ -20,7 +20,7 @@ fn F() { class C(T:! type) { var x: T; } - var v: C(i32) = {.x = 1}; + var unused v: C(i32) = {.x = 1}; } // --- fail_param_shadows_class.carbon @@ -161,19 +161,19 @@ class C(C:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %C.d45 = var %v.var_patt // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc8_26.1: %struct_type.x.c96 = struct_literal (%int_1) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc8_33.1: %struct_type.x.c96 = struct_literal (%int_1) [concrete = constants.%struct] // CHECK:STDOUT: %impl.elem0: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc8_26.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %bound_method.loc8_33.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_26.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc8_26.2(%int_1) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc8_26.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc8_26.3: ref %i32 = class_element_access %v.var, element0 -// CHECK:STDOUT: %.loc8_26.4: init %i32 to %.loc8_26.3 = in_place_init %.loc8_26.2 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc8_26.5: init %C.d45 to %v.var = class_init (%.loc8_26.4) [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc8_3: init %C.d45 = converted %.loc8_26.1, %.loc8_26.5 [concrete = constants.%C.val] +// CHECK:STDOUT: %bound_method.loc8_33.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc8_33.2(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc8_33.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc8_33.3: ref %i32 = class_element_access %v.var, element0 +// CHECK:STDOUT: %.loc8_33.4: init %i32 to %.loc8_33.3 = in_place_init %.loc8_33.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc8_33.5: init %C.d45 to %v.var = class_init (%.loc8_33.4) [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc8_3: init %C.d45 = converted %.loc8_33.1, %.loc8_33.5 [concrete = constants.%C.val] // CHECK:STDOUT: assign %v.var, %.loc8_3 -// CHECK:STDOUT: %.loc8_15: type = splice_block %C [concrete = constants.%C.d45] { +// CHECK:STDOUT: %.loc8_22: type = splice_block %C [concrete = constants.%C.d45] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] diff --git a/toolchain/check/testdata/generic/template/unimplemented.carbon b/toolchain/check/testdata/generic/template/unimplemented.carbon index 0597c7d3aa74..c2165bb9792b 100644 --- a/toolchain/check/testdata/generic/template/unimplemented.carbon +++ b/toolchain/check/testdata/generic/template/unimplemented.carbon @@ -52,22 +52,22 @@ library "[[@TEST_NAME]]"; fn F[template T:! Core.Destroy](x: T) { // TODO: These diagnostics aren't very good, and we should only produce one error here. // CHECK:STDERR: fail_todo_unimplemented_convert.carbon:[[@LINE+8]]:3: error: member name of type `` in compound member access is not an instance member or an interface member [CompoundMemberAccessDoesNotUseBase] - // CHECK:STDERR: var v: T = 0; - // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: var unused v: T = 0; + // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_todo_unimplemented_convert.carbon:[[@LINE+4]]:3: error: value of type `` is not callable [CallToNonCallable] - // CHECK:STDERR: var v: T = 0; - // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: var unused v: T = 0; + // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: - var v: T = 0; + var unused v: T = 0; // CHECK:STDERR: fail_todo_unimplemented_convert.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `T` to `i32` [ConversionFailure] - // CHECK:STDERR: var w: i32 = x; - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: var unused w: i32 = x; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_unimplemented_convert.carbon:[[@LINE+4]]:3: note: type `T` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: var w: i32 = x; - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: var unused w: i32 = x; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var w: i32 = x; + var unused w: i32 = x; } // CHECK:STDOUT: --- fail_todo_unimplemented_operator.carbon @@ -347,10 +347,10 @@ fn F[template T:! Core.Destroy](x: T) { // CHECK:STDOUT: %.loc14_3.1: @F.%.loc14_3.4 (@F.%.loc14_3.4) = splice_inst %.loc14_3.3 // CHECK:STDOUT: %.loc14_3.2: @F.%T.binding.as_type (%T.binding.as_type.140) = converted %int_0, [concrete = ] // CHECK:STDOUT: assign %v.var, -// CHECK:STDOUT: %.loc14_10.1: type = splice_block %.loc14_10.2 [template = %T.binding.as_type (constants.%T.binding.as_type.140)] { +// CHECK:STDOUT: %.loc14_17.1: type = splice_block %.loc14_17.2 [template = %T.binding.as_type (constants.%T.binding.as_type.140)] { // CHECK:STDOUT: %T.ref.loc14: %Destroy.type = name_ref T, %T.loc4_15.2 [template = %T.loc4_15.1 (constants.%T.765)] // CHECK:STDOUT: %T.as_type.loc14: type = facet_access_type %T.ref.loc14 [template = %T.binding.as_type (constants.%T.binding.as_type.140)] -// CHECK:STDOUT: %.loc14_10.2: type = converted %T.ref.loc14, %T.as_type.loc14 [template = %T.binding.as_type (constants.%T.binding.as_type.140)] +// CHECK:STDOUT: %.loc14_17.2: type = converted %T.ref.loc14, %T.as_type.loc14 [template = %T.binding.as_type (constants.%T.binding.as_type.140)] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref @F.%T.binding.as_type (%T.binding.as_type.140) = ref_binding v, %v.var // CHECK:STDOUT: name_binding_decl { @@ -361,7 +361,7 @@ fn F[template T:! Core.Destroy](x: T) { // CHECK:STDOUT: %x.ref: @F.%T.binding.as_type (%T.binding.as_type.140) = name_ref x, %x // CHECK:STDOUT: %.loc22_3: %i32 = converted %x.ref, [concrete = ] // CHECK:STDOUT: assign %w.var, -// CHECK:STDOUT: %.loc22_10: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc22_17: type = splice_block %i32 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon index ad362e576e00..8225a27188cf 100644 --- a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon +++ b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon @@ -20,11 +20,11 @@ fn ConditionIsNonConstant(b: bool) { // We choose to not accept this even if both arms evaluate to the same // constant value, because it notionally involves evaluating a non-constant // condition. - // CHECK:STDERR: fail_non_constant_condition.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] - // CHECK:STDERR: var v: if b then i32 else i32 = 1; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_non_constant_condition.carbon:[[@LINE+4]]:17: error: cannot evaluate type expression [TypeExprEvaluationFailure] + // CHECK:STDERR: var unused v: if b then i32 else i32 = 1; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var v: if b then i32 else i32 = 1; + var unused v: if b then i32 else i32 = 1; } // --- fail_non_constant_result.carbon @@ -32,16 +32,16 @@ fn ConditionIsNonConstant(b: bool) { package NonConstantResult; fn ChosenBranchIsNonConstant(t: type) { - // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] - // CHECK:STDERR: var v: if true then t else i32 = 1; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:17: error: cannot evaluate type expression [TypeExprEvaluationFailure] + // CHECK:STDERR: var unused v: if true then t else i32 = 1; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var v: if true then t else i32 = 1; - // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] - // CHECK:STDERR: var w: if false then i32 else t = 1; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ + var unused v: if true then t else i32 = 1; + // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:17: error: cannot evaluate type expression [TypeExprEvaluationFailure] + // CHECK:STDERR: var unused w: if false then i32 else t = 1; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var w: if false then i32 else t = 1; + var unused w: if false then i32 else t = 1; } // CHECK:STDOUT: --- fail_non_constant_condition.carbon @@ -102,27 +102,27 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: %v.var: ref = var %v.var_patt [concrete = ] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: assign %v.var, -// CHECK:STDOUT: br !.loc12_13 +// CHECK:STDOUT: br !.loc12_20 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc12_13: +// CHECK:STDOUT: !.loc12_20: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: -// CHECK:STDOUT: %int_32.loc12_20: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_20: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: br !if.expr.result(%i32.loc12_20) +// CHECK:STDOUT: %int_32.loc12_27: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc12_27: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: br !if.expr.result(%i32.loc12_27) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %int_32.loc12_29: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_29: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: br !if.expr.result(%i32.loc12_29) +// CHECK:STDOUT: %int_32.loc12_36: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc12_36: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: br !if.expr.result(%i32.loc12_36) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result: // CHECK:STDOUT: %.loc12: type = block_arg !if.expr.result -// CHECK:STDOUT: br !.loc12_7 +// CHECK:STDOUT: br !.loc12_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc12_7: +// CHECK:STDOUT: !.loc12_14: // CHECK:STDOUT: %v: ref = ref_binding v, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -178,9 +178,9 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: %v.var: ref = var %v.var_patt [concrete = ] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: assign %v.var, -// CHECK:STDOUT: br !.loc9_13 +// CHECK:STDOUT: br !.loc9_20 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc9_13: +// CHECK:STDOUT: !.loc9_20: // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true] // CHECK:STDOUT: if %true br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: @@ -195,9 +195,9 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc9: // CHECK:STDOUT: %.loc9: type = block_arg !if.expr.result.loc9 -// CHECK:STDOUT: br !.loc9_7 +// CHECK:STDOUT: br !.loc9_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc9_7: +// CHECK:STDOUT: !.loc9_14: // CHECK:STDOUT: %v: ref = ref_binding v, [concrete = ] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %w.patt: = ref_binding_pattern w [concrete] @@ -206,9 +206,9 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: %w.var: ref = var %w.var_patt [concrete = ] // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: assign %w.var, -// CHECK:STDOUT: br !.loc14_13 +// CHECK:STDOUT: br !.loc14_20 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc14_13: +// CHECK:STDOUT: !.loc14_20: // CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false] // CHECK:STDOUT: if %false br !if.expr.then.loc14 else br !if.expr.else.loc14 // CHECK:STDOUT: @@ -223,9 +223,9 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc14: // CHECK:STDOUT: %.loc14: type = block_arg !if.expr.result.loc14 -// CHECK:STDOUT: br !.loc14_7 +// CHECK:STDOUT: br !.loc14_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc14_7: +// CHECK:STDOUT: !.loc14_14: // CHECK:STDOUT: %w: ref = ref_binding w, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/assoc_const_self.carbon b/toolchain/check/testdata/impl/assoc_const_self.carbon index 0f1ca7dde512..2b53aa160db3 100644 --- a/toolchain/check/testdata/impl/assoc_const_self.carbon +++ b/toolchain/check/testdata/impl/assoc_const_self.carbon @@ -52,7 +52,7 @@ interface I { class C {} impl () as Core.ImplicitAs(C) { - fn Convert[self: ()]() -> C { return {}; } + fn Convert[unused self: ()]() -> C { return {}; } } // CHECK:STDERR: fail_assoc_const_not_constant_after_conversion.carbon:[[@LINE+4]]:11: error: associated constant V given value `()` that is not constant after conversion to `C` [AssociatedConstantNotConstantAfterConversion] @@ -501,11 +501,11 @@ fn CallF() { // CHECK:STDOUT: %return.param_patt: %pattern_type.7c7 = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc11_29: Core.Form = init_form %C.ref, call_param1 [concrete = constants.%.b89] +// CHECK:STDOUT: %.loc11_36: Core.Form = init_form %C.ref, call_param1 [concrete = constants.%.b89] // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0 -// CHECK:STDOUT: %.loc11_21.1: type = splice_block %.loc11_21.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc11_21.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc11_21.3: type = converted %.loc11_21.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc11_28.1: type = splice_block %.loc11_28.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc11_28.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc11_28.3: type = converted %.loc11_28.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param // CHECK:STDOUT: %return.param: ref %C = out_param call_param1 @@ -546,10 +546,10 @@ fn CallF() { // CHECK:STDOUT: // CHECK:STDOUT: fn @empty_tuple.type.as.ImplicitAs.impl.Convert(%self.param: %empty_tuple.type) -> out %return.param: %C { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_41.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc11_41.2: init %C to %return.param = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc11_42: init %C = converted %.loc11_41.1, %.loc11_41.2 [concrete = constants.%C.val] -// CHECK:STDOUT: return %.loc11_42 to %return.param +// CHECK:STDOUT: %.loc11_48.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc11_48.2: init %C to %return.param = class_init () [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc11_49: init %C = converted %.loc11_48.1, %.loc11_48.2 [concrete = constants.%C.val] +// CHECK:STDOUT: return %.loc11_49 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%Self.ab9) { diff --git a/toolchain/check/testdata/impl/basic.carbon b/toolchain/check/testdata/impl/basic.carbon index 2b6820ecd694..6e21d9a2f6fb 100644 --- a/toolchain/check/testdata/impl/basic.carbon +++ b/toolchain/check/testdata/impl/basic.carbon @@ -31,7 +31,7 @@ impl C as Simple { library "[[@TEST_NAME]]"; interface I { - fn Op[self: Self](); + fn Op[unused self: Self](); } class C {} @@ -42,7 +42,7 @@ class C {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: impl Unknown as I { - fn Op[self: Self]() {} + fn Op[unused self: Self]() {} } // --- fail_import_invalid_impl.carbon diff --git a/toolchain/check/testdata/impl/compound.carbon b/toolchain/check/testdata/impl/compound.carbon index fd4df4efa22c..d26a3b95fc62 100644 --- a/toolchain/check/testdata/impl/compound.carbon +++ b/toolchain/check/testdata/impl/compound.carbon @@ -90,7 +90,7 @@ interface Instance1 { } impl {.d: ()} as Instance1 { - fn G1[self: Self]() {} + fn G1[unused self: Self]() {} } fn InstanceCall(n: {.d: ()}) { @@ -109,7 +109,7 @@ interface Instance2 { } impl {.e: ()} as Instance2 { - fn G2[self: Self]() {} + fn G2[unused self: Self]() {} } fn InstanceCallFail() { diff --git a/toolchain/check/testdata/impl/error_recovery.carbon b/toolchain/check/testdata/impl/error_recovery.carbon index 6cad18e53ea7..e707fe3dc8ed 100644 --- a/toolchain/check/testdata/impl/error_recovery.carbon +++ b/toolchain/check/testdata/impl/error_recovery.carbon @@ -34,7 +34,7 @@ interface Z {} // CHECK:STDERR: impl forall [T:! type] T as Z; -fn F(U:! Z) {} +fn F(unused U:! Z) {} //@dump-sem-ir-begin fn G(T:! type) { @@ -66,7 +66,7 @@ interface Z {} // CHECK:STDERR: impl forall [T:! type] T as Z; -fn F(U:! Z) {} +fn F(unused U:! Z) {} //@dump-sem-ir-begin fn G(T:! type) { @@ -95,7 +95,7 @@ interface Z {} // CHECK:STDERR: impl forall [T:! type] T as Z; -fn F(U:! Z) {} +fn F(unused U:! Z) {} fn G() { // This impl lookup resolves to a final witness, which poisons any future diff --git a/toolchain/check/testdata/impl/eval_musteval.carbon b/toolchain/check/testdata/impl/eval_musteval.carbon index 07edfa358eb8..c037a74bac16 100644 --- a/toolchain/check/testdata/impl/eval_musteval.carbon +++ b/toolchain/check/testdata/impl/eval_musteval.carbon @@ -35,19 +35,19 @@ import library "interface"; class A { adapt {}; } impl A as Runtime { - fn F[self: Self]() -> type { return A; } + fn F[unused self: Self]() -> type { return A; } } impl A as Eval { // TODO: Consider rejecting this, as compile-time evaluation would always // fail. - fn F[self: Self]() -> type { return A; } + fn F[unused self: Self]() -> type { return A; } } impl A as MustEval { // TODO: Consider rejecting this, as compile-time evaluation would always // fail. - fn F[self: Self]() -> type { return A; } + fn F[unused self: Self]() -> type { return A; } } fn Call() { @@ -65,33 +65,33 @@ import library "interface"; class A { adapt {}; } impl A as Runtime { - fn F[self: Self]() -> type { return A; } + fn F[unused self: Self]() -> type { return A; } } impl A as Eval { - fn F[self: Self]() -> type { return A; } + fn F[unused self: Self]() -> type { return A; } } impl A as MustEval { - fn F[self: Self]() -> type { return A; } + fn F[unused self: Self]() -> type { return A; } } fn Call() { - // CHECK:STDERR: fail_impl_runtime_eval.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] - // CHECK:STDERR: let t: ({} as A).(Runtime.F)() = {} as A; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_impl_runtime_eval.carbon:[[@LINE+4]]:17: error: cannot evaluate type expression [TypeExprEvaluationFailure] + // CHECK:STDERR: let unused t: ({} as A).(Runtime.F)() = {} as A; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let t: ({} as A).(Runtime.F)() = {} as A; - // CHECK:STDERR: fail_impl_runtime_eval.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] - // CHECK:STDERR: let u: ({} as A).(Eval.F)() = {} as A; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ + let unused t: ({} as A).(Runtime.F)() = {} as A; + // CHECK:STDERR: fail_impl_runtime_eval.carbon:[[@LINE+4]]:17: error: cannot evaluate type expression [TypeExprEvaluationFailure] + // CHECK:STDERR: let unused u: ({} as A).(Eval.F)() = {} as A; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let u: ({} as A).(Eval.F)() = {} as A; - // CHECK:STDERR: fail_impl_runtime_eval.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] - // CHECK:STDERR: let v: ({} as A).(MustEval.F)() = {} as A; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ + let unused u: ({} as A).(Eval.F)() = {} as A; + // CHECK:STDERR: fail_impl_runtime_eval.carbon:[[@LINE+4]]:17: error: cannot evaluate type expression [TypeExprEvaluationFailure] + // CHECK:STDERR: let unused v: ({} as A).(MustEval.F)() = {} as A; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let v: ({} as A).(MustEval.F)() = {} as A; + let unused v: ({} as A).(MustEval.F)() = {} as A; } // --- impl_eval.carbon @@ -103,23 +103,23 @@ import library "interface"; class A { adapt {}; } impl A as Runtime { - eval fn F[self: Self]() -> type { return A; } + eval fn F[unused self: Self]() -> type { return A; } } impl A as Eval { - eval fn F[self: Self]() -> type { return A; } + eval fn F[unused self: Self]() -> type { return A; } } impl A as MustEval { - eval fn F[self: Self]() -> type { return A; } + eval fn F[unused self: Self]() -> type { return A; } } fn Call() { // TODO: Should we allow calling this at compile time? This is not allowed if // we generate a thunk; see the next split for an example. - let t: ({} as A).(Runtime.F)() = {} as A; - let u: ({} as A).(Eval.F)() = {} as A; - let v: ({} as A).(MustEval.F)() = {} as A; + let unused t: ({} as A).(Runtime.F)() = {} as A; + let unused u: ({} as A).(Eval.F)() = {} as A; + let unused v: ({} as A).(MustEval.F)() = {} as A; } // --- fail_todo_impl_eval_from_runtime_thunk.carbon @@ -132,21 +132,21 @@ class B {} class BView {} impl B as Core.ImplicitAs(BView) { - fn Convert[self: Self]() -> BView { return {}; } + fn Convert[unused self: Self]() -> BView { return {}; } } impl B as Runtime { - eval fn F[self: BView]() -> type { return B; } + eval fn F[unused self: BView]() -> type { return B; } } fn Call() { // TODO: Should we allow calling this at compile time? This is allowed if we // don't generate a thunk. - // CHECK:STDERR: fail_todo_impl_eval_from_runtime_thunk.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] - // CHECK:STDERR: let t: ({} as B).(Runtime.F)() = {} as B; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_impl_eval_from_runtime_thunk.carbon:[[@LINE+4]]:17: error: cannot evaluate type expression [TypeExprEvaluationFailure] + // CHECK:STDERR: let unused t: ({} as B).(Runtime.F)() = {} as B; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let t: ({} as B).(Runtime.F)() = {} as B; + let unused t: ({} as B).(Runtime.F)() = {} as B; } // --- fail_impl_musteval.carbon @@ -159,32 +159,32 @@ class B { adapt {}; } impl B as Runtime { // CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE+11]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] - // CHECK:STDERR: musteval fn F[self: Self]() -> type { return B; } - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: musteval fn F[unused self: Self]() -> type { return B; } + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE+8]]:3: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] - // CHECK:STDERR: musteval fn F[self: Self]() -> type { return B; } - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: musteval fn F[unused self: Self]() -> type { return B; } + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE-11]]:1: in import [InImport] // CHECK:STDERR: interface.carbon:5:3: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: fn F[self: Self]() -> type; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - musteval fn F[self: Self]() -> type { return B; } + musteval fn F[unused self: Self]() -> type { return B; } } impl B as Eval { // CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE+11]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] - // CHECK:STDERR: musteval fn F[self: Self]() -> type { return B; } - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: musteval fn F[unused self: Self]() -> type { return B; } + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE+8]]:3: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] - // CHECK:STDERR: musteval fn F[self: Self]() -> type { return B; } - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: musteval fn F[unused self: Self]() -> type { return B; } + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE-26]]:1: in import [InImport] // CHECK:STDERR: interface.carbon:9:3: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: eval fn F[self: Self]() -> type; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - musteval fn F[self: Self]() -> type { return B; } + musteval fn F[unused self: Self]() -> type { return B; } } // --- impl_musteval_from_musteval.carbon @@ -196,11 +196,11 @@ import library "interface"; class B { adapt {}; } impl B as MustEval { - musteval fn F[self: Self]() -> type { return B; } + musteval fn F[unused self: Self]() -> type { return B; } } fn Call() { - let t: ({} as B).(MustEval.F)() = {} as B; + let unused t: ({} as B).(MustEval.F)() = {} as B; } // --- fail_todo_impl_musteval_from_musteval_thunk.carbon @@ -213,20 +213,20 @@ class B {} class BView {} impl B as Core.ImplicitAs(BView) { - fn Convert[self: Self]() -> BView { return {}; } + fn Convert[unused self: Self]() -> BView { return {}; } } impl B as MustEval { // CHECK:STDERR: fail_todo_impl_musteval_from_musteval_thunk.carbon:[[@LINE+11]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] - // CHECK:STDERR: musteval fn F[self: BView]() -> type { return B; } - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: musteval fn F[unused self: BView]() -> type { return B; } + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_impl_musteval_from_musteval_thunk.carbon:[[@LINE+8]]:3: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] - // CHECK:STDERR: musteval fn F[self: BView]() -> type { return B; } - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: musteval fn F[unused self: BView]() -> type { return B; } + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_impl_musteval_from_musteval_thunk.carbon:[[@LINE-16]]:1: in import [InImport] // CHECK:STDERR: interface.carbon:13:3: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: musteval fn F[self: Self]() -> type; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - musteval fn F[self: BView]() -> type { return B; } + musteval fn F[unused self: BView]() -> type { return B; } } diff --git a/toolchain/check/testdata/impl/extend_final.carbon b/toolchain/check/testdata/impl/extend_final.carbon index d56a50362420..f99a4c6de6fc 100644 --- a/toolchain/check/testdata/impl/extend_final.carbon +++ b/toolchain/check/testdata/impl/extend_final.carbon @@ -22,7 +22,7 @@ class C { } fn F() { - let b: C.X = (); + let unused b: C.X = (); } // --- fail_final_extend_impl.carbon diff --git a/toolchain/check/testdata/impl/extend_impl_generic.carbon b/toolchain/check/testdata/impl/extend_impl_generic.carbon index a5eb0ebe68d8..eb5e30e2729c 100644 --- a/toolchain/check/testdata/impl/extend_impl_generic.carbon +++ b/toolchain/check/testdata/impl/extend_impl_generic.carbon @@ -33,8 +33,8 @@ class C { } fn G(c: C) { - let a: i32 = C.F().x; - var b: i32 = c.F().x; + let unused a: i32 = C.F().x; + var unused b: i32 = c.F().x; } // --- extend_impl_generic_class.carbon @@ -47,7 +47,7 @@ interface I(T:! type) { class X(U:! type) { extend impl as I(U) { - fn F[self: Self](t: U) { } + fn F[unused self: Self](unused t: U) { } } } @@ -134,7 +134,7 @@ class X(U:! type) { // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %DestroyOp.type.3e79c2.1: type = fn_type @DestroyOp.loc22_20 [concrete] +// CHECK:STDOUT: %DestroyOp.type.3e79c2.1: type = fn_type @DestroyOp.loc22_27 [concrete] // CHECK:STDOUT: %DestroyOp.b0ebf8.1: %DestroyOp.type.3e79c2.1 = struct_value () [concrete] // CHECK:STDOUT: %DestroyOp.type.3e79c2.2: type = fn_type @DestroyOp.loc22_3 [concrete] // CHECK:STDOUT: %DestroyOp.b0ebf8.2: %DestroyOp.type.3e79c2.2 = struct_value () [concrete] @@ -301,56 +301,56 @@ class X(U:! type) { // CHECK:STDOUT: %a.patt: %pattern_type.7ce = value_binding_pattern a [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc21_17: %HasF.assoc_type.078 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param, constants.%C.type.facet) [concrete = constants.%assoc0.22c] -// CHECK:STDOUT: %F.ref.loc21: %HasF.assoc_type.078 = name_ref F, %.loc21_17 [concrete = constants.%assoc0.22c] +// CHECK:STDOUT: %.loc21_24: %HasF.assoc_type.078 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param, constants.%C.type.facet) [concrete = constants.%assoc0.22c] +// CHECK:STDOUT: %F.ref.loc21: %HasF.assoc_type.078 = name_ref F, %.loc21_24 [concrete = constants.%assoc0.22c] // CHECK:STDOUT: %impl.elem0.loc21: %.095 = impl_witness_access constants.%HasF.impl_witness, element0 [concrete = constants.%C.as.HasF.impl.F] -// CHECK:STDOUT: %.loc21_20.1: ref %Param = temporary_storage -// CHECK:STDOUT: %C.as.HasF.impl.F.call.loc21: init %Param to %.loc21_20.1 = call %impl.elem0.loc21() -// CHECK:STDOUT: %.loc21_20.2: ref %Param = temporary %.loc21_20.1, %C.as.HasF.impl.F.call.loc21 +// CHECK:STDOUT: %.loc21_27.1: ref %Param = temporary_storage +// CHECK:STDOUT: %C.as.HasF.impl.F.call.loc21: init %Param to %.loc21_27.1 = call %impl.elem0.loc21() +// CHECK:STDOUT: %.loc21_27.2: ref %Param = temporary %.loc21_27.1, %C.as.HasF.impl.F.call.loc21 // CHECK:STDOUT: %x.ref.loc21: %Param.elem = name_ref x, @Param.%.loc9 [concrete = @Param.%.loc9] -// CHECK:STDOUT: %.loc21_21.1: ref %i32 = class_element_access %.loc21_20.2, element0 -// CHECK:STDOUT: %.loc21_10: type = splice_block %i32.loc21 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc21_28.1: ref %i32 = class_element_access %.loc21_27.2, element0 +// CHECK:STDOUT: %.loc21_17: type = splice_block %i32.loc21 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc21_21.2: %i32 = acquire_value %.loc21_21.1 -// CHECK:STDOUT: %a: %i32 = value_binding a, %.loc21_21.2 +// CHECK:STDOUT: %.loc21_28.2: %i32 = acquire_value %.loc21_28.1 +// CHECK:STDOUT: %a: %i32 = value_binding a, %.loc21_28.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.7ce = ref_binding_pattern b [concrete] // CHECK:STDOUT: %b.var_patt: %pattern_type.7ce = var_pattern %b.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref %i32 = var %b.var_patt // CHECK:STDOUT: %c.ref: %C = name_ref c, %c -// CHECK:STDOUT: %.loc22_17: %HasF.assoc_type.078 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param, constants.%C.type.facet) [concrete = constants.%assoc0.22c] -// CHECK:STDOUT: %F.ref.loc22: %HasF.assoc_type.078 = name_ref F, %.loc22_17 [concrete = constants.%assoc0.22c] -// CHECK:STDOUT: %impl.elem0.loc22_17: %.095 = impl_witness_access constants.%HasF.impl_witness, element0 [concrete = constants.%C.as.HasF.impl.F] -// CHECK:STDOUT: %.loc22_20.1: ref %Param = temporary_storage -// CHECK:STDOUT: %C.as.HasF.impl.F.call.loc22: init %Param to %.loc22_20.1 = call %impl.elem0.loc22_17() -// CHECK:STDOUT: %.loc22_20.2: ref %Param = temporary %.loc22_20.1, %C.as.HasF.impl.F.call.loc22 +// CHECK:STDOUT: %.loc22_24: %HasF.assoc_type.078 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param, constants.%C.type.facet) [concrete = constants.%assoc0.22c] +// CHECK:STDOUT: %F.ref.loc22: %HasF.assoc_type.078 = name_ref F, %.loc22_24 [concrete = constants.%assoc0.22c] +// CHECK:STDOUT: %impl.elem0.loc22_24: %.095 = impl_witness_access constants.%HasF.impl_witness, element0 [concrete = constants.%C.as.HasF.impl.F] +// CHECK:STDOUT: %.loc22_27.1: ref %Param = temporary_storage +// CHECK:STDOUT: %C.as.HasF.impl.F.call.loc22: init %Param to %.loc22_27.1 = call %impl.elem0.loc22_24() +// CHECK:STDOUT: %.loc22_27.2: ref %Param = temporary %.loc22_27.1, %C.as.HasF.impl.F.call.loc22 // CHECK:STDOUT: %x.ref.loc22: %Param.elem = name_ref x, @Param.%.loc9 [concrete = @Param.%.loc9] -// CHECK:STDOUT: %.loc22_21.1: ref %i32 = class_element_access %.loc22_20.2, element0 -// CHECK:STDOUT: %.loc22_21.2: %i32 = acquire_value %.loc22_21.1 -// CHECK:STDOUT: %impl.elem0.loc22_21: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] -// CHECK:STDOUT: %bound_method.loc22_21.1: = bound_method %.loc22_21.2, %impl.elem0.loc22_21 -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc22_21, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc22_21.2: = bound_method %.loc22_21.2, %specific_fn -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc22_21.2(%.loc22_21.2) +// CHECK:STDOUT: %.loc22_28.1: ref %i32 = class_element_access %.loc22_27.2, element0 +// CHECK:STDOUT: %.loc22_28.2: %i32 = acquire_value %.loc22_28.1 +// CHECK:STDOUT: %impl.elem0.loc22_28: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] +// CHECK:STDOUT: %bound_method.loc22_28.1: = bound_method %.loc22_28.2, %impl.elem0.loc22_28 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc22_28, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc22_28.2: = bound_method %.loc22_28.2, %specific_fn +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc22_28.2(%.loc22_28.2) // CHECK:STDOUT: assign %b.var, %Int.as.Copy.impl.Op.call -// CHECK:STDOUT: %.loc22_10: type = splice_block %i32.loc22 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc22_17: type = splice_block %i32.loc22 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %b: ref %i32 = ref_binding b, %b.var -// CHECK:STDOUT: %DestroyOp.bound.loc22_20: = bound_method %.loc22_20.2, constants.%DestroyOp.b0ebf8.1 -// CHECK:STDOUT: %DestroyOp.call.loc22_20: init %empty_tuple.type = call %DestroyOp.bound.loc22_20(%.loc22_20.2) +// CHECK:STDOUT: %DestroyOp.bound.loc22_27: = bound_method %.loc22_27.2, constants.%DestroyOp.b0ebf8.1 +// CHECK:STDOUT: %DestroyOp.call.loc22_27: init %empty_tuple.type = call %DestroyOp.bound.loc22_27(%.loc22_27.2) // CHECK:STDOUT: %DestroyOp.bound.loc22_3: = bound_method %b.var, constants.%DestroyOp.b0ebf8.2 // CHECK:STDOUT: %DestroyOp.call.loc22_3: init %empty_tuple.type = call %DestroyOp.bound.loc22_3(%b.var) -// CHECK:STDOUT: %DestroyOp.bound.loc21: = bound_method %.loc21_20.2, constants.%DestroyOp.b0ebf8.1 -// CHECK:STDOUT: %DestroyOp.call.loc21: init %empty_tuple.type = call %DestroyOp.bound.loc21(%.loc21_20.2) +// CHECK:STDOUT: %DestroyOp.bound.loc21: = bound_method %.loc21_27.2, constants.%DestroyOp.b0ebf8.1 +// CHECK:STDOUT: %DestroyOp.call.loc21: init %empty_tuple.type = call %DestroyOp.bound.loc21(%.loc21_27.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @DestroyOp.loc22_20(%self.param: ref %Param) = "no_op"; +// CHECK:STDOUT: fn @DestroyOp.loc22_27(%self.param: ref %Param) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: fn @DestroyOp.loc22_3(%self.param: ref %i32) = "no_op"; // CHECK:STDOUT: @@ -541,15 +541,15 @@ class X(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: impl: %Self.ref as %I.type.loc9_21.2 { // CHECK:STDOUT: %X.as.I.impl.F.decl: @X.as.I.impl.%X.as.I.impl.F.type (%X.as.I.impl.F.type) = fn_decl @X.as.I.impl.F [symbolic = @X.as.I.impl.%X.as.I.impl.F (constants.%X.as.I.impl.F)] { -// CHECK:STDOUT: %self.patt: @X.as.I.impl.F.%pattern_type.loc10_10 (%pattern_type.e07) = value_binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: @X.as.I.impl.F.%pattern_type.loc10_10 (%pattern_type.e07) = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %t.patt: @X.as.I.impl.F.%pattern_type.loc10_22 (%pattern_type.51d1c4.2) = value_binding_pattern t [concrete] -// CHECK:STDOUT: %t.param_patt: @X.as.I.impl.F.%pattern_type.loc10_22 (%pattern_type.51d1c4.2) = value_param_pattern %t.patt, call_param1 [concrete] +// CHECK:STDOUT: %self.patt: @X.as.I.impl.F.%pattern_type.loc10_17 (%pattern_type.e07) = value_binding_pattern self [concrete] +// CHECK:STDOUT: %self.param_patt: @X.as.I.impl.F.%pattern_type.loc10_17 (%pattern_type.e07) = value_param_pattern %self.patt, call_param0 [concrete] +// CHECK:STDOUT: %t.patt: @X.as.I.impl.F.%pattern_type.loc10_36 (%pattern_type.51d1c4.2) = value_binding_pattern t [concrete] +// CHECK:STDOUT: %t.param_patt: @X.as.I.impl.F.%pattern_type.loc10_36 (%pattern_type.51d1c4.2) = value_param_pattern %t.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @X.as.I.impl.F.%X (%X) = value_param call_param0 -// CHECK:STDOUT: %.loc10_16.1: type = splice_block %Self.ref [symbolic = %X (constants.%X)] { -// CHECK:STDOUT: %.loc10_16.2: type = specific_constant constants.%X, @X(constants.%U) [symbolic = %X (constants.%X)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10_16.2 [symbolic = %X (constants.%X)] +// CHECK:STDOUT: %.loc10_23.1: type = splice_block %Self.ref [symbolic = %X (constants.%X)] { +// CHECK:STDOUT: %.loc10_23.2: type = specific_constant constants.%X, @X(constants.%U) [symbolic = %X (constants.%X)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10_23.2 [symbolic = %X (constants.%X)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @X.as.I.impl.F.%X (%X) = value_binding self, %self.param // CHECK:STDOUT: %t.param: @X.as.I.impl.F.%U (%U) = value_param call_param1 @@ -606,14 +606,14 @@ class X(U:! type) { // CHECK:STDOUT: generic fn @X.as.I.impl.F(@X.%U.loc8_9.2: 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: %pattern_type.loc10_10: type = pattern_type %X [symbolic = %pattern_type.loc10_10 (constants.%pattern_type.e07)] +// CHECK:STDOUT: %pattern_type.loc10_17: type = pattern_type %X [symbolic = %pattern_type.loc10_17 (constants.%pattern_type.e07)] // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%U)> [symbolic = %I.type (constants.%I.type.1ab3e4.2)] -// CHECK:STDOUT: %require_complete.loc10_25: = require_complete_type %I.type [symbolic = %require_complete.loc10_25 (constants.%require_complete.e36)] -// CHECK:STDOUT: %pattern_type.loc10_22: type = pattern_type %U [symbolic = %pattern_type.loc10_22 (constants.%pattern_type.51d1c4.2)] +// CHECK:STDOUT: %require_complete.loc10_39: = require_complete_type %I.type [symbolic = %require_complete.loc10_39 (constants.%require_complete.e36)] +// CHECK:STDOUT: %pattern_type.loc10_36: type = pattern_type %U [symbolic = %pattern_type.loc10_36 (constants.%pattern_type.51d1c4.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc10_14: = require_complete_type %X [symbolic = %require_complete.loc10_14 (constants.%require_complete.5dd)] -// CHECK:STDOUT: %require_complete.loc10_23: = require_complete_type %U [symbolic = %require_complete.loc10_23 (constants.%require_complete.944)] +// CHECK:STDOUT: %require_complete.loc10_21: = require_complete_type %X [symbolic = %require_complete.loc10_21 (constants.%require_complete.5dd)] +// CHECK:STDOUT: %require_complete.loc10_37: = require_complete_type %U [symbolic = %require_complete.loc10_37 (constants.%require_complete.944)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @X.as.I.impl.F.%X (%X), %t.param: @X.as.I.impl.F.%U (%U)) { // CHECK:STDOUT: !entry: @@ -678,10 +678,10 @@ class X(U:! type) { // CHECK:STDOUT: specific @X.as.I.impl.F(constants.%U) { // CHECK:STDOUT: %U => constants.%U // CHECK:STDOUT: %X => constants.%X -// CHECK:STDOUT: %pattern_type.loc10_10 => constants.%pattern_type.e07 +// CHECK:STDOUT: %pattern_type.loc10_17 => constants.%pattern_type.e07 // CHECK:STDOUT: %I.type => constants.%I.type.1ab3e4.2 -// CHECK:STDOUT: %require_complete.loc10_25 => constants.%require_complete.e36 -// CHECK:STDOUT: %pattern_type.loc10_22 => constants.%pattern_type.51d1c4.2 +// CHECK:STDOUT: %require_complete.loc10_39 => constants.%require_complete.e36 +// CHECK:STDOUT: %pattern_type.loc10_36 => constants.%pattern_type.51d1c4.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%U, constants.%I.facet) { diff --git a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon index 263410f1b750..c0f13746afcc 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon @@ -22,7 +22,7 @@ class C { // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: extend impl forall [T:! type] as GenericInterface(T) { - fn F(x: T) {} + fn F(unused x: T) {} } } diff --git a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon index 2322d8b7d496..b2505e32733e 100644 --- a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon +++ b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon @@ -56,14 +56,14 @@ interface Z { // CHECK:STDERR: impl as Z { fn Zero() {} - fn Method[self: Self]() {} + fn Method[unused self: Self]() {} } } class Point { impl as Z { fn Zero() {} - fn Method[self: Self]() {} + fn Method[unused self: Self]() {} } } @@ -346,10 +346,10 @@ class X { // CHECK:STDOUT: %self.param_patt: @.as.Z.impl.Method.%pattern_type (%pattern_type.84b) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @.as.Z.impl.Method.%Self.binding.as_type (%Self.binding.as_type.62d) = value_param call_param0 -// CHECK:STDOUT: %.loc13_21.1: type = splice_block %.loc13_21.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.62d)] { +// CHECK:STDOUT: %.loc13_28.1: type = splice_block %.loc13_28.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.62d)] { // CHECK:STDOUT: %Self.ref: %Z.type = name_ref Self, @Z.%Self.loc3 [symbolic = %Self (constants.%Self.c59)] // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.62d)] -// CHECK:STDOUT: %.loc13_21.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.62d)] +// CHECK:STDOUT: %.loc13_28.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.62d)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @.as.Z.impl.Method.%Self.binding.as_type (%Self.binding.as_type.62d) = value_binding self, %self.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/forward_decls.carbon b/toolchain/check/testdata/impl/forward_decls.carbon index 35ffd2ce69fe..7612f5739b7b 100644 --- a/toolchain/check/testdata/impl/forward_decls.carbon +++ b/toolchain/check/testdata/impl/forward_decls.carbon @@ -153,7 +153,7 @@ interface I {} impl D as I {} class C(T:! I) {} -fn F(x: C(D)) {} +fn F(unused x: C(D)) {} // --- fail_todo_two_interfaces.carbon library "[[@TEST_NAME]]"; @@ -196,7 +196,7 @@ library "[[@TEST_NAME]]"; interface X; // Allowed to use incomplete interfaces in function declarations. -fn F(U:! X); +fn F(_:! X); fn G[U:! X](u: U); class C; @@ -224,8 +224,8 @@ fn H(c: C) { // The above declarations require that `interface Y`, `fn F` (since it is // generic), and `impl C as X` are defined in the same file. interface Y {} -fn F(U:! X) {} -fn G[U:! X](u: U) {} +fn F(_:! X) {} +fn G[U:! X](unused u: U) {} impl C as Y; impl C as X {} impl C as Y {} @@ -1394,11 +1394,11 @@ interface I { // CHECK:STDOUT: %x.param_patt: %pattern_type.b40 = value_param_pattern %x.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %x.param.loc14: %C.229 = value_param call_param0 -// CHECK:STDOUT: %.loc14_12.1: type = splice_block %C.loc14 [concrete = constants.%C.229] { +// CHECK:STDOUT: %.loc14_19.1: type = splice_block %C.loc14 [concrete = constants.%C.229] { // CHECK:STDOUT: %C.ref.loc14: %C.type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C.generic] // CHECK:STDOUT: %D.ref.loc14: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %I.facet.loc14: %I.type = facet_value %D.ref.loc14, (constants.%I.impl_witness) [concrete = constants.%I.facet] -// CHECK:STDOUT: %.loc14_12.2: %I.type = converted %D.ref.loc14, %I.facet.loc14 [concrete = constants.%I.facet] +// CHECK:STDOUT: %.loc14_19.2: %I.type = converted %D.ref.loc14, %I.facet.loc14 [concrete = constants.%I.facet] // CHECK:STDOUT: %C.loc14: type = class_type @C, @C(constants.%I.facet) [concrete = constants.%C.229] // CHECK:STDOUT: } // CHECK:STDOUT: %x.loc14: %C.229 = value_binding x, %x.param.loc14 @@ -1682,11 +1682,12 @@ interface I { // CHECK:STDOUT: %X.type: type = facet_type <@X> [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %U: %X.type = symbolic_binding U, 0 [symbolic] +// CHECK:STDOUT: %_: %X.type = symbolic_binding _, 0 [symbolic] // CHECK:STDOUT: %pattern_type.b4b: type = pattern_type %X.type [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] +// CHECK:STDOUT: %U: %X.type = symbolic_binding U, 0 [symbolic] // CHECK:STDOUT: %U.binding.as_type: type = symbolic_binding_type U, 0, %U [symbolic] // CHECK:STDOUT: %pattern_type.b36: type = pattern_type %U.binding.as_type [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] @@ -1729,13 +1730,13 @@ interface I { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %X.decl.loc3: type = interface_decl @X [concrete = constants.%X.type] {} {} // CHECK:STDOUT: %F.decl.loc6: %F.type = fn_decl @F [concrete = constants.%F] { -// CHECK:STDOUT: %U.patt: %pattern_type.b4b = symbolic_binding_pattern U, 0 [concrete] +// CHECK:STDOUT: %_.patt: %pattern_type.b4b = symbolic_binding_pattern _, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc6: type = splice_block %X.ref.loc6 [concrete = constants.%X.type] { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %X.ref.loc6: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %U.loc6_6.2: %X.type = symbolic_binding U, 0 [symbolic = %U.loc6_6.1 (constants.%U)] +// CHECK:STDOUT: %_.loc6_6.2: %X.type = symbolic_binding _, 0 [symbolic = %_.loc6_6.1 (constants.%_)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl.loc7: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %U.patt: %pattern_type.b4b = symbolic_binding_pattern U, 0 [concrete] @@ -1773,13 +1774,13 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: %Y.decl.loc33: type = interface_decl @Y [concrete = constants.%Y.type] {} {} // CHECK:STDOUT: %F.decl.loc34: %F.type = fn_decl @F [concrete = constants.%F] { -// CHECK:STDOUT: %U.patt: %pattern_type.b4b = symbolic_binding_pattern U, 0 [concrete] +// CHECK:STDOUT: %_.patt: %pattern_type.b4b = symbolic_binding_pattern _, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc34: type = splice_block %X.ref.loc34 [concrete = constants.%X.type] { // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %X.ref.loc34: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %U.loc34: %X.type = symbolic_binding U, 0 [symbolic = %U.loc6_6.1 (constants.%U)] +// CHECK:STDOUT: %_.loc34: %X.type = symbolic_binding _, 0 [symbolic = %_.loc6_6.1 (constants.%_)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl.loc35: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %U.patt: %pattern_type.b4b = symbolic_binding_pattern U, 0 [concrete] @@ -1792,10 +1793,10 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: %U.loc35: %X.type = symbolic_binding U, 0 [symbolic = %U.loc7_6.1 (constants.%U)] // CHECK:STDOUT: %u.param.loc35: @G.%U.binding.as_type (%U.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc35_16.1: type = splice_block %.loc35_16.2 [symbolic = %U.binding.as_type (constants.%U.binding.as_type)] { +// CHECK:STDOUT: %.loc35_23.1: type = splice_block %.loc35_23.2 [symbolic = %U.binding.as_type (constants.%U.binding.as_type)] { // CHECK:STDOUT: %U.ref.loc35: %X.type = name_ref U, %U.loc35 [symbolic = %U.loc7_6.1 (constants.%U)] // CHECK:STDOUT: %U.as_type.loc35: type = facet_access_type %U.ref.loc35 [symbolic = %U.binding.as_type (constants.%U.binding.as_type)] -// CHECK:STDOUT: %.loc35_16.2: type = converted %U.ref.loc35, %U.as_type.loc35 [symbolic = %U.binding.as_type (constants.%U.binding.as_type)] +// CHECK:STDOUT: %.loc35_23.2: type = converted %U.ref.loc35, %U.as_type.loc35 [symbolic = %U.binding.as_type (constants.%U.binding.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %u.loc35: @G.%U.binding.as_type (%U.binding.as_type) = value_binding u, %u.param.loc35 // CHECK:STDOUT: } @@ -1859,8 +1860,8 @@ interface I { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%U.loc6_6.2: %X.type) { -// CHECK:STDOUT: %U.loc6_6.1: %X.type = symbolic_binding U, 0 [symbolic = %U.loc6_6.1 (constants.%U)] +// CHECK:STDOUT: generic fn @F(%_.loc6_6.2: %X.type) { +// CHECK:STDOUT: %_.loc6_6.1: %X.type = symbolic_binding _, 0 [symbolic = %_.loc6_6.1 (constants.%_)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -1903,8 +1904,8 @@ interface I { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%U) { -// CHECK:STDOUT: %U.loc6_6.1 => constants.%U +// CHECK:STDOUT: specific @F(constants.%_) { +// CHECK:STDOUT: %_.loc6_6.1 => constants.%_ // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%U) { @@ -1918,7 +1919,7 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%X.facet) { -// CHECK:STDOUT: %U.loc6_6.1 => constants.%X.facet +// CHECK:STDOUT: %_.loc6_6.1 => constants.%X.facet // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/impl_as.carbon b/toolchain/check/testdata/impl/impl_as.carbon index 2985f0e5e733..3667d3fc4c75 100644 --- a/toolchain/check/testdata/impl/impl_as.carbon +++ b/toolchain/check/testdata/impl/impl_as.carbon @@ -20,7 +20,7 @@ class C { impl as Simple { fn F() { // C is a complete type here. - var c: C = {}; + var unused c: C = {}; } } } @@ -124,9 +124,9 @@ class C { // CHECK:STDOUT: %c.var_patt: %pattern_type.7c7 = var_pattern %c.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c.var: ref %C = var %c.var_patt -// CHECK:STDOUT: %.loc23_19.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc23_19.2: init %C to %c.var = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc23_7: init %C = converted %.loc23_19.1, %.loc23_19.2 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc23_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc23_26.2: init %C to %c.var = class_init () [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc23_7: init %C = converted %.loc23_26.1, %.loc23_26.2 [concrete = constants.%C.val] // CHECK:STDOUT: assign %c.var, %.loc23_7 // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %c: ref %C = ref_binding c, %c.var diff --git a/toolchain/check/testdata/impl/impl_assoc_const.carbon b/toolchain/check/testdata/impl/impl_assoc_const.carbon index 6bcb798f8ead..ea725cf95030 100644 --- a/toolchain/check/testdata/impl/impl_assoc_const.carbon +++ b/toolchain/check/testdata/impl/impl_assoc_const.carbon @@ -379,11 +379,11 @@ impl C as Z where .Z1 = C {} // Implied constraint: .Self impls Y. Should be verified against the type of the // facet value replacing T when calling F. // -// CHECK:STDERR: fail_todo_period_self_compared_with_concrete_self.carbon:[[@LINE+4]]:24: error: cannot convert type `.Self` that implements `Z` into type implementing `Y` [ConversionFailureFacetToFacet] -// CHECK:STDERR: fn F(T:! Z where .Z1 = .Self) {} -// CHECK:STDERR: ^~~~~ +// CHECK:STDERR: fail_todo_period_self_compared_with_concrete_self.carbon:[[@LINE+4]]:31: error: cannot convert type `.Self` that implements `Z` into type implementing `Y` [ConversionFailureFacetToFacet] +// CHECK:STDERR: fn F(unused T:! Z where .Z1 = .Self) {} +// CHECK:STDERR: ^~~~~ // CHECK:STDERR: -fn F(T:! Z where .Z1 = .Self) {} +fn F(unused T:! Z where .Z1 = .Self) {} fn G() { F(C); diff --git a/toolchain/check/testdata/impl/impl_thunk.carbon b/toolchain/check/testdata/impl/impl_thunk.carbon index aedf2cdbf211..789b4f3c96b6 100644 --- a/toolchain/check/testdata/impl/impl_thunk.carbon +++ b/toolchain/check/testdata/impl/impl_thunk.carbon @@ -305,7 +305,7 @@ interface I { impl () as I { //@dump-sem-ir-begin - fn F[self: (), U:! Core.Copy](x: U) -> U { return x; } + fn F[unused self: (), U:! Core.Copy](x: U) -> U { return x; } //@dump-sem-ir-end } @@ -998,13 +998,13 @@ impl () as I({}) { // CHECK:STDOUT: %U.binding.as_type.14b: type = symbolic_binding_type U, 0, %U.035 [symbolic] // CHECK:STDOUT: %pattern_type.9b9f0c.2: type = pattern_type %U.binding.as_type.14b [symbolic] // CHECK:STDOUT: %.0e8: Core.Form = init_form %U.binding.as_type.14b, call_param2 [symbolic] -// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.19e4b8.1: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_44.1 [concrete] +// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.19e4b8.1: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_51.1 [concrete] // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.8be29b.1: %empty_tuple.type.as.I.impl.F.type.19e4b8.1 = struct_value () [concrete] // CHECK:STDOUT: %T.67d: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %ptr.e8f: type = ptr_type %T.67d [symbolic] // CHECK:STDOUT: %pattern_type.4f4: type = pattern_type %ptr.e8f [symbolic] // CHECK:STDOUT: %.924: Core.Form = init_form %ptr.e8f, call_param2 [symbolic] -// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.19e4b8.2: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_44.2 [concrete] +// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.19e4b8.2: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_51.2 [concrete] // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.8be29b.2: %empty_tuple.type.as.I.impl.F.type.19e4b8.2 = struct_value () [concrete] // CHECK:STDOUT: %require_complete.67ca8d.1: = require_complete_type %U.binding.as_type.14b [symbolic] // CHECK:STDOUT: %require_complete.ef1: = require_complete_type %ptr.e8f [symbolic] @@ -1016,7 +1016,7 @@ impl () as I({}) { // CHECK:STDOUT: %.2f2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.67d) [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.2e6: = lookup_impl_witness %ptr.e8f, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.e8f, (%Copy.lookup_impl_witness.2e6) [symbolic] -// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn: = specific_function %empty_tuple.type.as.I.impl.F.8be29b.1, @empty_tuple.type.as.I.impl.F.loc10_44.1(%Copy.facet) [symbolic] +// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn: = specific_function %empty_tuple.type.as.I.impl.F.8be29b.1, @empty_tuple.type.as.I.impl.F.loc10_51.1(%Copy.facet) [symbolic] // CHECK:STDOUT: %Copy.WithSelf.Op.type.d82: type = fn_type @Copy.WithSelf.Op, @Copy(%Copy.facet) [symbolic] // CHECK:STDOUT: %.299: type = fn_type_with_self_type %Copy.WithSelf.Op.type.d82, %Copy.facet [symbolic] // CHECK:STDOUT: %impl.elem0.1c7: %.299 = impl_witness_access %Copy.lookup_impl_witness.2e6, element0 [symbolic] @@ -1033,43 +1033,43 @@ impl () as I({}) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_tuple.type.as.I.impl: %.loc8_7.2 as %I.ref { -// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.decl.loc10_44.1: %empty_tuple.type.as.I.impl.F.type.19e4b8.1 = fn_decl @empty_tuple.type.as.I.impl.F.loc10_44.1 [concrete = constants.%empty_tuple.type.as.I.impl.F.8be29b.1] { +// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.decl.loc10_51.1: %empty_tuple.type.as.I.impl.F.type.19e4b8.1 = fn_decl @empty_tuple.type.as.I.impl.F.loc10_51.1 [concrete = constants.%empty_tuple.type.as.I.impl.F.8be29b.1] { // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = value_binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: %U.patt: %pattern_type.ce2 = symbolic_binding_pattern U, 0 [concrete] -// CHECK:STDOUT: %x.patt: @empty_tuple.type.as.I.impl.F.loc10_44.1.%pattern_type (%pattern_type.9b9f0c.2) = value_binding_pattern x [concrete] -// CHECK:STDOUT: %x.param_patt: @empty_tuple.type.as.I.impl.F.loc10_44.1.%pattern_type (%pattern_type.9b9f0c.2) = value_param_pattern %x.patt, call_param1 [concrete] -// CHECK:STDOUT: %return.patt: @empty_tuple.type.as.I.impl.F.loc10_44.1.%pattern_type (%pattern_type.9b9f0c.2) = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: @empty_tuple.type.as.I.impl.F.loc10_44.1.%pattern_type (%pattern_type.9b9f0c.2) = out_param_pattern %return.patt, call_param2 [concrete] +// CHECK:STDOUT: %x.patt: @empty_tuple.type.as.I.impl.F.loc10_51.1.%pattern_type (%pattern_type.9b9f0c.2) = value_binding_pattern x [concrete] +// CHECK:STDOUT: %x.param_patt: @empty_tuple.type.as.I.impl.F.loc10_51.1.%pattern_type (%pattern_type.9b9f0c.2) = value_param_pattern %x.patt, call_param1 [concrete] +// CHECK:STDOUT: %return.patt: @empty_tuple.type.as.I.impl.F.loc10_51.1.%pattern_type (%pattern_type.9b9f0c.2) = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: @empty_tuple.type.as.I.impl.F.loc10_51.1.%pattern_type (%pattern_type.9b9f0c.2) = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.ref.loc10_42: %Copy.type = name_ref U, %U.loc10_18.2 [symbolic = %U.loc10_18.1 (constants.%U.035)] -// CHECK:STDOUT: %U.as_type.loc10_42: type = facet_access_type %U.ref.loc10_42 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)] -// CHECK:STDOUT: %.loc10_42.3: type = converted %U.ref.loc10_42, %U.as_type.loc10_42 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)] -// CHECK:STDOUT: %.loc10_42.4: Core.Form = init_form %.loc10_42.3, call_param2 [symbolic = %.loc10_42.2 (constants.%.0e8)] +// CHECK:STDOUT: %U.ref.loc10_49: %Copy.type = name_ref U, %U.loc10_25.2 [symbolic = %U.loc10_25.1 (constants.%U.035)] +// CHECK:STDOUT: %U.as_type.loc10_49: type = facet_access_type %U.ref.loc10_49 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)] +// CHECK:STDOUT: %.loc10_49.3: type = converted %U.ref.loc10_49, %U.as_type.loc10_49 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)] +// CHECK:STDOUT: %.loc10_49.4: Core.Form = init_form %.loc10_49.3, call_param2 [symbolic = %.loc10_49.2 (constants.%.0e8)] // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0 -// CHECK:STDOUT: %.loc10_15.1: type = splice_block %.loc10_15.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc10_15.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc10_15.3: type = converted %.loc10_15.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc10_22.1: type = splice_block %.loc10_22.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc10_22.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc10_22.3: type = converted %.loc10_22.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param -// CHECK:STDOUT: %.loc10_26: type = splice_block %Copy.ref [concrete = constants.%Copy.type] { +// CHECK:STDOUT: %.loc10_33: type = splice_block %Copy.ref [concrete = constants.%Copy.type] { // CHECK:STDOUT: // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Copy.ref: type = name_ref Copy, imports.%Core.Copy [concrete = constants.%Copy.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %U.loc10_18.2: %Copy.type = symbolic_binding U, 0 [symbolic = %U.loc10_18.1 (constants.%U.035)] -// CHECK:STDOUT: %x.param: @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b) = value_param call_param1 -// CHECK:STDOUT: %.loc10_36.1: type = splice_block %.loc10_36.2 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)] { -// CHECK:STDOUT: %U.ref.loc10_36: %Copy.type = name_ref U, %U.loc10_18.2 [symbolic = %U.loc10_18.1 (constants.%U.035)] -// CHECK:STDOUT: %U.as_type.loc10_36: type = facet_access_type %U.ref.loc10_36 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)] -// CHECK:STDOUT: %.loc10_36.2: type = converted %U.ref.loc10_36, %U.as_type.loc10_36 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)] +// CHECK:STDOUT: %U.loc10_25.2: %Copy.type = symbolic_binding U, 0 [symbolic = %U.loc10_25.1 (constants.%U.035)] +// CHECK:STDOUT: %x.param: @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b) = value_param call_param1 +// CHECK:STDOUT: %.loc10_43.1: type = splice_block %.loc10_43.2 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)] { +// CHECK:STDOUT: %U.ref.loc10_43: %Copy.type = name_ref U, %U.loc10_25.2 [symbolic = %U.loc10_25.1 (constants.%U.035)] +// CHECK:STDOUT: %U.as_type.loc10_43: type = facet_access_type %U.ref.loc10_43 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)] +// CHECK:STDOUT: %.loc10_43.2: type = converted %U.ref.loc10_43, %U.as_type.loc10_43 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b) = value_binding x, %x.param -// CHECK:STDOUT: %return.param: ref @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b) = out_param call_param2 -// CHECK:STDOUT: %return: ref @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b) = return_slot %return.param +// CHECK:STDOUT: %x: @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b) = value_binding x, %x.param +// CHECK:STDOUT: %return.param: ref @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b) = out_param call_param2 +// CHECK:STDOUT: %return: ref @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.decl.loc10_44.2: %empty_tuple.type.as.I.impl.F.type.19e4b8.2 = fn_decl @empty_tuple.type.as.I.impl.F.loc10_44.2 [concrete = constants.%empty_tuple.type.as.I.impl.F.8be29b.2] { +// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.decl.loc10_51.2: %empty_tuple.type.as.I.impl.F.type.19e4b8.2 = fn_decl @empty_tuple.type.as.I.impl.F.loc10_51.2 [concrete = constants.%empty_tuple.type.as.I.impl.F.8be29b.2] { // CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: @@ -1077,90 +1077,90 @@ impl () as I({}) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %empty_tuple.type.as.I.impl.F.decl.loc10_44.1 +// CHECK:STDOUT: .F = %empty_tuple.type.as.I.impl.F.decl.loc10_51.1 // CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @empty_tuple.type.as.I.impl.F.loc10_44.1(%U.loc10_18.2: %Copy.type) { -// CHECK:STDOUT: %U.loc10_18.1: %Copy.type = symbolic_binding U, 0 [symbolic = %U.loc10_18.1 (constants.%U.035)] -// CHECK:STDOUT: %U.binding.as_type: type = symbolic_binding_type U, 0, %U.loc10_18.1 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)] +// CHECK:STDOUT: generic fn @empty_tuple.type.as.I.impl.F.loc10_51.1(%U.loc10_25.2: %Copy.type) { +// CHECK:STDOUT: %U.loc10_25.1: %Copy.type = symbolic_binding U, 0 [symbolic = %U.loc10_25.1 (constants.%U.035)] +// CHECK:STDOUT: %U.binding.as_type: type = symbolic_binding_type U, 0, %U.loc10_25.1 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)] // CHECK:STDOUT: %pattern_type: type = pattern_type %U.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.9b9f0c.2)] -// CHECK:STDOUT: %.loc10_42.2: Core.Form = init_form %U.binding.as_type, call_param2 [symbolic = %.loc10_42.2 (constants.%.0e8)] +// CHECK:STDOUT: %.loc10_49.2: Core.Form = init_form %U.binding.as_type, call_param2 [symbolic = %.loc10_49.2 (constants.%.0e8)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %U.binding.as_type [symbolic = %require_complete (constants.%require_complete.67ca8d.1)] -// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %U.loc10_18.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.58dce0.2)] -// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy(%U.loc10_18.1) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.735e75.3)] -// CHECK:STDOUT: %.loc10_53: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %U.loc10_18.1 [symbolic = %.loc10_53 (constants.%.023143.2)] -// CHECK:STDOUT: %impl.elem0.loc10_53.2: @empty_tuple.type.as.I.impl.F.loc10_44.1.%.loc10_53 (%.023143.2) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_53.2 (constants.%impl.elem0.594c59.2)] -// CHECK:STDOUT: %specific_impl_fn.loc10_53.2: = specific_impl_function %impl.elem0.loc10_53.2, @Copy.WithSelf.Op(%U.loc10_18.1) [symbolic = %specific_impl_fn.loc10_53.2 (constants.%specific_impl_fn.bdce5c.2)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %U.loc10_25.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.58dce0.2)] +// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy(%U.loc10_25.1) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.735e75.3)] +// CHECK:STDOUT: %.loc10_60: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %U.loc10_25.1 [symbolic = %.loc10_60 (constants.%.023143.2)] +// CHECK:STDOUT: %impl.elem0.loc10_60.2: @empty_tuple.type.as.I.impl.F.loc10_51.1.%.loc10_60 (%.023143.2) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_60.2 (constants.%impl.elem0.594c59.2)] +// CHECK:STDOUT: %specific_impl_fn.loc10_60.2: = specific_impl_function %impl.elem0.loc10_60.2, @Copy.WithSelf.Op(%U.loc10_25.1) [symbolic = %specific_impl_fn.loc10_60.2 (constants.%specific_impl_fn.bdce5c.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: %empty_tuple.type, %x.param: @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b)) -> out %return.param: @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b) { +// CHECK:STDOUT: fn(%self.param: %empty_tuple.type, %x.param: @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b)) -> out %return.param: @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.ref: @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b) = name_ref x, %x -// CHECK:STDOUT: %impl.elem0.loc10_53.1: @empty_tuple.type.as.I.impl.F.loc10_44.1.%.loc10_53 (%.023143.2) = impl_witness_access constants.%Copy.lookup_impl_witness.58dce0.2, element0 [symbolic = %impl.elem0.loc10_53.2 (constants.%impl.elem0.594c59.2)] -// CHECK:STDOUT: %bound_method.loc10_53.1: = bound_method %x.ref, %impl.elem0.loc10_53.1 -// CHECK:STDOUT: %specific_impl_fn.loc10_53.1: = specific_impl_function %impl.elem0.loc10_53.1, @Copy.WithSelf.Op(constants.%U.035) [symbolic = %specific_impl_fn.loc10_53.2 (constants.%specific_impl_fn.bdce5c.2)] -// CHECK:STDOUT: %bound_method.loc10_53.2: = bound_method %x.ref, %specific_impl_fn.loc10_53.1 -// CHECK:STDOUT: %.loc10_42.1: ref @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b) = splice_block %return.param {} -// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b) to %.loc10_42.1 = call %bound_method.loc10_53.2(%x.ref) +// CHECK:STDOUT: %x.ref: @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b) = name_ref x, %x +// CHECK:STDOUT: %impl.elem0.loc10_60.1: @empty_tuple.type.as.I.impl.F.loc10_51.1.%.loc10_60 (%.023143.2) = impl_witness_access constants.%Copy.lookup_impl_witness.58dce0.2, element0 [symbolic = %impl.elem0.loc10_60.2 (constants.%impl.elem0.594c59.2)] +// CHECK:STDOUT: %bound_method.loc10_60.1: = bound_method %x.ref, %impl.elem0.loc10_60.1 +// CHECK:STDOUT: %specific_impl_fn.loc10_60.1: = specific_impl_function %impl.elem0.loc10_60.1, @Copy.WithSelf.Op(constants.%U.035) [symbolic = %specific_impl_fn.loc10_60.2 (constants.%specific_impl_fn.bdce5c.2)] +// CHECK:STDOUT: %bound_method.loc10_60.2: = bound_method %x.ref, %specific_impl_fn.loc10_60.1 +// CHECK:STDOUT: %.loc10_49.1: ref @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b) = splice_block %return.param {} +// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b) to %.loc10_49.1 = call %bound_method.loc10_60.2(%x.ref) // CHECK:STDOUT: return %Copy.WithSelf.Op.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @empty_tuple.type.as.I.impl.F.loc10_44.2(%T.loc5_20.2: type) { +// CHECK:STDOUT: generic fn @empty_tuple.type.as.I.impl.F.loc10_51.2(%T.loc5_20.2: type) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %.loc10_44.3: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc5_20.1) [symbolic = %.loc10_44.3 (constants.%.2f2)] +// CHECK:STDOUT: %.loc10_51.3: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc5_20.1) [symbolic = %.loc10_51.3 (constants.%.2f2)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.2e6)] -// CHECK:STDOUT: %Copy.facet.loc10_44.3: %Copy.type = facet_value %ptr, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc10_44.3 (constants.%Copy.facet)] -// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn.loc10_44.2: = specific_function constants.%empty_tuple.type.as.I.impl.F.8be29b.1, @empty_tuple.type.as.I.impl.F.loc10_44.1(%Copy.facet.loc10_44.3) [symbolic = %empty_tuple.type.as.I.impl.F.specific_fn.loc10_44.2 (constants.%empty_tuple.type.as.I.impl.F.specific_fn)] +// CHECK:STDOUT: %Copy.facet.loc10_51.3: %Copy.type = facet_value %ptr, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc10_51.3 (constants.%Copy.facet)] +// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn.loc10_51.2: = specific_function constants.%empty_tuple.type.as.I.impl.F.8be29b.1, @empty_tuple.type.as.I.impl.F.loc10_51.1(%Copy.facet.loc10_51.3) [symbolic = %empty_tuple.type.as.I.impl.F.specific_fn.loc10_51.2 (constants.%empty_tuple.type.as.I.impl.F.specific_fn)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: %empty_tuple.type, %x.param: @empty_tuple.type.as.I.impl.F.loc10_44.2.%ptr (%ptr.e8f)) -> out %return.param: @empty_tuple.type.as.I.impl.F.loc10_44.2.%ptr (%ptr.e8f) [thunk @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_44.1] { +// CHECK:STDOUT: fn(%self.param: %empty_tuple.type, %x.param: @empty_tuple.type.as.I.impl.F.loc10_51.2.%ptr (%ptr.e8f)) -> out %return.param: @empty_tuple.type.as.I.impl.F.loc10_51.2.%ptr (%ptr.e8f) [thunk @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_51.1] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.I.impl.F.type.19e4b8.1 = name_ref F, @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_44.1 [concrete = constants.%empty_tuple.type.as.I.impl.F.8be29b.1] +// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.I.impl.F.type.19e4b8.1 = name_ref F, @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_51.1 [concrete = constants.%empty_tuple.type.as.I.impl.F.8be29b.1] // CHECK:STDOUT: // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.bound: = bound_method %self.ref, %F.ref -// CHECK:STDOUT: %Copy.facet.loc10_44.1: %Copy.type = facet_value constants.%ptr.e8f, (constants.%Copy.lookup_impl_witness.2e6) [symbolic = %Copy.facet.loc10_44.3 (constants.%Copy.facet)] -// CHECK:STDOUT: %.loc10_44.1: %Copy.type = converted constants.%ptr.e8f, %Copy.facet.loc10_44.1 [symbolic = %Copy.facet.loc10_44.3 (constants.%Copy.facet)] -// CHECK:STDOUT: %Copy.facet.loc10_44.2: %Copy.type = facet_value constants.%ptr.e8f, (constants.%Copy.lookup_impl_witness.2e6) [symbolic = %Copy.facet.loc10_44.3 (constants.%Copy.facet)] -// CHECK:STDOUT: %.loc10_44.2: %Copy.type = converted constants.%ptr.e8f, %Copy.facet.loc10_44.2 [symbolic = %Copy.facet.loc10_44.3 (constants.%Copy.facet)] -// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn.loc10_44.1: = specific_function %F.ref, @empty_tuple.type.as.I.impl.F.loc10_44.1(constants.%Copy.facet) [symbolic = %empty_tuple.type.as.I.impl.F.specific_fn.loc10_44.2 (constants.%empty_tuple.type.as.I.impl.F.specific_fn)] -// CHECK:STDOUT: %bound_method: = bound_method %self.ref, %empty_tuple.type.as.I.impl.F.specific_fn.loc10_44.1 -// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.call: init @empty_tuple.type.as.I.impl.F.loc10_44.2.%ptr (%ptr.e8f) = call %bound_method(%self.ref, %x.ref) +// CHECK:STDOUT: %Copy.facet.loc10_51.1: %Copy.type = facet_value constants.%ptr.e8f, (constants.%Copy.lookup_impl_witness.2e6) [symbolic = %Copy.facet.loc10_51.3 (constants.%Copy.facet)] +// CHECK:STDOUT: %.loc10_51.1: %Copy.type = converted constants.%ptr.e8f, %Copy.facet.loc10_51.1 [symbolic = %Copy.facet.loc10_51.3 (constants.%Copy.facet)] +// CHECK:STDOUT: %Copy.facet.loc10_51.2: %Copy.type = facet_value constants.%ptr.e8f, (constants.%Copy.lookup_impl_witness.2e6) [symbolic = %Copy.facet.loc10_51.3 (constants.%Copy.facet)] +// CHECK:STDOUT: %.loc10_51.2: %Copy.type = converted constants.%ptr.e8f, %Copy.facet.loc10_51.2 [symbolic = %Copy.facet.loc10_51.3 (constants.%Copy.facet)] +// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn.loc10_51.1: = specific_function %F.ref, @empty_tuple.type.as.I.impl.F.loc10_51.1(constants.%Copy.facet) [symbolic = %empty_tuple.type.as.I.impl.F.specific_fn.loc10_51.2 (constants.%empty_tuple.type.as.I.impl.F.specific_fn)] +// CHECK:STDOUT: %bound_method: = bound_method %self.ref, %empty_tuple.type.as.I.impl.F.specific_fn.loc10_51.1 +// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.call: init @empty_tuple.type.as.I.impl.F.loc10_51.2.%ptr (%ptr.e8f) = call %bound_method(%self.ref, %x.ref) // CHECK:STDOUT: return %empty_tuple.type.as.I.impl.F.call // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @empty_tuple.type.as.I.impl.F.loc10_44.1(constants.%U.035) { -// CHECK:STDOUT: %U.loc10_18.1 => constants.%U.035 +// CHECK:STDOUT: specific @empty_tuple.type.as.I.impl.F.loc10_51.1(constants.%U.035) { +// CHECK:STDOUT: %U.loc10_25.1 => constants.%U.035 // CHECK:STDOUT: %U.binding.as_type => constants.%U.binding.as_type.14b // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9b9f0c.2 -// CHECK:STDOUT: %.loc10_42.2 => constants.%.0e8 +// CHECK:STDOUT: %.loc10_49.2 => constants.%.0e8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @empty_tuple.type.as.I.impl.F.loc10_44.2(constants.%T.67d) { +// CHECK:STDOUT: specific @empty_tuple.type.as.I.impl.F.loc10_51.2(constants.%T.67d) { // CHECK:STDOUT: %T.loc5_20.1 => constants.%T.67d // CHECK:STDOUT: %ptr => constants.%ptr.e8f // CHECK:STDOUT: %pattern_type => constants.%pattern_type.4f4 // CHECK:STDOUT: %.loc5 => constants.%.924 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @empty_tuple.type.as.I.impl.F.loc10_44.1(constants.%Copy.facet) { -// CHECK:STDOUT: %U.loc10_18.1 => constants.%Copy.facet +// CHECK:STDOUT: specific @empty_tuple.type.as.I.impl.F.loc10_51.1(constants.%Copy.facet) { +// CHECK:STDOUT: %U.loc10_25.1 => constants.%Copy.facet // CHECK:STDOUT: %U.binding.as_type => constants.%ptr.e8f // CHECK:STDOUT: %pattern_type => constants.%pattern_type.4f4 -// CHECK:STDOUT: %.loc10_42.2 => constants.%.924 +// CHECK:STDOUT: %.loc10_49.2 => constants.%.924 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete.ef1 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.2e6 // CHECK:STDOUT: %Copy.WithSelf.Op.type => constants.%Copy.WithSelf.Op.type.d82 -// CHECK:STDOUT: %.loc10_53 => constants.%.299 -// CHECK:STDOUT: %impl.elem0.loc10_53.2 => constants.%impl.elem0.1c7 -// CHECK:STDOUT: %specific_impl_fn.loc10_53.2 => constants.%specific_impl_fn.366 +// CHECK:STDOUT: %.loc10_60 => constants.%.299 +// CHECK:STDOUT: %impl.elem0.loc10_60.2 => constants.%impl.elem0.1c7 +// CHECK:STDOUT: %specific_impl_fn.loc10_60.2 => constants.%specific_impl_fn.366 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- generic_interface.carbon diff --git a/toolchain/check/testdata/impl/impl_thunk_min_prelude.carbon b/toolchain/check/testdata/impl/impl_thunk_min_prelude.carbon index d1430f7d8e29..8e6c075d229f 100644 --- a/toolchain/check/testdata/impl/impl_thunk_min_prelude.carbon +++ b/toolchain/check/testdata/impl/impl_thunk_min_prelude.carbon @@ -31,12 +31,12 @@ class A { } impl ConvertsToB as Core.ImplicitAs(B) { - fn Convert[self: Self]() -> B { return {}; } + fn Convert[unused self: Self]() -> B { return {}; } } } impl ConvertsToA as Core.ImplicitAs(A) { - fn Convert[self: Self]() -> A { return {}; } + fn Convert[unused self: Self]() -> A { return {}; } } } diff --git a/toolchain/check/testdata/impl/import_canonical_witnesses.carbon b/toolchain/check/testdata/impl/import_canonical_witnesses.carbon index 1e92e4a949d0..a99273f0d45f 100644 --- a/toolchain/check/testdata/impl/import_canonical_witnesses.carbon +++ b/toolchain/check/testdata/impl/import_canonical_witnesses.carbon @@ -40,7 +40,7 @@ interface SimpleOp { } impl forall [T:! type] T as SimpleOp { - fn Op[self: Self]() {} + fn Op[unused self: Self]() {} } // An empty interface with blanket impl for pointers. @@ -49,7 +49,7 @@ impl forall [T:! type] T as Empty {} // Class with a use of `SimpleOp.Op`. class InterfaceWrap(T:! SimpleOp & Empty) { - fn UseSimpleOp[self: Self](value:! T) { + fn UseSimpleOp[unused self: Self](value:! T) { value.(SimpleOp.Op)(); } } @@ -64,7 +64,7 @@ interface CombinedFacet { // A wrapper providing `CombinedFacet`. class TypeWrap(T:! type) { impl as CombinedFacet where .T = T { - fn GetInterfaceWrap[self: Self]() -> InterfaceWrap(T) { + fn GetInterfaceWrap[unused self: Self]() -> InterfaceWrap(T) { return {}; } } diff --git a/toolchain/check/testdata/impl/import_compound.carbon b/toolchain/check/testdata/impl/import_compound.carbon index c81ca368cf99..1c6d0c05f891 100644 --- a/toolchain/check/testdata/impl/import_compound.carbon +++ b/toolchain/check/testdata/impl/import_compound.carbon @@ -28,7 +28,7 @@ interface Instance { } impl {.i: ()} as Instance { - fn G[self: Self]() {} + fn G[unused self: Self]() {} } // --- import_non-instance_success.carbon @@ -630,7 +630,7 @@ fn InstanceCallImportFail() { // CHECK:STDOUT: %Main.import_ref.344: = import_ref Main//lib, loc15_27, loaded [concrete = constants.%Instance.impl_witness] // CHECK:STDOUT: %Main.import_ref.c9a: type = import_ref Main//lib, loc15_13, loaded [concrete = constants.%struct_type.i] // CHECK:STDOUT: %Main.import_ref.2f8: type = import_ref Main//lib, loc15_18, loaded [concrete = constants.%Instance.type] -// CHECK:STDOUT: %Main.import_ref.22d: %struct_type.i.as.Instance.impl.G.type = import_ref Main//lib, loc16_22, loaded [concrete = constants.%struct_type.i.as.Instance.impl.G] +// CHECK:STDOUT: %Main.import_ref.22d: %struct_type.i.as.Instance.impl.G.type = import_ref Main//lib, loc16_29, loaded [concrete = constants.%struct_type.i.as.Instance.impl.G] // CHECK:STDOUT: %Instance.impl_witness_table = impl_witness_table (%Main.import_ref.22d), @struct_type.i.as.Instance.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/import_impl_with_no_interface.carbon b/toolchain/check/testdata/impl/import_impl_with_no_interface.carbon index f8ceba7aca97..2cca3e8e531e 100644 --- a/toolchain/check/testdata/impl/import_impl_with_no_interface.carbon +++ b/toolchain/check/testdata/impl/import_impl_with_no_interface.carbon @@ -26,7 +26,7 @@ interface Instance { } impl {.i: ()} as Instance { - fn G[self: Self]() {} + fn G[unused self: Self]() {} } // --- import_instance_success.carbon diff --git a/toolchain/check/testdata/impl/import_self.carbon b/toolchain/check/testdata/impl/import_self.carbon index 0c4574e6c563..6a9043c132c8 100644 --- a/toolchain/check/testdata/impl/import_self.carbon +++ b/toolchain/check/testdata/impl/import_self.carbon @@ -29,7 +29,7 @@ import library "a"; class C { adapt (); } impl C as Add { - fn Op[self: Self](other: Self) -> Self { return () as C; } + fn Op[unused self: Self](unused other: Self) -> Self { return () as C; } } fn F(x: C, y: C) -> C { @@ -224,13 +224,13 @@ fn F(x: C, y: C) -> C { // CHECK:STDOUT: %return.patt: %pattern_type.7c7 = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.7c7 = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc9_37: type = name_ref Self, @C.as.Add.impl.%C.ref [concrete = constants.%C] -// CHECK:STDOUT: %.loc9_37: Core.Form = init_form %Self.ref.loc9_37, call_param2 [concrete = constants.%.92f] +// CHECK:STDOUT: %Self.ref.loc9_51: type = name_ref Self, @C.as.Add.impl.%C.ref [concrete = constants.%C] +// CHECK:STDOUT: %.loc9_51: Core.Form = init_form %Self.ref.loc9_51, call_param2 [concrete = constants.%.92f] // CHECK:STDOUT: %self.param: %C = value_param call_param0 -// CHECK:STDOUT: %Self.ref.loc9_15: type = name_ref Self, @C.as.Add.impl.%C.ref [concrete = constants.%C] +// CHECK:STDOUT: %Self.ref.loc9_22: type = name_ref Self, @C.as.Add.impl.%C.ref [concrete = constants.%C] // CHECK:STDOUT: %self: %C = value_binding self, %self.param // CHECK:STDOUT: %other.param: %C = value_param call_param1 -// CHECK:STDOUT: %Self.ref.loc9_28: type = name_ref Self, @C.as.Add.impl.%C.ref [concrete = constants.%C] +// CHECK:STDOUT: %Self.ref.loc9_42: type = name_ref Self, @C.as.Add.impl.%C.ref [concrete = constants.%C] // CHECK:STDOUT: %other: %C = value_binding other, %other.param // CHECK:STDOUT: %return.param: ref %C = out_param call_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -266,16 +266,16 @@ fn F(x: C, y: C) -> C { // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.Add.impl.Op(%self.param: %C, %other.param: %C) -> out %return.param: %C { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc9_52: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple.af4] +// CHECK:STDOUT: %.loc9_66: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple.af4] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple.af4] -// CHECK:STDOUT: %.loc9_54.1: %C = as_compatible %empty_tuple [concrete = constants.%empty_tuple.bfb] -// CHECK:STDOUT: %.loc9_54.2: %C = converted %.loc9_52, %.loc9_54.1 [concrete = constants.%empty_tuple.bfb] -// CHECK:STDOUT: %.loc9_58.1: %empty_tuple.type = as_compatible %.loc9_54.2 [concrete = constants.%empty_tuple.af4] -// CHECK:STDOUT: %.loc9_58.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple.af4] -// CHECK:STDOUT: %.loc9_58.3: init %C = as_compatible %.loc9_58.2 [concrete = constants.%empty_tuple.bfb] -// CHECK:STDOUT: %.loc9_58.4: init %C = converted %.loc9_54.2, %.loc9_58.3 [concrete = constants.%empty_tuple.bfb] -// CHECK:STDOUT: return %.loc9_58.4 +// CHECK:STDOUT: %.loc9_68.1: %C = as_compatible %empty_tuple [concrete = constants.%empty_tuple.bfb] +// CHECK:STDOUT: %.loc9_68.2: %C = converted %.loc9_66, %.loc9_68.1 [concrete = constants.%empty_tuple.bfb] +// CHECK:STDOUT: %.loc9_72.1: %empty_tuple.type = as_compatible %.loc9_68.2 [concrete = constants.%empty_tuple.af4] +// CHECK:STDOUT: %.loc9_72.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple.af4] +// CHECK:STDOUT: %.loc9_72.3: init %C = as_compatible %.loc9_72.2 [concrete = constants.%empty_tuple.bfb] +// CHECK:STDOUT: %.loc9_72.4: init %C = converted %.loc9_68.2, %.loc9_72.3 [concrete = constants.%empty_tuple.bfb] +// CHECK:STDOUT: return %.loc9_72.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%x.param: %C, %y.param: %C) -> out %return.param: %C { diff --git a/toolchain/check/testdata/impl/import_self_specific.carbon b/toolchain/check/testdata/impl/import_self_specific.carbon index 367c5023b42b..03bf2a060509 100644 --- a/toolchain/check/testdata/impl/import_self_specific.carbon +++ b/toolchain/check/testdata/impl/import_self_specific.carbon @@ -59,7 +59,7 @@ class D(N:! E) {} // impl for Z) should not be inappropriately added to this impl's generic eval // block. impl forall [N:! E] D(N) as I where .Assoc = () { - fn F(c: C(())) {} + fn F(unused c: C(())) {} } // CHECK:STDOUT: --- impl_def.carbon @@ -528,11 +528,11 @@ impl forall [N:! E] D(N) as I where .Assoc = () { // CHECK:STDOUT: %c.param_patt: %pattern_type.479 = value_param_pattern %c.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %c.param: %C.a44 = value_param call_param0 -// CHECK:STDOUT: %.loc21_15.1: type = splice_block %C [concrete = constants.%C.a44] { +// CHECK:STDOUT: %.loc21_22.1: type = splice_block %C [concrete = constants.%C.a44] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Main.C [concrete = constants.%C.generic] -// CHECK:STDOUT: %.loc21_14: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc21_21: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %Z.facet: %Z.type = facet_value constants.%empty_tuple.type, (constants.%Z.impl_witness.db1) [concrete = constants.%Z.facet.8bd] -// CHECK:STDOUT: %.loc21_15.2: %Z.type = converted %.loc21_14, %Z.facet [concrete = constants.%Z.facet.8bd] +// CHECK:STDOUT: %.loc21_22.2: %Z.type = converted %.loc21_21, %Z.facet [concrete = constants.%Z.facet.8bd] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%Z.facet.8bd) [concrete = constants.%C.a44] // CHECK:STDOUT: } // CHECK:STDOUT: %c: %C.a44 = value_binding c, %c.param diff --git a/toolchain/check/testdata/impl/import_thunk.carbon b/toolchain/check/testdata/impl/import_thunk.carbon index 4c7361f5a9fe..03a395898f88 100644 --- a/toolchain/check/testdata/impl/import_thunk.carbon +++ b/toolchain/check/testdata/impl/import_thunk.carbon @@ -28,7 +28,7 @@ import library "a"; class C(X:! ()) {} impl forall [Y:! ()] C(Y) as I { - fn F(x: C(Y)) {} + fn F(unused x: C(Y)) {} } // --- c.carbon @@ -128,15 +128,15 @@ fn G() { // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] // CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table, @C.as.I.impl(%Y) [symbolic] // CHECK:STDOUT: %pattern_type.fb2: type = pattern_type %C.c8540f.2 [symbolic] -// CHECK:STDOUT: %C.as.I.impl.F.type.cf838e.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.type.cf838e.1: type = fn_type @C.as.I.impl.F.loc8_24.1, @C.as.I.impl(%Y) [symbolic] // CHECK:STDOUT: %C.as.I.impl.F.421e41.1: %C.as.I.impl.F.type.cf838e.1 = struct_value () [symbolic] // CHECK:STDOUT: %I.facet: %I.type = facet_value %C.c8540f.2, (%I.impl_witness) [symbolic] // CHECK:STDOUT: %I.WithSelf.F.type.81b: type = fn_type @I.WithSelf.F, @I(%I.facet) [symbolic] // CHECK:STDOUT: %I.WithSelf.F.848: %I.WithSelf.F.type.81b = struct_value () [symbolic] -// CHECK:STDOUT: %C.as.I.impl.F.type.cf838e.2: type = fn_type @C.as.I.impl.F.loc8_17.2, @C.as.I.impl(%Y) [symbolic] +// CHECK:STDOUT: %C.as.I.impl.F.type.cf838e.2: type = fn_type @C.as.I.impl.F.loc8_24.2, @C.as.I.impl(%Y) [symbolic] // CHECK:STDOUT: %C.as.I.impl.F.421e41.2: %C.as.I.impl.F.type.cf838e.2 = struct_value () [symbolic] // CHECK:STDOUT: %require_complete: = require_complete_type %C.c8540f.2 [symbolic] -// CHECK:STDOUT: %C.as.I.impl.F.specific_fn: = specific_function %C.as.I.impl.F.421e41.1, @C.as.I.impl.F.loc8_17.1(%Y) [symbolic] +// CHECK:STDOUT: %C.as.I.impl.F.specific_fn: = specific_function %C.as.I.impl.F.421e41.1, @C.as.I.impl.F.loc8_24.1(%Y) [symbolic] // CHECK:STDOUT: %C.val: %C.c8540f.2 = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Self.765: %Destroy.type = symbolic_binding Self, 0 [symbolic] @@ -217,38 +217,38 @@ fn G() { // CHECK:STDOUT: %I.impl_witness.loc7_32.2: = impl_witness %I.impl_witness_table, @C.as.I.impl(%Y.loc7_14.1) [symbolic = %I.impl_witness.loc7_32.2 (constants.%I.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %C.as.I.impl.F.type.loc8_17.1: type = fn_type @C.as.I.impl.F.loc8_17.1, @C.as.I.impl(%Y.loc7_14.1) [symbolic = %C.as.I.impl.F.type.loc8_17.1 (constants.%C.as.I.impl.F.type.cf838e.1)] -// CHECK:STDOUT: %C.as.I.impl.F.loc8_17.1: @C.as.I.impl.%C.as.I.impl.F.type.loc8_17.1 (%C.as.I.impl.F.type.cf838e.1) = struct_value () [symbolic = %C.as.I.impl.F.loc8_17.1 (constants.%C.as.I.impl.F.421e41.1)] -// CHECK:STDOUT: %C.as.I.impl.F.type.loc8_17.2: type = fn_type @C.as.I.impl.F.loc8_17.2, @C.as.I.impl(%Y.loc7_14.1) [symbolic = %C.as.I.impl.F.type.loc8_17.2 (constants.%C.as.I.impl.F.type.cf838e.2)] -// CHECK:STDOUT: %C.as.I.impl.F.loc8_17.2: @C.as.I.impl.%C.as.I.impl.F.type.loc8_17.2 (%C.as.I.impl.F.type.cf838e.2) = struct_value () [symbolic = %C.as.I.impl.F.loc8_17.2 (constants.%C.as.I.impl.F.421e41.2)] +// CHECK:STDOUT: %C.as.I.impl.F.type.loc8_24.1: type = fn_type @C.as.I.impl.F.loc8_24.1, @C.as.I.impl(%Y.loc7_14.1) [symbolic = %C.as.I.impl.F.type.loc8_24.1 (constants.%C.as.I.impl.F.type.cf838e.1)] +// CHECK:STDOUT: %C.as.I.impl.F.loc8_24.1: @C.as.I.impl.%C.as.I.impl.F.type.loc8_24.1 (%C.as.I.impl.F.type.cf838e.1) = struct_value () [symbolic = %C.as.I.impl.F.loc8_24.1 (constants.%C.as.I.impl.F.421e41.1)] +// CHECK:STDOUT: %C.as.I.impl.F.type.loc8_24.2: type = fn_type @C.as.I.impl.F.loc8_24.2, @C.as.I.impl(%Y.loc7_14.1) [symbolic = %C.as.I.impl.F.type.loc8_24.2 (constants.%C.as.I.impl.F.type.cf838e.2)] +// CHECK:STDOUT: %C.as.I.impl.F.loc8_24.2: @C.as.I.impl.%C.as.I.impl.F.type.loc8_24.2 (%C.as.I.impl.F.type.cf838e.2) = struct_value () [symbolic = %C.as.I.impl.F.loc8_24.2 (constants.%C.as.I.impl.F.421e41.2)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.loc7_25.2 as %I.ref { -// CHECK:STDOUT: %C.as.I.impl.F.decl.loc8_17.1: @C.as.I.impl.%C.as.I.impl.F.type.loc8_17.1 (%C.as.I.impl.F.type.cf838e.1) = fn_decl @C.as.I.impl.F.loc8_17.1 [symbolic = @C.as.I.impl.%C.as.I.impl.F.loc8_17.1 (constants.%C.as.I.impl.F.421e41.1)] { -// CHECK:STDOUT: %x.patt: @C.as.I.impl.F.loc8_17.1.%pattern_type (%pattern_type.fb2) = value_binding_pattern x [concrete] -// CHECK:STDOUT: %x.param_patt: @C.as.I.impl.F.loc8_17.1.%pattern_type (%pattern_type.fb2) = value_param_pattern %x.patt, call_param0 [concrete] +// CHECK:STDOUT: %C.as.I.impl.F.decl.loc8_24.1: @C.as.I.impl.%C.as.I.impl.F.type.loc8_24.1 (%C.as.I.impl.F.type.cf838e.1) = fn_decl @C.as.I.impl.F.loc8_24.1 [symbolic = @C.as.I.impl.%C.as.I.impl.F.loc8_24.1 (constants.%C.as.I.impl.F.421e41.1)] { +// CHECK:STDOUT: %x.patt: @C.as.I.impl.F.loc8_24.1.%pattern_type (%pattern_type.fb2) = value_binding_pattern x [concrete] +// CHECK:STDOUT: %x.param_patt: @C.as.I.impl.F.loc8_24.1.%pattern_type (%pattern_type.fb2) = value_param_pattern %x.patt, call_param0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %x.param: @C.as.I.impl.F.loc8_17.1.%C.loc8_14.1 (%C.c8540f.2) = value_param call_param0 -// CHECK:STDOUT: %.loc8: type = splice_block %C.loc8_14.2 [symbolic = %C.loc8_14.1 (constants.%C.c8540f.2)] { +// CHECK:STDOUT: %x.param: @C.as.I.impl.F.loc8_24.1.%C.loc8_21.1 (%C.c8540f.2) = value_param call_param0 +// CHECK:STDOUT: %.loc8: type = splice_block %C.loc8_21.2 [symbolic = %C.loc8_21.1 (constants.%C.c8540f.2)] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %Y.ref: %empty_tuple.type = name_ref Y, @C.as.I.impl.%Y.loc7_14.2 [symbolic = %Y (constants.%Y)] -// CHECK:STDOUT: %C.loc8_14.2: type = class_type @C, @C(constants.%Y) [symbolic = %C.loc8_14.1 (constants.%C.c8540f.2)] +// CHECK:STDOUT: %C.loc8_21.2: type = class_type @C, @C(constants.%Y) [symbolic = %C.loc8_21.1 (constants.%C.c8540f.2)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @C.as.I.impl.F.loc8_17.1.%C.loc8_14.1 (%C.c8540f.2) = value_binding x, %x.param +// CHECK:STDOUT: %x: @C.as.I.impl.F.loc8_24.1.%C.loc8_21.1 (%C.c8540f.2) = value_binding x, %x.param // CHECK:STDOUT: } -// CHECK:STDOUT: %C.as.I.impl.F.decl.loc8_17.2: @C.as.I.impl.%C.as.I.impl.F.type.loc8_17.2 (%C.as.I.impl.F.type.cf838e.2) = fn_decl @C.as.I.impl.F.loc8_17.2 [symbolic = @C.as.I.impl.%C.as.I.impl.F.loc8_17.2 (constants.%C.as.I.impl.F.421e41.2)] { +// CHECK:STDOUT: %C.as.I.impl.F.decl.loc8_24.2: @C.as.I.impl.%C.as.I.impl.F.type.loc8_24.2 (%C.as.I.impl.F.type.cf838e.2) = fn_decl @C.as.I.impl.F.loc8_24.2 [symbolic = @C.as.I.impl.%C.as.I.impl.F.loc8_24.2 (constants.%C.as.I.impl.F.421e41.2)] { // CHECK:STDOUT: %x.patt: %pattern_type.a96 = value_binding_pattern x [concrete] // CHECK:STDOUT: %x.param_patt: %pattern_type.a96 = value_param_pattern %x.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %x.param: %empty_struct_type = value_param call_param0 // CHECK:STDOUT: %x: %empty_struct_type = value_binding x, %x.param // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%C.as.I.impl.F.decl.loc8_17.2), @C.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%C.as.I.impl.F.decl.loc8_24.2), @C.as.I.impl [concrete] // CHECK:STDOUT: %I.impl_witness.loc7_32.1: = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%Y) [symbolic = %I.impl_witness.loc7_32.2 (constants.%I.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = // CHECK:STDOUT: .Y = -// CHECK:STDOUT: .F = %C.as.I.impl.F.decl.loc8_17.1 +// CHECK:STDOUT: .F = %C.as.I.impl.F.decl.loc8_24.1 // CHECK:STDOUT: witness = %I.impl_witness.loc7_32.1 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -271,50 +271,50 @@ fn G() { // CHECK:STDOUT: fn; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @C.as.I.impl.F.loc8_17.1(@C.as.I.impl.%Y.loc7_14.2: %empty_tuple.type) { +// CHECK:STDOUT: generic fn @C.as.I.impl.F.loc8_24.1(@C.as.I.impl.%Y.loc7_14.2: %empty_tuple.type) { // CHECK:STDOUT: %Y: %empty_tuple.type = symbolic_binding Y, 0 [symbolic = %Y (constants.%Y)] -// CHECK:STDOUT: %C.loc8_14.1: type = class_type @C, @C(%Y) [symbolic = %C.loc8_14.1 (constants.%C.c8540f.2)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %C.loc8_14.1 [symbolic = %pattern_type (constants.%pattern_type.fb2)] +// CHECK:STDOUT: %C.loc8_21.1: type = class_type @C, @C(%Y) [symbolic = %C.loc8_21.1 (constants.%C.c8540f.2)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %C.loc8_21.1 [symbolic = %pattern_type (constants.%pattern_type.fb2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %C.loc8_14.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %C.loc8_21.1 [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @C.as.I.impl.F.loc8_17.1.%C.loc8_14.1 (%C.c8540f.2)) { +// CHECK:STDOUT: fn(%x.param: @C.as.I.impl.F.loc8_24.1.%C.loc8_21.1 (%C.c8540f.2)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @C.as.I.impl.F.loc8_17.2(@C.as.I.impl.%Y.loc7_14.2: %empty_tuple.type) { +// CHECK:STDOUT: generic fn @C.as.I.impl.F.loc8_24.2(@C.as.I.impl.%Y.loc7_14.2: %empty_tuple.type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Y: %empty_tuple.type = symbolic_binding Y, 0 [symbolic = %Y (constants.%Y)] -// CHECK:STDOUT: %C.as.I.impl.F.type: type = fn_type @C.as.I.impl.F.loc8_17.1, @C.as.I.impl(%Y) [symbolic = %C.as.I.impl.F.type (constants.%C.as.I.impl.F.type.cf838e.1)] -// CHECK:STDOUT: %C.as.I.impl.F: @C.as.I.impl.F.loc8_17.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.cf838e.1) = struct_value () [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.421e41.1)] -// CHECK:STDOUT: %C.as.I.impl.F.specific_fn.loc8_17.2: = specific_function %C.as.I.impl.F, @C.as.I.impl.F.loc8_17.1(%Y) [symbolic = %C.as.I.impl.F.specific_fn.loc8_17.2 (constants.%C.as.I.impl.F.specific_fn)] +// CHECK:STDOUT: %C.as.I.impl.F.type: type = fn_type @C.as.I.impl.F.loc8_24.1, @C.as.I.impl(%Y) [symbolic = %C.as.I.impl.F.type (constants.%C.as.I.impl.F.type.cf838e.1)] +// CHECK:STDOUT: %C.as.I.impl.F: @C.as.I.impl.F.loc8_24.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.cf838e.1) = struct_value () [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.421e41.1)] +// CHECK:STDOUT: %C.as.I.impl.F.specific_fn.loc8_24.2: = specific_function %C.as.I.impl.F, @C.as.I.impl.F.loc8_24.1(%Y) [symbolic = %C.as.I.impl.F.specific_fn.loc8_24.2 (constants.%C.as.I.impl.F.specific_fn)] // CHECK:STDOUT: %C: type = class_type @C, @C(%Y) [symbolic = %C (constants.%C.c8540f.2)] // CHECK:STDOUT: %require_complete: = require_complete_type %C [symbolic = %require_complete (constants.%require_complete)] -// CHECK:STDOUT: %C.val: @C.as.I.impl.F.loc8_17.2.%C (%C.c8540f.2) = struct_value () [symbolic = %C.val (constants.%C.val)] +// CHECK:STDOUT: %C.val: @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = struct_value () [symbolic = %C.val (constants.%C.val)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %C, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %C, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.155)] // CHECK:STDOUT: %.6: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.6 (constants.%.371)] -// CHECK:STDOUT: %impl.elem0.2: @C.as.I.impl.F.loc8_17.2.%.6 (%.371) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.2: @C.as.I.impl.F.loc8_24.2.%.6 (%.371) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.2 (constants.%impl.elem0)] // CHECK:STDOUT: %specific_impl_fn.2: = specific_impl_function %impl.elem0.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: %empty_struct_type) [thunk @C.as.I.impl.%C.as.I.impl.F.decl.loc8_17.1] { +// CHECK:STDOUT: fn(%x.param: %empty_struct_type) [thunk @C.as.I.impl.%C.as.I.impl.F.decl.loc8_24.1] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc8: @C.as.I.impl.F.loc8_17.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.cf838e.1) = specific_constant @C.as.I.impl.%C.as.I.impl.F.decl.loc8_17.1, @C.as.I.impl(constants.%Y) [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.421e41.1)] -// CHECK:STDOUT: %F.ref: @C.as.I.impl.F.loc8_17.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.cf838e.1) = name_ref F, %.loc8 [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.421e41.1)] +// CHECK:STDOUT: %.loc8: @C.as.I.impl.F.loc8_24.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.cf838e.1) = specific_constant @C.as.I.impl.%C.as.I.impl.F.decl.loc8_24.1, @C.as.I.impl(constants.%Y) [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.421e41.1)] +// CHECK:STDOUT: %F.ref: @C.as.I.impl.F.loc8_24.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.cf838e.1) = name_ref F, %.loc8 [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.421e41.1)] // CHECK:STDOUT: %x.ref: %empty_struct_type = name_ref x, %x.param -// CHECK:STDOUT: %C.as.I.impl.F.specific_fn.loc8_17.1: = specific_function %F.ref, @C.as.I.impl.F.loc8_17.1(constants.%Y) [symbolic = %C.as.I.impl.F.specific_fn.loc8_17.2 (constants.%C.as.I.impl.F.specific_fn)] -// CHECK:STDOUT: %.1: ref @C.as.I.impl.F.loc8_17.2.%C (%C.c8540f.2) = temporary_storage -// CHECK:STDOUT: %.2: init @C.as.I.impl.F.loc8_17.2.%C (%C.c8540f.2) to %.1 = class_init () [symbolic = %C.val (constants.%C.val)] -// CHECK:STDOUT: %.3: ref @C.as.I.impl.F.loc8_17.2.%C (%C.c8540f.2) = temporary %.1, %.2 -// CHECK:STDOUT: %.4: ref @C.as.I.impl.F.loc8_17.2.%C (%C.c8540f.2) = converted %x.ref, %.3 -// CHECK:STDOUT: %.5: @C.as.I.impl.F.loc8_17.2.%C (%C.c8540f.2) = acquire_value %.4 -// CHECK:STDOUT: %C.as.I.impl.F.call: init %empty_tuple.type = call %C.as.I.impl.F.specific_fn.loc8_17.1(%.5) +// CHECK:STDOUT: %C.as.I.impl.F.specific_fn.loc8_24.1: = specific_function %F.ref, @C.as.I.impl.F.loc8_24.1(constants.%Y) [symbolic = %C.as.I.impl.F.specific_fn.loc8_24.2 (constants.%C.as.I.impl.F.specific_fn)] +// CHECK:STDOUT: %.1: ref @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = temporary_storage +// CHECK:STDOUT: %.2: init @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) to %.1 = class_init () [symbolic = %C.val (constants.%C.val)] +// CHECK:STDOUT: %.3: ref @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = temporary %.1, %.2 +// CHECK:STDOUT: %.4: ref @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = converted %x.ref, %.3 +// CHECK:STDOUT: %.5: @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = acquire_value %.4 +// CHECK:STDOUT: %C.as.I.impl.F.call: init %empty_tuple.type = call %C.as.I.impl.F.specific_fn.loc8_24.1(%.5) // CHECK:STDOUT: %Op.ref: %Destroy.assoc_type = name_ref Op, imports.%Core.import_ref.06b [concrete = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.1: @C.as.I.impl.F.loc8_17.2.%.6 (%.371) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.1: @C.as.I.impl.F.loc8_24.2.%.6 (%.371) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.1: = bound_method %.3, %impl.elem0.1 // CHECK:STDOUT: %specific_impl_fn.1: = specific_impl_function %impl.elem0.1, @Destroy.WithSelf.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: %bound_method.2: = bound_method %.3, %specific_impl_fn.1 @@ -348,15 +348,15 @@ fn G() { // CHECK:STDOUT: %I.impl_witness.loc7_32.2 => constants.%I.impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %C.as.I.impl.F.type.loc8_17.1 => constants.%C.as.I.impl.F.type.cf838e.1 -// CHECK:STDOUT: %C.as.I.impl.F.loc8_17.1 => constants.%C.as.I.impl.F.421e41.1 -// CHECK:STDOUT: %C.as.I.impl.F.type.loc8_17.2 => constants.%C.as.I.impl.F.type.cf838e.2 -// CHECK:STDOUT: %C.as.I.impl.F.loc8_17.2 => constants.%C.as.I.impl.F.421e41.2 +// CHECK:STDOUT: %C.as.I.impl.F.type.loc8_24.1 => constants.%C.as.I.impl.F.type.cf838e.1 +// CHECK:STDOUT: %C.as.I.impl.F.loc8_24.1 => constants.%C.as.I.impl.F.421e41.1 +// CHECK:STDOUT: %C.as.I.impl.F.type.loc8_24.2 => constants.%C.as.I.impl.F.type.cf838e.2 +// CHECK:STDOUT: %C.as.I.impl.F.loc8_24.2 => constants.%C.as.I.impl.F.421e41.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C.as.I.impl.F.loc8_17.1(constants.%Y) { +// CHECK:STDOUT: specific @C.as.I.impl.F.loc8_24.1(constants.%Y) { // CHECK:STDOUT: %Y => constants.%Y -// CHECK:STDOUT: %C.loc8_14.1 => constants.%C.c8540f.2 +// CHECK:STDOUT: %C.loc8_21.1 => constants.%C.c8540f.2 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.fb2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -372,7 +372,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.F(constants.%I.facet) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @C.as.I.impl.F.loc8_17.2(constants.%Y) {} +// CHECK:STDOUT: specific @C.as.I.impl.F.loc8_24.2(constants.%Y) {} // CHECK:STDOUT: // CHECK:STDOUT: --- c.carbon // CHECK:STDOUT: @@ -450,7 +450,7 @@ fn G() { // CHECK:STDOUT: %Main.import_ref.c82 = import_ref Main//a, loc4_13, unloaded // CHECK:STDOUT: %Main.import_ref.972: @I.%I.WithSelf.F.type (%I.WithSelf.F.type.a1f) = import_ref Main//a, loc5_14, loaded [symbolic = @I.%I.WithSelf.F (constants.%I.WithSelf.F.cc3)] // CHECK:STDOUT: %Main.import_ref.e97: = import_ref Main//b, loc7_32, loaded [symbolic = @C.as.I.impl.%I.impl_witness (constants.%I.impl_witness.a8f)] -// CHECK:STDOUT: %Main.import_ref.045: @C.as.I.impl.%C.as.I.impl.F.type.2 (%C.as.I.impl.F.type.cf838e.1) = import_ref Main//b, loc8_17, loaded [symbolic = @C.as.I.impl.%C.as.I.impl.F.2 (constants.%C.as.I.impl.F.421e41.1)] +// CHECK:STDOUT: %Main.import_ref.045: @C.as.I.impl.%C.as.I.impl.F.type.2 (%C.as.I.impl.F.type.cf838e.1) = import_ref Main//b, loc8_24, loaded [symbolic = @C.as.I.impl.%C.as.I.impl.F.2 (constants.%C.as.I.impl.F.421e41.1)] // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.045), @C.as.I.impl [concrete] // CHECK:STDOUT: %Main.F.13b: @C.as.I.impl.%C.as.I.impl.F.type.1 (%C.as.I.impl.F.type.cf838e.2) = import_ref Main//b, F, loaded [symbolic = @C.as.I.impl.%C.as.I.impl.F.1 (constants.%C.as.I.impl.F.421e41.2)] // CHECK:STDOUT: %Main.import_ref.c90e1a.2: %empty_tuple.type = import_ref Main//b, loc7_14, loaded [symbolic = @C.as.I.impl.%Y (constants.%Y)] diff --git a/toolchain/check/testdata/impl/incomplete.carbon b/toolchain/check/testdata/impl/incomplete.carbon index bdc5bf44ae00..c538bdf19457 100644 --- a/toolchain/check/testdata/impl/incomplete.carbon +++ b/toolchain/check/testdata/impl/incomplete.carbon @@ -192,7 +192,7 @@ interface X { } // Requires `X` to be complete, doesn't require Z to be complete. -fn F(T:! X where .X1 = {}) {} +fn F(unused T:! X where .X1 = {}) {} // --- fail_incomplete_constraint.carbon library "[[@TEST_NAME]]"; @@ -803,23 +803,23 @@ interface B { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc16_12.1: type = splice_block %.loc16_12.2 [concrete = constants.%X_where.type] { +// CHECK:STDOUT: %.loc16_19.1: type = splice_block %.loc16_19.2 [concrete = constants.%X_where.type] { // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X.type] // CHECK:STDOUT: %.Self.2: %X.type = symbolic_binding .Self [symbolic_self = constants.%.Self.637] // CHECK:STDOUT: %.Self.ref: %X.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.637] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type] -// CHECK:STDOUT: %.loc16_18: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type] +// CHECK:STDOUT: %.loc16_25: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type] // CHECK:STDOUT: %X1.ref: %X.assoc_type = name_ref X1, @X1.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%X.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.loc16_25.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc16_25.2: type = converted %.loc16_25.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc16_12.2: type = where_expr %.Self.2 [concrete = constants.%X_where.type] { +// CHECK:STDOUT: %.loc16_32.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc16_32.2: type = converted %.loc16_32.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc16_19.2: type = where_expr %.Self.2 [concrete = constants.%X_where.type] { // CHECK:STDOUT: requirement_base_facet_type constants.%X.type -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc16_25.2 +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc16_32.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc16_6.2: %X_where.type = symbolic_binding T, 0 [symbolic = %T.loc16_6.1 (constants.%T)] +// CHECK:STDOUT: %T.loc16_13.2: %X_where.type = symbolic_binding T, 0 [symbolic = %T.loc16_13.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -886,8 +886,8 @@ interface B { // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.806)] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%T.loc16_6.2: %X_where.type) { -// CHECK:STDOUT: %T.loc16_6.1: %X_where.type = symbolic_binding T, 0 [symbolic = %T.loc16_6.1 (constants.%T)] +// CHECK:STDOUT: generic fn @F(%T.loc16_13.2: %X_where.type) { +// CHECK:STDOUT: %T.loc16_13.1: %X_where.type = symbolic_binding T, 0 [symbolic = %T.loc16_13.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -929,7 +929,7 @@ interface B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { -// CHECK:STDOUT: %T.loc16_6.1 => constants.%T +// CHECK:STDOUT: %T.loc16_13.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_incomplete_constraint.carbon diff --git a/toolchain/check/testdata/impl/interface_args.carbon b/toolchain/check/testdata/impl/interface_args.carbon index 868a783a2438..31a968b75a12 100644 --- a/toolchain/check/testdata/impl/interface_args.carbon +++ b/toolchain/check/testdata/impl/interface_args.carbon @@ -32,7 +32,7 @@ class B {} class C {} impl A as Action(B) { - fn Op[self: Self]() {} + fn Op[unused self: Self]() {} } fn F(a: A) { a.(Action(B).Op)(); } @@ -514,9 +514,9 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %Main.import_ref.450 = import_ref Main//action, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.d04: type = import_ref Main//action, loc12_6, loaded [concrete = constants.%A] // CHECK:STDOUT: %Main.import_ref.5ad: type = import_ref Main//action, loc12_19, loaded [concrete = constants.%Action.type.879] -// CHECK:STDOUT: %Main.import_ref.018 = import_ref Main//action, loc13_23, unloaded +// CHECK:STDOUT: %Main.import_ref.018 = import_ref Main//action, loc13_30, unloaded // CHECK:STDOUT: %Main.import_ref.04b = import_ref Main//action, loc5_22, unloaded -// CHECK:STDOUT: %Main.import_ref.4e3: %A.as.Action.impl.Op.type = import_ref Main//action, loc13_23, loaded [concrete = constants.%A.as.Action.impl.Op] +// CHECK:STDOUT: %Main.import_ref.4e3: %A.as.Action.impl.Op.type = import_ref Main//action, loc13_30, loaded [concrete = constants.%A.as.Action.impl.Op] // CHECK:STDOUT: %Action.impl_witness_table = impl_witness_table (%Main.import_ref.4e3), @A.as.Action.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -706,7 +706,7 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %Main.import_ref.450 = import_ref Main//action, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.d04: type = import_ref Main//action, loc12_6, loaded [concrete = constants.%A] // CHECK:STDOUT: %Main.import_ref.5ad: type = import_ref Main//action, loc12_19, loaded [concrete = constants.%Action.type.879] -// CHECK:STDOUT: %Main.import_ref.018 = import_ref Main//action, loc13_23, unloaded +// CHECK:STDOUT: %Main.import_ref.018 = import_ref Main//action, loc13_30, unloaded // CHECK:STDOUT: %Main.import_ref.8f24d3.3: = import_ref Main//action, loc10_10, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.743 = import_ref Main//action, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.04b = import_ref Main//action, loc5_22, unloaded diff --git a/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon b/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon index 92d43230da63..b8a88a4ff8f7 100644 --- a/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon +++ b/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon @@ -29,10 +29,10 @@ fn F(T:! I & J, t: T) { fn G() { class C { extend impl as I { - fn II[self: Self]() {} + fn II[unused self: Self]() {} } extend impl as J { - fn JJ[self: Self]() {} + fn JJ[unused self: Self]() {} } } // Nesting FacetValue and FacetAccessTypes, the impl lookup for `JJ` resolves diff --git a/toolchain/check/testdata/impl/lookup/find_in_final.carbon b/toolchain/check/testdata/impl/lookup/find_in_final.carbon index c62fe4131b60..91a8e30f4516 100644 --- a/toolchain/check/testdata/impl/lookup/find_in_final.carbon +++ b/toolchain/check/testdata/impl/lookup/find_in_final.carbon @@ -41,7 +41,7 @@ fn F(ZZ:! Z where .X = ()) { // Z.Y is unspecified on `ZZ` so it's found on the final impl where it's known // to be the concrete type (), which can then be used in this generic // function. - let a: ZZ.Y = (); + let unused a: ZZ.Y = (); } // --- final_impl_precedence_over_facet_access_type_with_where.carbon @@ -58,7 +58,7 @@ fn F[T:! Z where .X = ()](z: T) { // z.Y is unspecified on `ZZ` so it's found on the final impl where it's known // to be the concrete type (), which can then be used in this generic // function. - let a: z.Y = (); + let unused a: z.Y = (); } // --- final_impl_makes_compatible_facet_values.carbon @@ -125,4 +125,4 @@ final impl forall [T:! type] T as Z where .X = () {} // TODO: This should be diagnosed as there is a final impl defining `.X = ()`, // which makes the LHS of this rewrite constraint concrete. And since the RHS is // not the same (or convertible from), the rewrite is impossible. -fn F(ZZ:! Z where .X = {.r: ()}) {} +fn F(unused ZZ:! Z where .X = {.r: ()}) {} diff --git a/toolchain/check/testdata/impl/lookup/generic.carbon b/toolchain/check/testdata/impl/lookup/generic.carbon index 33d16b80aa4a..57f510a9da2f 100644 --- a/toolchain/check/testdata/impl/lookup/generic.carbon +++ b/toolchain/check/testdata/impl/lookup/generic.carbon @@ -21,7 +21,7 @@ interface HasF { } impl forall [T:! type] T as HasF { - fn F[self: Self]() {} + fn F[unused self: Self]() {} } fn G(x: {}) { @@ -55,7 +55,7 @@ interface HasF { class C(T:! type) {} impl forall [T:! type] C(T) as HasF { - fn F[self: Self]() {} + fn F[unused self: Self]() {} } fn G(x: C({})) { @@ -71,7 +71,7 @@ interface HasF(T:! type) { } impl forall [T:! type] {} as HasF(T) { - fn F[self: Self]() {} + fn F[unused self: Self]() {} } fn G(x: {}) { @@ -91,7 +91,7 @@ interface HasF { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: impl forall [T:! type, U:! type] T as HasF { - fn F[self: Self]() {} + fn F[unused self: Self]() {} } fn G(x: {}) { @@ -111,7 +111,7 @@ interface HasF(T:! type) { } impl forall [T:! type] T as HasF(T) { - fn F[self: Self]() {} + fn F[unused self: Self]() {} } class A {} diff --git a/toolchain/check/testdata/impl/lookup/impl_cycle.carbon b/toolchain/check/testdata/impl/lookup/impl_cycle.carbon index 1e8a88467fd7..3205fca42dc7 100644 --- a/toolchain/check/testdata/impl/lookup/impl_cycle.carbon +++ b/toolchain/check/testdata/impl/lookup/impl_cycle.carbon @@ -138,7 +138,7 @@ impl forall [U:! type, T:! ComparableWith(U)] class C {} class D {} -fn Compare[T:! type, U:! ComparableWith(T)](t: T, u: U) {} +fn Compare[T:! type, U:! ComparableWith(T)](unused t: T, unused u: U) {} fn F() { // CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE+17]]:3: error: cycle found in search for impl of `ComparableWith(C)` for type `C` [ImplLookupCycle] @@ -148,15 +148,15 @@ fn F() { // CHECK:STDERR: impl forall [U:! type, T:! ComparableWith(U)] // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE-9]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](t: T, u: U) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](unused t: T, unused u: U) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE+7]]:3: error: cannot convert type `C` into type implementing `ComparableWith(C)` [ConversionFailureTypeToFacet] // CHECK:STDERR: Compare({} as C, {} as C); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE-16]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](t: T, u: U) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](unused t: T, unused u: U) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Compare({} as C, {} as C); @@ -170,15 +170,15 @@ fn F() { // CHECK:STDERR: impl forall [U:! type, T:! ComparableWith(U)] // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE-31]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](t: T, u: U) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](unused t: T, unused u: U) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE+7]]:3: error: cannot convert type `D` into type implementing `ComparableWith(C)` [ConversionFailureTypeToFacet] // CHECK:STDERR: Compare({} as C, {} as D); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE-38]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](t: T, u: U) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](unused t: T, unused u: U) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Compare({} as C, {} as D); @@ -192,15 +192,15 @@ fn F() { // CHECK:STDERR: impl forall [U:! type, T:! ComparableWith(U)] // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE-53]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](t: T, u: U) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](unused t: T, unused u: U) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE+7]]:3: error: cannot convert type `C` into type implementing `ComparableWith(D)` [ConversionFailureTypeToFacet] // CHECK:STDERR: Compare({} as D, {} as C); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE-60]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](t: T, u: U) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](unused t: T, unused u: U) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Compare({} as D, {} as C); } @@ -286,7 +286,7 @@ impl forall [T:! type, U:! ComparableTo(T)] U as ComparableWith(T) {} // CHECK:STDERR: impl forall [T:! type, U:! ComparableTo(T)] T as ComparableWith(U) {} -fn Compare[T:! type, U:! ComparableWith(T)](t: T, u: U) {} +fn Compare[T:! type, U:! ComparableWith(T)](unused t: T, unused u: U) {} fn F() { Compare({} as C, {} as C); diff --git a/toolchain/check/testdata/impl/lookup/import.carbon b/toolchain/check/testdata/impl/lookup/import.carbon index 172f9730afcc..27fbdb060307 100644 --- a/toolchain/check/testdata/impl/lookup/import.carbon +++ b/toolchain/check/testdata/impl/lookup/import.carbon @@ -24,7 +24,7 @@ class C {} // Same library as the class and interface. impl C as HasF { - fn F[self: Self]() {} + fn F[unused self: Self]() {} } // --- package_b.carbon @@ -41,17 +41,17 @@ class D {} // Same library as the interface. impl PackageA.C as HasG { - fn G[self: Self]() {} + fn G[unused self: Self]() {} } // Same library as the class. impl D as PackageA.HasF { - fn F[self: Self]() {} + fn F[unused self: Self]() {} } // Same library as the class and interface. impl D as HasG { - fn G[self: Self]() {} + fn G[unused self: Self]() {} } // --- use_cf.carbon @@ -106,7 +106,7 @@ interface Z { } impl () as Z { - fn H[self: Self]() {} + fn H[unused self: Self]() {} } // --- import_associated_interface.carbon @@ -126,7 +126,7 @@ package PackageHasParam; class AnyParam[T:! type](X:! T) {} interface Y { - fn K[self: Self]() {} + fn K[unused self: Self]() {} } // --- has_generic_interface.carbon @@ -138,7 +138,7 @@ import PackageHasParam; interface GenericInterface(U:! type) {} impl PackageHasParam.AnyParam(GenericInterface) as PackageHasParam.Y { - fn K[self: Self]() {} + fn K[unused self: Self]() {} } fn L() { @@ -168,7 +168,7 @@ import PackageHasParam; class GenericClass(U:! type) {} impl PackageHasParam.AnyParam(GenericClass) as PackageHasParam.Y { - fn K[self: Self]() {} + fn K[unused self: Self]() {} } fn L() { @@ -205,7 +205,7 @@ class C(T:! type) {} interface I { fn F[self: Self](); } impl C((Extra1, Extra2, Extra3, Extra4, Extra5, Extra6, Extra7, Extra8)) as I { - fn F[self: Self]() {} + fn F[unused self: Self]() {} } // --- fail_use_has_extra_interfaces.carbon @@ -696,7 +696,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageA.import_ref.45d: = import_ref PackageA//default, loc11_16, loaded [concrete = constants.%HasF.impl_witness] // CHECK:STDOUT: %PackageA.import_ref.83d: type = import_ref PackageA//default, loc11_6, loaded [concrete = constants.%C] // CHECK:STDOUT: %PackageA.import_ref.4b0: type = import_ref PackageA//default, loc11_11, loaded [concrete = constants.%HasF.type] -// CHECK:STDOUT: %PackageA.import_ref.a28: %C.as.HasF.impl.F.type = import_ref PackageA//default, loc12_22, loaded [concrete = constants.%C.as.HasF.impl.F] +// CHECK:STDOUT: %PackageA.import_ref.a28: %C.as.HasF.impl.F.type = import_ref PackageA//default, loc12_29, loaded [concrete = constants.%C.as.HasF.impl.F] // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%PackageA.import_ref.a28), @C.as.HasF.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -842,7 +842,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageB.import_ref.3de: = import_ref PackageB//default, loc18_25, loaded [concrete = constants.%HasF.impl_witness] // CHECK:STDOUT: %PackageB.import_ref.106: type = import_ref PackageB//default, loc18_6, loaded [concrete = constants.%D] // CHECK:STDOUT: %PackageB.import_ref.7b1: type = import_ref PackageB//default, loc18_19, loaded [concrete = constants.%HasF.type] -// CHECK:STDOUT: %PackageB.import_ref.97f: %D.as.HasF.impl.F.type = import_ref PackageB//default, loc19_22, loaded [concrete = constants.%D.as.HasF.impl.F] +// CHECK:STDOUT: %PackageB.import_ref.97f: %D.as.HasF.impl.F.type = import_ref PackageB//default, loc19_29, loaded [concrete = constants.%D.as.HasF.impl.F] // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%PackageB.import_ref.97f), @D.as.HasF.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1002,7 +1002,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageB.import_ref.468 = import_ref PackageB//default, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %PackageB.import_ref.106: type = import_ref PackageB//default, loc23_6, loaded [concrete = constants.%D] // CHECK:STDOUT: %PackageB.import_ref.d31a52.2: type = import_ref PackageB//default, loc23_11, loaded [concrete = constants.%HasG.type] -// CHECK:STDOUT: %PackageB.import_ref.bb3: %C.as.HasG.impl.G.type = import_ref PackageB//default, loc14_22, loaded [concrete = constants.%C.as.HasG.impl.G] +// CHECK:STDOUT: %PackageB.import_ref.bb3: %C.as.HasG.impl.G.type = import_ref PackageB//default, loc14_29, loaded [concrete = constants.%C.as.HasG.impl.G] // CHECK:STDOUT: %HasG.impl_witness_table = impl_witness_table (%PackageB.import_ref.bb3), @C.as.HasG.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1159,7 +1159,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageB.import_ref.608: = import_ref PackageB//default, loc23_16, loaded [concrete = constants.%HasG.impl_witness] // CHECK:STDOUT: %PackageB.import_ref.106: type = import_ref PackageB//default, loc23_6, loaded [concrete = constants.%D] // CHECK:STDOUT: %PackageB.import_ref.d31a52.2: type = import_ref PackageB//default, loc23_11, loaded [concrete = constants.%HasG.type] -// CHECK:STDOUT: %PackageB.import_ref.83e: %D.as.HasG.impl.G.type = import_ref PackageB//default, loc24_22, loaded [concrete = constants.%D.as.HasG.impl.G] +// CHECK:STDOUT: %PackageB.import_ref.83e: %D.as.HasG.impl.G.type = import_ref PackageB//default, loc24_29, loaded [concrete = constants.%D.as.HasG.impl.G] // CHECK:STDOUT: %HasG.impl_witness_table = impl_witness_table (%PackageB.import_ref.83e), @D.as.HasG.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1428,7 +1428,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.5f5: = import_ref PackageAssociatedInterface//default, loc8_14, loaded [concrete = constants.%Z.impl_witness] // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.e5c: type = import_ref PackageAssociatedInterface//default, loc8_7, loaded [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.5fa: type = import_ref PackageAssociatedInterface//default, loc8_12, loaded [concrete = constants.%Z.type] -// CHECK:STDOUT: %PackageAssociatedInterface.import_ref.d43: %empty_tuple.type.as.Z.impl.H.type = import_ref PackageAssociatedInterface//default, loc9_22, loaded [concrete = constants.%empty_tuple.type.as.Z.impl.H] +// CHECK:STDOUT: %PackageAssociatedInterface.import_ref.d43: %empty_tuple.type.as.Z.impl.H.type = import_ref PackageAssociatedInterface//default, loc9_29, loaded [concrete = constants.%empty_tuple.type.as.Z.impl.H] // CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%PackageAssociatedInterface.import_ref.d43), @empty_tuple.type.as.Z.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1565,10 +1565,10 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %self.param_patt: @Y.WithSelf.K.%pattern_type (%pattern_type.880) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @Y.WithSelf.K.%Self.binding.as_type (%Self.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc7_14.1: type = splice_block %.loc7_14.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] { +// CHECK:STDOUT: %.loc7_21.1: type = splice_block %.loc7_21.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] { // CHECK:STDOUT: %Self.ref: %Y.type = name_ref Self, @Y.%Self.loc6 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] -// CHECK:STDOUT: %.loc7_14.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] +// CHECK:STDOUT: %.loc7_21.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @Y.WithSelf.K.%Self.binding.as_type (%Self.binding.as_type) = value_binding self, %self.param // CHECK:STDOUT: } @@ -1695,11 +1695,11 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageHasParam.import_ref.b3b: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)] // CHECK:STDOUT: %PackageHasParam.import_ref.b42: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)] // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type] -// CHECK:STDOUT: %PackageHasParam.import_ref.274: %Y.assoc_type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%assoc0.633] +// CHECK:STDOUT: %PackageHasParam.import_ref.274: %Y.assoc_type = import_ref PackageHasParam//default, loc7_29, loaded [concrete = constants.%assoc0.633] // CHECK:STDOUT: %PackageHasParam.K: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, K, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)] // CHECK:STDOUT: %PackageHasParam.import_ref.71dd35.2: %Y.type = import_ref PackageHasParam//default, loc6_13, loaded [symbolic = constants.%Self.079] // CHECK:STDOUT: %PackageHasParam.import_ref.9b4 = import_ref PackageHasParam//default, loc6_13, unloaded -// CHECK:STDOUT: %PackageHasParam.import_ref.0e4: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, loc7_22, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)] +// CHECK:STDOUT: %PackageHasParam.import_ref.0e4: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, loc7_29, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1952,15 +1952,15 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageGenericInterface.import_ref.116 = import_ref PackageGenericInterface//default, loc6_38, unloaded // CHECK:STDOUT: %PackageGenericInterface.import_ref.b3bc94.2: type = import_ref PackageGenericInterface//default, loc6_28, loaded [symbolic = @GenericInterface.%U (constants.%U)] // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type] -// CHECK:STDOUT: %PackageHasParam.import_ref.274: %Y.assoc_type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%assoc0.633] +// CHECK:STDOUT: %PackageHasParam.import_ref.274: %Y.assoc_type = import_ref PackageHasParam//default, loc7_29, loaded [concrete = constants.%assoc0.633] // CHECK:STDOUT: %PackageHasParam.K = import_ref PackageHasParam//default, K, unloaded // CHECK:STDOUT: %PackageHasParam.import_ref.71dd35.2: %Y.type = import_ref PackageHasParam//default, loc6_13, loaded [symbolic = constants.%Self.079] // CHECK:STDOUT: %PackageHasParam.import_ref.9b4 = import_ref PackageHasParam//default, loc6_13, unloaded -// CHECK:STDOUT: %PackageHasParam.import_ref.0e4: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, loc7_22, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)] +// CHECK:STDOUT: %PackageHasParam.import_ref.0e4: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, loc7_29, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)] // CHECK:STDOUT: %PackageGenericInterface.import_ref.564: = import_ref PackageGenericInterface//default, loc8_70, loaded [concrete = constants.%Y.impl_witness] // CHECK:STDOUT: %PackageGenericInterface.import_ref.2fb: type = import_ref PackageGenericInterface//default, loc8_47, loaded [concrete = constants.%AnyParam.861] // CHECK:STDOUT: %PackageGenericInterface.import_ref.6c1: type = import_ref PackageGenericInterface//default, loc8_67, loaded [concrete = constants.%Y.type] -// CHECK:STDOUT: %PackageGenericInterface.import_ref.ac9: %AnyParam.as.Y.impl.K.type = import_ref PackageGenericInterface//default, loc9_22, loaded [concrete = constants.%AnyParam.as.Y.impl.K] +// CHECK:STDOUT: %PackageGenericInterface.import_ref.ac9: %AnyParam.as.Y.impl.K.type = import_ref PackageGenericInterface//default, loc9_29, loaded [concrete = constants.%AnyParam.as.Y.impl.K] // CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (%PackageGenericInterface.import_ref.ac9), @AnyParam.as.Y.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } @@ -2173,11 +2173,11 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageHasParam.import_ref.b3b: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)] // CHECK:STDOUT: %PackageHasParam.import_ref.b42: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)] // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type] -// CHECK:STDOUT: %PackageHasParam.import_ref.274: %Y.assoc_type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%assoc0.633] +// CHECK:STDOUT: %PackageHasParam.import_ref.274: %Y.assoc_type = import_ref PackageHasParam//default, loc7_29, loaded [concrete = constants.%assoc0.633] // CHECK:STDOUT: %PackageHasParam.K: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, K, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)] // CHECK:STDOUT: %PackageHasParam.import_ref.71dd35.2: %Y.type = import_ref PackageHasParam//default, loc6_13, loaded [symbolic = constants.%Self.079] // CHECK:STDOUT: %PackageHasParam.import_ref.9b4 = import_ref PackageHasParam//default, loc6_13, unloaded -// CHECK:STDOUT: %PackageHasParam.import_ref.0e4: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, loc7_22, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)] +// CHECK:STDOUT: %PackageHasParam.import_ref.0e4: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, loc7_29, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2422,15 +2422,15 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageGenericClass.import_ref.7ce = import_ref PackageGenericClass//default, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %PackageGenericClass.import_ref.b3b: type = import_ref PackageGenericClass//default, loc6_20, loaded [symbolic = @GenericClass.%U (constants.%U)] // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type] -// CHECK:STDOUT: %PackageHasParam.import_ref.274: %Y.assoc_type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%assoc0.633] +// CHECK:STDOUT: %PackageHasParam.import_ref.274: %Y.assoc_type = import_ref PackageHasParam//default, loc7_29, loaded [concrete = constants.%assoc0.633] // CHECK:STDOUT: %PackageHasParam.K = import_ref PackageHasParam//default, K, unloaded // CHECK:STDOUT: %PackageHasParam.import_ref.71dd35.2: %Y.type = import_ref PackageHasParam//default, loc6_13, loaded [symbolic = constants.%Self.079] // CHECK:STDOUT: %PackageHasParam.import_ref.9b4 = import_ref PackageHasParam//default, loc6_13, unloaded -// CHECK:STDOUT: %PackageHasParam.import_ref.0e4: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, loc7_22, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)] +// CHECK:STDOUT: %PackageHasParam.import_ref.0e4: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, loc7_29, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)] // CHECK:STDOUT: %PackageGenericClass.import_ref.f5f: = import_ref PackageGenericClass//default, loc8_66, loaded [concrete = constants.%Y.impl_witness] // CHECK:STDOUT: %PackageGenericClass.import_ref.1b3: type = import_ref PackageGenericClass//default, loc8_43, loaded [concrete = constants.%AnyParam.d71] // CHECK:STDOUT: %PackageGenericClass.import_ref.6c1: type = import_ref PackageGenericClass//default, loc8_63, loaded [concrete = constants.%Y.type] -// CHECK:STDOUT: %PackageGenericClass.import_ref.6b4: %AnyParam.as.Y.impl.K.type = import_ref PackageGenericClass//default, loc9_22, loaded [concrete = constants.%AnyParam.as.Y.impl.K] +// CHECK:STDOUT: %PackageGenericClass.import_ref.6b4: %AnyParam.as.Y.impl.K.type = import_ref PackageGenericClass//default, loc9_29, loaded [concrete = constants.%AnyParam.as.Y.impl.K] // CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (%PackageGenericClass.import_ref.6b4), @AnyParam.as.Y.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/import_error.carbon b/toolchain/check/testdata/impl/lookup/import_error.carbon index cf676f4a9624..964bca105566 100644 --- a/toolchain/check/testdata/impl/lookup/import_error.carbon +++ b/toolchain/check/testdata/impl/lookup/import_error.carbon @@ -29,15 +29,15 @@ library "[[@TEST_NAME]]"; import library "error_interface_z"; -fn F[U:! type](T:! Z) { +fn F[unused U:! type](T:! Z) { // The value of `.X` is an error. It should not crash though. // - // CHECK:STDERR: fail_import_error.carbon:[[@LINE+7]]:16: error: cannot implicitly convert expression of type `()` to `T.(Z.X)` [ConversionFailure] - // CHECK:STDERR: let a: T.X = (); - // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_import_error.carbon:[[@LINE+4]]:16: note: type `()` does not implement interface `Core.ImplicitAs(T.(Z.X))` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let a: T.X = (); - // CHECK:STDERR: ^~ + // CHECK:STDERR: fail_import_error.carbon:[[@LINE+7]]:23: error: cannot implicitly convert expression of type `()` to `T.(Z.X)` [ConversionFailure] + // CHECK:STDERR: let unused a: T.X = (); + // CHECK:STDERR: ^~ + // CHECK:STDERR: fail_import_error.carbon:[[@LINE+4]]:23: note: type `()` does not implement interface `Core.ImplicitAs(T.(Z.X))` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused a: T.X = (); + // CHECK:STDERR: ^~ // CHECK:STDERR: - let a: T.X = (); + let unused a: T.X = (); } diff --git a/toolchain/check/testdata/impl/lookup/import_final.carbon b/toolchain/check/testdata/impl/lookup/import_final.carbon index b5d2a6879136..bcb7ed116edc 100644 --- a/toolchain/check/testdata/impl/lookup/import_final.carbon +++ b/toolchain/check/testdata/impl/lookup/import_final.carbon @@ -25,8 +25,8 @@ library "[[@TEST_NAME]]"; import library "interface_z"; -fn F[U:! type](T:! Z) { +fn F[unused U:! type](T:! Z) { // The value of `.X` can be known to be `C` here when the impl `T as Z(C)` is // final. - let a: T.X = {} as C; + let unused a: T.X = {} as C; } diff --git a/toolchain/check/testdata/impl/lookup/lookup_interface_with_enclosing_generic_inside_rewrite_constraint.carbon b/toolchain/check/testdata/impl/lookup/lookup_interface_with_enclosing_generic_inside_rewrite_constraint.carbon index b4e1d528e0b6..3d0f6e47559e 100644 --- a/toolchain/check/testdata/impl/lookup/lookup_interface_with_enclosing_generic_inside_rewrite_constraint.carbon +++ b/toolchain/check/testdata/impl/lookup/lookup_interface_with_enclosing_generic_inside_rewrite_constraint.carbon @@ -66,7 +66,7 @@ class Outer(OuterParam:! type) { let T:! type; } - fn G(H:! Y where .T = ()) {} + fn G(unused H:! Y where .T = ()) {} } class C; @@ -87,7 +87,7 @@ class Outer(OuterParam:! Z1) { let T:! type; } - fn G(H:! Y where .T = ()) {} + fn G(unused H:! Y where .T = ()) {} class C; impl C as Y where .T = () {} @@ -244,25 +244,25 @@ fn F() { // CHECK:STDOUT: %Outer.G.decl: @Outer.%Outer.G.type (%Outer.G.type.20d) = fn_decl @Outer.G [symbolic = @Outer.%Outer.G (constants.%Outer.G.b44)] { // CHECK:STDOUT: %H.patt: @Outer.G.%pattern_type (%pattern_type.b97) = symbolic_binding_pattern H, 1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc54_14.1: type = splice_block %.loc54_14.2 [symbolic = %Y_where.type (constants.%Y_where.type.7c7)] { +// CHECK:STDOUT: %.loc54_21.1: type = splice_block %.loc54_21.2 [symbolic = %Y_where.type (constants.%Y_where.type.7c7)] { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39] -// CHECK:STDOUT: %.loc54_12: type = specific_constant @Outer.%Y.decl, @Outer(constants.%OuterParam) [symbolic = %Y.type (constants.%Y.type.6b3)] -// CHECK:STDOUT: %Y.ref: type = name_ref Y, %.loc54_12 [symbolic = %Y.type (constants.%Y.type.6b3)] +// CHECK:STDOUT: %.loc54_19: type = specific_constant @Outer.%Y.decl, @Outer(constants.%OuterParam) [symbolic = %Y.type (constants.%Y.type.6b3)] +// CHECK:STDOUT: %Y.ref: type = name_ref Y, %.loc54_19 [symbolic = %Y.type (constants.%Y.type.6b3)] // CHECK:STDOUT: %.Self.3: @Outer.G.%Y.type (%Y.type.6b3) = symbolic_binding .Self [symbolic = %.Self.1 (constants.%.Self.cf7)] // CHECK:STDOUT: %.Self.ref: @Outer.G.%Y.type (%Y.type.6b3) = name_ref .Self, %.Self.3 [symbolic = %.Self.1 (constants.%.Self.cf7)] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type.b3c)] -// CHECK:STDOUT: %.loc54_20.1: type = converted %.Self.ref, %.Self.as_type [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type.b3c)] -// CHECK:STDOUT: %.loc54_20.2: @Outer.G.%Y.assoc_type (%Y.assoc_type.978) = specific_constant @T.%assoc0, @Y(constants.%OuterParam, constants.%.Self.cf7) [symbolic = %assoc0 (constants.%assoc0.049)] -// CHECK:STDOUT: %T.ref: @Outer.G.%Y.assoc_type (%Y.assoc_type.978) = name_ref T, %.loc54_20.2 [symbolic = %assoc0 (constants.%assoc0.049)] -// CHECK:STDOUT: %impl.elem0.loc54_20.2: type = impl_witness_access constants.%Y.lookup_impl_witness.3b9, element0 [symbolic = %impl.elem0.loc54_20.1 (constants.%impl.elem0.284)] -// CHECK:STDOUT: %.loc54_26.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc54_26.2: type = converted %.loc54_26.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc54_14.2: type = where_expr %.Self.3 [symbolic = %Y_where.type (constants.%Y_where.type.7c7)] { +// CHECK:STDOUT: %.loc54_27.1: type = converted %.Self.ref, %.Self.as_type [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type.b3c)] +// CHECK:STDOUT: %.loc54_27.2: @Outer.G.%Y.assoc_type (%Y.assoc_type.978) = specific_constant @T.%assoc0, @Y(constants.%OuterParam, constants.%.Self.cf7) [symbolic = %assoc0 (constants.%assoc0.049)] +// CHECK:STDOUT: %T.ref: @Outer.G.%Y.assoc_type (%Y.assoc_type.978) = name_ref T, %.loc54_27.2 [symbolic = %assoc0 (constants.%assoc0.049)] +// CHECK:STDOUT: %impl.elem0.loc54_27.2: type = impl_witness_access constants.%Y.lookup_impl_witness.3b9, element0 [symbolic = %impl.elem0.loc54_27.1 (constants.%impl.elem0.284)] +// CHECK:STDOUT: %.loc54_33.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc54_33.2: type = converted %.loc54_33.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc54_21.2: type = where_expr %.Self.3 [symbolic = %Y_where.type (constants.%Y_where.type.7c7)] { // CHECK:STDOUT: requirement_base_facet_type constants.%Y.type.6b3 -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc54_20.2, %.loc54_26.2 +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc54_27.2, %.loc54_33.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %H.loc54_8.2: @Outer.G.%Y_where.type (%Y_where.type.7c7) = symbolic_binding H, 1 [symbolic = %H.loc54_8.1 (constants.%H)] +// CHECK:STDOUT: %H.loc54_15.2: @Outer.G.%Y_where.type (%Y_where.type.7c7) = symbolic_binding H, 1 [symbolic = %H.loc54_15.1 (constants.%H)] // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357] // CHECK:STDOUT: complete_type_witness = %complete_type @@ -276,7 +276,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: class @C; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Outer.G(@Outer.%OuterParam.loc49_13.2: type, %H.loc54_8.2: @Outer.G.%Y_where.type (%Y_where.type.7c7)) { +// CHECK:STDOUT: generic fn @Outer.G(@Outer.%OuterParam.loc49_13.2: type, %H.loc54_15.2: @Outer.G.%Y_where.type (%Y_where.type.7c7)) { // CHECK:STDOUT: %OuterParam: type = symbolic_binding OuterParam, 0 [symbolic = %OuterParam (constants.%OuterParam)] // CHECK:STDOUT: %Y.type: type = facet_type <@Y, @Y(%OuterParam)> [symbolic = %Y.type (constants.%Y.type.6b3)] // CHECK:STDOUT: %.Self.1: @Outer.G.%Y.type (%Y.type.6b3) = symbolic_binding .Self [symbolic = %.Self.1 (constants.%.Self.cf7)] @@ -285,9 +285,9 @@ fn F() { // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y, @Y(%OuterParam) [symbolic = %Y.assoc_type (constants.%Y.assoc_type.978)] // CHECK:STDOUT: %assoc0: @Outer.G.%Y.assoc_type (%Y.assoc_type.978) = assoc_entity element0, @Y.%T [symbolic = %assoc0 (constants.%assoc0.049)] // CHECK:STDOUT: %Y.lookup_impl_witness: = lookup_impl_witness %.Self.1, @Y, @Y(%OuterParam) [symbolic = %Y.lookup_impl_witness (constants.%Y.lookup_impl_witness.3b9)] -// CHECK:STDOUT: %impl.elem0.loc54_20.1: type = impl_witness_access %Y.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc54_20.1 (constants.%impl.elem0.284)] -// CHECK:STDOUT: %Y_where.type: type = facet_type <@Y, @Y(%OuterParam) where %impl.elem0.loc54_20.1 = constants.%empty_tuple.type> [symbolic = %Y_where.type (constants.%Y_where.type.7c7)] -// CHECK:STDOUT: %H.loc54_8.1: @Outer.G.%Y_where.type (%Y_where.type.7c7) = symbolic_binding H, 1 [symbolic = %H.loc54_8.1 (constants.%H)] +// CHECK:STDOUT: %impl.elem0.loc54_27.1: type = impl_witness_access %Y.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc54_27.1 (constants.%impl.elem0.284)] +// CHECK:STDOUT: %Y_where.type: type = facet_type <@Y, @Y(%OuterParam) where %impl.elem0.loc54_27.1 = constants.%empty_tuple.type> [symbolic = %Y_where.type (constants.%Y_where.type.7c7)] +// CHECK:STDOUT: %H.loc54_15.1: @Outer.G.%Y_where.type (%Y_where.type.7c7) = symbolic_binding H, 1 [symbolic = %H.loc54_15.1 (constants.%H)] // CHECK:STDOUT: %pattern_type: type = pattern_type %Y_where.type [symbolic = %pattern_type (constants.%pattern_type.b97)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -353,9 +353,9 @@ fn F() { // CHECK:STDOUT: %Y.assoc_type => constants.%Y.assoc_type.978 // CHECK:STDOUT: %assoc0 => constants.%assoc0.049 // CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.lookup_impl_witness.3b9 -// CHECK:STDOUT: %impl.elem0.loc54_20.1 => constants.%impl.elem0.284 +// CHECK:STDOUT: %impl.elem0.loc54_27.1 => constants.%impl.elem0.284 // CHECK:STDOUT: %Y_where.type => constants.%Y_where.type.7c7 -// CHECK:STDOUT: %H.loc54_8.1 => constants.%H +// CHECK:STDOUT: %H.loc54_15.1 => constants.%H // CHECK:STDOUT: %pattern_type => constants.%pattern_type.b97 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -405,9 +405,9 @@ fn F() { // CHECK:STDOUT: %Y.assoc_type => constants.%Y.assoc_type.4bc // CHECK:STDOUT: %assoc0 => constants.%assoc0.7fe // CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.lookup_impl_witness.b08 -// CHECK:STDOUT: %impl.elem0.loc54_20.1 => constants.%impl.elem0.48b +// CHECK:STDOUT: %impl.elem0.loc54_27.1 => constants.%impl.elem0.48b // CHECK:STDOUT: %Y_where.type => constants.%Y_where.type.ad5 -// CHECK:STDOUT: %H.loc54_8.1 => constants.%facet_value +// CHECK:STDOUT: %H.loc54_15.1 => constants.%facet_value // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c51 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -635,25 +635,25 @@ fn F() { // CHECK:STDOUT: %Outer.G.decl: @Outer.%Outer.G.type (%Outer.G.type.e0a) = fn_decl @Outer.G [symbolic = @Outer.%Outer.G (constants.%Outer.G.dc4)] { // CHECK:STDOUT: %H.patt: @Outer.G.%pattern_type (%pattern_type.6bf) = symbolic_binding_pattern H, 1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc11_14.1: type = splice_block %.loc11_14.2 [symbolic = %Y_where.type (constants.%Y_where.type.b0f)] { +// CHECK:STDOUT: %.loc11_21.1: type = splice_block %.loc11_21.2 [symbolic = %Y_where.type (constants.%Y_where.type.b0f)] { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39] -// CHECK:STDOUT: %.loc11_12: type = specific_constant @Outer.%Y.decl, @Outer(constants.%OuterParam) [symbolic = %Y.type (constants.%Y.type.6ae)] -// CHECK:STDOUT: %Y.ref: type = name_ref Y, %.loc11_12 [symbolic = %Y.type (constants.%Y.type.6ae)] +// CHECK:STDOUT: %.loc11_19: type = specific_constant @Outer.%Y.decl, @Outer(constants.%OuterParam) [symbolic = %Y.type (constants.%Y.type.6ae)] +// CHECK:STDOUT: %Y.ref: type = name_ref Y, %.loc11_19 [symbolic = %Y.type (constants.%Y.type.6ae)] // CHECK:STDOUT: %.Self.3: @Outer.G.%Y.type (%Y.type.6ae) = symbolic_binding .Self [symbolic = %.Self.1 (constants.%.Self.997)] // CHECK:STDOUT: %.Self.ref: @Outer.G.%Y.type (%Y.type.6ae) = name_ref .Self, %.Self.3 [symbolic = %.Self.1 (constants.%.Self.997)] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type.238)] -// CHECK:STDOUT: %.loc11_20.1: type = converted %.Self.ref, %.Self.as_type [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type.238)] -// CHECK:STDOUT: %.loc11_20.2: @Outer.G.%Y.assoc_type (%Y.assoc_type.aab) = specific_constant @T.%assoc0, @Y(constants.%OuterParam, constants.%.Self.997) [symbolic = %assoc0 (constants.%assoc0.43a)] -// CHECK:STDOUT: %T.ref: @Outer.G.%Y.assoc_type (%Y.assoc_type.aab) = name_ref T, %.loc11_20.2 [symbolic = %assoc0 (constants.%assoc0.43a)] -// CHECK:STDOUT: %impl.elem0.loc11_20.2: type = impl_witness_access constants.%Y.lookup_impl_witness.5bf, element0 [symbolic = %impl.elem0.loc11_20.1 (constants.%impl.elem0.63e)] -// CHECK:STDOUT: %.loc11_26.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc11_26.2: type = converted %.loc11_26.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc11_14.2: type = where_expr %.Self.3 [symbolic = %Y_where.type (constants.%Y_where.type.b0f)] { +// CHECK:STDOUT: %.loc11_27.1: type = converted %.Self.ref, %.Self.as_type [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type.238)] +// CHECK:STDOUT: %.loc11_27.2: @Outer.G.%Y.assoc_type (%Y.assoc_type.aab) = specific_constant @T.%assoc0, @Y(constants.%OuterParam, constants.%.Self.997) [symbolic = %assoc0 (constants.%assoc0.43a)] +// CHECK:STDOUT: %T.ref: @Outer.G.%Y.assoc_type (%Y.assoc_type.aab) = name_ref T, %.loc11_27.2 [symbolic = %assoc0 (constants.%assoc0.43a)] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: type = impl_witness_access constants.%Y.lookup_impl_witness.5bf, element0 [symbolic = %impl.elem0.loc11_27.1 (constants.%impl.elem0.63e)] +// CHECK:STDOUT: %.loc11_33.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc11_33.2: type = converted %.loc11_33.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc11_21.2: type = where_expr %.Self.3 [symbolic = %Y_where.type (constants.%Y_where.type.b0f)] { // CHECK:STDOUT: requirement_base_facet_type constants.%Y.type.6ae -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc11_20.2, %.loc11_26.2 +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc11_27.2, %.loc11_33.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %H.loc11_8.2: @Outer.G.%Y_where.type (%Y_where.type.b0f) = symbolic_binding H, 1 [symbolic = %H.loc11_8.1 (constants.%H)] +// CHECK:STDOUT: %H.loc11_15.2: @Outer.G.%Y_where.type (%Y_where.type.b0f) = symbolic_binding H, 1 [symbolic = %H.loc11_15.1 (constants.%H)] // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [symbolic = @Outer.%C (constants.%C.521)] {} {} // CHECK:STDOUT: impl_decl @C.as.Y.impl [concrete] {} { @@ -690,7 +690,7 @@ fn F() { // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Outer.G(@Outer.%OuterParam.loc6_13.2: %Z1.type, %H.loc11_8.2: @Outer.G.%Y_where.type (%Y_where.type.b0f)) { +// CHECK:STDOUT: generic fn @Outer.G(@Outer.%OuterParam.loc6_13.2: %Z1.type, %H.loc11_15.2: @Outer.G.%Y_where.type (%Y_where.type.b0f)) { // CHECK:STDOUT: %OuterParam: %Z1.type = symbolic_binding OuterParam, 0 [symbolic = %OuterParam (constants.%OuterParam)] // CHECK:STDOUT: %Y.type: type = facet_type <@Y, @Y(%OuterParam)> [symbolic = %Y.type (constants.%Y.type.6ae)] // CHECK:STDOUT: %.Self.1: @Outer.G.%Y.type (%Y.type.6ae) = symbolic_binding .Self [symbolic = %.Self.1 (constants.%.Self.997)] @@ -699,9 +699,9 @@ fn F() { // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y, @Y(%OuterParam) [symbolic = %Y.assoc_type (constants.%Y.assoc_type.aab)] // CHECK:STDOUT: %assoc0: @Outer.G.%Y.assoc_type (%Y.assoc_type.aab) = assoc_entity element0, @Y.%T [symbolic = %assoc0 (constants.%assoc0.43a)] // CHECK:STDOUT: %Y.lookup_impl_witness: = lookup_impl_witness %.Self.1, @Y, @Y(%OuterParam) [symbolic = %Y.lookup_impl_witness (constants.%Y.lookup_impl_witness.5bf)] -// CHECK:STDOUT: %impl.elem0.loc11_20.1: type = impl_witness_access %Y.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_20.1 (constants.%impl.elem0.63e)] -// CHECK:STDOUT: %Y_where.type: type = facet_type <@Y, @Y(%OuterParam) where %impl.elem0.loc11_20.1 = constants.%empty_tuple.type> [symbolic = %Y_where.type (constants.%Y_where.type.b0f)] -// CHECK:STDOUT: %H.loc11_8.1: @Outer.G.%Y_where.type (%Y_where.type.b0f) = symbolic_binding H, 1 [symbolic = %H.loc11_8.1 (constants.%H)] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: type = impl_witness_access %Y.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_27.1 (constants.%impl.elem0.63e)] +// CHECK:STDOUT: %Y_where.type: type = facet_type <@Y, @Y(%OuterParam) where %impl.elem0.loc11_27.1 = constants.%empty_tuple.type> [symbolic = %Y_where.type (constants.%Y_where.type.b0f)] +// CHECK:STDOUT: %H.loc11_15.1: @Outer.G.%Y_where.type (%Y_where.type.b0f) = symbolic_binding H, 1 [symbolic = %H.loc11_15.1 (constants.%H)] // CHECK:STDOUT: %pattern_type: type = pattern_type %Y_where.type [symbolic = %pattern_type (constants.%pattern_type.6bf)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -803,9 +803,9 @@ fn F() { // CHECK:STDOUT: %Y.assoc_type => constants.%Y.assoc_type.aab // CHECK:STDOUT: %assoc0 => constants.%assoc0.43a // CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.lookup_impl_witness.5bf -// CHECK:STDOUT: %impl.elem0.loc11_20.1 => constants.%impl.elem0.63e +// CHECK:STDOUT: %impl.elem0.loc11_27.1 => constants.%impl.elem0.63e // CHECK:STDOUT: %Y_where.type => constants.%Y_where.type.b0f -// CHECK:STDOUT: %H.loc11_8.1 => constants.%H +// CHECK:STDOUT: %H.loc11_15.1 => constants.%H // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6bf // CHECK:STDOUT: } // CHECK:STDOUT: @@ -894,9 +894,9 @@ fn F() { // CHECK:STDOUT: %Y.assoc_type => constants.%Y.assoc_type.748 // CHECK:STDOUT: %assoc0 => constants.%assoc0.5a7 // CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.lookup_impl_witness.249 -// CHECK:STDOUT: %impl.elem0.loc11_20.1 => constants.%impl.elem0.9e9 +// CHECK:STDOUT: %impl.elem0.loc11_27.1 => constants.%impl.elem0.9e9 // CHECK:STDOUT: %Y_where.type => constants.%Y_where.type.c95 -// CHECK:STDOUT: %H.loc11_8.1 => constants.%facet_value.256 +// CHECK:STDOUT: %H.loc11_15.1 => constants.%facet_value.256 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.81f // CHECK:STDOUT: // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/impl/lookup/specialization.carbon b/toolchain/check/testdata/impl/lookup/specialization.carbon index bce3603ed770..222ff43d750a 100644 --- a/toolchain/check/testdata/impl/lookup/specialization.carbon +++ b/toolchain/check/testdata/impl/lookup/specialization.carbon @@ -26,7 +26,7 @@ fn F() { // The specialization of `Z(C)` should match in preference to the blanket impl // of `Z(T)`. If the blanket impl is chosen, then `a` will have type `()` // which will fail to typecheck here. - let a: C.(Z(C).X) = {} as C; + let unused a: C.(Z(C).X) = {} as C; } // --- specialized_self_second.carbon @@ -45,7 +45,7 @@ fn F() { // The specialization of `Z(C)` should match in preference to the blanket impl // of `Z(T)`. If the blanket impl is chosen, then `a` will have type `()` // which will fail to typecheck here. - let a: C.(Z(C).X) = {} as C; + let unused a: C.(Z(C).X) = {} as C; } // --- specialized_constraint_first.carbon @@ -64,7 +64,7 @@ fn F() { // The specialization of `Z(C)` should match in preference to the blanket impl // of `Z(T)`. If the blanket impl is chosen, then `a` will have type `()` // which will fail to typecheck here. - let a: C.(Z(C).X) = {} as C; + let unused a: C.(Z(C).X) = {} as C; } // --- specialized_constraint_second.carbon @@ -83,7 +83,7 @@ fn F() { // The specialization of `Z(C)` should match in preference to the blanket impl // of `Z(T)`. If the blanket impl is chosen, then `a` will have type `()` // which will fail to typecheck here. - let a: C.(Z(C).X) = {} as C; + let unused a: C.(Z(C).X) = {} as C; } // --- specialized_self_vs_constraint_self_first.carbon @@ -102,7 +102,7 @@ fn F() { // The specialization of `C(())` should match in preference to the blanket impl // of `C(T)`. If the blanket impl is chosen, then `a` will have type `()` // which will fail to typecheck here. - let a: C(()).(Z(C(())).X) = {} as C(()); + let unused a: C(()).(Z(C(())).X) = {} as C(()); } // --- specialized_self_vs_constraint_self_second.carbon @@ -121,7 +121,7 @@ fn F() { // The specialization of `Z(C)` should match in preference to the blanket impl // of `Z(T)`. If the blanket impl is chosen, then `a` will have type `()` // which will fail to typecheck here. - let a: C(()).(Z(C(())).X) = {} as C(()); + let unused a: C(()).(Z(C(())).X) = {} as C(()); } // --- generic_class_with_fully_specified_impl.carbon @@ -142,7 +142,7 @@ fn F() { // The specialization of `Z(C)` should match in preference to the blanket // impls of `Z(T)`. If a blanket impl is chosen, then `a` will have a struct // type which will fail to typecheck here when constructed from a `C` value. - let a: C(()).(Z(()).X) = {} as C(()); + let unused a: C(()).(Z(()).X) = {} as C(()); } // --- generic_class_with_blanket_impl_first.carbon @@ -162,7 +162,7 @@ fn F() { // The specialization of `Z(C)` should match in preference to the blanket // impls of `Z(T)`. If a blanket impl is chosen, then `a` will have type `()` // which will fail to typecheck here when constructed from a `C` value. - let a: C(()).(Z(()).X) = {} as C(()); + let unused a: C(()).(Z(()).X) = {} as C(()); } // --- generic_class_with_blanket_impl_second.carbon @@ -182,7 +182,7 @@ fn F() { // The specialization of `Z(C)` should match in preference to the blanket // impls of `Z(T)`. If a blanket impl is chosen, then `a` will have type `()` // which will fail to typecheck here when constructed from a `C` value. - let a: C(()).(Z(()).X) = {} as C(()); + let unused a: C(()).(Z(()).X) = {} as C(()); } // --- specialized_class_with_facet_value_param.carbon @@ -211,7 +211,7 @@ impl forall [T:! Z] C(D(E), T) as Z where .X = C(E, E) {} impl forall [T:! Z] C(T, T) as Z where .X = () {} fn F() { - let a: C(D(E), D(E)).(Z.X) = {} as C(E, E); + let unused a: C(D(E), D(E)).(Z.X) = {} as C(E, E); } // --- fail_specialized_class_with_symbolic_facet_value_param.carbon @@ -232,19 +232,19 @@ impl D as Y {} // caller has. impl forall [D:! Y] C(D) as Z where .X = () {} -fn F[D:! Y](d: D) { +fn F[D:! Y](unused d: D) { // The FacetValue deduced for the param of `C` will be a symbolic FacetValue // because we are in a generic where `D` is an unknown type, which will cause // the query and impl self type to be C(FacetValue) for a symbolic FacetValue. // - // CHECK:STDERR: fail_specialized_class_with_symbolic_facet_value_param.carbon:[[@LINE+7]]:23: error: cannot implicitly convert expression of type `()` to `C(D).(Z.X)` [ConversionFailure] - // CHECK:STDERR: let a: C(D).(Z.X) = (); - // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_specialized_class_with_symbolic_facet_value_param.carbon:[[@LINE+4]]:23: note: type `()` does not implement interface `Core.ImplicitAs(C(D).(Z.X))` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let a: C(D).(Z.X) = (); - // CHECK:STDERR: ^~ + // CHECK:STDERR: fail_specialized_class_with_symbolic_facet_value_param.carbon:[[@LINE+7]]:30: error: cannot implicitly convert expression of type `()` to `C(D).(Z.X)` [ConversionFailure] + // CHECK:STDERR: let unused a: C(D).(Z.X) = (); + // CHECK:STDERR: ^~ + // CHECK:STDERR: fail_specialized_class_with_symbolic_facet_value_param.carbon:[[@LINE+4]]:30: note: type `()` does not implement interface `Core.ImplicitAs(C(D).(Z.X))` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused a: C(D).(Z.X) = (); + // CHECK:STDERR: ^~ // CHECK:STDERR: - let a: C(D).(Z.X) = (); + let unused a: C(D).(Z.X) = (); } // --- pointer_specialization_first.carbon @@ -263,7 +263,7 @@ fn F() { // The specialization of `Z(C)` should match in preference to the blanket impl // of `Z(T)`. If the blanket impl is chosen, then `a` will have type `()` // which will fail to typecheck here. - let a: (C*).(Z.X) = {} as C; + let unused a: (C*).(Z.X) = {} as C; } // --- pointer_specialization_second.carbon @@ -282,7 +282,7 @@ fn F() { // The specialization of `Z(C)` should match in preference to the blanket impl // of `Z(T)`. If the blanket impl is chosen, then `a` will have type `()` // which will fail to typecheck here. - let a: (C*).(Z.X) = {} as C; + let unused a: (C*).(Z.X) = {} as C; } // --- cycle_in_deduce_avoided_by_specialization.carbon @@ -304,7 +304,7 @@ impl forall [T:! Z] C(T) as Z where .X = () {} impl C(()) as Z where .X = C(()) {} fn F() { - let a: C(()).(Z.X) = {} as C(()); + let unused a: C(()).(Z.X) = {} as C(()); } // --- final_specialization_before_generic_use_of_type_constant.carbon @@ -320,10 +320,10 @@ impl forall [T:! type, U:! type] T as Z(U) where .X = () {} final impl forall [T:! type] T as Z(C) where .X = C {} -fn F[U:! type](T:! Z(C)) { +fn F[unused U:! type](T:! Z(C)) { // The value of `.X` can be known to be `C` here when the impl `T as Z(C)` is // final. - let a: T.X = {} as C; + let unused a: T.X = {} as C; } // --- fail_specialization_written_after_generic_use_of_type_constant.carbon @@ -337,16 +337,16 @@ class C {} impl forall [T:! type, U:! type] T as Z(U) where .X = () {} -fn F[U:! type](T:! Z(C)) { +fn F[unused U:! type](T:! Z(C)) { // The value of `.X` is symbolic, it can't be assigned a value of type `C`. - // CHECK:STDERR: fail_specialization_written_after_generic_use_of_type_constant.carbon:[[@LINE+7]]:16: error: cannot implicitly convert expression of type `C` to `T.(Z(C).X)` [ConversionFailure] - // CHECK:STDERR: let a: T.X = {} as C; - // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_specialization_written_after_generic_use_of_type_constant.carbon:[[@LINE+4]]:16: note: type `C` does not implement interface `Core.ImplicitAs(T.(Z(C).X))` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let a: T.X = {} as C; - // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: fail_specialization_written_after_generic_use_of_type_constant.carbon:[[@LINE+7]]:23: error: cannot implicitly convert expression of type `C` to `T.(Z(C).X)` [ConversionFailure] + // CHECK:STDERR: let unused a: T.X = {} as C; + // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: fail_specialization_written_after_generic_use_of_type_constant.carbon:[[@LINE+4]]:23: note: type `C` does not implement interface `Core.ImplicitAs(T.(Z(C).X))` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused a: T.X = {} as C; + // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: - let a: T.X = {} as C; + let unused a: T.X = {} as C; } final impl forall [T:! type] T as Z(C) where .X = C {} @@ -385,7 +385,7 @@ impl C as Z where .V = {} { } fn F() { - let x: {}* = G(C); + let unused x: {}* = G(C); } // --- specialization_written_after_generic_use_with_generic_interface.carbon @@ -422,7 +422,7 @@ impl C as Z(C) where .V = {} { } fn F() { - let x: {}* = G(C); + let unused x: {}* = G(C); } // --- type_structure_first_difference.carbon @@ -451,7 +451,7 @@ fn F(T:! Z(C)) -> T.(Z(C).X) { fn G() { // This won't typecheck if the first impl is selected. - let a: () = F(C); + let unused a: () = F(C); } // --- extend_impl_as_specialization.carbon @@ -471,7 +471,7 @@ class C(S:! type) { fn F() { var t: (); let a: ()* = C(()).CC(&t); - let b: C(()).X = *a; + let unused b: C(()).X = *a; } // --- final_impl_as_specialization.carbon @@ -489,7 +489,7 @@ class C(S:! type) { } fn F() { - let a: () = C(()).CC(); + let unused a: () = C(()).CC(); } // --- final_extend_impl_as_specialization.carbon @@ -508,5 +508,5 @@ class C(S:! type) { fn F() { let a: () = C(()).CC(); - let b: C(()).X = a; + let unused b: C(()).X = a; } diff --git a/toolchain/check/testdata/impl/lookup/specialization_poison.carbon b/toolchain/check/testdata/impl/lookup/specialization_poison.carbon index afc907cecdbb..8e10a5d2cb2d 100644 --- a/toolchain/check/testdata/impl/lookup/specialization_poison.carbon +++ b/toolchain/check/testdata/impl/lookup/specialization_poison.carbon @@ -19,7 +19,7 @@ interface I { } impl forall [U:! type] U as I where .T = () { - fn F[self: Self]() -> () { return (); } + fn F[unused self: Self]() -> () { return (); } } // CHECK:STDERR: fail_final_poisoned_concrete_query_in_specific.carbon:[[@LINE+3]]:25: error: found `impl` that would change the result of an earlier use of `C* as I` [PoisonedImplLookupConcreteResult] @@ -58,12 +58,12 @@ impl forall [U:! type] U as I where .T = () {} class C {} -fn H[W:! type](v: W) { +fn H[W:! type](unused v: W) { // This concrete impl lookup query poisons any further specializations. - // CHECK:STDERR: fail_final_poisoned_concrete_query_in_generic.carbon:[[@LINE+3]]:10: error: found `impl` that would change the result of an earlier use of `C as I` [PoisonedImplLookupConcreteResult] - // CHECK:STDERR: let a: C.(I.T) = (); - // CHECK:STDERR: ^~~~~~~ - let a: C.(I.T) = (); + // CHECK:STDERR: fail_final_poisoned_concrete_query_in_generic.carbon:[[@LINE+3]]:17: error: found `impl` that would change the result of an earlier use of `C as I` [PoisonedImplLookupConcreteResult] + // CHECK:STDERR: let unused a: C.(I.T) = (); + // CHECK:STDERR: ^~~~~~~ + let unused a: C.(I.T) = (); } // CHECK:STDERR: fail_final_poisoned_concrete_query_in_generic.carbon:[[@LINE+7]]:1: note: the use would select the `impl` here but it was not found yet [PoisonedImplLookupConcreteResultNoteBadImpl] @@ -86,7 +86,7 @@ interface I { class C(U:! type) {} impl forall [U:! type] C(U) as I where .T = () { - fn F[self: Self]() -> () { return (); } + fn F[unused self: Self]() -> () { return (); } } fn G(c: C(())) -> () { @@ -105,7 +105,7 @@ fn G(c: C(())) -> () { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: impl C(()) as I where .T = {} { - fn F[self: Self]() -> {} { return {}; } + fn F[unused self: Self]() -> {} { return {}; } } // --- fail_final_poisoned_concrete_query_nested_type_in_interface.carbon @@ -117,7 +117,7 @@ interface I(U:! type) { } impl forall [U:! type] U as I(U) where .T = () { - fn F[self: Self]() -> () { return (); } + fn F[unused self: Self]() -> () { return (); } } class C {} @@ -138,7 +138,7 @@ fn G(c: C) -> () { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: impl C as I(C) where .T = {} { - fn F[self: Self]() -> {} { return {}; } + fn F[unused self: Self]() -> {} { return {}; } } // --- todo_fail_final_poisoned_by_generic_query.carbon @@ -150,7 +150,7 @@ interface I { } impl forall [U:! type] U as I where .T = () { - fn F[self: Self]() -> () { return (); } + fn F[unused self: Self]() -> () { return (); } } fn H[W:! type](v: W) -> W.(I.T) { diff --git a/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon b/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon index f8a1908dee81..8cb12081c43b 100644 --- a/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon +++ b/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon @@ -27,7 +27,7 @@ final impl forall [T:! type] T as Z(C) where .X = T {} fn F(T:! Z(C), t: T) { // This should typecheck, the `final impl` should give the same `T`. - let a: T.X = t; + let unused a: T.X = t; } // --- fail_nonfinal_specialized_symbolic_rewrite.carbon @@ -45,14 +45,14 @@ impl forall [T:! type, S:! type] T as Z(S) where .X = () {} impl forall [T:! type] T as Z(C) where .X = T {} fn F(T:! Z(C), t: T) { - // CHECK:STDERR: fail_nonfinal_specialized_symbolic_rewrite.carbon:[[@LINE+7]]:16: error: cannot implicitly convert expression of type `T` to `T.(Z(C).X)` [ConversionFailure] - // CHECK:STDERR: let a: T.X = t; - // CHECK:STDERR: ^ - // CHECK:STDERR: fail_nonfinal_specialized_symbolic_rewrite.carbon:[[@LINE+4]]:16: note: type `T` does not implement interface `Core.ImplicitAs(T.(Z(C).X))` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let a: T.X = t; - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_nonfinal_specialized_symbolic_rewrite.carbon:[[@LINE+7]]:23: error: cannot implicitly convert expression of type `T` to `T.(Z(C).X)` [ConversionFailure] + // CHECK:STDERR: let unused a: T.X = t; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_nonfinal_specialized_symbolic_rewrite.carbon:[[@LINE+4]]:23: note: type `T` does not implement interface `Core.ImplicitAs(T.(Z(C).X))` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused a: T.X = t; + // CHECK:STDERR: ^ // CHECK:STDERR: - let a: T.X = t; + let unused a: T.X = t; } // --- final_impl_rewrite_of_symbolic_through_impl_lookup.carbon @@ -328,7 +328,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T.binding.as_type [symbolic = %require_complete (constants.%require_complete.f3b)] -// CHECK:STDOUT: %.loc15_11.4: require_specific_def_type = require_specific_def @T.as.Z.impl.cf0(%T.binding.as_type) [symbolic = %.loc15_11.4 (constants.%.7b3)] +// CHECK:STDOUT: %.loc15_18.4: require_specific_def_type = require_specific_def @T.as.Z.impl.cf0(%T.binding.as_type) [symbolic = %.loc15_18.4 (constants.%.7b3)] // CHECK:STDOUT: %Z.impl_witness: = impl_witness @T.as.Z.impl.cf0.%Z.impl_witness_table, @T.as.Z.impl.cf0(%T.binding.as_type) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.5a3)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%t.param: @F.%T.binding.as_type (%T.binding.as_type)) { @@ -337,12 +337,12 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %a.patt: @F.%pattern_type (%pattern_type.bb9) = value_binding_pattern a [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %t.ref: @F.%T.binding.as_type (%T.binding.as_type) = name_ref t, %t -// CHECK:STDOUT: %.loc15_11.1: type = splice_block %impl.elem0 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { +// CHECK:STDOUT: %.loc15_18.1: type = splice_block %impl.elem0 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] { // CHECK:STDOUT: %T.ref.loc15: %Z.type.be4 = name_ref T, %T.loc13_6.2 [symbolic = %T.loc13_6.1 (constants.%T.fe5)] // CHECK:STDOUT: %T.as_type.loc15: type = facet_access_type %T.ref.loc15 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc15_11.2: type = converted %T.ref.loc15, %T.as_type.loc15 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc15_11.3: %Z.assoc_type.553 = specific_constant @X.%assoc0, @Z(constants.%C, constants.%T.fe5) [concrete = constants.%assoc0.1e0] -// CHECK:STDOUT: %X.ref: %Z.assoc_type.553 = name_ref X, %.loc15_11.3 [concrete = constants.%assoc0.1e0] +// CHECK:STDOUT: %.loc15_18.2: type = converted %T.ref.loc15, %T.as_type.loc15 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc15_18.3: %Z.assoc_type.553 = specific_constant @X.%assoc0, @Z(constants.%C, constants.%T.fe5) [concrete = constants.%assoc0.1e0] +// CHECK:STDOUT: %X.ref: %Z.assoc_type.553 = name_ref X, %.loc15_18.3 [concrete = constants.%assoc0.1e0] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%Z.impl_witness.5a3, element0 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %a: @F.%T.binding.as_type (%T.binding.as_type) = value_binding a, %t.ref @@ -725,12 +725,12 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc14: = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc14 (constants.%require_complete.f3b)] // CHECK:STDOUT: %Z.lookup_impl_witness: = lookup_impl_witness %T.loc14_6.1, @Z, @Z(constants.%C) [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness.1cb)] -// CHECK:STDOUT: %impl.elem0.loc22_11.2: type = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_11.2 (constants.%impl.elem0.a5e)] -// CHECK:STDOUT: %require_complete.loc22_11: = require_complete_type %impl.elem0.loc22_11.2 [symbolic = %require_complete.loc22_11 (constants.%require_complete.7cf)] -// CHECK:STDOUT: %pattern_type.loc22: type = pattern_type %impl.elem0.loc22_11.2 [symbolic = %pattern_type.loc22 (constants.%pattern_type.7ae)] -// CHECK:STDOUT: %ImplicitAs.type.loc22_16.2: type = facet_type <@ImplicitAs, @ImplicitAs(%impl.elem0.loc22_11.2)> [symbolic = %ImplicitAs.type.loc22_16.2 (constants.%ImplicitAs.type.7e4)] -// CHECK:STDOUT: %require_complete.loc22_16: = require_complete_type %ImplicitAs.type.loc22_16.2 [symbolic = %require_complete.loc22_16 (constants.%require_complete.591)] -// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%impl.elem0.loc22_11.2) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.ac6)] +// CHECK:STDOUT: %impl.elem0.loc22_18.2: type = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_18.2 (constants.%impl.elem0.a5e)] +// CHECK:STDOUT: %require_complete.loc22_18: = require_complete_type %impl.elem0.loc22_18.2 [symbolic = %require_complete.loc22_18 (constants.%require_complete.7cf)] +// CHECK:STDOUT: %pattern_type.loc22: type = pattern_type %impl.elem0.loc22_18.2 [symbolic = %pattern_type.loc22 (constants.%pattern_type.7ae)] +// CHECK:STDOUT: %ImplicitAs.type.loc22_23.2: type = facet_type <@ImplicitAs, @ImplicitAs(%impl.elem0.loc22_18.2)> [symbolic = %ImplicitAs.type.loc22_23.2 (constants.%ImplicitAs.type.7e4)] +// CHECK:STDOUT: %require_complete.loc22_23: = require_complete_type %ImplicitAs.type.loc22_23.2 [symbolic = %require_complete.loc22_23 (constants.%require_complete.591)] +// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%impl.elem0.loc22_18.2) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.ac6)] // CHECK:STDOUT: %assoc0: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ac6) = assoc_entity element0, imports.%Core.import_ref.201 [symbolic = %assoc0 (constants.%assoc0.ae8)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%t.param: @F.%T.binding.as_type (%T.binding.as_type)) { @@ -739,19 +739,19 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: %a.patt: @F.%pattern_type.loc22 (%pattern_type.7ae) = value_binding_pattern a [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %t.ref: @F.%T.binding.as_type (%T.binding.as_type) = name_ref t, %t -// CHECK:STDOUT: %.loc22_11.1: type = splice_block %impl.elem0.loc22_11.1 [symbolic = %impl.elem0.loc22_11.2 (constants.%impl.elem0.a5e)] { +// CHECK:STDOUT: %.loc22_18.1: type = splice_block %impl.elem0.loc22_18.1 [symbolic = %impl.elem0.loc22_18.2 (constants.%impl.elem0.a5e)] { // CHECK:STDOUT: %T.ref.loc22: %Z.type.be4 = name_ref T, %T.loc14_6.2 [symbolic = %T.loc14_6.1 (constants.%T.fe5)] // CHECK:STDOUT: %T.as_type.loc22: type = facet_access_type %T.ref.loc22 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc22_11.2: type = converted %T.ref.loc22, %T.as_type.loc22 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc22_11.3: %Z.assoc_type.553 = specific_constant @X.%assoc0, @Z(constants.%C, constants.%T.fe5) [concrete = constants.%assoc0.1e0] -// CHECK:STDOUT: %X.ref: %Z.assoc_type.553 = name_ref X, %.loc22_11.3 [concrete = constants.%assoc0.1e0] -// CHECK:STDOUT: %impl.elem0.loc22_11.1: type = impl_witness_access constants.%Z.lookup_impl_witness.1cb, element0 [symbolic = %impl.elem0.loc22_11.2 (constants.%impl.elem0.a5e)] +// CHECK:STDOUT: %.loc22_18.2: type = converted %T.ref.loc22, %T.as_type.loc22 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc22_18.3: %Z.assoc_type.553 = specific_constant @X.%assoc0, @Z(constants.%C, constants.%T.fe5) [concrete = constants.%assoc0.1e0] +// CHECK:STDOUT: %X.ref: %Z.assoc_type.553 = name_ref X, %.loc22_18.3 [concrete = constants.%assoc0.1e0] +// CHECK:STDOUT: %impl.elem0.loc22_18.1: type = impl_witness_access constants.%Z.lookup_impl_witness.1cb, element0 [symbolic = %impl.elem0.loc22_18.2 (constants.%impl.elem0.a5e)] // CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.type.loc22_16.1: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%impl.elem0.a5e)> [symbolic = %ImplicitAs.type.loc22_16.2 (constants.%ImplicitAs.type.7e4)] -// CHECK:STDOUT: %.loc22_16.1: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ac6) = specific_constant imports.%Core.import_ref.178, @ImplicitAs(constants.%impl.elem0.a5e, constants.%Self.738) [symbolic = %assoc0 (constants.%assoc0.ae8)] -// CHECK:STDOUT: %Convert.ref: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ac6) = name_ref Convert, %.loc22_16.1 [symbolic = %assoc0 (constants.%assoc0.ae8)] -// CHECK:STDOUT: %.loc22_16.2: @F.%impl.elem0.loc22_11.2 (%impl.elem0.a5e) = converted %t.ref, [concrete = ] -// CHECK:STDOUT: %a: @F.%impl.elem0.loc22_11.2 (%impl.elem0.a5e) = value_binding a, [concrete = ] +// CHECK:STDOUT: %ImplicitAs.type.loc22_23.1: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%impl.elem0.a5e)> [symbolic = %ImplicitAs.type.loc22_23.2 (constants.%ImplicitAs.type.7e4)] +// CHECK:STDOUT: %.loc22_23.1: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ac6) = specific_constant imports.%Core.import_ref.178, @ImplicitAs(constants.%impl.elem0.a5e, constants.%Self.738) [symbolic = %assoc0 (constants.%assoc0.ae8)] +// CHECK:STDOUT: %Convert.ref: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ac6) = name_ref Convert, %.loc22_23.1 [symbolic = %assoc0 (constants.%assoc0.ae8)] +// CHECK:STDOUT: %.loc22_23.2: @F.%impl.elem0.loc22_18.2 (%impl.elem0.a5e) = converted %t.ref, [concrete = ] +// CHECK:STDOUT: %a: @F.%impl.elem0.loc22_18.2 (%impl.elem0.a5e) = value_binding a, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/specific_args.carbon b/toolchain/check/testdata/impl/lookup/specific_args.carbon index d9acd94efb9f..3675fcdeca0e 100644 --- a/toolchain/check/testdata/impl/lookup/specific_args.carbon +++ b/toolchain/check/testdata/impl/lookup/specific_args.carbon @@ -28,7 +28,7 @@ import library "types"; class InInterfaceArgs {} -impl X as I(InInterfaceArgs) { fn F[self: Self]() {} } +impl X as I(InInterfaceArgs) { fn F[unused self: Self]() {} } // --- use_impl_in_interface_args.carbon @@ -45,7 +45,7 @@ import library "types"; class InClassArgs {} -impl C(InClassArgs) as I(X) { fn F[self: Self]() {} } +impl C(InClassArgs) as I(X) { fn F[unused self: Self]() {} } // --- use_impl_in_class_args.carbon @@ -423,7 +423,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %Main.import_ref.d1b: = import_ref Main//impl_in_interface_args, loc7_30, loaded [concrete = constants.%I.impl_witness] // CHECK:STDOUT: %Main.import_ref.044: type = import_ref Main//impl_in_interface_args, loc7_6, loaded [concrete = constants.%X] // CHECK:STDOUT: %Main.import_ref.acb: type = import_ref Main//impl_in_interface_args, loc7_28, loaded [concrete = constants.%I.type.39c] -// CHECK:STDOUT: %Main.import_ref.95d: %X.as.I.impl.F.type = import_ref Main//impl_in_interface_args, loc7_51, loaded [concrete = constants.%X.as.I.impl.F] +// CHECK:STDOUT: %Main.import_ref.95d: %X.as.I.impl.F.type = import_ref Main//impl_in_interface_args, loc7_58, loaded [concrete = constants.%X.as.I.impl.F] // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.95d), @X.as.I.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -825,7 +825,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %Main.import_ref.5ca: = import_ref Main//impl_in_class_args, loc7_29, loaded [concrete = constants.%I.impl_witness] // CHECK:STDOUT: %Main.import_ref.7f4: type = import_ref Main//impl_in_class_args, loc7_19, loaded [concrete = constants.%C.83f] // CHECK:STDOUT: %Main.import_ref.15e: type = import_ref Main//impl_in_class_args, loc7_27, loaded [concrete = constants.%I.type.03e] -// CHECK:STDOUT: %Main.import_ref.e57: %C.as.I.impl.F.type = import_ref Main//impl_in_class_args, loc7_50, loaded [concrete = constants.%C.as.I.impl.F] +// CHECK:STDOUT: %Main.import_ref.e57: %C.as.I.impl.F.type = import_ref Main//impl_in_class_args, loc7_57, loaded [concrete = constants.%C.as.I.impl.F] // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.e57), @C.as.I.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/struct.carbon b/toolchain/check/testdata/impl/lookup/struct.carbon index c41e6c64c1a5..14a10533e512 100644 --- a/toolchain/check/testdata/impl/lookup/struct.carbon +++ b/toolchain/check/testdata/impl/lookup/struct.carbon @@ -42,7 +42,7 @@ fn F(T:! Z) -> T.X { fn G() { // Check which impl is selected for struct literals with different field // names. - let c1: C = F({.a: (), .b: ()}); - let d1: D = F({.aa: (), .bb: ()}); - let d2: D = F({.b: (), .a: ()}); + let unused c1: C = F({.a: (), .b: ()}); + let unused d1: D = F({.aa: (), .bb: ()}); + let unused d2: D = F({.b: (), .a: ()}); } diff --git a/toolchain/check/testdata/impl/lookup/symbolic_lookup.carbon b/toolchain/check/testdata/impl/lookup/symbolic_lookup.carbon index 45a4a75075a4..cfa89cce3273 100644 --- a/toolchain/check/testdata/impl/lookup/symbolic_lookup.carbon +++ b/toolchain/check/testdata/impl/lookup/symbolic_lookup.carbon @@ -50,7 +50,7 @@ class C(T:! X) {} // with a `FacetAccessType` when evaluating the instruction. class D(T:! Y) { adapt C(T); } -fn Test(T:! Y & Z, d: D(T)) {} +fn Test(T:! Y & Z, unused d: D(T)) {} // --- final_symbolic_rewrite.carbon library "[[@TEST_NAME]]"; @@ -67,5 +67,5 @@ class C {} fn F(T:! Z(C), t: T) { // This should typecheck, the `final impl` should give the same `T`. - let a: T.X = t; + let unused a: T.X = t; } diff --git a/toolchain/check/testdata/impl/lookup/transitive.carbon b/toolchain/check/testdata/impl/lookup/transitive.carbon index bd41a493bb05..6d257bafac34 100644 --- a/toolchain/check/testdata/impl/lookup/transitive.carbon +++ b/toolchain/check/testdata/impl/lookup/transitive.carbon @@ -25,7 +25,7 @@ library "[[@TEST_NAME]]"; import library "i"; class C {} -impl C as I { fn F[self: Self]() {} } +impl C as I { fn F[unused self: Self]() {} } // --- get.carbon @@ -339,7 +339,7 @@ fn Call() { // CHECK:STDOUT: %Main.import_ref.31c: = import_ref Main//c, loc7_13, loaded [concrete = constants.%I.impl_witness] // CHECK:STDOUT: %Main.import_ref.61c: type = import_ref Main//c, loc7_6, loaded [concrete = constants.%C] // CHECK:STDOUT: %Main.import_ref.91f: type = import_ref Main//c, loc7_11, loaded [concrete = constants.%I.type] -// CHECK:STDOUT: %Main.import_ref.706: %C.as.I.impl.F.type = import_ref Main//c, loc7_34, loaded [concrete = constants.%C.as.I.impl.F] +// CHECK:STDOUT: %Main.import_ref.706: %C.as.I.impl.F.type = import_ref Main//c, loc7_41, loaded [concrete = constants.%C.as.I.impl.F] // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.706), @C.as.I.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/unused_generic_binding.carbon b/toolchain/check/testdata/impl/lookup/unused_generic_binding.carbon index f604081feb80..d81fad733cca 100644 --- a/toolchain/check/testdata/impl/lookup/unused_generic_binding.carbon +++ b/toolchain/check/testdata/impl/lookup/unused_generic_binding.carbon @@ -35,7 +35,7 @@ fn F() { // second is more specific. But since it has an unused generic parameter, it // will never match. If the second was matched, this line would not type // check. - let x: C.(I.T) = (); + let unused x: C.(I.T) = (); } // --- fail_one_binding_unused.carbon @@ -63,7 +63,7 @@ fn F() { // This shows that the first impl declaration was matched even though the // second is more specific. If the second was matched, it would not type // check. - let x: C.(I.T) = (); + let unused x: C.(I.T) = (); } // --- fail_inherited_binding_unused.carbon @@ -89,7 +89,7 @@ class C(U:! type) { } fn F() { - let x: C(()).(I.T) = (); + let unused x: C(()).(I.T) = (); } // --- fail_inherited_binding_in_forall_unused.carbon @@ -115,7 +115,7 @@ class C(U:! type) { } fn F() { - let x: C(()).(I.T) = (); + let unused x: C(()).(I.T) = (); } // --- inherited_binding_used.carbon @@ -134,7 +134,7 @@ class C(U:! type) { fn F() { // The `impl` inside C is matched here. - let x: C(()).(I.T) = (); + let unused x: C(()).(I.T) = (); } // --- inherited_binding_in_forall_used.carbon @@ -153,5 +153,5 @@ class C(U:! type) { fn F() { // The `impl` inside C is matched here. - let x: C(()).(I({}).T) = (); + let unused x: C(()).(I({}).T) = (); } diff --git a/toolchain/check/testdata/impl/self_in_signature.carbon b/toolchain/check/testdata/impl/self_in_signature.carbon index 0ad0ed490f8e..a6df7496dceb 100644 --- a/toolchain/check/testdata/impl/self_in_signature.carbon +++ b/toolchain/check/testdata/impl/self_in_signature.carbon @@ -21,11 +21,11 @@ class C {} class D {} impl C as UseSelf { - fn F[self: C](x: C) -> C { return {}; } + fn F[unused self: C](unused x: C) -> C { return {}; } } impl D as UseSelf { - fn F[self: Self](x: Self) -> Self { return {}; } + fn F[unused self: Self](unused x: Self) -> Self { return {}; } } interface SelfNested { @@ -232,13 +232,13 @@ impl D as SelfNested { // CHECK:STDOUT: %return.patt: %pattern_type.7c7 = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.7c7 = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc24_26: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc24_26: Core.Form = init_form %C.ref.loc24_26, call_param2 [concrete = constants.%.92f] +// CHECK:STDOUT: %C.ref.loc24_40: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc24_40: Core.Form = init_form %C.ref.loc24_40, call_param2 [concrete = constants.%.92f] // CHECK:STDOUT: %self.param: %C = value_param call_param0 -// CHECK:STDOUT: %C.ref.loc24_14: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc24_21: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %self: %C = value_binding self, %self.param // CHECK:STDOUT: %x.param: %C = value_param call_param1 -// CHECK:STDOUT: %C.ref.loc24_20: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc24_34: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %x: %C = value_binding x, %x.param // CHECK:STDOUT: %return.param: ref %C = out_param call_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -261,13 +261,13 @@ impl D as SelfNested { // CHECK:STDOUT: %return.patt: %pattern_type.9c8 = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.9c8 = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc28_32: type = name_ref Self, @D.as.UseSelf.impl.%D.ref [concrete = constants.%D] -// CHECK:STDOUT: %.loc28_32: Core.Form = init_form %Self.ref.loc28_32, call_param2 [concrete = constants.%.513] +// CHECK:STDOUT: %Self.ref.loc28_46: type = name_ref Self, @D.as.UseSelf.impl.%D.ref [concrete = constants.%D] +// CHECK:STDOUT: %.loc28_46: Core.Form = init_form %Self.ref.loc28_46, call_param2 [concrete = constants.%.513] // CHECK:STDOUT: %self.param: %D = value_param call_param0 -// CHECK:STDOUT: %Self.ref.loc28_14: type = name_ref Self, @D.as.UseSelf.impl.%D.ref [concrete = constants.%D] +// CHECK:STDOUT: %Self.ref.loc28_21: type = name_ref Self, @D.as.UseSelf.impl.%D.ref [concrete = constants.%D] // CHECK:STDOUT: %self: %D = value_binding self, %self.param // CHECK:STDOUT: %x.param: %D = value_param call_param1 -// CHECK:STDOUT: %Self.ref.loc28_23: type = name_ref Self, @D.as.UseSelf.impl.%D.ref [concrete = constants.%D] +// CHECK:STDOUT: %Self.ref.loc28_37: type = name_ref Self, @D.as.UseSelf.impl.%D.ref [concrete = constants.%D] // CHECK:STDOUT: %x: %D = value_binding x, %x.param // CHECK:STDOUT: %return.param: ref %D = out_param call_param2 // CHECK:STDOUT: %return: ref %D = return_slot %return.param @@ -360,18 +360,18 @@ impl D as SelfNested { // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.UseSelf.impl.F(%self.param: %C, %x.param: %C) -> out %return.param: %C { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc24_38.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc24_38.2: init %C to %return.param = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc24_39: init %C = converted %.loc24_38.1, %.loc24_38.2 [concrete = constants.%C.val] -// CHECK:STDOUT: return %.loc24_39 to %return.param +// CHECK:STDOUT: %.loc24_52.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc24_52.2: init %C to %return.param = class_init () [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc24_53: init %C = converted %.loc24_52.1, %.loc24_52.2 [concrete = constants.%C.val] +// CHECK:STDOUT: return %.loc24_53 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @D.as.UseSelf.impl.F(%self.param: %D, %x.param: %D) -> out %return.param: %D { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc28_47.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc28_47.2: init %D to %return.param = class_init () [concrete = constants.%D.val] -// CHECK:STDOUT: %.loc28_48: init %D = converted %.loc28_47.1, %.loc28_47.2 [concrete = constants.%D.val] -// CHECK:STDOUT: return %.loc28_48 to %return.param +// CHECK:STDOUT: %.loc28_61.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc28_61.2: init %D to %return.param = class_init () [concrete = constants.%D.val] +// CHECK:STDOUT: %.loc28_62: init %D = converted %.loc28_61.1, %.loc28_61.2 [concrete = constants.%D.val] +// CHECK:STDOUT: return %.loc28_62 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @SelfNested.WithSelf.F(@SelfNested.%Self.loc31: %SelfNested.type) { diff --git a/toolchain/check/testdata/impl/use_assoc_entity.carbon b/toolchain/check/testdata/impl/use_assoc_entity.carbon index 6abfe800d60d..8498dfba130f 100644 --- a/toolchain/check/testdata/impl/use_assoc_entity.carbon +++ b/toolchain/check/testdata/impl/use_assoc_entity.carbon @@ -21,7 +21,7 @@ interface J { } impl () as J where .U = i32 { - fn F[self: Self](u: i32) -> i32 { return -u; } + fn F[unused self: Self](u: i32) -> i32 { return -u; } } fn CallMethod(x: ()) -> i32 { @@ -34,7 +34,7 @@ class C { } impl C as J where .U = C { - fn F[self: Self](u: C) -> C { return self; } + fn F[self: Self](unused u: C) -> C { return self; } } // --- associated_type_in_function_signature.carbon @@ -69,18 +69,18 @@ class E { fn F(u: i32) -> i32 { return -u; } - fn G[self: Self](v: i32) -> i32 { + fn G[unused self: Self](v: i32) -> i32 { return -v; } } } fn CallBoth(e: E) { - let e1: i32 = e.F(2); - let e2: i32 = e.G(3); - let e3: i32 = E.F(4); - let e4: i32 = e.(E.G)(5); - let e5: i32 = e.(J.G)(6); + let unused e1: i32 = e.F(2); + let unused e2: i32 = e.G(3); + let unused e3: i32 = E.F(4); + let unused e4: i32 = e.(E.G)(5); + let unused e5: i32 = e.(J.G)(6); } fn GenericCallF[T:! J](t: T, u: T.U) -> T.U { @@ -187,12 +187,12 @@ class E { library "[[@TEST_NAME]]"; interface J { - fn F[self: Self]() {} + fn F[unused self: Self]() {} } class E { extend impl as J { - fn F[self: Self]() {} + fn F[unused self: Self]() {} } fn G[self: Self]() { self.F(); } @@ -242,7 +242,7 @@ interface J2 { } impl () as J2 where .U2 = {} { - fn F[self: Self](z: {}) -> {} { return z; } + fn F[unused self: Self](z: {}) -> {} { return z; } } class C2 { @@ -251,7 +251,7 @@ class C2 { } impl C2 as J2 where .U2 = C2 { - fn F[self: Self](z: C2) -> C2 { return self; } + fn F[self: Self](unused z: C2) -> C2 { return self; } } // --- fail_associated_type_in_signature_mismatch.carbon @@ -266,21 +266,21 @@ interface K { } impl () as K where .V = {.a: ()} { - // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE+14]]:20: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fn F[self: Self](v: {.x: ()}) -> {.x: ()} { return v; } - // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE+14]]:27: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: fn F[unused self: Self](v: {.x: ()}) -> {.x: ()} { return v; } + // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE-7]]:3: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: fn F[self: Self](v: V) -> V; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE+7]]:3: error: cannot convert from struct type `{.x: ()}` to `{.a: ()}`: missing field `a` in source type [StructInitMissingFieldInConversion] - // CHECK:STDERR: fn F[self: Self](v: {.x: ()}) -> {.x: ()} { return v; } - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn F[unused self: Self](v: {.x: ()}) -> {.x: ()} { return v; } + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE-14]]:3: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: fn F[self: Self](v: V) -> V; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - fn F[self: Self](v: {.x: ()}) -> {.x: ()} { return v; } + fn F[unused self: Self](v: {.x: ()}) -> {.x: ()} { return v; } } // --- use_non-type_in_function.carbon @@ -328,7 +328,7 @@ interface I { } impl () as I where .N = 2 { - fn F[self: Self]() -> array(bool, 2) { return (true, false); } + fn F[unused self: Self]() -> array(bool, 2) { return (true, false); } } // --- symbolic_associated_type_in_concrete_context.carbon @@ -343,7 +343,7 @@ class D {} impl forall [T:! type] T as Z where .X = C(T) {} fn F() { - let a: D.(Z.X) = {} as C(D); + let unused a: D.(Z.X) = {} as C(D); } // CHECK:STDOUT: --- associated_type_in_method_signature.carbon @@ -567,16 +567,16 @@ fn F() { // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc9_31: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc9_31: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc9_31: Core.Form = init_form %i32.loc9_31, call_param2 [concrete = constants.%.8ef] +// CHECK:STDOUT: %int_32.loc9_38: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc9_38: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc9_38: Core.Form = init_form %i32.loc9_38, call_param2 [concrete = constants.%.8ef] // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.J.impl.%.loc8_7.2 [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param // CHECK:STDOUT: %u.param: %i32 = value_param call_param1 -// CHECK:STDOUT: %.loc9_23: type = splice_block %i32.loc9_23 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc9_23: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc9_23: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc9_30: type = splice_block %i32.loc9_30 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc9_30: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc9_30: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %u: %i32 = value_binding u, %u.param // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2 @@ -600,13 +600,13 @@ fn F() { // CHECK:STDOUT: %return.patt: %pattern_type.7c7 = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.7c7 = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc22_29: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc22_29: Core.Form = init_form %C.ref.loc22_29, call_param2 [concrete = constants.%.92f] +// CHECK:STDOUT: %C.ref.loc22_36: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc22_36: Core.Form = init_form %C.ref.loc22_36, call_param2 [concrete = constants.%.92f] // CHECK:STDOUT: %self.param: %C = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.J.impl.%C.ref.loc21_6 [concrete = constants.%C] // CHECK:STDOUT: %self: %C = value_binding self, %self.param // CHECK:STDOUT: %u.param: %C = value_param call_param1 -// CHECK:STDOUT: %C.ref.loc22_23: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc22_30: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %u: %C = value_binding u, %u.param // CHECK:STDOUT: %return.param: ref %C = out_param call_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -648,10 +648,10 @@ fn F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %u.ref: %i32 = name_ref u, %u // CHECK:STDOUT: %impl.elem1: %.5dd = impl_witness_access constants.%Negate.impl_witness.11c, element1 [concrete = constants.%Int.as.Negate.impl.Op.e7f] -// CHECK:STDOUT: %bound_method.loc9_44.1: = bound_method %u.ref, %impl.elem1 +// CHECK:STDOUT: %bound_method.loc9_51.1: = bound_method %u.ref, %impl.elem1 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem1, @Int.as.Negate.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Negate.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_44.2: = bound_method %u.ref, %specific_fn -// CHECK:STDOUT: %Int.as.Negate.impl.Op.call: init %i32 = call %bound_method.loc9_44.2(%u.ref) +// CHECK:STDOUT: %bound_method.loc9_51.2: = bound_method %u.ref, %specific_fn +// CHECK:STDOUT: %Int.as.Negate.impl.Op.call: init %i32 = call %bound_method.loc9_51.2(%u.ref) // CHECK:STDOUT: return %Int.as.Negate.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: @@ -677,11 +677,11 @@ fn F() { // CHECK:STDOUT: fn @C.as.J.impl.F(%self.param: %C, %u.param: %C) -> out %return.param: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %C = name_ref self, %self -// CHECK:STDOUT: %.loc22_44.1: %empty_struct_type = as_compatible %self.ref -// CHECK:STDOUT: %.loc22_44.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc22_44.3: init %C = as_compatible %.loc22_44.2 [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc22_44.4: init %C = converted %self.ref, %.loc22_44.3 [concrete = constants.%C.val] -// CHECK:STDOUT: return %.loc22_44.4 +// CHECK:STDOUT: %.loc22_51.1: %empty_struct_type = as_compatible %self.ref +// CHECK:STDOUT: %.loc22_51.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc22_51.3: init %C = as_compatible %.loc22_51.2 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc22_51.4: init %C = converted %self.ref, %.loc22_51.3 [concrete = constants.%C.val] +// CHECK:STDOUT: return %.loc22_51.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @J(constants.%Self.8a1) { @@ -1338,16 +1338,16 @@ fn F() { // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc14_33: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_33: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc14_33: Core.Form = init_form %i32.loc14_33, call_param2 [concrete = constants.%.8ef] +// CHECK:STDOUT: %int_32.loc14_40: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc14_40: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc14_40: Core.Form = init_form %i32.loc14_40, call_param2 [concrete = constants.%.8ef] // CHECK:STDOUT: %self.param: %E = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E] // CHECK:STDOUT: %self: %E = value_binding self, %self.param // CHECK:STDOUT: %v.param: %i32 = value_param call_param1 -// CHECK:STDOUT: %.loc14_25: type = splice_block %i32.loc14_25 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc14_25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc14_32: type = splice_block %i32.loc14_32 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc14_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc14_32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %v: %i32 = value_binding v, %v.param // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2 @@ -1445,43 +1445,43 @@ fn F() { // CHECK:STDOUT: %impl.elem1.loc21: %.ff2 = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%E.as.J.impl.F] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc21: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc21_21.1: = bound_method %int_2, %impl.elem0.loc21 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] +// CHECK:STDOUT: %bound_method.loc21_28.1: = bound_method %int_2, %impl.elem0.loc21 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc21: = specific_function %impl.elem0.loc21, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc21_21.2: = bound_method %int_2, %specific_fn.loc21 [concrete = constants.%bound_method.646] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21: init %i32 = call %bound_method.loc21_21.2(%int_2) [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc21_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc21_21.2: %i32 = converted %int_2, %.loc21_21.1 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %E.as.J.impl.F.call.loc21: init %i32 = call %impl.elem1.loc21(%.loc21_21.2) -// CHECK:STDOUT: %.loc21_11: type = splice_block %i32.loc21 [concrete = constants.%i32] { +// CHECK:STDOUT: %bound_method.loc21_28.2: = bound_method %int_2, %specific_fn.loc21 [concrete = constants.%bound_method.646] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21: init %i32 = call %bound_method.loc21_28.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc21_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc21_28.2: %i32 = converted %int_2, %.loc21_28.1 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %E.as.J.impl.F.call.loc21: init %i32 = call %impl.elem1.loc21(%.loc21_28.2) +// CHECK:STDOUT: %.loc21_18: type = splice_block %i32.loc21 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc21_22.1: %i32 = value_of_initializer %E.as.J.impl.F.call.loc21 -// CHECK:STDOUT: %.loc21_22.2: %i32 = converted %E.as.J.impl.F.call.loc21, %.loc21_22.1 -// CHECK:STDOUT: %e1: %i32 = value_binding e1, %.loc21_22.2 +// CHECK:STDOUT: %.loc21_29.1: %i32 = value_of_initializer %E.as.J.impl.F.call.loc21 +// CHECK:STDOUT: %.loc21_29.2: %i32 = converted %E.as.J.impl.F.call.loc21, %.loc21_29.1 +// CHECK:STDOUT: %e1: %i32 = value_binding e1, %.loc21_29.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %e2.patt: %pattern_type.7ce = value_binding_pattern e2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %e.ref.loc22: %E = name_ref e, %e // CHECK:STDOUT: %G.ref.loc22: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2] // CHECK:STDOUT: %impl.elem2.loc22: %.825 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%E.as.J.impl.G] -// CHECK:STDOUT: %bound_method.loc22_18: = bound_method %e.ref.loc22, %impl.elem2.loc22 +// CHECK:STDOUT: %bound_method.loc22_25: = bound_method %e.ref.loc22, %impl.elem2.loc22 // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %impl.elem0.loc22: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc22_21.1: = bound_method %int_3, %impl.elem0.loc22 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] +// CHECK:STDOUT: %bound_method.loc22_28.1: = bound_method %int_3, %impl.elem0.loc22 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] // CHECK:STDOUT: %specific_fn.loc22: = specific_function %impl.elem0.loc22, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc22_21.2: = bound_method %int_3, %specific_fn.loc22 [concrete = constants.%bound_method.fa7] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22: init %i32 = call %bound_method.loc22_21.2(%int_3) [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc22_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc22_21.2: %i32 = converted %int_3, %.loc22_21.1 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %E.as.J.impl.G.call.loc22: init %i32 = call %bound_method.loc22_18(%e.ref.loc22, %.loc22_21.2) -// CHECK:STDOUT: %.loc22_11: type = splice_block %i32.loc22 [concrete = constants.%i32] { +// CHECK:STDOUT: %bound_method.loc22_28.2: = bound_method %int_3, %specific_fn.loc22 [concrete = constants.%bound_method.fa7] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22: init %i32 = call %bound_method.loc22_28.2(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc22_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc22_28.2: %i32 = converted %int_3, %.loc22_28.1 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %E.as.J.impl.G.call.loc22: init %i32 = call %bound_method.loc22_25(%e.ref.loc22, %.loc22_28.2) +// CHECK:STDOUT: %.loc22_18: type = splice_block %i32.loc22 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22_22.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc22 -// CHECK:STDOUT: %.loc22_22.2: %i32 = converted %E.as.J.impl.G.call.loc22, %.loc22_22.1 -// CHECK:STDOUT: %e2: %i32 = value_binding e2, %.loc22_22.2 +// CHECK:STDOUT: %.loc22_29.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc22 +// CHECK:STDOUT: %.loc22_29.2: %i32 = converted %E.as.J.impl.G.call.loc22, %.loc22_29.1 +// CHECK:STDOUT: %e2: %i32 = value_binding e2, %.loc22_29.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %e3.patt: %pattern_type.7ce = value_binding_pattern e3 [concrete] // CHECK:STDOUT: } @@ -1490,20 +1490,20 @@ fn F() { // CHECK:STDOUT: %impl.elem1.loc23: %.ff2 = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%E.as.J.impl.F] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] // CHECK:STDOUT: %impl.elem0.loc23: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc23_21.1: = bound_method %int_4, %impl.elem0.loc23 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c] +// CHECK:STDOUT: %bound_method.loc23_28.1: = bound_method %int_4, %impl.elem0.loc23 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c] // CHECK:STDOUT: %specific_fn.loc23: = specific_function %impl.elem0.loc23, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc23_21.2: = bound_method %int_4, %specific_fn.loc23 [concrete = constants.%bound_method.6d7] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23: init %i32 = call %bound_method.loc23_21.2(%int_4) [concrete = constants.%int_4.940] -// CHECK:STDOUT: %.loc23_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23 [concrete = constants.%int_4.940] -// CHECK:STDOUT: %.loc23_21.2: %i32 = converted %int_4, %.loc23_21.1 [concrete = constants.%int_4.940] -// CHECK:STDOUT: %E.as.J.impl.F.call.loc23: init %i32 = call %impl.elem1.loc23(%.loc23_21.2) -// CHECK:STDOUT: %.loc23_11: type = splice_block %i32.loc23 [concrete = constants.%i32] { +// CHECK:STDOUT: %bound_method.loc23_28.2: = bound_method %int_4, %specific_fn.loc23 [concrete = constants.%bound_method.6d7] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23: init %i32 = call %bound_method.loc23_28.2(%int_4) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %.loc23_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23 [concrete = constants.%int_4.940] +// CHECK:STDOUT: %.loc23_28.2: %i32 = converted %int_4, %.loc23_28.1 [concrete = constants.%int_4.940] +// CHECK:STDOUT: %E.as.J.impl.F.call.loc23: init %i32 = call %impl.elem1.loc23(%.loc23_28.2) +// CHECK:STDOUT: %.loc23_18: type = splice_block %i32.loc23 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc23_22.1: %i32 = value_of_initializer %E.as.J.impl.F.call.loc23 -// CHECK:STDOUT: %.loc23_22.2: %i32 = converted %E.as.J.impl.F.call.loc23, %.loc23_22.1 -// CHECK:STDOUT: %e3: %i32 = value_binding e3, %.loc23_22.2 +// CHECK:STDOUT: %.loc23_29.1: %i32 = value_of_initializer %E.as.J.impl.F.call.loc23 +// CHECK:STDOUT: %.loc23_29.2: %i32 = converted %E.as.J.impl.F.call.loc23, %.loc23_29.1 +// CHECK:STDOUT: %e3: %i32 = value_binding e3, %.loc23_29.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %e4.patt: %pattern_type.7ce = value_binding_pattern e4 [concrete] // CHECK:STDOUT: } @@ -1511,23 +1511,23 @@ fn F() { // CHECK:STDOUT: %E.ref.loc24: type = name_ref E, file.%E.decl [concrete = constants.%E] // CHECK:STDOUT: %G.ref.loc24: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2] // CHECK:STDOUT: %impl.elem2.loc24: %.825 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%E.as.J.impl.G] -// CHECK:STDOUT: %bound_method.loc24_18: = bound_method %e.ref.loc24, %impl.elem2.loc24 +// CHECK:STDOUT: %bound_method.loc24_25: = bound_method %e.ref.loc24, %impl.elem2.loc24 // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b] // CHECK:STDOUT: %impl.elem0.loc24: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc24_25.1: = bound_method %int_5, %impl.elem0.loc24 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.005] +// CHECK:STDOUT: %bound_method.loc24_32.1: = bound_method %int_5, %impl.elem0.loc24 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.005] // CHECK:STDOUT: %specific_fn.loc24: = specific_function %impl.elem0.loc24, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc24_25.2: = bound_method %int_5, %specific_fn.loc24 [concrete = constants.%bound_method.e9d] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc24: init %i32 = call %bound_method.loc24_25.2(%int_5) [concrete = constants.%int_5.0f6] -// CHECK:STDOUT: %.loc24_25.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc24 [concrete = constants.%int_5.0f6] -// CHECK:STDOUT: %.loc24_25.2: %i32 = converted %int_5, %.loc24_25.1 [concrete = constants.%int_5.0f6] -// CHECK:STDOUT: %E.as.J.impl.G.call.loc24: init %i32 = call %bound_method.loc24_18(%e.ref.loc24, %.loc24_25.2) -// CHECK:STDOUT: %.loc24_11: type = splice_block %i32.loc24 [concrete = constants.%i32] { +// CHECK:STDOUT: %bound_method.loc24_32.2: = bound_method %int_5, %specific_fn.loc24 [concrete = constants.%bound_method.e9d] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc24: init %i32 = call %bound_method.loc24_32.2(%int_5) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %.loc24_32.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc24 [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %.loc24_32.2: %i32 = converted %int_5, %.loc24_32.1 [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %E.as.J.impl.G.call.loc24: init %i32 = call %bound_method.loc24_25(%e.ref.loc24, %.loc24_32.2) +// CHECK:STDOUT: %.loc24_18: type = splice_block %i32.loc24 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc24_26.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc24 -// CHECK:STDOUT: %.loc24_26.2: %i32 = converted %E.as.J.impl.G.call.loc24, %.loc24_26.1 -// CHECK:STDOUT: %e4: %i32 = value_binding e4, %.loc24_26.2 +// CHECK:STDOUT: %.loc24_33.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc24 +// CHECK:STDOUT: %.loc24_33.2: %i32 = converted %E.as.J.impl.G.call.loc24, %.loc24_33.1 +// CHECK:STDOUT: %e4: %i32 = value_binding e4, %.loc24_33.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %e5.patt: %pattern_type.7ce = value_binding_pattern e5 [concrete] // CHECK:STDOUT: } @@ -1535,23 +1535,23 @@ fn F() { // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: %G.ref.loc25: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2] // CHECK:STDOUT: %impl.elem2.loc25: %.825 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%E.as.J.impl.G] -// CHECK:STDOUT: %bound_method.loc25_18: = bound_method %e.ref.loc25, %impl.elem2.loc25 +// CHECK:STDOUT: %bound_method.loc25_25: = bound_method %e.ref.loc25, %impl.elem2.loc25 // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6.462] // CHECK:STDOUT: %impl.elem0.loc25: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc25_25.1: = bound_method %int_6, %impl.elem0.loc25 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.502] +// CHECK:STDOUT: %bound_method.loc25_32.1: = bound_method %int_6, %impl.elem0.loc25 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.502] // CHECK:STDOUT: %specific_fn.loc25: = specific_function %impl.elem0.loc25, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc25_25.2: = bound_method %int_6, %specific_fn.loc25 [concrete = constants.%bound_method.bc2] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25: init %i32 = call %bound_method.loc25_25.2(%int_6) [concrete = constants.%int_6.e56] -// CHECK:STDOUT: %.loc25_25.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25 [concrete = constants.%int_6.e56] -// CHECK:STDOUT: %.loc25_25.2: %i32 = converted %int_6, %.loc25_25.1 [concrete = constants.%int_6.e56] -// CHECK:STDOUT: %E.as.J.impl.G.call.loc25: init %i32 = call %bound_method.loc25_18(%e.ref.loc25, %.loc25_25.2) -// CHECK:STDOUT: %.loc25_11: type = splice_block %i32.loc25 [concrete = constants.%i32] { +// CHECK:STDOUT: %bound_method.loc25_32.2: = bound_method %int_6, %specific_fn.loc25 [concrete = constants.%bound_method.bc2] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25: init %i32 = call %bound_method.loc25_32.2(%int_6) [concrete = constants.%int_6.e56] +// CHECK:STDOUT: %.loc25_32.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25 [concrete = constants.%int_6.e56] +// CHECK:STDOUT: %.loc25_32.2: %i32 = converted %int_6, %.loc25_32.1 [concrete = constants.%int_6.e56] +// CHECK:STDOUT: %E.as.J.impl.G.call.loc25: init %i32 = call %bound_method.loc25_25(%e.ref.loc25, %.loc25_32.2) +// CHECK:STDOUT: %.loc25_18: type = splice_block %i32.loc25 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc25_26.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc25 -// CHECK:STDOUT: %.loc25_26.2: %i32 = converted %E.as.J.impl.G.call.loc25, %.loc25_26.1 -// CHECK:STDOUT: %e5: %i32 = value_binding e5, %.loc25_26.2 +// CHECK:STDOUT: %.loc25_33.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc25 +// CHECK:STDOUT: %.loc25_33.2: %i32 = converted %E.as.J.impl.G.call.loc25, %.loc25_33.1 +// CHECK:STDOUT: %e5: %i32 = value_binding e5, %.loc25_33.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3004,10 +3004,10 @@ fn F() { // CHECK:STDOUT: %self.param_patt: @J.WithSelf.F.%pattern_type (%pattern_type.832) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @J.WithSelf.F.%Self.binding.as_type (%Self.binding.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc4_14.1: type = splice_block %.loc4_14.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] { +// CHECK:STDOUT: %.loc4_21.1: type = splice_block %.loc4_21.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] { // CHECK:STDOUT: %Self.ref: %J.type = name_ref Self, @J.%Self.loc3 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] -// CHECK:STDOUT: %.loc4_14.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] +// CHECK:STDOUT: %.loc4_21.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @J.WithSelf.F.%Self.binding.as_type (%Self.binding.as_type) = value_binding self, %self.param // CHECK:STDOUT: } @@ -3272,12 +3272,12 @@ fn F() { // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] // CHECK:STDOUT: %.0df: Core.Form = init_form %empty_struct_type, call_param2 [concrete] -// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1: type = fn_type @empty_tuple.type.as.J2.impl.F.loc23_33.1 [concrete] +// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1: type = fn_type @empty_tuple.type.as.J2.impl.F.loc23_40.1 [concrete] // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.7b8679.1: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1 = struct_value () [concrete] // CHECK:STDOUT: %J2.facet.6c9: %J2.type = facet_value %empty_tuple.type, (%J2.impl_witness.941) [concrete] // CHECK:STDOUT: %J2.WithSelf.F.type.43a: type = fn_type @J2.WithSelf.F, @J2(%J2.facet.6c9) [concrete] // CHECK:STDOUT: %J2.WithSelf.F.2bb: %J2.WithSelf.F.type.43a = struct_value () [concrete] -// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.type.56bdaf.2: type = fn_type @empty_tuple.type.as.J2.impl.F.loc23_33.2 [concrete] +// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.type.56bdaf.2: type = fn_type @empty_tuple.type.as.J2.impl.F.loc23_40.2 [concrete] // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.7b8679.2: %empty_tuple.type.as.J2.impl.F.type.56bdaf.2 = struct_value () [concrete] // CHECK:STDOUT: %C2: type = class_type @C2 [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] @@ -3285,12 +3285,12 @@ fn F() { // CHECK:STDOUT: %J2.impl_witness.30f: = impl_witness @C2.as.J2.impl.%J2.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.8df: type = pattern_type %C2 [concrete] // CHECK:STDOUT: %.704: Core.Form = init_form %C2, call_param2 [concrete] -// CHECK:STDOUT: %C2.as.J2.impl.F.type.d2a210.1: type = fn_type @C2.as.J2.impl.F.loc32_33.1 [concrete] +// CHECK:STDOUT: %C2.as.J2.impl.F.type.d2a210.1: type = fn_type @C2.as.J2.impl.F.loc32_40.1 [concrete] // CHECK:STDOUT: %C2.as.J2.impl.F.720bb2.1: %C2.as.J2.impl.F.type.d2a210.1 = struct_value () [concrete] // CHECK:STDOUT: %J2.facet.f19: %J2.type = facet_value %C2, (%J2.impl_witness.30f) [concrete] // CHECK:STDOUT: %J2.WithSelf.F.type.3cd: type = fn_type @J2.WithSelf.F, @J2(%J2.facet.f19) [concrete] // CHECK:STDOUT: %J2.WithSelf.F.06e: %J2.WithSelf.F.type.3cd = struct_value () [concrete] -// CHECK:STDOUT: %C2.as.J2.impl.F.type.d2a210.2: type = fn_type @C2.as.J2.impl.F.loc32_33.2 [concrete] +// CHECK:STDOUT: %C2.as.J2.impl.F.type.d2a210.2: type = fn_type @C2.as.J2.impl.F.loc32_40.2 [concrete] // CHECK:STDOUT: %C2.as.J2.impl.F.720bb2.2: %C2.as.J2.impl.F.type.d2a210.2 = struct_value () [concrete] // CHECK:STDOUT: %C2.val: %C2 = struct_value () [concrete] // CHECK:STDOUT: } @@ -3391,7 +3391,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_tuple.type.as.J2.impl: %.loc22_7.2 as %.loc22_15 { -// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.decl.loc23_33.1: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1 = fn_decl @empty_tuple.type.as.J2.impl.F.loc23_33.1 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.1] { +// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.decl.loc23_40.1: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1 = fn_decl @empty_tuple.type.as.J2.impl.F.loc23_40.1 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.1] { // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = value_binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: %z.patt: %pattern_type.a96 = value_binding_pattern z [concrete] @@ -3399,16 +3399,16 @@ fn F() { // CHECK:STDOUT: %return.patt: %pattern_type.a96 = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.a96 = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc23_31.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc23_31.2: type = converted %.loc23_31.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc23_31.3: Core.Form = init_form %.loc23_31.2, call_param2 [concrete = constants.%.0df] +// CHECK:STDOUT: %.loc23_38.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc23_38.2: type = converted %.loc23_38.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc23_38.3: Core.Form = init_form %.loc23_38.2, call_param2 [concrete = constants.%.0df] // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.J2.impl.%.loc22_7.2 [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param // CHECK:STDOUT: %z.param: %empty_struct_type = value_param call_param1 -// CHECK:STDOUT: %.loc23_24.1: type = splice_block %.loc23_24.3 [concrete = constants.%empty_struct_type] { -// CHECK:STDOUT: %.loc23_24.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc23_24.3: type = converted %.loc23_24.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc23_31.1: type = splice_block %.loc23_31.3 [concrete = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc23_31.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc23_31.3: type = converted %.loc23_31.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } // CHECK:STDOUT: %z: %empty_struct_type = value_binding z, %z.param // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param2 @@ -3416,7 +3416,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %.1: type = specific_constant , @J2.WithSelf.F(constants.%J2.facet.6c9) [concrete = ] // CHECK:STDOUT: %.2: type = specific_constant , @J2.WithSelf.F(constants.%J2.facet.6c9) [concrete = ] -// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.decl.loc23_33.2: %empty_tuple.type.as.J2.impl.F.type.56bdaf.2 = fn_decl @empty_tuple.type.as.J2.impl.F.loc23_33.2 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.2] { +// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.decl.loc23_40.2: %empty_tuple.type.as.J2.impl.F.type.56bdaf.2 = fn_decl @empty_tuple.type.as.J2.impl.F.loc23_40.2 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.2] { // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = value_binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: %.param_patt: = value_param_pattern , call_param1 [concrete] @@ -3425,17 +3425,17 @@ fn F() { // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param // CHECK:STDOUT: %.param: = value_param call_param1 // CHECK:STDOUT: } -// CHECK:STDOUT: %J2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.J2.impl.F.decl.loc23_33.2), @empty_tuple.type.as.J2.impl [concrete] +// CHECK:STDOUT: %J2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.J2.impl.F.decl.loc23_40.2), @empty_tuple.type.as.J2.impl [concrete] // CHECK:STDOUT: %J2.impl_witness: = impl_witness %J2.impl_witness_table [concrete = constants.%J2.impl_witness.941] // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %empty_tuple.type.as.J2.impl.F.decl.loc23_33.1 +// CHECK:STDOUT: .F = %empty_tuple.type.as.J2.impl.F.decl.loc23_40.1 // CHECK:STDOUT: witness = %J2.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @C2.as.J2.impl: %C2.ref.loc31_6 as %.loc31_15 { -// CHECK:STDOUT: %C2.as.J2.impl.F.decl.loc32_33.1: %C2.as.J2.impl.F.type.d2a210.1 = fn_decl @C2.as.J2.impl.F.loc32_33.1 [concrete = constants.%C2.as.J2.impl.F.720bb2.1] { +// CHECK:STDOUT: %C2.as.J2.impl.F.decl.loc32_40.1: %C2.as.J2.impl.F.type.d2a210.1 = fn_decl @C2.as.J2.impl.F.loc32_40.1 [concrete = constants.%C2.as.J2.impl.F.720bb2.1] { // CHECK:STDOUT: %self.patt: %pattern_type.8df = value_binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: %pattern_type.8df = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: %z.patt: %pattern_type.8df = value_binding_pattern z [concrete] @@ -3443,20 +3443,20 @@ fn F() { // CHECK:STDOUT: %return.patt: %pattern_type.8df = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.8df = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C2.ref.loc32_30: type = name_ref C2, file.%C2.decl [concrete = constants.%C2] -// CHECK:STDOUT: %.loc32_30: Core.Form = init_form %C2.ref.loc32_30, call_param2 [concrete = constants.%.704] +// CHECK:STDOUT: %C2.ref.loc32_37: type = name_ref C2, file.%C2.decl [concrete = constants.%C2] +// CHECK:STDOUT: %.loc32_37: Core.Form = init_form %C2.ref.loc32_37, call_param2 [concrete = constants.%.704] // CHECK:STDOUT: %self.param: %C2 = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C2.as.J2.impl.%C2.ref.loc31_6 [concrete = constants.%C2] // CHECK:STDOUT: %self: %C2 = value_binding self, %self.param // CHECK:STDOUT: %z.param: %C2 = value_param call_param1 -// CHECK:STDOUT: %C2.ref.loc32_23: type = name_ref C2, file.%C2.decl [concrete = constants.%C2] +// CHECK:STDOUT: %C2.ref.loc32_30: type = name_ref C2, file.%C2.decl [concrete = constants.%C2] // CHECK:STDOUT: %z: %C2 = value_binding z, %z.param // CHECK:STDOUT: %return.param: ref %C2 = out_param call_param2 // CHECK:STDOUT: %return: ref %C2 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %.1: type = specific_constant , @J2.WithSelf.F(constants.%J2.facet.f19) [concrete = ] // CHECK:STDOUT: %.2: type = specific_constant , @J2.WithSelf.F(constants.%J2.facet.f19) [concrete = ] -// CHECK:STDOUT: %C2.as.J2.impl.F.decl.loc32_33.2: %C2.as.J2.impl.F.type.d2a210.2 = fn_decl @C2.as.J2.impl.F.loc32_33.2 [concrete = constants.%C2.as.J2.impl.F.720bb2.2] { +// CHECK:STDOUT: %C2.as.J2.impl.F.decl.loc32_40.2: %C2.as.J2.impl.F.type.d2a210.2 = fn_decl @C2.as.J2.impl.F.loc32_40.2 [concrete = constants.%C2.as.J2.impl.F.720bb2.2] { // CHECK:STDOUT: %self.patt: %pattern_type.8df = value_binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: %pattern_type.8df = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: %.param_patt: = value_param_pattern , call_param1 [concrete] @@ -3465,13 +3465,13 @@ fn F() { // CHECK:STDOUT: %self: %C2 = value_binding self, %self.param // CHECK:STDOUT: %.param: = value_param call_param1 // CHECK:STDOUT: } -// CHECK:STDOUT: %J2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %C2.as.J2.impl.F.decl.loc32_33.2), @C2.as.J2.impl [concrete] +// CHECK:STDOUT: %J2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %C2.as.J2.impl.F.decl.loc32_40.2), @C2.as.J2.impl [concrete] // CHECK:STDOUT: %J2.impl_witness: = impl_witness %J2.impl_witness_table [concrete = constants.%J2.impl_witness.30f] // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C2 [concrete = constants.%C2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C2 = -// CHECK:STDOUT: .F = %C2.as.J2.impl.F.decl.loc32_33.1 +// CHECK:STDOUT: .F = %C2.as.J2.impl.F.decl.loc32_40.1 // CHECK:STDOUT: witness = %J2.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3494,17 +3494,17 @@ fn F() { // CHECK:STDOUT: fn(%self.param: @J2.WithSelf.F.%Self.binding.as_type (%Self.binding.as_type), %z.param: ) -> ; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @empty_tuple.type.as.J2.impl.F.loc23_33.1(%self.param: %empty_tuple.type, %z.param: %empty_struct_type) -> out %return.param: %empty_struct_type { +// CHECK:STDOUT: fn @empty_tuple.type.as.J2.impl.F.loc23_40.1(%self.param: %empty_tuple.type, %z.param: %empty_struct_type) -> out %return.param: %empty_struct_type { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %z.ref: %empty_struct_type = name_ref z, %z -// CHECK:STDOUT: %.loc23_42: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc23_43: init %empty_struct_type = converted %z.ref, %.loc23_42 [concrete = constants.%empty_struct] -// CHECK:STDOUT: return %.loc23_43 +// CHECK:STDOUT: %.loc23_49: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc23_50: init %empty_struct_type = converted %z.ref, %.loc23_49 [concrete = constants.%empty_struct] +// CHECK:STDOUT: return %.loc23_50 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @empty_tuple.type.as.J2.impl.F.loc23_33.2(%self.param: %empty_tuple.type, %.param: ) -> [thunk @empty_tuple.type.as.J2.impl.%empty_tuple.type.as.J2.impl.F.decl.loc23_33.1] { +// CHECK:STDOUT: fn @empty_tuple.type.as.J2.impl.F.loc23_40.2(%self.param: %empty_tuple.type, %.param: ) -> [thunk @empty_tuple.type.as.J2.impl.%empty_tuple.type.as.J2.impl.F.decl.loc23_40.1] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1 = name_ref F, @empty_tuple.type.as.J2.impl.%empty_tuple.type.as.J2.impl.F.decl.loc23_33.1 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.1] +// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1 = name_ref F, @empty_tuple.type.as.J2.impl.%empty_tuple.type.as.J2.impl.F.decl.loc23_40.1 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.1] // CHECK:STDOUT: %self.ref: %empty_tuple.type = name_ref self, %self.param // CHECK:STDOUT: %.ref: = name_ref , %.param // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.bound: = bound_method %self.ref, %F.ref @@ -3512,19 +3512,19 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @C2.as.J2.impl.F.loc32_33.1(%self.param: %C2, %z.param: %C2) -> out %return.param: %C2 { +// CHECK:STDOUT: fn @C2.as.J2.impl.F.loc32_40.1(%self.param: %C2, %z.param: %C2) -> out %return.param: %C2 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %C2 = name_ref self, %self -// CHECK:STDOUT: %.loc32_46.1: %empty_struct_type = as_compatible %self.ref -// CHECK:STDOUT: %.loc32_46.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc32_46.3: init %C2 = as_compatible %.loc32_46.2 [concrete = constants.%C2.val] -// CHECK:STDOUT: %.loc32_46.4: init %C2 = converted %self.ref, %.loc32_46.3 [concrete = constants.%C2.val] -// CHECK:STDOUT: return %.loc32_46.4 +// CHECK:STDOUT: %.loc32_53.1: %empty_struct_type = as_compatible %self.ref +// CHECK:STDOUT: %.loc32_53.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc32_53.3: init %C2 = as_compatible %.loc32_53.2 [concrete = constants.%C2.val] +// CHECK:STDOUT: %.loc32_53.4: init %C2 = converted %self.ref, %.loc32_53.3 [concrete = constants.%C2.val] +// CHECK:STDOUT: return %.loc32_53.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @C2.as.J2.impl.F.loc32_33.2(%self.param: %C2, %.param: ) -> [thunk @C2.as.J2.impl.%C2.as.J2.impl.F.decl.loc32_33.1] { +// CHECK:STDOUT: fn @C2.as.J2.impl.F.loc32_40.2(%self.param: %C2, %.param: ) -> [thunk @C2.as.J2.impl.%C2.as.J2.impl.F.decl.loc32_40.1] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %C2.as.J2.impl.F.type.d2a210.1 = name_ref F, @C2.as.J2.impl.%C2.as.J2.impl.F.decl.loc32_33.1 [concrete = constants.%C2.as.J2.impl.F.720bb2.1] +// CHECK:STDOUT: %F.ref: %C2.as.J2.impl.F.type.d2a210.1 = name_ref F, @C2.as.J2.impl.%C2.as.J2.impl.F.decl.loc32_40.1 [concrete = constants.%C2.as.J2.impl.F.720bb2.1] // CHECK:STDOUT: %self.ref: %C2 = name_ref self, %self.param // CHECK:STDOUT: %.ref: = name_ref , %.param // CHECK:STDOUT: %C2.as.J2.impl.F.bound: = bound_method %self.ref, %F.ref @@ -3609,14 +3609,14 @@ fn F() { // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete] // CHECK:STDOUT: %pattern_type.414: type = pattern_type %struct_type.x [concrete] // CHECK:STDOUT: %.bdc: Core.Form = init_form %struct_type.x, call_param2 [concrete] -// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.type.1710d5.1: type = fn_type @empty_tuple.type.as.K.impl.F.loc26_45.1 [concrete] +// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.type.1710d5.1: type = fn_type @empty_tuple.type.as.K.impl.F.loc26_52.1 [concrete] // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.907e52.1: %empty_tuple.type.as.K.impl.F.type.1710d5.1 = struct_value () [concrete] // CHECK:STDOUT: %K.facet: %K.type = facet_value %empty_tuple.type, (%K.impl_witness) [concrete] // CHECK:STDOUT: %K.WithSelf.F.type.aac: type = fn_type @K.WithSelf.F, @K(%K.facet) [concrete] // CHECK:STDOUT: %K.WithSelf.F.e22: %K.WithSelf.F.type.aac = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.e85: type = pattern_type %struct_type.a [concrete] // CHECK:STDOUT: %.074: Core.Form = init_form %struct_type.a, call_param2 [concrete] -// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.type.1710d5.2: type = fn_type @empty_tuple.type.as.K.impl.F.loc26_45.2 [concrete] +// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.type.1710d5.2: type = fn_type @empty_tuple.type.as.K.impl.F.loc26_52.2 [concrete] // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.907e52.2: %empty_tuple.type.as.K.impl.F.type.1710d5.2 = struct_value () [concrete] // CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] @@ -3707,7 +3707,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_tuple.type.as.K.impl: %.loc11_7.2 as %.loc11_14 { -// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.decl.loc26_45.1: %empty_tuple.type.as.K.impl.F.type.1710d5.1 = fn_decl @empty_tuple.type.as.K.impl.F.loc26_45.1 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.1] { +// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.decl.loc26_52.1: %empty_tuple.type.as.K.impl.F.type.1710d5.1 = fn_decl @empty_tuple.type.as.K.impl.F.loc26_52.1 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.1] { // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = value_binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: %v.patt: %pattern_type.414 = value_binding_pattern v [concrete] @@ -3715,18 +3715,18 @@ fn F() { // CHECK:STDOUT: %return.patt: %pattern_type.414 = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.414 = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc26_42.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc26_42.2: type = converted %.loc26_42.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %struct_type.x.loc26_43: type = struct_type {.x: %empty_tuple.type} [concrete = constants.%struct_type.x] -// CHECK:STDOUT: %.loc26_43: Core.Form = init_form %struct_type.x.loc26_43, call_param2 [concrete = constants.%.bdc] +// CHECK:STDOUT: %.loc26_49.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc26_49.2: type = converted %.loc26_49.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %struct_type.x.loc26_50: type = struct_type {.x: %empty_tuple.type} [concrete = constants.%struct_type.x] +// CHECK:STDOUT: %.loc26_50: Core.Form = init_form %struct_type.x.loc26_50, call_param2 [concrete = constants.%.bdc] // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.K.impl.%.loc11_7.2 [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param // CHECK:STDOUT: %v.param: %struct_type.x = value_param call_param1 -// CHECK:STDOUT: %.loc26_30: type = splice_block %struct_type.x.loc26_30 [concrete = constants.%struct_type.x] { -// CHECK:STDOUT: %.loc26_29.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc26_29.2: type = converted %.loc26_29.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %struct_type.x.loc26_30: type = struct_type {.x: %empty_tuple.type} [concrete = constants.%struct_type.x] +// CHECK:STDOUT: %.loc26_37: type = splice_block %struct_type.x.loc26_37 [concrete = constants.%struct_type.x] { +// CHECK:STDOUT: %.loc26_36.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc26_36.2: type = converted %.loc26_36.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %struct_type.x.loc26_37: type = struct_type {.x: %empty_tuple.type} [concrete = constants.%struct_type.x] // CHECK:STDOUT: } // CHECK:STDOUT: %v: %struct_type.x = value_binding v, %v.param // CHECK:STDOUT: %return.param: ref %struct_type.x = out_param call_param2 @@ -3734,7 +3734,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8_29.1: type = specific_constant @K.WithSelf.F.%V.ref.loc8_29, @K.WithSelf.F(constants.%K.facet) [concrete = constants.%struct_type.a] // CHECK:STDOUT: %.loc8_29.2: type = specific_constant @K.WithSelf.F.%.loc8_29.2, @K.WithSelf.F(constants.%K.facet) [concrete = constants.%.074] -// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.decl.loc26_45.2: %empty_tuple.type.as.K.impl.F.type.1710d5.2 = fn_decl @empty_tuple.type.as.K.impl.F.loc26_45.2 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.2] { +// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.decl.loc26_52.2: %empty_tuple.type.as.K.impl.F.type.1710d5.2 = fn_decl @empty_tuple.type.as.K.impl.F.loc26_52.2 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.2] { // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = value_binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: %v.patt: %pattern_type.e85 = value_binding_pattern v [concrete] @@ -3749,12 +3749,12 @@ fn F() { // CHECK:STDOUT: %return.param: ref %struct_type.a = out_param call_param2 // CHECK:STDOUT: %return: ref %struct_type.a = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %K.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.K.impl.F.decl.loc26_45.2), @empty_tuple.type.as.K.impl [concrete] +// CHECK:STDOUT: %K.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.K.impl.F.decl.loc26_52.2), @empty_tuple.type.as.K.impl [concrete] // CHECK:STDOUT: %K.impl_witness: = impl_witness %K.impl_witness_table [concrete = constants.%K.impl_witness] // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%struct_type.a [concrete = constants.%struct_type.a] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %empty_tuple.type.as.K.impl.F.decl.loc26_45.1 +// CHECK:STDOUT: .F = %empty_tuple.type.as.K.impl.F.decl.loc26_52.1 // CHECK:STDOUT: witness = %K.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3770,29 +3770,29 @@ fn F() { // CHECK:STDOUT: fn(%self.param: @K.WithSelf.F.%Self.binding.as_type (%Self.binding.as_type.87a), %v.param: @K.WithSelf.F.%impl.elem0.loc8_23.1 (%impl.elem0.c23)) -> out %return.param: @K.WithSelf.F.%impl.elem0.loc8_23.1 (%impl.elem0.c23); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @empty_tuple.type.as.K.impl.F.loc26_45.1(%self.param: %empty_tuple.type, %v.param: %struct_type.x) -> out %return.param: %struct_type.x { +// CHECK:STDOUT: fn @empty_tuple.type.as.K.impl.F.loc26_52.1(%self.param: %empty_tuple.type, %v.param: %struct_type.x) -> out %return.param: %struct_type.x { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %v.ref: %struct_type.x = name_ref v, %v -// CHECK:STDOUT: %.loc26_54.1: %empty_tuple.type = struct_access %v.ref, element0 -// CHECK:STDOUT: %.loc26_54.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc26_54.3: init %empty_tuple.type = converted %.loc26_54.1, %.loc26_54.2 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc26_54.4: init %struct_type.x = struct_init (%.loc26_54.3) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc26_55: init %struct_type.x = converted %v.ref, %.loc26_54.4 [concrete = constants.%struct] -// CHECK:STDOUT: return %.loc26_55 +// CHECK:STDOUT: %.loc26_61.1: %empty_tuple.type = struct_access %v.ref, element0 +// CHECK:STDOUT: %.loc26_61.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc26_61.3: init %empty_tuple.type = converted %.loc26_61.1, %.loc26_61.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc26_61.4: init %struct_type.x = struct_init (%.loc26_61.3) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc26_62: init %struct_type.x = converted %v.ref, %.loc26_61.4 [concrete = constants.%struct] +// CHECK:STDOUT: return %.loc26_62 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @empty_tuple.type.as.K.impl.F.loc26_45.2(%self.param: %empty_tuple.type, %v.param: %struct_type.a) -> out %return.param: %struct_type.a [thunk @empty_tuple.type.as.K.impl.%empty_tuple.type.as.K.impl.F.decl.loc26_45.1] { +// CHECK:STDOUT: fn @empty_tuple.type.as.K.impl.F.loc26_52.2(%self.param: %empty_tuple.type, %v.param: %struct_type.a) -> out %return.param: %struct_type.a [thunk @empty_tuple.type.as.K.impl.%empty_tuple.type.as.K.impl.F.decl.loc26_52.1] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.K.impl.F.type.1710d5.1 = name_ref F, @empty_tuple.type.as.K.impl.%empty_tuple.type.as.K.impl.F.decl.loc26_45.1 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.1] +// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.K.impl.F.type.1710d5.1 = name_ref F, @empty_tuple.type.as.K.impl.%empty_tuple.type.as.K.impl.F.decl.loc26_52.1 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.1] // CHECK:STDOUT: %self.ref: %empty_tuple.type = name_ref self, %self.param // CHECK:STDOUT: %v.ref: %struct_type.a = name_ref v, %v.param // CHECK:STDOUT: %return.ref: ref %struct_type.a = name_ref , %return.param // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.bound: = bound_method %self.ref, %F.ref // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.call: init %struct_type.x = call %empty_tuple.type.as.K.impl.F.bound(%self.ref, ) -// CHECK:STDOUT: %.loc26_45.1: ref %struct_type.x = temporary_storage -// CHECK:STDOUT: %.loc26_45.2: ref %struct_type.x = temporary %.loc26_45.1, %empty_tuple.type.as.K.impl.F.call -// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc26_45.2, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc26_45.2) +// CHECK:STDOUT: %.loc26_52.1: ref %struct_type.x = temporary_storage +// CHECK:STDOUT: %.loc26_52.2: ref %struct_type.x = temporary %.loc26_52.1, %empty_tuple.type.as.K.impl.F.call +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc26_52.2, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc26_52.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4505,10 +4505,10 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc9_31.1: type = value_of_initializer %Bool.call [concrete = bool] -// CHECK:STDOUT: %.loc9_31.2: type = converted %Bool.call, %.loc9_31.1 [concrete = bool] -// CHECK:STDOUT: %array_type: type = array_type %int_2, %.loc9_31.2 [concrete = constants.%array_type.c9b] -// CHECK:STDOUT: %.loc9_38: Core.Form = init_form %array_type, call_param1 [concrete = constants.%.d10] +// CHECK:STDOUT: %.loc9_38.1: type = value_of_initializer %Bool.call [concrete = bool] +// CHECK:STDOUT: %.loc9_38.2: type = converted %Bool.call, %.loc9_38.1 [concrete = bool] +// CHECK:STDOUT: %array_type: type = array_type %int_2, %.loc9_38.2 [concrete = constants.%array_type.c9b] +// CHECK:STDOUT: %.loc9_45: Core.Form = init_form %array_type, call_param1 [concrete = constants.%.d10] // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.I.impl.%.loc8_7.2 [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param @@ -4544,22 +4544,22 @@ fn F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true] // CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: %.loc9_61.1: %tuple.type.784 = tuple_literal (%true, %false) [concrete = constants.%tuple.a9a] -// CHECK:STDOUT: %impl.elem0.loc9_50: %.86d = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op] -// CHECK:STDOUT: %bound_method.loc9_50: = bound_method %true, %impl.elem0.loc9_50 [concrete = constants.%bool.as.Copy.impl.Op.bound.12b] -// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc9_50: init bool = call %bound_method.loc9_50(%true) [concrete = constants.%true] +// CHECK:STDOUT: %.loc9_68.1: %tuple.type.784 = tuple_literal (%true, %false) [concrete = constants.%tuple.a9a] +// CHECK:STDOUT: %impl.elem0.loc9_57: %.86d = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc9_57: = bound_method %true, %impl.elem0.loc9_57 [concrete = constants.%bool.as.Copy.impl.Op.bound.12b] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc9_57: init bool = call %bound_method.loc9_57(%true) [concrete = constants.%true] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc9_61.2: ref bool = array_index %return.param, %int_0 -// CHECK:STDOUT: %.loc9_61.3: init bool to %.loc9_61.2 = in_place_init %bool.as.Copy.impl.Op.call.loc9_50 [concrete = constants.%true] -// CHECK:STDOUT: %impl.elem0.loc9_56: %.86d = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op] -// CHECK:STDOUT: %bound_method.loc9_56: = bound_method %false, %impl.elem0.loc9_56 [concrete = constants.%bool.as.Copy.impl.Op.bound.082] -// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc9_56: init bool = call %bound_method.loc9_56(%false) [concrete = constants.%false] +// CHECK:STDOUT: %.loc9_68.2: ref bool = array_index %return.param, %int_0 +// CHECK:STDOUT: %.loc9_68.3: init bool to %.loc9_68.2 = in_place_init %bool.as.Copy.impl.Op.call.loc9_57 [concrete = constants.%true] +// CHECK:STDOUT: %impl.elem0.loc9_63: %.86d = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op] +// CHECK:STDOUT: %bound_method.loc9_63: = bound_method %false, %impl.elem0.loc9_63 [concrete = constants.%bool.as.Copy.impl.Op.bound.082] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc9_63: init bool = call %bound_method.loc9_63(%false) [concrete = constants.%false] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] -// CHECK:STDOUT: %.loc9_61.4: ref bool = array_index %return.param, %int_1 -// CHECK:STDOUT: %.loc9_61.5: init bool to %.loc9_61.4 = in_place_init %bool.as.Copy.impl.Op.call.loc9_56 [concrete = constants.%false] -// CHECK:STDOUT: %.loc9_61.6: init %array_type.c9b to %return.param = array_init (%.loc9_61.3, %.loc9_61.5) [concrete = constants.%array] -// CHECK:STDOUT: %.loc9_62: init %array_type.c9b = converted %.loc9_61.1, %.loc9_61.6 [concrete = constants.%array] -// CHECK:STDOUT: return %.loc9_62 to %return.param +// CHECK:STDOUT: %.loc9_68.4: ref bool = array_index %return.param, %int_1 +// CHECK:STDOUT: %.loc9_68.5: init bool to %.loc9_68.4 = in_place_init %bool.as.Copy.impl.Op.call.loc9_63 [concrete = constants.%false] +// CHECK:STDOUT: %.loc9_68.6: init %array_type.c9b to %return.param = array_init (%.loc9_68.3, %.loc9_68.5) [concrete = constants.%array] +// CHECK:STDOUT: %.loc9_69: init %array_type.c9b = converted %.loc9_68.1, %.loc9_68.6 [concrete = constants.%array] +// CHECK:STDOUT: return %.loc9_69 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%Self.ab9) { @@ -4765,26 +4765,26 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.a7e = value_binding_pattern a [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc12_21.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc12_28.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] -// CHECK:STDOUT: %D.ref.loc12_28: type = name_ref D, file.%D.decl [concrete = constants.%D] +// CHECK:STDOUT: %D.ref.loc12_35: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%D) [concrete = constants.%C.302] -// CHECK:STDOUT: %.loc12_21.2: ref %C.302 = temporary_storage -// CHECK:STDOUT: %.loc12_21.3: init %C.302 to %.loc12_21.2 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc12_21.4: ref %C.302 = temporary %.loc12_21.2, %.loc12_21.3 -// CHECK:STDOUT: %.loc12_23.1: ref %C.302 = converted %.loc12_21.1, %.loc12_21.4 -// CHECK:STDOUT: %.loc12_11.1: type = splice_block %impl.elem0 [concrete = constants.%C.302] { -// CHECK:STDOUT: %D.ref.loc12_10: type = name_ref D, file.%D.decl [concrete = constants.%D] +// CHECK:STDOUT: %.loc12_28.2: ref %C.302 = temporary_storage +// CHECK:STDOUT: %.loc12_28.3: init %C.302 to %.loc12_28.2 = class_init () [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc12_28.4: ref %C.302 = temporary %.loc12_28.2, %.loc12_28.3 +// CHECK:STDOUT: %.loc12_30.1: ref %C.302 = converted %.loc12_28.1, %.loc12_28.4 +// CHECK:STDOUT: %.loc12_18.1: type = splice_block %impl.elem0 [concrete = constants.%C.302] { +// CHECK:STDOUT: %D.ref.loc12_17: type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type] // CHECK:STDOUT: %X.ref: %Z.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.cdf] -// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %D.ref.loc12_10, (constants.%Z.impl_witness.63b) [concrete = constants.%Z.facet.59e] -// CHECK:STDOUT: %.loc12_11.2: %Z.type = converted %D.ref.loc12_10, %Z.facet [concrete = constants.%Z.facet.59e] +// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %D.ref.loc12_17, (constants.%Z.impl_witness.63b) [concrete = constants.%Z.facet.59e] +// CHECK:STDOUT: %.loc12_18.2: %Z.type = converted %D.ref.loc12_17, %Z.facet [concrete = constants.%Z.facet.59e] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%Z.impl_witness.63b, element0 [concrete = constants.%C.302] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc12_23.2: %C.302 = acquire_value %.loc12_23.1 -// CHECK:STDOUT: %a: %C.302 = value_binding a, %.loc12_23.2 -// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc12_21.4, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc12_21.4) +// CHECK:STDOUT: %.loc12_30.2: %C.302 = acquire_value %.loc12_30.1 +// CHECK:STDOUT: %a: %C.302 = value_binding a, %.loc12_30.2 +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc12_28.4, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc12_28.4) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/using_invalid_interface.carbon b/toolchain/check/testdata/impl/using_invalid_interface.carbon index 67000a125f49..4825454e517d 100644 --- a/toolchain/check/testdata/impl/using_invalid_interface.carbon +++ b/toolchain/check/testdata/impl/using_invalid_interface.carbon @@ -40,11 +40,11 @@ class C { // CHECK:STDERR: ^ // CHECK:STDERR: impl as IMisuse where .Arg = T { - // CHECK:STDERR: fail_misusing_invalid_interface.carbon:[[@LINE+4]]:35: error: name `T` not found [NameNotFound] - // CHECK:STDERR: fn Op[self: Self]() -> ArgToI(T) { - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_misusing_invalid_interface.carbon:[[@LINE+4]]:42: error: name `T` not found [NameNotFound] + // CHECK:STDERR: fn Op[unused self: Self]() -> ArgToI(T) { + // CHECK:STDERR: ^ // CHECK:STDERR: - fn Op[self: Self]() -> ArgToI(T) { + fn Op[unused self: Self]() -> ArgToI(T) { return {}; } } @@ -84,15 +84,15 @@ class ArgC {} class C { impl as IMisuse where .Arg = ArgC { - // CHECK:STDERR: fail_using_invalid_interface.carbon:[[@LINE+8]]:28: error: cannot convert type `ArgC` into type implementing `I` [ConversionFailureTypeToFacet] - // CHECK:STDERR: fn Op[self: Self]() -> ArgToI(ArgC) { - // CHECK:STDERR: ^~~~~~~~~~~~ + // CHECK:STDERR: fail_using_invalid_interface.carbon:[[@LINE+8]]:35: error: cannot convert type `ArgC` into type implementing `I` [ConversionFailureTypeToFacet] + // CHECK:STDERR: fn Op[unused self: Self]() -> ArgToI(ArgC) { + // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fail_using_invalid_interface.carbon:[[@LINE-9]]:1: in import [InImport] // CHECK:STDERR: fail_invalid_interface.carbon:5:14: note: initializing generic parameter `T` declared here [InitializingGenericParam] // CHECK:STDERR: class ArgToI(T:! I) {} // CHECK:STDERR: ^ // CHECK:STDERR: - fn Op[self: Self]() -> ArgToI(ArgC) { + fn Op[unused self: Self]() -> ArgToI(ArgC) { return {}; } } diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index 63db7042d0a4..c721c0d348f3 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -14,11 +14,11 @@ fn F() -> array(i32, 3); -fn G(b: array(i32, 3)) { +fn G(unused b: array(i32, 3)) { var a: array(i32, 3) = (1, 2, 3); // Indexing a durable array reference gives a durable reference. - var pa: i32* = &a[0]; + var unused pa: i32* = &a[0]; a[0] = 4; } @@ -229,27 +229,27 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %pa.var: ref %ptr.235 = var %pa.var_patt // CHECK:STDOUT: %a.ref.loc21: ref %array_type = name_ref a, %a // CHECK:STDOUT: %int_0.loc21: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] -// CHECK:STDOUT: %int_32.loc21_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc21_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc21_21: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc21_21.1: = bound_method %int_0.loc21, %impl.elem0.loc21_21 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.897] -// CHECK:STDOUT: %specific_fn.loc21_21: = specific_function %impl.elem0.loc21_21, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc21_21.2: = bound_method %int_0.loc21, %specific_fn.loc21_21 [concrete = constants.%bound_method.d2e] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21: init %i32 = call %bound_method.loc21_21.2(%int_0.loc21) [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc21_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21 [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc21_21.2: %i32 = converted %int_0.loc21, %.loc21_21.1 [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc21_22: ref %i32 = array_index %a.ref.loc21, %.loc21_21.2 -// CHECK:STDOUT: %addr: %ptr.235 = addr_of %.loc21_22 -// CHECK:STDOUT: %impl.elem0.loc21_18: %.a62 = impl_witness_access constants.%Copy.impl_witness.843, element0 [concrete = constants.%ptr.as.Copy.impl.Op.011] -// CHECK:STDOUT: %bound_method.loc21_18.1: = bound_method %addr, %impl.elem0.loc21_18 -// CHECK:STDOUT: %specific_fn.loc21_18: = specific_function %impl.elem0.loc21_18, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc21_18.2: = bound_method %addr, %specific_fn.loc21_18 -// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.235 = call %bound_method.loc21_18.2(%addr) +// CHECK:STDOUT: %int_32.loc21_29: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc21_29: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc21_28: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc21_28.1: = bound_method %int_0.loc21, %impl.elem0.loc21_28 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.897] +// CHECK:STDOUT: %specific_fn.loc21_28: = specific_function %impl.elem0.loc21_28, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_28.2: = bound_method %int_0.loc21, %specific_fn.loc21_28 [concrete = constants.%bound_method.d2e] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21: init %i32 = call %bound_method.loc21_28.2(%int_0.loc21) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc21_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc21_28.2: %i32 = converted %int_0.loc21, %.loc21_28.1 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc21_29: ref %i32 = array_index %a.ref.loc21, %.loc21_28.2 +// CHECK:STDOUT: %addr: %ptr.235 = addr_of %.loc21_29 +// CHECK:STDOUT: %impl.elem0.loc21_25: %.a62 = impl_witness_access constants.%Copy.impl_witness.843, element0 [concrete = constants.%ptr.as.Copy.impl.Op.011] +// CHECK:STDOUT: %bound_method.loc21_25.1: = bound_method %addr, %impl.elem0.loc21_25 +// CHECK:STDOUT: %specific_fn.loc21_25: = specific_function %impl.elem0.loc21_25, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_25.2: = bound_method %addr, %specific_fn.loc21_25 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.235 = call %bound_method.loc21_25.2(%addr) // CHECK:STDOUT: assign %pa.var, %ptr.as.Copy.impl.Op.call -// CHECK:STDOUT: %.loc21_14: type = splice_block %ptr [concrete = constants.%ptr.235] { -// CHECK:STDOUT: %int_32.loc21_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc21_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32.loc21_11 [concrete = constants.%ptr.235] +// CHECK:STDOUT: %.loc21_21: type = splice_block %ptr [concrete = constants.%ptr.235] { +// CHECK:STDOUT: %int_32.loc21_18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc21_18: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %ptr: type = ptr_type %i32.loc21_18 [concrete = constants.%ptr.235] // CHECK:STDOUT: } // CHECK:STDOUT: %pa: ref %ptr.235 = ref_binding pa, %pa.var // CHECK:STDOUT: %a.ref.loc22: ref %array_type = name_ref a, %a diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index 5199c805d17f..1902ea70c8c0 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -16,11 +16,11 @@ fn F() -> array(i32, 3); fn G(b: array(i32, 3)) { // Indexing an array value gives a value. - // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:18: error: cannot take the address of non-reference expression [AddrOfNonRef] - // CHECK:STDERR: var pb: i32* = &b[0]; - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:25: error: cannot take the address of non-reference expression [AddrOfNonRef] + // CHECK:STDERR: var unused pb: i32* = &b[0]; + // CHECK:STDERR: ^ // CHECK:STDERR: - var pb: i32* = &b[0]; + var unused pb: i32* = &b[0]; // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:3: error: expression is not assignable [AssignmentToNonAssignable] // CHECK:STDERR: b[0] = 4; // CHECK:STDERR: ^~~~ @@ -29,11 +29,11 @@ fn G(b: array(i32, 3)) { // Indexing an ephemeral reference (materialized from an initializing // expression) gives a value. - // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:18: error: cannot take the address of non-reference expression [AddrOfNonRef] - // CHECK:STDERR: var pf: i32* = &F()[0]; - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:25: error: cannot take the address of non-reference expression [AddrOfNonRef] + // CHECK:STDERR: var unused pf: i32* = &F()[0]; + // CHECK:STDERR: ^ // CHECK:STDERR: - var pf: i32* = &F()[0]; + var unused pf: i32* = &F()[0]; // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:3: error: expression is not assignable [AssignmentToNonAssignable] // CHECK:STDERR: F()[0] = 4; // CHECK:STDERR: ^~~~~~ @@ -162,29 +162,29 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: %pb.var: ref %ptr.235 = var %pb.var_patt // CHECK:STDOUT: %b.ref.loc23: %array_type = name_ref b, %b // CHECK:STDOUT: %int_0.loc23: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] -// CHECK:STDOUT: %int_32.loc23_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc23_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc23_21: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc23_21.1: = bound_method %int_0.loc23, %impl.elem0.loc23_21 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.897] -// CHECK:STDOUT: %specific_fn.loc23_21: = specific_function %impl.elem0.loc23_21, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc23_21.2: = bound_method %int_0.loc23, %specific_fn.loc23_21 [concrete = constants.%bound_method.d2e] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23: init %i32 = call %bound_method.loc23_21.2(%int_0.loc23) [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc23_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23 [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc23_21.2: %i32 = converted %int_0.loc23, %.loc23_21.1 [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc23_22.1: ref %array_type = value_as_ref %b.ref.loc23 -// CHECK:STDOUT: %.loc23_22.2: ref %i32 = array_index %.loc23_22.1, %.loc23_21.2 -// CHECK:STDOUT: %.loc23_22.3: %i32 = acquire_value %.loc23_22.2 +// CHECK:STDOUT: %int_32.loc23_29: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc23_29: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc23_28: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc23_28.1: = bound_method %int_0.loc23, %impl.elem0.loc23_28 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.897] +// CHECK:STDOUT: %specific_fn.loc23_28: = specific_function %impl.elem0.loc23_28, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc23_28.2: = bound_method %int_0.loc23, %specific_fn.loc23_28 [concrete = constants.%bound_method.d2e] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23: init %i32 = call %bound_method.loc23_28.2(%int_0.loc23) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc23_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc23_28.2: %i32 = converted %int_0.loc23, %.loc23_28.1 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc23_29.1: ref %array_type = value_as_ref %b.ref.loc23 +// CHECK:STDOUT: %.loc23_29.2: ref %i32 = array_index %.loc23_29.1, %.loc23_28.2 +// CHECK:STDOUT: %.loc23_29.3: %i32 = acquire_value %.loc23_29.2 // CHECK:STDOUT: %addr.loc23: %ptr.235 = addr_of [concrete = ] -// CHECK:STDOUT: %impl.elem0.loc23_18: %.a62 = impl_witness_access constants.%Copy.impl_witness.843, element0 [concrete = constants.%ptr.as.Copy.impl.Op.011] -// CHECK:STDOUT: %bound_method.loc23_18.1: = bound_method %addr.loc23, %impl.elem0.loc23_18 [concrete = ] -// CHECK:STDOUT: %specific_fn.loc23_18: = specific_function %impl.elem0.loc23_18, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc23_18.2: = bound_method %addr.loc23, %specific_fn.loc23_18 [concrete = ] -// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc23: init %ptr.235 = call %bound_method.loc23_18.2(%addr.loc23) [concrete = ] +// CHECK:STDOUT: %impl.elem0.loc23_25: %.a62 = impl_witness_access constants.%Copy.impl_witness.843, element0 [concrete = constants.%ptr.as.Copy.impl.Op.011] +// CHECK:STDOUT: %bound_method.loc23_25.1: = bound_method %addr.loc23, %impl.elem0.loc23_25 [concrete = ] +// CHECK:STDOUT: %specific_fn.loc23_25: = specific_function %impl.elem0.loc23_25, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc23_25.2: = bound_method %addr.loc23, %specific_fn.loc23_25 [concrete = ] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc23: init %ptr.235 = call %bound_method.loc23_25.2(%addr.loc23) [concrete = ] // CHECK:STDOUT: assign %pb.var, %ptr.as.Copy.impl.Op.call.loc23 -// CHECK:STDOUT: %.loc23_14: type = splice_block %ptr.loc23 [concrete = constants.%ptr.235] { -// CHECK:STDOUT: %int_32.loc23_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc23_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %ptr.loc23: type = ptr_type %i32.loc23_11 [concrete = constants.%ptr.235] +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr.loc23 [concrete = constants.%ptr.235] { +// CHECK:STDOUT: %int_32.loc23_18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc23_18: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %ptr.loc23: type = ptr_type %i32.loc23_18 [concrete = constants.%ptr.235] // CHECK:STDOUT: } // CHECK:STDOUT: %pb: ref %ptr.235 = ref_binding pb, %pb.var // CHECK:STDOUT: %b.ref.loc28: %array_type = name_ref b, %b @@ -215,32 +215,32 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: } // CHECK:STDOUT: %pf.var: ref %ptr.235 = var %pf.var_patt // CHECK:STDOUT: %F.ref.loc36: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %.loc36_21.1: ref %array_type = temporary_storage -// CHECK:STDOUT: %F.call.loc36: init %array_type to %.loc36_21.1 = call %F.ref.loc36() +// CHECK:STDOUT: %.loc36_28.1: ref %array_type = temporary_storage +// CHECK:STDOUT: %F.call.loc36: init %array_type to %.loc36_28.1 = call %F.ref.loc36() // CHECK:STDOUT: %int_0.loc36: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] -// CHECK:STDOUT: %.loc36_21.2: ref %array_type = temporary %.loc36_21.1, %F.call.loc36 -// CHECK:STDOUT: %int_32.loc36_24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc36_24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc36_23: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc36_23.1: = bound_method %int_0.loc36, %impl.elem0.loc36_23 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.897] -// CHECK:STDOUT: %specific_fn.loc36_23: = specific_function %impl.elem0.loc36_23, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc36_23.2: = bound_method %int_0.loc36, %specific_fn.loc36_23 [concrete = constants.%bound_method.d2e] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc36: init %i32 = call %bound_method.loc36_23.2(%int_0.loc36) [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc36_23.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc36 [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc36_23.2: %i32 = converted %int_0.loc36, %.loc36_23.1 [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc36_24.1: ref %i32 = array_index %.loc36_21.2, %.loc36_23.2 -// CHECK:STDOUT: %.loc36_24.2: %i32 = acquire_value %.loc36_24.1 +// CHECK:STDOUT: %.loc36_28.2: ref %array_type = temporary %.loc36_28.1, %F.call.loc36 +// CHECK:STDOUT: %int_32.loc36_31: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc36_31: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc36_30: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc36_30.1: = bound_method %int_0.loc36, %impl.elem0.loc36_30 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.897] +// CHECK:STDOUT: %specific_fn.loc36_30: = specific_function %impl.elem0.loc36_30, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc36_30.2: = bound_method %int_0.loc36, %specific_fn.loc36_30 [concrete = constants.%bound_method.d2e] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc36: init %i32 = call %bound_method.loc36_30.2(%int_0.loc36) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc36_30.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc36 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc36_30.2: %i32 = converted %int_0.loc36, %.loc36_30.1 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc36_31.1: ref %i32 = array_index %.loc36_28.2, %.loc36_30.2 +// CHECK:STDOUT: %.loc36_31.2: %i32 = acquire_value %.loc36_31.1 // CHECK:STDOUT: %addr.loc36: %ptr.235 = addr_of [concrete = ] -// CHECK:STDOUT: %impl.elem0.loc36_18: %.a62 = impl_witness_access constants.%Copy.impl_witness.843, element0 [concrete = constants.%ptr.as.Copy.impl.Op.011] -// CHECK:STDOUT: %bound_method.loc36_18.1: = bound_method %addr.loc36, %impl.elem0.loc36_18 [concrete = ] -// CHECK:STDOUT: %specific_fn.loc36_18: = specific_function %impl.elem0.loc36_18, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc36_18.2: = bound_method %addr.loc36, %specific_fn.loc36_18 [concrete = ] -// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc36: init %ptr.235 = call %bound_method.loc36_18.2(%addr.loc36) [concrete = ] +// CHECK:STDOUT: %impl.elem0.loc36_25: %.a62 = impl_witness_access constants.%Copy.impl_witness.843, element0 [concrete = constants.%ptr.as.Copy.impl.Op.011] +// CHECK:STDOUT: %bound_method.loc36_25.1: = bound_method %addr.loc36, %impl.elem0.loc36_25 [concrete = ] +// CHECK:STDOUT: %specific_fn.loc36_25: = specific_function %impl.elem0.loc36_25, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc36_25.2: = bound_method %addr.loc36, %specific_fn.loc36_25 [concrete = ] +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc36: init %ptr.235 = call %bound_method.loc36_25.2(%addr.loc36) [concrete = ] // CHECK:STDOUT: assign %pf.var, %ptr.as.Copy.impl.Op.call.loc36 -// CHECK:STDOUT: %.loc36_14: type = splice_block %ptr.loc36 [concrete = constants.%ptr.235] { -// CHECK:STDOUT: %int_32.loc36_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc36_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %ptr.loc36: type = ptr_type %i32.loc36_11 [concrete = constants.%ptr.235] +// CHECK:STDOUT: %.loc36_21: type = splice_block %ptr.loc36 [concrete = constants.%ptr.235] { +// CHECK:STDOUT: %int_32.loc36_18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc36_18: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %ptr.loc36: type = ptr_type %i32.loc36_18 [concrete = constants.%ptr.235] // CHECK:STDOUT: } // CHECK:STDOUT: %pf: ref %ptr.235 = ref_binding pf, %pf.var // CHECK:STDOUT: %F.ref.loc41: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] @@ -269,8 +269,8 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: assign %.loc41_8.2, %.loc41_10 // CHECK:STDOUT: %DestroyOp.bound.loc41: = bound_method %.loc41_5.2, constants.%DestroyOp.b0ebf8.1 // CHECK:STDOUT: %DestroyOp.call.loc41: init %empty_tuple.type = call %DestroyOp.bound.loc41(%.loc41_5.2) -// CHECK:STDOUT: %DestroyOp.bound.loc36_21: = bound_method %.loc36_21.2, constants.%DestroyOp.b0ebf8.1 -// CHECK:STDOUT: %DestroyOp.call.loc36_21: init %empty_tuple.type = call %DestroyOp.bound.loc36_21(%.loc36_21.2) +// CHECK:STDOUT: %DestroyOp.bound.loc36_28: = bound_method %.loc36_28.2, constants.%DestroyOp.b0ebf8.1 +// CHECK:STDOUT: %DestroyOp.call.loc36_28: init %empty_tuple.type = call %DestroyOp.bound.loc36_28(%.loc36_28.2) // CHECK:STDOUT: %DestroyOp.bound.loc36_3: = bound_method %pf.var, constants.%DestroyOp.b0ebf8.2 // CHECK:STDOUT: %DestroyOp.call.loc36_3: init %empty_tuple.type = call %DestroyOp.bound.loc36_3(%pf.var) // CHECK:STDOUT: %DestroyOp.bound.loc23: = bound_method %pb.var, constants.%DestroyOp.b0ebf8.2 diff --git a/toolchain/check/testdata/index/fail_name_not_found.carbon b/toolchain/check/testdata/index/fail_name_not_found.carbon index 9a57a099c318..86ee7a7af2d5 100644 --- a/toolchain/check/testdata/index/fail_name_not_found.carbon +++ b/toolchain/check/testdata/index/fail_name_not_found.carbon @@ -13,11 +13,11 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_name_not_found.carbon fn Main() { - // CHECK:STDERR: fail_name_not_found.carbon:[[@LINE+4]]:16: error: name `a` not found [NameNotFound] - // CHECK:STDERR: var b: i32 = a[0]; - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_name_not_found.carbon:[[@LINE+4]]:23: error: name `a` not found [NameNotFound] + // CHECK:STDERR: var unused b: i32 = a[0]; + // CHECK:STDERR: ^ // CHECK:STDERR: - var b: i32 = a[0]; + var unused b: i32 = a[0]; } // CHECK:STDOUT: --- fail_name_not_found.carbon diff --git a/toolchain/check/testdata/interface/as_type.carbon b/toolchain/check/testdata/interface/as_type.carbon index a93c79399606..460d13652cfe 100644 --- a/toolchain/check/testdata/interface/as_type.carbon +++ b/toolchain/check/testdata/interface/as_type.carbon @@ -14,7 +14,7 @@ interface Empty {} -fn F(e: Empty) {} +fn F(unused e: Empty) {} // CHECK:STDOUT: --- as_type.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/as_type_of_type.carbon b/toolchain/check/testdata/interface/as_type_of_type.carbon index 456bca165f13..ad06e6ec9507 100644 --- a/toolchain/check/testdata/interface/as_type_of_type.carbon +++ b/toolchain/check/testdata/interface/as_type_of_type.carbon @@ -19,7 +19,7 @@ class C {} impl C as Empty {} fn F(T:! Empty) { - var x: T*; + var unused x: T*; } // CHECK:STDOUT: --- as_type_of_type.carbon @@ -118,11 +118,11 @@ fn F(T:! Empty) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc21_6.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %ptr.loc22_11.2: type = ptr_type %T.binding.as_type [symbolic = %ptr.loc22_11.2 (constants.%ptr)] -// CHECK:STDOUT: %require_complete: = require_complete_type %ptr.loc22_11.2 [symbolic = %require_complete (constants.%require_complete)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc22_11.2 [symbolic = %pattern_type (constants.%pattern_type.fd9)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %ptr.loc22_11.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %ptr.loc22_11.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet)] +// CHECK:STDOUT: %ptr.loc22_18.2: type = ptr_type %T.binding.as_type [symbolic = %ptr.loc22_18.2 (constants.%ptr)] +// CHECK:STDOUT: %require_complete: = require_complete_type %ptr.loc22_18.2 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc22_18.2 [symbolic = %pattern_type (constants.%pattern_type.fd9)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %ptr.loc22_18.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %ptr.loc22_18.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.4bc)] // CHECK:STDOUT: %.loc22_3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc22_3 (constants.%.40e)] // CHECK:STDOUT: %impl.elem0.loc22_3.2: @F.%.loc22_3 (%.40e) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_3.2 (constants.%impl.elem0)] @@ -134,14 +134,14 @@ fn F(T:! Empty) { // CHECK:STDOUT: %x.patt: @F.%pattern_type (%pattern_type.fd9) = ref_binding_pattern x [concrete] // CHECK:STDOUT: %x.var_patt: @F.%pattern_type (%pattern_type.fd9) = var_pattern %x.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %x.var: ref @F.%ptr.loc22_11.2 (%ptr) = var %x.var_patt -// CHECK:STDOUT: %.loc22_11.1: type = splice_block %ptr.loc22_11.1 [symbolic = %ptr.loc22_11.2 (constants.%ptr)] { +// CHECK:STDOUT: %x.var: ref @F.%ptr.loc22_18.2 (%ptr) = var %x.var_patt +// CHECK:STDOUT: %.loc22_18.1: type = splice_block %ptr.loc22_18.1 [symbolic = %ptr.loc22_18.2 (constants.%ptr)] { // CHECK:STDOUT: %T.ref: %Empty.type = name_ref T, %T.loc21_6.2 [symbolic = %T.loc21_6.1 (constants.%T)] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc22_11.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %ptr.loc22_11.1: type = ptr_type %.loc22_11.2 [symbolic = %ptr.loc22_11.2 (constants.%ptr)] +// CHECK:STDOUT: %.loc22_18.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %ptr.loc22_18.1: type = ptr_type %.loc22_18.2 [symbolic = %ptr.loc22_18.2 (constants.%ptr)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: ref @F.%ptr.loc22_11.2 (%ptr) = ref_binding x, %x.var +// CHECK:STDOUT: %x: ref @F.%ptr.loc22_18.2 (%ptr) = ref_binding x, %x.var // CHECK:STDOUT: %impl.elem0.loc22_3.1: @F.%.loc22_3 (%.40e) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_3.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc22_3.1: = bound_method %x.var, %impl.elem0.loc22_3.1 // CHECK:STDOUT: %specific_impl_fn.loc22_3.1: = specific_impl_function %impl.elem0.loc22_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.loc22_3.2 (constants.%specific_impl_fn)] diff --git a/toolchain/check/testdata/interface/compound_member_access.carbon b/toolchain/check/testdata/interface/compound_member_access.carbon index f484376abc93..78631cd90f27 100644 --- a/toolchain/check/testdata/interface/compound_member_access.carbon +++ b/toolchain/check/testdata/interface/compound_member_access.carbon @@ -20,10 +20,10 @@ interface J { } // Simple member access. -fn Simple1(T:! J, S:! T.U) {} +fn Simple1(T:! J, unused S:! T.U) {} // This should be equivalent to `Simple1` above, but using compound member access. -fn Compound1(V:! J, W:! V.(J.U)) {} +fn Compound1(V:! J, unused W:! V.(J.U)) {} // --- non_instance.carbon library "[[@TEST_NAME]]"; @@ -241,15 +241,15 @@ fn Works() { // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc8_12.2: %J.type = symbolic_binding T, 0 [symbolic = %T.loc8_12.1 (constants.%T)] -// CHECK:STDOUT: %.loc8_24.1: type = splice_block %impl.elem0.loc8_24.2 [symbolic = %impl.elem0.loc8_24.1 (constants.%impl.elem0.5607ef.1)] { +// CHECK:STDOUT: %.loc8_31.1: type = splice_block %impl.elem0.loc8_31.2 [symbolic = %impl.elem0.loc8_31.1 (constants.%impl.elem0.5607ef.1)] { // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.ref: %J.type = name_ref T, %T.loc8_12.2 [symbolic = %T.loc8_12.1 (constants.%T)] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] -// CHECK:STDOUT: %.loc8_24.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] +// CHECK:STDOUT: %.loc8_31.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc8_24.2: type = impl_witness_access constants.%J.lookup_impl_witness.264a02.1, element0 [symbolic = %impl.elem0.loc8_24.1 (constants.%impl.elem0.5607ef.1)] +// CHECK:STDOUT: %impl.elem0.loc8_31.2: type = impl_witness_access constants.%J.lookup_impl_witness.264a02.1, element0 [symbolic = %impl.elem0.loc8_31.1 (constants.%impl.elem0.5607ef.1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %S.loc8_19.2: @Simple1.%impl.elem0.loc8_24.1 (%impl.elem0.5607ef.1) = symbolic_binding S, 1 [symbolic = %S.loc8_19.1 (constants.%S)] +// CHECK:STDOUT: %S.loc8_26.2: @Simple1.%impl.elem0.loc8_31.1 (%impl.elem0.5607ef.1) = symbolic_binding S, 1 [symbolic = %S.loc8_26.1 (constants.%S)] // CHECK:STDOUT: } // CHECK:STDOUT: %Compound1.decl: %Compound1.type = fn_decl @Compound1 [concrete = constants.%Compound1] { // CHECK:STDOUT: %V.patt: %pattern_type.f76 = symbolic_binding_pattern V, 0 [concrete] @@ -260,14 +260,14 @@ fn Works() { // CHECK:STDOUT: %J.ref.loc11_18: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } // CHECK:STDOUT: %V.loc11_14.2: %J.type = symbolic_binding V, 0 [symbolic = %V.loc11_14.1 (constants.%V)] -// CHECK:STDOUT: %.loc11_26: type = splice_block %impl.elem0.loc11_26.2 [symbolic = %impl.elem0.loc11_26.1 (constants.%impl.elem0.5607ef.2)] { +// CHECK:STDOUT: %.loc11_33: type = splice_block %impl.elem0.loc11_33.2 [symbolic = %impl.elem0.loc11_33.1 (constants.%impl.elem0.5607ef.2)] { // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %V.ref: %J.type = name_ref V, %V.loc11_14.2 [symbolic = %V.loc11_14.1 (constants.%V)] -// CHECK:STDOUT: %J.ref.loc11_28: type = name_ref J, file.%J.decl [concrete = constants.%J.type] +// CHECK:STDOUT: %J.ref.loc11_35: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc11_26.2: type = impl_witness_access constants.%J.lookup_impl_witness.264a02.2, element0 [symbolic = %impl.elem0.loc11_26.1 (constants.%impl.elem0.5607ef.2)] +// CHECK:STDOUT: %impl.elem0.loc11_33.2: type = impl_witness_access constants.%J.lookup_impl_witness.264a02.2, element0 [symbolic = %impl.elem0.loc11_33.1 (constants.%impl.elem0.5607ef.2)] // CHECK:STDOUT: } -// CHECK:STDOUT: %W.loc11_21.2: @Compound1.%impl.elem0.loc11_26.1 (%impl.elem0.5607ef.2) = symbolic_binding W, 1 [symbolic = %W.loc11_21.1 (constants.%W)] +// CHECK:STDOUT: %W.loc11_28.2: @Compound1.%impl.elem0.loc11_33.1 (%impl.elem0.5607ef.2) = symbolic_binding W, 1 [symbolic = %W.loc11_28.1 (constants.%W)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -288,13 +288,13 @@ fn Works() { // CHECK:STDOUT: !requires: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Simple1(%T.loc8_12.2: %J.type, %S.loc8_19.2: @Simple1.%impl.elem0.loc8_24.1 (%impl.elem0.5607ef.1)) { +// CHECK:STDOUT: generic fn @Simple1(%T.loc8_12.2: %J.type, %S.loc8_26.2: @Simple1.%impl.elem0.loc8_31.1 (%impl.elem0.5607ef.1)) { // CHECK:STDOUT: %T.loc8_12.1: %J.type = symbolic_binding T, 0 [symbolic = %T.loc8_12.1 (constants.%T)] // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc8_12.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] // CHECK:STDOUT: %J.lookup_impl_witness: = lookup_impl_witness %T.loc8_12.1, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.264a02.1)] -// CHECK:STDOUT: %impl.elem0.loc8_24.1: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc8_24.1 (constants.%impl.elem0.5607ef.1)] -// CHECK:STDOUT: %S.loc8_19.1: @Simple1.%impl.elem0.loc8_24.1 (%impl.elem0.5607ef.1) = symbolic_binding S, 1 [symbolic = %S.loc8_19.1 (constants.%S)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc8_24.1 [symbolic = %pattern_type (constants.%pattern_type.ad6d12.1)] +// CHECK:STDOUT: %impl.elem0.loc8_31.1: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc8_31.1 (constants.%impl.elem0.5607ef.1)] +// CHECK:STDOUT: %S.loc8_26.1: @Simple1.%impl.elem0.loc8_31.1 (%impl.elem0.5607ef.1) = symbolic_binding S, 1 [symbolic = %S.loc8_26.1 (constants.%S)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc8_31.1 [symbolic = %pattern_type (constants.%pattern_type.ad6d12.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -304,12 +304,12 @@ fn Works() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Compound1(%V.loc11_14.2: %J.type, %W.loc11_21.2: @Compound1.%impl.elem0.loc11_26.1 (%impl.elem0.5607ef.2)) { +// CHECK:STDOUT: generic fn @Compound1(%V.loc11_14.2: %J.type, %W.loc11_28.2: @Compound1.%impl.elem0.loc11_33.1 (%impl.elem0.5607ef.2)) { // CHECK:STDOUT: %V.loc11_14.1: %J.type = symbolic_binding V, 0 [symbolic = %V.loc11_14.1 (constants.%V)] // CHECK:STDOUT: %J.lookup_impl_witness: = lookup_impl_witness %V.loc11_14.1, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.264a02.2)] -// CHECK:STDOUT: %impl.elem0.loc11_26.1: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_26.1 (constants.%impl.elem0.5607ef.2)] -// CHECK:STDOUT: %W.loc11_21.1: @Compound1.%impl.elem0.loc11_26.1 (%impl.elem0.5607ef.2) = symbolic_binding W, 1 [symbolic = %W.loc11_21.1 (constants.%W)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc11_26.1 [symbolic = %pattern_type (constants.%pattern_type.ad6d12.2)] +// CHECK:STDOUT: %impl.elem0.loc11_33.1: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_33.1 (constants.%impl.elem0.5607ef.2)] +// CHECK:STDOUT: %W.loc11_28.1: @Compound1.%impl.elem0.loc11_33.1 (%impl.elem0.5607ef.2) = symbolic_binding W, 1 [symbolic = %W.loc11_28.1 (constants.%W)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc11_33.1 [symbolic = %pattern_type (constants.%pattern_type.ad6d12.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -331,8 +331,8 @@ fn Works() { // CHECK:STDOUT: %T.loc8_12.1 => constants.%T // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.264a02.1 -// CHECK:STDOUT: %impl.elem0.loc8_24.1 => constants.%impl.elem0.5607ef.1 -// CHECK:STDOUT: %S.loc8_19.1 => constants.%S +// CHECK:STDOUT: %impl.elem0.loc8_31.1 => constants.%impl.elem0.5607ef.1 +// CHECK:STDOUT: %S.loc8_26.1 => constants.%S // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ad6d12.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -343,8 +343,8 @@ fn Works() { // CHECK:STDOUT: specific @Compound1(constants.%V, constants.%W) { // CHECK:STDOUT: %V.loc11_14.1 => constants.%V // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.264a02.2 -// CHECK:STDOUT: %impl.elem0.loc11_26.1 => constants.%impl.elem0.5607ef.2 -// CHECK:STDOUT: %W.loc11_21.1 => constants.%W +// CHECK:STDOUT: %impl.elem0.loc11_33.1 => constants.%impl.elem0.5607ef.2 +// CHECK:STDOUT: %W.loc11_28.1 => constants.%W // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ad6d12.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/default_fn.carbon b/toolchain/check/testdata/interface/default_fn.carbon index e9a92f7a2a75..69a3540ec1b0 100644 --- a/toolchain/check/testdata/interface/default_fn.carbon +++ b/toolchain/check/testdata/interface/default_fn.carbon @@ -15,7 +15,7 @@ class C { interface I { // TODO: Use `default` here. - fn F[self: Self]() { + fn F[unused self: Self]() { // I and F are both complete here, and the impl below is in scope. var c: C = {}; c.(I.F)(); @@ -23,7 +23,7 @@ class C { } impl C as I { - fn F[self: Self]() {} + fn F[unused self: Self]() {} } } @@ -86,10 +86,10 @@ class C { // CHECK:STDOUT: %self.param_patt: @I.WithSelf.F.%pattern_type (%pattern_type.b59) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.binding.as_type (%Self.binding.as_type.5c6) = value_param call_param0 -// CHECK:STDOUT: %.loc18_16.1: type = splice_block %.loc18_16.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.5c6)] { +// CHECK:STDOUT: %.loc18_23.1: type = splice_block %.loc18_23.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.5c6)] { // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self.loc16 [symbolic = %Self (constants.%Self.849)] // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.5c6)] -// CHECK:STDOUT: %.loc18_16.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.5c6)] +// CHECK:STDOUT: %.loc18_23.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.5c6)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @I.WithSelf.F.%Self.binding.as_type (%Self.binding.as_type.5c6) = value_binding self, %self.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/export_name.carbon b/toolchain/check/testdata/interface/export_name.carbon index 1d22a579dd7e..8ec8b2e321f0 100644 --- a/toolchain/check/testdata/interface/export_name.carbon +++ b/toolchain/check/testdata/interface/export_name.carbon @@ -40,7 +40,7 @@ library "[[@TEST_NAME]]"; import library "export"; -fn UseEmpty(i: I) {} +fn UseEmpty(unused i: I) {} // CHECK:STDOUT: --- base.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_member_lookup.carbon b/toolchain/check/testdata/interface/fail_member_lookup.carbon index c05f17ee4c76..96fcc6bf5e8e 100644 --- a/toolchain/check/testdata/interface/fail_member_lookup.carbon +++ b/toolchain/check/testdata/interface/fail_member_lookup.carbon @@ -28,14 +28,14 @@ fn F() { // CHECK:STDERR: Interface.F(); - // CHECK:STDERR: fail_member_lookup.carbon:[[@LINE+7]]:10: error: cannot implicitly convert non-type value of type `` to `type` [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: var v: Interface.T; - // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_member_lookup.carbon:[[@LINE+4]]:10: note: type `` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: var v: Interface.T; - // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: fail_member_lookup.carbon:[[@LINE+7]]:17: error: cannot implicitly convert non-type value of type `` to `type` [ConversionFailureNonTypeToFacet] + // CHECK:STDERR: var unused v: Interface.T; + // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: fail_member_lookup.carbon:[[@LINE+4]]:17: note: type `` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: var unused v: Interface.T; + // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: - var v: Interface.T; + var unused v: Interface.T; } interface Different {} diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon index 1f013b951178..dbc1d819df37 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon @@ -52,7 +52,7 @@ interface Interface { // TODO: This should be // fn Interface.F[self: Self](U:! type, u: U*) -> U* { return u; } -fn Interface.C.F[self: Self](U:! type, u: U*) -> U* { return u; } +fn Interface.C.F[unused self: Self](U:! type, u: U*) -> U* { return u; } // CHECK:STDOUT: --- fail_todo_define_default_fn_out_of_line.carbon // CHECK:STDOUT: @@ -239,21 +239,21 @@ fn Interface.C.F[self: Self](U:! type, u: U*) -> U* { return u; } // CHECK:STDOUT: %return.patt: @C.F.%pattern_type.loc14_32 (%pattern_type.423) = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: @C.F.%pattern_type.loc14_32 (%pattern_type.423) = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.ref.loc20_50: type = name_ref U, %U.loc20 [symbolic = %U.loc14_22.1 (constants.%U.091)] -// CHECK:STDOUT: %ptr.loc20_51: type = ptr_type %U.ref.loc20_50 [symbolic = %ptr.loc14_36.1 (constants.%ptr.18e)] -// CHECK:STDOUT: %.loc20_51: Core.Form = init_form %ptr.loc20_51, call_param2 [symbolic = %.loc14_43.1 (constants.%.ddc)] +// CHECK:STDOUT: %U.ref.loc20_57: type = name_ref U, %U.loc20 [symbolic = %U.loc14_22.1 (constants.%U.091)] +// CHECK:STDOUT: %ptr.loc20_58: type = ptr_type %U.ref.loc20_57 [symbolic = %ptr.loc14_36.1 (constants.%ptr.18e)] +// CHECK:STDOUT: %.loc20_58: Core.Form = init_form %ptr.loc20_58, call_param2 [symbolic = %.loc14_43.1 (constants.%.ddc)] // CHECK:STDOUT: %self.param.loc20: @C.F.%C (%C) = value_param call_param0 -// CHECK:STDOUT: %.loc20_24.1: type = splice_block %Self.ref.loc20 [symbolic = %C (constants.%C)] { -// CHECK:STDOUT: %.loc20_24.2: type = specific_constant constants.%C, @C(constants.%Self.887) [symbolic = %C (constants.%C)] -// CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, %.loc20_24.2 [symbolic = %C (constants.%C)] +// CHECK:STDOUT: %.loc20_31.1: type = splice_block %Self.ref.loc20 [symbolic = %C (constants.%C)] { +// CHECK:STDOUT: %.loc20_31.2: type = specific_constant constants.%C, @C(constants.%Self.887) [symbolic = %C (constants.%C)] +// CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, %.loc20_31.2 [symbolic = %C (constants.%C)] // CHECK:STDOUT: } // CHECK:STDOUT: %self.loc20: @C.F.%C (%C) = value_binding self, %self.param.loc20 // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %U.loc20: type = symbolic_binding U, 1 [symbolic = %U.loc14_22.1 (constants.%U.091)] // CHECK:STDOUT: %u.param.loc20: @C.F.%ptr.loc14_36.1 (%ptr.18e) = value_param call_param1 -// CHECK:STDOUT: %.loc20_44: type = splice_block %ptr.loc20_44 [symbolic = %ptr.loc14_36.1 (constants.%ptr.18e)] { -// CHECK:STDOUT: %U.ref.loc20_43: type = name_ref U, %U.loc20 [symbolic = %U.loc14_22.1 (constants.%U.091)] -// CHECK:STDOUT: %ptr.loc20_44: type = ptr_type %U.ref.loc20_43 [symbolic = %ptr.loc14_36.1 (constants.%ptr.18e)] +// CHECK:STDOUT: %.loc20_51: type = splice_block %ptr.loc20_51 [symbolic = %ptr.loc14_36.1 (constants.%ptr.18e)] { +// CHECK:STDOUT: %U.ref.loc20_50: type = name_ref U, %U.loc20 [symbolic = %U.loc14_22.1 (constants.%U.091)] +// CHECK:STDOUT: %ptr.loc20_51: type = ptr_type %U.ref.loc20_50 [symbolic = %ptr.loc14_36.1 (constants.%ptr.18e)] // CHECK:STDOUT: } // CHECK:STDOUT: %u.loc20: @C.F.%ptr.loc14_36.1 (%ptr.18e) = value_binding u, %u.param.loc20 // CHECK:STDOUT: %return.param.loc20: ref @C.F.%ptr.loc14_36.1 (%ptr.18e) = out_param call_param2 @@ -331,24 +331,24 @@ fn Interface.C.F[self: Self](U:! type, u: U*) -> U* { return u; } // CHECK:STDOUT: %.loc14_43.1: Core.Form = init_form %ptr.loc14_36.1, call_param2 [symbolic = %.loc14_43.1 (constants.%.ddc)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc20_22: = require_complete_type %C [symbolic = %require_complete.loc20_22 (constants.%require_complete.a31)] -// CHECK:STDOUT: %require_complete.loc20_41: = require_complete_type %ptr.loc14_36.1 [symbolic = %require_complete.loc20_41 (constants.%require_complete.56d)] -// CHECK:STDOUT: %.loc20_62.1: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%U.loc14_22.1) [symbolic = %.loc20_62.1 (constants.%.f1d)] +// CHECK:STDOUT: %require_complete.loc20_29: = require_complete_type %C [symbolic = %require_complete.loc20_29 (constants.%require_complete.a31)] +// CHECK:STDOUT: %require_complete.loc20_48: = require_complete_type %ptr.loc14_36.1 [symbolic = %require_complete.loc20_48 (constants.%require_complete.56d)] +// CHECK:STDOUT: %.loc20_69.1: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%U.loc14_22.1) [symbolic = %.loc20_69.1 (constants.%.f1d)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc14_36.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.484)] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc14_36.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet)] // CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy(%Copy.facet) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.be8)] -// CHECK:STDOUT: %.loc20_62.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc20_62.2 (constants.%.e5c)] -// CHECK:STDOUT: %impl.elem0.loc20_62.2: @C.F.%.loc20_62.2 (%.e5c) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc20_62.2 (constants.%impl.elem0.375)] -// CHECK:STDOUT: %specific_impl_fn.loc20_62.2: = specific_impl_function %impl.elem0.loc20_62.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc20_62.2 (constants.%specific_impl_fn.389)] +// CHECK:STDOUT: %.loc20_69.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc20_69.2 (constants.%.e5c)] +// CHECK:STDOUT: %impl.elem0.loc20_69.2: @C.F.%.loc20_69.2 (%.e5c) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc20_69.2 (constants.%impl.elem0.375)] +// CHECK:STDOUT: %specific_impl_fn.loc20_69.2: = specific_impl_function %impl.elem0.loc20_69.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc20_69.2 (constants.%specific_impl_fn.389)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param.loc20: @C.F.%C (%C), %u.param.loc20: @C.F.%ptr.loc14_36.1 (%ptr.18e)) -> out %return.param.loc20: @C.F.%ptr.loc14_36.1 (%ptr.18e) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %u.ref: @C.F.%ptr.loc14_36.1 (%ptr.18e) = name_ref u, %u.loc20 -// CHECK:STDOUT: %impl.elem0.loc20_62.1: @C.F.%.loc20_62.2 (%.e5c) = impl_witness_access constants.%Copy.lookup_impl_witness.484, element0 [symbolic = %impl.elem0.loc20_62.2 (constants.%impl.elem0.375)] -// CHECK:STDOUT: %bound_method.loc20_62.1: = bound_method %u.ref, %impl.elem0.loc20_62.1 -// CHECK:STDOUT: %specific_impl_fn.loc20_62.1: = specific_impl_function %impl.elem0.loc20_62.1, @Copy.WithSelf.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc20_62.2 (constants.%specific_impl_fn.389)] -// CHECK:STDOUT: %bound_method.loc20_62.2: = bound_method %u.ref, %specific_impl_fn.loc20_62.1 -// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @C.F.%ptr.loc14_36.1 (%ptr.18e) = call %bound_method.loc20_62.2(%u.ref) +// CHECK:STDOUT: %impl.elem0.loc20_69.1: @C.F.%.loc20_69.2 (%.e5c) = impl_witness_access constants.%Copy.lookup_impl_witness.484, element0 [symbolic = %impl.elem0.loc20_69.2 (constants.%impl.elem0.375)] +// CHECK:STDOUT: %bound_method.loc20_69.1: = bound_method %u.ref, %impl.elem0.loc20_69.1 +// CHECK:STDOUT: %specific_impl_fn.loc20_69.1: = specific_impl_function %impl.elem0.loc20_69.1, @Copy.WithSelf.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc20_69.2 (constants.%specific_impl_fn.389)] +// CHECK:STDOUT: %bound_method.loc20_69.2: = bound_method %u.ref, %specific_impl_fn.loc20_69.1 +// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @C.F.%ptr.loc14_36.1 (%ptr.18e) = call %bound_method.loc20_69.2(%u.ref) // CHECK:STDOUT: return %Copy.WithSelf.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/generic.carbon b/toolchain/check/testdata/interface/generic.carbon index d86fc3a9fcfb..c01f0dd58f57 100644 --- a/toolchain/check/testdata/interface/generic.carbon +++ b/toolchain/check/testdata/interface/generic.carbon @@ -36,7 +36,7 @@ class C { interface WithImplicitArgs[T:! type](N:! T); -fn Receive(T:! Simple(C)) {} +fn Receive(unused T:! Simple(C)) {} fn Pass(T:! Simple(C)) { Receive(T); } @@ -67,14 +67,14 @@ library "[[@TEST_NAME]]"; interface Generic(T:! type) {} -// CHECK:STDERR: fail_args_count_mismatch.carbon:[[@LINE+7]]:10: error: 2 arguments passed to generic interface expecting 1 argument [CallArgCountMismatch] -// CHECK:STDERR: fn F(T:! Generic((), ())) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_args_count_mismatch.carbon:[[@LINE+7]]:17: error: 2 arguments passed to generic interface expecting 1 argument [CallArgCountMismatch] +// CHECK:STDERR: fn F(unused T:! Generic((), ())) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_args_count_mismatch.carbon:[[@LINE-5]]:1: note: calling generic interface declared here [InCallToEntity] // CHECK:STDERR: interface Generic(T:! type) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(T:! Generic((), ())) {} +fn F(unused T:! Generic((), ())) {} // CHECK:STDOUT: --- generic.carbon // CHECK:STDOUT: @@ -124,13 +124,14 @@ fn F(T:! Generic((), ())) {} // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T.67d [symbolic] // CHECK:STDOUT: %WithImplicitArgs.type: type = generic_interface_type @WithImplicitArgs [concrete] // CHECK:STDOUT: %WithImplicitArgs.generic: %WithImplicitArgs.type = struct_value () [concrete] -// CHECK:STDOUT: %T.760: %Simple.type.12a = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %T.7608f6.1: %Simple.type.12a = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.08a: type = pattern_type %Simple.type.12a [concrete] +// CHECK:STDOUT: %T.7608f6.2: %Simple.type.12a = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %Receive.type: type = fn_type @Receive [concrete] // CHECK:STDOUT: %Receive: %Receive.type = struct_value () [concrete] // CHECK:STDOUT: %Pass.type: type = fn_type @Pass [concrete] // CHECK:STDOUT: %Pass: %Pass.type = struct_value () [concrete] -// CHECK:STDOUT: %Receive.specific_fn: = specific_function %Receive, @Receive(%T.760) [symbolic] +// CHECK:STDOUT: %Receive.specific_fn: = specific_function %Receive, @Receive(%T.7608f6.1) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -178,7 +179,7 @@ fn F(T:! Generic((), ())) {} // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %Simple.type: type = facet_type <@Simple, @Simple(constants.%C)> [concrete = constants.%Simple.type.12a] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc24_12.2: %Simple.type.12a = symbolic_binding T, 0 [symbolic = %T.loc24_12.1 (constants.%T.760)] +// CHECK:STDOUT: %T.loc24_19.3: %Simple.type.12a = symbolic_binding T, 0 [symbolic = %T.loc24_19.2 (constants.%T.7608f6.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %Pass.decl: %Pass.type = fn_decl @Pass [concrete = constants.%Pass] { // CHECK:STDOUT: %T.patt: %pattern_type.08a = symbolic_binding_pattern T, 0 [concrete] @@ -189,7 +190,7 @@ fn F(T:! Generic((), ())) {} // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %Simple.type: type = facet_type <@Simple, @Simple(constants.%C)> [concrete = constants.%Simple.type.12a] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc25_9.2: %Simple.type.12a = symbolic_binding T, 0 [symbolic = %T.loc25_9.1 (constants.%T.760)] +// CHECK:STDOUT: %T.loc25_9.2: %Simple.type.12a = symbolic_binding T, 0 [symbolic = %T.loc25_9.1 (constants.%T.7608f6.1)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -325,8 +326,9 @@ fn F(T:! Generic((), ())) {} // CHECK:STDOUT: return %.loc17_16 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Receive(%T.loc24_12.2: %Simple.type.12a) { -// CHECK:STDOUT: %T.loc24_12.1: %Simple.type.12a = symbolic_binding T, 0 [symbolic = %T.loc24_12.1 (constants.%T.760)] +// CHECK:STDOUT: generic fn @Receive(%T.loc24_19.3: %Simple.type.12a) { +// CHECK:STDOUT: %T.loc24_19.1: %Simple.type.12a = symbolic_binding T, 0 [symbolic = %T.loc24_19.1 (constants.%T.7608f6.1)] +// CHECK:STDOUT: %T.loc24_19.2: %Simple.type.12a = symbolic_binding T, 0 [symbolic = %T.loc24_19.2 (constants.%T.7608f6.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -337,7 +339,7 @@ fn F(T:! Generic((), ())) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Pass(%T.loc25_9.2: %Simple.type.12a) { -// CHECK:STDOUT: %T.loc25_9.1: %Simple.type.12a = symbolic_binding T, 0 [symbolic = %T.loc25_9.1 (constants.%T.760)] +// CHECK:STDOUT: %T.loc25_9.1: %Simple.type.12a = symbolic_binding T, 0 [symbolic = %T.loc25_9.1 (constants.%T.7608f6.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Receive.specific_fn.loc26_3.2: = specific_function constants.%Receive, @Receive(%T.loc25_9.1) [symbolic = %Receive.specific_fn.loc26_3.2 (constants.%Receive.specific_fn)] @@ -345,8 +347,8 @@ fn F(T:! Generic((), ())) {} // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Receive.ref: %Receive.type = name_ref Receive, file.%Receive.decl [concrete = constants.%Receive] -// CHECK:STDOUT: %T.ref: %Simple.type.12a = name_ref T, %T.loc25_9.2 [symbolic = %T.loc25_9.1 (constants.%T.760)] -// CHECK:STDOUT: %Receive.specific_fn.loc26_3.1: = specific_function %Receive.ref, @Receive(constants.%T.760) [symbolic = %Receive.specific_fn.loc26_3.2 (constants.%Receive.specific_fn)] +// CHECK:STDOUT: %T.ref: %Simple.type.12a = name_ref T, %T.loc25_9.2 [symbolic = %T.loc25_9.1 (constants.%T.7608f6.1)] +// CHECK:STDOUT: %Receive.specific_fn.loc26_3.1: = specific_function %Receive.ref, @Receive(constants.%T.7608f6.1) [symbolic = %Receive.specific_fn.loc26_3.2 (constants.%Receive.specific_fn)] // CHECK:STDOUT: %Receive.call: init %empty_tuple.type = call %Receive.specific_fn.loc26_3.1() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -420,14 +422,20 @@ fn F(T:! Generic((), ())) {} // CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Receive(constants.%T.760) { -// CHECK:STDOUT: %T.loc24_12.1 => constants.%T.760 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: +// CHECK:STDOUT: specific @Receive(constants.%T.7608f6.2) { +// CHECK:STDOUT: %T.loc24_19.1 => constants.%T.7608f6.2 +// CHECK:STDOUT: %T.loc24_19.2 => constants.%T.7608f6.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Pass(constants.%T.760) { -// CHECK:STDOUT: %T.loc25_9.1 => constants.%T.760 +// CHECK:STDOUT: specific @Pass(constants.%T.7608f6.1) { +// CHECK:STDOUT: %T.loc25_9.1 => constants.%T.7608f6.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Receive(constants.%T.7608f6.1) { +// CHECK:STDOUT: %T.loc24_19.1 => constants.%T.7608f6.1 +// CHECK:STDOUT: %T.loc24_19.2 => constants.%T.7608f6.1 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatched_args.carbon @@ -619,8 +627,8 @@ fn F(T:! Generic((), ())) {} // CHECK:STDOUT: %.1: = splice_block [concrete = ] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Generic.ref: %Generic.type.835 = name_ref Generic, file.%Generic.decl [concrete = constants.%Generic.generic] -// CHECK:STDOUT: %.loc12_19: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc12_23: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc12_26: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc12_30: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: } // CHECK:STDOUT: %T: = symbolic_binding T, 0 [concrete = ] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/generic_default_fn.carbon b/toolchain/check/testdata/interface/generic_default_fn.carbon index f2bcbbe70605..f2bdccf1a109 100644 --- a/toolchain/check/testdata/interface/generic_default_fn.carbon +++ b/toolchain/check/testdata/interface/generic_default_fn.carbon @@ -10,9 +10,11 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/generic_default_fn.carbon -interface I(T:! type) { +interface I(_:! type) { // TODO: Use `default` here. fn F[ref self: Self]() -> Self*; } -fn I(T:! type).F[ref self: Self]() -> Self* { return &self; } +fn I(_:! type).F[ref self: Self]() -> Self* { + return &self; +} diff --git a/toolchain/check/testdata/interface/import.carbon b/toolchain/check/testdata/interface/import.carbon index b4c35786c438..53e202073f1e 100644 --- a/toolchain/check/testdata/interface/import.carbon +++ b/toolchain/check/testdata/interface/import.carbon @@ -40,9 +40,9 @@ library "[[@TEST_NAME]]"; import library "a"; -fn UseEmpty(e: Empty) {} -fn UseBasic(e: Basic) {} -fn UseForwardDeclared(f: ForwardDeclared) {} +fn UseEmpty(unused e: Empty) {} +fn UseBasic(unused e: Basic) {} +fn UseForwardDeclared(unused f: ForwardDeclared) {} alias UseBasicT = Basic.T; alias UseBasicF = Basic.F; diff --git a/toolchain/check/testdata/interface/import_access.carbon b/toolchain/check/testdata/interface/import_access.carbon index 2d5d09162c06..e5c86fd56ae8 100644 --- a/toolchain/check/testdata/interface/import_access.carbon +++ b/toolchain/check/testdata/interface/import_access.carbon @@ -45,7 +45,7 @@ package Test library "[[@TEST_NAME]]"; impl package Test library "[[@TEST_NAME]]"; -fn F(i: Def) {} +fn F(unused i: Def) {} // --- fail_local_def.carbon @@ -53,11 +53,11 @@ package Test library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:9: error: name `Def` not found [NameNotFound] -// CHECK:STDERR: fn F(i: Def) {} -// CHECK:STDERR: ^~~ +// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:16: error: name `Def` not found [NameNotFound] +// CHECK:STDERR: fn F(unused i: Def) {} +// CHECK:STDERR: ^~~ // CHECK:STDERR: -fn F(i: Def) {} +fn F(unused i: Def) {} // --- fail_other_def.carbon @@ -65,17 +65,17 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:9: error: member name `Def` not found in `Test` [MemberNameNotFoundInInstScope] -// CHECK:STDERR: fn F(i: Test.Def) {} -// CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:16: error: member name `Def` not found in `Test` [MemberNameNotFoundInInstScope] +// CHECK:STDERR: fn F(unused i: Test.Def) {} +// CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -fn F(i: Test.Def) {} +fn F(unused i: Test.Def) {} // --- forward_with_def.impl.carbon impl package Test library "[[@TEST_NAME]]"; -fn F(i: ForwardWithDef) {} +fn F(unused i: ForwardWithDef) {} // --- fail_local_forward_with_def.carbon @@ -83,11 +83,11 @@ package Test library "[[@TEST_NAME]]"; import library "forward_with_def"; -// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:9: error: name `ForwardWithDef` not found [NameNotFound] -// CHECK:STDERR: fn F(i: ForwardWithDef) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~ +// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:16: error: name `ForwardWithDef` not found [NameNotFound] +// CHECK:STDERR: fn F(unused i: ForwardWithDef) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(i: ForwardWithDef) {} +fn F(unused i: ForwardWithDef) {} // --- fail_other_forward_with_def.carbon @@ -95,24 +95,24 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward_with_def"; -// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:9: error: member name `ForwardWithDef` not found in `Test` [MemberNameNotFoundInInstScope] -// CHECK:STDERR: fn F(i: Test.ForwardWithDef) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:16: error: member name `ForwardWithDef` not found in `Test` [MemberNameNotFoundInInstScope] +// CHECK:STDERR: fn F(unused i: Test.ForwardWithDef) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(i: Test.ForwardWithDef) {} +fn F(unused i: Test.ForwardWithDef) {} // --- fail_todo_forward.impl.carbon impl package Test library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_forward.impl.carbon:[[@LINE+7]]:9: error: name `Forward` not found [NameNotFound] -// CHECK:STDERR: fn F(i: Forward*) {} -// CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: fail_todo_forward.impl.carbon:[[@LINE+7]]:16: error: name `Forward` not found [NameNotFound] +// CHECK:STDERR: fn F(unused i: Forward*) {} +// CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_forward.impl.carbon:[[@LINE+3]]:9: error: name `Forward` used before it was declared [NameUseBeforeDecl] -// CHECK:STDERR: fn F(i: Forward*) {} -// CHECK:STDERR: ^~~~~~~ -fn F(i: Forward*) {} +// CHECK:STDERR: fail_todo_forward.impl.carbon:[[@LINE+3]]:16: error: name `Forward` used before it was declared [NameUseBeforeDecl] +// CHECK:STDERR: fn F(unused i: Forward*) {} +// CHECK:STDERR: ^~~~~~~ +fn F(unused i: Forward*) {} // CHECK:STDERR: fail_todo_forward.impl.carbon:[[@LINE+4]]:11: note: declared here [NameUseBeforeDeclNote] // CHECK:STDERR: interface Forward {} @@ -126,11 +126,11 @@ package Test library "[[@TEST_NAME]]"; import library "forward"; -// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:9: error: name `Forward` not found [NameNotFound] -// CHECK:STDERR: fn F(i: Forward*) {} -// CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:16: error: name `Forward` not found [NameNotFound] +// CHECK:STDERR: fn F(unused i: Forward*) {} +// CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -fn F(i: Forward*) {} +fn F(unused i: Forward*) {} // --- fail_other_forward.carbon @@ -138,11 +138,11 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward"; -// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+4]]:9: error: name `Forward` not found [NameNotFound] -// CHECK:STDERR: fn F(i: Forward*) {} -// CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+4]]:16: error: name `Forward` not found [NameNotFound] +// CHECK:STDERR: fn F(unused i: Forward*) {} +// CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -fn F(i: Forward*) {} +fn F(unused i: Forward*) {} // --- todo_fail_private_on_redecl.carbon diff --git a/toolchain/check/testdata/interface/local.carbon b/toolchain/check/testdata/interface/local.carbon index 69560aee7c2e..51726f665d8a 100644 --- a/toolchain/check/testdata/interface/local.carbon +++ b/toolchain/check/testdata/interface/local.carbon @@ -17,7 +17,7 @@ fn F() { fn G[self: Self](); } impl () as I { - fn G[self: Self]() {} + fn G[unused self: Self]() {} } ().(I.G)(); } diff --git a/toolchain/check/testdata/interface/name_poisoning.carbon b/toolchain/check/testdata/interface/name_poisoning.carbon index d5434696ed78..77f5940f480a 100644 --- a/toolchain/check/testdata/interface/name_poisoning.carbon +++ b/toolchain/check/testdata/interface/name_poisoning.carbon @@ -19,7 +19,7 @@ interface I; // `N.F` uses `N.I` and not `package.I`. namespace N; interface N.I {} -fn N.F(x:! I) {} +fn N.F(unused x:! I) {} fn TestCall(x:! N.I) { // `N.F` accepts an `N.I` not a `package.I`. diff --git a/toolchain/check/testdata/interop/cpp/builtins.carbon b/toolchain/check/testdata/interop/cpp/builtins.carbon index 3348c3142abd..a6e815999201 100644 --- a/toolchain/check/testdata/interop/cpp/builtins.carbon +++ b/toolchain/check/testdata/interop/cpp/builtins.carbon @@ -19,28 +19,28 @@ import Cpp; fn F() { //@dump-sem-ir-begin let cpp_signed_char : Cpp.signed_char = 1 as i8; - let carbon_signed_char: i8 = cpp_signed_char; + let unused carbon_signed_char: i8 = cpp_signed_char; let cpp_short : Cpp.short = 1 as i16; - let carbon_short: i16 = cpp_short; + let unused carbon_short: i16 = cpp_short; let cpp_int : Cpp.int = 1 as i32; - let carbon_int: i32 = cpp_int; + let unused carbon_int: i32 = cpp_int; let cpp_unsigned_char : Cpp.unsigned_char = 1 as u8; - let carbon_unsigned_char: u8 = cpp_unsigned_char; + let unused carbon_unsigned_char: u8 = cpp_unsigned_char; let cpp_unsigned_short : Cpp.unsigned_short = 1 as u16; - let carbon_unsigned_short: u16 = cpp_unsigned_short; + let unused carbon_unsigned_short: u16 = cpp_unsigned_short; let cpp_unsigned_int : Cpp.unsigned_int = 1 as u32; - let carbon_unsigned_int: u32 = cpp_unsigned_int; + let unused carbon_unsigned_int: u32 = cpp_unsigned_int; let cpp_float : Cpp.float = 1.0 as f32; - let carbon_float: f32 = cpp_float; + let unused carbon_float: f32 = cpp_float; let cpp_double : Cpp.double = 1.0 as f64; - let carbon_double: f64 = cpp_double; + let unused carbon_double: f64 = cpp_double; //@dump-sem-ir-end } @@ -60,7 +60,7 @@ fn F() { // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: let cpp_long_double : Cpp.long_double = 1.0 as f64; - let carbon_long_double: f64 = cpp_long_double; + let unused carbon_long_double: f64 = cpp_long_double; //@dump-sem-ir-end } @@ -71,11 +71,11 @@ library "[[@TEST_NAME]]"; import Cpp; fn F() { - // CHECK:STDERR: fail_not_builtin.carbon:[[@LINE+4]]:21: error: member name `not_builtin` not found in `Cpp` [MemberNameNotFoundInInstScope] - // CHECK:STDERR: let not_builtin : Cpp.not_builtin = 1; - // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_not_builtin.carbon:[[@LINE+4]]:28: error: member name `not_builtin` not found in `Cpp` [MemberNameNotFoundInInstScope] + // CHECK:STDERR: let unused not_builtin : Cpp.not_builtin = 1; + // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: - let not_builtin : Cpp.not_builtin = 1; + let unused not_builtin : Cpp.not_builtin = 1; } // --- fail_lookup_in_other_scopes.carbon @@ -87,11 +87,11 @@ namespace MyNamespace {} '''; fn F() { - // CHECK:STDERR: fail_lookup_in_other_scopes.carbon:[[@LINE+4]]:14: error: member name `long` not found in `Cpp.MyNamespace` [MemberNameNotFoundInInstScope] - // CHECK:STDERR: let long : Cpp.MyNamespace.long = 1; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_lookup_in_other_scopes.carbon:[[@LINE+4]]:21: error: member name `long` not found in `Cpp.MyNamespace` [MemberNameNotFoundInInstScope] + // CHECK:STDERR: let unused long : Cpp.MyNamespace.long = 1; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let long : Cpp.MyNamespace.long = 1; + let unused long : Cpp.MyNamespace.long = 1; } // --- override_builtin.carbon @@ -107,7 +107,7 @@ struct unsigned_int { fn F() { //@dump-sem-ir-begin var unsigned_int : Cpp.unsigned_int; - let x: u32 = unsigned_int.foo(); + let unused x: u32 = unsigned_int.foo(); //@dump-sem-ir-end } @@ -595,13 +595,13 @@ fn F() { // CHECK:STDOUT: %foo.ref: %unsigned_int.foo.cpp_overload_set.type = name_ref foo, imports.%unsigned_int.foo.cpp_overload_set.value [concrete = constants.%unsigned_int.foo.cpp_overload_set.value] // CHECK:STDOUT: %bound_method: = bound_method %unsigned_int.ref.loc13, %foo.ref // CHECK:STDOUT: %unsigned_int.foo.call: init %u32 = call imports.%unsigned_int.foo.decl(%unsigned_int.ref.loc13) -// CHECK:STDOUT: %.loc13_10: type = splice_block %u32 [concrete = constants.%u32] { +// CHECK:STDOUT: %.loc13_17: type = splice_block %u32 [concrete = constants.%u32] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [concrete = constants.%u32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13_33.1: %u32 = value_of_initializer %unsigned_int.foo.call -// CHECK:STDOUT: %.loc13_33.2: %u32 = converted %unsigned_int.foo.call, %.loc13_33.1 -// CHECK:STDOUT: %x: %u32 = value_binding x, %.loc13_33.2 +// CHECK:STDOUT: %.loc13_40.1: %u32 = value_of_initializer %unsigned_int.foo.call +// CHECK:STDOUT: %.loc13_40.2: %u32 = converted %unsigned_int.foo.call, %.loc13_40.1 +// CHECK:STDOUT: %x: %u32 = value_binding x, %.loc13_40.2 // CHECK:STDOUT: %unsigned_int.cpp_destructor.bound: = bound_method %unsigned_int.var, constants.%unsigned_int.cpp_destructor // CHECK:STDOUT: %unsigned_int.cpp_destructor.call: init %empty_tuple.type = call %unsigned_int.cpp_destructor.bound(%unsigned_int.var) // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/builtins.llp64.carbon b/toolchain/check/testdata/interop/cpp/builtins.llp64.carbon index af2f264c9545..7d6abe760eea 100644 --- a/toolchain/check/testdata/interop/cpp/builtins.llp64.carbon +++ b/toolchain/check/testdata/interop/cpp/builtins.llp64.carbon @@ -20,9 +20,9 @@ import Cpp; fn F() { //@dump-sem-ir-begin let cpp_long_long: Cpp.long_long = 1; - let carbon_long_long: i64 = cpp_long_long; + let unused carbon_long_long: i64 = cpp_long_long; - var a: array(f32, 1 as Cpp.long_long) = (1.0,); + var unused a: array(f32, 1 as Cpp.long_long) = (1.0,); //@dump-sem-ir-end } @@ -35,9 +35,9 @@ import Cpp; fn F() { //@dump-sem-ir-begin let cpp_unsigned_long_long: Cpp.unsigned_long_long = 1; - let carbon_unsigned_long_long: u64 = cpp_unsigned_long_long; + let unused carbon_unsigned_long_long: u64 = cpp_unsigned_long_long; - var a: array(f32, 1 as Cpp.unsigned_long_long) = (1.0,); + var unused a: array(f32, 1 as Cpp.unsigned_long_long) = (1.0,); //@dump-sem-ir-end } @@ -57,17 +57,17 @@ auto PassLong(int x) -> IntResult; fn F() { //@dump-sem-ir-begin let cpp_long: Cpp.long = 1; - let cpp_long_result: Cpp.LongResult = Cpp.PassLong(cpp_long); + let unused cpp_long_result: Cpp.LongResult = Cpp.PassLong(cpp_long); let cpp_compat_long: Core.CppCompat.Long32 = cpp_long; - let cpp_compat_long_result: Cpp.LongResult = Cpp.PassLong(cpp_compat_long); + let unused cpp_compat_long_result: Cpp.LongResult = Cpp.PassLong(cpp_compat_long); let carbon_i32: i32 = cpp_long as i32; - let carbon_i32_result: Cpp.IntResult = Cpp.PassLong(carbon_i32); + let unused carbon_i32_result: Cpp.IntResult = Cpp.PassLong(carbon_i32); - let carbon_i64: i64 = cpp_long; + let unused carbon_i64: i64 = cpp_long; - var a: array(f32, 1 as Cpp.long) = (1.0,); + var unused a: array(f32, 1 as Cpp.long) = (1.0,); //@dump-sem-ir-end } @@ -79,14 +79,14 @@ import Cpp; fn F() { let cpp_long: Cpp.long = 1; - // CHECK:STDERR: fail_implicit_conversion_long_to_i32.carbon:[[@LINE+7]]:25: error: cannot implicitly convert expression of type `Cpp.long` to `i32` [ConversionFailure] - // CHECK:STDERR: let carbon_i32: i32 = cpp_long; - // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_implicit_conversion_long_to_i32.carbon:[[@LINE+4]]:25: note: type `Cpp.long` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let carbon_i32: i32 = cpp_long; - // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: fail_implicit_conversion_long_to_i32.carbon:[[@LINE+7]]:32: error: cannot implicitly convert expression of type `Cpp.long` to `i32` [ConversionFailure] + // CHECK:STDERR: let unused carbon_i32: i32 = cpp_long; + // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: fail_implicit_conversion_long_to_i32.carbon:[[@LINE+4]]:32: note: type `Cpp.long` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused carbon_i32: i32 = cpp_long; + // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: - let carbon_i32: i32 = cpp_long; + let unused carbon_i32: i32 = cpp_long; } // --- copy_long.carbon @@ -98,7 +98,7 @@ import Cpp; fn CopyLong() { //@dump-sem-ir-begin var a: Cpp.long = 1; - var b: Cpp.long = a; + var unused b: Cpp.long = a; //@dump-sem-ir-end } @@ -241,12 +241,12 @@ fn ArithmeticHomogeneousLong() { let x: Cpp.long = 1; let y: Cpp.long = 1; - let a: Cpp.long = -x; - let b: Cpp.long = x + y; - let c: Cpp.long = x - y; - let d: Cpp.long = x * y; - let e: Cpp.long = x / y; - let f: Cpp.long = x % y; + let unused a: Cpp.long = -x; + let unused b: Cpp.long = x + y; + let unused c: Cpp.long = x - y; + let unused d: Cpp.long = x * y; + let unused e: Cpp.long = x / y; + let unused f: Cpp.long = x % y; //@dump-sem-ir-end } @@ -256,7 +256,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn ArithmeticHeterogeneousLongLeftSide() { let b: i32 = 1; @@ -281,7 +281,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn ArithmeticHeterogeneousLongRightSide() { let b: i32 = 1; @@ -305,7 +305,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn ArithmeticHeterogeneousLongAndI64() { let x: Cpp.long = 1; @@ -320,7 +320,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn ArithmeticHeterogeneousLongAndI16() { let x: Cpp.long = 1; @@ -344,7 +344,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn ArithmeticHeterogeneousLongAndI128() { let x: Cpp.long = 1; @@ -368,7 +368,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn BitWiseHomogeneousLong() { let a: Cpp.long = 1; @@ -389,7 +389,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn BitWiseHeterogeneousLongLeftSide() { let b: i32 = 1; @@ -414,7 +414,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn BitWiseHeterogeneousLongRightSide() { let b: i32 = 1; @@ -439,7 +439,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn BitWiseHeterogeneousLongAndI64() { let a: Cpp.long = 1; @@ -455,7 +455,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn BitWiseHeterogeneousLongAndI16() { let a: Cpp.long = 1; @@ -479,7 +479,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn BitWiseHeterogeneousLongAndI128() { let a: Cpp.long = 1; @@ -633,15 +633,15 @@ auto PassULong(unsigned int x) -> UIntResult; fn F() { //@dump-sem-ir-begin let cpp_unsigned_long: Cpp.unsigned_long = 1; - let cpp_unsigned_long_result: Cpp.ULongResult = Cpp.PassULong(cpp_unsigned_long); + let unused cpp_unsigned_long_result: Cpp.ULongResult = Cpp.PassULong(cpp_unsigned_long); let cpp_compat_ulong: Core.CppCompat.ULong32 = cpp_unsigned_long; - let cpp_compat_ulong_result: Cpp.ULongResult = Cpp.PassULong(cpp_compat_ulong); + let unused cpp_compat_ulong_result: Cpp.ULongResult = Cpp.PassULong(cpp_compat_ulong); let carbon_u32: u32 = cpp_unsigned_long; - let carbon_u32_result: Cpp.UIntResult = Cpp.PassULong(carbon_u32); + let unused carbon_u32_result: Cpp.UIntResult = Cpp.PassULong(carbon_u32); - var a: array(f32, 1 as Cpp.unsigned_long) = (1.0,); + var unused a: array(f32, 1 as Cpp.unsigned_long) = (1.0,); //@dump-sem-ir-end } @@ -654,7 +654,7 @@ import Cpp; fn CopyUnsignedLong() { //@dump-sem-ir-begin var a: Cpp.unsigned_long = 1; - var b: Cpp.unsigned_long = a; + var unused b: Cpp.unsigned_long = a; //@dump-sem-ir-end } @@ -781,40 +781,40 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %array_type = var %a.var_patt // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float.674] -// CHECK:STDOUT: %.loc11_48.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] -// CHECK:STDOUT: %impl.elem0.loc11_48: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] -// CHECK:STDOUT: %bound_method.loc11_48.1: = bound_method %float, %impl.elem0.loc11_48 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc11_48: = specific_function %impl.elem0.loc11_48, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc11_48.2: = bound_method %float, %specific_fn.loc11_48 [concrete = constants.%bound_method.1e4] -// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc11_48.2(%float) [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc11_48.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc11_55.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] +// CHECK:STDOUT: %impl.elem0.loc11_55: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] +// CHECK:STDOUT: %bound_method.loc11_55.1: = bound_method %float, %impl.elem0.loc11_55 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc11_55: = specific_function %impl.elem0.loc11_55, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_55.2: = bound_method %float, %specific_fn.loc11_55 [concrete = constants.%bound_method.1e4] +// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc11_55.2(%float) [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc11_55.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc11_48.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc11_48.4: init %f32.97e to %.loc11_48.3 = in_place_init %.loc11_48.2 [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc11_48.5: init %array_type to %a.var = array_init (%.loc11_48.4) [concrete = constants.%array] -// CHECK:STDOUT: %.loc11_3: init %array_type = converted %.loc11_48.1, %.loc11_48.5 [concrete = constants.%array] +// CHECK:STDOUT: %.loc11_55.3: ref %f32.97e = array_index %a.var, %int_0 +// CHECK:STDOUT: %.loc11_55.4: init %f32.97e to %.loc11_55.3 = in_place_init %.loc11_55.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc11_55.5: init %array_type to %a.var = array_init (%.loc11_55.4) [concrete = constants.%array] +// CHECK:STDOUT: %.loc11_3: init %array_type = converted %.loc11_55.1, %.loc11_55.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc11_3 -// CHECK:STDOUT: %.loc11_39: type = splice_block %array_type [concrete = constants.%array_type] { +// CHECK:STDOUT: %.loc11_46: type = splice_block %array_type [concrete = constants.%array_type] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %f32: type = class_type @Float, @Float(constants.%int_32) [concrete = constants.%f32.97e] // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %Cpp.ref.loc11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %long_long.ref.loc11: type = name_ref long_long, %i64.1 [concrete = constants.%i64] -// CHECK:STDOUT: %impl.elem0.loc11_23.1: %.fc7 = impl_witness_access constants.%As.impl_witness.c71, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.a54] -// CHECK:STDOUT: %bound_method.loc11_23.1: = bound_method %int_1.loc11, %impl.elem0.loc11_23.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc11_23.1: = specific_function %impl.elem0.loc11_23.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc11_23.2: = bound_method %int_1.loc11, %specific_fn.loc11_23.1 [concrete = constants.%bound_method.41b] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i64 = call %bound_method.loc11_23.2(%int_1.loc11) [concrete = constants.%int_1.41a] -// CHECK:STDOUT: %.loc11_23.1: %i64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.41a] -// CHECK:STDOUT: %.loc11_23.2: %i64 = converted %int_1.loc11, %.loc11_23.1 [concrete = constants.%int_1.41a] -// CHECK:STDOUT: %impl.elem0.loc11_23.2: %.495 = impl_witness_access constants.%ImplicitAs.impl_witness.e86, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.535] -// CHECK:STDOUT: %bound_method.loc11_23.3: = bound_method %.loc11_23.2, %impl.elem0.loc11_23.2 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc11_23.2: = specific_function %impl.elem0.loc11_23.2, @Int.as.ImplicitAs.impl.Convert(constants.%int_64) [concrete = constants.%Int.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc11_23.4: = bound_method %.loc11_23.2, %specific_fn.loc11_23.2 [concrete = constants.%bound_method.d1e] -// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.loc11_23.4(%.loc11_23.2) [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc11_23.3: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc11_23.4: Core.IntLiteral = converted %.loc11_23.2, %.loc11_23.3 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %array_type: type = array_type %.loc11_23.4, %f32 [concrete = constants.%array_type] +// CHECK:STDOUT: %impl.elem0.loc11_30.1: %.fc7 = impl_witness_access constants.%As.impl_witness.c71, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.a54] +// CHECK:STDOUT: %bound_method.loc11_30.1: = bound_method %int_1.loc11, %impl.elem0.loc11_30.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc11_30.1: = specific_function %impl.elem0.loc11_30.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_30.2: = bound_method %int_1.loc11, %specific_fn.loc11_30.1 [concrete = constants.%bound_method.41b] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i64 = call %bound_method.loc11_30.2(%int_1.loc11) [concrete = constants.%int_1.41a] +// CHECK:STDOUT: %.loc11_30.1: %i64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.41a] +// CHECK:STDOUT: %.loc11_30.2: %i64 = converted %int_1.loc11, %.loc11_30.1 [concrete = constants.%int_1.41a] +// CHECK:STDOUT: %impl.elem0.loc11_30.2: %.495 = impl_witness_access constants.%ImplicitAs.impl_witness.e86, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.535] +// CHECK:STDOUT: %bound_method.loc11_30.3: = bound_method %.loc11_30.2, %impl.elem0.loc11_30.2 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc11_30.2: = specific_function %impl.elem0.loc11_30.2, @Int.as.ImplicitAs.impl.Convert(constants.%int_64) [concrete = constants.%Int.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_30.4: = bound_method %.loc11_30.2, %specific_fn.loc11_30.2 [concrete = constants.%bound_method.d1e] +// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.loc11_30.4(%.loc11_30.2) [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc11_30.3: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc11_30.4: Core.IntLiteral = converted %.loc11_30.2, %.loc11_30.3 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %array_type: type = array_type %.loc11_30.4, %f32 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %a.var, constants.%DestroyOp @@ -947,40 +947,40 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %array_type = var %a.var_patt // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float.674] -// CHECK:STDOUT: %.loc11_57.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] -// CHECK:STDOUT: %impl.elem0.loc11_57: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] -// CHECK:STDOUT: %bound_method.loc11_57.1: = bound_method %float, %impl.elem0.loc11_57 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc11_57: = specific_function %impl.elem0.loc11_57, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc11_57.2: = bound_method %float, %specific_fn.loc11_57 [concrete = constants.%bound_method.1e4] -// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc11_57.2(%float) [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc11_57.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc11_64.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] +// CHECK:STDOUT: %impl.elem0.loc11_64: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] +// CHECK:STDOUT: %bound_method.loc11_64.1: = bound_method %float, %impl.elem0.loc11_64 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc11_64: = specific_function %impl.elem0.loc11_64, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_64.2: = bound_method %float, %specific_fn.loc11_64 [concrete = constants.%bound_method.1e4] +// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc11_64.2(%float) [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc11_64.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc11_57.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc11_57.4: init %f32.97e to %.loc11_57.3 = in_place_init %.loc11_57.2 [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc11_57.5: init %array_type to %a.var = array_init (%.loc11_57.4) [concrete = constants.%array] -// CHECK:STDOUT: %.loc11_3: init %array_type = converted %.loc11_57.1, %.loc11_57.5 [concrete = constants.%array] +// CHECK:STDOUT: %.loc11_64.3: ref %f32.97e = array_index %a.var, %int_0 +// CHECK:STDOUT: %.loc11_64.4: init %f32.97e to %.loc11_64.3 = in_place_init %.loc11_64.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc11_64.5: init %array_type to %a.var = array_init (%.loc11_64.4) [concrete = constants.%array] +// CHECK:STDOUT: %.loc11_3: init %array_type = converted %.loc11_64.1, %.loc11_64.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc11_3 -// CHECK:STDOUT: %.loc11_48: type = splice_block %array_type [concrete = constants.%array_type] { +// CHECK:STDOUT: %.loc11_55: type = splice_block %array_type [concrete = constants.%array_type] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %f32: type = class_type @Float, @Float(constants.%int_32) [concrete = constants.%f32.97e] // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %Cpp.ref.loc11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %unsigned_long_long.ref.loc11: type = name_ref unsigned_long_long, %u64.1 [concrete = constants.%u64] -// CHECK:STDOUT: %impl.elem0.loc11_23.1: %.904 = impl_witness_access constants.%As.impl_witness.f54, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.715] -// CHECK:STDOUT: %bound_method.loc11_23.1: = bound_method %int_1.loc11, %impl.elem0.loc11_23.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc11_23.1: = specific_function %impl.elem0.loc11_23.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc11_23.2: = bound_method %int_1.loc11, %specific_fn.loc11_23.1 [concrete = constants.%bound_method.9cf] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %u64 = call %bound_method.loc11_23.2(%int_1.loc11) [concrete = constants.%int_1.f23] -// CHECK:STDOUT: %.loc11_23.1: %u64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.f23] -// CHECK:STDOUT: %.loc11_23.2: %u64 = converted %int_1.loc11, %.loc11_23.1 [concrete = constants.%int_1.f23] -// CHECK:STDOUT: %impl.elem0.loc11_23.2: %.74a = impl_witness_access constants.%ImplicitAs.impl_witness.2cc, element0 [concrete = constants.%UInt.as.ImplicitAs.impl.Convert.309] -// CHECK:STDOUT: %bound_method.loc11_23.3: = bound_method %.loc11_23.2, %impl.elem0.loc11_23.2 [concrete = constants.%UInt.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc11_23.2: = specific_function %impl.elem0.loc11_23.2, @UInt.as.ImplicitAs.impl.Convert(constants.%int_64) [concrete = constants.%UInt.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc11_23.4: = bound_method %.loc11_23.2, %specific_fn.loc11_23.2 [concrete = constants.%bound_method.f18] -// CHECK:STDOUT: %UInt.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.loc11_23.4(%.loc11_23.2) [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc11_23.3: Core.IntLiteral = value_of_initializer %UInt.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc11_23.4: Core.IntLiteral = converted %.loc11_23.2, %.loc11_23.3 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %array_type: type = array_type %.loc11_23.4, %f32 [concrete = constants.%array_type] +// CHECK:STDOUT: %impl.elem0.loc11_30.1: %.904 = impl_witness_access constants.%As.impl_witness.f54, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.715] +// CHECK:STDOUT: %bound_method.loc11_30.1: = bound_method %int_1.loc11, %impl.elem0.loc11_30.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc11_30.1: = specific_function %impl.elem0.loc11_30.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_30.2: = bound_method %int_1.loc11, %specific_fn.loc11_30.1 [concrete = constants.%bound_method.9cf] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %u64 = call %bound_method.loc11_30.2(%int_1.loc11) [concrete = constants.%int_1.f23] +// CHECK:STDOUT: %.loc11_30.1: %u64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.f23] +// CHECK:STDOUT: %.loc11_30.2: %u64 = converted %int_1.loc11, %.loc11_30.1 [concrete = constants.%int_1.f23] +// CHECK:STDOUT: %impl.elem0.loc11_30.2: %.74a = impl_witness_access constants.%ImplicitAs.impl_witness.2cc, element0 [concrete = constants.%UInt.as.ImplicitAs.impl.Convert.309] +// CHECK:STDOUT: %bound_method.loc11_30.3: = bound_method %.loc11_30.2, %impl.elem0.loc11_30.2 [concrete = constants.%UInt.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc11_30.2: = specific_function %impl.elem0.loc11_30.2, @UInt.as.ImplicitAs.impl.Convert(constants.%int_64) [concrete = constants.%UInt.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_30.4: = bound_method %.loc11_30.2, %specific_fn.loc11_30.2 [concrete = constants.%bound_method.f18] +// CHECK:STDOUT: %UInt.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.loc11_30.4(%.loc11_30.2) [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc11_30.3: Core.IntLiteral = value_of_initializer %UInt.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc11_30.4: Core.IntLiteral = converted %.loc11_30.2, %.loc11_30.3 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %array_type: type = array_type %.loc11_30.4, %f32 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %a.var, constants.%DestroyOp @@ -1160,20 +1160,20 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %cpp_long_result.patt: %pattern_type.cd9 = value_binding_pattern cpp_long_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc16_41: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc16_48: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %PassLong.ref.loc16: %PassLong.cpp_overload_set.type = name_ref PassLong, imports.%PassLong.cpp_overload_set.value [concrete = constants.%PassLong.cpp_overload_set.value] // CHECK:STDOUT: %cpp_long.ref.loc16: %Cpp.long = name_ref cpp_long, %cpp_long -// CHECK:STDOUT: %.loc16_62.1: ref %LongResult = temporary_storage -// CHECK:STDOUT: %addr.loc16: %ptr.305 = addr_of %.loc16_62.1 +// CHECK:STDOUT: %.loc16_69.1: ref %LongResult = temporary_storage +// CHECK:STDOUT: %addr.loc16: %ptr.305 = addr_of %.loc16_69.1 // CHECK:STDOUT: %PassLong__carbon_thunk.call.loc16: init %empty_tuple.type = call imports.%PassLong__carbon_thunk.decl.d16229.1(%cpp_long.ref.loc16, %addr.loc16) -// CHECK:STDOUT: %.loc16_62.2: init %LongResult to %.loc16_62.1 = mark_in_place_init %PassLong__carbon_thunk.call.loc16 -// CHECK:STDOUT: %.loc16_27: type = splice_block %LongResult.ref.loc16 [concrete = constants.%LongResult] { -// CHECK:STDOUT: %Cpp.ref.loc16_24: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc16_69.2: init %LongResult to %.loc16_69.1 = mark_in_place_init %PassLong__carbon_thunk.call.loc16 +// CHECK:STDOUT: %.loc16_34: type = splice_block %LongResult.ref.loc16 [concrete = constants.%LongResult] { +// CHECK:STDOUT: %Cpp.ref.loc16_31: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %LongResult.ref.loc16: type = name_ref LongResult, imports.%LongResult.decl [concrete = constants.%LongResult] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc16_62.3: ref %LongResult = temporary %.loc16_62.1, %.loc16_62.2 -// CHECK:STDOUT: %.loc16_62.4: %LongResult = acquire_value %.loc16_62.3 -// CHECK:STDOUT: %cpp_long_result: %LongResult = value_binding cpp_long_result, %.loc16_62.4 +// CHECK:STDOUT: %.loc16_69.3: ref %LongResult = temporary %.loc16_69.1, %.loc16_69.2 +// CHECK:STDOUT: %.loc16_69.4: %LongResult = acquire_value %.loc16_69.3 +// CHECK:STDOUT: %cpp_long_result: %LongResult = value_binding cpp_long_result, %.loc16_69.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %cpp_compat_long.patt: %pattern_type.68c = value_binding_pattern cpp_compat_long [concrete] // CHECK:STDOUT: } @@ -1187,20 +1187,20 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %cpp_compat_long_result.patt: %pattern_type.cd9 = value_binding_pattern cpp_compat_long_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc19_48: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc19_55: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %PassLong.ref.loc19: %PassLong.cpp_overload_set.type = name_ref PassLong, imports.%PassLong.cpp_overload_set.value [concrete = constants.%PassLong.cpp_overload_set.value] // CHECK:STDOUT: %cpp_compat_long.ref: %Cpp.long = name_ref cpp_compat_long, %cpp_compat_long -// CHECK:STDOUT: %.loc19_76.1: ref %LongResult = temporary_storage -// CHECK:STDOUT: %addr.loc19: %ptr.305 = addr_of %.loc19_76.1 +// CHECK:STDOUT: %.loc19_83.1: ref %LongResult = temporary_storage +// CHECK:STDOUT: %addr.loc19: %ptr.305 = addr_of %.loc19_83.1 // CHECK:STDOUT: %PassLong__carbon_thunk.call.loc19: init %empty_tuple.type = call imports.%PassLong__carbon_thunk.decl.d16229.1(%cpp_compat_long.ref, %addr.loc19) -// CHECK:STDOUT: %.loc19_76.2: init %LongResult to %.loc19_76.1 = mark_in_place_init %PassLong__carbon_thunk.call.loc19 -// CHECK:STDOUT: %.loc19_34: type = splice_block %LongResult.ref.loc19 [concrete = constants.%LongResult] { -// CHECK:STDOUT: %Cpp.ref.loc19_31: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc19_83.2: init %LongResult to %.loc19_83.1 = mark_in_place_init %PassLong__carbon_thunk.call.loc19 +// CHECK:STDOUT: %.loc19_41: type = splice_block %LongResult.ref.loc19 [concrete = constants.%LongResult] { +// CHECK:STDOUT: %Cpp.ref.loc19_38: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %LongResult.ref.loc19: type = name_ref LongResult, imports.%LongResult.decl [concrete = constants.%LongResult] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19_76.3: ref %LongResult = temporary %.loc19_76.1, %.loc19_76.2 -// CHECK:STDOUT: %.loc19_76.4: %LongResult = acquire_value %.loc19_76.3 -// CHECK:STDOUT: %cpp_compat_long_result: %LongResult = value_binding cpp_compat_long_result, %.loc19_76.4 +// CHECK:STDOUT: %.loc19_83.3: ref %LongResult = temporary %.loc19_83.1, %.loc19_83.2 +// CHECK:STDOUT: %.loc19_83.4: %LongResult = acquire_value %.loc19_83.3 +// CHECK:STDOUT: %cpp_compat_long_result: %LongResult = value_binding cpp_compat_long_result, %.loc19_83.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %carbon_i32.patt: %pattern_type.7ce = value_binding_pattern carbon_i32 [concrete] // CHECK:STDOUT: } @@ -1217,80 +1217,80 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %carbon_i32_result.patt: %pattern_type.454 = value_binding_pattern carbon_i32_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc22_42: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc22_49: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %PassLong.ref.loc22: %PassLong.cpp_overload_set.type = name_ref PassLong, imports.%PassLong.cpp_overload_set.value [concrete = constants.%PassLong.cpp_overload_set.value] // CHECK:STDOUT: %carbon_i32.ref: %i32 = name_ref carbon_i32, %carbon_i32 -// CHECK:STDOUT: %.loc22_65.1: ref %IntResult = temporary_storage -// CHECK:STDOUT: %addr.loc22: %ptr.3cb = addr_of %.loc22_65.1 +// CHECK:STDOUT: %.loc22_72.1: ref %IntResult = temporary_storage +// CHECK:STDOUT: %addr.loc22: %ptr.3cb = addr_of %.loc22_72.1 // CHECK:STDOUT: %PassLong__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%PassLong__carbon_thunk.decl.d16229.2(%carbon_i32.ref, %addr.loc22) -// CHECK:STDOUT: %.loc22_65.2: init %IntResult to %.loc22_65.1 = mark_in_place_init %PassLong__carbon_thunk.call.loc22 -// CHECK:STDOUT: %.loc22_29: type = splice_block %IntResult.ref [concrete = constants.%IntResult] { -// CHECK:STDOUT: %Cpp.ref.loc22_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc22_72.2: init %IntResult to %.loc22_72.1 = mark_in_place_init %PassLong__carbon_thunk.call.loc22 +// CHECK:STDOUT: %.loc22_36: type = splice_block %IntResult.ref [concrete = constants.%IntResult] { +// CHECK:STDOUT: %Cpp.ref.loc22_33: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %IntResult.ref: type = name_ref IntResult, imports.%IntResult.decl [concrete = constants.%IntResult] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22_65.3: ref %IntResult = temporary %.loc22_65.1, %.loc22_65.2 -// CHECK:STDOUT: %.loc22_65.4: %IntResult = acquire_value %.loc22_65.3 -// CHECK:STDOUT: %carbon_i32_result: %IntResult = value_binding carbon_i32_result, %.loc22_65.4 +// CHECK:STDOUT: %.loc22_72.3: ref %IntResult = temporary %.loc22_72.1, %.loc22_72.2 +// CHECK:STDOUT: %.loc22_72.4: %IntResult = acquire_value %.loc22_72.3 +// CHECK:STDOUT: %carbon_i32_result: %IntResult = value_binding carbon_i32_result, %.loc22_72.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %carbon_i64.patt: %pattern_type.95b = value_binding_pattern carbon_i64 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %cpp_long.ref.loc24: %Cpp.long = name_ref cpp_long, %cpp_long -// CHECK:STDOUT: %.loc24_19: type = splice_block %i64 [concrete = constants.%i64] { +// CHECK:STDOUT: %.loc24_26: type = splice_block %i64 [concrete = constants.%i64] { // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] // CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc24: %.12d = impl_witness_access constants.%ImplicitAs.impl_witness.bbc, element0 [concrete = constants.%Cpp.long.as.ImplicitAs.impl.Convert.bbf] // CHECK:STDOUT: %bound_method.loc24: = bound_method %cpp_long.ref.loc24, %impl.elem0.loc24 // CHECK:STDOUT: %Cpp.long.as.ImplicitAs.impl.Convert.call.loc24: init %i64 = call %bound_method.loc24(%cpp_long.ref.loc24) -// CHECK:STDOUT: %.loc24_25.1: %i64 = value_of_initializer %Cpp.long.as.ImplicitAs.impl.Convert.call.loc24 -// CHECK:STDOUT: %.loc24_25.2: %i64 = converted %cpp_long.ref.loc24, %.loc24_25.1 -// CHECK:STDOUT: %carbon_i64: %i64 = value_binding carbon_i64, %.loc24_25.2 +// CHECK:STDOUT: %.loc24_32.1: %i64 = value_of_initializer %Cpp.long.as.ImplicitAs.impl.Convert.call.loc24 +// CHECK:STDOUT: %.loc24_32.2: %i64 = converted %cpp_long.ref.loc24, %.loc24_32.1 +// CHECK:STDOUT: %carbon_i64: %i64 = value_binding carbon_i64, %.loc24_32.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.b36 = ref_binding_pattern a [concrete] // CHECK:STDOUT: %a.var_patt: %pattern_type.b36 = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %array_type = var %a.var_patt // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float.674] -// CHECK:STDOUT: %.loc26_43.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] -// CHECK:STDOUT: %impl.elem0.loc26_43: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] -// CHECK:STDOUT: %bound_method.loc26_43.1: = bound_method %float, %impl.elem0.loc26_43 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc26_43, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc26_43.2: = bound_method %float, %specific_fn [concrete = constants.%bound_method] -// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc26_43.2(%float) [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc26_43.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc26_50.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] +// CHECK:STDOUT: %impl.elem0.loc26_50: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] +// CHECK:STDOUT: %bound_method.loc26_50.1: = bound_method %float, %impl.elem0.loc26_50 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc26_50, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc26_50.2: = bound_method %float, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc26_50.2(%float) [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc26_50.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc26_43.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc26_43.4: init %f32.97e to %.loc26_43.3 = in_place_init %.loc26_43.2 [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc26_43.5: init %array_type to %a.var = array_init (%.loc26_43.4) [concrete = constants.%array] -// CHECK:STDOUT: %.loc26_3: init %array_type = converted %.loc26_43.1, %.loc26_43.5 [concrete = constants.%array] +// CHECK:STDOUT: %.loc26_50.3: ref %f32.97e = array_index %a.var, %int_0 +// CHECK:STDOUT: %.loc26_50.4: init %f32.97e to %.loc26_50.3 = in_place_init %.loc26_50.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc26_50.5: init %array_type to %a.var = array_init (%.loc26_50.4) [concrete = constants.%array] +// CHECK:STDOUT: %.loc26_3: init %array_type = converted %.loc26_50.1, %.loc26_50.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc26_3 -// CHECK:STDOUT: %.loc26_34: type = splice_block %array_type [concrete = constants.%array_type] { +// CHECK:STDOUT: %.loc26_41: type = splice_block %array_type [concrete = constants.%array_type] { // CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %f32: type = class_type @Float, @Float(constants.%int_32) [concrete = constants.%f32.97e] // CHECK:STDOUT: %int_1.loc26: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %Cpp.ref.loc26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %long.ref.loc26: type = name_ref long, constants.%Cpp.long [concrete = constants.%Cpp.long] -// CHECK:STDOUT: %impl.elem0.loc26_23.1: %.a3d = impl_witness_access constants.%As.impl_witness.60c, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert] -// CHECK:STDOUT: %bound_method.loc26_23.1: = bound_method %int_1.loc26, %impl.elem0.loc26_23.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %Cpp.long = call %bound_method.loc26_23.1(%int_1.loc26) [concrete = constants.%int_1.5a4] -// CHECK:STDOUT: %.loc26_23.1: %Cpp.long = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.5a4] -// CHECK:STDOUT: %.loc26_23.2: %Cpp.long = converted %int_1.loc26, %.loc26_23.1 [concrete = constants.%int_1.5a4] -// CHECK:STDOUT: %impl.elem0.loc26_23.2: %.7f4 = impl_witness_access constants.%ImplicitAs.impl_witness.e4d, element0 [concrete = constants.%Cpp.long.as.ImplicitAs.impl.Convert.d49] -// CHECK:STDOUT: %bound_method.loc26_23.2: = bound_method %.loc26_23.2, %impl.elem0.loc26_23.2 [concrete = constants.%Cpp.long.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %Cpp.long.as.ImplicitAs.impl.Convert.call.loc26: init Core.IntLiteral = call %bound_method.loc26_23.2(%.loc26_23.2) [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc26_23.3: Core.IntLiteral = value_of_initializer %Cpp.long.as.ImplicitAs.impl.Convert.call.loc26 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc26_23.4: Core.IntLiteral = converted %.loc26_23.2, %.loc26_23.3 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %array_type: type = array_type %.loc26_23.4, %f32 [concrete = constants.%array_type] +// CHECK:STDOUT: %impl.elem0.loc26_30.1: %.a3d = impl_witness_access constants.%As.impl_witness.60c, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert] +// CHECK:STDOUT: %bound_method.loc26_30.1: = bound_method %int_1.loc26, %impl.elem0.loc26_30.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %Cpp.long = call %bound_method.loc26_30.1(%int_1.loc26) [concrete = constants.%int_1.5a4] +// CHECK:STDOUT: %.loc26_30.1: %Cpp.long = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.5a4] +// CHECK:STDOUT: %.loc26_30.2: %Cpp.long = converted %int_1.loc26, %.loc26_30.1 [concrete = constants.%int_1.5a4] +// CHECK:STDOUT: %impl.elem0.loc26_30.2: %.7f4 = impl_witness_access constants.%ImplicitAs.impl_witness.e4d, element0 [concrete = constants.%Cpp.long.as.ImplicitAs.impl.Convert.d49] +// CHECK:STDOUT: %bound_method.loc26_30.2: = bound_method %.loc26_30.2, %impl.elem0.loc26_30.2 [concrete = constants.%Cpp.long.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %Cpp.long.as.ImplicitAs.impl.Convert.call.loc26: init Core.IntLiteral = call %bound_method.loc26_30.2(%.loc26_30.2) [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc26_30.3: Core.IntLiteral = value_of_initializer %Cpp.long.as.ImplicitAs.impl.Convert.call.loc26 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc26_30.4: Core.IntLiteral = converted %.loc26_30.2, %.loc26_30.3 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %array_type: type = array_type %.loc26_30.4, %f32 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %a.var, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%a.var) -// CHECK:STDOUT: %IntResult.cpp_destructor.bound: = bound_method %.loc22_65.3, constants.%IntResult.cpp_destructor -// CHECK:STDOUT: %IntResult.cpp_destructor.call: init %empty_tuple.type = call %IntResult.cpp_destructor.bound(%.loc22_65.3) -// CHECK:STDOUT: %LongResult.cpp_destructor.bound.loc19: = bound_method %.loc19_76.3, constants.%LongResult.cpp_destructor -// CHECK:STDOUT: %LongResult.cpp_destructor.call.loc19: init %empty_tuple.type = call %LongResult.cpp_destructor.bound.loc19(%.loc19_76.3) -// CHECK:STDOUT: %LongResult.cpp_destructor.bound.loc16: = bound_method %.loc16_62.3, constants.%LongResult.cpp_destructor -// CHECK:STDOUT: %LongResult.cpp_destructor.call.loc16: init %empty_tuple.type = call %LongResult.cpp_destructor.bound.loc16(%.loc16_62.3) +// CHECK:STDOUT: %IntResult.cpp_destructor.bound: = bound_method %.loc22_72.3, constants.%IntResult.cpp_destructor +// CHECK:STDOUT: %IntResult.cpp_destructor.call: init %empty_tuple.type = call %IntResult.cpp_destructor.bound(%.loc22_72.3) +// CHECK:STDOUT: %LongResult.cpp_destructor.bound.loc19: = bound_method %.loc19_83.3, constants.%LongResult.cpp_destructor +// CHECK:STDOUT: %LongResult.cpp_destructor.call.loc19: init %empty_tuple.type = call %LongResult.cpp_destructor.bound.loc19(%.loc19_83.3) +// CHECK:STDOUT: %LongResult.cpp_destructor.bound.loc16: = bound_method %.loc16_69.3, constants.%LongResult.cpp_destructor +// CHECK:STDOUT: %LongResult.cpp_destructor.call.loc16: init %empty_tuple.type = call %LongResult.cpp_destructor.bound.loc16(%.loc16_69.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1358,12 +1358,12 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref %Cpp.long = var %b.var_patt // CHECK:STDOUT: %a.ref: ref %Cpp.long = name_ref a, %a -// CHECK:STDOUT: %.loc9_21: %Cpp.long = acquire_value %a.ref +// CHECK:STDOUT: %.loc9_28: %Cpp.long = acquire_value %a.ref // CHECK:STDOUT: %impl.elem0.loc9: %.539 = impl_witness_access constants.%Copy.impl_witness.e75, element0 [concrete = constants.%Cpp.long.as.Copy.impl.Op] -// CHECK:STDOUT: %bound_method.loc9: = bound_method %.loc9_21, %impl.elem0.loc9 -// CHECK:STDOUT: %Cpp.long.as.Copy.impl.Op.call: init %Cpp.long = call %bound_method.loc9(%.loc9_21) +// CHECK:STDOUT: %bound_method.loc9: = bound_method %.loc9_28, %impl.elem0.loc9 +// CHECK:STDOUT: %Cpp.long.as.Copy.impl.Op.call: init %Cpp.long = call %bound_method.loc9(%.loc9_28) // CHECK:STDOUT: assign %b.var, %Cpp.long.as.Copy.impl.Op.call -// CHECK:STDOUT: %.loc9_13: type = splice_block %long.ref.loc9 [concrete = constants.%Cpp.long] { +// CHECK:STDOUT: %.loc9_20: type = splice_block %long.ref.loc9 [concrete = constants.%Cpp.long] { // CHECK:STDOUT: %Cpp.ref.loc9: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %long.ref.loc9: type = name_ref long, constants.%Cpp.long [concrete = constants.%Cpp.long] // CHECK:STDOUT: } @@ -2571,13 +2571,13 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %impl.elem1.loc11: %.22b = impl_witness_access constants.%Negate.impl_witness, element1 [concrete = constants.%Cpp.long.as.Negate.impl.Op] // CHECK:STDOUT: %bound_method.loc11: = bound_method %x.ref.loc11, %impl.elem1.loc11 // CHECK:STDOUT: %Cpp.long.as.Negate.impl.Op.call: init %Cpp.long = call %bound_method.loc11(%x.ref.loc11) -// CHECK:STDOUT: %.loc11_13: type = splice_block %long.ref.loc11 [concrete = constants.%Cpp.long] { +// CHECK:STDOUT: %.loc11_20: type = splice_block %long.ref.loc11 [concrete = constants.%Cpp.long] { // CHECK:STDOUT: %Cpp.ref.loc11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %long.ref.loc11: type = name_ref long, constants.%Cpp.long [concrete = constants.%Cpp.long] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11_21.1: %Cpp.long = value_of_initializer %Cpp.long.as.Negate.impl.Op.call -// CHECK:STDOUT: %.loc11_21.2: %Cpp.long = converted %Cpp.long.as.Negate.impl.Op.call, %.loc11_21.1 -// CHECK:STDOUT: %a: %Cpp.long = value_binding a, %.loc11_21.2 +// CHECK:STDOUT: %.loc11_28.1: %Cpp.long = value_of_initializer %Cpp.long.as.Negate.impl.Op.call +// CHECK:STDOUT: %.loc11_28.2: %Cpp.long = converted %Cpp.long.as.Negate.impl.Op.call, %.loc11_28.1 +// CHECK:STDOUT: %a: %Cpp.long = value_binding a, %.loc11_28.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.68c = value_binding_pattern b [concrete] // CHECK:STDOUT: } @@ -2586,13 +2586,13 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %impl.elem1.loc12: %.165 = impl_witness_access constants.%AddWith.impl_witness.e9f, element1 [concrete = constants.%Cpp.long.as.AddWith.impl.Op.be0] // CHECK:STDOUT: %bound_method.loc12: = bound_method %x.ref.loc12, %impl.elem1.loc12 // CHECK:STDOUT: %Cpp.long.as.AddWith.impl.Op.call: init %Cpp.long = call %bound_method.loc12(%x.ref.loc12, %y.ref.loc12) -// CHECK:STDOUT: %.loc12_13: type = splice_block %long.ref.loc12 [concrete = constants.%Cpp.long] { +// CHECK:STDOUT: %.loc12_20: type = splice_block %long.ref.loc12 [concrete = constants.%Cpp.long] { // CHECK:STDOUT: %Cpp.ref.loc12: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %long.ref.loc12: type = name_ref long, constants.%Cpp.long [concrete = constants.%Cpp.long] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc12_23.1: %Cpp.long = value_of_initializer %Cpp.long.as.AddWith.impl.Op.call -// CHECK:STDOUT: %.loc12_23.2: %Cpp.long = converted %Cpp.long.as.AddWith.impl.Op.call, %.loc12_23.1 -// CHECK:STDOUT: %b: %Cpp.long = value_binding b, %.loc12_23.2 +// CHECK:STDOUT: %.loc12_30.1: %Cpp.long = value_of_initializer %Cpp.long.as.AddWith.impl.Op.call +// CHECK:STDOUT: %.loc12_30.2: %Cpp.long = converted %Cpp.long.as.AddWith.impl.Op.call, %.loc12_30.1 +// CHECK:STDOUT: %b: %Cpp.long = value_binding b, %.loc12_30.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c.patt: %pattern_type.68c = value_binding_pattern c [concrete] // CHECK:STDOUT: } @@ -2601,13 +2601,13 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %impl.elem1.loc13: %.571 = impl_witness_access constants.%SubWith.impl_witness.8a6, element1 [concrete = constants.%Cpp.long.as.SubWith.impl.Op.37d] // CHECK:STDOUT: %bound_method.loc13: = bound_method %x.ref.loc13, %impl.elem1.loc13 // CHECK:STDOUT: %Cpp.long.as.SubWith.impl.Op.call: init %Cpp.long = call %bound_method.loc13(%x.ref.loc13, %y.ref.loc13) -// CHECK:STDOUT: %.loc13_13: type = splice_block %long.ref.loc13 [concrete = constants.%Cpp.long] { +// CHECK:STDOUT: %.loc13_20: type = splice_block %long.ref.loc13 [concrete = constants.%Cpp.long] { // CHECK:STDOUT: %Cpp.ref.loc13: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %long.ref.loc13: type = name_ref long, constants.%Cpp.long [concrete = constants.%Cpp.long] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13_23.1: %Cpp.long = value_of_initializer %Cpp.long.as.SubWith.impl.Op.call -// CHECK:STDOUT: %.loc13_23.2: %Cpp.long = converted %Cpp.long.as.SubWith.impl.Op.call, %.loc13_23.1 -// CHECK:STDOUT: %c: %Cpp.long = value_binding c, %.loc13_23.2 +// CHECK:STDOUT: %.loc13_30.1: %Cpp.long = value_of_initializer %Cpp.long.as.SubWith.impl.Op.call +// CHECK:STDOUT: %.loc13_30.2: %Cpp.long = converted %Cpp.long.as.SubWith.impl.Op.call, %.loc13_30.1 +// CHECK:STDOUT: %c: %Cpp.long = value_binding c, %.loc13_30.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %d.patt: %pattern_type.68c = value_binding_pattern d [concrete] // CHECK:STDOUT: } @@ -2616,13 +2616,13 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %impl.elem1.loc14: %.7d0 = impl_witness_access constants.%MulWith.impl_witness.87c, element1 [concrete = constants.%Cpp.long.as.MulWith.impl.Op.4e5] // CHECK:STDOUT: %bound_method.loc14: = bound_method %x.ref.loc14, %impl.elem1.loc14 // CHECK:STDOUT: %Cpp.long.as.MulWith.impl.Op.call: init %Cpp.long = call %bound_method.loc14(%x.ref.loc14, %y.ref.loc14) -// CHECK:STDOUT: %.loc14_13: type = splice_block %long.ref.loc14 [concrete = constants.%Cpp.long] { +// CHECK:STDOUT: %.loc14_20: type = splice_block %long.ref.loc14 [concrete = constants.%Cpp.long] { // CHECK:STDOUT: %Cpp.ref.loc14: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %long.ref.loc14: type = name_ref long, constants.%Cpp.long [concrete = constants.%Cpp.long] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc14_23.1: %Cpp.long = value_of_initializer %Cpp.long.as.MulWith.impl.Op.call -// CHECK:STDOUT: %.loc14_23.2: %Cpp.long = converted %Cpp.long.as.MulWith.impl.Op.call, %.loc14_23.1 -// CHECK:STDOUT: %d: %Cpp.long = value_binding d, %.loc14_23.2 +// CHECK:STDOUT: %.loc14_30.1: %Cpp.long = value_of_initializer %Cpp.long.as.MulWith.impl.Op.call +// CHECK:STDOUT: %.loc14_30.2: %Cpp.long = converted %Cpp.long.as.MulWith.impl.Op.call, %.loc14_30.1 +// CHECK:STDOUT: %d: %Cpp.long = value_binding d, %.loc14_30.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %e.patt: %pattern_type.68c = value_binding_pattern e [concrete] // CHECK:STDOUT: } @@ -2631,13 +2631,13 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %impl.elem1.loc15: %.aa3 = impl_witness_access constants.%DivWith.impl_witness.4ab, element1 [concrete = constants.%Cpp.long.as.DivWith.impl.Op.33f] // CHECK:STDOUT: %bound_method.loc15: = bound_method %x.ref.loc15, %impl.elem1.loc15 // CHECK:STDOUT: %Cpp.long.as.DivWith.impl.Op.call: init %Cpp.long = call %bound_method.loc15(%x.ref.loc15, %y.ref.loc15) -// CHECK:STDOUT: %.loc15_13: type = splice_block %long.ref.loc15 [concrete = constants.%Cpp.long] { +// CHECK:STDOUT: %.loc15_20: type = splice_block %long.ref.loc15 [concrete = constants.%Cpp.long] { // CHECK:STDOUT: %Cpp.ref.loc15: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %long.ref.loc15: type = name_ref long, constants.%Cpp.long [concrete = constants.%Cpp.long] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15_23.1: %Cpp.long = value_of_initializer %Cpp.long.as.DivWith.impl.Op.call -// CHECK:STDOUT: %.loc15_23.2: %Cpp.long = converted %Cpp.long.as.DivWith.impl.Op.call, %.loc15_23.1 -// CHECK:STDOUT: %e: %Cpp.long = value_binding e, %.loc15_23.2 +// CHECK:STDOUT: %.loc15_30.1: %Cpp.long = value_of_initializer %Cpp.long.as.DivWith.impl.Op.call +// CHECK:STDOUT: %.loc15_30.2: %Cpp.long = converted %Cpp.long.as.DivWith.impl.Op.call, %.loc15_30.1 +// CHECK:STDOUT: %e: %Cpp.long = value_binding e, %.loc15_30.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %f.patt: %pattern_type.68c = value_binding_pattern f [concrete] // CHECK:STDOUT: } @@ -2646,13 +2646,13 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %impl.elem1.loc16: %.c19 = impl_witness_access constants.%ModWith.impl_witness.c73, element1 [concrete = constants.%Cpp.long.as.ModWith.impl.Op.06e] // CHECK:STDOUT: %bound_method.loc16: = bound_method %x.ref.loc16, %impl.elem1.loc16 // CHECK:STDOUT: %Cpp.long.as.ModWith.impl.Op.call: init %Cpp.long = call %bound_method.loc16(%x.ref.loc16, %y.ref.loc16) -// CHECK:STDOUT: %.loc16_13: type = splice_block %long.ref.loc16 [concrete = constants.%Cpp.long] { +// CHECK:STDOUT: %.loc16_20: type = splice_block %long.ref.loc16 [concrete = constants.%Cpp.long] { // CHECK:STDOUT: %Cpp.ref.loc16: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %long.ref.loc16: type = name_ref long, constants.%Cpp.long [concrete = constants.%Cpp.long] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc16_23.1: %Cpp.long = value_of_initializer %Cpp.long.as.ModWith.impl.Op.call -// CHECK:STDOUT: %.loc16_23.2: %Cpp.long = converted %Cpp.long.as.ModWith.impl.Op.call, %.loc16_23.1 -// CHECK:STDOUT: %f: %Cpp.long = value_binding f, %.loc16_23.2 +// CHECK:STDOUT: %.loc16_30.1: %Cpp.long = value_of_initializer %Cpp.long.as.ModWith.impl.Op.call +// CHECK:STDOUT: %.loc16_30.2: %Cpp.long = converted %Cpp.long.as.ModWith.impl.Op.call, %.loc16_30.1 +// CHECK:STDOUT: %f: %Cpp.long = value_binding f, %.loc16_30.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4087,20 +4087,20 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %cpp_unsigned_long_result.patt: %pattern_type.6f2 = value_binding_pattern cpp_unsigned_long_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc16_51: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc16_58: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %PassULong.ref.loc16: %PassULong.cpp_overload_set.type = name_ref PassULong, imports.%PassULong.cpp_overload_set.value [concrete = constants.%PassULong.cpp_overload_set.value] // CHECK:STDOUT: %cpp_unsigned_long.ref.loc16: %Cpp.unsigned_long = name_ref cpp_unsigned_long, %cpp_unsigned_long -// CHECK:STDOUT: %.loc16_82.1: ref %ULongResult = temporary_storage -// CHECK:STDOUT: %addr.loc16: %ptr.f5e = addr_of %.loc16_82.1 +// CHECK:STDOUT: %.loc16_89.1: ref %ULongResult = temporary_storage +// CHECK:STDOUT: %addr.loc16: %ptr.f5e = addr_of %.loc16_89.1 // CHECK:STDOUT: %PassULong__carbon_thunk.call.loc16: init %empty_tuple.type = call imports.%PassULong__carbon_thunk.decl.108234.1(%cpp_unsigned_long.ref.loc16, %addr.loc16) -// CHECK:STDOUT: %.loc16_82.2: init %ULongResult to %.loc16_82.1 = mark_in_place_init %PassULong__carbon_thunk.call.loc16 -// CHECK:STDOUT: %.loc16_36: type = splice_block %ULongResult.ref.loc16 [concrete = constants.%ULongResult] { -// CHECK:STDOUT: %Cpp.ref.loc16_33: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc16_89.2: init %ULongResult to %.loc16_89.1 = mark_in_place_init %PassULong__carbon_thunk.call.loc16 +// CHECK:STDOUT: %.loc16_43: type = splice_block %ULongResult.ref.loc16 [concrete = constants.%ULongResult] { +// CHECK:STDOUT: %Cpp.ref.loc16_40: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ULongResult.ref.loc16: type = name_ref ULongResult, imports.%ULongResult.decl [concrete = constants.%ULongResult] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc16_82.3: ref %ULongResult = temporary %.loc16_82.1, %.loc16_82.2 -// CHECK:STDOUT: %.loc16_82.4: %ULongResult = acquire_value %.loc16_82.3 -// CHECK:STDOUT: %cpp_unsigned_long_result: %ULongResult = value_binding cpp_unsigned_long_result, %.loc16_82.4 +// CHECK:STDOUT: %.loc16_89.3: ref %ULongResult = temporary %.loc16_89.1, %.loc16_89.2 +// CHECK:STDOUT: %.loc16_89.4: %ULongResult = acquire_value %.loc16_89.3 +// CHECK:STDOUT: %cpp_unsigned_long_result: %ULongResult = value_binding cpp_unsigned_long_result, %.loc16_89.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %cpp_compat_ulong.patt: %pattern_type.5b7 = value_binding_pattern cpp_compat_ulong [concrete] // CHECK:STDOUT: } @@ -4114,20 +4114,20 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %cpp_compat_ulong_result.patt: %pattern_type.6f2 = value_binding_pattern cpp_compat_ulong_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc19_50: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc19_57: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %PassULong.ref.loc19: %PassULong.cpp_overload_set.type = name_ref PassULong, imports.%PassULong.cpp_overload_set.value [concrete = constants.%PassULong.cpp_overload_set.value] // CHECK:STDOUT: %cpp_compat_ulong.ref: %Cpp.unsigned_long = name_ref cpp_compat_ulong, %cpp_compat_ulong -// CHECK:STDOUT: %.loc19_80.1: ref %ULongResult = temporary_storage -// CHECK:STDOUT: %addr.loc19: %ptr.f5e = addr_of %.loc19_80.1 +// CHECK:STDOUT: %.loc19_87.1: ref %ULongResult = temporary_storage +// CHECK:STDOUT: %addr.loc19: %ptr.f5e = addr_of %.loc19_87.1 // CHECK:STDOUT: %PassULong__carbon_thunk.call.loc19: init %empty_tuple.type = call imports.%PassULong__carbon_thunk.decl.108234.1(%cpp_compat_ulong.ref, %addr.loc19) -// CHECK:STDOUT: %.loc19_80.2: init %ULongResult to %.loc19_80.1 = mark_in_place_init %PassULong__carbon_thunk.call.loc19 -// CHECK:STDOUT: %.loc19_35: type = splice_block %ULongResult.ref.loc19 [concrete = constants.%ULongResult] { -// CHECK:STDOUT: %Cpp.ref.loc19_32: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc19_87.2: init %ULongResult to %.loc19_87.1 = mark_in_place_init %PassULong__carbon_thunk.call.loc19 +// CHECK:STDOUT: %.loc19_42: type = splice_block %ULongResult.ref.loc19 [concrete = constants.%ULongResult] { +// CHECK:STDOUT: %Cpp.ref.loc19_39: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ULongResult.ref.loc19: type = name_ref ULongResult, imports.%ULongResult.decl [concrete = constants.%ULongResult] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19_80.3: ref %ULongResult = temporary %.loc19_80.1, %.loc19_80.2 -// CHECK:STDOUT: %.loc19_80.4: %ULongResult = acquire_value %.loc19_80.3 -// CHECK:STDOUT: %cpp_compat_ulong_result: %ULongResult = value_binding cpp_compat_ulong_result, %.loc19_80.4 +// CHECK:STDOUT: %.loc19_87.3: ref %ULongResult = temporary %.loc19_87.1, %.loc19_87.2 +// CHECK:STDOUT: %.loc19_87.4: %ULongResult = acquire_value %.loc19_87.3 +// CHECK:STDOUT: %cpp_compat_ulong_result: %ULongResult = value_binding cpp_compat_ulong_result, %.loc19_87.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %carbon_u32.patt: %pattern_type.4a9 = value_binding_pattern carbon_u32 [concrete] // CHECK:STDOUT: } @@ -4145,66 +4145,66 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %carbon_u32_result.patt: %pattern_type.dc7 = value_binding_pattern carbon_u32_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc22_43: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc22_50: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %PassULong.ref.loc22: %PassULong.cpp_overload_set.type = name_ref PassULong, imports.%PassULong.cpp_overload_set.value [concrete = constants.%PassULong.cpp_overload_set.value] // CHECK:STDOUT: %carbon_u32.ref: %u32 = name_ref carbon_u32, %carbon_u32 -// CHECK:STDOUT: %.loc22_67.1: ref %UIntResult = temporary_storage -// CHECK:STDOUT: %addr.loc22: %ptr.059 = addr_of %.loc22_67.1 +// CHECK:STDOUT: %.loc22_74.1: ref %UIntResult = temporary_storage +// CHECK:STDOUT: %addr.loc22: %ptr.059 = addr_of %.loc22_74.1 // CHECK:STDOUT: %PassULong__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%PassULong__carbon_thunk.decl.108234.2(%carbon_u32.ref, %addr.loc22) -// CHECK:STDOUT: %.loc22_67.2: init %UIntResult to %.loc22_67.1 = mark_in_place_init %PassULong__carbon_thunk.call.loc22 -// CHECK:STDOUT: %.loc22_29: type = splice_block %UIntResult.ref [concrete = constants.%UIntResult] { -// CHECK:STDOUT: %Cpp.ref.loc22_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc22_74.2: init %UIntResult to %.loc22_74.1 = mark_in_place_init %PassULong__carbon_thunk.call.loc22 +// CHECK:STDOUT: %.loc22_36: type = splice_block %UIntResult.ref [concrete = constants.%UIntResult] { +// CHECK:STDOUT: %Cpp.ref.loc22_33: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %UIntResult.ref: type = name_ref UIntResult, imports.%UIntResult.decl [concrete = constants.%UIntResult] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22_67.3: ref %UIntResult = temporary %.loc22_67.1, %.loc22_67.2 -// CHECK:STDOUT: %.loc22_67.4: %UIntResult = acquire_value %.loc22_67.3 -// CHECK:STDOUT: %carbon_u32_result: %UIntResult = value_binding carbon_u32_result, %.loc22_67.4 +// CHECK:STDOUT: %.loc22_74.3: ref %UIntResult = temporary %.loc22_74.1, %.loc22_74.2 +// CHECK:STDOUT: %.loc22_74.4: %UIntResult = acquire_value %.loc22_74.3 +// CHECK:STDOUT: %carbon_u32_result: %UIntResult = value_binding carbon_u32_result, %.loc22_74.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.b36 = ref_binding_pattern a [concrete] // CHECK:STDOUT: %a.var_patt: %pattern_type.b36 = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %array_type = var %a.var_patt // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float.674] -// CHECK:STDOUT: %.loc24_52.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] -// CHECK:STDOUT: %impl.elem0.loc24_52: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] -// CHECK:STDOUT: %bound_method.loc24_52.1: = bound_method %float, %impl.elem0.loc24_52 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc24_52, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc24_52.2: = bound_method %float, %specific_fn [concrete = constants.%bound_method] -// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc24_52.2(%float) [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc24_52.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc24_59.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] +// CHECK:STDOUT: %impl.elem0.loc24_59: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] +// CHECK:STDOUT: %bound_method.loc24_59.1: = bound_method %float, %impl.elem0.loc24_59 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc24_59, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc24_59.2: = bound_method %float, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc24_59.2(%float) [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc24_59.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc24_52.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc24_52.4: init %f32.97e to %.loc24_52.3 = in_place_init %.loc24_52.2 [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc24_52.5: init %array_type to %a.var = array_init (%.loc24_52.4) [concrete = constants.%array] -// CHECK:STDOUT: %.loc24_3: init %array_type = converted %.loc24_52.1, %.loc24_52.5 [concrete = constants.%array] +// CHECK:STDOUT: %.loc24_59.3: ref %f32.97e = array_index %a.var, %int_0 +// CHECK:STDOUT: %.loc24_59.4: init %f32.97e to %.loc24_59.3 = in_place_init %.loc24_59.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc24_59.5: init %array_type to %a.var = array_init (%.loc24_59.4) [concrete = constants.%array] +// CHECK:STDOUT: %.loc24_3: init %array_type = converted %.loc24_59.1, %.loc24_59.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc24_3 -// CHECK:STDOUT: %.loc24_43: type = splice_block %array_type [concrete = constants.%array_type] { +// CHECK:STDOUT: %.loc24_50: type = splice_block %array_type [concrete = constants.%array_type] { // CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %f32: type = class_type @Float, @Float(constants.%int_32) [concrete = constants.%f32.97e] // CHECK:STDOUT: %int_1.loc24: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %Cpp.ref.loc24: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %unsigned_long.ref.loc24: type = name_ref unsigned_long, constants.%Cpp.unsigned_long [concrete = constants.%Cpp.unsigned_long] -// CHECK:STDOUT: %impl.elem0.loc24_23.1: %.59b = impl_witness_access constants.%As.impl_witness.d5f, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert] -// CHECK:STDOUT: %bound_method.loc24_23.1: = bound_method %int_1.loc24, %impl.elem0.loc24_23.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %Cpp.unsigned_long = call %bound_method.loc24_23.1(%int_1.loc24) [concrete = constants.%int_1.0ab] -// CHECK:STDOUT: %.loc24_23.1: %Cpp.unsigned_long = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.0ab] -// CHECK:STDOUT: %.loc24_23.2: %Cpp.unsigned_long = converted %int_1.loc24, %.loc24_23.1 [concrete = constants.%int_1.0ab] -// CHECK:STDOUT: %impl.elem0.loc24_23.2: %.0db = impl_witness_access constants.%ImplicitAs.impl_witness.a13, element0 [concrete = constants.%Cpp.unsigned_long.as.ImplicitAs.impl.Convert.e53] -// CHECK:STDOUT: %bound_method.loc24_23.2: = bound_method %.loc24_23.2, %impl.elem0.loc24_23.2 [concrete = constants.%Cpp.unsigned_long.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %Cpp.unsigned_long.as.ImplicitAs.impl.Convert.call.loc24: init Core.IntLiteral = call %bound_method.loc24_23.2(%.loc24_23.2) [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc24_23.3: Core.IntLiteral = value_of_initializer %Cpp.unsigned_long.as.ImplicitAs.impl.Convert.call.loc24 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc24_23.4: Core.IntLiteral = converted %.loc24_23.2, %.loc24_23.3 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %array_type: type = array_type %.loc24_23.4, %f32 [concrete = constants.%array_type] +// CHECK:STDOUT: %impl.elem0.loc24_30.1: %.59b = impl_witness_access constants.%As.impl_witness.d5f, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert] +// CHECK:STDOUT: %bound_method.loc24_30.1: = bound_method %int_1.loc24, %impl.elem0.loc24_30.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %Cpp.unsigned_long = call %bound_method.loc24_30.1(%int_1.loc24) [concrete = constants.%int_1.0ab] +// CHECK:STDOUT: %.loc24_30.1: %Cpp.unsigned_long = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.0ab] +// CHECK:STDOUT: %.loc24_30.2: %Cpp.unsigned_long = converted %int_1.loc24, %.loc24_30.1 [concrete = constants.%int_1.0ab] +// CHECK:STDOUT: %impl.elem0.loc24_30.2: %.0db = impl_witness_access constants.%ImplicitAs.impl_witness.a13, element0 [concrete = constants.%Cpp.unsigned_long.as.ImplicitAs.impl.Convert.e53] +// CHECK:STDOUT: %bound_method.loc24_30.2: = bound_method %.loc24_30.2, %impl.elem0.loc24_30.2 [concrete = constants.%Cpp.unsigned_long.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %Cpp.unsigned_long.as.ImplicitAs.impl.Convert.call.loc24: init Core.IntLiteral = call %bound_method.loc24_30.2(%.loc24_30.2) [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc24_30.3: Core.IntLiteral = value_of_initializer %Cpp.unsigned_long.as.ImplicitAs.impl.Convert.call.loc24 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc24_30.4: Core.IntLiteral = converted %.loc24_30.2, %.loc24_30.3 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %array_type: type = array_type %.loc24_30.4, %f32 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %a.var, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%a.var) -// CHECK:STDOUT: %UIntResult.cpp_destructor.bound: = bound_method %.loc22_67.3, constants.%UIntResult.cpp_destructor -// CHECK:STDOUT: %UIntResult.cpp_destructor.call: init %empty_tuple.type = call %UIntResult.cpp_destructor.bound(%.loc22_67.3) -// CHECK:STDOUT: %ULongResult.cpp_destructor.bound.loc19: = bound_method %.loc19_80.3, constants.%ULongResult.cpp_destructor -// CHECK:STDOUT: %ULongResult.cpp_destructor.call.loc19: init %empty_tuple.type = call %ULongResult.cpp_destructor.bound.loc19(%.loc19_80.3) -// CHECK:STDOUT: %ULongResult.cpp_destructor.bound.loc16: = bound_method %.loc16_82.3, constants.%ULongResult.cpp_destructor -// CHECK:STDOUT: %ULongResult.cpp_destructor.call.loc16: init %empty_tuple.type = call %ULongResult.cpp_destructor.bound.loc16(%.loc16_82.3) +// CHECK:STDOUT: %UIntResult.cpp_destructor.bound: = bound_method %.loc22_74.3, constants.%UIntResult.cpp_destructor +// CHECK:STDOUT: %UIntResult.cpp_destructor.call: init %empty_tuple.type = call %UIntResult.cpp_destructor.bound(%.loc22_74.3) +// CHECK:STDOUT: %ULongResult.cpp_destructor.bound.loc19: = bound_method %.loc19_87.3, constants.%ULongResult.cpp_destructor +// CHECK:STDOUT: %ULongResult.cpp_destructor.call.loc19: init %empty_tuple.type = call %ULongResult.cpp_destructor.bound.loc19(%.loc19_87.3) +// CHECK:STDOUT: %ULongResult.cpp_destructor.bound.loc16: = bound_method %.loc16_89.3, constants.%ULongResult.cpp_destructor +// CHECK:STDOUT: %ULongResult.cpp_destructor.call.loc16: init %empty_tuple.type = call %ULongResult.cpp_destructor.bound.loc16(%.loc16_89.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4272,12 +4272,12 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref %Cpp.unsigned_long = var %b.var_patt // CHECK:STDOUT: %a.ref: ref %Cpp.unsigned_long = name_ref a, %a -// CHECK:STDOUT: %.loc9_30: %Cpp.unsigned_long = acquire_value %a.ref +// CHECK:STDOUT: %.loc9_37: %Cpp.unsigned_long = acquire_value %a.ref // CHECK:STDOUT: %impl.elem0.loc9: %.f45 = impl_witness_access constants.%Copy.impl_witness.ae3, element0 [concrete = constants.%Cpp.unsigned_long.as.Copy.impl.Op] -// CHECK:STDOUT: %bound_method.loc9: = bound_method %.loc9_30, %impl.elem0.loc9 -// CHECK:STDOUT: %Cpp.unsigned_long.as.Copy.impl.Op.call: init %Cpp.unsigned_long = call %bound_method.loc9(%.loc9_30) +// CHECK:STDOUT: %bound_method.loc9: = bound_method %.loc9_37, %impl.elem0.loc9 +// CHECK:STDOUT: %Cpp.unsigned_long.as.Copy.impl.Op.call: init %Cpp.unsigned_long = call %bound_method.loc9(%.loc9_37) // CHECK:STDOUT: assign %b.var, %Cpp.unsigned_long.as.Copy.impl.Op.call -// CHECK:STDOUT: %.loc9_13: type = splice_block %unsigned_long.ref.loc9 [concrete = constants.%Cpp.unsigned_long] { +// CHECK:STDOUT: %.loc9_20: type = splice_block %unsigned_long.ref.loc9 [concrete = constants.%Cpp.unsigned_long] { // CHECK:STDOUT: %Cpp.ref.loc9: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %unsigned_long.ref.loc9: type = name_ref unsigned_long, constants.%Cpp.unsigned_long [concrete = constants.%Cpp.unsigned_long] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/builtins.lp64.carbon b/toolchain/check/testdata/interop/cpp/builtins.lp64.carbon index de040e6cbc13..95d4d99cbf85 100644 --- a/toolchain/check/testdata/interop/cpp/builtins.lp64.carbon +++ b/toolchain/check/testdata/interop/cpp/builtins.lp64.carbon @@ -20,9 +20,9 @@ import Cpp; fn F() { //@dump-sem-ir-begin let cpp_long: Cpp.long = 1; - let carbon_long: i64 = cpp_long; + let unused carbon_long: i64 = cpp_long; - var a: array(f32, 1 as Cpp.long) = (1.0,); + var unused a: array(f32, 1 as Cpp.long) = (1.0,); //@dump-sem-ir-end } @@ -35,9 +35,9 @@ import Cpp; fn F() { //@dump-sem-ir-begin let cpp_unsigned_long: Cpp.unsigned_long = 1; - let carbon_unsigned_long: u64 = cpp_unsigned_long; + let unused carbon_unsigned_long: u64 = cpp_unsigned_long; - var a: array(f32, 1 as Cpp.unsigned_long) = (1.0,); + var unused a: array(f32, 1 as Cpp.unsigned_long) = (1.0,); //@dump-sem-ir-end } @@ -57,15 +57,15 @@ auto PassLongLong(long x) -> LongResult; fn F() { //@dump-sem-ir-begin let cpp_long_long: Cpp.long_long = 1; - let cpp_long_long_result: Cpp.LongLongResult = Cpp.PassLongLong(cpp_long_long); + let unused cpp_long_long_result: Cpp.LongLongResult = Cpp.PassLongLong(cpp_long_long); let cpp_compat_long_long: Core.CppCompat.LongLong64 = cpp_long_long; - let cpp_compat_long_long_result: Cpp.LongLongResult = Cpp.PassLongLong(cpp_compat_long_long); + let unused cpp_compat_long_long_result: Cpp.LongLongResult = Cpp.PassLongLong(cpp_compat_long_long); let carbon_i64: i64 = cpp_long_long as i64; - let carbon_i64_result: Cpp.LongResult = Cpp.PassLongLong(carbon_i64); + let unused carbon_i64_result: Cpp.LongResult = Cpp.PassLongLong(carbon_i64); - var a: array(f32, 1 as Cpp.long_long) = (1.0,); + var unused a: array(f32, 1 as Cpp.long_long) = (1.0,); //@dump-sem-ir-end } @@ -78,14 +78,14 @@ import Cpp; fn F() { let cpp_long_long: Cpp.long_long = 1; - // CHECK:STDERR: fail_implicit_conversion_long_long_to_i64.carbon:[[@LINE+7]]:25: error: cannot implicitly convert expression of type `Cpp.long_long` to `i64` [ConversionFailure] - // CHECK:STDERR: let carbon_i64: i64 = cpp_long_long; - // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_implicit_conversion_long_long_to_i64.carbon:[[@LINE+4]]:25: note: type `Cpp.long_long` does not implement interface `Core.ImplicitAs(i64)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let carbon_i64: i64 = cpp_long_long; - // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: fail_implicit_conversion_long_long_to_i64.carbon:[[@LINE+7]]:32: error: cannot implicitly convert expression of type `Cpp.long_long` to `i64` [ConversionFailure] + // CHECK:STDERR: let unused carbon_i64: i64 = cpp_long_long; + // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: fail_implicit_conversion_long_long_to_i64.carbon:[[@LINE+4]]:32: note: type `Cpp.long_long` does not implement interface `Core.ImplicitAs(i64)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused carbon_i64: i64 = cpp_long_long; + // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: - let carbon_i64: i64 = cpp_long_long; + let unused carbon_i64: i64 = cpp_long_long; } // --- copy_long_long.carbon @@ -97,7 +97,7 @@ import Cpp; fn CopyLongLong() { //@dump-sem-ir-begin var a: Cpp.long_long = 1; - var b: Cpp.long_long = a; + var unused b: Cpp.long_long = a; //@dump-sem-ir-end } @@ -233,7 +233,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn ArithmeticHomogeneousLongLong() { let x: Cpp.long_long = 1; @@ -253,7 +253,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn ArithmeticHeterogeneousLongLongLeftSide() { let b: i64 = 1; @@ -278,7 +278,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn ArithmeticHeterogeneousLongLongRightSide() { let b: i64 = 1; @@ -302,7 +302,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn ArithmeticHeterogeneousLongLongAndI32() { let x: Cpp.long_long = 1; @@ -326,7 +326,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn ArithmeticHeterogeneousLongLongAndI128() { let x: Cpp.long_long = 1; @@ -341,7 +341,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn BitWiseHomogeneousLongLong() { let a: Cpp.long_long = 1; @@ -361,7 +361,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn BitWiseHeterogeneousLongLongLeftSide() { let b: i64 = 1; @@ -386,7 +386,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn BitWiseHeterogeneousLongLongRightSide() { let b: i64 = 1; @@ -411,7 +411,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn BitWiseHeterogeneousLongLongAndI32() { let a: Cpp.long_long = 1; @@ -435,7 +435,7 @@ library "[[@TEST_NAME]]"; import Cpp; -fn AssertSameType[T:! type](a: T, b: T) {} +fn AssertSameType[T:! type](unused a: T, unused b: T) {} fn BitWiseHeterogeneousLongLongAndI128() { let a: Cpp.long_long = 1; @@ -581,15 +581,15 @@ auto PassULongLong(unsigned long x) -> ULongResult; fn F() { //@dump-sem-ir-begin let cpp_unsigned_long_long: Cpp.unsigned_long_long = 1; - let cpp_unsigned_long_long_result: Cpp.ULongLongResult = Cpp.PassULongLong(cpp_unsigned_long_long); + let unused cpp_unsigned_long_long_result: Cpp.ULongLongResult = Cpp.PassULongLong(cpp_unsigned_long_long); let cpp_compat_ulong_long: Core.CppCompat.ULongLong64 = cpp_unsigned_long_long; - let cpp_compat_ulong_long_result: Cpp.ULongLongResult = Cpp.PassULongLong(cpp_compat_ulong_long); + let unused cpp_compat_ulong_long_result: Cpp.ULongLongResult = Cpp.PassULongLong(cpp_compat_ulong_long); let carbon_u64: u64 = cpp_unsigned_long_long; - let carbon_u64_result: Cpp.ULongResult = Cpp.PassULongLong(carbon_u64); + let unused carbon_u64_result: Cpp.ULongResult = Cpp.PassULongLong(carbon_u64); - var a: array(f32, 1 as Cpp.unsigned_long_long) = (1.0,); + var unused a: array(f32, 1 as Cpp.unsigned_long_long) = (1.0,); //@dump-sem-ir-end } @@ -602,7 +602,7 @@ import Cpp; fn CopyUnsignedLongLong() { //@dump-sem-ir-begin var a: Cpp.unsigned_long_long = 1; - var b: Cpp.unsigned_long_long = a; + var unused b: Cpp.unsigned_long_long = a; //@dump-sem-ir-end } @@ -729,40 +729,40 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %array_type = var %a.var_patt // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float.674] -// CHECK:STDOUT: %.loc11_43.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] -// CHECK:STDOUT: %impl.elem0.loc11_43: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] -// CHECK:STDOUT: %bound_method.loc11_43.1: = bound_method %float, %impl.elem0.loc11_43 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc11_43: = specific_function %impl.elem0.loc11_43, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc11_43.2: = bound_method %float, %specific_fn.loc11_43 [concrete = constants.%bound_method.1e4] -// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc11_43.2(%float) [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc11_43.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc11_50.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] +// CHECK:STDOUT: %impl.elem0.loc11_50: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] +// CHECK:STDOUT: %bound_method.loc11_50.1: = bound_method %float, %impl.elem0.loc11_50 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc11_50: = specific_function %impl.elem0.loc11_50, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_50.2: = bound_method %float, %specific_fn.loc11_50 [concrete = constants.%bound_method.1e4] +// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc11_50.2(%float) [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc11_50.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc11_43.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc11_43.4: init %f32.97e to %.loc11_43.3 = in_place_init %.loc11_43.2 [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc11_43.5: init %array_type to %a.var = array_init (%.loc11_43.4) [concrete = constants.%array] -// CHECK:STDOUT: %.loc11_3: init %array_type = converted %.loc11_43.1, %.loc11_43.5 [concrete = constants.%array] +// CHECK:STDOUT: %.loc11_50.3: ref %f32.97e = array_index %a.var, %int_0 +// CHECK:STDOUT: %.loc11_50.4: init %f32.97e to %.loc11_50.3 = in_place_init %.loc11_50.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc11_50.5: init %array_type to %a.var = array_init (%.loc11_50.4) [concrete = constants.%array] +// CHECK:STDOUT: %.loc11_3: init %array_type = converted %.loc11_50.1, %.loc11_50.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc11_3 -// CHECK:STDOUT: %.loc11_34: type = splice_block %array_type [concrete = constants.%array_type] { +// CHECK:STDOUT: %.loc11_41: type = splice_block %array_type [concrete = constants.%array_type] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %f32: type = class_type @Float, @Float(constants.%int_32) [concrete = constants.%f32.97e] // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %Cpp.ref.loc11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %long.ref.loc11: type = name_ref long, %i64.1 [concrete = constants.%i64] -// CHECK:STDOUT: %impl.elem0.loc11_23.1: %.fc7 = impl_witness_access constants.%As.impl_witness.c71, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.a54] -// CHECK:STDOUT: %bound_method.loc11_23.1: = bound_method %int_1.loc11, %impl.elem0.loc11_23.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc11_23.1: = specific_function %impl.elem0.loc11_23.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc11_23.2: = bound_method %int_1.loc11, %specific_fn.loc11_23.1 [concrete = constants.%bound_method.41b] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i64 = call %bound_method.loc11_23.2(%int_1.loc11) [concrete = constants.%int_1.41a] -// CHECK:STDOUT: %.loc11_23.1: %i64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.41a] -// CHECK:STDOUT: %.loc11_23.2: %i64 = converted %int_1.loc11, %.loc11_23.1 [concrete = constants.%int_1.41a] -// CHECK:STDOUT: %impl.elem0.loc11_23.2: %.495 = impl_witness_access constants.%ImplicitAs.impl_witness.e86, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.535] -// CHECK:STDOUT: %bound_method.loc11_23.3: = bound_method %.loc11_23.2, %impl.elem0.loc11_23.2 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc11_23.2: = specific_function %impl.elem0.loc11_23.2, @Int.as.ImplicitAs.impl.Convert(constants.%int_64) [concrete = constants.%Int.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc11_23.4: = bound_method %.loc11_23.2, %specific_fn.loc11_23.2 [concrete = constants.%bound_method.d1e] -// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.loc11_23.4(%.loc11_23.2) [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc11_23.3: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc11_23.4: Core.IntLiteral = converted %.loc11_23.2, %.loc11_23.3 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %array_type: type = array_type %.loc11_23.4, %f32 [concrete = constants.%array_type] +// CHECK:STDOUT: %impl.elem0.loc11_30.1: %.fc7 = impl_witness_access constants.%As.impl_witness.c71, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.a54] +// CHECK:STDOUT: %bound_method.loc11_30.1: = bound_method %int_1.loc11, %impl.elem0.loc11_30.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc11_30.1: = specific_function %impl.elem0.loc11_30.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_30.2: = bound_method %int_1.loc11, %specific_fn.loc11_30.1 [concrete = constants.%bound_method.41b] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i64 = call %bound_method.loc11_30.2(%int_1.loc11) [concrete = constants.%int_1.41a] +// CHECK:STDOUT: %.loc11_30.1: %i64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.41a] +// CHECK:STDOUT: %.loc11_30.2: %i64 = converted %int_1.loc11, %.loc11_30.1 [concrete = constants.%int_1.41a] +// CHECK:STDOUT: %impl.elem0.loc11_30.2: %.495 = impl_witness_access constants.%ImplicitAs.impl_witness.e86, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.535] +// CHECK:STDOUT: %bound_method.loc11_30.3: = bound_method %.loc11_30.2, %impl.elem0.loc11_30.2 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc11_30.2: = specific_function %impl.elem0.loc11_30.2, @Int.as.ImplicitAs.impl.Convert(constants.%int_64) [concrete = constants.%Int.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_30.4: = bound_method %.loc11_30.2, %specific_fn.loc11_30.2 [concrete = constants.%bound_method.d1e] +// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.loc11_30.4(%.loc11_30.2) [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc11_30.3: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc11_30.4: Core.IntLiteral = converted %.loc11_30.2, %.loc11_30.3 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %array_type: type = array_type %.loc11_30.4, %f32 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %a.var, constants.%DestroyOp @@ -895,40 +895,40 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %array_type = var %a.var_patt // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float.674] -// CHECK:STDOUT: %.loc11_52.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] -// CHECK:STDOUT: %impl.elem0.loc11_52: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] -// CHECK:STDOUT: %bound_method.loc11_52.1: = bound_method %float, %impl.elem0.loc11_52 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc11_52: = specific_function %impl.elem0.loc11_52, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc11_52.2: = bound_method %float, %specific_fn.loc11_52 [concrete = constants.%bound_method.1e4] -// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc11_52.2(%float) [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc11_52.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc11_59.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] +// CHECK:STDOUT: %impl.elem0.loc11_59: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] +// CHECK:STDOUT: %bound_method.loc11_59.1: = bound_method %float, %impl.elem0.loc11_59 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc11_59: = specific_function %impl.elem0.loc11_59, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_59.2: = bound_method %float, %specific_fn.loc11_59 [concrete = constants.%bound_method.1e4] +// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc11_59.2(%float) [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc11_59.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc11_52.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc11_52.4: init %f32.97e to %.loc11_52.3 = in_place_init %.loc11_52.2 [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc11_52.5: init %array_type to %a.var = array_init (%.loc11_52.4) [concrete = constants.%array] -// CHECK:STDOUT: %.loc11_3: init %array_type = converted %.loc11_52.1, %.loc11_52.5 [concrete = constants.%array] +// CHECK:STDOUT: %.loc11_59.3: ref %f32.97e = array_index %a.var, %int_0 +// CHECK:STDOUT: %.loc11_59.4: init %f32.97e to %.loc11_59.3 = in_place_init %.loc11_59.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc11_59.5: init %array_type to %a.var = array_init (%.loc11_59.4) [concrete = constants.%array] +// CHECK:STDOUT: %.loc11_3: init %array_type = converted %.loc11_59.1, %.loc11_59.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc11_3 -// CHECK:STDOUT: %.loc11_43: type = splice_block %array_type [concrete = constants.%array_type] { +// CHECK:STDOUT: %.loc11_50: type = splice_block %array_type [concrete = constants.%array_type] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %f32: type = class_type @Float, @Float(constants.%int_32) [concrete = constants.%f32.97e] // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %Cpp.ref.loc11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %unsigned_long.ref.loc11: type = name_ref unsigned_long, %u64.1 [concrete = constants.%u64] -// CHECK:STDOUT: %impl.elem0.loc11_23.1: %.904 = impl_witness_access constants.%As.impl_witness.f54, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.715] -// CHECK:STDOUT: %bound_method.loc11_23.1: = bound_method %int_1.loc11, %impl.elem0.loc11_23.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc11_23.1: = specific_function %impl.elem0.loc11_23.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc11_23.2: = bound_method %int_1.loc11, %specific_fn.loc11_23.1 [concrete = constants.%bound_method.9cf] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %u64 = call %bound_method.loc11_23.2(%int_1.loc11) [concrete = constants.%int_1.f23] -// CHECK:STDOUT: %.loc11_23.1: %u64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.f23] -// CHECK:STDOUT: %.loc11_23.2: %u64 = converted %int_1.loc11, %.loc11_23.1 [concrete = constants.%int_1.f23] -// CHECK:STDOUT: %impl.elem0.loc11_23.2: %.74a = impl_witness_access constants.%ImplicitAs.impl_witness.2cc, element0 [concrete = constants.%UInt.as.ImplicitAs.impl.Convert.309] -// CHECK:STDOUT: %bound_method.loc11_23.3: = bound_method %.loc11_23.2, %impl.elem0.loc11_23.2 [concrete = constants.%UInt.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc11_23.2: = specific_function %impl.elem0.loc11_23.2, @UInt.as.ImplicitAs.impl.Convert(constants.%int_64) [concrete = constants.%UInt.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc11_23.4: = bound_method %.loc11_23.2, %specific_fn.loc11_23.2 [concrete = constants.%bound_method.f18] -// CHECK:STDOUT: %UInt.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.loc11_23.4(%.loc11_23.2) [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc11_23.3: Core.IntLiteral = value_of_initializer %UInt.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc11_23.4: Core.IntLiteral = converted %.loc11_23.2, %.loc11_23.3 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %array_type: type = array_type %.loc11_23.4, %f32 [concrete = constants.%array_type] +// CHECK:STDOUT: %impl.elem0.loc11_30.1: %.904 = impl_witness_access constants.%As.impl_witness.f54, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.715] +// CHECK:STDOUT: %bound_method.loc11_30.1: = bound_method %int_1.loc11, %impl.elem0.loc11_30.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc11_30.1: = specific_function %impl.elem0.loc11_30.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_30.2: = bound_method %int_1.loc11, %specific_fn.loc11_30.1 [concrete = constants.%bound_method.9cf] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %u64 = call %bound_method.loc11_30.2(%int_1.loc11) [concrete = constants.%int_1.f23] +// CHECK:STDOUT: %.loc11_30.1: %u64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.f23] +// CHECK:STDOUT: %.loc11_30.2: %u64 = converted %int_1.loc11, %.loc11_30.1 [concrete = constants.%int_1.f23] +// CHECK:STDOUT: %impl.elem0.loc11_30.2: %.74a = impl_witness_access constants.%ImplicitAs.impl_witness.2cc, element0 [concrete = constants.%UInt.as.ImplicitAs.impl.Convert.309] +// CHECK:STDOUT: %bound_method.loc11_30.3: = bound_method %.loc11_30.2, %impl.elem0.loc11_30.2 [concrete = constants.%UInt.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc11_30.2: = specific_function %impl.elem0.loc11_30.2, @UInt.as.ImplicitAs.impl.Convert(constants.%int_64) [concrete = constants.%UInt.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_30.4: = bound_method %.loc11_30.2, %specific_fn.loc11_30.2 [concrete = constants.%bound_method.f18] +// CHECK:STDOUT: %UInt.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.loc11_30.4(%.loc11_30.2) [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc11_30.3: Core.IntLiteral = value_of_initializer %UInt.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc11_30.4: Core.IntLiteral = converted %.loc11_30.2, %.loc11_30.3 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %array_type: type = array_type %.loc11_30.4, %f32 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %a.var, constants.%DestroyOp @@ -1097,20 +1097,20 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %cpp_long_long_result.patt: %pattern_type.257 = value_binding_pattern cpp_long_long_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc16_50: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc16_57: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %PassLongLong.ref.loc16: %PassLongLong.cpp_overload_set.type = name_ref PassLongLong, imports.%PassLongLong.cpp_overload_set.value [concrete = constants.%PassLongLong.cpp_overload_set.value] // CHECK:STDOUT: %cpp_long_long.ref.loc16: %Cpp.long_long = name_ref cpp_long_long, %cpp_long_long -// CHECK:STDOUT: %.loc16_80.1: ref %LongLongResult = temporary_storage -// CHECK:STDOUT: %addr.loc16: %ptr.a95 = addr_of %.loc16_80.1 +// CHECK:STDOUT: %.loc16_87.1: ref %LongLongResult = temporary_storage +// CHECK:STDOUT: %addr.loc16: %ptr.a95 = addr_of %.loc16_87.1 // CHECK:STDOUT: %PassLongLong__carbon_thunk.call.loc16: init %empty_tuple.type = call imports.%PassLongLong__carbon_thunk.decl.139b1c.1(%cpp_long_long.ref.loc16, %addr.loc16) -// CHECK:STDOUT: %.loc16_80.2: init %LongLongResult to %.loc16_80.1 = mark_in_place_init %PassLongLong__carbon_thunk.call.loc16 -// CHECK:STDOUT: %.loc16_32: type = splice_block %LongLongResult.ref.loc16 [concrete = constants.%LongLongResult] { -// CHECK:STDOUT: %Cpp.ref.loc16_29: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc16_87.2: init %LongLongResult to %.loc16_87.1 = mark_in_place_init %PassLongLong__carbon_thunk.call.loc16 +// CHECK:STDOUT: %.loc16_39: type = splice_block %LongLongResult.ref.loc16 [concrete = constants.%LongLongResult] { +// CHECK:STDOUT: %Cpp.ref.loc16_36: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %LongLongResult.ref.loc16: type = name_ref LongLongResult, imports.%LongLongResult.decl [concrete = constants.%LongLongResult] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc16_80.3: ref %LongLongResult = temporary %.loc16_80.1, %.loc16_80.2 -// CHECK:STDOUT: %.loc16_80.4: %LongLongResult = acquire_value %.loc16_80.3 -// CHECK:STDOUT: %cpp_long_long_result: %LongLongResult = value_binding cpp_long_long_result, %.loc16_80.4 +// CHECK:STDOUT: %.loc16_87.3: ref %LongLongResult = temporary %.loc16_87.1, %.loc16_87.2 +// CHECK:STDOUT: %.loc16_87.4: %LongLongResult = acquire_value %.loc16_87.3 +// CHECK:STDOUT: %cpp_long_long_result: %LongLongResult = value_binding cpp_long_long_result, %.loc16_87.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %cpp_compat_long_long.patt: %pattern_type.76e = value_binding_pattern cpp_compat_long_long [concrete] // CHECK:STDOUT: } @@ -1124,20 +1124,20 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %cpp_compat_long_long_result.patt: %pattern_type.257 = value_binding_pattern cpp_compat_long_long_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc19_57: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc19_64: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %PassLongLong.ref.loc19: %PassLongLong.cpp_overload_set.type = name_ref PassLongLong, imports.%PassLongLong.cpp_overload_set.value [concrete = constants.%PassLongLong.cpp_overload_set.value] // CHECK:STDOUT: %cpp_compat_long_long.ref: %Cpp.long_long = name_ref cpp_compat_long_long, %cpp_compat_long_long -// CHECK:STDOUT: %.loc19_94.1: ref %LongLongResult = temporary_storage -// CHECK:STDOUT: %addr.loc19: %ptr.a95 = addr_of %.loc19_94.1 +// CHECK:STDOUT: %.loc19_101.1: ref %LongLongResult = temporary_storage +// CHECK:STDOUT: %addr.loc19: %ptr.a95 = addr_of %.loc19_101.1 // CHECK:STDOUT: %PassLongLong__carbon_thunk.call.loc19: init %empty_tuple.type = call imports.%PassLongLong__carbon_thunk.decl.139b1c.1(%cpp_compat_long_long.ref, %addr.loc19) -// CHECK:STDOUT: %.loc19_94.2: init %LongLongResult to %.loc19_94.1 = mark_in_place_init %PassLongLong__carbon_thunk.call.loc19 -// CHECK:STDOUT: %.loc19_39: type = splice_block %LongLongResult.ref.loc19 [concrete = constants.%LongLongResult] { -// CHECK:STDOUT: %Cpp.ref.loc19_36: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc19_101.2: init %LongLongResult to %.loc19_101.1 = mark_in_place_init %PassLongLong__carbon_thunk.call.loc19 +// CHECK:STDOUT: %.loc19_46: type = splice_block %LongLongResult.ref.loc19 [concrete = constants.%LongLongResult] { +// CHECK:STDOUT: %Cpp.ref.loc19_43: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %LongLongResult.ref.loc19: type = name_ref LongLongResult, imports.%LongLongResult.decl [concrete = constants.%LongLongResult] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19_94.3: ref %LongLongResult = temporary %.loc19_94.1, %.loc19_94.2 -// CHECK:STDOUT: %.loc19_94.4: %LongLongResult = acquire_value %.loc19_94.3 -// CHECK:STDOUT: %cpp_compat_long_long_result: %LongLongResult = value_binding cpp_compat_long_long_result, %.loc19_94.4 +// CHECK:STDOUT: %.loc19_101.3: ref %LongLongResult = temporary %.loc19_101.1, %.loc19_101.2 +// CHECK:STDOUT: %.loc19_101.4: %LongLongResult = acquire_value %.loc19_101.3 +// CHECK:STDOUT: %cpp_compat_long_long_result: %LongLongResult = value_binding cpp_compat_long_long_result, %.loc19_101.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %carbon_i64.patt: %pattern_type.95b = value_binding_pattern carbon_i64 [concrete] // CHECK:STDOUT: } @@ -1154,66 +1154,66 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %carbon_i64_result.patt: %pattern_type.cd9 = value_binding_pattern carbon_i64_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc22_43: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc22_50: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %PassLongLong.ref.loc22: %PassLongLong.cpp_overload_set.type = name_ref PassLongLong, imports.%PassLongLong.cpp_overload_set.value [concrete = constants.%PassLongLong.cpp_overload_set.value] // CHECK:STDOUT: %carbon_i64.ref: %i64 = name_ref carbon_i64, %carbon_i64 -// CHECK:STDOUT: %.loc22_70.1: ref %LongResult = temporary_storage -// CHECK:STDOUT: %addr.loc22: %ptr.305 = addr_of %.loc22_70.1 +// CHECK:STDOUT: %.loc22_77.1: ref %LongResult = temporary_storage +// CHECK:STDOUT: %addr.loc22: %ptr.305 = addr_of %.loc22_77.1 // CHECK:STDOUT: %PassLongLong__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%PassLongLong__carbon_thunk.decl.139b1c.2(%carbon_i64.ref, %addr.loc22) -// CHECK:STDOUT: %.loc22_70.2: init %LongResult to %.loc22_70.1 = mark_in_place_init %PassLongLong__carbon_thunk.call.loc22 -// CHECK:STDOUT: %.loc22_29: type = splice_block %LongResult.ref [concrete = constants.%LongResult] { -// CHECK:STDOUT: %Cpp.ref.loc22_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc22_77.2: init %LongResult to %.loc22_77.1 = mark_in_place_init %PassLongLong__carbon_thunk.call.loc22 +// CHECK:STDOUT: %.loc22_36: type = splice_block %LongResult.ref [concrete = constants.%LongResult] { +// CHECK:STDOUT: %Cpp.ref.loc22_33: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %LongResult.ref: type = name_ref LongResult, imports.%LongResult.decl [concrete = constants.%LongResult] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22_70.3: ref %LongResult = temporary %.loc22_70.1, %.loc22_70.2 -// CHECK:STDOUT: %.loc22_70.4: %LongResult = acquire_value %.loc22_70.3 -// CHECK:STDOUT: %carbon_i64_result: %LongResult = value_binding carbon_i64_result, %.loc22_70.4 +// CHECK:STDOUT: %.loc22_77.3: ref %LongResult = temporary %.loc22_77.1, %.loc22_77.2 +// CHECK:STDOUT: %.loc22_77.4: %LongResult = acquire_value %.loc22_77.3 +// CHECK:STDOUT: %carbon_i64_result: %LongResult = value_binding carbon_i64_result, %.loc22_77.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.b36 = ref_binding_pattern a [concrete] // CHECK:STDOUT: %a.var_patt: %pattern_type.b36 = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %array_type = var %a.var_patt // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float.674] -// CHECK:STDOUT: %.loc24_48.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] -// CHECK:STDOUT: %impl.elem0.loc24_48: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] -// CHECK:STDOUT: %bound_method.loc24_48.1: = bound_method %float, %impl.elem0.loc24_48 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc24_48, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc24_48.2: = bound_method %float, %specific_fn [concrete = constants.%bound_method] -// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc24_48.2(%float) [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc24_48.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc24_55.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] +// CHECK:STDOUT: %impl.elem0.loc24_55: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] +// CHECK:STDOUT: %bound_method.loc24_55.1: = bound_method %float, %impl.elem0.loc24_55 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc24_55, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc24_55.2: = bound_method %float, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc24_55.2(%float) [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc24_55.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc24_48.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc24_48.4: init %f32.97e to %.loc24_48.3 = in_place_init %.loc24_48.2 [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc24_48.5: init %array_type to %a.var = array_init (%.loc24_48.4) [concrete = constants.%array] -// CHECK:STDOUT: %.loc24_3: init %array_type = converted %.loc24_48.1, %.loc24_48.5 [concrete = constants.%array] +// CHECK:STDOUT: %.loc24_55.3: ref %f32.97e = array_index %a.var, %int_0 +// CHECK:STDOUT: %.loc24_55.4: init %f32.97e to %.loc24_55.3 = in_place_init %.loc24_55.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc24_55.5: init %array_type to %a.var = array_init (%.loc24_55.4) [concrete = constants.%array] +// CHECK:STDOUT: %.loc24_3: init %array_type = converted %.loc24_55.1, %.loc24_55.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc24_3 -// CHECK:STDOUT: %.loc24_39: type = splice_block %array_type [concrete = constants.%array_type] { +// CHECK:STDOUT: %.loc24_46: type = splice_block %array_type [concrete = constants.%array_type] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %f32: type = class_type @Float, @Float(constants.%int_32) [concrete = constants.%f32.97e] // CHECK:STDOUT: %int_1.loc24: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %Cpp.ref.loc24: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %long_long.ref.loc24: type = name_ref long_long, constants.%Cpp.long_long [concrete = constants.%Cpp.long_long] -// CHECK:STDOUT: %impl.elem0.loc24_23.1: %.c9c = impl_witness_access constants.%As.impl_witness.158, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert] -// CHECK:STDOUT: %bound_method.loc24_23.1: = bound_method %int_1.loc24, %impl.elem0.loc24_23.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %Cpp.long_long = call %bound_method.loc24_23.1(%int_1.loc24) [concrete = constants.%int_1.092] -// CHECK:STDOUT: %.loc24_23.1: %Cpp.long_long = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.092] -// CHECK:STDOUT: %.loc24_23.2: %Cpp.long_long = converted %int_1.loc24, %.loc24_23.1 [concrete = constants.%int_1.092] -// CHECK:STDOUT: %impl.elem0.loc24_23.2: %.0a4 = impl_witness_access constants.%ImplicitAs.impl_witness.737, element0 [concrete = constants.%Cpp.long_long.as.ImplicitAs.impl.Convert] -// CHECK:STDOUT: %bound_method.loc24_23.2: = bound_method %.loc24_23.2, %impl.elem0.loc24_23.2 [concrete = constants.%Cpp.long_long.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %Cpp.long_long.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.loc24_23.2(%.loc24_23.2) [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc24_23.3: Core.IntLiteral = value_of_initializer %Cpp.long_long.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc24_23.4: Core.IntLiteral = converted %.loc24_23.2, %.loc24_23.3 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %array_type: type = array_type %.loc24_23.4, %f32 [concrete = constants.%array_type] +// CHECK:STDOUT: %impl.elem0.loc24_30.1: %.c9c = impl_witness_access constants.%As.impl_witness.158, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert] +// CHECK:STDOUT: %bound_method.loc24_30.1: = bound_method %int_1.loc24, %impl.elem0.loc24_30.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %Cpp.long_long = call %bound_method.loc24_30.1(%int_1.loc24) [concrete = constants.%int_1.092] +// CHECK:STDOUT: %.loc24_30.1: %Cpp.long_long = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.092] +// CHECK:STDOUT: %.loc24_30.2: %Cpp.long_long = converted %int_1.loc24, %.loc24_30.1 [concrete = constants.%int_1.092] +// CHECK:STDOUT: %impl.elem0.loc24_30.2: %.0a4 = impl_witness_access constants.%ImplicitAs.impl_witness.737, element0 [concrete = constants.%Cpp.long_long.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %bound_method.loc24_30.2: = bound_method %.loc24_30.2, %impl.elem0.loc24_30.2 [concrete = constants.%Cpp.long_long.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %Cpp.long_long.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.loc24_30.2(%.loc24_30.2) [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc24_30.3: Core.IntLiteral = value_of_initializer %Cpp.long_long.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc24_30.4: Core.IntLiteral = converted %.loc24_30.2, %.loc24_30.3 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %array_type: type = array_type %.loc24_30.4, %f32 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %a.var, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%a.var) -// CHECK:STDOUT: %LongResult.cpp_destructor.bound: = bound_method %.loc22_70.3, constants.%LongResult.cpp_destructor -// CHECK:STDOUT: %LongResult.cpp_destructor.call: init %empty_tuple.type = call %LongResult.cpp_destructor.bound(%.loc22_70.3) -// CHECK:STDOUT: %LongLongResult.cpp_destructor.bound.loc19: = bound_method %.loc19_94.3, constants.%LongLongResult.cpp_destructor -// CHECK:STDOUT: %LongLongResult.cpp_destructor.call.loc19: init %empty_tuple.type = call %LongLongResult.cpp_destructor.bound.loc19(%.loc19_94.3) -// CHECK:STDOUT: %LongLongResult.cpp_destructor.bound.loc16: = bound_method %.loc16_80.3, constants.%LongLongResult.cpp_destructor -// CHECK:STDOUT: %LongLongResult.cpp_destructor.call.loc16: init %empty_tuple.type = call %LongLongResult.cpp_destructor.bound.loc16(%.loc16_80.3) +// CHECK:STDOUT: %LongResult.cpp_destructor.bound: = bound_method %.loc22_77.3, constants.%LongResult.cpp_destructor +// CHECK:STDOUT: %LongResult.cpp_destructor.call: init %empty_tuple.type = call %LongResult.cpp_destructor.bound(%.loc22_77.3) +// CHECK:STDOUT: %LongLongResult.cpp_destructor.bound.loc19: = bound_method %.loc19_101.3, constants.%LongLongResult.cpp_destructor +// CHECK:STDOUT: %LongLongResult.cpp_destructor.call.loc19: init %empty_tuple.type = call %LongLongResult.cpp_destructor.bound.loc19(%.loc19_101.3) +// CHECK:STDOUT: %LongLongResult.cpp_destructor.bound.loc16: = bound_method %.loc16_87.3, constants.%LongLongResult.cpp_destructor +// CHECK:STDOUT: %LongLongResult.cpp_destructor.call.loc16: init %empty_tuple.type = call %LongLongResult.cpp_destructor.bound.loc16(%.loc16_87.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1281,12 +1281,12 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref %Cpp.long_long = var %b.var_patt // CHECK:STDOUT: %a.ref: ref %Cpp.long_long = name_ref a, %a -// CHECK:STDOUT: %.loc9_26: %Cpp.long_long = acquire_value %a.ref +// CHECK:STDOUT: %.loc9_33: %Cpp.long_long = acquire_value %a.ref // CHECK:STDOUT: %impl.elem0.loc9: %.3c6 = impl_witness_access constants.%Copy.impl_witness.6d4, element0 [concrete = constants.%Cpp.long_long.as.Copy.impl.Op] -// CHECK:STDOUT: %bound_method.loc9: = bound_method %.loc9_26, %impl.elem0.loc9 -// CHECK:STDOUT: %Cpp.long_long.as.Copy.impl.Op.call: init %Cpp.long_long = call %bound_method.loc9(%.loc9_26) +// CHECK:STDOUT: %bound_method.loc9: = bound_method %.loc9_33, %impl.elem0.loc9 +// CHECK:STDOUT: %Cpp.long_long.as.Copy.impl.Op.call: init %Cpp.long_long = call %bound_method.loc9(%.loc9_33) // CHECK:STDOUT: assign %b.var, %Cpp.long_long.as.Copy.impl.Op.call -// CHECK:STDOUT: %.loc9_13: type = splice_block %long_long.ref.loc9 [concrete = constants.%Cpp.long_long] { +// CHECK:STDOUT: %.loc9_20: type = splice_block %long_long.ref.loc9 [concrete = constants.%Cpp.long_long] { // CHECK:STDOUT: %Cpp.ref.loc9: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %long_long.ref.loc9: type = name_ref long_long, constants.%Cpp.long_long [concrete = constants.%Cpp.long_long] // CHECK:STDOUT: } @@ -3803,20 +3803,20 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %cpp_unsigned_long_long_result.patt: %pattern_type.633 = value_binding_pattern cpp_unsigned_long_long_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc16_60: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc16_67: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %PassULongLong.ref.loc16: %PassULongLong.cpp_overload_set.type = name_ref PassULongLong, imports.%PassULongLong.cpp_overload_set.value [concrete = constants.%PassULongLong.cpp_overload_set.value] // CHECK:STDOUT: %cpp_unsigned_long_long.ref.loc16: %Cpp.unsigned_long_long = name_ref cpp_unsigned_long_long, %cpp_unsigned_long_long -// CHECK:STDOUT: %.loc16_100.1: ref %ULongLongResult = temporary_storage -// CHECK:STDOUT: %addr.loc16: %ptr.d19 = addr_of %.loc16_100.1 +// CHECK:STDOUT: %.loc16_107.1: ref %ULongLongResult = temporary_storage +// CHECK:STDOUT: %addr.loc16: %ptr.d19 = addr_of %.loc16_107.1 // CHECK:STDOUT: %PassULongLong__carbon_thunk.call.loc16: init %empty_tuple.type = call imports.%PassULongLong__carbon_thunk.decl.f0c073.1(%cpp_unsigned_long_long.ref.loc16, %addr.loc16) -// CHECK:STDOUT: %.loc16_100.2: init %ULongLongResult to %.loc16_100.1 = mark_in_place_init %PassULongLong__carbon_thunk.call.loc16 -// CHECK:STDOUT: %.loc16_41: type = splice_block %ULongLongResult.ref.loc16 [concrete = constants.%ULongLongResult] { -// CHECK:STDOUT: %Cpp.ref.loc16_38: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc16_107.2: init %ULongLongResult to %.loc16_107.1 = mark_in_place_init %PassULongLong__carbon_thunk.call.loc16 +// CHECK:STDOUT: %.loc16_48: type = splice_block %ULongLongResult.ref.loc16 [concrete = constants.%ULongLongResult] { +// CHECK:STDOUT: %Cpp.ref.loc16_45: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ULongLongResult.ref.loc16: type = name_ref ULongLongResult, imports.%ULongLongResult.decl [concrete = constants.%ULongLongResult] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc16_100.3: ref %ULongLongResult = temporary %.loc16_100.1, %.loc16_100.2 -// CHECK:STDOUT: %.loc16_100.4: %ULongLongResult = acquire_value %.loc16_100.3 -// CHECK:STDOUT: %cpp_unsigned_long_long_result: %ULongLongResult = value_binding cpp_unsigned_long_long_result, %.loc16_100.4 +// CHECK:STDOUT: %.loc16_107.3: ref %ULongLongResult = temporary %.loc16_107.1, %.loc16_107.2 +// CHECK:STDOUT: %.loc16_107.4: %ULongLongResult = acquire_value %.loc16_107.3 +// CHECK:STDOUT: %cpp_unsigned_long_long_result: %ULongLongResult = value_binding cpp_unsigned_long_long_result, %.loc16_107.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %cpp_compat_ulong_long.patt: %pattern_type.ebd = value_binding_pattern cpp_compat_ulong_long [concrete] // CHECK:STDOUT: } @@ -3830,20 +3830,20 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %cpp_compat_ulong_long_result.patt: %pattern_type.633 = value_binding_pattern cpp_compat_ulong_long_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc19_59: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc19_66: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %PassULongLong.ref.loc19: %PassULongLong.cpp_overload_set.type = name_ref PassULongLong, imports.%PassULongLong.cpp_overload_set.value [concrete = constants.%PassULongLong.cpp_overload_set.value] // CHECK:STDOUT: %cpp_compat_ulong_long.ref: %Cpp.unsigned_long_long = name_ref cpp_compat_ulong_long, %cpp_compat_ulong_long -// CHECK:STDOUT: %.loc19_98.1: ref %ULongLongResult = temporary_storage -// CHECK:STDOUT: %addr.loc19: %ptr.d19 = addr_of %.loc19_98.1 +// CHECK:STDOUT: %.loc19_105.1: ref %ULongLongResult = temporary_storage +// CHECK:STDOUT: %addr.loc19: %ptr.d19 = addr_of %.loc19_105.1 // CHECK:STDOUT: %PassULongLong__carbon_thunk.call.loc19: init %empty_tuple.type = call imports.%PassULongLong__carbon_thunk.decl.f0c073.1(%cpp_compat_ulong_long.ref, %addr.loc19) -// CHECK:STDOUT: %.loc19_98.2: init %ULongLongResult to %.loc19_98.1 = mark_in_place_init %PassULongLong__carbon_thunk.call.loc19 -// CHECK:STDOUT: %.loc19_40: type = splice_block %ULongLongResult.ref.loc19 [concrete = constants.%ULongLongResult] { -// CHECK:STDOUT: %Cpp.ref.loc19_37: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc19_105.2: init %ULongLongResult to %.loc19_105.1 = mark_in_place_init %PassULongLong__carbon_thunk.call.loc19 +// CHECK:STDOUT: %.loc19_47: type = splice_block %ULongLongResult.ref.loc19 [concrete = constants.%ULongLongResult] { +// CHECK:STDOUT: %Cpp.ref.loc19_44: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ULongLongResult.ref.loc19: type = name_ref ULongLongResult, imports.%ULongLongResult.decl [concrete = constants.%ULongLongResult] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19_98.3: ref %ULongLongResult = temporary %.loc19_98.1, %.loc19_98.2 -// CHECK:STDOUT: %.loc19_98.4: %ULongLongResult = acquire_value %.loc19_98.3 -// CHECK:STDOUT: %cpp_compat_ulong_long_result: %ULongLongResult = value_binding cpp_compat_ulong_long_result, %.loc19_98.4 +// CHECK:STDOUT: %.loc19_105.3: ref %ULongLongResult = temporary %.loc19_105.1, %.loc19_105.2 +// CHECK:STDOUT: %.loc19_105.4: %ULongLongResult = acquire_value %.loc19_105.3 +// CHECK:STDOUT: %cpp_compat_ulong_long_result: %ULongLongResult = value_binding cpp_compat_ulong_long_result, %.loc19_105.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %carbon_u64.patt: %pattern_type.157 = value_binding_pattern carbon_u64 [concrete] // CHECK:STDOUT: } @@ -3861,66 +3861,66 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %carbon_u64_result.patt: %pattern_type.6f2 = value_binding_pattern carbon_u64_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc22_44: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc22_51: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %PassULongLong.ref.loc22: %PassULongLong.cpp_overload_set.type = name_ref PassULongLong, imports.%PassULongLong.cpp_overload_set.value [concrete = constants.%PassULongLong.cpp_overload_set.value] // CHECK:STDOUT: %carbon_u64.ref: %u64 = name_ref carbon_u64, %carbon_u64 -// CHECK:STDOUT: %.loc22_72.1: ref %ULongResult = temporary_storage -// CHECK:STDOUT: %addr.loc22: %ptr.f5e = addr_of %.loc22_72.1 +// CHECK:STDOUT: %.loc22_79.1: ref %ULongResult = temporary_storage +// CHECK:STDOUT: %addr.loc22: %ptr.f5e = addr_of %.loc22_79.1 // CHECK:STDOUT: %PassULongLong__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%PassULongLong__carbon_thunk.decl.f0c073.2(%carbon_u64.ref, %addr.loc22) -// CHECK:STDOUT: %.loc22_72.2: init %ULongResult to %.loc22_72.1 = mark_in_place_init %PassULongLong__carbon_thunk.call.loc22 -// CHECK:STDOUT: %.loc22_29: type = splice_block %ULongResult.ref [concrete = constants.%ULongResult] { -// CHECK:STDOUT: %Cpp.ref.loc22_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc22_79.2: init %ULongResult to %.loc22_79.1 = mark_in_place_init %PassULongLong__carbon_thunk.call.loc22 +// CHECK:STDOUT: %.loc22_36: type = splice_block %ULongResult.ref [concrete = constants.%ULongResult] { +// CHECK:STDOUT: %Cpp.ref.loc22_33: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ULongResult.ref: type = name_ref ULongResult, imports.%ULongResult.decl [concrete = constants.%ULongResult] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22_72.3: ref %ULongResult = temporary %.loc22_72.1, %.loc22_72.2 -// CHECK:STDOUT: %.loc22_72.4: %ULongResult = acquire_value %.loc22_72.3 -// CHECK:STDOUT: %carbon_u64_result: %ULongResult = value_binding carbon_u64_result, %.loc22_72.4 +// CHECK:STDOUT: %.loc22_79.3: ref %ULongResult = temporary %.loc22_79.1, %.loc22_79.2 +// CHECK:STDOUT: %.loc22_79.4: %ULongResult = acquire_value %.loc22_79.3 +// CHECK:STDOUT: %carbon_u64_result: %ULongResult = value_binding carbon_u64_result, %.loc22_79.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.b36 = ref_binding_pattern a [concrete] // CHECK:STDOUT: %a.var_patt: %pattern_type.b36 = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %array_type = var %a.var_patt // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float.674] -// CHECK:STDOUT: %.loc24_57.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] -// CHECK:STDOUT: %impl.elem0.loc24_57: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] -// CHECK:STDOUT: %bound_method.loc24_57.1: = bound_method %float, %impl.elem0.loc24_57 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc24_57, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc24_57.2: = bound_method %float, %specific_fn [concrete = constants.%bound_method] -// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc24_57.2(%float) [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc24_57.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc24_64.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] +// CHECK:STDOUT: %impl.elem0.loc24_64: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] +// CHECK:STDOUT: %bound_method.loc24_64.1: = bound_method %float, %impl.elem0.loc24_64 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc24_64, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc24_64.2: = bound_method %float, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc24_64.2(%float) [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc24_64.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc24_57.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc24_57.4: init %f32.97e to %.loc24_57.3 = in_place_init %.loc24_57.2 [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc24_57.5: init %array_type to %a.var = array_init (%.loc24_57.4) [concrete = constants.%array] -// CHECK:STDOUT: %.loc24_3: init %array_type = converted %.loc24_57.1, %.loc24_57.5 [concrete = constants.%array] +// CHECK:STDOUT: %.loc24_64.3: ref %f32.97e = array_index %a.var, %int_0 +// CHECK:STDOUT: %.loc24_64.4: init %f32.97e to %.loc24_64.3 = in_place_init %.loc24_64.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc24_64.5: init %array_type to %a.var = array_init (%.loc24_64.4) [concrete = constants.%array] +// CHECK:STDOUT: %.loc24_3: init %array_type = converted %.loc24_64.1, %.loc24_64.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc24_3 -// CHECK:STDOUT: %.loc24_48: type = splice_block %array_type [concrete = constants.%array_type] { +// CHECK:STDOUT: %.loc24_55: type = splice_block %array_type [concrete = constants.%array_type] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %f32: type = class_type @Float, @Float(constants.%int_32) [concrete = constants.%f32.97e] // CHECK:STDOUT: %int_1.loc24: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %Cpp.ref.loc24: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %unsigned_long_long.ref.loc24: type = name_ref unsigned_long_long, constants.%Cpp.unsigned_long_long [concrete = constants.%Cpp.unsigned_long_long] -// CHECK:STDOUT: %impl.elem0.loc24_23.1: %.83e = impl_witness_access constants.%As.impl_witness.d1f, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert] -// CHECK:STDOUT: %bound_method.loc24_23.1: = bound_method %int_1.loc24, %impl.elem0.loc24_23.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %Cpp.unsigned_long_long = call %bound_method.loc24_23.1(%int_1.loc24) [concrete = constants.%int_1.79a] -// CHECK:STDOUT: %.loc24_23.1: %Cpp.unsigned_long_long = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.79a] -// CHECK:STDOUT: %.loc24_23.2: %Cpp.unsigned_long_long = converted %int_1.loc24, %.loc24_23.1 [concrete = constants.%int_1.79a] -// CHECK:STDOUT: %impl.elem0.loc24_23.2: %.66f = impl_witness_access constants.%ImplicitAs.impl_witness.7c3, element0 [concrete = constants.%Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert.ffb] -// CHECK:STDOUT: %bound_method.loc24_23.2: = bound_method %.loc24_23.2, %impl.elem0.loc24_23.2 [concrete = constants.%Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert.call.loc24: init Core.IntLiteral = call %bound_method.loc24_23.2(%.loc24_23.2) [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc24_23.3: Core.IntLiteral = value_of_initializer %Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert.call.loc24 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc24_23.4: Core.IntLiteral = converted %.loc24_23.2, %.loc24_23.3 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %array_type: type = array_type %.loc24_23.4, %f32 [concrete = constants.%array_type] +// CHECK:STDOUT: %impl.elem0.loc24_30.1: %.83e = impl_witness_access constants.%As.impl_witness.d1f, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert] +// CHECK:STDOUT: %bound_method.loc24_30.1: = bound_method %int_1.loc24, %impl.elem0.loc24_30.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %Cpp.unsigned_long_long = call %bound_method.loc24_30.1(%int_1.loc24) [concrete = constants.%int_1.79a] +// CHECK:STDOUT: %.loc24_30.1: %Cpp.unsigned_long_long = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.79a] +// CHECK:STDOUT: %.loc24_30.2: %Cpp.unsigned_long_long = converted %int_1.loc24, %.loc24_30.1 [concrete = constants.%int_1.79a] +// CHECK:STDOUT: %impl.elem0.loc24_30.2: %.66f = impl_witness_access constants.%ImplicitAs.impl_witness.7c3, element0 [concrete = constants.%Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert.ffb] +// CHECK:STDOUT: %bound_method.loc24_30.2: = bound_method %.loc24_30.2, %impl.elem0.loc24_30.2 [concrete = constants.%Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert.call.loc24: init Core.IntLiteral = call %bound_method.loc24_30.2(%.loc24_30.2) [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc24_30.3: Core.IntLiteral = value_of_initializer %Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert.call.loc24 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc24_30.4: Core.IntLiteral = converted %.loc24_30.2, %.loc24_30.3 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %array_type: type = array_type %.loc24_30.4, %f32 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %a.var, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%a.var) -// CHECK:STDOUT: %ULongResult.cpp_destructor.bound: = bound_method %.loc22_72.3, constants.%ULongResult.cpp_destructor -// CHECK:STDOUT: %ULongResult.cpp_destructor.call: init %empty_tuple.type = call %ULongResult.cpp_destructor.bound(%.loc22_72.3) -// CHECK:STDOUT: %ULongLongResult.cpp_destructor.bound.loc19: = bound_method %.loc19_98.3, constants.%ULongLongResult.cpp_destructor -// CHECK:STDOUT: %ULongLongResult.cpp_destructor.call.loc19: init %empty_tuple.type = call %ULongLongResult.cpp_destructor.bound.loc19(%.loc19_98.3) -// CHECK:STDOUT: %ULongLongResult.cpp_destructor.bound.loc16: = bound_method %.loc16_100.3, constants.%ULongLongResult.cpp_destructor -// CHECK:STDOUT: %ULongLongResult.cpp_destructor.call.loc16: init %empty_tuple.type = call %ULongLongResult.cpp_destructor.bound.loc16(%.loc16_100.3) +// CHECK:STDOUT: %ULongResult.cpp_destructor.bound: = bound_method %.loc22_79.3, constants.%ULongResult.cpp_destructor +// CHECK:STDOUT: %ULongResult.cpp_destructor.call: init %empty_tuple.type = call %ULongResult.cpp_destructor.bound(%.loc22_79.3) +// CHECK:STDOUT: %ULongLongResult.cpp_destructor.bound.loc19: = bound_method %.loc19_105.3, constants.%ULongLongResult.cpp_destructor +// CHECK:STDOUT: %ULongLongResult.cpp_destructor.call.loc19: init %empty_tuple.type = call %ULongLongResult.cpp_destructor.bound.loc19(%.loc19_105.3) +// CHECK:STDOUT: %ULongLongResult.cpp_destructor.bound.loc16: = bound_method %.loc16_107.3, constants.%ULongLongResult.cpp_destructor +// CHECK:STDOUT: %ULongLongResult.cpp_destructor.call.loc16: init %empty_tuple.type = call %ULongLongResult.cpp_destructor.bound.loc16(%.loc16_107.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3988,12 +3988,12 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref %Cpp.unsigned_long_long = var %b.var_patt // CHECK:STDOUT: %a.ref: ref %Cpp.unsigned_long_long = name_ref a, %a -// CHECK:STDOUT: %.loc9_35: %Cpp.unsigned_long_long = acquire_value %a.ref +// CHECK:STDOUT: %.loc9_42: %Cpp.unsigned_long_long = acquire_value %a.ref // CHECK:STDOUT: %impl.elem0.loc9: %.d24 = impl_witness_access constants.%Copy.impl_witness.95c, element0 [concrete = constants.%Cpp.unsigned_long_long.as.Copy.impl.Op] -// CHECK:STDOUT: %bound_method.loc9: = bound_method %.loc9_35, %impl.elem0.loc9 -// CHECK:STDOUT: %Cpp.unsigned_long_long.as.Copy.impl.Op.call: init %Cpp.unsigned_long_long = call %bound_method.loc9(%.loc9_35) +// CHECK:STDOUT: %bound_method.loc9: = bound_method %.loc9_42, %impl.elem0.loc9 +// CHECK:STDOUT: %Cpp.unsigned_long_long.as.Copy.impl.Op.call: init %Cpp.unsigned_long_long = call %bound_method.loc9(%.loc9_42) // CHECK:STDOUT: assign %b.var, %Cpp.unsigned_long_long.as.Copy.impl.Op.call -// CHECK:STDOUT: %.loc9_13: type = splice_block %unsigned_long_long.ref.loc9 [concrete = constants.%Cpp.unsigned_long_long] { +// CHECK:STDOUT: %.loc9_20: type = splice_block %unsigned_long_long.ref.loc9 [concrete = constants.%Cpp.unsigned_long_long] { // CHECK:STDOUT: %Cpp.ref.loc9: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %unsigned_long_long.ref.loc9: type = name_ref unsigned_long_long, constants.%Cpp.unsigned_long_long [concrete = constants.%Cpp.unsigned_long_long] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/class/abstract.carbon b/toolchain/check/testdata/interop/cpp/class/abstract.carbon index c2671e523e36..5d7b3dadb111 100644 --- a/toolchain/check/testdata/interop/cpp/class/abstract.carbon +++ b/toolchain/check/testdata/interop/cpp/class/abstract.carbon @@ -47,10 +47,10 @@ import Cpp library "abstract.h"; class C { extend base: Cpp.A; // CHECK:STDERR: fail_todo_impl_abstract_member.carbon:[[@LINE+4]]:3: error: override without compatible virtual in base class [OverrideWithoutVirtualInBase] - // CHECK:STDERR: override fn f[ref self: Self]() {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: override fn f[unused ref self: Self]() {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - override fn f[ref self: Self]() {} + override fn f[unused ref self: Self]() {} } // --- abstract_final.h diff --git a/toolchain/check/testdata/interop/cpp/class/access.carbon b/toolchain/check/testdata/interop/cpp/class/access.carbon index 1538640dad55..4b62768c6b42 100644 --- a/toolchain/check/testdata/interop/cpp/class/access.carbon +++ b/toolchain/check/testdata/interop/cpp/class/access.carbon @@ -29,8 +29,8 @@ import Cpp library "non_function_member_public.h"; fn F(s: Cpp.S) { //@dump-sem-ir-begin - let instance_data: i32 = s.instance_data; - let static_data: i32 = Cpp.S.static_data; + let unused instance_data: i32 = s.instance_data; + let unused static_data: i32 = Cpp.S.static_data; //@dump-sem-ir-end } @@ -46,8 +46,8 @@ class Derived { fn F(d: Derived) { //@dump-sem-ir-begin - let instance_data: i32 = d.instance_data; - let static_data: i32 = Derived.static_data; + let unused instance_data: i32 = d.instance_data; + let unused static_data: i32 = Derived.static_data; //@dump-sem-ir-end } @@ -70,23 +70,23 @@ library "[[@TEST_NAME]]"; import Cpp library "non_function_member_protected.h"; fn F(c: Cpp.C) { - // CHECK:STDERR: fail_import_non_function_member_protected.carbon:[[@LINE+8]]:28: error: cannot access protected member `instance_data` of type `Cpp.C` [ClassInvalidMemberAccess] - // CHECK:STDERR: let instance_data: i32 = c.instance_data; - // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_non_function_member_protected.carbon:[[@LINE+8]]:35: error: cannot access protected member `instance_data` of type `Cpp.C` [ClassInvalidMemberAccess] + // CHECK:STDERR: let unused instance_data: i32 = c.instance_data; + // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_import_non_function_member_protected.carbon:[[@LINE-6]]:10: in file included here [InCppInclude] // CHECK:STDERR: ./non_function_member_protected.h:2:7: note: declared here [ClassMemberDeclaration] // CHECK:STDERR: class C { // CHECK:STDERR: ^ // CHECK:STDERR: - let instance_data: i32 = c.instance_data; - // CHECK:STDERR: fail_import_non_function_member_protected.carbon:[[@LINE+7]]:26: error: cannot access protected member `static_data` of type `Cpp.C` [ClassInvalidMemberAccess] - // CHECK:STDERR: let static_data: i32 = Cpp.C.static_data; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_import_non_function_member_protected.carbon:[[@LINE+4]]:26: note: declared here [ClassMemberDeclaration] - // CHECK:STDERR: let static_data: i32 = Cpp.C.static_data; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ + let unused instance_data: i32 = c.instance_data; + // CHECK:STDERR: fail_import_non_function_member_protected.carbon:[[@LINE+7]]:33: error: cannot access protected member `static_data` of type `Cpp.C` [ClassInvalidMemberAccess] + // CHECK:STDERR: let unused static_data: i32 = Cpp.C.static_data; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_non_function_member_protected.carbon:[[@LINE+4]]:33: note: declared here [ClassMemberDeclaration] + // CHECK:STDERR: let unused static_data: i32 = Cpp.C.static_data; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let static_data: i32 = Cpp.C.static_data; + let unused static_data: i32 = Cpp.C.static_data; } // --- fail_import_non_function_member_protected_extend.carbon @@ -100,23 +100,23 @@ class Derived { } fn F(d: Derived) { - // CHECK:STDERR: fail_import_non_function_member_protected_extend.carbon:[[@LINE+8]]:28: error: cannot access protected member `instance_data` of type `Derived` [ClassInvalidMemberAccess] - // CHECK:STDERR: let instance_data: i32 = d.instance_data; - // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_non_function_member_protected_extend.carbon:[[@LINE+8]]:35: error: cannot access protected member `instance_data` of type `Derived` [ClassInvalidMemberAccess] + // CHECK:STDERR: let unused instance_data: i32 = d.instance_data; + // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_import_non_function_member_protected_extend.carbon:[[@LINE-10]]:10: in file included here [InCppInclude] // CHECK:STDERR: ./non_function_member_protected.h:2:7: note: declared here [ClassMemberDeclaration] // CHECK:STDERR: class C { // CHECK:STDERR: ^ // CHECK:STDERR: - let instance_data: i32 = d.instance_data; - // CHECK:STDERR: fail_import_non_function_member_protected_extend.carbon:[[@LINE+7]]:26: error: cannot access protected member `static_data` of type `Derived` [ClassInvalidMemberAccess] - // CHECK:STDERR: let static_data: i32 = Derived.static_data; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_import_non_function_member_protected_extend.carbon:[[@LINE+4]]:26: note: declared here [ClassMemberDeclaration] - // CHECK:STDERR: let static_data: i32 = Derived.static_data; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ + let unused instance_data: i32 = d.instance_data; + // CHECK:STDERR: fail_import_non_function_member_protected_extend.carbon:[[@LINE+7]]:33: error: cannot access protected member `static_data` of type `Derived` [ClassInvalidMemberAccess] + // CHECK:STDERR: let unused static_data: i32 = Derived.static_data; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_non_function_member_protected_extend.carbon:[[@LINE+4]]:33: note: declared here [ClassMemberDeclaration] + // CHECK:STDERR: let unused static_data: i32 = Derived.static_data; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let static_data: i32 = Derived.static_data; + let unused static_data: i32 = Derived.static_data; } // --- import_non_function_member_protected_extend_call_in_member.carbon @@ -129,10 +129,10 @@ class Derived { extend base: Cpp.C; fn F[self: Self]() { //@dump-sem-ir-begin - let instance_data: i32 = self.instance_data; - let unqualified_static_data: i32 = static_data; - let derived_static_data: i32 = Derived.static_data; - let base_static_data: i32 = Cpp.C.static_data; + let unused instance_data: i32 = self.instance_data; + let unused unqualified_static_data: i32 = static_data; + let unused derived_static_data: i32 = Derived.static_data; + let unused base_static_data: i32 = Cpp.C.static_data; //@dump-sem-ir-end } } @@ -155,23 +155,23 @@ library "[[@TEST_NAME]]"; import Cpp library "non_function_member_private.h"; fn F(c: Cpp.C) { - // CHECK:STDERR: fail_import_non_function_member_private.carbon:[[@LINE+8]]:28: error: cannot access private member `instance_data` of type `Cpp.C` [ClassInvalidMemberAccess] - // CHECK:STDERR: let instance_data: i32 = c.instance_data; - // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_non_function_member_private.carbon:[[@LINE+8]]:35: error: cannot access private member `instance_data` of type `Cpp.C` [ClassInvalidMemberAccess] + // CHECK:STDERR: let unused instance_data: i32 = c.instance_data; + // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_import_non_function_member_private.carbon:[[@LINE-6]]:10: in file included here [InCppInclude] // CHECK:STDERR: ./non_function_member_private.h:2:7: note: declared here [ClassMemberDeclaration] // CHECK:STDERR: class C { // CHECK:STDERR: ^ // CHECK:STDERR: - let instance_data: i32 = c.instance_data; - // CHECK:STDERR: fail_import_non_function_member_private.carbon:[[@LINE+7]]:26: error: cannot access private member `static_data` of type `Cpp.C` [ClassInvalidMemberAccess] - // CHECK:STDERR: let static_data: i32 = Cpp.C.static_data; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_import_non_function_member_private.carbon:[[@LINE+4]]:26: note: declared here [ClassMemberDeclaration] - // CHECK:STDERR: let static_data: i32 = Cpp.C.static_data; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ + let unused instance_data: i32 = c.instance_data; + // CHECK:STDERR: fail_import_non_function_member_private.carbon:[[@LINE+7]]:33: error: cannot access private member `static_data` of type `Cpp.C` [ClassInvalidMemberAccess] + // CHECK:STDERR: let unused static_data: i32 = Cpp.C.static_data; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_non_function_member_private.carbon:[[@LINE+4]]:33: note: declared here [ClassMemberDeclaration] + // CHECK:STDERR: let unused static_data: i32 = Cpp.C.static_data; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let static_data: i32 = Cpp.C.static_data; + let unused static_data: i32 = Cpp.C.static_data; } // --- fail_import_non_function_member_private_extend.carbon @@ -183,44 +183,44 @@ import Cpp library "non_function_member_private.h"; class Derived { extend base: Cpp.C; fn F[self: Self]() { - // CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE+8]]:30: error: cannot access private member `instance_data` of type `Cpp.C` [ClassInvalidMemberAccess] - // CHECK:STDERR: let instance_data: i32 = self.instance_data; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE+8]]:37: error: cannot access private member `instance_data` of type `Cpp.C` [ClassInvalidMemberAccess] + // CHECK:STDERR: let unused instance_data: i32 = self.instance_data; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE-8]]:10: in file included here [InCppInclude] // CHECK:STDERR: ./non_function_member_private.h:2:7: note: declared here [ClassMemberDeclaration] // CHECK:STDERR: class C { // CHECK:STDERR: ^ // CHECK:STDERR: - let instance_data: i32 = self.instance_data; + let unused instance_data: i32 = self.instance_data; } } fn F(d: Derived) { - // CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE+8]]:28: error: cannot access private member `instance_data` of type `Cpp.C` [ClassInvalidMemberAccess] - // CHECK:STDERR: let instance_data: i32 = d.instance_data; - // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE+8]]:35: error: cannot access private member `instance_data` of type `Cpp.C` [ClassInvalidMemberAccess] + // CHECK:STDERR: let unused instance_data: i32 = d.instance_data; + // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE-21]]:10: in file included here [InCppInclude] // CHECK:STDERR: ./non_function_member_private.h:2:7: note: declared here [ClassMemberDeclaration] // CHECK:STDERR: class C { // CHECK:STDERR: ^ // CHECK:STDERR: - let instance_data: i32 = d.instance_data; - // CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE+7]]:34: error: cannot access private member `static_data` of type `Cpp.C` [ClassInvalidMemberAccess] - // CHECK:STDERR: let derived_static_data: i32 = Derived.static_data; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE+4]]:34: note: declared here [ClassMemberDeclaration] - // CHECK:STDERR: let derived_static_data: i32 = Derived.static_data; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ + let unused instance_data: i32 = d.instance_data; + // CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE+7]]:41: error: cannot access private member `static_data` of type `Cpp.C` [ClassInvalidMemberAccess] + // CHECK:STDERR: let unused derived_static_data: i32 = Derived.static_data; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE+4]]:41: note: declared here [ClassMemberDeclaration] + // CHECK:STDERR: let unused derived_static_data: i32 = Derived.static_data; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let derived_static_data: i32 = Derived.static_data; - // CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE+7]]:31: error: cannot access private member `static_data` of type `Cpp.C` [ClassInvalidMemberAccess] - // CHECK:STDERR: let base_static_data: i32 = Cpp.C.static_data; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE-4]]:34: note: declared here [ClassMemberDeclaration] - // CHECK:STDERR: let derived_static_data: i32 = Derived.static_data; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ + let unused derived_static_data: i32 = Derived.static_data; + // CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE+7]]:38: error: cannot access private member `static_data` of type `Cpp.C` [ClassInvalidMemberAccess] + // CHECK:STDERR: let unused base_static_data: i32 = Cpp.C.static_data; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE-4]]:41: note: declared here [ClassMemberDeclaration] + // CHECK:STDERR: let unused derived_static_data: i32 = Derived.static_data; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let base_static_data: i32 = Cpp.C.static_data; + let unused base_static_data: i32 = Cpp.C.static_data; } // --- fail_import_non_function_member_private_extend_static_within_member_function.carbon @@ -233,14 +233,14 @@ class Derived { extend base: Cpp.C; fn F() { // TODO: `C.static_data` is private, so this should fail. - // CHECK:STDERR: fail_import_non_function_member_private_extend_static_within_member_function.carbon:[[@LINE+7]]:40: error: cannot access private member `static_data` of type `Cpp.C` [ClassInvalidMemberAccess] - // CHECK:STDERR: let unqualified_static_data: i32 = static_data; - // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_import_non_function_member_private_extend_static_within_member_function.carbon:[[@LINE+4]]:40: note: declared here [ClassMemberDeclaration] - // CHECK:STDERR: let unqualified_static_data: i32 = static_data; - // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: fail_import_non_function_member_private_extend_static_within_member_function.carbon:[[@LINE+7]]:47: error: cannot access private member `static_data` of type `Cpp.C` [ClassInvalidMemberAccess] + // CHECK:STDERR: let unused unqualified_static_data: i32 = static_data; + // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: fail_import_non_function_member_private_extend_static_within_member_function.carbon:[[@LINE+4]]:47: note: declared here [ClassMemberDeclaration] + // CHECK:STDERR: let unused unqualified_static_data: i32 = static_data; + // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: - let unqualified_static_data: i32 = static_data; + let unused unqualified_static_data: i32 = static_data; } } @@ -333,7 +333,7 @@ import Cpp library "function_member_protected.h"; class Derived { extend base: Cpp.C; - fn F[self: Self]() { + fn F[unused self: Self]() { //@dump-sem-ir-begin static_fn(); Derived.static_fn(); @@ -1643,13 +1643,13 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: } // CHECK:STDOUT: %s.ref: %S = name_ref s, %s // CHECK:STDOUT: %instance_data.ref: %S.elem = name_ref instance_data, @S.%.1 [concrete = @S.%.1] -// CHECK:STDOUT: %.loc8_29.1: ref %i32 = class_element_access %s.ref, element0 -// CHECK:STDOUT: %.loc8_29.2: %i32 = acquire_value %.loc8_29.1 -// CHECK:STDOUT: %.loc8_22: type = splice_block %i32.loc8 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc8_36.1: ref %i32 = class_element_access %s.ref, element0 +// CHECK:STDOUT: %.loc8_36.2: %i32 = acquire_value %.loc8_36.1 +// CHECK:STDOUT: %.loc8_29: type = splice_block %i32.loc8 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %instance_data: %i32 = value_binding instance_data, %.loc8_29.2 +// CHECK:STDOUT: %instance_data: %i32 = value_binding instance_data, %.loc8_36.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %static_data.patt: %pattern_type.7ce = value_binding_pattern static_data [concrete] // CHECK:STDOUT: } @@ -1657,12 +1657,12 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %S.ref.loc9: type = name_ref S, imports.%S.decl [concrete = constants.%S] // CHECK:STDOUT: // CHECK:STDOUT: %static_data.ref: ref %i32 = name_ref static_data, imports.%static_data.var [concrete = imports.%static_data.var] -// CHECK:STDOUT: %.loc9_20: type = splice_block %i32.loc9 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc9_27: type = splice_block %i32.loc9 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc9_31: %i32 = acquire_value %static_data.ref -// CHECK:STDOUT: %static_data: %i32 = value_binding static_data, %.loc9_31 +// CHECK:STDOUT: %.loc9_38: %i32 = acquire_value %static_data.ref +// CHECK:STDOUT: %static_data: %i32 = value_binding static_data, %.loc9_38 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1690,27 +1690,27 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: } // CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d // CHECK:STDOUT: %instance_data.ref: %S.elem = name_ref instance_data, @S.%.1 [concrete = @S.%.1] -// CHECK:STDOUT: %.loc12_29.1: ref %S = class_element_access %d.ref, element0 -// CHECK:STDOUT: %.loc12_29.2: ref %S = converted %d.ref, %.loc12_29.1 -// CHECK:STDOUT: %.loc12_29.3: ref %i32 = class_element_access %.loc12_29.2, element0 -// CHECK:STDOUT: %.loc12_22: type = splice_block %i32.loc12 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc12_36.1: ref %S = class_element_access %d.ref, element0 +// CHECK:STDOUT: %.loc12_36.2: ref %S = converted %d.ref, %.loc12_36.1 +// CHECK:STDOUT: %.loc12_36.3: ref %i32 = class_element_access %.loc12_36.2, element0 +// CHECK:STDOUT: %.loc12_29: type = splice_block %i32.loc12 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc12_29.4: %i32 = acquire_value %.loc12_29.3 -// CHECK:STDOUT: %instance_data: %i32 = value_binding instance_data, %.loc12_29.4 +// CHECK:STDOUT: %.loc12_36.4: %i32 = acquire_value %.loc12_36.3 +// CHECK:STDOUT: %instance_data: %i32 = value_binding instance_data, %.loc12_36.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %static_data.patt: %pattern_type.7ce = value_binding_pattern static_data [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %Derived.ref.loc13: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived] // CHECK:STDOUT: // CHECK:STDOUT: %static_data.ref: ref %i32 = name_ref static_data, imports.%static_data.var [concrete = imports.%static_data.var] -// CHECK:STDOUT: %.loc13_20: type = splice_block %i32.loc13 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc13_27: type = splice_block %i32.loc13 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13_33: %i32 = acquire_value %static_data.ref -// CHECK:STDOUT: %static_data: %i32 = value_binding static_data, %.loc13_33 +// CHECK:STDOUT: %.loc13_40: %i32 = acquire_value %static_data.ref +// CHECK:STDOUT: %static_data: %i32 = value_binding static_data, %.loc13_40 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1757,49 +1757,49 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: } // CHECK:STDOUT: %self.ref: %Derived = name_ref self, %self // CHECK:STDOUT: %instance_data.ref: %C.elem = name_ref instance_data, @C.%.1 [concrete = @C.%.1] -// CHECK:STDOUT: %.loc10_34.1: ref %C = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc10_34.2: ref %C = converted %self.ref, %.loc10_34.1 -// CHECK:STDOUT: %.loc10_34.3: ref %i32 = class_element_access %.loc10_34.2, element0 -// CHECK:STDOUT: %.loc10_24: type = splice_block %i32.loc10 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc10_41.1: ref %C = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc10_41.2: ref %C = converted %self.ref, %.loc10_41.1 +// CHECK:STDOUT: %.loc10_41.3: ref %i32 = class_element_access %.loc10_41.2, element0 +// CHECK:STDOUT: %.loc10_31: type = splice_block %i32.loc10 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc10: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc10_34.4: %i32 = acquire_value %.loc10_34.3 -// CHECK:STDOUT: %instance_data: %i32 = value_binding instance_data, %.loc10_34.4 +// CHECK:STDOUT: %.loc10_41.4: %i32 = acquire_value %.loc10_41.3 +// CHECK:STDOUT: %instance_data: %i32 = value_binding instance_data, %.loc10_41.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %unqualified_static_data.patt: %pattern_type.7ce = value_binding_pattern unqualified_static_data [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: %static_data.ref.loc11: ref %i32 = name_ref static_data, imports.%static_data.var [concrete = imports.%static_data.var] -// CHECK:STDOUT: %.loc11_34: type = splice_block %i32.loc11 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc11_41: type = splice_block %i32.loc11 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11_40: %i32 = acquire_value %static_data.ref.loc11 -// CHECK:STDOUT: %unqualified_static_data: %i32 = value_binding unqualified_static_data, %.loc11_40 +// CHECK:STDOUT: %.loc11_47: %i32 = acquire_value %static_data.ref.loc11 +// CHECK:STDOUT: %unqualified_static_data: %i32 = value_binding unqualified_static_data, %.loc11_47 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %derived_static_data.patt: %pattern_type.7ce = value_binding_pattern derived_static_data [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived] // CHECK:STDOUT: %static_data.ref.loc12: ref %i32 = name_ref static_data, imports.%static_data.var [concrete = imports.%static_data.var] -// CHECK:STDOUT: %.loc12_30: type = splice_block %i32.loc12 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc12_37: type = splice_block %i32.loc12 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc12_43: %i32 = acquire_value %static_data.ref.loc12 -// CHECK:STDOUT: %derived_static_data: %i32 = value_binding derived_static_data, %.loc12_43 +// CHECK:STDOUT: %.loc12_50: %i32 = acquire_value %static_data.ref.loc12 +// CHECK:STDOUT: %derived_static_data: %i32 = value_binding derived_static_data, %.loc12_50 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %base_static_data.patt: %pattern_type.7ce = value_binding_pattern base_static_data [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %static_data.ref.loc13: ref %i32 = name_ref static_data, imports.%static_data.var [concrete = imports.%static_data.var] -// CHECK:STDOUT: %.loc13_27: type = splice_block %i32.loc13 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc13_34: type = splice_block %i32.loc13 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13_38: %i32 = acquire_value %static_data.ref.loc13 -// CHECK:STDOUT: %base_static_data: %i32 = value_binding base_static_data, %.loc13_38 +// CHECK:STDOUT: %.loc13_45: %i32 = acquire_value %static_data.ref.loc13 +// CHECK:STDOUT: %base_static_data: %i32 = value_binding base_static_data, %.loc13_45 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/class/class.carbon b/toolchain/check/testdata/interop/cpp/class/class.carbon index 8a401c6ff02a..433df167f8fe 100644 --- a/toolchain/check/testdata/interop/cpp/class/class.carbon +++ b/toolchain/check/testdata/interop/cpp/class/class.carbon @@ -35,15 +35,15 @@ library "[[@TEST_NAME]]"; import Cpp library "declaration.h"; fn MyF() { - // CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+8]]:12: error: binding pattern has incomplete type `Bar` in name binding declaration [IncompleteTypeInBindingDecl] - // CHECK:STDERR: var bar: Cpp.Bar; - // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+8]]:19: error: binding pattern has incomplete type `Bar` in name binding declaration [IncompleteTypeInBindingDecl] + // CHECK:STDERR: var unused bar: Cpp.Bar; + // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE-6]]:10: in file included here [InCppInclude] // CHECK:STDERR: ./declaration.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class Bar; // CHECK:STDERR: ^ // CHECK:STDERR: - var bar: Cpp.Bar; + var unused bar: Cpp.Bar; } // ============================================================================ @@ -125,7 +125,7 @@ import Cpp library "static_data_member.h"; fn MyF() { //@dump-sem-ir-begin - let bar: Cpp.Bar* = Cpp.Bar.foo; + let unused bar: Cpp.Bar* = Cpp.Bar.foo; //@dump-sem-ir-end } @@ -148,7 +148,7 @@ import Cpp library "data_member.h"; //@dump-sem-ir-begin fn MyF(bar : Cpp.Bar*) { - let foo_bar: Cpp.Bar* = bar->foo; + let unused foo_bar: Cpp.Bar* = bar->foo; } //@dump-sem-ir-end @@ -383,16 +383,16 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*); // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %bar.patt: %pattern_type = value_binding_pattern bar [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc8_23: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Bar.ref.loc8_26: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar] +// CHECK:STDOUT: %Cpp.ref.loc8_30: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Bar.ref.loc8_33: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar] // CHECK:STDOUT: %foo.ref: ref %ptr.f68 = name_ref foo, imports.%foo.var [concrete = imports.%foo.var] -// CHECK:STDOUT: %.loc8_19: type = splice_block %ptr [concrete = constants.%ptr.f68] { -// CHECK:STDOUT: %Cpp.ref.loc8_12: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Bar.ref.loc8_15: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar] -// CHECK:STDOUT: %ptr: type = ptr_type %Bar.ref.loc8_15 [concrete = constants.%ptr.f68] +// CHECK:STDOUT: %.loc8_26: type = splice_block %ptr [concrete = constants.%ptr.f68] { +// CHECK:STDOUT: %Cpp.ref.loc8_19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Bar.ref.loc8_22: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar] +// CHECK:STDOUT: %ptr: type = ptr_type %Bar.ref.loc8_22 [concrete = constants.%ptr.f68] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_30: %ptr.f68 = acquire_value %foo.ref -// CHECK:STDOUT: %bar: %ptr.f68 = value_binding bar, %.loc8_30 +// CHECK:STDOUT: %.loc8_37: %ptr.f68 = acquire_value %foo.ref +// CHECK:STDOUT: %bar: %ptr.f68 = value_binding bar, %.loc8_37 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -436,16 +436,16 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*); // CHECK:STDOUT: %foo_bar.patt: %pattern_type = value_binding_pattern foo_bar [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %bar.ref: %ptr.f68 = name_ref bar, %bar -// CHECK:STDOUT: %.loc8_30.1: ref %Bar = deref %bar.ref +// CHECK:STDOUT: %.loc8_37.1: ref %Bar = deref %bar.ref // CHECK:STDOUT: %foo.ref: %Bar.elem = name_ref foo, @Bar.%.1 [concrete = @Bar.%.1] -// CHECK:STDOUT: %.loc8_30.2: ref %ptr.f68 = class_element_access %.loc8_30.1, element0 -// CHECK:STDOUT: %.loc8_23: type = splice_block %ptr.loc8 [concrete = constants.%ptr.f68] { +// CHECK:STDOUT: %.loc8_37.2: ref %ptr.f68 = class_element_access %.loc8_37.1, element0 +// CHECK:STDOUT: %.loc8_30: type = splice_block %ptr.loc8 [concrete = constants.%ptr.f68] { // CHECK:STDOUT: %Cpp.ref.loc8: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Bar.ref.loc8: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar] // CHECK:STDOUT: %ptr.loc8: type = ptr_type %Bar.ref.loc8 [concrete = constants.%ptr.f68] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_30.3: %ptr.f68 = acquire_value %.loc8_30.2 -// CHECK:STDOUT: %foo_bar: %ptr.f68 = value_binding foo_bar, %.loc8_30.3 +// CHECK:STDOUT: %.loc8_37.3: %ptr.f68 = acquire_value %.loc8_37.2 +// CHECK:STDOUT: %foo_bar: %ptr.f68 = value_binding foo_bar, %.loc8_37.3 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/class/constructor.carbon b/toolchain/check/testdata/interop/cpp/class/constructor.carbon index d38f508ab2fe..369af4beaed2 100644 --- a/toolchain/check/testdata/interop/cpp/class/constructor.carbon +++ b/toolchain/check/testdata/interop/cpp/class/constructor.carbon @@ -29,7 +29,7 @@ import Cpp library "default.h"; fn F() { //@dump-sem-ir-begin - let c: Cpp.C = Cpp.C.C(); + let unused c: Cpp.C = Cpp.C.C(); //@dump-sem-ir-end } @@ -52,7 +52,7 @@ import Cpp library "non_default.h"; fn F() { //@dump-sem-ir-begin - let c: Cpp.C = Cpp.C.C(123, 456); + let unused c: Cpp.C = Cpp.C.C(123, 456); //@dump-sem-ir-end } @@ -76,8 +76,8 @@ import Cpp library "multiple.h"; fn F() { //@dump-sem-ir-begin - let c1: Cpp.C = Cpp.C.C(); - let c2: Cpp.C = Cpp.C.C(123, 456); + let unused c1: Cpp.C = Cpp.C.C(); + let unused c2: Cpp.C = Cpp.C.C(123, 456); //@dump-sem-ir-end } @@ -100,8 +100,8 @@ import Cpp library "default_arguments.h"; fn F() { //@dump-sem-ir-begin - let c1: Cpp.C = Cpp.C.C(8, 9); - let c2: Cpp.C = Cpp.C.C(8); + let unused c1: Cpp.C = Cpp.C.C(8, 9); + let unused c2: Cpp.C = Cpp.C.C(8); //@dump-sem-ir-end } @@ -126,8 +126,8 @@ import Cpp library "template.h"; fn F() { //@dump-sem-ir-begin var c1: Cpp.C = Cpp.C.C(123); - var c2: Cpp.C = Cpp.C.C(true); - var c3: Cpp.C = Cpp.C.C(&c1); + var unused c2: Cpp.C = Cpp.C.C(true); + var unused c3: Cpp.C = Cpp.C.C(&c1); //@dump-sem-ir-end } @@ -155,19 +155,19 @@ library "[[@TEST_NAME]]"; import Cpp library "deleted.h"; fn F() { - // CHECK:STDERR: fail_import_deleted.carbon:[[@LINE+8]]:26: error: call to deleted function 'C' [CppInteropParseError] - // CHECK:STDERR: 15 | let c: Cpp.C = Cpp.C.C(); - // CHECK:STDERR: | ^ + // CHECK:STDERR: fail_import_deleted.carbon:[[@LINE+8]]:33: error: call to deleted function 'C' [CppInteropParseError] + // CHECK:STDERR: 15 | let unused c: Cpp.C = Cpp.C.C(); + // CHECK:STDERR: | ^ // CHECK:STDERR: fail_import_deleted.carbon:[[@LINE-6]]:10: in file included here [InCppInclude] // CHECK:STDERR: ./deleted.h:4:3: note: candidate constructor has been explicitly deleted [CppInteropParseNote] // CHECK:STDERR: 4 | C() = delete; // CHECK:STDERR: | ^ // CHECK:STDERR: - let c: Cpp.C = Cpp.C.C(); + let unused c: Cpp.C = Cpp.C.C(); - // CHECK:STDERR: fail_import_deleted.carbon:[[@LINE+12]]:27: error: call to deleted function 'D' [CppInteropParseError] - // CHECK:STDERR: 29 | let d: Cpp.D = Cpp.D.D(0); - // CHECK:STDERR: | ^ + // CHECK:STDERR: fail_import_deleted.carbon:[[@LINE+12]]:34: error: call to deleted function 'D' [CppInteropParseError] + // CHECK:STDERR: 29 | let unused d: Cpp.D = Cpp.D.D(0); + // CHECK:STDERR: | ^ // CHECK:STDERR: fail_import_deleted.carbon:[[@LINE-16]]:10: in file included here [InCppInclude] // CHECK:STDERR: ./deleted.h:9:3: note: candidate constructor has been explicitly deleted [CppInteropParseNote] // CHECK:STDERR: 9 | D(int) = delete; @@ -177,7 +177,7 @@ fn F() { // CHECK:STDERR: 10 | D(short); // CHECK:STDERR: | ^ // CHECK:STDERR: - let d: Cpp.D = Cpp.D.D(0); + let unused d: Cpp.D = Cpp.D.D(0); } // ============================================================================ @@ -199,8 +199,8 @@ import Cpp library "implicit_single_argument.h"; fn F() { //@dump-sem-ir-begin - let c1: Cpp.C = Cpp.C.C(8); - let c2: Cpp.C = 8 as i32; + let unused c1: Cpp.C = Cpp.C.C(8); + let unused c2: Cpp.C = 8 as i32; //@dump-sem-ir-end } @@ -223,9 +223,9 @@ import Cpp library "implicit_multi_arguments.h"; fn F() { //@dump-sem-ir-begin - let c1: Cpp.C = Cpp.C.C(8, 9); - let c2: Cpp.C = Cpp.C.C(8); - let c3: Cpp.C = 8 as i32; + let unused c1: Cpp.C = Cpp.C.C(8, 9); + let unused c2: Cpp.C = Cpp.C.C(8); + let unused c3: Cpp.C = 8 as i32; //@dump-sem-ir-end } @@ -289,22 +289,22 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c.patt: %pattern_type.217 = value_binding_pattern c [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc8_18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, imports.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %C.ref.loc8_23: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] -// CHECK:STDOUT: %.loc8_26.1: ref %C = temporary_storage -// CHECK:STDOUT: %addr: %ptr.d9e = addr_of %.loc8_26.1 +// CHECK:STDOUT: %Cpp.ref.loc8_25: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc8_28: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc8_30: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] +// CHECK:STDOUT: %.loc8_33.1: ref %C = temporary_storage +// CHECK:STDOUT: %addr: %ptr.d9e = addr_of %.loc8_33.1 // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc8_26.2: init %C to %.loc8_26.1 = mark_in_place_init %C__carbon_thunk.call -// CHECK:STDOUT: %.loc8_13: type = splice_block %C.ref.loc8_13 [concrete = constants.%C] { -// CHECK:STDOUT: %Cpp.ref.loc8_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc8_13: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc8_33.2: init %C to %.loc8_33.1 = mark_in_place_init %C__carbon_thunk.call +// CHECK:STDOUT: %.loc8_20: type = splice_block %C.ref.loc8_20 [concrete = constants.%C] { +// CHECK:STDOUT: %Cpp.ref.loc8_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc8_20: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_26.3: ref %C = temporary %.loc8_26.1, %.loc8_26.2 -// CHECK:STDOUT: %.loc8_26.4: %C = acquire_value %.loc8_26.3 -// CHECK:STDOUT: %c: %C = value_binding c, %.loc8_26.4 -// CHECK:STDOUT: %C.cpp_destructor.bound: = bound_method %.loc8_26.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call %C.cpp_destructor.bound(%.loc8_26.3) +// CHECK:STDOUT: %.loc8_33.3: ref %C = temporary %.loc8_33.1, %.loc8_33.2 +// CHECK:STDOUT: %.loc8_33.4: %C = acquire_value %.loc8_33.3 +// CHECK:STDOUT: %c: %C = value_binding c, %.loc8_33.4 +// CHECK:STDOUT: %C.cpp_destructor.bound: = bound_method %.loc8_33.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call %C.cpp_destructor.bound(%.loc8_33.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -365,38 +365,38 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c.patt: %pattern_type.217 = value_binding_pattern c [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc8_18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, imports.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %C.ref.loc8_23: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] +// CHECK:STDOUT: %Cpp.ref.loc8_25: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc8_28: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc8_30: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] // CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete = constants.%int_123.fff] // CHECK:STDOUT: %int_456: Core.IntLiteral = int_value 456 [concrete = constants.%int_456.010] -// CHECK:STDOUT: %.loc8_34.1: ref %C = temporary_storage -// CHECK:STDOUT: %impl.elem0.loc8_26: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc8_26.1: = bound_method %int_123, %impl.elem0.loc8_26 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f5c] -// CHECK:STDOUT: %specific_fn.loc8_26: = specific_function %impl.elem0.loc8_26, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_26.2: = bound_method %int_123, %specific_fn.loc8_26 [concrete = constants.%bound_method.db6] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_26: init %i32 = call %bound_method.loc8_26.2(%int_123) [concrete = constants.%int_123.f7f] -// CHECK:STDOUT: %.loc8_26.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_26 [concrete = constants.%int_123.f7f] -// CHECK:STDOUT: %.loc8_26.2: %i32 = converted %int_123, %.loc8_26.1 [concrete = constants.%int_123.f7f] -// CHECK:STDOUT: %impl.elem0.loc8_31: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc8_31.1: = bound_method %int_456, %impl.elem0.loc8_31 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.266] -// CHECK:STDOUT: %specific_fn.loc8_31: = specific_function %impl.elem0.loc8_31, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_31.2: = bound_method %int_456, %specific_fn.loc8_31 [concrete = constants.%bound_method.f41] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_31: init %i32 = call %bound_method.loc8_31.2(%int_456) [concrete = constants.%int_456.d17] -// CHECK:STDOUT: %.loc8_31.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_31 [concrete = constants.%int_456.d17] -// CHECK:STDOUT: %.loc8_31.2: %i32 = converted %int_456, %.loc8_31.1 [concrete = constants.%int_456.d17] -// CHECK:STDOUT: %addr: %ptr.d9e = addr_of %.loc8_34.1 -// CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc8_26.2, %.loc8_31.2, %addr) -// CHECK:STDOUT: %.loc8_34.2: init %C to %.loc8_34.1 = mark_in_place_init %C__carbon_thunk.call -// CHECK:STDOUT: %.loc8_13: type = splice_block %C.ref.loc8_13 [concrete = constants.%C] { -// CHECK:STDOUT: %Cpp.ref.loc8_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc8_13: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc8_41.1: ref %C = temporary_storage +// CHECK:STDOUT: %impl.elem0.loc8_33: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc8_33.1: = bound_method %int_123, %impl.elem0.loc8_33 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f5c] +// CHECK:STDOUT: %specific_fn.loc8_33: = specific_function %impl.elem0.loc8_33, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_33.2: = bound_method %int_123, %specific_fn.loc8_33 [concrete = constants.%bound_method.db6] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_33: init %i32 = call %bound_method.loc8_33.2(%int_123) [concrete = constants.%int_123.f7f] +// CHECK:STDOUT: %.loc8_33.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_33 [concrete = constants.%int_123.f7f] +// CHECK:STDOUT: %.loc8_33.2: %i32 = converted %int_123, %.loc8_33.1 [concrete = constants.%int_123.f7f] +// CHECK:STDOUT: %impl.elem0.loc8_38: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc8_38.1: = bound_method %int_456, %impl.elem0.loc8_38 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.266] +// CHECK:STDOUT: %specific_fn.loc8_38: = specific_function %impl.elem0.loc8_38, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_38.2: = bound_method %int_456, %specific_fn.loc8_38 [concrete = constants.%bound_method.f41] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_38: init %i32 = call %bound_method.loc8_38.2(%int_456) [concrete = constants.%int_456.d17] +// CHECK:STDOUT: %.loc8_38.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_38 [concrete = constants.%int_456.d17] +// CHECK:STDOUT: %.loc8_38.2: %i32 = converted %int_456, %.loc8_38.1 [concrete = constants.%int_456.d17] +// CHECK:STDOUT: %addr: %ptr.d9e = addr_of %.loc8_41.1 +// CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc8_33.2, %.loc8_38.2, %addr) +// CHECK:STDOUT: %.loc8_41.2: init %C to %.loc8_41.1 = mark_in_place_init %C__carbon_thunk.call +// CHECK:STDOUT: %.loc8_20: type = splice_block %C.ref.loc8_20 [concrete = constants.%C] { +// CHECK:STDOUT: %Cpp.ref.loc8_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc8_20: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_34.3: ref %C = temporary %.loc8_34.1, %.loc8_34.2 -// CHECK:STDOUT: %.loc8_34.4: %C = acquire_value %.loc8_34.3 -// CHECK:STDOUT: %c: %C = value_binding c, %.loc8_34.4 -// CHECK:STDOUT: %C.cpp_destructor.bound: = bound_method %.loc8_34.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call %C.cpp_destructor.bound(%.loc8_34.3) +// CHECK:STDOUT: %.loc8_41.3: ref %C = temporary %.loc8_41.1, %.loc8_41.2 +// CHECK:STDOUT: %.loc8_41.4: %C = acquire_value %.loc8_41.3 +// CHECK:STDOUT: %c: %C = value_binding c, %.loc8_41.4 +// CHECK:STDOUT: %C.cpp_destructor.bound: = bound_method %.loc8_41.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call %C.cpp_destructor.bound(%.loc8_41.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -464,57 +464,57 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c1.patt: %pattern_type.217 = value_binding_pattern c1 [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc8_19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %C.ref.loc8_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] -// CHECK:STDOUT: %.loc8_27.1: ref %C = temporary_storage -// CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_27.1 +// CHECK:STDOUT: %Cpp.ref.loc8_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc8_29: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc8_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] +// CHECK:STDOUT: %.loc8_34.1: ref %C = temporary_storage +// CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_34.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%addr.loc8) -// CHECK:STDOUT: %.loc8_27.2: init %C to %.loc8_27.1 = mark_in_place_init %C__carbon_thunk.call.loc8 -// CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] { -// CHECK:STDOUT: %Cpp.ref.loc8_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc8_34.2: init %C to %.loc8_34.1 = mark_in_place_init %C__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_21: type = splice_block %C.ref.loc8_21 [concrete = constants.%C] { +// CHECK:STDOUT: %Cpp.ref.loc8_18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_27.3: ref %C = temporary %.loc8_27.1, %.loc8_27.2 -// CHECK:STDOUT: %.loc8_27.4: %C = acquire_value %.loc8_27.3 -// CHECK:STDOUT: %c1: %C = value_binding c1, %.loc8_27.4 +// CHECK:STDOUT: %.loc8_34.3: ref %C = temporary %.loc8_34.1, %.loc8_34.2 +// CHECK:STDOUT: %.loc8_34.4: %C = acquire_value %.loc8_34.3 +// CHECK:STDOUT: %c1: %C = value_binding c1, %.loc8_34.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c2.patt: %pattern_type.217 = value_binding_pattern c2 [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc9_19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc9_22: type = name_ref C, imports.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %C.ref.loc9_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] +// CHECK:STDOUT: %Cpp.ref.loc9_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc9_29: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc9_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] // CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete = constants.%int_123.fff] // CHECK:STDOUT: %int_456: Core.IntLiteral = int_value 456 [concrete = constants.%int_456.010] -// CHECK:STDOUT: %.loc9_35.1: ref %C = temporary_storage -// CHECK:STDOUT: %impl.elem0.loc9_27: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc9_27.1: = bound_method %int_123, %impl.elem0.loc9_27 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f5c] -// CHECK:STDOUT: %specific_fn.loc9_27: = specific_function %impl.elem0.loc9_27, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_27.2: = bound_method %int_123, %specific_fn.loc9_27 [concrete = constants.%bound_method.db6] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_27: init %i32 = call %bound_method.loc9_27.2(%int_123) [concrete = constants.%int_123.f7f] -// CHECK:STDOUT: %.loc9_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_27 [concrete = constants.%int_123.f7f] -// CHECK:STDOUT: %.loc9_27.2: %i32 = converted %int_123, %.loc9_27.1 [concrete = constants.%int_123.f7f] -// CHECK:STDOUT: %impl.elem0.loc9_32: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc9_32.1: = bound_method %int_456, %impl.elem0.loc9_32 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.266] -// CHECK:STDOUT: %specific_fn.loc9_32: = specific_function %impl.elem0.loc9_32, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_32.2: = bound_method %int_456, %specific_fn.loc9_32 [concrete = constants.%bound_method.f41] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_32: init %i32 = call %bound_method.loc9_32.2(%int_456) [concrete = constants.%int_456.d17] -// CHECK:STDOUT: %.loc9_32.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_32 [concrete = constants.%int_456.d17] -// CHECK:STDOUT: %.loc9_32.2: %i32 = converted %int_456, %.loc9_32.1 [concrete = constants.%int_456.d17] -// CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_35.1 -// CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc9_27.2, %.loc9_32.2, %addr.loc9) -// CHECK:STDOUT: %.loc9_35.2: init %C to %.loc9_35.1 = mark_in_place_init %C__carbon_thunk.call.loc9 -// CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] { -// CHECK:STDOUT: %Cpp.ref.loc9_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc9_42.1: ref %C = temporary_storage +// CHECK:STDOUT: %impl.elem0.loc9_34: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc9_34.1: = bound_method %int_123, %impl.elem0.loc9_34 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f5c] +// CHECK:STDOUT: %specific_fn.loc9_34: = specific_function %impl.elem0.loc9_34, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_34.2: = bound_method %int_123, %specific_fn.loc9_34 [concrete = constants.%bound_method.db6] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_34: init %i32 = call %bound_method.loc9_34.2(%int_123) [concrete = constants.%int_123.f7f] +// CHECK:STDOUT: %.loc9_34.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_34 [concrete = constants.%int_123.f7f] +// CHECK:STDOUT: %.loc9_34.2: %i32 = converted %int_123, %.loc9_34.1 [concrete = constants.%int_123.f7f] +// CHECK:STDOUT: %impl.elem0.loc9_39: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc9_39.1: = bound_method %int_456, %impl.elem0.loc9_39 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.266] +// CHECK:STDOUT: %specific_fn.loc9_39: = specific_function %impl.elem0.loc9_39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_39.2: = bound_method %int_456, %specific_fn.loc9_39 [concrete = constants.%bound_method.f41] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_39: init %i32 = call %bound_method.loc9_39.2(%int_456) [concrete = constants.%int_456.d17] +// CHECK:STDOUT: %.loc9_39.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_39 [concrete = constants.%int_456.d17] +// CHECK:STDOUT: %.loc9_39.2: %i32 = converted %int_456, %.loc9_39.1 [concrete = constants.%int_456.d17] +// CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_42.1 +// CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc9_34.2, %.loc9_39.2, %addr.loc9) +// CHECK:STDOUT: %.loc9_42.2: init %C to %.loc9_42.1 = mark_in_place_init %C__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_21: type = splice_block %C.ref.loc9_21 [concrete = constants.%C] { +// CHECK:STDOUT: %Cpp.ref.loc9_18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc9_21: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc9_35.3: ref %C = temporary %.loc9_35.1, %.loc9_35.2 -// CHECK:STDOUT: %.loc9_35.4: %C = acquire_value %.loc9_35.3 -// CHECK:STDOUT: %c2: %C = value_binding c2, %.loc9_35.4 -// CHECK:STDOUT: %C.cpp_destructor.bound.loc9: = bound_method %.loc9_35.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_35.3) -// CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %.loc8_27.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_27.3) +// CHECK:STDOUT: %.loc9_42.3: ref %C = temporary %.loc9_42.1, %.loc9_42.2 +// CHECK:STDOUT: %.loc9_42.4: %C = acquire_value %.loc9_42.3 +// CHECK:STDOUT: %c2: %C = value_binding c2, %.loc9_42.4 +// CHECK:STDOUT: %C.cpp_destructor.bound.loc9: = bound_method %.loc9_42.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_42.3) +// CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %.loc8_34.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_34.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -582,65 +582,65 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c1.patt: %pattern_type.217 = value_binding_pattern c1 [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc8_19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %C.ref.loc8_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] +// CHECK:STDOUT: %Cpp.ref.loc8_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc8_29: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc8_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] // CHECK:STDOUT: %int_8.loc8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85] // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete = constants.%int_9.988] -// CHECK:STDOUT: %.loc8_31.1: ref %C = temporary_storage -// CHECK:STDOUT: %impl.elem0.loc8_27: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc8_27.1: = bound_method %int_8.loc8, %impl.elem0.loc8_27 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.62f] -// CHECK:STDOUT: %specific_fn.loc8_27: = specific_function %impl.elem0.loc8_27, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_27.2: = bound_method %int_8.loc8, %specific_fn.loc8_27 [concrete = constants.%bound_method.e07] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_27: init %i32 = call %bound_method.loc8_27.2(%int_8.loc8) [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_27 [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_8.loc8, %.loc8_27.1 [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %impl.elem0.loc8_30: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc8_30.1: = bound_method %int_9, %impl.elem0.loc8_30 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.87d] -// CHECK:STDOUT: %specific_fn.loc8_30: = specific_function %impl.elem0.loc8_30, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_30.2: = bound_method %int_9, %specific_fn.loc8_30 [concrete = constants.%bound_method.661] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_30: init %i32 = call %bound_method.loc8_30.2(%int_9) [concrete = constants.%int_9.f88] -// CHECK:STDOUT: %.loc8_30.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_30 [concrete = constants.%int_9.f88] -// CHECK:STDOUT: %.loc8_30.2: %i32 = converted %int_9, %.loc8_30.1 [concrete = constants.%int_9.f88] -// CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_31.1 -// CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%.loc8_27.2, %.loc8_30.2, %addr.loc8) -// CHECK:STDOUT: %.loc8_31.2: init %C to %.loc8_31.1 = mark_in_place_init %C__carbon_thunk.call.loc8 -// CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] { -// CHECK:STDOUT: %Cpp.ref.loc8_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc8_38.1: ref %C = temporary_storage +// CHECK:STDOUT: %impl.elem0.loc8_34: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc8_34.1: = bound_method %int_8.loc8, %impl.elem0.loc8_34 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.62f] +// CHECK:STDOUT: %specific_fn.loc8_34: = specific_function %impl.elem0.loc8_34, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_34.2: = bound_method %int_8.loc8, %specific_fn.loc8_34 [concrete = constants.%bound_method.e07] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_34: init %i32 = call %bound_method.loc8_34.2(%int_8.loc8) [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %.loc8_34.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_34 [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %.loc8_34.2: %i32 = converted %int_8.loc8, %.loc8_34.1 [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %impl.elem0.loc8_37: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc8_37.1: = bound_method %int_9, %impl.elem0.loc8_37 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.87d] +// CHECK:STDOUT: %specific_fn.loc8_37: = specific_function %impl.elem0.loc8_37, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_37.2: = bound_method %int_9, %specific_fn.loc8_37 [concrete = constants.%bound_method.661] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_37: init %i32 = call %bound_method.loc8_37.2(%int_9) [concrete = constants.%int_9.f88] +// CHECK:STDOUT: %.loc8_37.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_37 [concrete = constants.%int_9.f88] +// CHECK:STDOUT: %.loc8_37.2: %i32 = converted %int_9, %.loc8_37.1 [concrete = constants.%int_9.f88] +// CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_38.1 +// CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%.loc8_34.2, %.loc8_37.2, %addr.loc8) +// CHECK:STDOUT: %.loc8_38.2: init %C to %.loc8_38.1 = mark_in_place_init %C__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_21: type = splice_block %C.ref.loc8_21 [concrete = constants.%C] { +// CHECK:STDOUT: %Cpp.ref.loc8_18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_31.3: ref %C = temporary %.loc8_31.1, %.loc8_31.2 -// CHECK:STDOUT: %.loc8_31.4: %C = acquire_value %.loc8_31.3 -// CHECK:STDOUT: %c1: %C = value_binding c1, %.loc8_31.4 +// CHECK:STDOUT: %.loc8_38.3: ref %C = temporary %.loc8_38.1, %.loc8_38.2 +// CHECK:STDOUT: %.loc8_38.4: %C = acquire_value %.loc8_38.3 +// CHECK:STDOUT: %c1: %C = value_binding c1, %.loc8_38.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c2.patt: %pattern_type.217 = value_binding_pattern c2 [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc9_19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc9_22: type = name_ref C, imports.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %C.ref.loc9_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] +// CHECK:STDOUT: %Cpp.ref.loc9_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc9_29: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc9_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] // CHECK:STDOUT: %int_8.loc9: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85] -// CHECK:STDOUT: %.loc9_28.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc9_35.1: ref %C = temporary_storage // CHECK:STDOUT: %impl.elem0.loc9: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc9_27.1: = bound_method %int_8.loc9, %impl.elem0.loc9 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.62f] +// CHECK:STDOUT: %bound_method.loc9_34.1: = bound_method %int_8.loc9, %impl.elem0.loc9 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.62f] // CHECK:STDOUT: %specific_fn.loc9: = specific_function %impl.elem0.loc9, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_27.2: = bound_method %int_8.loc9, %specific_fn.loc9 [concrete = constants.%bound_method.e07] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9: init %i32 = call %bound_method.loc9_27.2(%int_8.loc9) [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %.loc9_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %.loc9_27.2: %i32 = converted %int_8.loc9, %.loc9_27.1 [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_28.1 -// CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc9_27.2, %addr.loc9) -// CHECK:STDOUT: %.loc9_28.2: init %C to %.loc9_28.1 = mark_in_place_init %C__carbon_thunk.call.loc9 -// CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] { -// CHECK:STDOUT: %Cpp.ref.loc9_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %bound_method.loc9_34.2: = bound_method %int_8.loc9, %specific_fn.loc9 [concrete = constants.%bound_method.e07] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9: init %i32 = call %bound_method.loc9_34.2(%int_8.loc9) [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %.loc9_34.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %.loc9_34.2: %i32 = converted %int_8.loc9, %.loc9_34.1 [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_35.1 +// CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc9_34.2, %addr.loc9) +// CHECK:STDOUT: %.loc9_35.2: init %C to %.loc9_35.1 = mark_in_place_init %C__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_21: type = splice_block %C.ref.loc9_21 [concrete = constants.%C] { +// CHECK:STDOUT: %Cpp.ref.loc9_18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc9_21: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc9_28.3: ref %C = temporary %.loc9_28.1, %.loc9_28.2 -// CHECK:STDOUT: %.loc9_28.4: %C = acquire_value %.loc9_28.3 -// CHECK:STDOUT: %c2: %C = value_binding c2, %.loc9_28.4 -// CHECK:STDOUT: %C.cpp_destructor.bound.loc9: = bound_method %.loc9_28.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_28.3) -// CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %.loc8_31.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_31.3) +// CHECK:STDOUT: %.loc9_35.3: ref %C = temporary %.loc9_35.1, %.loc9_35.2 +// CHECK:STDOUT: %.loc9_35.4: %C = acquire_value %.loc9_35.3 +// CHECK:STDOUT: %c2: %C = value_binding c2, %.loc9_35.4 +// CHECK:STDOUT: %C.cpp_destructor.bound.loc9: = bound_method %.loc9_35.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_35.3) +// CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %.loc8_38.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_38.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -753,24 +753,24 @@ fn F() { // CHECK:STDOUT: %c2.var_patt: %pattern_type.217 = var_pattern %c2.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c2.var: ref %C = var %c2.var_patt -// CHECK:STDOUT: %Cpp.ref.loc9_19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc9_22: type = name_ref C, imports.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %C.ref.loc9_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] +// CHECK:STDOUT: %Cpp.ref.loc9_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc9_29: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc9_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true] // CHECK:STDOUT: %.loc9_3: ref %C = splice_block %c2.var {} -// CHECK:STDOUT: %.loc9_27.1: ref bool = temporary_storage +// CHECK:STDOUT: %.loc9_34.1: ref bool = temporary_storage // CHECK:STDOUT: %impl.elem0.loc9: %.86d = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op] // CHECK:STDOUT: %bound_method.loc9: = bound_method %true, %impl.elem0.loc9 [concrete = constants.%bool.as.Copy.impl.Op.bound] // CHECK:STDOUT: %bool.as.Copy.impl.Op.call: init bool = call %bound_method.loc9(%true) [concrete = constants.%true] -// CHECK:STDOUT: %.loc9_27.2: ref bool = temporary %.loc9_27.1, %bool.as.Copy.impl.Op.call -// CHECK:STDOUT: %addr.loc9_31.1: %ptr.bb2 = addr_of %.loc9_27.2 -// CHECK:STDOUT: %addr.loc9_31.2: %ptr.d9e = addr_of %.loc9_3 -// CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%addr.loc9_31.1, %addr.loc9_31.2) -// CHECK:STDOUT: %.loc9_31: init %C to %.loc9_3 = mark_in_place_init %C__carbon_thunk.call.loc9 -// CHECK:STDOUT: assign %c2.var, %.loc9_31 -// CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] { -// CHECK:STDOUT: %Cpp.ref.loc9_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc9_34.2: ref bool = temporary %.loc9_34.1, %bool.as.Copy.impl.Op.call +// CHECK:STDOUT: %addr.loc9_38.1: %ptr.bb2 = addr_of %.loc9_34.2 +// CHECK:STDOUT: %addr.loc9_38.2: %ptr.d9e = addr_of %.loc9_3 +// CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%addr.loc9_38.1, %addr.loc9_38.2) +// CHECK:STDOUT: %.loc9_38: init %C to %.loc9_3 = mark_in_place_init %C__carbon_thunk.call.loc9 +// CHECK:STDOUT: assign %c2.var, %.loc9_38 +// CHECK:STDOUT: %.loc9_21: type = splice_block %C.ref.loc9_21 [concrete = constants.%C] { +// CHECK:STDOUT: %Cpp.ref.loc9_18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc9_21: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: %c2: ref %C = ref_binding c2, %c2.var // CHECK:STDOUT: name_binding_decl { @@ -778,25 +778,25 @@ fn F() { // CHECK:STDOUT: %c3.var_patt: %pattern_type.217 = var_pattern %c3.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c3.var: ref %C = var %c3.var_patt -// CHECK:STDOUT: %Cpp.ref.loc10_19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc10_22: type = name_ref C, imports.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %C.ref.loc10_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] +// CHECK:STDOUT: %Cpp.ref.loc10_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc10_29: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc10_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] // CHECK:STDOUT: %c1.ref: ref %C = name_ref c1, %c1 -// CHECK:STDOUT: %addr.loc10_27: %ptr.d9e = addr_of %c1.ref +// CHECK:STDOUT: %addr.loc10_34: %ptr.d9e = addr_of %c1.ref // CHECK:STDOUT: %.loc10_3: ref %C = splice_block %c3.var {} -// CHECK:STDOUT: %addr.loc10_30: %ptr.d9e = addr_of %.loc10_3 -// CHECK:STDOUT: %C__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.3(%addr.loc10_27, %addr.loc10_30) -// CHECK:STDOUT: %.loc10_30: init %C to %.loc10_3 = mark_in_place_init %C__carbon_thunk.call.loc10 -// CHECK:STDOUT: assign %c3.var, %.loc10_30 -// CHECK:STDOUT: %.loc10_14: type = splice_block %C.ref.loc10_14 [concrete = constants.%C] { -// CHECK:STDOUT: %Cpp.ref.loc10_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc10_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %addr.loc10_37: %ptr.d9e = addr_of %.loc10_3 +// CHECK:STDOUT: %C__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.3(%addr.loc10_34, %addr.loc10_37) +// CHECK:STDOUT: %.loc10_37: init %C to %.loc10_3 = mark_in_place_init %C__carbon_thunk.call.loc10 +// CHECK:STDOUT: assign %c3.var, %.loc10_37 +// CHECK:STDOUT: %.loc10_21: type = splice_block %C.ref.loc10_21 [concrete = constants.%C] { +// CHECK:STDOUT: %Cpp.ref.loc10_18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc10_21: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: %c3: ref %C = ref_binding c3, %c3.var // CHECK:STDOUT: %C.cpp_destructor.bound.loc10: = bound_method %c3.var, constants.%C.cpp_destructor // CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%c3.var) -// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc9_27.2, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc9_27.2) +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc9_34.2, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc9_34.2) // CHECK:STDOUT: %C.cpp_destructor.bound.loc9: = bound_method %c2.var, constants.%C.cpp_destructor // CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%c2.var) // CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %c1.var, constants.%C.cpp_destructor @@ -873,28 +873,28 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c1.patt: %pattern_type.217 = value_binding_pattern c1 [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc8_19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %C.ref.loc8_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] +// CHECK:STDOUT: %Cpp.ref.loc8_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc8_29: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc8_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] // CHECK:STDOUT: %int_8.loc8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85] -// CHECK:STDOUT: %.loc8_28.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc8_35.1: ref %C = temporary_storage // CHECK:STDOUT: %impl.elem0.loc8: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc8_27.1: = bound_method %int_8.loc8, %impl.elem0.loc8 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %bound_method.loc8_34.1: = bound_method %int_8.loc8, %impl.elem0.loc8 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] // CHECK:STDOUT: %specific_fn.loc8: = specific_function %impl.elem0.loc8, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_27.2: = bound_method %int_8.loc8, %specific_fn.loc8 [concrete = constants.%bound_method.e07] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc8_27.2(%int_8.loc8) [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_8.loc8, %.loc8_27.1 [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_28.1 -// CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc8_27.2, %addr.loc8) -// CHECK:STDOUT: %.loc8_28.2: init %C to %.loc8_28.1 = mark_in_place_init %C__carbon_thunk.call.loc8 -// CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] { -// CHECK:STDOUT: %Cpp.ref.loc8_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %bound_method.loc8_34.2: = bound_method %int_8.loc8, %specific_fn.loc8 [concrete = constants.%bound_method.e07] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc8_34.2(%int_8.loc8) [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %.loc8_34.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %.loc8_34.2: %i32 = converted %int_8.loc8, %.loc8_34.1 [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_35.1 +// CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc8_34.2, %addr.loc8) +// CHECK:STDOUT: %.loc8_35.2: init %C to %.loc8_35.1 = mark_in_place_init %C__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_21: type = splice_block %C.ref.loc8_21 [concrete = constants.%C] { +// CHECK:STDOUT: %Cpp.ref.loc8_18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_28.3: ref %C = temporary %.loc8_28.1, %.loc8_28.2 -// CHECK:STDOUT: %.loc8_28.4: %C = acquire_value %.loc8_28.3 -// CHECK:STDOUT: %c1: %C = value_binding c1, %.loc8_28.4 +// CHECK:STDOUT: %.loc8_35.3: ref %C = temporary %.loc8_35.1, %.loc8_35.2 +// CHECK:STDOUT: %.loc8_35.4: %C = acquire_value %.loc8_35.3 +// CHECK:STDOUT: %c1: %C = value_binding c1, %.loc8_35.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c2.patt: %pattern_type.217 = value_binding_pattern c2 [concrete] // CHECK:STDOUT: } @@ -902,28 +902,28 @@ fn F() { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc9: %.9ed = impl_witness_access constants.%As.impl_witness.ab6, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.29b] -// CHECK:STDOUT: %bound_method.loc9_21.1: = bound_method %int_8.loc9, %impl.elem0.loc9 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %bound_method.loc9_28.1: = bound_method %int_8.loc9, %impl.elem0.loc9 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] // CHECK:STDOUT: %specific_fn.loc9: = specific_function %impl.elem0.loc9, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_21.2: = bound_method %int_8.loc9, %specific_fn.loc9 [concrete = constants.%bound_method.530] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc9_21.2(%int_8.loc9) [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %.loc9_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %.loc9_21.2: %i32 = converted %int_8.loc9, %.loc9_21.1 [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9 [concrete = constants.%C] { +// CHECK:STDOUT: %bound_method.loc9_28.2: = bound_method %int_8.loc9, %specific_fn.loc9 [concrete = constants.%bound_method.530] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc9_28.2(%int_8.loc9) [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %.loc9_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %.loc9_28.2: %i32 = converted %int_8.loc9, %.loc9_28.1 [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %.loc9_21: type = splice_block %C.ref.loc9 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc9: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc9_21.3: ref %C = temporary_storage -// CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_21.3 -// CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc9_21.2, %addr.loc9) -// CHECK:STDOUT: %.loc9_21.4: init %C to %.loc9_21.3 = mark_in_place_init %C__carbon_thunk.call.loc9 -// CHECK:STDOUT: %.loc9_21.5: init %C = converted %.loc9_21.2, %.loc9_21.4 -// CHECK:STDOUT: %.loc9_21.6: ref %C = temporary %.loc9_21.3, %.loc9_21.5 -// CHECK:STDOUT: %.loc9_21.7: %C = acquire_value %.loc9_21.6 -// CHECK:STDOUT: %c2: %C = value_binding c2, %.loc9_21.7 -// CHECK:STDOUT: %C.cpp_destructor.bound.loc9: = bound_method %.loc9_21.6, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_21.6) -// CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %.loc8_28.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_28.3) +// CHECK:STDOUT: %.loc9_28.3: ref %C = temporary_storage +// CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_28.3 +// CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc9_28.2, %addr.loc9) +// CHECK:STDOUT: %.loc9_28.4: init %C to %.loc9_28.3 = mark_in_place_init %C__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_28.5: init %C = converted %.loc9_28.2, %.loc9_28.4 +// CHECK:STDOUT: %.loc9_28.6: ref %C = temporary %.loc9_28.3, %.loc9_28.5 +// CHECK:STDOUT: %.loc9_28.7: %C = acquire_value %.loc9_28.6 +// CHECK:STDOUT: %c2: %C = value_binding c2, %.loc9_28.7 +// CHECK:STDOUT: %C.cpp_destructor.bound.loc9: = bound_method %.loc9_28.6, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_28.6) +// CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %.loc8_35.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_35.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1005,61 +1005,61 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c1.patt: %pattern_type.217 = value_binding_pattern c1 [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc8_19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %C.ref.loc8_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] +// CHECK:STDOUT: %Cpp.ref.loc8_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc8_29: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc8_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] // CHECK:STDOUT: %int_8.loc8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85] // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete = constants.%int_9.988] -// CHECK:STDOUT: %.loc8_31.1: ref %C = temporary_storage -// CHECK:STDOUT: %impl.elem0.loc8_27: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc8_27.1: = bound_method %int_8.loc8, %impl.elem0.loc8_27 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.62f] -// CHECK:STDOUT: %specific_fn.loc8_27: = specific_function %impl.elem0.loc8_27, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_27.2: = bound_method %int_8.loc8, %specific_fn.loc8_27 [concrete = constants.%bound_method.e07] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_27: init %i32 = call %bound_method.loc8_27.2(%int_8.loc8) [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_27 [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_8.loc8, %.loc8_27.1 [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %impl.elem0.loc8_30: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc8_30.1: = bound_method %int_9, %impl.elem0.loc8_30 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.87d] -// CHECK:STDOUT: %specific_fn.loc8_30: = specific_function %impl.elem0.loc8_30, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc8_30.2: = bound_method %int_9, %specific_fn.loc8_30 [concrete = constants.%bound_method.661] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_30: init %i32 = call %bound_method.loc8_30.2(%int_9) [concrete = constants.%int_9.f88] -// CHECK:STDOUT: %.loc8_30.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_30 [concrete = constants.%int_9.f88] -// CHECK:STDOUT: %.loc8_30.2: %i32 = converted %int_9, %.loc8_30.1 [concrete = constants.%int_9.f88] -// CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_31.1 -// CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%.loc8_27.2, %.loc8_30.2, %addr.loc8) -// CHECK:STDOUT: %.loc8_31.2: init %C to %.loc8_31.1 = mark_in_place_init %C__carbon_thunk.call.loc8 -// CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] { -// CHECK:STDOUT: %Cpp.ref.loc8_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc8_38.1: ref %C = temporary_storage +// CHECK:STDOUT: %impl.elem0.loc8_34: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc8_34.1: = bound_method %int_8.loc8, %impl.elem0.loc8_34 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.62f] +// CHECK:STDOUT: %specific_fn.loc8_34: = specific_function %impl.elem0.loc8_34, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_34.2: = bound_method %int_8.loc8, %specific_fn.loc8_34 [concrete = constants.%bound_method.e07] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_34: init %i32 = call %bound_method.loc8_34.2(%int_8.loc8) [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %.loc8_34.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_34 [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %.loc8_34.2: %i32 = converted %int_8.loc8, %.loc8_34.1 [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %impl.elem0.loc8_37: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc8_37.1: = bound_method %int_9, %impl.elem0.loc8_37 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.87d] +// CHECK:STDOUT: %specific_fn.loc8_37: = specific_function %impl.elem0.loc8_37, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_37.2: = bound_method %int_9, %specific_fn.loc8_37 [concrete = constants.%bound_method.661] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_37: init %i32 = call %bound_method.loc8_37.2(%int_9) [concrete = constants.%int_9.f88] +// CHECK:STDOUT: %.loc8_37.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_37 [concrete = constants.%int_9.f88] +// CHECK:STDOUT: %.loc8_37.2: %i32 = converted %int_9, %.loc8_37.1 [concrete = constants.%int_9.f88] +// CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_38.1 +// CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%.loc8_34.2, %.loc8_37.2, %addr.loc8) +// CHECK:STDOUT: %.loc8_38.2: init %C to %.loc8_38.1 = mark_in_place_init %C__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_21: type = splice_block %C.ref.loc8_21 [concrete = constants.%C] { +// CHECK:STDOUT: %Cpp.ref.loc8_18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_31.3: ref %C = temporary %.loc8_31.1, %.loc8_31.2 -// CHECK:STDOUT: %.loc8_31.4: %C = acquire_value %.loc8_31.3 -// CHECK:STDOUT: %c1: %C = value_binding c1, %.loc8_31.4 +// CHECK:STDOUT: %.loc8_38.3: ref %C = temporary %.loc8_38.1, %.loc8_38.2 +// CHECK:STDOUT: %.loc8_38.4: %C = acquire_value %.loc8_38.3 +// CHECK:STDOUT: %c1: %C = value_binding c1, %.loc8_38.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c2.patt: %pattern_type.217 = value_binding_pattern c2 [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc9_19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc9_22: type = name_ref C, imports.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %C.ref.loc9_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] +// CHECK:STDOUT: %Cpp.ref.loc9_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc9_29: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc9_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value] // CHECK:STDOUT: %int_8.loc9: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85] -// CHECK:STDOUT: %.loc9_28.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc9_35.1: ref %C = temporary_storage // CHECK:STDOUT: %impl.elem0.loc9: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc9_27.1: = bound_method %int_8.loc9, %impl.elem0.loc9 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.62f] +// CHECK:STDOUT: %bound_method.loc9_34.1: = bound_method %int_8.loc9, %impl.elem0.loc9 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.62f] // CHECK:STDOUT: %specific_fn.loc9: = specific_function %impl.elem0.loc9, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_27.2: = bound_method %int_8.loc9, %specific_fn.loc9 [concrete = constants.%bound_method.e07] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9: init %i32 = call %bound_method.loc9_27.2(%int_8.loc9) [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %.loc9_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %.loc9_27.2: %i32 = converted %int_8.loc9, %.loc9_27.1 [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_28.1 -// CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc9_27.2, %addr.loc9) -// CHECK:STDOUT: %.loc9_28.2: init %C to %.loc9_28.1 = mark_in_place_init %C__carbon_thunk.call.loc9 -// CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] { -// CHECK:STDOUT: %Cpp.ref.loc9_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %bound_method.loc9_34.2: = bound_method %int_8.loc9, %specific_fn.loc9 [concrete = constants.%bound_method.e07] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9: init %i32 = call %bound_method.loc9_34.2(%int_8.loc9) [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %.loc9_34.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %.loc9_34.2: %i32 = converted %int_8.loc9, %.loc9_34.1 [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_35.1 +// CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc9_34.2, %addr.loc9) +// CHECK:STDOUT: %.loc9_35.2: init %C to %.loc9_35.1 = mark_in_place_init %C__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_21: type = splice_block %C.ref.loc9_21 [concrete = constants.%C] { +// CHECK:STDOUT: %Cpp.ref.loc9_18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %C.ref.loc9_21: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc9_28.3: ref %C = temporary %.loc9_28.1, %.loc9_28.2 -// CHECK:STDOUT: %.loc9_28.4: %C = acquire_value %.loc9_28.3 -// CHECK:STDOUT: %c2: %C = value_binding c2, %.loc9_28.4 +// CHECK:STDOUT: %.loc9_35.3: ref %C = temporary %.loc9_35.1, %.loc9_35.2 +// CHECK:STDOUT: %.loc9_35.4: %C = acquire_value %.loc9_35.3 +// CHECK:STDOUT: %c2: %C = value_binding c2, %.loc9_35.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c3.patt: %pattern_type.217 = value_binding_pattern c3 [concrete] // CHECK:STDOUT: } @@ -1067,30 +1067,30 @@ fn F() { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc10: %.9ed = impl_witness_access constants.%As.impl_witness.ab6, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.29b] -// CHECK:STDOUT: %bound_method.loc10_21.1: = bound_method %int_8.loc10, %impl.elem0.loc10 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %bound_method.loc10_28.1: = bound_method %int_8.loc10, %impl.elem0.loc10 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] // CHECK:STDOUT: %specific_fn.loc10: = specific_function %impl.elem0.loc10, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc10_21.2: = bound_method %int_8.loc10, %specific_fn.loc10 [concrete = constants.%bound_method.530] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc10_21.2(%int_8.loc10) [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %.loc10_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %.loc10_21.2: %i32 = converted %int_8.loc10, %.loc10_21.1 [concrete = constants.%int_8.98c] -// CHECK:STDOUT: %.loc10_14: type = splice_block %C.ref.loc10 [concrete = constants.%C] { +// CHECK:STDOUT: %bound_method.loc10_28.2: = bound_method %int_8.loc10, %specific_fn.loc10 [concrete = constants.%bound_method.530] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc10_28.2(%int_8.loc10) [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %.loc10_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %.loc10_28.2: %i32 = converted %int_8.loc10, %.loc10_28.1 [concrete = constants.%int_8.98c] +// CHECK:STDOUT: %.loc10_21: type = splice_block %C.ref.loc10 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc10_21.3: ref %C = temporary_storage -// CHECK:STDOUT: %addr.loc10: %ptr.d9e = addr_of %.loc10_21.3 -// CHECK:STDOUT: %C__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc10_21.2, %addr.loc10) -// CHECK:STDOUT: %.loc10_21.4: init %C to %.loc10_21.3 = mark_in_place_init %C__carbon_thunk.call.loc10 -// CHECK:STDOUT: %.loc10_21.5: init %C = converted %.loc10_21.2, %.loc10_21.4 -// CHECK:STDOUT: %.loc10_21.6: ref %C = temporary %.loc10_21.3, %.loc10_21.5 -// CHECK:STDOUT: %.loc10_21.7: %C = acquire_value %.loc10_21.6 -// CHECK:STDOUT: %c3: %C = value_binding c3, %.loc10_21.7 -// CHECK:STDOUT: %C.cpp_destructor.bound.loc10: = bound_method %.loc10_21.6, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%.loc10_21.6) -// CHECK:STDOUT: %C.cpp_destructor.bound.loc9: = bound_method %.loc9_28.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_28.3) -// CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %.loc8_31.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_31.3) +// CHECK:STDOUT: %.loc10_28.3: ref %C = temporary_storage +// CHECK:STDOUT: %addr.loc10: %ptr.d9e = addr_of %.loc10_28.3 +// CHECK:STDOUT: %C__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc10_28.2, %addr.loc10) +// CHECK:STDOUT: %.loc10_28.4: init %C to %.loc10_28.3 = mark_in_place_init %C__carbon_thunk.call.loc10 +// CHECK:STDOUT: %.loc10_28.5: init %C = converted %.loc10_28.2, %.loc10_28.4 +// CHECK:STDOUT: %.loc10_28.6: ref %C = temporary %.loc10_28.3, %.loc10_28.5 +// CHECK:STDOUT: %.loc10_28.7: %C = acquire_value %.loc10_28.6 +// CHECK:STDOUT: %c3: %C = value_binding c3, %.loc10_28.7 +// CHECK:STDOUT: %C.cpp_destructor.bound.loc10: = bound_method %.loc10_28.6, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%.loc10_28.6) +// CHECK:STDOUT: %C.cpp_destructor.bound.loc9: = bound_method %.loc9_35.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_35.3) +// CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %.loc8_38.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_38.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/class/field.carbon b/toolchain/check/testdata/interop/cpp/class/field.carbon index 98779145c320..3e3d8eb74cc0 100644 --- a/toolchain/check/testdata/interop/cpp/class/field.carbon +++ b/toolchain/check/testdata/interop/cpp/class/field.carbon @@ -190,11 +190,11 @@ library "[[@TEST_NAME]]"; import Cpp library "unsupported_members.h"; fn Test(m: Cpp.UnsupportedMembers*) { - // CHECK:STDERR: fail_use_unsupported_members.carbon:[[@LINE+4]]:16: note: in `Cpp` name lookup for `is_volatile` [InCppNameLookup] - // CHECK:STDERR: let a: i32 = m->is_volatile; - // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: fail_use_unsupported_members.carbon:[[@LINE+4]]:23: note: in `Cpp` name lookup for `is_volatile` [InCppNameLookup] + // CHECK:STDERR: let unused a: i32 = m->is_volatile; + // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: - let a: i32 = m->is_volatile; + let unused a: i32 = m->is_volatile; } // CHECK:STDOUT: --- use_struct_fields.carbon diff --git a/toolchain/check/testdata/interop/cpp/class/method.carbon b/toolchain/check/testdata/interop/cpp/class/method.carbon index 2400d4f7f9bd..4f10148f6f0a 100644 --- a/toolchain/check/testdata/interop/cpp/class/method.carbon +++ b/toolchain/check/testdata/interop/cpp/class/method.carbon @@ -164,26 +164,8 @@ import Cpp library "object_param_qualifiers_overloaded.h"; fn CallF(v: Cpp.HasQualifiers, p: Cpp.HasQualifiers*) { //@dump-sem-ir-begin - var a: i32 = v.F(); - var b: i32* = p->F(); - //@dump-sem-ir-end -} - -// --- use_object_param_qualifiers_qualified.carbon - -library "[[@TEST_NAME]]"; - -import Cpp library "object_param_qualifiers.h"; - -fn F(v: Cpp.HasQualifiers, p: Cpp.HasQualifiers*) { - //@dump-sem-ir-begin - v.(Cpp.HasQualifiers.const_this)(); - v.(Cpp.HasQualifiers.const_ref_this)(); - - p->(Cpp.HasQualifiers.plain)(); - p->(Cpp.HasQualifiers.ref_this)(); - p->(Cpp.HasQualifiers.const_this)(); - p->(Cpp.HasQualifiers.const_ref_this)(); + var unused a: i32 = v.F(); + var unused b: i32* = p->F(); //@dump-sem-ir-end } @@ -412,12 +394,12 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref %ptr.235 = var %b.var_patt // CHECK:STDOUT: %p.ref: %ptr.ec3 = name_ref p, %p -// CHECK:STDOUT: %.loc9_18: ref %HasQualifiers = deref %p.ref +// CHECK:STDOUT: %.loc9_25: ref %HasQualifiers = deref %p.ref // CHECK:STDOUT: %F.ref.loc9: %HasQualifiers.F.cpp_overload_set.type = name_ref F, imports.%HasQualifiers.F.cpp_overload_set.value [concrete = constants.%HasQualifiers.F.cpp_overload_set.value] -// CHECK:STDOUT: %bound_method.loc9: = bound_method %.loc9_18, %F.ref.loc9 -// CHECK:STDOUT: %HasQualifiers.F.call: init %ptr.235 = call imports.%HasQualifiers.F.decl.f862ea.2(%.loc9_18) +// CHECK:STDOUT: %bound_method.loc9: = bound_method %.loc9_25, %F.ref.loc9 +// CHECK:STDOUT: %HasQualifiers.F.call: init %ptr.235 = call imports.%HasQualifiers.F.decl.f862ea.2(%.loc9_25) // CHECK:STDOUT: assign %b.var, %HasQualifiers.F.call -// CHECK:STDOUT: %.loc9_13: type = splice_block %ptr.loc9 [concrete = constants.%ptr.235] { +// CHECK:STDOUT: %.loc9_20: type = splice_block %ptr.loc9 [concrete = constants.%ptr.235] { // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %ptr.loc9: type = ptr_type %i32.loc9 [concrete = constants.%ptr.235] @@ -434,114 +416,6 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: // CHECK:STDOUT: fn @DestroyOp.loc8(%self.param: ref %i32) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: --- use_object_param_qualifiers_qualified.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %HasQualifiers: type = class_type @HasQualifiers [concrete] -// CHECK:STDOUT: %pattern_type.e15: type = pattern_type %HasQualifiers [concrete] -// CHECK:STDOUT: %ptr.ec3: type = ptr_type %HasQualifiers [concrete] -// CHECK:STDOUT: %HasQualifiers.const_this.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.const_this.cpp_overload_set [concrete] -// CHECK:STDOUT: %HasQualifiers.const_this.cpp_overload_set.value: %HasQualifiers.const_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.const_this.cpp_overload_set [concrete] -// CHECK:STDOUT: %const_this__carbon_thunk.type: type = fn_type @const_this__carbon_thunk [concrete] -// CHECK:STDOUT: %const_this__carbon_thunk: %const_this__carbon_thunk.type = struct_value () [concrete] -// CHECK:STDOUT: %HasQualifiers.const_ref_this.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.const_ref_this.cpp_overload_set [concrete] -// CHECK:STDOUT: %HasQualifiers.const_ref_this.cpp_overload_set.value: %HasQualifiers.const_ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.const_ref_this.cpp_overload_set [concrete] -// CHECK:STDOUT: %const_ref_this__carbon_thunk.type: type = fn_type @const_ref_this__carbon_thunk [concrete] -// CHECK:STDOUT: %const_ref_this__carbon_thunk: %const_ref_this__carbon_thunk.type = struct_value () [concrete] -// CHECK:STDOUT: %HasQualifiers.plain.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.plain.cpp_overload_set [concrete] -// CHECK:STDOUT: %HasQualifiers.plain.cpp_overload_set.value: %HasQualifiers.plain.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.plain.cpp_overload_set [concrete] -// CHECK:STDOUT: %HasQualifiers.plain.type: type = fn_type @HasQualifiers.plain [concrete] -// CHECK:STDOUT: %HasQualifiers.plain: %HasQualifiers.plain.type = struct_value () [concrete] -// CHECK:STDOUT: %HasQualifiers.ref_this.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.ref_this.cpp_overload_set [concrete] -// CHECK:STDOUT: %HasQualifiers.ref_this.cpp_overload_set.value: %HasQualifiers.ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.ref_this.cpp_overload_set [concrete] -// CHECK:STDOUT: %HasQualifiers.ref_this.type: type = fn_type @HasQualifiers.ref_this [concrete] -// CHECK:STDOUT: %HasQualifiers.ref_this: %HasQualifiers.ref_this.type = struct_value () [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Cpp: = namespace file.%Cpp.import_cpp, [concrete] { -// CHECK:STDOUT: .HasQualifiers = %HasQualifiers.decl -// CHECK:STDOUT: import Cpp//... -// CHECK:STDOUT: } -// CHECK:STDOUT: %HasQualifiers.decl: type = class_decl @HasQualifiers [concrete = constants.%HasQualifiers] {} {} -// CHECK:STDOUT: %HasQualifiers.const_this.cpp_overload_set.value: %HasQualifiers.const_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.const_this.cpp_overload_set [concrete = constants.%HasQualifiers.const_this.cpp_overload_set.value] -// CHECK:STDOUT: %const_this__carbon_thunk.decl: %const_this__carbon_thunk.type = fn_decl @const_this__carbon_thunk [concrete = constants.%const_this__carbon_thunk] { -// CHECK:STDOUT: -// CHECK:STDOUT: } { -// CHECK:STDOUT: -// CHECK:STDOUT: } -// CHECK:STDOUT: %HasQualifiers.const_ref_this.cpp_overload_set.value: %HasQualifiers.const_ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.const_ref_this.cpp_overload_set [concrete = constants.%HasQualifiers.const_ref_this.cpp_overload_set.value] -// CHECK:STDOUT: %const_ref_this__carbon_thunk.decl: %const_ref_this__carbon_thunk.type = fn_decl @const_ref_this__carbon_thunk [concrete = constants.%const_ref_this__carbon_thunk] { -// CHECK:STDOUT: -// CHECK:STDOUT: } { -// CHECK:STDOUT: -// CHECK:STDOUT: } -// CHECK:STDOUT: %HasQualifiers.plain.cpp_overload_set.value: %HasQualifiers.plain.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.plain.cpp_overload_set [concrete = constants.%HasQualifiers.plain.cpp_overload_set.value] -// CHECK:STDOUT: %HasQualifiers.plain.decl: %HasQualifiers.plain.type = fn_decl @HasQualifiers.plain [concrete = constants.%HasQualifiers.plain] { -// CHECK:STDOUT: %self.patt: %pattern_type.e15 = ref_binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: %pattern_type.e15 = ref_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %HasQualifiers = ref_param call_param0 -// CHECK:STDOUT: %self: ref %HasQualifiers = ref_binding self, %self.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %HasQualifiers.ref_this.cpp_overload_set.value: %HasQualifiers.ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.ref_this.cpp_overload_set [concrete = constants.%HasQualifiers.ref_this.cpp_overload_set.value] -// CHECK:STDOUT: %HasQualifiers.ref_this.decl: %HasQualifiers.ref_this.type = fn_decl @HasQualifiers.ref_this [concrete = constants.%HasQualifiers.ref_this] { -// CHECK:STDOUT: %self.patt: %pattern_type.e15 = ref_binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: %pattern_type.e15 = ref_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %HasQualifiers = ref_param call_param0 -// CHECK:STDOUT: %self: ref %HasQualifiers = ref_binding self, %self.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%v.param: %HasQualifiers, %p.param: %ptr.ec3) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %v.ref.loc8: %HasQualifiers = name_ref v, %v -// CHECK:STDOUT: %Cpp.ref.loc8: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %HasQualifiers.ref.loc8: type = name_ref HasQualifiers, imports.%HasQualifiers.decl [concrete = constants.%HasQualifiers] -// CHECK:STDOUT: %const_this.ref.loc8: %HasQualifiers.const_this.cpp_overload_set.type = name_ref const_this, imports.%HasQualifiers.const_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_this.cpp_overload_set.value] -// CHECK:STDOUT: %bound_method.loc8: = bound_method %v.ref.loc8, %const_this.ref.loc8 -// CHECK:STDOUT: %const_this__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%const_this__carbon_thunk.decl(%v.ref.loc8) -// CHECK:STDOUT: %v.ref.loc9: %HasQualifiers = name_ref v, %v -// CHECK:STDOUT: %Cpp.ref.loc9: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %HasQualifiers.ref.loc9: type = name_ref HasQualifiers, imports.%HasQualifiers.decl [concrete = constants.%HasQualifiers] -// CHECK:STDOUT: %const_ref_this.ref.loc9: %HasQualifiers.const_ref_this.cpp_overload_set.type = name_ref const_ref_this, imports.%HasQualifiers.const_ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_ref_this.cpp_overload_set.value] -// CHECK:STDOUT: %bound_method.loc9: = bound_method %v.ref.loc9, %const_ref_this.ref.loc9 -// CHECK:STDOUT: %const_ref_this__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%const_ref_this__carbon_thunk.decl(%v.ref.loc9) -// CHECK:STDOUT: %p.ref.loc11: %ptr.ec3 = name_ref p, %p -// CHECK:STDOUT: %Cpp.ref.loc11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %HasQualifiers.ref.loc11: type = name_ref HasQualifiers, imports.%HasQualifiers.decl [concrete = constants.%HasQualifiers] -// CHECK:STDOUT: %plain.ref: %HasQualifiers.plain.cpp_overload_set.type = name_ref plain, imports.%HasQualifiers.plain.cpp_overload_set.value [concrete = constants.%HasQualifiers.plain.cpp_overload_set.value] -// CHECK:STDOUT: %.loc11: ref %HasQualifiers = deref %p.ref.loc11 -// CHECK:STDOUT: %bound_method.loc11: = bound_method %.loc11, %plain.ref -// CHECK:STDOUT: %HasQualifiers.plain.call: init %empty_tuple.type = call imports.%HasQualifiers.plain.decl(%.loc11) -// CHECK:STDOUT: %p.ref.loc12: %ptr.ec3 = name_ref p, %p -// CHECK:STDOUT: %Cpp.ref.loc12: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %HasQualifiers.ref.loc12: type = name_ref HasQualifiers, imports.%HasQualifiers.decl [concrete = constants.%HasQualifiers] -// CHECK:STDOUT: %ref_this.ref: %HasQualifiers.ref_this.cpp_overload_set.type = name_ref ref_this, imports.%HasQualifiers.ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.ref_this.cpp_overload_set.value] -// CHECK:STDOUT: %.loc12: ref %HasQualifiers = deref %p.ref.loc12 -// CHECK:STDOUT: %bound_method.loc12: = bound_method %.loc12, %ref_this.ref -// CHECK:STDOUT: %HasQualifiers.ref_this.call: init %empty_tuple.type = call imports.%HasQualifiers.ref_this.decl(%.loc12) -// CHECK:STDOUT: %p.ref.loc13: %ptr.ec3 = name_ref p, %p -// CHECK:STDOUT: %Cpp.ref.loc13: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %HasQualifiers.ref.loc13: type = name_ref HasQualifiers, imports.%HasQualifiers.decl [concrete = constants.%HasQualifiers] -// CHECK:STDOUT: %const_this.ref.loc13: %HasQualifiers.const_this.cpp_overload_set.type = name_ref const_this, imports.%HasQualifiers.const_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_this.cpp_overload_set.value] -// CHECK:STDOUT: %.loc13_4.1: ref %HasQualifiers = deref %p.ref.loc13 -// CHECK:STDOUT: %bound_method.loc13: = bound_method %.loc13_4.1, %const_this.ref.loc13 -// CHECK:STDOUT: %.loc13_4.2: %HasQualifiers = acquire_value %.loc13_4.1 -// CHECK:STDOUT: %const_this__carbon_thunk.call.loc13: init %empty_tuple.type = call imports.%const_this__carbon_thunk.decl(%.loc13_4.2) -// CHECK:STDOUT: %p.ref.loc14: %ptr.ec3 = name_ref p, %p -// CHECK:STDOUT: %Cpp.ref.loc14: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %HasQualifiers.ref.loc14: type = name_ref HasQualifiers, imports.%HasQualifiers.decl [concrete = constants.%HasQualifiers] -// CHECK:STDOUT: %const_ref_this.ref.loc14: %HasQualifiers.const_ref_this.cpp_overload_set.type = name_ref const_ref_this, imports.%HasQualifiers.const_ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_ref_this.cpp_overload_set.value] -// CHECK:STDOUT: %.loc14_4.1: ref %HasQualifiers = deref %p.ref.loc14 -// CHECK:STDOUT: %bound_method.loc14: = bound_method %.loc14_4.1, %const_ref_this.ref.loc14 -// CHECK:STDOUT: %.loc14_4.2: %HasQualifiers = acquire_value %.loc14_4.1 -// CHECK:STDOUT: %const_ref_this__carbon_thunk.call.loc14: init %empty_tuple.type = call imports.%const_ref_this__carbon_thunk.decl(%.loc14_4.2) -// CHECK:STDOUT: -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: --- call_explicit_object_param.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/interop/cpp/class/union.carbon b/toolchain/check/testdata/interop/cpp/class/union.carbon index 53c67276d581..c4fa6f314d2b 100644 --- a/toolchain/check/testdata/interop/cpp/class/union.carbon +++ b/toolchain/check/testdata/interop/cpp/class/union.carbon @@ -35,15 +35,15 @@ library "[[@TEST_NAME]]"; import Cpp library "declaration.h"; fn MyF() { - // CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+8]]:12: error: binding pattern has incomplete type `Bar` in name binding declaration [IncompleteTypeInBindingDecl] - // CHECK:STDERR: var bar: Cpp.Bar; - // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+8]]:19: error: binding pattern has incomplete type `Bar` in name binding declaration [IncompleteTypeInBindingDecl] + // CHECK:STDERR: var unused bar: Cpp.Bar; + // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE-6]]:10: in file included here [InCppInclude] // CHECK:STDERR: ./declaration.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: union Bar; // CHECK:STDERR: ^ // CHECK:STDERR: - var bar: Cpp.Bar; + var unused bar: Cpp.Bar; } // ============================================================================ @@ -125,7 +125,7 @@ import Cpp library "static_data_member.h"; fn MyF() { //@dump-sem-ir-begin - let bar: Cpp.Bar* = Cpp.Bar.foo; + let unused bar: Cpp.Bar* = Cpp.Bar.foo; //@dump-sem-ir-end } @@ -148,7 +148,7 @@ import Cpp library "data_member.h"; //@dump-sem-ir-begin fn MyF(bar : Cpp.Bar*) { - let foo_bar: Cpp.Bar* = bar->foo; + let unused foo_bar: Cpp.Bar* = bar->foo; } //@dump-sem-ir-end @@ -332,16 +332,16 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*); // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %bar.patt: %pattern_type = value_binding_pattern bar [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc8_23: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Bar.ref.loc8_26: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar] +// CHECK:STDOUT: %Cpp.ref.loc8_30: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Bar.ref.loc8_33: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar] // CHECK:STDOUT: %foo.ref: ref %ptr.f68 = name_ref foo, imports.%foo.var [concrete = imports.%foo.var] -// CHECK:STDOUT: %.loc8_19: type = splice_block %ptr [concrete = constants.%ptr.f68] { -// CHECK:STDOUT: %Cpp.ref.loc8_12: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Bar.ref.loc8_15: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar] -// CHECK:STDOUT: %ptr: type = ptr_type %Bar.ref.loc8_15 [concrete = constants.%ptr.f68] +// CHECK:STDOUT: %.loc8_26: type = splice_block %ptr [concrete = constants.%ptr.f68] { +// CHECK:STDOUT: %Cpp.ref.loc8_19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Bar.ref.loc8_22: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar] +// CHECK:STDOUT: %ptr: type = ptr_type %Bar.ref.loc8_22 [concrete = constants.%ptr.f68] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_30: %ptr.f68 = acquire_value %foo.ref -// CHECK:STDOUT: %bar: %ptr.f68 = value_binding bar, %.loc8_30 +// CHECK:STDOUT: %.loc8_37: %ptr.f68 = acquire_value %foo.ref +// CHECK:STDOUT: %bar: %ptr.f68 = value_binding bar, %.loc8_37 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -385,16 +385,16 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*); // CHECK:STDOUT: %foo_bar.patt: %pattern_type = value_binding_pattern foo_bar [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %bar.ref: %ptr.f68 = name_ref bar, %bar -// CHECK:STDOUT: %.loc8_30.1: ref %Bar = deref %bar.ref +// CHECK:STDOUT: %.loc8_37.1: ref %Bar = deref %bar.ref // CHECK:STDOUT: %foo.ref: %Bar.elem = name_ref foo, @Bar.%.1 [concrete = @Bar.%.1] -// CHECK:STDOUT: %.loc8_30.2: ref %ptr.f68 = class_element_access %.loc8_30.1, element0 -// CHECK:STDOUT: %.loc8_23: type = splice_block %ptr.loc8 [concrete = constants.%ptr.f68] { +// CHECK:STDOUT: %.loc8_37.2: ref %ptr.f68 = class_element_access %.loc8_37.1, element0 +// CHECK:STDOUT: %.loc8_30: type = splice_block %ptr.loc8 [concrete = constants.%ptr.f68] { // CHECK:STDOUT: %Cpp.ref.loc8: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Bar.ref.loc8: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar] // CHECK:STDOUT: %ptr.loc8: type = ptr_type %Bar.ref.loc8 [concrete = constants.%ptr.f68] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_30.3: %ptr.f68 = acquire_value %.loc8_30.2 -// CHECK:STDOUT: %foo_bar: %ptr.f68 = value_binding foo_bar, %.loc8_30.3 +// CHECK:STDOUT: %.loc8_37.3: %ptr.f68 = acquire_value %.loc8_37.2 +// CHECK:STDOUT: %foo_bar: %ptr.f68 = value_binding foo_bar, %.loc8_37.3 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/enum/convert.carbon b/toolchain/check/testdata/interop/cpp/enum/convert.carbon index d2c00ac3ded7..611197b767f5 100644 --- a/toolchain/check/testdata/interop/cpp/enum/convert.carbon +++ b/toolchain/check/testdata/interop/cpp/enum/convert.carbon @@ -26,9 +26,9 @@ import Cpp library "enum.h"; //@dump-sem-ir-begin fn F() { - let a: i16 = Cpp.Enum.a as i16; - let b: Cpp.Enum = (42 as i16) as Cpp.Enum; - let c: Cpp.Other = Cpp.a as Cpp.Other; + let unused a: i16 = Cpp.Enum.a as i16; + let unused b: Cpp.Enum = (42 as i16) as Cpp.Enum; + let unused c: Cpp.Other = Cpp.a as Cpp.Other; } //@dump-sem-ir-end @@ -144,15 +144,15 @@ fn F() { // CHECK:STDOUT: %Cpp.ref.loc8: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Enum.ref.loc8: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] // CHECK:STDOUT: %a.ref.loc8: %Enum = name_ref a, imports.%int_0 [concrete = constants.%int_0.420] -// CHECK:STDOUT: %int_16.loc8_30: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16.loc8_30: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] -// CHECK:STDOUT: %.loc8_27.1: %i16 = as_compatible %a.ref.loc8 [concrete = constants.%int_0.320] -// CHECK:STDOUT: %.loc8_27.2: %i16 = converted %a.ref.loc8, %.loc8_27.1 [concrete = constants.%int_0.320] -// CHECK:STDOUT: %.loc8_10: type = splice_block %i16.loc8_10 [concrete = constants.%i16] { -// CHECK:STDOUT: %int_16.loc8_10: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] -// CHECK:STDOUT: %i16.loc8_10: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: %int_16.loc8_37: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16.loc8_37: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] +// CHECK:STDOUT: %.loc8_34.1: %i16 = as_compatible %a.ref.loc8 [concrete = constants.%int_0.320] +// CHECK:STDOUT: %.loc8_34.2: %i16 = converted %a.ref.loc8, %.loc8_34.1 [concrete = constants.%int_0.320] +// CHECK:STDOUT: %.loc8_17: type = splice_block %i16.loc8_17 [concrete = constants.%i16] { +// CHECK:STDOUT: %int_16.loc8_17: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] +// CHECK:STDOUT: %i16.loc8_17: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i16 = value_binding a, %.loc8_27.2 +// CHECK:STDOUT: %a: %i16 = value_binding a, %.loc8_34.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.ebf = value_binding_pattern b [concrete] // CHECK:STDOUT: } @@ -160,35 +160,35 @@ fn F() { // CHECK:STDOUT: %int_16.loc9: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] // CHECK:STDOUT: %i16.loc9: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: %impl.elem0: %.70c = impl_witness_access constants.%As.impl_witness.b61, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.a42] -// CHECK:STDOUT: %bound_method.loc9_25.1: = bound_method %int_42, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %bound_method.loc9_32.1: = bound_method %int_42, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_25.2: = bound_method %int_42, %specific_fn [concrete = constants.%bound_method] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i16 = call %bound_method.loc9_25.2(%int_42) [concrete = constants.%int_42.a0e] -// CHECK:STDOUT: %.loc9_25.1: %i16 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_42.a0e] -// CHECK:STDOUT: %.loc9_25.2: %i16 = converted %int_42, %.loc9_25.1 [concrete = constants.%int_42.a0e] -// CHECK:STDOUT: %Cpp.ref.loc9_36: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Enum.ref.loc9_39: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] -// CHECK:STDOUT: %.loc9_33.1: %Enum = as_compatible %.loc9_25.2 [concrete = constants.%int_42.c3a] -// CHECK:STDOUT: %.loc9_33.2: %Enum = converted %.loc9_25.2, %.loc9_33.1 [concrete = constants.%int_42.c3a] -// CHECK:STDOUT: %.loc9_13: type = splice_block %Enum.ref.loc9_13 [concrete = constants.%Enum] { -// CHECK:STDOUT: %Cpp.ref.loc9_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Enum.ref.loc9_13: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] +// CHECK:STDOUT: %bound_method.loc9_32.2: = bound_method %int_42, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i16 = call %bound_method.loc9_32.2(%int_42) [concrete = constants.%int_42.a0e] +// CHECK:STDOUT: %.loc9_32.1: %i16 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_42.a0e] +// CHECK:STDOUT: %.loc9_32.2: %i16 = converted %int_42, %.loc9_32.1 [concrete = constants.%int_42.a0e] +// CHECK:STDOUT: %Cpp.ref.loc9_43: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Enum.ref.loc9_46: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] +// CHECK:STDOUT: %.loc9_40.1: %Enum = as_compatible %.loc9_32.2 [concrete = constants.%int_42.c3a] +// CHECK:STDOUT: %.loc9_40.2: %Enum = converted %.loc9_32.2, %.loc9_40.1 [concrete = constants.%int_42.c3a] +// CHECK:STDOUT: %.loc9_20: type = splice_block %Enum.ref.loc9_20 [concrete = constants.%Enum] { +// CHECK:STDOUT: %Cpp.ref.loc9_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Enum.ref.loc9_20: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] // CHECK:STDOUT: } -// CHECK:STDOUT: %b: %Enum = value_binding b, %.loc9_33.2 +// CHECK:STDOUT: %b: %Enum = value_binding b, %.loc9_40.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c.patt: %pattern_type.c06 = value_binding_pattern c [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc10_22: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc10_29: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %a.ref.loc10: %Enum = name_ref a, imports.%int_0 [concrete = constants.%int_0.420] -// CHECK:STDOUT: %Cpp.ref.loc10_31: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Other.ref.loc10_34: type = name_ref Other, imports.%Other.decl [concrete = constants.%Other] -// CHECK:STDOUT: %.loc10_28.1: %Other = as_compatible %a.ref.loc10 [concrete = constants.%int_0.fa2] -// CHECK:STDOUT: %.loc10_28.2: %Other = converted %a.ref.loc10, %.loc10_28.1 [concrete = constants.%int_0.fa2] -// CHECK:STDOUT: %.loc10_13: type = splice_block %Other.ref.loc10_13 [concrete = constants.%Other] { -// CHECK:STDOUT: %Cpp.ref.loc10_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Other.ref.loc10_13: type = name_ref Other, imports.%Other.decl [concrete = constants.%Other] +// CHECK:STDOUT: %Cpp.ref.loc10_38: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Other.ref.loc10_41: type = name_ref Other, imports.%Other.decl [concrete = constants.%Other] +// CHECK:STDOUT: %.loc10_35.1: %Other = as_compatible %a.ref.loc10 [concrete = constants.%int_0.fa2] +// CHECK:STDOUT: %.loc10_35.2: %Other = converted %a.ref.loc10, %.loc10_35.1 [concrete = constants.%int_0.fa2] +// CHECK:STDOUT: %.loc10_20: type = splice_block %Other.ref.loc10_20 [concrete = constants.%Other] { +// CHECK:STDOUT: %Cpp.ref.loc10_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Other.ref.loc10_20: type = name_ref Other, imports.%Other.decl [concrete = constants.%Other] // CHECK:STDOUT: } -// CHECK:STDOUT: %c: %Other = value_binding c, %.loc10_28.2 +// CHECK:STDOUT: %c: %Other = value_binding c, %.loc10_35.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/enum/fixed.carbon b/toolchain/check/testdata/interop/cpp/enum/fixed.carbon index 4ae8075d54a3..353bd5529343 100644 --- a/toolchain/check/testdata/interop/cpp/enum/fixed.carbon +++ b/toolchain/check/testdata/interop/cpp/enum/fixed.carbon @@ -22,8 +22,8 @@ import Cpp library "enum.h"; //@dump-sem-ir-begin fn F() { - let a: Cpp.Enum = Cpp.Enum.a; - let b: Cpp.Enum = Cpp.b; + let unused a: Cpp.Enum = Cpp.Enum.a; + let unused b: Cpp.Enum = Cpp.b; } //@dump-sem-ir-end @@ -58,21 +58,21 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type = value_binding_pattern a [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc8_21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Enum.ref.loc8_24: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] +// CHECK:STDOUT: %Cpp.ref.loc8_28: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Enum.ref.loc8_31: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] // CHECK:STDOUT: %a.ref: %Enum = name_ref a, imports.%int_0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc8: type = splice_block %Enum.ref.loc8_13 [concrete = constants.%Enum] { -// CHECK:STDOUT: %Cpp.ref.loc8_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Enum.ref.loc8_13: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] +// CHECK:STDOUT: %.loc8: type = splice_block %Enum.ref.loc8_20 [concrete = constants.%Enum] { +// CHECK:STDOUT: %Cpp.ref.loc8_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Enum.ref.loc8_20: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %Enum = value_binding a, %a.ref // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type = value_binding_pattern b [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc9_21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc9_28: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %b.ref: %Enum = name_ref b, imports.%int_1 [concrete = constants.%int_1] // CHECK:STDOUT: %.loc9: type = splice_block %Enum.ref.loc9 [concrete = constants.%Enum] { -// CHECK:STDOUT: %Cpp.ref.loc9_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc9_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Enum.ref.loc9: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] // CHECK:STDOUT: } // CHECK:STDOUT: %b: %Enum = value_binding b, %b.ref diff --git a/toolchain/check/testdata/interop/cpp/enum/incomplete.carbon b/toolchain/check/testdata/interop/cpp/enum/incomplete.carbon index e0285aa12e7a..5767ad72686f 100644 --- a/toolchain/check/testdata/interop/cpp/enum/incomplete.carbon +++ b/toolchain/check/testdata/interop/cpp/enum/incomplete.carbon @@ -46,15 +46,15 @@ import Cpp library "declaration.h"; fn MyF() { // TODO: It's a bit surprising to refer to this type as a class, even though // we model it as a class in Carbon. Consider customizing the diagnostic. - // CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+8]]:10: error: binding pattern has incomplete type `UnsizedEnum` in name binding declaration [IncompleteTypeInBindingDecl] - // CHECK:STDERR: var e: Cpp.UnsizedEnum; - // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+8]]:17: error: binding pattern has incomplete type `UnsizedEnum` in name binding declaration [IncompleteTypeInBindingDecl] + // CHECK:STDERR: var unused e: Cpp.UnsizedEnum; + // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE-8]]:10: in file included here [InCppInclude] // CHECK:STDERR: ./declaration.h:4:6: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: enum UnsizedEnum; // CHECK:STDERR: ^ // CHECK:STDERR: - var e: Cpp.UnsizedEnum; + var unused e: Cpp.UnsizedEnum; } // CHECK:STDOUT: --- import_declaration.carbon diff --git a/toolchain/check/testdata/interop/cpp/enum/member.carbon b/toolchain/check/testdata/interop/cpp/enum/member.carbon index a2d47d03bcc9..fe9752348a6c 100644 --- a/toolchain/check/testdata/interop/cpp/enum/member.carbon +++ b/toolchain/check/testdata/interop/cpp/enum/member.carbon @@ -25,8 +25,8 @@ import Cpp library "enum_member.h"; //@dump-sem-ir-begin fn F() { - let a: Cpp.A.E = Cpp.A.a; - let b: Cpp.A.E = Cpp.A.E.b; + let unused a: Cpp.A.E = Cpp.A.a; + let unused b: Cpp.A.E = Cpp.A.E.b; } //@dump-sem-ir-end @@ -62,26 +62,26 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type = value_binding_pattern a [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc8_20: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %A.ref.loc8_23: type = name_ref A, imports.%A.decl [concrete = constants.%A] +// CHECK:STDOUT: %Cpp.ref.loc8_27: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %A.ref.loc8_30: type = name_ref A, imports.%A.decl [concrete = constants.%A] // CHECK:STDOUT: %a.ref: %E = name_ref a, imports.%int_0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc8: type = splice_block %E.ref.loc8 [concrete = constants.%E] { -// CHECK:STDOUT: %Cpp.ref.loc8_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %A.ref.loc8_13: type = name_ref A, imports.%A.decl [concrete = constants.%A] +// CHECK:STDOUT: %Cpp.ref.loc8_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %A.ref.loc8_20: type = name_ref A, imports.%A.decl [concrete = constants.%A] // CHECK:STDOUT: %E.ref.loc8: type = name_ref E, imports.%E.decl [concrete = constants.%E] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %E = value_binding a, %a.ref // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type = value_binding_pattern b [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc9_20: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %A.ref.loc9_23: type = name_ref A, imports.%A.decl [concrete = constants.%A] -// CHECK:STDOUT: %E.ref.loc9_25: type = name_ref E, imports.%E.decl [concrete = constants.%E] +// CHECK:STDOUT: %Cpp.ref.loc9_27: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %A.ref.loc9_30: type = name_ref A, imports.%A.decl [concrete = constants.%A] +// CHECK:STDOUT: %E.ref.loc9_32: type = name_ref E, imports.%E.decl [concrete = constants.%E] // CHECK:STDOUT: %b.ref: %E = name_ref b, imports.%int_1 [concrete = constants.%int_1] -// CHECK:STDOUT: %.loc9: type = splice_block %E.ref.loc9_15 [concrete = constants.%E] { -// CHECK:STDOUT: %Cpp.ref.loc9_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %A.ref.loc9_13: type = name_ref A, imports.%A.decl [concrete = constants.%A] -// CHECK:STDOUT: %E.ref.loc9_15: type = name_ref E, imports.%E.decl [concrete = constants.%E] +// CHECK:STDOUT: %.loc9: type = splice_block %E.ref.loc9_22 [concrete = constants.%E] { +// CHECK:STDOUT: %Cpp.ref.loc9_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %A.ref.loc9_20: type = name_ref A, imports.%A.decl [concrete = constants.%A] +// CHECK:STDOUT: %E.ref.loc9_22: type = name_ref E, imports.%E.decl [concrete = constants.%E] // CHECK:STDOUT: } // CHECK:STDOUT: %b: %E = value_binding b, %b.ref // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/interop/cpp/enum/scoped.carbon b/toolchain/check/testdata/interop/cpp/enum/scoped.carbon index 492ae0be3201..65ad00dd087e 100644 --- a/toolchain/check/testdata/interop/cpp/enum/scoped.carbon +++ b/toolchain/check/testdata/interop/cpp/enum/scoped.carbon @@ -22,7 +22,7 @@ import Cpp library "enum.h"; //@dump-sem-ir-begin fn F() { - let a: Cpp.Enum = Cpp.Enum.a; + let unused a: Cpp.Enum = Cpp.Enum.a; } //@dump-sem-ir-end @@ -33,11 +33,11 @@ library "[[@TEST_NAME]]"; import Cpp library "enum.h"; fn F() { - // CHECK:STDERR: fail_name_without_scope.carbon:[[@LINE+4]]:21: error: member name `b` not found in `Cpp` [MemberNameNotFoundInInstScope] - // CHECK:STDERR: let b: Cpp.Enum = Cpp.b; - // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: fail_name_without_scope.carbon:[[@LINE+4]]:28: error: member name `b` not found in `Cpp` [MemberNameNotFoundInInstScope] + // CHECK:STDERR: let unused b: Cpp.Enum = Cpp.b; + // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - let b: Cpp.Enum = Cpp.b; + let unused b: Cpp.Enum = Cpp.b; } // CHECK:STDOUT: --- import_enum.carbon @@ -68,12 +68,12 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type = value_binding_pattern a [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc8_21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Enum.ref.loc8_24: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] +// CHECK:STDOUT: %Cpp.ref.loc8_28: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Enum.ref.loc8_31: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] // CHECK:STDOUT: %a.ref: %Enum = name_ref a, imports.%int_0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc8: type = splice_block %Enum.ref.loc8_13 [concrete = constants.%Enum] { -// CHECK:STDOUT: %Cpp.ref.loc8_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Enum.ref.loc8_13: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] +// CHECK:STDOUT: %.loc8: type = splice_block %Enum.ref.loc8_20 [concrete = constants.%Enum] { +// CHECK:STDOUT: %Cpp.ref.loc8_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Enum.ref.loc8_20: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %Enum = value_binding a, %a.ref // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/interop/cpp/enum/unscoped.carbon b/toolchain/check/testdata/interop/cpp/enum/unscoped.carbon index ea6a0f2ac8e2..9fa8210576bb 100644 --- a/toolchain/check/testdata/interop/cpp/enum/unscoped.carbon +++ b/toolchain/check/testdata/interop/cpp/enum/unscoped.carbon @@ -24,8 +24,8 @@ import Cpp library "enum.h"; //@dump-sem-ir-begin fn F() { - let a: Cpp.Enum = Cpp.Enum.a; - let b: Cpp.Enum = Cpp.b; + let unused a: Cpp.Enum = Cpp.Enum.a; + let unused b: Cpp.Enum = Cpp.b; } //@dump-sem-ir-end @@ -36,23 +36,23 @@ library "[[@TEST_NAME]]"; import Cpp library "enum.h"; fn F() { - // CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+7]]:22: error: cannot implicitly convert expression of type `Cpp.Enum` to `Cpp.Other` [ConversionFailure] - // CHECK:STDERR: let c: Cpp.Other = Cpp.Enum.c; - // CHECK:STDERR: ^~~~~~~~~~ - // CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+4]]:22: note: type `Cpp.Enum` does not implement interface `Core.ImplicitAs(Cpp.Other)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let c: Cpp.Other = Cpp.Enum.c; - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+7]]:29: error: cannot implicitly convert expression of type `Cpp.Enum` to `Cpp.Other` [ConversionFailure] + // CHECK:STDERR: let unused c: Cpp.Other = Cpp.Enum.c; + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+4]]:29: note: type `Cpp.Enum` does not implement interface `Core.ImplicitAs(Cpp.Other)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused c: Cpp.Other = Cpp.Enum.c; + // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: - let c: Cpp.Other = Cpp.Enum.c; + let unused c: Cpp.Other = Cpp.Enum.c; - // CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+7]]:23: error: cannot implicitly convert expression of type `Cpp.Enum` to `Cpp.Other` [ConversionFailure] - // CHECK:STDERR: let c2: Cpp.Other = Cpp.c; - // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+4]]:23: note: type `Cpp.Enum` does not implement interface `Core.ImplicitAs(Cpp.Other)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let c2: Cpp.Other = Cpp.c; - // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+7]]:30: error: cannot implicitly convert expression of type `Cpp.Enum` to `Cpp.Other` [ConversionFailure] + // CHECK:STDERR: let unused c2: Cpp.Other = Cpp.c; + // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+4]]:30: note: type `Cpp.Enum` does not implement interface `Core.ImplicitAs(Cpp.Other)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused c2: Cpp.Other = Cpp.c; + // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - let c2: Cpp.Other = Cpp.c; + let unused c2: Cpp.Other = Cpp.c; } // --- fail_non_enum_member.carbon @@ -62,11 +62,11 @@ library "[[@TEST_NAME]]"; import Cpp library "enum.h"; fn F() { - // CHECK:STDERR: fail_non_enum_member.carbon:[[@LINE+4]]:22: error: member name `d` not found in `Cpp.Enum` [MemberNameNotFoundInInstScope] - // CHECK:STDERR: let c: Cpp.Other = Cpp.Enum.d; - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fail_non_enum_member.carbon:[[@LINE+4]]:29: error: member name `d` not found in `Cpp.Enum` [MemberNameNotFoundInInstScope] + // CHECK:STDERR: let unused c: Cpp.Other = Cpp.Enum.d; + // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: - let c: Cpp.Other = Cpp.Enum.d; + let unused c: Cpp.Other = Cpp.Enum.d; } // CHECK:STDOUT: --- import_enum.carbon @@ -100,21 +100,21 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type = value_binding_pattern a [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc8_21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Enum.ref.loc8_24: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] +// CHECK:STDOUT: %Cpp.ref.loc8_28: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Enum.ref.loc8_31: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] // CHECK:STDOUT: %a.ref: %Enum = name_ref a, imports.%int_0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc8: type = splice_block %Enum.ref.loc8_13 [concrete = constants.%Enum] { -// CHECK:STDOUT: %Cpp.ref.loc8_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Enum.ref.loc8_13: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] +// CHECK:STDOUT: %.loc8: type = splice_block %Enum.ref.loc8_20 [concrete = constants.%Enum] { +// CHECK:STDOUT: %Cpp.ref.loc8_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Enum.ref.loc8_20: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %Enum = value_binding a, %a.ref // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type = value_binding_pattern b [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc9_21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc9_28: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %b.ref: %Enum = name_ref b, imports.%int_1 [concrete = constants.%int_1] // CHECK:STDOUT: %.loc9: type = splice_block %Enum.ref.loc9 [concrete = constants.%Enum] { -// CHECK:STDOUT: %Cpp.ref.loc9_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc9_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Enum.ref.loc9: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum] // CHECK:STDOUT: } // CHECK:STDOUT: %b: %Enum = value_binding b, %b.ref diff --git a/toolchain/check/testdata/interop/cpp/enum/using.carbon b/toolchain/check/testdata/interop/cpp/enum/using.carbon index 701e907da17a..48ea534ef8a8 100644 --- a/toolchain/check/testdata/interop/cpp/enum/using.carbon +++ b/toolchain/check/testdata/interop/cpp/enum/using.carbon @@ -42,10 +42,10 @@ import Cpp library "enum.h"; //@dump-sem-ir-begin fn F() { - let col : Cpp.Color = Cpp.Color.Red; - let colb : Cpp.Color = Cpp.Blue; - let pet : Cpp.Zoo.Animal = Cpp.Zoo.Animal.Cat; - let pet2 : Cpp.Zoo.Animal = Cpp.Dog; + let unused col : Cpp.Color = Cpp.Color.Red; + let unused colb : Cpp.Color = Cpp.Blue; + let unused pet : Cpp.Zoo.Animal = Cpp.Zoo.Animal.Cat; + let unused pet2 : Cpp.Zoo.Animal = Cpp.Dog; } //@dump-sem-ir-end @@ -91,44 +91,44 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %col.patt: %pattern_type.839 = value_binding_pattern col [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc18_25: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Color.ref.loc18_28: type = name_ref Color, imports.%Color.decl [concrete = constants.%Color] +// CHECK:STDOUT: %Cpp.ref.loc18_32: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Color.ref.loc18_35: type = name_ref Color, imports.%Color.decl [concrete = constants.%Color] // CHECK:STDOUT: %Red.ref: %Color = name_ref Red, imports.%int_0.40a [concrete = constants.%int_0.40a] -// CHECK:STDOUT: %.loc18: type = splice_block %Color.ref.loc18_16 [concrete = constants.%Color] { -// CHECK:STDOUT: %Cpp.ref.loc18_13: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Color.ref.loc18_16: type = name_ref Color, imports.%Color.decl [concrete = constants.%Color] +// CHECK:STDOUT: %.loc18: type = splice_block %Color.ref.loc18_23 [concrete = constants.%Color] { +// CHECK:STDOUT: %Cpp.ref.loc18_20: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Color.ref.loc18_23: type = name_ref Color, imports.%Color.decl [concrete = constants.%Color] // CHECK:STDOUT: } // CHECK:STDOUT: %col: %Color = value_binding col, %Red.ref // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %colb.patt: %pattern_type.839 = value_binding_pattern colb [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc19_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc19_33: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Blue.ref: %Color = name_ref Blue, imports.%int_1.a8e [concrete = constants.%int_1.a8e] // CHECK:STDOUT: %.loc19: type = splice_block %Color.ref.loc19 [concrete = constants.%Color] { -// CHECK:STDOUT: %Cpp.ref.loc19_14: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc19_21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Color.ref.loc19: type = name_ref Color, imports.%Color.decl [concrete = constants.%Color] // CHECK:STDOUT: } // CHECK:STDOUT: %colb: %Color = value_binding colb, %Blue.ref // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %pet.patt: %pattern_type.d9d = value_binding_pattern pet [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc20_30: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Zoo.ref.loc20_33: type = name_ref Zoo, imports.%Zoo.decl [concrete = constants.%Zoo] -// CHECK:STDOUT: %Animal.ref.loc20_37: type = name_ref Animal, imports.%Animal.decl [concrete = constants.%Animal] +// CHECK:STDOUT: %Cpp.ref.loc20_37: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Zoo.ref.loc20_40: type = name_ref Zoo, imports.%Zoo.decl [concrete = constants.%Zoo] +// CHECK:STDOUT: %Animal.ref.loc20_44: type = name_ref Animal, imports.%Animal.decl [concrete = constants.%Animal] // CHECK:STDOUT: %Cat.ref: %Animal = name_ref Cat, imports.%int_0.83f [concrete = constants.%int_0.83f] -// CHECK:STDOUT: %.loc20: type = splice_block %Animal.ref.loc20_20 [concrete = constants.%Animal] { -// CHECK:STDOUT: %Cpp.ref.loc20_13: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Zoo.ref.loc20_16: type = name_ref Zoo, imports.%Zoo.decl [concrete = constants.%Zoo] -// CHECK:STDOUT: %Animal.ref.loc20_20: type = name_ref Animal, imports.%Animal.decl [concrete = constants.%Animal] +// CHECK:STDOUT: %.loc20: type = splice_block %Animal.ref.loc20_27 [concrete = constants.%Animal] { +// CHECK:STDOUT: %Cpp.ref.loc20_20: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Zoo.ref.loc20_23: type = name_ref Zoo, imports.%Zoo.decl [concrete = constants.%Zoo] +// CHECK:STDOUT: %Animal.ref.loc20_27: type = name_ref Animal, imports.%Animal.decl [concrete = constants.%Animal] // CHECK:STDOUT: } // CHECK:STDOUT: %pet: %Animal = value_binding pet, %Cat.ref // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %pet2.patt: %pattern_type.d9d = value_binding_pattern pet2 [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc21_31: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc21_38: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Dog.ref: %Animal = name_ref Dog, imports.%int_1.afa [concrete = constants.%int_1.afa] // CHECK:STDOUT: %.loc21: type = splice_block %Animal.ref.loc21 [concrete = constants.%Animal] { -// CHECK:STDOUT: %Cpp.ref.loc21_14: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc21_21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Zoo.ref.loc21: type = name_ref Zoo, imports.%Zoo.decl [concrete = constants.%Zoo] // CHECK:STDOUT: %Animal.ref.loc21: type = name_ref Animal, imports.%Animal.decl [concrete = constants.%Animal] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon b/toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon index 50ef21e116e7..8741c9e49e60 100644 --- a/toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon +++ b/toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon @@ -485,7 +485,7 @@ import Cpp library "bool_return.h"; fn F() { //@dump-sem-ir-begin - let x: bool = Cpp.foo_bool(); + let unused x: bool = Cpp.foo_bool(); //@dump-sem-ir-end } @@ -505,7 +505,7 @@ import Cpp library "short_return.h"; fn F() { //@dump-sem-ir-begin - let x: i16 = Cpp.foo_short(); + let unused x: i16 = Cpp.foo_short(); //@dump-sem-ir-end } @@ -551,7 +551,7 @@ import Cpp library "double_return.h"; fn F() { //@dump-sem-ir-begin - let x: f64 = Cpp.foo_double(); + let unused x: f64 = Cpp.foo_double(); //@dump-sem-ir-end } @@ -2099,20 +2099,20 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo_bool.ref: %foo_bool.cpp_overload_set.type = name_ref foo_bool, imports.%foo_bool.cpp_overload_set.value [concrete = constants.%foo_bool.cpp_overload_set.value] -// CHECK:STDOUT: %.loc8_30.1: ref bool = temporary_storage -// CHECK:STDOUT: %addr: %ptr = addr_of %.loc8_30.1 +// CHECK:STDOUT: %.loc8_37.1: ref bool = temporary_storage +// CHECK:STDOUT: %addr: %ptr = addr_of %.loc8_37.1 // CHECK:STDOUT: %foo_bool__carbon_thunk.call: init %empty_tuple.type = call imports.%foo_bool__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc8_30.2: init bool to %.loc8_30.1 = mark_in_place_init %foo_bool__carbon_thunk.call -// CHECK:STDOUT: %.loc8_10.1: type = splice_block %.loc8_10.3 [concrete = bool] { +// CHECK:STDOUT: %.loc8_37.2: init bool to %.loc8_37.1 = mark_in_place_init %foo_bool__carbon_thunk.call +// CHECK:STDOUT: %.loc8_17.1: type = splice_block %.loc8_17.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc8_10.2: type = value_of_initializer %Bool.call [concrete = bool] -// CHECK:STDOUT: %.loc8_10.3: type = converted %Bool.call, %.loc8_10.2 [concrete = bool] +// CHECK:STDOUT: %.loc8_17.2: type = value_of_initializer %Bool.call [concrete = bool] +// CHECK:STDOUT: %.loc8_17.3: type = converted %Bool.call, %.loc8_17.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_30.3: ref bool = temporary %.loc8_30.1, %.loc8_30.2 -// CHECK:STDOUT: %.loc8_30.4: bool = acquire_value %.loc8_30.3 -// CHECK:STDOUT: %x: bool = value_binding x, %.loc8_30.4 -// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc8_30.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc8_30.3) +// CHECK:STDOUT: %.loc8_37.3: ref bool = temporary %.loc8_37.1, %.loc8_37.2 +// CHECK:STDOUT: %.loc8_37.4: bool = acquire_value %.loc8_37.3 +// CHECK:STDOUT: %x: bool = value_binding x, %.loc8_37.4 +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc8_37.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc8_37.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2154,19 +2154,19 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo_short.ref: %foo_short.cpp_overload_set.type = name_ref foo_short, imports.%foo_short.cpp_overload_set.value [concrete = constants.%foo_short.cpp_overload_set.value] -// CHECK:STDOUT: %.loc8_30.1: ref %i16 = temporary_storage -// CHECK:STDOUT: %addr: %ptr = addr_of %.loc8_30.1 +// CHECK:STDOUT: %.loc8_37.1: ref %i16 = temporary_storage +// CHECK:STDOUT: %addr: %ptr = addr_of %.loc8_37.1 // CHECK:STDOUT: %foo_short__carbon_thunk.call: init %empty_tuple.type = call imports.%foo_short__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc8_30.2: init %i16 to %.loc8_30.1 = mark_in_place_init %foo_short__carbon_thunk.call -// CHECK:STDOUT: %.loc8_10: type = splice_block %i16 [concrete = constants.%i16] { +// CHECK:STDOUT: %.loc8_37.2: init %i16 to %.loc8_37.1 = mark_in_place_init %foo_short__carbon_thunk.call +// CHECK:STDOUT: %.loc8_17: type = splice_block %i16 [concrete = constants.%i16] { // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_30.3: ref %i16 = temporary %.loc8_30.1, %.loc8_30.2 -// CHECK:STDOUT: %.loc8_30.4: %i16 = acquire_value %.loc8_30.3 -// CHECK:STDOUT: %x: %i16 = value_binding x, %.loc8_30.4 -// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc8_30.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc8_30.3) +// CHECK:STDOUT: %.loc8_37.3: ref %i16 = temporary %.loc8_37.1, %.loc8_37.2 +// CHECK:STDOUT: %.loc8_37.4: %i16 = acquire_value %.loc8_37.3 +// CHECK:STDOUT: %x: %i16 = value_binding x, %.loc8_37.4 +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc8_37.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc8_37.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2232,19 +2232,19 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo_double.ref: %foo_double.cpp_overload_set.type = name_ref foo_double, imports.%foo_double.cpp_overload_set.value [concrete = constants.%foo_double.cpp_overload_set.value] -// CHECK:STDOUT: %.loc8_31.1: ref %f64.d77 = temporary_storage -// CHECK:STDOUT: %addr: %ptr = addr_of %.loc8_31.1 +// CHECK:STDOUT: %.loc8_38.1: ref %f64.d77 = temporary_storage +// CHECK:STDOUT: %addr: %ptr = addr_of %.loc8_38.1 // CHECK:STDOUT: %foo_double__carbon_thunk.call: init %empty_tuple.type = call imports.%foo_double__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc8_31.2: init %f64.d77 to %.loc8_31.1 = mark_in_place_init %foo_double__carbon_thunk.call -// CHECK:STDOUT: %.loc8_10: type = splice_block %f64 [concrete = constants.%f64.d77] { +// CHECK:STDOUT: %.loc8_38.2: init %f64.d77 to %.loc8_38.1 = mark_in_place_init %foo_double__carbon_thunk.call +// CHECK:STDOUT: %.loc8_17: type = splice_block %f64 [concrete = constants.%f64.d77] { // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] // CHECK:STDOUT: %f64: type = class_type @Float, @Float(constants.%int_64) [concrete = constants.%f64.d77] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_31.3: ref %f64.d77 = temporary %.loc8_31.1, %.loc8_31.2 -// CHECK:STDOUT: %.loc8_31.4: %f64.d77 = acquire_value %.loc8_31.3 -// CHECK:STDOUT: %x: %f64.d77 = value_binding x, %.loc8_31.4 -// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc8_31.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc8_31.3) +// CHECK:STDOUT: %.loc8_38.3: ref %f64.d77 = temporary %.loc8_38.1, %.loc8_38.2 +// CHECK:STDOUT: %.loc8_38.4: %f64.d77 = acquire_value %.loc8_38.3 +// CHECK:STDOUT: %x: %f64.d77 = value_binding x, %.loc8_38.4 +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc8_38.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc8_38.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/class.carbon b/toolchain/check/testdata/interop/cpp/function/class.carbon index 2271e2e6664d..8c9505fe7473 100644 --- a/toolchain/check/testdata/interop/cpp/function/class.carbon +++ b/toolchain/check/testdata/interop/cpp/function/class.carbon @@ -216,7 +216,7 @@ fn F(c: Cpp.N.C) { //@dump-sem-ir-begin Cpp.foo(c); // Check that the parameter type was imported correctly. - var x: Cpp.N.C; + var unused x: Cpp.N.C; //@dump-sem-ir-end } @@ -265,7 +265,7 @@ import Cpp library "definition_in_outer_definition.h"; fn F(c: Cpp.O.C) { //@dump-sem-ir-begin Cpp.foo(c); - var x: Cpp.O; + var unused x: Cpp.O; //@dump-sem-ir-end } diff --git a/toolchain/check/testdata/interop/cpp/function/default_arg.carbon b/toolchain/check/testdata/interop/cpp/function/default_arg.carbon index 1e75fd153e58..c44f549e443f 100644 --- a/toolchain/check/testdata/interop/cpp/function/default_arg.carbon +++ b/toolchain/check/testdata/interop/cpp/function/default_arg.carbon @@ -31,7 +31,7 @@ import Cpp library "functions.h"; fn Call() { //@dump-sem-ir-begin Cpp.GlobalNoReturn(1, 2, 3, 4); - let value: i32 = Cpp.GlobalReturnInt(1, 2, 3, 4); + let unused value: i32 = Cpp.GlobalReturnInt(1, 2, 3, 4); ({} as Cpp.X).B(1, 2); Cpp.X.C(1, 2); ({} as Cpp.X).D(1, 2); @@ -47,7 +47,7 @@ import Cpp library "functions.h"; fn Call() { // //@dump-sem-ir-begin Cpp.GlobalNoReturn(1, 2); - let value: i32 = Cpp.GlobalReturnInt(1, 2); + let unused value: i32 = Cpp.GlobalReturnInt(1, 2); Cpp.GlobalNoReturn(1, 2, 3); ({} as Cpp.X).B(1); Cpp.X.C(1); @@ -291,42 +291,42 @@ fn Call() { // CHECK:STDOUT: %int_2.loc9: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %int_3.loc9: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %int_4.loc9: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] -// CHECK:STDOUT: %impl.elem0.loc9_40: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc9_40.1: = bound_method %int_1.loc9, %impl.elem0.loc9_40 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] -// CHECK:STDOUT: %specific_fn.loc9_40: = specific_function %impl.elem0.loc9_40, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_40.2: = bound_method %int_1.loc9, %specific_fn.loc9_40 [concrete = constants.%bound_method.38b] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_40: init %i32 = call %bound_method.loc9_40.2(%int_1.loc9) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc9_40.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_40 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc9_40.2: %i32 = converted %int_1.loc9, %.loc9_40.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc9_43: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc9_43.1: = bound_method %int_2.loc9, %impl.elem0.loc9_43 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] -// CHECK:STDOUT: %specific_fn.loc9_43: = specific_function %impl.elem0.loc9_43, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_43.2: = bound_method %int_2.loc9, %specific_fn.loc9_43 [concrete = constants.%bound_method.646] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_43: init %i32 = call %bound_method.loc9_43.2(%int_2.loc9) [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc9_43.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_43 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc9_43.2: %i32 = converted %int_2.loc9, %.loc9_43.1 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %impl.elem0.loc9_46: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc9_46.1: = bound_method %int_3.loc9, %impl.elem0.loc9_46 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] -// CHECK:STDOUT: %specific_fn.loc9_46: = specific_function %impl.elem0.loc9_46, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_46.2: = bound_method %int_3.loc9, %specific_fn.loc9_46 [concrete = constants.%bound_method.fa7] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_46: init %i32 = call %bound_method.loc9_46.2(%int_3.loc9) [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc9_46.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_46 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc9_46.2: %i32 = converted %int_3.loc9, %.loc9_46.1 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %impl.elem0.loc9_49: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc9_49.1: = bound_method %int_4.loc9, %impl.elem0.loc9_49 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c] -// CHECK:STDOUT: %specific_fn.loc9_49: = specific_function %impl.elem0.loc9_49, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_49.2: = bound_method %int_4.loc9, %specific_fn.loc9_49 [concrete = constants.%bound_method.6d7] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_49: init %i32 = call %bound_method.loc9_49.2(%int_4.loc9) [concrete = constants.%int_4.940] -// CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_49 [concrete = constants.%int_4.940] -// CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int_4.loc9, %.loc9_49.1 [concrete = constants.%int_4.940] -// CHECK:STDOUT: %GlobalReturnInt.call: init %i32 = call imports.%GlobalReturnInt.decl(%.loc9_40.2, %.loc9_43.2, %.loc9_46.2, %.loc9_49.2) -// CHECK:STDOUT: %.loc9_14: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %impl.elem0.loc9_47: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc9_47.1: = bound_method %int_1.loc9, %impl.elem0.loc9_47 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] +// CHECK:STDOUT: %specific_fn.loc9_47: = specific_function %impl.elem0.loc9_47, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_47.2: = bound_method %int_1.loc9, %specific_fn.loc9_47 [concrete = constants.%bound_method.38b] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_47: init %i32 = call %bound_method.loc9_47.2(%int_1.loc9) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc9_47.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_47 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc9_47.2: %i32 = converted %int_1.loc9, %.loc9_47.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc9_50: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc9_50.1: = bound_method %int_2.loc9, %impl.elem0.loc9_50 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] +// CHECK:STDOUT: %specific_fn.loc9_50: = specific_function %impl.elem0.loc9_50, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_50.2: = bound_method %int_2.loc9, %specific_fn.loc9_50 [concrete = constants.%bound_method.646] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_50: init %i32 = call %bound_method.loc9_50.2(%int_2.loc9) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc9_50.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_50 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc9_50.2: %i32 = converted %int_2.loc9, %.loc9_50.1 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %impl.elem0.loc9_53: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc9_53.1: = bound_method %int_3.loc9, %impl.elem0.loc9_53 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] +// CHECK:STDOUT: %specific_fn.loc9_53: = specific_function %impl.elem0.loc9_53, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_53.2: = bound_method %int_3.loc9, %specific_fn.loc9_53 [concrete = constants.%bound_method.fa7] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_53: init %i32 = call %bound_method.loc9_53.2(%int_3.loc9) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc9_53.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_53 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc9_53.2: %i32 = converted %int_3.loc9, %.loc9_53.1 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc9_56: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc9_56.1: = bound_method %int_4.loc9, %impl.elem0.loc9_56 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c] +// CHECK:STDOUT: %specific_fn.loc9_56: = specific_function %impl.elem0.loc9_56, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_56.2: = bound_method %int_4.loc9, %specific_fn.loc9_56 [concrete = constants.%bound_method.6d7] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_56: init %i32 = call %bound_method.loc9_56.2(%int_4.loc9) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %.loc9_56.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_56 [concrete = constants.%int_4.940] +// CHECK:STDOUT: %.loc9_56.2: %i32 = converted %int_4.loc9, %.loc9_56.1 [concrete = constants.%int_4.940] +// CHECK:STDOUT: %GlobalReturnInt.call: init %i32 = call imports.%GlobalReturnInt.decl(%.loc9_47.2, %.loc9_50.2, %.loc9_53.2, %.loc9_56.2) +// CHECK:STDOUT: %.loc9_21: type = splice_block %i32 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc9_50.1: %i32 = value_of_initializer %GlobalReturnInt.call -// CHECK:STDOUT: %.loc9_50.2: %i32 = converted %GlobalReturnInt.call, %.loc9_50.1 -// CHECK:STDOUT: %value: %i32 = value_binding value, %.loc9_50.2 +// CHECK:STDOUT: %.loc9_57.1: %i32 = value_of_initializer %GlobalReturnInt.call +// CHECK:STDOUT: %.loc9_57.2: %i32 = converted %GlobalReturnInt.call, %.loc9_57.1 +// CHECK:STDOUT: %value: %i32 = value_binding value, %.loc9_57.2 // CHECK:STDOUT: %.loc10_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %X.ref.loc10: type = name_ref X, imports.%X.decl [concrete = constants.%X] @@ -672,28 +672,28 @@ fn Call() { // CHECK:STDOUT: %GlobalReturnInt.ref: %GlobalReturnInt.cpp_overload_set.type = name_ref GlobalReturnInt, imports.%GlobalReturnInt.cpp_overload_set.value [concrete = constants.%GlobalReturnInt.cpp_overload_set.value] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_2.loc9: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc9_40: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc9_40.1: = bound_method %int_1.loc9, %impl.elem0.loc9_40 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] -// CHECK:STDOUT: %specific_fn.loc9_40: = specific_function %impl.elem0.loc9_40, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_40.2: = bound_method %int_1.loc9, %specific_fn.loc9_40 [concrete = constants.%bound_method.38b] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_40: init %i32 = call %bound_method.loc9_40.2(%int_1.loc9) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc9_40.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_40 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc9_40.2: %i32 = converted %int_1.loc9, %.loc9_40.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc9_43: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc9_43.1: = bound_method %int_2.loc9, %impl.elem0.loc9_43 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] -// CHECK:STDOUT: %specific_fn.loc9_43: = specific_function %impl.elem0.loc9_43, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_43.2: = bound_method %int_2.loc9, %specific_fn.loc9_43 [concrete = constants.%bound_method.646] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_43: init %i32 = call %bound_method.loc9_43.2(%int_2.loc9) [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc9_43.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_43 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc9_43.2: %i32 = converted %int_2.loc9, %.loc9_43.1 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %GlobalReturnInt__carbon_thunk.call: init %i32 = call imports.%GlobalReturnInt__carbon_thunk.decl(%.loc9_40.2, %.loc9_43.2) -// CHECK:STDOUT: %.loc9_14: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %impl.elem0.loc9_47: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc9_47.1: = bound_method %int_1.loc9, %impl.elem0.loc9_47 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] +// CHECK:STDOUT: %specific_fn.loc9_47: = specific_function %impl.elem0.loc9_47, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_47.2: = bound_method %int_1.loc9, %specific_fn.loc9_47 [concrete = constants.%bound_method.38b] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_47: init %i32 = call %bound_method.loc9_47.2(%int_1.loc9) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc9_47.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_47 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc9_47.2: %i32 = converted %int_1.loc9, %.loc9_47.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc9_50: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc9_50.1: = bound_method %int_2.loc9, %impl.elem0.loc9_50 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] +// CHECK:STDOUT: %specific_fn.loc9_50: = specific_function %impl.elem0.loc9_50, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_50.2: = bound_method %int_2.loc9, %specific_fn.loc9_50 [concrete = constants.%bound_method.646] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_50: init %i32 = call %bound_method.loc9_50.2(%int_2.loc9) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc9_50.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_50 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc9_50.2: %i32 = converted %int_2.loc9, %.loc9_50.1 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %GlobalReturnInt__carbon_thunk.call: init %i32 = call imports.%GlobalReturnInt__carbon_thunk.decl(%.loc9_47.2, %.loc9_50.2) +// CHECK:STDOUT: %.loc9_21: type = splice_block %i32 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc9_44.1: %i32 = value_of_initializer %GlobalReturnInt__carbon_thunk.call -// CHECK:STDOUT: %.loc9_44.2: %i32 = converted %GlobalReturnInt__carbon_thunk.call, %.loc9_44.1 -// CHECK:STDOUT: %value: %i32 = value_binding value, %.loc9_44.2 +// CHECK:STDOUT: %.loc9_51.1: %i32 = value_of_initializer %GlobalReturnInt__carbon_thunk.call +// CHECK:STDOUT: %.loc9_51.2: %i32 = converted %GlobalReturnInt__carbon_thunk.call, %.loc9_51.1 +// CHECK:STDOUT: %value: %i32 = value_binding value, %.loc9_51.2 // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %GlobalNoReturn.ref.loc10: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value] // CHECK:STDOUT: %int_1.loc10: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] diff --git a/toolchain/check/testdata/interop/cpp/function/full_semir.carbon b/toolchain/check/testdata/interop/cpp/function/full_semir.carbon index a215408eb43f..fc44067b7257 100644 --- a/toolchain/check/testdata/interop/cpp/function/full_semir.carbon +++ b/toolchain/check/testdata/interop/cpp/function/full_semir.carbon @@ -62,7 +62,7 @@ library "[[@TEST_NAME]]"; import Cpp library "short_return.h"; fn F() { - let x: i16 = Cpp.foo_short(); + let unused x: i16 = Cpp.foo_short(); } // CHECK:STDOUT: --- import_short_param.carbon @@ -361,19 +361,19 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo_short.ref: %foo_short.cpp_overload_set.type = name_ref foo_short, imports.%foo_short.cpp_overload_set.value [concrete = constants.%foo_short.cpp_overload_set.value] -// CHECK:STDOUT: %.loc7_30.1: ref %i16 = temporary_storage -// CHECK:STDOUT: %addr: %ptr = addr_of %.loc7_30.1 +// CHECK:STDOUT: %.loc7_37.1: ref %i16 = temporary_storage +// CHECK:STDOUT: %addr: %ptr = addr_of %.loc7_37.1 // CHECK:STDOUT: %foo_short__carbon_thunk.call: init %empty_tuple.type = call imports.%foo_short__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc7_30.2: init %i16 to %.loc7_30.1 = mark_in_place_init %foo_short__carbon_thunk.call -// CHECK:STDOUT: %.loc7_10: type = splice_block %i16 [concrete = constants.%i16] { +// CHECK:STDOUT: %.loc7_37.2: init %i16 to %.loc7_37.1 = mark_in_place_init %foo_short__carbon_thunk.call +// CHECK:STDOUT: %.loc7_17: type = splice_block %i16 [concrete = constants.%i16] { // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc7_30.3: ref %i16 = temporary %.loc7_30.1, %.loc7_30.2 -// CHECK:STDOUT: %.loc7_30.4: %i16 = acquire_value %.loc7_30.3 -// CHECK:STDOUT: %x: %i16 = value_binding x, %.loc7_30.4 -// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc7_30.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc7_30.3) +// CHECK:STDOUT: %.loc7_37.3: ref %i16 = temporary %.loc7_37.1, %.loc7_37.2 +// CHECK:STDOUT: %.loc7_37.4: %i16 = acquire_value %.loc7_37.3 +// CHECK:STDOUT: %x: %i16 = value_binding x, %.loc7_37.4 +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc7_37.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc7_37.3) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/inline.carbon b/toolchain/check/testdata/interop/cpp/function/inline.carbon index 2b86dca575d7..2d745be13925 100644 --- a/toolchain/check/testdata/interop/cpp/function/inline.carbon +++ b/toolchain/check/testdata/interop/cpp/function/inline.carbon @@ -79,10 +79,10 @@ inline auto ThunkOnBoth(short) -> auto { short x = 0; return x; } fn MyF() { //@dump-sem-ir-begin - let r1: i32 = Cpp.WithoutThunk(1); - let r2: i32 = Cpp.ThunkOnArg(1); - let r3: i16 = Cpp.ThunkOnReturn(1); - let r4: i16 = Cpp.ThunkOnBoth(1); + let unused r1: i32 = Cpp.WithoutThunk(1); + let unused r2: i32 = Cpp.ThunkOnArg(1); + let unused r3: i16 = Cpp.ThunkOnReturn(1); + let unused r4: i16 = Cpp.ThunkOnBoth(1); //@dump-sem-ir-end } @@ -260,49 +260,49 @@ fn MyF() { // CHECK:STDOUT: %WithoutThunk.ref: %WithoutThunk.cpp_overload_set.type = name_ref WithoutThunk, imports.%WithoutThunk.cpp_overload_set.value [concrete = constants.%WithoutThunk.cpp_overload_set.value] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc13: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc13_34.1: = bound_method %int_1.loc13, %impl.elem0.loc13 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] +// CHECK:STDOUT: %bound_method.loc13_41.1: = bound_method %int_1.loc13, %impl.elem0.loc13 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] // CHECK:STDOUT: %specific_fn.loc13: = specific_function %impl.elem0.loc13, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.709] -// CHECK:STDOUT: %bound_method.loc13_34.2: = bound_method %int_1.loc13, %specific_fn.loc13 [concrete = constants.%bound_method.38b] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13: init %i32 = call %bound_method.loc13_34.2(%int_1.loc13) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc13_34.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc13_34.2: %i32 = converted %int_1.loc13, %.loc13_34.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %WithoutThunk.call: init %i32 = call imports.%WithoutThunk.decl(%.loc13_34.2) -// CHECK:STDOUT: %.loc13_11: type = splice_block %i32.loc13 [concrete = constants.%i32] { +// CHECK:STDOUT: %bound_method.loc13_41.2: = bound_method %int_1.loc13, %specific_fn.loc13 [concrete = constants.%bound_method.38b] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13: init %i32 = call %bound_method.loc13_41.2(%int_1.loc13) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc13_41.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc13_41.2: %i32 = converted %int_1.loc13, %.loc13_41.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %WithoutThunk.call: init %i32 = call imports.%WithoutThunk.decl(%.loc13_41.2) +// CHECK:STDOUT: %.loc13_18: type = splice_block %i32.loc13 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13_35.1: %i32 = value_of_initializer %WithoutThunk.call -// CHECK:STDOUT: %.loc13_35.2: %i32 = converted %WithoutThunk.call, %.loc13_35.1 -// CHECK:STDOUT: %r1: %i32 = value_binding r1, %.loc13_35.2 +// CHECK:STDOUT: %.loc13_42.1: %i32 = value_of_initializer %WithoutThunk.call +// CHECK:STDOUT: %.loc13_42.2: %i32 = converted %WithoutThunk.call, %.loc13_42.1 +// CHECK:STDOUT: %r1: %i32 = value_binding r1, %.loc13_42.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %r2.patt: %pattern_type.7ce = value_binding_pattern r2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref.loc14: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ThunkOnArg.ref: %ThunkOnArg.cpp_overload_set.type = name_ref ThunkOnArg, imports.%ThunkOnArg.cpp_overload_set.value [concrete = constants.%ThunkOnArg.cpp_overload_set.value] // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc14_32.1: %.3ce = impl_witness_access constants.%ImplicitAs.impl_witness.882, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.8d9] -// CHECK:STDOUT: %bound_method.loc14_32.1: = bound_method %int_1.loc14, %impl.elem0.loc14_32.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7e8] -// CHECK:STDOUT: %specific_fn.loc14_32.1: = specific_function %impl.elem0.loc14_32.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.a76] -// CHECK:STDOUT: %bound_method.loc14_32.2: = bound_method %int_1.loc14, %specific_fn.loc14_32.1 [concrete = constants.%bound_method.576] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14: init %i16 = call %bound_method.loc14_32.2(%int_1.loc14) [concrete = constants.%int_1.f90] -// CHECK:STDOUT: %.loc14_32.1: %i16 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14 [concrete = constants.%int_1.f90] -// CHECK:STDOUT: %.loc14_32.2: %i16 = converted %int_1.loc14, %.loc14_32.1 [concrete = constants.%int_1.f90] -// CHECK:STDOUT: %.loc14_32.3: ref %i16 = temporary_storage -// CHECK:STDOUT: %impl.elem0.loc14_32.2: %.eb3 = impl_witness_access constants.%Copy.impl_witness.e99, element0 [concrete = constants.%Int.as.Copy.impl.Op.0da] -// CHECK:STDOUT: %bound_method.loc14_32.3: = bound_method %.loc14_32.2, %impl.elem0.loc14_32.2 [concrete = constants.%Int.as.Copy.impl.Op.bound] -// CHECK:STDOUT: %specific_fn.loc14_32.2: = specific_function %impl.elem0.loc14_32.2, @Int.as.Copy.impl.Op(constants.%int_16) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc14_32.4: = bound_method %.loc14_32.2, %specific_fn.loc14_32.2 [concrete = constants.%bound_method.a48] -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc14: init %i16 = call %bound_method.loc14_32.4(%.loc14_32.2) [concrete = constants.%int_1.f90] -// CHECK:STDOUT: %.loc14_32.4: ref %i16 = temporary %.loc14_32.3, %Int.as.Copy.impl.Op.call.loc14 -// CHECK:STDOUT: %addr.loc14: %ptr.251 = addr_of %.loc14_32.4 +// CHECK:STDOUT: %impl.elem0.loc14_39.1: %.3ce = impl_witness_access constants.%ImplicitAs.impl_witness.882, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.8d9] +// CHECK:STDOUT: %bound_method.loc14_39.1: = bound_method %int_1.loc14, %impl.elem0.loc14_39.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7e8] +// CHECK:STDOUT: %specific_fn.loc14_39.1: = specific_function %impl.elem0.loc14_39.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.a76] +// CHECK:STDOUT: %bound_method.loc14_39.2: = bound_method %int_1.loc14, %specific_fn.loc14_39.1 [concrete = constants.%bound_method.576] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14: init %i16 = call %bound_method.loc14_39.2(%int_1.loc14) [concrete = constants.%int_1.f90] +// CHECK:STDOUT: %.loc14_39.1: %i16 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14 [concrete = constants.%int_1.f90] +// CHECK:STDOUT: %.loc14_39.2: %i16 = converted %int_1.loc14, %.loc14_39.1 [concrete = constants.%int_1.f90] +// CHECK:STDOUT: %.loc14_39.3: ref %i16 = temporary_storage +// CHECK:STDOUT: %impl.elem0.loc14_39.2: %.eb3 = impl_witness_access constants.%Copy.impl_witness.e99, element0 [concrete = constants.%Int.as.Copy.impl.Op.0da] +// CHECK:STDOUT: %bound_method.loc14_39.3: = bound_method %.loc14_39.2, %impl.elem0.loc14_39.2 [concrete = constants.%Int.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc14_39.2: = specific_function %impl.elem0.loc14_39.2, @Int.as.Copy.impl.Op(constants.%int_16) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_39.4: = bound_method %.loc14_39.2, %specific_fn.loc14_39.2 [concrete = constants.%bound_method.a48] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc14: init %i16 = call %bound_method.loc14_39.4(%.loc14_39.2) [concrete = constants.%int_1.f90] +// CHECK:STDOUT: %.loc14_39.4: ref %i16 = temporary %.loc14_39.3, %Int.as.Copy.impl.Op.call.loc14 +// CHECK:STDOUT: %addr.loc14: %ptr.251 = addr_of %.loc14_39.4 // CHECK:STDOUT: %ThunkOnArg__carbon_thunk.call: init %i32 = call imports.%ThunkOnArg__carbon_thunk.decl(%addr.loc14) -// CHECK:STDOUT: %.loc14_11: type = splice_block %i32.loc14 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc14_18: type = splice_block %i32.loc14 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc14_33.1: %i32 = value_of_initializer %ThunkOnArg__carbon_thunk.call -// CHECK:STDOUT: %.loc14_33.2: %i32 = converted %ThunkOnArg__carbon_thunk.call, %.loc14_33.1 -// CHECK:STDOUT: %r2: %i32 = value_binding r2, %.loc14_33.2 +// CHECK:STDOUT: %.loc14_40.1: %i32 = value_of_initializer %ThunkOnArg__carbon_thunk.call +// CHECK:STDOUT: %.loc14_40.2: %i32 = converted %ThunkOnArg__carbon_thunk.call, %.loc14_40.1 +// CHECK:STDOUT: %r2: %i32 = value_binding r2, %.loc14_40.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %r3.patt: %pattern_type.2f8 = value_binding_pattern r3 [concrete] // CHECK:STDOUT: } @@ -310,63 +310,63 @@ fn MyF() { // CHECK:STDOUT: %ThunkOnReturn.ref: %ThunkOnReturn.cpp_overload_set.type = name_ref ThunkOnReturn, imports.%ThunkOnReturn.cpp_overload_set.value [concrete = constants.%ThunkOnReturn.cpp_overload_set.value] // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc15: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc15_35.1: = bound_method %int_1.loc15, %impl.elem0.loc15 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] +// CHECK:STDOUT: %bound_method.loc15_42.1: = bound_method %int_1.loc15, %impl.elem0.loc15 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] // CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem0.loc15, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.709] -// CHECK:STDOUT: %bound_method.loc15_35.2: = bound_method %int_1.loc15, %specific_fn.loc15 [concrete = constants.%bound_method.38b] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15: init %i32 = call %bound_method.loc15_35.2(%int_1.loc15) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc15_35.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc15_35.2: %i32 = converted %int_1.loc15, %.loc15_35.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc15_36.1: ref %i16 = temporary_storage -// CHECK:STDOUT: %addr.loc15: %ptr.251 = addr_of %.loc15_36.1 -// CHECK:STDOUT: %ThunkOnReturn__carbon_thunk.call: init %empty_tuple.type = call imports.%ThunkOnReturn__carbon_thunk.decl(%.loc15_35.2, %addr.loc15) -// CHECK:STDOUT: %.loc15_36.2: init %i16 to %.loc15_36.1 = mark_in_place_init %ThunkOnReturn__carbon_thunk.call -// CHECK:STDOUT: %.loc15_11: type = splice_block %i16.loc15 [concrete = constants.%i16] { +// CHECK:STDOUT: %bound_method.loc15_42.2: = bound_method %int_1.loc15, %specific_fn.loc15 [concrete = constants.%bound_method.38b] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15: init %i32 = call %bound_method.loc15_42.2(%int_1.loc15) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc15_42.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc15_42.2: %i32 = converted %int_1.loc15, %.loc15_42.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc15_43.1: ref %i16 = temporary_storage +// CHECK:STDOUT: %addr.loc15: %ptr.251 = addr_of %.loc15_43.1 +// CHECK:STDOUT: %ThunkOnReturn__carbon_thunk.call: init %empty_tuple.type = call imports.%ThunkOnReturn__carbon_thunk.decl(%.loc15_42.2, %addr.loc15) +// CHECK:STDOUT: %.loc15_43.2: init %i16 to %.loc15_43.1 = mark_in_place_init %ThunkOnReturn__carbon_thunk.call +// CHECK:STDOUT: %.loc15_18: type = splice_block %i16.loc15 [concrete = constants.%i16] { // CHECK:STDOUT: %int_16.loc15: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] // CHECK:STDOUT: %i16.loc15: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15_36.3: ref %i16 = temporary %.loc15_36.1, %.loc15_36.2 -// CHECK:STDOUT: %.loc15_36.4: %i16 = acquire_value %.loc15_36.3 -// CHECK:STDOUT: %r3: %i16 = value_binding r3, %.loc15_36.4 +// CHECK:STDOUT: %.loc15_43.3: ref %i16 = temporary %.loc15_43.1, %.loc15_43.2 +// CHECK:STDOUT: %.loc15_43.4: %i16 = acquire_value %.loc15_43.3 +// CHECK:STDOUT: %r3: %i16 = value_binding r3, %.loc15_43.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %r4.patt: %pattern_type.2f8 = value_binding_pattern r4 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref.loc16: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ThunkOnBoth.ref: %ThunkOnBoth.cpp_overload_set.type = name_ref ThunkOnBoth, imports.%ThunkOnBoth.cpp_overload_set.value [concrete = constants.%ThunkOnBoth.cpp_overload_set.value] // CHECK:STDOUT: %int_1.loc16: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc16_33.1: %.3ce = impl_witness_access constants.%ImplicitAs.impl_witness.882, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.8d9] -// CHECK:STDOUT: %bound_method.loc16_33.1: = bound_method %int_1.loc16, %impl.elem0.loc16_33.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7e8] -// CHECK:STDOUT: %specific_fn.loc16_33.1: = specific_function %impl.elem0.loc16_33.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.a76] -// CHECK:STDOUT: %bound_method.loc16_33.2: = bound_method %int_1.loc16, %specific_fn.loc16_33.1 [concrete = constants.%bound_method.576] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16: init %i16 = call %bound_method.loc16_33.2(%int_1.loc16) [concrete = constants.%int_1.f90] -// CHECK:STDOUT: %.loc16_33.1: %i16 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16 [concrete = constants.%int_1.f90] -// CHECK:STDOUT: %.loc16_33.2: %i16 = converted %int_1.loc16, %.loc16_33.1 [concrete = constants.%int_1.f90] -// CHECK:STDOUT: %.loc16_33.3: ref %i16 = temporary_storage -// CHECK:STDOUT: %impl.elem0.loc16_33.2: %.eb3 = impl_witness_access constants.%Copy.impl_witness.e99, element0 [concrete = constants.%Int.as.Copy.impl.Op.0da] -// CHECK:STDOUT: %bound_method.loc16_33.3: = bound_method %.loc16_33.2, %impl.elem0.loc16_33.2 [concrete = constants.%Int.as.Copy.impl.Op.bound] -// CHECK:STDOUT: %specific_fn.loc16_33.2: = specific_function %impl.elem0.loc16_33.2, @Int.as.Copy.impl.Op(constants.%int_16) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc16_33.4: = bound_method %.loc16_33.2, %specific_fn.loc16_33.2 [concrete = constants.%bound_method.a48] -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc16: init %i16 = call %bound_method.loc16_33.4(%.loc16_33.2) [concrete = constants.%int_1.f90] -// CHECK:STDOUT: %.loc16_33.4: ref %i16 = temporary %.loc16_33.3, %Int.as.Copy.impl.Op.call.loc16 -// CHECK:STDOUT: %addr.loc16_34.1: %ptr.251 = addr_of %.loc16_33.4 -// CHECK:STDOUT: %.loc16_34.1: ref %i16 = temporary_storage -// CHECK:STDOUT: %addr.loc16_34.2: %ptr.251 = addr_of %.loc16_34.1 -// CHECK:STDOUT: %ThunkOnBoth__carbon_thunk.call: init %empty_tuple.type = call imports.%ThunkOnBoth__carbon_thunk.decl(%addr.loc16_34.1, %addr.loc16_34.2) -// CHECK:STDOUT: %.loc16_34.2: init %i16 to %.loc16_34.1 = mark_in_place_init %ThunkOnBoth__carbon_thunk.call -// CHECK:STDOUT: %.loc16_11: type = splice_block %i16.loc16 [concrete = constants.%i16] { +// CHECK:STDOUT: %impl.elem0.loc16_40.1: %.3ce = impl_witness_access constants.%ImplicitAs.impl_witness.882, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.8d9] +// CHECK:STDOUT: %bound_method.loc16_40.1: = bound_method %int_1.loc16, %impl.elem0.loc16_40.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7e8] +// CHECK:STDOUT: %specific_fn.loc16_40.1: = specific_function %impl.elem0.loc16_40.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.a76] +// CHECK:STDOUT: %bound_method.loc16_40.2: = bound_method %int_1.loc16, %specific_fn.loc16_40.1 [concrete = constants.%bound_method.576] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16: init %i16 = call %bound_method.loc16_40.2(%int_1.loc16) [concrete = constants.%int_1.f90] +// CHECK:STDOUT: %.loc16_40.1: %i16 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16 [concrete = constants.%int_1.f90] +// CHECK:STDOUT: %.loc16_40.2: %i16 = converted %int_1.loc16, %.loc16_40.1 [concrete = constants.%int_1.f90] +// CHECK:STDOUT: %.loc16_40.3: ref %i16 = temporary_storage +// CHECK:STDOUT: %impl.elem0.loc16_40.2: %.eb3 = impl_witness_access constants.%Copy.impl_witness.e99, element0 [concrete = constants.%Int.as.Copy.impl.Op.0da] +// CHECK:STDOUT: %bound_method.loc16_40.3: = bound_method %.loc16_40.2, %impl.elem0.loc16_40.2 [concrete = constants.%Int.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc16_40.2: = specific_function %impl.elem0.loc16_40.2, @Int.as.Copy.impl.Op(constants.%int_16) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc16_40.4: = bound_method %.loc16_40.2, %specific_fn.loc16_40.2 [concrete = constants.%bound_method.a48] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc16: init %i16 = call %bound_method.loc16_40.4(%.loc16_40.2) [concrete = constants.%int_1.f90] +// CHECK:STDOUT: %.loc16_40.4: ref %i16 = temporary %.loc16_40.3, %Int.as.Copy.impl.Op.call.loc16 +// CHECK:STDOUT: %addr.loc16_41.1: %ptr.251 = addr_of %.loc16_40.4 +// CHECK:STDOUT: %.loc16_41.1: ref %i16 = temporary_storage +// CHECK:STDOUT: %addr.loc16_41.2: %ptr.251 = addr_of %.loc16_41.1 +// CHECK:STDOUT: %ThunkOnBoth__carbon_thunk.call: init %empty_tuple.type = call imports.%ThunkOnBoth__carbon_thunk.decl(%addr.loc16_41.1, %addr.loc16_41.2) +// CHECK:STDOUT: %.loc16_41.2: init %i16 to %.loc16_41.1 = mark_in_place_init %ThunkOnBoth__carbon_thunk.call +// CHECK:STDOUT: %.loc16_18: type = splice_block %i16.loc16 [concrete = constants.%i16] { // CHECK:STDOUT: %int_16.loc16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] // CHECK:STDOUT: %i16.loc16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc16_34.3: ref %i16 = temporary %.loc16_34.1, %.loc16_34.2 -// CHECK:STDOUT: %.loc16_34.4: %i16 = acquire_value %.loc16_34.3 -// CHECK:STDOUT: %r4: %i16 = value_binding r4, %.loc16_34.4 -// CHECK:STDOUT: %DestroyOp.bound.loc16_34: = bound_method %.loc16_34.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc16_34: init %empty_tuple.type = call %DestroyOp.bound.loc16_34(%.loc16_34.3) -// CHECK:STDOUT: %DestroyOp.bound.loc16_33: = bound_method %.loc16_33.4, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc16_33: init %empty_tuple.type = call %DestroyOp.bound.loc16_33(%.loc16_33.4) -// CHECK:STDOUT: %DestroyOp.bound.loc15: = bound_method %.loc15_36.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc15: init %empty_tuple.type = call %DestroyOp.bound.loc15(%.loc15_36.3) -// CHECK:STDOUT: %DestroyOp.bound.loc14: = bound_method %.loc14_32.4, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc14: init %empty_tuple.type = call %DestroyOp.bound.loc14(%.loc14_32.4) +// CHECK:STDOUT: %.loc16_41.3: ref %i16 = temporary %.loc16_41.1, %.loc16_41.2 +// CHECK:STDOUT: %.loc16_41.4: %i16 = acquire_value %.loc16_41.3 +// CHECK:STDOUT: %r4: %i16 = value_binding r4, %.loc16_41.4 +// CHECK:STDOUT: %DestroyOp.bound.loc16_41: = bound_method %.loc16_41.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc16_41: init %empty_tuple.type = call %DestroyOp.bound.loc16_41(%.loc16_41.3) +// CHECK:STDOUT: %DestroyOp.bound.loc16_40: = bound_method %.loc16_40.4, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc16_40: init %empty_tuple.type = call %DestroyOp.bound.loc16_40(%.loc16_40.4) +// CHECK:STDOUT: %DestroyOp.bound.loc15: = bound_method %.loc15_43.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc15: init %empty_tuple.type = call %DestroyOp.bound.loc15(%.loc15_43.3) +// CHECK:STDOUT: %DestroyOp.bound.loc14: = bound_method %.loc14_39.4, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc14: init %empty_tuple.type = call %DestroyOp.bound.loc14(%.loc14_39.4) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/operators.carbon b/toolchain/check/testdata/interop/cpp/function/operators.carbon index 17edf4a154be..2eb0dca28bf5 100644 --- a/toolchain/check/testdata/interop/cpp/function/operators.carbon +++ b/toolchain/check/testdata/interop/cpp/function/operators.carbon @@ -44,10 +44,10 @@ fn F() { --c; // Arithmetic. - let minus: Cpp.C = -c; + let unused minus: Cpp.C = -c; // Bitwise. - let complement: Cpp.C = ^c; + let unused complement: Cpp.C = ^c; //@dump-sem-ir-end } @@ -171,18 +171,18 @@ fn F() { var c2: Cpp.C = Cpp.C.C(); // Arithmetic. - let addition: Cpp.C = c1 + c2; - let subtraction: Cpp.C = c1 - c2; - let multiplication: Cpp.C = c1 * c2; - let division: Cpp.C = c1 / c2; - let modulo: Cpp.C = c1 % c2; + let unused addition: Cpp.C = c1 + c2; + let unused subtraction: Cpp.C = c1 - c2; + let unused multiplication: Cpp.C = c1 * c2; + let unused division: Cpp.C = c1 / c2; + let unused modulo: Cpp.C = c1 % c2; // Bitwise. - let bitwise_and: Cpp.C = c1 & c2; - let bitwise_or: Cpp.C = c1 | c2; - let bitwise_xor: Cpp.C = c1 ^ c2; - let left_shift: Cpp.C = c1 << 3; - let right_shift: Cpp.C = c1 >> 5; + let unused bitwise_and: Cpp.C = c1 & c2; + let unused bitwise_or: Cpp.C = c1 | c2; + let unused bitwise_xor: Cpp.C = c1 ^ c2; + let unused left_shift: Cpp.C = c1 << 3; + let unused right_shift: Cpp.C = c1 >> 5; // Compound assignment, arithmetic. c1 += c2; @@ -199,15 +199,15 @@ fn F() { c1 >>= 5; // Relational. - let equal: bool = c1 == c2; - let not_equal: bool = c1 != c2; - let greater_than: bool = c1 > c2; - let less_than: bool = c1 < c2; - let greater_than_or_equal: bool = c1 >= c2; - let less_than_or_equal: bool = c1 <= c2; + let unused equal: bool = c1 == c2; + let unused not_equal: bool = c1 != c2; + let unused greater_than: bool = c1 > c2; + let unused less_than: bool = c1 < c2; + let unused greater_than_or_equal: bool = c1 >= c2; + let unused less_than_or_equal: bool = c1 <= c2; // Indexing. - let index: i32 = c1[42]; + let unused index: i32 = c1[42]; //@dump-sem-ir-end } @@ -243,7 +243,7 @@ fn F() { let c2: Cpp.C = Cpp.C.C(); let c3: Cpp.C = c1 + c2; let c4: Cpp.C = c1 + c3; - let c5: Cpp.C = c4 + c3; + let unused c5: Cpp.C = c4 + c3; //@dump-sem-ir-end } @@ -256,16 +256,16 @@ import Cpp library "binary_operators.h"; fn F() { let c1: Cpp.C = Cpp.C.C(); // TODO: Include a list of non-viable candidate operators with this diagnostic. - // CHECK:STDERR: fail_call_with_wrong_type.carbon:[[@LINE+4]]:19: error: cannot access member of interface `Core.AddWith(Core.IntLiteral)` in type `Cpp.C` that does not implement that interface [MissingImplInMemberAccess] - // CHECK:STDERR: let c2: Cpp.C = c1 + 5; - // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: fail_call_with_wrong_type.carbon:[[@LINE+4]]:26: error: cannot access member of interface `Core.AddWith(Core.IntLiteral)` in type `Cpp.C` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: let unused c2: Cpp.C = c1 + 5; + // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: - let c2: Cpp.C = c1 + 5; - // CHECK:STDERR: fail_call_with_wrong_type.carbon:[[@LINE+4]]:19: error: cannot access member of interface `Core.AddWith(Cpp.C)` in type `Core.IntLiteral` that does not implement that interface [MissingImplInMemberAccess] - // CHECK:STDERR: let c3: Cpp.C = 6 + c1; - // CHECK:STDERR: ^~~~~~ + let unused c2: Cpp.C = c1 + 5; + // CHECK:STDERR: fail_call_with_wrong_type.carbon:[[@LINE+4]]:26: error: cannot access member of interface `Core.AddWith(Cpp.C)` in type `Core.IntLiteral` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: let unused c3: Cpp.C = 6 + c1; + // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: - let c3: Cpp.C = 6 + c1; + let unused c3: Cpp.C = 6 + c1; } // ============================================================================ @@ -343,24 +343,24 @@ fn F() { var c2: Cpp.C = Cpp.C.C(); // No rewrite. - let greater_than: bool = c1 > c2; + let unused greater_than: bool = c1 > c2; // Rewrite. - // CHECK:STDERR: fail_todo_rewrite_spaceship.carbon:[[@LINE+4]]:25: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo] - // CHECK:STDERR: let less_than: bool = c1 < c2; - // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: fail_todo_rewrite_spaceship.carbon:[[@LINE+4]]:32: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo] + // CHECK:STDERR: let unused less_than: bool = c1 < c2; + // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: - let less_than: bool = c1 < c2; + let unused less_than: bool = c1 < c2; // Rewrite. - // CHECK:STDERR: fail_todo_rewrite_spaceship.carbon:[[@LINE+4]]:37: error: semantics TODO: `Rewriting operator>= using operator<=> is not supported` [SemanticsTodo] - // CHECK:STDERR: let greater_than_or_equal: bool = c1 >= c2; - // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: fail_todo_rewrite_spaceship.carbon:[[@LINE+4]]:44: error: semantics TODO: `Rewriting operator>= using operator<=> is not supported` [SemanticsTodo] + // CHECK:STDERR: let unused greater_than_or_equal: bool = c1 >= c2; + // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: - let greater_than_or_equal: bool = c1 >= c2; + let unused greater_than_or_equal: bool = c1 >= c2; // No rewrite. - let less_than_or_equal: bool = c1 <= c2; + let unused less_than_or_equal: bool = c1 <= c2; //@dump-sem-ir-end } @@ -412,14 +412,14 @@ fn F() { var c2: Cpp.C = Cpp.C.C(); // No rewrite. - let equal: bool = c1 == c2; + let unused equal: bool = c1 == c2; // Rewrite. - // CHECK:STDERR: fail_todo_rewrite_equal.carbon:[[@LINE+4]]:25: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo] - // CHECK:STDERR: let not_equal: bool = c1 != c2; - // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: fail_todo_rewrite_equal.carbon:[[@LINE+4]]:32: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo] + // CHECK:STDERR: let unused not_equal: bool = c1 != c2; + // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: - let not_equal: bool = c1 != c2; + let unused not_equal: bool = c1 != c2; //@dump-sem-ir-end } @@ -443,8 +443,8 @@ import Cpp library "plus_with_int_conversion.h"; fn F() { let c1: Cpp.C = Cpp.C.C(4); - let c2: Cpp.C = c1 + 5; - let c3: Cpp.C = 6 + c1; + let unused c2: Cpp.C = c1 + 5; + let unused c3: Cpp.C = 6 + c1; } // ============================================================================ @@ -489,11 +489,11 @@ import Cpp library "plus_with_string_view_conversion.h"; fn F() { let s1: str = "hello"; let s2: str = "world"; - // CHECK:STDERR: fail_todo_import_plus_with_string_view_conversion.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.AddWith(str)` in type `str` that does not implement that interface [MissingImplInMemberAccess] - // CHECK:STDERR: let c: Cpp.C = s1 + s2; - // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: fail_todo_import_plus_with_string_view_conversion.carbon:[[@LINE+4]]:25: error: cannot access member of interface `Core.AddWith(str)` in type `str` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: let unused c: Cpp.C = s1 + s2; + // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: - let c: Cpp.C = s1 + s2; + let unused c: Cpp.C = s1 + s2; } // ============================================================================ @@ -672,7 +672,7 @@ fn F() { //@dump-sem-ir-begin let c1: Cpp.N.C = Cpp.N.C.C(); let c2: Cpp.N.C = Cpp.N.C.C(); - let c3: Cpp.N.C = c1 + c2; + let unused c3: Cpp.N.C = c1 + c2; //@dump-sem-ir-end } @@ -701,8 +701,8 @@ fn F() { //@dump-sem-ir-begin let c1: Cpp.N1.C1 = Cpp.N1.C1.C1(); let c2: Cpp.N2.C2 = Cpp.N2.C2.C2(); - let c3: Cpp.N2.C2 = c1 + c2; - let c4: Cpp.N2.C2 = c2 - c1; + let unused c3: Cpp.N2.C2 = c1 + c2; + let unused c4: Cpp.N2.C2 = c2 - c1; //@dump-sem-ir-end } @@ -731,11 +731,11 @@ fn F() { //@dump-sem-ir-begin let c1: Cpp.N.C = Cpp.N.C.C(); let c2: Cpp.N.C = Cpp.N.C.C(); - // CHECK:STDERR: fail_todo_import_operands_in_namespace_operator_in_global.carbon:[[@LINE+4]]:21: error: cannot access member of interface `Core.AddWith(Cpp.N.C)` in type `Cpp.N.C` that does not implement that interface [MissingImplInMemberAccess] - // CHECK:STDERR: let c3: Cpp.N.C = c1 + c2; - // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: fail_todo_import_operands_in_namespace_operator_in_global.carbon:[[@LINE+4]]:28: error: cannot access member of interface `Core.AddWith(Cpp.N.C)` in type `Cpp.N.C` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: let unused c3: Cpp.N.C = c1 + c2; + // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: - let c3: Cpp.N.C = c1 + c2; + let unused c3: Cpp.N.C = c1 + c2; //@dump-sem-ir-end } @@ -761,7 +761,7 @@ fn F() { //@dump-sem-ir-begin let c1: Cpp.O.C = Cpp.O.C.C(); let c2: Cpp.O.C = Cpp.O.C.C(); - let c3: Cpp.O.C = c1 + c2; + let unused c3: Cpp.O.C = c1 + c2; //@dump-sem-ir-end } @@ -789,7 +789,7 @@ fn F() { //@dump-sem-ir-begin let c1: Cpp.N.O.C = Cpp.N.O.C.C(); let c2: Cpp.N.O.C = Cpp.N.O.C.C(); - let c3: Cpp.N.O.C = c1 + c2; + let unused c3: Cpp.N.O.C = c1 + c2; //@dump-sem-ir-end } @@ -818,7 +818,7 @@ fn F() { //@dump-sem-ir-begin var c1: Cpp.C = Cpp.C.C(); var c2: Cpp.C = -c1; - var c3: Cpp.C = c1 + c2; + var unused c3: Cpp.C = c1 + c2; //@dump-sem-ir-end } @@ -869,11 +869,11 @@ import Cpp library "not_found.h"; fn F() { let c1: Cpp.C = Cpp.C.C(); let c2: Cpp.C = Cpp.C.C(); - // CHECK:STDERR: fail_import_not_found.carbon:[[@LINE+4]]:19: error: cannot access member of interface `Core.AddWith(Cpp.C)` in type `Cpp.C` that does not implement that interface [MissingImplInMemberAccess] - // CHECK:STDERR: let c3: Cpp.C = c1 + c2; - // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: fail_import_not_found.carbon:[[@LINE+4]]:26: error: cannot access member of interface `Core.AddWith(Cpp.C)` in type `Cpp.C` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: let unused c3: Cpp.C = c1 + c2; + // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: - let c3: Cpp.C = c1 + c2; + let unused c3: Cpp.C = c1 + c2; } // ============================================================================ @@ -894,15 +894,15 @@ library "[[@TEST_NAME]]"; import Cpp library "incomplete.h"; fn F() { - // CHECK:STDERR: fail_import_incomplete_unary.carbon:[[@LINE+8]]:27: error: looking up a C++ operator with incomplete operand type `Cpp.Incomplete` [IncompleteOperandTypeInCppOperatorLookup] - // CHECK:STDERR: let result_unary: i32 = -*Cpp.CreateIncomplete(); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_incomplete_unary.carbon:[[@LINE+8]]:34: error: looking up a C++ operator with incomplete operand type `Cpp.Incomplete` [IncompleteOperandTypeInCppOperatorLookup] + // CHECK:STDERR: let unused result_unary: i32 = -*Cpp.CreateIncomplete(); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_import_incomplete_unary.carbon:[[@LINE-6]]:10: in file included here [InCppInclude] // CHECK:STDERR: ./incomplete.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^ // CHECK:STDERR: - let result_unary: i32 = -*Cpp.CreateIncomplete(); + let unused result_unary: i32 = -*Cpp.CreateIncomplete(); } // --- fail_import_incomplete_binary.carbon @@ -913,15 +913,15 @@ import Cpp library "incomplete.h"; fn F() { var complete: Cpp.Complete = Cpp.Complete.Complete(); - // CHECK:STDERR: fail_import_incomplete_binary.carbon:[[@LINE+8]]:28: error: looking up a C++ operator with incomplete operand type `Cpp.Incomplete` [IncompleteOperandTypeInCppOperatorLookup] - // CHECK:STDERR: let result_binary: i32 = complete + *Cpp.CreateIncomplete(); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_incomplete_binary.carbon:[[@LINE+8]]:35: error: looking up a C++ operator with incomplete operand type `Cpp.Incomplete` [IncompleteOperandTypeInCppOperatorLookup] + // CHECK:STDERR: let unused result_binary: i32 = complete + *Cpp.CreateIncomplete(); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_import_incomplete_binary.carbon:[[@LINE-7]]:10: in file included here [InCppInclude] // CHECK:STDERR: ./incomplete.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^ // CHECK:STDERR: - let result_binary: i32 = complete + *Cpp.CreateIncomplete(); + let unused result_binary: i32 = complete + *Cpp.CreateIncomplete(); } // ============================================================================ @@ -943,14 +943,14 @@ fn CreateIncomplete() -> Incomplete*; fn F() { var complete: Cpp.Complete = Cpp.Complete.Complete(); - // CHECK:STDERR: fail_incomplete_operand_carbon_type.carbon:[[@LINE+7]]:21: error: looking up a C++ operator with incomplete operand type `Incomplete` [IncompleteOperandTypeInCppOperatorLookup] - // CHECK:STDERR: let result: i32 = *CreateIncomplete() + complete; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_incomplete_operand_carbon_type.carbon:[[@LINE+7]]:28: error: looking up a C++ operator with incomplete operand type `Incomplete` [IncompleteOperandTypeInCppOperatorLookup] + // CHECK:STDERR: let unused result: i32 = *CreateIncomplete() + complete; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_incomplete_operand_carbon_type.carbon:[[@LINE-8]]:1: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let result: i32 = *CreateIncomplete() + complete; + let unused result: i32 = *CreateIncomplete() + complete; } // ============================================================================ @@ -1044,7 +1044,7 @@ fn F() { let c1: Cpp.C = Cpp.C.C(); let c2: Cpp.C = Cpp.C.C(); //@dump-sem-ir-begin - let c3: Cpp.C = c1 + c2; + let unused c3: Cpp.C = c1 + c2; //@dump-sem-ir-end } @@ -1133,42 +1133,42 @@ fn F() { // CHECK:STDOUT: %minus.patt: %pattern_type.217 = value_binding_pattern minus [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c.ref.loc15: ref %C = name_ref c, %c -// CHECK:STDOUT: %.loc15_22.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc15_23.1: %C = acquire_value %c.ref.loc15 -// CHECK:STDOUT: %.loc15_23.2: ref %C = value_as_ref %.loc15_23.1 -// CHECK:STDOUT: %addr.loc15_22.1: %ptr.d9e = addr_of %.loc15_23.2 -// CHECK:STDOUT: %addr.loc15_22.2: %ptr.d9e = addr_of %.loc15_22.1 -// CHECK:STDOUT: %operator_Minus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Minus__carbon_thunk.decl(%addr.loc15_22.1, %addr.loc15_22.2) -// CHECK:STDOUT: %.loc15_22.2: init %C to %.loc15_22.1 = mark_in_place_init %operator_Minus__carbon_thunk.call -// CHECK:STDOUT: %.loc15_17: type = splice_block %C.ref.loc15 [concrete = constants.%C] { +// CHECK:STDOUT: %.loc15_29.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc15_30.1: %C = acquire_value %c.ref.loc15 +// CHECK:STDOUT: %.loc15_30.2: ref %C = value_as_ref %.loc15_30.1 +// CHECK:STDOUT: %addr.loc15_29.1: %ptr.d9e = addr_of %.loc15_30.2 +// CHECK:STDOUT: %addr.loc15_29.2: %ptr.d9e = addr_of %.loc15_29.1 +// CHECK:STDOUT: %operator_Minus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Minus__carbon_thunk.decl(%addr.loc15_29.1, %addr.loc15_29.2) +// CHECK:STDOUT: %.loc15_29.2: init %C to %.loc15_29.1 = mark_in_place_init %operator_Minus__carbon_thunk.call +// CHECK:STDOUT: %.loc15_24: type = splice_block %C.ref.loc15 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc15: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc15: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15_22.3: ref %C = temporary %.loc15_22.1, %.loc15_22.2 -// CHECK:STDOUT: %.loc15_22.4: %C = acquire_value %.loc15_22.3 -// CHECK:STDOUT: %minus: %C = value_binding minus, %.loc15_22.4 +// CHECK:STDOUT: %.loc15_29.3: ref %C = temporary %.loc15_29.1, %.loc15_29.2 +// CHECK:STDOUT: %.loc15_29.4: %C = acquire_value %.loc15_29.3 +// CHECK:STDOUT: %minus: %C = value_binding minus, %.loc15_29.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %complement.patt: %pattern_type.217 = value_binding_pattern complement [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c.ref.loc18: ref %C = name_ref c, %c -// CHECK:STDOUT: %.loc18_27.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc18_28.1: %C = acquire_value %c.ref.loc18 -// CHECK:STDOUT: %.loc18_28.2: ref %C = value_as_ref %.loc18_28.1 -// CHECK:STDOUT: %addr.loc18_27.1: %ptr.d9e = addr_of %.loc18_28.2 -// CHECK:STDOUT: %addr.loc18_27.2: %ptr.d9e = addr_of %.loc18_27.1 -// CHECK:STDOUT: %operator_Tilde__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Tilde__carbon_thunk.decl(%addr.loc18_27.1, %addr.loc18_27.2) -// CHECK:STDOUT: %.loc18_27.2: init %C to %.loc18_27.1 = mark_in_place_init %operator_Tilde__carbon_thunk.call -// CHECK:STDOUT: %.loc18_22: type = splice_block %C.ref.loc18 [concrete = constants.%C] { +// CHECK:STDOUT: %.loc18_34.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc18_35.1: %C = acquire_value %c.ref.loc18 +// CHECK:STDOUT: %.loc18_35.2: ref %C = value_as_ref %.loc18_35.1 +// CHECK:STDOUT: %addr.loc18_34.1: %ptr.d9e = addr_of %.loc18_35.2 +// CHECK:STDOUT: %addr.loc18_34.2: %ptr.d9e = addr_of %.loc18_34.1 +// CHECK:STDOUT: %operator_Tilde__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Tilde__carbon_thunk.decl(%addr.loc18_34.1, %addr.loc18_34.2) +// CHECK:STDOUT: %.loc18_34.2: init %C to %.loc18_34.1 = mark_in_place_init %operator_Tilde__carbon_thunk.call +// CHECK:STDOUT: %.loc18_29: type = splice_block %C.ref.loc18 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc18: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc18_27.3: ref %C = temporary %.loc18_27.1, %.loc18_27.2 -// CHECK:STDOUT: %.loc18_27.4: %C = acquire_value %.loc18_27.3 -// CHECK:STDOUT: %complement: %C = value_binding complement, %.loc18_27.4 -// CHECK:STDOUT: %C.cpp_destructor.bound.loc18: = bound_method %.loc18_27.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc18: init %empty_tuple.type = call %C.cpp_destructor.bound.loc18(%.loc18_27.3) -// CHECK:STDOUT: %C.cpp_destructor.bound.loc15: = bound_method %.loc15_22.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc15: init %empty_tuple.type = call %C.cpp_destructor.bound.loc15(%.loc15_22.3) +// CHECK:STDOUT: %.loc18_34.3: ref %C = temporary %.loc18_34.1, %.loc18_34.2 +// CHECK:STDOUT: %.loc18_34.4: %C = acquire_value %.loc18_34.3 +// CHECK:STDOUT: %complement: %C = value_binding complement, %.loc18_34.4 +// CHECK:STDOUT: %C.cpp_destructor.bound.loc18: = bound_method %.loc18_34.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc18: init %empty_tuple.type = call %C.cpp_destructor.bound.loc18(%.loc18_34.3) +// CHECK:STDOUT: %C.cpp_destructor.bound.loc15: = bound_method %.loc15_29.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc15: init %empty_tuple.type = call %C.cpp_destructor.bound.loc15(%.loc15_29.3) // CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %c.var, constants.%C.cpp_destructor // CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%c.var) // CHECK:STDOUT: @@ -1474,229 +1474,229 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc12: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc12: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc12_28.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc12_25.1: %C = acquire_value %c1.ref.loc12 -// CHECK:STDOUT: %.loc12_30.1: %C = acquire_value %c2.ref.loc12 -// CHECK:STDOUT: %.loc12_25.2: ref %C = value_as_ref %.loc12_25.1 -// CHECK:STDOUT: %addr.loc12_28.1: %ptr.d9e = addr_of %.loc12_25.2 -// CHECK:STDOUT: %.loc12_30.2: ref %C = value_as_ref %.loc12_30.1 -// CHECK:STDOUT: %addr.loc12_28.2: %ptr.d9e = addr_of %.loc12_30.2 -// CHECK:STDOUT: %addr.loc12_28.3: %ptr.d9e = addr_of %.loc12_28.1 -// CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc12_28.1, %addr.loc12_28.2, %addr.loc12_28.3) -// CHECK:STDOUT: %.loc12_28.2: init %C to %.loc12_28.1 = mark_in_place_init %operator_Plus__carbon_thunk.call -// CHECK:STDOUT: %.loc12_20: type = splice_block %C.ref.loc12 [concrete = constants.%C] { +// CHECK:STDOUT: %.loc12_35.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc12_32.1: %C = acquire_value %c1.ref.loc12 +// CHECK:STDOUT: %.loc12_37.1: %C = acquire_value %c2.ref.loc12 +// CHECK:STDOUT: %.loc12_32.2: ref %C = value_as_ref %.loc12_32.1 +// CHECK:STDOUT: %addr.loc12_35.1: %ptr.d9e = addr_of %.loc12_32.2 +// CHECK:STDOUT: %.loc12_37.2: ref %C = value_as_ref %.loc12_37.1 +// CHECK:STDOUT: %addr.loc12_35.2: %ptr.d9e = addr_of %.loc12_37.2 +// CHECK:STDOUT: %addr.loc12_35.3: %ptr.d9e = addr_of %.loc12_35.1 +// CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc12_35.1, %addr.loc12_35.2, %addr.loc12_35.3) +// CHECK:STDOUT: %.loc12_35.2: init %C to %.loc12_35.1 = mark_in_place_init %operator_Plus__carbon_thunk.call +// CHECK:STDOUT: %.loc12_27: type = splice_block %C.ref.loc12 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc12: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc12_28.3: ref %C = temporary %.loc12_28.1, %.loc12_28.2 -// CHECK:STDOUT: %.loc12_28.4: %C = acquire_value %.loc12_28.3 -// CHECK:STDOUT: %addition: %C = value_binding addition, %.loc12_28.4 +// CHECK:STDOUT: %.loc12_35.3: ref %C = temporary %.loc12_35.1, %.loc12_35.2 +// CHECK:STDOUT: %.loc12_35.4: %C = acquire_value %.loc12_35.3 +// CHECK:STDOUT: %addition: %C = value_binding addition, %.loc12_35.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %subtraction.patt: %pattern_type.217 = value_binding_pattern subtraction [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc13: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc13: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc13_31.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc13_28.1: %C = acquire_value %c1.ref.loc13 -// CHECK:STDOUT: %.loc13_33.1: %C = acquire_value %c2.ref.loc13 -// CHECK:STDOUT: %.loc13_28.2: ref %C = value_as_ref %.loc13_28.1 -// CHECK:STDOUT: %addr.loc13_31.1: %ptr.d9e = addr_of %.loc13_28.2 -// CHECK:STDOUT: %.loc13_33.2: ref %C = value_as_ref %.loc13_33.1 -// CHECK:STDOUT: %addr.loc13_31.2: %ptr.d9e = addr_of %.loc13_33.2 -// CHECK:STDOUT: %addr.loc13_31.3: %ptr.d9e = addr_of %.loc13_31.1 -// CHECK:STDOUT: %operator_Minus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Minus__carbon_thunk.decl(%addr.loc13_31.1, %addr.loc13_31.2, %addr.loc13_31.3) -// CHECK:STDOUT: %.loc13_31.2: init %C to %.loc13_31.1 = mark_in_place_init %operator_Minus__carbon_thunk.call -// CHECK:STDOUT: %.loc13_23: type = splice_block %C.ref.loc13 [concrete = constants.%C] { +// CHECK:STDOUT: %.loc13_38.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc13_35.1: %C = acquire_value %c1.ref.loc13 +// CHECK:STDOUT: %.loc13_40.1: %C = acquire_value %c2.ref.loc13 +// CHECK:STDOUT: %.loc13_35.2: ref %C = value_as_ref %.loc13_35.1 +// CHECK:STDOUT: %addr.loc13_38.1: %ptr.d9e = addr_of %.loc13_35.2 +// CHECK:STDOUT: %.loc13_40.2: ref %C = value_as_ref %.loc13_40.1 +// CHECK:STDOUT: %addr.loc13_38.2: %ptr.d9e = addr_of %.loc13_40.2 +// CHECK:STDOUT: %addr.loc13_38.3: %ptr.d9e = addr_of %.loc13_38.1 +// CHECK:STDOUT: %operator_Minus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Minus__carbon_thunk.decl(%addr.loc13_38.1, %addr.loc13_38.2, %addr.loc13_38.3) +// CHECK:STDOUT: %.loc13_38.2: init %C to %.loc13_38.1 = mark_in_place_init %operator_Minus__carbon_thunk.call +// CHECK:STDOUT: %.loc13_30: type = splice_block %C.ref.loc13 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc13: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13_31.3: ref %C = temporary %.loc13_31.1, %.loc13_31.2 -// CHECK:STDOUT: %.loc13_31.4: %C = acquire_value %.loc13_31.3 -// CHECK:STDOUT: %subtraction: %C = value_binding subtraction, %.loc13_31.4 +// CHECK:STDOUT: %.loc13_38.3: ref %C = temporary %.loc13_38.1, %.loc13_38.2 +// CHECK:STDOUT: %.loc13_38.4: %C = acquire_value %.loc13_38.3 +// CHECK:STDOUT: %subtraction: %C = value_binding subtraction, %.loc13_38.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %multiplication.patt: %pattern_type.217 = value_binding_pattern multiplication [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc14: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc14: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc14_34.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc14_31.1: %C = acquire_value %c1.ref.loc14 -// CHECK:STDOUT: %.loc14_36.1: %C = acquire_value %c2.ref.loc14 -// CHECK:STDOUT: %.loc14_31.2: ref %C = value_as_ref %.loc14_31.1 -// CHECK:STDOUT: %addr.loc14_34.1: %ptr.d9e = addr_of %.loc14_31.2 -// CHECK:STDOUT: %.loc14_36.2: ref %C = value_as_ref %.loc14_36.1 -// CHECK:STDOUT: %addr.loc14_34.2: %ptr.d9e = addr_of %.loc14_36.2 -// CHECK:STDOUT: %addr.loc14_34.3: %ptr.d9e = addr_of %.loc14_34.1 -// CHECK:STDOUT: %operator_Star__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Star__carbon_thunk.decl(%addr.loc14_34.1, %addr.loc14_34.2, %addr.loc14_34.3) -// CHECK:STDOUT: %.loc14_34.2: init %C to %.loc14_34.1 = mark_in_place_init %operator_Star__carbon_thunk.call -// CHECK:STDOUT: %.loc14_26: type = splice_block %C.ref.loc14 [concrete = constants.%C] { +// CHECK:STDOUT: %.loc14_41.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc14_38.1: %C = acquire_value %c1.ref.loc14 +// CHECK:STDOUT: %.loc14_43.1: %C = acquire_value %c2.ref.loc14 +// CHECK:STDOUT: %.loc14_38.2: ref %C = value_as_ref %.loc14_38.1 +// CHECK:STDOUT: %addr.loc14_41.1: %ptr.d9e = addr_of %.loc14_38.2 +// CHECK:STDOUT: %.loc14_43.2: ref %C = value_as_ref %.loc14_43.1 +// CHECK:STDOUT: %addr.loc14_41.2: %ptr.d9e = addr_of %.loc14_43.2 +// CHECK:STDOUT: %addr.loc14_41.3: %ptr.d9e = addr_of %.loc14_41.1 +// CHECK:STDOUT: %operator_Star__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Star__carbon_thunk.decl(%addr.loc14_41.1, %addr.loc14_41.2, %addr.loc14_41.3) +// CHECK:STDOUT: %.loc14_41.2: init %C to %.loc14_41.1 = mark_in_place_init %operator_Star__carbon_thunk.call +// CHECK:STDOUT: %.loc14_33: type = splice_block %C.ref.loc14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc14: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc14: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc14_34.3: ref %C = temporary %.loc14_34.1, %.loc14_34.2 -// CHECK:STDOUT: %.loc14_34.4: %C = acquire_value %.loc14_34.3 -// CHECK:STDOUT: %multiplication: %C = value_binding multiplication, %.loc14_34.4 +// CHECK:STDOUT: %.loc14_41.3: ref %C = temporary %.loc14_41.1, %.loc14_41.2 +// CHECK:STDOUT: %.loc14_41.4: %C = acquire_value %.loc14_41.3 +// CHECK:STDOUT: %multiplication: %C = value_binding multiplication, %.loc14_41.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %division.patt: %pattern_type.217 = value_binding_pattern division [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc15: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc15: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc15_28.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc15_25.1: %C = acquire_value %c1.ref.loc15 -// CHECK:STDOUT: %.loc15_30.1: %C = acquire_value %c2.ref.loc15 -// CHECK:STDOUT: %.loc15_25.2: ref %C = value_as_ref %.loc15_25.1 -// CHECK:STDOUT: %addr.loc15_28.1: %ptr.d9e = addr_of %.loc15_25.2 -// CHECK:STDOUT: %.loc15_30.2: ref %C = value_as_ref %.loc15_30.1 -// CHECK:STDOUT: %addr.loc15_28.2: %ptr.d9e = addr_of %.loc15_30.2 -// CHECK:STDOUT: %addr.loc15_28.3: %ptr.d9e = addr_of %.loc15_28.1 -// CHECK:STDOUT: %operator_Slash__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Slash__carbon_thunk.decl(%addr.loc15_28.1, %addr.loc15_28.2, %addr.loc15_28.3) -// CHECK:STDOUT: %.loc15_28.2: init %C to %.loc15_28.1 = mark_in_place_init %operator_Slash__carbon_thunk.call -// CHECK:STDOUT: %.loc15_20: type = splice_block %C.ref.loc15 [concrete = constants.%C] { +// CHECK:STDOUT: %.loc15_35.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc15_32.1: %C = acquire_value %c1.ref.loc15 +// CHECK:STDOUT: %.loc15_37.1: %C = acquire_value %c2.ref.loc15 +// CHECK:STDOUT: %.loc15_32.2: ref %C = value_as_ref %.loc15_32.1 +// CHECK:STDOUT: %addr.loc15_35.1: %ptr.d9e = addr_of %.loc15_32.2 +// CHECK:STDOUT: %.loc15_37.2: ref %C = value_as_ref %.loc15_37.1 +// CHECK:STDOUT: %addr.loc15_35.2: %ptr.d9e = addr_of %.loc15_37.2 +// CHECK:STDOUT: %addr.loc15_35.3: %ptr.d9e = addr_of %.loc15_35.1 +// CHECK:STDOUT: %operator_Slash__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Slash__carbon_thunk.decl(%addr.loc15_35.1, %addr.loc15_35.2, %addr.loc15_35.3) +// CHECK:STDOUT: %.loc15_35.2: init %C to %.loc15_35.1 = mark_in_place_init %operator_Slash__carbon_thunk.call +// CHECK:STDOUT: %.loc15_27: type = splice_block %C.ref.loc15 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc15: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc15: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15_28.3: ref %C = temporary %.loc15_28.1, %.loc15_28.2 -// CHECK:STDOUT: %.loc15_28.4: %C = acquire_value %.loc15_28.3 -// CHECK:STDOUT: %division: %C = value_binding division, %.loc15_28.4 +// CHECK:STDOUT: %.loc15_35.3: ref %C = temporary %.loc15_35.1, %.loc15_35.2 +// CHECK:STDOUT: %.loc15_35.4: %C = acquire_value %.loc15_35.3 +// CHECK:STDOUT: %division: %C = value_binding division, %.loc15_35.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %modulo.patt: %pattern_type.217 = value_binding_pattern modulo [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc16: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc16: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc16_26.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc16_23.1: %C = acquire_value %c1.ref.loc16 -// CHECK:STDOUT: %.loc16_28.1: %C = acquire_value %c2.ref.loc16 -// CHECK:STDOUT: %.loc16_23.2: ref %C = value_as_ref %.loc16_23.1 -// CHECK:STDOUT: %addr.loc16_26.1: %ptr.d9e = addr_of %.loc16_23.2 -// CHECK:STDOUT: %.loc16_28.2: ref %C = value_as_ref %.loc16_28.1 -// CHECK:STDOUT: %addr.loc16_26.2: %ptr.d9e = addr_of %.loc16_28.2 -// CHECK:STDOUT: %addr.loc16_26.3: %ptr.d9e = addr_of %.loc16_26.1 -// CHECK:STDOUT: %operator_Percent__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Percent__carbon_thunk.decl(%addr.loc16_26.1, %addr.loc16_26.2, %addr.loc16_26.3) -// CHECK:STDOUT: %.loc16_26.2: init %C to %.loc16_26.1 = mark_in_place_init %operator_Percent__carbon_thunk.call -// CHECK:STDOUT: %.loc16_18: type = splice_block %C.ref.loc16 [concrete = constants.%C] { +// CHECK:STDOUT: %.loc16_33.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc16_30.1: %C = acquire_value %c1.ref.loc16 +// CHECK:STDOUT: %.loc16_35.1: %C = acquire_value %c2.ref.loc16 +// CHECK:STDOUT: %.loc16_30.2: ref %C = value_as_ref %.loc16_30.1 +// CHECK:STDOUT: %addr.loc16_33.1: %ptr.d9e = addr_of %.loc16_30.2 +// CHECK:STDOUT: %.loc16_35.2: ref %C = value_as_ref %.loc16_35.1 +// CHECK:STDOUT: %addr.loc16_33.2: %ptr.d9e = addr_of %.loc16_35.2 +// CHECK:STDOUT: %addr.loc16_33.3: %ptr.d9e = addr_of %.loc16_33.1 +// CHECK:STDOUT: %operator_Percent__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Percent__carbon_thunk.decl(%addr.loc16_33.1, %addr.loc16_33.2, %addr.loc16_33.3) +// CHECK:STDOUT: %.loc16_33.2: init %C to %.loc16_33.1 = mark_in_place_init %operator_Percent__carbon_thunk.call +// CHECK:STDOUT: %.loc16_25: type = splice_block %C.ref.loc16 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc16: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc16: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc16_26.3: ref %C = temporary %.loc16_26.1, %.loc16_26.2 -// CHECK:STDOUT: %.loc16_26.4: %C = acquire_value %.loc16_26.3 -// CHECK:STDOUT: %modulo: %C = value_binding modulo, %.loc16_26.4 +// CHECK:STDOUT: %.loc16_33.3: ref %C = temporary %.loc16_33.1, %.loc16_33.2 +// CHECK:STDOUT: %.loc16_33.4: %C = acquire_value %.loc16_33.3 +// CHECK:STDOUT: %modulo: %C = value_binding modulo, %.loc16_33.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %bitwise_and.patt: %pattern_type.217 = value_binding_pattern bitwise_and [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc19: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc19: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc19_31.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc19_28.1: %C = acquire_value %c1.ref.loc19 -// CHECK:STDOUT: %.loc19_33.1: %C = acquire_value %c2.ref.loc19 -// CHECK:STDOUT: %.loc19_28.2: ref %C = value_as_ref %.loc19_28.1 -// CHECK:STDOUT: %addr.loc19_31.1: %ptr.d9e = addr_of %.loc19_28.2 -// CHECK:STDOUT: %.loc19_33.2: ref %C = value_as_ref %.loc19_33.1 -// CHECK:STDOUT: %addr.loc19_31.2: %ptr.d9e = addr_of %.loc19_33.2 -// CHECK:STDOUT: %addr.loc19_31.3: %ptr.d9e = addr_of %.loc19_31.1 -// CHECK:STDOUT: %operator_Amp__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Amp__carbon_thunk.decl(%addr.loc19_31.1, %addr.loc19_31.2, %addr.loc19_31.3) -// CHECK:STDOUT: %.loc19_31.2: init %C to %.loc19_31.1 = mark_in_place_init %operator_Amp__carbon_thunk.call -// CHECK:STDOUT: %.loc19_23: type = splice_block %C.ref.loc19 [concrete = constants.%C] { +// CHECK:STDOUT: %.loc19_38.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc19_35.1: %C = acquire_value %c1.ref.loc19 +// CHECK:STDOUT: %.loc19_40.1: %C = acquire_value %c2.ref.loc19 +// CHECK:STDOUT: %.loc19_35.2: ref %C = value_as_ref %.loc19_35.1 +// CHECK:STDOUT: %addr.loc19_38.1: %ptr.d9e = addr_of %.loc19_35.2 +// CHECK:STDOUT: %.loc19_40.2: ref %C = value_as_ref %.loc19_40.1 +// CHECK:STDOUT: %addr.loc19_38.2: %ptr.d9e = addr_of %.loc19_40.2 +// CHECK:STDOUT: %addr.loc19_38.3: %ptr.d9e = addr_of %.loc19_38.1 +// CHECK:STDOUT: %operator_Amp__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Amp__carbon_thunk.decl(%addr.loc19_38.1, %addr.loc19_38.2, %addr.loc19_38.3) +// CHECK:STDOUT: %.loc19_38.2: init %C to %.loc19_38.1 = mark_in_place_init %operator_Amp__carbon_thunk.call +// CHECK:STDOUT: %.loc19_30: type = splice_block %C.ref.loc19 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc19: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19_31.3: ref %C = temporary %.loc19_31.1, %.loc19_31.2 -// CHECK:STDOUT: %.loc19_31.4: %C = acquire_value %.loc19_31.3 -// CHECK:STDOUT: %bitwise_and: %C = value_binding bitwise_and, %.loc19_31.4 +// CHECK:STDOUT: %.loc19_38.3: ref %C = temporary %.loc19_38.1, %.loc19_38.2 +// CHECK:STDOUT: %.loc19_38.4: %C = acquire_value %.loc19_38.3 +// CHECK:STDOUT: %bitwise_and: %C = value_binding bitwise_and, %.loc19_38.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %bitwise_or.patt: %pattern_type.217 = value_binding_pattern bitwise_or [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc20: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc20: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc20_30.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc20_27.1: %C = acquire_value %c1.ref.loc20 -// CHECK:STDOUT: %.loc20_32.1: %C = acquire_value %c2.ref.loc20 -// CHECK:STDOUT: %.loc20_27.2: ref %C = value_as_ref %.loc20_27.1 -// CHECK:STDOUT: %addr.loc20_30.1: %ptr.d9e = addr_of %.loc20_27.2 -// CHECK:STDOUT: %.loc20_32.2: ref %C = value_as_ref %.loc20_32.1 -// CHECK:STDOUT: %addr.loc20_30.2: %ptr.d9e = addr_of %.loc20_32.2 -// CHECK:STDOUT: %addr.loc20_30.3: %ptr.d9e = addr_of %.loc20_30.1 -// CHECK:STDOUT: %operator_Pipe__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Pipe__carbon_thunk.decl(%addr.loc20_30.1, %addr.loc20_30.2, %addr.loc20_30.3) -// CHECK:STDOUT: %.loc20_30.2: init %C to %.loc20_30.1 = mark_in_place_init %operator_Pipe__carbon_thunk.call -// CHECK:STDOUT: %.loc20_22: type = splice_block %C.ref.loc20 [concrete = constants.%C] { +// CHECK:STDOUT: %.loc20_37.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc20_34.1: %C = acquire_value %c1.ref.loc20 +// CHECK:STDOUT: %.loc20_39.1: %C = acquire_value %c2.ref.loc20 +// CHECK:STDOUT: %.loc20_34.2: ref %C = value_as_ref %.loc20_34.1 +// CHECK:STDOUT: %addr.loc20_37.1: %ptr.d9e = addr_of %.loc20_34.2 +// CHECK:STDOUT: %.loc20_39.2: ref %C = value_as_ref %.loc20_39.1 +// CHECK:STDOUT: %addr.loc20_37.2: %ptr.d9e = addr_of %.loc20_39.2 +// CHECK:STDOUT: %addr.loc20_37.3: %ptr.d9e = addr_of %.loc20_37.1 +// CHECK:STDOUT: %operator_Pipe__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Pipe__carbon_thunk.decl(%addr.loc20_37.1, %addr.loc20_37.2, %addr.loc20_37.3) +// CHECK:STDOUT: %.loc20_37.2: init %C to %.loc20_37.1 = mark_in_place_init %operator_Pipe__carbon_thunk.call +// CHECK:STDOUT: %.loc20_29: type = splice_block %C.ref.loc20 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc20: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc20: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc20_30.3: ref %C = temporary %.loc20_30.1, %.loc20_30.2 -// CHECK:STDOUT: %.loc20_30.4: %C = acquire_value %.loc20_30.3 -// CHECK:STDOUT: %bitwise_or: %C = value_binding bitwise_or, %.loc20_30.4 +// CHECK:STDOUT: %.loc20_37.3: ref %C = temporary %.loc20_37.1, %.loc20_37.2 +// CHECK:STDOUT: %.loc20_37.4: %C = acquire_value %.loc20_37.3 +// CHECK:STDOUT: %bitwise_or: %C = value_binding bitwise_or, %.loc20_37.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %bitwise_xor.patt: %pattern_type.217 = value_binding_pattern bitwise_xor [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc21: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc21: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc21_31.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc21_28.1: %C = acquire_value %c1.ref.loc21 -// CHECK:STDOUT: %.loc21_33.1: %C = acquire_value %c2.ref.loc21 -// CHECK:STDOUT: %.loc21_28.2: ref %C = value_as_ref %.loc21_28.1 -// CHECK:STDOUT: %addr.loc21_31.1: %ptr.d9e = addr_of %.loc21_28.2 -// CHECK:STDOUT: %.loc21_33.2: ref %C = value_as_ref %.loc21_33.1 -// CHECK:STDOUT: %addr.loc21_31.2: %ptr.d9e = addr_of %.loc21_33.2 -// CHECK:STDOUT: %addr.loc21_31.3: %ptr.d9e = addr_of %.loc21_31.1 -// CHECK:STDOUT: %operator_Caret__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Caret__carbon_thunk.decl(%addr.loc21_31.1, %addr.loc21_31.2, %addr.loc21_31.3) -// CHECK:STDOUT: %.loc21_31.2: init %C to %.loc21_31.1 = mark_in_place_init %operator_Caret__carbon_thunk.call -// CHECK:STDOUT: %.loc21_23: type = splice_block %C.ref.loc21 [concrete = constants.%C] { +// CHECK:STDOUT: %.loc21_38.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc21_35.1: %C = acquire_value %c1.ref.loc21 +// CHECK:STDOUT: %.loc21_40.1: %C = acquire_value %c2.ref.loc21 +// CHECK:STDOUT: %.loc21_35.2: ref %C = value_as_ref %.loc21_35.1 +// CHECK:STDOUT: %addr.loc21_38.1: %ptr.d9e = addr_of %.loc21_35.2 +// CHECK:STDOUT: %.loc21_40.2: ref %C = value_as_ref %.loc21_40.1 +// CHECK:STDOUT: %addr.loc21_38.2: %ptr.d9e = addr_of %.loc21_40.2 +// CHECK:STDOUT: %addr.loc21_38.3: %ptr.d9e = addr_of %.loc21_38.1 +// CHECK:STDOUT: %operator_Caret__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Caret__carbon_thunk.decl(%addr.loc21_38.1, %addr.loc21_38.2, %addr.loc21_38.3) +// CHECK:STDOUT: %.loc21_38.2: init %C to %.loc21_38.1 = mark_in_place_init %operator_Caret__carbon_thunk.call +// CHECK:STDOUT: %.loc21_30: type = splice_block %C.ref.loc21 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc21: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc21_31.3: ref %C = temporary %.loc21_31.1, %.loc21_31.2 -// CHECK:STDOUT: %.loc21_31.4: %C = acquire_value %.loc21_31.3 -// CHECK:STDOUT: %bitwise_xor: %C = value_binding bitwise_xor, %.loc21_31.4 +// CHECK:STDOUT: %.loc21_38.3: ref %C = temporary %.loc21_38.1, %.loc21_38.2 +// CHECK:STDOUT: %.loc21_38.4: %C = acquire_value %.loc21_38.3 +// CHECK:STDOUT: %bitwise_xor: %C = value_binding bitwise_xor, %.loc21_38.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %left_shift.patt: %pattern_type.217 = value_binding_pattern left_shift [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc22: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %int_3.loc22: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] -// CHECK:STDOUT: %.loc22_30.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc22_27.1: %C = acquire_value %c1.ref.loc22 +// CHECK:STDOUT: %.loc22_37.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc22_34.1: %C = acquire_value %c1.ref.loc22 // CHECK:STDOUT: %impl.elem0.loc22: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc22_33.1: = bound_method %int_3.loc22, %impl.elem0.loc22 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] +// CHECK:STDOUT: %bound_method.loc22_40.1: = bound_method %int_3.loc22, %impl.elem0.loc22 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] // CHECK:STDOUT: %specific_fn.loc22: = specific_function %impl.elem0.loc22, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc22_33.2: = bound_method %int_3.loc22, %specific_fn.loc22 [concrete = constants.%bound_method.fa7] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22: init %i32 = call %bound_method.loc22_33.2(%int_3.loc22) [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc22_33.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc22_33.2: %i32 = converted %int_3.loc22, %.loc22_33.1 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc22_27.2: ref %C = value_as_ref %.loc22_27.1 -// CHECK:STDOUT: %addr.loc22_30.1: %ptr.d9e = addr_of %.loc22_27.2 -// CHECK:STDOUT: %addr.loc22_30.2: %ptr.d9e = addr_of %.loc22_30.1 -// CHECK:STDOUT: %operator_LessLess__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_LessLess__carbon_thunk.decl(%addr.loc22_30.1, %.loc22_33.2, %addr.loc22_30.2) -// CHECK:STDOUT: %.loc22_30.2: init %C to %.loc22_30.1 = mark_in_place_init %operator_LessLess__carbon_thunk.call -// CHECK:STDOUT: %.loc22_22: type = splice_block %C.ref.loc22 [concrete = constants.%C] { +// CHECK:STDOUT: %bound_method.loc22_40.2: = bound_method %int_3.loc22, %specific_fn.loc22 [concrete = constants.%bound_method.fa7] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22: init %i32 = call %bound_method.loc22_40.2(%int_3.loc22) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc22_40.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc22_40.2: %i32 = converted %int_3.loc22, %.loc22_40.1 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc22_34.2: ref %C = value_as_ref %.loc22_34.1 +// CHECK:STDOUT: %addr.loc22_37.1: %ptr.d9e = addr_of %.loc22_34.2 +// CHECK:STDOUT: %addr.loc22_37.2: %ptr.d9e = addr_of %.loc22_37.1 +// CHECK:STDOUT: %operator_LessLess__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_LessLess__carbon_thunk.decl(%addr.loc22_37.1, %.loc22_40.2, %addr.loc22_37.2) +// CHECK:STDOUT: %.loc22_37.2: init %C to %.loc22_37.1 = mark_in_place_init %operator_LessLess__carbon_thunk.call +// CHECK:STDOUT: %.loc22_29: type = splice_block %C.ref.loc22 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc22: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22_30.3: ref %C = temporary %.loc22_30.1, %.loc22_30.2 -// CHECK:STDOUT: %.loc22_30.4: %C = acquire_value %.loc22_30.3 -// CHECK:STDOUT: %left_shift: %C = value_binding left_shift, %.loc22_30.4 +// CHECK:STDOUT: %.loc22_37.3: ref %C = temporary %.loc22_37.1, %.loc22_37.2 +// CHECK:STDOUT: %.loc22_37.4: %C = acquire_value %.loc22_37.3 +// CHECK:STDOUT: %left_shift: %C = value_binding left_shift, %.loc22_37.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %right_shift.patt: %pattern_type.217 = value_binding_pattern right_shift [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc23: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %int_5.loc23: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b] -// CHECK:STDOUT: %.loc23_31.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc23_28.1: %C = acquire_value %c1.ref.loc23 +// CHECK:STDOUT: %.loc23_38.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc23_35.1: %C = acquire_value %c1.ref.loc23 // CHECK:STDOUT: %impl.elem0.loc23: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc23_34.1: = bound_method %int_5.loc23, %impl.elem0.loc23 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.005] +// CHECK:STDOUT: %bound_method.loc23_41.1: = bound_method %int_5.loc23, %impl.elem0.loc23 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.005] // CHECK:STDOUT: %specific_fn.loc23: = specific_function %impl.elem0.loc23, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc23_34.2: = bound_method %int_5.loc23, %specific_fn.loc23 [concrete = constants.%bound_method.e9d] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23: init %i32 = call %bound_method.loc23_34.2(%int_5.loc23) [concrete = constants.%int_5.0f6] -// CHECK:STDOUT: %.loc23_34.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23 [concrete = constants.%int_5.0f6] -// CHECK:STDOUT: %.loc23_34.2: %i32 = converted %int_5.loc23, %.loc23_34.1 [concrete = constants.%int_5.0f6] -// CHECK:STDOUT: %.loc23_28.2: ref %C = value_as_ref %.loc23_28.1 -// CHECK:STDOUT: %addr.loc23_31.1: %ptr.d9e = addr_of %.loc23_28.2 -// CHECK:STDOUT: %addr.loc23_31.2: %ptr.d9e = addr_of %.loc23_31.1 -// CHECK:STDOUT: %operator_GreaterGreater__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_GreaterGreater__carbon_thunk.decl(%addr.loc23_31.1, %.loc23_34.2, %addr.loc23_31.2) -// CHECK:STDOUT: %.loc23_31.2: init %C to %.loc23_31.1 = mark_in_place_init %operator_GreaterGreater__carbon_thunk.call -// CHECK:STDOUT: %.loc23_23: type = splice_block %C.ref.loc23 [concrete = constants.%C] { +// CHECK:STDOUT: %bound_method.loc23_41.2: = bound_method %int_5.loc23, %specific_fn.loc23 [concrete = constants.%bound_method.e9d] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23: init %i32 = call %bound_method.loc23_41.2(%int_5.loc23) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %.loc23_41.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23 [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %.loc23_41.2: %i32 = converted %int_5.loc23, %.loc23_41.1 [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %.loc23_35.2: ref %C = value_as_ref %.loc23_35.1 +// CHECK:STDOUT: %addr.loc23_38.1: %ptr.d9e = addr_of %.loc23_35.2 +// CHECK:STDOUT: %addr.loc23_38.2: %ptr.d9e = addr_of %.loc23_38.1 +// CHECK:STDOUT: %operator_GreaterGreater__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_GreaterGreater__carbon_thunk.decl(%addr.loc23_38.1, %.loc23_41.2, %addr.loc23_38.2) +// CHECK:STDOUT: %.loc23_38.2: init %C to %.loc23_38.1 = mark_in_place_init %operator_GreaterGreater__carbon_thunk.call +// CHECK:STDOUT: %.loc23_30: type = splice_block %C.ref.loc23 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc23: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc23: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc23_31.3: ref %C = temporary %.loc23_31.1, %.loc23_31.2 -// CHECK:STDOUT: %.loc23_31.4: %C = acquire_value %.loc23_31.3 -// CHECK:STDOUT: %right_shift: %C = value_binding right_shift, %.loc23_31.4 +// CHECK:STDOUT: %.loc23_38.3: ref %C = temporary %.loc23_38.1, %.loc23_38.2 +// CHECK:STDOUT: %.loc23_38.4: %C = acquire_value %.loc23_38.3 +// CHECK:STDOUT: %right_shift: %C = value_binding right_shift, %.loc23_38.4 // CHECK:STDOUT: %c1.ref.loc26: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc26: ref %C = name_ref c2, %c2 // CHECK:STDOUT: %.loc26_9.1: %C = acquire_value %c2.ref.loc26 @@ -1770,139 +1770,139 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc40: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc40: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc40_21.1: %C = acquire_value %c1.ref.loc40 -// CHECK:STDOUT: %.loc40_27.1: %C = acquire_value %c2.ref.loc40 -// CHECK:STDOUT: %.loc40_21.2: ref %C = value_as_ref %.loc40_21.1 -// CHECK:STDOUT: %addr.loc40_24.1: %ptr.d9e = addr_of %.loc40_21.2 -// CHECK:STDOUT: %.loc40_27.2: ref %C = value_as_ref %.loc40_27.1 -// CHECK:STDOUT: %addr.loc40_24.2: %ptr.d9e = addr_of %.loc40_27.2 -// CHECK:STDOUT: %.loc40_24.1: ref bool = temporary_storage -// CHECK:STDOUT: %addr.loc40_24.3: %ptr.bb2 = addr_of %.loc40_24.1 -// CHECK:STDOUT: %operator_EqualEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_EqualEqual__carbon_thunk.decl(%addr.loc40_24.1, %addr.loc40_24.2, %addr.loc40_24.3) -// CHECK:STDOUT: %.loc40_24.2: init bool to %.loc40_24.1 = mark_in_place_init %operator_EqualEqual__carbon_thunk.call -// CHECK:STDOUT: %.loc40_14.1: type = splice_block %.loc40_14.3 [concrete = bool] { +// CHECK:STDOUT: %.loc40_28.1: %C = acquire_value %c1.ref.loc40 +// CHECK:STDOUT: %.loc40_34.1: %C = acquire_value %c2.ref.loc40 +// CHECK:STDOUT: %.loc40_28.2: ref %C = value_as_ref %.loc40_28.1 +// CHECK:STDOUT: %addr.loc40_31.1: %ptr.d9e = addr_of %.loc40_28.2 +// CHECK:STDOUT: %.loc40_34.2: ref %C = value_as_ref %.loc40_34.1 +// CHECK:STDOUT: %addr.loc40_31.2: %ptr.d9e = addr_of %.loc40_34.2 +// CHECK:STDOUT: %.loc40_31.1: ref bool = temporary_storage +// CHECK:STDOUT: %addr.loc40_31.3: %ptr.bb2 = addr_of %.loc40_31.1 +// CHECK:STDOUT: %operator_EqualEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_EqualEqual__carbon_thunk.decl(%addr.loc40_31.1, %addr.loc40_31.2, %addr.loc40_31.3) +// CHECK:STDOUT: %.loc40_31.2: init bool to %.loc40_31.1 = mark_in_place_init %operator_EqualEqual__carbon_thunk.call +// CHECK:STDOUT: %.loc40_21.1: type = splice_block %.loc40_21.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc40: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc40_14.2: type = value_of_initializer %Bool.call.loc40 [concrete = bool] -// CHECK:STDOUT: %.loc40_14.3: type = converted %Bool.call.loc40, %.loc40_14.2 [concrete = bool] +// CHECK:STDOUT: %.loc40_21.2: type = value_of_initializer %Bool.call.loc40 [concrete = bool] +// CHECK:STDOUT: %.loc40_21.3: type = converted %Bool.call.loc40, %.loc40_21.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc40_24.3: ref bool = temporary %.loc40_24.1, %.loc40_24.2 -// CHECK:STDOUT: %.loc40_24.4: bool = acquire_value %.loc40_24.3 -// CHECK:STDOUT: %equal: bool = value_binding equal, %.loc40_24.4 +// CHECK:STDOUT: %.loc40_31.3: ref bool = temporary %.loc40_31.1, %.loc40_31.2 +// CHECK:STDOUT: %.loc40_31.4: bool = acquire_value %.loc40_31.3 +// CHECK:STDOUT: %equal: bool = value_binding equal, %.loc40_31.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %not_equal.patt: %pattern_type.831 = value_binding_pattern not_equal [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc41: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc41: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc41_25.1: %C = acquire_value %c1.ref.loc41 -// CHECK:STDOUT: %.loc41_31.1: %C = acquire_value %c2.ref.loc41 -// CHECK:STDOUT: %.loc41_25.2: ref %C = value_as_ref %.loc41_25.1 -// CHECK:STDOUT: %addr.loc41_28.1: %ptr.d9e = addr_of %.loc41_25.2 -// CHECK:STDOUT: %.loc41_31.2: ref %C = value_as_ref %.loc41_31.1 -// CHECK:STDOUT: %addr.loc41_28.2: %ptr.d9e = addr_of %.loc41_31.2 -// CHECK:STDOUT: %.loc41_28.1: ref bool = temporary_storage -// CHECK:STDOUT: %addr.loc41_28.3: %ptr.bb2 = addr_of %.loc41_28.1 -// CHECK:STDOUT: %operator_ExclaimEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_ExclaimEqual__carbon_thunk.decl(%addr.loc41_28.1, %addr.loc41_28.2, %addr.loc41_28.3) -// CHECK:STDOUT: %.loc41_28.2: init bool to %.loc41_28.1 = mark_in_place_init %operator_ExclaimEqual__carbon_thunk.call -// CHECK:STDOUT: %.loc41_18.1: type = splice_block %.loc41_18.3 [concrete = bool] { +// CHECK:STDOUT: %.loc41_32.1: %C = acquire_value %c1.ref.loc41 +// CHECK:STDOUT: %.loc41_38.1: %C = acquire_value %c2.ref.loc41 +// CHECK:STDOUT: %.loc41_32.2: ref %C = value_as_ref %.loc41_32.1 +// CHECK:STDOUT: %addr.loc41_35.1: %ptr.d9e = addr_of %.loc41_32.2 +// CHECK:STDOUT: %.loc41_38.2: ref %C = value_as_ref %.loc41_38.1 +// CHECK:STDOUT: %addr.loc41_35.2: %ptr.d9e = addr_of %.loc41_38.2 +// CHECK:STDOUT: %.loc41_35.1: ref bool = temporary_storage +// CHECK:STDOUT: %addr.loc41_35.3: %ptr.bb2 = addr_of %.loc41_35.1 +// CHECK:STDOUT: %operator_ExclaimEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_ExclaimEqual__carbon_thunk.decl(%addr.loc41_35.1, %addr.loc41_35.2, %addr.loc41_35.3) +// CHECK:STDOUT: %.loc41_35.2: init bool to %.loc41_35.1 = mark_in_place_init %operator_ExclaimEqual__carbon_thunk.call +// CHECK:STDOUT: %.loc41_25.1: type = splice_block %.loc41_25.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc41: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc41_18.2: type = value_of_initializer %Bool.call.loc41 [concrete = bool] -// CHECK:STDOUT: %.loc41_18.3: type = converted %Bool.call.loc41, %.loc41_18.2 [concrete = bool] +// CHECK:STDOUT: %.loc41_25.2: type = value_of_initializer %Bool.call.loc41 [concrete = bool] +// CHECK:STDOUT: %.loc41_25.3: type = converted %Bool.call.loc41, %.loc41_25.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc41_28.3: ref bool = temporary %.loc41_28.1, %.loc41_28.2 -// CHECK:STDOUT: %.loc41_28.4: bool = acquire_value %.loc41_28.3 -// CHECK:STDOUT: %not_equal: bool = value_binding not_equal, %.loc41_28.4 +// CHECK:STDOUT: %.loc41_35.3: ref bool = temporary %.loc41_35.1, %.loc41_35.2 +// CHECK:STDOUT: %.loc41_35.4: bool = acquire_value %.loc41_35.3 +// CHECK:STDOUT: %not_equal: bool = value_binding not_equal, %.loc41_35.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %greater_than.patt: %pattern_type.831 = value_binding_pattern greater_than [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc42: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc42: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc42_28.1: %C = acquire_value %c1.ref.loc42 -// CHECK:STDOUT: %.loc42_33.1: %C = acquire_value %c2.ref.loc42 -// CHECK:STDOUT: %.loc42_28.2: ref %C = value_as_ref %.loc42_28.1 -// CHECK:STDOUT: %addr.loc42_31.1: %ptr.d9e = addr_of %.loc42_28.2 -// CHECK:STDOUT: %.loc42_33.2: ref %C = value_as_ref %.loc42_33.1 -// CHECK:STDOUT: %addr.loc42_31.2: %ptr.d9e = addr_of %.loc42_33.2 -// CHECK:STDOUT: %.loc42_31.1: ref bool = temporary_storage -// CHECK:STDOUT: %addr.loc42_31.3: %ptr.bb2 = addr_of %.loc42_31.1 -// CHECK:STDOUT: %operator_Greater__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Greater__carbon_thunk.decl(%addr.loc42_31.1, %addr.loc42_31.2, %addr.loc42_31.3) -// CHECK:STDOUT: %.loc42_31.2: init bool to %.loc42_31.1 = mark_in_place_init %operator_Greater__carbon_thunk.call -// CHECK:STDOUT: %.loc42_21.1: type = splice_block %.loc42_21.3 [concrete = bool] { +// CHECK:STDOUT: %.loc42_35.1: %C = acquire_value %c1.ref.loc42 +// CHECK:STDOUT: %.loc42_40.1: %C = acquire_value %c2.ref.loc42 +// CHECK:STDOUT: %.loc42_35.2: ref %C = value_as_ref %.loc42_35.1 +// CHECK:STDOUT: %addr.loc42_38.1: %ptr.d9e = addr_of %.loc42_35.2 +// CHECK:STDOUT: %.loc42_40.2: ref %C = value_as_ref %.loc42_40.1 +// CHECK:STDOUT: %addr.loc42_38.2: %ptr.d9e = addr_of %.loc42_40.2 +// CHECK:STDOUT: %.loc42_38.1: ref bool = temporary_storage +// CHECK:STDOUT: %addr.loc42_38.3: %ptr.bb2 = addr_of %.loc42_38.1 +// CHECK:STDOUT: %operator_Greater__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Greater__carbon_thunk.decl(%addr.loc42_38.1, %addr.loc42_38.2, %addr.loc42_38.3) +// CHECK:STDOUT: %.loc42_38.2: init bool to %.loc42_38.1 = mark_in_place_init %operator_Greater__carbon_thunk.call +// CHECK:STDOUT: %.loc42_28.1: type = splice_block %.loc42_28.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc42: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc42_21.2: type = value_of_initializer %Bool.call.loc42 [concrete = bool] -// CHECK:STDOUT: %.loc42_21.3: type = converted %Bool.call.loc42, %.loc42_21.2 [concrete = bool] +// CHECK:STDOUT: %.loc42_28.2: type = value_of_initializer %Bool.call.loc42 [concrete = bool] +// CHECK:STDOUT: %.loc42_28.3: type = converted %Bool.call.loc42, %.loc42_28.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc42_31.3: ref bool = temporary %.loc42_31.1, %.loc42_31.2 -// CHECK:STDOUT: %.loc42_31.4: bool = acquire_value %.loc42_31.3 -// CHECK:STDOUT: %greater_than: bool = value_binding greater_than, %.loc42_31.4 +// CHECK:STDOUT: %.loc42_38.3: ref bool = temporary %.loc42_38.1, %.loc42_38.2 +// CHECK:STDOUT: %.loc42_38.4: bool = acquire_value %.loc42_38.3 +// CHECK:STDOUT: %greater_than: bool = value_binding greater_than, %.loc42_38.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %less_than.patt: %pattern_type.831 = value_binding_pattern less_than [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc43: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc43: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc43_25.1: %C = acquire_value %c1.ref.loc43 -// CHECK:STDOUT: %.loc43_30.1: %C = acquire_value %c2.ref.loc43 -// CHECK:STDOUT: %.loc43_25.2: ref %C = value_as_ref %.loc43_25.1 -// CHECK:STDOUT: %addr.loc43_28.1: %ptr.d9e = addr_of %.loc43_25.2 -// CHECK:STDOUT: %.loc43_30.2: ref %C = value_as_ref %.loc43_30.1 -// CHECK:STDOUT: %addr.loc43_28.2: %ptr.d9e = addr_of %.loc43_30.2 -// CHECK:STDOUT: %.loc43_28.1: ref bool = temporary_storage -// CHECK:STDOUT: %addr.loc43_28.3: %ptr.bb2 = addr_of %.loc43_28.1 -// CHECK:STDOUT: %operator_Less__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Less__carbon_thunk.decl(%addr.loc43_28.1, %addr.loc43_28.2, %addr.loc43_28.3) -// CHECK:STDOUT: %.loc43_28.2: init bool to %.loc43_28.1 = mark_in_place_init %operator_Less__carbon_thunk.call -// CHECK:STDOUT: %.loc43_18.1: type = splice_block %.loc43_18.3 [concrete = bool] { +// CHECK:STDOUT: %.loc43_32.1: %C = acquire_value %c1.ref.loc43 +// CHECK:STDOUT: %.loc43_37.1: %C = acquire_value %c2.ref.loc43 +// CHECK:STDOUT: %.loc43_32.2: ref %C = value_as_ref %.loc43_32.1 +// CHECK:STDOUT: %addr.loc43_35.1: %ptr.d9e = addr_of %.loc43_32.2 +// CHECK:STDOUT: %.loc43_37.2: ref %C = value_as_ref %.loc43_37.1 +// CHECK:STDOUT: %addr.loc43_35.2: %ptr.d9e = addr_of %.loc43_37.2 +// CHECK:STDOUT: %.loc43_35.1: ref bool = temporary_storage +// CHECK:STDOUT: %addr.loc43_35.3: %ptr.bb2 = addr_of %.loc43_35.1 +// CHECK:STDOUT: %operator_Less__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Less__carbon_thunk.decl(%addr.loc43_35.1, %addr.loc43_35.2, %addr.loc43_35.3) +// CHECK:STDOUT: %.loc43_35.2: init bool to %.loc43_35.1 = mark_in_place_init %operator_Less__carbon_thunk.call +// CHECK:STDOUT: %.loc43_25.1: type = splice_block %.loc43_25.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc43: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc43_18.2: type = value_of_initializer %Bool.call.loc43 [concrete = bool] -// CHECK:STDOUT: %.loc43_18.3: type = converted %Bool.call.loc43, %.loc43_18.2 [concrete = bool] +// CHECK:STDOUT: %.loc43_25.2: type = value_of_initializer %Bool.call.loc43 [concrete = bool] +// CHECK:STDOUT: %.loc43_25.3: type = converted %Bool.call.loc43, %.loc43_25.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc43_28.3: ref bool = temporary %.loc43_28.1, %.loc43_28.2 -// CHECK:STDOUT: %.loc43_28.4: bool = acquire_value %.loc43_28.3 -// CHECK:STDOUT: %less_than: bool = value_binding less_than, %.loc43_28.4 +// CHECK:STDOUT: %.loc43_35.3: ref bool = temporary %.loc43_35.1, %.loc43_35.2 +// CHECK:STDOUT: %.loc43_35.4: bool = acquire_value %.loc43_35.3 +// CHECK:STDOUT: %less_than: bool = value_binding less_than, %.loc43_35.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %greater_than_or_equal.patt: %pattern_type.831 = value_binding_pattern greater_than_or_equal [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc44: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc44: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc44_37.1: %C = acquire_value %c1.ref.loc44 -// CHECK:STDOUT: %.loc44_43.1: %C = acquire_value %c2.ref.loc44 -// CHECK:STDOUT: %.loc44_37.2: ref %C = value_as_ref %.loc44_37.1 -// CHECK:STDOUT: %addr.loc44_40.1: %ptr.d9e = addr_of %.loc44_37.2 -// CHECK:STDOUT: %.loc44_43.2: ref %C = value_as_ref %.loc44_43.1 -// CHECK:STDOUT: %addr.loc44_40.2: %ptr.d9e = addr_of %.loc44_43.2 -// CHECK:STDOUT: %.loc44_40.1: ref bool = temporary_storage -// CHECK:STDOUT: %addr.loc44_40.3: %ptr.bb2 = addr_of %.loc44_40.1 -// CHECK:STDOUT: %operator_GreaterEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_GreaterEqual__carbon_thunk.decl(%addr.loc44_40.1, %addr.loc44_40.2, %addr.loc44_40.3) -// CHECK:STDOUT: %.loc44_40.2: init bool to %.loc44_40.1 = mark_in_place_init %operator_GreaterEqual__carbon_thunk.call -// CHECK:STDOUT: %.loc44_30.1: type = splice_block %.loc44_30.3 [concrete = bool] { +// CHECK:STDOUT: %.loc44_44.1: %C = acquire_value %c1.ref.loc44 +// CHECK:STDOUT: %.loc44_50.1: %C = acquire_value %c2.ref.loc44 +// CHECK:STDOUT: %.loc44_44.2: ref %C = value_as_ref %.loc44_44.1 +// CHECK:STDOUT: %addr.loc44_47.1: %ptr.d9e = addr_of %.loc44_44.2 +// CHECK:STDOUT: %.loc44_50.2: ref %C = value_as_ref %.loc44_50.1 +// CHECK:STDOUT: %addr.loc44_47.2: %ptr.d9e = addr_of %.loc44_50.2 +// CHECK:STDOUT: %.loc44_47.1: ref bool = temporary_storage +// CHECK:STDOUT: %addr.loc44_47.3: %ptr.bb2 = addr_of %.loc44_47.1 +// CHECK:STDOUT: %operator_GreaterEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_GreaterEqual__carbon_thunk.decl(%addr.loc44_47.1, %addr.loc44_47.2, %addr.loc44_47.3) +// CHECK:STDOUT: %.loc44_47.2: init bool to %.loc44_47.1 = mark_in_place_init %operator_GreaterEqual__carbon_thunk.call +// CHECK:STDOUT: %.loc44_37.1: type = splice_block %.loc44_37.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc44: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc44_30.2: type = value_of_initializer %Bool.call.loc44 [concrete = bool] -// CHECK:STDOUT: %.loc44_30.3: type = converted %Bool.call.loc44, %.loc44_30.2 [concrete = bool] +// CHECK:STDOUT: %.loc44_37.2: type = value_of_initializer %Bool.call.loc44 [concrete = bool] +// CHECK:STDOUT: %.loc44_37.3: type = converted %Bool.call.loc44, %.loc44_37.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc44_40.3: ref bool = temporary %.loc44_40.1, %.loc44_40.2 -// CHECK:STDOUT: %.loc44_40.4: bool = acquire_value %.loc44_40.3 -// CHECK:STDOUT: %greater_than_or_equal: bool = value_binding greater_than_or_equal, %.loc44_40.4 +// CHECK:STDOUT: %.loc44_47.3: ref bool = temporary %.loc44_47.1, %.loc44_47.2 +// CHECK:STDOUT: %.loc44_47.4: bool = acquire_value %.loc44_47.3 +// CHECK:STDOUT: %greater_than_or_equal: bool = value_binding greater_than_or_equal, %.loc44_47.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %less_than_or_equal.patt: %pattern_type.831 = value_binding_pattern less_than_or_equal [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc45: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc45: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc45_34.1: %C = acquire_value %c1.ref.loc45 -// CHECK:STDOUT: %.loc45_40.1: %C = acquire_value %c2.ref.loc45 -// CHECK:STDOUT: %.loc45_34.2: ref %C = value_as_ref %.loc45_34.1 -// CHECK:STDOUT: %addr.loc45_37.1: %ptr.d9e = addr_of %.loc45_34.2 -// CHECK:STDOUT: %.loc45_40.2: ref %C = value_as_ref %.loc45_40.1 -// CHECK:STDOUT: %addr.loc45_37.2: %ptr.d9e = addr_of %.loc45_40.2 -// CHECK:STDOUT: %.loc45_37.1: ref bool = temporary_storage -// CHECK:STDOUT: %addr.loc45_37.3: %ptr.bb2 = addr_of %.loc45_37.1 -// CHECK:STDOUT: %operator_LessEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_LessEqual__carbon_thunk.decl(%addr.loc45_37.1, %addr.loc45_37.2, %addr.loc45_37.3) -// CHECK:STDOUT: %.loc45_37.2: init bool to %.loc45_37.1 = mark_in_place_init %operator_LessEqual__carbon_thunk.call -// CHECK:STDOUT: %.loc45_27.1: type = splice_block %.loc45_27.3 [concrete = bool] { +// CHECK:STDOUT: %.loc45_41.1: %C = acquire_value %c1.ref.loc45 +// CHECK:STDOUT: %.loc45_47.1: %C = acquire_value %c2.ref.loc45 +// CHECK:STDOUT: %.loc45_41.2: ref %C = value_as_ref %.loc45_41.1 +// CHECK:STDOUT: %addr.loc45_44.1: %ptr.d9e = addr_of %.loc45_41.2 +// CHECK:STDOUT: %.loc45_47.2: ref %C = value_as_ref %.loc45_47.1 +// CHECK:STDOUT: %addr.loc45_44.2: %ptr.d9e = addr_of %.loc45_47.2 +// CHECK:STDOUT: %.loc45_44.1: ref bool = temporary_storage +// CHECK:STDOUT: %addr.loc45_44.3: %ptr.bb2 = addr_of %.loc45_44.1 +// CHECK:STDOUT: %operator_LessEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_LessEqual__carbon_thunk.decl(%addr.loc45_44.1, %addr.loc45_44.2, %addr.loc45_44.3) +// CHECK:STDOUT: %.loc45_44.2: init bool to %.loc45_44.1 = mark_in_place_init %operator_LessEqual__carbon_thunk.call +// CHECK:STDOUT: %.loc45_34.1: type = splice_block %.loc45_34.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc45: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc45_27.2: type = value_of_initializer %Bool.call.loc45 [concrete = bool] -// CHECK:STDOUT: %.loc45_27.3: type = converted %Bool.call.loc45, %.loc45_27.2 [concrete = bool] +// CHECK:STDOUT: %.loc45_34.2: type = value_of_initializer %Bool.call.loc45 [concrete = bool] +// CHECK:STDOUT: %.loc45_34.3: type = converted %Bool.call.loc45, %.loc45_34.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc45_37.3: ref bool = temporary %.loc45_37.1, %.loc45_37.2 -// CHECK:STDOUT: %.loc45_37.4: bool = acquire_value %.loc45_37.3 -// CHECK:STDOUT: %less_than_or_equal: bool = value_binding less_than_or_equal, %.loc45_37.4 +// CHECK:STDOUT: %.loc45_44.3: ref bool = temporary %.loc45_44.1, %.loc45_44.2 +// CHECK:STDOUT: %.loc45_44.4: bool = acquire_value %.loc45_44.3 +// CHECK:STDOUT: %less_than_or_equal: bool = value_binding less_than_or_equal, %.loc45_44.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %index.patt: %pattern_type.7ce = value_binding_pattern index [concrete] // CHECK:STDOUT: } @@ -1910,52 +1910,52 @@ fn F() { // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete = constants.%int_42.20e] // CHECK:STDOUT: %C.cpp_operator.bound: = bound_method %c1.ref.loc48, imports.%C.cpp_operator.decl // CHECK:STDOUT: %impl.elem0.loc48: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc48_23.1: = bound_method %int_42, %impl.elem0.loc48 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.c83] +// CHECK:STDOUT: %bound_method.loc48_30.1: = bound_method %int_42, %impl.elem0.loc48 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.c83] // CHECK:STDOUT: %specific_fn.loc48: = specific_function %impl.elem0.loc48, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc48_23.2: = bound_method %int_42, %specific_fn.loc48 [concrete = constants.%bound_method.cb9] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc48: init %i32 = call %bound_method.loc48_23.2(%int_42) [concrete = constants.%int_42.c68] -// CHECK:STDOUT: %.loc48_23.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc48 [concrete = constants.%int_42.c68] -// CHECK:STDOUT: %.loc48_23.2: %i32 = converted %int_42, %.loc48_23.1 [concrete = constants.%int_42.c68] -// CHECK:STDOUT: %C.cpp_operator.call: init %i32 = call %C.cpp_operator.bound(%c1.ref.loc48, %.loc48_23.2) -// CHECK:STDOUT: %.loc48_14: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %bound_method.loc48_30.2: = bound_method %int_42, %specific_fn.loc48 [concrete = constants.%bound_method.cb9] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc48: init %i32 = call %bound_method.loc48_30.2(%int_42) [concrete = constants.%int_42.c68] +// CHECK:STDOUT: %.loc48_30.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc48 [concrete = constants.%int_42.c68] +// CHECK:STDOUT: %.loc48_30.2: %i32 = converted %int_42, %.loc48_30.1 [concrete = constants.%int_42.c68] +// CHECK:STDOUT: %C.cpp_operator.call: init %i32 = call %C.cpp_operator.bound(%c1.ref.loc48, %.loc48_30.2) +// CHECK:STDOUT: %.loc48_21: type = splice_block %i32 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc48_25.1: %i32 = value_of_initializer %C.cpp_operator.call -// CHECK:STDOUT: %.loc48_25.2: %i32 = converted %C.cpp_operator.call, %.loc48_25.1 -// CHECK:STDOUT: %index: %i32 = value_binding index, %.loc48_25.2 -// CHECK:STDOUT: %DestroyOp.bound.loc45: = bound_method %.loc45_37.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc45: init %empty_tuple.type = call %DestroyOp.bound.loc45(%.loc45_37.3) -// CHECK:STDOUT: %DestroyOp.bound.loc44: = bound_method %.loc44_40.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc44: init %empty_tuple.type = call %DestroyOp.bound.loc44(%.loc44_40.3) -// CHECK:STDOUT: %DestroyOp.bound.loc43: = bound_method %.loc43_28.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc43: init %empty_tuple.type = call %DestroyOp.bound.loc43(%.loc43_28.3) -// CHECK:STDOUT: %DestroyOp.bound.loc42: = bound_method %.loc42_31.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc42: init %empty_tuple.type = call %DestroyOp.bound.loc42(%.loc42_31.3) -// CHECK:STDOUT: %DestroyOp.bound.loc41: = bound_method %.loc41_28.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc41: init %empty_tuple.type = call %DestroyOp.bound.loc41(%.loc41_28.3) -// CHECK:STDOUT: %DestroyOp.bound.loc40: = bound_method %.loc40_24.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc40: init %empty_tuple.type = call %DestroyOp.bound.loc40(%.loc40_24.3) -// CHECK:STDOUT: %C.cpp_destructor.bound.loc23: = bound_method %.loc23_31.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc23: init %empty_tuple.type = call %C.cpp_destructor.bound.loc23(%.loc23_31.3) -// CHECK:STDOUT: %C.cpp_destructor.bound.loc22: = bound_method %.loc22_30.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc22: init %empty_tuple.type = call %C.cpp_destructor.bound.loc22(%.loc22_30.3) -// CHECK:STDOUT: %C.cpp_destructor.bound.loc21: = bound_method %.loc21_31.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc21: init %empty_tuple.type = call %C.cpp_destructor.bound.loc21(%.loc21_31.3) -// CHECK:STDOUT: %C.cpp_destructor.bound.loc20: = bound_method %.loc20_30.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc20: init %empty_tuple.type = call %C.cpp_destructor.bound.loc20(%.loc20_30.3) -// CHECK:STDOUT: %C.cpp_destructor.bound.loc19: = bound_method %.loc19_31.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc19: init %empty_tuple.type = call %C.cpp_destructor.bound.loc19(%.loc19_31.3) -// CHECK:STDOUT: %C.cpp_destructor.bound.loc16: = bound_method %.loc16_26.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc16: init %empty_tuple.type = call %C.cpp_destructor.bound.loc16(%.loc16_26.3) -// CHECK:STDOUT: %C.cpp_destructor.bound.loc15: = bound_method %.loc15_28.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc15: init %empty_tuple.type = call %C.cpp_destructor.bound.loc15(%.loc15_28.3) -// CHECK:STDOUT: %C.cpp_destructor.bound.loc14: = bound_method %.loc14_34.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc14: init %empty_tuple.type = call %C.cpp_destructor.bound.loc14(%.loc14_34.3) -// CHECK:STDOUT: %C.cpp_destructor.bound.loc13: = bound_method %.loc13_31.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc13: init %empty_tuple.type = call %C.cpp_destructor.bound.loc13(%.loc13_31.3) -// CHECK:STDOUT: %C.cpp_destructor.bound.loc12: = bound_method %.loc12_28.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc12: init %empty_tuple.type = call %C.cpp_destructor.bound.loc12(%.loc12_28.3) +// CHECK:STDOUT: %.loc48_32.1: %i32 = value_of_initializer %C.cpp_operator.call +// CHECK:STDOUT: %.loc48_32.2: %i32 = converted %C.cpp_operator.call, %.loc48_32.1 +// CHECK:STDOUT: %index: %i32 = value_binding index, %.loc48_32.2 +// CHECK:STDOUT: %DestroyOp.bound.loc45: = bound_method %.loc45_44.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc45: init %empty_tuple.type = call %DestroyOp.bound.loc45(%.loc45_44.3) +// CHECK:STDOUT: %DestroyOp.bound.loc44: = bound_method %.loc44_47.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc44: init %empty_tuple.type = call %DestroyOp.bound.loc44(%.loc44_47.3) +// CHECK:STDOUT: %DestroyOp.bound.loc43: = bound_method %.loc43_35.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc43: init %empty_tuple.type = call %DestroyOp.bound.loc43(%.loc43_35.3) +// CHECK:STDOUT: %DestroyOp.bound.loc42: = bound_method %.loc42_38.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc42: init %empty_tuple.type = call %DestroyOp.bound.loc42(%.loc42_38.3) +// CHECK:STDOUT: %DestroyOp.bound.loc41: = bound_method %.loc41_35.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc41: init %empty_tuple.type = call %DestroyOp.bound.loc41(%.loc41_35.3) +// CHECK:STDOUT: %DestroyOp.bound.loc40: = bound_method %.loc40_31.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc40: init %empty_tuple.type = call %DestroyOp.bound.loc40(%.loc40_31.3) +// CHECK:STDOUT: %C.cpp_destructor.bound.loc23: = bound_method %.loc23_38.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc23: init %empty_tuple.type = call %C.cpp_destructor.bound.loc23(%.loc23_38.3) +// CHECK:STDOUT: %C.cpp_destructor.bound.loc22: = bound_method %.loc22_37.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc22: init %empty_tuple.type = call %C.cpp_destructor.bound.loc22(%.loc22_37.3) +// CHECK:STDOUT: %C.cpp_destructor.bound.loc21: = bound_method %.loc21_38.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc21: init %empty_tuple.type = call %C.cpp_destructor.bound.loc21(%.loc21_38.3) +// CHECK:STDOUT: %C.cpp_destructor.bound.loc20: = bound_method %.loc20_37.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc20: init %empty_tuple.type = call %C.cpp_destructor.bound.loc20(%.loc20_37.3) +// CHECK:STDOUT: %C.cpp_destructor.bound.loc19: = bound_method %.loc19_38.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc19: init %empty_tuple.type = call %C.cpp_destructor.bound.loc19(%.loc19_38.3) +// CHECK:STDOUT: %C.cpp_destructor.bound.loc16: = bound_method %.loc16_33.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc16: init %empty_tuple.type = call %C.cpp_destructor.bound.loc16(%.loc16_33.3) +// CHECK:STDOUT: %C.cpp_destructor.bound.loc15: = bound_method %.loc15_35.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc15: init %empty_tuple.type = call %C.cpp_destructor.bound.loc15(%.loc15_35.3) +// CHECK:STDOUT: %C.cpp_destructor.bound.loc14: = bound_method %.loc14_41.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc14: init %empty_tuple.type = call %C.cpp_destructor.bound.loc14(%.loc14_41.3) +// CHECK:STDOUT: %C.cpp_destructor.bound.loc13: = bound_method %.loc13_38.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc13: init %empty_tuple.type = call %C.cpp_destructor.bound.loc13(%.loc13_38.3) +// CHECK:STDOUT: %C.cpp_destructor.bound.loc12: = bound_method %.loc12_35.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc12: init %empty_tuple.type = call %C.cpp_destructor.bound.loc12(%.loc12_35.3) // CHECK:STDOUT: %C.cpp_destructor.bound.loc9: = bound_method %c2.var, constants.%C.cpp_destructor // CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%c2.var) // CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %c1.var, constants.%C.cpp_destructor @@ -2082,23 +2082,23 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %c4.ref: %C = name_ref c4, %c4 // CHECK:STDOUT: %c3.ref.loc12: %C = name_ref c3, %c3 -// CHECK:STDOUT: %.loc12_22.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc12_19: ref %C = value_as_ref %c4.ref -// CHECK:STDOUT: %addr.loc12_22.1: %ptr.d9e = addr_of %.loc12_19 -// CHECK:STDOUT: %.loc12_24: ref %C = value_as_ref %c3.ref.loc12 -// CHECK:STDOUT: %addr.loc12_22.2: %ptr.d9e = addr_of %.loc12_24 -// CHECK:STDOUT: %addr.loc12_22.3: %ptr.d9e = addr_of %.loc12_22.1 -// CHECK:STDOUT: %operator_Plus__carbon_thunk.call.loc12: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc12_22.1, %addr.loc12_22.2, %addr.loc12_22.3) -// CHECK:STDOUT: %.loc12_22.2: init %C to %.loc12_22.1 = mark_in_place_init %operator_Plus__carbon_thunk.call.loc12 -// CHECK:STDOUT: %.loc12_14: type = splice_block %C.ref.loc12 [concrete = constants.%C] { +// CHECK:STDOUT: %.loc12_29.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc12_26: ref %C = value_as_ref %c4.ref +// CHECK:STDOUT: %addr.loc12_29.1: %ptr.d9e = addr_of %.loc12_26 +// CHECK:STDOUT: %.loc12_31: ref %C = value_as_ref %c3.ref.loc12 +// CHECK:STDOUT: %addr.loc12_29.2: %ptr.d9e = addr_of %.loc12_31 +// CHECK:STDOUT: %addr.loc12_29.3: %ptr.d9e = addr_of %.loc12_29.1 +// CHECK:STDOUT: %operator_Plus__carbon_thunk.call.loc12: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc12_29.1, %addr.loc12_29.2, %addr.loc12_29.3) +// CHECK:STDOUT: %.loc12_29.2: init %C to %.loc12_29.1 = mark_in_place_init %operator_Plus__carbon_thunk.call.loc12 +// CHECK:STDOUT: %.loc12_21: type = splice_block %C.ref.loc12 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc12: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc12_22.3: ref %C = temporary %.loc12_22.1, %.loc12_22.2 -// CHECK:STDOUT: %.loc12_22.4: %C = acquire_value %.loc12_22.3 -// CHECK:STDOUT: %c5: %C = value_binding c5, %.loc12_22.4 -// CHECK:STDOUT: %C.cpp_destructor.bound.loc12: = bound_method %.loc12_22.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc12: init %empty_tuple.type = call %C.cpp_destructor.bound.loc12(%.loc12_22.3) +// CHECK:STDOUT: %.loc12_29.3: ref %C = temporary %.loc12_29.1, %.loc12_29.2 +// CHECK:STDOUT: %.loc12_29.4: %C = acquire_value %.loc12_29.3 +// CHECK:STDOUT: %c5: %C = value_binding c5, %.loc12_29.4 +// CHECK:STDOUT: %C.cpp_destructor.bound.loc12: = bound_method %.loc12_29.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc12: init %empty_tuple.type = call %C.cpp_destructor.bound.loc12(%.loc12_29.3) // CHECK:STDOUT: %C.cpp_destructor.bound.loc11: = bound_method %.loc11_22.3, constants.%C.cpp_destructor // CHECK:STDOUT: %C.cpp_destructor.call.loc11: init %empty_tuple.type = call %C.cpp_destructor.bound.loc11(%.loc11_22.3) // CHECK:STDOUT: %C.cpp_destructor.bound.loc10: = bound_method %.loc10_22.3, constants.%C.cpp_destructor @@ -2202,33 +2202,33 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc19: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc19: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc19_28.1: %C = acquire_value %c1.ref.loc19 -// CHECK:STDOUT: %.loc19_33.1: %C = acquire_value %c2.ref.loc19 -// CHECK:STDOUT: %.loc19_28.2: ref %C = value_as_ref %.loc19_28.1 -// CHECK:STDOUT: %addr.loc19_31.1: %ptr.d9e = addr_of %.loc19_28.2 -// CHECK:STDOUT: %.loc19_33.2: ref %C = value_as_ref %.loc19_33.1 -// CHECK:STDOUT: %addr.loc19_31.2: %ptr.d9e = addr_of %.loc19_33.2 -// CHECK:STDOUT: %.loc19_31.1: ref bool = temporary_storage -// CHECK:STDOUT: %addr.loc19_31.3: %ptr.bb2 = addr_of %.loc19_31.1 -// CHECK:STDOUT: %operator_Greater__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Greater__carbon_thunk.decl(%addr.loc19_31.1, %addr.loc19_31.2, %addr.loc19_31.3) -// CHECK:STDOUT: %.loc19_31.2: init bool to %.loc19_31.1 = mark_in_place_init %operator_Greater__carbon_thunk.call -// CHECK:STDOUT: %.loc19_21.1: type = splice_block %.loc19_21.3 [concrete = bool] { +// CHECK:STDOUT: %.loc19_35.1: %C = acquire_value %c1.ref.loc19 +// CHECK:STDOUT: %.loc19_40.1: %C = acquire_value %c2.ref.loc19 +// CHECK:STDOUT: %.loc19_35.2: ref %C = value_as_ref %.loc19_35.1 +// CHECK:STDOUT: %addr.loc19_38.1: %ptr.d9e = addr_of %.loc19_35.2 +// CHECK:STDOUT: %.loc19_40.2: ref %C = value_as_ref %.loc19_40.1 +// CHECK:STDOUT: %addr.loc19_38.2: %ptr.d9e = addr_of %.loc19_40.2 +// CHECK:STDOUT: %.loc19_38.1: ref bool = temporary_storage +// CHECK:STDOUT: %addr.loc19_38.3: %ptr.bb2 = addr_of %.loc19_38.1 +// CHECK:STDOUT: %operator_Greater__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Greater__carbon_thunk.decl(%addr.loc19_38.1, %addr.loc19_38.2, %addr.loc19_38.3) +// CHECK:STDOUT: %.loc19_38.2: init bool to %.loc19_38.1 = mark_in_place_init %operator_Greater__carbon_thunk.call +// CHECK:STDOUT: %.loc19_28.1: type = splice_block %.loc19_28.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc19: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc19_21.2: type = value_of_initializer %Bool.call.loc19 [concrete = bool] -// CHECK:STDOUT: %.loc19_21.3: type = converted %Bool.call.loc19, %.loc19_21.2 [concrete = bool] +// CHECK:STDOUT: %.loc19_28.2: type = value_of_initializer %Bool.call.loc19 [concrete = bool] +// CHECK:STDOUT: %.loc19_28.3: type = converted %Bool.call.loc19, %.loc19_28.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19_31.3: ref bool = temporary %.loc19_31.1, %.loc19_31.2 -// CHECK:STDOUT: %.loc19_31.4: bool = acquire_value %.loc19_31.3 -// CHECK:STDOUT: %greater_than: bool = value_binding greater_than, %.loc19_31.4 +// CHECK:STDOUT: %.loc19_38.3: ref bool = temporary %.loc19_38.1, %.loc19_38.2 +// CHECK:STDOUT: %.loc19_38.4: bool = acquire_value %.loc19_38.3 +// CHECK:STDOUT: %greater_than: bool = value_binding greater_than, %.loc19_38.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %less_than.patt: %pattern_type.831 = value_binding_pattern less_than [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc26: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc26: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc26_18.1: type = splice_block %.loc26_18.3 [concrete = bool] { +// CHECK:STDOUT: %.loc26_25.1: type = splice_block %.loc26_25.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc26: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc26_18.2: type = value_of_initializer %Bool.call.loc26 [concrete = bool] -// CHECK:STDOUT: %.loc26_18.3: type = converted %Bool.call.loc26, %.loc26_18.2 [concrete = bool] +// CHECK:STDOUT: %.loc26_25.2: type = value_of_initializer %Bool.call.loc26 [concrete = bool] +// CHECK:STDOUT: %.loc26_25.3: type = converted %Bool.call.loc26, %.loc26_25.2 [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: %less_than: bool = value_binding less_than, [concrete = ] // CHECK:STDOUT: name_binding_decl { @@ -2236,10 +2236,10 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc33: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc33: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc33_30.1: type = splice_block %.loc33_30.3 [concrete = bool] { +// CHECK:STDOUT: %.loc33_37.1: type = splice_block %.loc33_37.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc33: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc33_30.2: type = value_of_initializer %Bool.call.loc33 [concrete = bool] -// CHECK:STDOUT: %.loc33_30.3: type = converted %Bool.call.loc33, %.loc33_30.2 [concrete = bool] +// CHECK:STDOUT: %.loc33_37.2: type = value_of_initializer %Bool.call.loc33 [concrete = bool] +// CHECK:STDOUT: %.loc33_37.3: type = converted %Bool.call.loc33, %.loc33_37.2 [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: %greater_than_or_equal: bool = value_binding greater_than_or_equal, [concrete = ] // CHECK:STDOUT: name_binding_decl { @@ -2247,28 +2247,28 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc36: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc36: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc36_34.1: %C = acquire_value %c1.ref.loc36 -// CHECK:STDOUT: %.loc36_40.1: %C = acquire_value %c2.ref.loc36 -// CHECK:STDOUT: %.loc36_34.2: ref %C = value_as_ref %.loc36_34.1 -// CHECK:STDOUT: %addr.loc36_37.1: %ptr.d9e = addr_of %.loc36_34.2 -// CHECK:STDOUT: %.loc36_40.2: ref %C = value_as_ref %.loc36_40.1 -// CHECK:STDOUT: %addr.loc36_37.2: %ptr.d9e = addr_of %.loc36_40.2 -// CHECK:STDOUT: %.loc36_37.1: ref bool = temporary_storage -// CHECK:STDOUT: %addr.loc36_37.3: %ptr.bb2 = addr_of %.loc36_37.1 -// CHECK:STDOUT: %operator_LessEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_LessEqual__carbon_thunk.decl(%addr.loc36_37.1, %addr.loc36_37.2, %addr.loc36_37.3) -// CHECK:STDOUT: %.loc36_37.2: init bool to %.loc36_37.1 = mark_in_place_init %operator_LessEqual__carbon_thunk.call -// CHECK:STDOUT: %.loc36_27.1: type = splice_block %.loc36_27.3 [concrete = bool] { +// CHECK:STDOUT: %.loc36_41.1: %C = acquire_value %c1.ref.loc36 +// CHECK:STDOUT: %.loc36_47.1: %C = acquire_value %c2.ref.loc36 +// CHECK:STDOUT: %.loc36_41.2: ref %C = value_as_ref %.loc36_41.1 +// CHECK:STDOUT: %addr.loc36_44.1: %ptr.d9e = addr_of %.loc36_41.2 +// CHECK:STDOUT: %.loc36_47.2: ref %C = value_as_ref %.loc36_47.1 +// CHECK:STDOUT: %addr.loc36_44.2: %ptr.d9e = addr_of %.loc36_47.2 +// CHECK:STDOUT: %.loc36_44.1: ref bool = temporary_storage +// CHECK:STDOUT: %addr.loc36_44.3: %ptr.bb2 = addr_of %.loc36_44.1 +// CHECK:STDOUT: %operator_LessEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_LessEqual__carbon_thunk.decl(%addr.loc36_44.1, %addr.loc36_44.2, %addr.loc36_44.3) +// CHECK:STDOUT: %.loc36_44.2: init bool to %.loc36_44.1 = mark_in_place_init %operator_LessEqual__carbon_thunk.call +// CHECK:STDOUT: %.loc36_34.1: type = splice_block %.loc36_34.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc36: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc36_27.2: type = value_of_initializer %Bool.call.loc36 [concrete = bool] -// CHECK:STDOUT: %.loc36_27.3: type = converted %Bool.call.loc36, %.loc36_27.2 [concrete = bool] +// CHECK:STDOUT: %.loc36_34.2: type = value_of_initializer %Bool.call.loc36 [concrete = bool] +// CHECK:STDOUT: %.loc36_34.3: type = converted %Bool.call.loc36, %.loc36_34.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc36_37.3: ref bool = temporary %.loc36_37.1, %.loc36_37.2 -// CHECK:STDOUT: %.loc36_37.4: bool = acquire_value %.loc36_37.3 -// CHECK:STDOUT: %less_than_or_equal: bool = value_binding less_than_or_equal, %.loc36_37.4 -// CHECK:STDOUT: %DestroyOp.bound.loc36: = bound_method %.loc36_37.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc36: init %empty_tuple.type = call %DestroyOp.bound.loc36(%.loc36_37.3) -// CHECK:STDOUT: %DestroyOp.bound.loc19: = bound_method %.loc19_31.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc19: init %empty_tuple.type = call %DestroyOp.bound.loc19(%.loc19_31.3) +// CHECK:STDOUT: %.loc36_44.3: ref bool = temporary %.loc36_44.1, %.loc36_44.2 +// CHECK:STDOUT: %.loc36_44.4: bool = acquire_value %.loc36_44.3 +// CHECK:STDOUT: %less_than_or_equal: bool = value_binding less_than_or_equal, %.loc36_44.4 +// CHECK:STDOUT: %DestroyOp.bound.loc36: = bound_method %.loc36_44.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc36: init %empty_tuple.type = call %DestroyOp.bound.loc36(%.loc36_44.3) +// CHECK:STDOUT: %DestroyOp.bound.loc19: = bound_method %.loc19_38.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc19: init %empty_tuple.type = call %DestroyOp.bound.loc19(%.loc19_38.3) // CHECK:STDOUT: %C.cpp_destructor.bound.loc16: = bound_method %c2.var, constants.%C.cpp_destructor // CHECK:STDOUT: %C.cpp_destructor.call.loc16: init %empty_tuple.type = call %C.cpp_destructor.bound.loc16(%c2.var) // CHECK:STDOUT: %C.cpp_destructor.bound.loc15: = bound_method %c1.var, constants.%C.cpp_destructor @@ -2363,37 +2363,37 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc16: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc16: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc16_21.1: %C = acquire_value %c1.ref.loc16 -// CHECK:STDOUT: %.loc16_27.1: %C = acquire_value %c2.ref.loc16 -// CHECK:STDOUT: %.loc16_21.2: ref %C = value_as_ref %.loc16_21.1 -// CHECK:STDOUT: %addr.loc16_24.1: %ptr.d9e = addr_of %.loc16_21.2 -// CHECK:STDOUT: %.loc16_27.2: ref %C = value_as_ref %.loc16_27.1 -// CHECK:STDOUT: %addr.loc16_24.2: %ptr.d9e = addr_of %.loc16_27.2 -// CHECK:STDOUT: %.loc16_24.1: ref bool = temporary_storage -// CHECK:STDOUT: %addr.loc16_24.3: %ptr.bb2 = addr_of %.loc16_24.1 -// CHECK:STDOUT: %operator_EqualEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_EqualEqual__carbon_thunk.decl(%addr.loc16_24.1, %addr.loc16_24.2, %addr.loc16_24.3) -// CHECK:STDOUT: %.loc16_24.2: init bool to %.loc16_24.1 = mark_in_place_init %operator_EqualEqual__carbon_thunk.call -// CHECK:STDOUT: %.loc16_14.1: type = splice_block %.loc16_14.3 [concrete = bool] { +// CHECK:STDOUT: %.loc16_28.1: %C = acquire_value %c1.ref.loc16 +// CHECK:STDOUT: %.loc16_34.1: %C = acquire_value %c2.ref.loc16 +// CHECK:STDOUT: %.loc16_28.2: ref %C = value_as_ref %.loc16_28.1 +// CHECK:STDOUT: %addr.loc16_31.1: %ptr.d9e = addr_of %.loc16_28.2 +// CHECK:STDOUT: %.loc16_34.2: ref %C = value_as_ref %.loc16_34.1 +// CHECK:STDOUT: %addr.loc16_31.2: %ptr.d9e = addr_of %.loc16_34.2 +// CHECK:STDOUT: %.loc16_31.1: ref bool = temporary_storage +// CHECK:STDOUT: %addr.loc16_31.3: %ptr.bb2 = addr_of %.loc16_31.1 +// CHECK:STDOUT: %operator_EqualEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_EqualEqual__carbon_thunk.decl(%addr.loc16_31.1, %addr.loc16_31.2, %addr.loc16_31.3) +// CHECK:STDOUT: %.loc16_31.2: init bool to %.loc16_31.1 = mark_in_place_init %operator_EqualEqual__carbon_thunk.call +// CHECK:STDOUT: %.loc16_21.1: type = splice_block %.loc16_21.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc16: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc16_14.2: type = value_of_initializer %Bool.call.loc16 [concrete = bool] -// CHECK:STDOUT: %.loc16_14.3: type = converted %Bool.call.loc16, %.loc16_14.2 [concrete = bool] +// CHECK:STDOUT: %.loc16_21.2: type = value_of_initializer %Bool.call.loc16 [concrete = bool] +// CHECK:STDOUT: %.loc16_21.3: type = converted %Bool.call.loc16, %.loc16_21.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc16_24.3: ref bool = temporary %.loc16_24.1, %.loc16_24.2 -// CHECK:STDOUT: %.loc16_24.4: bool = acquire_value %.loc16_24.3 -// CHECK:STDOUT: %equal: bool = value_binding equal, %.loc16_24.4 +// CHECK:STDOUT: %.loc16_31.3: ref bool = temporary %.loc16_31.1, %.loc16_31.2 +// CHECK:STDOUT: %.loc16_31.4: bool = acquire_value %.loc16_31.3 +// CHECK:STDOUT: %equal: bool = value_binding equal, %.loc16_31.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %not_equal.patt: %pattern_type.831 = value_binding_pattern not_equal [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc23: ref %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc23: ref %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc23_18.1: type = splice_block %.loc23_18.3 [concrete = bool] { +// CHECK:STDOUT: %.loc23_25.1: type = splice_block %.loc23_25.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc23: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc23_18.2: type = value_of_initializer %Bool.call.loc23 [concrete = bool] -// CHECK:STDOUT: %.loc23_18.3: type = converted %Bool.call.loc23, %.loc23_18.2 [concrete = bool] +// CHECK:STDOUT: %.loc23_25.2: type = value_of_initializer %Bool.call.loc23 [concrete = bool] +// CHECK:STDOUT: %.loc23_25.3: type = converted %Bool.call.loc23, %.loc23_25.2 [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: %not_equal: bool = value_binding not_equal, [concrete = ] -// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc16_24.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc16_24.3) +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc16_31.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc16_31.3) // CHECK:STDOUT: %C.cpp_destructor.bound.loc13: = bound_method %c2.var, constants.%C.cpp_destructor // CHECK:STDOUT: %C.cpp_destructor.call.loc13: init %empty_tuple.type = call %C.cpp_destructor.bound.loc13(%c2.var) // CHECK:STDOUT: %C.cpp_destructor.bound.loc12: = bound_method %c1.var, constants.%C.cpp_destructor @@ -2488,24 +2488,24 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref: %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref: %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc10_24.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc10_21: ref %C = value_as_ref %c1.ref -// CHECK:STDOUT: %addr.loc10_24.1: %ptr.838 = addr_of %.loc10_21 -// CHECK:STDOUT: %.loc10_26: ref %C = value_as_ref %c2.ref -// CHECK:STDOUT: %addr.loc10_24.2: %ptr.838 = addr_of %.loc10_26 -// CHECK:STDOUT: %addr.loc10_24.3: %ptr.838 = addr_of %.loc10_24.1 -// CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc10_24.1, %addr.loc10_24.2, %addr.loc10_24.3) -// CHECK:STDOUT: %.loc10_24.2: init %C to %.loc10_24.1 = mark_in_place_init %operator_Plus__carbon_thunk.call -// CHECK:STDOUT: %.loc10_16: type = splice_block %C.ref.loc10 [concrete = constants.%C] { +// CHECK:STDOUT: %.loc10_31.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc10_28: ref %C = value_as_ref %c1.ref +// CHECK:STDOUT: %addr.loc10_31.1: %ptr.838 = addr_of %.loc10_28 +// CHECK:STDOUT: %.loc10_33: ref %C = value_as_ref %c2.ref +// CHECK:STDOUT: %addr.loc10_31.2: %ptr.838 = addr_of %.loc10_33 +// CHECK:STDOUT: %addr.loc10_31.3: %ptr.838 = addr_of %.loc10_31.1 +// CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc10_31.1, %addr.loc10_31.2, %addr.loc10_31.3) +// CHECK:STDOUT: %.loc10_31.2: init %C to %.loc10_31.1 = mark_in_place_init %operator_Plus__carbon_thunk.call +// CHECK:STDOUT: %.loc10_23: type = splice_block %C.ref.loc10 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N.ref.loc10: = name_ref N, imports.%N [concrete = imports.%N] // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc10_24.3: ref %C = temporary %.loc10_24.1, %.loc10_24.2 -// CHECK:STDOUT: %.loc10_24.4: %C = acquire_value %.loc10_24.3 -// CHECK:STDOUT: %c3: %C = value_binding c3, %.loc10_24.4 -// CHECK:STDOUT: %C.cpp_destructor.bound.loc10: = bound_method %.loc10_24.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%.loc10_24.3) +// CHECK:STDOUT: %.loc10_31.3: ref %C = temporary %.loc10_31.1, %.loc10_31.2 +// CHECK:STDOUT: %.loc10_31.4: %C = acquire_value %.loc10_31.3 +// CHECK:STDOUT: %c3: %C = value_binding c3, %.loc10_31.4 +// CHECK:STDOUT: %C.cpp_destructor.bound.loc10: = bound_method %.loc10_31.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%.loc10_31.3) // CHECK:STDOUT: %C.cpp_destructor.bound.loc9: = bound_method %.loc9_31.3, constants.%C.cpp_destructor // CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_31.3) // CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %.loc8_31.3, constants.%C.cpp_destructor @@ -2626,47 +2626,47 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref.loc10: %C1 = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref.loc10: %C2 = name_ref c2, %c2 -// CHECK:STDOUT: %.loc10_26.1: ref %C2 = temporary_storage -// CHECK:STDOUT: %.loc10_23: ref %C1 = value_as_ref %c1.ref.loc10 -// CHECK:STDOUT: %addr.loc10_26.1: %ptr.087 = addr_of %.loc10_23 -// CHECK:STDOUT: %.loc10_28: ref %C2 = value_as_ref %c2.ref.loc10 -// CHECK:STDOUT: %addr.loc10_26.2: %ptr.51f = addr_of %.loc10_28 -// CHECK:STDOUT: %addr.loc10_26.3: %ptr.51f = addr_of %.loc10_26.1 -// CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc10_26.1, %addr.loc10_26.2, %addr.loc10_26.3) -// CHECK:STDOUT: %.loc10_26.2: init %C2 to %.loc10_26.1 = mark_in_place_init %operator_Plus__carbon_thunk.call -// CHECK:STDOUT: %.loc10_17: type = splice_block %C2.ref.loc10 [concrete = constants.%C2] { +// CHECK:STDOUT: %.loc10_33.1: ref %C2 = temporary_storage +// CHECK:STDOUT: %.loc10_30: ref %C1 = value_as_ref %c1.ref.loc10 +// CHECK:STDOUT: %addr.loc10_33.1: %ptr.087 = addr_of %.loc10_30 +// CHECK:STDOUT: %.loc10_35: ref %C2 = value_as_ref %c2.ref.loc10 +// CHECK:STDOUT: %addr.loc10_33.2: %ptr.51f = addr_of %.loc10_35 +// CHECK:STDOUT: %addr.loc10_33.3: %ptr.51f = addr_of %.loc10_33.1 +// CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc10_33.1, %addr.loc10_33.2, %addr.loc10_33.3) +// CHECK:STDOUT: %.loc10_33.2: init %C2 to %.loc10_33.1 = mark_in_place_init %operator_Plus__carbon_thunk.call +// CHECK:STDOUT: %.loc10_24: type = splice_block %C2.ref.loc10 [concrete = constants.%C2] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N2.ref.loc10: = name_ref N2, imports.%N2 [concrete = imports.%N2] // CHECK:STDOUT: %C2.ref.loc10: type = name_ref C2, imports.%C2.decl [concrete = constants.%C2] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc10_26.3: ref %C2 = temporary %.loc10_26.1, %.loc10_26.2 -// CHECK:STDOUT: %.loc10_26.4: %C2 = acquire_value %.loc10_26.3 -// CHECK:STDOUT: %c3: %C2 = value_binding c3, %.loc10_26.4 +// CHECK:STDOUT: %.loc10_33.3: ref %C2 = temporary %.loc10_33.1, %.loc10_33.2 +// CHECK:STDOUT: %.loc10_33.4: %C2 = acquire_value %.loc10_33.3 +// CHECK:STDOUT: %c3: %C2 = value_binding c3, %.loc10_33.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c4.patt: %pattern_type.846 = value_binding_pattern c4 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c2.ref.loc11: %C2 = name_ref c2, %c2 // CHECK:STDOUT: %c1.ref.loc11: %C1 = name_ref c1, %c1 -// CHECK:STDOUT: %.loc11_26.1: ref %C2 = temporary_storage -// CHECK:STDOUT: %.loc11_23: ref %C2 = value_as_ref %c2.ref.loc11 -// CHECK:STDOUT: %addr.loc11_26.1: %ptr.51f = addr_of %.loc11_23 -// CHECK:STDOUT: %.loc11_28: ref %C1 = value_as_ref %c1.ref.loc11 -// CHECK:STDOUT: %addr.loc11_26.2: %ptr.087 = addr_of %.loc11_28 -// CHECK:STDOUT: %addr.loc11_26.3: %ptr.51f = addr_of %.loc11_26.1 -// CHECK:STDOUT: %operator_Minus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Minus__carbon_thunk.decl(%addr.loc11_26.1, %addr.loc11_26.2, %addr.loc11_26.3) -// CHECK:STDOUT: %.loc11_26.2: init %C2 to %.loc11_26.1 = mark_in_place_init %operator_Minus__carbon_thunk.call -// CHECK:STDOUT: %.loc11_17: type = splice_block %C2.ref.loc11 [concrete = constants.%C2] { +// CHECK:STDOUT: %.loc11_33.1: ref %C2 = temporary_storage +// CHECK:STDOUT: %.loc11_30: ref %C2 = value_as_ref %c2.ref.loc11 +// CHECK:STDOUT: %addr.loc11_33.1: %ptr.51f = addr_of %.loc11_30 +// CHECK:STDOUT: %.loc11_35: ref %C1 = value_as_ref %c1.ref.loc11 +// CHECK:STDOUT: %addr.loc11_33.2: %ptr.087 = addr_of %.loc11_35 +// CHECK:STDOUT: %addr.loc11_33.3: %ptr.51f = addr_of %.loc11_33.1 +// CHECK:STDOUT: %operator_Minus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Minus__carbon_thunk.decl(%addr.loc11_33.1, %addr.loc11_33.2, %addr.loc11_33.3) +// CHECK:STDOUT: %.loc11_33.2: init %C2 to %.loc11_33.1 = mark_in_place_init %operator_Minus__carbon_thunk.call +// CHECK:STDOUT: %.loc11_24: type = splice_block %C2.ref.loc11 [concrete = constants.%C2] { // CHECK:STDOUT: %Cpp.ref.loc11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N2.ref.loc11: = name_ref N2, imports.%N2 [concrete = imports.%N2] // CHECK:STDOUT: %C2.ref.loc11: type = name_ref C2, imports.%C2.decl [concrete = constants.%C2] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11_26.3: ref %C2 = temporary %.loc11_26.1, %.loc11_26.2 -// CHECK:STDOUT: %.loc11_26.4: %C2 = acquire_value %.loc11_26.3 -// CHECK:STDOUT: %c4: %C2 = value_binding c4, %.loc11_26.4 -// CHECK:STDOUT: %C2.cpp_destructor.bound.loc11: = bound_method %.loc11_26.3, constants.%C2.cpp_destructor -// CHECK:STDOUT: %C2.cpp_destructor.call.loc11: init %empty_tuple.type = call %C2.cpp_destructor.bound.loc11(%.loc11_26.3) -// CHECK:STDOUT: %C2.cpp_destructor.bound.loc10: = bound_method %.loc10_26.3, constants.%C2.cpp_destructor -// CHECK:STDOUT: %C2.cpp_destructor.call.loc10: init %empty_tuple.type = call %C2.cpp_destructor.bound.loc10(%.loc10_26.3) +// CHECK:STDOUT: %.loc11_33.3: ref %C2 = temporary %.loc11_33.1, %.loc11_33.2 +// CHECK:STDOUT: %.loc11_33.4: %C2 = acquire_value %.loc11_33.3 +// CHECK:STDOUT: %c4: %C2 = value_binding c4, %.loc11_33.4 +// CHECK:STDOUT: %C2.cpp_destructor.bound.loc11: = bound_method %.loc11_33.3, constants.%C2.cpp_destructor +// CHECK:STDOUT: %C2.cpp_destructor.call.loc11: init %empty_tuple.type = call %C2.cpp_destructor.bound.loc11(%.loc11_33.3) +// CHECK:STDOUT: %C2.cpp_destructor.bound.loc10: = bound_method %.loc10_33.3, constants.%C2.cpp_destructor +// CHECK:STDOUT: %C2.cpp_destructor.call.loc10: init %empty_tuple.type = call %C2.cpp_destructor.bound.loc10(%.loc10_33.3) // CHECK:STDOUT: %C2.cpp_destructor.bound.loc9: = bound_method %.loc9_36.3, constants.%C2.cpp_destructor // CHECK:STDOUT: %C2.cpp_destructor.call.loc9: init %empty_tuple.type = call %C2.cpp_destructor.bound.loc9(%.loc9_36.3) // CHECK:STDOUT: %C1.cpp_destructor.bound: = bound_method %.loc8_36.3, constants.%C1.cpp_destructor @@ -2848,24 +2848,24 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref: %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref: %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc10_24.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc10_21: ref %C = value_as_ref %c1.ref -// CHECK:STDOUT: %addr.loc10_24.1: %ptr.de2 = addr_of %.loc10_21 -// CHECK:STDOUT: %.loc10_26: ref %C = value_as_ref %c2.ref -// CHECK:STDOUT: %addr.loc10_24.2: %ptr.de2 = addr_of %.loc10_26 -// CHECK:STDOUT: %addr.loc10_24.3: %ptr.de2 = addr_of %.loc10_24.1 -// CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc10_24.1, %addr.loc10_24.2, %addr.loc10_24.3) -// CHECK:STDOUT: %.loc10_24.2: init %C to %.loc10_24.1 = mark_in_place_init %operator_Plus__carbon_thunk.call -// CHECK:STDOUT: %.loc10_16: type = splice_block %C.ref.loc10 [concrete = constants.%C] { +// CHECK:STDOUT: %.loc10_31.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc10_28: ref %C = value_as_ref %c1.ref +// CHECK:STDOUT: %addr.loc10_31.1: %ptr.de2 = addr_of %.loc10_28 +// CHECK:STDOUT: %.loc10_33: ref %C = value_as_ref %c2.ref +// CHECK:STDOUT: %addr.loc10_31.2: %ptr.de2 = addr_of %.loc10_33 +// CHECK:STDOUT: %addr.loc10_31.3: %ptr.de2 = addr_of %.loc10_31.1 +// CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc10_31.1, %addr.loc10_31.2, %addr.loc10_31.3) +// CHECK:STDOUT: %.loc10_31.2: init %C to %.loc10_31.1 = mark_in_place_init %operator_Plus__carbon_thunk.call +// CHECK:STDOUT: %.loc10_23: type = splice_block %C.ref.loc10 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %O.ref.loc10: type = name_ref O, imports.%O.decl [concrete = constants.%O] // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc10_24.3: ref %C = temporary %.loc10_24.1, %.loc10_24.2 -// CHECK:STDOUT: %.loc10_24.4: %C = acquire_value %.loc10_24.3 -// CHECK:STDOUT: %c3: %C = value_binding c3, %.loc10_24.4 -// CHECK:STDOUT: %C.cpp_destructor.bound.loc10: = bound_method %.loc10_24.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%.loc10_24.3) +// CHECK:STDOUT: %.loc10_31.3: ref %C = temporary %.loc10_31.1, %.loc10_31.2 +// CHECK:STDOUT: %.loc10_31.4: %C = acquire_value %.loc10_31.3 +// CHECK:STDOUT: %c3: %C = value_binding c3, %.loc10_31.4 +// CHECK:STDOUT: %C.cpp_destructor.bound.loc10: = bound_method %.loc10_31.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%.loc10_31.3) // CHECK:STDOUT: %C.cpp_destructor.bound.loc9: = bound_method %.loc9_31.3, constants.%C.cpp_destructor // CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_31.3) // CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %.loc8_31.3, constants.%C.cpp_destructor @@ -2964,25 +2964,25 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref: %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref: %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc10_26.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc10_23: ref %C = value_as_ref %c1.ref -// CHECK:STDOUT: %addr.loc10_26.1: %ptr.4b2 = addr_of %.loc10_23 -// CHECK:STDOUT: %.loc10_28: ref %C = value_as_ref %c2.ref -// CHECK:STDOUT: %addr.loc10_26.2: %ptr.4b2 = addr_of %.loc10_28 -// CHECK:STDOUT: %addr.loc10_26.3: %ptr.4b2 = addr_of %.loc10_26.1 -// CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc10_26.1, %addr.loc10_26.2, %addr.loc10_26.3) -// CHECK:STDOUT: %.loc10_26.2: init %C to %.loc10_26.1 = mark_in_place_init %operator_Plus__carbon_thunk.call -// CHECK:STDOUT: %.loc10_18: type = splice_block %C.ref.loc10 [concrete = constants.%C] { +// CHECK:STDOUT: %.loc10_33.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc10_30: ref %C = value_as_ref %c1.ref +// CHECK:STDOUT: %addr.loc10_33.1: %ptr.4b2 = addr_of %.loc10_30 +// CHECK:STDOUT: %.loc10_35: ref %C = value_as_ref %c2.ref +// CHECK:STDOUT: %addr.loc10_33.2: %ptr.4b2 = addr_of %.loc10_35 +// CHECK:STDOUT: %addr.loc10_33.3: %ptr.4b2 = addr_of %.loc10_33.1 +// CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc10_33.1, %addr.loc10_33.2, %addr.loc10_33.3) +// CHECK:STDOUT: %.loc10_33.2: init %C to %.loc10_33.1 = mark_in_place_init %operator_Plus__carbon_thunk.call +// CHECK:STDOUT: %.loc10_25: type = splice_block %C.ref.loc10 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N.ref.loc10: = name_ref N, imports.%N [concrete = imports.%N] // CHECK:STDOUT: %O.ref.loc10: type = name_ref O, imports.%O.decl [concrete = constants.%O] // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc10_26.3: ref %C = temporary %.loc10_26.1, %.loc10_26.2 -// CHECK:STDOUT: %.loc10_26.4: %C = acquire_value %.loc10_26.3 -// CHECK:STDOUT: %c3: %C = value_binding c3, %.loc10_26.4 -// CHECK:STDOUT: %C.cpp_destructor.bound.loc10: = bound_method %.loc10_26.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%.loc10_26.3) +// CHECK:STDOUT: %.loc10_33.3: ref %C = temporary %.loc10_33.1, %.loc10_33.2 +// CHECK:STDOUT: %.loc10_33.4: %C = acquire_value %.loc10_33.3 +// CHECK:STDOUT: %c3: %C = value_binding c3, %.loc10_33.4 +// CHECK:STDOUT: %C.cpp_destructor.bound.loc10: = bound_method %.loc10_33.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%.loc10_33.3) // CHECK:STDOUT: %C.cpp_destructor.bound.loc9: = bound_method %.loc9_35.3, constants.%C.cpp_destructor // CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_35.3) // CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %.loc8_35.3, constants.%C.cpp_destructor @@ -3101,14 +3101,14 @@ fn F() { // CHECK:STDOUT: %c2.ref: ref %C = name_ref c2, %c2 // CHECK:STDOUT: %C.cpp_operator.bound.loc10: = bound_method %c1.ref.loc10, imports.%C.cpp_operator.decl.828f43.2 // CHECK:STDOUT: %.loc10_3: ref %C = splice_block %c3.var {} -// CHECK:STDOUT: %.loc10_24.1: %C = acquire_value %c2.ref -// CHECK:STDOUT: %.loc10_24.2: ref %C = value_as_ref %.loc10_24.1 -// CHECK:STDOUT: %addr.loc10_22.1: %ptr.d9e = addr_of %.loc10_24.2 -// CHECK:STDOUT: %addr.loc10_22.2: %ptr.d9e = addr_of %.loc10_3 -// CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%c1.ref.loc10, %addr.loc10_22.1, %addr.loc10_22.2) -// CHECK:STDOUT: %.loc10_22: init %C to %.loc10_3 = mark_in_place_init %operator_Plus__carbon_thunk.call -// CHECK:STDOUT: assign %c3.var, %.loc10_22 -// CHECK:STDOUT: %.loc10_14: type = splice_block %C.ref.loc10 [concrete = constants.%C] { +// CHECK:STDOUT: %.loc10_31.1: %C = acquire_value %c2.ref +// CHECK:STDOUT: %.loc10_31.2: ref %C = value_as_ref %.loc10_31.1 +// CHECK:STDOUT: %addr.loc10_29.1: %ptr.d9e = addr_of %.loc10_31.2 +// CHECK:STDOUT: %addr.loc10_29.2: %ptr.d9e = addr_of %.loc10_3 +// CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%c1.ref.loc10, %addr.loc10_29.1, %addr.loc10_29.2) +// CHECK:STDOUT: %.loc10_29: init %C to %.loc10_3 = mark_in_place_init %operator_Plus__carbon_thunk.call +// CHECK:STDOUT: assign %c3.var, %.loc10_29 +// CHECK:STDOUT: %.loc10_21: type = splice_block %C.ref.loc10 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } @@ -3187,23 +3187,23 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %c1.ref: %C = name_ref c1, %c1 // CHECK:STDOUT: %c2.ref: %C = name_ref c2, %c2 -// CHECK:STDOUT: %.loc10_22.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc10_19: ref %C = value_as_ref %c1.ref -// CHECK:STDOUT: %addr.loc10_22.1: %ptr.d9e = addr_of %.loc10_19 -// CHECK:STDOUT: %.loc10_24: ref %C = value_as_ref %c2.ref -// CHECK:STDOUT: %addr.loc10_22.2: %ptr.d9e = addr_of %.loc10_24 -// CHECK:STDOUT: %addr.loc10_22.3: %ptr.d9e = addr_of %.loc10_22.1 -// CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc10_22.1, %addr.loc10_22.2, %addr.loc10_22.3) -// CHECK:STDOUT: %.loc10_22.2: init %C to %.loc10_22.1 = mark_in_place_init %operator_Plus__carbon_thunk.call -// CHECK:STDOUT: %.loc10_14: type = splice_block %C.ref.loc10 [concrete = constants.%C] { +// CHECK:STDOUT: %.loc10_29.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc10_26: ref %C = value_as_ref %c1.ref +// CHECK:STDOUT: %addr.loc10_29.1: %ptr.d9e = addr_of %.loc10_26 +// CHECK:STDOUT: %.loc10_31: ref %C = value_as_ref %c2.ref +// CHECK:STDOUT: %addr.loc10_29.2: %ptr.d9e = addr_of %.loc10_31 +// CHECK:STDOUT: %addr.loc10_29.3: %ptr.d9e = addr_of %.loc10_29.1 +// CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc10_29.1, %addr.loc10_29.2, %addr.loc10_29.3) +// CHECK:STDOUT: %.loc10_29.2: init %C to %.loc10_29.1 = mark_in_place_init %operator_Plus__carbon_thunk.call +// CHECK:STDOUT: %.loc10_21: type = splice_block %C.ref.loc10 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc10_22.3: ref %C = temporary %.loc10_22.1, %.loc10_22.2 -// CHECK:STDOUT: %.loc10_22.4: %C = acquire_value %.loc10_22.3 -// CHECK:STDOUT: %c3: %C = value_binding c3, %.loc10_22.4 -// CHECK:STDOUT: %C.cpp_destructor.bound.loc10: = bound_method %.loc10_22.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%.loc10_22.3) +// CHECK:STDOUT: %.loc10_29.3: ref %C = temporary %.loc10_29.1, %.loc10_29.2 +// CHECK:STDOUT: %.loc10_29.4: %C = acquire_value %.loc10_29.3 +// CHECK:STDOUT: %c3: %C = value_binding c3, %.loc10_29.4 +// CHECK:STDOUT: %C.cpp_destructor.bound.loc10: = bound_method %.loc10_29.3, constants.%C.cpp_destructor +// CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%.loc10_29.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/overloads.carbon b/toolchain/check/testdata/interop/cpp/function/overloads.carbon index 5999efccbef4..b8bef73c6c1b 100644 --- a/toolchain/check/testdata/interop/cpp/function/overloads.carbon +++ b/toolchain/check/testdata/interop/cpp/function/overloads.carbon @@ -106,30 +106,30 @@ import Cpp library "int_literal.h"; fn F() { // i32_max - let a: i32 = Cpp.foo(2147483647); + let unused a: i32 = Cpp.foo(2147483647); // i32_max + 1 // It could fit to unsigned int, but only signed integers are considered, so assigned to long. // Decimal, hexadecimal and binary integer literals are treated the same when assigning a C++ type. - let b: i64 = Cpp.foo(2147483648); - let b_hexa: i64 = Cpp.foo(0x8000_0000); - let b_binary: i64 = Cpp.foo(0b1000_0000_0000_0000_0000_0000_0000_0000); + let unused b: i64 = Cpp.foo(2147483648); + let unused b_hexa: i64 = Cpp.foo(0x8000_0000); + let unused b_binary: i64 = Cpp.foo(0b1000_0000_0000_0000_0000_0000_0000_0000); // i64_max - let c: i64 = Cpp.foo(9223372036854775807); + let unused c: i64 = Cpp.foo(9223372036854775807); // i64_max + 1 // Could fit to unsigned long, but only signed integers are considered, so fitted to _int128. - let d: i128 = Cpp.foo(9223372036854775808); + let unused d: i128 = Cpp.foo(9223372036854775808); // u64_max - let e: i128 = Cpp.foo(18446744073709551615); + let unused e: i128 = Cpp.foo(18446744073709551615); // u64_max + 1 - let f: i128 = Cpp.foo(18446744073709551616); + let unused f: i128 = Cpp.foo(18446744073709551616); // i128_max - let g: i128 = Cpp.foo(170141183460469231731687303715884105727); + let unused g: i128 = Cpp.foo(170141183460469231731687303715884105727); } // --- fail_import_large_int_literal.carbon @@ -141,15 +141,15 @@ import Cpp library "int_literal.h"; fn F() { // TODO: get rid of the second error message here. // i128_max + 1 - // CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+8]]:25: error: integer value 170141183460469231731687303715884105728 too large to fit in a signed C++ integer type; requires 129 bits, but max is 128 [IntTooLargeForCppType] - // CHECK:STDERR: let h: i128 = Cpp.foo(170141183460469231731687303715884105728); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+8]]:32: error: integer value 170141183460469231731687303715884105728 too large to fit in a signed C++ integer type; requires 129 bits, but max is 128 [IntTooLargeForCppType] + // CHECK:STDERR: let unused h: i128 = Cpp.foo(170141183460469231731687303715884105728); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+4]]:25: error: call argument of type `Core.IntLiteral` is not supported [CppCallArgTypeNotSupported] - // CHECK:STDERR: let h: i128 = Cpp.foo(170141183460469231731687303715884105728); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+4]]:32: error: call argument of type `Core.IntLiteral` is not supported [CppCallArgTypeNotSupported] + // CHECK:STDERR: let unused h: i128 = Cpp.foo(170141183460469231731687303715884105728); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let h: i128 = Cpp.foo(170141183460469231731687303715884105728); + let unused h: i128 = Cpp.foo(170141183460469231731687303715884105728); } // --- negative_int_literal.h @@ -202,7 +202,7 @@ library "[[@TEST_NAME]]"; import Cpp library "floating_point_literal.h"; fn F() { - let d: f64 = Cpp.foo(1.0); + let unused d: f64 = Cpp.foo(1.0); } // --- fail_import_large_floating_point_literal.carbon @@ -777,15 +777,15 @@ import Cpp inline ''' interface I {} -fn EchoValue[ValueT:! I](value:! ValueT) {} +fn EchoValue[ValueT:! I](unused value:! ValueT) {} fn F() { // CHECK:STDERR: fail_missing_impl.carbon:[[@LINE+7]]:3: error: cannot convert type `` into type implementing `I` [ConversionFailureTypeToFacet] // CHECK:STDERR: EchoValue(Cpp.foo); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_missing_impl.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn EchoValue[ValueT:! I](value:! ValueT) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn EchoValue[ValueT:! I](unused value:! ValueT) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: EchoValue(Cpp.foo); } @@ -1529,20 +1529,20 @@ fn F() { // CHECK:STDOUT: %foo.ref.loc8: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value] // CHECK:STDOUT: %int_2147483647: Core.IntLiteral = int_value 2147483647 [concrete = constants.%int_2147483647.d89] // CHECK:STDOUT: %impl.elem0.loc8: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc8_24.1: = bound_method %int_2147483647, %impl.elem0.loc8 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.5e6] +// CHECK:STDOUT: %bound_method.loc8_31.1: = bound_method %int_2147483647, %impl.elem0.loc8 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.5e6] // CHECK:STDOUT: %specific_fn.loc8: = specific_function %impl.elem0.loc8, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.709] -// CHECK:STDOUT: %bound_method.loc8_24.2: = bound_method %int_2147483647, %specific_fn.loc8 [concrete = constants.%bound_method.076] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8: init %i32 = call %bound_method.loc8_24.2(%int_2147483647) [concrete = constants.%int_2147483647.a74] -// CHECK:STDOUT: %.loc8_24.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8 [concrete = constants.%int_2147483647.a74] -// CHECK:STDOUT: %.loc8_24.2: %i32 = converted %int_2147483647, %.loc8_24.1 [concrete = constants.%int_2147483647.a74] -// CHECK:STDOUT: %foo.call.loc8: init %i32 = call imports.%foo.decl.bd967b.1(%.loc8_24.2) -// CHECK:STDOUT: %.loc8_10: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %bound_method.loc8_31.2: = bound_method %int_2147483647, %specific_fn.loc8 [concrete = constants.%bound_method.076] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8: init %i32 = call %bound_method.loc8_31.2(%int_2147483647) [concrete = constants.%int_2147483647.a74] +// CHECK:STDOUT: %.loc8_31.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8 [concrete = constants.%int_2147483647.a74] +// CHECK:STDOUT: %.loc8_31.2: %i32 = converted %int_2147483647, %.loc8_31.1 [concrete = constants.%int_2147483647.a74] +// CHECK:STDOUT: %foo.call.loc8: init %i32 = call imports.%foo.decl.bd967b.1(%.loc8_31.2) +// CHECK:STDOUT: %.loc8_17: type = splice_block %i32 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_34.1: %i32 = value_of_initializer %foo.call.loc8 -// CHECK:STDOUT: %.loc8_34.2: %i32 = converted %foo.call.loc8, %.loc8_34.1 -// CHECK:STDOUT: %a: %i32 = value_binding a, %.loc8_34.2 +// CHECK:STDOUT: %.loc8_41.1: %i32 = value_of_initializer %foo.call.loc8 +// CHECK:STDOUT: %.loc8_41.2: %i32 = converted %foo.call.loc8, %.loc8_41.1 +// CHECK:STDOUT: %a: %i32 = value_binding a, %.loc8_41.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.95b = value_binding_pattern b [concrete] // CHECK:STDOUT: } @@ -1550,20 +1550,20 @@ fn F() { // CHECK:STDOUT: %foo.ref.loc13: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value] // CHECK:STDOUT: %int_2147483648.loc13: Core.IntLiteral = int_value 2147483648 [concrete = constants.%int_2147483648.1db] // CHECK:STDOUT: %impl.elem0.loc13: %.a64 = impl_witness_access constants.%ImplicitAs.impl_witness.556, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.57d] -// CHECK:STDOUT: %bound_method.loc13_24.1: = bound_method %int_2147483648.loc13, %impl.elem0.loc13 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.8a4] +// CHECK:STDOUT: %bound_method.loc13_31.1: = bound_method %int_2147483648.loc13, %impl.elem0.loc13 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.8a4] // CHECK:STDOUT: %specific_fn.loc13: = specific_function %impl.elem0.loc13, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.8d7] -// CHECK:STDOUT: %bound_method.loc13_24.2: = bound_method %int_2147483648.loc13, %specific_fn.loc13 [concrete = constants.%bound_method.41d] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13: init %i64 = call %bound_method.loc13_24.2(%int_2147483648.loc13) [concrete = constants.%int_2147483648.e1f] -// CHECK:STDOUT: %.loc13_24.1: %i64 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13 [concrete = constants.%int_2147483648.e1f] -// CHECK:STDOUT: %.loc13_24.2: %i64 = converted %int_2147483648.loc13, %.loc13_24.1 [concrete = constants.%int_2147483648.e1f] -// CHECK:STDOUT: %foo.call.loc13: init %i64 = call imports.%foo.decl.bd967b.2(%.loc13_24.2) -// CHECK:STDOUT: %.loc13_10: type = splice_block %i64.loc13 [concrete = constants.%i64] { +// CHECK:STDOUT: %bound_method.loc13_31.2: = bound_method %int_2147483648.loc13, %specific_fn.loc13 [concrete = constants.%bound_method.41d] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13: init %i64 = call %bound_method.loc13_31.2(%int_2147483648.loc13) [concrete = constants.%int_2147483648.e1f] +// CHECK:STDOUT: %.loc13_31.1: %i64 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13 [concrete = constants.%int_2147483648.e1f] +// CHECK:STDOUT: %.loc13_31.2: %i64 = converted %int_2147483648.loc13, %.loc13_31.1 [concrete = constants.%int_2147483648.e1f] +// CHECK:STDOUT: %foo.call.loc13: init %i64 = call imports.%foo.decl.bd967b.2(%.loc13_31.2) +// CHECK:STDOUT: %.loc13_17: type = splice_block %i64.loc13 [concrete = constants.%i64] { // CHECK:STDOUT: %int_64.loc13: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] // CHECK:STDOUT: %i64.loc13: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13_34.1: %i64 = value_of_initializer %foo.call.loc13 -// CHECK:STDOUT: %.loc13_34.2: %i64 = converted %foo.call.loc13, %.loc13_34.1 -// CHECK:STDOUT: %b: %i64 = value_binding b, %.loc13_34.2 +// CHECK:STDOUT: %.loc13_41.1: %i64 = value_of_initializer %foo.call.loc13 +// CHECK:STDOUT: %.loc13_41.2: %i64 = converted %foo.call.loc13, %.loc13_41.1 +// CHECK:STDOUT: %b: %i64 = value_binding b, %.loc13_41.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b_hexa.patt: %pattern_type.95b = value_binding_pattern b_hexa [concrete] // CHECK:STDOUT: } @@ -1571,20 +1571,20 @@ fn F() { // CHECK:STDOUT: %foo.ref.loc14: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value] // CHECK:STDOUT: %int_2147483648.loc14: Core.IntLiteral = int_value 2147483648 [concrete = constants.%int_2147483648.1db] // CHECK:STDOUT: %impl.elem0.loc14: %.a64 = impl_witness_access constants.%ImplicitAs.impl_witness.556, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.57d] -// CHECK:STDOUT: %bound_method.loc14_29.1: = bound_method %int_2147483648.loc14, %impl.elem0.loc14 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.8a4] +// CHECK:STDOUT: %bound_method.loc14_36.1: = bound_method %int_2147483648.loc14, %impl.elem0.loc14 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.8a4] // CHECK:STDOUT: %specific_fn.loc14: = specific_function %impl.elem0.loc14, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.8d7] -// CHECK:STDOUT: %bound_method.loc14_29.2: = bound_method %int_2147483648.loc14, %specific_fn.loc14 [concrete = constants.%bound_method.41d] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14: init %i64 = call %bound_method.loc14_29.2(%int_2147483648.loc14) [concrete = constants.%int_2147483648.e1f] -// CHECK:STDOUT: %.loc14_29.1: %i64 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14 [concrete = constants.%int_2147483648.e1f] -// CHECK:STDOUT: %.loc14_29.2: %i64 = converted %int_2147483648.loc14, %.loc14_29.1 [concrete = constants.%int_2147483648.e1f] -// CHECK:STDOUT: %foo.call.loc14: init %i64 = call imports.%foo.decl.bd967b.2(%.loc14_29.2) -// CHECK:STDOUT: %.loc14_15: type = splice_block %i64.loc14 [concrete = constants.%i64] { +// CHECK:STDOUT: %bound_method.loc14_36.2: = bound_method %int_2147483648.loc14, %specific_fn.loc14 [concrete = constants.%bound_method.41d] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14: init %i64 = call %bound_method.loc14_36.2(%int_2147483648.loc14) [concrete = constants.%int_2147483648.e1f] +// CHECK:STDOUT: %.loc14_36.1: %i64 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14 [concrete = constants.%int_2147483648.e1f] +// CHECK:STDOUT: %.loc14_36.2: %i64 = converted %int_2147483648.loc14, %.loc14_36.1 [concrete = constants.%int_2147483648.e1f] +// CHECK:STDOUT: %foo.call.loc14: init %i64 = call imports.%foo.decl.bd967b.2(%.loc14_36.2) +// CHECK:STDOUT: %.loc14_22: type = splice_block %i64.loc14 [concrete = constants.%i64] { // CHECK:STDOUT: %int_64.loc14: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] // CHECK:STDOUT: %i64.loc14: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc14_40.1: %i64 = value_of_initializer %foo.call.loc14 -// CHECK:STDOUT: %.loc14_40.2: %i64 = converted %foo.call.loc14, %.loc14_40.1 -// CHECK:STDOUT: %b_hexa: %i64 = value_binding b_hexa, %.loc14_40.2 +// CHECK:STDOUT: %.loc14_47.1: %i64 = value_of_initializer %foo.call.loc14 +// CHECK:STDOUT: %.loc14_47.2: %i64 = converted %foo.call.loc14, %.loc14_47.1 +// CHECK:STDOUT: %b_hexa: %i64 = value_binding b_hexa, %.loc14_47.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b_binary.patt: %pattern_type.95b = value_binding_pattern b_binary [concrete] // CHECK:STDOUT: } @@ -1592,20 +1592,20 @@ fn F() { // CHECK:STDOUT: %foo.ref.loc15: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value] // CHECK:STDOUT: %int_2147483648.loc15: Core.IntLiteral = int_value 2147483648 [concrete = constants.%int_2147483648.1db] // CHECK:STDOUT: %impl.elem0.loc15: %.a64 = impl_witness_access constants.%ImplicitAs.impl_witness.556, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.57d] -// CHECK:STDOUT: %bound_method.loc15_31.1: = bound_method %int_2147483648.loc15, %impl.elem0.loc15 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.8a4] +// CHECK:STDOUT: %bound_method.loc15_38.1: = bound_method %int_2147483648.loc15, %impl.elem0.loc15 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.8a4] // CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem0.loc15, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.8d7] -// CHECK:STDOUT: %bound_method.loc15_31.2: = bound_method %int_2147483648.loc15, %specific_fn.loc15 [concrete = constants.%bound_method.41d] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15: init %i64 = call %bound_method.loc15_31.2(%int_2147483648.loc15) [concrete = constants.%int_2147483648.e1f] -// CHECK:STDOUT: %.loc15_31.1: %i64 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15 [concrete = constants.%int_2147483648.e1f] -// CHECK:STDOUT: %.loc15_31.2: %i64 = converted %int_2147483648.loc15, %.loc15_31.1 [concrete = constants.%int_2147483648.e1f] -// CHECK:STDOUT: %foo.call.loc15: init %i64 = call imports.%foo.decl.bd967b.2(%.loc15_31.2) -// CHECK:STDOUT: %.loc15_17: type = splice_block %i64.loc15 [concrete = constants.%i64] { +// CHECK:STDOUT: %bound_method.loc15_38.2: = bound_method %int_2147483648.loc15, %specific_fn.loc15 [concrete = constants.%bound_method.41d] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15: init %i64 = call %bound_method.loc15_38.2(%int_2147483648.loc15) [concrete = constants.%int_2147483648.e1f] +// CHECK:STDOUT: %.loc15_38.1: %i64 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15 [concrete = constants.%int_2147483648.e1f] +// CHECK:STDOUT: %.loc15_38.2: %i64 = converted %int_2147483648.loc15, %.loc15_38.1 [concrete = constants.%int_2147483648.e1f] +// CHECK:STDOUT: %foo.call.loc15: init %i64 = call imports.%foo.decl.bd967b.2(%.loc15_38.2) +// CHECK:STDOUT: %.loc15_24: type = splice_block %i64.loc15 [concrete = constants.%i64] { // CHECK:STDOUT: %int_64.loc15: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] // CHECK:STDOUT: %i64.loc15: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15_72.1: %i64 = value_of_initializer %foo.call.loc15 -// CHECK:STDOUT: %.loc15_72.2: %i64 = converted %foo.call.loc15, %.loc15_72.1 -// CHECK:STDOUT: %b_binary: %i64 = value_binding b_binary, %.loc15_72.2 +// CHECK:STDOUT: %.loc15_79.1: %i64 = value_of_initializer %foo.call.loc15 +// CHECK:STDOUT: %.loc15_79.2: %i64 = converted %foo.call.loc15, %.loc15_79.1 +// CHECK:STDOUT: %b_binary: %i64 = value_binding b_binary, %.loc15_79.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c.patt: %pattern_type.95b = value_binding_pattern c [concrete] // CHECK:STDOUT: } @@ -1613,164 +1613,164 @@ fn F() { // CHECK:STDOUT: %foo.ref.loc18: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value] // CHECK:STDOUT: %int_9223372036854775807: Core.IntLiteral = int_value 9223372036854775807 [concrete = constants.%int_9223372036854775807.e6f] // CHECK:STDOUT: %impl.elem0.loc18: %.a64 = impl_witness_access constants.%ImplicitAs.impl_witness.556, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.57d] -// CHECK:STDOUT: %bound_method.loc18_24.1: = bound_method %int_9223372036854775807, %impl.elem0.loc18 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.6d9] +// CHECK:STDOUT: %bound_method.loc18_31.1: = bound_method %int_9223372036854775807, %impl.elem0.loc18 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.6d9] // CHECK:STDOUT: %specific_fn.loc18: = specific_function %impl.elem0.loc18, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.8d7] -// CHECK:STDOUT: %bound_method.loc18_24.2: = bound_method %int_9223372036854775807, %specific_fn.loc18 [concrete = constants.%bound_method.ef8] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18: init %i64 = call %bound_method.loc18_24.2(%int_9223372036854775807) [concrete = constants.%int_9223372036854775807.9c2] -// CHECK:STDOUT: %.loc18_24.1: %i64 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18 [concrete = constants.%int_9223372036854775807.9c2] -// CHECK:STDOUT: %.loc18_24.2: %i64 = converted %int_9223372036854775807, %.loc18_24.1 [concrete = constants.%int_9223372036854775807.9c2] -// CHECK:STDOUT: %foo.call.loc18: init %i64 = call imports.%foo.decl.bd967b.2(%.loc18_24.2) -// CHECK:STDOUT: %.loc18_10: type = splice_block %i64.loc18 [concrete = constants.%i64] { +// CHECK:STDOUT: %bound_method.loc18_31.2: = bound_method %int_9223372036854775807, %specific_fn.loc18 [concrete = constants.%bound_method.ef8] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18: init %i64 = call %bound_method.loc18_31.2(%int_9223372036854775807) [concrete = constants.%int_9223372036854775807.9c2] +// CHECK:STDOUT: %.loc18_31.1: %i64 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18 [concrete = constants.%int_9223372036854775807.9c2] +// CHECK:STDOUT: %.loc18_31.2: %i64 = converted %int_9223372036854775807, %.loc18_31.1 [concrete = constants.%int_9223372036854775807.9c2] +// CHECK:STDOUT: %foo.call.loc18: init %i64 = call imports.%foo.decl.bd967b.2(%.loc18_31.2) +// CHECK:STDOUT: %.loc18_17: type = splice_block %i64.loc18 [concrete = constants.%i64] { // CHECK:STDOUT: %int_64.loc18: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] // CHECK:STDOUT: %i64.loc18: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc18_43.1: %i64 = value_of_initializer %foo.call.loc18 -// CHECK:STDOUT: %.loc18_43.2: %i64 = converted %foo.call.loc18, %.loc18_43.1 -// CHECK:STDOUT: %c: %i64 = value_binding c, %.loc18_43.2 +// CHECK:STDOUT: %.loc18_50.1: %i64 = value_of_initializer %foo.call.loc18 +// CHECK:STDOUT: %.loc18_50.2: %i64 = converted %foo.call.loc18, %.loc18_50.1 +// CHECK:STDOUT: %c: %i64 = value_binding c, %.loc18_50.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %d.patt: %pattern_type.57d = value_binding_pattern d [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref.loc22: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo.ref.loc22: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value] // CHECK:STDOUT: %int_9223372036854775808: Core.IntLiteral = int_value 9223372036854775808 [concrete = constants.%int_9223372036854775808.293] -// CHECK:STDOUT: %impl.elem0.loc22_25.1: %.44c = impl_witness_access constants.%ImplicitAs.impl_witness.47a, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.75a] -// CHECK:STDOUT: %bound_method.loc22_25.1: = bound_method %int_9223372036854775808, %impl.elem0.loc22_25.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.6a8] -// CHECK:STDOUT: %specific_fn.loc22_25.1: = specific_function %impl.elem0.loc22_25.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_128) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.e59] -// CHECK:STDOUT: %bound_method.loc22_25.2: = bound_method %int_9223372036854775808, %specific_fn.loc22_25.1 [concrete = constants.%bound_method.561] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22: init %i128 = call %bound_method.loc22_25.2(%int_9223372036854775808) [concrete = constants.%int_9223372036854775808.f14] -// CHECK:STDOUT: %.loc22_25.1: %i128 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22 [concrete = constants.%int_9223372036854775808.f14] -// CHECK:STDOUT: %.loc22_25.2: %i128 = converted %int_9223372036854775808, %.loc22_25.1 [concrete = constants.%int_9223372036854775808.f14] -// CHECK:STDOUT: %.loc22_25.3: ref %i128 = temporary_storage -// CHECK:STDOUT: %impl.elem0.loc22_25.2: %.0e6 = impl_witness_access constants.%Copy.impl_witness.a35, element0 [concrete = constants.%Int.as.Copy.impl.Op.bc1] -// CHECK:STDOUT: %bound_method.loc22_25.3: = bound_method %.loc22_25.2, %impl.elem0.loc22_25.2 [concrete = constants.%Int.as.Copy.impl.Op.bound.def] -// CHECK:STDOUT: %specific_fn.loc22_25.2: = specific_function %impl.elem0.loc22_25.2, @Int.as.Copy.impl.Op(constants.%int_128) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc22_25.4: = bound_method %.loc22_25.2, %specific_fn.loc22_25.2 [concrete = constants.%bound_method.b4e] -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc22: init %i128 = call %bound_method.loc22_25.4(%.loc22_25.2) [concrete = constants.%int_9223372036854775808.f14] -// CHECK:STDOUT: %.loc22_25.4: ref %i128 = temporary %.loc22_25.3, %Int.as.Copy.impl.Op.call.loc22 -// CHECK:STDOUT: %addr.loc22_44.1: %ptr.974 = addr_of %.loc22_25.4 -// CHECK:STDOUT: %.loc22_44.1: ref %i128 = temporary_storage -// CHECK:STDOUT: %addr.loc22_44.2: %ptr.974 = addr_of %.loc22_44.1 -// CHECK:STDOUT: %foo__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc22_44.1, %addr.loc22_44.2) -// CHECK:STDOUT: %.loc22_44.2: init %i128 to %.loc22_44.1 = mark_in_place_init %foo__carbon_thunk.call.loc22 -// CHECK:STDOUT: %.loc22_10: type = splice_block %i128.loc22 [concrete = constants.%i128] { +// CHECK:STDOUT: %impl.elem0.loc22_32.1: %.44c = impl_witness_access constants.%ImplicitAs.impl_witness.47a, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.75a] +// CHECK:STDOUT: %bound_method.loc22_32.1: = bound_method %int_9223372036854775808, %impl.elem0.loc22_32.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.6a8] +// CHECK:STDOUT: %specific_fn.loc22_32.1: = specific_function %impl.elem0.loc22_32.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_128) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.e59] +// CHECK:STDOUT: %bound_method.loc22_32.2: = bound_method %int_9223372036854775808, %specific_fn.loc22_32.1 [concrete = constants.%bound_method.561] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22: init %i128 = call %bound_method.loc22_32.2(%int_9223372036854775808) [concrete = constants.%int_9223372036854775808.f14] +// CHECK:STDOUT: %.loc22_32.1: %i128 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22 [concrete = constants.%int_9223372036854775808.f14] +// CHECK:STDOUT: %.loc22_32.2: %i128 = converted %int_9223372036854775808, %.loc22_32.1 [concrete = constants.%int_9223372036854775808.f14] +// CHECK:STDOUT: %.loc22_32.3: ref %i128 = temporary_storage +// CHECK:STDOUT: %impl.elem0.loc22_32.2: %.0e6 = impl_witness_access constants.%Copy.impl_witness.a35, element0 [concrete = constants.%Int.as.Copy.impl.Op.bc1] +// CHECK:STDOUT: %bound_method.loc22_32.3: = bound_method %.loc22_32.2, %impl.elem0.loc22_32.2 [concrete = constants.%Int.as.Copy.impl.Op.bound.def] +// CHECK:STDOUT: %specific_fn.loc22_32.2: = specific_function %impl.elem0.loc22_32.2, @Int.as.Copy.impl.Op(constants.%int_128) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc22_32.4: = bound_method %.loc22_32.2, %specific_fn.loc22_32.2 [concrete = constants.%bound_method.b4e] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc22: init %i128 = call %bound_method.loc22_32.4(%.loc22_32.2) [concrete = constants.%int_9223372036854775808.f14] +// CHECK:STDOUT: %.loc22_32.4: ref %i128 = temporary %.loc22_32.3, %Int.as.Copy.impl.Op.call.loc22 +// CHECK:STDOUT: %addr.loc22_51.1: %ptr.974 = addr_of %.loc22_32.4 +// CHECK:STDOUT: %.loc22_51.1: ref %i128 = temporary_storage +// CHECK:STDOUT: %addr.loc22_51.2: %ptr.974 = addr_of %.loc22_51.1 +// CHECK:STDOUT: %foo__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc22_51.1, %addr.loc22_51.2) +// CHECK:STDOUT: %.loc22_51.2: init %i128 to %.loc22_51.1 = mark_in_place_init %foo__carbon_thunk.call.loc22 +// CHECK:STDOUT: %.loc22_17: type = splice_block %i128.loc22 [concrete = constants.%i128] { // CHECK:STDOUT: %int_128.loc22: Core.IntLiteral = int_value 128 [concrete = constants.%int_128] // CHECK:STDOUT: %i128.loc22: type = class_type @Int, @Int(constants.%int_128) [concrete = constants.%i128] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22_44.3: ref %i128 = temporary %.loc22_44.1, %.loc22_44.2 -// CHECK:STDOUT: %.loc22_44.4: %i128 = acquire_value %.loc22_44.3 -// CHECK:STDOUT: %d: %i128 = value_binding d, %.loc22_44.4 +// CHECK:STDOUT: %.loc22_51.3: ref %i128 = temporary %.loc22_51.1, %.loc22_51.2 +// CHECK:STDOUT: %.loc22_51.4: %i128 = acquire_value %.loc22_51.3 +// CHECK:STDOUT: %d: %i128 = value_binding d, %.loc22_51.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %e.patt: %pattern_type.57d = value_binding_pattern e [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref.loc25: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo.ref.loc25: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value] // CHECK:STDOUT: %int_18446744073709551615: Core.IntLiteral = int_value 18446744073709551615 [concrete = constants.%int_18446744073709551615.5ec] -// CHECK:STDOUT: %impl.elem0.loc25_25.1: %.44c = impl_witness_access constants.%ImplicitAs.impl_witness.47a, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.75a] -// CHECK:STDOUT: %bound_method.loc25_25.1: = bound_method %int_18446744073709551615, %impl.elem0.loc25_25.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.9ac] -// CHECK:STDOUT: %specific_fn.loc25_25.1: = specific_function %impl.elem0.loc25_25.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_128) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.e59] -// CHECK:STDOUT: %bound_method.loc25_25.2: = bound_method %int_18446744073709551615, %specific_fn.loc25_25.1 [concrete = constants.%bound_method.422] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25: init %i128 = call %bound_method.loc25_25.2(%int_18446744073709551615) [concrete = constants.%int_18446744073709551615.f56] -// CHECK:STDOUT: %.loc25_25.1: %i128 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25 [concrete = constants.%int_18446744073709551615.f56] -// CHECK:STDOUT: %.loc25_25.2: %i128 = converted %int_18446744073709551615, %.loc25_25.1 [concrete = constants.%int_18446744073709551615.f56] -// CHECK:STDOUT: %.loc25_25.3: ref %i128 = temporary_storage -// CHECK:STDOUT: %impl.elem0.loc25_25.2: %.0e6 = impl_witness_access constants.%Copy.impl_witness.a35, element0 [concrete = constants.%Int.as.Copy.impl.Op.bc1] -// CHECK:STDOUT: %bound_method.loc25_25.3: = bound_method %.loc25_25.2, %impl.elem0.loc25_25.2 [concrete = constants.%Int.as.Copy.impl.Op.bound.cf0] -// CHECK:STDOUT: %specific_fn.loc25_25.2: = specific_function %impl.elem0.loc25_25.2, @Int.as.Copy.impl.Op(constants.%int_128) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc25_25.4: = bound_method %.loc25_25.2, %specific_fn.loc25_25.2 [concrete = constants.%bound_method.2cb] -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc25: init %i128 = call %bound_method.loc25_25.4(%.loc25_25.2) [concrete = constants.%int_18446744073709551615.f56] -// CHECK:STDOUT: %.loc25_25.4: ref %i128 = temporary %.loc25_25.3, %Int.as.Copy.impl.Op.call.loc25 -// CHECK:STDOUT: %addr.loc25_45.1: %ptr.974 = addr_of %.loc25_25.4 -// CHECK:STDOUT: %.loc25_45.1: ref %i128 = temporary_storage -// CHECK:STDOUT: %addr.loc25_45.2: %ptr.974 = addr_of %.loc25_45.1 -// CHECK:STDOUT: %foo__carbon_thunk.call.loc25: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc25_45.1, %addr.loc25_45.2) -// CHECK:STDOUT: %.loc25_45.2: init %i128 to %.loc25_45.1 = mark_in_place_init %foo__carbon_thunk.call.loc25 -// CHECK:STDOUT: %.loc25_10: type = splice_block %i128.loc25 [concrete = constants.%i128] { +// CHECK:STDOUT: %impl.elem0.loc25_32.1: %.44c = impl_witness_access constants.%ImplicitAs.impl_witness.47a, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.75a] +// CHECK:STDOUT: %bound_method.loc25_32.1: = bound_method %int_18446744073709551615, %impl.elem0.loc25_32.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.9ac] +// CHECK:STDOUT: %specific_fn.loc25_32.1: = specific_function %impl.elem0.loc25_32.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_128) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.e59] +// CHECK:STDOUT: %bound_method.loc25_32.2: = bound_method %int_18446744073709551615, %specific_fn.loc25_32.1 [concrete = constants.%bound_method.422] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25: init %i128 = call %bound_method.loc25_32.2(%int_18446744073709551615) [concrete = constants.%int_18446744073709551615.f56] +// CHECK:STDOUT: %.loc25_32.1: %i128 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25 [concrete = constants.%int_18446744073709551615.f56] +// CHECK:STDOUT: %.loc25_32.2: %i128 = converted %int_18446744073709551615, %.loc25_32.1 [concrete = constants.%int_18446744073709551615.f56] +// CHECK:STDOUT: %.loc25_32.3: ref %i128 = temporary_storage +// CHECK:STDOUT: %impl.elem0.loc25_32.2: %.0e6 = impl_witness_access constants.%Copy.impl_witness.a35, element0 [concrete = constants.%Int.as.Copy.impl.Op.bc1] +// CHECK:STDOUT: %bound_method.loc25_32.3: = bound_method %.loc25_32.2, %impl.elem0.loc25_32.2 [concrete = constants.%Int.as.Copy.impl.Op.bound.cf0] +// CHECK:STDOUT: %specific_fn.loc25_32.2: = specific_function %impl.elem0.loc25_32.2, @Int.as.Copy.impl.Op(constants.%int_128) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc25_32.4: = bound_method %.loc25_32.2, %specific_fn.loc25_32.2 [concrete = constants.%bound_method.2cb] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc25: init %i128 = call %bound_method.loc25_32.4(%.loc25_32.2) [concrete = constants.%int_18446744073709551615.f56] +// CHECK:STDOUT: %.loc25_32.4: ref %i128 = temporary %.loc25_32.3, %Int.as.Copy.impl.Op.call.loc25 +// CHECK:STDOUT: %addr.loc25_52.1: %ptr.974 = addr_of %.loc25_32.4 +// CHECK:STDOUT: %.loc25_52.1: ref %i128 = temporary_storage +// CHECK:STDOUT: %addr.loc25_52.2: %ptr.974 = addr_of %.loc25_52.1 +// CHECK:STDOUT: %foo__carbon_thunk.call.loc25: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc25_52.1, %addr.loc25_52.2) +// CHECK:STDOUT: %.loc25_52.2: init %i128 to %.loc25_52.1 = mark_in_place_init %foo__carbon_thunk.call.loc25 +// CHECK:STDOUT: %.loc25_17: type = splice_block %i128.loc25 [concrete = constants.%i128] { // CHECK:STDOUT: %int_128.loc25: Core.IntLiteral = int_value 128 [concrete = constants.%int_128] // CHECK:STDOUT: %i128.loc25: type = class_type @Int, @Int(constants.%int_128) [concrete = constants.%i128] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc25_45.3: ref %i128 = temporary %.loc25_45.1, %.loc25_45.2 -// CHECK:STDOUT: %.loc25_45.4: %i128 = acquire_value %.loc25_45.3 -// CHECK:STDOUT: %e: %i128 = value_binding e, %.loc25_45.4 +// CHECK:STDOUT: %.loc25_52.3: ref %i128 = temporary %.loc25_52.1, %.loc25_52.2 +// CHECK:STDOUT: %.loc25_52.4: %i128 = acquire_value %.loc25_52.3 +// CHECK:STDOUT: %e: %i128 = value_binding e, %.loc25_52.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %f.patt: %pattern_type.57d = value_binding_pattern f [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref.loc28: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo.ref.loc28: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value] // CHECK:STDOUT: %int_18446744073709551616: Core.IntLiteral = int_value 18446744073709551616 [concrete = constants.%int_18446744073709551616.1ee] -// CHECK:STDOUT: %impl.elem0.loc28_25.1: %.44c = impl_witness_access constants.%ImplicitAs.impl_witness.47a, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.75a] -// CHECK:STDOUT: %bound_method.loc28_25.1: = bound_method %int_18446744073709551616, %impl.elem0.loc28_25.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.6a3] -// CHECK:STDOUT: %specific_fn.loc28_25.1: = specific_function %impl.elem0.loc28_25.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_128) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.e59] -// CHECK:STDOUT: %bound_method.loc28_25.2: = bound_method %int_18446744073709551616, %specific_fn.loc28_25.1 [concrete = constants.%bound_method.e31] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc28: init %i128 = call %bound_method.loc28_25.2(%int_18446744073709551616) [concrete = constants.%int_18446744073709551616.92b] -// CHECK:STDOUT: %.loc28_25.1: %i128 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc28 [concrete = constants.%int_18446744073709551616.92b] -// CHECK:STDOUT: %.loc28_25.2: %i128 = converted %int_18446744073709551616, %.loc28_25.1 [concrete = constants.%int_18446744073709551616.92b] -// CHECK:STDOUT: %.loc28_25.3: ref %i128 = temporary_storage -// CHECK:STDOUT: %impl.elem0.loc28_25.2: %.0e6 = impl_witness_access constants.%Copy.impl_witness.a35, element0 [concrete = constants.%Int.as.Copy.impl.Op.bc1] -// CHECK:STDOUT: %bound_method.loc28_25.3: = bound_method %.loc28_25.2, %impl.elem0.loc28_25.2 [concrete = constants.%Int.as.Copy.impl.Op.bound.bcd] -// CHECK:STDOUT: %specific_fn.loc28_25.2: = specific_function %impl.elem0.loc28_25.2, @Int.as.Copy.impl.Op(constants.%int_128) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc28_25.4: = bound_method %.loc28_25.2, %specific_fn.loc28_25.2 [concrete = constants.%bound_method.6a9] -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc28: init %i128 = call %bound_method.loc28_25.4(%.loc28_25.2) [concrete = constants.%int_18446744073709551616.92b] -// CHECK:STDOUT: %.loc28_25.4: ref %i128 = temporary %.loc28_25.3, %Int.as.Copy.impl.Op.call.loc28 -// CHECK:STDOUT: %addr.loc28_45.1: %ptr.974 = addr_of %.loc28_25.4 -// CHECK:STDOUT: %.loc28_45.1: ref %i128 = temporary_storage -// CHECK:STDOUT: %addr.loc28_45.2: %ptr.974 = addr_of %.loc28_45.1 -// CHECK:STDOUT: %foo__carbon_thunk.call.loc28: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc28_45.1, %addr.loc28_45.2) -// CHECK:STDOUT: %.loc28_45.2: init %i128 to %.loc28_45.1 = mark_in_place_init %foo__carbon_thunk.call.loc28 -// CHECK:STDOUT: %.loc28_10: type = splice_block %i128.loc28 [concrete = constants.%i128] { +// CHECK:STDOUT: %impl.elem0.loc28_32.1: %.44c = impl_witness_access constants.%ImplicitAs.impl_witness.47a, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.75a] +// CHECK:STDOUT: %bound_method.loc28_32.1: = bound_method %int_18446744073709551616, %impl.elem0.loc28_32.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.6a3] +// CHECK:STDOUT: %specific_fn.loc28_32.1: = specific_function %impl.elem0.loc28_32.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_128) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.e59] +// CHECK:STDOUT: %bound_method.loc28_32.2: = bound_method %int_18446744073709551616, %specific_fn.loc28_32.1 [concrete = constants.%bound_method.e31] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc28: init %i128 = call %bound_method.loc28_32.2(%int_18446744073709551616) [concrete = constants.%int_18446744073709551616.92b] +// CHECK:STDOUT: %.loc28_32.1: %i128 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc28 [concrete = constants.%int_18446744073709551616.92b] +// CHECK:STDOUT: %.loc28_32.2: %i128 = converted %int_18446744073709551616, %.loc28_32.1 [concrete = constants.%int_18446744073709551616.92b] +// CHECK:STDOUT: %.loc28_32.3: ref %i128 = temporary_storage +// CHECK:STDOUT: %impl.elem0.loc28_32.2: %.0e6 = impl_witness_access constants.%Copy.impl_witness.a35, element0 [concrete = constants.%Int.as.Copy.impl.Op.bc1] +// CHECK:STDOUT: %bound_method.loc28_32.3: = bound_method %.loc28_32.2, %impl.elem0.loc28_32.2 [concrete = constants.%Int.as.Copy.impl.Op.bound.bcd] +// CHECK:STDOUT: %specific_fn.loc28_32.2: = specific_function %impl.elem0.loc28_32.2, @Int.as.Copy.impl.Op(constants.%int_128) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc28_32.4: = bound_method %.loc28_32.2, %specific_fn.loc28_32.2 [concrete = constants.%bound_method.6a9] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc28: init %i128 = call %bound_method.loc28_32.4(%.loc28_32.2) [concrete = constants.%int_18446744073709551616.92b] +// CHECK:STDOUT: %.loc28_32.4: ref %i128 = temporary %.loc28_32.3, %Int.as.Copy.impl.Op.call.loc28 +// CHECK:STDOUT: %addr.loc28_52.1: %ptr.974 = addr_of %.loc28_32.4 +// CHECK:STDOUT: %.loc28_52.1: ref %i128 = temporary_storage +// CHECK:STDOUT: %addr.loc28_52.2: %ptr.974 = addr_of %.loc28_52.1 +// CHECK:STDOUT: %foo__carbon_thunk.call.loc28: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc28_52.1, %addr.loc28_52.2) +// CHECK:STDOUT: %.loc28_52.2: init %i128 to %.loc28_52.1 = mark_in_place_init %foo__carbon_thunk.call.loc28 +// CHECK:STDOUT: %.loc28_17: type = splice_block %i128.loc28 [concrete = constants.%i128] { // CHECK:STDOUT: %int_128.loc28: Core.IntLiteral = int_value 128 [concrete = constants.%int_128] // CHECK:STDOUT: %i128.loc28: type = class_type @Int, @Int(constants.%int_128) [concrete = constants.%i128] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc28_45.3: ref %i128 = temporary %.loc28_45.1, %.loc28_45.2 -// CHECK:STDOUT: %.loc28_45.4: %i128 = acquire_value %.loc28_45.3 -// CHECK:STDOUT: %f: %i128 = value_binding f, %.loc28_45.4 +// CHECK:STDOUT: %.loc28_52.3: ref %i128 = temporary %.loc28_52.1, %.loc28_52.2 +// CHECK:STDOUT: %.loc28_52.4: %i128 = acquire_value %.loc28_52.3 +// CHECK:STDOUT: %f: %i128 = value_binding f, %.loc28_52.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %g.patt: %pattern_type.57d = value_binding_pattern g [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref.loc31: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo.ref.loc31: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value] // CHECK:STDOUT: %int_170141183460469231731687303715884105727: Core.IntLiteral = int_value 170141183460469231731687303715884105727 [concrete = constants.%int_170141183460469231731687303715884105727.fea] -// CHECK:STDOUT: %impl.elem0.loc31_25.1: %.44c = impl_witness_access constants.%ImplicitAs.impl_witness.47a, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.75a] -// CHECK:STDOUT: %bound_method.loc31_25.1: = bound_method %int_170141183460469231731687303715884105727, %impl.elem0.loc31_25.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.8e8] -// CHECK:STDOUT: %specific_fn.loc31_25.1: = specific_function %impl.elem0.loc31_25.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_128) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.e59] -// CHECK:STDOUT: %bound_method.loc31_25.2: = bound_method %int_170141183460469231731687303715884105727, %specific_fn.loc31_25.1 [concrete = constants.%bound_method.d00] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc31: init %i128 = call %bound_method.loc31_25.2(%int_170141183460469231731687303715884105727) [concrete = constants.%int_170141183460469231731687303715884105727.ff5] -// CHECK:STDOUT: %.loc31_25.1: %i128 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc31 [concrete = constants.%int_170141183460469231731687303715884105727.ff5] -// CHECK:STDOUT: %.loc31_25.2: %i128 = converted %int_170141183460469231731687303715884105727, %.loc31_25.1 [concrete = constants.%int_170141183460469231731687303715884105727.ff5] -// CHECK:STDOUT: %.loc31_25.3: ref %i128 = temporary_storage -// CHECK:STDOUT: %impl.elem0.loc31_25.2: %.0e6 = impl_witness_access constants.%Copy.impl_witness.a35, element0 [concrete = constants.%Int.as.Copy.impl.Op.bc1] -// CHECK:STDOUT: %bound_method.loc31_25.3: = bound_method %.loc31_25.2, %impl.elem0.loc31_25.2 [concrete = constants.%Int.as.Copy.impl.Op.bound.78b] -// CHECK:STDOUT: %specific_fn.loc31_25.2: = specific_function %impl.elem0.loc31_25.2, @Int.as.Copy.impl.Op(constants.%int_128) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc31_25.4: = bound_method %.loc31_25.2, %specific_fn.loc31_25.2 [concrete = constants.%bound_method.2fb] -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc31: init %i128 = call %bound_method.loc31_25.4(%.loc31_25.2) [concrete = constants.%int_170141183460469231731687303715884105727.ff5] -// CHECK:STDOUT: %.loc31_25.4: ref %i128 = temporary %.loc31_25.3, %Int.as.Copy.impl.Op.call.loc31 -// CHECK:STDOUT: %addr.loc31_64.1: %ptr.974 = addr_of %.loc31_25.4 -// CHECK:STDOUT: %.loc31_64.1: ref %i128 = temporary_storage -// CHECK:STDOUT: %addr.loc31_64.2: %ptr.974 = addr_of %.loc31_64.1 -// CHECK:STDOUT: %foo__carbon_thunk.call.loc31: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc31_64.1, %addr.loc31_64.2) -// CHECK:STDOUT: %.loc31_64.2: init %i128 to %.loc31_64.1 = mark_in_place_init %foo__carbon_thunk.call.loc31 -// CHECK:STDOUT: %.loc31_10: type = splice_block %i128.loc31 [concrete = constants.%i128] { +// CHECK:STDOUT: %impl.elem0.loc31_32.1: %.44c = impl_witness_access constants.%ImplicitAs.impl_witness.47a, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.75a] +// CHECK:STDOUT: %bound_method.loc31_32.1: = bound_method %int_170141183460469231731687303715884105727, %impl.elem0.loc31_32.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.8e8] +// CHECK:STDOUT: %specific_fn.loc31_32.1: = specific_function %impl.elem0.loc31_32.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_128) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn.e59] +// CHECK:STDOUT: %bound_method.loc31_32.2: = bound_method %int_170141183460469231731687303715884105727, %specific_fn.loc31_32.1 [concrete = constants.%bound_method.d00] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc31: init %i128 = call %bound_method.loc31_32.2(%int_170141183460469231731687303715884105727) [concrete = constants.%int_170141183460469231731687303715884105727.ff5] +// CHECK:STDOUT: %.loc31_32.1: %i128 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc31 [concrete = constants.%int_170141183460469231731687303715884105727.ff5] +// CHECK:STDOUT: %.loc31_32.2: %i128 = converted %int_170141183460469231731687303715884105727, %.loc31_32.1 [concrete = constants.%int_170141183460469231731687303715884105727.ff5] +// CHECK:STDOUT: %.loc31_32.3: ref %i128 = temporary_storage +// CHECK:STDOUT: %impl.elem0.loc31_32.2: %.0e6 = impl_witness_access constants.%Copy.impl_witness.a35, element0 [concrete = constants.%Int.as.Copy.impl.Op.bc1] +// CHECK:STDOUT: %bound_method.loc31_32.3: = bound_method %.loc31_32.2, %impl.elem0.loc31_32.2 [concrete = constants.%Int.as.Copy.impl.Op.bound.78b] +// CHECK:STDOUT: %specific_fn.loc31_32.2: = specific_function %impl.elem0.loc31_32.2, @Int.as.Copy.impl.Op(constants.%int_128) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc31_32.4: = bound_method %.loc31_32.2, %specific_fn.loc31_32.2 [concrete = constants.%bound_method.2fb] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc31: init %i128 = call %bound_method.loc31_32.4(%.loc31_32.2) [concrete = constants.%int_170141183460469231731687303715884105727.ff5] +// CHECK:STDOUT: %.loc31_32.4: ref %i128 = temporary %.loc31_32.3, %Int.as.Copy.impl.Op.call.loc31 +// CHECK:STDOUT: %addr.loc31_71.1: %ptr.974 = addr_of %.loc31_32.4 +// CHECK:STDOUT: %.loc31_71.1: ref %i128 = temporary_storage +// CHECK:STDOUT: %addr.loc31_71.2: %ptr.974 = addr_of %.loc31_71.1 +// CHECK:STDOUT: %foo__carbon_thunk.call.loc31: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc31_71.1, %addr.loc31_71.2) +// CHECK:STDOUT: %.loc31_71.2: init %i128 to %.loc31_71.1 = mark_in_place_init %foo__carbon_thunk.call.loc31 +// CHECK:STDOUT: %.loc31_17: type = splice_block %i128.loc31 [concrete = constants.%i128] { // CHECK:STDOUT: %int_128.loc31: Core.IntLiteral = int_value 128 [concrete = constants.%int_128] // CHECK:STDOUT: %i128.loc31: type = class_type @Int, @Int(constants.%int_128) [concrete = constants.%i128] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc31_64.3: ref %i128 = temporary %.loc31_64.1, %.loc31_64.2 -// CHECK:STDOUT: %.loc31_64.4: %i128 = acquire_value %.loc31_64.3 -// CHECK:STDOUT: %g: %i128 = value_binding g, %.loc31_64.4 -// CHECK:STDOUT: %DestroyOp.bound.loc31_64: = bound_method %.loc31_64.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc31_64: init %empty_tuple.type = call %DestroyOp.bound.loc31_64(%.loc31_64.3) -// CHECK:STDOUT: %DestroyOp.bound.loc31_25: = bound_method %.loc31_25.4, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc31_25: init %empty_tuple.type = call %DestroyOp.bound.loc31_25(%.loc31_25.4) -// CHECK:STDOUT: %DestroyOp.bound.loc28_45: = bound_method %.loc28_45.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc28_45: init %empty_tuple.type = call %DestroyOp.bound.loc28_45(%.loc28_45.3) -// CHECK:STDOUT: %DestroyOp.bound.loc28_25: = bound_method %.loc28_25.4, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc28_25: init %empty_tuple.type = call %DestroyOp.bound.loc28_25(%.loc28_25.4) -// CHECK:STDOUT: %DestroyOp.bound.loc25_45: = bound_method %.loc25_45.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc25_45: init %empty_tuple.type = call %DestroyOp.bound.loc25_45(%.loc25_45.3) -// CHECK:STDOUT: %DestroyOp.bound.loc25_25: = bound_method %.loc25_25.4, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc25_25: init %empty_tuple.type = call %DestroyOp.bound.loc25_25(%.loc25_25.4) -// CHECK:STDOUT: %DestroyOp.bound.loc22_44: = bound_method %.loc22_44.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc22_44: init %empty_tuple.type = call %DestroyOp.bound.loc22_44(%.loc22_44.3) -// CHECK:STDOUT: %DestroyOp.bound.loc22_25: = bound_method %.loc22_25.4, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc22_25: init %empty_tuple.type = call %DestroyOp.bound.loc22_25(%.loc22_25.4) +// CHECK:STDOUT: %.loc31_71.3: ref %i128 = temporary %.loc31_71.1, %.loc31_71.2 +// CHECK:STDOUT: %.loc31_71.4: %i128 = acquire_value %.loc31_71.3 +// CHECK:STDOUT: %g: %i128 = value_binding g, %.loc31_71.4 +// CHECK:STDOUT: %DestroyOp.bound.loc31_71: = bound_method %.loc31_71.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc31_71: init %empty_tuple.type = call %DestroyOp.bound.loc31_71(%.loc31_71.3) +// CHECK:STDOUT: %DestroyOp.bound.loc31_32: = bound_method %.loc31_32.4, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc31_32: init %empty_tuple.type = call %DestroyOp.bound.loc31_32(%.loc31_32.4) +// CHECK:STDOUT: %DestroyOp.bound.loc28_52: = bound_method %.loc28_52.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc28_52: init %empty_tuple.type = call %DestroyOp.bound.loc28_52(%.loc28_52.3) +// CHECK:STDOUT: %DestroyOp.bound.loc28_32: = bound_method %.loc28_32.4, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc28_32: init %empty_tuple.type = call %DestroyOp.bound.loc28_32(%.loc28_32.4) +// CHECK:STDOUT: %DestroyOp.bound.loc25_52: = bound_method %.loc25_52.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc25_52: init %empty_tuple.type = call %DestroyOp.bound.loc25_52(%.loc25_52.3) +// CHECK:STDOUT: %DestroyOp.bound.loc25_32: = bound_method %.loc25_32.4, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc25_32: init %empty_tuple.type = call %DestroyOp.bound.loc25_32(%.loc25_32.4) +// CHECK:STDOUT: %DestroyOp.bound.loc22_51: = bound_method %.loc22_51.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc22_51: init %empty_tuple.type = call %DestroyOp.bound.loc22_51(%.loc22_51.3) +// CHECK:STDOUT: %DestroyOp.bound.loc22_32: = bound_method %.loc22_32.4, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc22_32: init %empty_tuple.type = call %DestroyOp.bound.loc22_32(%.loc22_32.4) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2184,36 +2184,36 @@ fn F() { // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value] // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float.674] -// CHECK:STDOUT: %impl.elem0.loc7_24.1: %.6c5 = impl_witness_access constants.%ImplicitAs.impl_witness.cb2, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.239] -// CHECK:STDOUT: %bound_method.loc7_24.1: = bound_method %float, %impl.elem0.loc7_24.1 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc7_24.1: = specific_function %impl.elem0.loc7_24.1, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_64) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc7_24.2: = bound_method %float, %specific_fn.loc7_24.1 [concrete = constants.%bound_method.581] -// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f64.d77 = call %bound_method.loc7_24.2(%float) [concrete = constants.%float.d20] -// CHECK:STDOUT: %.loc7_24.1: %f64.d77 = value_of_initializer %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.d20] -// CHECK:STDOUT: %.loc7_24.2: %f64.d77 = converted %float, %.loc7_24.1 [concrete = constants.%float.d20] -// CHECK:STDOUT: %.loc7_24.3: ref %f64.d77 = temporary_storage -// CHECK:STDOUT: %impl.elem0.loc7_24.2: %.59b = impl_witness_access constants.%Copy.impl_witness.1e3, element0 [concrete = constants.%Float.as.Copy.impl.Op.f05] -// CHECK:STDOUT: %bound_method.loc7_24.3: = bound_method %.loc7_24.2, %impl.elem0.loc7_24.2 [concrete = constants.%Float.as.Copy.impl.Op.bound] -// CHECK:STDOUT: %specific_fn.loc7_24.2: = specific_function %impl.elem0.loc7_24.2, @Float.as.Copy.impl.Op(constants.%int_64) [concrete = constants.%Float.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc7_24.4: = bound_method %.loc7_24.2, %specific_fn.loc7_24.2 [concrete = constants.%bound_method.9b6] -// CHECK:STDOUT: %Float.as.Copy.impl.Op.call: init %f64.d77 = call %bound_method.loc7_24.4(%.loc7_24.2) [concrete = constants.%float.d20] -// CHECK:STDOUT: %.loc7_24.4: ref %f64.d77 = temporary %.loc7_24.3, %Float.as.Copy.impl.Op.call -// CHECK:STDOUT: %addr.loc7_27.1: %ptr.bcc = addr_of %.loc7_24.4 -// CHECK:STDOUT: %.loc7_27.1: ref %f64.d77 = temporary_storage -// CHECK:STDOUT: %addr.loc7_27.2: %ptr.bcc = addr_of %.loc7_27.1 -// CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc7_27.1, %addr.loc7_27.2) -// CHECK:STDOUT: %.loc7_27.2: init %f64.d77 to %.loc7_27.1 = mark_in_place_init %foo__carbon_thunk.call -// CHECK:STDOUT: %.loc7_10: type = splice_block %f64 [concrete = constants.%f64.d77] { +// CHECK:STDOUT: %impl.elem0.loc7_31.1: %.6c5 = impl_witness_access constants.%ImplicitAs.impl_witness.cb2, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.239] +// CHECK:STDOUT: %bound_method.loc7_31.1: = bound_method %float, %impl.elem0.loc7_31.1 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc7_31.1: = specific_function %impl.elem0.loc7_31.1, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_64) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_31.2: = bound_method %float, %specific_fn.loc7_31.1 [concrete = constants.%bound_method.581] +// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f64.d77 = call %bound_method.loc7_31.2(%float) [concrete = constants.%float.d20] +// CHECK:STDOUT: %.loc7_31.1: %f64.d77 = value_of_initializer %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.d20] +// CHECK:STDOUT: %.loc7_31.2: %f64.d77 = converted %float, %.loc7_31.1 [concrete = constants.%float.d20] +// CHECK:STDOUT: %.loc7_31.3: ref %f64.d77 = temporary_storage +// CHECK:STDOUT: %impl.elem0.loc7_31.2: %.59b = impl_witness_access constants.%Copy.impl_witness.1e3, element0 [concrete = constants.%Float.as.Copy.impl.Op.f05] +// CHECK:STDOUT: %bound_method.loc7_31.3: = bound_method %.loc7_31.2, %impl.elem0.loc7_31.2 [concrete = constants.%Float.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %specific_fn.loc7_31.2: = specific_function %impl.elem0.loc7_31.2, @Float.as.Copy.impl.Op(constants.%int_64) [concrete = constants.%Float.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc7_31.4: = bound_method %.loc7_31.2, %specific_fn.loc7_31.2 [concrete = constants.%bound_method.9b6] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.call: init %f64.d77 = call %bound_method.loc7_31.4(%.loc7_31.2) [concrete = constants.%float.d20] +// CHECK:STDOUT: %.loc7_31.4: ref %f64.d77 = temporary %.loc7_31.3, %Float.as.Copy.impl.Op.call +// CHECK:STDOUT: %addr.loc7_34.1: %ptr.bcc = addr_of %.loc7_31.4 +// CHECK:STDOUT: %.loc7_34.1: ref %f64.d77 = temporary_storage +// CHECK:STDOUT: %addr.loc7_34.2: %ptr.bcc = addr_of %.loc7_34.1 +// CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc7_34.1, %addr.loc7_34.2) +// CHECK:STDOUT: %.loc7_34.2: init %f64.d77 to %.loc7_34.1 = mark_in_place_init %foo__carbon_thunk.call +// CHECK:STDOUT: %.loc7_17: type = splice_block %f64 [concrete = constants.%f64.d77] { // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] // CHECK:STDOUT: %f64: type = class_type @Float, @Float(constants.%int_64) [concrete = constants.%f64.d77] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc7_27.3: ref %f64.d77 = temporary %.loc7_27.1, %.loc7_27.2 -// CHECK:STDOUT: %.loc7_27.4: %f64.d77 = acquire_value %.loc7_27.3 -// CHECK:STDOUT: %d: %f64.d77 = value_binding d, %.loc7_27.4 -// CHECK:STDOUT: %DestroyOp.bound.loc7_27: = bound_method %.loc7_27.3, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc7_27: init %empty_tuple.type = call %DestroyOp.bound.loc7_27(%.loc7_27.3) -// CHECK:STDOUT: %DestroyOp.bound.loc7_24: = bound_method %.loc7_24.4, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc7_24: init %empty_tuple.type = call %DestroyOp.bound.loc7_24(%.loc7_24.4) +// CHECK:STDOUT: %.loc7_34.3: ref %f64.d77 = temporary %.loc7_34.1, %.loc7_34.2 +// CHECK:STDOUT: %.loc7_34.4: %f64.d77 = acquire_value %.loc7_34.3 +// CHECK:STDOUT: %d: %f64.d77 = value_binding d, %.loc7_34.4 +// CHECK:STDOUT: %DestroyOp.bound.loc7_34: = bound_method %.loc7_34.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc7_34: init %empty_tuple.type = call %DestroyOp.bound.loc7_34(%.loc7_34.3) +// CHECK:STDOUT: %DestroyOp.bound.loc7_31: = bound_method %.loc7_31.4, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc7_31: init %empty_tuple.type = call %DestroyOp.bound.loc7_31(%.loc7_31.4) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3932,13 +3932,13 @@ fn F() { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: %ValueT.loc10_14.2: %I.type = symbolic_binding ValueT, 0 [symbolic = %ValueT.loc10_14.1 (constants.%ValueT)] -// CHECK:STDOUT: %.loc10_34.1: type = splice_block %.loc10_34.2 [symbolic = %ValueT.binding.as_type (constants.%ValueT.binding.as_type)] { +// CHECK:STDOUT: %.loc10_41.1: type = splice_block %.loc10_41.2 [symbolic = %ValueT.binding.as_type (constants.%ValueT.binding.as_type)] { // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %ValueT.ref: %I.type = name_ref ValueT, %ValueT.loc10_14.2 [symbolic = %ValueT.loc10_14.1 (constants.%ValueT)] // CHECK:STDOUT: %ValueT.as_type: type = facet_access_type %ValueT.ref [symbolic = %ValueT.binding.as_type (constants.%ValueT.binding.as_type)] -// CHECK:STDOUT: %.loc10_34.2: type = converted %ValueT.ref, %ValueT.as_type [symbolic = %ValueT.binding.as_type (constants.%ValueT.binding.as_type)] +// CHECK:STDOUT: %.loc10_41.2: type = converted %ValueT.ref, %ValueT.as_type [symbolic = %ValueT.binding.as_type (constants.%ValueT.binding.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %value.loc10_26.2: @EchoValue.%ValueT.binding.as_type (%ValueT.binding.as_type) = symbolic_binding value, 1 [symbolic = %value.loc10_26.1 (constants.%value)] +// CHECK:STDOUT: %value.loc10_33.2: @EchoValue.%ValueT.binding.as_type (%ValueT.binding.as_type) = symbolic_binding value, 1 [symbolic = %value.loc10_33.1 (constants.%value)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: } @@ -3954,10 +3954,10 @@ fn F() { // CHECK:STDOUT: !requires: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @EchoValue(%ValueT.loc10_14.2: %I.type, %value.loc10_26.2: @EchoValue.%ValueT.binding.as_type (%ValueT.binding.as_type)) { +// CHECK:STDOUT: generic fn @EchoValue(%ValueT.loc10_14.2: %I.type, %value.loc10_33.2: @EchoValue.%ValueT.binding.as_type (%ValueT.binding.as_type)) { // CHECK:STDOUT: %ValueT.loc10_14.1: %I.type = symbolic_binding ValueT, 0 [symbolic = %ValueT.loc10_14.1 (constants.%ValueT)] // CHECK:STDOUT: %ValueT.binding.as_type: type = symbolic_binding_type ValueT, 0, %ValueT.loc10_14.1 [symbolic = %ValueT.binding.as_type (constants.%ValueT.binding.as_type)] -// CHECK:STDOUT: %value.loc10_26.1: @EchoValue.%ValueT.binding.as_type (%ValueT.binding.as_type) = symbolic_binding value, 1 [symbolic = %value.loc10_26.1 (constants.%value)] +// CHECK:STDOUT: %value.loc10_33.1: @EchoValue.%ValueT.binding.as_type (%ValueT.binding.as_type) = symbolic_binding value, 1 [symbolic = %value.loc10_33.1 (constants.%value)] // CHECK:STDOUT: %pattern_type: type = pattern_type %ValueT.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.422)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -3983,7 +3983,7 @@ fn F() { // CHECK:STDOUT: specific @EchoValue(constants.%ValueT, constants.%value) { // CHECK:STDOUT: %ValueT.loc10_14.1 => constants.%ValueT // CHECK:STDOUT: %ValueT.binding.as_type => constants.%ValueT.binding.as_type -// CHECK:STDOUT: %value.loc10_26.1 => constants.%value +// CHECK:STDOUT: %value.loc10_33.1 => constants.%value // CHECK:STDOUT: %pattern_type => constants.%pattern_type.422 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/pointer.carbon b/toolchain/check/testdata/interop/cpp/function/pointer.carbon index 7a6ff9bc9345..c56c93343dce 100644 --- a/toolchain/check/testdata/interop/cpp/function/pointer.carbon +++ b/toolchain/check/testdata/interop/cpp/function/pointer.carbon @@ -372,7 +372,7 @@ fn F() { // We assume that this cannot return a null pointer, because the function is // generic in the type `T`. // TODO: This isn't guaranteed; is this the behavior we want? - let p: Cpp.S* = Cpp.foo(&s); + let unused p: Cpp.S* = Cpp.foo(&s); //@dump-sem-ir-end } @@ -405,7 +405,7 @@ fn F() { var s: Cpp.S = {}; Cpp.Direct(&s); - let a: Core.Optional(Cpp.S*) = Cpp.Indirect({} as Cpp.S); + let unused a: Core.Optional(Cpp.S*) = Cpp.Indirect({} as Cpp.S); //@dump-sem-ir-end } @@ -417,14 +417,14 @@ import Cpp library "deduced_pointer_param.h"; fn F() { // This could return a null pointer, so should not be given the type `Cpp.S*`. - // CHECK:STDERR: fail_import_deduced_pointer_param_as_optional_pointer.carbon:[[@LINE+7]]:19: error: cannot implicitly convert expression of type `Core.Optional(Cpp.S* as Core.OptionalStorage)` to `Cpp.S*` [ConversionFailure] - // CHECK:STDERR: let a: Cpp.S* = Cpp.Indirect({} as Cpp.S); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_import_deduced_pointer_param_as_optional_pointer.carbon:[[@LINE+4]]:19: note: type `Core.Optional(Cpp.S* as Core.OptionalStorage)` does not implement interface `Core.ImplicitAs(Cpp.S*)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let a: Cpp.S* = Cpp.Indirect({} as Cpp.S); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_deduced_pointer_param_as_optional_pointer.carbon:[[@LINE+7]]:26: error: cannot implicitly convert expression of type `Core.Optional(Cpp.S* as Core.OptionalStorage)` to `Cpp.S*` [ConversionFailure] + // CHECK:STDERR: let unused a: Cpp.S* = Cpp.Indirect({} as Cpp.S); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_deduced_pointer_param_as_optional_pointer.carbon:[[@LINE+4]]:26: note: type `Core.Optional(Cpp.S* as Core.OptionalStorage)` does not implement interface `Core.ImplicitAs(Cpp.S*)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused a: Cpp.S* = Cpp.Indirect({} as Cpp.S); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let a: Cpp.S* = Cpp.Indirect({} as Cpp.S); + let unused a: Cpp.S* = Cpp.Indirect({} as Cpp.S); } // CHECK:STDOUT: --- import_non_nullable_pointer_param.carbon @@ -1757,19 +1757,19 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %p.patt: %pattern_type.259 = value_binding_pattern p [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc13_19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc13_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value] // CHECK:STDOUT: %s.ref: ref %S = name_ref s, %s // CHECK:STDOUT: %addr: %ptr.5c7 = addr_of %s.ref // CHECK:STDOUT: %foo.call: init %ptr.5c7 = call imports.%foo.decl(%addr) -// CHECK:STDOUT: %.loc13_15: type = splice_block %ptr [concrete = constants.%ptr.5c7] { -// CHECK:STDOUT: %Cpp.ref.loc13_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc13_22: type = splice_block %ptr [concrete = constants.%ptr.5c7] { +// CHECK:STDOUT: %Cpp.ref.loc13_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %S.ref.loc13: type = name_ref S, imports.%S.decl [concrete = constants.%S] // CHECK:STDOUT: %ptr: type = ptr_type %S.ref.loc13 [concrete = constants.%ptr.5c7] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13_29.1: %ptr.5c7 = value_of_initializer %foo.call -// CHECK:STDOUT: %.loc13_29.2: %ptr.5c7 = converted %foo.call, %.loc13_29.1 -// CHECK:STDOUT: %p: %ptr.5c7 = value_binding p, %.loc13_29.2 +// CHECK:STDOUT: %.loc13_36.1: %ptr.5c7 = value_of_initializer %foo.call +// CHECK:STDOUT: %.loc13_36.2: %ptr.5c7 = converted %foo.call, %.loc13_36.1 +// CHECK:STDOUT: %p: %ptr.5c7 = value_binding p, %.loc13_36.2 // CHECK:STDOUT: %S.cpp_destructor.bound: = bound_method %s.var, constants.%S.cpp_destructor // CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call %S.cpp_destructor.bound(%s.var) // CHECK:STDOUT: @@ -1921,37 +1921,37 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.70a = value_binding_pattern a [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc13_34: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc13_41: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Indirect.ref: %Indirect.cpp_overload_set.type = name_ref Indirect, imports.%Indirect.cpp_overload_set.value [concrete = constants.%Indirect.cpp_overload_set.value] -// CHECK:STDOUT: %.loc13_48.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %Cpp.ref.loc13_53: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %S.ref.loc13_56: type = name_ref S, imports.%S.decl [concrete = constants.%S] -// CHECK:STDOUT: %.loc13_48.2: ref %S = temporary_storage -// CHECK:STDOUT: %.loc13_48.3: init %S to %.loc13_48.2 = class_init () [concrete = constants.%S.val] -// CHECK:STDOUT: %.loc13_48.4: ref %S = temporary %.loc13_48.2, %.loc13_48.3 -// CHECK:STDOUT: %.loc13_50.1: ref %S = converted %.loc13_48.1, %.loc13_48.4 -// CHECK:STDOUT: %.loc13_50.2: %S = acquire_value %.loc13_50.1 -// CHECK:STDOUT: %.loc13_50.3: ref %S = value_as_ref %.loc13_50.2 -// CHECK:STDOUT: %addr.loc13: %ptr.5c7 = addr_of %.loc13_50.3 +// CHECK:STDOUT: %.loc13_55.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %Cpp.ref.loc13_60: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %S.ref.loc13_63: type = name_ref S, imports.%S.decl [concrete = constants.%S] +// CHECK:STDOUT: %.loc13_55.2: ref %S = temporary_storage +// CHECK:STDOUT: %.loc13_55.3: init %S to %.loc13_55.2 = class_init () [concrete = constants.%S.val] +// CHECK:STDOUT: %.loc13_55.4: ref %S = temporary %.loc13_55.2, %.loc13_55.3 +// CHECK:STDOUT: %.loc13_57.1: ref %S = converted %.loc13_55.1, %.loc13_55.4 +// CHECK:STDOUT: %.loc13_57.2: %S = acquire_value %.loc13_57.1 +// CHECK:STDOUT: %.loc13_57.3: ref %S = value_as_ref %.loc13_57.2 +// CHECK:STDOUT: %addr.loc13: %ptr.5c7 = addr_of %.loc13_57.3 // CHECK:STDOUT: %Indirect__carbon_thunk.call: init %Optional.065 = call imports.%Indirect__carbon_thunk.decl(%addr.loc13) -// CHECK:STDOUT: %.loc13_30.1: type = splice_block %Optional [concrete = constants.%Optional.065] { +// CHECK:STDOUT: %.loc13_37.1: type = splice_block %Optional [concrete = constants.%Optional.065] { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Optional.ref: %Optional.type = name_ref Optional, imports.%Core.Optional [concrete = constants.%Optional.generic] -// CHECK:STDOUT: %Cpp.ref.loc13_24: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %S.ref.loc13_27: type = name_ref S, imports.%S.decl [concrete = constants.%S] -// CHECK:STDOUT: %ptr: type = ptr_type %S.ref.loc13_27 [concrete = constants.%ptr.5c7] +// CHECK:STDOUT: %Cpp.ref.loc13_31: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %S.ref.loc13_34: type = name_ref S, imports.%S.decl [concrete = constants.%S] +// CHECK:STDOUT: %ptr: type = ptr_type %S.ref.loc13_34 [concrete = constants.%ptr.5c7] // CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr, (constants.%OptionalStorage.impl_witness.ba1) [concrete = constants.%OptionalStorage.facet.872] -// CHECK:STDOUT: %.loc13_30.2: %OptionalStorage.type = converted %ptr, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet.872] +// CHECK:STDOUT: %.loc13_37.2: %OptionalStorage.type = converted %ptr, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet.872] // CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.872) [concrete = constants.%Optional.065] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13_58.1: ref %Optional.065 = temporary_storage -// CHECK:STDOUT: %.loc13_58.2: ref %Optional.065 = temporary %.loc13_58.1, %Indirect__carbon_thunk.call -// CHECK:STDOUT: %.loc13_58.3: %Optional.065 = acquire_value %.loc13_58.2 -// CHECK:STDOUT: %a: %Optional.065 = value_binding a, %.loc13_58.3 -// CHECK:STDOUT: %DestroyOp.bound.loc13: = bound_method %.loc13_58.2, constants.%DestroyOp.b0ebf8.2 -// CHECK:STDOUT: %DestroyOp.call.loc13: init %empty_tuple.type = call %DestroyOp.bound.loc13(%.loc13_58.2) -// CHECK:STDOUT: %S.cpp_destructor.bound.loc13: = bound_method %.loc13_48.4, constants.%S.cpp_destructor -// CHECK:STDOUT: %S.cpp_destructor.call.loc13: init %empty_tuple.type = call %S.cpp_destructor.bound.loc13(%.loc13_48.4) +// CHECK:STDOUT: %.loc13_65.1: ref %Optional.065 = temporary_storage +// CHECK:STDOUT: %.loc13_65.2: ref %Optional.065 = temporary %.loc13_65.1, %Indirect__carbon_thunk.call +// CHECK:STDOUT: %.loc13_65.3: %Optional.065 = acquire_value %.loc13_65.2 +// CHECK:STDOUT: %a: %Optional.065 = value_binding a, %.loc13_65.3 +// CHECK:STDOUT: %DestroyOp.bound.loc13: = bound_method %.loc13_65.2, constants.%DestroyOp.b0ebf8.2 +// CHECK:STDOUT: %DestroyOp.call.loc13: init %empty_tuple.type = call %DestroyOp.bound.loc13(%.loc13_65.2) +// CHECK:STDOUT: %S.cpp_destructor.bound.loc13: = bound_method %.loc13_55.4, constants.%S.cpp_destructor +// CHECK:STDOUT: %S.cpp_destructor.call.loc13: init %empty_tuple.type = call %S.cpp_destructor.bound.loc13(%.loc13_55.4) // CHECK:STDOUT: %DestroyOp.bound.loc11: = bound_method %.loc11_14.3, constants.%DestroyOp.b0ebf8.2 // CHECK:STDOUT: %DestroyOp.call.loc11: init %empty_tuple.type = call %DestroyOp.bound.loc11(%.loc11_14.3) // CHECK:STDOUT: %S.cpp_destructor.bound.loc10: = bound_method %s.var, constants.%S.cpp_destructor diff --git a/toolchain/check/testdata/interop/cpp/function/reference.carbon b/toolchain/check/testdata/interop/cpp/function/reference.carbon index 3361ffbeb22d..e98f7e5572b1 100644 --- a/toolchain/check/testdata/interop/cpp/function/reference.carbon +++ b/toolchain/check/testdata/interop/cpp/function/reference.carbon @@ -248,7 +248,7 @@ import Cpp library "return_lvalue_ref.h"; fn F() { //@dump-sem-ir-begin - let ref s: Cpp.S = Cpp.ReturnsLValue(); + let unused ref s: Cpp.S = Cpp.ReturnsLValue(); //@dump-sem-ir-end } @@ -270,7 +270,7 @@ import Cpp library "return_rvalue_ref.h"; fn F() { //@dump-sem-ir-begin - let ref s: Cpp.S = Cpp.ReturnsRValue(); + let unused ref s: Cpp.S = Cpp.ReturnsRValue(); //@dump-sem-ir-end } @@ -292,7 +292,7 @@ import Cpp library "return_const_lvalue_ref.h"; fn F() { //@dump-sem-ir-begin - let ref s: const Cpp.S = Cpp.ReturnConstLValue(); + let unused ref s: const Cpp.S = Cpp.ReturnConstLValue(); //@dump-sem-ir-end } @@ -303,14 +303,14 @@ library "[[@TEST_NAME]]"; import Cpp library "return_const_lvalue_ref.h"; fn F() { - // CHECK:STDERR: fail_call_return_const_lvalue_ref_const_correctness.carbon:[[@LINE+7]]:22: error: cannot implicitly convert expression of type `const Cpp.S` to `Cpp.S` [ConversionFailure] - // CHECK:STDERR: let ref s: Cpp.S = Cpp.ReturnConstLValue(); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_call_return_const_lvalue_ref_const_correctness.carbon:[[@LINE+4]]:22: note: type `const Cpp.S` does not implement interface `Core.ImplicitAs(Cpp.S)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let ref s: Cpp.S = Cpp.ReturnConstLValue(); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_call_return_const_lvalue_ref_const_correctness.carbon:[[@LINE+7]]:29: error: cannot implicitly convert expression of type `const Cpp.S` to `Cpp.S` [ConversionFailure] + // CHECK:STDERR: let unused ref s: Cpp.S = Cpp.ReturnConstLValue(); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_call_return_const_lvalue_ref_const_correctness.carbon:[[@LINE+4]]:29: note: type `const Cpp.S` does not implement interface `Core.ImplicitAs(Cpp.S)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused ref s: Cpp.S = Cpp.ReturnConstLValue(); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let ref s: Cpp.S = Cpp.ReturnConstLValue(); + let unused ref s: Cpp.S = Cpp.ReturnConstLValue(); } @@ -856,11 +856,11 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %s.patt: %pattern_type = ref_binding_pattern s [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc8_22: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc8_29: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ReturnsLValue.ref: %ReturnsLValue.cpp_overload_set.type = name_ref ReturnsLValue, imports.%ReturnsLValue.cpp_overload_set.value [concrete = constants.%ReturnsLValue.cpp_overload_set.value] // CHECK:STDOUT: %ReturnsLValue.call: ref %S = call imports.%ReturnsLValue.decl() // CHECK:STDOUT: %.loc8: type = splice_block %S.ref [concrete = constants.%S] { -// CHECK:STDOUT: %Cpp.ref.loc8_14: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc8_21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S] // CHECK:STDOUT: } // CHECK:STDOUT: %s: ref %S = ref_binding s, %ReturnsLValue.call @@ -894,11 +894,11 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %s.patt: %pattern_type = ref_binding_pattern s [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc8_22: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc8_29: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ReturnsRValue.ref: %ReturnsRValue.cpp_overload_set.type = name_ref ReturnsRValue, imports.%ReturnsRValue.cpp_overload_set.value [concrete = constants.%ReturnsRValue.cpp_overload_set.value] // CHECK:STDOUT: %ReturnsRValue.call: ref %S = call imports.%ReturnsRValue.decl() // CHECK:STDOUT: %.loc8: type = splice_block %S.ref [concrete = constants.%S] { -// CHECK:STDOUT: %Cpp.ref.loc8_14: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc8_21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S] // CHECK:STDOUT: } // CHECK:STDOUT: %s: ref %S = ref_binding s, %ReturnsRValue.call @@ -933,11 +933,11 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %s.patt: %pattern_type = ref_binding_pattern s [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc8_28: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc8_35: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ReturnConstLValue.ref: %ReturnConstLValue.cpp_overload_set.type = name_ref ReturnConstLValue, imports.%ReturnConstLValue.cpp_overload_set.value [concrete = constants.%ReturnConstLValue.cpp_overload_set.value] // CHECK:STDOUT: %ReturnConstLValue.call: ref %const = call imports.%ReturnConstLValue.decl() // CHECK:STDOUT: %.loc8: type = splice_block %const [concrete = constants.%const] { -// CHECK:STDOUT: %Cpp.ref.loc8_20: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc8_27: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S] // CHECK:STDOUT: %const: type = const_type %S.ref [concrete = constants.%const] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/function/return.carbon b/toolchain/check/testdata/interop/cpp/function/return.carbon index 73280a34e5d5..73ebcddb8404 100644 --- a/toolchain/check/testdata/interop/cpp/function/return.carbon +++ b/toolchain/check/testdata/interop/cpp/function/return.carbon @@ -70,7 +70,7 @@ auto ReturnNullPtr() -> nullptr_t; fn InitializeFromReturn() { //@dump-sem-ir-begin - var c: Cpp.nullptr_t = Cpp.ReturnNullPtr(); + var unused c: Cpp.nullptr_t = Cpp.ReturnNullPtr(); //@dump-sem-ir-end } @@ -101,7 +101,7 @@ unsigned int ReturnU32(); '''; fn Var() { - var my_u32: u32 = Cpp.ReturnU32(); + var unused my_u32: u32 = Cpp.ReturnU32(); } // CHECK:STDOUT: --- import_multiple.carbon @@ -211,15 +211,15 @@ fn Var() { // CHECK:STDOUT: %c.var_patt: %pattern_type.f05 = var_pattern %c.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c.var: ref %Cpp.nullptr_t = var %c.var_patt -// CHECK:STDOUT: %Cpp.ref.loc11_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc11_33: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ReturnNullPtr.ref: %ReturnNullPtr.cpp_overload_set.type = name_ref ReturnNullPtr, imports.%ReturnNullPtr.cpp_overload_set.value [concrete = constants.%ReturnNullPtr.cpp_overload_set.value] // CHECK:STDOUT: %.loc11_3: ref %Cpp.nullptr_t = splice_block %c.var {} // CHECK:STDOUT: %addr: %ptr.142 = addr_of %.loc11_3 // CHECK:STDOUT: %ReturnNullPtr__carbon_thunk.call: init %empty_tuple.type = call imports.%ReturnNullPtr__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc11_44: init %Cpp.nullptr_t to %.loc11_3 = mark_in_place_init %ReturnNullPtr__carbon_thunk.call -// CHECK:STDOUT: assign %c.var, %.loc11_44 -// CHECK:STDOUT: %.loc11_13: type = splice_block %nullptr_t.ref [concrete = constants.%Cpp.nullptr_t] { -// CHECK:STDOUT: %Cpp.ref.loc11_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc11_51: init %Cpp.nullptr_t to %.loc11_3 = mark_in_place_init %ReturnNullPtr__carbon_thunk.call +// CHECK:STDOUT: assign %c.var, %.loc11_51 +// CHECK:STDOUT: %.loc11_20: type = splice_block %nullptr_t.ref [concrete = constants.%Cpp.nullptr_t] { +// CHECK:STDOUT: %Cpp.ref.loc11_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %nullptr_t.ref: type = name_ref nullptr_t, constants.%Cpp.nullptr_t [concrete = constants.%Cpp.nullptr_t] // CHECK:STDOUT: } // CHECK:STDOUT: %c: ref %Cpp.nullptr_t = ref_binding c, %c.var diff --git a/toolchain/check/testdata/interop/cpp/function/struct.carbon b/toolchain/check/testdata/interop/cpp/function/struct.carbon index ad27c25a7a52..d848d0f175a1 100644 --- a/toolchain/check/testdata/interop/cpp/function/struct.carbon +++ b/toolchain/check/testdata/interop/cpp/function/struct.carbon @@ -216,7 +216,7 @@ fn F(s: Cpp.N.S) { //@dump-sem-ir-begin Cpp.foo(s); // Check that the parameter type was imported correctly. - var x: Cpp.N.S; + var unused x: Cpp.N.S; //@dump-sem-ir-end } @@ -264,7 +264,7 @@ import Cpp library "definition_in_outer_definition.h"; fn F(s: Cpp.O.S) { //@dump-sem-ir-begin Cpp.foo(s); - var x: Cpp.O; + var unused x: Cpp.O; //@dump-sem-ir-end } diff --git a/toolchain/check/testdata/interop/cpp/function/union.carbon b/toolchain/check/testdata/interop/cpp/function/union.carbon index a8a1b72ea416..993b0517df76 100644 --- a/toolchain/check/testdata/interop/cpp/function/union.carbon +++ b/toolchain/check/testdata/interop/cpp/function/union.carbon @@ -176,7 +176,7 @@ fn F(u: Cpp.N.U) { //@dump-sem-ir-begin Cpp.foo(u); // Check that the parameter type was imported correctly. - var x: Cpp.N.U; + var unused x: Cpp.N.U; //@dump-sem-ir-end } @@ -225,7 +225,7 @@ import Cpp library "definition_in_outer_definition.h"; fn F(u: Cpp.O.U) { //@dump-sem-ir-begin Cpp.foo(u); - var x: Cpp.O; + var unused x: Cpp.O; //@dump-sem-ir-end } diff --git a/toolchain/check/testdata/interop/cpp/function/void_pointer.carbon b/toolchain/check/testdata/interop/cpp/function/void_pointer.carbon index 5d39c082fa60..65dab79b6715 100644 --- a/toolchain/check/testdata/interop/cpp/function/void_pointer.carbon +++ b/toolchain/check/testdata/interop/cpp/function/void_pointer.carbon @@ -34,7 +34,7 @@ auto foo() -> void* _Nonnull; fn F() { //@dump-sem-ir-begin - let output: Cpp.void* = Cpp.foo(); + let unused output: Cpp.void* = Cpp.foo(); //@dump-sem-ir-end } @@ -76,7 +76,7 @@ auto foo() -> void*; fn F() { //@dump-sem-ir-begin - let output: Core.Optional(Cpp.void*) = Cpp.foo(); + let unused output: Core.Optional(Cpp.void*) = Cpp.foo(); //@dump-sem-ir-end } @@ -178,17 +178,17 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %output.patt: %pattern_type = value_binding_pattern output [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc10_27: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc10_34: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value] // CHECK:STDOUT: %foo.call: init %ptr = call imports.%foo.decl() -// CHECK:STDOUT: %.loc10_23: type = splice_block %ptr [concrete = constants.%ptr] { -// CHECK:STDOUT: %Cpp.ref.loc10_15: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc10_30: type = splice_block %ptr [concrete = constants.%ptr] { +// CHECK:STDOUT: %Cpp.ref.loc10_22: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void] // CHECK:STDOUT: %ptr: type = ptr_type %void.ref [concrete = constants.%ptr] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc10_35.1: %ptr = value_of_initializer %foo.call -// CHECK:STDOUT: %.loc10_35.2: %ptr = converted %foo.call, %.loc10_35.1 -// CHECK:STDOUT: %output: %ptr = value_binding output, %.loc10_35.2 +// CHECK:STDOUT: %.loc10_42.1: %ptr = value_of_initializer %foo.call +// CHECK:STDOUT: %.loc10_42.2: %ptr = converted %foo.call, %.loc10_42.1 +// CHECK:STDOUT: %output: %ptr = value_binding output, %.loc10_42.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -463,25 +463,25 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %output.patt: %pattern_type.cec = value_binding_pattern output [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc10_42: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc10_49: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value] // CHECK:STDOUT: %foo.call: init %Optional.bb8 = call imports.%foo.decl() -// CHECK:STDOUT: %.loc10_38.1: type = splice_block %Optional [concrete = constants.%Optional.bb8] { +// CHECK:STDOUT: %.loc10_45.1: type = splice_block %Optional [concrete = constants.%Optional.bb8] { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Optional.ref: %Optional.type = name_ref Optional, imports.%Core.Optional [concrete = constants.%Optional.generic] -// CHECK:STDOUT: %Cpp.ref.loc10_29: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc10_36: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void] // CHECK:STDOUT: %ptr: type = ptr_type %void.ref [concrete = constants.%ptr.874] // CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr, (constants.%OptionalStorage.impl_witness.32c) [concrete = constants.%OptionalStorage.facet] -// CHECK:STDOUT: %.loc10_38.2: %OptionalStorage.type = converted %ptr, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet] +// CHECK:STDOUT: %.loc10_45.2: %OptionalStorage.type = converted %ptr, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet] // CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.bb8] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc10_50.1: ref %Optional.bb8 = temporary_storage -// CHECK:STDOUT: %.loc10_50.2: ref %Optional.bb8 = temporary %.loc10_50.1, %foo.call -// CHECK:STDOUT: %.loc10_50.3: %Optional.bb8 = acquire_value %.loc10_50.2 -// CHECK:STDOUT: %output: %Optional.bb8 = value_binding output, %.loc10_50.3 -// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc10_50.2, constants.%DestroyOp.b0ebf8.2 -// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc10_50.2) +// CHECK:STDOUT: %.loc10_57.1: ref %Optional.bb8 = temporary_storage +// CHECK:STDOUT: %.loc10_57.2: ref %Optional.bb8 = temporary %.loc10_57.1, %foo.call +// CHECK:STDOUT: %.loc10_57.3: %Optional.bb8 = acquire_value %.loc10_57.2 +// CHECK:STDOUT: %output: %Optional.bb8 = value_binding output, %.loc10_57.3 +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc10_57.2, constants.%DestroyOp.b0ebf8.2 +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc10_57.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/impls/destroy.carbon b/toolchain/check/testdata/interop/cpp/impls/destroy.carbon index e2f7dcae3e46..f793f8631746 100644 --- a/toolchain/check/testdata/interop/cpp/impls/destroy.carbon +++ b/toolchain/check/testdata/interop/cpp/impls/destroy.carbon @@ -58,11 +58,11 @@ import Cpp library "types.h"; //@include-in-dumps fn PublicDestroy() { - var a: Cpp.PublicDestructor = {}; + var unused a: Cpp.PublicDestructor = {}; } fn TrivialDestroy() { - var a: Cpp.TrivialDestructor = {}; + var unused a: Cpp.TrivialDestructor = {}; } // --- destroy_protected_base_destructor.carbon @@ -77,7 +77,7 @@ class Derived { fn DestroyClassWithProtectedBaseDestructor() { //@dump-sem-ir-begin - var a: Derived = {.base = {}}; + var unused a: Derived = {.base = {}}; //@dump-sem-ir-end } @@ -94,7 +94,7 @@ class Derived { fn DestroyClassWithPrivateBaseDestructor() { //@dump-sem-ir-begin // TODO: We should not allow this, as the destructor of the base class is private. - var a: Derived = {.base = {}}; + var unused a: Derived = {.base = {}}; //@dump-sem-ir-end } @@ -121,47 +121,47 @@ library "[[@TEST_NAME]]"; import Cpp library "types.h"; fn AmbiguousDestroy() { - // CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+4]]:10: note: while completing C++ type `Cpp.AmbiguousDestructorT` [InCppTypeCompletion] - // CHECK:STDERR: var a: Cpp.AmbiguousDestructor = {}; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+4]]:17: note: while completing C++ type `Cpp.AmbiguousDestructorT` [InCppTypeCompletion] + // CHECK:STDERR: var unused a: Cpp.AmbiguousDestructor = {}; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var a: Cpp.AmbiguousDestructor = {}; + var unused a: Cpp.AmbiguousDestructor = {}; } fn DeletedDestroy() { // CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+8]]:3: error: attempt to use a deleted function [CppInteropParseError] - // CHECK:STDERR: 39 | var a: Cpp.DeletedDestructor = {}; + // CHECK:STDERR: 39 | var unused a: Cpp.DeletedDestructor = {}; // CHECK:STDERR: | ^ // CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE-14]]:10: in file included here [InCppInclude] // CHECK:STDERR: ./types.h:23:3: note: '~DeletedDestructor' has been explicitly marked deleted here [CppInteropParseNote] // CHECK:STDERR: 23 | ~DeletedDestructor() = delete; // CHECK:STDERR: | ^ // CHECK:STDERR: - var a: Cpp.DeletedDestructor = {}; + var unused a: Cpp.DeletedDestructor = {}; } fn PrivateDestroy() { // CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+8]]:3: error: cannot access private member `` of type `Cpp.PrivateDestructor` [ClassInvalidMemberAccess] - // CHECK:STDERR: var a: Cpp.PrivateDestructor = {}; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: var unused a: Cpp.PrivateDestructor = {}; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE-26]]:10: in file included here [InCppInclude] // CHECK:STDERR: ./types.h:28:3: note: declared here [ClassMemberDeclaration] // CHECK:STDERR: ~PrivateDestructor(); // CHECK:STDERR: ^ // CHECK:STDERR: - var a: Cpp.PrivateDestructor = {}; + var unused a: Cpp.PrivateDestructor = {}; } fn ProtectedDestroy() { // CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+8]]:3: error: cannot access protected member `` of type `Cpp.ProtectedDestructor` [ClassInvalidMemberAccess] - // CHECK:STDERR: var a: Cpp.ProtectedDestructor = {}; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: var unused a: Cpp.ProtectedDestructor = {}; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE-38]]:10: in file included here [InCppInclude] // CHECK:STDERR: ./types.h:33:3: note: declared here [ClassMemberDeclaration] // CHECK:STDERR: ~ProtectedDestructor(); // CHECK:STDERR: ^ // CHECK:STDERR: - var a: Cpp.ProtectedDestructor = {}; + var unused a: Cpp.ProtectedDestructor = {}; } // --- destroy_generically.carbon @@ -171,7 +171,7 @@ library "[[@TEST_NAME]]"; import Cpp library "types.h"; fn Destroy[T:! Core.Copy & Core.Destroy](c: T) { - var d: T = c; + var unused d: T = c; } fn DoDestroy() { @@ -264,11 +264,11 @@ fn EqualWitnesses(p: Wrap(Cpp.PublicDestructor)*) -> Wrap(Cpp.PublicDestructor)* // CHECK:STDOUT: %a.var_patt: %pattern_type.27d = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %PublicDestructor = var %a.var_patt -// CHECK:STDOUT: %.loc11_34.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc11_34.2: init %PublicDestructor to %a.var = class_init () [concrete = constants.%PublicDestructor.val] -// CHECK:STDOUT: %.loc11_3: init %PublicDestructor = converted %.loc11_34.1, %.loc11_34.2 [concrete = constants.%PublicDestructor.val] +// CHECK:STDOUT: %.loc11_41.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc11_41.2: init %PublicDestructor to %a.var = class_init () [concrete = constants.%PublicDestructor.val] +// CHECK:STDOUT: %.loc11_3: init %PublicDestructor = converted %.loc11_41.1, %.loc11_41.2 [concrete = constants.%PublicDestructor.val] // CHECK:STDOUT: assign %a.var, %.loc11_3 -// CHECK:STDOUT: %.loc11_13: type = splice_block %PublicDestructor.ref [concrete = constants.%PublicDestructor] { +// CHECK:STDOUT: %.loc11_20: type = splice_block %PublicDestructor.ref [concrete = constants.%PublicDestructor] { // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %PublicDestructor.ref: type = name_ref PublicDestructor, imports.%PublicDestructor.decl [concrete = constants.%PublicDestructor] // CHECK:STDOUT: } @@ -287,11 +287,11 @@ fn EqualWitnesses(p: Wrap(Cpp.PublicDestructor)*) -> Wrap(Cpp.PublicDestructor)* // CHECK:STDOUT: %a.var_patt: %pattern_type.1b8 = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %TrivialDestructor = var %a.var_patt -// CHECK:STDOUT: %.loc15_35.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc15_35.2: init %TrivialDestructor to %a.var = class_init () [concrete = constants.%TrivialDestructor.val] -// CHECK:STDOUT: %.loc15_3: init %TrivialDestructor = converted %.loc15_35.1, %.loc15_35.2 [concrete = constants.%TrivialDestructor.val] +// CHECK:STDOUT: %.loc15_42.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc15_42.2: init %TrivialDestructor to %a.var = class_init () [concrete = constants.%TrivialDestructor.val] +// CHECK:STDOUT: %.loc15_3: init %TrivialDestructor = converted %.loc15_42.1, %.loc15_42.2 [concrete = constants.%TrivialDestructor.val] // CHECK:STDOUT: assign %a.var, %.loc15_3 -// CHECK:STDOUT: %.loc15_13: type = splice_block %TrivialDestructor.ref [concrete = constants.%TrivialDestructor] { +// CHECK:STDOUT: %.loc15_20: type = splice_block %TrivialDestructor.ref [concrete = constants.%TrivialDestructor] { // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %TrivialDestructor.ref: type = name_ref TrivialDestructor, imports.%TrivialDestructor.decl [concrete = constants.%TrivialDestructor] // CHECK:STDOUT: } @@ -330,13 +330,13 @@ fn EqualWitnesses(p: Wrap(Cpp.PublicDestructor)*) -> Wrap(Cpp.PublicDestructor)* // CHECK:STDOUT: %a.var_patt: %pattern_type.9f6 = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %Derived = var %a.var_patt -// CHECK:STDOUT: %.loc12_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc12_31.1: %struct_type.base.f5e = struct_literal (%.loc12_30.1) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc12_31.2: ref %ProtectedDestructor = class_element_access %a.var, element0 -// CHECK:STDOUT: %.loc12_30.2: init %ProtectedDestructor to %.loc12_31.2 = class_init () [concrete = constants.%ProtectedDestructor.val] -// CHECK:STDOUT: %.loc12_31.3: init %ProtectedDestructor = converted %.loc12_30.1, %.loc12_30.2 [concrete = constants.%ProtectedDestructor.val] -// CHECK:STDOUT: %.loc12_31.4: init %Derived to %a.var = class_init (%.loc12_31.3) [concrete = constants.%Derived.val] -// CHECK:STDOUT: %.loc12_3: init %Derived = converted %.loc12_31.1, %.loc12_31.4 [concrete = constants.%Derived.val] +// CHECK:STDOUT: %.loc12_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc12_38.1: %struct_type.base.f5e = struct_literal (%.loc12_37.1) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc12_38.2: ref %ProtectedDestructor = class_element_access %a.var, element0 +// CHECK:STDOUT: %.loc12_37.2: init %ProtectedDestructor to %.loc12_38.2 = class_init () [concrete = constants.%ProtectedDestructor.val] +// CHECK:STDOUT: %.loc12_38.3: init %ProtectedDestructor = converted %.loc12_37.1, %.loc12_37.2 [concrete = constants.%ProtectedDestructor.val] +// CHECK:STDOUT: %.loc12_38.4: init %Derived to %a.var = class_init (%.loc12_38.3) [concrete = constants.%Derived.val] +// CHECK:STDOUT: %.loc12_3: init %Derived = converted %.loc12_38.1, %.loc12_38.4 [concrete = constants.%Derived.val] // CHECK:STDOUT: assign %a.var, %.loc12_3 // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived] // CHECK:STDOUT: %a: ref %Derived = ref_binding a, %a.var @@ -374,13 +374,13 @@ fn EqualWitnesses(p: Wrap(Cpp.PublicDestructor)*) -> Wrap(Cpp.PublicDestructor)* // CHECK:STDOUT: %a.var_patt: %pattern_type.9f6 = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %Derived = var %a.var_patt -// CHECK:STDOUT: %.loc13_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc13_31.1: %struct_type.base.f5e = struct_literal (%.loc13_30.1) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc13_31.2: ref %PrivateDestructor = class_element_access %a.var, element0 -// CHECK:STDOUT: %.loc13_30.2: init %PrivateDestructor to %.loc13_31.2 = class_init () [concrete = constants.%PrivateDestructor.val] -// CHECK:STDOUT: %.loc13_31.3: init %PrivateDestructor = converted %.loc13_30.1, %.loc13_30.2 [concrete = constants.%PrivateDestructor.val] -// CHECK:STDOUT: %.loc13_31.4: init %Derived to %a.var = class_init (%.loc13_31.3) [concrete = constants.%Derived.val] -// CHECK:STDOUT: %.loc13_3: init %Derived = converted %.loc13_31.1, %.loc13_31.4 [concrete = constants.%Derived.val] +// CHECK:STDOUT: %.loc13_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc13_38.1: %struct_type.base.f5e = struct_literal (%.loc13_37.1) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc13_38.2: ref %PrivateDestructor = class_element_access %a.var, element0 +// CHECK:STDOUT: %.loc13_37.2: init %PrivateDestructor to %.loc13_38.2 = class_init () [concrete = constants.%PrivateDestructor.val] +// CHECK:STDOUT: %.loc13_38.3: init %PrivateDestructor = converted %.loc13_37.1, %.loc13_37.2 [concrete = constants.%PrivateDestructor.val] +// CHECK:STDOUT: %.loc13_38.4: init %Derived to %a.var = class_init (%.loc13_38.3) [concrete = constants.%Derived.val] +// CHECK:STDOUT: %.loc13_3: init %Derived = converted %.loc13_38.1, %.loc13_38.4 [concrete = constants.%Derived.val] // CHECK:STDOUT: assign %a.var, %.loc13_3 // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived] // CHECK:STDOUT: %a: ref %Derived = ref_binding a, %a.var diff --git a/toolchain/check/testdata/interop/cpp/import.carbon b/toolchain/check/testdata/interop/cpp/import.carbon index 6268d0509635..96225cafae52 100644 --- a/toolchain/check/testdata/interop/cpp/import.carbon +++ b/toolchain/check/testdata/interop/cpp/import.carbon @@ -38,11 +38,11 @@ import library "namespace_api"; fn F() { // Imports are not implicitly re-exported, so lookup is expected to fail. - // CHECK:STDERR: fail_import_namespace_api.carbon:[[@LINE+4]]:10: error: member name `MyClass` not found in `Cpp.MyNamespace` [MemberNameNotFoundInInstScope] - // CHECK:STDERR: var x: MyNamespaceAlias.MyClass; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_namespace_api.carbon:[[@LINE+4]]:17: error: member name `MyClass` not found in `Cpp.MyNamespace` [MemberNameNotFoundInInstScope] + // CHECK:STDERR: var unused x: MyNamespaceAlias.MyClass; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var x: MyNamespaceAlias.MyClass; + var unused x: MyNamespaceAlias.MyClass; } // ============================================================================ @@ -126,7 +126,7 @@ library "[[@TEST_NAME]]"; import Cpp; fn F(input: Cpp.int) { - let output: i32 = input; + let unused output: i32 = input; } // ============================================================================ diff --git a/toolchain/check/testdata/interop/cpp/macros.carbon b/toolchain/check/testdata/interop/cpp/macros.carbon index 2ea790fe36fa..54be4fafe241 100644 --- a/toolchain/check/testdata/interop/cpp/macros.carbon +++ b/toolchain/check/testdata/interop/cpp/macros.carbon @@ -30,12 +30,12 @@ import Cpp library "integer_literal_replacement_token.h"; fn F() { //@dump-sem-ir-begin - let a: i32 = Cpp.CONFIG_VALUE; - let b: i64 = Cpp.CONFIG_VALUE_LONG; - let c: u32 = Cpp.CONFIG_VALUE_UNSIGNED; - let d: i32 = Cpp.CONFIG_VALUE_HEXA; - let e: i32 = Cpp.CONFIG_VALUE_OCTAL; - let f: i32 = Cpp.CONFIG_VALUE_BINARY; + let unused a: i32 = Cpp.CONFIG_VALUE; + let unused b: i64 = Cpp.CONFIG_VALUE_LONG; + let unused c: u32 = Cpp.CONFIG_VALUE_UNSIGNED; + let unused d: i32 = Cpp.CONFIG_VALUE_HEXA; + let unused e: i32 = Cpp.CONFIG_VALUE_OCTAL; + let unused f: i32 = Cpp.CONFIG_VALUE_BINARY; //@dump-sem-ir-end } @@ -119,13 +119,13 @@ library "[[@TEST_NAME]]"; import Cpp library "macro_in_nested_scope.h"; fn F() { - let a: i32 = Cpp.CONFIG_VALUE; + let unused a: i32 = Cpp.CONFIG_VALUE; - // CHECK:STDERR: fail_import_macro_in_nested_scope.carbon:[[@LINE+4]]:16: error: member name `CONFIG_VALUE` not found in `Cpp.N` [MemberNameNotFoundInInstScope] - // CHECK:STDERR: let b: i32 = Cpp.N.CONFIG_VALUE; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_macro_in_nested_scope.carbon:[[@LINE+4]]:23: error: member name `CONFIG_VALUE` not found in `Cpp.N` [MemberNameNotFoundInInstScope] + // CHECK:STDERR: let unused b: i32 = Cpp.N.CONFIG_VALUE; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let b: i32 = Cpp.N.CONFIG_VALUE; + let unused b: i32 = Cpp.N.CONFIG_VALUE; } // --- macro_and_non_macro_same_name.h @@ -146,9 +146,9 @@ fn F() { //@dump-sem-ir-begin // When the same macro name and non-macro name exist in the global C++ scope, the macro name is selected. // Cpp.n is treated as an integer constant with value 1. - var a: array(f32, Cpp.n) = (1.0,); + var unused a: array(f32, Cpp.n) = (1.0,); - let b: f32 = Cpp.X.n; + let unused b: f32 = Cpp.X.n; //@dump-sem-ir-end } @@ -188,7 +188,7 @@ import Cpp library "unary_operator.h"; fn F() { //@dump-sem-ir-begin - let a: i32 = Cpp.NEGATIVE; + let unused a: i32 = Cpp.NEGATIVE; //@dump-sem-ir-end } @@ -203,7 +203,7 @@ import Cpp library "binary_operator.h"; fn F() { //@dump-sem-ir-begin - let a: i32 = Cpp.ADDITION; + let unused a: i32 = Cpp.ADDITION; //@dump-sem-ir-end } @@ -221,10 +221,10 @@ import Cpp library "casting.h"; fn F() { //@dump-sem-ir-begin - let a: u32 = Cpp.CAST_UNSIGNED; - let b: i32 = Cpp.CAST_STATIC; - let c: i32 = Cpp.CAST_FUNCTIONAL; - let d: i32 = Cpp.CAST_BOOL_TO_INT; + let unused a: u32 = Cpp.CAST_UNSIGNED; + let unused b: i32 = Cpp.CAST_STATIC; + let unused c: i32 = Cpp.CAST_FUNCTIONAL; + let unused d: i32 = Cpp.CAST_BOOL_TO_INT; //@dump-sem-ir-end } @@ -240,7 +240,7 @@ import Cpp library "nested_macros.h"; fn F() { //@dump-sem-ir-begin - let a: i32 = Cpp.INDIRECT_ONE; + let unused a: i32 = Cpp.INDIRECT_ONE; //@dump-sem-ir-end } @@ -264,13 +264,13 @@ import Cpp library "string_literal_object_like_macro.h"; fn F() { //@dump-sem-ir-begin - let a: str = Cpp.SimpleString; - let b: str = Cpp.EmptyString; - let c: str = Cpp.EscapeCharacter; - let d: str = Cpp.Concatenated; - let e: str = Cpp.RawString; - let f: str = Cpp.Utf8String; - let g: str = Cpp.Indirect; + let unused a: str = Cpp.SimpleString; + let unused b: str = Cpp.EmptyString; + let unused c: str = Cpp.EscapeCharacter; + let unused d: str = Cpp.Concatenated; + let unused e: str = Cpp.RawString; + let unused f: str = Cpp.Utf8String; + let unused g: str = Cpp.Indirect; //@dump-sem-ir-end } @@ -361,9 +361,9 @@ import Cpp library "floating_point_literal_macro.h"; fn F() { //@dump-sem-ir-begin - let a: f64 = Cpp.MyDouble; - let b: f64 = Cpp.MyDoubleE; - let c: f32 = Cpp.MyFloat; + let unused a: f64 = Cpp.MyDouble; + let unused b: f64 = Cpp.MyDoubleE; + let unused c: f32 = Cpp.MyFloat; //@dump-sem-ir-end } @@ -422,12 +422,12 @@ import Cpp library "character_literals.h"; fn F() { //@dump-sem-ir-begin - let a: char = Cpp.M_LOWERCASE; - let b: char = Cpp.M_UPPERCASE; - let c: char = Cpp.M_DIGIT; - let d: char = Cpp.M_SPACE; - let e: char = Cpp.M_TAB; - let f: char = Cpp.M_UTF8_CHAR; + let unused a: char = Cpp.M_LOWERCASE; + let unused b: char = Cpp.M_UPPERCASE; + let unused c: char = Cpp.M_DIGIT; + let unused d: char = Cpp.M_SPACE; + let unused e: char = Cpp.M_TAB; + let unused f: char = Cpp.M_UTF8_CHAR; //@dump-sem-ir-end } @@ -445,9 +445,9 @@ import Cpp library "character_literals_operators.h"; fn F() { //@dump-sem-ir-begin - let a: char = Cpp.M_CONDITIONAL; - let b: i32 = Cpp.M_A_PLUS_ONE; - let c: bool = Cpp.M_A_EQUAL; + let unused a: char = Cpp.M_CONDITIONAL; + let unused b: i32 = Cpp.M_A_PLUS_ONE; + let unused c: bool = Cpp.M_A_EQUAL; //@dump-sem-ir-end } @@ -466,11 +466,11 @@ library "[[@TEST_NAME]]"; import Cpp library "multiple_characters.h"; fn F() { - // CHECK:STDERR: import_multiple_characters.carbon:[[@LINE+4]]:15: note: in `Cpp` name lookup for `MULTIPLE_CHARS` [InCppNameLookup] - // CHECK:STDERR: let a: i32 = Cpp.MULTIPLE_CHARS; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: import_multiple_characters.carbon:[[@LINE+4]]:22: note: in `Cpp` name lookup for `MULTIPLE_CHARS` [InCppNameLookup] + // CHECK:STDERR: let unused a: i32 = Cpp.MULTIPLE_CHARS; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let a: i32 = Cpp.MULTIPLE_CHARS; + let unused a: i32 = Cpp.MULTIPLE_CHARS; } // --- unsupported_character_literal_types.h @@ -486,42 +486,42 @@ library "[[@TEST_NAME]]"; import Cpp library "unsupported_character_literal_types.h"; fn F() { - // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+11]]:16: error: semantics TODO: `Unsupported: C++ literal's type `char16_t` could not be mapped to a Carbon type` [SemanticsTodo] - // CHECK:STDERR: let a: char = Cpp.M_UTF16_CHAR; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+8]]:16: note: in `Cpp` name lookup for `M_UTF16_CHAR` [InCppNameLookup] - // CHECK:STDERR: let a: char = Cpp.M_UTF16_CHAR; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+11]]:23: error: semantics TODO: `Unsupported: C++ literal's type `char16_t` could not be mapped to a Carbon type` [SemanticsTodo] + // CHECK:STDERR: let unused a: char = Cpp.M_UTF16_CHAR; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+8]]:23: note: in `Cpp` name lookup for `M_UTF16_CHAR` [InCppNameLookup] + // CHECK:STDERR: let unused a: char = Cpp.M_UTF16_CHAR; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+4]]:16: error: member name `M_UTF16_CHAR` not found in `Cpp` [MemberNameNotFoundInInstScope] - // CHECK:STDERR: let a: char = Cpp.M_UTF16_CHAR; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+4]]:23: error: member name `M_UTF16_CHAR` not found in `Cpp` [MemberNameNotFoundInInstScope] + // CHECK:STDERR: let unused a: char = Cpp.M_UTF16_CHAR; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: - let a: char = Cpp.M_UTF16_CHAR; - // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+11]]:16: error: semantics TODO: `Unsupported: C++ literal's type `char32_t` could not be mapped to a Carbon type` [SemanticsTodo] - // CHECK:STDERR: let b: char = Cpp.M_UTF32_CHAR; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+8]]:16: note: in `Cpp` name lookup for `M_UTF32_CHAR` [InCppNameLookup] - // CHECK:STDERR: let b: char = Cpp.M_UTF32_CHAR; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~ + let unused a: char = Cpp.M_UTF16_CHAR; + // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+11]]:23: error: semantics TODO: `Unsupported: C++ literal's type `char32_t` could not be mapped to a Carbon type` [SemanticsTodo] + // CHECK:STDERR: let unused b: char = Cpp.M_UTF32_CHAR; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+8]]:23: note: in `Cpp` name lookup for `M_UTF32_CHAR` [InCppNameLookup] + // CHECK:STDERR: let unused b: char = Cpp.M_UTF32_CHAR; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+4]]:16: error: member name `M_UTF32_CHAR` not found in `Cpp` [MemberNameNotFoundInInstScope] - // CHECK:STDERR: let b: char = Cpp.M_UTF32_CHAR; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+4]]:23: error: member name `M_UTF32_CHAR` not found in `Cpp` [MemberNameNotFoundInInstScope] + // CHECK:STDERR: let unused b: char = Cpp.M_UTF32_CHAR; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: - let b: char = Cpp.M_UTF32_CHAR; - // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+11]]:16: error: semantics TODO: `Unsupported: C++ literal's type `wchar_t` could not be mapped to a Carbon type` [SemanticsTodo] - // CHECK:STDERR: let c: char = Cpp.M_WIDE_CHAR; - // CHECK:STDERR: ^~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+8]]:16: note: in `Cpp` name lookup for `M_WIDE_CHAR` [InCppNameLookup] - // CHECK:STDERR: let c: char = Cpp.M_WIDE_CHAR; - // CHECK:STDERR: ^~~~~~~~~~~~~~~ + let unused b: char = Cpp.M_UTF32_CHAR; + // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+11]]:23: error: semantics TODO: `Unsupported: C++ literal's type `wchar_t` could not be mapped to a Carbon type` [SemanticsTodo] + // CHECK:STDERR: let unused c: char = Cpp.M_WIDE_CHAR; + // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+8]]:23: note: in `Cpp` name lookup for `M_WIDE_CHAR` [InCppNameLookup] + // CHECK:STDERR: let unused c: char = Cpp.M_WIDE_CHAR; + // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+4]]:16: error: member name `M_WIDE_CHAR` not found in `Cpp` [MemberNameNotFoundInInstScope] - // CHECK:STDERR: let c: char = Cpp.M_WIDE_CHAR; - // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+4]]:23: error: member name `M_WIDE_CHAR` not found in `Cpp` [MemberNameNotFoundInInstScope] + // CHECK:STDERR: let unused c: char = Cpp.M_WIDE_CHAR; + // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: - let c: char = Cpp.M_WIDE_CHAR; + let unused c: char = Cpp.M_WIDE_CHAR; } // --- fail_assign_to_character_literals.carbon @@ -563,18 +563,18 @@ import Cpp library "boolean_literal_macro.h"; fn F() { //@dump-sem-ir-begin - let a: bool = Cpp.M_TRUE; - let b: bool = Cpp.M_FALSE; - let c: bool = Cpp.M_NOT_TRUE; - let d: bool = Cpp.M_NOT_ZERO; - let e: bool = Cpp.M_ONE_EQ_ONE; - let f: bool = Cpp.M_ONE_NEQ_ONE; - let g: bool = Cpp.M_AND; - let h: bool = Cpp.M_OR; - let i: bool = Cpp.M_COMPLEX; + let unused a: bool = Cpp.M_TRUE; + let unused b: bool = Cpp.M_FALSE; + let unused c: bool = Cpp.M_NOT_TRUE; + let unused d: bool = Cpp.M_NOT_ZERO; + let unused e: bool = Cpp.M_ONE_EQ_ONE; + let unused f: bool = Cpp.M_ONE_NEQ_ONE; + let unused g: bool = Cpp.M_AND; + let unused h: bool = Cpp.M_OR; + let unused i: bool = Cpp.M_COMPLEX; - let j: i32 = Cpp.M_ONE; - let k: i32 = Cpp.M_ZERO; + let unused j: i32 = Cpp.M_ONE; + let unused k: i32 = Cpp.M_ZERO; //@dump-sem-ir-end } @@ -634,7 +634,7 @@ import Cpp inline ''' fn F() { //@dump-sem-ir-begin - let a: Cpp.A = Cpp.M_A; + let unused a: Cpp.A = Cpp.M_A; //@dump-sem-ir-end } @@ -662,7 +662,7 @@ import Cpp inline ''' fn F() { //@dump-sem-ir-begin - let a: i32 = Cpp.M_CONSTEXPR_INT; + let unused a: i32 = Cpp.M_CONSTEXPR_INT; //@dump-sem-ir-end } @@ -676,7 +676,7 @@ import Cpp inline ''' '''; fn F() { - let a: i32 = Cpp.M_CONSTEXPR_NO_SCOPE; + let unused a: i32 = Cpp.M_CONSTEXPR_NO_SCOPE; } // --- fail_todo_import_macro_constexpr_float.carbon @@ -689,18 +689,18 @@ import Cpp inline ''' '''; fn F() { - // CHECK:STDERR: fail_todo_import_macro_constexpr_float.carbon:[[@LINE+11]]:16: error: semantics TODO: `Unsupported: macro evaluated to a non-integer LValue` [SemanticsTodo] - // CHECK:STDERR: let a: f32 = Cpp.M_CONSTEXPR_FLOAT; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_import_macro_constexpr_float.carbon:[[@LINE+8]]:16: note: in `Cpp` name lookup for `M_CONSTEXPR_FLOAT` [InCppNameLookup] - // CHECK:STDERR: let a: f32 = Cpp.M_CONSTEXPR_FLOAT; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_import_macro_constexpr_float.carbon:[[@LINE+11]]:23: error: semantics TODO: `Unsupported: macro evaluated to a non-integer LValue` [SemanticsTodo] + // CHECK:STDERR: let unused a: f32 = Cpp.M_CONSTEXPR_FLOAT; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_import_macro_constexpr_float.carbon:[[@LINE+8]]:23: note: in `Cpp` name lookup for `M_CONSTEXPR_FLOAT` [InCppNameLookup] + // CHECK:STDERR: let unused a: f32 = Cpp.M_CONSTEXPR_FLOAT; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_todo_import_macro_constexpr_float.carbon:[[@LINE+4]]:16: error: member name `M_CONSTEXPR_FLOAT` not found in `Cpp` [MemberNameNotFoundInInstScope] - // CHECK:STDERR: let a: f32 = Cpp.M_CONSTEXPR_FLOAT; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_import_macro_constexpr_float.carbon:[[@LINE+4]]:23: error: member name `M_CONSTEXPR_FLOAT` not found in `Cpp` [MemberNameNotFoundInInstScope] + // CHECK:STDERR: let unused a: f32 = Cpp.M_CONSTEXPR_FLOAT; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - let a: f32 = Cpp.M_CONSTEXPR_FLOAT; + let unused a: f32 = Cpp.M_CONSTEXPR_FLOAT; } // --- lambda.carbon @@ -713,7 +713,7 @@ import Cpp inline ''' fn F() { //@dump-sem-ir-begin - let i: i32 = Cpp.MyIntLambda; + let unused i: i32 = Cpp.MyIntLambda; //@dump-sem-ir-end } @@ -729,11 +729,11 @@ library "[[@TEST_NAME]]"; import Cpp library "macro_undefined.h"; fn F() { - // CHECK:STDERR: fail_macro_undefined.carbon:[[@LINE+4]]:16: error: member name `UNDEF_NAME` not found in `Cpp` [MemberNameNotFoundInInstScope] - // CHECK:STDERR: let a: i32 = Cpp.UNDEF_NAME; - // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: fail_macro_undefined.carbon:[[@LINE+4]]:23: error: member name `UNDEF_VALUE` not found in `Cpp` [MemberNameNotFoundInInstScope] + // CHECK:STDERR: let unused a: i32 = Cpp.UNDEF_VALUE; + // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: - let a: i32 = Cpp.UNDEF_NAME; + let unused a: i32 = Cpp.UNDEF_VALUE; } // --- macro_redefined.h @@ -751,7 +751,7 @@ import Cpp library "macro_redefined.h"; fn F() { //@dump-sem-ir-begin - let a: i32 = Cpp.REDEF_NAME; + let unused a: i32 = Cpp.REDEF_NAME; //@dump-sem-ir-end } @@ -777,7 +777,7 @@ import Cpp library "macro_defined_twice.h"; fn F() { //@dump-sem-ir-begin - let a: i32 = Cpp.TWICE_DEF; + let unused a: i32 = Cpp.TWICE_DEF; //@dump-sem-ir-end } @@ -796,11 +796,11 @@ library "[[@TEST_NAME]]"; import Cpp library "function_like_macros.h"; fn F() { - // CHECK:STDERR: fail_todo_import_function_like_macros.carbon:[[@LINE+4]]:16: error: member name `MAX` not found in `Cpp` [MemberNameNotFoundInInstScope] - // CHECK:STDERR: let a: i32 = Cpp.MAX(1,2); - // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: fail_todo_import_function_like_macros.carbon:[[@LINE+4]]:23: error: member name `MAX` not found in `Cpp` [MemberNameNotFoundInInstScope] + // CHECK:STDERR: let unused a: i32 = Cpp.MAX(1,2); + // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: - let a: i32 = Cpp.MAX(1,2); + let unused a: i32 = Cpp.MAX(1,2); } // ============================================================================ @@ -818,11 +818,11 @@ library "[[@TEST_NAME]]"; import Cpp library "predefined_macros.h"; fn F() { - // CHECK:STDERR: fail_todo_import_predefined_macros.carbon:[[@LINE+4]]:23: error: member name `__LINE__` not found in `Cpp` [MemberNameNotFoundInInstScope] - // CHECK:STDERR: let line_num: i32 = Cpp.__LINE__; - // CHECK:STDERR: ^~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_import_predefined_macros.carbon:[[@LINE+4]]:30: error: member name `__LINE__` not found in `Cpp` [MemberNameNotFoundInInstScope] + // CHECK:STDERR: let unused line_num: i32 = Cpp.__LINE__; + // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: - let line_num: i32 = Cpp.__LINE__; + let unused line_num: i32 = Cpp.__LINE__; } // ============================================================================ @@ -1036,33 +1036,33 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %array_type = var %a.var_patt // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float.674] -// CHECK:STDOUT: %.loc10_35.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] -// CHECK:STDOUT: %impl.elem0.loc10_35: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] -// CHECK:STDOUT: %bound_method.loc10_35.1: = bound_method %float, %impl.elem0.loc10_35 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc10_35: = specific_function %impl.elem0.loc10_35, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc10_35.2: = bound_method %float, %specific_fn.loc10_35 [concrete = constants.%bound_method.1e4] -// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc10_35.2(%float) [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc10_35.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc10_42.1: %tuple.type = tuple_literal (%float) [concrete = constants.%tuple] +// CHECK:STDOUT: %impl.elem0.loc10_42: %.98d = impl_witness_access constants.%ImplicitAs.impl_witness.bc6, element0 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.e55] +// CHECK:STDOUT: %bound_method.loc10_42.1: = bound_method %float, %impl.elem0.loc10_42 [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc10_42: = specific_function %impl.elem0.loc10_42, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_42.2: = bound_method %float, %specific_fn.loc10_42 [concrete = constants.%bound_method.1e4] +// CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f32.97e = call %bound_method.loc10_42.2(%float) [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc10_42.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc10_35.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc10_35.4: init %f32.97e to %.loc10_35.3 = in_place_init %.loc10_35.2 [concrete = constants.%float.e3b] -// CHECK:STDOUT: %.loc10_35.5: init %array_type to %a.var = array_init (%.loc10_35.4) [concrete = constants.%array] -// CHECK:STDOUT: %.loc10_3: init %array_type = converted %.loc10_35.1, %.loc10_35.5 [concrete = constants.%array] +// CHECK:STDOUT: %.loc10_42.3: ref %f32.97e = array_index %a.var, %int_0 +// CHECK:STDOUT: %.loc10_42.4: init %f32.97e to %.loc10_42.3 = in_place_init %.loc10_42.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc10_42.5: init %array_type to %a.var = array_init (%.loc10_42.4) [concrete = constants.%array] +// CHECK:STDOUT: %.loc10_3: init %array_type = converted %.loc10_42.1, %.loc10_42.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc10_3 -// CHECK:STDOUT: %.loc10_26: type = splice_block %array_type [concrete = constants.%array_type] { +// CHECK:STDOUT: %.loc10_33: type = splice_block %array_type [concrete = constants.%array_type] { // CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %f32.loc10: type = class_type @Float, @Float(constants.%int_32) [concrete = constants.%f32.97e] // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: // CHECK:STDOUT: %n.ref.loc10: %i32 = name_ref n, imports.%int_1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc10_24: %.0a7 = impl_witness_access constants.%ImplicitAs.impl_witness.640, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.dd4] -// CHECK:STDOUT: %bound_method.loc10_24.1: = bound_method %n.ref.loc10, %impl.elem0.loc10_24 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc10_24: = specific_function %impl.elem0.loc10_24, @Int.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Int.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc10_24.2: = bound_method %n.ref.loc10, %specific_fn.loc10_24 [concrete = constants.%bound_method.04c] -// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.loc10_24.2(%n.ref.loc10) [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc10_24.1: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc10_24.2: Core.IntLiteral = converted %n.ref.loc10, %.loc10_24.1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %array_type: type = array_type %.loc10_24.2, %f32.loc10 [concrete = constants.%array_type] +// CHECK:STDOUT: %impl.elem0.loc10_31: %.0a7 = impl_witness_access constants.%ImplicitAs.impl_witness.640, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.dd4] +// CHECK:STDOUT: %bound_method.loc10_31.1: = bound_method %n.ref.loc10, %impl.elem0.loc10_31 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc10_31: = specific_function %impl.elem0.loc10_31, @Int.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Int.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_31.2: = bound_method %n.ref.loc10, %specific_fn.loc10_31 [concrete = constants.%bound_method.04c] +// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.loc10_31.2(%n.ref.loc10) [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc10_31.1: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc10_31.2: Core.IntLiteral = converted %n.ref.loc10, %.loc10_31.1 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %array_type: type = array_type %.loc10_31.2, %f32.loc10 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %array_type = ref_binding a, %a.var // CHECK:STDOUT: name_binding_decl { @@ -1072,12 +1072,12 @@ fn F() { // CHECK:STDOUT: %X.ref: = name_ref X, imports.%X [concrete = imports.%X] // CHECK:STDOUT: // CHECK:STDOUT: %n.ref.loc12: ref %f32.97e = name_ref n, imports.%n.var [concrete = imports.%n.var] -// CHECK:STDOUT: %.loc12_10: type = splice_block %f32.loc12 [concrete = constants.%f32.97e] { +// CHECK:STDOUT: %.loc12_17: type = splice_block %f32.loc12 [concrete = constants.%f32.97e] { // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %f32.loc12: type = class_type @Float, @Float(constants.%int_32) [concrete = constants.%f32.97e] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc12_21: %f32.97e = acquire_value %n.ref.loc12 -// CHECK:STDOUT: %b: %f32.97e = value_binding b, %.loc12_21 +// CHECK:STDOUT: %.loc12_28: %f32.97e = acquire_value %n.ref.loc12 +// CHECK:STDOUT: %b: %f32.97e = value_binding b, %.loc12_28 // CHECK:STDOUT: %DestroyOp.bound: = bound_method %a.var, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%a.var) // CHECK:STDOUT: @@ -1546,10 +1546,10 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %M_A_EQUAL.ref: bool = name_ref M_A_EQUAL, imports.%true [concrete = constants.%true] -// CHECK:STDOUT: %.loc10_10.1: type = splice_block %.loc10_10.3 [concrete = bool] { +// CHECK:STDOUT: %.loc10_17.1: type = splice_block %.loc10_17.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc10_10.2: type = value_of_initializer %Bool.call [concrete = bool] -// CHECK:STDOUT: %.loc10_10.3: type = converted %Bool.call, %.loc10_10.2 [concrete = bool] +// CHECK:STDOUT: %.loc10_17.2: type = value_of_initializer %Bool.call [concrete = bool] +// CHECK:STDOUT: %.loc10_17.3: type = converted %Bool.call, %.loc10_17.2 [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: %c: bool = value_binding c, %M_A_EQUAL.ref // CHECK:STDOUT: @@ -1605,10 +1605,10 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref.loc8: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %M_TRUE.ref: bool = name_ref M_TRUE, imports.%true.d1048d.1 [concrete = constants.%true] -// CHECK:STDOUT: %.loc8_10.1: type = splice_block %.loc8_10.3 [concrete = bool] { +// CHECK:STDOUT: %.loc8_17.1: type = splice_block %.loc8_17.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc8: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc8_10.2: type = value_of_initializer %Bool.call.loc8 [concrete = bool] -// CHECK:STDOUT: %.loc8_10.3: type = converted %Bool.call.loc8, %.loc8_10.2 [concrete = bool] +// CHECK:STDOUT: %.loc8_17.2: type = value_of_initializer %Bool.call.loc8 [concrete = bool] +// CHECK:STDOUT: %.loc8_17.3: type = converted %Bool.call.loc8, %.loc8_17.2 [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: %a: bool = value_binding a, %M_TRUE.ref // CHECK:STDOUT: name_binding_decl { @@ -1616,10 +1616,10 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref.loc9: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %M_FALSE.ref: bool = name_ref M_FALSE, imports.%false.505718.1 [concrete = constants.%false] -// CHECK:STDOUT: %.loc9_10.1: type = splice_block %.loc9_10.3 [concrete = bool] { +// CHECK:STDOUT: %.loc9_17.1: type = splice_block %.loc9_17.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc9: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc9_10.2: type = value_of_initializer %Bool.call.loc9 [concrete = bool] -// CHECK:STDOUT: %.loc9_10.3: type = converted %Bool.call.loc9, %.loc9_10.2 [concrete = bool] +// CHECK:STDOUT: %.loc9_17.2: type = value_of_initializer %Bool.call.loc9 [concrete = bool] +// CHECK:STDOUT: %.loc9_17.3: type = converted %Bool.call.loc9, %.loc9_17.2 [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = value_binding b, %M_FALSE.ref // CHECK:STDOUT: name_binding_decl { @@ -1627,10 +1627,10 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %M_NOT_TRUE.ref: bool = name_ref M_NOT_TRUE, imports.%false.505718.2 [concrete = constants.%false] -// CHECK:STDOUT: %.loc10_10.1: type = splice_block %.loc10_10.3 [concrete = bool] { +// CHECK:STDOUT: %.loc10_17.1: type = splice_block %.loc10_17.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc10: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc10_10.2: type = value_of_initializer %Bool.call.loc10 [concrete = bool] -// CHECK:STDOUT: %.loc10_10.3: type = converted %Bool.call.loc10, %.loc10_10.2 [concrete = bool] +// CHECK:STDOUT: %.loc10_17.2: type = value_of_initializer %Bool.call.loc10 [concrete = bool] +// CHECK:STDOUT: %.loc10_17.3: type = converted %Bool.call.loc10, %.loc10_17.2 [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: %c: bool = value_binding c, %M_NOT_TRUE.ref // CHECK:STDOUT: name_binding_decl { @@ -1638,10 +1638,10 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref.loc11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %M_NOT_ZERO.ref: bool = name_ref M_NOT_ZERO, imports.%true.d1048d.2 [concrete = constants.%true] -// CHECK:STDOUT: %.loc11_10.1: type = splice_block %.loc11_10.3 [concrete = bool] { +// CHECK:STDOUT: %.loc11_17.1: type = splice_block %.loc11_17.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc11: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc11_10.2: type = value_of_initializer %Bool.call.loc11 [concrete = bool] -// CHECK:STDOUT: %.loc11_10.3: type = converted %Bool.call.loc11, %.loc11_10.2 [concrete = bool] +// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %Bool.call.loc11 [concrete = bool] +// CHECK:STDOUT: %.loc11_17.3: type = converted %Bool.call.loc11, %.loc11_17.2 [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: %d: bool = value_binding d, %M_NOT_ZERO.ref // CHECK:STDOUT: name_binding_decl { @@ -1649,10 +1649,10 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref.loc12: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %M_ONE_EQ_ONE.ref: bool = name_ref M_ONE_EQ_ONE, imports.%true.d1048d.3 [concrete = constants.%true] -// CHECK:STDOUT: %.loc12_10.1: type = splice_block %.loc12_10.3 [concrete = bool] { +// CHECK:STDOUT: %.loc12_17.1: type = splice_block %.loc12_17.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc12: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %Bool.call.loc12 [concrete = bool] -// CHECK:STDOUT: %.loc12_10.3: type = converted %Bool.call.loc12, %.loc12_10.2 [concrete = bool] +// CHECK:STDOUT: %.loc12_17.2: type = value_of_initializer %Bool.call.loc12 [concrete = bool] +// CHECK:STDOUT: %.loc12_17.3: type = converted %Bool.call.loc12, %.loc12_17.2 [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: %e: bool = value_binding e, %M_ONE_EQ_ONE.ref // CHECK:STDOUT: name_binding_decl { @@ -1660,10 +1660,10 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref.loc13: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %M_ONE_NEQ_ONE.ref: bool = name_ref M_ONE_NEQ_ONE, imports.%false.505718.3 [concrete = constants.%false] -// CHECK:STDOUT: %.loc13_10.1: type = splice_block %.loc13_10.3 [concrete = bool] { +// CHECK:STDOUT: %.loc13_17.1: type = splice_block %.loc13_17.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc13: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc13_10.2: type = value_of_initializer %Bool.call.loc13 [concrete = bool] -// CHECK:STDOUT: %.loc13_10.3: type = converted %Bool.call.loc13, %.loc13_10.2 [concrete = bool] +// CHECK:STDOUT: %.loc13_17.2: type = value_of_initializer %Bool.call.loc13 [concrete = bool] +// CHECK:STDOUT: %.loc13_17.3: type = converted %Bool.call.loc13, %.loc13_17.2 [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: %f: bool = value_binding f, %M_ONE_NEQ_ONE.ref // CHECK:STDOUT: name_binding_decl { @@ -1671,10 +1671,10 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref.loc14: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %M_AND.ref: bool = name_ref M_AND, imports.%true.d1048d.4 [concrete = constants.%true] -// CHECK:STDOUT: %.loc14_10.1: type = splice_block %.loc14_10.3 [concrete = bool] { +// CHECK:STDOUT: %.loc14_17.1: type = splice_block %.loc14_17.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc14: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc14_10.2: type = value_of_initializer %Bool.call.loc14 [concrete = bool] -// CHECK:STDOUT: %.loc14_10.3: type = converted %Bool.call.loc14, %.loc14_10.2 [concrete = bool] +// CHECK:STDOUT: %.loc14_17.2: type = value_of_initializer %Bool.call.loc14 [concrete = bool] +// CHECK:STDOUT: %.loc14_17.3: type = converted %Bool.call.loc14, %.loc14_17.2 [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: %g: bool = value_binding g, %M_AND.ref // CHECK:STDOUT: name_binding_decl { @@ -1682,10 +1682,10 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref.loc15: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %M_OR.ref: bool = name_ref M_OR, imports.%true.d1048d.5 [concrete = constants.%true] -// CHECK:STDOUT: %.loc15_10.1: type = splice_block %.loc15_10.3 [concrete = bool] { +// CHECK:STDOUT: %.loc15_17.1: type = splice_block %.loc15_17.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc15: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc15_10.2: type = value_of_initializer %Bool.call.loc15 [concrete = bool] -// CHECK:STDOUT: %.loc15_10.3: type = converted %Bool.call.loc15, %.loc15_10.2 [concrete = bool] +// CHECK:STDOUT: %.loc15_17.2: type = value_of_initializer %Bool.call.loc15 [concrete = bool] +// CHECK:STDOUT: %.loc15_17.3: type = converted %Bool.call.loc15, %.loc15_17.2 [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: %h: bool = value_binding h, %M_OR.ref // CHECK:STDOUT: name_binding_decl { @@ -1693,10 +1693,10 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp.ref.loc16: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %M_COMPLEX.ref: bool = name_ref M_COMPLEX, imports.%true.d1048d.6 [concrete = constants.%true] -// CHECK:STDOUT: %.loc16_10.1: type = splice_block %.loc16_10.3 [concrete = bool] { +// CHECK:STDOUT: %.loc16_17.1: type = splice_block %.loc16_17.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc16: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc16_10.2: type = value_of_initializer %Bool.call.loc16 [concrete = bool] -// CHECK:STDOUT: %.loc16_10.3: type = converted %Bool.call.loc16, %.loc16_10.2 [concrete = bool] +// CHECK:STDOUT: %.loc16_17.2: type = value_of_initializer %Bool.call.loc16 [concrete = bool] +// CHECK:STDOUT: %.loc16_17.3: type = converted %Bool.call.loc16, %.loc16_17.2 [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: %i: bool = value_binding i, %M_COMPLEX.ref // CHECK:STDOUT: name_binding_decl { @@ -1841,10 +1841,10 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type = value_binding_pattern a [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc11_18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc11_25: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %M_A.ref: %A = name_ref M_A, imports.%int_1 [concrete = constants.%int_1] // CHECK:STDOUT: %.loc11: type = splice_block %A.ref [concrete = constants.%A] { -// CHECK:STDOUT: %Cpp.ref.loc11_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc11_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%A.decl [concrete = constants.%A] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %A = value_binding a, %M_A.ref @@ -1878,13 +1878,13 @@ fn F() { // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: // CHECK:STDOUT: %M_CONSTEXPR_INT.ref: %const = name_ref M_CONSTEXPR_INT, imports.%int_1 [concrete = constants.%int_1.22e] -// CHECK:STDOUT: %.loc11_10: type = splice_block %i32.loc11 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc11_17: type = splice_block %i32.loc11 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11_19.1: %i32 = as_compatible %M_CONSTEXPR_INT.ref [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc11_19.2: %i32 = converted %M_CONSTEXPR_INT.ref, %.loc11_19.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %a: %i32 = value_binding a, %.loc11_19.2 +// CHECK:STDOUT: %.loc11_26.1: %i32 = as_compatible %M_CONSTEXPR_INT.ref [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc11_26.2: %i32 = converted %M_CONSTEXPR_INT.ref, %.loc11_26.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %a: %i32 = value_binding a, %.loc11_26.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/template/generic_call.carbon b/toolchain/check/testdata/interop/cpp/template/generic_call.carbon index c6f3d186d581..b646132e06ff 100644 --- a/toolchain/check/testdata/interop/cpp/template/generic_call.carbon +++ b/toolchain/check/testdata/interop/cpp/template/generic_call.carbon @@ -23,14 +23,14 @@ library "[[@TEST_NAME]]"; import Cpp library "header.h"; -fn F[T:! type](x: T) { +fn F[T:! type](unused x: T) { // TODO: This should be treated as being template-dependent on T, // and we should perform the call during monomorphization. - // CHECK:STDERR: fail_todo_generic_call.carbon:[[@LINE+4]]:16: error: semantics TODO: `unsupported type used as template argument` [SemanticsTodo] - // CHECK:STDERR: var v: Cpp.S(T); - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_todo_generic_call.carbon:[[@LINE+4]]:23: error: semantics TODO: `unsupported type used as template argument` [SemanticsTodo] + // CHECK:STDERR: var unused v: Cpp.S(T); + // CHECK:STDERR: ^ // CHECK:STDERR: - var v: Cpp.S(T); + var unused v: Cpp.S(T); } fn G() { diff --git a/toolchain/check/testdata/interop/cpp/template/non_type_param.carbon b/toolchain/check/testdata/interop/cpp/template/non_type_param.carbon index 41a7bf028f30..add5eb54381c 100644 --- a/toolchain/check/testdata/interop/cpp/template/non_type_param.carbon +++ b/toolchain/check/testdata/interop/cpp/template/non_type_param.carbon @@ -59,7 +59,7 @@ import Cpp library "templates.h"; class C { adapt {}; } impl C as Core.ImplicitAs(i32) { - eval fn Convert[self: Self]() -> i32 { return 123; } + eval fn Convert[unused self: Self]() -> i32 { return 123; } } var s: Cpp.Simple({} as C) = Cpp.MakeSimple123(); diff --git a/toolchain/check/testdata/interop/cpp/typedef.carbon b/toolchain/check/testdata/interop/cpp/typedef.carbon index d006eaf24092..599757e27eef 100644 --- a/toolchain/check/testdata/interop/cpp/typedef.carbon +++ b/toolchain/check/testdata/interop/cpp/typedef.carbon @@ -26,7 +26,7 @@ fn F() { //@dump-sem-ir-begin var n: Cpp.foo = 42; // Types are equivalent. - var p: Cpp.bar* = &n; + var unused p: Cpp.bar* = &n; //@dump-sem-ir-end } @@ -44,8 +44,8 @@ import Cpp library "class_typedef.h"; fn H(var c: Cpp.C, var d: Cpp.D) { //@dump-sem-ir-begin // Types are equivalent. - var pd: Cpp.D* = &c; - var pc: Cpp.C* = &d; + var unused pd: Cpp.D* = &c; + var unused pc: Cpp.C* = &d; //@dump-sem-ir-end } @@ -131,10 +131,10 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %n.ref: ref %i32 = name_ref n, %n // CHECK:STDOUT: %addr: %ptr.235 = addr_of %n.ref // CHECK:STDOUT: %impl.elem0.loc10: %.a62 = impl_witness_access constants.%Copy.impl_witness.843, element0 [concrete = constants.%ptr.as.Copy.impl.Op.011] -// CHECK:STDOUT: %bound_method.loc10_21.1: = bound_method %addr, %impl.elem0.loc10 +// CHECK:STDOUT: %bound_method.loc10_28.1: = bound_method %addr, %impl.elem0.loc10 // CHECK:STDOUT: %specific_fn.loc10: = specific_function %impl.elem0.loc10, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc10_21.2: = bound_method %addr, %specific_fn.loc10 -// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.235 = call %bound_method.loc10_21.2(%addr) +// CHECK:STDOUT: %bound_method.loc10_28.2: = bound_method %addr, %specific_fn.loc10 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.235 = call %bound_method.loc10_28.2(%addr) // CHECK:STDOUT: assign %p.var, %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: %.loc10: type = splice_block %ptr [concrete = constants.%ptr.235] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -197,10 +197,10 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %c.ref: ref %C = name_ref c, %c // CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %c.ref // CHECK:STDOUT: %impl.elem0.loc9: %.798 = impl_witness_access constants.%Copy.impl_witness.83a, element0 [concrete = constants.%ptr.as.Copy.impl.Op.f1d] -// CHECK:STDOUT: %bound_method.loc9_20.1: = bound_method %addr.loc9, %impl.elem0.loc9 +// CHECK:STDOUT: %bound_method.loc9_27.1: = bound_method %addr.loc9, %impl.elem0.loc9 // CHECK:STDOUT: %specific_fn.loc9: = specific_function %impl.elem0.loc9, @ptr.as.Copy.impl.Op(constants.%C) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_20.2: = bound_method %addr.loc9, %specific_fn.loc9 -// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc9: init %ptr.d9e = call %bound_method.loc9_20.2(%addr.loc9) +// CHECK:STDOUT: %bound_method.loc9_27.2: = bound_method %addr.loc9, %specific_fn.loc9 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc9: init %ptr.d9e = call %bound_method.loc9_27.2(%addr.loc9) // CHECK:STDOUT: assign %pd.var, %ptr.as.Copy.impl.Op.call.loc9 // CHECK:STDOUT: %.loc9: type = splice_block %ptr.loc9 [concrete = constants.%ptr.d9e] { // CHECK:STDOUT: %Cpp.ref.loc9: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -216,10 +216,10 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %d.ref: ref %C = name_ref d, %d // CHECK:STDOUT: %addr.loc10: %ptr.d9e = addr_of %d.ref // CHECK:STDOUT: %impl.elem0.loc10: %.798 = impl_witness_access constants.%Copy.impl_witness.83a, element0 [concrete = constants.%ptr.as.Copy.impl.Op.f1d] -// CHECK:STDOUT: %bound_method.loc10_20.1: = bound_method %addr.loc10, %impl.elem0.loc10 +// CHECK:STDOUT: %bound_method.loc10_27.1: = bound_method %addr.loc10, %impl.elem0.loc10 // CHECK:STDOUT: %specific_fn.loc10: = specific_function %impl.elem0.loc10, @ptr.as.Copy.impl.Op(constants.%C) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc10_20.2: = bound_method %addr.loc10, %specific_fn.loc10 -// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc10: init %ptr.d9e = call %bound_method.loc10_20.2(%addr.loc10) +// CHECK:STDOUT: %bound_method.loc10_27.2: = bound_method %addr.loc10, %specific_fn.loc10 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc10: init %ptr.d9e = call %bound_method.loc10_27.2(%addr.loc10) // CHECK:STDOUT: assign %pc.var, %ptr.as.Copy.impl.Op.call.loc10 // CHECK:STDOUT: %.loc10: type = splice_block %ptr.loc10 [concrete = constants.%ptr.d9e] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] diff --git a/toolchain/check/testdata/interop/cpp/var/global.carbon b/toolchain/check/testdata/interop/cpp/var/global.carbon index baefd7977507..2260667db90d 100644 --- a/toolchain/check/testdata/interop/cpp/var/global.carbon +++ b/toolchain/check/testdata/interop/cpp/var/global.carbon @@ -30,9 +30,9 @@ library "[[@TEST_NAME]]"; import Cpp library "global_scope.h"; fn MyF() { - let local: Cpp.C = Cpp.global; - let local_ptr: Cpp.C* = Cpp.global_ptr; - let local_ref: Cpp.C* = Cpp.global_ref; + let unused local: Cpp.C = Cpp.global; + let unused local_ptr: Cpp.C* = Cpp.global_ptr; + let unused local_ref: Cpp.C* = Cpp.global_ref; } // ============================================================================ @@ -55,18 +55,18 @@ library "[[@TEST_NAME]]"; import Cpp library "unsupported_type.h"; fn MyF() { - // CHECK:STDERR: fail_import_unsupported_type.carbon:[[@LINE+11]]:14: note: in `Cpp` name lookup for `UnusupportedType` [InCppNameLookup] - // CHECK:STDERR: let local: Cpp.UnusupportedType = Cpp.global; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_import_unsupported_type.carbon:[[@LINE+11]]:21: note: in `Cpp` name lookup for `UnusupportedType` [InCppNameLookup] + // CHECK:STDERR: let unused local: Cpp.UnusupportedType = Cpp.global; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_import_unsupported_type.carbon:[[@LINE+7]]:37: error: semantics TODO: `Unsupported: var type: UnusupportedType` [SemanticsTodo] - // CHECK:STDERR: let local: Cpp.UnusupportedType = Cpp.global; - // CHECK:STDERR: ^~~~~~~~~~ - // CHECK:STDERR: fail_import_unsupported_type.carbon:[[@LINE+4]]:37: note: in `Cpp` name lookup for `global` [InCppNameLookup] - // CHECK:STDERR: let local: Cpp.UnusupportedType = Cpp.global; - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fail_import_unsupported_type.carbon:[[@LINE+7]]:44: error: semantics TODO: `Unsupported: var type: UnusupportedType` [SemanticsTodo] + // CHECK:STDERR: let unused local: Cpp.UnusupportedType = Cpp.global; + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fail_import_unsupported_type.carbon:[[@LINE+4]]:44: note: in `Cpp` name lookup for `global` [InCppNameLookup] + // CHECK:STDERR: let unused local: Cpp.UnusupportedType = Cpp.global; + // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: - let local: Cpp.UnusupportedType = Cpp.global; + let unused local: Cpp.UnusupportedType = Cpp.global; } // CHECK:STDOUT: --- import_global_scope.carbon @@ -136,40 +136,40 @@ fn MyF() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %local.patt: %pattern_type.217 = value_binding_pattern local [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc7_22: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc7_29: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %global.ref: ref %C = name_ref global, imports.%global.var [concrete = imports.%global.var] -// CHECK:STDOUT: %.loc7_17: type = splice_block %C.ref.loc7 [concrete = constants.%C] { -// CHECK:STDOUT: %Cpp.ref.loc7_14: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc7_24: type = splice_block %C.ref.loc7 [concrete = constants.%C] { +// CHECK:STDOUT: %Cpp.ref.loc7_21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc7_25: %C = acquire_value %global.ref -// CHECK:STDOUT: %local: %C = value_binding local, %.loc7_25 +// CHECK:STDOUT: %.loc7_32: %C = acquire_value %global.ref +// CHECK:STDOUT: %local: %C = value_binding local, %.loc7_32 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %local_ptr.patt: %pattern_type.a31 = value_binding_pattern local_ptr [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc8_27: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc8_34: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %global_ptr.ref: ref %ptr.d9e = name_ref global_ptr, imports.%global_ptr.var [concrete = imports.%global_ptr.var] -// CHECK:STDOUT: %.loc8_23: type = splice_block %ptr.loc8 [concrete = constants.%ptr.d9e] { -// CHECK:STDOUT: %Cpp.ref.loc8_18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc8_30: type = splice_block %ptr.loc8 [concrete = constants.%ptr.d9e] { +// CHECK:STDOUT: %Cpp.ref.loc8_25: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %ptr.loc8: type = ptr_type %C.ref.loc8 [concrete = constants.%ptr.d9e] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_30: %ptr.d9e = acquire_value %global_ptr.ref -// CHECK:STDOUT: %local_ptr: %ptr.d9e = value_binding local_ptr, %.loc8_30 +// CHECK:STDOUT: %.loc8_37: %ptr.d9e = acquire_value %global_ptr.ref +// CHECK:STDOUT: %local_ptr: %ptr.d9e = value_binding local_ptr, %.loc8_37 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %local_ref.patt: %pattern_type.a31 = value_binding_pattern local_ref [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc9_27: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc9_34: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %global_ref.ref: ref %const = name_ref global_ref, imports.%global_ref.var [concrete = imports.%global_ref.var] -// CHECK:STDOUT: %.loc9_23: type = splice_block %ptr.loc9 [concrete = constants.%ptr.d9e] { -// CHECK:STDOUT: %Cpp.ref.loc9_18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc9_30: type = splice_block %ptr.loc9 [concrete = constants.%ptr.d9e] { +// CHECK:STDOUT: %Cpp.ref.loc9_25: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, imports.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %ptr.loc9: type = ptr_type %C.ref.loc9 [concrete = constants.%ptr.d9e] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc9_30.1: ref %ptr.d9e = as_compatible %global_ref.ref [concrete = constants.%global_ref.var] -// CHECK:STDOUT: %.loc9_30.2: ref %ptr.d9e = converted %global_ref.ref, %.loc9_30.1 [concrete = constants.%global_ref.var] -// CHECK:STDOUT: %.loc9_30.3: %ptr.d9e = acquire_value %.loc9_30.2 -// CHECK:STDOUT: %local_ref: %ptr.d9e = value_binding local_ref, %.loc9_30.3 +// CHECK:STDOUT: %.loc9_37.1: ref %ptr.d9e = as_compatible %global_ref.ref [concrete = constants.%global_ref.var] +// CHECK:STDOUT: %.loc9_37.2: ref %ptr.d9e = converted %global_ref.ref, %.loc9_37.1 [concrete = constants.%global_ref.var] +// CHECK:STDOUT: %.loc9_37.3: %ptr.d9e = acquire_value %.loc9_37.2 +// CHECK:STDOUT: %local_ref: %ptr.d9e = value_binding local_ref, %.loc9_37.3 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -210,10 +210,10 @@ fn MyF() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %local.patt: = value_binding_pattern local [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc22_37: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc22_44: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %global.ref: = name_ref global, [concrete = ] // CHECK:STDOUT: %.1: = splice_block [concrete = ] { -// CHECK:STDOUT: %Cpp.ref.loc22_14: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc22_21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %UnusupportedType.ref: = name_ref UnusupportedType, [concrete = ] // CHECK:STDOUT: } // CHECK:STDOUT: %local: = value_binding local, [concrete = ] diff --git a/toolchain/check/testdata/interop/cpp/var/namespace.carbon b/toolchain/check/testdata/interop/cpp/var/namespace.carbon index 2ac8ff41d5bf..97a0a75d1491 100644 --- a/toolchain/check/testdata/interop/cpp/var/namespace.carbon +++ b/toolchain/check/testdata/interop/cpp/var/namespace.carbon @@ -24,7 +24,7 @@ library "[[@TEST_NAME]]"; import Cpp library "namespace.h"; fn MyF() { - let local: Cpp.N.C = Cpp.N.global; + let unused local: Cpp.N.C = Cpp.N.global; } // --- type_in_namespace.carbon diff --git a/toolchain/check/testdata/interop/cpp/void.carbon b/toolchain/check/testdata/interop/cpp/void.carbon index 9ec948279ca9..1d6e38e5b713 100644 --- a/toolchain/check/testdata/interop/cpp/void.carbon +++ b/toolchain/check/testdata/interop/cpp/void.carbon @@ -18,7 +18,7 @@ import Cpp; // This is valid, unlike in C++, because `Cpp.void` is complete but abstract in // Carbon. Values of type `Cpp.void` exist, but objects of that type do not. -fn F(x: Cpp.void) {} +fn F(unused x: Cpp.void) {} // --- fail_void_abstract.carbon @@ -27,14 +27,14 @@ library "[[@TEST_NAME]]"; import Cpp; fn G() { - // CHECK:STDERR: fail_void_abstract.carbon:[[@LINE+7]]:10: error: binding pattern has abstract type `Cpp.void` in `var` pattern [AbstractTypeInVarPattern] - // CHECK:STDERR: var x: Cpp.void; - // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: fail_void_abstract.carbon:[[@LINE+7]]:17: error: binding pattern has abstract type `Cpp.void` in `var` pattern [AbstractTypeInVarPattern] + // CHECK:STDERR: var unused x: Cpp.void; + // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: {{.*}}/prelude/types/cpp/void.carbon:24:1: note: class was declared abstract here [ClassAbstractHere] // CHECK:STDERR: abstract class CppCompat.VoidBase { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var x: Cpp.void; + var unused x: Cpp.void; } // --- fail_void_argument.carbon diff --git a/toolchain/check/testdata/interop/cpp/void_pointer.carbon b/toolchain/check/testdata/interop/cpp/void_pointer.carbon index 4a62971b6568..658d2836126a 100644 --- a/toolchain/check/testdata/interop/cpp/void_pointer.carbon +++ b/toolchain/check/testdata/interop/cpp/void_pointer.carbon @@ -20,7 +20,7 @@ struct S {}; fn F(input: Cpp.S*) { //@dump-sem-ir-begin - let p: Cpp.void* = input; + let unused p: Cpp.void* = input; //@dump-sem-ir-end } @@ -34,7 +34,7 @@ class C {} fn F(input: C*) { //@dump-sem-ir-begin - let p: Cpp.void* = input; + let unused p: Cpp.void* = input; //@dump-sem-ir-end } @@ -48,7 +48,7 @@ struct S {}; fn F(input: Cpp.S*) { //@dump-sem-ir-begin - let p: Cpp.void* = input as Cpp.void*; + let unused p: Cpp.void* = input as Cpp.void*; //@dump-sem-ir-end } @@ -62,7 +62,7 @@ class C {} fn F(input: C*) { //@dump-sem-ir-begin - let p: Cpp.void* = input as Cpp.void*; + let unused p: Cpp.void* = input as Cpp.void*; //@dump-sem-ir-end } @@ -76,14 +76,14 @@ struct S {}; fn F(input: Cpp.void*) { //@dump-sem-ir-begin - // CHECK:STDERR: fail_explicit_as_from_void_pointer_to_cpp_class_pointer.carbon:[[@LINE+7]]:19: error: cannot convert expression of type `Cpp.void*` to `Cpp.S*` with `as` [ConversionFailure] - // CHECK:STDERR: let p: Cpp.S* = input as Cpp.S*; - // CHECK:STDERR: ^~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_explicit_as_from_void_pointer_to_cpp_class_pointer.carbon:[[@LINE+4]]:19: note: type `Cpp.void*` does not implement interface `Core.As(Cpp.S*)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let p: Cpp.S* = input as Cpp.S*; - // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_explicit_as_from_void_pointer_to_cpp_class_pointer.carbon:[[@LINE+7]]:26: error: cannot convert expression of type `Cpp.void*` to `Cpp.S*` with `as` [ConversionFailure] + // CHECK:STDERR: let unused p: Cpp.S* = input as Cpp.S*; + // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_explicit_as_from_void_pointer_to_cpp_class_pointer.carbon:[[@LINE+4]]:26: note: type `Cpp.void*` does not implement interface `Core.As(Cpp.S*)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused p: Cpp.S* = input as Cpp.S*; + // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: - let p: Cpp.S* = input as Cpp.S*; + let unused p: Cpp.S* = input as Cpp.S*; //@dump-sem-ir-end } @@ -97,14 +97,14 @@ class C {} fn F(input: Cpp.void*) { //@dump-sem-ir-begin - // CHECK:STDERR: fail_explicit_as_from_void_pointer_to_carbon_class_pointer.carbon:[[@LINE+7]]:15: error: cannot convert expression of type `Cpp.void*` to `C*` with `as` [ConversionFailure] - // CHECK:STDERR: let p: C* = input as C*; - // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_explicit_as_from_void_pointer_to_carbon_class_pointer.carbon:[[@LINE+4]]:15: note: type `Cpp.void*` does not implement interface `Core.As(C*)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: let p: C* = input as C*; - // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: fail_explicit_as_from_void_pointer_to_carbon_class_pointer.carbon:[[@LINE+7]]:22: error: cannot convert expression of type `Cpp.void*` to `C*` with `as` [ConversionFailure] + // CHECK:STDERR: let unused p: C* = input as C*; + // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: fail_explicit_as_from_void_pointer_to_carbon_class_pointer.carbon:[[@LINE+4]]:22: note: type `Cpp.void*` does not implement interface `Core.As(C*)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: let unused p: C* = input as C*; + // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: - let p: C* = input as C*; + let unused p: C* = input as C*; //@dump-sem-ir-end } @@ -118,7 +118,7 @@ struct S {}; fn F(input: Cpp.void*) { //@dump-sem-ir-begin - let p: Cpp.S* = input unsafe as Cpp.S*; + let unused p: Cpp.S* = input unsafe as Cpp.S*; //@dump-sem-ir-end } @@ -132,7 +132,7 @@ class C {} fn F(input: Cpp.void*) { //@dump-sem-ir-begin - let p: C* = input unsafe as C*; + let unused p: C* = input unsafe as C*; //@dump-sem-ir-end } @@ -174,19 +174,19 @@ fn F(input: Cpp.void*) { // CHECK:STDOUT: %p.patt: %pattern_type.9fb = value_binding_pattern p [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %input.ref: %ptr.5c7 = name_ref input, %input -// CHECK:STDOUT: %.loc10_18: type = splice_block %ptr.loc10 [concrete = constants.%ptr.874] { +// CHECK:STDOUT: %.loc10_25: type = splice_block %ptr.loc10 [concrete = constants.%ptr.874] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void] // CHECK:STDOUT: %ptr.loc10: type = ptr_type %void.ref [concrete = constants.%ptr.874] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0: %.751 = impl_witness_access constants.%ImplicitAs.impl_witness.ffd, element0 [concrete = constants.%ptr.as.ImplicitAs.impl.Convert.d8d] -// CHECK:STDOUT: %bound_method.loc10_22.1: = bound_method %input.ref, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc10_29.1: = bound_method %input.ref, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.ImplicitAs.impl.Convert.1(constants.%S) [concrete = constants.%ptr.as.ImplicitAs.impl.Convert.specific_fn.ffe] -// CHECK:STDOUT: %bound_method.loc10_22.2: = bound_method %input.ref, %specific_fn -// CHECK:STDOUT: %ptr.as.ImplicitAs.impl.Convert.call: init %ptr.874 = call %bound_method.loc10_22.2(%input.ref) -// CHECK:STDOUT: %.loc10_22.1: %ptr.874 = value_of_initializer %ptr.as.ImplicitAs.impl.Convert.call -// CHECK:STDOUT: %.loc10_22.2: %ptr.874 = converted %input.ref, %.loc10_22.1 -// CHECK:STDOUT: %p: %ptr.874 = value_binding p, %.loc10_22.2 +// CHECK:STDOUT: %bound_method.loc10_29.2: = bound_method %input.ref, %specific_fn +// CHECK:STDOUT: %ptr.as.ImplicitAs.impl.Convert.call: init %ptr.874 = call %bound_method.loc10_29.2(%input.ref) +// CHECK:STDOUT: %.loc10_29.1: %ptr.874 = value_of_initializer %ptr.as.ImplicitAs.impl.Convert.call +// CHECK:STDOUT: %.loc10_29.2: %ptr.874 = converted %input.ref, %.loc10_29.1 +// CHECK:STDOUT: %p: %ptr.874 = value_binding p, %.loc10_29.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -226,19 +226,19 @@ fn F(input: Cpp.void*) { // CHECK:STDOUT: %p.patt: %pattern_type.9fb = value_binding_pattern p [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %input.ref: %ptr.31e = name_ref input, %input -// CHECK:STDOUT: %.loc10_18: type = splice_block %ptr.loc10 [concrete = constants.%ptr.874] { +// CHECK:STDOUT: %.loc10_25: type = splice_block %ptr.loc10 [concrete = constants.%ptr.874] { // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void] // CHECK:STDOUT: %ptr.loc10: type = ptr_type %void.ref [concrete = constants.%ptr.874] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0: %.9d0 = impl_witness_access constants.%ImplicitAs.impl_witness.39c, element0 [concrete = constants.%ptr.as.ImplicitAs.impl.Convert.1f8] -// CHECK:STDOUT: %bound_method.loc10_22.1: = bound_method %input.ref, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc10_29.1: = bound_method %input.ref, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.ImplicitAs.impl.Convert.1(constants.%C) [concrete = constants.%ptr.as.ImplicitAs.impl.Convert.specific_fn.384] -// CHECK:STDOUT: %bound_method.loc10_22.2: = bound_method %input.ref, %specific_fn -// CHECK:STDOUT: %ptr.as.ImplicitAs.impl.Convert.call: init %ptr.874 = call %bound_method.loc10_22.2(%input.ref) -// CHECK:STDOUT: %.loc10_22.1: %ptr.874 = value_of_initializer %ptr.as.ImplicitAs.impl.Convert.call -// CHECK:STDOUT: %.loc10_22.2: %ptr.874 = converted %input.ref, %.loc10_22.1 -// CHECK:STDOUT: %p: %ptr.874 = value_binding p, %.loc10_22.2 +// CHECK:STDOUT: %bound_method.loc10_29.2: = bound_method %input.ref, %specific_fn +// CHECK:STDOUT: %ptr.as.ImplicitAs.impl.Convert.call: init %ptr.874 = call %bound_method.loc10_29.2(%input.ref) +// CHECK:STDOUT: %.loc10_29.1: %ptr.874 = value_of_initializer %ptr.as.ImplicitAs.impl.Convert.call +// CHECK:STDOUT: %.loc10_29.2: %ptr.874 = converted %input.ref, %.loc10_29.1 +// CHECK:STDOUT: %p: %ptr.874 = value_binding p, %.loc10_29.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -290,22 +290,22 @@ fn F(input: Cpp.void*) { // CHECK:STDOUT: %p.patt: %pattern_type.9fb = value_binding_pattern p [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %input.ref: %ptr.5c7 = name_ref input, %input -// CHECK:STDOUT: %Cpp.ref.loc10_31: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %void.ref.loc10_34: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void] -// CHECK:STDOUT: %ptr.loc10_39: type = ptr_type %void.ref.loc10_34 [concrete = constants.%ptr.874] +// CHECK:STDOUT: %Cpp.ref.loc10_38: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %void.ref.loc10_41: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void] +// CHECK:STDOUT: %ptr.loc10_46: type = ptr_type %void.ref.loc10_41 [concrete = constants.%ptr.874] // CHECK:STDOUT: %impl.elem0: %.bb8 = impl_witness_access constants.%As.impl_witness.9e9, element0 [concrete = constants.%T.binding.as_type.as.As.impl.Convert.e7d] -// CHECK:STDOUT: %bound_method.loc10_28.1: = bound_method %input.ref, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc10_35.1: = bound_method %input.ref, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @T.binding.as_type.as.As.impl.Convert(constants.%ptr.874, constants.%ImplicitAs.facet) [concrete = constants.%T.binding.as_type.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc10_28.2: = bound_method %input.ref, %specific_fn -// CHECK:STDOUT: %T.binding.as_type.as.As.impl.Convert.call: init %ptr.874 = call %bound_method.loc10_28.2(%input.ref) -// CHECK:STDOUT: %.loc10_28.1: %ptr.874 = value_of_initializer %T.binding.as_type.as.As.impl.Convert.call -// CHECK:STDOUT: %.loc10_28.2: %ptr.874 = converted %input.ref, %.loc10_28.1 -// CHECK:STDOUT: %.loc10_18: type = splice_block %ptr.loc10_18 [concrete = constants.%ptr.874] { -// CHECK:STDOUT: %Cpp.ref.loc10_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %void.ref.loc10_13: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void] -// CHECK:STDOUT: %ptr.loc10_18: type = ptr_type %void.ref.loc10_13 [concrete = constants.%ptr.874] +// CHECK:STDOUT: %bound_method.loc10_35.2: = bound_method %input.ref, %specific_fn +// CHECK:STDOUT: %T.binding.as_type.as.As.impl.Convert.call: init %ptr.874 = call %bound_method.loc10_35.2(%input.ref) +// CHECK:STDOUT: %.loc10_35.1: %ptr.874 = value_of_initializer %T.binding.as_type.as.As.impl.Convert.call +// CHECK:STDOUT: %.loc10_35.2: %ptr.874 = converted %input.ref, %.loc10_35.1 +// CHECK:STDOUT: %.loc10_25: type = splice_block %ptr.loc10_25 [concrete = constants.%ptr.874] { +// CHECK:STDOUT: %Cpp.ref.loc10_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %void.ref.loc10_20: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void] +// CHECK:STDOUT: %ptr.loc10_25: type = ptr_type %void.ref.loc10_20 [concrete = constants.%ptr.874] // CHECK:STDOUT: } -// CHECK:STDOUT: %p: %ptr.874 = value_binding p, %.loc10_28.2 +// CHECK:STDOUT: %p: %ptr.874 = value_binding p, %.loc10_35.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -355,22 +355,22 @@ fn F(input: Cpp.void*) { // CHECK:STDOUT: %p.patt: %pattern_type.9fb = value_binding_pattern p [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %input.ref: %ptr.31e = name_ref input, %input -// CHECK:STDOUT: %Cpp.ref.loc10_31: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %void.ref.loc10_34: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void] -// CHECK:STDOUT: %ptr.loc10_39: type = ptr_type %void.ref.loc10_34 [concrete = constants.%ptr.874] +// CHECK:STDOUT: %Cpp.ref.loc10_38: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %void.ref.loc10_41: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void] +// CHECK:STDOUT: %ptr.loc10_46: type = ptr_type %void.ref.loc10_41 [concrete = constants.%ptr.874] // CHECK:STDOUT: %impl.elem0: %.99e = impl_witness_access constants.%As.impl_witness.fa1, element0 [concrete = constants.%T.binding.as_type.as.As.impl.Convert.483] -// CHECK:STDOUT: %bound_method.loc10_28.1: = bound_method %input.ref, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc10_35.1: = bound_method %input.ref, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @T.binding.as_type.as.As.impl.Convert(constants.%ptr.874, constants.%ImplicitAs.facet) [concrete = constants.%T.binding.as_type.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc10_28.2: = bound_method %input.ref, %specific_fn -// CHECK:STDOUT: %T.binding.as_type.as.As.impl.Convert.call: init %ptr.874 = call %bound_method.loc10_28.2(%input.ref) -// CHECK:STDOUT: %.loc10_28.1: %ptr.874 = value_of_initializer %T.binding.as_type.as.As.impl.Convert.call -// CHECK:STDOUT: %.loc10_28.2: %ptr.874 = converted %input.ref, %.loc10_28.1 -// CHECK:STDOUT: %.loc10_18: type = splice_block %ptr.loc10_18 [concrete = constants.%ptr.874] { -// CHECK:STDOUT: %Cpp.ref.loc10_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %void.ref.loc10_13: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void] -// CHECK:STDOUT: %ptr.loc10_18: type = ptr_type %void.ref.loc10_13 [concrete = constants.%ptr.874] +// CHECK:STDOUT: %bound_method.loc10_35.2: = bound_method %input.ref, %specific_fn +// CHECK:STDOUT: %T.binding.as_type.as.As.impl.Convert.call: init %ptr.874 = call %bound_method.loc10_35.2(%input.ref) +// CHECK:STDOUT: %.loc10_35.1: %ptr.874 = value_of_initializer %T.binding.as_type.as.As.impl.Convert.call +// CHECK:STDOUT: %.loc10_35.2: %ptr.874 = converted %input.ref, %.loc10_35.1 +// CHECK:STDOUT: %.loc10_25: type = splice_block %ptr.loc10_25 [concrete = constants.%ptr.874] { +// CHECK:STDOUT: %Cpp.ref.loc10_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %void.ref.loc10_20: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void] +// CHECK:STDOUT: %ptr.loc10_25: type = ptr_type %void.ref.loc10_20 [concrete = constants.%ptr.874] // CHECK:STDOUT: } -// CHECK:STDOUT: %p: %ptr.874 = value_binding p, %.loc10_28.2 +// CHECK:STDOUT: %p: %ptr.874 = value_binding p, %.loc10_35.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -399,14 +399,14 @@ fn F(input: Cpp.void*) { // CHECK:STDOUT: %p.patt: %pattern_type.259 = value_binding_pattern p [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %input.ref: %ptr.874 = name_ref input, %input -// CHECK:STDOUT: %Cpp.ref.loc17_28: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %S.ref.loc17_31: type = name_ref S, imports.%S.decl [concrete = constants.%S] -// CHECK:STDOUT: %ptr.loc17_33: type = ptr_type %S.ref.loc17_31 [concrete = constants.%ptr.5c7] -// CHECK:STDOUT: %.loc17_25: %ptr.5c7 = converted %input.ref, [concrete = ] -// CHECK:STDOUT: %.loc17_15: type = splice_block %ptr.loc17_15 [concrete = constants.%ptr.5c7] { -// CHECK:STDOUT: %Cpp.ref.loc17_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %S.ref.loc17_13: type = name_ref S, imports.%S.decl [concrete = constants.%S] -// CHECK:STDOUT: %ptr.loc17_15: type = ptr_type %S.ref.loc17_13 [concrete = constants.%ptr.5c7] +// CHECK:STDOUT: %Cpp.ref.loc17_35: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %S.ref.loc17_38: type = name_ref S, imports.%S.decl [concrete = constants.%S] +// CHECK:STDOUT: %ptr.loc17_40: type = ptr_type %S.ref.loc17_38 [concrete = constants.%ptr.5c7] +// CHECK:STDOUT: %.loc17_32: %ptr.5c7 = converted %input.ref, [concrete = ] +// CHECK:STDOUT: %.loc17_22: type = splice_block %ptr.loc17_22 [concrete = constants.%ptr.5c7] { +// CHECK:STDOUT: %Cpp.ref.loc17_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %S.ref.loc17_20: type = name_ref S, imports.%S.decl [concrete = constants.%S] +// CHECK:STDOUT: %ptr.loc17_22: type = ptr_type %S.ref.loc17_20 [concrete = constants.%ptr.5c7] // CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.5c7 = value_binding p, [concrete = ] // CHECK:STDOUT: @@ -431,12 +431,12 @@ fn F(input: Cpp.void*) { // CHECK:STDOUT: %p.patt: %pattern_type.506 = value_binding_pattern p [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %input.ref: %ptr.874 = name_ref input, %input -// CHECK:STDOUT: %C.ref.loc17_24: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %ptr.loc17_25: type = ptr_type %C.ref.loc17_24 [concrete = constants.%ptr.31e] -// CHECK:STDOUT: %.loc17_21: %ptr.31e = converted %input.ref, [concrete = ] -// CHECK:STDOUT: %.loc17_11: type = splice_block %ptr.loc17_11 [concrete = constants.%ptr.31e] { -// CHECK:STDOUT: %C.ref.loc17_10: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %ptr.loc17_11: type = ptr_type %C.ref.loc17_10 [concrete = constants.%ptr.31e] +// CHECK:STDOUT: %C.ref.loc17_31: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %ptr.loc17_32: type = ptr_type %C.ref.loc17_31 [concrete = constants.%ptr.31e] +// CHECK:STDOUT: %.loc17_28: %ptr.31e = converted %input.ref, [concrete = ] +// CHECK:STDOUT: %.loc17_18: type = splice_block %ptr.loc17_18 [concrete = constants.%ptr.31e] { +// CHECK:STDOUT: %C.ref.loc17_17: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %ptr.loc17_18: type = ptr_type %C.ref.loc17_17 [concrete = constants.%ptr.31e] // CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.31e = value_binding p, [concrete = ] // CHECK:STDOUT: @@ -481,22 +481,22 @@ fn F(input: Cpp.void*) { // CHECK:STDOUT: %p.patt: %pattern_type.259 = value_binding_pattern p [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %input.ref: %ptr.874 = name_ref input, %input -// CHECK:STDOUT: %Cpp.ref.loc10_35: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %S.ref.loc10_38: type = name_ref S, imports.%S.decl [concrete = constants.%S] -// CHECK:STDOUT: %ptr.loc10_40: type = ptr_type %S.ref.loc10_38 [concrete = constants.%ptr.5c7] +// CHECK:STDOUT: %Cpp.ref.loc10_42: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %S.ref.loc10_45: type = name_ref S, imports.%S.decl [concrete = constants.%S] +// CHECK:STDOUT: %ptr.loc10_47: type = ptr_type %S.ref.loc10_45 [concrete = constants.%ptr.5c7] // CHECK:STDOUT: %impl.elem0: %.fba = impl_witness_access constants.%UnsafeAs.impl_witness.080, element0 [concrete = constants.%ptr.as.UnsafeAs.impl.Convert.fe3] -// CHECK:STDOUT: %bound_method.loc10_32.1: = bound_method %input.ref, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc10_39.1: = bound_method %input.ref, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.UnsafeAs.impl.Convert(constants.%Cpp.void, constants.%S) [concrete = constants.%ptr.as.UnsafeAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc10_32.2: = bound_method %input.ref, %specific_fn -// CHECK:STDOUT: %ptr.as.UnsafeAs.impl.Convert.call: init %ptr.5c7 = call %bound_method.loc10_32.2(%input.ref) -// CHECK:STDOUT: %.loc10_32.1: %ptr.5c7 = value_of_initializer %ptr.as.UnsafeAs.impl.Convert.call -// CHECK:STDOUT: %.loc10_32.2: %ptr.5c7 = converted %input.ref, %.loc10_32.1 -// CHECK:STDOUT: %.loc10_15: type = splice_block %ptr.loc10_15 [concrete = constants.%ptr.5c7] { -// CHECK:STDOUT: %Cpp.ref.loc10_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %S.ref.loc10_13: type = name_ref S, imports.%S.decl [concrete = constants.%S] -// CHECK:STDOUT: %ptr.loc10_15: type = ptr_type %S.ref.loc10_13 [concrete = constants.%ptr.5c7] +// CHECK:STDOUT: %bound_method.loc10_39.2: = bound_method %input.ref, %specific_fn +// CHECK:STDOUT: %ptr.as.UnsafeAs.impl.Convert.call: init %ptr.5c7 = call %bound_method.loc10_39.2(%input.ref) +// CHECK:STDOUT: %.loc10_39.1: %ptr.5c7 = value_of_initializer %ptr.as.UnsafeAs.impl.Convert.call +// CHECK:STDOUT: %.loc10_39.2: %ptr.5c7 = converted %input.ref, %.loc10_39.1 +// CHECK:STDOUT: %.loc10_22: type = splice_block %ptr.loc10_22 [concrete = constants.%ptr.5c7] { +// CHECK:STDOUT: %Cpp.ref.loc10_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %S.ref.loc10_20: type = name_ref S, imports.%S.decl [concrete = constants.%S] +// CHECK:STDOUT: %ptr.loc10_22: type = ptr_type %S.ref.loc10_20 [concrete = constants.%ptr.5c7] // CHECK:STDOUT: } -// CHECK:STDOUT: %p: %ptr.5c7 = value_binding p, %.loc10_32.2 +// CHECK:STDOUT: %p: %ptr.5c7 = value_binding p, %.loc10_39.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -533,20 +533,20 @@ fn F(input: Cpp.void*) { // CHECK:STDOUT: %p.patt: %pattern_type.506 = value_binding_pattern p [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %input.ref: %ptr.874 = name_ref input, %input -// CHECK:STDOUT: %C.ref.loc10_31: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %ptr.loc10_32: type = ptr_type %C.ref.loc10_31 [concrete = constants.%ptr.31e] +// CHECK:STDOUT: %C.ref.loc10_38: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %ptr.loc10_39: type = ptr_type %C.ref.loc10_38 [concrete = constants.%ptr.31e] // CHECK:STDOUT: %impl.elem0: %.53b = impl_witness_access constants.%UnsafeAs.impl_witness.2f5, element0 [concrete = constants.%ptr.as.UnsafeAs.impl.Convert.409] -// CHECK:STDOUT: %bound_method.loc10_28.1: = bound_method %input.ref, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc10_35.1: = bound_method %input.ref, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.UnsafeAs.impl.Convert(constants.%Cpp.void, constants.%C) [concrete = constants.%ptr.as.UnsafeAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc10_28.2: = bound_method %input.ref, %specific_fn -// CHECK:STDOUT: %ptr.as.UnsafeAs.impl.Convert.call: init %ptr.31e = call %bound_method.loc10_28.2(%input.ref) -// CHECK:STDOUT: %.loc10_28.1: %ptr.31e = value_of_initializer %ptr.as.UnsafeAs.impl.Convert.call -// CHECK:STDOUT: %.loc10_28.2: %ptr.31e = converted %input.ref, %.loc10_28.1 -// CHECK:STDOUT: %.loc10_11: type = splice_block %ptr.loc10_11 [concrete = constants.%ptr.31e] { -// CHECK:STDOUT: %C.ref.loc10_10: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %ptr.loc10_11: type = ptr_type %C.ref.loc10_10 [concrete = constants.%ptr.31e] +// CHECK:STDOUT: %bound_method.loc10_35.2: = bound_method %input.ref, %specific_fn +// CHECK:STDOUT: %ptr.as.UnsafeAs.impl.Convert.call: init %ptr.31e = call %bound_method.loc10_35.2(%input.ref) +// CHECK:STDOUT: %.loc10_35.1: %ptr.31e = value_of_initializer %ptr.as.UnsafeAs.impl.Convert.call +// CHECK:STDOUT: %.loc10_35.2: %ptr.31e = converted %input.ref, %.loc10_35.1 +// CHECK:STDOUT: %.loc10_18: type = splice_block %ptr.loc10_18 [concrete = constants.%ptr.31e] { +// CHECK:STDOUT: %C.ref.loc10_17: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %ptr.loc10_18: type = ptr_type %C.ref.loc10_17 [concrete = constants.%ptr.31e] // CHECK:STDOUT: } -// CHECK:STDOUT: %p: %ptr.31e = value_binding p, %.loc10_28.2 +// CHECK:STDOUT: %p: %ptr.31e = value_binding p, %.loc10_35.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/compile_time_bindings.carbon b/toolchain/check/testdata/let/compile_time_bindings.carbon index 45a4b6fd9640..b68cffb2946c 100644 --- a/toolchain/check/testdata/let/compile_time_bindings.carbon +++ b/toolchain/check/testdata/let/compile_time_bindings.carbon @@ -55,10 +55,10 @@ class C { fn F(b:! ((),)) { let c:! ((), ()) = ((), ()); - var a1: () = a; - var b1: ((),) = b; - var c1: ((), ()) = c; - var d1: ((), (), ()) = d; + var unused a1: () = a; + var unused b1: ((),) = b; + var unused c1: ((), ()) = c; + var unused d1: ((), (), ()) = d; } // CHECK:STDERR: fail_multiple_lets.carbon:[[@LINE+8]]:7: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo] // CHECK:STDERR: let d:! ((), (), ()) = ((), (), ()); diff --git a/toolchain/check/testdata/let/convert.carbon b/toolchain/check/testdata/let/convert.carbon index 7ff291d8915e..93c2a8b420a7 100644 --- a/toolchain/check/testdata/let/convert.carbon +++ b/toolchain/check/testdata/let/convert.carbon @@ -29,8 +29,15 @@ library "[[@TEST_NAME]]"; fn G() { var a: i32 = 0; - let n: i32 = a; - // CHECK:STDERR: fail_let_bound_to_ref_not_mutable.carbon:[[@LINE+4]]:3: error: expression is not assignable [AssignmentToNonAssignable] + let unused n: i32 = a; + // CHECK:STDERR: fail_let_bound_to_ref_not_mutable.carbon:[[@LINE+11]]:3: error: expression is not assignable [AssignmentToNonAssignable] + // CHECK:STDERR: n = 1; + // CHECK:STDERR: ^ + // CHECK:STDERR: + // CHECK:STDERR: fail_let_bound_to_ref_not_mutable.carbon:[[@LINE-5]]:14: error: variable `n` marked `unused` but used [UnusedButUsed] + // CHECK:STDERR: let unused n: i32 = a; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_let_bound_to_ref_not_mutable.carbon:[[@LINE+4]]:3: note: usage here [UnusedButUsedHere] // CHECK:STDERR: n = 1; // CHECK:STDERR: ^ // CHECK:STDERR: diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index af8512d32619..a0f42f61c4dc 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -13,15 +13,15 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/fail_duplicate_decl.carbon fn F() { - let a: i32 = 1; - // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+7]]:7: error: duplicate name `a` being declared in the same scope [NameDeclDuplicate] - // CHECK:STDERR: let a: i32 = 2; - // CHECK:STDERR: ^ - // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: note: name is previously declared here [NameDeclPrevious] - // CHECK:STDERR: let a: i32 = 1; - // CHECK:STDERR: ^ + let unused a: i32 = 1; + // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+7]]:14: error: duplicate name `a` being declared in the same scope [NameDeclDuplicate] + // CHECK:STDERR: let unused a: i32 = 2; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:14: note: name is previously declared here [NameDeclPrevious] + // CHECK:STDERR: let unused a: i32 = 1; + // CHECK:STDERR: ^ // CHECK:STDERR: - let a: i32 = 2; + let unused a: i32 = 2; } // CHECK:STDOUT: --- fail_duplicate_decl.carbon @@ -85,34 +85,34 @@ fn F() { // CHECK:STDOUT: %a.patt.loc16: %pattern_type.7ce = value_binding_pattern a [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc16_10: type = splice_block %i32.loc16 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc16_17: type = splice_block %i32.loc16 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc16: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc16_16.1: = bound_method %int_1, %impl.elem0.loc16 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] +// CHECK:STDOUT: %bound_method.loc16_23.1: = bound_method %int_1, %impl.elem0.loc16 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] // CHECK:STDOUT: %specific_fn.loc16: = specific_function %impl.elem0.loc16, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc16_16.2: = bound_method %int_1, %specific_fn.loc16 [concrete = constants.%bound_method.38b] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16: init %i32 = call %bound_method.loc16_16.2(%int_1) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc16_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc16_16.2: %i32 = converted %int_1, %.loc16_16.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %a.loc16: %i32 = value_binding a, %.loc16_16.2 +// CHECK:STDOUT: %bound_method.loc16_23.2: = bound_method %int_1, %specific_fn.loc16 [concrete = constants.%bound_method.38b] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16: init %i32 = call %bound_method.loc16_23.2(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc16_23.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc16_23.2: %i32 = converted %int_1, %.loc16_23.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %a.loc16: %i32 = value_binding a, %.loc16_23.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt.loc24: %pattern_type.7ce = value_binding_pattern a [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc24_10: type = splice_block %i32.loc24 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc24_17: type = splice_block %i32.loc24 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %impl.elem0.loc24: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc24_16.1: = bound_method %int_2, %impl.elem0.loc24 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] +// CHECK:STDOUT: %bound_method.loc24_23.1: = bound_method %int_2, %impl.elem0.loc24 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc24: = specific_function %impl.elem0.loc24, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc24_16.2: = bound_method %int_2, %specific_fn.loc24 [concrete = constants.%bound_method.646] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc24: init %i32 = call %bound_method.loc24_16.2(%int_2) [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc24_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc24 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc24_16.2: %i32 = converted %int_2, %.loc24_16.1 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %a.loc24: %i32 = value_binding a, %.loc24_16.2 +// CHECK:STDOUT: %bound_method.loc24_23.2: = bound_method %int_2, %specific_fn.loc24 [concrete = constants.%bound_method.646] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc24: init %i32 = call %bound_method.loc24_23.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc24_23.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc24 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc24_23.2: %i32 = converted %int_2, %.loc24_23.1 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %a.loc24: %i32 = value_binding a, %.loc24_23.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_generic.carbon b/toolchain/check/testdata/let/fail_generic.carbon index 88c9cb91fb5b..81cc6163b21d 100644 --- a/toolchain/check/testdata/let/fail_generic.carbon +++ b/toolchain/check/testdata/let/fail_generic.carbon @@ -13,7 +13,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/fail_generic.carbon // TODO: Should this be valid? -fn F(a: i32) -> i32 { +fn F(unused a: i32) -> i32 { // CHECK:STDERR: fail_generic.carbon:[[@LINE+4]]:7: error: semantics TODO: `local `let :!` bindings are currently unsupported` [SemanticsTodo] // CHECK:STDERR: let T:! type = i32; // CHECK:STDERR: ^~~~~~~~ diff --git a/toolchain/check/testdata/let/fail_missing_value.carbon b/toolchain/check/testdata/let/fail_missing_value.carbon index 0404e9ce28c6..8e3ec927007d 100644 --- a/toolchain/check/testdata/let/fail_missing_value.carbon +++ b/toolchain/check/testdata/let/fail_missing_value.carbon @@ -19,11 +19,11 @@ let n: i32; fn F() { - // CHECK:STDERR: fail_missing_value.carbon:[[@LINE+4]]:13: error: expected `=`; `let` declaration must have an initializer [ExpectedInitializerAfterLet] - // CHECK:STDERR: let n: i32; - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_missing_value.carbon:[[@LINE+4]]:20: error: expected `=`; `let` declaration must have an initializer [ExpectedInitializerAfterLet] + // CHECK:STDERR: let unused n: i32; + // CHECK:STDERR: ^ // CHECK:STDERR: - let n: i32; + let unused n: i32; } // CHECK:STDOUT: --- fail_missing_value.carbon diff --git a/toolchain/check/testdata/let/fail_use_in_init.carbon b/toolchain/check/testdata/let/fail_use_in_init.carbon index 53d8136098dc..45bfc173f31c 100644 --- a/toolchain/check/testdata/let/fail_use_in_init.carbon +++ b/toolchain/check/testdata/let/fail_use_in_init.carbon @@ -13,11 +13,18 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/fail_use_in_init.carbon fn F() { - // CHECK:STDERR: fail_use_in_init.carbon:[[@LINE+4]]:16: error: `a` used before initialization [UsedBeforeInitialization] - // CHECK:STDERR: let a: i32 = a; - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_use_in_init.carbon:[[@LINE+11]]:23: error: `a` used before initialization [UsedBeforeInitialization] + // CHECK:STDERR: let unused a: i32 = a; + // CHECK:STDERR: ^ // CHECK:STDERR: - let a: i32 = a; + // CHECK:STDERR: fail_use_in_init.carbon:[[@LINE+7]]:14: error: variable `a` marked `unused` but used [UnusedButUsed] + // CHECK:STDERR: let unused a: i32 = a; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_use_in_init.carbon:[[@LINE+4]]:23: note: usage here [UnusedButUsedHere] + // CHECK:STDERR: let unused a: i32 = a; + // CHECK:STDERR: ^ + // CHECK:STDERR: + let unused a: i32 = a; } // CHECK:STDOUT: --- fail_use_in_init.carbon @@ -56,7 +63,7 @@ fn F() { // CHECK:STDOUT: %a.patt: %pattern_type.7ce = value_binding_pattern a [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.ref: = name_ref a, [concrete = ] -// CHECK:STDOUT: %.loc20: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc27: type = splice_block %i32 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/generic.carbon b/toolchain/check/testdata/let/generic.carbon index 103d51de8bcf..058fd5f59088 100644 --- a/toolchain/check/testdata/let/generic.carbon +++ b/toolchain/check/testdata/let/generic.carbon @@ -22,7 +22,7 @@ fn F() { // CHECK:STDERR: let T:! type = i32; var p: T*; - let a: T = *p; + let unused a: T = *p; } // --- fail_todo_assignment.carbon diff --git a/toolchain/check/testdata/let/local.carbon b/toolchain/check/testdata/let/local.carbon index 7ff8270f2a1d..ec341a84768a 100644 --- a/toolchain/check/testdata/let/local.carbon +++ b/toolchain/check/testdata/let/local.carbon @@ -25,7 +25,7 @@ library "[[@TEST_NAME]]"; class C {} -fn F(c: C) {} +fn F(_: C) {} fn CallF() { //@dump-sem-ir-begin diff --git a/toolchain/check/testdata/let/ref.carbon b/toolchain/check/testdata/let/ref.carbon index 938d5cf03f17..3b6bc38eefff 100644 --- a/toolchain/check/testdata/let/ref.carbon +++ b/toolchain/check/testdata/let/ref.carbon @@ -18,7 +18,7 @@ fn F(a: i32) { var b: i32 = a; //@dump-sem-ir-begin let ref c: i32 = b; - let (ref d: i32, ref e: i32) = (b, c); + let (unused ref d: i32, unused ref e: i32) = (b, c); //@dump-sem-ir-end } @@ -27,11 +27,11 @@ fn F(a: i32) { library "[[@TEST_NAME]]"; fn F(a: i32) { - // CHECK:STDERR: fail_ref_to_value.carbon:[[@LINE+4]]:20: error: cannot bind durable reference to non-reference value of type `i32` [ConversionFailureNonRefToRef] - // CHECK:STDERR: let ref b: i32 = a; - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_ref_to_value.carbon:[[@LINE+4]]:27: error: cannot bind durable reference to non-reference value of type `i32` [ConversionFailureNonRefToRef] + // CHECK:STDERR: let unused ref b: i32 = a; + // CHECK:STDERR: ^ // CHECK:STDERR: - let ref b: i32 = a; + let unused ref b: i32 = a; } // --- fail_ref_to_temporary.carbon @@ -41,11 +41,11 @@ library "[[@TEST_NAME]]"; fn G() -> i32; fn F() { - // CHECK:STDERR: fail_ref_to_temporary.carbon:[[@LINE+4]]:20: error: cannot bind durable reference to non-reference value of type `i32` [ConversionFailureNonRefToRef] - // CHECK:STDERR: let ref a: i32 = G(); - // CHECK:STDERR: ^~~ + // CHECK:STDERR: fail_ref_to_temporary.carbon:[[@LINE+4]]:27: error: cannot bind durable reference to non-reference value of type `i32` [ConversionFailureNonRefToRef] + // CHECK:STDERR: let unused ref a: i32 = G(); + // CHECK:STDERR: ^~~ // CHECK:STDERR: - let ref a: i32 = G(); + let unused ref a: i32 = G(); } // CHECK:STDOUT: --- local.carbon @@ -76,19 +76,19 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %d.patt: %pattern_type.7ce = ref_binding_pattern d [concrete] // CHECK:STDOUT: %e.patt: %pattern_type.7ce = ref_binding_pattern e [concrete] -// CHECK:STDOUT: %.loc8_30: %pattern_type.511 = tuple_pattern (%d.patt, %e.patt) [concrete] +// CHECK:STDOUT: %.loc8_44: %pattern_type.511 = tuple_pattern (%d.patt, %e.patt) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %b.ref.loc8: ref %i32 = name_ref b, %b // CHECK:STDOUT: %c.ref: ref %i32 = name_ref c, %c -// CHECK:STDOUT: %.loc8_39: %tuple.type.d07 = tuple_literal (%b.ref.loc8, %c.ref) -// CHECK:STDOUT: %.loc8_15: type = splice_block %i32.loc8_15 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc8_15: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc8_15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc8_53: %tuple.type.d07 = tuple_literal (%b.ref.loc8, %c.ref) +// CHECK:STDOUT: %.loc8_22: type = splice_block %i32.loc8_22 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc8_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc8_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %d: ref %i32 = ref_binding d, %b.ref.loc8 -// CHECK:STDOUT: %.loc8_27: type = splice_block %i32.loc8_27 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc8_27: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc8_27: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc8_41: type = splice_block %i32.loc8_41 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc8_41: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc8_41: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %e: ref %i32 = ref_binding e, %c.ref // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/shadowed_decl.carbon b/toolchain/check/testdata/let/shadowed_decl.carbon index b6509bb70c1c..ba6ed9bb7624 100644 --- a/toolchain/check/testdata/let/shadowed_decl.carbon +++ b/toolchain/check/testdata/let/shadowed_decl.carbon @@ -12,7 +12,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/shadowed_decl.carbon -fn F(a: i32) -> i32 { +fn F(unused a: i32) -> i32 { let a: i32 = 1; // TODO: Reject this due to ambiguity. return a; @@ -88,13 +88,13 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc15_17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc15_17: Core.Form = init_form %i32.loc15_17, call_param1 [concrete = constants.%.e54] +// CHECK:STDOUT: %int_32.loc15_24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc15_24: Core.Form = init_form %i32.loc15_24, call_param1 [concrete = constants.%.e54] // CHECK:STDOUT: %a.param: %i32 = value_param call_param0 -// CHECK:STDOUT: %.loc15_9: type = splice_block %i32.loc15_9 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc15_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc15_16: type = splice_block %i32.loc15_16 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc15_16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %a.loc15: %i32 = value_binding a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 diff --git a/toolchain/check/testdata/main_run/fail_mismatch_params.carbon b/toolchain/check/testdata/main_run/fail_mismatch_params.carbon index aa51761d579f..49131f37b492 100644 --- a/toolchain/check/testdata/main_run/fail_mismatch_params.carbon +++ b/toolchain/check/testdata/main_run/fail_mismatch_params.carbon @@ -15,27 +15,27 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_bad_argc.carbon:[[@LINE+4]]:1: error: invalid parameters for `Main.Run` function; expected `()` or `(argc: i32, argv: Core.Optional(char*)*)` [InvalidMainRunParameters] -// CHECK:STDERR: fn Run(n: i64) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Run(unused n: i64) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Run(n: i64) {} +fn Run(unused n: i64) {} // --- fail_bad_argv.carbon library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_bad_argv.carbon:[[@LINE+4]]:1: error: invalid parameters for `Main.Run` function; expected `()` or `(argc: i32, argv: Core.Optional(char*)*)` [InvalidMainRunParameters] -// CHECK:STDERR: fn Run(n: i32, p: i32) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Run(unused n: i32, unused p: i32) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Run(n: i32, p: i32) {} +fn Run(unused n: i32, unused p: i32) {} // --- fail_too_many_params.carbon library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_too_many_params.carbon:[[@LINE+4]]:1: error: invalid parameters for `Main.Run` function; expected `()` or `(argc: i32, argv: Core.Optional(char*)*)` [InvalidMainRunParameters] -// CHECK:STDERR: fn Run(n: i32, p: i32*, q: i32*) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Run(unused n: i32, unused p: i32*, unused q: i32*) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Run(n: i32, p: i32*, q: i32*) {} +fn Run(unused n: i32, unused p: i32*, unused q: i32*) {} diff --git a/toolchain/check/testdata/main_run/no_return.carbon b/toolchain/check/testdata/main_run/no_return.carbon index 8a60257085f0..b0863b201a82 100644 --- a/toolchain/check/testdata/main_run/no_return.carbon +++ b/toolchain/check/testdata/main_run/no_return.carbon @@ -22,7 +22,7 @@ fn Run() {} library "[[@TEST_NAME]]"; // TODO: Switch a proper type for argv once we require one. -fn Run(argc: i32, argv: i32*) {} +fn Run(unused argc: i32, unused argv: i32*) {} // CHECK:STDOUT: --- no_params.carbon // CHECK:STDOUT: @@ -88,16 +88,16 @@ fn Run(argc: i32, argv: i32*) {} // CHECK:STDOUT: %argv.param_patt: %pattern_type.fe8 = value_param_pattern %argv.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %argc.param: %i32 = value_param call_param0 -// CHECK:STDOUT: %.loc5_14: type = splice_block %i32.loc5_14 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc5_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc5_21: type = splice_block %i32.loc5_21 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %argc: %i32 = value_binding argc, %argc.param // CHECK:STDOUT: %argv.param: %ptr = value_param call_param1 -// CHECK:STDOUT: %.loc5_28: type = splice_block %ptr [concrete = constants.%ptr] { -// CHECK:STDOUT: %int_32.loc5_25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32.loc5_25 [concrete = constants.%ptr] +// CHECK:STDOUT: %.loc5_42: type = splice_block %ptr [concrete = constants.%ptr] { +// CHECK:STDOUT: %int_32.loc5_39: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_39: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %ptr: type = ptr_type %i32.loc5_39 [concrete = constants.%ptr] // CHECK:STDOUT: } // CHECK:STDOUT: %argv: %ptr = value_binding argv, %argv.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/main_run/return_i32.carbon b/toolchain/check/testdata/main_run/return_i32.carbon index d84f32132f56..5ae85b3a3faf 100644 --- a/toolchain/check/testdata/main_run/return_i32.carbon +++ b/toolchain/check/testdata/main_run/return_i32.carbon @@ -22,7 +22,7 @@ fn Run() -> i32 { return 0; } library "[[@TEST_NAME]]"; // TODO: Switch a proper type for argv once we require one. -fn Run(argc: i32, argv: i32*) -> i32 { return 0; } +fn Run(unused argc: i32, unused argv: i32*) -> i32 { return 0; } // CHECK:STDOUT: --- no_params.carbon // CHECK:STDOUT: @@ -158,40 +158,40 @@ fn Run(argc: i32, argv: i32*) -> i32 { return 0; } // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_34: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_34: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc5_34: Core.Form = init_form %i32.loc5_34, call_param2 [concrete = constants.%.8ef] +// CHECK:STDOUT: %int_32.loc5_48: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_48: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc5_48: Core.Form = init_form %i32.loc5_48, call_param2 [concrete = constants.%.8ef] // CHECK:STDOUT: %argc.param: %i32 = value_param call_param0 -// CHECK:STDOUT: %.loc5_14: type = splice_block %i32.loc5_14 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc5_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc5_21: type = splice_block %i32.loc5_21 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %argc: %i32 = value_binding argc, %argc.param // CHECK:STDOUT: %argv.param: %ptr = value_param call_param1 -// CHECK:STDOUT: %.loc5_28: type = splice_block %ptr [concrete = constants.%ptr] { -// CHECK:STDOUT: %int_32.loc5_25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32.loc5_25 [concrete = constants.%ptr] +// CHECK:STDOUT: %.loc5_42: type = splice_block %ptr [concrete = constants.%ptr] { +// CHECK:STDOUT: %int_32.loc5_39: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_39: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %ptr: type = ptr_type %i32.loc5_39 [concrete = constants.%ptr] // CHECK:STDOUT: } // CHECK:STDOUT: %argv: %ptr = value_binding argv, %argv.param // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc5_38.1: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_38.1: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.loc5_38.2: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_38.2: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc5_52.1: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_52.1: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc5_52.2: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_52.2: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run(%argc.param: %i32, %argv.param: %ptr) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc5_48.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %bound_method.loc5_62.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc5_48.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc5_48.2(%int_0) [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc5_48: init %i32 = converted %int_0, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: return %.loc5_48 +// CHECK:STDOUT: %bound_method.loc5_62.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc5_62.2(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc5_62: init %i32 = converted %int_0, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: return %.loc5_62 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/named_constraint/convert.carbon b/toolchain/check/testdata/named_constraint/convert.carbon index da038ae34d7d..48cdf990e03a 100644 --- a/toolchain/check/testdata/named_constraint/convert.carbon +++ b/toolchain/check/testdata/named_constraint/convert.carbon @@ -15,7 +15,7 @@ library "[[@TEST_NAME]]"; constraint E {} -fn F(T:! E) {} +fn F(unused T:! E) {} //@dump-sem-ir-begin fn G(T:! E & E) { @@ -29,7 +29,7 @@ library "[[@TEST_NAME]]"; constraint E1 {} constraint E2 {} -fn F(T:! E1) {} +fn F(unused T:! E1) {} //@dump-sem-ir-begin fn G(T:! E2) { @@ -46,7 +46,7 @@ constraint E { require impls Z; } -fn F(T:! E) {} +fn F(unused T:! E) {} class C {} impl C as Z {} @@ -63,7 +63,6 @@ fn G(T:! Z) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %E.type: type = facet_type <@E> [concrete] -// CHECK:STDOUT: %T: %E.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.9a5: type = pattern_type %E.type [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] @@ -76,9 +75,10 @@ fn G(T:! Z) { // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.type: type = fn_type @type.as.BitAndWith.impl.Op [concrete] // CHECK:STDOUT: %type.as.BitAndWith.impl.Op: %type.as.BitAndWith.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.bound: = bound_method %E.type, %type.as.BitAndWith.impl.Op [concrete] +// CHECK:STDOUT: %T.f45530.2: %E.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] -// CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%T) [symbolic] +// CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%T.f45530.2) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -100,12 +100,12 @@ fn G(T:! Z) { // CHECK:STDOUT: %.loc8_12.2: type = value_of_initializer %type.as.BitAndWith.impl.Op.call [concrete = constants.%E.type] // CHECK:STDOUT: %.loc8_12.3: type = converted %type.as.BitAndWith.impl.Op.call, %.loc8_12.2 [concrete = constants.%E.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc8_6.2: %E.type = symbolic_binding T, 0 [symbolic = %T.loc8_6.1 (constants.%T)] +// CHECK:STDOUT: %T.loc8_6.2: %E.type = symbolic_binding T, 0 [symbolic = %T.loc8_6.1 (constants.%T.f45530.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(%T.loc8_6.2: %E.type) { -// CHECK:STDOUT: %T.loc8_6.1: %E.type = symbolic_binding T, 0 [symbolic = %T.loc8_6.1 (constants.%T)] +// CHECK:STDOUT: %T.loc8_6.1: %E.type = symbolic_binding T, 0 [symbolic = %T.loc8_6.1 (constants.%T.f45530.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.specific_fn.loc9_3.2: = specific_function constants.%F, @F(%T.loc8_6.1) [symbolic = %F.specific_fn.loc9_3.2 (constants.%F.specific_fn)] @@ -113,15 +113,15 @@ fn G(T:! Z) { // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %T.ref: %E.type = name_ref T, %T.loc8_6.2 [symbolic = %T.loc8_6.1 (constants.%T)] -// CHECK:STDOUT: %F.specific_fn.loc9_3.1: = specific_function %F.ref, @F(constants.%T) [symbolic = %F.specific_fn.loc9_3.2 (constants.%F.specific_fn)] +// CHECK:STDOUT: %T.ref: %E.type = name_ref T, %T.loc8_6.2 [symbolic = %T.loc8_6.1 (constants.%T.f45530.2)] +// CHECK:STDOUT: %F.specific_fn.loc9_3.1: = specific_function %F.ref, @F(constants.%T.f45530.2) [symbolic = %F.specific_fn.loc9_3.2 (constants.%F.specific_fn)] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn.loc9_3.1() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @G(constants.%T) { -// CHECK:STDOUT: %T.loc8_6.1 => constants.%T +// CHECK:STDOUT: specific @G(constants.%T.f45530.2) { +// CHECK:STDOUT: %T.loc8_6.1 => constants.%T.f45530.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- compatible_constraints.carbon diff --git a/toolchain/check/testdata/named_constraint/empty.carbon b/toolchain/check/testdata/named_constraint/empty.carbon index d4a020138cbf..ca3916394ce3 100644 --- a/toolchain/check/testdata/named_constraint/empty.carbon +++ b/toolchain/check/testdata/named_constraint/empty.carbon @@ -16,7 +16,7 @@ constraint Empty {} // Like `type`. // //@dump-sem-ir-begin -fn F(T:! Empty) {} +fn F(unused T:! Empty) {} //@dump-sem-ir-end interface Z {} @@ -70,7 +70,7 @@ fn G(T:! Z, U:! type, V:! Empty) { // CHECK:STDOUT: // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [concrete = constants.%Empty.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc19_6.2: %Empty.type = symbolic_binding T, 0 [symbolic = %T.loc19_6.1 (constants.%T.f45)] +// CHECK:STDOUT: %T.loc19_13.2: %Empty.type = symbolic_binding T, 0 [symbolic = %T.loc19_13.1 (constants.%T.f45)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %T.patt: %pattern_type.22b = symbolic_binding_pattern T, 0 [concrete] @@ -92,8 +92,8 @@ fn G(T:! Z, U:! type, V:! Empty) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%T.loc19_6.2: %Empty.type) { -// CHECK:STDOUT: %T.loc19_6.1: %Empty.type = symbolic_binding T, 0 [symbolic = %T.loc19_6.1 (constants.%T.f45)] +// CHECK:STDOUT: generic fn @F(%T.loc19_13.2: %Empty.type) { +// CHECK:STDOUT: %T.loc19_13.1: %Empty.type = symbolic_binding T, 0 [symbolic = %T.loc19_13.1 (constants.%T.f45)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -151,7 +151,7 @@ fn G(T:! Z, U:! type, V:! Empty) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.f45) { -// CHECK:STDOUT: %T.loc19_6.1 => constants.%T.f45 +// CHECK:STDOUT: %T.loc19_13.1 => constants.%T.f45 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T.ea3, constants.%U, constants.%V) { @@ -161,31 +161,31 @@ fn G(T:! Z, U:! type, V:! Empty) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Empty.facet.76f) { -// CHECK:STDOUT: %T.loc19_6.1 => constants.%Empty.facet.76f +// CHECK:STDOUT: %T.loc19_13.1 => constants.%Empty.facet.76f // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Empty.facet.2cb) { -// CHECK:STDOUT: %T.loc19_6.1 => constants.%Empty.facet.2cb +// CHECK:STDOUT: %T.loc19_13.1 => constants.%Empty.facet.2cb // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Empty.facet.4f8) { -// CHECK:STDOUT: %T.loc19_6.1 => constants.%Empty.facet.4f8 +// CHECK:STDOUT: %T.loc19_13.1 => constants.%Empty.facet.4f8 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Empty.facet.380) { -// CHECK:STDOUT: %T.loc19_6.1 => constants.%Empty.facet.380 +// CHECK:STDOUT: %T.loc19_13.1 => constants.%Empty.facet.380 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%V) { -// CHECK:STDOUT: %T.loc19_6.1 => constants.%V +// CHECK:STDOUT: %T.loc19_13.1 => constants.%V // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/named_constraint/empty_generic.carbon b/toolchain/check/testdata/named_constraint/empty_generic.carbon index be067ba64170..2ddca06c82ad 100644 --- a/toolchain/check/testdata/named_constraint/empty_generic.carbon +++ b/toolchain/check/testdata/named_constraint/empty_generic.carbon @@ -15,7 +15,7 @@ interface Z {} //@dump-sem-ir-begin constraint Empty(T:! type) {} -fn F(T:! type, U:! Empty(T)) {} +fn F(T:! type, unused U:! Empty(T)) {} fn G(T:! Z, U:! Empty(T), V:! type) { F(T, {} as type); @@ -81,13 +81,13 @@ fn G(T:! Z, U:! Empty(T), V:! type) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: %T.loc18_6.2: type = symbolic_binding T, 0 [symbolic = %T.loc18_6.1 (constants.%T.67d)] -// CHECK:STDOUT: %.loc18: type = splice_block %Empty.type.loc18_27.2 [symbolic = %Empty.type.loc18_27.1 (constants.%Empty.type.d682d6.1)] { +// CHECK:STDOUT: %.loc18: type = splice_block %Empty.type.loc18_34.2 [symbolic = %Empty.type.loc18_34.1 (constants.%Empty.type.d682d6.1)] { // CHECK:STDOUT: // CHECK:STDOUT: %Empty.ref: %Empty.type.19a = name_ref Empty, file.%Empty.decl [concrete = constants.%empty_struct.019] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc18_6.2 [symbolic = %T.loc18_6.1 (constants.%T.67d)] -// CHECK:STDOUT: %Empty.type.loc18_27.2: type = facet_type <@Empty, @Empty(constants.%T.67d)> [symbolic = %Empty.type.loc18_27.1 (constants.%Empty.type.d682d6.1)] +// CHECK:STDOUT: %Empty.type.loc18_34.2: type = facet_type <@Empty, @Empty(constants.%T.67d)> [symbolic = %Empty.type.loc18_34.1 (constants.%Empty.type.d682d6.1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %U.loc18_16.2: @F.%Empty.type.loc18_27.1 (%Empty.type.d682d6.1) = symbolic_binding U, 1 [symbolic = %U.loc18_16.1 (constants.%U.e1f642.1)] +// CHECK:STDOUT: %U.loc18_23.2: @F.%Empty.type.loc18_34.1 (%Empty.type.d682d6.1) = symbolic_binding U, 1 [symbolic = %U.loc18_23.1 (constants.%U.e1f642.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %T.patt: %pattern_type.22b = symbolic_binding_pattern T, 0 [concrete] @@ -131,11 +131,11 @@ fn G(T:! Z, U:! Empty(T), V:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%T.loc18_6.2: type, %U.loc18_16.2: @F.%Empty.type.loc18_27.1 (%Empty.type.d682d6.1)) { +// CHECK:STDOUT: generic fn @F(%T.loc18_6.2: type, %U.loc18_23.2: @F.%Empty.type.loc18_34.1 (%Empty.type.d682d6.1)) { // CHECK:STDOUT: %T.loc18_6.1: type = symbolic_binding T, 0 [symbolic = %T.loc18_6.1 (constants.%T.67d)] -// CHECK:STDOUT: %Empty.type.loc18_27.1: type = facet_type <@Empty, @Empty(%T.loc18_6.1)> [symbolic = %Empty.type.loc18_27.1 (constants.%Empty.type.d682d6.1)] -// CHECK:STDOUT: %U.loc18_16.1: @F.%Empty.type.loc18_27.1 (%Empty.type.d682d6.1) = symbolic_binding U, 1 [symbolic = %U.loc18_16.1 (constants.%U.e1f642.1)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Empty.type.loc18_27.1 [symbolic = %pattern_type (constants.%pattern_type.9a587c.1)] +// CHECK:STDOUT: %Empty.type.loc18_34.1: type = facet_type <@Empty, @Empty(%T.loc18_6.1)> [symbolic = %Empty.type.loc18_34.1 (constants.%Empty.type.d682d6.1)] +// CHECK:STDOUT: %U.loc18_23.1: @F.%Empty.type.loc18_34.1 (%Empty.type.d682d6.1) = symbolic_binding U, 1 [symbolic = %U.loc18_23.1 (constants.%U.e1f642.1)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Empty.type.loc18_34.1 [symbolic = %pattern_type (constants.%pattern_type.9a587c.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -222,8 +222,8 @@ fn G(T:! Z, U:! Empty(T), V:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.67d, constants.%U.e1f642.1) { // CHECK:STDOUT: %T.loc18_6.1 => constants.%T.67d -// CHECK:STDOUT: %Empty.type.loc18_27.1 => constants.%Empty.type.d682d6.1 -// CHECK:STDOUT: %U.loc18_16.1 => constants.%U.e1f642.1 +// CHECK:STDOUT: %Empty.type.loc18_34.1 => constants.%Empty.type.d682d6.1 +// CHECK:STDOUT: %U.loc18_23.1 => constants.%U.e1f642.1 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9a587c.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -254,8 +254,8 @@ fn G(T:! Z, U:! Empty(T), V:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.binding.as_type, constants.%Empty.facet.76f) { // CHECK:STDOUT: %T.loc18_6.1 => constants.%T.binding.as_type -// CHECK:STDOUT: %Empty.type.loc18_27.1 => constants.%Empty.type.d682d6.2 -// CHECK:STDOUT: %U.loc18_16.1 => constants.%Empty.facet.76f +// CHECK:STDOUT: %Empty.type.loc18_34.1 => constants.%Empty.type.d682d6.2 +// CHECK:STDOUT: %U.loc18_23.1 => constants.%Empty.facet.76f // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9a587c.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -267,8 +267,8 @@ fn G(T:! Z, U:! Empty(T), V:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.binding.as_type, constants.%Empty.facet.2cb) { // CHECK:STDOUT: %T.loc18_6.1 => constants.%T.binding.as_type -// CHECK:STDOUT: %Empty.type.loc18_27.1 => constants.%Empty.type.d682d6.2 -// CHECK:STDOUT: %U.loc18_16.1 => constants.%Empty.facet.2cb +// CHECK:STDOUT: %Empty.type.loc18_34.1 => constants.%Empty.type.d682d6.2 +// CHECK:STDOUT: %U.loc18_23.1 => constants.%Empty.facet.2cb // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9a587c.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -280,8 +280,8 @@ fn G(T:! Z, U:! Empty(T), V:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.binding.as_type, constants.%Empty.facet.4f8) { // CHECK:STDOUT: %T.loc18_6.1 => constants.%T.binding.as_type -// CHECK:STDOUT: %Empty.type.loc18_27.1 => constants.%Empty.type.d682d6.2 -// CHECK:STDOUT: %U.loc18_16.1 => constants.%Empty.facet.4f8 +// CHECK:STDOUT: %Empty.type.loc18_34.1 => constants.%Empty.type.d682d6.2 +// CHECK:STDOUT: %U.loc18_23.1 => constants.%Empty.facet.4f8 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9a587c.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -289,8 +289,8 @@ fn G(T:! Z, U:! Empty(T), V:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.binding.as_type, constants.%U.e1f642.2) { // CHECK:STDOUT: %T.loc18_6.1 => constants.%T.binding.as_type -// CHECK:STDOUT: %Empty.type.loc18_27.1 => constants.%Empty.type.d682d6.2 -// CHECK:STDOUT: %U.loc18_16.1 => constants.%U.e1f642.2 +// CHECK:STDOUT: %Empty.type.loc18_34.1 => constants.%Empty.type.d682d6.2 +// CHECK:STDOUT: %U.loc18_23.1 => constants.%U.e1f642.2 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9a587c.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -302,8 +302,8 @@ fn G(T:! Z, U:! Empty(T), V:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.binding.as_type, constants.%Empty.facet.ed5) { // CHECK:STDOUT: %T.loc18_6.1 => constants.%T.binding.as_type -// CHECK:STDOUT: %Empty.type.loc18_27.1 => constants.%Empty.type.d682d6.2 -// CHECK:STDOUT: %U.loc18_16.1 => constants.%Empty.facet.ed5 +// CHECK:STDOUT: %Empty.type.loc18_34.1 => constants.%Empty.type.d682d6.2 +// CHECK:STDOUT: %U.loc18_23.1 => constants.%Empty.facet.ed5 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9a587c.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/named_constraint/generic.carbon b/toolchain/check/testdata/named_constraint/generic.carbon index e55b1c693ba6..e5b27c7424e5 100644 --- a/toolchain/check/testdata/named_constraint/generic.carbon +++ b/toolchain/check/testdata/named_constraint/generic.carbon @@ -66,14 +66,14 @@ library "[[@TEST_NAME]]"; constraint Generic(T:! type) {} -// CHECK:STDERR: fail_args_count_mismatch.carbon:[[@LINE+7]]:10: error: 2 arguments passed to generic constraint expecting 1 argument [CallArgCountMismatch] -// CHECK:STDERR: fn F(T:! Generic((), ())) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_args_count_mismatch.carbon:[[@LINE+7]]:17: error: 2 arguments passed to generic constraint expecting 1 argument [CallArgCountMismatch] +// CHECK:STDERR: fn F(unused T:! Generic((), ())) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_args_count_mismatch.carbon:[[@LINE-5]]:1: note: calling generic constraint declared here [InCallToEntity] // CHECK:STDERR: constraint Generic(T:! type) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(T:! Generic((), ())) {} +fn F(unused T:! Generic((), ())) {} // CHECK:STDOUT: --- generic.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/named_constraint/import_constraint_decl.carbon b/toolchain/check/testdata/named_constraint/import_constraint_decl.carbon index ed07c9b7f559..b301e4e77ba5 100644 --- a/toolchain/check/testdata/named_constraint/import_constraint_decl.carbon +++ b/toolchain/check/testdata/named_constraint/import_constraint_decl.carbon @@ -31,7 +31,7 @@ constraint B { //@include-in-dumps impl library "[[@TEST_NAME]]"; -fn F(T:! B) {} +fn F(unused T:! B) {} // --- fail_import_not_identified.carbon library "[[@TEST_NAME]]"; @@ -118,7 +118,7 @@ impl C as B {} // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %B.ref: type = name_ref B, imports.%Main.B [concrete = constants.%B.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc4_6.2: %B.type = symbolic_binding T, 0 [symbolic = %T.loc4_6.1 (constants.%T)] +// CHECK:STDOUT: %T.loc4_13.2: %B.type = symbolic_binding T, 0 [symbolic = %T.loc4_13.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -146,8 +146,8 @@ impl C as B {} // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%T.loc4_6.2: %B.type) { -// CHECK:STDOUT: %T.loc4_6.1: %B.type = symbolic_binding T, 0 [symbolic = %T.loc4_6.1 (constants.%T)] +// CHECK:STDOUT: generic fn @F(%T.loc4_13.2: %B.type) { +// CHECK:STDOUT: %T.loc4_13.1: %B.type = symbolic_binding T, 0 [symbolic = %T.loc4_13.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -169,6 +169,6 @@ impl C as B {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { -// CHECK:STDOUT: %T.loc4_6.1 => constants.%T +// CHECK:STDOUT: %T.loc4_13.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/named_constraint/invalid_members.carbon b/toolchain/check/testdata/named_constraint/invalid_members.carbon index b7addc259add..40bda30496bb 100644 --- a/toolchain/check/testdata/named_constraint/invalid_members.carbon +++ b/toolchain/check/testdata/named_constraint/invalid_members.carbon @@ -22,7 +22,7 @@ constraint E { constraint F { // TODO: Any fn in a non-template constraint is an error. fn DefinedFunction() {} - fn DefinedMethod[self: Self](b: Self) {} + fn DefinedMethod[unused self: Self](unused b: Self) {} } // --- todo_fail_invalid_var.carbon diff --git a/toolchain/check/testdata/namespace/fail_params.carbon b/toolchain/check/testdata/namespace/fail_params.carbon index 52f9530b6579..aed99dad0ff3 100644 --- a/toolchain/check/testdata/namespace/fail_params.carbon +++ b/toolchain/check/testdata/namespace/fail_params.carbon @@ -39,13 +39,13 @@ namespace C[T:! type](x: T); namespace D; // CHECK:STDERR: fail_params.carbon:[[@LINE+7]]:4: error: redeclaration differs because of parameter list [RedeclParamListDiffers] -// CHECK:STDERR: fn D(T:! type).F() {} +// CHECK:STDERR: fn D(unused T:! type).F() {} // CHECK:STDERR: ^ // CHECK:STDERR: fail_params.carbon:[[@LINE-4]]:1: note: previously declared without parameter list [RedeclParamListPrevious] // CHECK:STDERR: namespace D; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: -fn D(T:! type).F() {} +fn D(unused T:! type).F() {} // CHECK:STDOUT: --- fail_params.carbon // CHECK:STDOUT: @@ -55,7 +55,8 @@ fn D(T:! type).F() {} // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %T.67db0b.1: type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %T.67db0b.2: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %F.type.117: type = fn_type @F.loc48 [concrete] // CHECK:STDOUT: %F.d98: %F.type.117 = struct_value () [concrete] // CHECK:STDOUT: } @@ -86,15 +87,15 @@ fn D(T:! type).F() {} // CHECK:STDOUT: %n: = value_binding n, %n.param // CHECK:STDOUT: %B: = namespace [concrete] {} // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = constants.%T] -// CHECK:STDOUT: %x.param: %T = value_param call_param0 -// CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T] -// CHECK:STDOUT: %x: %T = value_binding x, %x.param +// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = constants.%T.67db0b.1] +// CHECK:STDOUT: %x.param: %T.67db0b.1 = value_param call_param0 +// CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T.67db0b.1] +// CHECK:STDOUT: %x: %T.67db0b.1 = value_binding x, %x.param // CHECK:STDOUT: %C: = namespace [concrete] {} // CHECK:STDOUT: %D: = namespace [concrete] {} // CHECK:STDOUT: %F.decl.loc48: %F.type.117 = fn_decl @F.loc48 [concrete = constants.%F.d98] {} { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T.loc48_6.2: type = symbolic_binding T, 0 [symbolic = %T.loc48_6.1 (constants.%T)] +// CHECK:STDOUT: %T.loc48_13.3: type = symbolic_binding T, 0 [symbolic = %T.loc48_13.2 (constants.%T.67db0b.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -103,8 +104,9 @@ fn D(T:! type).F() {} // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.loc48(%T.loc48_6.2: type) { -// CHECK:STDOUT: %T.loc48_6.1: type = symbolic_binding T, 0 [symbolic = %T.loc48_6.1 (constants.%T)] +// CHECK:STDOUT: generic fn @F.loc48(%T.loc48_13.3: type) { +// CHECK:STDOUT: %T.loc48_13.1: type = symbolic_binding T, 0 [symbolic = %T.loc48_13.1 (constants.%T.67db0b.1)] +// CHECK:STDOUT: %T.loc48_13.2: type = symbolic_binding T, 0 [symbolic = %T.loc48_13.2 (constants.%T.67db0b.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -114,7 +116,8 @@ fn D(T:! type).F() {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.loc48(constants.%T) { -// CHECK:STDOUT: %T.loc48_6.1 => constants.%T +// CHECK:STDOUT: specific @F.loc48(constants.%T.67db0b.2) { +// CHECK:STDOUT: %T.loc48_13.1 => constants.%T.67db0b.2 +// CHECK:STDOUT: %T.loc48_13.2 => constants.%T.67db0b.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/name_poisoning.carbon b/toolchain/check/testdata/namespace/name_poisoning.carbon index 4af8be7e2fe1..122cd30d461e 100644 --- a/toolchain/check/testdata/namespace/name_poisoning.carbon +++ b/toolchain/check/testdata/namespace/name_poisoning.carbon @@ -25,7 +25,7 @@ class N2.N1.C {} class N1.C {} fn TestNamespaces() { var x: N2.N1.C; - var y: N2.N3.C* = &x; + var unused y: N2.N3.C* = &x; } // --- poison.carbon diff --git a/toolchain/check/testdata/operators/builtin/and.carbon b/toolchain/check/testdata/operators/builtin/and.carbon index adb3e921e266..f95457460c0c 100644 --- a/toolchain/check/testdata/operators/builtin/and.carbon +++ b/toolchain/check/testdata/operators/builtin/and.carbon @@ -20,14 +20,14 @@ fn And() -> bool { } fn Constant() { - var a: if true and true then bool else () = true; - var b: if true and false then bool else () = (); - var c: if false and true then bool else () = (); - var d: if false and false then bool else () = (); + var unused a: if true and true then bool else () = true; + var unused b: if true and false then bool else () = (); + var unused c: if false and true then bool else () = (); + var unused d: if false and false then bool else () = (); } fn PartialConstant(x: bool) { - var a: if false and x then bool else () = (); + var unused a: if false and x then bool else () = (); } // CHECK:STDOUT: --- and.carbon @@ -189,165 +189,165 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %a.var_patt: %pattern_type.831 = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref bool = var %a.var_patt -// CHECK:STDOUT: %true.loc23_47: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: %true.loc23_54: bool = bool_literal true [concrete = constants.%true] // CHECK:STDOUT: %impl.elem0: %.86d = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op] -// CHECK:STDOUT: %bound_method: = bound_method %true.loc23_47, %impl.elem0 [concrete = constants.%bool.as.Copy.impl.Op.bound] -// CHECK:STDOUT: %bool.as.Copy.impl.Op.call: init bool = call %bound_method(%true.loc23_47) [concrete = constants.%true] +// CHECK:STDOUT: %bound_method: = bound_method %true.loc23_54, %impl.elem0 [concrete = constants.%bool.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.call: init bool = call %bound_method(%true.loc23_54) [concrete = constants.%true] // CHECK:STDOUT: assign %a.var, %bool.as.Copy.impl.Op.call -// CHECK:STDOUT: br !.loc23_13 +// CHECK:STDOUT: br !.loc23_20 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc23_13: -// CHECK:STDOUT: %true.loc23_13: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: !.loc23_20: +// CHECK:STDOUT: %true.loc23_20: bool = bool_literal true [concrete = constants.%true] // CHECK:STDOUT: %false.loc23: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: if %true.loc23_13 br !and.rhs.loc23 else br !and.result.loc23(%false.loc23) +// CHECK:STDOUT: if %true.loc23_20 br !and.rhs.loc23 else br !and.result.loc23(%false.loc23) // CHECK:STDOUT: // CHECK:STDOUT: !and.rhs.loc23: -// CHECK:STDOUT: %true.loc23_22: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: br !and.result.loc23(%true.loc23_22) +// CHECK:STDOUT: %true.loc23_29: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: br !and.result.loc23(%true.loc23_29) // CHECK:STDOUT: // CHECK:STDOUT: !and.result.loc23: -// CHECK:STDOUT: %.loc23_18: bool = block_arg !and.result.loc23 [concrete = constants.%true] -// CHECK:STDOUT: if %.loc23_18 br !if.expr.then.loc23 else br !if.expr.else.loc23 +// CHECK:STDOUT: %.loc23_25: bool = block_arg !and.result.loc23 [concrete = constants.%true] +// CHECK:STDOUT: if %.loc23_25 br !if.expr.then.loc23 else br !if.expr.else.loc23 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc23: // CHECK:STDOUT: %Bool.call.loc23: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc23_32.1: type = value_of_initializer %Bool.call.loc23 [concrete = bool] -// CHECK:STDOUT: %.loc23_32.2: type = converted %Bool.call.loc23, %.loc23_32.1 [concrete = bool] -// CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_32.2) +// CHECK:STDOUT: %.loc23_39.1: type = value_of_initializer %Bool.call.loc23 [concrete = bool] +// CHECK:STDOUT: %.loc23_39.2: type = converted %Bool.call.loc23, %.loc23_39.1 [concrete = bool] +// CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_39.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc23: -// CHECK:STDOUT: %.loc23_43: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc23_37: type = converted %.loc23_43, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_37) +// CHECK:STDOUT: %.loc23_50: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc23_44: type = converted %.loc23_50, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_44) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc23: -// CHECK:STDOUT: %.loc23_10: type = block_arg !if.expr.result.loc23 [concrete = bool] -// CHECK:STDOUT: br !.loc23_7 +// CHECK:STDOUT: %.loc23_17: type = block_arg !if.expr.result.loc23 [concrete = bool] +// CHECK:STDOUT: br !.loc23_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc23_7: +// CHECK:STDOUT: !.loc23_14: // CHECK:STDOUT: %a: ref bool = ref_binding a, %a.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.cb1 = ref_binding_pattern b [concrete] // CHECK:STDOUT: %b.var_patt: %pattern_type.cb1 = var_pattern %b.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref %empty_tuple.type = var %b.var_patt -// CHECK:STDOUT: %.loc24_49.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc24_49.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc24_3: init %empty_tuple.type = converted %.loc24_49.1, %.loc24_49.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc24_56.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc24_56.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc24_3: init %empty_tuple.type = converted %.loc24_56.1, %.loc24_56.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: assign %b.var, %.loc24_3 -// CHECK:STDOUT: br !.loc24_13 +// CHECK:STDOUT: br !.loc24_20 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc24_13: +// CHECK:STDOUT: !.loc24_20: // CHECK:STDOUT: %true.loc24: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: %false.loc24_18: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: if %true.loc24 br !and.rhs.loc24 else br !and.result.loc24(%false.loc24_18) +// CHECK:STDOUT: %false.loc24_25: bool = bool_literal false [concrete = constants.%false] +// CHECK:STDOUT: if %true.loc24 br !and.rhs.loc24 else br !and.result.loc24(%false.loc24_25) // CHECK:STDOUT: // CHECK:STDOUT: !and.rhs.loc24: -// CHECK:STDOUT: %false.loc24_22: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: br !and.result.loc24(%false.loc24_22) +// CHECK:STDOUT: %false.loc24_29: bool = bool_literal false [concrete = constants.%false] +// CHECK:STDOUT: br !and.result.loc24(%false.loc24_29) // CHECK:STDOUT: // CHECK:STDOUT: !and.result.loc24: -// CHECK:STDOUT: %.loc24_18: bool = block_arg !and.result.loc24 [concrete = constants.%false] -// CHECK:STDOUT: if %.loc24_18 br !if.expr.then.loc24 else br !if.expr.else.loc24 +// CHECK:STDOUT: %.loc24_25: bool = block_arg !and.result.loc24 [concrete = constants.%false] +// CHECK:STDOUT: if %.loc24_25 br !if.expr.then.loc24 else br !if.expr.else.loc24 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc24: // CHECK:STDOUT: %Bool.call.loc24: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc24_33.1: type = value_of_initializer %Bool.call.loc24 [concrete = bool] -// CHECK:STDOUT: %.loc24_33.2: type = converted %Bool.call.loc24, %.loc24_33.1 [concrete = bool] -// CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_33.2) +// CHECK:STDOUT: %.loc24_40.1: type = value_of_initializer %Bool.call.loc24 [concrete = bool] +// CHECK:STDOUT: %.loc24_40.2: type = converted %Bool.call.loc24, %.loc24_40.1 [concrete = bool] +// CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_40.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc24: -// CHECK:STDOUT: %.loc24_44: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc24_38: type = converted %.loc24_44, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_38) +// CHECK:STDOUT: %.loc24_51: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc24_45: type = converted %.loc24_51, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_45) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc24: -// CHECK:STDOUT: %.loc24_10: type = block_arg !if.expr.result.loc24 [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !.loc24_7 +// CHECK:STDOUT: %.loc24_17: type = block_arg !if.expr.result.loc24 [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !.loc24_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc24_7: +// CHECK:STDOUT: !.loc24_14: // CHECK:STDOUT: %b: ref %empty_tuple.type = ref_binding b, %b.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c.patt: %pattern_type.cb1 = ref_binding_pattern c [concrete] // CHECK:STDOUT: %c.var_patt: %pattern_type.cb1 = var_pattern %c.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c.var: ref %empty_tuple.type = var %c.var_patt -// CHECK:STDOUT: %.loc25_49.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc25_49.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc25_3: init %empty_tuple.type = converted %.loc25_49.1, %.loc25_49.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc25_56.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc25_56.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc25_3: init %empty_tuple.type = converted %.loc25_56.1, %.loc25_56.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: assign %c.var, %.loc25_3 -// CHECK:STDOUT: br !.loc25_13 +// CHECK:STDOUT: br !.loc25_20 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc25_13: -// CHECK:STDOUT: %false.loc25_13: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: %false.loc25_19: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: if %false.loc25_13 br !and.rhs.loc25 else br !and.result.loc25(%false.loc25_19) +// CHECK:STDOUT: !.loc25_20: +// CHECK:STDOUT: %false.loc25_20: bool = bool_literal false [concrete = constants.%false] +// CHECK:STDOUT: %false.loc25_26: bool = bool_literal false [concrete = constants.%false] +// CHECK:STDOUT: if %false.loc25_20 br !and.rhs.loc25 else br !and.result.loc25(%false.loc25_26) // CHECK:STDOUT: // CHECK:STDOUT: !and.rhs.loc25: // CHECK:STDOUT: %true.loc25: bool = bool_literal true [concrete = constants.%true] // CHECK:STDOUT: br !and.result.loc25(%true.loc25) // CHECK:STDOUT: // CHECK:STDOUT: !and.result.loc25: -// CHECK:STDOUT: %.loc25_19: bool = block_arg !and.result.loc25 [concrete = constants.%false] -// CHECK:STDOUT: if %.loc25_19 br !if.expr.then.loc25 else br !if.expr.else.loc25 +// CHECK:STDOUT: %.loc25_26: bool = block_arg !and.result.loc25 [concrete = constants.%false] +// CHECK:STDOUT: if %.loc25_26 br !if.expr.then.loc25 else br !if.expr.else.loc25 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc25: // CHECK:STDOUT: %Bool.call.loc25: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc25_33.1: type = value_of_initializer %Bool.call.loc25 [concrete = bool] -// CHECK:STDOUT: %.loc25_33.2: type = converted %Bool.call.loc25, %.loc25_33.1 [concrete = bool] -// CHECK:STDOUT: br !if.expr.result.loc25(%.loc25_33.2) +// CHECK:STDOUT: %.loc25_40.1: type = value_of_initializer %Bool.call.loc25 [concrete = bool] +// CHECK:STDOUT: %.loc25_40.2: type = converted %Bool.call.loc25, %.loc25_40.1 [concrete = bool] +// CHECK:STDOUT: br !if.expr.result.loc25(%.loc25_40.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc25: -// CHECK:STDOUT: %.loc25_44: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc25_38: type = converted %.loc25_44, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc25(%.loc25_38) +// CHECK:STDOUT: %.loc25_51: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc25_45: type = converted %.loc25_51, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !if.expr.result.loc25(%.loc25_45) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc25: -// CHECK:STDOUT: %.loc25_10: type = block_arg !if.expr.result.loc25 [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !.loc25_7 +// CHECK:STDOUT: %.loc25_17: type = block_arg !if.expr.result.loc25 [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !.loc25_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc25_7: +// CHECK:STDOUT: !.loc25_14: // CHECK:STDOUT: %c: ref %empty_tuple.type = ref_binding c, %c.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %d.patt: %pattern_type.cb1 = ref_binding_pattern d [concrete] // CHECK:STDOUT: %d.var_patt: %pattern_type.cb1 = var_pattern %d.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %d.var: ref %empty_tuple.type = var %d.var_patt -// CHECK:STDOUT: %.loc26_50.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc26_50.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc26_3: init %empty_tuple.type = converted %.loc26_50.1, %.loc26_50.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc26_57.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc26_57.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc26_3: init %empty_tuple.type = converted %.loc26_57.1, %.loc26_57.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: assign %d.var, %.loc26_3 -// CHECK:STDOUT: br !.loc26_13 +// CHECK:STDOUT: br !.loc26_20 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc26_13: -// CHECK:STDOUT: %false.loc26_13: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: %false.loc26_19: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: if %false.loc26_13 br !and.rhs.loc26 else br !and.result.loc26(%false.loc26_19) +// CHECK:STDOUT: !.loc26_20: +// CHECK:STDOUT: %false.loc26_20: bool = bool_literal false [concrete = constants.%false] +// CHECK:STDOUT: %false.loc26_26: bool = bool_literal false [concrete = constants.%false] +// CHECK:STDOUT: if %false.loc26_20 br !and.rhs.loc26 else br !and.result.loc26(%false.loc26_26) // CHECK:STDOUT: // CHECK:STDOUT: !and.rhs.loc26: -// CHECK:STDOUT: %false.loc26_23: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: br !and.result.loc26(%false.loc26_23) +// CHECK:STDOUT: %false.loc26_30: bool = bool_literal false [concrete = constants.%false] +// CHECK:STDOUT: br !and.result.loc26(%false.loc26_30) // CHECK:STDOUT: // CHECK:STDOUT: !and.result.loc26: -// CHECK:STDOUT: %.loc26_19: bool = block_arg !and.result.loc26 [concrete = constants.%false] -// CHECK:STDOUT: if %.loc26_19 br !if.expr.then.loc26 else br !if.expr.else.loc26 +// CHECK:STDOUT: %.loc26_26: bool = block_arg !and.result.loc26 [concrete = constants.%false] +// CHECK:STDOUT: if %.loc26_26 br !if.expr.then.loc26 else br !if.expr.else.loc26 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc26: // CHECK:STDOUT: %Bool.call.loc26: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc26_34.1: type = value_of_initializer %Bool.call.loc26 [concrete = bool] -// CHECK:STDOUT: %.loc26_34.2: type = converted %Bool.call.loc26, %.loc26_34.1 [concrete = bool] -// CHECK:STDOUT: br !if.expr.result.loc26(%.loc26_34.2) +// CHECK:STDOUT: %.loc26_41.1: type = value_of_initializer %Bool.call.loc26 [concrete = bool] +// CHECK:STDOUT: %.loc26_41.2: type = converted %Bool.call.loc26, %.loc26_41.1 [concrete = bool] +// CHECK:STDOUT: br !if.expr.result.loc26(%.loc26_41.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc26: -// CHECK:STDOUT: %.loc26_45: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc26_39: type = converted %.loc26_45, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc26(%.loc26_39) +// CHECK:STDOUT: %.loc26_52: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc26_46: type = converted %.loc26_52, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !if.expr.result.loc26(%.loc26_46) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc26: -// CHECK:STDOUT: %.loc26_10: type = block_arg !if.expr.result.loc26 [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !.loc26_7 +// CHECK:STDOUT: %.loc26_17: type = block_arg !if.expr.result.loc26 [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !.loc26_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc26_7: +// CHECK:STDOUT: !.loc26_14: // CHECK:STDOUT: %d: ref %empty_tuple.type = ref_binding d, %d.var // CHECK:STDOUT: %DestroyOp.bound.loc26: = bound_method %d.var, constants.%DestroyOp.b0ebf8.1 // CHECK:STDOUT: %DestroyOp.call.loc26: init %empty_tuple.type = call %DestroyOp.bound.loc26(%d.var) @@ -371,41 +371,41 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %a.var_patt: %pattern_type.cb1 = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var %a.var_patt -// CHECK:STDOUT: %.loc30_46.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc30_46.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc30_3: init %empty_tuple.type = converted %.loc30_46.1, %.loc30_46.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc30_53.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc30_53.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc30_3: init %empty_tuple.type = converted %.loc30_53.1, %.loc30_53.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: assign %a.var, %.loc30_3 -// CHECK:STDOUT: br !.loc30_13 +// CHECK:STDOUT: br !.loc30_20 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc30_13: -// CHECK:STDOUT: %false.loc30_13: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: %false.loc30_19: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: if %false.loc30_13 br !and.rhs else br !and.result(%false.loc30_19) +// CHECK:STDOUT: !.loc30_20: +// CHECK:STDOUT: %false.loc30_20: bool = bool_literal false [concrete = constants.%false] +// CHECK:STDOUT: %false.loc30_26: bool = bool_literal false [concrete = constants.%false] +// CHECK:STDOUT: if %false.loc30_20 br !and.rhs else br !and.result(%false.loc30_26) // CHECK:STDOUT: // CHECK:STDOUT: !and.rhs: // CHECK:STDOUT: %x.ref: bool = name_ref x, %x // CHECK:STDOUT: br !and.result(%x.ref) // CHECK:STDOUT: // CHECK:STDOUT: !and.result: -// CHECK:STDOUT: %.loc30_19: bool = block_arg !and.result [concrete = constants.%false] -// CHECK:STDOUT: if %.loc30_19 br !if.expr.then else br !if.expr.else +// CHECK:STDOUT: %.loc30_26: bool = block_arg !and.result [concrete = constants.%false] +// CHECK:STDOUT: if %.loc30_26 br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: // CHECK:STDOUT: %Bool.call.loc30: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc30_30.1: type = value_of_initializer %Bool.call.loc30 [concrete = bool] -// CHECK:STDOUT: %.loc30_30.2: type = converted %Bool.call.loc30, %.loc30_30.1 [concrete = bool] -// CHECK:STDOUT: br !if.expr.result(%.loc30_30.2) +// CHECK:STDOUT: %.loc30_37.1: type = value_of_initializer %Bool.call.loc30 [concrete = bool] +// CHECK:STDOUT: %.loc30_37.2: type = converted %Bool.call.loc30, %.loc30_37.1 [concrete = bool] +// CHECK:STDOUT: br !if.expr.result(%.loc30_37.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %.loc30_41: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc30_35: type = converted %.loc30_41, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result(%.loc30_35) +// CHECK:STDOUT: %.loc30_48: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc30_42: type = converted %.loc30_48, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !if.expr.result(%.loc30_42) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result: -// CHECK:STDOUT: %.loc30_10: type = block_arg !if.expr.result [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !.loc30_7 +// CHECK:STDOUT: %.loc30_17: type = block_arg !if.expr.result [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !.loc30_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc30_7: +// CHECK:STDOUT: !.loc30_14: // CHECK:STDOUT: %a: ref %empty_tuple.type = ref_binding a, %a.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %a.var, constants.%DestroyOp.b0ebf8.1 // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%a.var) diff --git a/toolchain/check/testdata/operators/builtin/bit_and.carbon b/toolchain/check/testdata/operators/builtin/bit_and.carbon index ea0ec931bb18..2da170912792 100644 --- a/toolchain/check/testdata/operators/builtin/bit_and.carbon +++ b/toolchain/check/testdata/operators/builtin/bit_and.carbon @@ -16,8 +16,8 @@ library "[[@TEST_NAME]]"; interface I {} interface J {} -fn F1[T:! I & J](t: T) {} -fn F2[T:! I & I](t: T) {} +fn F1[T:! I & J](unused t: T) {} +fn F2[T:! I & I](unused t: T) {} // --- fail_bit_and_non_facet_types.carbon library "[[@TEST_NAME]]"; @@ -27,31 +27,31 @@ class J {} class K {} // CHECK:STDERR: fail_bit_and_non_facet_types.carbon:[[@LINE+4]]:11: error: non-facet type `J` combined with `&` operator [FacetTypeRequiredForTypeAndOperator] -// CHECK:STDERR: fn F1[T:! I & J](t: T) {} +// CHECK:STDERR: fn F1[T:! I & J](unused t: T) {} // CHECK:STDERR: ^~~~~ // CHECK:STDERR: -fn F1[T:! I & J](t: T) {} +fn F1[T:! I & J](unused t: T) {} // CHECK:STDERR: fail_bit_and_non_facet_types.carbon:[[@LINE+4]]:11: error: non-facet type `J` combined with `&` operator [FacetTypeRequiredForTypeAndOperator] -// CHECK:STDERR: fn F2[T:! J & I](t: T) {} +// CHECK:STDERR: fn F2[T:! J & I](unused t: T) {} // CHECK:STDERR: ^~~~~ // CHECK:STDERR: -fn F2[T:! J & I](t: T) {} +fn F2[T:! J & I](unused t: T) {} // CHECK:STDERR: fail_bit_and_non_facet_types.carbon:[[@LINE+8]]:11: error: non-facet type `J` combined with `&` operator [FacetTypeRequiredForTypeAndOperator] -// CHECK:STDERR: fn F3[T:! J & K](t: T) {} +// CHECK:STDERR: fn F3[T:! J & K](unused t: T) {} // CHECK:STDERR: ^~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_bit_and_non_facet_types.carbon:[[@LINE+4]]:11: error: non-facet type `K` combined with `&` operator [FacetTypeRequiredForTypeAndOperator] -// CHECK:STDERR: fn F3[T:! J & K](t: T) {} +// CHECK:STDERR: fn F3[T:! J & K](unused t: T) {} // CHECK:STDERR: ^~~~~ // CHECK:STDERR: -fn F3[T:! J & K](t: T) {} +fn F3[T:! J & K](unused t: T) {} // --- bit_and_values_with_impl.carbon library "[[@TEST_NAME]]"; class J { adapt {}; } impl J as Core.BitAndWith(J) where .Result = J { - fn Op[self: Self](other: Self) -> Self { return {} as J; } + fn Op[unused self: Self](unused other: Self) -> Self { return {} as J; } } fn F() { diff --git a/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon b/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon index 2c0d07bbbdd8..1bd4aa478955 100644 --- a/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon @@ -17,16 +17,16 @@ package FailNonConstantResult; fn PartialConstant(x: bool) { - // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] - // CHECK:STDERR: var a: if true and x then bool else (); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:17: error: cannot evaluate type expression [TypeExprEvaluationFailure] + // CHECK:STDERR: var unused a: if true and x then bool else (); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var a: if true and x then bool else (); - // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] - // CHECK:STDERR: var b: if false or x then bool else (); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var unused a: if true and x then bool else (); + // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:17: error: cannot evaluate type expression [TypeExprEvaluationFailure] + // CHECK:STDERR: var unused b: if false or x then bool else (); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var b: if false or x then bool else (); + var unused b: if false or x then bool else (); } // --- fail_despite_known_result.carbon @@ -36,16 +36,16 @@ package FailDespiteKnownResult; fn KnownValueButNonConstantCondition(x: bool) { // We choose not to give these cases constant values, even though we could, // because they notionally involve evaluating a non-constant condition. - // CHECK:STDERR: fail_despite_known_result.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] - // CHECK:STDERR: var c: if x and false then bool else (); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_despite_known_result.carbon:[[@LINE+4]]:17: error: cannot evaluate type expression [TypeExprEvaluationFailure] + // CHECK:STDERR: var unused c: if x and false then bool else (); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var c: if x and false then bool else (); - // CHECK:STDERR: fail_despite_known_result.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] - // CHECK:STDERR: var d: if x or true then bool else (); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var unused c: if x and false then bool else (); + // CHECK:STDERR: fail_despite_known_result.carbon:[[@LINE+4]]:17: error: cannot evaluate type expression [TypeExprEvaluationFailure] + // CHECK:STDERR: var unused d: if x or true then bool else (); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - var d: if x or true then bool else (); + var unused d: if x or true then bool else (); } // CHECK:STDOUT: --- fail_non_constant_result.carbon @@ -101,9 +101,9 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: %a.var_patt: = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref = var %a.var_patt [concrete = ] -// CHECK:STDOUT: br !.loc9_13 +// CHECK:STDOUT: br !.loc9_20 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc9_13: +// CHECK:STDOUT: !.loc9_20: // CHECK:STDOUT: %true.loc9: bool = bool_literal true [concrete = constants.%true] // CHECK:STDOUT: %false.loc9: bool = bool_literal false [concrete = constants.%false] // CHECK:STDOUT: if %true.loc9 br !and.rhs else br !and.result(%false.loc9) @@ -113,63 +113,63 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: br !and.result(%x.ref.loc9) // CHECK:STDOUT: // CHECK:STDOUT: !and.result: -// CHECK:STDOUT: %.loc9_18: bool = block_arg !and.result -// CHECK:STDOUT: if %.loc9_18 br !if.expr.then.loc9 else br !if.expr.else.loc9 +// CHECK:STDOUT: %.loc9_25: bool = block_arg !and.result +// CHECK:STDOUT: if %.loc9_25 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: // CHECK:STDOUT: %Bool.call.loc9: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc9_29.1: type = value_of_initializer %Bool.call.loc9 [concrete = bool] -// CHECK:STDOUT: %.loc9_29.2: type = converted %Bool.call.loc9, %.loc9_29.1 [concrete = bool] -// CHECK:STDOUT: br !if.expr.result.loc9(%.loc9_29.2) +// CHECK:STDOUT: %.loc9_36.1: type = value_of_initializer %Bool.call.loc9 [concrete = bool] +// CHECK:STDOUT: %.loc9_36.2: type = converted %Bool.call.loc9, %.loc9_36.1 [concrete = bool] +// CHECK:STDOUT: br !if.expr.result.loc9(%.loc9_36.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc9: -// CHECK:STDOUT: %.loc9_40: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc9_34: type = converted %.loc9_40, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc9(%.loc9_34) +// CHECK:STDOUT: %.loc9_47: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_41: type = converted %.loc9_47, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !if.expr.result.loc9(%.loc9_41) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc9: -// CHECK:STDOUT: %.loc9_10: type = block_arg !if.expr.result.loc9 -// CHECK:STDOUT: br !.loc9_7 +// CHECK:STDOUT: %.loc9_17: type = block_arg !if.expr.result.loc9 +// CHECK:STDOUT: br !.loc9_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc9_7: +// CHECK:STDOUT: !.loc9_14: // CHECK:STDOUT: %a: ref = ref_binding a, [concrete = ] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: = ref_binding_pattern b [concrete] // CHECK:STDOUT: %b.var_patt: = var_pattern %b.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref = var %b.var_patt [concrete = ] -// CHECK:STDOUT: br !.loc14_13 +// CHECK:STDOUT: br !.loc14_20 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc14_13: +// CHECK:STDOUT: !.loc14_20: // CHECK:STDOUT: %false.loc14: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: %.loc14_19.1: bool = not %false.loc14 [concrete = constants.%true] +// CHECK:STDOUT: %.loc14_26.1: bool = not %false.loc14 [concrete = constants.%true] // CHECK:STDOUT: %true.loc14: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: if %.loc14_19.1 br !or.rhs else br !or.result(%true.loc14) +// CHECK:STDOUT: if %.loc14_26.1 br !or.rhs else br !or.result(%true.loc14) // CHECK:STDOUT: // CHECK:STDOUT: !or.rhs: // CHECK:STDOUT: %x.ref.loc14: bool = name_ref x, %x // CHECK:STDOUT: br !or.result(%x.ref.loc14) // CHECK:STDOUT: // CHECK:STDOUT: !or.result: -// CHECK:STDOUT: %.loc14_19.2: bool = block_arg !or.result -// CHECK:STDOUT: if %.loc14_19.2 br !if.expr.then.loc14 else br !if.expr.else.loc14 +// CHECK:STDOUT: %.loc14_26.2: bool = block_arg !or.result +// CHECK:STDOUT: if %.loc14_26.2 br !if.expr.then.loc14 else br !if.expr.else.loc14 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc14: // CHECK:STDOUT: %Bool.call.loc14: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc14_29.1: type = value_of_initializer %Bool.call.loc14 [concrete = bool] -// CHECK:STDOUT: %.loc14_29.2: type = converted %Bool.call.loc14, %.loc14_29.1 [concrete = bool] -// CHECK:STDOUT: br !if.expr.result.loc14(%.loc14_29.2) +// CHECK:STDOUT: %.loc14_36.1: type = value_of_initializer %Bool.call.loc14 [concrete = bool] +// CHECK:STDOUT: %.loc14_36.2: type = converted %Bool.call.loc14, %.loc14_36.1 [concrete = bool] +// CHECK:STDOUT: br !if.expr.result.loc14(%.loc14_36.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc14: -// CHECK:STDOUT: %.loc14_40: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc14_34: type = converted %.loc14_40, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc14(%.loc14_34) +// CHECK:STDOUT: %.loc14_47: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc14_41: type = converted %.loc14_47, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !if.expr.result.loc14(%.loc14_41) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc14: -// CHECK:STDOUT: %.loc14_10: type = block_arg !if.expr.result.loc14 -// CHECK:STDOUT: br !.loc14_7 +// CHECK:STDOUT: %.loc14_17: type = block_arg !if.expr.result.loc14 +// CHECK:STDOUT: br !.loc14_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc14_7: +// CHECK:STDOUT: !.loc14_14: // CHECK:STDOUT: %b: ref = ref_binding b, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -227,75 +227,75 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: %c.var_patt: = var_pattern %c.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c.var: ref = var %c.var_patt [concrete = ] -// CHECK:STDOUT: br !.loc11_13 +// CHECK:STDOUT: br !.loc11_20 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc11_13: +// CHECK:STDOUT: !.loc11_20: // CHECK:STDOUT: %x.ref.loc11: bool = name_ref x, %x -// CHECK:STDOUT: %false.loc11_15: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: if %x.ref.loc11 br !and.rhs else br !and.result(%false.loc11_15) +// CHECK:STDOUT: %false.loc11_22: bool = bool_literal false [concrete = constants.%false] +// CHECK:STDOUT: if %x.ref.loc11 br !and.rhs else br !and.result(%false.loc11_22) // CHECK:STDOUT: // CHECK:STDOUT: !and.rhs: -// CHECK:STDOUT: %false.loc11_19: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: br !and.result(%false.loc11_19) +// CHECK:STDOUT: %false.loc11_26: bool = bool_literal false [concrete = constants.%false] +// CHECK:STDOUT: br !and.result(%false.loc11_26) // CHECK:STDOUT: // CHECK:STDOUT: !and.result: -// CHECK:STDOUT: %.loc11_15: bool = block_arg !and.result -// CHECK:STDOUT: if %.loc11_15 br !if.expr.then.loc11 else br !if.expr.else.loc11 +// CHECK:STDOUT: %.loc11_22: bool = block_arg !and.result +// CHECK:STDOUT: if %.loc11_22 br !if.expr.then.loc11 else br !if.expr.else.loc11 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc11: // CHECK:STDOUT: %Bool.call.loc11: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc11_30.1: type = value_of_initializer %Bool.call.loc11 [concrete = bool] -// CHECK:STDOUT: %.loc11_30.2: type = converted %Bool.call.loc11, %.loc11_30.1 [concrete = bool] -// CHECK:STDOUT: br !if.expr.result.loc11(%.loc11_30.2) +// CHECK:STDOUT: %.loc11_37.1: type = value_of_initializer %Bool.call.loc11 [concrete = bool] +// CHECK:STDOUT: %.loc11_37.2: type = converted %Bool.call.loc11, %.loc11_37.1 [concrete = bool] +// CHECK:STDOUT: br !if.expr.result.loc11(%.loc11_37.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc11: -// CHECK:STDOUT: %.loc11_41: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc11_35: type = converted %.loc11_41, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc11(%.loc11_35) +// CHECK:STDOUT: %.loc11_48: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc11_42: type = converted %.loc11_48, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !if.expr.result.loc11(%.loc11_42) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc11: -// CHECK:STDOUT: %.loc11_10: type = block_arg !if.expr.result.loc11 -// CHECK:STDOUT: br !.loc11_7 +// CHECK:STDOUT: %.loc11_17: type = block_arg !if.expr.result.loc11 +// CHECK:STDOUT: br !.loc11_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc11_7: +// CHECK:STDOUT: !.loc11_14: // CHECK:STDOUT: %c: ref = ref_binding c, [concrete = ] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %d.patt: = ref_binding_pattern d [concrete] // CHECK:STDOUT: %d.var_patt: = var_pattern %d.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %d.var: ref = var %d.var_patt [concrete = ] -// CHECK:STDOUT: br !.loc16_13 +// CHECK:STDOUT: br !.loc16_20 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc16_13: +// CHECK:STDOUT: !.loc16_20: // CHECK:STDOUT: %x.ref.loc16: bool = name_ref x, %x -// CHECK:STDOUT: %.loc16_15.1: bool = not %x.ref.loc16 -// CHECK:STDOUT: %true.loc16_15: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: if %.loc16_15.1 br !or.rhs else br !or.result(%true.loc16_15) +// CHECK:STDOUT: %.loc16_22.1: bool = not %x.ref.loc16 +// CHECK:STDOUT: %true.loc16_22: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: if %.loc16_22.1 br !or.rhs else br !or.result(%true.loc16_22) // CHECK:STDOUT: // CHECK:STDOUT: !or.rhs: -// CHECK:STDOUT: %true.loc16_18: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: br !or.result(%true.loc16_18) +// CHECK:STDOUT: %true.loc16_25: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: br !or.result(%true.loc16_25) // CHECK:STDOUT: // CHECK:STDOUT: !or.result: -// CHECK:STDOUT: %.loc16_15.2: bool = block_arg !or.result -// CHECK:STDOUT: if %.loc16_15.2 br !if.expr.then.loc16 else br !if.expr.else.loc16 +// CHECK:STDOUT: %.loc16_22.2: bool = block_arg !or.result +// CHECK:STDOUT: if %.loc16_22.2 br !if.expr.then.loc16 else br !if.expr.else.loc16 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc16: // CHECK:STDOUT: %Bool.call.loc16: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc16_28.1: type = value_of_initializer %Bool.call.loc16 [concrete = bool] -// CHECK:STDOUT: %.loc16_28.2: type = converted %Bool.call.loc16, %.loc16_28.1 [concrete = bool] -// CHECK:STDOUT: br !if.expr.result.loc16(%.loc16_28.2) +// CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %Bool.call.loc16 [concrete = bool] +// CHECK:STDOUT: %.loc16_35.2: type = converted %Bool.call.loc16, %.loc16_35.1 [concrete = bool] +// CHECK:STDOUT: br !if.expr.result.loc16(%.loc16_35.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc16: -// CHECK:STDOUT: %.loc16_39: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc16_33: type = converted %.loc16_39, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc16(%.loc16_33) +// CHECK:STDOUT: %.loc16_46: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc16_40: type = converted %.loc16_46, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !if.expr.result.loc16(%.loc16_40) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc16: -// CHECK:STDOUT: %.loc16_10: type = block_arg !if.expr.result.loc16 -// CHECK:STDOUT: br !.loc16_7 +// CHECK:STDOUT: %.loc16_17: type = block_arg !if.expr.result.loc16 +// CHECK:STDOUT: br !.loc16_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc16_7: +// CHECK:STDOUT: !.loc16_14: // CHECK:STDOUT: %d: ref = ref_binding d, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon index 24933ddfc9e7..f001e31448d1 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon @@ -13,14 +13,14 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon fn Main() { - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:17: error: cannot implicitly convert expression of type `Core.IntLiteral` to `bool` [ConversionFailure] - // CHECK:STDERR: var x: bool = not 12; - // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:17: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: var x: bool = not 12; - // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:24: error: cannot implicitly convert expression of type `Core.IntLiteral` to `bool` [ConversionFailure] + // CHECK:STDERR: var unused x: bool = not 12; + // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:24: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: var unused x: bool = not 12; + // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: - var x: bool = not 12; + var unused x: bool = not 12; } // CHECK:STDOUT: --- fail_type_mismatch.carbon @@ -70,13 +70,13 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %x.var: ref bool = var %x.var_patt // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12] -// CHECK:STDOUT: %.loc23_17.1: bool = converted %int_12, [concrete = ] -// CHECK:STDOUT: %.loc23_17.2: = not [concrete = ] +// CHECK:STDOUT: %.loc23_24.1: bool = converted %int_12, [concrete = ] +// CHECK:STDOUT: %.loc23_24.2: = not [concrete = ] // CHECK:STDOUT: assign %x.var, -// CHECK:STDOUT: %.loc23_10.1: type = splice_block %.loc23_10.3 [concrete = bool] { +// CHECK:STDOUT: %.loc23_17.1: type = splice_block %.loc23_17.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc23_10.2: type = value_of_initializer %Bool.call [concrete = bool] -// CHECK:STDOUT: %.loc23_10.3: type = converted %Bool.call, %.loc23_10.2 [concrete = bool] +// CHECK:STDOUT: %.loc23_17.2: type = value_of_initializer %Bool.call [concrete = bool] +// CHECK:STDOUT: %.loc23_17.3: type = converted %Bool.call, %.loc23_17.2 [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: %x: ref bool = ref_binding x, %x.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %x.var, constants.%DestroyOp diff --git a/toolchain/check/testdata/operators/builtin/or.carbon b/toolchain/check/testdata/operators/builtin/or.carbon index 50e6a10827a5..ecc2d65989e1 100644 --- a/toolchain/check/testdata/operators/builtin/or.carbon +++ b/toolchain/check/testdata/operators/builtin/or.carbon @@ -20,14 +20,14 @@ fn Or() -> bool { } fn Constant() { - var a: if true or true then bool else () = true; - var b: if true or false then bool else () = true; - var c: if false or true then bool else () = true; - var d: if false or false then bool else () = (); + var unused a: if true or true then bool else () = true; + var unused b: if true or false then bool else () = true; + var unused c: if false or true then bool else () = true; + var unused d: if false or false then bool else () = (); } fn PartialConstant(x: bool) { - var a: if true or x then bool else () = true; + var unused a: if true or x then bool else () = true; } // CHECK:STDOUT: --- or.carbon @@ -190,171 +190,171 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %a.var_patt: %pattern_type.831 = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref bool = var %a.var_patt -// CHECK:STDOUT: %true.loc23_46: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: %true.loc23_53: bool = bool_literal true [concrete = constants.%true] // CHECK:STDOUT: %impl.elem0.loc23: %.86d = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op] -// CHECK:STDOUT: %bound_method.loc23: = bound_method %true.loc23_46, %impl.elem0.loc23 [concrete = constants.%bool.as.Copy.impl.Op.bound] -// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc23: init bool = call %bound_method.loc23(%true.loc23_46) [concrete = constants.%true] +// CHECK:STDOUT: %bound_method.loc23: = bound_method %true.loc23_53, %impl.elem0.loc23 [concrete = constants.%bool.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc23: init bool = call %bound_method.loc23(%true.loc23_53) [concrete = constants.%true] // CHECK:STDOUT: assign %a.var, %bool.as.Copy.impl.Op.call.loc23 -// CHECK:STDOUT: br !.loc23_13 +// CHECK:STDOUT: br !.loc23_20 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc23_13: -// CHECK:STDOUT: %true.loc23_13: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: %.loc23_18.1: bool = not %true.loc23_13 [concrete = constants.%false] -// CHECK:STDOUT: %true.loc23_18: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: if %.loc23_18.1 br !or.rhs.loc23 else br !or.result.loc23(%true.loc23_18) +// CHECK:STDOUT: !.loc23_20: +// CHECK:STDOUT: %true.loc23_20: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: %.loc23_25.1: bool = not %true.loc23_20 [concrete = constants.%false] +// CHECK:STDOUT: %true.loc23_25: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: if %.loc23_25.1 br !or.rhs.loc23 else br !or.result.loc23(%true.loc23_25) // CHECK:STDOUT: // CHECK:STDOUT: !or.rhs.loc23: -// CHECK:STDOUT: %true.loc23_21: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: br !or.result.loc23(%true.loc23_21) +// CHECK:STDOUT: %true.loc23_28: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: br !or.result.loc23(%true.loc23_28) // CHECK:STDOUT: // CHECK:STDOUT: !or.result.loc23: -// CHECK:STDOUT: %.loc23_18.2: bool = block_arg !or.result.loc23 [concrete = constants.%true] -// CHECK:STDOUT: if %.loc23_18.2 br !if.expr.then.loc23 else br !if.expr.else.loc23 +// CHECK:STDOUT: %.loc23_25.2: bool = block_arg !or.result.loc23 [concrete = constants.%true] +// CHECK:STDOUT: if %.loc23_25.2 br !if.expr.then.loc23 else br !if.expr.else.loc23 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc23: // CHECK:STDOUT: %Bool.call.loc23: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc23_31.1: type = value_of_initializer %Bool.call.loc23 [concrete = bool] -// CHECK:STDOUT: %.loc23_31.2: type = converted %Bool.call.loc23, %.loc23_31.1 [concrete = bool] -// CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_31.2) +// CHECK:STDOUT: %.loc23_38.1: type = value_of_initializer %Bool.call.loc23 [concrete = bool] +// CHECK:STDOUT: %.loc23_38.2: type = converted %Bool.call.loc23, %.loc23_38.1 [concrete = bool] +// CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_38.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc23: -// CHECK:STDOUT: %.loc23_42: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc23_36: type = converted %.loc23_42, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_36) +// CHECK:STDOUT: %.loc23_49: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc23_43: type = converted %.loc23_49, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_43) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc23: -// CHECK:STDOUT: %.loc23_10: type = block_arg !if.expr.result.loc23 [concrete = bool] -// CHECK:STDOUT: br !.loc23_7 +// CHECK:STDOUT: %.loc23_17: type = block_arg !if.expr.result.loc23 [concrete = bool] +// CHECK:STDOUT: br !.loc23_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc23_7: +// CHECK:STDOUT: !.loc23_14: // CHECK:STDOUT: %a: ref bool = ref_binding a, %a.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.831 = ref_binding_pattern b [concrete] // CHECK:STDOUT: %b.var_patt: %pattern_type.831 = var_pattern %b.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref bool = var %b.var_patt -// CHECK:STDOUT: %true.loc24_47: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: %true.loc24_54: bool = bool_literal true [concrete = constants.%true] // CHECK:STDOUT: %impl.elem0.loc24: %.86d = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op] -// CHECK:STDOUT: %bound_method.loc24: = bound_method %true.loc24_47, %impl.elem0.loc24 [concrete = constants.%bool.as.Copy.impl.Op.bound] -// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc24: init bool = call %bound_method.loc24(%true.loc24_47) [concrete = constants.%true] +// CHECK:STDOUT: %bound_method.loc24: = bound_method %true.loc24_54, %impl.elem0.loc24 [concrete = constants.%bool.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc24: init bool = call %bound_method.loc24(%true.loc24_54) [concrete = constants.%true] // CHECK:STDOUT: assign %b.var, %bool.as.Copy.impl.Op.call.loc24 -// CHECK:STDOUT: br !.loc24_13 +// CHECK:STDOUT: br !.loc24_20 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc24_13: -// CHECK:STDOUT: %true.loc24_13: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: %.loc24_18.1: bool = not %true.loc24_13 [concrete = constants.%false] -// CHECK:STDOUT: %true.loc24_18: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: if %.loc24_18.1 br !or.rhs.loc24 else br !or.result.loc24(%true.loc24_18) +// CHECK:STDOUT: !.loc24_20: +// CHECK:STDOUT: %true.loc24_20: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: %.loc24_25.1: bool = not %true.loc24_20 [concrete = constants.%false] +// CHECK:STDOUT: %true.loc24_25: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: if %.loc24_25.1 br !or.rhs.loc24 else br !or.result.loc24(%true.loc24_25) // CHECK:STDOUT: // CHECK:STDOUT: !or.rhs.loc24: // CHECK:STDOUT: %false.loc24: bool = bool_literal false [concrete = constants.%false] // CHECK:STDOUT: br !or.result.loc24(%false.loc24) // CHECK:STDOUT: // CHECK:STDOUT: !or.result.loc24: -// CHECK:STDOUT: %.loc24_18.2: bool = block_arg !or.result.loc24 [concrete = constants.%true] -// CHECK:STDOUT: if %.loc24_18.2 br !if.expr.then.loc24 else br !if.expr.else.loc24 +// CHECK:STDOUT: %.loc24_25.2: bool = block_arg !or.result.loc24 [concrete = constants.%true] +// CHECK:STDOUT: if %.loc24_25.2 br !if.expr.then.loc24 else br !if.expr.else.loc24 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc24: // CHECK:STDOUT: %Bool.call.loc24: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc24_32.1: type = value_of_initializer %Bool.call.loc24 [concrete = bool] -// CHECK:STDOUT: %.loc24_32.2: type = converted %Bool.call.loc24, %.loc24_32.1 [concrete = bool] -// CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_32.2) +// CHECK:STDOUT: %.loc24_39.1: type = value_of_initializer %Bool.call.loc24 [concrete = bool] +// CHECK:STDOUT: %.loc24_39.2: type = converted %Bool.call.loc24, %.loc24_39.1 [concrete = bool] +// CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_39.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc24: -// CHECK:STDOUT: %.loc24_43: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc24_37: type = converted %.loc24_43, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_37) +// CHECK:STDOUT: %.loc24_50: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc24_44: type = converted %.loc24_50, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_44) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc24: -// CHECK:STDOUT: %.loc24_10: type = block_arg !if.expr.result.loc24 [concrete = bool] -// CHECK:STDOUT: br !.loc24_7 +// CHECK:STDOUT: %.loc24_17: type = block_arg !if.expr.result.loc24 [concrete = bool] +// CHECK:STDOUT: br !.loc24_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc24_7: +// CHECK:STDOUT: !.loc24_14: // CHECK:STDOUT: %b: ref bool = ref_binding b, %b.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c.patt: %pattern_type.831 = ref_binding_pattern c [concrete] // CHECK:STDOUT: %c.var_patt: %pattern_type.831 = var_pattern %c.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %c.var: ref bool = var %c.var_patt -// CHECK:STDOUT: %true.loc25_47: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: %true.loc25_54: bool = bool_literal true [concrete = constants.%true] // CHECK:STDOUT: %impl.elem0.loc25: %.86d = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op] -// CHECK:STDOUT: %bound_method.loc25: = bound_method %true.loc25_47, %impl.elem0.loc25 [concrete = constants.%bool.as.Copy.impl.Op.bound] -// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc25: init bool = call %bound_method.loc25(%true.loc25_47) [concrete = constants.%true] +// CHECK:STDOUT: %bound_method.loc25: = bound_method %true.loc25_54, %impl.elem0.loc25 [concrete = constants.%bool.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc25: init bool = call %bound_method.loc25(%true.loc25_54) [concrete = constants.%true] // CHECK:STDOUT: assign %c.var, %bool.as.Copy.impl.Op.call.loc25 -// CHECK:STDOUT: br !.loc25_13 +// CHECK:STDOUT: br !.loc25_20 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc25_13: +// CHECK:STDOUT: !.loc25_20: // CHECK:STDOUT: %false.loc25: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: %.loc25_19.1: bool = not %false.loc25 [concrete = constants.%true] -// CHECK:STDOUT: %true.loc25_19: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: if %.loc25_19.1 br !or.rhs.loc25 else br !or.result.loc25(%true.loc25_19) +// CHECK:STDOUT: %.loc25_26.1: bool = not %false.loc25 [concrete = constants.%true] +// CHECK:STDOUT: %true.loc25_26: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: if %.loc25_26.1 br !or.rhs.loc25 else br !or.result.loc25(%true.loc25_26) // CHECK:STDOUT: // CHECK:STDOUT: !or.rhs.loc25: -// CHECK:STDOUT: %true.loc25_22: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: br !or.result.loc25(%true.loc25_22) +// CHECK:STDOUT: %true.loc25_29: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: br !or.result.loc25(%true.loc25_29) // CHECK:STDOUT: // CHECK:STDOUT: !or.result.loc25: -// CHECK:STDOUT: %.loc25_19.2: bool = block_arg !or.result.loc25 [concrete = constants.%true] -// CHECK:STDOUT: if %.loc25_19.2 br !if.expr.then.loc25 else br !if.expr.else.loc25 +// CHECK:STDOUT: %.loc25_26.2: bool = block_arg !or.result.loc25 [concrete = constants.%true] +// CHECK:STDOUT: if %.loc25_26.2 br !if.expr.then.loc25 else br !if.expr.else.loc25 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc25: // CHECK:STDOUT: %Bool.call.loc25: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc25_32.1: type = value_of_initializer %Bool.call.loc25 [concrete = bool] -// CHECK:STDOUT: %.loc25_32.2: type = converted %Bool.call.loc25, %.loc25_32.1 [concrete = bool] -// CHECK:STDOUT: br !if.expr.result.loc25(%.loc25_32.2) +// CHECK:STDOUT: %.loc25_39.1: type = value_of_initializer %Bool.call.loc25 [concrete = bool] +// CHECK:STDOUT: %.loc25_39.2: type = converted %Bool.call.loc25, %.loc25_39.1 [concrete = bool] +// CHECK:STDOUT: br !if.expr.result.loc25(%.loc25_39.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc25: -// CHECK:STDOUT: %.loc25_43: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc25_37: type = converted %.loc25_43, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc25(%.loc25_37) +// CHECK:STDOUT: %.loc25_50: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc25_44: type = converted %.loc25_50, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !if.expr.result.loc25(%.loc25_44) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc25: -// CHECK:STDOUT: %.loc25_10: type = block_arg !if.expr.result.loc25 [concrete = bool] -// CHECK:STDOUT: br !.loc25_7 +// CHECK:STDOUT: %.loc25_17: type = block_arg !if.expr.result.loc25 [concrete = bool] +// CHECK:STDOUT: br !.loc25_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc25_7: +// CHECK:STDOUT: !.loc25_14: // CHECK:STDOUT: %c: ref bool = ref_binding c, %c.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %d.patt: %pattern_type.cb1 = ref_binding_pattern d [concrete] // CHECK:STDOUT: %d.var_patt: %pattern_type.cb1 = var_pattern %d.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %d.var: ref %empty_tuple.type = var %d.var_patt -// CHECK:STDOUT: %.loc26_49.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc26_49.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc26_3: init %empty_tuple.type = converted %.loc26_49.1, %.loc26_49.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc26_56.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc26_56.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc26_3: init %empty_tuple.type = converted %.loc26_56.1, %.loc26_56.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: assign %d.var, %.loc26_3 -// CHECK:STDOUT: br !.loc26_13 +// CHECK:STDOUT: br !.loc26_20 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc26_13: -// CHECK:STDOUT: %false.loc26_13: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: %.loc26_19.1: bool = not %false.loc26_13 [concrete = constants.%true] +// CHECK:STDOUT: !.loc26_20: +// CHECK:STDOUT: %false.loc26_20: bool = bool_literal false [concrete = constants.%false] +// CHECK:STDOUT: %.loc26_26.1: bool = not %false.loc26_20 [concrete = constants.%true] // CHECK:STDOUT: %true.loc26: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: if %.loc26_19.1 br !or.rhs.loc26 else br !or.result.loc26(%true.loc26) +// CHECK:STDOUT: if %.loc26_26.1 br !or.rhs.loc26 else br !or.result.loc26(%true.loc26) // CHECK:STDOUT: // CHECK:STDOUT: !or.rhs.loc26: -// CHECK:STDOUT: %false.loc26_22: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: br !or.result.loc26(%false.loc26_22) +// CHECK:STDOUT: %false.loc26_29: bool = bool_literal false [concrete = constants.%false] +// CHECK:STDOUT: br !or.result.loc26(%false.loc26_29) // CHECK:STDOUT: // CHECK:STDOUT: !or.result.loc26: -// CHECK:STDOUT: %.loc26_19.2: bool = block_arg !or.result.loc26 [concrete = constants.%false] -// CHECK:STDOUT: if %.loc26_19.2 br !if.expr.then.loc26 else br !if.expr.else.loc26 +// CHECK:STDOUT: %.loc26_26.2: bool = block_arg !or.result.loc26 [concrete = constants.%false] +// CHECK:STDOUT: if %.loc26_26.2 br !if.expr.then.loc26 else br !if.expr.else.loc26 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc26: // CHECK:STDOUT: %Bool.call.loc26: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc26_33.1: type = value_of_initializer %Bool.call.loc26 [concrete = bool] -// CHECK:STDOUT: %.loc26_33.2: type = converted %Bool.call.loc26, %.loc26_33.1 [concrete = bool] -// CHECK:STDOUT: br !if.expr.result.loc26(%.loc26_33.2) +// CHECK:STDOUT: %.loc26_40.1: type = value_of_initializer %Bool.call.loc26 [concrete = bool] +// CHECK:STDOUT: %.loc26_40.2: type = converted %Bool.call.loc26, %.loc26_40.1 [concrete = bool] +// CHECK:STDOUT: br !if.expr.result.loc26(%.loc26_40.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc26: -// CHECK:STDOUT: %.loc26_44: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc26_38: type = converted %.loc26_44, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc26(%.loc26_38) +// CHECK:STDOUT: %.loc26_51: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc26_45: type = converted %.loc26_51, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !if.expr.result.loc26(%.loc26_45) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc26: -// CHECK:STDOUT: %.loc26_10: type = block_arg !if.expr.result.loc26 [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !.loc26_7 +// CHECK:STDOUT: %.loc26_17: type = block_arg !if.expr.result.loc26 [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !.loc26_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc26_7: +// CHECK:STDOUT: !.loc26_14: // CHECK:STDOUT: %d: ref %empty_tuple.type = ref_binding d, %d.var // CHECK:STDOUT: %DestroyOp.bound.loc26: = bound_method %d.var, constants.%DestroyOp.b0ebf8.1 // CHECK:STDOUT: %DestroyOp.call.loc26: init %empty_tuple.type = call %DestroyOp.bound.loc26(%d.var) @@ -378,43 +378,43 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %a.var_patt: %pattern_type.831 = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref bool = var %a.var_patt -// CHECK:STDOUT: %true.loc30_43: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: %true.loc30_50: bool = bool_literal true [concrete = constants.%true] // CHECK:STDOUT: %impl.elem0: %.86d = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op] -// CHECK:STDOUT: %bound_method: = bound_method %true.loc30_43, %impl.elem0 [concrete = constants.%bool.as.Copy.impl.Op.bound] -// CHECK:STDOUT: %bool.as.Copy.impl.Op.call: init bool = call %bound_method(%true.loc30_43) [concrete = constants.%true] +// CHECK:STDOUT: %bound_method: = bound_method %true.loc30_50, %impl.elem0 [concrete = constants.%bool.as.Copy.impl.Op.bound] +// CHECK:STDOUT: %bool.as.Copy.impl.Op.call: init bool = call %bound_method(%true.loc30_50) [concrete = constants.%true] // CHECK:STDOUT: assign %a.var, %bool.as.Copy.impl.Op.call -// CHECK:STDOUT: br !.loc30_13 +// CHECK:STDOUT: br !.loc30_20 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc30_13: -// CHECK:STDOUT: %true.loc30_13: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: %.loc30_18.1: bool = not %true.loc30_13 [concrete = constants.%false] -// CHECK:STDOUT: %true.loc30_18: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: if %.loc30_18.1 br !or.rhs else br !or.result(%true.loc30_18) +// CHECK:STDOUT: !.loc30_20: +// CHECK:STDOUT: %true.loc30_20: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: %.loc30_25.1: bool = not %true.loc30_20 [concrete = constants.%false] +// CHECK:STDOUT: %true.loc30_25: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: if %.loc30_25.1 br !or.rhs else br !or.result(%true.loc30_25) // CHECK:STDOUT: // CHECK:STDOUT: !or.rhs: // CHECK:STDOUT: %x.ref: bool = name_ref x, %x // CHECK:STDOUT: br !or.result(%x.ref) // CHECK:STDOUT: // CHECK:STDOUT: !or.result: -// CHECK:STDOUT: %.loc30_18.2: bool = block_arg !or.result [concrete = constants.%true] -// CHECK:STDOUT: if %.loc30_18.2 br !if.expr.then else br !if.expr.else +// CHECK:STDOUT: %.loc30_25.2: bool = block_arg !or.result [concrete = constants.%true] +// CHECK:STDOUT: if %.loc30_25.2 br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: // CHECK:STDOUT: %Bool.call.loc30: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc30_28.1: type = value_of_initializer %Bool.call.loc30 [concrete = bool] -// CHECK:STDOUT: %.loc30_28.2: type = converted %Bool.call.loc30, %.loc30_28.1 [concrete = bool] -// CHECK:STDOUT: br !if.expr.result(%.loc30_28.2) +// CHECK:STDOUT: %.loc30_35.1: type = value_of_initializer %Bool.call.loc30 [concrete = bool] +// CHECK:STDOUT: %.loc30_35.2: type = converted %Bool.call.loc30, %.loc30_35.1 [concrete = bool] +// CHECK:STDOUT: br !if.expr.result(%.loc30_35.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %.loc30_39: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc30_33: type = converted %.loc30_39, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result(%.loc30_33) +// CHECK:STDOUT: %.loc30_46: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc30_40: type = converted %.loc30_46, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !if.expr.result(%.loc30_40) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result: -// CHECK:STDOUT: %.loc30_10: type = block_arg !if.expr.result [concrete = bool] -// CHECK:STDOUT: br !.loc30_7 +// CHECK:STDOUT: %.loc30_17: type = block_arg !if.expr.result [concrete = bool] +// CHECK:STDOUT: br !.loc30_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc30_7: +// CHECK:STDOUT: !.loc30_14: // CHECK:STDOUT: %a: ref bool = ref_binding a, %a.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %a.var, constants.%DestroyOp.b0ebf8.2 // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%a.var) diff --git a/toolchain/check/testdata/operators/builtin/ref.carbon b/toolchain/check/testdata/operators/builtin/ref.carbon index 035c44209de2..5bab78ecf80e 100644 --- a/toolchain/check/testdata/operators/builtin/ref.carbon +++ b/toolchain/check/testdata/operators/builtin/ref.carbon @@ -30,14 +30,14 @@ library "[[@TEST_NAME]]"; fn F() { var x: () = (); - // CHECK:STDERR: fail_ref_out_of_place.carbon:[[@LINE+4]]:15: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam] - // CHECK:STDERR: let y: () = ref x; - // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: fail_ref_out_of_place.carbon:[[@LINE+4]]:22: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam] + // CHECK:STDERR: let unused y: () = ref x; + // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - let y: () = ref x; - // CHECK:STDERR: fail_ref_out_of_place.carbon:[[@LINE+4]]:16: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam] - // CHECK:STDERR: let z: () = (ref x); - // CHECK:STDERR: ^~~~~ + let unused y: () = ref x; + // CHECK:STDERR: fail_ref_out_of_place.carbon:[[@LINE+4]]:23: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam] + // CHECK:STDERR: let unused z: () = (ref x); + // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - let z: () = (ref x); + let unused z: () = (ref x); } diff --git a/toolchain/check/testdata/operators/builtin/unary_op.carbon b/toolchain/check/testdata/operators/builtin/unary_op.carbon index 49fc41463cc5..7c7aab148d83 100644 --- a/toolchain/check/testdata/operators/builtin/unary_op.carbon +++ b/toolchain/check/testdata/operators/builtin/unary_op.carbon @@ -20,8 +20,8 @@ let not_true: bool = not true; let not_false: bool = not false; fn Constant() { - var a: if not true then bool else () = (); - var b: if not false then bool else () = true; + var unused a: if not true then bool else () = (); + var unused b: if not false then bool else () = true; } // CHECK:STDOUT: --- unary_op.carbon @@ -137,33 +137,33 @@ fn Constant() { // CHECK:STDOUT: %a.var_patt: %pattern_type.cb1 = var_pattern %a.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var %a.var_patt -// CHECK:STDOUT: %.loc23_43.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc23_43.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc23_3: init %empty_tuple.type = converted %.loc23_43.1, %.loc23_43.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc23_50.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc23_50.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc23_3: init %empty_tuple.type = converted %.loc23_50.1, %.loc23_50.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: assign %a.var, %.loc23_3 -// CHECK:STDOUT: br !.loc23_17 +// CHECK:STDOUT: br !.loc23_24 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc23_17: +// CHECK:STDOUT: !.loc23_24: // CHECK:STDOUT: %true.loc23: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: %.loc23_13: bool = not %true.loc23 [concrete = constants.%false] -// CHECK:STDOUT: if %.loc23_13 br !if.expr.then.loc23 else br !if.expr.else.loc23 +// CHECK:STDOUT: %.loc23_20: bool = not %true.loc23 [concrete = constants.%false] +// CHECK:STDOUT: if %.loc23_20 br !if.expr.then.loc23 else br !if.expr.else.loc23 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc23: // CHECK:STDOUT: %Bool.call.loc23: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc23_27.1: type = value_of_initializer %Bool.call.loc23 [concrete = bool] -// CHECK:STDOUT: %.loc23_27.2: type = converted %Bool.call.loc23, %.loc23_27.1 [concrete = bool] -// CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_27.2) +// CHECK:STDOUT: %.loc23_34.1: type = value_of_initializer %Bool.call.loc23 [concrete = bool] +// CHECK:STDOUT: %.loc23_34.2: type = converted %Bool.call.loc23, %.loc23_34.1 [concrete = bool] +// CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_34.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc23: -// CHECK:STDOUT: %.loc23_38: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc23_32: type = converted %.loc23_38, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_32) +// CHECK:STDOUT: %.loc23_45: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc23_39: type = converted %.loc23_45, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_39) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc23: -// CHECK:STDOUT: %.loc23_10: type = block_arg !if.expr.result.loc23 [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !.loc23_7 +// CHECK:STDOUT: %.loc23_17: type = block_arg !if.expr.result.loc23 [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !.loc23_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc23_7: +// CHECK:STDOUT: !.loc23_14: // CHECK:STDOUT: %a: ref %empty_tuple.type = ref_binding a, %a.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.831 = ref_binding_pattern b [concrete] @@ -175,29 +175,29 @@ fn Constant() { // CHECK:STDOUT: %bound_method: = bound_method %true.loc24, %impl.elem0 [concrete = constants.%bool.as.Copy.impl.Op.bound] // CHECK:STDOUT: %bool.as.Copy.impl.Op.call: init bool = call %bound_method(%true.loc24) [concrete = constants.%true] // CHECK:STDOUT: assign %b.var, %bool.as.Copy.impl.Op.call -// CHECK:STDOUT: br !.loc24_17 +// CHECK:STDOUT: br !.loc24_24 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc24_17: +// CHECK:STDOUT: !.loc24_24: // CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: %.loc24_13: bool = not %false [concrete = constants.%true] -// CHECK:STDOUT: if %.loc24_13 br !if.expr.then.loc24 else br !if.expr.else.loc24 +// CHECK:STDOUT: %.loc24_20: bool = not %false [concrete = constants.%true] +// CHECK:STDOUT: if %.loc24_20 br !if.expr.then.loc24 else br !if.expr.else.loc24 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc24: // CHECK:STDOUT: %Bool.call.loc24: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc24_28.1: type = value_of_initializer %Bool.call.loc24 [concrete = bool] -// CHECK:STDOUT: %.loc24_28.2: type = converted %Bool.call.loc24, %.loc24_28.1 [concrete = bool] -// CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_28.2) +// CHECK:STDOUT: %.loc24_35.1: type = value_of_initializer %Bool.call.loc24 [concrete = bool] +// CHECK:STDOUT: %.loc24_35.2: type = converted %Bool.call.loc24, %.loc24_35.1 [concrete = bool] +// CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_35.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc24: -// CHECK:STDOUT: %.loc24_39: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc24_33: type = converted %.loc24_39, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_33) +// CHECK:STDOUT: %.loc24_46: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc24_40: type = converted %.loc24_46, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_40) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc24: -// CHECK:STDOUT: %.loc24_10: type = block_arg !if.expr.result.loc24 [concrete = bool] -// CHECK:STDOUT: br !.loc24_7 +// CHECK:STDOUT: %.loc24_17: type = block_arg !if.expr.result.loc24 [concrete = bool] +// CHECK:STDOUT: br !.loc24_14 // CHECK:STDOUT: -// CHECK:STDOUT: !.loc24_7: +// CHECK:STDOUT: !.loc24_14: // CHECK:STDOUT: %b: ref bool = ref_binding b, %b.var // CHECK:STDOUT: %DestroyOp.bound.loc24: = bound_method %b.var, constants.%DestroyOp.b0ebf8.1 // CHECK:STDOUT: %DestroyOp.call.loc24: init %empty_tuple.type = call %DestroyOp.bound.loc24(%b.var) diff --git a/toolchain/check/testdata/operators/overloaded/add.carbon b/toolchain/check/testdata/operators/overloaded/add.carbon index d429887fa699..70fef5360d7b 100644 --- a/toolchain/check/testdata/operators/overloaded/add.carbon +++ b/toolchain/check/testdata/operators/overloaded/add.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.AddWith(C) where .Result = C { - fn Op[self: C](other: C) -> C { + fn Op[unused self: C](unused other: C) -> C { return {}; } } impl C as Core.AddAssignWith(C) { - fn Op[ref self: C](other: C) {} + fn Op[unused ref self: C](unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/binary_op.carbon.tmpl b/toolchain/check/testdata/operators/overloaded/binary_op.carbon.tmpl index 29d5ff243ab1..15da0f9ee409 100644 --- a/toolchain/check/testdata/operators/overloaded/binary_op.carbon.tmpl +++ b/toolchain/check/testdata/operators/overloaded/binary_op.carbon.tmpl @@ -15,12 +15,12 @@ package User; class C {}; impl C as Core.INTERFACEWith(C) where .Result = C { - fn Op[self: C](other: C) -> C { + fn Op[unused self: C](unused other: C) -> C { return {}; } } impl C as Core.INTERFACEAssignWith(C) { - fn Op[ref self: C](other: C) {} + fn Op[unused ref self: C](unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/bit_and.carbon b/toolchain/check/testdata/operators/overloaded/bit_and.carbon index b6563f477edb..cd1a6cb763ea 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_and.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_and.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.BitAndWith(C) where .Result = C { - fn Op[self: C](other: C) -> C { + fn Op[unused self: C](unused other: C) -> C { return {}; } } impl C as Core.BitAndAssignWith(C) { - fn Op[ref self: C](other: C) {} + fn Op[unused ref self: C](unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon index dfea7e5f4bea..bc7422959c97 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon @@ -19,7 +19,7 @@ package User; class C {}; impl C as Core.BitComplement where .Result = C { - fn Op[self: C]() -> C { + fn Op[unused self: C]() -> C { return {}; } } diff --git a/toolchain/check/testdata/operators/overloaded/bit_or.carbon b/toolchain/check/testdata/operators/overloaded/bit_or.carbon index 760b6f245878..ea774e7813e4 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_or.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_or.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.BitOrWith(C) where .Result = C { - fn Op[self: C](other: C) -> C { + fn Op[unused self: C](unused other: C) -> C { return {}; } } impl C as Core.BitOrAssignWith(C) { - fn Op[ref self: C](other: C) {} + fn Op[unused ref self: C](unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon index 5f9c521f0f32..98dba52fb63f 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.BitXorWith(C) where .Result = C { - fn Op[self: C](other: C) -> C { + fn Op[unused self: C](unused other: C) -> C { return {}; } } impl C as Core.BitXorAssignWith(C) { - fn Op[ref self: C](other: C) {} + fn Op[unused ref self: C](unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/div.carbon b/toolchain/check/testdata/operators/overloaded/div.carbon index faa8bc664600..5d0653355bd7 100644 --- a/toolchain/check/testdata/operators/overloaded/div.carbon +++ b/toolchain/check/testdata/operators/overloaded/div.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.DivWith(C) where .Result = C { - fn Op[self: C](other: C) -> C { + fn Op[unused self: C](unused other: C) -> C { return {}; } } impl C as Core.DivAssignWith(C) { - fn Op[ref self: C](other: C) {} + fn Op[unused ref self: C](unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon index cac8f5785349..13ba72f352fb 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon @@ -16,10 +16,10 @@ class C {}; class D {}; impl C as Core.AddWith(C) where .Result = C { - fn Op[self: C](other: C) -> C { return {}; } + fn Op[unused self: C](unused other: C) -> C { return {}; } } impl C as Core.AddAssignWith(C) { - fn Op[ref self: C](other: C) {} + fn Op[unused ref self: C](unused other: C) {} } fn Test(a: C, b: D, z: bool) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index 4b018eb7032a..aa7233a4882f 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -58,7 +58,7 @@ import Core library "core_wrong_arg_count"; class C {} impl C as Core.IndexWith((), ()) { - fn At[self: Self](subscript: ()) -> () { + fn At[unused self: Self](unused subscript: ()) -> () { return (); } } @@ -415,16 +415,16 @@ fn F() { // CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc9_40.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc9_40.2: type = converted %.loc9_40.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc9_40.3: Core.Form = init_form %.loc9_40.2, call_param2 [concrete = constants.%.067] +// CHECK:STDOUT: %.loc9_54.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_54.2: type = converted %.loc9_54.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc9_54.3: Core.Form = init_form %.loc9_54.2, call_param2 [concrete = constants.%.067] // CHECK:STDOUT: %self.param: %C = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.IndexWith.impl.%C.ref [concrete = constants.%C] // CHECK:STDOUT: %self: %C = value_binding self, %self.param // CHECK:STDOUT: %subscript.param: %empty_tuple.type = value_param call_param1 -// CHECK:STDOUT: %.loc9_33.1: type = splice_block %.loc9_33.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc9_33.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc9_33.3: type = converted %.loc9_33.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc9_47.1: type = splice_block %.loc9_47.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc9_47.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_47.3: type = converted %.loc9_47.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %subscript: %empty_tuple.type = value_binding subscript, %subscript.param // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param2 diff --git a/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon b/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon index 6c340617561b..fa7e494a9f8d 100644 --- a/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon +++ b/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon @@ -21,7 +21,7 @@ class ElementType {} class SubscriptType {} impl C as Core.IndexWith(SubscriptType) where .ElementType = ElementType { - fn At[self: Self](subscript: SubscriptType) -> ElementType { + fn At[unused self: Self](unused subscript: SubscriptType) -> ElementType { return {}; } } @@ -39,7 +39,7 @@ class C { } impl (C, C) as Core.IndexWith(Core.IntLiteral()) where .ElementType = C { - fn At[self: Self](subscript: Core.IntLiteral()) -> C { + fn At[self: Self](unused subscript: Core.IntLiteral()) -> C { return self.0; } } @@ -56,7 +56,7 @@ class ElementType {} class SubscriptType {} impl C as Core.IndexWith(SubscriptType) where .ElementType = ElementType { - fn At[self: Self](subscript: SubscriptType) -> ElementType { + fn At[unused self: Self](unused subscript: SubscriptType) -> ElementType { return {}; } } @@ -395,17 +395,17 @@ let x: i32 = c[0]; // CHECK:STDOUT: %return.param_patt: %pattern_type.7c7 = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc9_54: Core.Form = init_form %C.ref, call_param2 [concrete = constants.%.92f] +// CHECK:STDOUT: %.loc9_61: Core.Form = init_form %C.ref, call_param2 [concrete = constants.%.92f] // CHECK:STDOUT: %self.param: %tuple.type.d23 = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @tuple.type.as.IndexWith.impl.%.loc8_11.2 [concrete = constants.%tuple.type.d23] // CHECK:STDOUT: %self: %tuple.type.d23 = value_binding self, %self.param // CHECK:STDOUT: %subscript.param: Core.IntLiteral = value_param call_param1 -// CHECK:STDOUT: %.loc9_48.1: type = splice_block %.loc9_48.3 [concrete = Core.IntLiteral] { +// CHECK:STDOUT: %.loc9_55.1: type = splice_block %.loc9_55.3 [concrete = Core.IntLiteral] { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] // CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc9_48.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc9_48.3: type = converted %IntLiteral.call, %.loc9_48.2 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc9_55.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc9_55.3: type = converted %IntLiteral.call, %.loc9_55.2 [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %subscript: Core.IntLiteral = value_binding subscript, %subscript.param // CHECK:STDOUT: %return.param: ref %C = out_param call_param2 diff --git a/toolchain/check/testdata/operators/overloaded/left_shift.carbon b/toolchain/check/testdata/operators/overloaded/left_shift.carbon index 8d5db47d63b4..ddb83960d196 100644 --- a/toolchain/check/testdata/operators/overloaded/left_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/left_shift.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.LeftShiftWith(C) where .Result = C { - fn Op[self: C](other: C) -> C { + fn Op[unused self: C](unused other: C) -> C { return {}; } } impl C as Core.LeftShiftAssignWith(C) { - fn Op[ref self: C](other: C) {} + fn Op[unused ref self: C](unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/mod.carbon b/toolchain/check/testdata/operators/overloaded/mod.carbon index 4a3ca451f479..2b2dc3643a66 100644 --- a/toolchain/check/testdata/operators/overloaded/mod.carbon +++ b/toolchain/check/testdata/operators/overloaded/mod.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.ModWith(C) where .Result = C { - fn Op[self: C](other: C) -> C { + fn Op[unused self: C](unused other: C) -> C { return {}; } } impl C as Core.ModAssignWith(C) { - fn Op[ref self: C](other: C) {} + fn Op[unused ref self: C](unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/mul.carbon b/toolchain/check/testdata/operators/overloaded/mul.carbon index 1d5084bbdff1..6af1d9df8d34 100644 --- a/toolchain/check/testdata/operators/overloaded/mul.carbon +++ b/toolchain/check/testdata/operators/overloaded/mul.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.MulWith(C) where .Result = C { - fn Op[self: C](other: C) -> C { + fn Op[unused self: C](unused other: C) -> C { return {}; } } impl C as Core.MulAssignWith(C) { - fn Op[ref self: C](other: C) {} + fn Op[unused ref self: C](unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/negate.carbon b/toolchain/check/testdata/operators/overloaded/negate.carbon index d7db29b97079..73364405f9ec 100644 --- a/toolchain/check/testdata/operators/overloaded/negate.carbon +++ b/toolchain/check/testdata/operators/overloaded/negate.carbon @@ -19,7 +19,7 @@ package User; class C {}; impl C as Core.Negate where .Result = C { - fn Op[self: C]() -> C { + fn Op[unused self: C]() -> C { return {}; } } diff --git a/toolchain/check/testdata/operators/overloaded/right_shift.carbon b/toolchain/check/testdata/operators/overloaded/right_shift.carbon index a8e1b92323d8..c8797e722c4d 100644 --- a/toolchain/check/testdata/operators/overloaded/right_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/right_shift.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.RightShiftWith(C) where .Result = C { - fn Op[self: C](other: C) -> C { + fn Op[unused self: C](unused other: C) -> C { return {}; } } impl C as Core.RightShiftAssignWith(C) { - fn Op[ref self: C](other: C) {} + fn Op[unused ref self: C](unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/string_indexing.carbon b/toolchain/check/testdata/operators/overloaded/string_indexing.carbon index f260c7aaad23..3922c8dc51ae 100644 --- a/toolchain/check/testdata/operators/overloaded/string_indexing.carbon +++ b/toolchain/check/testdata/operators/overloaded/string_indexing.carbon @@ -14,22 +14,22 @@ library "[[@TEST_NAME]]"; fn TestLiteralNegativeIndex() { - // CHECK:STDERR: fail_literal_negative_index.carbon:[[@LINE+4]]:17: error: index `-1` is negative. [StringAtIndexNegative] - // CHECK:STDERR: let c: char = "Test"[-1]; - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fail_literal_negative_index.carbon:[[@LINE+4]]:24: error: index `-1` is negative. [StringAtIndexNegative] + // CHECK:STDERR: let unused c: char = "Test"[-1]; + // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: - let c: char = "Test"[-1]; + let unused c: char = "Test"[-1]; } // --- fail_literal_out_of_bounds.carbon library "[[@TEST_NAME]]"; fn TestLiteralOutOfBounds() { - // CHECK:STDERR: fail_literal_out_of_bounds.carbon:[[@LINE+4]]:17: error: string index `4` is out of bounds; string has length 4. [StringAtIndexOutOfBounds] - // CHECK:STDERR: let c: char = "Test"[4]; - // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: fail_literal_out_of_bounds.carbon:[[@LINE+4]]:24: error: string index `4` is out of bounds; string has length 4. [StringAtIndexOutOfBounds] + // CHECK:STDERR: let unused c: char = "Test"[4]; + // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: - let c: char = "Test"[4]; + let unused c: char = "Test"[4]; } // --- fail_wrong_type.carbon @@ -72,8 +72,8 @@ library "[[@TEST_NAME]]"; fn TestStringIndexing() { //@dump-sem-ir-begin - let c: char = "Test"[0]; - let d: char = "Test"[3]; + let unused c: char = "Test"[0]; + let unused d: char = "Test"[3]; //@dump-sem-ir-end } @@ -157,17 +157,17 @@ fn TestStringIndexing() { // CHECK:STDOUT: %String.val.loc5: %str.ee0 = struct_value (%str.loc5, %int_4.loc5) [concrete = constants.%String.val] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %impl.elem1.loc5: %.b7b = impl_witness_access constants.%IndexWith.impl_witness.8d4, element1 [concrete = constants.%str.as.IndexWith.impl.At.a70] -// CHECK:STDOUT: %bound_method.loc5_25.1: = bound_method %String.val.loc5, %impl.elem1.loc5 [concrete = constants.%str.as.IndexWith.impl.At.bound] -// CHECK:STDOUT: %ImplicitAs.facet.loc5_25.1: %ImplicitAs.type.2ad = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.4e6) [concrete = constants.%ImplicitAs.facet] -// CHECK:STDOUT: %.loc5_25.1: %ImplicitAs.type.2ad = converted Core.IntLiteral, %ImplicitAs.facet.loc5_25.1 [concrete = constants.%ImplicitAs.facet] -// CHECK:STDOUT: %ImplicitAs.facet.loc5_25.2: %ImplicitAs.type.2ad = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.4e6) [concrete = constants.%ImplicitAs.facet] -// CHECK:STDOUT: %.loc5_25.2: %ImplicitAs.type.2ad = converted Core.IntLiteral, %ImplicitAs.facet.loc5_25.2 [concrete = constants.%ImplicitAs.facet] +// CHECK:STDOUT: %bound_method.loc5_32.1: = bound_method %String.val.loc5, %impl.elem1.loc5 [concrete = constants.%str.as.IndexWith.impl.At.bound] +// CHECK:STDOUT: %ImplicitAs.facet.loc5_32.1: %ImplicitAs.type.2ad = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.4e6) [concrete = constants.%ImplicitAs.facet] +// CHECK:STDOUT: %.loc5_32.1: %ImplicitAs.type.2ad = converted Core.IntLiteral, %ImplicitAs.facet.loc5_32.1 [concrete = constants.%ImplicitAs.facet] +// CHECK:STDOUT: %ImplicitAs.facet.loc5_32.2: %ImplicitAs.type.2ad = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.4e6) [concrete = constants.%ImplicitAs.facet] +// CHECK:STDOUT: %.loc5_32.2: %ImplicitAs.type.2ad = converted Core.IntLiteral, %ImplicitAs.facet.loc5_32.2 [concrete = constants.%ImplicitAs.facet] // CHECK:STDOUT: %specific_fn.loc5: = specific_function %impl.elem1.loc5, @str.as.IndexWith.impl.At(constants.%ImplicitAs.facet) [concrete = constants.%str.as.IndexWith.impl.At.specific_fn] -// CHECK:STDOUT: %bound_method.loc5_25.2: = bound_method %String.val.loc5, %specific_fn.loc5 [concrete = constants.%bound_method] -// CHECK:STDOUT: %str.as.IndexWith.impl.At.call.loc5: init %char = call %bound_method.loc5_25.2(%String.val.loc5, %int_0) [concrete = constants.%int_84] -// CHECK:STDOUT: %.loc5_25.3: %char = value_of_initializer %str.as.IndexWith.impl.At.call.loc5 [concrete = constants.%int_84] -// CHECK:STDOUT: %.loc5_25.4: %char = converted %str.as.IndexWith.impl.At.call.loc5, %.loc5_25.3 [concrete = constants.%int_84] -// CHECK:STDOUT: %c: %char = value_binding c, %.loc5_25.4 +// CHECK:STDOUT: %bound_method.loc5_32.2: = bound_method %String.val.loc5, %specific_fn.loc5 [concrete = constants.%bound_method] +// CHECK:STDOUT: %str.as.IndexWith.impl.At.call.loc5: init %char = call %bound_method.loc5_32.2(%String.val.loc5, %int_0) [concrete = constants.%int_84] +// CHECK:STDOUT: %.loc5_32.3: %char = value_of_initializer %str.as.IndexWith.impl.At.call.loc5 [concrete = constants.%int_84] +// CHECK:STDOUT: %.loc5_32.4: %char = converted %str.as.IndexWith.impl.At.call.loc5, %.loc5_32.3 [concrete = constants.%int_84] +// CHECK:STDOUT: %c: %char = value_binding c, %.loc5_32.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %d.patt: %pattern_type.b09 = value_binding_pattern d [concrete] // CHECK:STDOUT: } @@ -176,17 +176,17 @@ fn TestStringIndexing() { // CHECK:STDOUT: %String.val.loc6: %str.ee0 = struct_value (%str.loc6, %int_4.loc6) [concrete = constants.%String.val] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3] // CHECK:STDOUT: %impl.elem1.loc6: %.b7b = impl_witness_access constants.%IndexWith.impl_witness.8d4, element1 [concrete = constants.%str.as.IndexWith.impl.At.a70] -// CHECK:STDOUT: %bound_method.loc6_25.1: = bound_method %String.val.loc6, %impl.elem1.loc6 [concrete = constants.%str.as.IndexWith.impl.At.bound] -// CHECK:STDOUT: %ImplicitAs.facet.loc6_25.1: %ImplicitAs.type.2ad = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.4e6) [concrete = constants.%ImplicitAs.facet] -// CHECK:STDOUT: %.loc6_25.1: %ImplicitAs.type.2ad = converted Core.IntLiteral, %ImplicitAs.facet.loc6_25.1 [concrete = constants.%ImplicitAs.facet] -// CHECK:STDOUT: %ImplicitAs.facet.loc6_25.2: %ImplicitAs.type.2ad = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.4e6) [concrete = constants.%ImplicitAs.facet] -// CHECK:STDOUT: %.loc6_25.2: %ImplicitAs.type.2ad = converted Core.IntLiteral, %ImplicitAs.facet.loc6_25.2 [concrete = constants.%ImplicitAs.facet] +// CHECK:STDOUT: %bound_method.loc6_32.1: = bound_method %String.val.loc6, %impl.elem1.loc6 [concrete = constants.%str.as.IndexWith.impl.At.bound] +// CHECK:STDOUT: %ImplicitAs.facet.loc6_32.1: %ImplicitAs.type.2ad = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.4e6) [concrete = constants.%ImplicitAs.facet] +// CHECK:STDOUT: %.loc6_32.1: %ImplicitAs.type.2ad = converted Core.IntLiteral, %ImplicitAs.facet.loc6_32.1 [concrete = constants.%ImplicitAs.facet] +// CHECK:STDOUT: %ImplicitAs.facet.loc6_32.2: %ImplicitAs.type.2ad = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.4e6) [concrete = constants.%ImplicitAs.facet] +// CHECK:STDOUT: %.loc6_32.2: %ImplicitAs.type.2ad = converted Core.IntLiteral, %ImplicitAs.facet.loc6_32.2 [concrete = constants.%ImplicitAs.facet] // CHECK:STDOUT: %specific_fn.loc6: = specific_function %impl.elem1.loc6, @str.as.IndexWith.impl.At(constants.%ImplicitAs.facet) [concrete = constants.%str.as.IndexWith.impl.At.specific_fn] -// CHECK:STDOUT: %bound_method.loc6_25.2: = bound_method %String.val.loc6, %specific_fn.loc6 [concrete = constants.%bound_method] -// CHECK:STDOUT: %str.as.IndexWith.impl.At.call.loc6: init %char = call %bound_method.loc6_25.2(%String.val.loc6, %int_3) [concrete = constants.%int_116] -// CHECK:STDOUT: %.loc6_25.3: %char = value_of_initializer %str.as.IndexWith.impl.At.call.loc6 [concrete = constants.%int_116] -// CHECK:STDOUT: %.loc6_25.4: %char = converted %str.as.IndexWith.impl.At.call.loc6, %.loc6_25.3 [concrete = constants.%int_116] -// CHECK:STDOUT: %d: %char = value_binding d, %.loc6_25.4 +// CHECK:STDOUT: %bound_method.loc6_32.2: = bound_method %String.val.loc6, %specific_fn.loc6 [concrete = constants.%bound_method] +// CHECK:STDOUT: %str.as.IndexWith.impl.At.call.loc6: init %char = call %bound_method.loc6_32.2(%String.val.loc6, %int_3) [concrete = constants.%int_116] +// CHECK:STDOUT: %.loc6_32.3: %char = value_of_initializer %str.as.IndexWith.impl.At.call.loc6 [concrete = constants.%int_116] +// CHECK:STDOUT: %.loc6_32.4: %char = converted %str.as.IndexWith.impl.At.call.loc6, %.loc6_32.3 [concrete = constants.%int_116] +// CHECK:STDOUT: %d: %char = value_binding d, %.loc6_32.4 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/sub.carbon b/toolchain/check/testdata/operators/overloaded/sub.carbon index 0cc7edf54a8c..1632ebf04627 100644 --- a/toolchain/check/testdata/operators/overloaded/sub.carbon +++ b/toolchain/check/testdata/operators/overloaded/sub.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.SubWith(C) where .Result = C { - fn Op[self: C](other: C) -> C { + fn Op[unused self: C](unused other: C) -> C { return {}; } } impl C as Core.SubAssignWith(C) { - fn Op[ref self: C](other: C) {} + fn Op[unused ref self: C](unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/unary_op.carbon.tmpl b/toolchain/check/testdata/operators/overloaded/unary_op.carbon.tmpl index ffbda5811eb7..861420879500 100644 --- a/toolchain/check/testdata/operators/overloaded/unary_op.carbon.tmpl +++ b/toolchain/check/testdata/operators/overloaded/unary_op.carbon.tmpl @@ -15,7 +15,7 @@ package User; class C {}; impl C as Core.INTERFACE where .Result = C { - fn Op[self: C]() -> C { + fn Op[unused self: C]() -> C { return {}; } } diff --git a/toolchain/check/testdata/package_expr/fail_not_found.carbon b/toolchain/check/testdata/package_expr/fail_not_found.carbon index 6558f6cc980b..53af16df1f40 100644 --- a/toolchain/check/testdata/package_expr/fail_not_found.carbon +++ b/toolchain/check/testdata/package_expr/fail_not_found.carbon @@ -13,11 +13,11 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/package_expr/fail_not_found.carbon fn Main() { - // CHECK:STDERR: fail_not_found.carbon:[[@LINE+4]]:16: error: member name `x` not found in `Main` [MemberNameNotFoundInInstScope] - // CHECK:STDERR: var y: i32 = package.x; - // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: fail_not_found.carbon:[[@LINE+4]]:23: error: member name `x` not found in `Main` [MemberNameNotFoundInInstScope] + // CHECK:STDERR: var unused y: i32 = package.x; + // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: - var y: i32 = package.x; + var unused y: i32 = package.x; } // CHECK:STDOUT: --- fail_not_found.carbon diff --git a/toolchain/check/testdata/package_expr/syntax.carbon b/toolchain/check/testdata/package_expr/syntax.carbon index d636cea6cd93..0019095dea5c 100644 --- a/toolchain/check/testdata/package_expr/syntax.carbon +++ b/toolchain/check/testdata/package_expr/syntax.carbon @@ -26,9 +26,9 @@ package InsideFn; var x: i32 = 0; fn Main() { - var x: i32 = 1; + var unused x: i32 = 1; - var y: i32 = package.x; + var unused y: i32 = package.x; } // --- namespace.carbon @@ -253,7 +253,7 @@ fn Main() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc7_3.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc7_3: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %x.var, %.loc7_3 -// CHECK:STDOUT: %.loc7_10: type = splice_block %i32.loc7 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc7_17: type = splice_block %i32.loc7 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } @@ -265,14 +265,14 @@ fn Main() { // CHECK:STDOUT: %y.var: ref %i32 = var %y.var_patt // CHECK:STDOUT: %package.ref: = name_ref package, package [concrete = package] // CHECK:STDOUT: %x.ref: ref %i32 = name_ref x, file.%x [concrete = file.%x.var] -// CHECK:STDOUT: %.loc9_23: %i32 = acquire_value %x.ref +// CHECK:STDOUT: %.loc9_30: %i32 = acquire_value %x.ref // CHECK:STDOUT: %impl.elem0.loc9: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] -// CHECK:STDOUT: %bound_method.loc9_23.1: = bound_method %.loc9_23, %impl.elem0.loc9 +// CHECK:STDOUT: %bound_method.loc9_30.1: = bound_method %.loc9_30, %impl.elem0.loc9 // CHECK:STDOUT: %specific_fn.loc9: = specific_function %impl.elem0.loc9, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_23.2: = bound_method %.loc9_23, %specific_fn.loc9 -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc9_23.2(%.loc9_23) +// CHECK:STDOUT: %bound_method.loc9_30.2: = bound_method %.loc9_30, %specific_fn.loc9 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc9_30.2(%.loc9_30) // CHECK:STDOUT: assign %y.var, %Int.as.Copy.impl.Op.call -// CHECK:STDOUT: %.loc9_10: type = splice_block %i32.loc9 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc9_17: type = splice_block %i32.loc9 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/cross_package_import.carbon b/toolchain/check/testdata/packages/cross_package_import.carbon index 34a68de8bc63..79a1aa7f83de 100644 --- a/toolchain/check/testdata/packages/cross_package_import.carbon +++ b/toolchain/check/testdata/packages/cross_package_import.carbon @@ -32,7 +32,7 @@ extern fn F(); package Other library "[[@TEST_NAME]]"; -fn F(x: ()) {} +fn F(unused x: ()) {} // --- other_fn2.carbon @@ -106,8 +106,8 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+8]]:1: in import [InImport] // CHECK:STDERR: other_fn_conflict.carbon:4:1: error: duplicate name `F` being declared in the same scope [NameDeclDuplicate] -// CHECK:STDERR: fn F(x: ()) {} -// CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: fn F(unused x: ()) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+4]]:1: in import [InImport] // CHECK:STDERR: other_fn.carbon:4:1: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: fn F() {} @@ -265,9 +265,9 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: %x.param_patt: %pattern_type = value_param_pattern %x.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %x.param: %empty_tuple.type = value_param call_param0 -// CHECK:STDOUT: %.loc4_10.1: type = splice_block %.loc4_10.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc4_10.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc4_10.3: type = converted %.loc4_10.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc4_17.1: type = splice_block %.loc4_17.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc4_17.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc4_17.3: type = converted %.loc4_17.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %x: %empty_tuple.type = value_binding x, %x.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/missing_prelude.carbon b/toolchain/check/testdata/packages/missing_prelude.carbon index e89289667bdb..04e6ec678935 100644 --- a/toolchain/check/testdata/packages/missing_prelude.carbon +++ b/toolchain/check/testdata/packages/missing_prelude.carbon @@ -42,7 +42,7 @@ var n: i32; package Core library "[[@TEST_NAME]]"; -fn Int[T:! type](N:! T) -> {} { return {}; } +fn Int[T:! type](unused N:! T) -> {} { return {}; } // --- use_fake_int.carbon @@ -60,7 +60,7 @@ package Core library "[[@TEST_NAME]]"; // Note that we are intentionally using a different type here from other cases // to test that this function is called, not the one from prelude_fake_int. -fn Int[T:! type](N:! T) -> () { return (); } +fn Int[T:! type](unused N:! T) -> () { return (); } var n: () = i32; @@ -184,40 +184,40 @@ var n: {} = i32; // CHECK:STDOUT: %return.patt: %pattern_type.a96 = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.a96 = out_param_pattern %return.patt, call_param0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc4_29.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc4_29.2: type = converted %.loc4_29.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc4_29.3: Core.Form = init_form %.loc4_29.2, call_param0 [concrete = constants.%.dde] +// CHECK:STDOUT: %.loc4_36.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc4_36.2: type = converted %.loc4_36.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc4_36.3: Core.Form = init_form %.loc4_36.2, call_param0 [concrete = constants.%.dde] // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc4_8.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_8.1 (constants.%T)] -// CHECK:STDOUT: %.loc4_22: type = splice_block %T.ref [symbolic = %T.loc4_8.1 (constants.%T)] { +// CHECK:STDOUT: %.loc4_29: type = splice_block %T.ref [symbolic = %T.loc4_8.1 (constants.%T)] { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_8.2 [symbolic = %T.loc4_8.1 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc4_18.2: @Int.%T.loc4_8.1 (%T) = symbolic_binding N, 1 [symbolic = %N.loc4_18.1 (constants.%N)] +// CHECK:STDOUT: %N.loc4_25.2: @Int.%T.loc4_8.1 (%T) = symbolic_binding N, 1 [symbolic = %N.loc4_25.1 (constants.%N)] // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param0 // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Int(%T.loc4_8.2: type, %N.loc4_18.2: @Int.%T.loc4_8.1 (%T)) { +// CHECK:STDOUT: generic fn @Int(%T.loc4_8.2: type, %N.loc4_25.2: @Int.%T.loc4_8.1 (%T)) { // CHECK:STDOUT: %T.loc4_8.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_8.1 (constants.%T)] -// CHECK:STDOUT: %N.loc4_18.1: @Int.%T.loc4_8.1 (%T) = symbolic_binding N, 1 [symbolic = %N.loc4_18.1 (constants.%N)] +// CHECK:STDOUT: %N.loc4_25.1: @Int.%T.loc4_8.1 (%T) = symbolic_binding N, 1 [symbolic = %N.loc4_25.1 (constants.%N)] // CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc4_8.1 [symbolic = %pattern_type (constants.%pattern_type.51d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn() -> out %return.param: %empty_struct_type { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc4_41.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc4_41.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc4_42: init %empty_struct_type = converted %.loc4_41.1, %.loc4_41.2 [concrete = constants.%empty_struct] -// CHECK:STDOUT: return %.loc4_42 +// CHECK:STDOUT: %.loc4_48.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc4_48.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc4_49: init %empty_struct_type = converted %.loc4_48.1, %.loc4_48.2 [concrete = constants.%empty_struct] +// CHECK:STDOUT: return %.loc4_49 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Int(constants.%T, constants.%N) { // CHECK:STDOUT: %T.loc4_8.1 => constants.%T -// CHECK:STDOUT: %N.loc4_18.1 => constants.%N +// CHECK:STDOUT: %N.loc4_25.1 => constants.%N // CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: @@ -329,16 +329,16 @@ var n: {} = i32; // CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern %return.patt, call_param0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc8_29.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_29.2: type = converted %.loc8_29.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc8_29.3: Core.Form = init_form %.loc8_29.2, call_param0 [concrete = constants.%.842] +// CHECK:STDOUT: %.loc8_36.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_36.2: type = converted %.loc8_36.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc8_36.3: Core.Form = init_form %.loc8_36.2, call_param0 [concrete = constants.%.842] // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc8_8.2: type = symbolic_binding T, 0 [symbolic = %T.loc8_8.1 (constants.%T)] -// CHECK:STDOUT: %.loc8_22: type = splice_block %T.ref [symbolic = %T.loc8_8.1 (constants.%T)] { +// CHECK:STDOUT: %.loc8_29: type = splice_block %T.ref [symbolic = %T.loc8_8.1 (constants.%T)] { // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_8.2 [symbolic = %T.loc8_8.1 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc8_18.2: @Int.%T.loc8_8.1 (%T) = symbolic_binding N, 1 [symbolic = %N.loc8_18.1 (constants.%N)] +// CHECK:STDOUT: %N.loc8_25.2: @Int.%T.loc8_8.1 (%T) = symbolic_binding N, 1 [symbolic = %N.loc8_25.1 (constants.%N)] // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param0 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param // CHECK:STDOUT: } @@ -354,19 +354,19 @@ var n: {} = i32; // CHECK:STDOUT: %n: ref %empty_tuple.type = ref_binding n, %n.var [concrete = %n.var] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Int(%T.loc8_8.2: type, %N.loc8_18.2: @Int.%T.loc8_8.1 (%T)) { +// CHECK:STDOUT: generic fn @Int(%T.loc8_8.2: type, %N.loc8_25.2: @Int.%T.loc8_8.1 (%T)) { // CHECK:STDOUT: %T.loc8_8.1: type = symbolic_binding T, 0 [symbolic = %T.loc8_8.1 (constants.%T)] -// CHECK:STDOUT: %N.loc8_18.1: @Int.%T.loc8_8.1 (%T) = symbolic_binding N, 1 [symbolic = %N.loc8_18.1 (constants.%N)] +// CHECK:STDOUT: %N.loc8_25.1: @Int.%T.loc8_8.1 (%T) = symbolic_binding N, 1 [symbolic = %N.loc8_25.1 (constants.%N)] // CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc8_8.1 [symbolic = %pattern_type (constants.%pattern_type.51d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn() -> out %return.param: %empty_tuple.type { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc8_41.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_41.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_42: init %empty_tuple.type = converted %.loc8_41.1, %.loc8_41.2 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: return %.loc8_42 +// CHECK:STDOUT: %.loc8_48.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_48.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_49: init %empty_tuple.type = converted %.loc8_48.1, %.loc8_48.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: return %.loc8_49 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -381,13 +381,13 @@ var n: {} = i32; // CHECK:STDOUT: // CHECK:STDOUT: specific @Int(constants.%T, constants.%N) { // CHECK:STDOUT: %T.loc8_8.1 => constants.%T -// CHECK:STDOUT: %N.loc8_18.1 => constants.%N +// CHECK:STDOUT: %N.loc8_25.1 => constants.%N // CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Int(Core.IntLiteral, constants.%int_32) { // CHECK:STDOUT: %T.loc8_8.1 => Core.IntLiteral -// CHECK:STDOUT: %N.loc8_18.1 => constants.%int_32 +// CHECK:STDOUT: %N.loc8_25.1 => constants.%int_32 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.dc0 // CHECK:STDOUT: // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/patterns/unused_underscore.carbon b/toolchain/check/testdata/patterns/unused_underscore.carbon new file mode 100644 index 000000000000..7ec6394973dd --- /dev/null +++ b/toolchain/check/testdata/patterns/unused_underscore.carbon @@ -0,0 +1,25 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/primitives.carbon +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/patterns/unused_underscore.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/patterns/unused_underscore.carbon + +fn F() { + // CHECK:STDERR: unused_underscore.carbon:[[@LINE+4]]:7: warning: `unused` modifier on pattern without bindings [UnusedPatternNoBindings] + // CHECK:STDERR: var unused _: i32 = 1; + // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: + var unused _: i32 = 1; + + // CHECK:STDERR: unused_underscore.carbon:[[@LINE+4]]:7: warning: `unused` modifier on pattern without bindings [UnusedPatternNoBindings] + // CHECK:STDERR: let unused (_: i32, _: i32) = (1, 1); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + let unused (_: i32, _: i32) = (1, 1); +} diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index 570769667f1e..0bebee579db4 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -15,13 +15,13 @@ fn F() { var s: {.a: i32, .b: i32} = {.a = 1, .b = 2}; - var p: {.a: i32, .b: i32}* = &s; - var q: i32* = &s.a; - var r: i32* = &s.b; + var unused p: {.a: i32, .b: i32}* = &s; + var unused q: i32* = &s.a; + var unused r: i32* = &s.b; var t: (i32, i32) = (1, 2); - var t0: i32* = &t.0; - var t1: i32* = &t.1; + var unused t0: i32* = &t.0; + var unused t1: i32* = &t.1; } // CHECK:STDOUT: --- address_of_lvalue.carbon @@ -174,16 +174,16 @@ fn F() { // CHECK:STDOUT: %s.ref.loc18: ref %struct_type.a.b.501 = name_ref s, %s // CHECK:STDOUT: %addr.loc18: %ptr.3ee = addr_of %s.ref.loc18 // CHECK:STDOUT: %impl.elem0.loc18: %.4da = impl_witness_access constants.%Copy.impl_witness.00b, element0 [concrete = constants.%ptr.as.Copy.impl.Op.6e1] -// CHECK:STDOUT: %bound_method.loc18_32.1: = bound_method %addr.loc18, %impl.elem0.loc18 +// CHECK:STDOUT: %bound_method.loc18_39.1: = bound_method %addr.loc18, %impl.elem0.loc18 // CHECK:STDOUT: %specific_fn.loc18: = specific_function %impl.elem0.loc18, @ptr.as.Copy.impl.Op(constants.%struct_type.a.b.501) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn.8f3] -// CHECK:STDOUT: %bound_method.loc18_32.2: = bound_method %addr.loc18, %specific_fn.loc18 -// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc18: init %ptr.3ee = call %bound_method.loc18_32.2(%addr.loc18) +// CHECK:STDOUT: %bound_method.loc18_39.2: = bound_method %addr.loc18, %specific_fn.loc18 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc18: init %ptr.3ee = call %bound_method.loc18_39.2(%addr.loc18) // CHECK:STDOUT: assign %p.var, %ptr.as.Copy.impl.Op.call.loc18 // CHECK:STDOUT: %.loc18: type = splice_block %ptr.loc18 [concrete = constants.%ptr.3ee] { -// CHECK:STDOUT: %int_32.loc18_15: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.loc18_24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc18_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc18_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc18_31: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc18_31: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %struct_type.a.b.loc18: type = struct_type {.a: %i32, .b: %i32} [concrete = constants.%struct_type.a.b.501] // CHECK:STDOUT: %ptr.loc18: type = ptr_type %struct_type.a.b.loc18 [concrete = constants.%ptr.3ee] // CHECK:STDOUT: } @@ -194,15 +194,15 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %q.var: ref %ptr.235 = var %q.var_patt // CHECK:STDOUT: %s.ref.loc19: ref %struct_type.a.b.501 = name_ref s, %s -// CHECK:STDOUT: %.loc19_19: ref %i32 = struct_access %s.ref.loc19, element0 -// CHECK:STDOUT: %addr.loc19: %ptr.235 = addr_of %.loc19_19 +// CHECK:STDOUT: %.loc19_26: ref %i32 = struct_access %s.ref.loc19, element0 +// CHECK:STDOUT: %addr.loc19: %ptr.235 = addr_of %.loc19_26 // CHECK:STDOUT: %impl.elem0.loc19: %.a62 = impl_witness_access constants.%Copy.impl_witness.843, element0 [concrete = constants.%ptr.as.Copy.impl.Op.011] -// CHECK:STDOUT: %bound_method.loc19_17.1: = bound_method %addr.loc19, %impl.elem0.loc19 +// CHECK:STDOUT: %bound_method.loc19_24.1: = bound_method %addr.loc19, %impl.elem0.loc19 // CHECK:STDOUT: %specific_fn.loc19: = specific_function %impl.elem0.loc19, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn.101] -// CHECK:STDOUT: %bound_method.loc19_17.2: = bound_method %addr.loc19, %specific_fn.loc19 -// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc19: init %ptr.235 = call %bound_method.loc19_17.2(%addr.loc19) +// CHECK:STDOUT: %bound_method.loc19_24.2: = bound_method %addr.loc19, %specific_fn.loc19 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc19: init %ptr.235 = call %bound_method.loc19_24.2(%addr.loc19) // CHECK:STDOUT: assign %q.var, %ptr.as.Copy.impl.Op.call.loc19 -// CHECK:STDOUT: %.loc19_13: type = splice_block %ptr.loc19 [concrete = constants.%ptr.235] { +// CHECK:STDOUT: %.loc19_20: type = splice_block %ptr.loc19 [concrete = constants.%ptr.235] { // CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %ptr.loc19: type = ptr_type %i32.loc19 [concrete = constants.%ptr.235] @@ -214,15 +214,15 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %r.var: ref %ptr.235 = var %r.var_patt // CHECK:STDOUT: %s.ref.loc20: ref %struct_type.a.b.501 = name_ref s, %s -// CHECK:STDOUT: %.loc20_19: ref %i32 = struct_access %s.ref.loc20, element1 -// CHECK:STDOUT: %addr.loc20: %ptr.235 = addr_of %.loc20_19 +// CHECK:STDOUT: %.loc20_26: ref %i32 = struct_access %s.ref.loc20, element1 +// CHECK:STDOUT: %addr.loc20: %ptr.235 = addr_of %.loc20_26 // CHECK:STDOUT: %impl.elem0.loc20: %.a62 = impl_witness_access constants.%Copy.impl_witness.843, element0 [concrete = constants.%ptr.as.Copy.impl.Op.011] -// CHECK:STDOUT: %bound_method.loc20_17.1: = bound_method %addr.loc20, %impl.elem0.loc20 +// CHECK:STDOUT: %bound_method.loc20_24.1: = bound_method %addr.loc20, %impl.elem0.loc20 // CHECK:STDOUT: %specific_fn.loc20: = specific_function %impl.elem0.loc20, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn.101] -// CHECK:STDOUT: %bound_method.loc20_17.2: = bound_method %addr.loc20, %specific_fn.loc20 -// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc20: init %ptr.235 = call %bound_method.loc20_17.2(%addr.loc20) +// CHECK:STDOUT: %bound_method.loc20_24.2: = bound_method %addr.loc20, %specific_fn.loc20 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc20: init %ptr.235 = call %bound_method.loc20_24.2(%addr.loc20) // CHECK:STDOUT: assign %r.var, %ptr.as.Copy.impl.Op.call.loc20 -// CHECK:STDOUT: %.loc20_13: type = splice_block %ptr.loc20 [concrete = constants.%ptr.235] { +// CHECK:STDOUT: %.loc20_20: type = splice_block %ptr.loc20 [concrete = constants.%ptr.235] { // CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %ptr.loc20: type = ptr_type %i32.loc20 [concrete = constants.%ptr.235] @@ -274,10 +274,10 @@ fn F() { // CHECK:STDOUT: %tuple.elem0.loc23: ref %i32 = tuple_access %t.ref.loc23, element0 // CHECK:STDOUT: %addr.loc23: %ptr.235 = addr_of %tuple.elem0.loc23 // CHECK:STDOUT: %impl.elem0.loc23: %.a62 = impl_witness_access constants.%Copy.impl_witness.843, element0 [concrete = constants.%ptr.as.Copy.impl.Op.011] -// CHECK:STDOUT: %bound_method.loc23_18.1: = bound_method %addr.loc23, %impl.elem0.loc23 +// CHECK:STDOUT: %bound_method.loc23_25.1: = bound_method %addr.loc23, %impl.elem0.loc23 // CHECK:STDOUT: %specific_fn.loc23: = specific_function %impl.elem0.loc23, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn.101] -// CHECK:STDOUT: %bound_method.loc23_18.2: = bound_method %addr.loc23, %specific_fn.loc23 -// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc23: init %ptr.235 = call %bound_method.loc23_18.2(%addr.loc23) +// CHECK:STDOUT: %bound_method.loc23_25.2: = bound_method %addr.loc23, %specific_fn.loc23 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc23: init %ptr.235 = call %bound_method.loc23_25.2(%addr.loc23) // CHECK:STDOUT: assign %t0.var, %ptr.as.Copy.impl.Op.call.loc23 // CHECK:STDOUT: %.loc23: type = splice_block %ptr.loc23 [concrete = constants.%ptr.235] { // CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] @@ -295,10 +295,10 @@ fn F() { // CHECK:STDOUT: %tuple.elem1.loc24: ref %i32 = tuple_access %t.ref.loc24, element1 // CHECK:STDOUT: %addr.loc24: %ptr.235 = addr_of %tuple.elem1.loc24 // CHECK:STDOUT: %impl.elem0.loc24: %.a62 = impl_witness_access constants.%Copy.impl_witness.843, element0 [concrete = constants.%ptr.as.Copy.impl.Op.011] -// CHECK:STDOUT: %bound_method.loc24_18.1: = bound_method %addr.loc24, %impl.elem0.loc24 +// CHECK:STDOUT: %bound_method.loc24_25.1: = bound_method %addr.loc24, %impl.elem0.loc24 // CHECK:STDOUT: %specific_fn.loc24: = specific_function %impl.elem0.loc24, @ptr.as.Copy.impl.Op(constants.%i32) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn.101] -// CHECK:STDOUT: %bound_method.loc24_18.2: = bound_method %addr.loc24, %specific_fn.loc24 -// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc24: init %ptr.235 = call %bound_method.loc24_18.2(%addr.loc24) +// CHECK:STDOUT: %bound_method.loc24_25.2: = bound_method %addr.loc24, %specific_fn.loc24 +// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc24: init %ptr.235 = call %bound_method.loc24_25.2(%addr.loc24) // CHECK:STDOUT: assign %t1.var, %ptr.as.Copy.impl.Op.call.loc24 // CHECK:STDOUT: %.loc24: type = splice_block %ptr.loc24 [concrete = constants.%ptr.235] { // CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] diff --git a/toolchain/check/testdata/pointer/fail_address_of_value.carbon b/toolchain/check/testdata/pointer/fail_address_of_value.carbon index ec5cc4be59d8..8dcbbed88c2c 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_value.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_value.carbon @@ -95,9 +95,9 @@ fn AddressOfTupleElementValue() { } fn AddressOfParam(param: i32) { - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:26: error: cannot take the address of non-reference expression [AddrOfNonRef] - // CHECK:STDERR: var param_addr: i32* = ¶m; - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:33: error: cannot take the address of non-reference expression [AddrOfNonRef] + // CHECK:STDERR: var unused param_addr: i32* = ¶m; + // CHECK:STDERR: ^ // CHECK:STDERR: - var param_addr: i32* = ¶m; + var unused param_addr: i32* = ¶m; } diff --git a/toolchain/check/testdata/primitives/numeric_literals.carbon b/toolchain/check/testdata/primitives/numeric_literals.carbon index 5e6e56f608eb..b5d2fa4765d2 100644 --- a/toolchain/check/testdata/primitives/numeric_literals.carbon +++ b/toolchain/check/testdata/primitives/numeric_literals.carbon @@ -17,7 +17,7 @@ library "[[@TEST_NAME]]"; fn F() { // 8 and 9 trigger special behavior in APInt when mishandling signed versus // unsigned, so we pay extra attention to those. - var ints: array(i32, 6) = ( + var unused ints: array(i32, 6) = ( //@dump-sem-ir-begin 8, 9, @@ -27,7 +27,7 @@ fn F() { 0x7FFFFFFF, //@dump-sem-ir-end ); - var floats: array(f64, 6) = ( + var unused floats: array(f64, 6) = ( //@dump-sem-ir-begin 0.9, 8.0, diff --git a/toolchain/check/testdata/return/code_after_return_value.carbon b/toolchain/check/testdata/return/code_after_return_value.carbon index b3daee4dc8a9..768e9b3419b1 100644 --- a/toolchain/check/testdata/return/code_after_return_value.carbon +++ b/toolchain/check/testdata/return/code_after_return_value.carbon @@ -12,7 +12,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/code_after_return_value.carbon -fn F(b: bool) -> i32 { +fn F(unused b: bool) -> i32 { return 0; // Exercise various forms of control flow to check that we still consider the @@ -89,12 +89,12 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc15_18: Core.Form = init_form %i32, call_param1 [concrete = constants.%.e54] +// CHECK:STDOUT: %.loc15_25: Core.Form = init_form %i32, call_param1 [concrete = constants.%.e54] // CHECK:STDOUT: %b.param: bool = value_param call_param0 -// CHECK:STDOUT: %.loc15_9.1: type = splice_block %.loc15_9.3 [concrete = bool] { +// CHECK:STDOUT: %.loc15_16.1: type = splice_block %.loc15_16.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc15_9.2: type = value_of_initializer %Bool.call [concrete = bool] -// CHECK:STDOUT: %.loc15_9.3: type = converted %Bool.call, %.loc15_9.2 [concrete = bool] +// CHECK:STDOUT: %.loc15_16.2: type = value_of_initializer %Bool.call [concrete = bool] +// CHECK:STDOUT: %.loc15_16.3: type = converted %Bool.call, %.loc15_16.2 [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = value_binding b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 diff --git a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon index 46985bb5b0a0..d7adeaec1938 100644 --- a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon @@ -18,13 +18,13 @@ library "[[@TEST_NAME]]"; fn Procedure() { // CHECK:STDERR: fail_procedure_with_returned_var.carbon:[[@LINE+7]]:3: error: cannot declare a `returned var` in this function [ReturnedVarWithNoReturnType] - // CHECK:STDERR: returned var v: () = (); + // CHECK:STDERR: returned var unused v: () = (); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_procedure_with_returned_var.carbon:[[@LINE-4]]:1: note: there was no return type provided [ReturnTypeOmittedNote] // CHECK:STDERR: fn Procedure() { // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: - returned var v: () = (); + returned var unused v: () = (); return; } @@ -34,13 +34,13 @@ library "[[@TEST_NAME]]"; fn ForgotReturnType() { // CHECK:STDERR: fail_forgot_return_type.carbon:[[@LINE+7]]:3: error: cannot declare a `returned var` in this function [ReturnedVarWithNoReturnType] - // CHECK:STDERR: returned var v: () = (); + // CHECK:STDERR: returned var unused v: () = (); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_forgot_return_type.carbon:[[@LINE-4]]:1: note: there was no return type provided [ReturnTypeOmittedNote] // CHECK:STDERR: fn ForgotReturnType() { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - returned var v: () = (); + returned var unused v: () = (); // CHECK:STDERR: fail_forgot_return_type.carbon:[[@LINE+4]]:3: error: `return var;` with no `returned var` in scope [ReturnVarWithNoReturnedVar] // CHECK:STDERR: return var; // CHECK:STDERR: ^~~~~~~~~~~ @@ -86,13 +86,13 @@ fn ForgotReturnType() { // CHECK:STDOUT: %v.var_patt: %pattern_type.cb1 = var_pattern %v.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %empty_tuple.type = var %v.var_patt -// CHECK:STDOUT: %.loc12_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc12_25.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc12_12: init %empty_tuple.type = converted %.loc12_25.1, %.loc12_25.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc12_32.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc12_32.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc12_12: init %empty_tuple.type = converted %.loc12_32.1, %.loc12_32.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: assign %v.var, %.loc12_12 -// CHECK:STDOUT: %.loc12_20.1: type = splice_block %.loc12_20.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc12_20.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc12_20.3: type = converted %.loc12_20.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc12_27.1: type = splice_block %.loc12_27.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc12_27.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc12_27.3: type = converted %.loc12_27.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref %empty_tuple.type = ref_binding v, %v.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %v.var, constants.%DestroyOp @@ -140,13 +140,13 @@ fn ForgotReturnType() { // CHECK:STDOUT: %v.var_patt: %pattern_type.cb1 = var_pattern %v.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %empty_tuple.type = var %v.var_patt -// CHECK:STDOUT: %.loc12_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc12_25.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc12_12: init %empty_tuple.type = converted %.loc12_25.1, %.loc12_25.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc12_32.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc12_32.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc12_12: init %empty_tuple.type = converted %.loc12_32.1, %.loc12_32.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: assign %v.var, %.loc12_12 -// CHECK:STDOUT: %.loc12_20.1: type = splice_block %.loc12_20.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc12_20.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc12_20.3: type = converted %.loc12_20.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc12_27.1: type = splice_block %.loc12_27.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc12_27.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc12_27.3: type = converted %.loc12_27.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref %empty_tuple.type = ref_binding v, %v.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %v.var, constants.%DestroyOp diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index 3c2e09ae5399..52391b05222b 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -15,14 +15,14 @@ fn SameScope() -> i32 { if (true) { returned var v: i32 = 0; - // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE+7]]:18: error: cannot declare a `returned var` in the scope of another `returned var` [ReturnedVarShadowed] - // CHECK:STDERR: returned var w: i32 = 1; - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE+7]]:25: error: cannot declare a `returned var` in the scope of another `returned var` [ReturnedVarShadowed] + // CHECK:STDERR: returned var unused w: i32 = 1; + // CHECK:STDERR: ^ // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE-4]]:18: note: `returned var` was declared here [ReturnedVarHere] // CHECK:STDERR: returned var v: i32 = 0; // CHECK:STDERR: ^ // CHECK:STDERR: - returned var w: i32 = 1; + returned var unused w: i32 = 1; } return 0; } @@ -31,14 +31,14 @@ fn DifferentScopes() -> i32 { if (true) { returned var v: i32 = 0; if (true) { - // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE+7]]:20: error: cannot declare a `returned var` in the scope of another `returned var` [ReturnedVarShadowed] - // CHECK:STDERR: returned var w: i32 = 1; - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE+7]]:27: error: cannot declare a `returned var` in the scope of another `returned var` [ReturnedVarShadowed] + // CHECK:STDERR: returned var unused w: i32 = 1; + // CHECK:STDERR: ^ // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE-5]]:18: note: `returned var` was declared here [ReturnedVarHere] // CHECK:STDERR: returned var v: i32 = 0; // CHECK:STDERR: ^ // CHECK:STDERR: - returned var w: i32 = 1; + returned var unused w: i32 = 1; } } return 0; @@ -166,7 +166,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25: init %i32 = call %bound_method.loc25_14.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc25_14: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %w.var, %.loc25_14 -// CHECK:STDOUT: %.loc25_21: type = splice_block %i32.loc25 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc25_28: type = splice_block %i32.loc25 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } @@ -231,7 +231,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc41: init %i32 = call %bound_method.loc41_16.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc41_16: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc41 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: assign %w.var, %.loc41_16 -// CHECK:STDOUT: %.loc41_23: type = splice_block %i32.loc41 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc41_30: type = splice_block %i32.loc41 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32.loc41: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc41: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/import_convert_function.carbon b/toolchain/check/testdata/return/import_convert_function.carbon index d06fcbffa0a7..53400e5d827e 100644 --- a/toolchain/check/testdata/return/import_convert_function.carbon +++ b/toolchain/check/testdata/return/import_convert_function.carbon @@ -20,14 +20,14 @@ class C(N:! i32) {} class D { var n: i32; var m: i32; } fn Make() -> D { return {.n = 0, .m = 0}; } -impl C(0) as Core.ImplicitAs(D) { fn Convert[self: Self]() -> D { return Make(); } } -impl C(1) as Core.ImplicitAs(D) { fn Convert[self: Self]() -> D { return Make(); } } -impl C(2) as Core.ImplicitAs(D) { fn Convert[self: Self]() -> D { return Make(); } } -impl C(3) as Core.ImplicitAs(D) { fn Convert[self: Self]() -> D { return Make(); } } -impl C(4) as Core.ImplicitAs(D) { fn Convert[self: Self]() -> D { return Make(); } } -impl C(5) as Core.ImplicitAs(D) { fn Convert[self: Self]() -> D { return Make(); } } -impl C(6) as Core.ImplicitAs(D) { fn Convert[self: Self]() -> D { return Make(); } } -impl C(7) as Core.ImplicitAs(D) { fn Convert[self: Self]() -> D { return Make(); } } +impl C(0) as Core.ImplicitAs(D) { fn Convert[unused self: Self]() -> D { return Make(); } } +impl C(1) as Core.ImplicitAs(D) { fn Convert[unused self: Self]() -> D { return Make(); } } +impl C(2) as Core.ImplicitAs(D) { fn Convert[unused self: Self]() -> D { return Make(); } } +impl C(3) as Core.ImplicitAs(D) { fn Convert[unused self: Self]() -> D { return Make(); } } +impl C(4) as Core.ImplicitAs(D) { fn Convert[unused self: Self]() -> D { return Make(); } } +impl C(5) as Core.ImplicitAs(D) { fn Convert[unused self: Self]() -> D { return Make(); } } +impl C(6) as Core.ImplicitAs(D) { fn Convert[unused self: Self]() -> D { return Make(); } } +impl C(7) as Core.ImplicitAs(D) { fn Convert[unused self: Self]() -> D { return Make(); } } // --- user.carbon @@ -35,7 +35,7 @@ import P library "library"; // Check that we don't crash if we import functions and reallocate the function // value store while handling a `return` statement. -fn F0(n: i32) -> P.D { +fn F0(unused n: i32) -> P.D { if (false) { return {} as P.C(0); } if (false) { return {} as P.C(1); } if (false) { return {} as P.C(2); } @@ -342,7 +342,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param_patt: %pattern_type.c49 = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %.loc8_63.2: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.b61] +// CHECK:STDOUT: %.loc8_70.2: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.b61] // CHECK:STDOUT: %self.param: %C.4f5 = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.ImplicitAs.impl.c43.%C [concrete = constants.%C.4f5] // CHECK:STDOUT: %self: %C.4f5 = value_binding self, %self.param @@ -367,7 +367,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param_patt: %pattern_type.c49 = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %.loc9_63.2: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.b61] +// CHECK:STDOUT: %.loc9_70.2: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.b61] // CHECK:STDOUT: %self.param: %C.95b = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.ImplicitAs.impl.7c3.%C [concrete = constants.%C.95b] // CHECK:STDOUT: %self: %C.95b = value_binding self, %self.param @@ -392,7 +392,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param_patt: %pattern_type.c49 = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %.loc10_63.2: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.b61] +// CHECK:STDOUT: %.loc10_70.2: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.b61] // CHECK:STDOUT: %self.param: %C.a93 = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.ImplicitAs.impl.fa3.%C [concrete = constants.%C.a93] // CHECK:STDOUT: %self: %C.a93 = value_binding self, %self.param @@ -417,7 +417,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param_patt: %pattern_type.c49 = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %.loc11_63.2: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.b61] +// CHECK:STDOUT: %.loc11_70.2: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.b61] // CHECK:STDOUT: %self.param: %C.1d7 = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.ImplicitAs.impl.158.%C [concrete = constants.%C.1d7] // CHECK:STDOUT: %self: %C.1d7 = value_binding self, %self.param @@ -442,7 +442,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param_patt: %pattern_type.c49 = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %.loc12_63.2: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.b61] +// CHECK:STDOUT: %.loc12_70.2: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.b61] // CHECK:STDOUT: %self.param: %C.e40 = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.ImplicitAs.impl.f64.%C [concrete = constants.%C.e40] // CHECK:STDOUT: %self: %C.e40 = value_binding self, %self.param @@ -467,7 +467,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param_patt: %pattern_type.c49 = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %.loc13_63.2: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.b61] +// CHECK:STDOUT: %.loc13_70.2: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.b61] // CHECK:STDOUT: %self.param: %C.3f1 = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.ImplicitAs.impl.d86.%C [concrete = constants.%C.3f1] // CHECK:STDOUT: %self: %C.3f1 = value_binding self, %self.param @@ -492,7 +492,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param_patt: %pattern_type.c49 = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %.loc14_63.2: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.b61] +// CHECK:STDOUT: %.loc14_70.2: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.b61] // CHECK:STDOUT: %self.param: %C.0fa = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.ImplicitAs.impl.f13.%C [concrete = constants.%C.0fa] // CHECK:STDOUT: %self: %C.0fa = value_binding self, %self.param @@ -517,7 +517,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param_patt: %pattern_type.c49 = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %.loc15_63.2: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.b61] +// CHECK:STDOUT: %.loc15_70.2: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.b61] // CHECK:STDOUT: %self.param: %C.2b7 = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.ImplicitAs.impl.83b.%C [concrete = constants.%C.2b7] // CHECK:STDOUT: %self: %C.2b7 = value_binding self, %self.param @@ -593,64 +593,64 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.loc8(%self.param: %C.4f5) -> out %return.param: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc8_63.1: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %Make.call: init %D to %.loc8_63.1 = call %Make.ref() +// CHECK:STDOUT: %.loc8_70.1: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %Make.call: init %D to %.loc8_70.1 = call %Make.ref() // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.loc9(%self.param: %C.95b) -> out %return.param: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc9_63.1: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %Make.call: init %D to %.loc9_63.1 = call %Make.ref() +// CHECK:STDOUT: %.loc9_70.1: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %Make.call: init %D to %.loc9_70.1 = call %Make.ref() // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.loc10(%self.param: %C.a93) -> out %return.param: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc10_63.1: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %Make.call: init %D to %.loc10_63.1 = call %Make.ref() +// CHECK:STDOUT: %.loc10_70.1: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %Make.call: init %D to %.loc10_70.1 = call %Make.ref() // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.loc11(%self.param: %C.1d7) -> out %return.param: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc11_63.1: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %Make.call: init %D to %.loc11_63.1 = call %Make.ref() +// CHECK:STDOUT: %.loc11_70.1: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %Make.call: init %D to %.loc11_70.1 = call %Make.ref() // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.loc12(%self.param: %C.e40) -> out %return.param: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc12_63.1: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %Make.call: init %D to %.loc12_63.1 = call %Make.ref() +// CHECK:STDOUT: %.loc12_70.1: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %Make.call: init %D to %.loc12_70.1 = call %Make.ref() // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.loc13(%self.param: %C.3f1) -> out %return.param: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc13_63.1: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %Make.call: init %D to %.loc13_63.1 = call %Make.ref() +// CHECK:STDOUT: %.loc13_70.1: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %Make.call: init %D to %.loc13_70.1 = call %Make.ref() // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.loc14(%self.param: %C.0fa) -> out %return.param: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc14_63.1: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %Make.call: init %D to %.loc14_63.1 = call %Make.ref() +// CHECK:STDOUT: %.loc14_70.1: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %Make.call: init %D to %.loc14_70.1 = call %Make.ref() // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.loc15(%self.param: %C.2b7) -> out %return.param: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc15_63.1: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %Make.call: init %D to %.loc15_63.1 = call %Make.ref() +// CHECK:STDOUT: %.loc15_70.1: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %Make.call: init %D to %.loc15_70.1 = call %Make.ref() // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: @@ -911,22 +911,22 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %P.import_ref.24c: = import_ref P//library, loc15_33, loaded [concrete = constants.%ImplicitAs.impl_witness.356] // CHECK:STDOUT: %P.import_ref.854: type = import_ref P//library, loc15_9, loaded [concrete = constants.%C.304] // CHECK:STDOUT: %P.import_ref.68d5e2.8: type = import_ref P//library, loc15_31, loaded [concrete = constants.%ImplicitAs.type.899] -// CHECK:STDOUT: %P.import_ref.623: %C.as.ImplicitAs.impl.Convert.type.994 = import_ref P//library, loc8_65, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.78d] +// CHECK:STDOUT: %P.import_ref.623: %C.as.ImplicitAs.impl.Convert.type.994 = import_ref P//library, loc8_72, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.78d] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1e8 = impl_witness_table (%P.import_ref.623), @C.as.ImplicitAs.impl.87c [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] -// CHECK:STDOUT: %P.import_ref.a4a: %C.as.ImplicitAs.impl.Convert.type.900 = import_ref P//library, loc9_65, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.b44] +// CHECK:STDOUT: %P.import_ref.a4a: %C.as.ImplicitAs.impl.Convert.type.900 = import_ref P//library, loc9_72, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.b44] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.c5c = impl_witness_table (%P.import_ref.a4a), @C.as.ImplicitAs.impl.a01 [concrete] -// CHECK:STDOUT: %P.import_ref.e4a: %C.as.ImplicitAs.impl.Convert.type.ae1 = import_ref P//library, loc10_65, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.dd6] +// CHECK:STDOUT: %P.import_ref.e4a: %C.as.ImplicitAs.impl.Convert.type.ae1 = import_ref P//library, loc10_72, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.dd6] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.5db = impl_witness_table (%P.import_ref.e4a), @C.as.ImplicitAs.impl.390 [concrete] -// CHECK:STDOUT: %P.import_ref.b26b: %C.as.ImplicitAs.impl.Convert.type.cbe = import_ref P//library, loc11_65, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.d1c] +// CHECK:STDOUT: %P.import_ref.b26b: %C.as.ImplicitAs.impl.Convert.type.cbe = import_ref P//library, loc11_72, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.d1c] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.126 = impl_witness_table (%P.import_ref.b26b), @C.as.ImplicitAs.impl.071 [concrete] -// CHECK:STDOUT: %P.import_ref.6da: %C.as.ImplicitAs.impl.Convert.type.876 = import_ref P//library, loc12_65, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.db5] +// CHECK:STDOUT: %P.import_ref.6da: %C.as.ImplicitAs.impl.Convert.type.876 = import_ref P//library, loc12_72, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.db5] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.92c = impl_witness_table (%P.import_ref.6da), @C.as.ImplicitAs.impl.891 [concrete] -// CHECK:STDOUT: %P.import_ref.200: %C.as.ImplicitAs.impl.Convert.type.043 = import_ref P//library, loc13_65, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.a63] +// CHECK:STDOUT: %P.import_ref.200: %C.as.ImplicitAs.impl.Convert.type.043 = import_ref P//library, loc13_72, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.a63] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.d8f = impl_witness_table (%P.import_ref.200), @C.as.ImplicitAs.impl.882 [concrete] -// CHECK:STDOUT: %P.import_ref.010: %C.as.ImplicitAs.impl.Convert.type.7be = import_ref P//library, loc14_65, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.e2f] +// CHECK:STDOUT: %P.import_ref.010: %C.as.ImplicitAs.impl.Convert.type.7be = import_ref P//library, loc14_72, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.e2f] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.70a = impl_witness_table (%P.import_ref.010), @C.as.ImplicitAs.impl.ad9 [concrete] -// CHECK:STDOUT: %P.import_ref.624: %C.as.ImplicitAs.impl.Convert.type.c30 = import_ref P//library, loc15_65, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.5ea] +// CHECK:STDOUT: %P.import_ref.624: %C.as.ImplicitAs.impl.Convert.type.c30 = import_ref P//library, loc15_72, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.5ea] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.575 = impl_witness_table (%P.import_ref.624), @C.as.ImplicitAs.impl.5d4 [concrete] // CHECK:STDOUT: %P.Make: %Make.type = import_ref P//library, Make, loaded [concrete = constants.%Make] // CHECK:STDOUT: } @@ -947,9 +947,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } { // CHECK:STDOUT: %P.ref.loc6: = name_ref P, imports.%P [concrete = imports.%P] // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%P.D [concrete = constants.%D] -// CHECK:STDOUT: %.loc6_19.10: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.db5] +// CHECK:STDOUT: %.loc6_26.10: Core.Form = init_form %D.ref, call_param1 [concrete = constants.%.db5] // CHECK:STDOUT: %n.param: %i32 = value_param call_param0 -// CHECK:STDOUT: %.loc6_10: type = splice_block %i32 [concrete = constants.%i32] { +// CHECK:STDOUT: %.loc6_17: type = splice_block %i32 [concrete = constants.%i32] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: } @@ -1045,9 +1045,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc7_26.1: ref %C.b00 = converted %.loc7_24.1, %.loc7_24.4 // CHECK:STDOUT: %impl.elem0.loc7_35: %.866 = impl_witness_access constants.%ImplicitAs.impl_witness.01b, element0 [concrete = constants.%C.as.ImplicitAs.impl.Convert.78d] // CHECK:STDOUT: %bound_method.loc7_35: = bound_method %.loc7_26.1, %impl.elem0.loc7_35 -// CHECK:STDOUT: %.loc6_19.1: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %.loc6_26.1: ref %D = splice_block %return.param {} // CHECK:STDOUT: %.loc7_26.2: %C.b00 = acquire_value %.loc7_26.1 -// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc7: init %D to %.loc6_19.1 = call %bound_method.loc7_35(%.loc7_26.2) +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc7: init %D to %.loc6_26.1 = call %bound_method.loc7_35(%.loc7_26.2) // CHECK:STDOUT: %.loc7_35: init %D = converted %.loc7_26.1, %C.as.ImplicitAs.impl.Convert.call.loc7 // CHECK:STDOUT: %DestroyOp.bound.loc7_24.1: = bound_method %.loc7_24.4, constants.%DestroyOp.b0ebf8.1 // CHECK:STDOUT: %DestroyOp.call.loc7_24.1: init %empty_tuple.type = call %DestroyOp.bound.loc7_24.1(%.loc7_24.4) @@ -1076,9 +1076,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc8_26.1: ref %C.674 = converted %.loc8_24.1, %.loc8_24.4 // CHECK:STDOUT: %impl.elem0.loc8_35: %.86b = impl_witness_access constants.%ImplicitAs.impl_witness.638, element0 [concrete = constants.%C.as.ImplicitAs.impl.Convert.b44] // CHECK:STDOUT: %bound_method.loc8_35: = bound_method %.loc8_26.1, %impl.elem0.loc8_35 -// CHECK:STDOUT: %.loc6_19.2: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %.loc6_26.2: ref %D = splice_block %return.param {} // CHECK:STDOUT: %.loc8_26.2: %C.674 = acquire_value %.loc8_26.1 -// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc8: init %D to %.loc6_19.2 = call %bound_method.loc8_35(%.loc8_26.2) +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc8: init %D to %.loc6_26.2 = call %bound_method.loc8_35(%.loc8_26.2) // CHECK:STDOUT: %.loc8_35: init %D = converted %.loc8_26.1, %C.as.ImplicitAs.impl.Convert.call.loc8 // CHECK:STDOUT: %DestroyOp.bound.loc8_24.1: = bound_method %.loc8_24.4, constants.%DestroyOp.b0ebf8.2 // CHECK:STDOUT: %DestroyOp.call.loc8_24.1: init %empty_tuple.type = call %DestroyOp.bound.loc8_24.1(%.loc8_24.4) @@ -1109,9 +1109,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc9_26.1: ref %C.681 = converted %.loc9_24.1, %.loc9_24.4 // CHECK:STDOUT: %impl.elem0.loc9_35: %.bfa = impl_witness_access constants.%ImplicitAs.impl_witness.a8d, element0 [concrete = constants.%C.as.ImplicitAs.impl.Convert.dd6] // CHECK:STDOUT: %bound_method.loc9_35: = bound_method %.loc9_26.1, %impl.elem0.loc9_35 -// CHECK:STDOUT: %.loc6_19.3: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %.loc6_26.3: ref %D = splice_block %return.param {} // CHECK:STDOUT: %.loc9_26.2: %C.681 = acquire_value %.loc9_26.1 -// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc9: init %D to %.loc6_19.3 = call %bound_method.loc9_35(%.loc9_26.2) +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc9: init %D to %.loc6_26.3 = call %bound_method.loc9_35(%.loc9_26.2) // CHECK:STDOUT: %.loc9_35: init %D = converted %.loc9_26.1, %C.as.ImplicitAs.impl.Convert.call.loc9 // CHECK:STDOUT: %DestroyOp.bound.loc9_24.1: = bound_method %.loc9_24.4, constants.%DestroyOp.b0ebf8.3 // CHECK:STDOUT: %DestroyOp.call.loc9_24.1: init %empty_tuple.type = call %DestroyOp.bound.loc9_24.1(%.loc9_24.4) @@ -1144,9 +1144,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc10_26.1: ref %C.7ac = converted %.loc10_24.1, %.loc10_24.4 // CHECK:STDOUT: %impl.elem0.loc10_35: %.a2c = impl_witness_access constants.%ImplicitAs.impl_witness.56b, element0 [concrete = constants.%C.as.ImplicitAs.impl.Convert.d1c] // CHECK:STDOUT: %bound_method.loc10_35: = bound_method %.loc10_26.1, %impl.elem0.loc10_35 -// CHECK:STDOUT: %.loc6_19.4: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %.loc6_26.4: ref %D = splice_block %return.param {} // CHECK:STDOUT: %.loc10_26.2: %C.7ac = acquire_value %.loc10_26.1 -// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc10: init %D to %.loc6_19.4 = call %bound_method.loc10_35(%.loc10_26.2) +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc10: init %D to %.loc6_26.4 = call %bound_method.loc10_35(%.loc10_26.2) // CHECK:STDOUT: %.loc10_35: init %D = converted %.loc10_26.1, %C.as.ImplicitAs.impl.Convert.call.loc10 // CHECK:STDOUT: %DestroyOp.bound.loc10_24.1: = bound_method %.loc10_24.4, constants.%DestroyOp.b0ebf8.4 // CHECK:STDOUT: %DestroyOp.call.loc10_24.1: init %empty_tuple.type = call %DestroyOp.bound.loc10_24.1(%.loc10_24.4) @@ -1181,9 +1181,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc11_26.1: ref %C.89d = converted %.loc11_24.1, %.loc11_24.4 // CHECK:STDOUT: %impl.elem0.loc11_35: %.c32 = impl_witness_access constants.%ImplicitAs.impl_witness.e05, element0 [concrete = constants.%C.as.ImplicitAs.impl.Convert.db5] // CHECK:STDOUT: %bound_method.loc11_35: = bound_method %.loc11_26.1, %impl.elem0.loc11_35 -// CHECK:STDOUT: %.loc6_19.5: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %.loc6_26.5: ref %D = splice_block %return.param {} // CHECK:STDOUT: %.loc11_26.2: %C.89d = acquire_value %.loc11_26.1 -// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc11: init %D to %.loc6_19.5 = call %bound_method.loc11_35(%.loc11_26.2) +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc11: init %D to %.loc6_26.5 = call %bound_method.loc11_35(%.loc11_26.2) // CHECK:STDOUT: %.loc11_35: init %D = converted %.loc11_26.1, %C.as.ImplicitAs.impl.Convert.call.loc11 // CHECK:STDOUT: %DestroyOp.bound.loc11_24.1: = bound_method %.loc11_24.4, constants.%DestroyOp.b0ebf8.5 // CHECK:STDOUT: %DestroyOp.call.loc11_24.1: init %empty_tuple.type = call %DestroyOp.bound.loc11_24.1(%.loc11_24.4) @@ -1220,9 +1220,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc12_26.1: ref %C.f0a = converted %.loc12_24.1, %.loc12_24.4 // CHECK:STDOUT: %impl.elem0.loc12_35: %.df3 = impl_witness_access constants.%ImplicitAs.impl_witness.262, element0 [concrete = constants.%C.as.ImplicitAs.impl.Convert.a63] // CHECK:STDOUT: %bound_method.loc12_35: = bound_method %.loc12_26.1, %impl.elem0.loc12_35 -// CHECK:STDOUT: %.loc6_19.6: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %.loc6_26.6: ref %D = splice_block %return.param {} // CHECK:STDOUT: %.loc12_26.2: %C.f0a = acquire_value %.loc12_26.1 -// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc12: init %D to %.loc6_19.6 = call %bound_method.loc12_35(%.loc12_26.2) +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc12: init %D to %.loc6_26.6 = call %bound_method.loc12_35(%.loc12_26.2) // CHECK:STDOUT: %.loc12_35: init %D = converted %.loc12_26.1, %C.as.ImplicitAs.impl.Convert.call.loc12 // CHECK:STDOUT: %DestroyOp.bound.loc12_24.1: = bound_method %.loc12_24.4, constants.%DestroyOp.b0ebf8.6 // CHECK:STDOUT: %DestroyOp.call.loc12_24.1: init %empty_tuple.type = call %DestroyOp.bound.loc12_24.1(%.loc12_24.4) @@ -1261,9 +1261,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc13_26.1: ref %C.c60 = converted %.loc13_24.1, %.loc13_24.4 // CHECK:STDOUT: %impl.elem0.loc13_35: %.4a2 = impl_witness_access constants.%ImplicitAs.impl_witness.7d1, element0 [concrete = constants.%C.as.ImplicitAs.impl.Convert.e2f] // CHECK:STDOUT: %bound_method.loc13_35: = bound_method %.loc13_26.1, %impl.elem0.loc13_35 -// CHECK:STDOUT: %.loc6_19.7: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %.loc6_26.7: ref %D = splice_block %return.param {} // CHECK:STDOUT: %.loc13_26.2: %C.c60 = acquire_value %.loc13_26.1 -// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc13: init %D to %.loc6_19.7 = call %bound_method.loc13_35(%.loc13_26.2) +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc13: init %D to %.loc6_26.7 = call %bound_method.loc13_35(%.loc13_26.2) // CHECK:STDOUT: %.loc13_35: init %D = converted %.loc13_26.1, %C.as.ImplicitAs.impl.Convert.call.loc13 // CHECK:STDOUT: %DestroyOp.bound.loc13_24.1: = bound_method %.loc13_24.4, constants.%DestroyOp.b0ebf8.7 // CHECK:STDOUT: %DestroyOp.call.loc13_24.1: init %empty_tuple.type = call %DestroyOp.bound.loc13_24.1(%.loc13_24.4) @@ -1304,9 +1304,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc14_26.1: ref %C.304 = converted %.loc14_24.1, %.loc14_24.4 // CHECK:STDOUT: %impl.elem0.loc14_35: %.ad8 = impl_witness_access constants.%ImplicitAs.impl_witness.356, element0 [concrete = constants.%C.as.ImplicitAs.impl.Convert.5ea] // CHECK:STDOUT: %bound_method.loc14_35: = bound_method %.loc14_26.1, %impl.elem0.loc14_35 -// CHECK:STDOUT: %.loc6_19.8: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %.loc6_26.8: ref %D = splice_block %return.param {} // CHECK:STDOUT: %.loc14_26.2: %C.304 = acquire_value %.loc14_26.1 -// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc14: init %D to %.loc6_19.8 = call %bound_method.loc14_35(%.loc14_26.2) +// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc14: init %D to %.loc6_26.8 = call %bound_method.loc14_35(%.loc14_26.2) // CHECK:STDOUT: %.loc14_35: init %D = converted %.loc14_26.1, %C.as.ImplicitAs.impl.Convert.call.loc14 // CHECK:STDOUT: %DestroyOp.bound.loc14_24.1: = bound_method %.loc14_24.4, constants.%DestroyOp.b0ebf8.8 // CHECK:STDOUT: %DestroyOp.call.loc14_24.1: init %empty_tuple.type = call %DestroyOp.bound.loc14_24.1(%.loc14_24.4) @@ -1329,8 +1329,8 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: !if.else.loc14: // CHECK:STDOUT: %P.ref.loc15: = name_ref P, imports.%P [concrete = imports.%P] // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, imports.%P.Make [concrete = constants.%Make] -// CHECK:STDOUT: %.loc6_19.9: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %Make.call: init %D to %.loc6_19.9 = call %Make.ref() +// CHECK:STDOUT: %.loc6_26.9: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %Make.call: init %D to %.loc6_26.9 = call %Make.ref() // CHECK:STDOUT: %DestroyOp.bound.loc14_24.2: = bound_method %.loc14_24.4, constants.%DestroyOp.b0ebf8.8 // CHECK:STDOUT: %DestroyOp.call.loc14_24.2: init %empty_tuple.type = call %DestroyOp.bound.loc14_24.2(%.loc14_24.4) // CHECK:STDOUT: %DestroyOp.bound.loc13_24.3: = bound_method %.loc13_24.4, constants.%DestroyOp.b0ebf8.7 diff --git a/toolchain/check/testdata/struct/nested_struct_in_place.carbon b/toolchain/check/testdata/struct/nested_struct_in_place.carbon index 59a5fed63c75..78afd544fe1d 100644 --- a/toolchain/check/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/check/testdata/struct/nested_struct_in_place.carbon @@ -15,7 +15,7 @@ fn F() -> (i32, i32, i32); fn G() { - var v: {.a: (i32, i32, i32), .b: (i32, i32, i32)} = {.a = F(), .b = F()}; + var unused v: {.a: (i32, i32, i32), .b: (i32, i32, i32)} = {.a = F(), .b = F()}; } // CHECK:STDOUT: --- nested_struct_in_place.carbon @@ -88,33 +88,33 @@ fn G() { // CHECK:STDOUT: %v.var_patt: %pattern_type.3c2 = var_pattern %v.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %struct_type.a.b.2f9 = var %v.var_patt -// CHECK:STDOUT: %F.ref.loc18_61: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %.loc18_74.1: ref %tuple.type.189 = struct_access %v.var, element0 -// CHECK:STDOUT: %F.call.loc18_63: init %tuple.type.189 to %.loc18_74.1 = call %F.ref.loc18_61() -// CHECK:STDOUT: %F.ref.loc18_71: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %.loc18_74.2: ref %tuple.type.189 = struct_access %v.var, element1 -// CHECK:STDOUT: %F.call.loc18_73: init %tuple.type.189 to %.loc18_74.2 = call %F.ref.loc18_71() -// CHECK:STDOUT: %.loc18_74.3: %struct_type.a.b.2f9 = struct_literal (%F.call.loc18_63, %F.call.loc18_73) -// CHECK:STDOUT: %.loc18_74.4: init %struct_type.a.b.2f9 to %v.var = struct_init (%F.call.loc18_63, %F.call.loc18_73) -// CHECK:STDOUT: %.loc18_3: init %struct_type.a.b.2f9 = converted %.loc18_74.3, %.loc18_74.4 +// CHECK:STDOUT: %F.ref.loc18_68: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] +// CHECK:STDOUT: %.loc18_81.1: ref %tuple.type.189 = struct_access %v.var, element0 +// CHECK:STDOUT: %F.call.loc18_70: init %tuple.type.189 to %.loc18_81.1 = call %F.ref.loc18_68() +// CHECK:STDOUT: %F.ref.loc18_78: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] +// CHECK:STDOUT: %.loc18_81.2: ref %tuple.type.189 = struct_access %v.var, element1 +// CHECK:STDOUT: %F.call.loc18_80: init %tuple.type.189 to %.loc18_81.2 = call %F.ref.loc18_78() +// CHECK:STDOUT: %.loc18_81.3: %struct_type.a.b.2f9 = struct_literal (%F.call.loc18_70, %F.call.loc18_80) +// CHECK:STDOUT: %.loc18_81.4: init %struct_type.a.b.2f9 to %v.var = struct_init (%F.call.loc18_70, %F.call.loc18_80) +// CHECK:STDOUT: %.loc18_3: init %struct_type.a.b.2f9 = converted %.loc18_81.3, %.loc18_81.4 // CHECK:STDOUT: assign %v.var, %.loc18_3 -// CHECK:STDOUT: %.loc18_51: type = splice_block %struct_type.a.b [concrete = constants.%struct_type.a.b.2f9] { -// CHECK:STDOUT: %int_32.loc18_16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.loc18_21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.loc18_26: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_26: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc18_29.1: %tuple.type.ff9 = tuple_literal (%i32.loc18_16, %i32.loc18_21, %i32.loc18_26) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc18_29.2: type = converted %.loc18_29.1, constants.%tuple.type.189 [concrete = constants.%tuple.type.189] -// CHECK:STDOUT: %int_32.loc18_37: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_37: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.loc18_42: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_42: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.loc18_47: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_47: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc18_50.1: %tuple.type.ff9 = tuple_literal (%i32.loc18_37, %i32.loc18_42, %i32.loc18_47) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc18_50.2: type = converted %.loc18_50.1, constants.%tuple.type.189 [concrete = constants.%tuple.type.189] +// CHECK:STDOUT: %.loc18_58: type = splice_block %struct_type.a.b [concrete = constants.%struct_type.a.b.2f9] { +// CHECK:STDOUT: %int_32.loc18_23: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc18_23: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc18_28: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc18_28: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc18_33: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc18_33: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc18_36.1: %tuple.type.ff9 = tuple_literal (%i32.loc18_23, %i32.loc18_28, %i32.loc18_33) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc18_36.2: type = converted %.loc18_36.1, constants.%tuple.type.189 [concrete = constants.%tuple.type.189] +// CHECK:STDOUT: %int_32.loc18_44: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc18_44: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc18_49: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc18_49: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc18_54: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc18_54: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc18_57.1: %tuple.type.ff9 = tuple_literal (%i32.loc18_44, %i32.loc18_49, %i32.loc18_54) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc18_57.2: type = converted %.loc18_57.1, constants.%tuple.type.189 [concrete = constants.%tuple.type.189] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %tuple.type.189, .b: %tuple.type.189} [concrete = constants.%struct_type.a.b.2f9] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref %struct_type.a.b.2f9 = ref_binding v, %v.var diff --git a/toolchain/check/testdata/tuple/element_access.carbon b/toolchain/check/testdata/tuple/element_access.carbon index 36b0587d1605..61ba78aebad1 100644 --- a/toolchain/check/testdata/tuple/element_access.carbon +++ b/toolchain/check/testdata/tuple/element_access.carbon @@ -37,7 +37,7 @@ interface I { } impl (i32, i32) as I { - fn F[self: Self]() {} + fn F[unused self: Self]() {} } fn G(x: (i32, i32)) { @@ -60,7 +60,7 @@ impl (i32, i32) as I { // This requires a thunk due to the return type mismatch. // The thunk internally contains an element access of the form // `self.(RealF)()`. - fn F[self: Self]() -> Derived* { return &d; } + fn F[unused self: Self]() -> Derived* { return &d; } } fn G(x: (i32, i32)) { @@ -174,11 +174,11 @@ library "[[@TEST_NAME]]"; fn Main() { var non_tuple: array(i32, 2) = (5, 5); - // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+4]]:20: error: type `array(i32, 2)` does not support tuple indexing; only tuples can be indexed that way [TupleIndexOnANonTupleType] - // CHECK:STDERR: var first: i32 = non_tuple.0; - // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+4]]:27: error: type `array(i32, 2)` does not support tuple indexing; only tuples can be indexed that way [TupleIndexOnANonTupleType] + // CHECK:STDERR: var unused first: i32 = non_tuple.0; + // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: - var first: i32 = non_tuple.0; + var unused first: i32 = non_tuple.0; } // --- fail_out_of_bound_access.carbon diff --git a/toolchain/check/testdata/tuple/in_place_tuple_init.carbon b/toolchain/check/testdata/tuple/in_place_tuple_init.carbon index 381711418196..dddc119effbe 100644 --- a/toolchain/check/testdata/tuple/in_place_tuple_init.carbon +++ b/toolchain/check/testdata/tuple/in_place_tuple_init.carbon @@ -36,13 +36,13 @@ fn F() -> (i32, i32, i32); fn G() { //@dump-sem-ir-begin - var v: ((i32, i32, i32), (i32, i32, i32)) = (F(), F()); + var unused v: ((i32, i32, i32), (i32, i32, i32)) = (F(), F()); //@dump-sem-ir-end } fn H() { //@dump-sem-ir-begin - var v: (i32, (i32, i32, i32), i32) = (1, F(), 2); + var unused v: (i32, (i32, i32, i32), i32) = (1, F(), 2); //@dump-sem-ir-end } @@ -192,35 +192,35 @@ fn H() { // CHECK:STDOUT: %v.var_patt: %pattern_type.d88 = var_pattern %v.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %tuple.type.99b = var %v.var_patt -// CHECK:STDOUT: %F.ref.loc7_48: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] +// CHECK:STDOUT: %F.ref.loc7_55: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] // CHECK:STDOUT: %tuple.elem0: ref %tuple.type.189 = tuple_access %v.var, element0 -// CHECK:STDOUT: %F.call.loc7_50: init %tuple.type.189 to %tuple.elem0 = call %F.ref.loc7_48() -// CHECK:STDOUT: %F.ref.loc7_53: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] +// CHECK:STDOUT: %F.call.loc7_57: init %tuple.type.189 to %tuple.elem0 = call %F.ref.loc7_55() +// CHECK:STDOUT: %F.ref.loc7_60: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] // CHECK:STDOUT: %tuple.elem1: ref %tuple.type.189 = tuple_access %v.var, element1 -// CHECK:STDOUT: %F.call.loc7_55: init %tuple.type.189 to %tuple.elem1 = call %F.ref.loc7_53() -// CHECK:STDOUT: %.loc7_56.1: %tuple.type.99b = tuple_literal (%F.call.loc7_50, %F.call.loc7_55) -// CHECK:STDOUT: %.loc7_56.2: init %tuple.type.99b to %v.var = tuple_init (%F.call.loc7_50, %F.call.loc7_55) -// CHECK:STDOUT: %.loc7_3: init %tuple.type.99b = converted %.loc7_56.1, %.loc7_56.2 +// CHECK:STDOUT: %F.call.loc7_62: init %tuple.type.189 to %tuple.elem1 = call %F.ref.loc7_60() +// CHECK:STDOUT: %.loc7_63.1: %tuple.type.99b = tuple_literal (%F.call.loc7_57, %F.call.loc7_62) +// CHECK:STDOUT: %.loc7_63.2: init %tuple.type.99b to %v.var = tuple_init (%F.call.loc7_57, %F.call.loc7_62) +// CHECK:STDOUT: %.loc7_3: init %tuple.type.99b = converted %.loc7_63.1, %.loc7_63.2 // CHECK:STDOUT: assign %v.var, %.loc7_3 -// CHECK:STDOUT: %.loc7_43.1: type = splice_block %.loc7_43.5 [concrete = constants.%tuple.type.99b] { -// CHECK:STDOUT: %int_32.loc7_12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc7_25: %tuple.type.ff9 = tuple_literal (%i32.loc7_12, %i32.loc7_17, %i32.loc7_22) [concrete = constants.%tuple.e64] +// CHECK:STDOUT: %.loc7_50.1: type = splice_block %.loc7_50.5 [concrete = constants.%tuple.type.99b] { +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc7_24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %int_32.loc7_29: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32.loc7_29: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_34: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_34: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_39: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_39: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc7_42: %tuple.type.ff9 = tuple_literal (%i32.loc7_29, %i32.loc7_34, %i32.loc7_39) [concrete = constants.%tuple.e64] -// CHECK:STDOUT: %.loc7_43.2: %tuple.type.f9f = tuple_literal (%.loc7_25, %.loc7_42) [concrete = constants.%tuple.9e5] -// CHECK:STDOUT: %.loc7_43.3: type = converted constants.%tuple.e64, constants.%tuple.type.189 [concrete = constants.%tuple.type.189] -// CHECK:STDOUT: %.loc7_43.4: type = converted constants.%tuple.e64, constants.%tuple.type.189 [concrete = constants.%tuple.type.189] -// CHECK:STDOUT: %.loc7_43.5: type = converted %.loc7_43.2, constants.%tuple.type.99b [concrete = constants.%tuple.type.99b] +// CHECK:STDOUT: %.loc7_32: %tuple.type.ff9 = tuple_literal (%i32.loc7_19, %i32.loc7_24, %i32.loc7_29) [concrete = constants.%tuple.e64] +// CHECK:STDOUT: %int_32.loc7_36: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_36: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc7_41: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_41: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc7_46: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_46: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc7_49: %tuple.type.ff9 = tuple_literal (%i32.loc7_36, %i32.loc7_41, %i32.loc7_46) [concrete = constants.%tuple.e64] +// CHECK:STDOUT: %.loc7_50.2: %tuple.type.f9f = tuple_literal (%.loc7_32, %.loc7_49) [concrete = constants.%tuple.9e5] +// CHECK:STDOUT: %.loc7_50.3: type = converted constants.%tuple.e64, constants.%tuple.type.189 [concrete = constants.%tuple.type.189] +// CHECK:STDOUT: %.loc7_50.4: type = converted constants.%tuple.e64, constants.%tuple.type.189 [concrete = constants.%tuple.type.189] +// CHECK:STDOUT: %.loc7_50.5: type = converted %.loc7_50.2, constants.%tuple.type.99b [concrete = constants.%tuple.type.99b] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref %tuple.type.99b = ref_binding v, %v.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %v.var, constants.%DestroyOp.b0ebf8.1 @@ -242,41 +242,41 @@ fn H() { // CHECK:STDOUT: %tuple.elem1: ref %tuple.type.189 = tuple_access %v.var, element1 // CHECK:STDOUT: %F.call: init %tuple.type.189 to %tuple.elem1 = call %F.ref() // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc13_50.1: %tuple.type.667 = tuple_literal (%int_1, %F.call, %int_2) -// CHECK:STDOUT: %impl.elem0.loc13_50.1: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc13_50.1: = bound_method %int_1, %impl.elem0.loc13_50.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] -// CHECK:STDOUT: %specific_fn.loc13_50.1: = specific_function %impl.elem0.loc13_50.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc13_50.2: = bound_method %int_1, %specific_fn.loc13_50.1 [concrete = constants.%bound_method.38b] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_50.1: init %i32 = call %bound_method.loc13_50.2(%int_1) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc13_50.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_50.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc13_57.1: %tuple.type.667 = tuple_literal (%int_1, %F.call, %int_2) +// CHECK:STDOUT: %impl.elem0.loc13_57.1: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc13_57.1: = bound_method %int_1, %impl.elem0.loc13_57.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] +// CHECK:STDOUT: %specific_fn.loc13_57.1: = specific_function %impl.elem0.loc13_57.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_57.2: = bound_method %int_1, %specific_fn.loc13_57.1 [concrete = constants.%bound_method.38b] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_57.1: init %i32 = call %bound_method.loc13_57.2(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc13_57.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_57.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %v.var, element0 -// CHECK:STDOUT: %.loc13_50.3: init %i32 to %tuple.elem0 = in_place_init %.loc13_50.2 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc13_50.2: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc13_50.3: = bound_method %int_2, %impl.elem0.loc13_50.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] -// CHECK:STDOUT: %specific_fn.loc13_50.2: = specific_function %impl.elem0.loc13_50.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc13_50.4: = bound_method %int_2, %specific_fn.loc13_50.2 [concrete = constants.%bound_method.646] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_50.2: init %i32 = call %bound_method.loc13_50.4(%int_2) [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc13_50.4: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_50.2 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc13_57.3: init %i32 to %tuple.elem0 = in_place_init %.loc13_57.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc13_57.2: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc13_57.3: = bound_method %int_2, %impl.elem0.loc13_57.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] +// CHECK:STDOUT: %specific_fn.loc13_57.2: = specific_function %impl.elem0.loc13_57.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_57.4: = bound_method %int_2, %specific_fn.loc13_57.2 [concrete = constants.%bound_method.646] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_57.2: init %i32 = call %bound_method.loc13_57.4(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc13_57.4: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_57.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %v.var, element2 -// CHECK:STDOUT: %.loc13_50.5: init %i32 to %tuple.elem2 = in_place_init %.loc13_50.4 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc13_50.6: init %tuple.type.516 to %v.var = tuple_init (%.loc13_50.3, %F.call, %.loc13_50.5) -// CHECK:STDOUT: %.loc13_3: init %tuple.type.516 = converted %.loc13_50.1, %.loc13_50.6 +// CHECK:STDOUT: %.loc13_57.5: init %i32 to %tuple.elem2 = in_place_init %.loc13_57.4 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc13_57.6: init %tuple.type.516 to %v.var = tuple_init (%.loc13_57.3, %F.call, %.loc13_57.5) +// CHECK:STDOUT: %.loc13_3: init %tuple.type.516 = converted %.loc13_57.1, %.loc13_57.6 // CHECK:STDOUT: assign %v.var, %.loc13_3 -// CHECK:STDOUT: %.loc13_36.1: type = splice_block %.loc13_36.4 [concrete = constants.%tuple.type.516] { -// CHECK:STDOUT: %int_32.loc13_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.loc13_17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.loc13_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.loc13_27: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_27: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc13_30: %tuple.type.ff9 = tuple_literal (%i32.loc13_17, %i32.loc13_22, %i32.loc13_27) [concrete = constants.%tuple.e64] -// CHECK:STDOUT: %int_32.loc13_33: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_33: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc13_36.2: %tuple.type.3a3 = tuple_literal (%i32.loc13_11, %.loc13_30, %i32.loc13_33) [concrete = constants.%tuple.5fc] -// CHECK:STDOUT: %.loc13_36.3: type = converted constants.%tuple.e64, constants.%tuple.type.189 [concrete = constants.%tuple.type.189] -// CHECK:STDOUT: %.loc13_36.4: type = converted %.loc13_36.2, constants.%tuple.type.516 [concrete = constants.%tuple.type.516] +// CHECK:STDOUT: %.loc13_43.1: type = splice_block %.loc13_43.4 [concrete = constants.%tuple.type.516] { +// CHECK:STDOUT: %int_32.loc13_18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_18: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc13_24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc13_29: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_29: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc13_34: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_34: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc13_37: %tuple.type.ff9 = tuple_literal (%i32.loc13_24, %i32.loc13_29, %i32.loc13_34) [concrete = constants.%tuple.e64] +// CHECK:STDOUT: %int_32.loc13_40: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_40: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc13_43.2: %tuple.type.3a3 = tuple_literal (%i32.loc13_18, %.loc13_37, %i32.loc13_40) [concrete = constants.%tuple.5fc] +// CHECK:STDOUT: %.loc13_43.3: type = converted constants.%tuple.e64, constants.%tuple.type.189 [concrete = constants.%tuple.type.189] +// CHECK:STDOUT: %.loc13_43.4: type = converted %.loc13_43.2, constants.%tuple.type.516 [concrete = constants.%tuple.type.516] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref %tuple.type.516 = ref_binding v, %v.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %v.var, constants.%DestroyOp.b0ebf8.2 diff --git a/toolchain/check/testdata/tuple/tuple_pattern.carbon b/toolchain/check/testdata/tuple/tuple_pattern.carbon index f018445bcfa3..bcd7ab92d2cc 100644 --- a/toolchain/check/testdata/tuple/tuple_pattern.carbon +++ b/toolchain/check/testdata/tuple/tuple_pattern.carbon @@ -17,9 +17,9 @@ library "[[@TEST_NAME]]"; fn F() { //@dump-sem-ir-begin - let (x: {}, y: {}) = ({}, {}); - var (a: {}, b: {}); - var (c: {}, d: {}) = ({}, {}); + let (unused x: {}, unused y: {}) = ({}, {}); + var (unused a: {}, unused b: {}); + var (unused c: {}, unused d: {}) = ({}, {}); //@dump-sem-ir-end } @@ -30,14 +30,14 @@ library "[[@TEST_NAME]]"; fn F() { //@dump-sem-ir-begin var tuple: ({}, {}) = ({}, {}); - var (x: {}, y: {}) = tuple; + var (unused x: {}, unused y: {}) = tuple; //@dump-sem-ir-end } fn G() { //@dump-sem-ir-begin let tuple: ({}, {}) = ({}, {}); - var (x: {}, y: {}) = tuple; + var (unused x: {}, unused y: {}) = tuple; //@dump-sem-ir-end } @@ -45,7 +45,7 @@ fn MakeTuple() -> ({}, {}); fn H() { //@dump-sem-ir-begin - var (x: {}, y: {}) = MakeTuple(); + var (unused x: {}, unused y: {}) = MakeTuple(); //@dump-sem-ir-end } @@ -55,7 +55,7 @@ library "[[@TEST_NAME]]"; fn F() { //@dump-sem-ir-begin - let (x: {}, (y: {}, z: {})) = ({}, ({}, {})); + let (unused x: {}, (unused y: {}, unused z: {})) = ({}, ({}, {})); //@dump-sem-ir-end } @@ -121,74 +121,74 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type.a96 = value_binding_pattern x [concrete] // CHECK:STDOUT: %y.patt: %pattern_type.a96 = value_binding_pattern y [concrete] -// CHECK:STDOUT: %.loc6_20: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete] +// CHECK:STDOUT: %.loc6_34: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc6_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc6_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc6_31: %tuple.type.b6b = tuple_literal (%.loc6_26.1, %.loc6_30.1) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc6_12.1: type = splice_block %.loc6_12.3 [concrete = constants.%empty_struct_type] { -// CHECK:STDOUT: %.loc6_12.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc6_12.3: type = converted %.loc6_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: } -// CHECK:STDOUT: %empty_struct.loc6_26: %empty_struct_type = struct_value () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc6_26.2: %empty_struct_type = converted %.loc6_26.1, %empty_struct.loc6_26 [concrete = constants.%empty_struct] -// CHECK:STDOUT: %x: %empty_struct_type = value_binding x, %.loc6_26.2 +// CHECK:STDOUT: %.loc6_40.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc6_44.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc6_45: %tuple.type.b6b = tuple_literal (%.loc6_40.1, %.loc6_44.1) [concrete = constants.%tuple] // CHECK:STDOUT: %.loc6_19.1: type = splice_block %.loc6_19.3 [concrete = constants.%empty_struct_type] { // CHECK:STDOUT: %.loc6_19.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc6_19.3: type = converted %.loc6_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } -// CHECK:STDOUT: %empty_struct.loc6_30: %empty_struct_type = struct_value () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc6_30.2: %empty_struct_type = converted %.loc6_30.1, %empty_struct.loc6_30 [concrete = constants.%empty_struct] -// CHECK:STDOUT: %y: %empty_struct_type = value_binding y, %.loc6_30.2 +// CHECK:STDOUT: %empty_struct.loc6_40: %empty_struct_type = struct_value () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc6_40.2: %empty_struct_type = converted %.loc6_40.1, %empty_struct.loc6_40 [concrete = constants.%empty_struct] +// CHECK:STDOUT: %x: %empty_struct_type = value_binding x, %.loc6_40.2 +// CHECK:STDOUT: %.loc6_33.1: type = splice_block %.loc6_33.3 [concrete = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc6_33.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc6_33.3: type = converted %.loc6_33.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %empty_struct.loc6_44: %empty_struct_type = struct_value () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc6_44.2: %empty_struct_type = converted %.loc6_44.1, %empty_struct.loc6_44 [concrete = constants.%empty_struct] +// CHECK:STDOUT: %y: %empty_struct_type = value_binding y, %.loc6_44.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.a96 = ref_binding_pattern a [concrete] // CHECK:STDOUT: %b.patt: %pattern_type.a96 = ref_binding_pattern b [concrete] -// CHECK:STDOUT: %.loc7_20: %pattern_type.de4 = tuple_pattern (%a.patt, %b.patt) [concrete] -// CHECK:STDOUT: %.var_patt.loc7: %pattern_type.de4 = var_pattern %.loc7_20 [concrete] +// CHECK:STDOUT: %.loc7_34: %pattern_type.de4 = tuple_pattern (%a.patt, %b.patt) [concrete] +// CHECK:STDOUT: %.var_patt.loc7: %pattern_type.de4 = var_pattern %.loc7_34 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %.var.loc7: ref %tuple.type.b6b = var %.var_patt.loc7 // CHECK:STDOUT: %tuple.elem0.loc7: ref %empty_struct_type = tuple_access %.var.loc7, element0 // CHECK:STDOUT: %tuple.elem1.loc7: ref %empty_struct_type = tuple_access %.var.loc7, element1 -// CHECK:STDOUT: %.loc7_12.1: type = splice_block %.loc7_12.3 [concrete = constants.%empty_struct_type] { -// CHECK:STDOUT: %.loc7_12.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc7_12.3: type = converted %.loc7_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: ref %empty_struct_type = ref_binding a, %tuple.elem0.loc7 // CHECK:STDOUT: %.loc7_19.1: type = splice_block %.loc7_19.3 [concrete = constants.%empty_struct_type] { // CHECK:STDOUT: %.loc7_19.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc7_19.3: type = converted %.loc7_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } +// CHECK:STDOUT: %a: ref %empty_struct_type = ref_binding a, %tuple.elem0.loc7 +// CHECK:STDOUT: %.loc7_33.1: type = splice_block %.loc7_33.3 [concrete = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc7_33.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc7_33.3: type = converted %.loc7_33.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: ref %empty_struct_type = ref_binding b, %tuple.elem1.loc7 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c.patt: %pattern_type.a96 = ref_binding_pattern c [concrete] // CHECK:STDOUT: %d.patt: %pattern_type.a96 = ref_binding_pattern d [concrete] -// CHECK:STDOUT: %.loc8_20: %pattern_type.de4 = tuple_pattern (%c.patt, %d.patt) [concrete] -// CHECK:STDOUT: %.var_patt.loc8: %pattern_type.de4 = var_pattern %.loc8_20 [concrete] +// CHECK:STDOUT: %.loc8_34: %pattern_type.de4 = tuple_pattern (%c.patt, %d.patt) [concrete] +// CHECK:STDOUT: %.var_patt.loc8: %pattern_type.de4 = var_pattern %.loc8_34 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %.var.loc8: ref %tuple.type.b6b = var %.var_patt.loc8 -// CHECK:STDOUT: %.loc8_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc8_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc8_31.1: %tuple.type.b6b = tuple_literal (%.loc8_26.1, %.loc8_30.1) [concrete = constants.%tuple] -// CHECK:STDOUT: %tuple.elem0.loc8_31: ref %empty_struct_type = tuple_access %.var.loc8, element0 -// CHECK:STDOUT: %.loc8_26.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc8_31.2: init %empty_struct_type = converted %.loc8_26.1, %.loc8_26.2 [concrete = constants.%empty_struct] -// CHECK:STDOUT: %tuple.elem1.loc8_31: ref %empty_struct_type = tuple_access %.var.loc8, element1 -// CHECK:STDOUT: %.loc8_30.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc8_31.3: init %empty_struct_type = converted %.loc8_30.1, %.loc8_30.2 [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc8_31.4: init %tuple.type.b6b to %.var.loc8 = tuple_init (%.loc8_31.2, %.loc8_31.3) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc8_3: init %tuple.type.b6b = converted %.loc8_31.1, %.loc8_31.4 [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc8_40.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc8_44.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc8_45.1: %tuple.type.b6b = tuple_literal (%.loc8_40.1, %.loc8_44.1) [concrete = constants.%tuple] +// CHECK:STDOUT: %tuple.elem0.loc8_45: ref %empty_struct_type = tuple_access %.var.loc8, element0 +// CHECK:STDOUT: %.loc8_40.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc8_45.2: init %empty_struct_type = converted %.loc8_40.1, %.loc8_40.2 [concrete = constants.%empty_struct] +// CHECK:STDOUT: %tuple.elem1.loc8_45: ref %empty_struct_type = tuple_access %.var.loc8, element1 +// CHECK:STDOUT: %.loc8_44.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc8_45.3: init %empty_struct_type = converted %.loc8_44.1, %.loc8_44.2 [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc8_45.4: init %tuple.type.b6b to %.var.loc8 = tuple_init (%.loc8_45.2, %.loc8_45.3) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc8_3: init %tuple.type.b6b = converted %.loc8_45.1, %.loc8_45.4 [concrete = constants.%tuple] // CHECK:STDOUT: assign %.var.loc8, %.loc8_3 // CHECK:STDOUT: %tuple.elem0.loc8_3: ref %empty_struct_type = tuple_access %.var.loc8, element0 // CHECK:STDOUT: %tuple.elem1.loc8_3: ref %empty_struct_type = tuple_access %.var.loc8, element1 -// CHECK:STDOUT: %.loc8_12.1: type = splice_block %.loc8_12.3 [concrete = constants.%empty_struct_type] { -// CHECK:STDOUT: %.loc8_12.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc8_12.3: type = converted %.loc8_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: } -// CHECK:STDOUT: %c: ref %empty_struct_type = ref_binding c, %tuple.elem0.loc8_3 // CHECK:STDOUT: %.loc8_19.1: type = splice_block %.loc8_19.3 [concrete = constants.%empty_struct_type] { // CHECK:STDOUT: %.loc8_19.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc8_19.3: type = converted %.loc8_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } +// CHECK:STDOUT: %c: ref %empty_struct_type = ref_binding c, %tuple.elem0.loc8_3 +// CHECK:STDOUT: %.loc8_33.1: type = splice_block %.loc8_33.3 [concrete = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc8_33.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc8_33.3: type = converted %.loc8_33.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: } // CHECK:STDOUT: %d: ref %empty_struct_type = ref_binding d, %tuple.elem1.loc8_3 // CHECK:STDOUT: %DestroyOp.bound.loc8: = bound_method %.var.loc8, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call.loc8: init %empty_tuple.type = call %DestroyOp.bound.loc8(%.var.loc8) @@ -249,33 +249,33 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type.a96 = ref_binding_pattern x [concrete] // CHECK:STDOUT: %y.patt: %pattern_type.a96 = ref_binding_pattern y [concrete] -// CHECK:STDOUT: %.loc7_20: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete] -// CHECK:STDOUT: %.var_patt: %pattern_type.de4 = var_pattern %.loc7_20 [concrete] +// CHECK:STDOUT: %.loc7_34: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete] +// CHECK:STDOUT: %.var_patt: %pattern_type.de4 = var_pattern %.loc7_34 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %.var: ref %tuple.type.b6b = var %.var_patt // CHECK:STDOUT: %tuple.ref: ref %tuple.type.b6b = name_ref tuple, %tuple -// CHECK:STDOUT: %tuple.elem0.loc7_24.1: ref %empty_struct_type = tuple_access %tuple.ref, element0 -// CHECK:STDOUT: %tuple.elem0.loc7_24.2: ref %empty_struct_type = tuple_access %.var, element0 -// CHECK:STDOUT: %.loc7_24.1: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc7_24.2: init %empty_struct_type = converted %tuple.elem0.loc7_24.1, %.loc7_24.1 [concrete = constants.%empty_struct] -// CHECK:STDOUT: %tuple.elem1.loc7_24.1: ref %empty_struct_type = tuple_access %tuple.ref, element1 -// CHECK:STDOUT: %tuple.elem1.loc7_24.2: ref %empty_struct_type = tuple_access %.var, element1 -// CHECK:STDOUT: %.loc7_24.3: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc7_24.4: init %empty_struct_type = converted %tuple.elem1.loc7_24.1, %.loc7_24.3 [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc7_24.5: init %tuple.type.b6b to %.var = tuple_init (%.loc7_24.2, %.loc7_24.4) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc7_3: init %tuple.type.b6b = converted %tuple.ref, %.loc7_24.5 [concrete = constants.%tuple] +// CHECK:STDOUT: %tuple.elem0.loc7_38.1: ref %empty_struct_type = tuple_access %tuple.ref, element0 +// CHECK:STDOUT: %tuple.elem0.loc7_38.2: ref %empty_struct_type = tuple_access %.var, element0 +// CHECK:STDOUT: %.loc7_38.1: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc7_38.2: init %empty_struct_type = converted %tuple.elem0.loc7_38.1, %.loc7_38.1 [concrete = constants.%empty_struct] +// CHECK:STDOUT: %tuple.elem1.loc7_38.1: ref %empty_struct_type = tuple_access %tuple.ref, element1 +// CHECK:STDOUT: %tuple.elem1.loc7_38.2: ref %empty_struct_type = tuple_access %.var, element1 +// CHECK:STDOUT: %.loc7_38.3: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc7_38.4: init %empty_struct_type = converted %tuple.elem1.loc7_38.1, %.loc7_38.3 [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc7_38.5: init %tuple.type.b6b to %.var = tuple_init (%.loc7_38.2, %.loc7_38.4) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc7_3: init %tuple.type.b6b = converted %tuple.ref, %.loc7_38.5 [concrete = constants.%tuple] // CHECK:STDOUT: assign %.var, %.loc7_3 // CHECK:STDOUT: %tuple.elem0.loc7_3: ref %empty_struct_type = tuple_access %.var, element0 // CHECK:STDOUT: %tuple.elem1.loc7_3: ref %empty_struct_type = tuple_access %.var, element1 -// CHECK:STDOUT: %.loc7_12.1: type = splice_block %.loc7_12.3 [concrete = constants.%empty_struct_type] { -// CHECK:STDOUT: %.loc7_12.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc7_12.3: type = converted %.loc7_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: } -// CHECK:STDOUT: %x: ref %empty_struct_type = ref_binding x, %tuple.elem0.loc7_3 // CHECK:STDOUT: %.loc7_19.1: type = splice_block %.loc7_19.3 [concrete = constants.%empty_struct_type] { // CHECK:STDOUT: %.loc7_19.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc7_19.3: type = converted %.loc7_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } +// CHECK:STDOUT: %x: ref %empty_struct_type = ref_binding x, %tuple.elem0.loc7_3 +// CHECK:STDOUT: %.loc7_33.1: type = splice_block %.loc7_33.3 [concrete = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc7_33.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc7_33.3: type = converted %.loc7_33.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: } // CHECK:STDOUT: %y: ref %empty_struct_type = ref_binding y, %tuple.elem1.loc7_3 // CHECK:STDOUT: %DestroyOp.bound.loc7: = bound_method %.var, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call.loc7: init %empty_tuple.type = call %DestroyOp.bound.loc7(%.var) @@ -312,33 +312,33 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type.a96 = ref_binding_pattern x [concrete] // CHECK:STDOUT: %y.patt: %pattern_type.a96 = ref_binding_pattern y [concrete] -// CHECK:STDOUT: %.loc14_20: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete] -// CHECK:STDOUT: %.var_patt: %pattern_type.de4 = var_pattern %.loc14_20 [concrete] +// CHECK:STDOUT: %.loc14_34: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete] +// CHECK:STDOUT: %.var_patt: %pattern_type.de4 = var_pattern %.loc14_34 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %.var: ref %tuple.type.b6b = var %.var_patt // CHECK:STDOUT: %tuple.ref: %tuple.type.b6b = name_ref tuple, %tuple.loc13_7 -// CHECK:STDOUT: %tuple.elem0.loc14_24.1: %empty_struct_type = tuple_access %tuple.ref, element0 -// CHECK:STDOUT: %tuple.elem0.loc14_24.2: ref %empty_struct_type = tuple_access %.var, element0 -// CHECK:STDOUT: %.loc14_24.1: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc14_24.2: init %empty_struct_type = converted %tuple.elem0.loc14_24.1, %.loc14_24.1 [concrete = constants.%empty_struct] -// CHECK:STDOUT: %tuple.elem1.loc14_24.1: %empty_struct_type = tuple_access %tuple.ref, element1 -// CHECK:STDOUT: %tuple.elem1.loc14_24.2: ref %empty_struct_type = tuple_access %.var, element1 -// CHECK:STDOUT: %.loc14_24.3: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc14_24.4: init %empty_struct_type = converted %tuple.elem1.loc14_24.1, %.loc14_24.3 [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc14_24.5: init %tuple.type.b6b to %.var = tuple_init (%.loc14_24.2, %.loc14_24.4) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc14_3: init %tuple.type.b6b = converted %tuple.ref, %.loc14_24.5 [concrete = constants.%tuple] +// CHECK:STDOUT: %tuple.elem0.loc14_38.1: %empty_struct_type = tuple_access %tuple.ref, element0 +// CHECK:STDOUT: %tuple.elem0.loc14_38.2: ref %empty_struct_type = tuple_access %.var, element0 +// CHECK:STDOUT: %.loc14_38.1: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc14_38.2: init %empty_struct_type = converted %tuple.elem0.loc14_38.1, %.loc14_38.1 [concrete = constants.%empty_struct] +// CHECK:STDOUT: %tuple.elem1.loc14_38.1: %empty_struct_type = tuple_access %tuple.ref, element1 +// CHECK:STDOUT: %tuple.elem1.loc14_38.2: ref %empty_struct_type = tuple_access %.var, element1 +// CHECK:STDOUT: %.loc14_38.3: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc14_38.4: init %empty_struct_type = converted %tuple.elem1.loc14_38.1, %.loc14_38.3 [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc14_38.5: init %tuple.type.b6b to %.var = tuple_init (%.loc14_38.2, %.loc14_38.4) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc14_3: init %tuple.type.b6b = converted %tuple.ref, %.loc14_38.5 [concrete = constants.%tuple] // CHECK:STDOUT: assign %.var, %.loc14_3 // CHECK:STDOUT: %tuple.elem0.loc14_3: ref %empty_struct_type = tuple_access %.var, element0 // CHECK:STDOUT: %tuple.elem1.loc14_3: ref %empty_struct_type = tuple_access %.var, element1 -// CHECK:STDOUT: %.loc14_12.1: type = splice_block %.loc14_12.3 [concrete = constants.%empty_struct_type] { -// CHECK:STDOUT: %.loc14_12.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc14_12.3: type = converted %.loc14_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: } -// CHECK:STDOUT: %x: ref %empty_struct_type = ref_binding x, %tuple.elem0.loc14_3 // CHECK:STDOUT: %.loc14_19.1: type = splice_block %.loc14_19.3 [concrete = constants.%empty_struct_type] { // CHECK:STDOUT: %.loc14_19.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc14_19.3: type = converted %.loc14_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } +// CHECK:STDOUT: %x: ref %empty_struct_type = ref_binding x, %tuple.elem0.loc14_3 +// CHECK:STDOUT: %.loc14_33.1: type = splice_block %.loc14_33.3 [concrete = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc14_33.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc14_33.3: type = converted %.loc14_33.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: } // CHECK:STDOUT: %y: ref %empty_struct_type = ref_binding y, %tuple.elem1.loc14_3 // CHECK:STDOUT: %DestroyOp.bound: = bound_method %.var, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.var) @@ -350,8 +350,8 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type.a96 = ref_binding_pattern x [concrete] // CHECK:STDOUT: %y.patt: %pattern_type.a96 = ref_binding_pattern y [concrete] -// CHECK:STDOUT: %.loc22_20: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete] -// CHECK:STDOUT: %.var_patt: %pattern_type.de4 = var_pattern %.loc22_20 [concrete] +// CHECK:STDOUT: %.loc22_34: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete] +// CHECK:STDOUT: %.var_patt: %pattern_type.de4 = var_pattern %.loc22_34 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %.var: ref %tuple.type.b6b = var %.var_patt // CHECK:STDOUT: %MakeTuple.ref: %MakeTuple.type = name_ref MakeTuple, file.%MakeTuple.decl [concrete = constants.%MakeTuple] @@ -360,15 +360,15 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: assign %.var, %MakeTuple.call // CHECK:STDOUT: %tuple.elem0: ref %empty_struct_type = tuple_access %.var, element0 // CHECK:STDOUT: %tuple.elem1: ref %empty_struct_type = tuple_access %.var, element1 -// CHECK:STDOUT: %.loc22_12.1: type = splice_block %.loc22_12.3 [concrete = constants.%empty_struct_type] { -// CHECK:STDOUT: %.loc22_12.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc22_12.3: type = converted %.loc22_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: } -// CHECK:STDOUT: %x: ref %empty_struct_type = ref_binding x, %tuple.elem0 // CHECK:STDOUT: %.loc22_19.1: type = splice_block %.loc22_19.3 [concrete = constants.%empty_struct_type] { // CHECK:STDOUT: %.loc22_19.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc22_19.3: type = converted %.loc22_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } +// CHECK:STDOUT: %x: ref %empty_struct_type = ref_binding x, %tuple.elem0 +// CHECK:STDOUT: %.loc22_33.1: type = splice_block %.loc22_33.3 [concrete = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc22_33.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc22_33.3: type = converted %.loc22_33.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: } // CHECK:STDOUT: %y: ref %empty_struct_type = ref_binding y, %tuple.elem1 // CHECK:STDOUT: %DestroyOp.bound: = bound_method %.var, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.var) @@ -398,35 +398,35 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %x.patt: %pattern_type.a96 = value_binding_pattern x [concrete] // CHECK:STDOUT: %y.patt: %pattern_type.a96 = value_binding_pattern y [concrete] // CHECK:STDOUT: %z.patt: %pattern_type.a96 = value_binding_pattern z [concrete] -// CHECK:STDOUT: %.loc6_28: %pattern_type.de4 = tuple_pattern (%y.patt, %z.patt) [concrete] -// CHECK:STDOUT: %.loc6_29: %pattern_type.361 = tuple_pattern (%x.patt, %.loc6_28) [concrete] +// CHECK:STDOUT: %.loc6_49: %pattern_type.de4 = tuple_pattern (%y.patt, %z.patt) [concrete] +// CHECK:STDOUT: %.loc6_50: %pattern_type.361 = tuple_pattern (%x.patt, %.loc6_49) [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc6_35.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc6_40.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc6_44.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc6_45: %tuple.type.b6b = tuple_literal (%.loc6_40.1, %.loc6_44.1) [concrete = constants.%tuple.9a3] -// CHECK:STDOUT: %.loc6_46: %tuple.type.6ca = tuple_literal (%.loc6_35.1, %.loc6_45) [concrete = constants.%tuple.56c] -// CHECK:STDOUT: %.loc6_12.1: type = splice_block %.loc6_12.3 [concrete = constants.%empty_struct_type] { -// CHECK:STDOUT: %.loc6_12.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc6_12.3: type = converted %.loc6_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc6_56.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc6_61.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc6_65.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc6_66: %tuple.type.b6b = tuple_literal (%.loc6_61.1, %.loc6_65.1) [concrete = constants.%tuple.9a3] +// CHECK:STDOUT: %.loc6_67: %tuple.type.6ca = tuple_literal (%.loc6_56.1, %.loc6_66) [concrete = constants.%tuple.56c] +// CHECK:STDOUT: %.loc6_19.1: type = splice_block %.loc6_19.3 [concrete = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc6_19.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc6_19.3: type = converted %.loc6_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } -// CHECK:STDOUT: %empty_struct.loc6_35: %empty_struct_type = struct_value () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc6_35.2: %empty_struct_type = converted %.loc6_35.1, %empty_struct.loc6_35 [concrete = constants.%empty_struct] -// CHECK:STDOUT: %x: %empty_struct_type = value_binding x, %.loc6_35.2 -// CHECK:STDOUT: %.loc6_20.1: type = splice_block %.loc6_20.3 [concrete = constants.%empty_struct_type] { -// CHECK:STDOUT: %.loc6_20.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc6_20.3: type = converted %.loc6_20.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %empty_struct.loc6_56: %empty_struct_type = struct_value () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc6_56.2: %empty_struct_type = converted %.loc6_56.1, %empty_struct.loc6_56 [concrete = constants.%empty_struct] +// CHECK:STDOUT: %x: %empty_struct_type = value_binding x, %.loc6_56.2 +// CHECK:STDOUT: %.loc6_34.1: type = splice_block %.loc6_34.3 [concrete = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc6_34.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc6_34.3: type = converted %.loc6_34.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } -// CHECK:STDOUT: %empty_struct.loc6_40: %empty_struct_type = struct_value () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc6_40.2: %empty_struct_type = converted %.loc6_40.1, %empty_struct.loc6_40 [concrete = constants.%empty_struct] -// CHECK:STDOUT: %y: %empty_struct_type = value_binding y, %.loc6_40.2 -// CHECK:STDOUT: %.loc6_27.1: type = splice_block %.loc6_27.3 [concrete = constants.%empty_struct_type] { -// CHECK:STDOUT: %.loc6_27.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc6_27.3: type = converted %.loc6_27.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %empty_struct.loc6_61: %empty_struct_type = struct_value () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc6_61.2: %empty_struct_type = converted %.loc6_61.1, %empty_struct.loc6_61 [concrete = constants.%empty_struct] +// CHECK:STDOUT: %y: %empty_struct_type = value_binding y, %.loc6_61.2 +// CHECK:STDOUT: %.loc6_48.1: type = splice_block %.loc6_48.3 [concrete = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc6_48.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc6_48.3: type = converted %.loc6_48.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } -// CHECK:STDOUT: %empty_struct.loc6_44: %empty_struct_type = struct_value () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc6_44.2: %empty_struct_type = converted %.loc6_44.1, %empty_struct.loc6_44 [concrete = constants.%empty_struct] -// CHECK:STDOUT: %z: %empty_struct_type = value_binding z, %.loc6_44.2 +// CHECK:STDOUT: %empty_struct.loc6_65: %empty_struct_type = struct_value () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc6_65.2: %empty_struct_type = converted %.loc6_65.1, %empty_struct.loc6_65 [concrete = constants.%empty_struct] +// CHECK:STDOUT: %z: %empty_struct_type = value_binding z, %.loc6_65.2 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/decl.carbon b/toolchain/check/testdata/var/decl.carbon index 26fc6847bfe6..d69f8f13f8c1 100644 --- a/toolchain/check/testdata/var/decl.carbon +++ b/toolchain/check/testdata/var/decl.carbon @@ -15,7 +15,7 @@ // --- basic.carbon fn Main() { - var x: (); + var unused x: (); } // CHECK:STDOUT: --- basic.carbon @@ -56,9 +56,9 @@ fn Main() { // CHECK:STDOUT: %x.var_patt: %pattern_type.cb1 = var_pattern %x.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var %x.var_patt -// CHECK:STDOUT: %.loc3_11.1: type = splice_block %.loc3_11.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc3_11.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc3_11.3: type = converted %.loc3_11.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc3_18.1: type = splice_block %.loc3_18.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc3_18.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc3_18.3: type = converted %.loc3_18.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %x: ref %empty_tuple.type = ref_binding x, %x.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %x.var, constants.%DestroyOp diff --git a/toolchain/check/testdata/var/decl_with_init.carbon b/toolchain/check/testdata/var/decl_with_init.carbon index 29f6ba004e40..cddd41578f8c 100644 --- a/toolchain/check/testdata/var/decl_with_init.carbon +++ b/toolchain/check/testdata/var/decl_with_init.carbon @@ -15,7 +15,7 @@ // --- basic.carbon fn Main() { - var x: () = (); + var unused x: () = (); } // CHECK:STDOUT: --- basic.carbon @@ -56,13 +56,13 @@ fn Main() { // CHECK:STDOUT: %x.var_patt: %pattern_type.cb1 = var_pattern %x.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var %x.var_patt -// CHECK:STDOUT: %.loc3_16.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc3_16.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc3_3: init %empty_tuple.type = converted %.loc3_16.1, %.loc3_16.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc3_23.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc3_23.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc3_3: init %empty_tuple.type = converted %.loc3_23.1, %.loc3_23.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: assign %x.var, %.loc3_3 -// CHECK:STDOUT: %.loc3_11.1: type = splice_block %.loc3_11.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc3_11.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc3_11.3: type = converted %.loc3_11.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc3_18.1: type = splice_block %.loc3_18.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc3_18.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc3_18.3: type = converted %.loc3_18.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %x: ref %empty_tuple.type = ref_binding x, %x.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %x.var, constants.%DestroyOp diff --git a/toolchain/check/testdata/var/fail_duplicate_decl.carbon b/toolchain/check/testdata/var/fail_duplicate_decl.carbon index 0d0c18e92ac6..b24e61b3dd38 100644 --- a/toolchain/check/testdata/var/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/var/fail_duplicate_decl.carbon @@ -15,15 +15,15 @@ // --- fail_basic.carbon fn Main() { - var x: () = (); - // CHECK:STDERR: fail_basic.carbon:[[@LINE+7]]:7: error: duplicate name `x` being declared in the same scope [NameDeclDuplicate] - // CHECK:STDERR: var x: () = (); - // CHECK:STDERR: ^ - // CHECK:STDERR: fail_basic.carbon:[[@LINE-4]]:7: note: name is previously declared here [NameDeclPrevious] - // CHECK:STDERR: var x: () = (); - // CHECK:STDERR: ^ + var unused x: () = (); + // CHECK:STDERR: fail_basic.carbon:[[@LINE+7]]:14: error: duplicate name `x` being declared in the same scope [NameDeclDuplicate] + // CHECK:STDERR: var unused x: () = (); + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_basic.carbon:[[@LINE-4]]:14: note: name is previously declared here [NameDeclPrevious] + // CHECK:STDERR: var unused x: () = (); + // CHECK:STDERR: ^ // CHECK:STDERR: - var x: () = (); + var unused x: () = (); } // CHECK:STDOUT: --- fail_basic.carbon @@ -64,13 +64,13 @@ fn Main() { // CHECK:STDOUT: %x.var_patt.loc3: %pattern_type.cb1 = var_pattern %x.patt.loc3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %x.var.loc3: ref %empty_tuple.type = var %x.var_patt.loc3 -// CHECK:STDOUT: %.loc3_16.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc3_16.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc3_3: init %empty_tuple.type = converted %.loc3_16.1, %.loc3_16.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc3_23.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc3_23.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc3_3: init %empty_tuple.type = converted %.loc3_23.1, %.loc3_23.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: assign %x.var.loc3, %.loc3_3 -// CHECK:STDOUT: %.loc3_11.1: type = splice_block %.loc3_11.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc3_11.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc3_11.3: type = converted %.loc3_11.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc3_18.1: type = splice_block %.loc3_18.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc3_18.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc3_18.3: type = converted %.loc3_18.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %x.loc3: ref %empty_tuple.type = ref_binding x, %x.var.loc3 // CHECK:STDOUT: name_binding_decl { @@ -78,13 +78,13 @@ fn Main() { // CHECK:STDOUT: %x.var_patt.loc11: %pattern_type.cb1 = var_pattern %x.patt.loc11 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %x.var.loc11: ref %empty_tuple.type = var %x.var_patt.loc11 -// CHECK:STDOUT: %.loc11_16.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc11_16.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc11_3: init %empty_tuple.type = converted %.loc11_16.1, %.loc11_16.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc11_23.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc11_23.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc11_3: init %empty_tuple.type = converted %.loc11_23.1, %.loc11_23.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: assign %x.var.loc11, %.loc11_3 -// CHECK:STDOUT: %.loc11_11.1: type = splice_block %.loc11_11.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc11_11.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc11_11.3: type = converted %.loc11_11.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc11_18.1: type = splice_block %.loc11_18.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc11_18.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc11_18.3: type = converted %.loc11_18.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %x.loc11: ref %empty_tuple.type = ref_binding x, %x.var.loc11 // CHECK:STDOUT: %DestroyOp.bound.loc11: = bound_method %x.var.loc11, constants.%DestroyOp diff --git a/toolchain/check/testdata/var/fail_init_with_self.carbon b/toolchain/check/testdata/var/fail_init_with_self.carbon index ff666bd99582..c7d9d0878610 100644 --- a/toolchain/check/testdata/var/fail_init_with_self.carbon +++ b/toolchain/check/testdata/var/fail_init_with_self.carbon @@ -15,11 +15,18 @@ // --- fail_basic.carbon fn Main() { - // CHECK:STDERR: fail_basic.carbon:[[@LINE+4]]:15: error: `x` used before initialization [UsedBeforeInitialization] - // CHECK:STDERR: var x: () = x; - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_basic.carbon:[[@LINE+11]]:22: error: `x` used before initialization [UsedBeforeInitialization] + // CHECK:STDERR: var unused x: () = x; + // CHECK:STDERR: ^ // CHECK:STDERR: - var x: () = x; + // CHECK:STDERR: fail_basic.carbon:[[@LINE+7]]:14: error: variable `x` marked `unused` but used [UnusedButUsed] + // CHECK:STDERR: var unused x: () = x; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_basic.carbon:[[@LINE+4]]:22: note: usage here [UnusedButUsedHere] + // CHECK:STDERR: var unused x: () = x; + // CHECK:STDERR: ^ + // CHECK:STDERR: + var unused x: () = x; } // CHECK:STDOUT: --- fail_basic.carbon @@ -62,9 +69,9 @@ fn Main() { // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var %x.var_patt // CHECK:STDOUT: %x.ref: = name_ref x, [concrete = ] // CHECK:STDOUT: assign %x.var, -// CHECK:STDOUT: %.loc7_11.1: type = splice_block %.loc7_11.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc7_11.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc7_11.3: type = converted %.loc7_11.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc14_18.1: type = splice_block %.loc14_18.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc14_18.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc14_18.3: type = converted %.loc14_18.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %x: ref %empty_tuple.type = ref_binding x, %x.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %x.var, constants.%DestroyOp diff --git a/toolchain/check/testdata/var/fail_lookup_outside_scope.carbon b/toolchain/check/testdata/var/fail_lookup_outside_scope.carbon index a85b3df0ceeb..3d2dba4604fb 100644 --- a/toolchain/check/testdata/var/fail_lookup_outside_scope.carbon +++ b/toolchain/check/testdata/var/fail_lookup_outside_scope.carbon @@ -15,7 +15,7 @@ // --- fail_basic.carbon fn Main() { - var x: (); + var unused x: (); } // CHECK:STDERR: fail_basic.carbon:[[@LINE+4]]:13: error: name `x` not found [NameNotFound] @@ -74,9 +74,9 @@ var y: () = x; // CHECK:STDOUT: %x.var_patt: %pattern_type.cb1 = var_pattern %x.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var %x.var_patt -// CHECK:STDOUT: %.loc3_11.1: type = splice_block %.loc3_11.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc3_11.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc3_11.3: type = converted %.loc3_11.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc3_18.1: type = splice_block %.loc3_18.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc3_18.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc3_18.3: type = converted %.loc3_18.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %x: ref %empty_tuple.type = ref_binding x, %x.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %x.var, constants.%DestroyOp diff --git a/toolchain/check/testdata/var/fail_not_copyable.carbon b/toolchain/check/testdata/var/fail_not_copyable.carbon index ba7916b33d79..0d8370e71f61 100644 --- a/toolchain/check/testdata/var/fail_not_copyable.carbon +++ b/toolchain/check/testdata/var/fail_not_copyable.carbon @@ -15,12 +15,12 @@ class X { fn F(x: X) { // TODO: Decide on rules for when classes are copyable. - // CHECK:STDERR: fail_not_copyable.carbon:[[@LINE+7]]:14: error: cannot copy value of type `X` [CopyOfUncopyableType] - // CHECK:STDERR: var y: X = x; - // CHECK:STDERR: ^ - // CHECK:STDERR: fail_not_copyable.carbon:[[@LINE+4]]:14: note: type `X` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] - // CHECK:STDERR: var y: X = x; - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_not_copyable.carbon:[[@LINE+7]]:21: error: cannot copy value of type `X` [CopyOfUncopyableType] + // CHECK:STDERR: var unused y: X = x; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_not_copyable.carbon:[[@LINE+4]]:21: note: type `X` does not implement interface `Core.Copy` [MissingImplInMemberAccessNote] + // CHECK:STDERR: var unused y: X = x; + // CHECK:STDERR: ^ // CHECK:STDERR: - var y: X = x; + var unused y: X = x; } diff --git a/toolchain/check/testdata/var/fail_storage_is_literal.carbon b/toolchain/check/testdata/var/fail_storage_is_literal.carbon index c6ddc31dd356..28869100148c 100644 --- a/toolchain/check/testdata/var/fail_storage_is_literal.carbon +++ b/toolchain/check/testdata/var/fail_storage_is_literal.carbon @@ -13,14 +13,14 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/fail_storage_is_literal.carbon fn Main() { - // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+7]]:10: error: cannot implicitly convert non-type value of type `Core.IntLiteral` to `type` [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: var x: 1 = 1; - // CHECK:STDERR: ^ - // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+4]]:10: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] - // CHECK:STDERR: var x: 1 = 1; - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+7]]:17: error: cannot implicitly convert non-type value of type `Core.IntLiteral` to `type` [ConversionFailureNonTypeToFacet] + // CHECK:STDERR: var unused x: 1 = 1; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+4]]:17: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: var unused x: 1 = 1; + // CHECK:STDERR: ^ // CHECK:STDERR: - var x: 1 = 1; + var unused x: 1 = 1; } // CHECK:STDOUT: --- fail_storage_is_literal.carbon @@ -61,11 +61,11 @@ fn Main() { // CHECK:STDOUT: %x.var_patt: = var_pattern %x.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %x.var: ref = var %x.var_patt [concrete = ] -// CHECK:STDOUT: %int_1.loc23_14: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] +// CHECK:STDOUT: %int_1.loc23_21: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: %.1: = splice_block [concrete = ] { -// CHECK:STDOUT: %int_1.loc23_10: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] -// CHECK:STDOUT: %.loc23: type = converted %int_1.loc23_10, [concrete = ] +// CHECK:STDOUT: %int_1.loc23_17: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] +// CHECK:STDOUT: %.loc23: type = converted %int_1.loc23_17, [concrete = ] // CHECK:STDOUT: } // CHECK:STDOUT: %x: ref = ref_binding x, [concrete = ] // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/var/global_lookup_in_scope.carbon b/toolchain/check/testdata/var/global_lookup_in_scope.carbon index 63c55066b3b2..efd20b059b09 100644 --- a/toolchain/check/testdata/var/global_lookup_in_scope.carbon +++ b/toolchain/check/testdata/var/global_lookup_in_scope.carbon @@ -17,7 +17,7 @@ var x: {.v: ()} = {.v = ()}; fn Main() { - var y: {.v: ()} = x; + var unused y: {.v: ()} = x; } // CHECK:STDOUT: --- basic.carbon @@ -74,16 +74,16 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %y.var: ref %struct_type.v = var %y.var_patt // CHECK:STDOUT: %x.ref: ref %struct_type.v = name_ref x, file.%x [concrete = file.%x.var] -// CHECK:STDOUT: %.loc5_21.1: ref %empty_tuple.type = struct_access %x.ref, element0 [concrete = constants.%.c0c] -// CHECK:STDOUT: %.loc5_21.2: ref %empty_tuple.type = struct_access %y.var, element0 -// CHECK:STDOUT: %.loc5_21.3: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_21.4: init %empty_tuple.type = converted %.loc5_21.1, %.loc5_21.3 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_21.5: init %struct_type.v to %y.var = struct_init (%.loc5_21.4) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc5_3: init %struct_type.v = converted %x.ref, %.loc5_21.5 [concrete = constants.%struct] +// CHECK:STDOUT: %.loc5_28.1: ref %empty_tuple.type = struct_access %x.ref, element0 [concrete = constants.%.c0c] +// CHECK:STDOUT: %.loc5_28.2: ref %empty_tuple.type = struct_access %y.var, element0 +// CHECK:STDOUT: %.loc5_28.3: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_28.4: init %empty_tuple.type = converted %.loc5_28.1, %.loc5_28.3 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_28.5: init %struct_type.v to %y.var = struct_init (%.loc5_28.4) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc5_3: init %struct_type.v = converted %x.ref, %.loc5_28.5 [concrete = constants.%struct] // CHECK:STDOUT: assign %y.var, %.loc5_3 -// CHECK:STDOUT: %.loc5_17: type = splice_block %struct_type.v [concrete = constants.%struct_type.v] { -// CHECK:STDOUT: %.loc5_16.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_16.2: type = converted %.loc5_16.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc5_24: type = splice_block %struct_type.v [concrete = constants.%struct_type.v] { +// CHECK:STDOUT: %.loc5_23.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_23.2: type = converted %.loc5_23.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %struct_type.v: type = struct_type {.v: %empty_tuple.type} [concrete = constants.%struct_type.v] // CHECK:STDOUT: } // CHECK:STDOUT: %y: ref %struct_type.v = ref_binding y, %y.var diff --git a/toolchain/check/testdata/var/shadowing.carbon b/toolchain/check/testdata/var/shadowing.carbon index 3c062bceff8c..03d998bee2a5 100644 --- a/toolchain/check/testdata/var/shadowing.carbon +++ b/toolchain/check/testdata/var/shadowing.carbon @@ -20,7 +20,7 @@ fn Main() { var NS: () = (); NS = (); - var x: () = (); + var unused x: () = (); if (true) { var x: () = (); @@ -89,13 +89,13 @@ fn Main() { // CHECK:STDOUT: %x.var_patt.loc8: %pattern_type.cb1 = var_pattern %x.patt.loc8 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %x.var.loc8: ref %empty_tuple.type = var %x.var_patt.loc8 -// CHECK:STDOUT: %.loc8_16.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_16.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_3: init %empty_tuple.type = converted %.loc8_16.1, %.loc8_16.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_23.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_23.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_3: init %empty_tuple.type = converted %.loc8_23.1, %.loc8_23.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: assign %x.var.loc8, %.loc8_3 -// CHECK:STDOUT: %.loc8_11.1: type = splice_block %.loc8_11.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc8_11.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_11.3: type = converted %.loc8_11.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc8_18.1: type = splice_block %.loc8_18.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc8_18.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_18.3: type = converted %.loc8_18.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %x.loc8: ref %empty_tuple.type = ref_binding x, %x.var.loc8 // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true] diff --git a/toolchain/check/testdata/var/var_pattern.carbon b/toolchain/check/testdata/var/var_pattern.carbon index 3eed5cd4e83c..bf6db1cc840b 100644 --- a/toolchain/check/testdata/var/var_pattern.carbon +++ b/toolchain/check/testdata/var/var_pattern.carbon @@ -17,7 +17,7 @@ library "[[@TEST_NAME]]"; fn F() { - let var x: () = (); + let var unused x: () = (); } // --- var_in_tuple.carbon @@ -25,7 +25,7 @@ fn F() { library "[[@TEST_NAME]]"; fn F() { - let (x: (), var y: ()) = ((), ()); + let (unused x: (), var unused y: ()) = ((), ()); } // --- tuple_in_var.carbon @@ -33,7 +33,7 @@ fn F() { library "[[@TEST_NAME]]"; fn F() { - var (x: (), y: ()) = ((), ()); + var (unused x: (), unused y: ()) = ((), ()); } // --- tuple_in_let_var.carbon @@ -41,7 +41,7 @@ fn F() { library "[[@TEST_NAME]]"; fn F() { - let var (x: (), y: ()) = ((), ()); + let var (unused x: (), unused y: ()) = ((), ()); } // --- function.carbon @@ -65,7 +65,7 @@ fn F(x: (), var y: ()); impl package P; -fn F(x: (), var y: ()) {} +fn F(unused x: (), var unused y: ()) {} // --- use_public_function.carbon @@ -82,11 +82,11 @@ fn G() { library "[[@TEST_NAME]]"; fn F() { - // CHECK:STDERR: fail_nested.carbon:[[@LINE+4]]:27: error: `var` nested within another `var` [NestedVar] - // CHECK:STDERR: let (x: (), var (y: (), var z: ())) = ((), ((), ())); - // CHECK:STDERR: ^~~ + // CHECK:STDERR: fail_nested.carbon:[[@LINE+4]]:41: error: `var` nested within another `var` [NestedVar] + // CHECK:STDERR: let (unused x: (), var (unused y: (), var unused z: ())) = ((), ((), ())); + // CHECK:STDERR: ^~~ // CHECK:STDERR: - let (x: (), var (y: (), var z: ())) = ((), ((), ())); + let (unused x: (), var (unused y: (), var unused z: ())) = ((), ((), ())); } // --- fail_compile_time.carbon @@ -142,7 +142,7 @@ fn F() -> (); fn G() { // The SemIR should contain only two temporary_storage insts, not three. - let (x: (), var y: (), z: ()) = (F(), F(), F()); + let (unused x: (), var unused y: (), unused z: ()) = (F(), F(), F()); } // CHECK:STDOUT: --- basic.carbon @@ -183,13 +183,13 @@ fn G() { // CHECK:STDOUT: %x.var_patt: %pattern_type.cb1 = var_pattern %x.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var %x.var_patt -// CHECK:STDOUT: %.loc5_20.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_20.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_7: init %empty_tuple.type = converted %.loc5_20.1, %.loc5_20.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_27.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_27.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_7: init %empty_tuple.type = converted %.loc5_27.1, %.loc5_27.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: assign %x.var, %.loc5_7 -// CHECK:STDOUT: %.loc5_15.1: type = splice_block %.loc5_15.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc5_15.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_15.3: type = converted %.loc5_15.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc5_22.1: type = splice_block %.loc5_22.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc5_22.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_22.3: type = converted %.loc5_22.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %x: ref %empty_tuple.type = ref_binding x, %x.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %x.var, constants.%DestroyOp @@ -239,25 +239,25 @@ fn G() { // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = value_binding_pattern x [concrete] // CHECK:STDOUT: %y.patt: %pattern_type.cb1 = ref_binding_pattern y [concrete] // CHECK:STDOUT: %y.var_patt: %pattern_type.cb1 = var_pattern %y.patt [concrete] -// CHECK:STDOUT: %.loc5_24: %pattern_type.5b8 = tuple_pattern (%x.patt, %y.var_patt) [concrete] +// CHECK:STDOUT: %.loc5_38: %pattern_type.5b8 = tuple_pattern (%x.patt, %y.var_patt) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %y.var: ref %empty_tuple.type = var %y.var_patt -// CHECK:STDOUT: %.loc5_30.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_34.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_35: %tuple.type = tuple_literal (%.loc5_30.1, %.loc5_34.1) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc5_12.1: type = splice_block %.loc5_12.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc5_12.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_12.3: type = converted %.loc5_12.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc5_44.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_48.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_49: %tuple.type = tuple_literal (%.loc5_44.1, %.loc5_48.1) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc5_19.1: type = splice_block %.loc5_19.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc5_19.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_19.3: type = converted %.loc5_19.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_30.2: %empty_tuple.type = converted %.loc5_30.1, %empty_tuple [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %x: %empty_tuple.type = value_binding x, %.loc5_30.2 -// CHECK:STDOUT: %.loc5_34.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_15: init %empty_tuple.type = converted %.loc5_34.1, %.loc5_34.2 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: assign %y.var, %.loc5_15 -// CHECK:STDOUT: %.loc5_23.1: type = splice_block %.loc5_23.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc5_23.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_23.3: type = converted %.loc5_23.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc5_44.2: %empty_tuple.type = converted %.loc5_44.1, %empty_tuple [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %x: %empty_tuple.type = value_binding x, %.loc5_44.2 +// CHECK:STDOUT: %.loc5_48.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_22: init %empty_tuple.type = converted %.loc5_48.1, %.loc5_48.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: assign %y.var, %.loc5_22 +// CHECK:STDOUT: %.loc5_37.1: type = splice_block %.loc5_37.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc5_37.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_37.3: type = converted %.loc5_37.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %y: ref %empty_tuple.type = ref_binding y, %y.var // CHECK:STDOUT: %DestroyOp.bound: = bound_method %y.var, constants.%DestroyOp @@ -306,33 +306,33 @@ fn G() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = ref_binding_pattern x [concrete] // CHECK:STDOUT: %y.patt: %pattern_type.cb1 = ref_binding_pattern y [concrete] -// CHECK:STDOUT: %.loc5_20: %pattern_type.5b8 = tuple_pattern (%x.patt, %y.patt) [concrete] -// CHECK:STDOUT: %.var_patt: %pattern_type.5b8 = var_pattern %.loc5_20 [concrete] +// CHECK:STDOUT: %.loc5_34: %pattern_type.5b8 = tuple_pattern (%x.patt, %y.patt) [concrete] +// CHECK:STDOUT: %.var_patt: %pattern_type.5b8 = var_pattern %.loc5_34 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %.var: ref %tuple.type = var %.var_patt -// CHECK:STDOUT: %.loc5_26.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_30.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_31.1: %tuple.type = tuple_literal (%.loc5_26.1, %.loc5_30.1) [concrete = constants.%tuple] -// CHECK:STDOUT: %tuple.elem0.loc5_31: ref %empty_tuple.type = tuple_access %.var, element0 -// CHECK:STDOUT: %.loc5_26.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_31.2: init %empty_tuple.type = converted %.loc5_26.1, %.loc5_26.2 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %tuple.elem1.loc5_31: ref %empty_tuple.type = tuple_access %.var, element1 -// CHECK:STDOUT: %.loc5_30.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_31.3: init %empty_tuple.type = converted %.loc5_30.1, %.loc5_30.2 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_31.4: init %tuple.type to %.var = tuple_init (%.loc5_31.2, %.loc5_31.3) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc5_3: init %tuple.type = converted %.loc5_31.1, %.loc5_31.4 [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc5_40.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_44.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_45.1: %tuple.type = tuple_literal (%.loc5_40.1, %.loc5_44.1) [concrete = constants.%tuple] +// CHECK:STDOUT: %tuple.elem0.loc5_45: ref %empty_tuple.type = tuple_access %.var, element0 +// CHECK:STDOUT: %.loc5_40.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_45.2: init %empty_tuple.type = converted %.loc5_40.1, %.loc5_40.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %tuple.elem1.loc5_45: ref %empty_tuple.type = tuple_access %.var, element1 +// CHECK:STDOUT: %.loc5_44.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_45.3: init %empty_tuple.type = converted %.loc5_44.1, %.loc5_44.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_45.4: init %tuple.type to %.var = tuple_init (%.loc5_45.2, %.loc5_45.3) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc5_3: init %tuple.type = converted %.loc5_45.1, %.loc5_45.4 [concrete = constants.%tuple] // CHECK:STDOUT: assign %.var, %.loc5_3 // CHECK:STDOUT: %tuple.elem0.loc5_3: ref %empty_tuple.type = tuple_access %.var, element0 // CHECK:STDOUT: %tuple.elem1.loc5_3: ref %empty_tuple.type = tuple_access %.var, element1 -// CHECK:STDOUT: %.loc5_12.1: type = splice_block %.loc5_12.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc5_12.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_12.3: type = converted %.loc5_12.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: } -// CHECK:STDOUT: %x: ref %empty_tuple.type = ref_binding x, %tuple.elem0.loc5_3 // CHECK:STDOUT: %.loc5_19.1: type = splice_block %.loc5_19.3 [concrete = constants.%empty_tuple.type] { // CHECK:STDOUT: %.loc5_19.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc5_19.3: type = converted %.loc5_19.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %x: ref %empty_tuple.type = ref_binding x, %tuple.elem0.loc5_3 +// CHECK:STDOUT: %.loc5_33.1: type = splice_block %.loc5_33.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc5_33.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_33.3: type = converted %.loc5_33.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %y: ref %empty_tuple.type = ref_binding y, %tuple.elem1.loc5_3 // CHECK:STDOUT: %DestroyOp.bound: = bound_method %.var, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.var) @@ -380,33 +380,33 @@ fn G() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = ref_binding_pattern x [concrete] // CHECK:STDOUT: %y.patt: %pattern_type.cb1 = ref_binding_pattern y [concrete] -// CHECK:STDOUT: %.loc5_24: %pattern_type.5b8 = tuple_pattern (%x.patt, %y.patt) [concrete] -// CHECK:STDOUT: %.var_patt: %pattern_type.5b8 = var_pattern %.loc5_24 [concrete] +// CHECK:STDOUT: %.loc5_38: %pattern_type.5b8 = tuple_pattern (%x.patt, %y.patt) [concrete] +// CHECK:STDOUT: %.var_patt: %pattern_type.5b8 = var_pattern %.loc5_38 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %.var: ref %tuple.type = var %.var_patt -// CHECK:STDOUT: %.loc5_30.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_34.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_35.1: %tuple.type = tuple_literal (%.loc5_30.1, %.loc5_34.1) [concrete = constants.%tuple] -// CHECK:STDOUT: %tuple.elem0.loc5_35: ref %empty_tuple.type = tuple_access %.var, element0 -// CHECK:STDOUT: %.loc5_30.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_35.2: init %empty_tuple.type = converted %.loc5_30.1, %.loc5_30.2 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %tuple.elem1.loc5_35: ref %empty_tuple.type = tuple_access %.var, element1 -// CHECK:STDOUT: %.loc5_34.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_35.3: init %empty_tuple.type = converted %.loc5_34.1, %.loc5_34.2 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_35.4: init %tuple.type to %.var = tuple_init (%.loc5_35.2, %.loc5_35.3) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc5_7: init %tuple.type = converted %.loc5_35.1, %.loc5_35.4 [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc5_44.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_48.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_49.1: %tuple.type = tuple_literal (%.loc5_44.1, %.loc5_48.1) [concrete = constants.%tuple] +// CHECK:STDOUT: %tuple.elem0.loc5_49: ref %empty_tuple.type = tuple_access %.var, element0 +// CHECK:STDOUT: %.loc5_44.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_49.2: init %empty_tuple.type = converted %.loc5_44.1, %.loc5_44.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %tuple.elem1.loc5_49: ref %empty_tuple.type = tuple_access %.var, element1 +// CHECK:STDOUT: %.loc5_48.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_49.3: init %empty_tuple.type = converted %.loc5_48.1, %.loc5_48.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_49.4: init %tuple.type to %.var = tuple_init (%.loc5_49.2, %.loc5_49.3) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc5_7: init %tuple.type = converted %.loc5_49.1, %.loc5_49.4 [concrete = constants.%tuple] // CHECK:STDOUT: assign %.var, %.loc5_7 // CHECK:STDOUT: %tuple.elem0.loc5_7: ref %empty_tuple.type = tuple_access %.var, element0 // CHECK:STDOUT: %tuple.elem1.loc5_7: ref %empty_tuple.type = tuple_access %.var, element1 -// CHECK:STDOUT: %.loc5_16.1: type = splice_block %.loc5_16.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc5_16.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_16.3: type = converted %.loc5_16.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: } -// CHECK:STDOUT: %x: ref %empty_tuple.type = ref_binding x, %tuple.elem0.loc5_7 // CHECK:STDOUT: %.loc5_23.1: type = splice_block %.loc5_23.3 [concrete = constants.%empty_tuple.type] { // CHECK:STDOUT: %.loc5_23.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc5_23.3: type = converted %.loc5_23.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } +// CHECK:STDOUT: %x: ref %empty_tuple.type = ref_binding x, %tuple.elem0.loc5_7 +// CHECK:STDOUT: %.loc5_37.1: type = splice_block %.loc5_37.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc5_37.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_37.3: type = converted %.loc5_37.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %y: ref %empty_tuple.type = ref_binding y, %tuple.elem1.loc5_7 // CHECK:STDOUT: %DestroyOp.bound: = bound_method %.var, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.var) @@ -586,15 +586,15 @@ fn G() { // CHECK:STDOUT: %y.var_patt: %pattern_type = var_pattern %y.param_patt [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %x.param: %empty_tuple.type = value_param call_param0 -// CHECK:STDOUT: %.loc4_10.1: type = splice_block %.loc4_10.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc4_10.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc4_10.3: type = converted %.loc4_10.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc4_17.1: type = splice_block %.loc4_17.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc4_17.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc4_17.3: type = converted %.loc4_17.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %x: %empty_tuple.type = value_binding x, %x.param // CHECK:STDOUT: %y.param: ref %empty_tuple.type = ref_param call_param1 -// CHECK:STDOUT: %.loc4_21.1: type = splice_block %.loc4_21.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc4_21.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc4_21.3: type = converted %.loc4_21.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc4_35.1: type = splice_block %.loc4_35.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc4_35.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc4_35.3: type = converted %.loc4_35.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %y: ref %empty_tuple.type = ref_binding y, %y.param // CHECK:STDOUT: } @@ -694,9 +694,9 @@ fn G() { // CHECK:STDOUT: %tuple.d8f: %tuple.type.bcd = tuple_value (%empty_tuple, %empty_tuple) [concrete] // CHECK:STDOUT: %tuple.c9e: %tuple.type.a21 = tuple_value (%empty_tuple, %tuple.d8f) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %DestroyOp.type.3e79c2.1: type = fn_type @DestroyOp.loc9_15 [concrete] +// CHECK:STDOUT: %DestroyOp.type.3e79c2.1: type = fn_type @DestroyOp.loc9_22 [concrete] // CHECK:STDOUT: %DestroyOp.b0ebf8.1: %DestroyOp.type.3e79c2.1 = struct_value () [concrete] -// CHECK:STDOUT: %DestroyOp.type.3e79c2.2: type = fn_type @DestroyOp.loc9_27 [concrete] +// CHECK:STDOUT: %DestroyOp.type.3e79c2.2: type = fn_type @DestroyOp.loc9_41 [concrete] // CHECK:STDOUT: %DestroyOp.b0ebf8.2: %DestroyOp.type.3e79c2.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -725,58 +725,58 @@ fn G() { // CHECK:STDOUT: %y.patt: %pattern_type.cb1 = ref_binding_pattern y [concrete] // CHECK:STDOUT: %z.patt: %pattern_type.cb1 = ref_binding_pattern z [concrete] // CHECK:STDOUT: %z.var_patt: %pattern_type.cb1 = var_pattern %z.patt [concrete] -// CHECK:STDOUT: %.loc9_36: %pattern_type.5b8 = tuple_pattern (%y.patt, %z.var_patt) [concrete] -// CHECK:STDOUT: %.var_patt: %pattern_type.5b8 = var_pattern %.loc9_36 [concrete] -// CHECK:STDOUT: %.loc9_37: %pattern_type.c6c = tuple_pattern (%x.patt, %.var_patt) [concrete] +// CHECK:STDOUT: %.loc9_57: %pattern_type.5b8 = tuple_pattern (%y.patt, %z.var_patt) [concrete] +// CHECK:STDOUT: %.var_patt: %pattern_type.5b8 = var_pattern %.loc9_57 [concrete] +// CHECK:STDOUT: %.loc9_58: %pattern_type.c6c = tuple_pattern (%x.patt, %.var_patt) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %z.var: ref %empty_tuple.type = var %z.var_patt // CHECK:STDOUT: %.var: ref %tuple.type.bcd = var %.var_patt -// CHECK:STDOUT: %.loc9_43.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc9_48.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc9_52.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc9_53.1: %tuple.type.bcd = tuple_literal (%.loc9_48.1, %.loc9_52.1) [concrete = constants.%tuple.d8f] -// CHECK:STDOUT: %.loc9_54: %tuple.type.a21 = tuple_literal (%.loc9_43.1, %.loc9_53.1) [concrete = constants.%tuple.c9e] -// CHECK:STDOUT: %.loc9_12.1: type = splice_block %.loc9_12.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc9_12.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc9_12.3: type = converted %.loc9_12.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc9_64.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_69.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_73.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_74.1: %tuple.type.bcd = tuple_literal (%.loc9_69.1, %.loc9_73.1) [concrete = constants.%tuple.d8f] +// CHECK:STDOUT: %.loc9_75: %tuple.type.a21 = tuple_literal (%.loc9_64.1, %.loc9_74.1) [concrete = constants.%tuple.c9e] +// CHECK:STDOUT: %.loc9_19.1: type = splice_block %.loc9_19.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc9_19.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_19.3: type = converted %.loc9_19.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc9_43.2: %empty_tuple.type = converted %.loc9_43.1, %empty_tuple [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %x: %empty_tuple.type = value_binding x, %.loc9_43.2 -// CHECK:STDOUT: %tuple.elem0.loc9_53: ref %empty_tuple.type = tuple_access %.var, element0 -// CHECK:STDOUT: %.loc9_48.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc9_53.2: init %empty_tuple.type = converted %.loc9_48.1, %.loc9_48.2 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %tuple.elem1.loc9_53: ref %empty_tuple.type = tuple_access %.var, element1 -// CHECK:STDOUT: %.loc9_52.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc9_53.3: init %empty_tuple.type = converted %.loc9_52.1, %.loc9_52.2 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc9_53.4: init %tuple.type.bcd to %.var = tuple_init (%.loc9_53.2, %.loc9_53.3) [concrete = constants.%tuple.d8f] -// CHECK:STDOUT: %.loc9_15.1: init %tuple.type.bcd = converted %.loc9_53.1, %.loc9_53.4 [concrete = constants.%tuple.d8f] -// CHECK:STDOUT: assign %.var, %.loc9_15.1 -// CHECK:STDOUT: %tuple.elem0.loc9_15: ref %empty_tuple.type = tuple_access %.var, element0 -// CHECK:STDOUT: %tuple.elem1.loc9_15: ref %empty_tuple.type = tuple_access %.var, element1 -// CHECK:STDOUT: %.loc9_24.1: type = splice_block %.loc9_24.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc9_24.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc9_24.3: type = converted %.loc9_24.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc9_64.2: %empty_tuple.type = converted %.loc9_64.1, %empty_tuple [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %x: %empty_tuple.type = value_binding x, %.loc9_64.2 +// CHECK:STDOUT: %tuple.elem0.loc9_74: ref %empty_tuple.type = tuple_access %.var, element0 +// CHECK:STDOUT: %.loc9_69.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_74.2: init %empty_tuple.type = converted %.loc9_69.1, %.loc9_69.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %tuple.elem1.loc9_74: ref %empty_tuple.type = tuple_access %.var, element1 +// CHECK:STDOUT: %.loc9_73.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_74.3: init %empty_tuple.type = converted %.loc9_73.1, %.loc9_73.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_74.4: init %tuple.type.bcd to %.var = tuple_init (%.loc9_74.2, %.loc9_74.3) [concrete = constants.%tuple.d8f] +// CHECK:STDOUT: %.loc9_22.1: init %tuple.type.bcd = converted %.loc9_74.1, %.loc9_74.4 [concrete = constants.%tuple.d8f] +// CHECK:STDOUT: assign %.var, %.loc9_22.1 +// CHECK:STDOUT: %tuple.elem0.loc9_22: ref %empty_tuple.type = tuple_access %.var, element0 +// CHECK:STDOUT: %tuple.elem1.loc9_22: ref %empty_tuple.type = tuple_access %.var, element1 +// CHECK:STDOUT: %.loc9_38.1: type = splice_block %.loc9_38.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc9_38.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_38.3: type = converted %.loc9_38.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %y: ref %empty_tuple.type = ref_binding y, %tuple.elem0.loc9_15 -// CHECK:STDOUT: %.loc9_15.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc9_27: init %empty_tuple.type = converted %tuple.elem1.loc9_15, %.loc9_15.2 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: assign %z.var, %.loc9_27 -// CHECK:STDOUT: %.loc9_35.1: type = splice_block %.loc9_35.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc9_35.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc9_35.3: type = converted %.loc9_35.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %y: ref %empty_tuple.type = ref_binding y, %tuple.elem0.loc9_22 +// CHECK:STDOUT: %.loc9_22.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_41: init %empty_tuple.type = converted %tuple.elem1.loc9_22, %.loc9_22.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: assign %z.var, %.loc9_41 +// CHECK:STDOUT: %.loc9_56.1: type = splice_block %.loc9_56.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc9_56.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_56.3: type = converted %.loc9_56.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %z: ref %empty_tuple.type = ref_binding z, %z.var -// CHECK:STDOUT: %DestroyOp.bound.loc9_15: = bound_method %.var, constants.%DestroyOp.b0ebf8.1 -// CHECK:STDOUT: %DestroyOp.call.loc9_15: init %empty_tuple.type = call %DestroyOp.bound.loc9_15(%.var) -// CHECK:STDOUT: %DestroyOp.bound.loc9_27: = bound_method %z.var, constants.%DestroyOp.b0ebf8.2 -// CHECK:STDOUT: %DestroyOp.call.loc9_27: init %empty_tuple.type = call %DestroyOp.bound.loc9_27(%z.var) +// CHECK:STDOUT: %DestroyOp.bound.loc9_22: = bound_method %.var, constants.%DestroyOp.b0ebf8.1 +// CHECK:STDOUT: %DestroyOp.call.loc9_22: init %empty_tuple.type = call %DestroyOp.bound.loc9_22(%.var) +// CHECK:STDOUT: %DestroyOp.bound.loc9_41: = bound_method %z.var, constants.%DestroyOp.b0ebf8.2 +// CHECK:STDOUT: %DestroyOp.call.loc9_41: init %empty_tuple.type = call %DestroyOp.bound.loc9_41(%z.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @DestroyOp.loc9_15(%self.param: ref %tuple.type.bcd) = "no_op"; +// CHECK:STDOUT: fn @DestroyOp.loc9_22(%self.param: ref %tuple.type.bcd) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @DestroyOp.loc9_27(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: fn @DestroyOp.loc9_41(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_compile_time.carbon // CHECK:STDOUT: @@ -895,46 +895,46 @@ fn G() { // CHECK:STDOUT: %y.patt: %pattern_type.cb1 = ref_binding_pattern y [concrete] // CHECK:STDOUT: %y.var_patt: %pattern_type.cb1 = var_pattern %y.patt [concrete] // CHECK:STDOUT: %z.patt: %pattern_type.cb1 = value_binding_pattern z [concrete] -// CHECK:STDOUT: %.loc8_31: %pattern_type.8c1 = tuple_pattern (%x.patt, %y.var_patt, %z.patt) [concrete] +// CHECK:STDOUT: %.loc8_52: %pattern_type.8c1 = tuple_pattern (%x.patt, %y.var_patt, %z.patt) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %y.var: ref %empty_tuple.type = var %y.var_patt -// CHECK:STDOUT: %F.ref.loc8_36: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %F.call.loc8_38: init %empty_tuple.type = call %F.ref.loc8_36() -// CHECK:STDOUT: %F.ref.loc8_41: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %F.call.loc8_43: init %empty_tuple.type = call %F.ref.loc8_41() -// CHECK:STDOUT: %F.ref.loc8_46: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %F.call.loc8_48: init %empty_tuple.type = call %F.ref.loc8_46() -// CHECK:STDOUT: %.loc8_49: %tuple.type = tuple_literal (%F.call.loc8_38, %F.call.loc8_43, %F.call.loc8_48) -// CHECK:STDOUT: %.loc8_12.1: type = splice_block %.loc8_12.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc8_12.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_12.3: type = converted %.loc8_12.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %F.ref.loc8_57: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] +// CHECK:STDOUT: %F.call.loc8_59: init %empty_tuple.type = call %F.ref.loc8_57() +// CHECK:STDOUT: %F.ref.loc8_62: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] +// CHECK:STDOUT: %F.call.loc8_64: init %empty_tuple.type = call %F.ref.loc8_62() +// CHECK:STDOUT: %F.ref.loc8_67: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] +// CHECK:STDOUT: %F.call.loc8_69: init %empty_tuple.type = call %F.ref.loc8_67() +// CHECK:STDOUT: %.loc8_70: %tuple.type = tuple_literal (%F.call.loc8_59, %F.call.loc8_64, %F.call.loc8_69) +// CHECK:STDOUT: %.loc8_19.1: type = splice_block %.loc8_19.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc8_19.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_19.3: type = converted %.loc8_19.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_38.1: ref %empty_tuple.type = temporary_storage -// CHECK:STDOUT: %.loc8_38.2: ref %empty_tuple.type = temporary %.loc8_38.1, %F.call.loc8_38 -// CHECK:STDOUT: %tuple.loc8_38: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_38.3: %empty_tuple.type = converted %F.call.loc8_38, %tuple.loc8_38 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %x: %empty_tuple.type = value_binding x, %.loc8_38.3 -// CHECK:STDOUT: assign %y.var, %F.call.loc8_43 -// CHECK:STDOUT: %.loc8_23.1: type = splice_block %.loc8_23.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc8_23.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_23.3: type = converted %.loc8_23.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc8_59.1: ref %empty_tuple.type = temporary_storage +// CHECK:STDOUT: %.loc8_59.2: ref %empty_tuple.type = temporary %.loc8_59.1, %F.call.loc8_59 +// CHECK:STDOUT: %tuple.loc8_59: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_59.3: %empty_tuple.type = converted %F.call.loc8_59, %tuple.loc8_59 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %x: %empty_tuple.type = value_binding x, %.loc8_59.3 +// CHECK:STDOUT: assign %y.var, %F.call.loc8_64 +// CHECK:STDOUT: %.loc8_37.1: type = splice_block %.loc8_37.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc8_37.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_37.3: type = converted %.loc8_37.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %y: ref %empty_tuple.type = ref_binding y, %y.var -// CHECK:STDOUT: %.loc8_30.1: type = splice_block %.loc8_30.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc8_30.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_30.3: type = converted %.loc8_30.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc8_51.1: type = splice_block %.loc8_51.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc8_51.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_51.3: type = converted %.loc8_51.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_48.1: ref %empty_tuple.type = temporary_storage -// CHECK:STDOUT: %.loc8_48.2: ref %empty_tuple.type = temporary %.loc8_48.1, %F.call.loc8_48 -// CHECK:STDOUT: %tuple.loc8_48: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_48.3: %empty_tuple.type = converted %F.call.loc8_48, %tuple.loc8_48 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %z: %empty_tuple.type = value_binding z, %.loc8_48.3 -// CHECK:STDOUT: %DestroyOp.bound.loc8_48: = bound_method %.loc8_48.2, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc8_48: init %empty_tuple.type = call %DestroyOp.bound.loc8_48(%.loc8_48.2) -// CHECK:STDOUT: %DestroyOp.bound.loc8_38: = bound_method %.loc8_38.2, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc8_38: init %empty_tuple.type = call %DestroyOp.bound.loc8_38(%.loc8_38.2) -// CHECK:STDOUT: %DestroyOp.bound.loc8_15: = bound_method %y.var, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc8_15: init %empty_tuple.type = call %DestroyOp.bound.loc8_15(%y.var) +// CHECK:STDOUT: %.loc8_69.1: ref %empty_tuple.type = temporary_storage +// CHECK:STDOUT: %.loc8_69.2: ref %empty_tuple.type = temporary %.loc8_69.1, %F.call.loc8_69 +// CHECK:STDOUT: %tuple.loc8_69: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_69.3: %empty_tuple.type = converted %F.call.loc8_69, %tuple.loc8_69 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %z: %empty_tuple.type = value_binding z, %.loc8_69.3 +// CHECK:STDOUT: %DestroyOp.bound.loc8_69: = bound_method %.loc8_69.2, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc8_69: init %empty_tuple.type = call %DestroyOp.bound.loc8_69(%.loc8_69.2) +// CHECK:STDOUT: %DestroyOp.bound.loc8_59: = bound_method %.loc8_59.2, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc8_59: init %empty_tuple.type = call %DestroyOp.bound.loc8_59(%.loc8_59.2) +// CHECK:STDOUT: %DestroyOp.bound.loc8_22: = bound_method %y.var, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc8_22: init %empty_tuple.type = call %DestroyOp.bound.loc8_22(%y.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/where_expr/constraints.carbon b/toolchain/check/testdata/where_expr/constraints.carbon index bcd0716fe178..7205219896e3 100644 --- a/toolchain/check/testdata/where_expr/constraints.carbon +++ b/toolchain/check/testdata/where_expr/constraints.carbon @@ -180,7 +180,7 @@ import library "error_in_constraint"; fn F() { //@dump-sem-ir-begin - let x: () = WithError(()); + let unused x: () = WithError(()); //@dump-sem-ir-end } @@ -538,10 +538,10 @@ fn F() { // CHECK:STDOUT: %x.patt: %pattern_type = value_binding_pattern x [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %WithError.ref: %WithError.type = name_ref WithError, imports.%Main.WithError [concrete = constants.%WithError] -// CHECK:STDOUT: %.loc8_26: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_11.1: type = splice_block %.loc8_11.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc8_11.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_11.3: type = converted %.loc8_11.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc8_33: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_18.1: type = splice_block %.loc8_18.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc8_18.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_18.3: type = converted %.loc8_18.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %x: %empty_tuple.type = value_binding x, [concrete = ] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/where_expr/designator.carbon b/toolchain/check/testdata/where_expr/designator.carbon index bb24e303a49e..c6abdf5b0187 100644 --- a/toolchain/check/testdata/where_expr/designator.carbon +++ b/toolchain/check/testdata/where_expr/designator.carbon @@ -45,7 +45,7 @@ fn PeriodMismatch(W:! J where .Mismatch = {}); library "[[@TEST_NAME]]"; fn Foo() -> () { - var x: (); + var unused x: (); // CHECK:STDERR: fail_designator_matches_var.carbon:[[@LINE+5]]:10: error: name `.Self` not found [NameNotFound] // CHECK:STDERR: return .x; // CHECK:STDERR: ^~ @@ -98,7 +98,7 @@ interface I {} // TODO: Diagnose that the `where` on `T` does not refer to `.Self` at all. // See https://docs.carbon-lang.dev/docs/design/generics/details.html#constraints-must-use-a-designator -fn F(U:! type, T:! type where U impls I) {} +fn F(U:! type, unused T:! type where U impls I) {} // --- todo_fail_equality_constraint_does_not_constrain_self.carbon library "[[@TEST_NAME]]"; @@ -109,7 +109,7 @@ interface I { // TODO: Diagnose that the `where` on `T` does not refer to `.Self` at all. // See https://docs.carbon-lang.dev/docs/design/generics/details.html#constraints-must-use-a-designator -fn F(U:! I, T:! type where U.X == ()) {} +fn F(U:! I, unused T:! type where U.X == ()) {} // --- todo_fail_combined_constraint_does_not_constrain_self.carbon library "[[@TEST_NAME]]"; @@ -120,7 +120,7 @@ interface I { // TODO: Diagnose that the `where` on `T` does not refer to `.Self` at all. // See https://docs.carbon-lang.dev/docs/design/generics/details.html#constraints-must-use-a-designator -fn F(U:! I, T:! type where U impls I and U.X == ()) {} +fn F(U:! I, unused T:! type where U impls I and U.X == ()) {} // --- impls_constraint_does_constrain_self.carbon library "[[@TEST_NAME]]"; @@ -129,9 +129,9 @@ interface I(T:! type) {} class C(T:! type); -fn F(T:! type where C(.Self) impls I(())) {} +fn F(unused T:! type where C(.Self) impls I(())) {} -fn G(T:! type where C(()) impls I(.Self)) {} +fn G(unused T:! type where C(()) impls I(.Self)) {} // CHECK:STDOUT: --- success.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/where_expr/dot_self_impls.carbon b/toolchain/check/testdata/where_expr/dot_self_impls.carbon index d177f5a09748..327555edc244 100644 --- a/toolchain/check/testdata/where_expr/dot_self_impls.carbon +++ b/toolchain/check/testdata/where_expr/dot_self_impls.carbon @@ -57,7 +57,7 @@ interface J { fn INotJ(T:! I where .Self impls J) { // Gets `T.(I.F)`. Doesn't consider `T.(J.F)`, so no ambiguity. - let x: () = T.F(); + let unused x: () = T.F(); } // --- fail_name_lookup_through_where_self_impls.carbon @@ -145,7 +145,7 @@ fn INotJ[T:! I where .Self impls J](x: T) { library "[[@TEST_NAME]]"; class WrapType(T:! type) {} -fn AssertSame[T:! type](a: WrapType(T), b: WrapType(T)) {} +fn AssertSame[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {} fn Type(T:! type) -> WrapType(T) { return {}; } interface I; @@ -178,7 +178,7 @@ interface K {} library "[[@TEST_NAME]]"; class WrapType(T:! type) {} -fn AssertSame[T:! type](a: WrapType(T), b: WrapType(T)) {} +fn AssertSame[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {} fn Type(T:! type) -> WrapType(T) { return {}; } interface I { let A:! type; } @@ -201,7 +201,7 @@ fn Test() { library "[[@TEST_NAME]]"; class WrapType(T:! type) {} -fn Same[T:! type](a: WrapType(T), b: WrapType(T)) {} +fn Same[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {} fn Type(T:! type) -> WrapType(T) { return {}; } interface I {} @@ -212,8 +212,8 @@ fn Test() { // CHECK:STDERR: Same(Type(I where .Self impls J), Type(J where .Self impls I)); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_compare_not_equal.carbon:[[@LINE-10]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Same[T:! type](a: WrapType(T), b: WrapType(T)) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Same[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Same(Type(I where .Self impls J), Type(J where .Self impls I)); } diff --git a/toolchain/check/testdata/where_expr/dot_self_index.carbon b/toolchain/check/testdata/where_expr/dot_self_index.carbon index 81eac161ed3d..526ad267fb6b 100644 --- a/toolchain/check/testdata/where_expr/dot_self_index.carbon +++ b/toolchain/check/testdata/where_expr/dot_self_index.carbon @@ -18,7 +18,7 @@ interface Empty(W:! type) { // .Self has index invalid, not 1 // V has index 1, does not match .Self //@dump-sem-ir-begin -fn H(T:! type, U: Empty(T) where .A = T*, V:! type) {} +fn H(T:! type, unused U: Empty(T) where .A = T*, unused V:! type) {} //@dump-sem-ir-end fn G(U: Empty(i32) where .A = i32*) { @@ -76,47 +76,47 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: // CHECK:STDOUT: %T.loc21_6.2: type = symbolic_binding T, 0 [symbolic = %T.loc21_6.1 (constants.%T)] // CHECK:STDOUT: %U.param: @H.%Empty_where.type (%Empty_where.type.2dc) = value_param call_param0 -// CHECK:STDOUT: %.loc21_28.1: type = splice_block %.loc21_28.2 [symbolic = %Empty_where.type (constants.%Empty_where.type.2dc)] { +// CHECK:STDOUT: %.loc21_35.1: type = splice_block %.loc21_35.2 [symbolic = %Empty_where.type (constants.%Empty_where.type.2dc)] { // CHECK:STDOUT: %Empty.ref: %Empty.type.d36 = name_ref Empty, file.%Empty.decl [concrete = constants.%Empty.generic] -// CHECK:STDOUT: %T.ref.loc21_25: type = name_ref T, %T.loc21_6.2 [symbolic = %T.loc21_6.1 (constants.%T)] -// CHECK:STDOUT: %Empty.type.loc21_26.2: type = facet_type <@Empty, @Empty(constants.%T)> [symbolic = %Empty.type.loc21_26.1 (constants.%Empty.type.6f76f1.2)] +// CHECK:STDOUT: %T.ref.loc21_32: type = name_ref T, %T.loc21_6.2 [symbolic = %T.loc21_6.1 (constants.%T)] +// CHECK:STDOUT: %Empty.type.loc21_33.2: type = facet_type <@Empty, @Empty(constants.%T)> [symbolic = %Empty.type.loc21_33.1 (constants.%Empty.type.6f76f1.2)] // CHECK:STDOUT: -// CHECK:STDOUT: %.Self.ref: @H.%Empty.type.loc21_26.1 (%Empty.type.6f76f1.2) = name_ref .Self, %.Self.4 [symbolic = %.Self.1 (constants.%.Self.b4b)] +// CHECK:STDOUT: %.Self.ref: @H.%Empty.type.loc21_33.1 (%Empty.type.6f76f1.2) = name_ref .Self, %.Self.4 [symbolic = %.Self.1 (constants.%.Self.b4b)] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type.b61)] -// CHECK:STDOUT: %.loc21_34.1: type = converted %.Self.ref, %.Self.as_type [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type.b61)] -// CHECK:STDOUT: %.loc21_34.2: @H.%Empty.assoc_type (%Empty.assoc_type.ce4b5a.2) = specific_constant @A.%assoc0, @Empty(constants.%T, constants.%.Self.b4b) [symbolic = %assoc0 (constants.%assoc0.beb632.2)] -// CHECK:STDOUT: %A.ref: @H.%Empty.assoc_type (%Empty.assoc_type.ce4b5a.2) = name_ref A, %.loc21_34.2 [symbolic = %assoc0 (constants.%assoc0.beb632.2)] -// CHECK:STDOUT: %impl.elem0.loc21_34.2: type = impl_witness_access constants.%Empty.lookup_impl_witness.177, element0 [symbolic = %impl.elem0.loc21_34.1 (constants.%impl.elem0.de5)] -// CHECK:STDOUT: %T.ref.loc21_39: type = name_ref T, %T.loc21_6.2 [symbolic = %T.loc21_6.1 (constants.%T)] -// CHECK:STDOUT: %ptr.loc21_40.2: type = ptr_type %T.ref.loc21_39 [symbolic = %ptr.loc21_40.1 (constants.%ptr.e8f)] -// CHECK:STDOUT: %.loc21_28.2: type = where_expr %.Self.4 [symbolic = %Empty_where.type (constants.%Empty_where.type.2dc)] { +// CHECK:STDOUT: %.loc21_41.1: type = converted %.Self.ref, %.Self.as_type [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type.b61)] +// CHECK:STDOUT: %.loc21_41.2: @H.%Empty.assoc_type (%Empty.assoc_type.ce4b5a.2) = specific_constant @A.%assoc0, @Empty(constants.%T, constants.%.Self.b4b) [symbolic = %assoc0 (constants.%assoc0.beb632.2)] +// CHECK:STDOUT: %A.ref: @H.%Empty.assoc_type (%Empty.assoc_type.ce4b5a.2) = name_ref A, %.loc21_41.2 [symbolic = %assoc0 (constants.%assoc0.beb632.2)] +// CHECK:STDOUT: %impl.elem0.loc21_41.2: type = impl_witness_access constants.%Empty.lookup_impl_witness.177, element0 [symbolic = %impl.elem0.loc21_41.1 (constants.%impl.elem0.de5)] +// CHECK:STDOUT: %T.ref.loc21_46: type = name_ref T, %T.loc21_6.2 [symbolic = %T.loc21_6.1 (constants.%T)] +// CHECK:STDOUT: %ptr.loc21_47.2: type = ptr_type %T.ref.loc21_46 [symbolic = %ptr.loc21_47.1 (constants.%ptr.e8f)] +// CHECK:STDOUT: %.loc21_35.2: type = where_expr %.Self.4 [symbolic = %Empty_where.type (constants.%Empty_where.type.2dc)] { // CHECK:STDOUT: requirement_base_facet_type constants.%Empty.type.6f76f1.2 -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc21_34.2, %ptr.loc21_40.2 +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc21_41.2, %ptr.loc21_47.2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %U: @H.%Empty_where.type (%Empty_where.type.2dc) = value_binding U, %U.param // CHECK:STDOUT: -// CHECK:STDOUT: %V.loc21_43.2: type = symbolic_binding V, 1 [symbolic = %V.loc21_43.1 (constants.%V)] +// CHECK:STDOUT: %V.loc21_57.2: type = symbolic_binding V, 1 [symbolic = %V.loc21_57.1 (constants.%V)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @H(%T.loc21_6.2: type, %V.loc21_43.2: type) { +// CHECK:STDOUT: generic fn @H(%T.loc21_6.2: type, %V.loc21_57.2: type) { // CHECK:STDOUT: %T.loc21_6.1: type = symbolic_binding T, 0 [symbolic = %T.loc21_6.1 (constants.%T)] -// CHECK:STDOUT: %Empty.type.loc21_26.1: type = facet_type <@Empty, @Empty(%T.loc21_6.1)> [symbolic = %Empty.type.loc21_26.1 (constants.%Empty.type.6f76f1.2)] +// CHECK:STDOUT: %Empty.type.loc21_33.1: type = facet_type <@Empty, @Empty(%T.loc21_6.1)> [symbolic = %Empty.type.loc21_33.1 (constants.%Empty.type.6f76f1.2)] // CHECK:STDOUT: -// CHECK:STDOUT: %require_complete.loc21_34: = require_complete_type %Empty.type.loc21_26.1 [symbolic = %require_complete.loc21_34 (constants.%require_complete.8eb)] +// CHECK:STDOUT: %require_complete.loc21_41: = require_complete_type %Empty.type.loc21_33.1 [symbolic = %require_complete.loc21_41 (constants.%require_complete.8eb)] // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self.1 [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type.b61)] // CHECK:STDOUT: %Empty.assoc_type: type = assoc_entity_type @Empty, @Empty(%T.loc21_6.1) [symbolic = %Empty.assoc_type (constants.%Empty.assoc_type.ce4b5a.2)] // CHECK:STDOUT: %assoc0: @H.%Empty.assoc_type (%Empty.assoc_type.ce4b5a.2) = assoc_entity element0, @Empty.%A [symbolic = %assoc0 (constants.%assoc0.beb632.2)] // CHECK:STDOUT: %Empty.lookup_impl_witness: = lookup_impl_witness %.Self.1, @Empty, @Empty(%T.loc21_6.1) [symbolic = %Empty.lookup_impl_witness (constants.%Empty.lookup_impl_witness.177)] -// CHECK:STDOUT: %impl.elem0.loc21_34.1: type = impl_witness_access %Empty.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc21_34.1 (constants.%impl.elem0.de5)] -// CHECK:STDOUT: %ptr.loc21_40.1: type = ptr_type %T.loc21_6.1 [symbolic = %ptr.loc21_40.1 (constants.%ptr.e8f)] -// CHECK:STDOUT: %Empty_where.type: type = facet_type <@Empty, @Empty(%T.loc21_6.1) where %impl.elem0.loc21_34.1 = %ptr.loc21_40.1> [symbolic = %Empty_where.type (constants.%Empty_where.type.2dc)] +// CHECK:STDOUT: %impl.elem0.loc21_41.1: type = impl_witness_access %Empty.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc21_41.1 (constants.%impl.elem0.de5)] +// CHECK:STDOUT: %ptr.loc21_47.1: type = ptr_type %T.loc21_6.1 [symbolic = %ptr.loc21_47.1 (constants.%ptr.e8f)] +// CHECK:STDOUT: %Empty_where.type: type = facet_type <@Empty, @Empty(%T.loc21_6.1) where %impl.elem0.loc21_41.1 = %ptr.loc21_47.1> [symbolic = %Empty_where.type (constants.%Empty_where.type.2dc)] // CHECK:STDOUT: %pattern_type: type = pattern_type %Empty_where.type [symbolic = %pattern_type (constants.%pattern_type.bb3)] -// CHECK:STDOUT: %V.loc21_43.1: type = symbolic_binding V, 1 [symbolic = %V.loc21_43.1 (constants.%V)] +// CHECK:STDOUT: %V.loc21_57.1: type = symbolic_binding V, 1 [symbolic = %V.loc21_57.1 (constants.%V)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc21_17: = require_complete_type %Empty_where.type [symbolic = %require_complete.loc21_17 (constants.%require_complete.6bc)] +// CHECK:STDOUT: %require_complete.loc21_24: = require_complete_type %Empty_where.type [symbolic = %require_complete.loc21_24 (constants.%require_complete.6bc)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%U.param: @H.%Empty_where.type (%Empty_where.type.2dc)) { // CHECK:STDOUT: !entry: @@ -126,36 +126,36 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: // CHECK:STDOUT: specific @H(constants.%T, constants.%V) { // CHECK:STDOUT: %T.loc21_6.1 => constants.%T -// CHECK:STDOUT: %Empty.type.loc21_26.1 => constants.%Empty.type.6f76f1.2 +// CHECK:STDOUT: %Empty.type.loc21_33.1 => constants.%Empty.type.6f76f1.2 // CHECK:STDOUT: %.Self.1 => constants.%.Self.b4b -// CHECK:STDOUT: %require_complete.loc21_34 => constants.%require_complete.8eb +// CHECK:STDOUT: %require_complete.loc21_41 => constants.%require_complete.8eb // CHECK:STDOUT: %.Self.binding.as_type => constants.%.Self.binding.as_type.b61 // CHECK:STDOUT: %Empty.assoc_type => constants.%Empty.assoc_type.ce4b5a.2 // CHECK:STDOUT: %assoc0 => constants.%assoc0.beb632.2 // CHECK:STDOUT: %Empty.lookup_impl_witness => constants.%Empty.lookup_impl_witness.177 -// CHECK:STDOUT: %impl.elem0.loc21_34.1 => constants.%impl.elem0.de5 -// CHECK:STDOUT: %ptr.loc21_40.1 => constants.%ptr.e8f +// CHECK:STDOUT: %impl.elem0.loc21_41.1 => constants.%impl.elem0.de5 +// CHECK:STDOUT: %ptr.loc21_47.1 => constants.%ptr.e8f // CHECK:STDOUT: %Empty_where.type => constants.%Empty_where.type.2dc // CHECK:STDOUT: %pattern_type => constants.%pattern_type.bb3 -// CHECK:STDOUT: %V.loc21_43.1 => constants.%V +// CHECK:STDOUT: %V.loc21_57.1 => constants.%V // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @H(constants.%i32, bool) { // CHECK:STDOUT: %T.loc21_6.1 => constants.%i32 -// CHECK:STDOUT: %Empty.type.loc21_26.1 => constants.%Empty.type.4fb +// CHECK:STDOUT: %Empty.type.loc21_33.1 => constants.%Empty.type.4fb // CHECK:STDOUT: %.Self.1 => constants.%.Self.ec6 -// CHECK:STDOUT: %require_complete.loc21_34 => constants.%complete_type.ba8 +// CHECK:STDOUT: %require_complete.loc21_41 => constants.%complete_type.ba8 // CHECK:STDOUT: %.Self.binding.as_type => constants.%.Self.binding.as_type.63c // CHECK:STDOUT: %Empty.assoc_type => constants.%Empty.assoc_type.623 // CHECK:STDOUT: %assoc0 => constants.%assoc0.edc // CHECK:STDOUT: %Empty.lookup_impl_witness => constants.%Empty.lookup_impl_witness.924 -// CHECK:STDOUT: %impl.elem0.loc21_34.1 => constants.%impl.elem0.238 -// CHECK:STDOUT: %ptr.loc21_40.1 => constants.%ptr.235 +// CHECK:STDOUT: %impl.elem0.loc21_41.1 => constants.%impl.elem0.238 +// CHECK:STDOUT: %ptr.loc21_47.1 => constants.%ptr.235 // CHECK:STDOUT: %Empty_where.type => constants.%Empty_where.type.729 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ee5 -// CHECK:STDOUT: %V.loc21_43.1 => bool +// CHECK:STDOUT: %V.loc21_57.1 => bool // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc21_17 => constants.%complete_type.863 +// CHECK:STDOUT: %require_complete.loc21_24 => constants.%complete_type.863 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/where_expr/equal_rewrite.carbon b/toolchain/check/testdata/where_expr/equal_rewrite.carbon index fd41b60446c3..dcaec6ec0468 100644 --- a/toolchain/check/testdata/where_expr/equal_rewrite.carbon +++ b/toolchain/check/testdata/where_expr/equal_rewrite.carbon @@ -44,7 +44,7 @@ interface E { } //@dump-sem-ir-begin -fn OneRewrite(G:! E where .F = i32) {} +fn OneRewrite(unused G:! E where .F = i32) {} fn RepeatedRewrite(H:! E where .F = i32 and .F = i32) { //@dump-sem-ir-end @@ -65,7 +65,7 @@ interface J { } //@dump-sem-ir-begin -fn Alphabetical(M:! J where .K = () and .L = bool) {} +fn Alphabetical(unused M:! J where .K = () and .L = bool) {} fn Reversed(N:! J where .L = bool and .K = ()) { //@dump-sem-ir-end @@ -80,15 +80,15 @@ interface O { let P:! type; } -fn WithInteger(Q:! O where .P = i32) {} +fn WithInteger(unused Q:! O where .P = i32) {} fn WithBool(R:! O where .P = bool) { // CHECK:STDERR: fail_rewrites_mismatch_right.carbon:[[@LINE+7]]:3: error: cannot convert type `R` that implements `O where .(O.P) = bool` into type implementing `O where .(O.P) = i32` [ConversionFailureFacetToFacet] // CHECK:STDERR: WithInteger(R); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_rewrites_mismatch_right.carbon:[[@LINE-6]]:16: note: initializing generic parameter `Q` declared here [InitializingGenericParam] - // CHECK:STDERR: fn WithInteger(Q:! O where .P = i32) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_rewrites_mismatch_right.carbon:[[@LINE-6]]:23: note: initializing generic parameter `Q` declared here [InitializingGenericParam] + // CHECK:STDERR: fn WithInteger(unused Q:! O where .P = i32) {} + // CHECK:STDERR: ^ // CHECK:STDERR: WithInteger(R); } @@ -102,15 +102,15 @@ interface S { let U:! type; } -fn WithT(V:! S where .T = ()) {} +fn WithT(unused V:! S where .T = ()) {} fn WithU(W:! S where .U = ()) { // CHECK:STDERR: fail_rewrites_mismatch_left.carbon:[[@LINE+7]]:3: error: cannot convert type `W` that implements `S where .(S.U) = ()` into type implementing `S where .(S.T) = ()` [ConversionFailureFacetToFacet] // CHECK:STDERR: WithT(W); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_rewrites_mismatch_left.carbon:[[@LINE-6]]:10: note: initializing generic parameter `V` declared here [InitializingGenericParam] - // CHECK:STDERR: fn WithT(V:! S where .T = ()) {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_rewrites_mismatch_left.carbon:[[@LINE-6]]:17: note: initializing generic parameter `V` declared here [InitializingGenericParam] + // CHECK:STDERR: fn WithT(unused V:! S where .T = ()) {} + // CHECK:STDERR: ^ // CHECK:STDERR: WithT(W); } @@ -382,23 +382,23 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %OneRewrite.decl: %OneRewrite.type = fn_decl @OneRewrite [concrete = constants.%OneRewrite] { // CHECK:STDOUT: %G.patt: %pattern_type.606 = symbolic_binding_pattern G, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc9_21.1: type = splice_block %.loc9_21.2 [concrete = constants.%E_where.type] { +// CHECK:STDOUT: %.loc9_28.1: type = splice_block %.loc9_28.2 [concrete = constants.%E_where.type] { // CHECK:STDOUT: // CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [concrete = constants.%E.type] // CHECK:STDOUT: // CHECK:STDOUT: %.Self.ref: %E.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.7f5] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type] -// CHECK:STDOUT: %.loc9_27: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type] +// CHECK:STDOUT: %.loc9_34: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type] // CHECK:STDOUT: %F.ref: %E.assoc_type = name_ref F, @F.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%E.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc9_21.2: type = where_expr %.Self.2 [concrete = constants.%E_where.type] { +// CHECK:STDOUT: %.loc9_28.2: type = where_expr %.Self.2 [concrete = constants.%E_where.type] { // CHECK:STDOUT: requirement_base_facet_type constants.%E.type // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %G.loc9_15.2: %E_where.type = symbolic_binding G, 0 [symbolic = %G.loc9_15.1 (constants.%G)] +// CHECK:STDOUT: %G.loc9_22.2: %E_where.type = symbolic_binding G, 0 [symbolic = %G.loc9_22.1 (constants.%G)] // CHECK:STDOUT: } // CHECK:STDOUT: %RepeatedRewrite.decl: %RepeatedRewrite.type = fn_decl @RepeatedRewrite [concrete = constants.%RepeatedRewrite] { // CHECK:STDOUT: %H.patt: %pattern_type.606 = symbolic_binding_pattern H, 0 [concrete] @@ -432,8 +432,8 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @OneRewrite(%G.loc9_15.2: %E_where.type) { -// CHECK:STDOUT: %G.loc9_15.1: %E_where.type = symbolic_binding G, 0 [symbolic = %G.loc9_15.1 (constants.%G)] +// CHECK:STDOUT: generic fn @OneRewrite(%G.loc9_22.2: %E_where.type) { +// CHECK:STDOUT: %G.loc9_22.1: %E_where.type = symbolic_binding G, 0 [symbolic = %G.loc9_22.1 (constants.%G)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -456,7 +456,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @OneRewrite(constants.%G) { -// CHECK:STDOUT: %G.loc9_15.1 => constants.%G +// CHECK:STDOUT: %G.loc9_22.1 => constants.%G // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @RepeatedRewrite(constants.%H) { @@ -464,7 +464,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @OneRewrite(constants.%H) { -// CHECK:STDOUT: %G.loc9_15.1 => constants.%H +// CHECK:STDOUT: %G.loc9_22.1 => constants.%H // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -477,7 +477,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @OneRewrite(constants.%I) { -// CHECK:STDOUT: %G.loc9_15.1 => constants.%I +// CHECK:STDOUT: %G.loc9_22.1 => constants.%I // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -515,32 +515,32 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %Alphabetical.decl: %Alphabetical.type = fn_decl @Alphabetical [concrete = constants.%Alphabetical] { // CHECK:STDOUT: %M.patt: %pattern_type.a2c = symbolic_binding_pattern M, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc10_23.1: type = splice_block %.loc10_23.2 [concrete = constants.%J_where.type] { +// CHECK:STDOUT: %.loc10_30.1: type = splice_block %.loc10_30.2 [concrete = constants.%J_where.type] { // CHECK:STDOUT: // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: -// CHECK:STDOUT: %.Self.ref.loc10_29: %J.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.2fa] -// CHECK:STDOUT: %.Self.as_type.loc10_29: type = facet_access_type %.Self.ref.loc10_29 [symbolic_self = constants.%.Self.binding.as_type] -// CHECK:STDOUT: %.loc10_29: type = converted %.Self.ref.loc10_29, %.Self.as_type.loc10_29 [symbolic_self = constants.%.Self.binding.as_type] +// CHECK:STDOUT: %.Self.ref.loc10_36: %J.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.2fa] +// CHECK:STDOUT: %.Self.as_type.loc10_36: type = facet_access_type %.Self.ref.loc10_36 [symbolic_self = constants.%.Self.binding.as_type] +// CHECK:STDOUT: %.loc10_36: type = converted %.Self.ref.loc10_36, %.Self.as_type.loc10_36 [symbolic_self = constants.%.Self.binding.as_type] // CHECK:STDOUT: %K.ref: %J.assoc_type = name_ref K, @K.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.loc10_35.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc10_35.2: type = converted %.loc10_35.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %.Self.ref.loc10_41: %J.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.2fa] -// CHECK:STDOUT: %.Self.as_type.loc10_41: type = facet_access_type %.Self.ref.loc10_41 [symbolic_self = constants.%.Self.binding.as_type] -// CHECK:STDOUT: %.loc10_41: type = converted %.Self.ref.loc10_41, %.Self.as_type.loc10_41 [symbolic_self = constants.%.Self.binding.as_type] +// CHECK:STDOUT: %.loc10_42.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc10_42.2: type = converted %.loc10_42.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.Self.ref.loc10_48: %J.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.2fa] +// CHECK:STDOUT: %.Self.as_type.loc10_48: type = facet_access_type %.Self.ref.loc10_48 [symbolic_self = constants.%.Self.binding.as_type] +// CHECK:STDOUT: %.loc10_48: type = converted %.Self.ref.loc10_48, %.Self.as_type.loc10_48 [symbolic_self = constants.%.Self.binding.as_type] // CHECK:STDOUT: %L.ref: %J.assoc_type = name_ref L, @L.%assoc1 [concrete = constants.%assoc1] // CHECK:STDOUT: %impl.elem1: type = impl_witness_access constants.%J.lookup_impl_witness, element1 [symbolic_self = constants.%impl.elem1] // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc10_46.1: type = value_of_initializer %Bool.call [concrete = bool] -// CHECK:STDOUT: %.loc10_46.2: type = converted %Bool.call, %.loc10_46.1 [concrete = bool] -// CHECK:STDOUT: %.loc10_23.2: type = where_expr %.Self.2 [concrete = constants.%J_where.type] { +// CHECK:STDOUT: %.loc10_53.1: type = value_of_initializer %Bool.call [concrete = bool] +// CHECK:STDOUT: %.loc10_53.2: type = converted %Bool.call, %.loc10_53.1 [concrete = bool] +// CHECK:STDOUT: %.loc10_30.2: type = where_expr %.Self.2 [concrete = constants.%J_where.type] { // CHECK:STDOUT: requirement_base_facet_type constants.%J.type -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_35.2 -// CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc10_46.2 +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_42.2 +// CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc10_53.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %M.loc10_17.2: %J_where.type = symbolic_binding M, 0 [symbolic = %M.loc10_17.1 (constants.%M)] +// CHECK:STDOUT: %M.loc10_24.2: %J_where.type = symbolic_binding M, 0 [symbolic = %M.loc10_24.1 (constants.%M)] // CHECK:STDOUT: } // CHECK:STDOUT: %Reversed.decl: %Reversed.type = fn_decl @Reversed [concrete = constants.%Reversed] { // CHECK:STDOUT: %N.patt: %pattern_type.a2c = symbolic_binding_pattern N, 0 [concrete] @@ -574,8 +574,8 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Alphabetical(%M.loc10_17.2: %J_where.type) { -// CHECK:STDOUT: %M.loc10_17.1: %J_where.type = symbolic_binding M, 0 [symbolic = %M.loc10_17.1 (constants.%M)] +// CHECK:STDOUT: generic fn @Alphabetical(%M.loc10_24.2: %J_where.type) { +// CHECK:STDOUT: %M.loc10_24.1: %J_where.type = symbolic_binding M, 0 [symbolic = %M.loc10_24.1 (constants.%M)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -598,7 +598,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Alphabetical(constants.%M) { -// CHECK:STDOUT: %M.loc10_17.1 => constants.%M +// CHECK:STDOUT: %M.loc10_24.1 => constants.%M // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Reversed(constants.%N) { @@ -606,7 +606,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Alphabetical(constants.%N) { -// CHECK:STDOUT: %M.loc10_17.1 => constants.%N +// CHECK:STDOUT: %M.loc10_24.1 => constants.%N // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/where_expr/non_generic.carbon b/toolchain/check/testdata/where_expr/non_generic.carbon index 2eaef074c89a..020357f1c343 100644 --- a/toolchain/check/testdata/where_expr/non_generic.carbon +++ b/toolchain/check/testdata/where_expr/non_generic.carbon @@ -14,7 +14,7 @@ interface I { let T:! type; } // Ensure that we don't crash when checking this `where` in a non-generic context. //@dump-sem-ir-begin -fn NotGenericF(U: I where .T == i32) {} +fn NotGenericF(unused U: I where .T == i32) {} //@dump-sem-ir-end // CHECK:STDOUT: --- non_generic.carbon @@ -44,17 +44,17 @@ fn NotGenericF(U: I where .T == i32) {} // CHECK:STDOUT: %U.param_patt: %pattern_type.092 = value_param_pattern %U.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %U.param: %I_where.type = value_param call_param0 -// CHECK:STDOUT: %.loc17_21.1: type = splice_block %.loc17_21.2 [concrete = constants.%I_where.type] { +// CHECK:STDOUT: %.loc17_28.1: type = splice_block %.loc17_28.2 [concrete = constants.%I_where.type] { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type] -// CHECK:STDOUT: %.loc17_27: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type] +// CHECK:STDOUT: %.loc17_34: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type] // CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc17_21.2: type = where_expr %.Self [concrete = constants.%I_where.type] { +// CHECK:STDOUT: %.loc17_28.2: type = where_expr %.Self [concrete = constants.%I_where.type] { // CHECK:STDOUT: requirement_base_facet_type constants.%I.type // CHECK:STDOUT: requirement_equivalent %impl.elem0, %i32 // CHECK:STDOUT: } diff --git a/toolchain/check/thunk.cpp b/toolchain/check/thunk.cpp index d21baa26a4a5..798efaca894d 100644 --- a/toolchain/check/thunk.cpp +++ b/toolchain/check/thunk.cpp @@ -77,7 +77,8 @@ static auto CloneBindingPattern(Context& context, SemIR::InstId pattern_id, // Rebuild the binding pattern. return AddBindingPattern(context, SemIR::LocId(pattern_id), entity_name.name_id, type_id, type_expr_region_id, - pattern.kind, entity_name.is_template) + pattern.kind, entity_name.is_template, + /*is_unused=*/false) .pattern_id; } diff --git a/toolchain/check/unused.cpp b/toolchain/check/unused.cpp new file mode 100644 index 000000000000..dffbc58d765d --- /dev/null +++ b/toolchain/check/unused.cpp @@ -0,0 +1,54 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include "toolchain/check/unused.h" + +#include "toolchain/base/kind_switch.h" +#include "toolchain/check/context.h" +#include "toolchain/check/diagnostic_helpers.h" + +namespace Carbon::Check { + +auto CheckUnusedBinding(Context& context, SemIR::NameId name_id, + const LexicalLookup::Result& result) -> void { + // Don't warn about the special name `_`. Other special names, such as `self`, + // are warned if unused. `.Self` is also excluded as it is often implicit. + if (name_id == SemIR::NameId::Underscore || + name_id == SemIR::NameId::PeriodSelf) { + return; + } + + // Don't warn about names that aren't in the current file. + auto decl_loc = context.insts().GetCanonicalLocId(result.inst_id); + if (decl_loc.kind() == SemIR::LocId::Kind::ImportIRInstId) { + return; + } + + auto binding = context.insts().TryGetAs(result.inst_id); + if (!binding) { + return; + } + + const auto& entity_name = context.entity_names().Get(binding->entity_name_id); + if (entity_name.is_unused) { + if (result.use_loc_id.has_value()) { + CARBON_DIAGNOSTIC(UnusedButUsed, Error, + "variable `{0}` marked `unused` but used", + SemIR::NameId); + CARBON_DIAGNOSTIC(UnusedButUsedHere, Note, "usage here"); + context.emitter() + .Build(decl_loc, UnusedButUsed, name_id) + .Note(result.use_loc_id, UnusedButUsedHere) + .Emit(); + } + } else { + if (!result.use_loc_id.has_value() && result.is_decl_reachable) { + CARBON_DIAGNOSTIC(UnusedBinding, Warning, "binding `{0}` unused", + SemIR::NameId); + context.emitter().Emit(decl_loc, UnusedBinding, name_id); + } + } +} + +} // namespace Carbon::Check diff --git a/toolchain/check/unused.h b/toolchain/check/unused.h new file mode 100644 index 000000000000..1e4d03051f4e --- /dev/null +++ b/toolchain/check/unused.h @@ -0,0 +1,23 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef CARBON_TOOLCHAIN_CHECK_UNUSED_H_ +#define CARBON_TOOLCHAIN_CHECK_UNUSED_H_ + +#include "toolchain/check/context.h" +#include "toolchain/check/scope_stack.h" + +namespace Carbon::Check { + +// Checks for an unused binding. We track whether a name was declared in a +// reachable position, and whether it was used (even in unreachable code), to +// decide whether to warn. If a name is used in unreachable code, we don't warn +// because changing it to `_` would be a name lookup error in that unreachable +// code. +auto CheckUnusedBinding(Context& context, SemIR::NameId name_id, + const LexicalLookup::Result& result) -> void; + +} // namespace Carbon::Check + +#endif // CARBON_TOOLCHAIN_CHECK_UNUSED_H_ diff --git a/toolchain/diagnostics/kind.def b/toolchain/diagnostics/kind.def index 624c75d1a012..f6357e7fc64a 100644 --- a/toolchain/diagnostics/kind.def +++ b/toolchain/diagnostics/kind.def @@ -559,6 +559,13 @@ CARBON_DIAGNOSTIC_KIND(GenericMissingExplicitParameters) // Pattern matching diagnostics. CARBON_DIAGNOSTIC_KIND(TuplePatternSizeDoesntMatchLiteral) +// Unused diagnostics. +CARBON_DIAGNOSTIC_KIND(UnusedButUsed) +CARBON_DIAGNOSTIC_KIND(UnusedButUsedHere) +CARBON_DIAGNOSTIC_KIND(UnusedModifierOnDeclaration) +CARBON_DIAGNOSTIC_KIND(UnusedPatternNoBindings) +CARBON_DIAGNOSTIC_KIND(UnusedBinding) + // ============================================================================ // CodeGen diagnostics // ============================================================================ diff --git a/toolchain/driver/testdata/fail_flush_errors.carbon b/toolchain/driver/testdata/fail_flush_errors.carbon index ab5575312db7..666c1850fe5f 100644 --- a/toolchain/driver/testdata/fail_flush_errors.carbon +++ b/toolchain/driver/testdata/fail_flush_errors.carbon @@ -37,7 +37,7 @@ fn F() { undeclared2; // Add the name into the string table via a declaration rather than an expression. - if (true) { let undeclared3: () = (); } + if (true) { let unused undeclared3: () = (); } // CHECK:STDERR: fail_flush_errors.carbon:[[@LINE+4]]:3: error: name `undeclared3` not found [NameNotFound] // CHECK:STDERR: undeclared3; // CHECK:STDERR: ^~~~~~~~~~~ diff --git a/toolchain/lower/testdata/array/iterate.carbon b/toolchain/lower/testdata/array/iterate.carbon index dec99b1fb115..04dd592e2420 100644 --- a/toolchain/lower/testdata/array/iterate.carbon +++ b/toolchain/lower/testdata/array/iterate.carbon @@ -197,7 +197,7 @@ fn F() { // CHECK:STDOUT: !17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8) // CHECK:STDOUT: !18 = !{!19} // CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !12, type: !17) -// CHECK:STDOUT: !20 = !DILocation(line: 23, column: 39, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 23, column: 46, scope: !12) // CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.7711e6f0e1563534:Iterate.Core.a4ad391f91521d70", scope: null, file: !13, line: 24, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) // CHECK:STDOUT: !22 = !DISubroutineType(types: !23) // CHECK:STDOUT: !23 = !{!17, !17, !17} diff --git a/toolchain/lower/testdata/class/virtual.carbon b/toolchain/lower/testdata/class/virtual.carbon index 636fee162529..bb8f2dd8f69c 100644 --- a/toolchain/lower/testdata/class/virtual.carbon +++ b/toolchain/lower/testdata/class/virtual.carbon @@ -19,12 +19,12 @@ base class Base { base class Intermediate { extend base: Base; - virtual fn Fn[self: Self]() { } + virtual fn Fn[unused self: Self]() { } } class Derived { extend base: Intermediate; - override fn Fn[self: Self]() { } + override fn Fn[unused self: Self]() { } } // --- create.carbon @@ -52,7 +52,7 @@ package MemberInit; base class Base { var m: i32; - virtual fn Fn[self: Self]() { } + virtual fn Fn[unused self: Self]() { } } fn Fn() { @@ -113,7 +113,7 @@ fn Use() { library "[[@TEST_NAME]]"; base class Base(T:! type) { - virtual fn F[self: Self]() { } + virtual fn F[unused self: Self]() { } } // --- generic_use.carbon @@ -121,7 +121,7 @@ base class Base(T:! type) { library "[[@TEST_NAME]]"; base class Base(T:! Core.Destroy) { - virtual fn F[self: Self]() { + virtual fn F[unused self: Self]() { var _: T; } } @@ -141,7 +141,7 @@ fn F() { library "[[@TEST_NAME]]"; base class Base(T:! type) { - virtual fn F[self: Self]() { } + virtual fn F[unused self: Self]() { } } class T1; diff --git a/toolchain/lower/testdata/for/bindings.carbon b/toolchain/lower/testdata/for/bindings.carbon index 25f434ef3f01..4819c8545f73 100644 --- a/toolchain/lower/testdata/for/bindings.carbon +++ b/toolchain/lower/testdata/for/bindings.carbon @@ -12,10 +12,10 @@ class EmptyRange(T:! Core.Copy & Core.Destroy) { impl as Core.Iterate where .CursorType = {} and .ElementType = T { - fn NewCursor[self: Self]() -> {} { + fn NewCursor[unused self: Self]() -> {} { return {}; } - fn Next[self: Self](_: {}*) -> Core.Optional(T) { + fn Next[unused self: Self](_: {}*) -> Core.Optional(T) { return Core.Optional(T).None(); } } diff --git a/toolchain/lower/testdata/function/generic/call_basic.carbon b/toolchain/lower/testdata/function/generic/call_basic.carbon index 4123ef1843d8..5f43ed1e3986 100644 --- a/toolchain/lower/testdata/function/generic/call_basic.carbon +++ b/toolchain/lower/testdata/function/generic/call_basic.carbon @@ -12,7 +12,7 @@ class C { impl as Core.Copy { - fn Op[self: Self]() -> Self { return {}; } + fn Op[unused self: Self]() -> Self { return {}; } } } @@ -60,12 +60,12 @@ fn M() { // CHECK:STDOUT: // CHECK:STDOUT: %type = type {} // CHECK:STDOUT: -// CHECK:STDOUT: @C.val.loc15_44 = internal constant {} zeroinitializer +// CHECK:STDOUT: @C.val.loc15_51 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @"_COp.C.Main:Copy.Core"(ptr sret({}) %return, ptr %self) #0 !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @C.val.loc15_44, i64 0, i1 false), !dbg !10 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @C.val.loc15_51, i64 0, i1 false), !dbg !10 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -245,7 +245,7 @@ fn M() { // CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8) // CHECK:STDOUT: !8 = !{!9} // CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) -// CHECK:STDOUT: !10 = !DILocation(line: 15, column: 35, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 15, column: 42, scope: !4) // CHECK:STDOUT: !11 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !3, line: 48, type: !12, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !12 = !DISubroutineType(types: !13) // CHECK:STDOUT: !13 = !{null} diff --git a/toolchain/lower/testdata/function/generic/call_method.carbon b/toolchain/lower/testdata/function/generic/call_method.carbon index 405453a20a3e..464bdc382004 100644 --- a/toolchain/lower/testdata/function/generic/call_method.carbon +++ b/toolchain/lower/testdata/function/generic/call_method.carbon @@ -11,7 +11,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/function/generic/call_method.carbon class C { - fn F[self: Self, T:! Core.Copy](x: T) -> T { + fn F[unused self: Self, T:! Core.Copy](x: T) -> T { return x; } } diff --git a/toolchain/lower/testdata/function/generic/call_recursive_basic.carbon b/toolchain/lower/testdata/function/generic/call_recursive_basic.carbon index 2e2c631ac8a0..f827a50091f9 100644 --- a/toolchain/lower/testdata/function/generic/call_recursive_basic.carbon +++ b/toolchain/lower/testdata/function/generic/call_recursive_basic.carbon @@ -12,7 +12,7 @@ class C { impl as Core.Copy { - fn Op[self: Self]() -> Self { return {}; } + fn Op[unused self: Self]() -> Self { return {}; } } } @@ -43,12 +43,12 @@ fn M() { // CHECK:STDOUT: ; ModuleID = 'call_recursive_basic.carbon' // CHECK:STDOUT: source_filename = "call_recursive_basic.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @C.val.loc15_44 = internal constant {} zeroinitializer +// CHECK:STDOUT: @C.val.loc15_51 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @"_COp.C.Main:Copy.Core"(ptr sret({}) %return, ptr %self) #0 !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @C.val.loc15_44, i64 0, i1 false), !dbg !10 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @C.val.loc15_51, i64 0, i1 false), !dbg !10 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -169,7 +169,7 @@ fn M() { // CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8) // CHECK:STDOUT: !8 = !{!9} // CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) -// CHECK:STDOUT: !10 = !DILocation(line: 15, column: 35, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 15, column: 42, scope: !4) // CHECK:STDOUT: !11 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !3, line: 28, type: !12, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !12 = !DISubroutineType(types: !13) // CHECK:STDOUT: !13 = !{null} diff --git a/toolchain/lower/testdata/function/generic/call_specific_in_class.carbon b/toolchain/lower/testdata/function/generic/call_specific_in_class.carbon index 3a0ee8069504..202c5968df15 100644 --- a/toolchain/lower/testdata/function/generic/call_specific_in_class.carbon +++ b/toolchain/lower/testdata/function/generic/call_specific_in_class.carbon @@ -15,7 +15,7 @@ // generic function for an object, from a generic context. // The specifics with a pointer type could be deduplicated here. class C { - fn Cfn[self: Self, T:! Core.Copy](x: T) -> T { + fn Cfn[unused self: Self, T:! Core.Copy](x: T) -> T { return x; } } diff --git a/toolchain/lower/testdata/function/generic/reverse_canonical.carbon b/toolchain/lower/testdata/function/generic/reverse_canonical.carbon index d524542e64ad..6d140a8c1c46 100644 --- a/toolchain/lower/testdata/function/generic/reverse_canonical.carbon +++ b/toolchain/lower/testdata/function/generic/reverse_canonical.carbon @@ -17,7 +17,7 @@ fn second[T:! type, U:! type, V:! type](arg1: T, arg2: U, arg3: V); fn third[T:! type, U:! type, V:! type](arg1: T, arg2: U, arg3: V); fn fourth[T:! type, U:! type, V:! type](arg1: T, arg2: U, arg3: V); -fn first[T:! type, U:! type, V:! type](arg1: T, arg2: U, arg3: V) { +fn first[T:! type, U:! type, V:! type](unused arg1: T, arg2: U, unused arg3: V) { var local_name: C1*; second(arg2, arg2, local_name); @@ -37,7 +37,7 @@ fn third[T:! type, U:! type, V:! type](arg1: T, arg2: U, arg3: V) { fourth(arg3, arg3, arg2); } -fn fourth[T:! type, U:! type, V:! type](arg1: T, arg2: U, arg3: V) { +fn fourth[T:! type, U:! type, V:! type](unused arg1: T, unused arg2: U, unused arg3: V) { } fn Main() { diff --git a/toolchain/lower/testdata/function/generic/self_canonical.carbon b/toolchain/lower/testdata/function/generic/self_canonical.carbon index 6a281b169184..1fa83c1ecd53 100644 --- a/toolchain/lower/testdata/function/generic/self_canonical.carbon +++ b/toolchain/lower/testdata/function/generic/self_canonical.carbon @@ -32,7 +32,7 @@ fn first_function[T:! type](arg: T); fn second_function[T:! type, U:! type, V:! type](arg1: T, arg2: U, arg3: V); -fn third_function[T:! type, U:! type, V:! type](arg1: T, arg2: U, arg3: V) { +fn third_function[T:! type, U:! type, V:! type](arg1: T, arg2: U, unused arg3: V) { var local1: class_name2*; var local2: class_name2*; @@ -40,13 +40,13 @@ fn third_function[T:! type, U:! type, V:! type](arg1: T, arg2: U, arg3: V) { fourth_function(local1); } -fn unused_1[T:! type, U:! type, V:! type](arg1: T, arg2: U, arg3: V) { +fn unused_1[T:! type, U:! type, V:! type](arg1: T, unused arg2: U, arg3: V) { var local1: class_name6*; third_function(arg1, arg3, local1); } -fn fourth_function[T:! type](arg: T) { +fn fourth_function[T:! type](unused arg: T) { var local1: class_name5**; var local2: class_name6*; @@ -67,7 +67,7 @@ fn unused_2[T:! type, U:! type](arg1: T, arg2: U) { second_function(arg1, arg2, local1); } -fn second_function[T:! type, U:! type, V:! type](arg1: T, arg2: U, arg3: V) { +fn second_function[T:! type, U:! type, V:! type](arg1: T, unused arg2: U, arg3: V) { var local1: class_name3*; var local2: class_name4*; var local3: class_name2*; diff --git a/toolchain/lower/testdata/function/generic/type_representation.carbon b/toolchain/lower/testdata/function/generic/type_representation.carbon index 18ca546b849b..27efe5481ec0 100644 --- a/toolchain/lower/testdata/function/generic/type_representation.carbon +++ b/toolchain/lower/testdata/function/generic/type_representation.carbon @@ -45,7 +45,7 @@ fn F_X(a: X) -> X { } impl () as Copy { - fn Op[self: ()]() -> () { + fn Op[unused self: ()]() -> () { return (); } } diff --git a/toolchain/lower/testdata/impl/impl.carbon b/toolchain/lower/testdata/impl/impl.carbon index 7b3704adb14c..26964d7e9188 100644 --- a/toolchain/lower/testdata/impl/impl.carbon +++ b/toolchain/lower/testdata/impl/impl.carbon @@ -45,21 +45,21 @@ interface I(T:! type) { } impl C as I(A) { - fn F[self: C]() -> A { return {}; } + fn F[unused self: C]() -> A { return {}; } } impl C as I(B) { - fn F[self: C]() -> B { return {}; } + fn F[unused self: C]() -> B { return {}; } } fn F1(x: C, y: C) { - var a: A = x.(I(A).F)(); - var b: B = y.(I(B).F)(); + var unused a: A = x.(I(A).F)(); + var unused b: B = y.(I(B).F)(); } fn F2[T:! I(A), U:! I(B)](x: T, y: U) { - var a: A = x.F(); - var b: B = y.F(); + var unused a: A = x.F(); + var unused b: B = y.F(); } // --- generic_class_impls.carbon @@ -127,20 +127,20 @@ impl C(B) as I { // CHECK:STDOUT: ; ModuleID = 'generic_impls.carbon' // CHECK:STDOUT: source_filename = "generic_impls.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @A.val.loc13_35 = internal constant {} zeroinitializer -// CHECK:STDOUT: @B.val.loc17_35 = internal constant {} zeroinitializer +// CHECK:STDOUT: @A.val.loc13_42 = internal constant {} zeroinitializer +// CHECK:STDOUT: @B.val.loc17_42 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @"_CF.C.Main:I.96947bccc1c5e61b.Main"(ptr sret({}) %return, ptr %self) #0 !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @A.val.loc13_35, i64 0, i1 false), !dbg !10 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @A.val.loc13_42, i64 0, i1 false), !dbg !10 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @"_CF.C.Main:I.707dbe5ae2414d29.Main"(ptr sret({}) %return, ptr %self) #0 !dbg !11 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @B.val.loc17_35, i64 0, i1 false), !dbg !14 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @B.val.loc17_42, i64 0, i1 false), !dbg !14 // CHECK:STDOUT: ret void, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -183,11 +183,11 @@ impl C(B) as I { // CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8) // CHECK:STDOUT: !8 = !{!9} // CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) -// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 26, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 33, scope: !4) // CHECK:STDOUT: !11 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.Main:I.707dbe5ae2414d29.Main", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !12) // CHECK:STDOUT: !12 = !{!13} // CHECK:STDOUT: !13 = !DILocalVariable(arg: 1, scope: !11, type: !7) -// CHECK:STDOUT: !14 = !DILocation(line: 17, column: 26, scope: !11) +// CHECK:STDOUT: !14 = !DILocation(line: 17, column: 33, scope: !11) // CHECK:STDOUT: !15 = distinct !DISubprogram(name: "F1", linkageName: "_CF1.Main", scope: null, file: !3, line: 20, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !18) // CHECK:STDOUT: !16 = !DISubroutineType(types: !17) // CHECK:STDOUT: !17 = !{null, !7, !7} @@ -196,8 +196,8 @@ impl C(B) as I { // CHECK:STDOUT: !20 = !DILocalVariable(arg: 2, scope: !15, type: !7) // CHECK:STDOUT: !21 = !DILocation(line: 21, column: 3, scope: !15) // CHECK:STDOUT: !22 = !DILocation(line: 22, column: 3, scope: !15) -// CHECK:STDOUT: !23 = !DILocation(line: 21, column: 14, scope: !15) -// CHECK:STDOUT: !24 = !DILocation(line: 22, column: 14, scope: !15) +// CHECK:STDOUT: !23 = !DILocation(line: 21, column: 21, scope: !15) +// CHECK:STDOUT: !24 = !DILocation(line: 22, column: 21, scope: !15) // CHECK:STDOUT: !25 = !DILocation(line: 20, column: 1, scope: !15) // CHECK:STDOUT: ; ModuleID = 'generic_class_impls.carbon' // CHECK:STDOUT: source_filename = "generic_class_impls.carbon" diff --git a/toolchain/lower/testdata/impl/import_facet.carbon b/toolchain/lower/testdata/impl/import_facet.carbon index 59c1d4226088..f69f1722259b 100644 --- a/toolchain/lower/testdata/impl/import_facet.carbon +++ b/toolchain/lower/testdata/impl/import_facet.carbon @@ -17,7 +17,7 @@ library "[[@TEST_NAME]]"; class C(T:! Core.Copy & Core.Destroy) { - fn GetC[self: Self]() -> T { + fn GetC[unused self: Self]() -> T { var value: T; return value; } @@ -29,7 +29,7 @@ export import library "a"; interface I { let T:! Core.Copy & Core.Destroy; - fn GetI[self: Self]() -> C(T); + fn GetI[unused self: Self]() -> C(T); } // --- c.carbon @@ -38,7 +38,7 @@ export import library "b"; class D(T:! type) { impl as I where .T = T* { - fn GetI[self: Self]() -> C(T*) { + fn GetI[unused self: Self]() -> C(T*) { return {}; } } diff --git a/toolchain/lower/testdata/impl/thunk.carbon b/toolchain/lower/testdata/impl/thunk.carbon index d1d3e611177a..452668d2cead 100644 --- a/toolchain/lower/testdata/impl/thunk.carbon +++ b/toolchain/lower/testdata/impl/thunk.carbon @@ -44,7 +44,7 @@ library "[[@TEST_NAME]]"; class A {} class B { impl as Core.ImplicitAs(A) { - fn Convert[self: Self]() -> A { return {}; } + fn Convert[unused self: Self]() -> A { return {}; } } } @@ -55,7 +55,7 @@ interface I(T:! type) { class C(U:! type) {} impl forall [V:! type] C(V) as I(V) { - fn F[self: Self](_: A) -> B { return {}; } + fn F[unused self: Self](_: A) -> B { return {}; } } fn Call(c: C(()), b: B) -> A { @@ -183,13 +183,13 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: ; ModuleID = 'generic_thunk.carbon' // CHECK:STDOUT: source_filename = "generic_thunk.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @A.val.loc7_46 = internal constant {} zeroinitializer -// CHECK:STDOUT: @B.val.loc18_42 = internal constant {} zeroinitializer +// CHECK:STDOUT: @A.val.loc7_53 = internal constant {} zeroinitializer +// CHECK:STDOUT: @B.val.loc18_49 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr sret({}) %return, ptr %self) #0 !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @A.val.loc7_46, i64 0, i1 false), !dbg !10 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @A.val.loc7_53, i64 0, i1 false), !dbg !10 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -227,7 +227,7 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define linkonce_odr void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr sret({}) %return, ptr %self, ptr %_) #0 !dbg !26 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @B.val.loc18_42, i64 0, i1 false), !dbg !30 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @B.val.loc18_49, i64 0, i1 false), !dbg !30 // CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -241,16 +241,16 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind // CHECK:STDOUT: define linkonce_odr void @"_CF:thunk.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr sret({}) %return, ptr %self, ptr %x) #3 !dbg !37 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc18_31.2.temp = alloca {}, align 8, !dbg !41 -// CHECK:STDOUT: %.loc18_31.6.temp = alloca {}, align 8, !dbg !41 +// CHECK:STDOUT: %.loc18_38.2.temp = alloca {}, align 8, !dbg !41 +// CHECK:STDOUT: %.loc18_38.6.temp = alloca {}, align 8, !dbg !41 // CHECK:STDOUT: %.loc12_21.1.temp = alloca {}, align 8, !dbg !42 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_31.2.temp), !dbg !41 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr %.loc18_31.2.temp, ptr %x), !dbg !41 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_31.6.temp), !dbg !41 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_38.2.temp), !dbg !41 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr %.loc18_38.2.temp, ptr %x), !dbg !41 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_38.6.temp), !dbg !41 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_21.1.temp), !dbg !42 // CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr %.loc12_21.1.temp, ptr %x), !dbg !42 -// CHECK:STDOUT: call void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %.loc18_31.6.temp, ptr %self, ptr %.loc12_21.1.temp), !dbg !41 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr %return, ptr %.loc18_31.6.temp), !dbg !41 +// CHECK:STDOUT: call void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %.loc18_38.6.temp, ptr %self, ptr %.loc12_21.1.temp), !dbg !41 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.96947bccc1c5e61b.Core"(ptr %return, ptr %.loc18_38.6.temp), !dbg !41 // CHECK:STDOUT: ret void, !dbg !41 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -275,7 +275,7 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8) // CHECK:STDOUT: !8 = !{!9} // CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) -// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 37, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 44, scope: !4) // CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !3, line: 21, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) // CHECK:STDOUT: !12 = !DISubroutineType(types: !13) // CHECK:STDOUT: !13 = !{!7, !7, !7} @@ -295,7 +295,7 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: !27 = !{!28, !29} // CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !7) // CHECK:STDOUT: !29 = !DILocalVariable(arg: 2, scope: !26, type: !7) -// CHECK:STDOUT: !30 = !DILocation(line: 18, column: 33, scope: !26) +// CHECK:STDOUT: !30 = !DILocation(line: 18, column: 40, scope: !26) // CHECK:STDOUT: !31 = distinct !DISubprogram(name: "CallGeneric", linkageName: "_CCallGeneric.Main.0bac38e8a17f7a1f", scope: null, file: !3, line: 25, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !32) // CHECK:STDOUT: !32 = !{!33, !34} // CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !31, type: !7) diff --git a/toolchain/lower/testdata/let/local.carbon b/toolchain/lower/testdata/let/local.carbon index deec574cec7b..4a65d2842c6f 100644 --- a/toolchain/lower/testdata/let/local.carbon +++ b/toolchain/lower/testdata/let/local.carbon @@ -24,7 +24,7 @@ library "[[@TEST_NAME]]"; class C {} -fn F(c: C) {} +fn F(_: C) {} fn CallF() { // TODO: Uncomment this once symbolic locals work in check. It's disabled so @@ -60,7 +60,7 @@ fn CallF() { // CHECK:STDOUT: source_filename = "symbolic.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main(ptr %c) #0 !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main(ptr %_) #0 !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } diff --git a/toolchain/parse/testdata/generics/interface/final_member_definition.carbon b/toolchain/parse/testdata/generics/interface/final_member_definition.carbon index 63ed5985e43d..147d140a261c 100644 --- a/toolchain/parse/testdata/generics/interface/final_member_definition.carbon +++ b/toolchain/parse/testdata/generics/interface/final_member_definition.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/interface/final_member_definition.carbon interface Foo { - final fn Add[self: Self](b: Self) -> Self { + final fn Add[unused self: Self](b: Self) -> Self { print("Allowed."); } } @@ -24,10 +24,11 @@ interface Foo { // CHECK:STDOUT: {kind: 'FinalModifier', text: 'final'}, // CHECK:STDOUT: {kind: 'IdentifierNameBeforeParams', text: 'Add'}, // CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['}, -// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, -// CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, -// CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, +// CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, +// CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, +// CHECK:STDOUT: {kind: 'UnusedPattern', text: 'unused', subtree_size: 4}, +// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 6}, // CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeParams', text: 'b'}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, @@ -35,13 +36,13 @@ interface Foo { // CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 5}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 16}, +// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 17}, // CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'print'}, // CHECK:STDOUT: {kind: 'CallExprStart', text: '(', subtree_size: 2}, // CHECK:STDOUT: {kind: 'StringLiteral', text: '"Allowed."'}, // CHECK:STDOUT: {kind: 'CallExpr', text: ')', subtree_size: 4}, // CHECK:STDOUT: {kind: 'ExprStatement', text: ';', subtree_size: 5}, -// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 22}, -// CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 26}, +// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 23}, +// CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 27}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/named_constraint/invalid_method.carbon b/toolchain/parse/testdata/generics/named_constraint/invalid_method.carbon index 8dd102fe1000..126cac73228f 100644 --- a/toolchain/parse/testdata/generics/named_constraint/invalid_method.carbon +++ b/toolchain/parse/testdata/generics/named_constraint/invalid_method.carbon @@ -15,7 +15,7 @@ constraint E { constraint Foo { // This is an error in the check phase. - fn DefinedMethod[self: Self](b: Self) -> Self {} + fn DefinedMethod[unused self: Self](b: Self) -> Self {} } // CHECK:STDOUT: - filename: invalid_method.carbon @@ -46,10 +46,11 @@ constraint Foo { // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'IdentifierNameBeforeParams', text: 'DefinedMethod'}, // CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['}, -// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, -// CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, -// CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, +// CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, +// CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, +// CHECK:STDOUT: {kind: 'UnusedPattern', text: 'unused', subtree_size: 4}, +// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 6}, // CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeParams', text: 'b'}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, @@ -57,8 +58,8 @@ constraint Foo { // CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 5}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 15}, -// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 16}, -// CHECK:STDOUT: {kind: 'NamedConstraintDefinition', text: '}', subtree_size: 20}, +// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 16}, +// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 17}, +// CHECK:STDOUT: {kind: 'NamedConstraintDefinition', text: '}', subtree_size: 21}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/sem_ir/entity_name.h b/toolchain/sem_ir/entity_name.h index 1c62133e7e04..6dfdb7474d1e 100644 --- a/toolchain/sem_ir/entity_name.h +++ b/toolchain/sem_ir/entity_name.h @@ -17,14 +17,14 @@ struct EntityName : public Printable { auto Print(llvm::raw_ostream& out) const -> void { out << "{name: " << name_id << ", parent_scope: " << parent_scope_id << ", index: " << bind_index_value << ", is_template: " << is_template - << "}"; + << ", is_unused: " << is_unused << "}"; } friend auto CarbonHashtableEq(const EntityName& lhs, const EntityName& rhs) -> bool { // This requires that there are no padding bits in the type. This is upheld // since it holds values all of the same size: each is 32 bits, with one - // split into 31 and 1 bits. + // split into 30, 1, and 1 bits. return std::memcmp(&lhs, &rhs, sizeof(EntityName)) == 0; } @@ -53,9 +53,11 @@ struct EntityName : public Printable { // them for other kinds of `EntityName`. // The bind_index() value, unwrapped so it can be stored in a bit-field. - int32_t bind_index_value : 31 = CompileTimeBindIndex::None.index; + int32_t bind_index_value : 30 = CompileTimeBindIndex::None.index; // Whether this binding is a template parameter. bool is_template : 1 = false; + // Whether this binding is marked unused. + bool is_unused : 1 = false; }; // Value store for EntityName. In addition to the regular ValueStore @@ -67,12 +69,17 @@ struct EntityNameStore // Adds an entity name for a symbolic binding. auto AddSymbolicBindingName(NameId name_id, NameScopeId parent_scope_id, - CompileTimeBindIndex bind_index, bool is_template) - -> EntityNameId { - return Add({.name_id = name_id, - .parent_scope_id = parent_scope_id, - .bind_index_value = bind_index.index, - .is_template = is_template}); + CompileTimeBindIndex bind_index, bool is_template, + bool is_unused) -> EntityNameId { + EntityName name = {.name_id = name_id, + .parent_scope_id = parent_scope_id, + .bind_index_value = bind_index.index, + .is_template = is_template, + .is_unused = is_unused}; + CARBON_CHECK(name.bind_index_value == bind_index.index, + "Bind index out of range for bit-field: {0}", + bind_index.index); + return Add(name); } // Convert an `EntityName` to a canonical ID. All calls to this with