diff --git a/.agents/skills/diagnostics/SKILL.md b/.agents/skills/diagnostics/SKILL.md index 68596bb57e83..363e816f72bd 100644 --- a/.agents/skills/diagnostics/SKILL.md +++ b/.agents/skills/diagnostics/SKILL.md @@ -156,12 +156,12 @@ Custom structures can define how they serialize inside diagnostics using the ### Fluent Builder Pattern -A diagnostic is one message plus the labels that mark the source explaining it. -Use `Build` to state the message and `Attach` to mark each place the reader has -to look, chained fluently: +A diagnostic is one message plus the labels attached to the source that explains +it. Use `Build` to state the message and `Attach` to attach a label to each +place the reader has to look, chained fluently: ```cpp -CARBON_DIAGNOSTIC_LABEL(ModifierPrevious, Info, "`{0}` previously appeared here", +CARBON_DIAGNOSTIC_LABEL(ModifierPrevious, "`{0}` previously appeared here", Lex::TokenKind); context.emitter() @@ -172,16 +172,12 @@ context.emitter() Labels are declared with `CARBON_DIAGNOSTIC_LABEL` where they are attached, and are not registered in `kind.def`; `check_diagnostics.py` checks that each one is -attached and covered. A label is either `Primary` -- the range the message -itself is about -- or `Info`, for somewhere else the reader must look; those two -are the only categories, because anything not read against the code it names is -not a label. `Attach(loc)` with no label marks a range wordlessly, which is what -to use when a label would only restate the message. - -Every diagnostic should attach at least one label; a message with nothing -attached has nothing to show. See +attached and covered. A label explains the problem. Code that is part of the +problem is covered by the message's ranges: its own location, and any further +range added with `ExtraRange(loc)`, which has no text. Text not read together +with the code it is attached to is not a label. See [diagnostics.md](../../../toolchain/docs/diagnostics.md) for which range to pick -and when a label earns words. +and when a label needs text. > [!SAFETY] Emitter builders are marked `[[nodiscard]]`. To prevent a developer > from creating a builder but failing to terminal-chain `.Emit()`, the builder @@ -189,34 +185,36 @@ and when a label earns words. > `static_assert(false)`. You must save the builder to an lvalue or execute the > chain exactly as `emitter.Build(...).Attach(...).Emit()`. -### RAII Context & Annotation Scopes +### Diagnosers & Context Scopes -Manage large checking structures requiring blanket context using RAII block -scopes: +- `Diagnoser`: When a caller can state the problem better than the code that + detects it, it passes a callback that builds the diagnostic with the + caller's own `CARBON_DIAGNOSTIC`. The callee calls it, attaches its own + labels, and emits the result: -- `ContextScope`: Attaches a context to every diagnostic emitted within its - scope, describing the higher-level operation that failed because of it. A - context is declared with `CARBON_DIAGNOSTIC_CONTEXT`, or - `CARBON_DIAGNOSTIC_SOFT_CONTEXT` for one dropped when the diagnostic - already has a context: + ```cpp + RequireCompleteType(context, base_type_id, node_id, [&] { + CARBON_DIAGNOSTIC(IncompleteTypeInBaseDecl, Error, + "base {0} is an incomplete type", InstIdAsType); + return context.emitter().Build(node_id, IncompleteTypeInBaseDecl, + base_type_inst_id); + }); + ``` + +- `ContextScope`: RAII block scope that attaches a label to every diagnostic + emitted within it, saying what was being done when it was emitted. It only + attaches a label; the emitting code still builds the message: ```cpp Diagnostics::ContextScope diagnostic_context( &context.emitter(), [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT( - QualifiedDeclInIncompleteClassScope, - "cannot declare a member of incomplete class {0}", SemIR::TypeId); - builder.Attach(loc_id, QualifiedDeclInIncompleteClassScope, - context.classes().Get(class_id).self_type_id); + CARBON_DIAGNOSTIC_LABEL(ResolvingSpecificHere, + "in monomorphization of {0} here", + SemIR::SpecificId); + builder.Attach(loc_id, ResolvingSpecificHere, specific_id); }); ``` - A context is not a label: its text stands alone as a sentence, which is why - it leads the diagnostic rather than following it. - -- `AnnotationScope`: RAII block scope that attaches labels to every diagnostic - emitted within it, using the same `Builder` as a direct emission. - --- ## 4. Diagnostics Wording Style Guide diff --git a/toolchain/check/call.cpp b/toolchain/check/call.cpp index fa5ed1c22a1d..adaed62c807b 100644 --- a/toolchain/check/call.cpp +++ b/toolchain/check/call.cpp @@ -84,17 +84,24 @@ static auto ResolveCalleeInCall(Context& context, SemIR::LocId loc_id, Diagnostics::IntAsSelect, Diagnostics::IntAsSelect, Diagnostics::IntAsSelect); CARBON_DIAGNOSTIC_LABEL( - InCallToEntity, Info, + InCallToEntity, "calling {0:=0:function|=1:generic class|=2:generic " "interface|=3:generic constraint}" " declared here", Diagnostics::IntAsSelect); - context.emitter() - .Build(loc_id, CallArgCountMismatch, arg_ids.size(), - static_cast(entity_kind_for_diagnostic), expected_args_size) - .Attach(entity.latest_decl_id(), InCallToEntity, - static_cast(entity_kind_for_diagnostic)) - .Emit(); + auto diag = context.emitter().Build( + loc_id, CallArgCountMismatch, arg_ids.size(), + static_cast(entity_kind_for_diagnostic), expected_args_size); + // Only attach a label when the declaration has a location distinct from + // the call's. + auto decl_loc_id = + context.insts().GetCanonicalLocId(entity.latest_decl_id()); + if (decl_loc_id.has_value() && + decl_loc_id != context.insts().GetCanonicalLocId(loc_id)) { + diag.Attach(LocIdForDiagnostics::DeclaredName(entity.latest_decl_id()), + InCallToEntity, static_cast(entity_kind_for_diagnostic)); + } + diag.Emit(); return std::nullopt; } @@ -262,7 +269,7 @@ auto PerformCallToFunction(Context& context, SemIR::LocId loc_id, "call to `{0}` before its return type is known", SemIR::NameId); CARBON_DIAGNOSTIC_LABEL( - ReturnTypeDeducedFromDefinition, Info, + ReturnTypeDeducedFromDefinition, "return type of `{0}` is deduced from its definition", SemIR::NameId); context.emitter() .Build(loc_id, CallBeforeReturnTypeDeduced, callee.name_id) @@ -280,9 +287,9 @@ auto PerformCallToFunction(Context& context, SemIR::LocId loc_id, auto return_arg_id = SemIR::InstId::None; if (callee.return_pattern_id.has_value()) { - Diagnostics::AnnotationScope annotate_diagnostics( + Diagnostics::ContextScope diagnostic_context( &context.emitter(), [&](auto& builder) { - CARBON_DIAGNOSTIC_LABEL(IncompleteReturnTypeHere, Info, + CARBON_DIAGNOSTIC_LABEL(IncompleteReturnTypeHere, "return type declared here"); builder.Attach(callee.return_pattern_id, IncompleteReturnTypeHere); }); diff --git a/toolchain/check/check.cpp b/toolchain/check/check.cpp index 9883324ce9ef..8138415b8240 100644 --- a/toolchain/check/check.cpp +++ b/toolchain/check/check.cpp @@ -123,7 +123,7 @@ static auto TrackImport(Map& api_map, !insert_result.is_inserted()) { CARBON_DIAGNOSTIC(RepeatedImport, Error, "library imported more than once"); - CARBON_DIAGNOSTIC_LABEL(FirstImported, Info, "first import here"); + CARBON_DIAGNOSTIC_LABEL(FirstImported, "first import here"); unit_info.emitter.Build(import.node_id, RepeatedImport) .Attach(insert_result.value(), FirstImported) .Emit(); diff --git a/toolchain/check/check_unit.cpp b/toolchain/check/check_unit.cpp index b656f89f4171..65cedde97a8a 100644 --- a/toolchain/check/check_unit.cpp +++ b/toolchain/check/check_unit.cpp @@ -387,7 +387,8 @@ auto CheckUnit::ProcessNodeIds() -> bool { // On crash, report which token we were handling. PrettyStackTraceFunction node_dumper([&](llvm::raw_ostream& output) { const auto& tree = tree_and_subtrees_getter_(); - auto converted = tree.NodeToDiagnosticLoc(node_id, /*token_only=*/false); + auto converted = + tree.NodeToDiagnosticLoc(node_id, Parse::LocExtent::Subtree); output << Diagnostics::FormatLocation(converted.loc) << ": "; output << "Checking " << context_.parse_tree().node_kind(node_id) << "\n"; // Crash output has a tab indent; try to indent slightly past that. @@ -523,15 +524,22 @@ auto CheckUnit::CheckRequiredDefinitions() -> bool { case DefinitionResolution::NotDefinedYet: { CARBON_DIAGNOSTIC(MissingGenericFunctionDefinition, Error, "use of undefined generic function"); - CARBON_DIAGNOSTIC_LABEL(MissingGenericFunctionDefinitionHere, Info, + CARBON_DIAGNOSTIC_LABEL(MissingGenericFunctionDefinitionHere, "generic function declared here"); auto generic_decl_id = context_.generics() .Get(context_.specifics().Get(specific_id).generic_id) .decl_id; - emitter_.Build(loc, MissingGenericFunctionDefinition) - .Attach(generic_decl_id, MissingGenericFunctionDefinitionHere) - .Emit(); + auto diag = emitter_.Build(loc, MissingGenericFunctionDefinition); + // Only attach a label when the declaration has a location distinct from + // the use's. + auto decl_loc_id = context_.insts().GetCanonicalLocId(generic_decl_id); + if (decl_loc_id.has_value() && + decl_loc_id != context_.insts().GetCanonicalLocId(loc)) { + diag.Attach(LocIdForDiagnostics::DeclaredName(generic_decl_id), + MissingGenericFunctionDefinitionHere); + } + diag.Emit(); break; } } @@ -590,10 +598,10 @@ auto CheckUnit::CheckPoisonedConcreteImplLookupQueries() -> void { "use of `{0} as {1}`", InstIdAsRawType, SpecificInterfaceIdAsRawType); CARBON_DIAGNOSTIC_LABEL( - PoisonedImplLookupConcreteResultNoteBadImpl, Info, + PoisonedImplLookupConcreteResultNoteBadImpl, "the use would select the `impl` here but it was not found yet"); CARBON_DIAGNOSTIC_LABEL( - PoisonedImplLookupConcreteResultNotePreviousImpl, Info, + PoisonedImplLookupConcreteResultNotePreviousImpl, "the use had selected the `impl` here"); emitter_ .Build(poison.loc_id, PoisonedImplLookupConcreteResult, @@ -610,7 +618,7 @@ auto CheckUnit::CheckPoisonedConcreteImplLookupQueries() -> void { "found `impl` for {0} as {1}, which has a custom witness", InstIdAsRawType, SpecificInterfaceIdAsRawType); CARBON_DIAGNOSTIC_LABEL( - PoisonedImplLookupCustomResultNoteBadImpl, Info, + PoisonedImplLookupCustomResultNoteBadImpl, "the use tried to select the `impl` here, but a custom " "witness was already chosen"); diff --git a/toolchain/check/check_unit.h b/toolchain/check/check_unit.h index df14e5907d83..2351ac9bdfe6 100644 --- a/toolchain/check/check_unit.h +++ b/toolchain/check/check_unit.h @@ -69,7 +69,7 @@ struct UnitAndImports { auto ConvertLoc(Parse::NodeId node_id, ContextFnT /*context_fn*/) const -> Diagnostics::ConvertedLoc override { return tree_and_subtrees_getter_().NodeToDiagnosticLoc( - node_id, /*token_only=*/false); + node_id, Parse::LocExtent::Subtree); } private: diff --git a/toolchain/check/class.cpp b/toolchain/check/class.cpp index 16a076766c7c..36a79bd582b7 100644 --- a/toolchain/check/class.cpp +++ b/toolchain/check/class.cpp @@ -61,8 +61,7 @@ static auto CheckCompleteAdapterClassType( const auto& class_info = context.classes().Get(class_id); if (class_info.base_id.has_value()) { CARBON_DIAGNOSTIC(AdaptWithBase, Error, "adapter with base class"); - CARBON_DIAGNOSTIC_LABEL(AdaptWithBaseHere, Info, - "`base` declaration is here"); + CARBON_DIAGNOSTIC_LABEL(AdaptWithBaseHere, "`base` declaration is here"); context.emitter() .Build(class_info.adapt_id, AdaptWithBase) .Attach(class_info.base_id, AdaptWithBaseHere) @@ -72,7 +71,7 @@ static auto CheckCompleteAdapterClassType( if (!field_decls.empty()) { CARBON_DIAGNOSTIC(AdaptWithFields, Error, "adapter with fields"); - CARBON_DIAGNOSTIC_LABEL(AdaptWithFieldHere, Info, + CARBON_DIAGNOSTIC_LABEL(AdaptWithFieldHere, "first field declaration is here"); context.emitter() .Build(class_info.adapt_id, AdaptWithFields) @@ -89,7 +88,7 @@ static auto CheckCompleteAdapterClassType( SemIR::Function::VirtualModifier::Virtual) { CARBON_DIAGNOSTIC(AdaptWithVirtual, Error, "adapter with virtual function"); - CARBON_DIAGNOSTIC_LABEL(AdaptWithVirtualHere, Info, + CARBON_DIAGNOSTIC_LABEL(AdaptWithVirtualHere, "first virtual function declaration is here"); context.emitter() .Build(class_info.adapt_id, AdaptWithVirtual) @@ -319,7 +318,7 @@ static auto BuildVtable(Context& context, Parse::ClassDefinitionId node_id, CARBON_DIAGNOSTIC(OverrideWithoutVirtualInBase, Error, "override without compatible virtual in base class"); CARBON_DIAGNOSTIC_LABEL( - OverrideCandidateArityMismatch, Info, + OverrideCandidateArityMismatch, "base class function has {2:more|fewer} parameters " "({0} vs {1} excluding `self`)", Diagnostics::IntAsSelect, Diagnostics::IntAsSelect, diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index f925600a5730..fa43e8a67911 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -1496,10 +1496,9 @@ static auto PerformBuiltinConversion(Context& context, SemIR::LocId loc_id, // While the types are the same, the conversion can still fail if it // performs a copy while converting the value to another category, and // the type (or some part of it) is not copyable. - Diagnostics::AnnotationScope annotate_diagnostics( + Diagnostics::ContextScope diagnostic_context( &context.emitter(), [&](auto& builder) { - CARBON_DIAGNOSTIC_LABEL(InCopy, Info, "in copy of {0}", - TypeOfInstId); + CARBON_DIAGNOSTIC_LABEL(InCopy, "in copy of {0}", TypeOfInstId); builder.Attach(value_id, InCopy, value_id); }); @@ -1867,14 +1866,14 @@ static auto PerformBuiltinConversion(Context& context, SemIR::LocId loc_id, static auto PerformCopy(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id, const ConversionTarget& target) -> SemIR::InstId { + auto expr_loc_id = GetInstLocationOrFallback(context, expr_id, loc_id); auto copy_id = BuildUnaryOperator( - context, GetInstLocationOrFallback(context, expr_id, loc_id), - {.interface_name = CoreIdentifier::Copy}, expr_id, target.diagnose, - [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT(CopyOfUncopyableType, - "cannot copy value of type {0}", - TypeOfInstId); - builder.Attach(expr_id, CopyOfUncopyableType, expr_id); + context, expr_loc_id, {.interface_name = CoreIdentifier::Copy}, expr_id, + target.diagnose, [&] { + CARBON_DIAGNOSTIC(CopyOfUncopyableType, Error, + "cannot copy value of type {0}", TypeOfInstId); + return context.emitter().Build(expr_loc_id, CopyOfUncopyableType, + expr_id); }); return copy_id; } @@ -1928,32 +1927,33 @@ static auto PerformUserDefinedConversion(Context& context, SemIR::LocId loc_id, .interface_args_ref = interface_args, .op_name = CoreIdentifier::Convert, }; - expr_id = BuildUnaryOperator( - context, loc_id, op, expr_id, target.diagnose, [&](auto& builder) { + expr_id = + BuildUnaryOperator(context, loc_id, op, expr_id, target.diagnose, [&] { int target_kind_for_diag = target.kind == ConversionTarget::ExplicitAs ? 1 : target.kind == ConversionTarget::ExplicitUnsafeAs ? 2 : 0; if (context.types().Is(target.type_id)) { - CARBON_DIAGNOSTIC_CONTEXT( - ConversionFailureNonTypeToFacet, + CARBON_DIAGNOSTIC( + ConversionFailureNonTypeToFacet, Error, "cannot{0:=0: implicitly|:} convert non-type value of type {1} " "{2:to|into type implementing} {3}" "{0:=1: with `as`|=2: with `unsafe as`|:}", Diagnostics::IntAsSelect, TypeOfInstId, Diagnostics::BoolAsSelect, SemIR::TypeId); - builder.Attach(loc_id, ConversionFailureNonTypeToFacet, - target_kind_for_diag, expr_id, - target.type_id == SemIR::TypeType::TypeId, - target.type_id); + return context.emitter().Build( + loc_id, ConversionFailureNonTypeToFacet, target_kind_for_diag, + expr_id, target.type_id == SemIR::TypeType::TypeId, + target.type_id); } else { - CARBON_DIAGNOSTIC_CONTEXT( - ConversionFailure, + CARBON_DIAGNOSTIC( + ConversionFailure, Error, "cannot{0:=0: implicitly|:} convert expression of type " "{1} to {2}{0:=1: with `as`|=2: with `unsafe as`|:}", Diagnostics::IntAsSelect, TypeOfInstId, SemIR::TypeId); - builder.Attach(loc_id, ConversionFailure, target_kind_for_diag, - expr_id, target.type_id); + return context.emitter().Build(loc_id, ConversionFailure, + target_kind_for_diag, expr_id, + target.type_id); } }); @@ -2537,24 +2537,23 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id, // need the type to be complete. if (ConversionNeedsCompleteTarget(context, expr_id, target)) { if (target.diagnose) { - if (!RequireCompleteType( - context, target.type_id, loc_id, [&](auto& builder) { - CARBON_CHECK( - !target.is_initializer(), - "Initialization of incomplete types is expected to be " - "caught elsewhere."); - CARBON_DIAGNOSTIC_CONTEXT( - IncompleteTypeInValueConversion, - "forming value of incomplete type {0}", SemIR::TypeId); - CARBON_DIAGNOSTIC_CONTEXT(IncompleteTypeInConversion, - "invalid use of incomplete type {0}", - SemIR::TypeId); - builder.Attach(loc_id, - target.kind == ConversionTarget::Value - ? IncompleteTypeInValueConversion - : IncompleteTypeInConversion, - target.type_id); - })) { + if (!RequireCompleteType(context, target.type_id, loc_id, [&] { + CARBON_CHECK(!target.is_initializer(), + "Initialization of incomplete types is expected to be " + "caught elsewhere."); + CARBON_DIAGNOSTIC(IncompleteTypeInValueConversion, Error, + "forming value of incomplete type {0}", + SemIR::TypeId); + CARBON_DIAGNOSTIC(IncompleteTypeInConversion, Error, + "invalid use of incomplete type {0}", + SemIR::TypeId); + return context.emitter().Build( + loc_id, + target.kind == ConversionTarget::Value + ? IncompleteTypeInValueConversion + : IncompleteTypeInConversion, + target.type_id); + })) { return SemIR::ErrorInst::InstId; } } else { diff --git a/toolchain/check/cpp/diagnostic_consumer.cpp b/toolchain/check/cpp/diagnostic_consumer.cpp index 9e8218bbfb42..7b3b8e418c35 100644 --- a/toolchain/check/cpp/diagnostic_consumer.cpp +++ b/toolchain/check/cpp/diagnostic_consumer.cpp @@ -63,18 +63,18 @@ template static auto AttachFixIt(BuilderT& builder, LocT loc, const CppDiagnosticListener::FixIt& fix_it) -> void { if (fix_it.text.empty()) { - CARBON_DIAGNOSTIC_LABEL(CppInteropFixItRemoval, Info, "remove this"); + CARBON_DIAGNOSTIC_LABEL(CppInteropFixItRemoval, "remove this"); builder.Attach(loc, CppInteropFixItRemoval); return; } if (fix_it.range.getBegin() == fix_it.range.getEnd()) { - CARBON_DIAGNOSTIC_LABEL(CppInteropFixItInsertion, Info, "insert `{0}` here", + CARBON_DIAGNOSTIC_LABEL(CppInteropFixItInsertion, "insert `{0}` here", std::string); builder.Attach(loc, CppInteropFixItInsertion, fix_it.text); return; } - CARBON_DIAGNOSTIC_LABEL(CppInteropFixItReplacement, Info, - "replace with `{0}`", std::string); + CARBON_DIAGNOSTIC_LABEL(CppInteropFixItReplacement, "replace with `{0}`", + std::string); builder.Attach(loc, CppInteropFixItReplacement, fix_it.text); } @@ -214,42 +214,46 @@ static auto FindEmptyParameterList(const clang::SourceManager& source_manager, // Returns the label to attach for a Clang note, which says more about the // diagnostic it follows rather than reporting a problem of its own. static auto GetNoteLabel() -> const Diagnostics::LabelBase& { - CARBON_DIAGNOSTIC_LABEL(CppInteropParseNote, Info, "{0}", std::string); + CARBON_DIAGNOSTIC_LABEL(CppInteropParseNote, "{0}", std::string); return CppInteropParseNote; } // Returns the label to attach for what a note says about the source it marks, // as opposed to the declaration the note names. static auto GetNoteReasonLabel() -> const Diagnostics::LabelBase& { - CARBON_DIAGNOSTIC_LABEL(CppInteropParseNoteReason, Info, "{0}", std::string); + CARBON_DIAGNOSTIC_LABEL(CppInteropParseNoteReason, "{0}", std::string); return CppInteropParseNoteReason; } -// Attaches what `info` marks: the ranges Clang would underline, which say -// nothing the message doesn't and so only mark, and the changes it suggests, -// which explain rather than state and so carry words. -// -// A range belonging to the leading diagnostic is part of the problem; one -// belonging to a note explains it, the same as the note itself does. -// -// `to_loc` maps a Clang range onto whatever locations the builder takes. +// Attaches a label with text for each of `info`'s fix-its. `to_loc` maps a +// Clang range onto whatever locations the builder takes. template -static auto AttachMarks(BuilderT& builder, - const CppDiagnosticListener::Diagnostic& info, - bool is_note, ToLocT to_loc) -> void { - for (clang::CharSourceRange range : info.ranges) { - builder.Attach(to_loc(range), is_note - ? Diagnostics::LabelCategory::Info - : Diagnostics::LabelCategory::Primary); - } +static auto AttachFixIts(BuilderT& builder, + const CppDiagnosticListener::Diagnostic& info, + ToLocT to_loc) -> void { for (const CppDiagnosticListener::FixIt& fix_it : info.fix_its) { AttachFixIt(builder, to_loc(fix_it.range), fix_it); } } -// Attaches `note_info`, a note trailing the diagnostic being built: its words +// Adds the ranges Clang would underline for the leading diagnostic `info` to +// the message, since they are part of the problem, and attaches `info`'s +// fix-its. +template +static auto AttachRangesAndFixIts(BuilderT& builder, + const CppDiagnosticListener::Diagnostic& info, + ToLocT to_loc) -> void { + for (clang::CharSourceRange range : info.ranges) { + builder.ExtraRange(to_loc(range)); + } + AttachFixIts(builder, info, to_loc); +} + +// Attaches `note_info`, a note trailing the diagnostic being built: its text // on the declaration it names, its reason half -- when it split into one -- -// on the source that half is about, and then whatever it marks. +// on the source that half is about, its ranges, and its fix-its. +// +// A note's ranges are attached as labels with no text. template static auto AttachNote(BuilderT& builder, const CppDiagnosticListener::Diagnostic& note_info, @@ -259,7 +263,11 @@ static auto AttachNote(BuilderT& builder, builder.Attach(to_loc(note_info.reason_range), GetNoteReasonLabel(), note_info.reason); } - AttachMarks(builder, note_info, /*is_note=*/true, to_loc); + CARBON_DIAGNOSTIC_LABEL(CppInteropNoteRange, ""); + for (clang::CharSourceRange range : note_info.ranges) { + builder.Attach(to_loc(range), CppInteropNoteRange); + } + AttachFixIts(builder, note_info, to_loc); } // A listener that emits Clang diagnostics directly to a provided Carbon @@ -283,7 +291,7 @@ class FallbackDiagnosticListener : public CppDiagnosticListener { const Diagnostic& info = diags[i]; auto builder = emitter.Build(info.location, GetDiagnostic(info.level), info.message); - AttachMarks(builder, info, /*is_note=*/false, as_range); + AttachRangesAndFixIts(builder, info, as_range); for (; i + 1 < diags.size() && diags[i + 1].level == clang::DiagnosticsEngine::Note; ++i) { @@ -323,15 +331,15 @@ class ContextDiagnosticListener : public CppDiagnosticListener { auto as_loc_id = [&](clang::CharSourceRange range) { return SemIR::LocId(AddImportIRInst(context_->sem_ir(), range)); }; - AttachMarks(builder, info, /*is_note=*/false, as_loc_id); + AttachRangesAndFixIts(builder, info, as_loc_id); for (; i + 1 < diags.size() && diags[i + 1].level == clang::DiagnosticsEngine::Note; ++i) { AttachNote(builder, diags[i + 1], as_loc_id); } - // TODO: This will apply all current Carbon annotation functions. We - // should instead track how Clang's context notes and Carbon's annotation - // functions are interleaved, and interleave the notes in the same order. + // TODO: This attaches the labels of every active Carbon context scope. + // We should instead track how Clang's context notes and Carbon's context + // scopes are interleaved, and interleave the labels in the same order. builder.Emit(); } } diff --git a/toolchain/check/cpp/export.cpp b/toolchain/check/cpp/export.cpp index a95ae4a78aa8..24ae59900531 100644 --- a/toolchain/check/cpp/export.cpp +++ b/toolchain/check/cpp/export.cpp @@ -2047,7 +2047,7 @@ auto ExportFunctionToCppPointerConversion( ExportedFunctionPtrTypeMismatch, Error, "can't convert exported {0:member |}function pointer to `{1}`", Diagnostics::BoolAsSelect, CppType); - CARBON_DIAGNOSTIC_LABEL(ExportedFromFunction, Info, + CARBON_DIAGNOSTIC_LABEL(ExportedFromFunction, "function exported with pointer type `{0}`", CppType); context.emitter() diff --git a/toolchain/check/cpp/generate_ast.cpp b/toolchain/check/cpp/generate_ast.cpp index 1a9f46962bdd..ae031b00cbc8 100644 --- a/toolchain/check/cpp/generate_ast.cpp +++ b/toolchain/check/cpp/generate_ast.cpp @@ -466,9 +466,12 @@ auto CarbonExternalASTSource::CompleteType(clang::TagDecl* tag_decl) -> void { } auto& [class_type_id, class_type] = *carbon_class_info; - auto context_fn = [](DiagnosticContextBuilder& /*builder*/) -> void {}; - if (!RequireCompleteType(*context_, class_type_id, GetCurrentCppLocId(), - context_fn)) { + if (!RequireCompleteType(*context_, class_type_id, GetCurrentCppLocId(), [&] { + CARBON_DIAGNOSTIC(IncompleteTypeInCppUse, Error, + "use of incomplete Carbon type {0}", SemIR::TypeId); + return context_->emitter().Build(GetCurrentCppLocId(), + IncompleteTypeInCppUse, class_type_id); + })) { return; } @@ -1081,12 +1084,12 @@ auto GenerateAst(Context& context, CARBON_CHECK(!context.cpp_context()); CARBON_CHECK(!context.sem_ir().cpp_file()); - // Register an annotation scope to flush any Clang diagnostics when we - // return. This ensures C++ diagnostics get flushed before `diags` is - // destroyed, and that diagnostics created here don't interleave with later - // Carbon diagnostics. - Diagnostics::AnnotationScope annotate_diagnostics(&context.emitter(), - [](auto& /*builder*/) {}); + // Register a context scope to flush any Clang diagnostics when we return. + // This ensures C++ diagnostics get flushed before `diags` is destroyed, and + // that diagnostics created here don't interleave with later Carbon + // diagnostics. + Diagnostics::ContextScope diagnostic_context(&context.emitter(), + [](auto& /*builder*/) {}); auto clang_instance = domain.clang_instance_ptr(); diff --git a/toolchain/check/cpp/impl_lookup.cpp b/toolchain/check/cpp/impl_lookup.cpp index fc8922ec081b..ec0381608740 100644 --- a/toolchain/check/cpp/impl_lookup.cpp +++ b/toolchain/check/cpp/impl_lookup.cpp @@ -146,13 +146,12 @@ static auto BuildCopyWitness(Context& context, SemIR::LocId loc_id, if (auto* class_decl = dyn_cast(tag_decl)) { auto class_type_id = SemIR::TypeId::ForTypeConstant(query_self_const_id); if (!Check::RequireCompleteType( - context, class_type_id, SemIR::LocId::None, [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT( - IncompleteTypeInCopyWitness, - "argument to C++ call has incomplete type {0}", - SemIR::TypeId); - builder.Attach(loc_id, IncompleteTypeInCopyWitness, - class_type_id); + context, class_type_id, SemIR::LocId::None, [&] { + CARBON_DIAGNOSTIC(IncompleteTypeInCopyWitness, Error, + "argument to C++ call has incomplete type {0}", + SemIR::TypeId); + return context.emitter().Build( + loc_id, IncompleteTypeInCopyWitness, class_type_id); })) { return SemIR::ErrorInst::InstId; } diff --git a/toolchain/check/cpp/import.cpp b/toolchain/check/cpp/import.cpp index 7bf64962a333..eaf24f974251 100644 --- a/toolchain/check/cpp/import.cpp +++ b/toolchain/check/cpp/import.cpp @@ -2097,9 +2097,9 @@ static auto ImportFunctionDecl(Context& context, SemIR::LocId loc_id, context.insts().GetAs(*function_decl_id).function_id; SemIR::Function& imported_function = context.functions().Get(function_id); if (IsCppThunkRequired(context, callee_info)) { - Diagnostics::AnnotationScope annotate_diagnostics( + Diagnostics::ContextScope diagnostic_context( &context.emitter(), [&](auto& builder) { - CARBON_DIAGNOSTIC_LABEL(InCppThunk, Info, + CARBON_DIAGNOSTIC_LABEL(InCppThunk, "in thunk for C++ function used here"); builder.Attach(loc_id, InCppThunk); }); @@ -2164,10 +2164,10 @@ auto ImportFunctionPointerInvoke( context.TODO(loc_id, "invoking a C++ member function pointer is unsupported"); } - Diagnostics::AnnotationScope annotate_diagnostics( + Diagnostics::ContextScope diagnostic_context( &context.emitter(), [&](auto& builder) { CARBON_DIAGNOSTIC_LABEL( - InCppFunctionPointerThunk, Info, + InCppFunctionPointerThunk, "in thunk for C++ function pointer type used here"); builder.Attach(loc_id, InCppFunctionPointerThunk); }); @@ -2771,11 +2771,10 @@ auto GetClangIdentifierInfo(Context& context, SemIR::NameId name_id) auto ImportNameFromCpp(Context& context, SemIR::LocId loc_id, SemIR::NameScopeId scope_id, SemIR::NameId name_id) -> SemIR::ScopeLookupResult { - Diagnostics::AnnotationScope annotate_diagnostics( + Diagnostics::ContextScope diagnostic_context( &context.emitter(), [&](auto& builder) { - CARBON_DIAGNOSTIC_LABEL(InCppNameLookup, Info, - "in `Cpp` name lookup for `{0}`", - SemIR::NameId); + CARBON_DIAGNOSTIC_LABEL( + InCppNameLookup, "in `Cpp` name lookup for `{0}`", SemIR::NameId); builder.Attach(loc_id, InCppNameLookup, name_id); }); if (IsIncompleteClass(context, scope_id)) { diff --git a/toolchain/check/cpp/operators.cpp b/toolchain/check/cpp/operators.cpp index daa8c5a54cd5..13ff746ba95d 100644 --- a/toolchain/check/cpp/operators.cpp +++ b/toolchain/check/cpp/operators.cpp @@ -654,13 +654,13 @@ struct DiagnoseIncompleteOperandTypeInCppOperatorLookup { SemIR::TypeId arg_type_id; SemIR::LocId loc_id; - void operator()(auto& builder) const { - CARBON_DIAGNOSTIC_CONTEXT( - IncompleteOperandTypeInCppOperatorLookup, + auto operator()() const -> DiagnosticBuilder { + CARBON_DIAGNOSTIC( + IncompleteOperandTypeInCppOperatorLookup, Error, "looking up a C++ operator with incomplete operand type {0}", SemIR::TypeId); - builder.Attach(loc_id, IncompleteOperandTypeInCppOperatorLookup, - arg_type_id); + return context.emitter().Build( + loc_id, IncompleteOperandTypeInCppOperatorLookup, arg_type_id); } }; } // namespace @@ -673,11 +673,11 @@ static auto FindClangOperator(Context& context, SemIR::LocId loc_id, auto LookupCppOperator(Context& context, SemIR::LocId loc_id, Operator op, llvm::ArrayRef arg_type_ids) -> SemIR::InstId { - // Register an annotation scope to flush any Clang diagnostics when we return. + // Register a context scope to flush any Clang diagnostics when we return. // This is important to ensure that Clang diagnostics are properly interleaved // with Carbon diagnostics. - Diagnostics::AnnotationScope annotate_diagnostics(&context.emitter(), - [](auto& /*builder*/) {}); + Diagnostics::ContextScope diagnostic_context(&context.emitter(), + [](auto& /*builder*/) {}); if (op.interface_name == CoreIdentifier::ImplicitAs || op.interface_name == CoreIdentifier::As) { @@ -733,11 +733,11 @@ auto LookupCppOperator(Context& context, SemIR::LocId loc_id, Operator op, auto LookupCppOperator(Context& context, SemIR::LocId loc_id, Operator op, llvm::ArrayRef arg_ids) -> SemIR::InstId { - // Register an annotation scope to flush any Clang diagnostics when we return. + // Register a context scope to flush any Clang diagnostics when we return. // This is important to ensure that Clang diagnostics are properly interleaved // with Carbon diagnostics. - Diagnostics::AnnotationScope annotate_diagnostics(&context.emitter(), - [](auto& /*builder*/) {}); + Diagnostics::ContextScope diagnostic_context(&context.emitter(), + [](auto& /*builder*/) {}); // We can only handle concrete types in LookupCppOperator. for (auto arg_id : arg_ids) { diff --git a/toolchain/check/cpp/overload_resolution.cpp b/toolchain/check/cpp/overload_resolution.cpp index ecdc11cc6ff6..5a4509fc5db8 100644 --- a/toolchain/check/cpp/overload_resolution.cpp +++ b/toolchain/check/cpp/overload_resolution.cpp @@ -267,11 +267,11 @@ auto PerformCppOverloadResolution( const SemIR::CppOverloadSet& overload_set, llvm::ArrayRef template_arg_ids, SemIR::InstId self_id, llvm::ArrayRef arg_ids) -> SemIR::InstId { - // Register an annotation scope to flush any Clang diagnostics when we return. + // Register a context scope to flush any Clang diagnostics when we return. // This is important to ensure that Clang diagnostics are properly interleaved // with Carbon diagnostics. - Diagnostics::AnnotationScope annotate_diagnostics(&context.emitter(), - [](auto& /*builder*/) {}); + Diagnostics::ContextScope diagnostic_context(&context.emitter(), + [](auto& /*builder*/) {}); // Map Carbon call argument types to C++ types. clang::Expr* self_expr = nullptr; diff --git a/toolchain/check/custom_witness.cpp b/toolchain/check/custom_witness.cpp index 3384d149175c..b68de565b407 100644 --- a/toolchain/check/custom_witness.cpp +++ b/toolchain/check/custom_witness.cpp @@ -870,6 +870,20 @@ static auto LookupSubobjectDestroyWitness( query_specific_interface, format); } +// Requires `type_id`, the source or destination type of a built-in conversion, +// to be complete. +static auto RequireCompleteConversionType(Context& context, SemIR::LocId loc_id, + SemIR::TypeId type_id, bool is_source) + -> bool { + return RequireCompleteType(context, type_id, loc_id, [&] { + CARBON_DIAGNOSTIC(IncompleteTypeInBuiltinConversion, Error, + "built-in conversion {0:from|to} incomplete type {1}", + Diagnostics::BoolAsSelect, SemIR::TypeId); + return context.emitter().Build(loc_id, IncompleteTypeInBuiltinConversion, + is_source, type_id); + }); +} + static auto MakeIntFitsInWitness( Context& context, SemIR::LocId loc_id, SemIR::ConstantId query_self_const_id, @@ -895,9 +909,10 @@ static auto MakeIntFitsInWitness( auto dest_type_id = GetFacetAccessType( context, context.constant_values().GetInstId(dest_const_id)); - auto context_fn = [](DiagnosticContextBuilder& /*builder*/) -> void {}; - if (!RequireCompleteType(context, src_type_id, loc_id, context_fn) || - !RequireCompleteType(context, dest_type_id, loc_id, context_fn)) { + if (!RequireCompleteConversionType(context, loc_id, src_type_id, + /*is_source=*/true) || + !RequireCompleteConversionType(context, loc_id, dest_type_id, + /*is_source=*/false)) { return std::nullopt; } @@ -993,9 +1008,10 @@ static auto MakeFloatFitsInWitness( auto dest_type_id = GetFacetAccessType( context, context.constant_values().GetInstId(dest_const_id)); - auto context_fn = [](DiagnosticContextBuilder& /*builder*/) -> void {}; - if (!RequireCompleteType(context, src_type_id, loc_id, context_fn) || - !RequireCompleteType(context, dest_type_id, loc_id, context_fn)) { + if (!RequireCompleteConversionType(context, loc_id, src_type_id, + /*is_source=*/true) || + !RequireCompleteConversionType(context, loc_id, dest_type_id, + /*is_source=*/false)) { return std::nullopt; } diff --git a/toolchain/check/decl_name_stack.cpp b/toolchain/check/decl_name_stack.cpp index 03f30bd43979..36a4393ccc21 100644 --- a/toolchain/check/decl_name_stack.cpp +++ b/toolchain/check/decl_name_stack.cpp @@ -392,15 +392,14 @@ static auto DiagnoseQualifiedDeclInIncompleteClassScope(Context& context, SemIR::LocId loc_id, SemIR::ClassId class_id) -> void { - Diagnostics::ContextScope diagnostic_context( - &context.emitter(), [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT( - QualifiedDeclInIncompleteClassScope, - "cannot declare a member of incomplete class {0}", SemIR::TypeId); - builder.Attach(loc_id, QualifiedDeclInIncompleteClassScope, - context.classes().Get(class_id).self_type_id); - }); - DiagnoseIncompleteClass(context, class_id); + DiagnoseIncompleteClass(context, class_id, [&] { + CARBON_DIAGNOSTIC(QualifiedDeclInIncompleteClassScope, Error, + "cannot declare a member of incomplete class {0}", + SemIR::TypeId); + return context.emitter().Build( + loc_id, QualifiedDeclInIncompleteClassScope, + context.classes().Get(class_id).self_type_id); + }); } // Diagnose that a qualified declaration name specifies an undefined interface @@ -408,15 +407,13 @@ static auto DiagnoseQualifiedDeclInIncompleteClassScope(Context& context, static auto DiagnoseQualifiedDeclInUndefinedInterfaceScope( Context& context, SemIR::LocId loc_id, SemIR::InterfaceId interface_id, SemIR::InstId interface_inst_id) -> void { - Diagnostics::ContextScope diagnostic_context( - &context.emitter(), [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT( - QualifiedDeclInUndefinedInterfaceScope, - "cannot declare a member of undefined interface {0}", InstIdAsType); - builder.Attach(loc_id, QualifiedDeclInUndefinedInterfaceScope, - interface_inst_id); - }); - DiagnoseIncompleteInterface(context, interface_id); + DiagnoseIncompleteInterface(context, interface_id, [&] { + CARBON_DIAGNOSTIC(QualifiedDeclInUndefinedInterfaceScope, Error, + "cannot declare a member of undefined interface {0}", + InstIdAsType); + return context.emitter().Build( + loc_id, QualifiedDeclInUndefinedInterfaceScope, interface_inst_id); + }); } // Diagnose that a qualified declaration name specifies a different package as @@ -427,7 +424,7 @@ static auto DiagnoseQualifiedDeclInImportedPackage(Context& context, -> void { CARBON_DIAGNOSTIC(QualifiedDeclOutsidePackage, Error, "imported packages cannot be used for declarations"); - CARBON_DIAGNOSTIC_LABEL(QualifiedDeclOutsidePackageSource, Info, + CARBON_DIAGNOSTIC_LABEL(QualifiedDeclOutsidePackageSource, "package imported here"); context.emitter() .Build(use_loc_id, QualifiedDeclOutsidePackage) @@ -443,7 +440,7 @@ static auto DiagnoseQualifiedDeclInNonScope( CARBON_DIAGNOSTIC(QualifiedNameInNonScope, Error, "name qualifiers are only allowed for entities that " "provide a scope"); - CARBON_DIAGNOSTIC_LABEL(QualifiedNameNonScopeEntity, Info, + CARBON_DIAGNOSTIC_LABEL(QualifiedNameNonScopeEntity, "referenced non-scope entity declared here"); context.emitter() .Build(use_loc_id, QualifiedNameInNonScope) diff --git a/toolchain/check/deduce.cpp b/toolchain/check/deduce.cpp index f5cd0fc2f046..354b6b8c9926 100644 --- a/toolchain/check/deduce.cpp +++ b/toolchain/check/deduce.cpp @@ -215,7 +215,7 @@ class DeductionContext { if (auto param = context().insts().TryGetAs( param_id)) { CARBON_DIAGNOSTIC_LABEL( - InitializingGenericParam, Info, + InitializingGenericParam, "initializing generic parameter `{0}` declared here", SemIR::NameId); builder.Attach( loc_id, InitializingGenericParam, @@ -243,9 +243,11 @@ class DeductionContext { static auto NoteGenericHere(Context& context, SemIR::GenericId generic_id, DiagnosticBuilder& diag) -> void { - CARBON_DIAGNOSTIC_LABEL(DeductionGenericHere, Info, + CARBON_DIAGNOSTIC_LABEL(DeductionGenericHere, "while deducing parameters of generic declared here"); - diag.Attach(context.generics().Get(generic_id).decl_id, DeductionGenericHere); + diag.Attach(LocIdForDiagnostics::DeclaredName( + context.generics().Get(generic_id).decl_id), + DeductionGenericHere); } DeductionContext::DeductionContext(Context* context, SemIR::LocId loc_id, @@ -334,7 +336,7 @@ auto DeductionContext::Deduce() -> bool { // compile-time value (e.g. TupleType) that we can decompose further. // So we do this conversion here, even though we will later try convert // again when we have deduced all of the bindings. - Diagnostics::AnnotationScope annotate_diagnostics( + Diagnostics::ContextScope diagnostic_context( &context().emitter(), [&](auto& builder) { if (diagnose_) { NoteInitializingParam(param_id, param_loc_id, builder); @@ -540,7 +542,7 @@ auto DeductionContext::CheckDeductionIsComplete() -> bool { // that incorrectly. auto binding_type_id = context().insts().Get(binding_id).type_id(); if (binding_type_id.is_symbolic()) { - Diagnostics::AnnotationScope annotate_diagnostics( + Diagnostics::ContextScope diagnostic_context( &context().emitter(), [&](auto& builder) { if (diagnose_) { NoteInitializingParam(binding_id, SemIR::LocId(binding_id), @@ -549,14 +551,20 @@ auto DeductionContext::CheckDeductionIsComplete() -> bool { }); { + // A diagnostic from substituting the generic arguments known so far + // into this parameter's type gets a label on the call or impl lookup + // being deduced for, naming the parameter. + auto name_id = GetEntityNameForGenericBinding(context(), binding_id); Diagnostics::ContextScope diag_context( &context().emitter(), [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT( + if (!name_id.has_value()) { + return; + } + CARBON_DIAGNOSTIC_LABEL( SubstitutingGenericParamType, - "constructed invalid specific for {0} from argument", - SemIR::TypeId); - builder.Attach(loc_id_, SubstitutingGenericParamType, - binding_type_id); + "while substituting generic arguments into the type of `{0}`", + SemIR::NameId); + builder.Attach(loc_id_, SubstitutingGenericParamType, name_id); }); auto param_type_const_id = SubstConstant(context(), SemIR::LocId(binding_id), diff --git a/toolchain/check/diagnostic_emitter.cpp b/toolchain/check/diagnostic_emitter.cpp index 63eeab478f4f..67d07a12871b 100644 --- a/toolchain/check/diagnostic_emitter.cpp +++ b/toolchain/check/diagnostic_emitter.cpp @@ -21,8 +21,8 @@ namespace Carbon::Check { auto DiagnosticEmitter::ConvertLoc(LocIdForDiagnostics loc_id, ContextFnT context_fn) const -> Diagnostics::ConvertedLoc { - auto [imports, converted] = loc_converter_.ConvertWithImports( - loc_id.loc_id(), loc_id.is_token_only()); + auto [imports, converted] = + loc_converter_.ConvertWithImports(loc_id.loc_id(), loc_id.extent()); for (const auto& import : imports) { // These are rendered as `: `, hanging off the location // they were reached from, so each reads as a step in a path. diff --git a/toolchain/check/diagnostic_helpers.h b/toolchain/check/diagnostic_helpers.h index b1676933c54a..75d89c5b2e58 100644 --- a/toolchain/check/diagnostic_helpers.h +++ b/toolchain/check/diagnostic_helpers.h @@ -24,24 +24,34 @@ class LocIdForDiagnostics { // This means the displayed location will include only the location's specific // parse node, instead of also including its descendants. static auto TokenOnly(Parse::NodeId node_id) -> LocIdForDiagnostics { - return LocIdForDiagnostics(SemIR::LocId(node_id), true); + return LocIdForDiagnostics(SemIR::LocId(node_id), Parse::LocExtent::Token); + } + + // Constructs a location for the name that `loc_id` declares, for a label + // that only locates a declaration. If `loc_id` declares no name, the + // location covers all of it. + template + requires std::constructible_from + static auto DeclaredName(LocT loc_id) -> LocIdForDiagnostics { + return LocIdForDiagnostics(SemIR::LocId(loc_id), + Parse::LocExtent::DeclaredName); } template requires std::constructible_from explicit(false) LocIdForDiagnostics(LocT loc_id) - : LocIdForDiagnostics(SemIR::LocId(loc_id), false) {} + : LocIdForDiagnostics(SemIR::LocId(loc_id), Parse::LocExtent::Subtree) {} auto loc_id() const -> SemIR::LocId { return loc_id_; } - auto is_token_only() const -> bool { return is_token_only_; } + auto extent() const -> Parse::LocExtent { return extent_; } private: - explicit LocIdForDiagnostics(SemIR::LocId loc_id, bool is_token_only) - : loc_id_(loc_id), is_token_only_(is_token_only) {} + explicit LocIdForDiagnostics(SemIR::LocId loc_id, Parse::LocExtent extent) + : loc_id_(loc_id), extent_(extent) {} SemIR::LocId loc_id_; - bool is_token_only_; + Parse::LocExtent extent_; }; // We define the emitter separately for dependencies, so only provide a base @@ -49,11 +59,22 @@ class LocIdForDiagnostics { using DiagnosticEmitterBase = Diagnostics::Emitter; using DiagnosticBuilder = DiagnosticEmitterBase::Builder; -using DiagnosticContextBuilder = DiagnosticEmitterBase::ContextBuilder; -// A function that adds a context label to a diagnostic. -using DiagnosticContextFn = - llvm::function_refvoid>; +// A function that builds a diagnostic with the caller's message, for a callee +// that detects a problem during an operation the caller performs, so that the +// message can describe that operation. The callee calls it, attaches labels +// for what it found, and emits the result. What a null one means depends on +// the callee. +using Diagnoser = llvm::function_refDiagnosticBuilder>; + +// A function that attaches labels to a diagnostic that other code builds, for a +// caller that can locate parts of the code being checked but does not build the +// diagnostic itself. +using DiagnosticLabelFn = llvm::function_refvoid>; + +// Attaches labels to every diagnostic emitted while it is in scope. +using DiagnosticContextScope = + Diagnostics::ContextScope; // An expression with a constant value, for rendering in a diagnostic. The // diagnostic rendering will include enclosing "`"s. diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index 48c547736298..d698605829ca 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -2896,14 +2896,23 @@ static auto MakeConstantForCall(EvalContext& eval_context, evaluation_mode == SemIR::Function::EvaluationMode::MustEval) { CARBON_DIAGNOSTIC(NonConstantCallToCompTimeOnlyFunction, Error, "non-constant call to compile-time-only function"); - CARBON_DIAGNOSTIC_LABEL(CompTimeOnlyFunctionHere, Info, + CARBON_DIAGNOSTIC_LABEL(CompTimeOnlyFunctionHere, "compile-time-only function declared here"); const auto& function = eval_context.functions().Get( std::get(callee).function_id); - eval_context.emitter() - .Build(inst_id, NonConstantCallToCompTimeOnlyFunction) - .Attach(function.latest_decl_id(), CompTimeOnlyFunctionHere) - .Emit(); + auto diag = eval_context.emitter().Build( + inst_id, NonConstantCallToCompTimeOnlyFunction); + // Only attach a label when the declaration has a location distinct from + // the call's. + auto decl_loc_id = + eval_context.insts().GetCanonicalLocId(function.latest_decl_id()); + if (decl_loc_id.has_value() && + decl_loc_id != eval_context.insts().GetCanonicalLocId(inst_id)) { + diag.Attach( + LocIdForDiagnostics::DeclaredName(function.latest_decl_id()), + CompTimeOnlyFunctionHere); + } + diag.Emit(); } return SemIR::ConstantId::NotConstant; } @@ -3486,9 +3495,9 @@ auto TryEvalBlockForSpecific(Context& context, SemIR::LocId loc_id, Diagnostics::ContextScope diagnostic_context( &context.emitter(), [&](auto& builder) { - CARBON_DIAGNOSTIC_SOFT_CONTEXT(ResolvingSpecificHere, - "unable to monomorphize specific {0}", - SemIR::SpecificId); + CARBON_DIAGNOSTIC_LABEL(ResolvingSpecificHere, + "in monomorphization of {0} here", + SemIR::SpecificId); builder.Attach(loc_id, ResolvingSpecificHere, specific_id); }); @@ -3874,9 +3883,9 @@ static auto TryEvalCall(EvalContext& outer_eval_context, SemIR::LocId loc_id, FunctionExecContext eval_context(&outer_eval_context.context(), loc_id, specific_id, &locals, args_id); - Diagnostics::AnnotationScope annotate_diagnostics( + Diagnostics::ContextScope diagnostic_context( &eval_context.emitter(), [&](auto& builder) { - CARBON_DIAGNOSTIC_LABEL(InCallToEvalFn, Info, "in call to {0} here", + CARBON_DIAGNOSTIC_LABEL(InCallToEvalFn, "in call to {0} here", SemIR::NameId); builder.Attach(loc_id, InCallToEvalFn, function.name_id); }); diff --git a/toolchain/check/eval_inst.cpp b/toolchain/check/eval_inst.cpp index 673b9ade4831..d0630b3ee0ac 100644 --- a/toolchain/check/eval_inst.cpp +++ b/toolchain/check/eval_inst.cpp @@ -602,22 +602,21 @@ auto EvalConstantInst(Context& context, SemIR::InstId inst_id, auto complete_type_id = context.types().GetTypeIdForTypeInstId(inst.complete_type_inst_id); if (complete_type_id.is_concrete()) { - Diagnostics::ContextScope diagnostic_context( - &context.emitter(), [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT(IncompleteTypeInMonomorphization, - "{0} evaluates to incomplete type {1}", - InstIdAsType, InstIdAsType); - builder.Attach(inst_id, IncompleteTypeInMonomorphization, - context.insts() - .GetAs(inst_id) - .complete_type_inst_id, - inst.complete_type_inst_id); - }); // We use TryToCompleteType() instead of RequireCompleteType() because we // are currently evaluating a RequireCompleteType instruction, and calling // RequireCompleteType() would insert another copy of the same instruction. - if (!TryToCompleteType(context, complete_type_id, SemIR::LocId(inst_id), - true)) { + if (!TryToCompleteType( + context, complete_type_id, SemIR::LocId(inst_id), [&] { + CARBON_DIAGNOSTIC(IncompleteTypeInMonomorphization, Error, + "{0} evaluates to incomplete type {1}", + InstIdAsType, InstIdAsType); + return context.emitter().Build( + inst_id, IncompleteTypeInMonomorphization, + context.insts() + .GetAs(inst_id) + .complete_type_inst_id, + inst.complete_type_inst_id); + })) { return ConstantEvalResult::Error; } return ConstantEvalResult::NewAnyPhase(SemIR::CompleteTypeWitness{ diff --git a/toolchain/check/function.cpp b/toolchain/check/function.cpp index 15caac544356..dd0efafba0ed 100644 --- a/toolchain/check/function.cpp +++ b/toolchain/check/function.cpp @@ -304,13 +304,13 @@ auto CheckFunctionReturnTypeMatches(Context& context, : context.emitter().Build(new_function.latest_decl_id(), FunctionRedeclReturnTypeDiffersNoReturn); if (prev_return_type_id.has_value()) { - CARBON_DIAGNOSTIC_LABEL(FunctionRedeclReturnTypePrevious, Info, + CARBON_DIAGNOSTIC_LABEL(FunctionRedeclReturnTypePrevious, "previously declared with return type {0}", SemIR::TypeId); diag.Attach(prev_function.latest_decl_id(), FunctionRedeclReturnTypePrevious, prev_return_type_id); } else { - CARBON_DIAGNOSTIC_LABEL(FunctionRedeclReturnTypePreviousNoReturn, Info, + CARBON_DIAGNOSTIC_LABEL(FunctionRedeclReturnTypePreviousNoReturn, "previously declared with no return type"); diag.Attach(prev_function.latest_decl_id(), FunctionRedeclReturnTypePreviousNoReturn); @@ -352,7 +352,7 @@ static auto CheckFunctionEvaluationModeMatches( "{0:=-1:not `eval`|=-2:not `musteval`|=1:`eval`|=2:`musteval`}", Diagnostics::IntAsSelect); CARBON_DIAGNOSTIC_LABEL( - FunctionRedeclEvaluationModePrevious, Info, + FunctionRedeclEvaluationModePrevious, "previously {0:<0:not |:}declared as " "{0:=-1:`eval`|=-2:`musteval`|=1:`eval`|=2:`musteval`}", Diagnostics::IntAsSelect); @@ -400,19 +400,19 @@ auto CheckFunctionReturnPatternType(Context& context, SemIR::LocId loc_id, // definition or call to this function. if (!RequireConcreteType( context, arg_type_id, SemIR::LocId(return_pattern_id), - [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT(IncompleteTypeInFunctionReturnType, - "function returns incomplete type {0}", - SemIR::TypeId); - builder.Attach(loc_id, IncompleteTypeInFunctionReturnType, - arg_type_id); + [&] { + CARBON_DIAGNOSTIC(IncompleteTypeInFunctionReturnType, Error, + "function returns incomplete type {0}", + SemIR::TypeId); + return context.emitter().Build( + loc_id, IncompleteTypeInFunctionReturnType, arg_type_id); }, - [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT(AbstractTypeInFunctionReturnType, - "function returns abstract type {0}", - SemIR::TypeId); - builder.Attach(loc_id, AbstractTypeInFunctionReturnType, - arg_type_id); + [&] { + CARBON_DIAGNOSTIC(AbstractTypeInFunctionReturnType, Error, + "function returns abstract type {0}", + SemIR::TypeId); + return context.emitter().Build( + loc_id, AbstractTypeInFunctionReturnType, arg_type_id); })) { return SemIR::ErrorInst::TypeId; } @@ -463,13 +463,13 @@ auto CheckFunctionDefinitionSignature(Context& context, // The parameter types need to be complete. RequireCompleteType( context, context.insts().Get(param_ref_id).type_id(), - SemIR::LocId(param_ref_id), [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT( - IncompleteTypeInFunctionParam, + SemIR::LocId(param_ref_id), [&] { + CARBON_DIAGNOSTIC( + IncompleteTypeInFunctionParam, Error, "parameter has incomplete type {0} in function definition", TypeOfInstId); - builder.Attach(param_ref_id, IncompleteTypeInFunctionParam, - param_ref_id); + return context.emitter().Build( + param_ref_id, IncompleteTypeInFunctionParam, param_ref_id); }); } @@ -793,12 +793,12 @@ static auto CheckDefaults(Context& context, SemIR::Function& function) if (!state->patterns_missing_defaults.empty()) { CARBON_DIAGNOSTIC(RequiredPatternDefaultValueMissing, Error, "this pattern is missing a required default value"); - CARBON_DIAGNOSTIC_LABEL(RequiredPatternDefaultValueFirstDefault, Info, + CARBON_DIAGNOSTIC_LABEL(RequiredPatternDefaultValueFirstDefault, "all patterns to the right of this first pattern " "with a default value must also specify a " "default value"); CARBON_DIAGNOSTIC_LABEL( - RequiredPatternDefaultValueMissingAdditional, Primary, + RequiredPatternDefaultValueMissingAdditional, "this pattern is also missing a required default value"); auto inst_ref = llvm::ArrayRef(state->patterns_missing_defaults); auto builder = context.emitter().Build( diff --git a/toolchain/check/handle_binding_pattern.cpp b/toolchain/check/handle_binding_pattern.cpp index c4a1460bb0e1..4325003d49ce 100644 --- a/toolchain/check/handle_binding_pattern.cpp +++ b/toolchain/check/handle_binding_pattern.cpp @@ -98,16 +98,16 @@ static auto IsValidParamForIntroducer(Context& context, SemIR::LocId loc_id, return false; } if (!is_generic) { - CARBON_DIAGNOSTIC(GenericParamMustBeConstant, Error, - "parameters of generic types must be constant"); - auto builder = - context.emitter().Build(loc_id, GenericParamMustBeConstant); if (is_var) { - CARBON_DIAGNOSTIC_LABEL(VarParamIsRuntime, Info, - "`var` parameters are runtime"); - builder.Attach(loc_id, VarParamIsRuntime); + CARBON_DIAGNOSTIC(VarParamIsRuntime, Error, + "`var` parameter of a generic type; parameters of " + "generic types must be constant"); + context.emitter().Emit(loc_id, VarParamIsRuntime); + } else { + CARBON_DIAGNOSTIC(GenericParamMustBeConstant, Error, + "parameters of generic types must be constant"); + context.emitter().Emit(loc_id, GenericParamMustBeConstant); } - builder.Emit(); return false; } return true; @@ -373,13 +373,12 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, return binding.pattern_id; }; - auto abstract_diagnostic_context = [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT(AbstractTypeInVarPattern, - "binding pattern has abstract type {0} in `var` " - "pattern", - SemIR::TypeId); - builder.Attach(type_expr.node_id, AbstractTypeInVarPattern, - type_expr.type_component_id); + auto abstract_diagnoser = [&] { + CARBON_DIAGNOSTIC(AbstractTypeInVarPattern, Error, + "binding pattern has abstract type {0} in `var` pattern", + SemIR::TypeId); + return context.emitter().Build(type_expr.node_id, AbstractTypeInVarPattern, + type_expr.type_component_id); }; // A `self` binding must be the first parameter in the explicit parameter @@ -451,10 +450,8 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, auto& class_info = context.classes().Get(class_type.class_id); if (class_info.inheritance_kind == SemIR::Class::InheritanceKind::Abstract) { - Diagnostics::ContextScope scope(&context.emitter(), - abstract_diagnostic_context); DiagnoseAbstractClass(context, class_type.class_id, - /*direct_use=*/true); + /*direct_use=*/true, abstract_diagnoser); type_expr.type_component_id = SemIR::ErrorInst::TypeId; } } @@ -536,26 +533,24 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, if (node_kind == Parse::NodeKind::FormBindingPattern) { return context.TODO(node_id, "support local form bindings"); } - auto incomplete_diagnostic_context = [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT( - IncompleteTypeInBindingDecl, - "binding pattern has incomplete type {0} in name " - "binding declaration", - InstIdAsType); - builder.Attach(type_expr.node_id, IncompleteTypeInBindingDecl, - type_expr.inst_id); + auto incomplete_diagnoser = [&] { + CARBON_DIAGNOSTIC(IncompleteTypeInBindingDecl, Error, + "binding pattern has incomplete type {0} in name " + "binding declaration", + InstIdAsType); + return context.emitter().Build( + type_expr.node_id, IncompleteTypeInBindingDecl, type_expr.inst_id); }; if (node_kind == Parse::NodeKind::VarBindingPattern || node_kind == Parse::NodeKind::StructPatternFieldVarBindingPattern) { - if (!RequireConcreteType( - context, type_expr.type_component_id, type_expr.node_id, - incomplete_diagnostic_context, abstract_diagnostic_context)) { + if (!RequireConcreteType(context, type_expr.type_component_id, + type_expr.node_id, incomplete_diagnoser, + abstract_diagnoser)) { type_expr.type_component_id = SemIR::ErrorInst::TypeId; } } else { if (!RequireCompleteType(context, type_expr.type_component_id, - type_expr.node_id, - incomplete_diagnostic_context)) { + type_expr.node_id, incomplete_diagnoser)) { type_expr.type_component_id = SemIR::ErrorInst::TypeId; } } diff --git a/toolchain/check/handle_class.cpp b/toolchain/check/handle_class.cpp index 75a627ab9f66..8f48442fe70e 100644 --- a/toolchain/check/handle_class.cpp +++ b/toolchain/check/handle_class.cpp @@ -216,7 +216,7 @@ static auto DiagnoseClassSpecificDeclRepeated(Context& context, CARBON_DIAGNOSTIC(BaseDeclRepeated, Error, "multiple `base` declarations in class; multiple " "inheritance is not permitted"); - CARBON_DIAGNOSTIC_LABEL(ClassSpecificDeclPrevious, Info, + CARBON_DIAGNOSTIC_LABEL(ClassSpecificDeclPrevious, "previous `{0}` declaration is here", Lex::TokenKind); CARBON_CHECK(tok == Lex::TokenKind::Adapt || tok == Lex::TokenKind::Base); context.emitter() @@ -259,19 +259,21 @@ auto HandleParseNode(Context& context, Parse::AdaptDeclId node_id) -> bool { ExprAsType(context, node_id, adapted_type_expr_id); if (!RequireConcreteType( context, adapted_type_id, node_id, - [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT(IncompleteTypeInAdaptDecl, - "adapted type {0} is an incomplete type", - InstIdAsType); - builder.Attach(node_id, IncompleteTypeInAdaptDecl, - adapted_type_inst_id); + [&] { + CARBON_DIAGNOSTIC(IncompleteTypeInAdaptDecl, Error, + "adapted type {0} is an incomplete type", + InstIdAsType); + return context.emitter().Build(adapted_type_node, + IncompleteTypeInAdaptDecl, + adapted_type_inst_id); }, - [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT(AbstractTypeInAdaptDecl, - "adapted type {0} is an abstract type", - InstIdAsType); - builder.Attach(node_id, AbstractTypeInAdaptDecl, - adapted_type_inst_id); + [&] { + CARBON_DIAGNOSTIC(AbstractTypeInAdaptDecl, Error, + "adapted type {0} is an abstract type", + InstIdAsType); + return context.emitter().Build(adapted_type_node, + AbstractTypeInAdaptDecl, + adapted_type_inst_id); })) { adapted_type_id = SemIR::ErrorInst::TypeId; } @@ -335,11 +337,11 @@ static auto CheckBaseType(Context& context, Parse::NodeId node_id, if (base_type_id == SemIR::ErrorInst::TypeId) { return BaseInfo::Error; } - if (!RequireCompleteType(context, base_type_id, node_id, [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT(IncompleteTypeInBaseDecl, - "base {0} is an incomplete type", - InstIdAsType); - builder.Attach(node_id, IncompleteTypeInBaseDecl, base_type_inst_id); + if (!RequireCompleteType(context, base_type_id, node_id, [&] { + CARBON_DIAGNOSTIC(IncompleteTypeInBaseDecl, Error, + "base {0} is an incomplete type", InstIdAsType); + return context.emitter().Build(node_id, IncompleteTypeInBaseDecl, + base_type_inst_id); })) { return BaseInfo::Error; } diff --git a/toolchain/check/handle_export.cpp b/toolchain/check/handle_export.cpp index ad4b9eec0890..3329b934a0ba 100644 --- a/toolchain/check/handle_export.cpp +++ b/toolchain/check/handle_export.cpp @@ -58,7 +58,7 @@ auto HandleParseNode(Context& context, Parse::ExportDeclId node_id) -> bool { if (inst.Is()) { CARBON_DIAGNOSTIC(ExportRedundant, Warning, "`export` matches previous `export`"); - CARBON_DIAGNOSTIC_LABEL(ExportPrevious, Info, "previous `export` here"); + CARBON_DIAGNOSTIC_LABEL(ExportPrevious, "previous `export` here"); context.emitter() .Build(node_id, ExportRedundant) // Use the location of the export itself, not the exported instruction. @@ -76,7 +76,7 @@ auto HandleParseNode(Context& context, Parse::ExportDeclId node_id) -> bool { if (!import_ref) { CARBON_DIAGNOSTIC(ExportNotImportedEntity, Error, "only imported entities are valid for `export`"); - CARBON_DIAGNOSTIC_LABEL(ExportNotImportedEntitySource, Info, + CARBON_DIAGNOSTIC_LABEL(ExportNotImportedEntitySource, "name is declared here"); context.emitter() .Build(node_id, ExportNotImportedEntity) diff --git a/toolchain/check/handle_impl.cpp b/toolchain/check/handle_impl.cpp index 7af37133cd3f..a551517ed667 100644 --- a/toolchain/check/handle_impl.cpp +++ b/toolchain/check/handle_impl.cpp @@ -90,7 +90,7 @@ auto HandleParseNode(Context& context, Parse::ImplTypeAsId node_id) -> bool { // If the explicit self type is the default, suggest removing it with a // diagnostic, but continue as if no error occurred since the self-type // is semantically valid. - CARBON_DIAGNOSTIC_LABEL(ExtendImplSelfAsDefault, Info, + CARBON_DIAGNOSTIC_LABEL(ExtendImplSelfAsDefault, "remove the explicit `Self` type here"); diag.Attach(self_node, ExtendImplSelfAsDefault); if (self_type.type_id != SemIR::ErrorInst::TypeId) { @@ -339,7 +339,7 @@ static auto BuildImplDecl(Context& context, Parse::AnyImplDeclId node_id, CARBON_DIAGNOSTIC(FinalImplInMatchFirst, Error, "`final impl` in `match_first` block"); CARBON_DIAGNOSTIC_LABEL( - FinalImplInMatchFirstNote, Info, + FinalImplInMatchFirstNote, "the `match_first` block can be modified as `final` instead"); context.emitter() .Build(node_id, FinalImplInMatchFirst) @@ -371,7 +371,7 @@ static auto BuildImplDecl(Context& context, Parse::AnyImplDeclId node_id, CARBON_DIAGNOSTIC( ImplInTwoMatchFirst, Error, "impl declared in `match_first` more than once"); - CARBON_DIAGNOSTIC_LABEL(ImplInTwoMatchFirstNote, Info, + CARBON_DIAGNOSTIC_LABEL(ImplInTwoMatchFirstNote, "previous declaration here"); context.emitter() .Build(node_id, ImplInTwoMatchFirst) diff --git a/toolchain/check/handle_match_first.cpp b/toolchain/check/handle_match_first.cpp index b6562fedc0fe..bb2a14c58657 100644 --- a/toolchain/check/handle_match_first.cpp +++ b/toolchain/check/handle_match_first.cpp @@ -29,9 +29,10 @@ auto HandleParseNode(Context& context, MatchFirstInWrongScope, Error, "found `match_first` in invalid scope; expected namespace or class"); auto builder = context.emitter().Build(node_id, MatchFirstInWrongScope); - CARBON_DIAGNOSTIC_LABEL(MatchFirstInWrongScopeNote, Info, + CARBON_DIAGNOSTIC_LABEL(MatchFirstInWrongScopeNote, "in enclosing scope here"); - builder.Attach(enclosing_scope_inst_id, MatchFirstInWrongScopeNote); + builder.Attach(LocIdForDiagnostics::DeclaredName(enclosing_scope_inst_id), + MatchFirstInWrongScopeNote); builder.Emit(); context.node_stack().Push(node_id, SemIR::ErrorInst::InstId); return true; diff --git a/toolchain/check/handle_modifier.cpp b/toolchain/check/handle_modifier.cpp index 647a7a1907b2..9708cb643fd9 100644 --- a/toolchain/check/handle_modifier.cpp +++ b/toolchain/check/handle_modifier.cpp @@ -9,8 +9,8 @@ namespace Carbon::Check { -CARBON_DIAGNOSTIC_LABEL(ModifierPrevious, Info, - "`{0}` previously appeared here", Lex::TokenKind); +CARBON_DIAGNOSTIC_LABEL(ModifierPrevious, "`{0}` previously appeared here", + Lex::TokenKind); static auto DiagnoseRepeated(Context& context, Parse::NodeId first_node, Parse::NodeId second_node) -> void { diff --git a/toolchain/check/handle_name.cpp b/toolchain/check/handle_name.cpp index 3ccd65b4c29d..8f0ec2a1b496 100644 --- a/toolchain/check/handle_name.cpp +++ b/toolchain/check/handle_name.cpp @@ -205,15 +205,13 @@ auto HandleParseNode(Context& context, Parse::DesignatorExprId node_id) // `.Self`. SemIR::InstId period_self_id = SemIR::InstId::None; { - // TODO: Instead of annotating the diagnostic, should change - // `HandleNameAsExpr` to optionally allow us to produce the diagnostic - // instead so we can generate a "name `.Self` implicitly referenced by - // designated expression, but not found" diagnostic instead of adding a - // note to the current "name `.Self` not found" message. - Diagnostics::AnnotationScope annotate_diagnostics( + // TODO: Pass a diagnoser to `HandleNameAsExpr`, so that this can emit + // "name `.Self` implicitly referenced by designated expression, but not + // found" in place of labeling the "name `.Self` not found" diagnostic. + Diagnostics::ContextScope diagnostic_context( &context.emitter(), [&](auto& builder) { CARBON_DIAGNOSTIC_LABEL( - NoPeriodSelfForDesignator, Info, + NoPeriodSelfForDesignator, "designator may only be used when `.Self` is in scope"); builder.Attach(SemIR::LocId::None, NoPeriodSelfForDesignator); }); diff --git a/toolchain/check/handle_operator.cpp b/toolchain/check/handle_operator.cpp index ba5e64751c7e..93fbce87ca6a 100644 --- a/toolchain/check/handle_operator.cpp +++ b/toolchain/check/handle_operator.cpp @@ -285,7 +285,10 @@ auto PerformAction(Context& context, SemIR::LocId loc_id, auto diag_loc_id = loc_id.kind() == SemIR::LocId::Kind::NodeId ? LocIdForDiagnostics::TokenOnly(loc_id.node_id()) : LocIdForDiagnostics(loc_id); - context.emitter().Emit(diag_loc_id, AddrOfNonRef); + context.emitter() + .Build(diag_loc_id, AddrOfNonRef) + .ExtraRange(value_id) + .Emit(); value_id = SemIR::ErrorInst::InstId; break; } @@ -408,23 +411,20 @@ auto HandleParseNode(Context& context, Parse::PrefixOperatorStarId node_id) [&context, &node_id](SemIR::TypeId not_pointer_type_id) { // TODO: Pass in the expression we're trying to dereference to produce a // better diagnostic. + // TODO: Check for any facet here, rather than only a type. + if (not_pointer_type_id == SemIR::TypeType::TypeId) { + CARBON_DIAGNOSTIC(DerefOfType, Error, + "cannot dereference a type; to form a pointer " + "type, write the `*` after the pointee type"); + context.emitter().Emit(LocIdForDiagnostics::TokenOnly(node_id), + DerefOfType); + return; + } CARBON_DIAGNOSTIC(DerefOfNonPointer, Error, "cannot dereference operand of non-pointer type {0}", SemIR::TypeId); - - auto builder = - context.emitter().Build(LocIdForDiagnostics::TokenOnly(node_id), - DerefOfNonPointer, not_pointer_type_id); - - // TODO: Check for any facet here, rather than only a type. - if (not_pointer_type_id == SemIR::TypeType::TypeId) { - CARBON_DIAGNOSTIC_LABEL( - DerefOfType, Info, - "to form a pointer type, write the `*` after the pointee type"); - builder.Attach(LocIdForDiagnostics::TokenOnly(node_id), DerefOfType); - } - - builder.Emit(); + context.emitter().Emit(LocIdForDiagnostics::TokenOnly(node_id), + DerefOfNonPointer, not_pointer_type_id); }); context.node_stack().Push(node_id, deref_base_id); diff --git a/toolchain/check/handle_require.cpp b/toolchain/check/handle_require.cpp index a70c6a998a08..61e42400656f 100644 --- a/toolchain/check/handle_require.cpp +++ b/toolchain/check/handle_require.cpp @@ -245,13 +245,14 @@ static auto ValidateRequire(Context& context, SemIR::LocId full_require_loc_id, auto identified_facet_type_id = RequireIdentifiedFacetType( context, constraint_loc_id, self_type_id.AsConstantId(), - constraint_type_id, [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT( - RequireImplsUnidentifiedFacetType, + constraint_type_id, [&] { + CARBON_DIAGNOSTIC( + RequireImplsUnidentifiedFacetType, Error, "facet type {0} cannot be identified in `require` declaration", SemIR::TypeId); - builder.Attach(constraint_loc_id, RequireImplsUnidentifiedFacetType, - constraint_type_id); + return context.emitter().Build(constraint_loc_id, + RequireImplsUnidentifiedFacetType, + constraint_type_id); }); if (!identified_facet_type_id.has_value()) { // The constraint can't be used. A diagnostic was emitted by @@ -350,14 +351,13 @@ auto HandleParseNode(Context& context, Parse::RequireDeclId node_id) -> bool { if (!RequireCompleteType( context, context.types().GetTypeIdForTypeInstId(constraint_type_inst_id), - constraint_node_id, [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT( - RequireImplsIncompleteFacetType, - "`extend require` of incomplete facet type {0}", - InstIdAsType); - builder.Attach(constraint_node_id, - RequireImplsIncompleteFacetType, - constraint_type_inst_id); + constraint_node_id, [&] { + CARBON_DIAGNOSTIC(RequireImplsIncompleteFacetType, Error, + "`extend require` of incomplete facet type {0}", + InstIdAsType); + return context.emitter().Build(constraint_node_id, + RequireImplsIncompleteFacetType, + constraint_type_inst_id); })) { return true; } diff --git a/toolchain/check/handle_where.cpp b/toolchain/check/handle_where.cpp index 2b4b289a1aa0..4d680aa4828c 100644 --- a/toolchain/check/handle_where.cpp +++ b/toolchain/check/handle_where.cpp @@ -499,7 +499,7 @@ static auto DiagnoseNestedWhere(Context& context, SemIR::LocId loc_id, NestedWhereInsideWhere, Error, "found `where` expression nested on the right-hand side of `where`"); auto builder = context.emitter().Build(loc_id, NestedWhereInsideWhere); - CARBON_DIAGNOSTIC_LABEL(NestedWhereInsideWhereOuterNote, Info, + CARBON_DIAGNOSTIC_LABEL(NestedWhereInsideWhereOuterNote, "on right-hand side of `where` here"); builder.Attach(outer_loc_id, NestedWhereInsideWhereOuterNote); builder.Emit(); diff --git a/toolchain/check/impl.cpp b/toolchain/check/impl.cpp index a393ca61a664..cadbef3c5988 100644 --- a/toolchain/check/impl.cpp +++ b/toolchain/check/impl.cpp @@ -39,12 +39,12 @@ namespace Carbon::Check { // Adds the location of the associated function to a diagnostic. static auto NoteAssociatedFunction(Context& context, DiagnosticBuilder& builder, SemIR::FunctionId function_id) -> void { - CARBON_DIAGNOSTIC_LABEL(AssociatedFunctionHere, Info, + CARBON_DIAGNOSTIC_LABEL(AssociatedFunctionHere, "associated function {0} declared here", SemIR::NameId); const auto& function = context.functions().Get(function_id); - builder.Attach(function.latest_decl_id(), AssociatedFunctionHere, - function.name_id); + builder.Attach(LocIdForDiagnostics::DeclaredName(function.latest_decl_id()), + AssociatedFunctionHere, function.name_id); } auto CheckAssociatedFunctionImplementation( @@ -193,7 +193,7 @@ static auto VerifyImplRedecl(Context& context, const SemIR::Impl& new_impl, CARBON_DIAGNOSTIC(ImplRedefinition, Error, "redefinition of `impl {0} as {1}`", InstIdAsRawType, InstIdAsRawType); - CARBON_DIAGNOSTIC_LABEL(ImplPreviousDefinition, Info, + CARBON_DIAGNOSTIC_LABEL(ImplPreviousDefinition, "previous definition was here"); context.emitter() .Build(new_impl.latest_decl_id(), ImplRedefinition, new_impl.self_id, @@ -288,12 +288,13 @@ static auto ApplyExtendImplAs(Context& context, SemIR::LocId loc_id, if (!RequireCompleteType( context, context.types().GetTypeIdForTypeInstId(impl.constraint_id), - SemIR::LocId(impl.constraint_id), [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT( - ExtendImplAsIncomplete, - "`extend impl as` incomplete facet type {0}", InstIdAsType); - builder.Attach(impl.latest_decl_id(), ExtendImplAsIncomplete, - impl.constraint_id); + SemIR::LocId(impl.constraint_id), [&] { + CARBON_DIAGNOSTIC(ExtendImplAsIncomplete, Error, + "`extend impl as` incomplete facet type {0}", + InstIdAsType); + return context.emitter().Build(impl.latest_decl_id(), + ExtendImplAsIncomplete, + impl.constraint_id); })) { parent_scope.set_has_error(); return false; @@ -654,14 +655,14 @@ auto ImplWitnessStartDefinition(Context& context, SemIR::Impl& impl) -> void { { if (!RequireCompleteType( context, context.types().GetTypeIdForTypeInstId(impl.constraint_id), - SemIR::LocId(impl.constraint_id), [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT( - ImplAsIncompleteFacetTypeDefinition, + SemIR::LocId(impl.constraint_id), [&] { + CARBON_DIAGNOSTIC( + ImplAsIncompleteFacetTypeDefinition, Error, "definition of impl as incomplete facet type {0}", InstIdAsType); - builder.Attach(SemIR::LocId(impl.latest_decl_id()), - ImplAsIncompleteFacetTypeDefinition, - impl.constraint_id); + return context.emitter().Build( + SemIR::LocId(impl.latest_decl_id()), + ImplAsIncompleteFacetTypeDefinition, impl.constraint_id); })) { FillImplWitnessWithErrors(context, impl); return; @@ -837,7 +838,7 @@ auto CheckImplRequirementsAtEndOfDefinition( "associated constant {0} not given a value in impl " "of interface {1}", SemIR::NameId, SemIR::NameId); - CARBON_DIAGNOSTIC_LABEL(AssociatedConstantHere, Info, + CARBON_DIAGNOSTIC_LABEL(AssociatedConstantHere, "associated constant declared here"); context.emitter() .Build(loc_id, ImplAssociatedConstantNeedsValue, @@ -1035,12 +1036,12 @@ auto CheckConstraintIsInterface(Context& context, SemIR::LocId loc_id, auto identified_id = RequireIdentifiedFacetType( context, SemIR::LocId(full_constraint_id), context.constant_values().Get(self_id), - context.types().GetTypeIdForTypeInstId(full_constraint_id), - [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT( - ImplOfUnidentifiedFacetType, - "facet type {0} cannot be identified in `impl as`", InstIdAsType); - builder.Attach(loc_id, ImplOfUnidentifiedFacetType, full_constraint_id); + context.types().GetTypeIdForTypeInstId(full_constraint_id), [&] { + CARBON_DIAGNOSTIC(ImplOfUnidentifiedFacetType, Error, + "facet type {0} cannot be identified in `impl as`", + InstIdAsType); + return context.emitter().Build(loc_id, ImplOfUnidentifiedFacetType, + full_constraint_id); }); if (!identified_id.has_value()) { return {IdentifiedFacetTypeId::None, SemIR::SpecificInterface::None}; diff --git a/toolchain/check/impl_lookup.cpp b/toolchain/check/impl_lookup.cpp index c2da3314facf..960babd53273 100644 --- a/toolchain/check/impl_lookup.cpp +++ b/toolchain/check/impl_lookup.cpp @@ -214,7 +214,7 @@ static auto FindAndDiagnoseImplLookupCycle( for (const auto& active_entry : llvm::drop_begin(stack, i)) { if (active_entry.impl_loc.has_value()) { CARBON_DIAGNOSTIC_LABEL( - ImplLookupCycleNote, Info, + ImplLookupCycleNote, "determining if this impl clause matches", ); builder.Attach(active_entry.impl_loc, ImplLookupCycleNote); } @@ -895,6 +895,14 @@ auto LookupImplWitness(Context& context, SemIR::LocId loc_id, query_facet_type_const_id)); } + auto query_facet_type_id = + context.types().GetTypeIdForTypeConstantId(query_facet_type_const_id); + auto diagnoser = [&] { + CARBON_DIAGNOSTIC(ImplLookupInUnidentifiedFacetType, Error, + "facet type {0} can not be identified", SemIR::TypeId); + return context.emitter().Build(loc_id, ImplLookupInUnidentifiedFacetType, + query_facet_type_id); + }; // This IdentifiedFacetType holds all the requirements that the impl lookup is // trying to satisfy. On success, each `X impls Y` requirement in here will // result in a witness being returned that provides the `impls` relationship. @@ -902,17 +910,8 @@ auto LookupImplWitness(Context& context, SemIR::LocId loc_id, // succeed. Since we're doing impl lookup and not defining an `impl` witness, // we treat all rewrite requirements as equivalent requirements. auto required_identified_id = RequireIdentifiedFacetType( - context, loc_id, query_self_const_id, - context.types().GetTypeIdForTypeConstantId(query_facet_type_const_id), - [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT(ImplLookupInUnidentifiedFacetType, - "facet type {0} can not be identified", - SemIR::TypeId); - builder.Attach(loc_id, ImplLookupInUnidentifiedFacetType, - context.types().GetTypeIdForTypeConstantId( - query_facet_type_const_id)); - }, - diagnose); + context, loc_id, query_self_const_id, query_facet_type_id, + diagnose ? Diagnoser(diagnoser) : nullptr); if (!required_identified_id.has_value()) { return SemIR::InstBlockIdOrError::MakeError(); } @@ -1330,13 +1329,18 @@ auto MakeWitnessesForPeriodSelfTypeWithoutLookup(Context& context, auto period_self_type_id = context.constant_values().GetInst(period_self).type_id(); + // The facet type of `.Self` may refer to generic interfaces that use `.Self` + // in their arguments, and replacing `.Self` with `facet_value` can fail with + // a monomorphization error, which is diagnosed where it happens. The + // diagnoser is for a named constraint in the facet type that isn't complete. auto identified_period_self_type_id = RequireIdentifiedFacetType( - context, loc_id, facet_value, period_self_type_id, - // The facet type of `.Self` may refer to generic interfaces that use - // `.Self` in their arguments. And when `.Self` is replaced by - // `facet_value`, we may fail with a monomorphization error. We pass it - // along without adding additional context. - [&](auto& /*builder*/) {}); + context, loc_id, facet_value, period_self_type_id, [&] { + CARBON_DIAGNOSTIC(PeriodSelfUnidentifiedFacetType, Error, + "facet type {0} of `.Self` cannot be identified", + SemIR::TypeId); + return context.emitter().Build(loc_id, PeriodSelfUnidentifiedFacetType, + period_self_type_id); + }); if (!identified_period_self_type_id.has_value()) { return SemIR::InstBlockIdOrError::MakeError(); } diff --git a/toolchain/check/impl_validation.cpp b/toolchain/check/impl_validation.cpp index d71b98ed063d..568150bcd212 100644 --- a/toolchain/check/impl_validation.cpp +++ b/toolchain/check/impl_validation.cpp @@ -252,7 +252,7 @@ static auto DiagnoseNonFinalImplsWithSameTypeStructureOutsideMatchFirst( "structure as another non-final `impl`"); auto builder = context.emitter().Build(impl_b.latest_decl_id, ImplNonFinalSameTypeStructure); - CARBON_DIAGNOSTIC_LABEL(ImplNonFinalSameTypeStructureNote, Info, + CARBON_DIAGNOSTIC_LABEL(ImplNonFinalSameTypeStructureNote, "other `impl` here"); builder.Attach(impl_a.latest_decl_id, ImplNonFinalSameTypeStructureNote); builder.Emit(); @@ -281,7 +281,7 @@ static auto DiagnoseUnmatchableNonFinalImplWithFinalImpl(Context& context, auto builder = context.emitter().Build(query_impl.latest_decl_id, ImplFinalOverlapsNonFinal); CARBON_DIAGNOSTIC_LABEL( - ImplFinalOverlapsNonFinalNote, Info, + ImplFinalOverlapsNonFinalNote, "`final impl` declared here would always be used instead"); builder.Attach(final_impl.latest_decl_id, ImplFinalOverlapsNonFinalNote); builder.Emit(); @@ -311,7 +311,7 @@ static auto DiagnoseFinalImplsOverlapInDifferentFiles(Context& context, CARBON_DIAGNOSTIC( FinalImplOverlapsDifferentFile, Error, "`final impl` overlaps with `final impl` from another file"); - CARBON_DIAGNOSTIC_LABEL(FinalImplOverlapsDifferentFileNote, Info, + CARBON_DIAGNOSTIC_LABEL(FinalImplOverlapsDifferentFileNote, "imported `final impl` here"); if (impl_a.is_local) { auto builder = context.emitter().Build(impl_a.latest_decl_id, @@ -346,7 +346,7 @@ static auto DiagnoseFinalImplsOverlapOutsideMatchFirst(Context& context, "outside a `match_first` block"); auto builder = context.emitter().Build(impl_b.latest_decl_id, FinalImplOverlapsSameFile); - CARBON_DIAGNOSTIC_LABEL(FinalImplOverlapsSameFileNote, Info, + CARBON_DIAGNOSTIC_LABEL(FinalImplOverlapsSameFileNote, "other `final impl` here"); builder.Attach(impl_a.latest_decl_id, FinalImplOverlapsSameFileNote); builder.Emit(); diff --git a/toolchain/check/import.cpp b/toolchain/check/import.cpp index 2074497d037c..f7c5c6e47983 100644 --- a/toolchain/check/import.cpp +++ b/toolchain/check/import.cpp @@ -639,9 +639,9 @@ auto ImportNameFromOtherPackage( } // Annotate diagnostics as occurring during this name lookup. - Diagnostics::AnnotationScope annotate_diagnostics( + Diagnostics::ContextScope diagnostic_context( &context.emitter(), [&](auto& builder) { - CARBON_DIAGNOSTIC_LABEL(InNameLookup, Info, "in name lookup for `{0}`", + CARBON_DIAGNOSTIC_LABEL(InNameLookup, "in name lookup for `{0}`", SemIR::NameId); builder.Attach(loc_id, InNameLookup, name_id); }); diff --git a/toolchain/check/literal.cpp b/toolchain/check/literal.cpp index 9d1e882b3d9d..5743472caa33 100644 --- a/toolchain/check/literal.cpp +++ b/toolchain/check/literal.cpp @@ -171,13 +171,12 @@ static auto GetStringLiteralRepr(Context& context, SemIR::LocId loc_id, auto MakeStringLiteral(Context& context, Parse::StringLiteralId node_id, StringLiteralValueId value_id) -> SemIR::InstId { auto str_type = MakeStringType(context, SemIR::LocId(node_id).AsDesugared()); - if (!RequireCompleteType( - context, str_type.type_id, node_id, [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT(StringLiteralTypeIncomplete, - "type {0} is incomplete", InstIdAsType); - builder.Attach(node_id, StringLiteralTypeIncomplete, - str_type.inst_id); - })) { + if (!RequireCompleteType(context, str_type.type_id, node_id, [&] { + CARBON_DIAGNOSTIC(StringLiteralTypeIncomplete, Error, + "type {0} is incomplete", InstIdAsType); + return context.emitter().Build(node_id, StringLiteralTypeIncomplete, + str_type.inst_id); + })) { return SemIR::ErrorInst::InstId; } diff --git a/toolchain/check/member_access.cpp b/toolchain/check/member_access.cpp index 99da70a3831c..0a0c1615bb61 100644 --- a/toolchain/check/member_access.cpp +++ b/toolchain/check/member_access.cpp @@ -254,11 +254,11 @@ static auto GetWitnessFromSingleImplLookupResult( // Performs impl lookup for a member name expression. This finds the relevant // impl witness and extracts the corresponding impl member. -static auto PerformImplLookup( - Context& context, SemIR::LocId loc_id, SemIR::ConstantId type_const_id, - SemIR::AssociatedEntityType assoc_type, SemIR::InstId member_id, - bool diagnose = true, - DiagnosticContextFn missing_impl_diagnostic_context = nullptr) +static auto PerformImplLookup(Context& context, SemIR::LocId loc_id, + SemIR::ConstantId type_const_id, + SemIR::AssociatedEntityType assoc_type, + SemIR::InstId member_id, bool diagnose = true, + Diagnoser missing_impl_diagnostic = nullptr) -> SemIR::InstId { auto self_type_id = context.types().GetTypeIdForTypeConstantId(type_const_id); // TODO: Avoid forming and then immediately decomposing a `FacetType` here. @@ -269,15 +269,9 @@ static auto PerformImplLookup( interface_type_id.AsConstantId()); if (!lookup_result.has_value()) { if (diagnose) { - if (missing_impl_diagnostic_context) { - Diagnostics::ContextScope scope(&context.emitter(), - missing_impl_diagnostic_context); - // TODO: Pass in the expression whose type we are printing. - CARBON_DIAGNOSTIC(MissingImplInMemberAccessInContext, Error, - "type {1} does not implement interface {0}", - SemIR::TypeId, SemIR::TypeId); - context.emitter().Emit(loc_id, MissingImplInMemberAccessInContext, - interface_type_id, self_type_id); + if (missing_impl_diagnostic) { + auto diag = missing_impl_diagnostic(); + diag.Emit(); } else { // TODO: Pass in the expression whose type we are printing. CARBON_DIAGNOSTIC(MissingImplInMemberAccess, Error, @@ -541,13 +535,13 @@ static auto PerformActionHelper(Context& context, SemIR::LocId loc_id, // here to provide a better diagnostic than what we get when looking for // scopes directly on the facet type. if (!RequireCompleteType( - context, base_type_id, SemIR::LocId(base_id), [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT( - IncompleteTypeInMemberAccessOfFacet, + context, base_type_id, SemIR::LocId(base_id), [&] { + CARBON_DIAGNOSTIC( + IncompleteTypeInMemberAccessOfFacet, Error, "member access into facet of incomplete type {0}", SemIR::TypeId); - builder.Attach(base_id, IncompleteTypeInMemberAccessOfFacet, - base_type_id); + return context.emitter().Build( + base_id, IncompleteTypeInMemberAccessOfFacet, base_type_id); })) { // If the scope is invalid in AppendLookupScopesForConstant we still // return true and proceed with lookup, just ignoring that scope. @@ -582,16 +576,16 @@ static auto PerformActionHelper(Context& context, SemIR::LocId loc_id, // we can produce a better diagnostic here with context about what operation // is being done (member access) that requires the complete type. // - // TODO: ConvertToValueOrRefExpr could take context about the operation being - // done to give a better error than "invalid use of" an incomplete type? - if (!RequireCompleteType( - context, base_type_id, SemIR::LocId(base_id), [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT( - IncompleteTypeInMemberAccess, - "member access into object of incomplete type {0}", - TypeOfInstId); - builder.Attach(base_id, IncompleteTypeInMemberAccess, base_id); - })) { + // TODO: ConvertToValueOrRefExpr could take a diagnoser for the operation + // being done, to give a better error than "invalid use of" an incomplete + // type. + if (!RequireCompleteType(context, base_type_id, SemIR::LocId(base_id), [&] { + CARBON_DIAGNOSTIC(IncompleteTypeInMemberAccess, Error, + "member access into object of incomplete type {0}", + TypeOfInstId); + return context.emitter().Build(base_id, IncompleteTypeInMemberAccess, + base_id); + })) { return SemIR::ErrorInst::InstId; } @@ -772,8 +766,7 @@ auto GetAssociatedValue(Context& context, SemIR::LocId loc_id, static auto PerformCompoundMemberAccessAction( Context& context, SemIR::LocId loc_id, SemIR::InstId base_id, SemIR::InstId member_expr_id, bool diagnose = true, - DiagnosticContextFn missing_impl_diagnostic_context = nullptr) - -> SemIR::InstId { + Diagnoser missing_impl_diagnostic = nullptr) -> SemIR::InstId { auto base_type_id = context.insts().Get(base_id).type_id(); auto base_type_const_id = context.types().GetConstantId(base_type_id); @@ -806,9 +799,9 @@ static auto PerformCompoundMemberAccessAction( if (IsInstanceType(context, decl_type_id)) { // Step 2a: For instance methods, lookup the impl of the interface for // this type and get the method. - member_id = PerformImplLookup(context, loc_id, base_type_const_id, - *assoc_type, member_id, diagnose, - missing_impl_diagnostic_context); + member_id = + PerformImplLookup(context, loc_id, base_type_const_id, *assoc_type, + member_id, diagnose, missing_impl_diagnostic); // Next we will perform instance binding. } else { // Step 2b: For non-instance methods and associated constants, we access @@ -844,10 +837,11 @@ static auto PerformCompoundMemberAccessAction( return member_id; } -auto PerformCompoundMemberAccess( - Context& context, SemIR::LocId loc_id, SemIR::InstId base_id, - SemIR::InstId member_expr_id, bool diagnose, - DiagnosticContextFn missing_impl_diagnostic_context) -> SemIR::InstId { +auto PerformCompoundMemberAccess(Context& context, SemIR::LocId loc_id, + SemIR::InstId base_id, + SemIR::InstId member_expr_id, bool diagnose, + Diagnoser missing_impl_diagnostic) + -> SemIR::InstId { if (auto splice_inst_id = AddActionSpliceIfDependent( context, loc_id, SemIR::TypeInstId::None, SemIR::CompoundMemberAccessAction{.type_id = SemIR::InstType::TypeId, @@ -860,7 +854,7 @@ auto PerformCompoundMemberAccess( } return PerformCompoundMemberAccessAction(context, loc_id, base_id, member_expr_id, diagnose, - missing_impl_diagnostic_context); + missing_impl_diagnostic); } auto PerformAction(Context& context, SemIR::LocId loc_id, @@ -889,7 +883,10 @@ auto PerformTupleAccess(Context& context, SemIR::LocId loc_id, // TODO: Decide what to do if the index is a symbolic constant. CARBON_DIAGNOSTIC(TupleIndexNotConstant, Error, "tuple index must be a constant"); - context.emitter().Emit(loc_id, TupleIndexNotConstant); + context.emitter() + .Build(loc_id, TupleIndexNotConstant) + .ExtraRange(index_inst_id) + .Emit(); return SemIR::ErrorInst::InstId; }; // Diagnose a non-constant index prior to conversion to IntLiteral, because diff --git a/toolchain/check/member_access.h b/toolchain/check/member_access.h index 6c10b58bbaa7..a0d7afd39898 100644 --- a/toolchain/check/member_access.h +++ b/toolchain/check/member_access.h @@ -27,17 +27,18 @@ auto PerformMemberAccess(Context& context, SemIR::LocId loc_id, // Creates SemIR to perform a compound member access with base expression // `base_id` and member name expression `member_expr_id`. Returns the result of -// the access. If specified, `missing_impl_diagnostic_context()` is used to -// provide context for the error diagnostic when impl binding fails due to a -// missing `impl`. +// the access. If specified, `missing_impl_diagnostic()` is emitted in place of +// the generic diagnostic when impl binding fails due to a missing `impl`; see +// `BuildUnaryOperator`. // // On failure, an ErrorInst is returned and a diagnostic is produced unless // `diagnose` is false. It is incorrect to specify `diagnose` as false if the // resulting ErrorInst may appear in the produced SemIR. -auto PerformCompoundMemberAccess( - Context& context, SemIR::LocId loc_id, SemIR::InstId base_id, - SemIR::InstId member_expr_id, bool diagnose = true, - DiagnosticContextFn missing_impl_diagnostic_context = nullptr) +auto PerformCompoundMemberAccess(Context& context, SemIR::LocId loc_id, + SemIR::InstId base_id, + SemIR::InstId member_expr_id, + bool diagnose = true, + Diagnoser missing_impl_diagnostic = nullptr) -> SemIR::InstId; // Finds the value of an associated entity (given by assoc_entity_inst_id, a diff --git a/toolchain/check/merge.cpp b/toolchain/check/merge.cpp index 02a2255d1e46..40ab7a82fe3d 100644 --- a/toolchain/check/merge.cpp +++ b/toolchain/check/merge.cpp @@ -14,7 +14,7 @@ namespace Carbon::Check { -CARBON_DIAGNOSTIC_LABEL(RedeclPrevDecl, Info, "previously declared here"); +CARBON_DIAGNOSTIC_LABEL(RedeclPrevDecl, "previously declared here"); // Diagnoses a redeclaration which is redundant. static auto DiagnoseRedundant(Context& context, Lex::TokenKind decl_kind, @@ -25,7 +25,7 @@ static auto DiagnoseRedundant(Context& context, Lex::TokenKind decl_kind, SemIR::NameId); context.emitter() .Build(new_loc_id, RedeclRedundant, decl_kind, name_id) - .Attach(prev_loc_id, RedeclPrevDecl) + .Attach(LocIdForDiagnostics::DeclaredName(prev_loc_id), RedeclPrevDecl) .Emit(); } @@ -35,10 +35,10 @@ static auto DiagnoseRedef(Context& context, Lex::TokenKind decl_kind, SemIR::LocId prev_loc_id) -> void { CARBON_DIAGNOSTIC(RedeclRedef, Error, "redefinition of `{0} {1}`", Lex::TokenKind, SemIR::NameId); - CARBON_DIAGNOSTIC_LABEL(RedeclPrevDef, Info, "previously defined here"); + CARBON_DIAGNOSTIC_LABEL(RedeclPrevDef, "previously defined here"); context.emitter() .Build(new_loc_id, RedeclRedef, decl_kind, name_id) - .Attach(prev_loc_id, RedeclPrevDef) + .Attach(LocIdForDiagnostics::DeclaredName(prev_loc_id), RedeclPrevDef) .Emit(); } @@ -52,7 +52,7 @@ static auto DiagnoseExternMismatch(Context& context, Lex::TokenKind decl_kind, Lex::TokenKind, SemIR::NameId); context.emitter() .Build(new_loc_id, RedeclExternMismatch, decl_kind, name_id) - .Attach(prev_loc_id, RedeclPrevDecl) + .Attach(LocIdForDiagnostics::DeclaredName(prev_loc_id), RedeclPrevDecl) .Emit(); } @@ -67,7 +67,7 @@ static auto DiagnoseExternLibraryInImporter(Context& context, Lex::TokenKind, SemIR::NameId); context.emitter() .Build(new_loc_id, ExternLibraryInImporter, decl_kind, name_id) - .Attach(prev_loc_id, RedeclPrevDecl) + .Attach(LocIdForDiagnostics::DeclaredName(prev_loc_id), RedeclPrevDecl) .Emit(); } @@ -79,7 +79,7 @@ static auto DiagnoseExternLibraryIncorrect(Context& context, ExternLibraryIncorrect, Error, "declaration in {0} doesn't match `extern library` declaration", SemIR::LibraryNameId); - CARBON_DIAGNOSTIC_LABEL(ExternLibraryExpected, Info, + CARBON_DIAGNOSTIC_LABEL(ExternLibraryExpected, "previously declared with `extern library` here"); context.emitter() .Build(new_loc_id, ExternLibraryIncorrect, context.sem_ir().library_id()) @@ -214,7 +214,7 @@ static auto CheckRedeclParam(Context& context, bool is_implicit_param, SemIR::SpecificId prev_specific_id, bool diagnose, bool check_syntax) -> bool { CARBON_DIAGNOSTIC_LABEL( - RedeclParamPrevious, Info, + RedeclParamPrevious, "previous declaration's corresponding {0:implicit |}parameter here", Diagnostics::BoolAsSelect); auto emit_general_diagnostic = [&]() { @@ -390,7 +390,7 @@ static auto CheckRedeclParams(Context& context, SemIR::LocId new_decl_loc_id, "redeclaration differs because of " "{1:|missing }{0:implicit |}parameter list", Diagnostics::BoolAsSelect, Diagnostics::BoolAsSelect); - CARBON_DIAGNOSTIC_LABEL(RedeclParamListPrevious, Info, + CARBON_DIAGNOSTIC_LABEL(RedeclParamListPrevious, "previously declared " "{1:with|without} {0:implicit |}parameter list", Diagnostics::BoolAsSelect, @@ -419,7 +419,7 @@ static auto CheckRedeclParams(Context& context, SemIR::LocId new_decl_loc_id, "redeclaration differs because of {0:implicit |}parameter count of {1}", Diagnostics::BoolAsSelect, int32_t); CARBON_DIAGNOSTIC_LABEL( - RedeclParamCountPrevious, Info, + RedeclParamCountPrevious, "previously declared with {0:implicit |}parameter count of {1}", Diagnostics::BoolAsSelect, int32_t); context.emitter() @@ -537,7 +537,7 @@ static auto CheckRedeclParamSyntax(Context& context, } CARBON_DIAGNOSTIC(RedeclParamSyntaxDiffers, Error, "redeclaration syntax differs here"); - CARBON_DIAGNOSTIC_LABEL(RedeclParamSyntaxPrevious, Info, + CARBON_DIAGNOSTIC_LABEL(RedeclParamSyntaxPrevious, "comparing with previous declaration here"); context.emitter() .Build(new_node_id, RedeclParamSyntaxDiffers) @@ -840,7 +840,9 @@ auto TryMergeRedecl(Context& context, context.emitter() .Build(entity_info.new_entity.latest_decl_id(), DeducedReturnTypeRedecl) - .Attach(prev_entity.latest_decl_id(), RedeclPrevDecl) + .Attach( + LocIdForDiagnostics::DeclaredName(prev_entity.latest_decl_id()), + RedeclPrevDecl) .Emit(); return false; } diff --git a/toolchain/check/modifiers.cpp b/toolchain/check/modifiers.cpp index d03d99906e8f..be82ab0d995c 100644 --- a/toolchain/check/modifiers.cpp +++ b/toolchain/check/modifiers.cpp @@ -44,8 +44,7 @@ static auto DiagnoseNotAllowed( auto diag = StartDiagnoseNotAllowed(context, diagnostic_base, modifier_node, decl_kind); if (context_loc_id.has_value()) { - CARBON_DIAGNOSTIC_LABEL(ModifierNotInContext, Info, - "containing definition here"); + CARBON_DIAGNOSTIC_LABEL(ModifierNotInContext, "containing definition here"); diag.Attach(context_loc_id, ModifierNotInContext); } diag.Emit(); diff --git a/toolchain/check/name_lookup.cpp b/toolchain/check/name_lookup.cpp index 26c6fabf9b51..e888c335484d 100644 --- a/toolchain/check/name_lookup.cpp +++ b/toolchain/check/name_lookup.cpp @@ -157,10 +157,11 @@ auto TryGetLookupResultInCurrentScope(Context& context, SemIR::LocId loc_id, UncapturedLocal, Error, "cannot reference local `{0}` declared in enclosing scope", SemIR::NameId); - CARBON_DIAGNOSTIC_LABEL(UncapturedLocalDecl, Info, "declared here"); + CARBON_DIAGNOSTIC_LABEL(UncapturedLocalDecl, "declared here"); context.emitter() .Build(loc_id, UncapturedLocal, name_id) - .Attach(target_inst_id, UncapturedLocalDecl) + .Attach(LocIdForDiagnostics::DeclaredName(target_inst_id), + UncapturedLocalDecl) .Emit(); return false; } @@ -355,12 +356,19 @@ static auto DiagnoseInvalidQualifiedNameAccess( ClassInvalidMemberAccess, Error, "cannot access {0:private|protected} member `{1}` of type {2}", Diagnostics::BoolAsSelect, SemIR::NameId, SemIR::TypeId); - CARBON_DIAGNOSTIC_LABEL(ClassMemberDeclaration, Info, "declared here"); - context.emitter() - .Build(loc_id, ClassInvalidMemberAccess, - access_kind == SemIR::AccessKind::Private, name_id, scope_type_id) - .Attach(member_loc_id, ClassMemberDeclaration) - .Emit(); + CARBON_DIAGNOSTIC_LABEL(ClassMemberDeclaration, "declared here"); + auto diag = context.emitter().Build(loc_id, ClassInvalidMemberAccess, + access_kind == SemIR::AccessKind::Private, + name_id, scope_type_id); + // Only attach a label when the member's declaration has a location distinct + // from the access. + auto decl_loc_id = context.insts().GetCanonicalLocId(member_loc_id); + if (decl_loc_id.has_value() && + decl_loc_id != context.insts().GetCanonicalLocId(loc_id)) { + diag.Attach(LocIdForDiagnostics::DeclaredName(member_loc_id), + ClassMemberDeclaration); + } + diag.Emit(); } // Returns whether the access is prohibited by the access modifiers. @@ -456,12 +464,12 @@ auto AppendLookupScopesForConstant(Context& context, SemIR::LocId loc_id, // they are not complete. RequireCompleteType( context, context.types().GetTypeIdForTypeConstantId(lookup_const_id), - loc_id, [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT(QualifiedExprInIncompleteClassScope, - "member access into incomplete class {0}", - InstIdAsType); - builder.Attach(loc_id, QualifiedExprInIncompleteClassScope, - lookup_inst_id); + loc_id, [&] { + CARBON_DIAGNOSTIC(QualifiedExprInIncompleteClassScope, Error, + "member access into incomplete class {0}", + InstIdAsType); + return context.emitter().Build( + loc_id, QualifiedExprInIncompleteClassScope, lookup_inst_id); }); } auto& class_info = context.classes().Get(class_ty->class_id); @@ -484,13 +492,14 @@ auto AppendLookupScopesForConstant(Context& context, SemIR::LocId loc_id, if (!RequireCompleteType( context, context.types().GetTypeIdForTypeConstantId(lookup_const_id), - loc_id, [&](auto& builder) { - CARBON_DIAGNOSTIC_CONTEXT( - QualifiedExprInIncompleteFacetTypeScope, + loc_id, [&] { + CARBON_DIAGNOSTIC( + QualifiedExprInIncompleteFacetTypeScope, Error, "member access into incomplete facet type {0}", InstIdAsType); - builder.Attach(loc_id, QualifiedExprInIncompleteFacetTypeScope, - lookup_inst_id); + return context.emitter().Build( + loc_id, QualifiedExprInIncompleteFacetTypeScope, + lookup_inst_id); })) { // Lookup into this scope should fail without producing an error since // `RequireCompleteFacetType` has already issued a diagnostic. @@ -799,11 +808,10 @@ auto DiagnoseDuplicateName(Context& context, SemIR::NameId name_id, CARBON_DIAGNOSTIC(NameDeclDuplicate, Error, "duplicate name `{0}` being declared in the same scope", SemIR::NameId); - CARBON_DIAGNOSTIC_LABEL(NameDeclPrevious, Info, - "name is previously declared here"); + CARBON_DIAGNOSTIC_LABEL(NameDeclPrevious, "name is previously declared here"); context.emitter() .Build(dup_def, NameDeclDuplicate, name_id) - .Attach(prev_def, NameDeclPrevious) + .Attach(LocIdForDiagnostics::DeclaredName(prev_def), NameDeclPrevious) .Emit(); } @@ -814,7 +822,7 @@ auto DiagnosePoisonedName(Context& context, SemIR::NameId name_id, "Trying to diagnose poisoned name with no poisoning location"); CARBON_DIAGNOSTIC(NameUseBeforeDecl, Error, "name `{0}` used before it was declared", SemIR::NameId); - CARBON_DIAGNOSTIC_LABEL(NameUseBeforeDeclNote, Info, "declared here"); + CARBON_DIAGNOSTIC_LABEL(NameUseBeforeDeclNote, "declared here"); context.emitter() .Build(poisoning_loc_id, NameUseBeforeDecl, name_id) .Attach(decl_name_loc_id, NameUseBeforeDeclNote) diff --git a/toolchain/check/operator.cpp b/toolchain/check/operator.cpp index 166b331e4b33..74f2bce2a952 100644 --- a/toolchain/check/operator.cpp +++ b/toolchain/check/operator.cpp @@ -65,8 +65,7 @@ static auto HasCppClassType(Context& context, SemIR::InstId inst_id) -> bool { auto BuildUnaryOperator(Context& context, SemIR::LocId loc_id, Operator op, SemIR::InstId operand_id, bool diagnose, - DiagnosticContextFn missing_impl_diagnostic_context) - -> SemIR::InstId { + Diagnoser missing_impl_diagnostic) -> SemIR::InstId { if (operand_id == SemIR::ErrorInst::InstId) { // Exit early for errors, which prevent forming an `Op` function. return SemIR::ErrorInst::InstId; @@ -92,9 +91,8 @@ auto BuildUnaryOperator(Context& context, SemIR::LocId loc_id, Operator op, auto op_fn_id = GetOperatorOpFunction(context, loc_id, op); // Form `operand.(Op)`. - auto bound_op_id = - PerformCompoundMemberAccess(context, loc_id, operand_id, op_fn_id, - diagnose, missing_impl_diagnostic_context); + auto bound_op_id = PerformCompoundMemberAccess( + context, loc_id, operand_id, op_fn_id, diagnose, missing_impl_diagnostic); if (bound_op_id == SemIR::ErrorInst::InstId) { return SemIR::ErrorInst::InstId; } @@ -115,8 +113,7 @@ auto BuildSelfDestructCall(Context& context, SemIR::InstId object_id) auto BuildBinaryOperator(Context& context, SemIR::LocId loc_id, Operator op, SemIR::InstId lhs_id, SemIR::InstId rhs_id, - bool diagnose, - DiagnosticContextFn missing_impl_diagnostic_context) + bool diagnose, Diagnoser missing_impl_diagnostic) -> SemIR::InstId { if (lhs_id == SemIR::ErrorInst::InstId) { // Exit early for errors, which prevent forming an `Op` function. @@ -147,9 +144,8 @@ auto BuildBinaryOperator(Context& context, SemIR::LocId loc_id, Operator op, auto op_fn_id = GetOperatorOpFunction(context, loc_id, op); // Form `lhs.(Op)`. - auto bound_op_id = - PerformCompoundMemberAccess(context, loc_id, lhs_id, op_fn_id, diagnose, - missing_impl_diagnostic_context); + auto bound_op_id = PerformCompoundMemberAccess( + context, loc_id, lhs_id, op_fn_id, diagnose, missing_impl_diagnostic); if (bound_op_id == SemIR::ErrorInst::InstId) { return SemIR::ErrorInst::InstId; } diff --git a/toolchain/check/operator.h b/toolchain/check/operator.h index 4ca7fc34a286..a9dc1e4be585 100644 --- a/toolchain/check/operator.h +++ b/toolchain/check/operator.h @@ -25,12 +25,14 @@ struct Operator { // `diagnose` is false. It is incorrect to specify `diagnose` as false if the // resulting ErrorInst may appear in the produced SemIR. // -// If specified, `missing_impl_diagnostic_context` is used to provide context -// for the diagnostic if the impl lookup for the operator fails. +// If specified, `missing_impl_diagnostic` builds the diagnostic for a failed +// impl lookup for the operator in place of the generic missing-impl +// diagnostic, for a caller that can describe the failure in terms of its own +// operation, such as a conversion. auto BuildUnaryOperator(Context& context, SemIR::LocId loc_id, Operator op, SemIR::InstId operand_id, bool diagnose = true, - DiagnosticContextFn missing_impl_diagnostic_context = - nullptr) -> SemIR::InstId; + Diagnoser missing_impl_diagnostic = nullptr) + -> SemIR::InstId; // Checks and builds SemIR for a binary operator expression. For example, // `lhs_id * rhs_id`. @@ -39,12 +41,14 @@ auto BuildUnaryOperator(Context& context, SemIR::LocId loc_id, Operator op, // `diagnose` is false. It is incorrect to specify `diagnose` as false if the // resulting ErrorInst may appear in the produced SemIR. // -// If specified, `missing_impl_diagnostic_context` is used to provide context -// for the diagnostic if the impl lookup for the operator fails. -auto BuildBinaryOperator( - Context& context, SemIR::LocId loc_id, Operator op, SemIR::InstId lhs_id, - SemIR::InstId rhs_id, bool diagnose = true, - DiagnosticContextFn missing_impl_diagnostic_context = nullptr) +// If specified, `missing_impl_diagnostic` builds the diagnostic for a failed +// impl lookup for the operator in place of the generic missing-impl +// diagnostic, for a caller that can describe the failure in terms of its own +// operation, such as a conversion. +auto BuildBinaryOperator(Context& context, SemIR::LocId loc_id, Operator op, + SemIR::InstId lhs_id, SemIR::InstId rhs_id, + bool diagnose = true, + Diagnoser missing_impl_diagnostic = nullptr) -> SemIR::InstId; // Builds `.(Destroy.SelfDestruct)()`, converting adapters to their diff --git a/toolchain/check/pattern_match.cpp b/toolchain/check/pattern_match.cpp index 1d5c9414acee..def4b9004ab8 100644 --- a/toolchain/check/pattern_match.cpp +++ b/toolchain/check/pattern_match.cpp @@ -284,10 +284,10 @@ class MatchContext { // TODO: There is a cycle through pattern matching with an action. // NOLINTNEXTLINE(misc-no-recursion) auto MatchContext::Match(State state, WorkItem entry) -> void { - Diagnostics::AnnotationScope annotate_diagnostics( + Diagnostics::ContextScope diagnostic_context( &context_.emitter(), [&](auto& builder) { if (std::holds_alternative(state)) { - CARBON_DIAGNOSTIC_LABEL(InCallToFunctionParam, Info, + CARBON_DIAGNOSTIC_LABEL(InCallToFunctionParam, "initializing function parameter"); builder.Attach(entry.pattern_id, InCallToFunctionParam); } diff --git a/toolchain/check/return.cpp b/toolchain/check/return.cpp index 6d1ae99748a8..958274572407 100644 --- a/toolchain/check/return.cpp +++ b/toolchain/check/return.cpp @@ -58,7 +58,7 @@ static auto GetCurrentReturnedVar(Context& context) -> SemIR::InstId { // Produces a note that the given function has no explicit return type. static auto NoteNoReturnTypeProvided(DiagnosticBuilder& diag, const SemIR::Function& function) { - CARBON_DIAGNOSTIC_LABEL(ReturnTypeOmittedNote, Info, + CARBON_DIAGNOSTIC_LABEL(ReturnTypeOmittedNote, "there was no return type provided"); diag.Attach(function.latest_decl_id(), ReturnTypeOmittedNote); } @@ -67,8 +67,8 @@ static auto NoteNoReturnTypeProvided(DiagnosticBuilder& diag, // must be a function whose definition is currently being checked. static auto NoteReturnType(DiagnosticBuilder& diag, const SemIR::Function& function) { - CARBON_DIAGNOSTIC_LABEL(ReturnTypeHereNote, Info, - "return type of function is {0}", InstIdAsType); + CARBON_DIAGNOSTIC_LABEL(ReturnTypeHereNote, "return type of function is {0}", + InstIdAsType); diag.Attach(function.return_type_inst_id, ReturnTypeHereNote, function.return_type_inst_id); } @@ -77,7 +77,7 @@ static auto NoteReturnType(DiagnosticBuilder& diag, // function whose return type has not been deduced yet. static auto NoteReturnTypeIsDeduced(DiagnosticBuilder& diag, const SemIR::Function& function) { - CARBON_DIAGNOSTIC_LABEL(ReturnTypeIsDeducedNote, Info, + CARBON_DIAGNOSTIC_LABEL(ReturnTypeIsDeducedNote, "return type of function is deduced"); diag.Attach(function.latest_decl_id(), ReturnTypeIsDeducedNote); } @@ -85,8 +85,7 @@ static auto NoteReturnTypeIsDeduced(DiagnosticBuilder& diag, // Produces a note pointing at the currently in scope `returned var`. static auto NoteReturnedVar(DiagnosticBuilder& diag, SemIR::InstId returned_var_id) { - CARBON_DIAGNOSTIC_LABEL(ReturnedVarHere, Info, - "`returned var` was declared here"); + CARBON_DIAGNOSTIC_LABEL(ReturnedVarHere, "`returned var` was declared here"); diag.Attach(returned_var_id, ReturnedVarHere); } @@ -216,11 +215,11 @@ static auto CompletePendingReturns(Context& context, // Any problems converting to the return type are probably due to the choice // of return type, so point out where it came from. - Diagnostics::AnnotationScope annotate_diagnostics( + Diagnostics::ContextScope diagnostic_context( &context.emitter(), [&](DiagnosticBuilder& builder) { // TODO: Track the instruction the return type was deduced for and use // TypeOfInstId to preserve sugar. - CARBON_DIAGNOSTIC_LABEL(ReturnTypeDeducedAs, Info, + CARBON_DIAGNOSTIC_LABEL(ReturnTypeDeducedAs, "return type deduced as {0}", InstIdAsType); builder.Attach(function.return_type_inst_id, ReturnTypeDeducedAs, function.return_type_inst_id); @@ -302,10 +301,10 @@ auto RegisterReturnedVar(Context& context, Parse::NodeId returned_node, "`returned var` declaration in function with " "non-initializing return form"); auto diag = context.emitter().Build(returned_node, ReturnedVarNotInit); - CARBON_DIAGNOSTIC_LABEL(ReturnFormHereNote, Info, - "return form declared here"); + CARBON_DIAGNOSTIC_LABEL(ReturnFormHereNote, "return form declared here"); // A deduced return form is located where its type was deduced from, which - // is this `returned var`, so point at the function declaration instead. + // is this `returned var`, so attach the label to the function declaration + // instead. diag.Attach(function.has_deduced_return_type() ? function.latest_decl_id() : function.return_form_inst_id, @@ -453,7 +452,7 @@ auto DeduceReturnTypeAtEndOfBody(Context& context, DeducedReturnTypeMismatch, Error, "deduced return type {0} does not match return type deduced earlier", TypeOfInstId); - CARBON_DIAGNOSTIC_LABEL(DeducedReturnTypeMismatchPrevious, Info, + CARBON_DIAGNOSTIC_LABEL(DeducedReturnTypeMismatchPrevious, "return type previously deduced as {0} here", TypeOfInstId); context.emitter() diff --git a/toolchain/check/struct.cpp b/toolchain/check/struct.cpp index 1264a41d9ff7..907751e10f3b 100644 --- a/toolchain/check/struct.cpp +++ b/toolchain/check/struct.cpp @@ -36,7 +36,7 @@ auto DiagnoseDuplicateNames(Context& context, "duplicated field name `{1}` in " "{0:=0:struct literal|=1:struct type literal|=2:struct pattern}", Diagnostics::IntAsSelect, SemIR::NameId); - CARBON_DIAGNOSTIC_LABEL(StructNamePrevious, Info, + CARBON_DIAGNOSTIC_LABEL(StructNamePrevious, "field with the same name here"); context.emitter() .Build(result.value(), StructNameDuplicate, diff --git a/toolchain/check/testdata/alias/basics.carbon b/toolchain/check/testdata/alias/basics.carbon index 99081670bb05..e43b6814e790 100644 --- a/toolchain/check/testdata/alias/basics.carbon +++ b/toolchain/check/testdata/alias/basics.carbon @@ -94,8 +94,8 @@ var a: C = {}; var b: C = {}; // CHECK:STDERR: ╭─┤ fail_name_conflict.carbon:[[@LINE+11]]:7 // CHECK:STDERR: │ var b: C = {}; -// CHECK:STDERR: · ──┬─ -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ alias b = C; // CHECK:STDERR: · ┳ diff --git a/toolchain/check/testdata/array/basics.carbon b/toolchain/check/testdata/array/basics.carbon index 1e83830fc7be..d725367081be 100644 --- a/toolchain/check/testdata/array/basics.carbon +++ b/toolchain/check/testdata/array/basics.carbon @@ -9,6 +9,26 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/array/basics.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/basics.carbon +// CHECK:STDERR: ╭─┤ min_prelude/parts/array.carbon:13:3 +// CHECK:STDERR: -> │ adapt MakeArray(T, N); +// CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━ +// CHECK:STDERR: · ┗━━┫ error: `` evaluates to incomplete type +// CHECK:STDERR: · ┃ `` +// CHECK:STDERR: · ┃ [IncompleteTypeInMonomorphization] +// CHECK:STDERR: ┆ +// CHECK:STDERR: ├─┤ fail_incomplete_element.carbon +// CHECK:STDERR: │ class Incomplete; +// CHECK:STDERR: · ─────┬──── +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: ┆ +// CHECK:STDERR: │ var a: array(Incomplete, 1); +// CHECK:STDERR: · ──────────┬───────── +// CHECK:STDERR: · ╰──┤ in monomorphization of `array(Incomplete, 1)` here +// CHECK:STDERR: · │ │ [ResolvingSpecificHere] +// CHECK:STDERR: · ╰────┤ in completion of type `array(Incomplete, 1)` here +// CHECK:STDERR: · │ [InTypeCompletion] +// CHECK:STDERR: ╰──── +// CHECK:STDERR: // --- assign_var.carbon @@ -81,29 +101,10 @@ library "[[@TEST_NAME]]"; class Incomplete; -// CHECK:STDERR: ╭─┤ fail_incomplete_element.carbon:[[@LINE+31]]:8 -// CHECK:STDERR: │ class Incomplete; -// CHECK:STDERR: · ────────┬──────── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] -// CHECK:STDERR: ┆ -// CHECK:STDERR: -> │ var a: array(Incomplete, 1); -// CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━ -// CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type `array(Incomplete, 1)` in -// CHECK:STDERR: · ┃ name binding declaration -// CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] -// CHECK:STDERR: ┆ -// CHECK:STDERR: ├─┤ min_prelude/parts/array.carbon -// CHECK:STDERR: │ adapt MakeArray(T, N); -// CHECK:STDERR: · ┬───────────────────── -// CHECK:STDERR: · ╰──┤ `` evaluates to incomplete type -// CHECK:STDERR: · │ `` -// CHECK:STDERR: · │ [IncompleteTypeInMonomorphization] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_incomplete_element.carbon:[[@LINE+12]]:8 // CHECK:STDERR: │ class Incomplete; -// CHECK:STDERR: · ────────┬──────── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: · ─────┬──── +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ var a: array(Incomplete, 1); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━ @@ -120,15 +121,12 @@ var p: Incomplete* = &a[0]; library "[[@TEST_NAME]]"; -// CHECK:STDERR: ╭─┤ fail_invalid_element.carbon:[[@LINE+11]]:14 +// CHECK:STDERR: ╭─┤ fail_invalid_element.carbon:[[@LINE+8]]:14 // CHECK:STDERR: -> │ var a: array(1, 1); // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type -// CHECK:STDERR: · │ ┃ `Core.IntLiteral` to `type` -// CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] -// CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(type)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `Core.IntLiteral` to `type` +// CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: var a: array(1, 1); diff --git a/toolchain/check/testdata/array/bound_values.carbon b/toolchain/check/testdata/array/bound_values.carbon index 532451a250b9..8f44b04b83b5 100644 --- a/toolchain/check/testdata/array/bound_values.carbon +++ b/toolchain/check/testdata/array/bound_values.carbon @@ -62,15 +62,12 @@ var a: array(i32, 39999999999999999993); library "[[@TEST_NAME]]"; -// CHECK:STDERR: ╭─┤ fail_invalid_type_with_overflow.carbon:[[@LINE+11]]:14 +// CHECK:STDERR: ╭─┤ fail_invalid_type_with_overflow.carbon:[[@LINE+8]]:14 // CHECK:STDERR: -> │ var b: array(1, 39999999999999999993); // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type -// CHECK:STDERR: · │ ┃ `Core.IntLiteral` to `type` -// CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] -// CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(type)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `Core.IntLiteral` to `type` +// CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: var b: array(1, 39999999999999999993); diff --git a/toolchain/check/testdata/array/element_mismatches.carbon b/toolchain/check/testdata/array/element_mismatches.carbon index 74edbb60212c..a6d7fa7bef82 100644 --- a/toolchain/check/testdata/array/element_mismatches.carbon +++ b/toolchain/check/testdata/array/element_mismatches.carbon @@ -16,15 +16,12 @@ library "[[@TEST_NAME]]"; class C {} -// CHECK:STDERR: ╭─┤ fail_arg_wrong_type.carbon:[[@LINE+11]]:22 +// CHECK:STDERR: ╭─┤ fail_arg_wrong_type.carbon:[[@LINE+8]]:22 // CHECK:STDERR: -> │ var a: array(C, 3) = ({}, (), true); // CHECK:STDERR: · ┳━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type -// CHECK:STDERR: · │ ┃ `()` to `C` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `()` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(C)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `()` to `C` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var a: array(C, 3) = ({}, (), true); @@ -37,27 +34,22 @@ class C {} class D {} var a: (D, C, D); -// CHECK:STDERR: ╭─┤ fail_var_wrong_type.carbon:[[@LINE+11]]:22 +// CHECK:STDERR: ╭─┤ fail_var_wrong_type.carbon:[[@LINE+8]]:22 // CHECK:STDERR: -> │ var b: array(C, 3) = a; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type -// CHECK:STDERR: · │ ┃ `D` to `C` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `D` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(C)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `D` to `C` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var b: array(C, 3) = a; var c: (C, D, D); -// CHECK:STDERR: ╭─┤ fail_var_wrong_type.carbon:[[@LINE+9]]:22 +// CHECK:STDERR: ╭─┤ fail_var_wrong_type.carbon:[[@LINE+7]]:22 // CHECK:STDERR: -> │ var d: array(C, 3) = c; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot copy value of type `C` -// CHECK:STDERR: · │ ┃ [CopyOfUncopyableType] -// CHECK:STDERR: · ╰────┤ type `C` does not implement interface `Core.Copy` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ [CopyOfUncopyableType] // CHECK:STDERR: ╰──── // CHECK:STDERR: var d: array(C, 3) = c; diff --git a/toolchain/check/testdata/array/init_dependent_bound.carbon b/toolchain/check/testdata/array/init_dependent_bound.carbon index eda5d7bf222f..f4770f2db6d1 100644 --- a/toolchain/check/testdata/array/init_dependent_bound.carbon +++ b/toolchain/check/testdata/array/init_dependent_bound.carbon @@ -54,9 +54,9 @@ constraint Z(N: i32) { // have no location. The error should still point somewhere reasonable. // CHECK:STDERR: ╭─┤ fail_init_dependent_bound_in_constant.carbon:[[@LINE+13]]:24 // CHECK:STDERR: │ interface Y(T: type, U: T) {} - // CHECK:STDERR: · ──────────────┬───────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ extend require impls Y(array((), N), ()); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━ diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index a79c548be5bf..562057cc1222 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -133,15 +133,12 @@ fn F(a: A) { // a copy to perform initialization. It's not clear whether that is the right // behavior. - // CHECK:STDERR: ╭─┤ fail_init_tuple_variable.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_init_tuple_variable.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ var unused a_init: A = (a as ({}, Noncopyable)) as A; - // CHECK:STDERR: · ━━━━━━━━━━┳━━━━━━━━━ ┬──────────────────────────── - // CHECK:STDERR: · ┗━━━━━━━━━━━━━━━┫ error: cannot copy value of type `Noncopyable` - // CHECK:STDERR: · │ │ ┃ [CopyOfUncopyableType] - // CHECK:STDERR: · ╰─────────────────┤ type `Noncopyable` does not implement interface - // CHECK:STDERR: · │ │ `Core.Copy` - // CHECK:STDERR: · │ │ [MissingImplInMemberAccessInContext] - // CHECK:STDERR: · ╰──────┤ in copy of `A` [InCopy] + // CHECK:STDERR: · ━━━━━━━━━━┳━━━━━━━━━ ────┬──────────────────────── + // CHECK:STDERR: · ┗━━━━━━━━━━━━━━━━━━━┫ error: cannot copy value of type `Noncopyable` + // CHECK:STDERR: · │ ┃ [CopyOfUncopyableType] + // CHECK:STDERR: · ╰────┤ in copy of `A` [InCopy] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused a_init: A = (a as ({}, Noncopyable)) as A; @@ -162,14 +159,12 @@ class B { // We do not try to implicitly convert from the first operand of `as` to the // adapted type of the second operand. -// CHECK:STDERR: ╭─┤ fail_adapt_init_from_struct.carbon:[[@LINE+10]]:12 +// CHECK:STDERR: ╭─┤ fail_adapt_init_from_struct.carbon:[[@LINE+8]]:12 // CHECK:STDERR: -> │ var b: B = {.x = ()} as B; // CHECK:STDERR: · ┳━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `{.x: ()}` to `B` with -// CHECK:STDERR: · │ ┃ `as` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `{.x: ()}` does not implement interface `Core.As(B)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `as` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var b: B = {.x = ()} as B; diff --git a/toolchain/check/testdata/as/basics.carbon b/toolchain/check/testdata/as/basics.carbon index 89d2bb80929a..8f2a6960a2f6 100644 --- a/toolchain/check/testdata/as/basics.carbon +++ b/toolchain/check/testdata/as/basics.carbon @@ -106,15 +106,12 @@ let n: Y = ({.x = ()} as X) as Y; library "[[@TEST_NAME]]"; -// CHECK:STDERR: ╭─┤ fail_no_conversion.carbon:[[@LINE+11]]:13 +// CHECK:STDERR: ╭─┤ fail_no_conversion.carbon:[[@LINE+8]]:13 // CHECK:STDERR: -> │ let a: {} = 1 as {}; // CHECK:STDERR: · ┳━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `Core.IntLiteral` to -// CHECK:STDERR: · │ ┃ `{}` with `as` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement interface -// CHECK:STDERR: · │ `Core.As({})` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `{}` with `as` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let a: {} = 1 as {}; @@ -123,15 +120,12 @@ let a: {} = 1 as {}; library "[[@TEST_NAME]]"; -// CHECK:STDERR: ╭─┤ fail_not_type.carbon:[[@LINE+11]]:32 +// CHECK:STDERR: ╭─┤ fail_not_type.carbon:[[@LINE+8]]:32 // CHECK:STDERR: -> │ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type -// CHECK:STDERR: · │ ┃ value of type `{.x: ()}` to `type` -// CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] -// CHECK:STDERR: · ╰────┤ type `{.x: ()}` does not implement -// CHECK:STDERR: · │ interface `Core.ImplicitAs(type)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ value of type `{.x: ()}` to `type` +// CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: let n: {.x: ()} = {.x = ()} as {.x = ()}; diff --git a/toolchain/check/testdata/as/const.carbon b/toolchain/check/testdata/as/const.carbon index 57878700ece5..578fd524d4d8 100644 --- a/toolchain/check/testdata/as/const.carbon +++ b/toolchain/check/testdata/as/const.carbon @@ -58,27 +58,21 @@ var reference: const X; let ptr: const X* = &reference; fn Use() { - // CHECK:STDERR: ╭─┤ fail_cannot_remove_const.carbon:[[@LINE+11]]:24 + // CHECK:STDERR: ╭─┤ fail_cannot_remove_const.carbon:[[@LINE+8]]:24 // CHECK:STDERR: -> │ let unused a: X* = &(reference as X); // CHECK:STDERR: · ┳━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `const X` - // CHECK:STDERR: · │ ┃ to `X` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `const X` does not implement interface - // CHECK:STDERR: · │ `Core.As(X)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `X` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused a: X* = &(reference as X); - // CHECK:STDERR: ╭─┤ fail_cannot_remove_const.carbon:[[@LINE+11]]:22 + // CHECK:STDERR: ╭─┤ fail_cannot_remove_const.carbon:[[@LINE+8]]:22 // CHECK:STDERR: -> │ let unused b: X* = ptr as X*; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `const X*` to - // CHECK:STDERR: · │ ┃ `X*` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `const X*` does not implement interface - // CHECK:STDERR: · │ `Core.As(X*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `X*` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused b: X* = ptr as X*; diff --git a/toolchain/check/testdata/as/maybe_unformed.carbon b/toolchain/check/testdata/as/maybe_unformed.carbon index 6ac2c78251c1..6e1f190f999f 100644 --- a/toolchain/check/testdata/as/maybe_unformed.carbon +++ b/toolchain/check/testdata/as/maybe_unformed.carbon @@ -39,33 +39,25 @@ 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+14]]:41 + // CHECK:STDERR: ╭─┤ fail_todo_add_unformed_nonref.carbon:[[@LINE+10]]:41 // CHECK:STDERR: -> │ var unused i: Core.MaybeUnformed(X) = Init() as Core.MaybeUnformed(X); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of - // CHECK:STDERR: · │ ┃ type `X` to - // CHECK:STDERR: · │ ┃ `Core.MaybeUnformed(X)` with - // CHECK:STDERR: · │ ┃ `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `X` does not implement - // CHECK:STDERR: · │ interface - // CHECK:STDERR: · │ `Core.As(Core.MaybeUnformed(X))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type `X` to + // CHECK:STDERR: · ┃ `Core.MaybeUnformed(X)` with + // CHECK:STDERR: · ┃ `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused i: Core.MaybeUnformed(X) = Init() as Core.MaybeUnformed(X); - // CHECK:STDERR: ╭─┤ fail_todo_add_unformed_nonref.carbon:[[@LINE+14]]:41 + // CHECK:STDERR: ╭─┤ fail_todo_add_unformed_nonref.carbon:[[@LINE+10]]:41 // CHECK:STDERR: -> │ let unused v: Core.MaybeUnformed(X) = value as Core.MaybeUnformed(X); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of - // CHECK:STDERR: · │ ┃ type `X` to - // CHECK:STDERR: · │ ┃ `Core.MaybeUnformed(X)` with - // CHECK:STDERR: · │ ┃ `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `X` does not implement - // CHECK:STDERR: · │ interface - // CHECK:STDERR: · │ `Core.As(Core.MaybeUnformed(X))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type `X` to + // CHECK:STDERR: · ┃ `Core.MaybeUnformed(X)` with + // CHECK:STDERR: · ┃ `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused v: Core.MaybeUnformed(X) = value as Core.MaybeUnformed(X); @@ -84,65 +76,50 @@ var reference: Core.MaybeUnformed(X); let ptr: Core.MaybeUnformed(X)* = &reference; fn Use() { - // CHECK:STDERR: ╭─┤ fail_cannot_remove_unformed.carbon:[[@LINE+11]]:21 + // CHECK:STDERR: ╭─┤ fail_cannot_remove_unformed.carbon:[[@LINE+8]]:21 // CHECK:STDERR: -> │ var unused i: X = Init() as X; // CHECK:STDERR: · ┳━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type - // CHECK:STDERR: · │ ┃ `Core.MaybeUnformed(X)` to `X` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.MaybeUnformed(X)` does not implement - // CHECK:STDERR: · │ interface `Core.As(X)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Core.MaybeUnformed(X)` to `X` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: 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+11]]:21 + // CHECK:STDERR: ╭─┤ fail_cannot_remove_unformed.carbon:[[@LINE+8]]:21 // CHECK:STDERR: -> │ var unused j: X = Init() unsafe as X; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type - // CHECK:STDERR: · │ ┃ `Core.MaybeUnformed(X)` to `X` with `unsafe as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.MaybeUnformed(X)` does not implement - // CHECK:STDERR: · │ interface `Core.UnsafeAs(X)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Core.MaybeUnformed(X)` to `X` with `unsafe as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused j: X = Init() unsafe as X; - // CHECK:STDERR: ╭─┤ fail_cannot_remove_unformed.carbon:[[@LINE+11]]:21 + // CHECK:STDERR: ╭─┤ fail_cannot_remove_unformed.carbon:[[@LINE+8]]:21 // CHECK:STDERR: -> │ let unused v: X = value as X; // CHECK:STDERR: · ┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type - // CHECK:STDERR: · │ ┃ `Core.MaybeUnformed(X)` to `X` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.MaybeUnformed(X)` does not implement - // CHECK:STDERR: · │ interface `Core.As(X)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Core.MaybeUnformed(X)` to `X` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused v: X = value as X; - // CHECK:STDERR: ╭─┤ fail_cannot_remove_unformed.carbon:[[@LINE+11]]:24 + // CHECK:STDERR: ╭─┤ fail_cannot_remove_unformed.carbon:[[@LINE+8]]:24 // CHECK:STDERR: -> │ let unused a: X* = &(reference as X); // CHECK:STDERR: · ┳━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type - // CHECK:STDERR: · │ ┃ `Core.MaybeUnformed(X)` to `X` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.MaybeUnformed(X)` does not implement - // CHECK:STDERR: · │ interface `Core.As(X)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Core.MaybeUnformed(X)` to `X` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused a: X* = &(reference as X); - // CHECK:STDERR: ╭─┤ fail_cannot_remove_unformed.carbon:[[@LINE+11]]:22 + // CHECK:STDERR: ╭─┤ fail_cannot_remove_unformed.carbon:[[@LINE+8]]:22 // CHECK:STDERR: -> │ let unused b: X* = ptr as X*; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type - // CHECK:STDERR: · │ ┃ `Core.MaybeUnformed(X)*` to `X*` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.MaybeUnformed(X)*` does not implement - // CHECK:STDERR: · │ interface `Core.As(X*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Core.MaybeUnformed(X)*` to `X*` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused b: X* = ptr as X*; @@ -271,7 +248,7 @@ fn Use() { // CHECK:STDOUT: %T.09f: %SubobjectDestroy.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.type.dea: type = fn_type @T.as_type.as.DestroyImpl.impl.Op, @T.as_type.as.DestroyImpl.impl(%T.09f) [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.6e5: %T.as_type.as.DestroyImpl.impl.Op.type.dea = struct_value () [symbolic] -// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.4: type = fn_type @SubobjectDestroy.WithSelf.Op.loc26_3.4 [concrete] +// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.4: type = fn_type @SubobjectDestroy.WithSelf.Op.loc22_3.4 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.4: %SubobjectDestroy.WithSelf.Op.type.6870fd.4 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.4: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.4), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.4df: %SubobjectDestroy.type = facet_value %MaybeUnformed.67f, (%custom_witness.b80ef6.4) [concrete] @@ -298,19 +275,19 @@ fn Use() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %i.var: ref %MaybeUnformed.67f = var_storage %i.var_patt // CHECK:STDOUT: %Init.ref: %Init.type = name_ref Init, file.%Init.decl [concrete = constants.%Init] -// CHECK:STDOUT: %.loc26_46: ref %X = temporary_storage -// CHECK:STDOUT: %Init.call: init %X to %.loc26_46 = call %Init.ref() -// CHECK:STDOUT: %Core.ref.loc26_51: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %MaybeUnformed.ref.loc26_55: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] -// CHECK:STDOUT: %X.ref.loc26_70: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc26_71: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.67f] -// CHECK:STDOUT: %.loc26_48: %MaybeUnformed.67f = converted %Init.call, [concrete = ] +// CHECK:STDOUT: %.loc22_46: ref %X = temporary_storage +// CHECK:STDOUT: %Init.call: init %X to %.loc22_46 = call %Init.ref() +// CHECK:STDOUT: %Core.ref.loc22_51: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %MaybeUnformed.ref.loc22_55: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] +// CHECK:STDOUT: %X.ref.loc22_70: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %MaybeUnformed.loc22_71: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.67f] +// CHECK:STDOUT: %.loc22_48: %MaybeUnformed.67f = converted %Init.call, [concrete = ] // CHECK:STDOUT: assign %i.var, -// CHECK:STDOUT: %.loc26_37: type = splice_block %MaybeUnformed.loc26_37 [concrete = constants.%MaybeUnformed.67f] { -// CHECK:STDOUT: %Core.ref.loc26_17: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %MaybeUnformed.ref.loc26_21: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] -// CHECK:STDOUT: %X.ref.loc26_36: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc26_37: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.67f] +// CHECK:STDOUT: %.loc22_37: type = splice_block %MaybeUnformed.loc22_37 [concrete = constants.%MaybeUnformed.67f] { +// CHECK:STDOUT: %Core.ref.loc22_17: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %MaybeUnformed.ref.loc22_21: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] +// CHECK:STDOUT: %X.ref.loc22_36: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %MaybeUnformed.loc22_37: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.67f] // CHECK:STDOUT: } // CHECK:STDOUT: %i: ref %MaybeUnformed.67f = wrapper_binding i, %i.var // CHECK:STDOUT: name_binding_decl { @@ -319,40 +296,40 @@ fn Use() { // CHECK:STDOUT: } // CHECK:STDOUT: %value.global_ref: %X = global_ref @__global_init.%value // CHECK:STDOUT: %value.ref: %X = name_ref value, %value.global_ref -// CHECK:STDOUT: %Core.ref.loc41_50: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %MaybeUnformed.ref.loc41_54: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] -// CHECK:STDOUT: %X.ref.loc41_69: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc41_70: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.67f] -// CHECK:STDOUT: %.loc41_47: %MaybeUnformed.67f = converted %value.ref, [concrete = ] -// CHECK:STDOUT: %.loc41_37: type = splice_block %MaybeUnformed.loc41_37 [concrete = constants.%MaybeUnformed.67f] { -// CHECK:STDOUT: %Core.ref.loc41_17: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %MaybeUnformed.ref.loc41_21: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] -// CHECK:STDOUT: %X.ref.loc41_36: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %MaybeUnformed.loc41_37: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.67f] +// CHECK:STDOUT: %Core.ref.loc33_50: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %MaybeUnformed.ref.loc33_54: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] +// CHECK:STDOUT: %X.ref.loc33_69: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %MaybeUnformed.loc33_70: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.67f] +// CHECK:STDOUT: %.loc33_47: %MaybeUnformed.67f = converted %value.ref, [concrete = ] +// CHECK:STDOUT: %.loc33_37: type = splice_block %MaybeUnformed.loc33_37 [concrete = constants.%MaybeUnformed.67f] { +// CHECK:STDOUT: %Core.ref.loc33_17: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %MaybeUnformed.ref.loc33_21: %MaybeUnformed.type = name_ref MaybeUnformed, imports.%Core.MaybeUnformed [concrete = constants.%MaybeUnformed.generic] +// CHECK:STDOUT: %X.ref.loc33_36: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %MaybeUnformed.loc33_37: type = class_type @MaybeUnformed, @MaybeUnformed(constants.%X) [concrete = constants.%MaybeUnformed.67f] // CHECK:STDOUT: } // CHECK:STDOUT: %v: %MaybeUnformed.67f = wrapper_binding v, [concrete = ] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %v.patt: %pattern_type.55d = value_binding_pattern v [concrete = constants.%v.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.facet.loc26_3.1: %Destroy.type = facet_value constants.%MaybeUnformed.67f, (constants.%DestroyImpl.impl_witness.8e6, constants.%custom_witness.b80ef6.4) [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %.loc26_3.1: %Destroy.type = converted constants.%MaybeUnformed.67f, %Destroy.facet.loc26_3.1 [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %Destroy.facet.loc26_3.2: %Destroy.type = facet_value constants.%MaybeUnformed.67f, (constants.%DestroyImpl.impl_witness.8e6, constants.%custom_witness.b80ef6.4) [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %.loc26_3.2: %Destroy.type = converted constants.%MaybeUnformed.67f, %Destroy.facet.loc26_3.2 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %Destroy.facet.loc22_3.1: %Destroy.type = facet_value constants.%MaybeUnformed.67f, (constants.%DestroyImpl.impl_witness.8e6, constants.%custom_witness.b80ef6.4) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc22_3.1: %Destroy.type = converted constants.%MaybeUnformed.67f, %Destroy.facet.loc22_3.1 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %Destroy.facet.loc22_3.2: %Destroy.type = facet_value constants.%MaybeUnformed.67f, (constants.%DestroyImpl.impl_witness.8e6, constants.%custom_witness.b80ef6.4) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc22_3.2: %Destroy.type = converted constants.%MaybeUnformed.67f, %Destroy.facet.loc22_3.2 [concrete = constants.%Destroy.facet] // CHECK:STDOUT: // CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%i.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc26_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc22_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc26_3.2(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc22_3.2(%self.param: ref %X) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc26_3.3(%self.param: ref %.f01) { +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc22_3.3(%self.param: ref %.f01) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc26_3.4(%self.param: ref %MaybeUnformed.67f) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc22_3.4(%self.param: ref %MaybeUnformed.67f) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/as/partial.carbon b/toolchain/check/testdata/as/partial.carbon index 71a1c664b099..4f60f7bd8fda 100644 --- a/toolchain/check/testdata/as/partial.carbon +++ b/toolchain/check/testdata/as/partial.carbon @@ -60,39 +60,30 @@ var reference: partial X; let ptr: partial X* = &reference; fn Use() { - // CHECK:STDERR: ╭─┤ fail_cannot_remove_partial.carbon:[[@LINE+11]]:21 + // CHECK:STDERR: ╭─┤ fail_cannot_remove_partial.carbon:[[@LINE+8]]:21 // CHECK:STDERR: -> │ let unused v: X = value as X; // CHECK:STDERR: · ┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `partial X` to - // CHECK:STDERR: · │ ┃ `X` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `partial X` does not implement interface - // CHECK:STDERR: · │ `Core.As(X)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `X` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused v: X = value as X; - // CHECK:STDERR: ╭─┤ fail_cannot_remove_partial.carbon:[[@LINE+11]]:24 + // CHECK:STDERR: ╭─┤ fail_cannot_remove_partial.carbon:[[@LINE+8]]:24 // CHECK:STDERR: -> │ let unused a: X* = &(reference as X); // CHECK:STDERR: · ┳━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `partial X` - // CHECK:STDERR: · │ ┃ to `X` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `partial X` does not implement interface - // CHECK:STDERR: · │ `Core.As(X)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `X` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused a: X* = &(reference as X); - // CHECK:STDERR: ╭─┤ fail_cannot_remove_partial.carbon:[[@LINE+11]]:22 + // CHECK:STDERR: ╭─┤ fail_cannot_remove_partial.carbon:[[@LINE+8]]:22 // CHECK:STDERR: -> │ let unused b: X* = ptr as X*; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `partial X*` - // CHECK:STDERR: · │ ┃ to `X*` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `partial X*` does not implement interface - // CHECK:STDERR: · │ `Core.As(X*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `X*` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused b: X* = ptr as X*; diff --git a/toolchain/check/testdata/as/unsafe_as.carbon b/toolchain/check/testdata/as/unsafe_as.carbon index b4bf5262b974..d5660e700971 100644 --- a/toolchain/check/testdata/as/unsafe_as.carbon +++ b/toolchain/check/testdata/as/unsafe_as.carbon @@ -18,14 +18,12 @@ class A {}; class B {}; fn Convert(a: A) -> B { - // CHECK:STDERR: ╭─┤ fail_no_conversion.carbon:[[@LINE+10]]:10 + // CHECK:STDERR: ╭─┤ fail_no_conversion.carbon:[[@LINE+8]]:10 // CHECK:STDERR: -> │ return a unsafe as B; // CHECK:STDERR: · ┳━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `A` to `B` with - // CHECK:STDERR: · │ ┃ `unsafe as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `A` does not implement interface `Core.UnsafeAs(B)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `unsafe as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return a unsafe as B; diff --git a/toolchain/check/testdata/builtins/char_literal/add.carbon b/toolchain/check/testdata/builtins/char_literal/add.carbon index c8843ebfe64e..50c4858312b0 100644 --- a/toolchain/check/testdata/builtins/char_literal/add.carbon +++ b/toolchain/check/testdata/builtins/char_literal/add.carbon @@ -53,8 +53,8 @@ let a: CharLiteral = AddCharInt('a', 0x10000000000000); // CHECK:STDERR: ╭─┤ fail_overflow.carbon:[[@LINE+19]]:5 // CHECK:STDERR: │ let a: CharLiteral = AddCharInt('a', 0x10000000000000); -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let a: CharLiteral = AddCharInt('\u{10FFFF}', 1); // CHECK:STDERR: · ┳ diff --git a/toolchain/check/testdata/builtins/char_literal/convert_char.carbon b/toolchain/check/testdata/builtins/char_literal/convert_char.carbon index d904bd7e03ce..442259a47c65 100644 --- a/toolchain/check/testdata/builtins/char_literal/convert_char.carbon +++ b/toolchain/check/testdata/builtins/char_literal/convert_char.carbon @@ -59,7 +59,7 @@ library "[[@TEST_NAME]]"; import library "builtin"; let c: CharLiteral = 'a'; -// CHECK:STDERR: ╭─┤ fail_runtime_call.carbon:[[@LINE+13]]:18 +// CHECK:STDERR: ╭─┤ fail_runtime_call.carbon:[[@LINE+12]]:18 // CHECK:STDERR: -> │ let d: UInt(8) = ToChar(c); // CHECK:STDERR: · ━━━━┳━━━━ // CHECK:STDERR: · ┗━━┫ error: non-constant call to compile-time-only function @@ -67,9 +67,8 @@ let c: CharLiteral = 'a'; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ builtin.carbon // CHECK:STDERR: │ fn ToChar(c: CharLiteral) -> UInt(8) = "char_literal.convert_char"; -// CHECK:STDERR: · ───────────────────┬────────────────── -// CHECK:STDERR: · ╰──┤ compile-time-only function declared here -// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] +// CHECK:STDERR: · ───┬── +// CHECK:STDERR: · ╰──┤ compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: let d: UInt(8) = ToChar(c); diff --git a/toolchain/check/testdata/builtins/char_literal/convert_int.carbon b/toolchain/check/testdata/builtins/char_literal/convert_int.carbon index 35be9a4330f8..4a7978232b22 100644 --- a/toolchain/check/testdata/builtins/char_literal/convert_int.carbon +++ b/toolchain/check/testdata/builtins/char_literal/convert_int.carbon @@ -45,22 +45,19 @@ fn UInt(n: IntLiteral) -> type = "int.make_type_unsigned"; fn ConvertToU8(c: CharLiteral) -> UInt(8) = "char_literal.convert_int"; -// CHECK:STDERR: ╭─┤ fail_overflow.carbon:[[@LINE+18]]:13 +// CHECK:STDERR: ╭─┤ fail_overflow.carbon:[[@LINE+15]]:13 // CHECK:STDERR: -> │ let g: u8 = ConvertToU8('\u{100}'); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: character value U+0100 too large for type `` // CHECK:STDERR: · ┃ [CharTooLargeForType] // CHECK:STDERR: ╰──── // CHECK:STDERR: -// CHECK:STDERR: ╭─┤ fail_overflow.carbon:[[@LINE+11]]:13 +// CHECK:STDERR: ╭─┤ fail_overflow.carbon:[[@LINE+8]]:13 // CHECK:STDERR: -> │ let g: u8 = ConvertToU8('\u{100}'); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type -// CHECK:STDERR: · │ ┃ `` to `u8` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(u8)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `` to `u8` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let g: u8 = ConvertToU8('\u{100}'); diff --git a/toolchain/check/testdata/builtins/cpp/std/initializer_list/make.carbon b/toolchain/check/testdata/builtins/cpp/std/initializer_list/make.carbon index 2c440f1d6240..aa50876497b6 100644 --- a/toolchain/check/testdata/builtins/cpp/std/initializer_list/make.carbon +++ b/toolchain/check/testdata/builtins/cpp/std/initializer_list/make.carbon @@ -60,8 +60,8 @@ class FailIncomplete; // CHECK:STDERR: ╭─┤ fail_incomplete.carbon:[[@LINE+19]]:17 // CHECK:STDERR: │ class FailIncomplete; -// CHECK:STDERR: · ──────────┬────────── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: · ───────┬────── +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn Make(n: i32) -> FailIncomplete = "cpp.std.initializer_list.make"; // CHECK:STDERR: · ━━━┳━━━━━━━━━━━━━ diff --git a/toolchain/check/testdata/builtins/float/convert_checked.carbon b/toolchain/check/testdata/builtins/float/convert_checked.carbon index bd045463ec71..a7d0305d4731 100644 --- a/toolchain/check/testdata/builtins/float/convert_checked.carbon +++ b/toolchain/check/testdata/builtins/float/convert_checked.carbon @@ -163,9 +163,9 @@ let not_constant_64: f64 = 0.0; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ f64.carbon // CHECK:STDERR: │ fn Float64ToFloat64(a: f64) -> f64 = "float.convert_checked"; -// CHECK:STDERR: · ──────────────────┬───────────────── -// CHECK:STDERR: · ╰──┤ compile-time-only function declared here -// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] +// CHECK:STDERR: · ────────┬─────── +// CHECK:STDERR: · ╰──┤ compile-time-only function declared here +// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: let convert_not_constant: f64 = Float64ToFloat64(not_constant_64); diff --git a/toolchain/check/testdata/builtins/int/and.carbon b/toolchain/check/testdata/builtins/int/and.carbon index 16044827c271..ccb7d02b32cf 100644 --- a/toolchain/check/testdata/builtins/int/and.carbon +++ b/toolchain/check/testdata/builtins/int/and.carbon @@ -52,11 +52,10 @@ library "[[@TEST_NAME]]"; fn AndLit(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.and"; fn F(a: Core.IntLiteral) -> Core.IntLiteral { - // CHECK:STDERR: ╭─┤ fail_literal_runtime.carbon:[[@LINE+12]]:10 + // CHECK:STDERR: ╭─┤ fail_literal_runtime.carbon:[[@LINE+11]]:10 // CHECK:STDERR: │ fn AndLit(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "in... - // CHECK:STDERR: · ───────────────────────────────────┬────────────────────────────────── - // CHECK:STDERR: · ╰──┤ compile-time-only function declared here - // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return AndLit(5, a); // CHECK:STDERR: · ━━━━━━┳━━━━━ @@ -114,11 +113,10 @@ fn And(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.and"; fn Test(n: Core.IntLiteral) { // OK And(1, 1); - // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+12]]:3 + // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn And(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.and"; - // CHECK:STDERR: · ─────────────────────────────────┬───────────────────────────────── - // CHECK:STDERR: · ╰──┤ compile-time-only function declared here - // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] + // CHECK:STDERR: · ─┬─ + // CHECK:STDERR: · ╰──┤ compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ And(n, 1); // CHECK:STDERR: · ━━━━┳━━━━ @@ -127,11 +125,10 @@ fn Test(n: Core.IntLiteral) { // CHECK:STDERR: ╰──── // CHECK:STDERR: And(n, 1); - // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+12]]:3 + // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn And(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.and"; - // CHECK:STDERR: · ─────────────────────────────────┬───────────────────────────────── - // CHECK:STDERR: · ╰──┤ compile-time-only function declared here - // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] + // CHECK:STDERR: · ─┬─ + // CHECK:STDERR: · ╰──┤ compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ And(1, n); // CHECK:STDERR: · ━━━━┳━━━━ @@ -140,11 +137,10 @@ fn Test(n: Core.IntLiteral) { // CHECK:STDERR: ╰──── // CHECK:STDERR: And(1, n); - // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+12]]:3 + // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn And(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.and"; - // CHECK:STDERR: · ─────────────────────────────────┬───────────────────────────────── - // CHECK:STDERR: · ╰──┤ compile-time-only function declared here - // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] + // CHECK:STDERR: · ─┬─ + // CHECK:STDERR: · ╰──┤ compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ And(n, n); // CHECK:STDERR: · ━━━━┳━━━━ diff --git a/toolchain/check/testdata/builtins/int/complement.carbon b/toolchain/check/testdata/builtins/int/complement.carbon index b8126d24ef5c..118135d29ae0 100644 --- a/toolchain/check/testdata/builtins/int/complement.carbon +++ b/toolchain/check/testdata/builtins/int/complement.carbon @@ -52,11 +52,10 @@ library "[[@TEST_NAME]]"; fn Complement(a: Core.IntLiteral) -> Core.IntLiteral = "int.complement"; fn F(a: Core.IntLiteral) -> Core.IntLiteral { - // CHECK:STDERR: ╭─┤ fail_literal_runtime.carbon:[[@LINE+12]]:10 + // CHECK:STDERR: ╭─┤ fail_literal_runtime.carbon:[[@LINE+11]]:10 // CHECK:STDERR: │ fn Complement(a: Core.IntLiteral) -> Core.IntLiteral = "int.complement"; - // CHECK:STDERR: · ───────────────────────────┬────────────────────────── - // CHECK:STDERR: · ╰──┤ compile-time-only function declared here - // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] + // CHECK:STDERR: · ─────┬──── + // CHECK:STDERR: · ╰──┤ compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return Complement(a); // CHECK:STDERR: · ━━━━━━┳━━━━━━ diff --git a/toolchain/check/testdata/builtins/int/convert.carbon b/toolchain/check/testdata/builtins/int/convert.carbon index caba918ea1e9..8e4833cfdfa3 100644 --- a/toolchain/check/testdata/builtins/int/convert.carbon +++ b/toolchain/check/testdata/builtins/int/convert.carbon @@ -76,14 +76,12 @@ import library "int_ops"; fn F() { // Ensure our testing machinery works. - // CHECK:STDERR: ╭─┤ fail_self_test.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_self_test.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ Test(Int32ToInt32(0)) as Expect(1 as i32); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `Expect(0)` to `Expect(1)` with - // CHECK:STDERR: · │ ┃ `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Expect(0)` does not implement interface `Core.As(Expect(1))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: Test(Int32ToInt32(0)) as Expect(1 as i32); @@ -257,9 +255,9 @@ let not_constant: Core.IntLiteral = 0; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ int_ops.carbon // CHECK:STDERR: │ fn IntLiteralToInt16(a: Core.IntLiteral) -> i16 = "int.convert"; -// CHECK:STDERR: · ────────────────────────┬──────────────────────── -// CHECK:STDERR: · ╰──┤ compile-time-only function declared here -// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] +// CHECK:STDERR: · ────────┬──────── +// CHECK:STDERR: · ╰──┤ compile-time-only function declared here +// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: let convert_not_constant: i16 = IntLiteralToInt16(not_constant); diff --git a/toolchain/check/testdata/builtins/int/convert_checked.carbon b/toolchain/check/testdata/builtins/int/convert_checked.carbon index 531c6c29ac7a..41db93b820a8 100644 --- a/toolchain/check/testdata/builtins/int/convert_checked.carbon +++ b/toolchain/check/testdata/builtins/int/convert_checked.carbon @@ -273,9 +273,9 @@ let not_constant: i32 = 0; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ int_ops.carbon // CHECK:STDERR: │ fn Int32ToInt16(a: i32) -> i16 = "int.convert_checked"; -// CHECK:STDERR: · ────────────────┬─────────────── -// CHECK:STDERR: · ╰──┤ compile-time-only function declared here -// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] +// CHECK:STDERR: · ──────┬───── +// CHECK:STDERR: · ╰──┤ compile-time-only function declared here +// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: let convert_not_constant_narrow: i16 = Int32ToInt16(not_constant); @@ -289,9 +289,9 @@ let convert_not_constant_narrow: i16 = Int32ToInt16(not_constant); // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ int_ops.carbon // CHECK:STDERR: │ fn Int32ToInt32(a: i32) -> i32 = "int.convert_checked"; -// CHECK:STDERR: · ────────────────┬─────────────── -// CHECK:STDERR: · ╰──┤ compile-time-only function declared here -// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] +// CHECK:STDERR: · ──────┬───── +// CHECK:STDERR: · ╰──┤ compile-time-only function declared here +// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: let convert_not_constant_same: i32 = Int32ToInt32(not_constant); @@ -305,9 +305,9 @@ let convert_not_constant_same: i32 = Int32ToInt32(not_constant); // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ int_ops.carbon // CHECK:STDERR: │ fn Int32ToInt64(a: i32) -> i64 = "int.convert_checked"; -// CHECK:STDERR: · ────────────────┬─────────────── -// CHECK:STDERR: · ╰──┤ compile-time-only function declared here -// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] +// CHECK:STDERR: · ──────┬───── +// CHECK:STDERR: · ╰──┤ compile-time-only function declared here +// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); diff --git a/toolchain/check/testdata/builtins/int/eq.carbon b/toolchain/check/testdata/builtins/int/eq.carbon index 019ff59f0297..d1bb56ceb959 100644 --- a/toolchain/check/testdata/builtins/int/eq.carbon +++ b/toolchain/check/testdata/builtins/int/eq.carbon @@ -84,11 +84,10 @@ fn Eq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.eq"; fn Test(n: Core.IntLiteral) { // OK Eq(1, 1); - // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+12]]:3 + // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn Eq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.eq"; - // CHECK:STDERR: · ───────────────────────────┬─────────────────────────── - // CHECK:STDERR: · ╰──┤ compile-time-only function declared here - // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] + // CHECK:STDERR: · ─┬ + // CHECK:STDERR: · ╰──┤ compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Eq(n, 1); // CHECK:STDERR: · ━━━━┳━━━ @@ -97,11 +96,10 @@ fn Test(n: Core.IntLiteral) { // CHECK:STDERR: ╰──── // CHECK:STDERR: Eq(n, 1); - // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+12]]:3 + // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn Eq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.eq"; - // CHECK:STDERR: · ───────────────────────────┬─────────────────────────── - // CHECK:STDERR: · ╰──┤ compile-time-only function declared here - // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] + // CHECK:STDERR: · ─┬ + // CHECK:STDERR: · ╰──┤ compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Eq(1, n); // CHECK:STDERR: · ━━━━┳━━━ @@ -110,11 +108,10 @@ fn Test(n: Core.IntLiteral) { // CHECK:STDERR: ╰──── // CHECK:STDERR: Eq(1, n); - // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+12]]:3 + // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn Eq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.eq"; - // CHECK:STDERR: · ───────────────────────────┬─────────────────────────── - // CHECK:STDERR: · ╰──┤ compile-time-only function declared here - // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] + // CHECK:STDERR: · ─┬ + // CHECK:STDERR: · ╰──┤ compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Eq(n, n); // CHECK:STDERR: · ━━━━┳━━━ diff --git a/toolchain/check/testdata/builtins/int/fail_convert_oversized_type.carbon b/toolchain/check/testdata/builtins/int/fail_convert_oversized_type.carbon index 049aa210c3e3..238b8004f755 100644 --- a/toolchain/check/testdata/builtins/int/fail_convert_oversized_type.carbon +++ b/toolchain/check/testdata/builtins/int/fail_convert_oversized_type.carbon @@ -17,7 +17,7 @@ library "[[@TEST_NAME]]"; // Initializing a binding whose type is an invalid integer type must not crash // constant evaluation (#7278). The type is diagnosed; the conversion of the // initializer should then produce an error value, not a CHECK failure. -// CHECK:STDERR: ╭─┤ fail_width_not_multiple_of_8.carbon:[[@LINE+23]]:10 +// CHECK:STDERR: ╭─┤ fail_width_not_multiple_of_8.carbon:[[@LINE+52]]:10 // CHECK:STDERR: -> │ let bad: i8388609 = 0; // CHECK:STDERR: · ┳━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: bit width of integer type literal must be a multiple of 8; @@ -25,19 +25,48 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: · ┃ [IntWidthNotMultipleOf8] // CHECK:STDERR: ╰──── // CHECK:STDERR: -// CHECK:STDERR: ╭─┤ fail_width_not_multiple_of_8.carbon:[[@LINE+15]]:10 -// CHECK:STDERR: -> │ let bad: i8388609 = 0; -// CHECK:STDERR: · ┳━━━━━━━ -// CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type `i8388609` in name -// CHECK:STDERR: · ┃ binding declaration -// CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] +// CHECK:STDERR: ╭─┤ {{.*}}/prelude/types/int.carbon:18:9 +// CHECK:STDERR: -> │ adapt MakeInt(N); +// CHECK:STDERR: · ┳━━━━━━━━━ +// CHECK:STDERR: · ┗━━┫ error: integer type width of 8388609 is greater than the maximum +// CHECK:STDERR: · ┃ supported width of 8388608 +// CHECK:STDERR: · ┃ [IntWidthTooLarge] // CHECK:STDERR: ┆ -// CHECK:STDERR: ├─┤ {{.*}}/prelude/types/int.carbon -// CHECK:STDERR: │ adapt MakeInt(N); -// CHECK:STDERR: · ┬───────── -// CHECK:STDERR: · ╰──┤ integer type width of 8388609 is greater than the maximum supported -// CHECK:STDERR: · │ width of 8388608 -// CHECK:STDERR: · │ [IntWidthTooLarge] +// CHECK:STDERR: ├─┤ fail_width_not_multiple_of_8.carbon +// CHECK:STDERR: │ let bad: i8388609 = 0; +// CHECK:STDERR: · ────┬─── +// CHECK:STDERR: · ╰──┤ in monomorphization of `i8388609` here [ResolvingSpecificHere] +// CHECK:STDERR: · ╰────┤ in completion of type `i8388609` here [InTypeCompletion] +// CHECK:STDERR: ╰──── +// CHECK:STDERR: +// CHECK:STDERR: ╭─┤ {{.*}}/prelude/types/int.carbon:18:9 +// CHECK:STDERR: -> │ adapt MakeInt(N); +// CHECK:STDERR: · ┳━━━━━━━━━ +// CHECK:STDERR: · ┗━━┫ error: integer type width of 16777216 is greater than the maximum +// CHECK:STDERR: · ┃ supported width of 8388608 +// CHECK:STDERR: · ┃ [IntWidthTooLarge] +// CHECK:STDERR: ┆ +// CHECK:STDERR: ├─┤ fail_width_too_large.carbon +// CHECK:STDERR: │ let bad: i16777216 = 0; +// CHECK:STDERR: · ────┬──── +// CHECK:STDERR: · ╰──┤ in monomorphization of `i16777216` here +// CHECK:STDERR: · │ │ [ResolvingSpecificHere] +// CHECK:STDERR: · ╰────┤ in completion of type `i16777216` here [InTypeCompletion] +// CHECK:STDERR: ╰──── +// CHECK:STDERR: +// CHECK:STDERR: ╭─┤ {{.*}}/prelude/types/int.carbon:18:9 +// CHECK:STDERR: -> │ adapt MakeInt(N); +// CHECK:STDERR: · ┳━━━━━━━━━ +// CHECK:STDERR: · ┗━━┫ error: integer type width of 8388609 is greater than the maximum +// CHECK:STDERR: · ┃ supported width of 8388608 +// CHECK:STDERR: · ┃ [IntWidthTooLarge] +// CHECK:STDERR: ┆ +// CHECK:STDERR: ├─┤ fail_width_too_large_core_int.carbon +// CHECK:STDERR: │ let bad: Core.Int(8388609) = 0; +// CHECK:STDERR: · ────────┬──────── +// CHECK:STDERR: · ╰──┤ in monomorphization of `i8388609` here +// CHECK:STDERR: · │ │ [ResolvingSpecificHere] +// CHECK:STDERR: · ╰────┤ in completion of type `i8388609` here [InTypeCompletion] // CHECK:STDERR: ╰──── // CHECK:STDERR: let bad: i8388609 = 0; @@ -46,40 +75,10 @@ let bad: i8388609 = 0; library "[[@TEST_NAME]]"; -// CHECK:STDERR: ╭─┤ fail_width_too_large.carbon:[[@LINE+15]]:10 -// CHECK:STDERR: -> │ let bad: i16777216 = 0; -// CHECK:STDERR: · ┳━━━━━━━━ -// CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type `i16777216` in name -// CHECK:STDERR: · ┃ binding declaration -// CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] -// CHECK:STDERR: ┆ -// CHECK:STDERR: ├─┤ {{.*}}/prelude/types/int.carbon -// CHECK:STDERR: │ adapt MakeInt(N); -// CHECK:STDERR: · ┬───────── -// CHECK:STDERR: · ╰──┤ integer type width of 16777216 is greater than the maximum -// CHECK:STDERR: · │ supported width of 8388608 -// CHECK:STDERR: · │ [IntWidthTooLarge] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: let bad: i16777216 = 0; // --- fail_width_too_large_core_int.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: ╭─┤ fail_width_too_large_core_int.carbon:[[@LINE+15]]:10 -// CHECK:STDERR: -> │ let bad: Core.Int(8388609) = 0; -// CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ -// CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type `i8388609` in name -// CHECK:STDERR: · ┃ binding declaration -// CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] -// CHECK:STDERR: ┆ -// CHECK:STDERR: ├─┤ {{.*}}/prelude/types/int.carbon -// CHECK:STDERR: │ adapt MakeInt(N); -// CHECK:STDERR: · ┬───────── -// CHECK:STDERR: · ╰──┤ integer type width of 8388609 is greater than the maximum supported -// CHECK:STDERR: · │ width of 8388608 -// CHECK:STDERR: · │ [IntWidthTooLarge] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: let bad: Core.Int(8388609) = 0; diff --git a/toolchain/check/testdata/builtins/int/left_shift.carbon b/toolchain/check/testdata/builtins/int/left_shift.carbon index cf5638ee90a6..9fcbf2f6b6b1 100644 --- a/toolchain/check/testdata/builtins/int/left_shift.carbon +++ b/toolchain/check/testdata/builtins/int/left_shift.carbon @@ -230,9 +230,9 @@ var an_i32: i32 = 34; // This can't be valid: we don't have a compile-time or runtime integer value for `a_lit`. // CHECK:STDERR: ╭─┤ fail_comp_time_only_shift.carbon:[[@LINE+12]]:17 // CHECK:STDERR: │ fn LeftShiftByLit(a: i32, b: Core.IntLiteral) -> i32 = "int.left_shift"; -// CHECK:STDERR: · ───────────────────────────┬────────────────────────── -// CHECK:STDERR: · ╰──┤ compile-time-only function declared here -// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] +// CHECK:STDERR: · ───────┬────── +// CHECK:STDERR: · ╰──┤ compile-time-only function declared here +// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let bad1: i32 = LeftShiftByLit(an_i32, a_lit); // CHECK:STDERR: · ━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━ @@ -245,9 +245,9 @@ let bad1: i32 = LeftShiftByLit(an_i32, a_lit); // TODO: This could be valid because we don't actually need the return value at runtime. // CHECK:STDERR: ╭─┤ fail_comp_time_only_shift.carbon:[[@LINE+13]]:29 // CHECK:STDERR: │ fn LeftShiftOfLit(a: Core.IntLiteral, b: i32) -> Core.IntLiteral = "int.le... -// CHECK:STDERR: · ─────────────────────────────────┬──────────────────────────────── -// CHECK:STDERR: · ╰──┤ compile-time-only function declared here -// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] +// CHECK:STDERR: · ───────┬────── +// CHECK:STDERR: · ╰──┤ compile-time-only function declared here +// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let bad2: Core.IntLiteral = LeftShiftOfLit(a_lit, an_i32); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -261,9 +261,9 @@ let bad2: Core.IntLiteral = LeftShiftOfLit(a_lit, an_i32); // TODO: This could be valid because the literal argument has a constant value. // CHECK:STDERR: ╭─┤ fail_comp_time_only_shift.carbon:[[@LINE+12]]:17 // CHECK:STDERR: │ fn LeftShiftByLit(a: i32, b: Core.IntLiteral) -> i32 = "int.left_shift"; -// CHECK:STDERR: · ───────────────────────────┬────────────────────────── -// CHECK:STDERR: · ╰──┤ compile-time-only function declared here -// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] +// CHECK:STDERR: · ───────┬────── +// CHECK:STDERR: · ╰──┤ compile-time-only function declared here +// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let bad3: i32 = LeftShiftByLit(an_i32, 12); // CHECK:STDERR: · ━━━━━┳━━━━━━━━━━━━━━━━━━━━ @@ -276,9 +276,9 @@ let bad3: i32 = LeftShiftByLit(an_i32, 12); // TODO: This could be valid because we don't actually need the return value at runtime. // CHECK:STDERR: ╭─┤ fail_comp_time_only_shift.carbon:[[@LINE+13]]:29 // CHECK:STDERR: │ fn LeftShiftOfLit(a: Core.IntLiteral, b: i32) -> Core.IntLiteral = "int.le... -// CHECK:STDERR: · ─────────────────────────────────┬──────────────────────────────── -// CHECK:STDERR: · ╰──┤ compile-time-only function declared here -// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] +// CHECK:STDERR: · ───────┬────── +// CHECK:STDERR: · ╰──┤ compile-time-only function declared here +// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let bad4: Core.IntLiteral = LeftShiftOfLit(12, an_i32); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/toolchain/check/testdata/builtins/int/less_eq.carbon b/toolchain/check/testdata/builtins/int/less_eq.carbon index c93068cd2c6b..a3e13283c59c 100644 --- a/toolchain/check/testdata/builtins/int/less_eq.carbon +++ b/toolchain/check/testdata/builtins/int/less_eq.carbon @@ -79,11 +79,10 @@ fn LessEq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.less_eq"; fn Test(n: Core.IntLiteral) { // OK LessEq(1, 1); - // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+12]]:3 + // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn LessEq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.less_eq"; - // CHECK:STDERR: · ─────────────────────────────┬───────────────────────────── - // CHECK:STDERR: · ╰──┤ compile-time-only function declared here - // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ LessEq(n, 1); // CHECK:STDERR: · ━━━━━━┳━━━━━ @@ -92,11 +91,10 @@ fn Test(n: Core.IntLiteral) { // CHECK:STDERR: ╰──── // CHECK:STDERR: LessEq(n, 1); - // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+12]]:3 + // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn LessEq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.less_eq"; - // CHECK:STDERR: · ─────────────────────────────┬───────────────────────────── - // CHECK:STDERR: · ╰──┤ compile-time-only function declared here - // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ LessEq(1, n); // CHECK:STDERR: · ━━━━━━┳━━━━━ @@ -105,11 +103,10 @@ fn Test(n: Core.IntLiteral) { // CHECK:STDERR: ╰──── // CHECK:STDERR: LessEq(1, n); - // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+12]]:3 + // CHECK:STDERR: ╭─┤ fail_runtime_literal.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn LessEq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.less_eq"; - // CHECK:STDERR: · ─────────────────────────────┬───────────────────────────── - // CHECK:STDERR: · ╰──┤ compile-time-only function declared here - // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ LessEq(n, n); // CHECK:STDERR: · ━━━━━━┳━━━━━ diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index d7a95c0e62f9..01274faa31bf 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -129,8 +129,8 @@ fn Negate(a: i32) -> i32 = "int.snegate"; // CHECK:STDERR: ╭─┤ fail_bad_call.carbon:[[@LINE+12]]:26 // CHECK:STDERR: │ fn Negate(a: i32) -> i32 = "int.snegate"; -// CHECK:STDERR: · ─────────────┬──────────── -// CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] +// CHECK:STDERR: · ───┬── +// CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ var bad_call: array(i32, Negate(1, 2)); // CHECK:STDERR: · ┳━━━━━━━━━━━ diff --git a/toolchain/check/testdata/builtins/int/uadd.carbon b/toolchain/check/testdata/builtins/int/uadd.carbon index 7d32c1b539c4..9586e71e236a 100644 --- a/toolchain/check/testdata/builtins/int/uadd.carbon +++ b/toolchain/check/testdata/builtins/int/uadd.carbon @@ -111,8 +111,8 @@ fn Add(a: i32, b: i32) -> i32 = "int.uadd"; // CHECK:STDERR: ╭─┤ fail_bad_call.carbon:[[@LINE+12]]:26 // CHECK:STDERR: │ fn Add(a: i32, b: i32) -> i32 = "int.uadd"; -// CHECK:STDERR: · ───────────────┬─────────────── -// CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] +// CHECK:STDERR: · ─┬─ +// CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ var bad_call: array(i32, Add(1, 2, 3)); // CHECK:STDERR: · ┳━━━━━━━━━━━ diff --git a/toolchain/check/testdata/builtins/int/unegate.carbon b/toolchain/check/testdata/builtins/int/unegate.carbon index 78c8c18dd817..4bb18434ae21 100644 --- a/toolchain/check/testdata/builtins/int/unegate.carbon +++ b/toolchain/check/testdata/builtins/int/unegate.carbon @@ -113,8 +113,8 @@ fn Negate(a: u32) -> u32 = "int.unegate"; // CHECK:STDERR: ╭─┤ fail_bad_call.carbon:[[@LINE+12]]:26 // CHECK:STDERR: │ fn Negate(a: u32) -> u32 = "int.unegate"; -// CHECK:STDERR: · ─────────────┬──────────── -// CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] +// CHECK:STDERR: · ───┬── +// CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ var bad_call: array(u32, Negate(1, 2)); // CHECK:STDERR: · ┳━━━━━━━━━━━ diff --git a/toolchain/check/testdata/class/abstract/abstract.carbon b/toolchain/check/testdata/class/abstract/abstract.carbon index f9724e3941c5..d13f21e515dc 100644 --- a/toolchain/check/testdata/class/abstract/abstract.carbon +++ b/toolchain/check/testdata/class/abstract/abstract.carbon @@ -95,15 +95,15 @@ abstract class Abstract { class Adapter { // TODO(#4387): This should probably be valid - // CHECK:STDERR: ╭─┤ fail_abstract_adapter.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_abstract_adapter.carbon:[[@LINE+11]]:9 // CHECK:STDERR: │ abstract class Abstract { // CHECK:STDERR: · ────────────┬──────────── // CHECK:STDERR: · ╰──┤ class was declared abstract here [ClassAbstractHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ adapt Abstract; - // CHECK:STDERR: · ━━━━━━━┳━━━━━━━ - // CHECK:STDERR: · ┗━━┫ error: adapted type `Abstract` is an abstract type - // CHECK:STDERR: · ┃ [AbstractTypeInAdaptDecl] + // CHECK:STDERR: · ━━━━┳━━━ + // CHECK:STDERR: · ┗━━┫ error: adapted type `Abstract` is an abstract type + // CHECK:STDERR: · ┃ [AbstractTypeInAdaptDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: adapt Abstract; @@ -209,9 +209,9 @@ fn F() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/destroy.carbon // CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) { - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused l: Abstract = {}; @@ -239,9 +239,9 @@ fn F() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/destroy.carbon // CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) { - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused l: Abstract = {.base = {}} as Derived; @@ -282,12 +282,10 @@ abstract class Abstract { } fn Assign(ref a: Abstract) { - // CHECK:STDERR: ╭─┤ fail_assign_to_abstract_ref.carbon:[[@LINE+8]]:7 + // CHECK:STDERR: ╭─┤ fail_assign_to_abstract_ref.carbon:[[@LINE+6]]:7 // CHECK:STDERR: -> │ a = a; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot copy value of type `Abstract` [CopyOfUncopyableType] - // CHECK:STDERR: · ╰────┤ type `Abstract` does not implement interface `Core.Copy` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ╰──── // CHECK:STDERR: a = a; @@ -1217,10 +1215,10 @@ fn Assign(ref a: Abstract) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Assign(%a.param: ref %Abstract) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref.loc15_3: ref %Abstract = name_ref a, %a -// CHECK:STDOUT: %a.ref.loc15_7: ref %Abstract = name_ref a, %a -// CHECK:STDOUT: %.loc15: %Abstract = acquire_value %a.ref.loc15_7 -// CHECK:STDOUT: assign %a.ref.loc15_3, +// CHECK:STDOUT: %a.ref.loc13_3: ref %Abstract = name_ref a, %a +// CHECK:STDOUT: %a.ref.loc13_7: ref %Abstract = name_ref a, %a +// CHECK:STDOUT: %.loc13: %Abstract = acquire_value %a.ref.loc13_7 +// CHECK:STDOUT: assign %a.ref.loc13_3, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/abstract/fail_abstract_in_struct.carbon b/toolchain/check/testdata/class/abstract/fail_abstract_in_struct.carbon index 3d39d3b28c09..460efe19b765 100644 --- a/toolchain/check/testdata/class/abstract/fail_abstract_in_struct.carbon +++ b/toolchain/check/testdata/class/abstract/fail_abstract_in_struct.carbon @@ -130,14 +130,13 @@ library "[[@TEST_NAME]]"; import library "lib"; -// CHECK:STDERR: ╭─┤ fail_import.carbon:[[@LINE+14]]:9 +// CHECK:STDERR: ╭─┤ fail_import.carbon:[[@LINE+13]]:9 // CHECK:STDERR: -> │ var v5: {.m: Abstract}; // CHECK:STDERR: · ┳━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: binding pattern has abstract type `{.m: Abstract}` in `var` // CHECK:STDERR: · ┃ pattern // CHECK:STDERR: · ┃ [AbstractTypeInVarPattern] // CHECK:STDERR: ┆ -// CHECK:STDERR: │ ╭── imported from: fail_import.carbon [InImport] // CHECK:STDERR: ├─┤ lib.carbon // CHECK:STDERR: │ abstract class Abstract {} // CHECK:STDERR: · ────────────┬──────────── @@ -481,7 +480,7 @@ var v5: {.m: Abstract}; // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %v5.var: ref = var_storage %v5.var_patt [concrete = ] -// CHECK:STDOUT: %.loc19: type = splice_block %struct_type.m [concrete = constants.%struct_type.m.b92] { +// CHECK:STDOUT: %.loc18: type = splice_block %struct_type.m [concrete = constants.%struct_type.m.b92] { // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, imports.%Main.Abstract [concrete = constants.%Abstract] // CHECK:STDOUT: %struct_type.m: type = struct_type {.m: %Abstract} [concrete = constants.%struct_type.m.b92] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/abstract/fail_abstract_in_tuple.carbon b/toolchain/check/testdata/class/abstract/fail_abstract_in_tuple.carbon index 7f53697033a0..3ffd741abce1 100644 --- a/toolchain/check/testdata/class/abstract/fail_abstract_in_tuple.carbon +++ b/toolchain/check/testdata/class/abstract/fail_abstract_in_tuple.carbon @@ -139,14 +139,13 @@ library "[[@TEST_NAME]]"; import library "lib"; fn Var5() { - // CHECK:STDERR: ╭─┤ fail_import.carbon:[[@LINE+14]]:18 + // CHECK:STDERR: ╭─┤ fail_import.carbon:[[@LINE+13]]:18 // CHECK:STDERR: -> │ var unused v5: (Abstract,); // CHECK:STDERR: · ┳━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: binding pattern has abstract type `(Abstract,)` in // CHECK:STDERR: · ┃ `var` pattern // CHECK:STDERR: · ┃ [AbstractTypeInVarPattern] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── imported from: fail_import.carbon [InImport] // CHECK:STDERR: ├─┤ lib.carbon // CHECK:STDERR: │ abstract class Abstract {} // CHECK:STDERR: · ────────────┬──────────── @@ -625,10 +624,10 @@ fn Var5() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %v5.var: ref = var_storage %v5.var_patt [concrete = ] // CHECK:STDOUT: assign %v5.var, -// CHECK:STDOUT: %.loc20_28.1: type = splice_block %.loc20_28.3 [concrete = constants.%tuple.type.763] { +// CHECK:STDOUT: %.loc19_28.1: type = splice_block %.loc19_28.3 [concrete = constants.%tuple.type.763] { // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, imports.%Main.Abstract [concrete = constants.%Abstract] -// CHECK:STDOUT: %.loc20_28.2: %tuple.type.135 = tuple_literal (%Abstract.ref) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc20_28.3: type = converted %.loc20_28.2, constants.%tuple.type.763 [concrete = constants.%tuple.type.763] +// CHECK:STDOUT: %.loc19_28.2: %tuple.type.135 = tuple_literal (%Abstract.ref) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc19_28.3: type = converted %.loc19_28.2, constants.%tuple.type.763 [concrete = constants.%tuple.type.763] // CHECK:STDOUT: } // CHECK:STDOUT: %v5: = wrapper_binding v5, [concrete = ] // CHECK:STDOUT: name_binding_decl { diff --git a/toolchain/check/testdata/class/access/access_modifiers.carbon b/toolchain/check/testdata/class/access/access_modifiers.carbon index c947ee9eb033..182ca5142c39 100644 --- a/toolchain/check/testdata/class/access/access_modifiers.carbon +++ b/toolchain/check/testdata/class/access/access_modifiers.carbon @@ -33,8 +33,8 @@ fn Run() { let circle: Circle = Circle.Make(); // CHECK:STDERR: ╭─┤ fail_private_field_access.carbon:[[@LINE+12]]:28 // CHECK:STDERR: │ private var radius: i32; - // CHECK:STDERR: · ─────┬───── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let unused radius: i32 = circle.radius; // CHECK:STDERR: · ┳━━━━━━━━━━━━ @@ -46,8 +46,8 @@ fn Run() { let unused radius: i32 = circle.radius; // CHECK:STDERR: ╭─┤ fail_private_field_access.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ private var radius: i32; - // CHECK:STDERR: · ─────┬───── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ circle.radius = 5; // CHECK:STDERR: · ━━━━━━┳━━━━━━ @@ -58,8 +58,8 @@ fn Run() { circle.radius = 5; // CHECK:STDERR: ╭─┤ fail_private_field_access.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ private let SOME_INTERNAL_CONSTANT: i32 = 5; - // CHECK:STDERR: · ─────────────┬───────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────────┬────────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ circle.SOME_INTERNAL_CONSTANT; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -72,7 +72,7 @@ fn Run() { // CHECK:STDERR: ╭─┤ fail_private_field_access.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ private fn SomeInternalFunction() -> i32 { - // CHECK:STDERR: · ─────────────────────┬──────────────────── + // CHECK:STDERR: · ──────────┬───────── // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ circle.SomeInternalFunction(); @@ -97,8 +97,8 @@ fn Run() { //@dump-sem-ir-begin // CHECK:STDERR: ╭─┤ fail_protected_field_access.carbon:[[@LINE+11]]:23 // CHECK:STDERR: │ protected var x: i32; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let unused x: i32 = A.x; // CHECK:STDERR: · ┳━━ @@ -182,8 +182,8 @@ class A { //@dump-sem-ir-begin // CHECK:STDERR: ╭─┤ fail_global_access.carbon:[[@LINE+11]]:14 // CHECK:STDERR: │ protected let x: i32 = 5; -// CHECK:STDERR: · ───┬── -// CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let x: i32 = A.x; // CHECK:STDERR: · ━┳━ @@ -194,8 +194,8 @@ class A { let x: i32 = A.x; // CHECK:STDERR: ╭─┤ fail_global_access.carbon:[[@LINE+11]]:14 // CHECK:STDERR: │ private let y: i32 = 5; -// CHECK:STDERR: · ───┬── -// CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let y: i32 = A.y; // CHECK:STDERR: · ━┳━ diff --git a/toolchain/check/testdata/class/access/friend.carbon b/toolchain/check/testdata/class/access/friend.carbon index f542c242fe5f..2e4ffb95c130 100644 --- a/toolchain/check/testdata/class/access/friend.carbon +++ b/toolchain/check/testdata/class/access/friend.carbon @@ -20,8 +20,8 @@ class C { fn F(c: C) -> i32 { // CHECK:STDERR: ╭─┤ fail_non_friend.carbon:[[@LINE+11]]:10 // CHECK:STDERR: │ private var i: i32; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return c.i; // CHECK:STDERR: · ━┳━ diff --git a/toolchain/check/testdata/class/access/inheritance_access.carbon b/toolchain/check/testdata/class/access/inheritance_access.carbon index 190984711479..f35feb044d04 100644 --- a/toolchain/check/testdata/class/access/inheritance_access.carbon +++ b/toolchain/check/testdata/class/access/inheritance_access.carbon @@ -83,8 +83,8 @@ class Square { fn GetPosition(self) -> i32 { // CHECK:STDERR: ╭─┤ fail_inherited_private_field_access.carbon:[[@LINE+11]]:12 // CHECK:STDERR: │ private var y: i32; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return self.y; // CHECK:STDERR: · ━━━┳━━ @@ -132,8 +132,8 @@ class C { extend base: B; // CHECK:STDERR: ╭─┤ fail_noninstance_private_on_parent_qualified.carbon:[[@LINE+11]]:12 // CHECK:STDERR: │ private fn F() {} - // CHECK:STDERR: · ────────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn G() { Self.F(); } // CHECK:STDERR: · ━━━┳━━ @@ -164,8 +164,8 @@ class C { // CHECK:STDERR: ╭─┤ fail_noninstance_private_on_parent_unqualified.carbon:[[@LINE+12]]:27 // CHECK:STDERR: │ private let SOME_PRIVATE_CONSTANT: i32 = 86; - // CHECK:STDERR: · ─────────────┬──────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────────┬────────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn G1() -> i32 { return SOME_PRIVATE_CONSTANT; } // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━ @@ -178,8 +178,8 @@ class C { // CHECK:STDERR: ╭─┤ fail_noninstance_private_on_parent_unqualified.carbon:[[@LINE+11]]:13 // CHECK:STDERR: │ private fn Fa() {} - // CHECK:STDERR: · ────────┬──────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ─┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn G2() { Fa(); } // CHECK:STDERR: · ━┳ @@ -191,8 +191,8 @@ class C { // CHECK:STDERR: ╭─┤ fail_noninstance_private_on_parent_unqualified.carbon:[[@LINE+11]]:13 // CHECK:STDERR: │ private fn Fb() {} - // CHECK:STDERR: · ────────┬──────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ─┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn G3() { Fb(); } // CHECK:STDERR: · ━┳ @@ -235,8 +235,8 @@ class B { fn G() -> i32 { // CHECK:STDERR: ╭─┤ fail_non_inherited_access.carbon:[[@LINE+11]]:5 // CHECK:STDERR: │ private let SOME_PRIVATE_CONSTANT: i32 = 5; - // CHECK:STDERR: · ─────────────┬──────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────────┬────────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ A.SOME_PRIVATE_CONSTANT; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━ @@ -248,8 +248,8 @@ class B { // CHECK:STDERR: ╭─┤ fail_non_inherited_access.carbon:[[@LINE+12]]:12 // CHECK:STDERR: │ protected let SOME_PROTECTED_CONSTANT: i32 = 5; - // CHECK:STDERR: · ──────────────┬───────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────────┬─────────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return A.SOME_PROTECTED_CONSTANT; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━ @@ -264,8 +264,8 @@ class B { fn SomeFunc(self) -> i32{ // CHECK:STDERR: ╭─┤ fail_non_inherited_access.carbon:[[@LINE+12]]:12 // CHECK:STDERR: │ protected let INTERNAL_CONSTANT: i32 = 5; - // CHECK:STDERR: · ───────────┬────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ────────┬──────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return self.internal.INTERNAL_CONSTANT; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -291,8 +291,8 @@ class B { fn F(self) { // CHECK:STDERR: ╭─┤ fail_compound_member_access.carbon:[[@LINE+11]]:11 // CHECK:STDERR: │ private var x: i32; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ self.(A.x); // CHECK:STDERR: · ━┳━ diff --git a/toolchain/check/testdata/class/access/inheritance_friend_access.carbon b/toolchain/check/testdata/class/access/inheritance_friend_access.carbon index a933cc37ac36..6d338b064bf5 100644 --- a/toolchain/check/testdata/class/access/inheritance_friend_access.carbon +++ b/toolchain/check/testdata/class/access/inheritance_friend_access.carbon @@ -26,8 +26,8 @@ class Derived { fn G() { // CHECK:STDERR: ╭─┤ fail_todo_friend_of_base.carbon:[[@LINE+11]]:5 // CHECK:STDERR: │ private fn F() {} - // CHECK:STDERR: · ────────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Self.F(); // CHECK:STDERR: · ━━━┳━━ @@ -55,8 +55,8 @@ class Derived { fn G() { // CHECK:STDERR: ╭─┤ fail_todo_unqualified_in_friend_of_base.carbon:[[@LINE+11]]:5 // CHECK:STDERR: │ private fn F() {} - // CHECK:STDERR: · ────────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ F(); // CHECK:STDERR: · ┳ @@ -86,8 +86,8 @@ class Friend { fn G(d: Derived) { // CHECK:STDERR: ╭─┤ fail_todo_friend_of_base_via_other_class.carbon:[[@LINE+11]]:5 // CHECK:STDERR: │ private fn F() {} - // CHECK:STDERR: · ────────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ d.F(); // CHECK:STDERR: · ━┳━ @@ -119,8 +119,8 @@ class Derived { fn ViaDerived(d: Derived) { // CHECK:STDERR: ╭─┤ fail_todo_nested_in_friend_of_base.carbon:[[@LINE+11]]:7 // CHECK:STDERR: │ private fn F() {} - // CHECK:STDERR: · ────────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ d.F(); // CHECK:STDERR: · ━┳━ @@ -145,6 +145,21 @@ base class Base { class A(template T: type) { fn G() { + // CHECK:STDERR: ╭─┤ fail_todo_friend_of_base_via_template.carbon:[[@LINE+15]]:5 + // CHECK:STDERR: │ private fn F() {} + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: ┆ + // CHECK:STDERR: -> │ T.F(); + // CHECK:STDERR: · ━┳━ + // CHECK:STDERR: · ┗━━┫ error: cannot access private member `F` of type `Base` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ A(Derived).G(); + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ in monomorphization of `G()` here [ResolvingSpecificHere] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: T.F(); } } @@ -154,22 +169,6 @@ class Derived { } fn H() { - // CHECK:STDERR: ╭─┤ fail_todo_friend_of_base_via_template.carbon:[[@LINE+16]]:3 - // CHECK:STDERR: │ private fn F() {} - // CHECK:STDERR: · ────────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] - // CHECK:STDERR: ┆ - // CHECK:STDERR: │ T.F(); - // CHECK:STDERR: · ─┬─ - // CHECK:STDERR: · ╰──┤ cannot access private member `F` of type `Base` - // CHECK:STDERR: · │ [ClassInvalidMemberAccess] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ A(Derived).G(); - // CHECK:STDERR: · ━━━━━━┳━━━━━ - // CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific `G()` - // CHECK:STDERR: · ┃ [ResolvingSpecificHere] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: A(Derived).G(); } @@ -190,8 +189,8 @@ class Derived { fn Base.G(d: Derived) { // CHECK:STDERR: ╭─┤ fail_todo_base_member_via_derived.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ private fn F() {} - // CHECK:STDERR: · ────────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ d.F(); // CHECK:STDERR: · ━┳━ @@ -219,8 +218,8 @@ class Derived { fn Base(T: type).G(d: Derived) { // CHECK:STDERR: ╭─┤ fail_todo_generic_base_member_via_derived.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ private fn F() {} - // CHECK:STDERR: · ────────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ d.F(); // CHECK:STDERR: · ━┳━ @@ -252,8 +251,8 @@ class Derived { fn Base(T: type).Nested.G(d: Derived) { // CHECK:STDERR: ╭─┤ fail_todo_generic_base_member_via_derived_in_nested_class.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ private fn F() {} - // CHECK:STDERR: · ────────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ d.F(); // CHECK:STDERR: · ━┳━ @@ -287,8 +286,8 @@ class Friend { fn G(b: Bottom) { // CHECK:STDERR: ╭─┤ fail_todo_friend_of_indirect_base.carbon:[[@LINE+11]]:5 // CHECK:STDERR: │ private fn F() {} - // CHECK:STDERR: · ────────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ b.F(); // CHECK:STDERR: · ━┳━ @@ -318,8 +317,8 @@ interface I { default fn G(d: Derived) { // CHECK:STDERR: ╭─┤ fail_todo_friend_interface_of_base.carbon:[[@LINE+11]]:5 // CHECK:STDERR: │ private fn F() {} - // CHECK:STDERR: · ────────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ d.F(); // CHECK:STDERR: · ━┳━ @@ -347,8 +346,8 @@ class Adapter { fn G() { // CHECK:STDERR: ╭─┤ fail_todo_friend_of_adapted_class.carbon:[[@LINE+11]]:5 // CHECK:STDERR: │ private fn F() {} - // CHECK:STDERR: · ────────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Self.F(); // CHECK:STDERR: · ━━━┳━━ @@ -465,8 +464,8 @@ class Friend { m.F(); // CHECK:STDERR: ╭─┤ fail_todo_friend_of_base_protected_member_of_indirect_base.carbon:[[@LINE+11]]:5 // CHECK:STDERR: │ protected fn F() {} - // CHECK:STDERR: · ─────────┬──────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ b.F(); // CHECK:STDERR: · ━┳━ @@ -495,8 +494,8 @@ class Derived { fn G(d: Derived) { // CHECK:STDERR: ╭─┤ fail_not_friend_of_base.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ private fn F(); - // CHECK:STDERR: · ───────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ d.F(); // CHECK:STDERR: · ━┳━ @@ -527,8 +526,8 @@ class Friend { d.G(); // CHECK:STDERR: ╭─┤ fail_friend_of_derived_only.carbon:[[@LINE+11]]:5 // CHECK:STDERR: │ private fn F(); - // CHECK:STDERR: · ───────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ d.F(); // CHECK:STDERR: · ━┳━ @@ -553,8 +552,8 @@ class Derived { fn Qualified() { // CHECK:STDERR: ╭─┤ fail_derived_without_friendship_qualified.carbon:[[@LINE+11]]:5 // CHECK:STDERR: │ private fn F() {} - // CHECK:STDERR: · ────────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Self.F(); // CHECK:STDERR: · ━━━┳━━ @@ -579,8 +578,8 @@ class Derived { fn Unqualified() { // CHECK:STDERR: ╭─┤ fail_derived_without_friendship_unqualified.carbon:[[@LINE+11]]:5 // CHECK:STDERR: │ private fn F() {} - // CHECK:STDERR: · ────────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ F(); // CHECK:STDERR: · ┳ @@ -614,8 +613,8 @@ class Friend { fn G(b: Bottom) { // CHECK:STDERR: ╭─┤ fail_friend_of_middle_only.carbon:[[@LINE+11]]:5 // CHECK:STDERR: │ private fn F(); - // CHECK:STDERR: · ───────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ b.F(); // CHECK:STDERR: · ━┳━ @@ -640,8 +639,8 @@ class Adapter { fn G() { // CHECK:STDERR: ╭─┤ fail_not_friend_of_adapted_class.carbon:[[@LINE+11]]:5 // CHECK:STDERR: │ private fn F() {} - // CHECK:STDERR: · ────────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Self.F(); // CHECK:STDERR: · ━━━┳━━ diff --git a/toolchain/check/testdata/class/adapter/adapt_copy.carbon b/toolchain/check/testdata/class/adapter/adapt_copy.carbon index 9232e8904cec..09abc8141e74 100644 --- a/toolchain/check/testdata/class/adapter/adapt_copy.carbon +++ b/toolchain/check/testdata/class/adapter/adapt_copy.carbon @@ -24,49 +24,39 @@ class AdaptCopyable { } fn F(c: AdaptCopyable) -> AdaptCopyable { - // CHECK:STDERR: ╭─┤ fail_adapt_copyable.carbon:[[@LINE+10]]:26 + // CHECK:STDERR: ╭─┤ fail_adapt_copyable.carbon:[[@LINE+7]]:26 // CHECK:STDERR: -> │ var d: AdaptCopyable = c; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot copy value of type `AdaptCopyable` - // CHECK:STDERR: · │ ┃ [CopyOfUncopyableType] - // CHECK:STDERR: · ╰────┤ type `AdaptCopyable` does not implement - // CHECK:STDERR: · │ interface `Core.Copy` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [CopyOfUncopyableType] // CHECK:STDERR: ╰──── // CHECK:STDERR: var d: AdaptCopyable = c; - // CHECK:STDERR: ╭─┤ fail_adapt_copyable.carbon:[[@LINE+9]]:10 + // CHECK:STDERR: ╭─┤ fail_adapt_copyable.carbon:[[@LINE+7]]:10 // CHECK:STDERR: -> │ return d; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot copy value of type `AdaptCopyable` - // CHECK:STDERR: · │ ┃ [CopyOfUncopyableType] - // CHECK:STDERR: · ╰────┤ type `AdaptCopyable` does not implement interface `Core.Copy` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [CopyOfUncopyableType] // CHECK:STDERR: ╰──── // CHECK:STDERR: return d; } fn InTuple(c: (AdaptCopyable, u32)) -> (AdaptCopyable, u32) { - // CHECK:STDERR: ╭─┤ fail_adapt_copyable.carbon:[[@LINE+11]]:33 + // CHECK:STDERR: ╭─┤ fail_adapt_copyable.carbon:[[@LINE+8]]:33 // CHECK:STDERR: -> │ var d: (AdaptCopyable, u32) = c; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot copy value of type - // CHECK:STDERR: · │ ┃ `AdaptCopyable` - // CHECK:STDERR: · │ ┃ [CopyOfUncopyableType] - // CHECK:STDERR: · ╰────┤ type `AdaptCopyable` does not implement - // CHECK:STDERR: · │ interface `Core.Copy` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `AdaptCopyable` + // CHECK:STDERR: · ┃ [CopyOfUncopyableType] // CHECK:STDERR: ╰──── // CHECK:STDERR: var d: (AdaptCopyable, u32) = c; - // CHECK:STDERR: ╭─┤ fail_adapt_copyable.carbon:[[@LINE+9]]:10 + // CHECK:STDERR: ╭─┤ fail_adapt_copyable.carbon:[[@LINE+7]]:10 // CHECK:STDERR: -> │ return d; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot copy value of type `AdaptCopyable` - // CHECK:STDERR: · │ ┃ [CopyOfUncopyableType] - // CHECK:STDERR: · ╰────┤ type `AdaptCopyable` does not implement interface `Core.Copy` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [CopyOfUncopyableType] // CHECK:STDERR: ╰──── // CHECK:STDERR: return d; @@ -103,25 +93,20 @@ class AdaptNoncopyable { } fn G(a: AdaptNoncopyable) -> AdaptNoncopyable { - // CHECK:STDERR: ╭─┤ fail_adapt_not_copyable.carbon:[[@LINE+11]]:29 + // CHECK:STDERR: ╭─┤ fail_adapt_not_copyable.carbon:[[@LINE+8]]:29 // CHECK:STDERR: -> │ var b: AdaptNoncopyable = a; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot copy value of type - // CHECK:STDERR: · │ ┃ `AdaptNoncopyable` - // CHECK:STDERR: · │ ┃ [CopyOfUncopyableType] - // CHECK:STDERR: · ╰────┤ type `AdaptNoncopyable` does not implement - // CHECK:STDERR: · │ interface `Core.Copy` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `AdaptNoncopyable` + // CHECK:STDERR: · ┃ [CopyOfUncopyableType] // CHECK:STDERR: ╰──── // CHECK:STDERR: var b: AdaptNoncopyable = a; - // CHECK:STDERR: ╭─┤ fail_adapt_not_copyable.carbon:[[@LINE+9]]:10 + // CHECK:STDERR: ╭─┤ fail_adapt_not_copyable.carbon:[[@LINE+7]]:10 // CHECK:STDERR: -> │ return b; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot copy value of type `AdaptNoncopyable` - // CHECK:STDERR: · │ ┃ [CopyOfUncopyableType] - // CHECK:STDERR: · ╰────┤ type `AdaptNoncopyable` does not implement interface `Core.Copy` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [CopyOfUncopyableType] // CHECK:STDERR: ╰──── // CHECK:STDERR: return b; @@ -140,29 +125,23 @@ class AdaptNoncopyableIndirect { } fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { - // CHECK:STDERR: ╭─┤ fail_adapt_not_copyable_indirect.carbon:[[@LINE+14]]:3 + // CHECK:STDERR: ╭─┤ fail_adapt_not_copyable_indirect.carbon:[[@LINE+10]]:3 // CHECK:STDERR: -> │ var b: AdaptNoncopyableIndirect = a; // CHECK:STDERR: · ━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━ ┬ // CHECK:STDERR: · ┗━━━━━━━━━━━━━━━━━━━━━┫ error: cannot copy value of type - // CHECK:STDERR: · │ │ ┃ `Noncopyable` - // CHECK:STDERR: · │ │ ┃ [CopyOfUncopyableType] - // CHECK:STDERR: · ╰───────────────────────┤ type `Noncopyable` does not implement - // CHECK:STDERR: · │ │ interface `Core.Copy` - // CHECK:STDERR: · │ │ [MissingImplInMemberAccessInContext] - // CHECK:STDERR: · ╰──────┤ in copy of - // CHECK:STDERR: · │ `AdaptNoncopyableIndirect` - // CHECK:STDERR: · │ [InCopy] + // CHECK:STDERR: · │ ┃ `Noncopyable` + // CHECK:STDERR: · │ ┃ [CopyOfUncopyableType] + // CHECK:STDERR: · ╰────┤ in copy of `AdaptNoncopyableIndirect` + // CHECK:STDERR: · │ [InCopy] // CHECK:STDERR: ╰──── // CHECK:STDERR: var b: AdaptNoncopyableIndirect = a; - // CHECK:STDERR: ╭─┤ fail_adapt_not_copyable_indirect.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_adapt_not_copyable_indirect.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return b; // CHECK:STDERR: · ━━━━┳━━┯━ // CHECK:STDERR: · ┗━━━━━┫ error: cannot copy value of type `Noncopyable` - // CHECK:STDERR: · │ │ ┃ [CopyOfUncopyableType] - // CHECK:STDERR: · ╰───────┤ type `Noncopyable` does not implement interface `Core.Copy` - // CHECK:STDERR: · │ │ [MissingImplInMemberAccessInContext] - // CHECK:STDERR: · ╰──────┤ in copy of `AdaptNoncopyableIndirect` [InCopy] + // CHECK:STDERR: · │ ┃ [CopyOfUncopyableType] + // CHECK:STDERR: · ╰────┤ in copy of `AdaptNoncopyableIndirect` [InCopy] // CHECK:STDERR: ╰──── // CHECK:STDERR: return b; @@ -216,7 +195,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %T.09f: %SubobjectDestroy.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.type.dea: type = fn_type @T.as_type.as.DestroyImpl.impl.Op, @T.as_type.as.DestroyImpl.impl(%T.09f) [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.6e5: %T.as_type.as.DestroyImpl.impl.Op.type.dea = struct_value () [symbolic] -// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc19_3.2 [concrete] +// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc16_3.2 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.2: %SubobjectDestroy.WithSelf.Op.type.6870fd.2 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.2: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.2), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.f53: %SubobjectDestroy.type = facet_value %AdaptCopyable, (%custom_witness.b80ef6.2) [concrete] @@ -239,10 +218,10 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %InTuple: %InTuple.type = struct_value () [concrete] // CHECK:STDOUT: %d.patt.883: %pattern_type.848 = ref_binding_pattern d [concrete] // CHECK:STDOUT: %d.var_patt.66d: %pattern_type.848 = var_pattern %d.patt.883 [concrete] -// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.3: type = fn_type @SubobjectDestroy.WithSelf.Op.loc44_3.1 [concrete] +// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.3: type = fn_type @SubobjectDestroy.WithSelf.Op.loc36_3.1 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.3: %SubobjectDestroy.WithSelf.Op.type.6870fd.3 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.3: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.3), @SubobjectDestroy [concrete] -// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.4: type = fn_type @SubobjectDestroy.WithSelf.Op.loc44_3.2 [concrete] +// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.4: type = fn_type @SubobjectDestroy.WithSelf.Op.loc36_3.2 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.4: %SubobjectDestroy.WithSelf.Op.type.6870fd.4 = struct_value () [concrete] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.439: %SubobjectDestroy.type = facet_value %u32, (%custom_witness.b80ef6.3) [concrete] @@ -301,19 +280,19 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %c.param_patt: %pattern_type.848 = value_param_pattern [concrete = constants.%c.param_patt.47e] // CHECK:STDOUT: %c.patt: %pattern_type.848 = wrapper_binding_pattern c, %c.param_patt [concrete = constants.%c.patt.fe5] // CHECK:STDOUT: %return.param_patt: %pattern_type.848 = out_param_pattern [concrete = constants.%return.param_patt.117] -// CHECK:STDOUT: %return.patt: %pattern_type.848 = return_slot_pattern %return.param_patt, %.loc32_59.2 [concrete = constants.%return.patt.77a] +// CHECK:STDOUT: %return.patt: %pattern_type.848 = return_slot_pattern %return.param_patt, %.loc27_59.2 [concrete = constants.%return.patt.77a] // CHECK:STDOUT: } { -// CHECK:STDOUT: %AdaptCopyable.ref.loc32_41: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] -// CHECK:STDOUT: %u32.loc32_56: type = type_literal constants.%u32 [concrete = constants.%u32] -// CHECK:STDOUT: %.loc32_59.1: %tuple.type.693 = tuple_literal (%AdaptCopyable.ref.loc32_41, %u32.loc32_56) [concrete = constants.%tuple.0f9] -// CHECK:STDOUT: %.loc32_59.2: type = converted %.loc32_59.1, constants.%tuple.type.c35 [concrete = constants.%tuple.type.c35] -// CHECK:STDOUT: %.loc32_59.3: Core.Form = init_form %.loc32_59.2 [concrete = constants.%.70b] +// CHECK:STDOUT: %AdaptCopyable.ref.loc27_41: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] +// CHECK:STDOUT: %u32.loc27_56: type = type_literal constants.%u32 [concrete = constants.%u32] +// CHECK:STDOUT: %.loc27_59.1: %tuple.type.693 = tuple_literal (%AdaptCopyable.ref.loc27_41, %u32.loc27_56) [concrete = constants.%tuple.0f9] +// CHECK:STDOUT: %.loc27_59.2: type = converted %.loc27_59.1, constants.%tuple.type.c35 [concrete = constants.%tuple.type.c35] +// CHECK:STDOUT: %.loc27_59.3: Core.Form = init_form %.loc27_59.2 [concrete = constants.%.70b] // CHECK:STDOUT: %c.param: %tuple.type.c35 = value_param call_param0 -// CHECK:STDOUT: %.loc32_34.1: type = splice_block %.loc32_34.3 [concrete = constants.%tuple.type.c35] { -// CHECK:STDOUT: %AdaptCopyable.ref.loc32_16: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] -// CHECK:STDOUT: %u32.loc32_31: type = type_literal constants.%u32 [concrete = constants.%u32] -// CHECK:STDOUT: %.loc32_34.2: %tuple.type.693 = tuple_literal (%AdaptCopyable.ref.loc32_16, %u32.loc32_31) [concrete = constants.%tuple.0f9] -// CHECK:STDOUT: %.loc32_34.3: type = converted %.loc32_34.2, constants.%tuple.type.c35 [concrete = constants.%tuple.type.c35] +// CHECK:STDOUT: %.loc27_34.1: type = splice_block %.loc27_34.3 [concrete = constants.%tuple.type.c35] { +// CHECK:STDOUT: %AdaptCopyable.ref.loc27_16: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] +// CHECK:STDOUT: %u32.loc27_31: type = type_literal constants.%u32 [concrete = constants.%u32] +// CHECK:STDOUT: %.loc27_34.2: %tuple.type.693 = tuple_literal (%AdaptCopyable.ref.loc27_16, %u32.loc27_31) [concrete = constants.%tuple.0f9] +// CHECK:STDOUT: %.loc27_34.3: type = converted %.loc27_34.2, constants.%tuple.type.c35 [concrete = constants.%tuple.type.c35] // CHECK:STDOUT: } // CHECK:STDOUT: %c: %tuple.type.c35 = wrapper_binding c, %c.param // CHECK:STDOUT: %return.param: ref %tuple.type.c35 = out_param call_param1 @@ -336,38 +315,38 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %d.var: ref %AdaptCopyable = var_storage %d.var_patt // CHECK:STDOUT: %c.ref: %AdaptCopyable = name_ref c, %c // CHECK:STDOUT: assign %d.var, -// CHECK:STDOUT: %AdaptCopyable.ref.loc19: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] +// CHECK:STDOUT: %AdaptCopyable.ref.loc16: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] // CHECK:STDOUT: %d: ref %AdaptCopyable = wrapper_binding d, %d.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %d.patt: %pattern_type.3b9 = ref_binding_pattern d [concrete = constants.%d.patt.467] // CHECK:STDOUT: %d.var_patt: %pattern_type.3b9 = var_pattern %d.patt [concrete = constants.%d.var_patt.b13] // CHECK:STDOUT: } // CHECK:STDOUT: %d.ref: ref %AdaptCopyable = name_ref d, %d -// CHECK:STDOUT: %.loc29: %AdaptCopyable = acquire_value %d.ref -// CHECK:STDOUT: %Destroy.facet.loc19_3.1: %Destroy.type = facet_value constants.%AdaptCopyable, (constants.%DestroyImpl.impl_witness.da7, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.11a] -// CHECK:STDOUT: %.loc19_3.1: %Destroy.type = converted constants.%AdaptCopyable, %Destroy.facet.loc19_3.1 [concrete = constants.%Destroy.facet.11a] -// CHECK:STDOUT: %Destroy.facet.loc19_3.2: %Destroy.type = facet_value constants.%AdaptCopyable, (constants.%DestroyImpl.impl_witness.da7, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.11a] -// CHECK:STDOUT: %.loc19_3.2: %Destroy.type = converted constants.%AdaptCopyable, %Destroy.facet.loc19_3.2 [concrete = constants.%Destroy.facet.11a] +// CHECK:STDOUT: %.loc24: %AdaptCopyable = acquire_value %d.ref +// CHECK:STDOUT: %Destroy.facet.loc16_3.1: %Destroy.type = facet_value constants.%AdaptCopyable, (constants.%DestroyImpl.impl_witness.da7, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.11a] +// CHECK:STDOUT: %.loc16_3.1: %Destroy.type = converted constants.%AdaptCopyable, %Destroy.facet.loc16_3.1 [concrete = constants.%Destroy.facet.11a] +// CHECK:STDOUT: %Destroy.facet.loc16_3.2: %Destroy.type = facet_value constants.%AdaptCopyable, (constants.%DestroyImpl.impl_witness.da7, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.11a] +// CHECK:STDOUT: %.loc16_3.2: %Destroy.type = converted constants.%AdaptCopyable, %Destroy.facet.loc16_3.2 [concrete = constants.%Destroy.facet.11a] // CHECK:STDOUT: %SelfDestruct.specific_fn: = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet.11a) [concrete = constants.%SelfDestruct.specific_fn.97c] // CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%d.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc19_3.1(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc16_3.1(%self.param: ref %i32) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc19_3.2(%self.param: ref %AdaptCopyable) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc16_3.2(%self.param: ref %AdaptCopyable) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: fn @InTuple(%c.param: %tuple.type.c35) -> out %return.param: %tuple.type.c35 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.var: ref %tuple.type.c35 = var_storage %d.var_patt // CHECK:STDOUT: %c.ref: %tuple.type.c35 = name_ref c, %c -// CHECK:STDOUT: %tuple.elem0.loc44: %AdaptCopyable = tuple_access %c.ref, element0 +// CHECK:STDOUT: %tuple.elem0.loc36: %AdaptCopyable = tuple_access %c.ref, element0 // CHECK:STDOUT: assign %d.var, -// CHECK:STDOUT: %.loc44_29.1: type = splice_block %.loc44_29.3 [concrete = constants.%tuple.type.c35] { -// CHECK:STDOUT: %AdaptCopyable.ref.loc44: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] -// CHECK:STDOUT: %u32.loc44: type = type_literal constants.%u32 [concrete = constants.%u32] -// CHECK:STDOUT: %.loc44_29.2: %tuple.type.693 = tuple_literal (%AdaptCopyable.ref.loc44, %u32.loc44) [concrete = constants.%tuple.0f9] -// CHECK:STDOUT: %.loc44_29.3: type = converted %.loc44_29.2, constants.%tuple.type.c35 [concrete = constants.%tuple.type.c35] +// CHECK:STDOUT: %.loc36_29.1: type = splice_block %.loc36_29.3 [concrete = constants.%tuple.type.c35] { +// CHECK:STDOUT: %AdaptCopyable.ref.loc36: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] +// CHECK:STDOUT: %u32.loc36: type = type_literal constants.%u32 [concrete = constants.%u32] +// CHECK:STDOUT: %.loc36_29.2: %tuple.type.693 = tuple_literal (%AdaptCopyable.ref.loc36, %u32.loc36) [concrete = constants.%tuple.0f9] +// CHECK:STDOUT: %.loc36_29.3: type = converted %.loc36_29.2, constants.%tuple.type.c35 [concrete = constants.%tuple.type.c35] // CHECK:STDOUT: } // CHECK:STDOUT: %d: ref %tuple.type.c35 = wrapper_binding d, %d.var // CHECK:STDOUT: name_binding_decl { @@ -375,37 +354,37 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %d.var_patt: %pattern_type.848 = var_pattern %d.patt [concrete = constants.%d.var_patt.66d] // CHECK:STDOUT: } // CHECK:STDOUT: %d.ref: ref %tuple.type.c35 = name_ref d, %d -// CHECK:STDOUT: %tuple.elem0.loc54: ref %AdaptCopyable = tuple_access %d.ref, element0 -// CHECK:STDOUT: %.loc54: %AdaptCopyable = acquire_value %tuple.elem0.loc54 -// CHECK:STDOUT: %Destroy.facet.loc44_3.1: %Destroy.type = facet_value constants.%tuple.type.c35, (constants.%DestroyImpl.impl_witness.2ab, constants.%custom_witness.b80ef6.4) [concrete = constants.%Destroy.facet.aca] -// CHECK:STDOUT: %.loc44_3.1: %Destroy.type = converted constants.%tuple.type.c35, %Destroy.facet.loc44_3.1 [concrete = constants.%Destroy.facet.aca] -// CHECK:STDOUT: %Destroy.facet.loc44_3.2: %Destroy.type = facet_value constants.%tuple.type.c35, (constants.%DestroyImpl.impl_witness.2ab, constants.%custom_witness.b80ef6.4) [concrete = constants.%Destroy.facet.aca] -// CHECK:STDOUT: %.loc44_3.2: %Destroy.type = converted constants.%tuple.type.c35, %Destroy.facet.loc44_3.2 [concrete = constants.%Destroy.facet.aca] +// CHECK:STDOUT: %tuple.elem0.loc44: ref %AdaptCopyable = tuple_access %d.ref, element0 +// CHECK:STDOUT: %.loc44: %AdaptCopyable = acquire_value %tuple.elem0.loc44 +// CHECK:STDOUT: %Destroy.facet.loc36_3.1: %Destroy.type = facet_value constants.%tuple.type.c35, (constants.%DestroyImpl.impl_witness.2ab, constants.%custom_witness.b80ef6.4) [concrete = constants.%Destroy.facet.aca] +// CHECK:STDOUT: %.loc36_3.1: %Destroy.type = converted constants.%tuple.type.c35, %Destroy.facet.loc36_3.1 [concrete = constants.%Destroy.facet.aca] +// CHECK:STDOUT: %Destroy.facet.loc36_3.2: %Destroy.type = facet_value constants.%tuple.type.c35, (constants.%DestroyImpl.impl_witness.2ab, constants.%custom_witness.b80ef6.4) [concrete = constants.%Destroy.facet.aca] +// CHECK:STDOUT: %.loc36_3.2: %Destroy.type = converted constants.%tuple.type.c35, %Destroy.facet.loc36_3.2 [concrete = constants.%Destroy.facet.aca] // CHECK:STDOUT: %SelfDestruct.specific_fn: = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet.aca) [concrete = constants.%SelfDestruct.specific_fn.f48] // CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%d.var) // CHECK:STDOUT: return to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc44_3.1(%self.param: ref %u32) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc36_3.1(%self.param: ref %u32) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc44_3.2(%self.param: ref %tuple.type.c35) { +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc36_3.2(%self.param: ref %tuple.type.c35) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %tuple.elem1: ref %u32 = tuple_access %self.param, element1 -// CHECK:STDOUT: %Destroy.facet.loc44_3.1: %Destroy.type = facet_value constants.%u32, (constants.%DestroyImpl.impl_witness.ee7, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet.35c] -// CHECK:STDOUT: %.loc44_3.1: %Destroy.type = converted constants.%u32, %Destroy.facet.loc44_3.1 [concrete = constants.%Destroy.facet.35c] -// CHECK:STDOUT: %Destroy.facet.loc44_3.2: %Destroy.type = facet_value constants.%u32, (constants.%DestroyImpl.impl_witness.ee7, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet.35c] -// CHECK:STDOUT: %.loc44_3.2: %Destroy.type = converted constants.%u32, %Destroy.facet.loc44_3.2 [concrete = constants.%Destroy.facet.35c] +// CHECK:STDOUT: %Destroy.facet.loc36_3.1: %Destroy.type = facet_value constants.%u32, (constants.%DestroyImpl.impl_witness.ee7, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet.35c] +// CHECK:STDOUT: %.loc36_3.1: %Destroy.type = converted constants.%u32, %Destroy.facet.loc36_3.1 [concrete = constants.%Destroy.facet.35c] +// CHECK:STDOUT: %Destroy.facet.loc36_3.2: %Destroy.type = facet_value constants.%u32, (constants.%DestroyImpl.impl_witness.ee7, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet.35c] +// CHECK:STDOUT: %.loc36_3.2: %Destroy.type = converted constants.%u32, %Destroy.facet.loc36_3.2 [concrete = constants.%Destroy.facet.35c] // CHECK:STDOUT: %SelfDestruct.specific_fn.1: = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet.35c) [concrete = constants.%SelfDestruct.specific_fn.a73] -// CHECK:STDOUT: %SelfDestruct.call.loc44_3.1: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%tuple.elem1) +// CHECK:STDOUT: %SelfDestruct.call.loc36_3.1: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%tuple.elem1) // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %tuple.elem0: ref %AdaptCopyable = tuple_access %self.param, element0 -// CHECK:STDOUT: %Destroy.facet.loc44_3.3: %Destroy.type = facet_value constants.%AdaptCopyable, (constants.%DestroyImpl.impl_witness.da7, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.11a] -// CHECK:STDOUT: %.loc44_3.3: %Destroy.type = converted constants.%AdaptCopyable, %Destroy.facet.loc44_3.3 [concrete = constants.%Destroy.facet.11a] -// CHECK:STDOUT: %Destroy.facet.loc44_3.4: %Destroy.type = facet_value constants.%AdaptCopyable, (constants.%DestroyImpl.impl_witness.da7, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.11a] -// CHECK:STDOUT: %.loc44_3.4: %Destroy.type = converted constants.%AdaptCopyable, %Destroy.facet.loc44_3.4 [concrete = constants.%Destroy.facet.11a] +// CHECK:STDOUT: %Destroy.facet.loc36_3.3: %Destroy.type = facet_value constants.%AdaptCopyable, (constants.%DestroyImpl.impl_witness.da7, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.11a] +// CHECK:STDOUT: %.loc36_3.3: %Destroy.type = converted constants.%AdaptCopyable, %Destroy.facet.loc36_3.3 [concrete = constants.%Destroy.facet.11a] +// CHECK:STDOUT: %Destroy.facet.loc36_3.4: %Destroy.type = facet_value constants.%AdaptCopyable, (constants.%DestroyImpl.impl_witness.da7, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.11a] +// CHECK:STDOUT: %.loc36_3.4: %Destroy.type = converted constants.%AdaptCopyable, %Destroy.facet.loc36_3.4 [concrete = constants.%Destroy.facet.11a] // CHECK:STDOUT: %SelfDestruct.specific_fn.2: = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet.11a) [concrete = constants.%SelfDestruct.specific_fn.97c] -// CHECK:STDOUT: %SelfDestruct.call.loc44_3.2: init %empty_tuple.type = call %SelfDestruct.specific_fn.2(%tuple.elem0) +// CHECK:STDOUT: %SelfDestruct.call.loc36_3.2: init %empty_tuple.type = call %SelfDestruct.specific_fn.2(%tuple.elem0) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -823,7 +802,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %T.09f: %SubobjectDestroy.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.type.dea: type = fn_type @T.as_type.as.DestroyImpl.impl.Op, @T.as_type.as.DestroyImpl.impl(%T.09f) [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.6e5: %T.as_type.as.DestroyImpl.impl.Op.type.dea = struct_value () [symbolic] -// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.3: type = fn_type @SubobjectDestroy.WithSelf.Op.loc24_3.3 [concrete] +// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.3: type = fn_type @SubobjectDestroy.WithSelf.Op.loc21_3.3 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.3: %SubobjectDestroy.WithSelf.Op.type.6870fd.3 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.3: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.3), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.7fa: %SubobjectDestroy.type = facet_value %AdaptNoncopyable, (%custom_witness.b80ef6.3) [concrete] @@ -895,28 +874,28 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %b.var: ref %AdaptNoncopyable = var_storage %b.var_patt // CHECK:STDOUT: %a.ref: %AdaptNoncopyable = name_ref a, %a // CHECK:STDOUT: assign %b.var, -// CHECK:STDOUT: %AdaptNoncopyable.ref.loc24: type = name_ref AdaptNoncopyable, file.%AdaptNoncopyable.decl [concrete = constants.%AdaptNoncopyable] +// CHECK:STDOUT: %AdaptNoncopyable.ref.loc21: type = name_ref AdaptNoncopyable, file.%AdaptNoncopyable.decl [concrete = constants.%AdaptNoncopyable] // CHECK:STDOUT: %b: ref %AdaptNoncopyable = wrapper_binding b, %b.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.d14 = ref_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: %b.var_patt: %pattern_type.d14 = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: %b.ref: ref %AdaptNoncopyable = name_ref b, %b -// CHECK:STDOUT: %.loc34: %AdaptNoncopyable = acquire_value %b.ref -// CHECK:STDOUT: %Destroy.facet.loc24_3.1: %Destroy.type = facet_value constants.%AdaptNoncopyable, (constants.%DestroyImpl.impl_witness.9f4, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %.loc24_3.1: %Destroy.type = converted constants.%AdaptNoncopyable, %Destroy.facet.loc24_3.1 [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %Destroy.facet.loc24_3.2: %Destroy.type = facet_value constants.%AdaptNoncopyable, (constants.%DestroyImpl.impl_witness.9f4, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %.loc24_3.2: %Destroy.type = converted constants.%AdaptNoncopyable, %Destroy.facet.loc24_3.2 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc29: %AdaptNoncopyable = acquire_value %b.ref +// CHECK:STDOUT: %Destroy.facet.loc21_3.1: %Destroy.type = facet_value constants.%AdaptNoncopyable, (constants.%DestroyImpl.impl_witness.9f4, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc21_3.1: %Destroy.type = converted constants.%AdaptNoncopyable, %Destroy.facet.loc21_3.1 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %Destroy.facet.loc21_3.2: %Destroy.type = facet_value constants.%AdaptNoncopyable, (constants.%DestroyImpl.impl_witness.9f4, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc21_3.2: %Destroy.type = converted constants.%AdaptNoncopyable, %Destroy.facet.loc21_3.2 [concrete = constants.%Destroy.facet] // CHECK:STDOUT: %SelfDestruct.specific_fn: = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet) [concrete = constants.%SelfDestruct.specific_fn] // CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%b.var) // CHECK:STDOUT: return to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc24_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc21_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc24_3.2(%self.param: ref %Noncopyable) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc21_3.2(%self.param: ref %Noncopyable) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc24_3.3(%self.param: ref %AdaptNoncopyable) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc21_3.3(%self.param: ref %AdaptNoncopyable) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_adapt_not_copyable_indirect.carbon = $fail_adapt_not_copyable_indirect // CHECK:STDOUT: @@ -963,10 +942,10 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %T.09f: %SubobjectDestroy.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.type.dea: type = fn_type @T.as_type.as.DestroyImpl.impl.Op, @T.as_type.as.DestroyImpl.impl(%T.09f) [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.6e5: %T.as_type.as.DestroyImpl.impl.Op.type.dea = struct_value () [symbolic] -// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.1: type = fn_type @SubobjectDestroy.WithSelf.Op.loc27_3.1 [concrete] +// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.1: type = fn_type @SubobjectDestroy.WithSelf.Op.loc23_3.1 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.1: %SubobjectDestroy.WithSelf.Op.type.6870fd.1 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.1: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.1), @SubobjectDestroy [concrete] -// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.3: type = fn_type @SubobjectDestroy.WithSelf.Op.loc27_3.3 [concrete] +// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.3: type = fn_type @SubobjectDestroy.WithSelf.Op.loc23_3.3 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.3: %SubobjectDestroy.WithSelf.Op.type.6870fd.3 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.3: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.3), @SubobjectDestroy [concrete] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete] @@ -980,7 +959,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Destroy.facet.6f5: %Destroy.type = facet_value %Noncopyable, (%DestroyImpl.impl_witness.59b, %custom_witness.b80ef6.3) [concrete] // CHECK:STDOUT: %SelfDestruct.specific_fn.20b: = specific_function %SelfDestruct, @SelfDestruct(%Destroy.facet.6f5) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] -// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.5: type = fn_type @SubobjectDestroy.WithSelf.Op.loc27_3.5 [concrete] +// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.5: type = fn_type @SubobjectDestroy.WithSelf.Op.loc23_3.5 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.5: %SubobjectDestroy.WithSelf.Op.type.6870fd.5 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.5: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.5), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.e5e: %SubobjectDestroy.type = facet_value %AdaptNoncopyableIndirect, (%custom_witness.b80ef6.5) [concrete] @@ -1059,83 +1038,83 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.var: ref %AdaptNoncopyableIndirect = var_storage %b.var_patt // CHECK:STDOUT: %a.ref: %AdaptNoncopyableIndirect = name_ref a, %a -// CHECK:STDOUT: %.loc27_3.1: %tuple.type.71d = as_compatible %a.ref -// CHECK:STDOUT: %tuple.elem0.loc27_3.1: %i32 = tuple_access %.loc27_3.1, element0 -// CHECK:STDOUT: %impl.elem0.loc27: %.2b9 = impl_witness_access constants.%Copy.impl_witness.8af, element0 [concrete = constants.%Int.as.Copy.impl.Op.cae] -// CHECK:STDOUT: %bound_method.loc27_3.1: = bound_method %tuple.elem0.loc27_3.1, %impl.elem0.loc27 -// CHECK:STDOUT: %specific_fn.loc27: = specific_function %impl.elem0.loc27, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc27_3.2: = bound_method %tuple.elem0.loc27_3.1, %specific_fn.loc27 -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc27: init %i32 = call %bound_method.loc27_3.2(%tuple.elem0.loc27_3.1) -// CHECK:STDOUT: %.loc27_3.2: ref %tuple.type.71d = as_compatible %b.var -// CHECK:STDOUT: %tuple.elem0.loc27_3.2: ref %i32 = tuple_access %.loc27_3.2, element0 -// CHECK:STDOUT: %.loc27_3.3: init %i32 to %tuple.elem0.loc27_3.2 = in_place_init %Int.as.Copy.impl.Op.call.loc27 -// CHECK:STDOUT: %tuple.elem1.loc27: %Noncopyable = tuple_access %.loc27_3.1, element1 +// CHECK:STDOUT: %.loc23_3.1: %tuple.type.71d = as_compatible %a.ref +// CHECK:STDOUT: %tuple.elem0.loc23_3.1: %i32 = tuple_access %.loc23_3.1, element0 +// CHECK:STDOUT: %impl.elem0.loc23: %.2b9 = impl_witness_access constants.%Copy.impl_witness.8af, element0 [concrete = constants.%Int.as.Copy.impl.Op.cae] +// CHECK:STDOUT: %bound_method.loc23_3.1: = bound_method %tuple.elem0.loc23_3.1, %impl.elem0.loc23 +// CHECK:STDOUT: %specific_fn.loc23: = specific_function %impl.elem0.loc23, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc23_3.2: = bound_method %tuple.elem0.loc23_3.1, %specific_fn.loc23 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc23: init %i32 = call %bound_method.loc23_3.2(%tuple.elem0.loc23_3.1) +// CHECK:STDOUT: %.loc23_3.2: ref %tuple.type.71d = as_compatible %b.var +// CHECK:STDOUT: %tuple.elem0.loc23_3.2: ref %i32 = tuple_access %.loc23_3.2, element0 +// CHECK:STDOUT: %.loc23_3.3: init %i32 to %tuple.elem0.loc23_3.2 = in_place_init %Int.as.Copy.impl.Op.call.loc23 +// CHECK:STDOUT: %tuple.elem1.loc23: %Noncopyable = tuple_access %.loc23_3.1, element1 // CHECK:STDOUT: assign %b.var, -// CHECK:STDOUT: %AdaptNoncopyableIndirect.ref.loc27: type = name_ref AdaptNoncopyableIndirect, file.%AdaptNoncopyableIndirect.decl [concrete = constants.%AdaptNoncopyableIndirect] +// CHECK:STDOUT: %AdaptNoncopyableIndirect.ref.loc23: type = name_ref AdaptNoncopyableIndirect, file.%AdaptNoncopyableIndirect.decl [concrete = constants.%AdaptNoncopyableIndirect] // CHECK:STDOUT: %b: ref %AdaptNoncopyableIndirect = wrapper_binding b, %b.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.be3 = ref_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: %b.var_patt: %pattern_type.be3 = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: %b.ref: ref %AdaptNoncopyableIndirect = name_ref b, %b -// CHECK:STDOUT: %.loc38_11.1: ref %tuple.type.71d = as_compatible %b.ref -// CHECK:STDOUT: %tuple.elem0.loc38_11.1: ref %i32 = tuple_access %.loc38_11.1, element0 -// CHECK:STDOUT: %.loc38_11.2: %i32 = acquire_value %tuple.elem0.loc38_11.1 -// CHECK:STDOUT: %impl.elem0.loc38: %.2b9 = impl_witness_access constants.%Copy.impl_witness.8af, element0 [concrete = constants.%Int.as.Copy.impl.Op.cae] -// CHECK:STDOUT: %bound_method.loc38_11.1: = bound_method %.loc38_11.2, %impl.elem0.loc38 -// CHECK:STDOUT: %specific_fn.loc38: = specific_function %impl.elem0.loc38, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc38_11.2: = bound_method %.loc38_11.2, %specific_fn.loc38 -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc38: init %i32 = call %bound_method.loc38_11.2(%.loc38_11.2) -// CHECK:STDOUT: %.loc38_11.3: ref %tuple.type.71d = as_compatible %return.param -// CHECK:STDOUT: %tuple.elem0.loc38_11.2: ref %i32 = tuple_access %.loc38_11.3, element0 -// CHECK:STDOUT: %.loc38_11.4: init %i32 to %tuple.elem0.loc38_11.2 = in_place_init %Int.as.Copy.impl.Op.call.loc38 -// CHECK:STDOUT: %tuple.elem1.loc38: ref %Noncopyable = tuple_access %.loc38_11.1, element1 -// CHECK:STDOUT: %.loc38_11.5: %Noncopyable = acquire_value %tuple.elem1.loc38 -// CHECK:STDOUT: %Destroy.facet.loc27_3.1: %Destroy.type = facet_value constants.%AdaptNoncopyableIndirect, (constants.%DestroyImpl.impl_witness.860, constants.%custom_witness.b80ef6.5) [concrete = constants.%Destroy.facet.1f2] -// CHECK:STDOUT: %.loc27_3.4: %Destroy.type = converted constants.%AdaptNoncopyableIndirect, %Destroy.facet.loc27_3.1 [concrete = constants.%Destroy.facet.1f2] -// CHECK:STDOUT: %Destroy.facet.loc27_3.2: %Destroy.type = facet_value constants.%AdaptNoncopyableIndirect, (constants.%DestroyImpl.impl_witness.860, constants.%custom_witness.b80ef6.5) [concrete = constants.%Destroy.facet.1f2] -// CHECK:STDOUT: %.loc27_3.5: %Destroy.type = converted constants.%AdaptNoncopyableIndirect, %Destroy.facet.loc27_3.2 [concrete = constants.%Destroy.facet.1f2] +// CHECK:STDOUT: %.loc32_11.1: ref %tuple.type.71d = as_compatible %b.ref +// CHECK:STDOUT: %tuple.elem0.loc32_11.1: ref %i32 = tuple_access %.loc32_11.1, element0 +// CHECK:STDOUT: %.loc32_11.2: %i32 = acquire_value %tuple.elem0.loc32_11.1 +// CHECK:STDOUT: %impl.elem0.loc32: %.2b9 = impl_witness_access constants.%Copy.impl_witness.8af, element0 [concrete = constants.%Int.as.Copy.impl.Op.cae] +// CHECK:STDOUT: %bound_method.loc32_11.1: = bound_method %.loc32_11.2, %impl.elem0.loc32 +// CHECK:STDOUT: %specific_fn.loc32: = specific_function %impl.elem0.loc32, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc32_11.2: = bound_method %.loc32_11.2, %specific_fn.loc32 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc32: init %i32 = call %bound_method.loc32_11.2(%.loc32_11.2) +// CHECK:STDOUT: %.loc32_11.3: ref %tuple.type.71d = as_compatible %return.param +// CHECK:STDOUT: %tuple.elem0.loc32_11.2: ref %i32 = tuple_access %.loc32_11.3, element0 +// CHECK:STDOUT: %.loc32_11.4: init %i32 to %tuple.elem0.loc32_11.2 = in_place_init %Int.as.Copy.impl.Op.call.loc32 +// CHECK:STDOUT: %tuple.elem1.loc32: ref %Noncopyable = tuple_access %.loc32_11.1, element1 +// CHECK:STDOUT: %.loc32_11.5: %Noncopyable = acquire_value %tuple.elem1.loc32 +// CHECK:STDOUT: %Destroy.facet.loc23_3.1: %Destroy.type = facet_value constants.%AdaptNoncopyableIndirect, (constants.%DestroyImpl.impl_witness.860, constants.%custom_witness.b80ef6.5) [concrete = constants.%Destroy.facet.1f2] +// CHECK:STDOUT: %.loc23_3.4: %Destroy.type = converted constants.%AdaptNoncopyableIndirect, %Destroy.facet.loc23_3.1 [concrete = constants.%Destroy.facet.1f2] +// CHECK:STDOUT: %Destroy.facet.loc23_3.2: %Destroy.type = facet_value constants.%AdaptNoncopyableIndirect, (constants.%DestroyImpl.impl_witness.860, constants.%custom_witness.b80ef6.5) [concrete = constants.%Destroy.facet.1f2] +// CHECK:STDOUT: %.loc23_3.5: %Destroy.type = converted constants.%AdaptNoncopyableIndirect, %Destroy.facet.loc23_3.2 [concrete = constants.%Destroy.facet.1f2] // CHECK:STDOUT: %SelfDestruct.specific_fn: = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet.1f2) [concrete = constants.%SelfDestruct.specific_fn.0b6] // CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%b.var) // CHECK:STDOUT: return to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc27_3.1(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc23_3.1(%self.param: ref %i32) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc27_3.2(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc23_3.2(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc27_3.3(%self.param: ref %Noncopyable) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc23_3.3(%self.param: ref %Noncopyable) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc27_3.4(%self.param: ref %tuple.type.71d) { +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc23_3.4(%self.param: ref %tuple.type.71d) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2] // CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %self.param, element2 -// CHECK:STDOUT: %Destroy.facet.loc27_3.1: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] -// CHECK:STDOUT: %.loc27_3.1: %Destroy.type = converted constants.%i32, %Destroy.facet.loc27_3.1 [concrete = constants.%Destroy.facet.c2b] -// CHECK:STDOUT: %Destroy.facet.loc27_3.2: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] -// CHECK:STDOUT: %.loc27_3.2: %Destroy.type = converted constants.%i32, %Destroy.facet.loc27_3.2 [concrete = constants.%Destroy.facet.c2b] +// CHECK:STDOUT: %Destroy.facet.loc23_3.1: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] +// CHECK:STDOUT: %.loc23_3.1: %Destroy.type = converted constants.%i32, %Destroy.facet.loc23_3.1 [concrete = constants.%Destroy.facet.c2b] +// CHECK:STDOUT: %Destroy.facet.loc23_3.2: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] +// CHECK:STDOUT: %.loc23_3.2: %Destroy.type = converted constants.%i32, %Destroy.facet.loc23_3.2 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %SelfDestruct.specific_fn.1: = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet.c2b) [concrete = constants.%SelfDestruct.specific_fn.845] -// CHECK:STDOUT: %SelfDestruct.call.loc27_3.1: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%tuple.elem2) +// CHECK:STDOUT: %SelfDestruct.call.loc23_3.1: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%tuple.elem2) // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %tuple.elem1: ref %Noncopyable = tuple_access %self.param, element1 -// CHECK:STDOUT: %Destroy.facet.loc27_3.3: %Destroy.type = facet_value constants.%Noncopyable, (constants.%DestroyImpl.impl_witness.59b, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet.6f5] -// CHECK:STDOUT: %.loc27_3.3: %Destroy.type = converted constants.%Noncopyable, %Destroy.facet.loc27_3.3 [concrete = constants.%Destroy.facet.6f5] -// CHECK:STDOUT: %Destroy.facet.loc27_3.4: %Destroy.type = facet_value constants.%Noncopyable, (constants.%DestroyImpl.impl_witness.59b, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet.6f5] -// CHECK:STDOUT: %.loc27_3.4: %Destroy.type = converted constants.%Noncopyable, %Destroy.facet.loc27_3.4 [concrete = constants.%Destroy.facet.6f5] +// CHECK:STDOUT: %Destroy.facet.loc23_3.3: %Destroy.type = facet_value constants.%Noncopyable, (constants.%DestroyImpl.impl_witness.59b, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet.6f5] +// CHECK:STDOUT: %.loc23_3.3: %Destroy.type = converted constants.%Noncopyable, %Destroy.facet.loc23_3.3 [concrete = constants.%Destroy.facet.6f5] +// CHECK:STDOUT: %Destroy.facet.loc23_3.4: %Destroy.type = facet_value constants.%Noncopyable, (constants.%DestroyImpl.impl_witness.59b, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet.6f5] +// CHECK:STDOUT: %.loc23_3.4: %Destroy.type = converted constants.%Noncopyable, %Destroy.facet.loc23_3.4 [concrete = constants.%Destroy.facet.6f5] // CHECK:STDOUT: %SelfDestruct.specific_fn.2: = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet.6f5) [concrete = constants.%SelfDestruct.specific_fn.20b] -// CHECK:STDOUT: %SelfDestruct.call.loc27_3.2: init %empty_tuple.type = call %SelfDestruct.specific_fn.2(%tuple.elem1) +// CHECK:STDOUT: %SelfDestruct.call.loc23_3.2: init %empty_tuple.type = call %SelfDestruct.specific_fn.2(%tuple.elem1) // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %self.param, element0 -// CHECK:STDOUT: %Destroy.facet.loc27_3.5: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] -// CHECK:STDOUT: %.loc27_3.5: %Destroy.type = converted constants.%i32, %Destroy.facet.loc27_3.5 [concrete = constants.%Destroy.facet.c2b] -// CHECK:STDOUT: %Destroy.facet.loc27_3.6: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] -// CHECK:STDOUT: %.loc27_3.6: %Destroy.type = converted constants.%i32, %Destroy.facet.loc27_3.6 [concrete = constants.%Destroy.facet.c2b] +// CHECK:STDOUT: %Destroy.facet.loc23_3.5: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] +// CHECK:STDOUT: %.loc23_3.5: %Destroy.type = converted constants.%i32, %Destroy.facet.loc23_3.5 [concrete = constants.%Destroy.facet.c2b] +// CHECK:STDOUT: %Destroy.facet.loc23_3.6: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] +// CHECK:STDOUT: %.loc23_3.6: %Destroy.type = converted constants.%i32, %Destroy.facet.loc23_3.6 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %SelfDestruct.specific_fn.3: = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet.c2b) [concrete = constants.%SelfDestruct.specific_fn.845] -// CHECK:STDOUT: %SelfDestruct.call.loc27_3.3: init %empty_tuple.type = call %SelfDestruct.specific_fn.3(%tuple.elem0) +// CHECK:STDOUT: %SelfDestruct.call.loc23_3.3: init %empty_tuple.type = call %SelfDestruct.specific_fn.3(%tuple.elem0) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc27_3.5(%self.param: ref %AdaptNoncopyableIndirect) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc23_3.5(%self.param: ref %AdaptNoncopyableIndirect) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: --- adapt_copyable_struct.carbon = $adapt_copyable_struct // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/adapter/convert_incomplete.carbon b/toolchain/check/testdata/class/adapter/convert_incomplete.carbon index d4a9e181a05b..5fb9f242ca7d 100644 --- a/toolchain/check/testdata/class/adapter/convert_incomplete.carbon +++ b/toolchain/check/testdata/class/adapter/convert_incomplete.carbon @@ -52,15 +52,12 @@ class Adapter(T: type); class X {} fn F(p: Adapter(X)*) { - // CHECK:STDERR: ╭─┤ fail_incomplete.carbon:[[@LINE+11]]:22 + // CHECK:STDERR: ╭─┤ fail_incomplete.carbon:[[@LINE+8]]:22 // CHECK:STDERR: -> │ let unused x: X* = *p as X*; // CHECK:STDERR: · ┳━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `Adapter(X)` - // CHECK:STDERR: · │ ┃ to `X*` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Adapter(X)` does not implement interface - // CHECK:STDERR: · │ `Core.As(X*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `X*` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused x: X* = *p as X*; diff --git a/toolchain/check/testdata/class/adapter/extend_adapt.carbon b/toolchain/check/testdata/class/adapter/extend_adapt.carbon index 84afd8a8fbcc..36cd448efbd2 100644 --- a/toolchain/check/testdata/class/adapter/extend_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/extend_adapt.carbon @@ -52,7 +52,7 @@ class SomeClassAdapter { } fn F(a: SomeClassAdapter) { - // CHECK:STDERR: ╭─┤ fail_todo_method_access.carbon:[[@LINE+15]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_method_access.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn F(self); // CHECK:STDERR: · ──┬─ // CHECK:STDERR: · ╰──┤ initializing function parameter [InCallToFunctionParam] @@ -60,11 +60,8 @@ fn F(a: SomeClassAdapter) { // CHECK:STDERR: -> │ a.F(); // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `SomeClassAdapter` to - // CHECK:STDERR: · │ ┃ `SomeClass` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `SomeClassAdapter` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(SomeClass)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `SomeClass` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: a.F(); @@ -84,15 +81,12 @@ class SomeClassAdapter { } fn F(a: SomeClassAdapter) -> i32 { - // CHECK:STDERR: ╭─┤ fail_todo_field_access.carbon:[[@LINE+11]]:10 + // CHECK:STDERR: ╭─┤ fail_todo_field_access.carbon:[[@LINE+8]]:10 // CHECK:STDERR: -> │ return a.b; // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `SomeClassAdapter` to `SomeClass` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `SomeClassAdapter` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(SomeClass)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `SomeClassAdapter` to `SomeClass` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return a.b; @@ -381,7 +375,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a // CHECK:STDOUT: %F.ref: %SomeClass.F.type = name_ref F, @SomeClass.%SomeClass.F.decl [concrete = constants.%SomeClass.F] // CHECK:STDOUT: %SomeClass.F.bound: = bound_method %a.ref, %F.ref -// CHECK:STDOUT: %.loc28: %SomeClass = converted %a.ref, [concrete = ] +// CHECK:STDOUT: %.loc25: %SomeClass = converted %a.ref, [concrete = ] // CHECK:STDOUT: %SomeClass.F.call: init %empty_tuple.type = call %SomeClass.F.bound() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -482,8 +476,8 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a // CHECK:STDOUT: %b.ref: %SomeClass.elem = name_ref b, @SomeClass.%field_decl.loc6 [concrete = @SomeClass.%field_decl.loc6] -// CHECK:STDOUT: %.loc25_11.1: %SomeClass = converted %a.ref, [concrete = ] -// CHECK:STDOUT: %.loc25_11.2: %i32 = class_element_access , element1 [concrete = ] +// CHECK:STDOUT: %.loc22_11.1: %SomeClass = converted %a.ref, [concrete = ] +// CHECK:STDOUT: %.loc22_11.2: %i32 = class_element_access , element1 [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon b/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon index 13f57c201427..a4a599f251b5 100644 --- a/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon +++ b/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon @@ -15,15 +15,12 @@ library "[[@TEST_NAME]]"; class Bad { - // CHECK:STDERR: ╭─┤ fail_not_type.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_not_type.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ adapt 100; // CHECK:STDERR: · ┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `Core.IntLiteral` - // CHECK:STDERR: · │ ┃ to `type` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(type)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `type` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: adapt 100; @@ -43,15 +40,12 @@ fn Use(b: Bad) { b.F(); } library "[[@TEST_NAME]]"; class Bad { - // CHECK:STDERR: ╭─┤ fail_extend_not_type.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_extend_not_type.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ extend adapt 100; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `Core.IntLiteral` - // CHECK:STDERR: · │ ┃ to `type` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(type)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `type` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: extend adapt 100; diff --git a/toolchain/check/testdata/class/adapter/fail_adapt_bad_type.carbon b/toolchain/check/testdata/class/adapter/fail_adapt_bad_type.carbon index 061df1e6b9b2..e409894c001f 100644 --- a/toolchain/check/testdata/class/adapter/fail_adapt_bad_type.carbon +++ b/toolchain/check/testdata/class/adapter/fail_adapt_bad_type.carbon @@ -17,15 +17,15 @@ library "[[@TEST_NAME]]"; class Incomplete; class AdaptIncomplete { - // CHECK:STDERR: ╭─┤ fail_incomplete_type.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_incomplete_type.carbon:[[@LINE+11]]:9 // CHECK:STDERR: │ class Incomplete; - // CHECK:STDERR: · ────────┬──────── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ─────┬──── + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ adapt Incomplete; - // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━ - // CHECK:STDERR: · ┗━━┫ error: adapted type `Incomplete` is an incomplete type - // CHECK:STDERR: · ┃ [IncompleteTypeInAdaptDecl] + // CHECK:STDERR: · ━━━━━┳━━━━ + // CHECK:STDERR: · ┗━━┫ error: adapted type `Incomplete` is an incomplete type + // CHECK:STDERR: · ┃ [IncompleteTypeInAdaptDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: adapt Incomplete; diff --git a/toolchain/check/testdata/class/adapter/init_adapt.carbon b/toolchain/check/testdata/class/adapter/init_adapt.carbon index effe14fb5f34..749a135ca0bf 100644 --- a/toolchain/check/testdata/class/adapter/init_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/init_adapt.carbon @@ -56,28 +56,22 @@ let a: C = {.a = 1, .b = 2}; // Cannot implicitly convert between a type and an adapter for the type. -// CHECK:STDERR: ╭─┤ fail_not_implicit.carbon:[[@LINE+11]]:17 +// CHECK:STDERR: ╭─┤ fail_not_implicit.carbon:[[@LINE+8]]:17 // CHECK:STDERR: -> │ let b: AdaptC = a; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `C` to -// CHECK:STDERR: · │ ┃ `AdaptC` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `C` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(AdaptC)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `AdaptC` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let b: AdaptC = a; -// CHECK:STDERR: ╭─┤ fail_not_implicit.carbon:[[@LINE+11]]:12 +// CHECK:STDERR: ╭─┤ fail_not_implicit.carbon:[[@LINE+8]]:12 // CHECK:STDERR: -> │ let c: C = b; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `AdaptC` to -// CHECK:STDERR: · │ ┃ `C` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `AdaptC` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(C)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `C` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let c: C = b; @@ -86,24 +80,20 @@ fn MakeC() -> C; fn MakeAdaptC() -> AdaptC; -// CHECK:STDERR: ╭─┤ fail_not_implicit.carbon:[[@LINE+9]]:1 +// CHECK:STDERR: ╭─┤ fail_not_implicit.carbon:[[@LINE+7]]:1 // CHECK:STDERR: -> │ var d: AdaptC = MakeC(); // CHECK:STDERR: · ━━━━━━┳━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `C` to `AdaptC` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `C` does not implement interface `Core.ImplicitAs(AdaptC)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var d: AdaptC = MakeC(); -// CHECK:STDERR: ╭─┤ fail_not_implicit.carbon:[[@LINE+9]]:1 +// CHECK:STDERR: ╭─┤ fail_not_implicit.carbon:[[@LINE+7]]:1 // CHECK:STDERR: -> │ var e: C = MakeAdaptC(); // CHECK:STDERR: · ━━━━┳━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `AdaptC` to `C` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `AdaptC` does not implement interface `Core.ImplicitAs(C)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var e: C = MakeAdaptC(); @@ -422,12 +412,12 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.98b = value_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %AdaptC.ref.loc28: type = name_ref AdaptC, %AdaptC.decl [concrete = constants.%AdaptC] +// CHECK:STDOUT: %AdaptC.ref.loc25: type = name_ref AdaptC, %AdaptC.decl [concrete = constants.%AdaptC] // CHECK:STDOUT: %b: %AdaptC = wrapper_binding b, [concrete = ] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.720 = value_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %C.ref.loc41: type = name_ref C, %C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc35: type = name_ref C, %C.decl [concrete = constants.%C] // CHECK:STDOUT: %c: %C = wrapper_binding c, [concrete = ] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c.patt: %pattern_type.98b = value_binding_pattern c [concrete = constants.%c.patt] @@ -437,7 +427,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %return.patt: %pattern_type.98b = return_slot_pattern %return.param_patt, %C.ref [concrete = constants.%return.patt.e4a] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc43: Core.Form = init_form %C.ref [concrete = constants.%.a44] +// CHECK:STDOUT: %.loc37: Core.Form = init_form %C.ref [concrete = constants.%.a44] // CHECK:STDOUT: %return.param: ref %C = out_param call_param0 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } @@ -446,19 +436,19 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %return.patt: %pattern_type.720 = return_slot_pattern %return.param_patt, %AdaptC.ref [concrete = constants.%return.patt.794] // CHECK:STDOUT: } { // CHECK:STDOUT: %AdaptC.ref: type = name_ref AdaptC, file.%AdaptC.decl [concrete = constants.%AdaptC] -// CHECK:STDOUT: %.loc45: Core.Form = init_form %AdaptC.ref [concrete = constants.%.624] +// CHECK:STDOUT: %.loc39: Core.Form = init_form %AdaptC.ref [concrete = constants.%.624] // CHECK:STDOUT: %return.param: ref %AdaptC = out_param call_param0 // CHECK:STDOUT: %return: ref %AdaptC = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %d.var: ref %AdaptC = var_storage %d.var_patt [concrete] -// CHECK:STDOUT: %AdaptC.ref.loc56: type = name_ref AdaptC, %AdaptC.decl [concrete = constants.%AdaptC] +// CHECK:STDOUT: %AdaptC.ref.loc48: type = name_ref AdaptC, %AdaptC.decl [concrete = constants.%AdaptC] // CHECK:STDOUT: %d: ref %AdaptC = wrapper_binding d, %d.var [concrete = %d.var] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %d.patt: %pattern_type.720 = ref_binding_pattern d [concrete = constants.%d.patt] // CHECK:STDOUT: %d.var_patt: %pattern_type.720 = var_pattern %d.patt [concrete = constants.%d.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: %e.var: ref %C = var_storage %e.var_patt [concrete] -// CHECK:STDOUT: %C.ref.loc67: type = name_ref C, %C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc57: type = name_ref C, %C.decl [concrete = constants.%C] // CHECK:STDOUT: %e: ref %C = wrapper_binding e, %e.var [concrete = %e.var] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %e.patt: %pattern_type.98b = ref_binding_pattern e [concrete = constants.%e.patt] @@ -525,18 +515,18 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc13_27.12: %C = acquire_value %.loc13_27.11 [concrete = constants.%C.val] // CHECK:STDOUT: %a.global_ref: %C = global_ref file.%a // CHECK:STDOUT: %a.ref: %C = name_ref a, %a.global_ref -// CHECK:STDOUT: %.loc28: %AdaptC = converted %a.ref, [concrete = ] +// CHECK:STDOUT: %.loc25: %AdaptC = converted %a.ref, [concrete = ] // CHECK:STDOUT: %b.ref: %AdaptC = name_ref b, file.%b [concrete = ] -// CHECK:STDOUT: %.loc41: %C = converted %b.ref, [concrete = ] +// CHECK:STDOUT: %.loc35: %C = converted %b.ref, [concrete = ] // CHECK:STDOUT: %MakeC.ref: %MakeC.type = name_ref MakeC, file.%MakeC.decl [concrete = constants.%MakeC] -// CHECK:STDOUT: %.loc56_23: ref %C = temporary_storage -// CHECK:STDOUT: %MakeC.call: init %C to %.loc56_23 = call %MakeC.ref() -// CHECK:STDOUT: %.loc56_1: %AdaptC = converted %MakeC.call, [concrete = ] +// CHECK:STDOUT: %.loc48_23: ref %C = temporary_storage +// CHECK:STDOUT: %MakeC.call: init %C to %.loc48_23 = call %MakeC.ref() +// CHECK:STDOUT: %.loc48_1: %AdaptC = converted %MakeC.call, [concrete = ] // CHECK:STDOUT: assign file.%d.var, // CHECK:STDOUT: %MakeAdaptC.ref: %MakeAdaptC.type = name_ref MakeAdaptC, file.%MakeAdaptC.decl [concrete = constants.%MakeAdaptC] -// CHECK:STDOUT: %.loc67_23: ref %AdaptC = temporary_storage -// CHECK:STDOUT: %MakeAdaptC.call: init %AdaptC to %.loc67_23 = call %MakeAdaptC.ref() -// CHECK:STDOUT: %.loc67_1: %C = converted %MakeAdaptC.call, [concrete = ] +// CHECK:STDOUT: %.loc57_23: ref %AdaptC = temporary_storage +// CHECK:STDOUT: %MakeAdaptC.call: init %AdaptC to %.loc57_23 = call %MakeAdaptC.ref() +// CHECK:STDOUT: %.loc57_1: %C = converted %MakeAdaptC.call, [concrete = ] // CHECK:STDOUT: assign file.%e.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/cross_package_import.carbon b/toolchain/check/testdata/class/cross_package_import.carbon index e34c18ace685..275c897a7655 100644 --- a/toolchain/check/testdata/class/cross_package_import.carbon +++ b/toolchain/check/testdata/class/cross_package_import.carbon @@ -52,18 +52,17 @@ library "[[@TEST_NAME]]"; import Other library "other_extern"; -// CHECK:STDERR: ╭─┤ fail_extern.carbon:[[@LINE+50]]:8 +// CHECK:STDERR: ╭─┤ fail_extern.carbon:[[@LINE+49]]:8 // CHECK:STDERR: -> │ var c: Other.C = {}; // CHECK:STDERR: · ┳━━━━━━ // CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type `C` in name binding // CHECK:STDERR: · ┃ declaration // CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] // CHECK:STDERR: ┆ -// CHECK:STDERR: │ ╭── imported from: fail_extern.carbon [InImport] // CHECK:STDERR: ├─┤ other_extern.carbon // CHECK:STDERR: │ extern class C; -// CHECK:STDERR: · ───────┬─────── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╷ ╭── imported from: fail_todo_merge_define_extern.carbon [InImport] @@ -75,8 +74,8 @@ import Other library "other_extern"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ other_define.carbon // CHECK:STDERR: │ class C {} -// CHECK:STDERR: · ────┬──── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ fail_todo_merge_define_extern.carbon // CHECK:STDERR: │ var c: Other.C = {}; @@ -93,8 +92,8 @@ import Other library "other_extern"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ other_define.carbon // CHECK:STDERR: │ class C {} -// CHECK:STDERR: · ────┬──── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ fail_conflict.carbon // CHECK:STDERR: │ var c: Other.C = {}; @@ -303,7 +302,7 @@ var c: Other.C = {}; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %c.var: ref = var_storage %c.var_patt [concrete = ] -// CHECK:STDOUT: %.loc56: type = splice_block %C.ref [concrete = constants.%C] { +// CHECK:STDOUT: %.loc55: type = splice_block %C.ref [concrete = constants.%C] { // CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [concrete = imports.%Other] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Other.C [concrete = constants.%C] // CHECK:STDOUT: } @@ -318,7 +317,7 @@ var c: Other.C = {}; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc56: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc55: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: assign file.%c.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/extern.carbon b/toolchain/check/testdata/class/extern.carbon index 7e7f92cc52e0..1591e30fa281 100644 --- a/toolchain/check/testdata/class/extern.carbon +++ b/toolchain/check/testdata/class/extern.carbon @@ -51,8 +51,8 @@ library "[[@TEST_NAME]]"; extern class C; // CHECK:STDERR: ╭─┤ fail_decl_fn_in_extern.carbon:[[@LINE+11]]:4 // CHECK:STDERR: │ extern class C; -// CHECK:STDERR: · ───────┬─────── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn C.F(); // CHECK:STDERR: · ┳ @@ -75,8 +75,8 @@ library "[[@TEST_NAME]]"; extern class C; // CHECK:STDERR: ╭─┤ fail_extern_decl_after_extern_decl.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ extern class C; -// CHECK:STDERR: · ───────┬─────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ extern class C; // CHECK:STDERR: · ━━━━━━━┳━━━━━━━ @@ -92,8 +92,8 @@ library "[[@TEST_NAME]]"; extern class C; // CHECK:STDERR: ╭─┤ fail_decl_after_extern_decl.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ extern class C; -// CHECK:STDERR: · ───────┬─────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ class C; // CHECK:STDERR: · ━━━━┳━━━ @@ -124,8 +124,8 @@ library "[[@TEST_NAME]]"; extern class C; // CHECK:STDERR: ╭─┤ fail_def_after_extern_decl.carbon:[[@LINE+11]]:1 // CHECK:STDERR: │ extern class C; -// CHECK:STDERR: · ───────┬─────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ class C {} // CHECK:STDERR: · ━━━━┳━━━━ @@ -142,8 +142,8 @@ library "[[@TEST_NAME]]"; class C; // CHECK:STDERR: ╭─┤ fail_extern_decl_after_decl.carbon:[[@LINE+88]]:1 // CHECK:STDERR: │ class C; -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ extern class C; // CHECK:STDERR: · ━━━━━━━┳━━━━━━━ @@ -159,8 +159,8 @@ class C; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_decl.carbon // CHECK:STDERR: │ extern class C; -// CHECK:STDERR: · ───────┬─────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╷ ╭── imported from: fail_import_decl_then_extern_decl.carbon [InImport] @@ -172,8 +172,8 @@ class C; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ decl.carbon // CHECK:STDERR: │ class C; -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╷ ╭── imported from: fail_import_extern_decl_then_def.carbon [InImport] @@ -185,8 +185,8 @@ class C; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_decl.carbon // CHECK:STDERR: │ extern class C; -// CHECK:STDERR: · ───────┬─────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╷ ╭── imported from: fail_import_ownership_conflict.carbon [InImport] @@ -198,8 +198,8 @@ class C; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_decl.carbon // CHECK:STDERR: │ extern class C; -// CHECK:STDERR: · ───────┬─────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╷ ╭── imported from: fail_import_ownership_conflict.carbon [InImport] @@ -211,8 +211,8 @@ class C; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_decl.carbon // CHECK:STDERR: │ extern class C; -// CHECK:STDERR: · ───────┬─────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╷ ╭── imported from: fail_todo_import_extern_decl_copy.carbon [InImport] @@ -224,8 +224,8 @@ class C; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_decl.carbon // CHECK:STDERR: │ extern class C; -// CHECK:STDERR: · ───────┬─────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: extern class C; @@ -279,8 +279,8 @@ import library "extern_decl"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_decl.carbon // CHECK:STDERR: │ extern class C; -// CHECK:STDERR: · ───────┬─────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: extern class C; @@ -299,8 +299,8 @@ import library "decl"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ decl.carbon // CHECK:STDERR: │ class C; -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: extern class C; @@ -319,8 +319,8 @@ import library "def"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ def.carbon // CHECK:STDERR: │ class C {} -// CHECK:STDERR: · ────┬──── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: extern class C; @@ -339,8 +339,8 @@ import library "def"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ def.carbon // CHECK:STDERR: │ class C {} -// CHECK:STDERR: · ────┬──── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: extern class C; diff --git a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon index 796a27e51319..ec5520682b7b 100644 --- a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon +++ b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon @@ -19,13 +19,11 @@ class B { } fn AccessBInA(a: A) -> i32 { - // CHECK:STDERR: ╭─┤ fail_compound_type_mismatch.carbon:[[@LINE+9]]:10 + // CHECK:STDERR: ╭─┤ fail_compound_type_mismatch.carbon:[[@LINE+7]]:10 // CHECK:STDERR: -> │ return a.(B.b); // CHECK:STDERR: · ━━━┳━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `A` to `B` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `A` does not implement interface `Core.ImplicitAs(B)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return a.(B.b); diff --git a/toolchain/check/testdata/class/fail_import_misuses.carbon b/toolchain/check/testdata/class/fail_import_misuses.carbon index b4fd93f7ffc7..af496b26b9cd 100644 --- a/toolchain/check/testdata/class/fail_import_misuses.carbon +++ b/toolchain/check/testdata/class/fail_import_misuses.carbon @@ -32,25 +32,24 @@ import library "a"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ a.carbon // CHECK:STDERR: │ class Empty { -// CHECK:STDERR: · ──────┬────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ──┬── +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: class Empty { } -// CHECK:STDERR: ╭─┤ fail_b.carbon:[[@LINE+14]]:8 +// CHECK:STDERR: ╭─┤ fail_b.carbon:[[@LINE+13]]:8 // CHECK:STDERR: -> │ var a: Incomplete; // CHECK:STDERR: · ┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type `Incomplete` in name // CHECK:STDERR: · ┃ binding declaration // CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] // CHECK:STDERR: ┆ -// CHECK:STDERR: │ ╭── imported from: fail_b.carbon [InImport] // CHECK:STDERR: ├─┤ a.carbon // CHECK:STDERR: │ class Incomplete; -// CHECK:STDERR: · ────────┬──────── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: · ─────┬──── +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: var a: Incomplete; diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index bdc2b5f11318..2400d4480bbd 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -18,8 +18,8 @@ class Class; // CHECK:STDERR: ╭─┤ fail_forward_decl.carbon:[[@LINE+11]]:4 // CHECK:STDERR: │ class Class; -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: · ──┬── +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn Class.Function() {} // CHECK:STDERR: · ━━┳━━ @@ -32,8 +32,8 @@ fn Class.Function() {} fn CallClassFunction() { // CHECK:STDERR: ╭─┤ fail_forward_decl.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ class Class; - // CHECK:STDERR: · ──────┬───── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ──┬── + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Class.Function(); // CHECK:STDERR: · ━━━━━━━┳━━━━━━ @@ -46,8 +46,8 @@ fn CallClassFunction() { // CHECK:STDERR: ╭─┤ fail_forward_decl.carbon:[[@LINE+12]]:17 // CHECK:STDERR: │ class Class; -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: · ──┬── +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ var global_var: Class; // CHECK:STDERR: · ┳━━━━ @@ -60,8 +60,8 @@ var global_var: Class; // CHECK:STDERR: ╭─┤ fail_forward_decl.carbon:[[@LINE+11]]:24 // CHECK:STDERR: │ class Class; -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: · ──┬── +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn ConvertFromStruct() -> Class { return {}; } // CHECK:STDERR: · ━━━━┳━━━ @@ -74,8 +74,8 @@ fn ConvertFromStruct() -> Class { return {}; } fn G(p: Class*) -> () { // CHECK:STDERR: ╭─┤ fail_forward_decl.carbon:[[@LINE+11]]:10 // CHECK:STDERR: │ class Class; - // CHECK:STDERR: · ──────┬───── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ──┬── + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return p->n; // CHECK:STDERR: · ━━┳━ @@ -89,8 +89,8 @@ fn G(p: Class*) -> () { fn MemberAccess(p: Class*) -> () { // CHECK:STDERR: ╭─┤ fail_forward_decl.carbon:[[@LINE+11]]:11 // CHECK:STDERR: │ class Class; - // CHECK:STDERR: · ──────┬───── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ──┬── + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return (*p).n; // CHECK:STDERR: · ━┳ @@ -103,8 +103,8 @@ fn MemberAccess(p: Class*) -> () { // CHECK:STDERR: ╭─┤ fail_forward_decl.carbon:[[@LINE+11]]:20 // CHECK:STDERR: │ class Class; -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: · ──┬── +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn Copy(p: Class*) -> Class { // CHECK:STDERR: · ━━━━┳━━━ @@ -119,8 +119,8 @@ fn Copy(p: Class*) -> Class { fn Let(p: Class*) { // CHECK:STDERR: ╭─┤ fail_forward_decl.carbon:[[@LINE+12]]:17 // CHECK:STDERR: │ class Class; - // CHECK:STDERR: · ──────┬───── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ──┬── + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let unused c: Class = *p; // CHECK:STDERR: · ┳━━━━ @@ -139,8 +139,8 @@ fn ReturnIncomplete() -> Class; fn CallTakeIncomplete(p: Class*) { // CHECK:STDERR: ╭─┤ fail_forward_decl.carbon:[[@LINE+16]]:18 // CHECK:STDERR: │ class Class; - // CHECK:STDERR: · ──────┬───── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ──┬── + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn TakeIncomplete(c: Class); // CHECK:STDERR: · ────┬─── @@ -157,8 +157,8 @@ fn CallTakeIncomplete(p: Class*) { // CHECK:STDERR: ╭─┤ fail_forward_decl.carbon:[[@LINE+16]]:18 // CHECK:STDERR: │ class Class; - // CHECK:STDERR: · ──────┬───── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ──┬── + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn TakeIncomplete(c: Class); // CHECK:STDERR: · ────┬─── @@ -177,8 +177,8 @@ fn CallTakeIncomplete(p: Class*) { fn CallReturnIncomplete() { // CHECK:STDERR: ╭─┤ fail_forward_decl.carbon:[[@LINE+16]]:3 // CHECK:STDERR: │ class Class; - // CHECK:STDERR: · ──────┬───── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ──┬── + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn ReturnIncomplete() -> Class; // CHECK:STDERR: · ────┬─── diff --git a/toolchain/check/testdata/class/fail_redefinition.carbon b/toolchain/check/testdata/class/fail_redefinition.carbon index bfece9ccd164..1bc89a427284 100644 --- a/toolchain/check/testdata/class/fail_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_redefinition.carbon @@ -18,8 +18,8 @@ class Class { // CHECK:STDERR: ╭─┤ fail_redefinition.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ class Class { -// CHECK:STDERR: · ──────┬────── -// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] +// CHECK:STDERR: · ──┬── +// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ class Class { // CHECK:STDERR: · ━━━━━━┳━━━━━━ @@ -45,8 +45,8 @@ fn Class.G() {} fn Class.H() {} // CHECK:STDERR: ╭─┤ fail_redefinition.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ fn I() {} -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn Class.I() {} // CHECK:STDERR: · ━━━━━━━┳━━━━━━ diff --git a/toolchain/check/testdata/class/fail_var_param.carbon b/toolchain/check/testdata/class/fail_var_param.carbon index 6eb09c1567f1..aa37f9d5df9e 100644 --- a/toolchain/check/testdata/class/fail_var_param.carbon +++ b/toolchain/check/testdata/class/fail_var_param.carbon @@ -14,10 +14,10 @@ // generic type. // CHECK:STDERR: ╭─┤ fail_var_param.carbon:[[@LINE+8]]:13 // CHECK:STDERR: -> │ class C(var x: i32); -// CHECK:STDERR: · ━━━┳━━ -// CHECK:STDERR: · ┗━━┫ error: parameters of generic types must be constant -// CHECK:STDERR: · │ ┃ [GenericParamMustBeConstant] -// CHECK:STDERR: · ╰────┤ `var` parameters are runtime [VarParamIsRuntime] +// CHECK:STDERR: · ┳━━━━━ +// CHECK:STDERR: · ┗━━┫ error: `var` parameter of a generic type; parameters of generic +// CHECK:STDERR: · ┃ types must be constant +// CHECK:STDERR: · ┃ [VarParamIsRuntime] // CHECK:STDERR: ╰──── // CHECK:STDERR: class C(var x: i32); diff --git a/toolchain/check/testdata/class/field/field_initializer.carbon b/toolchain/check/testdata/class/field/field_initializer.carbon index 3254a3b4d1c2..344ca3122a5d 100644 --- a/toolchain/check/testdata/class/field/field_initializer.carbon +++ b/toolchain/check/testdata/class/field/field_initializer.carbon @@ -63,15 +63,12 @@ var C: Class = {.not_a_field = 456}; library "[[@TEST_NAME]]"; class Class { - // CHECK:STDERR: ╭─┤ fail_field_initializer_wrong_type.carbon:[[@LINE+11]]:20 + // CHECK:STDERR: ╭─┤ fail_field_initializer_wrong_type.carbon:[[@LINE+8]]:20 // CHECK:STDERR: -> │ var field: i32 = (); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `()` - // CHECK:STDERR: · │ ┃ to `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `()` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `i32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var field: i32 = (); diff --git a/toolchain/check/testdata/class/field/static.carbon b/toolchain/check/testdata/class/field/static.carbon index 2b261ee6f76c..cbe64957894f 100644 --- a/toolchain/check/testdata/class/field/static.carbon +++ b/toolchain/check/testdata/class/field/static.carbon @@ -45,8 +45,8 @@ class C { fn F() { // CHECK:STDERR: ╭─┤ fail_private_static_field_invalid_access.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ private static var static_field: i32; - // CHECK:STDERR: · ────────┬──────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ C.static_field = 123; // CHECK:STDERR: · ━━━━━━━┳━━━━━━ diff --git a/toolchain/check/testdata/class/generic/adapt.carbon b/toolchain/check/testdata/class/generic/adapt.carbon index 7ec60a8c821d..475e81ee1b6e 100644 --- a/toolchain/check/testdata/class/generic/adapt.carbon +++ b/toolchain/check/testdata/class/generic/adapt.carbon @@ -52,15 +52,12 @@ class Adapter { fn Access(a: Adapter) -> i32 { // TODO: This should presumably work, but the design doesn't say how yet. - // CHECK:STDERR: ╭─┤ fail_todo_extend_adapt_specific_type.carbon:[[@LINE+11]]:10 + // CHECK:STDERR: ╭─┤ fail_todo_extend_adapt_specific_type.carbon:[[@LINE+8]]:10 // CHECK:STDERR: -> │ return a.x; // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Adapter` to - // CHECK:STDERR: · │ ┃ `C(i32)` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Adapter` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(C(i32))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `C(i32)` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return a.x; @@ -89,15 +86,12 @@ import library "extend_adapt_specific_type_library"; fn ImportedAccess(a: Adapter) -> i32 { // TODO: This should presumably work, but the design doesn't say how yet. - // CHECK:STDERR: ╭─┤ fail_todo_import_extend_adapt_specific_type.carbon:[[@LINE+11]]:10 + // CHECK:STDERR: ╭─┤ fail_todo_import_extend_adapt_specific_type.carbon:[[@LINE+8]]:10 // CHECK:STDERR: -> │ return a.x; // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Adapter` to - // CHECK:STDERR: · │ ┃ `C(i32)` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Adapter` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(C(i32))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `C(i32)` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return a.x; @@ -590,8 +584,8 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %Adapter = name_ref a, %a // CHECK:STDOUT: %x.ref: %C.elem.0b0 = name_ref x, @C.%field_decl [concrete = @C.%field_decl] -// CHECK:STDOUT: %.loc25_11.1: %C.4da = converted %a.ref, [concrete = ] -// CHECK:STDOUT: %.loc25_11.2: %i32 = class_element_access , element0 [concrete = ] +// CHECK:STDOUT: %.loc22_11.1: %C.4da = converted %a.ref, [concrete = ] +// CHECK:STDOUT: %.loc22_11.2: %i32 = class_element_access , element0 [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -840,8 +834,8 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %Adapter = name_ref a, %a // CHECK:STDOUT: %x.ref: %C.elem.0b0 = name_ref x, imports.%Main.import_ref.130 [concrete = imports.%field_decl] -// CHECK:STDOUT: %.loc19_11.1: %C.4da = converted %a.ref, [concrete = ] -// CHECK:STDOUT: %.loc19_11.2: %i32 = class_element_access , element0 [concrete = ] +// CHECK:STDOUT: %.loc16_11.1: %C.4da = converted %a.ref, [concrete = ] +// CHECK:STDOUT: %.loc16_11.2: %i32 = class_element_access , element0 [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index c94d304ef523..0a1b2852296e 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -31,8 +31,8 @@ class Class(T: type, N: i32) {} // CHECK:STDERR: ╭─┤ fail_too_few.carbon:[[@LINE+11]]:8 // CHECK:STDERR: │ class Class(T: type, N: i32) {} -// CHECK:STDERR: · ───────────────┬────────────── -// CHECK:STDERR: · ╰──┤ calling generic class declared here [InCallToEntity] +// CHECK:STDERR: · ──┬── +// CHECK:STDERR: · ╰──┤ calling generic class declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ var a: Class(i32*); // CHECK:STDERR: · ━━━━━┳━━━━━ @@ -50,8 +50,8 @@ class Class(T: type, N: i32) {} // CHECK:STDERR: ╭─┤ fail_too_many.carbon:[[@LINE+11]]:8 // CHECK:STDERR: │ class Class(T: type, N: i32) {} -// CHECK:STDERR: · ───────────────┬────────────── -// CHECK:STDERR: · ╰──┤ calling generic class declared here [InCallToEntity] +// CHECK:STDERR: · ──┬── +// CHECK:STDERR: · ╰──┤ calling generic class declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ var a: Class(i32*, 1, 2); // CHECK:STDERR: · ━━━━┳━━━━━━━━━━━━ @@ -67,7 +67,7 @@ library "[[@TEST_NAME]]"; class Class(T: type, N: i32) {} -// CHECK:STDERR: ╭─┤ fail_no_conversion.carbon:[[@LINE+16]]:8 +// CHECK:STDERR: ╭─┤ fail_no_conversion.carbon:[[@LINE+13]]:8 // CHECK:STDERR: │ class Class(T: type, N: i32) {} // CHECK:STDERR: · ───┬─── // CHECK:STDERR: · ╰──┤ initializing generic parameter `T` declared here @@ -76,11 +76,8 @@ class Class(T: type, N: i32) {} // CHECK:STDERR: -> │ var a: Class(5, i32*); // CHECK:STDERR: · ┳━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type -// CHECK:STDERR: · │ ┃ `Core.IntLiteral` to `type` -// CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] -// CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(type)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `Core.IntLiteral` to `type` +// CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: var a: Class(5, i32*); @@ -579,7 +576,7 @@ class Outer(T: type) { // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5] // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete = constants.%ptr] -// CHECK:STDOUT: %.loc22: type = converted %int_5, [concrete = ] +// CHECK:STDOUT: %.loc19: type = converted %int_5, [concrete = ] // CHECK:STDOUT: } // CHECK:STDOUT: %a: = wrapper_binding a, [concrete = ] // CHECK:STDOUT: name_binding_decl { diff --git a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon index 5951673cc7fe..c7fbc7a72aad 100644 --- a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon +++ b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon @@ -21,21 +21,23 @@ base class B {} class A(N: i32) { extend base: B; + // CHECK:STDERR: ╭─┤ fail_derived_to_base.carbon:[[@LINE+13]]:10 + // CHECK:STDERR: -> │ var n: Int(N); + // CHECK:STDERR: · ━━━┳━━ + // CHECK:STDERR: · ┗━━┫ error: integer type width of 0 is not positive + // CHECK:STDERR: · ┃ [IntWidthNotPositive] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ let unused b: B* = a; + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ in monomorphization of `A(0)` here + // CHECK:STDERR: · │ │ [ResolvingSpecificHere] + // CHECK:STDERR: · ╰────┤ in completion of type `A(0)` here [InTypeCompletion] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: var n: Int(N); } fn F(a: A(0)*) { - // CHECK:STDERR: ╭─┤ fail_derived_to_base.carbon:[[@LINE+11]]:22 - // CHECK:STDERR: │ var n: Int(N); - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ integer type width of 0 is not positive [IntWidthNotPositive] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ let unused b: B* = a; - // CHECK:STDERR: · ┳ - // CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific `A(0)` - // CHECK:STDERR: · ┃ [ResolvingSpecificHere] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: let unused b: B* = a; } @@ -176,18 +178,18 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %a.patt: %pattern_type.ada = wrapper_binding_pattern a, %a.param_patt [concrete = constants.%a.patt] // CHECK:STDOUT: } { // CHECK:STDOUT: %a.param: %ptr.0b6 = value_param call_param0 -// CHECK:STDOUT: %.loc12_13: type = splice_block %ptr.loc12 [concrete = constants.%ptr.0b6] { +// CHECK:STDOUT: %.loc25_13: type = splice_block %ptr.loc25 [concrete = constants.%ptr.0b6] { // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [concrete = constants.%A.generic] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %impl.elem0: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] -// CHECK:STDOUT: %bound_method.loc12_12.1: = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %bound_method.loc25_12.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_12.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method.036] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc12_12.2(%int_0) [concrete = constants.%int_0.753] -// CHECK:STDOUT: %.loc12_12.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.753] -// CHECK:STDOUT: %.loc12_12.2: %i32 = converted %int_0, %.loc12_12.1 [concrete = constants.%int_0.753] +// CHECK:STDOUT: %bound_method.loc25_12.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method.036] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc25_12.2(%int_0) [concrete = constants.%int_0.753] +// CHECK:STDOUT: %.loc25_12.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.753] +// CHECK:STDOUT: %.loc25_12.2: %i32 = converted %int_0, %.loc25_12.1 [concrete = constants.%int_0.753] // CHECK:STDOUT: %A: type = class_type @A, @A(constants.%int_0.753) [concrete = constants.%A.10a] -// CHECK:STDOUT: %ptr.loc12: type = ptr_type %A [concrete = constants.%ptr.0b6] +// CHECK:STDOUT: %ptr.loc25: type = ptr_type %A [concrete = constants.%ptr.0b6] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.0b6 = wrapper_binding a, %a.param // CHECK:STDOUT: } @@ -211,33 +213,33 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %A: type = class_type @A, @A(%N.loc6_10.1) [symbolic = %A (constants.%A.2ee)] // CHECK:STDOUT: %A.elem.loc7: type = unbound_element_type %A, constants.%B [symbolic = %A.elem.loc7 (constants.%A.elem.1fa)] // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound: = bound_method %N.loc6_10.1, constants.%Int.as.ImplicitAs.impl.Convert.779 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound.de4)] -// CHECK:STDOUT: %bound_method.loc9_14.3: = bound_method %N.loc6_10.1, constants.%Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc9_14.3 (constants.%bound_method.2e8)] -// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc9_14.2: init Core.IntLiteral = call %bound_method.loc9_14.3(%N.loc6_10.1) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc9_14.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %iN.builtin: type = int_type signed, %Int.as.ImplicitAs.impl.Convert.call.loc9_14.2 [symbolic = %iN.builtin (constants.%iN.builtin.2cb)] +// CHECK:STDOUT: %bound_method.loc22_14.3: = bound_method %N.loc6_10.1, constants.%Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc22_14.3 (constants.%bound_method.2e8)] +// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc22_14.2: init Core.IntLiteral = call %bound_method.loc22_14.3(%N.loc6_10.1) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc22_14.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %iN.builtin: type = int_type signed, %Int.as.ImplicitAs.impl.Convert.call.loc22_14.2 [symbolic = %iN.builtin (constants.%iN.builtin.2cb)] // CHECK:STDOUT: %require_complete: = require_complete_type %iN.builtin [symbolic = %require_complete (constants.%require_complete.23a)] -// CHECK:STDOUT: %A.elem.loc9: type = unbound_element_type %A, %iN.builtin [symbolic = %A.elem.loc9 (constants.%A.elem.b93)] +// CHECK:STDOUT: %A.elem.loc22: type = unbound_element_type %A, %iN.builtin [symbolic = %A.elem.loc22 (constants.%A.elem.b93)] // CHECK:STDOUT: %struct_type.base.n: type = struct_type {.base: %B, .n: @A.%iN.builtin (%iN.builtin.2cb)} [symbolic = %struct_type.base.n (constants.%struct_type.base.n)] -// CHECK:STDOUT: %complete_type.loc10_1.2: = complete_type_witness %struct_type.base.n [symbolic = %complete_type.loc10_1.2 (constants.%complete_type.642)] +// CHECK:STDOUT: %complete_type.loc23_1.2: = complete_type_witness %struct_type.base.n [symbolic = %complete_type.loc23_1.2 (constants.%complete_type.642)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B] // CHECK:STDOUT: %.loc7: @A.%A.elem.loc7 (%A.elem.1fa) = base_decl %B.ref, element0 [concrete] -// CHECK:STDOUT: %field_decl: @A.%A.elem.loc9 (%A.elem.b93) = field_decl n, element1, %.loc9_15.2 in [concrete] { +// CHECK:STDOUT: %field_decl: @A.%A.elem.loc22 (%A.elem.b93) = field_decl n, element1, %.loc22_15.2 in [concrete] { // CHECK:STDOUT: %Int.ref: %Int.type.9c0 = name_ref Int, file.%Int.decl [concrete = constants.%Int.c4a] // CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc6_10.2 [symbolic = %N.loc6_10.1 (constants.%N.c34)] // CHECK:STDOUT: %impl.elem0: %.ce7 = impl_witness_access constants.%ImplicitAs.impl_witness.323, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.779] -// CHECK:STDOUT: %bound_method.loc9_14.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound.de4)] +// CHECK:STDOUT: %bound_method.loc22_14.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound.de4)] // 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.loc9_14.2: = bound_method %N.ref, %specific_fn [symbolic = %bound_method.loc9_14.3 (constants.%bound_method.2e8)] -// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc9_14.1: init Core.IntLiteral = call %bound_method.loc9_14.2(%N.ref) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc9_14.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %.loc9_14.1: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call.loc9_14.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc9_14.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %.loc9_14.2: Core.IntLiteral = converted %N.ref, %.loc9_14.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc9_14.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %Int.call: init type = call %Int.ref(%.loc9_14.2) [symbolic = %iN.builtin (constants.%iN.builtin.2cb)] -// CHECK:STDOUT: %.loc9_15.1: type = value_of_initializer %Int.call [symbolic = %iN.builtin (constants.%iN.builtin.2cb)] -// CHECK:STDOUT: %.loc9_15.2: type = converted %Int.call, %.loc9_15.1 [symbolic = %iN.builtin (constants.%iN.builtin.2cb)] +// CHECK:STDOUT: %bound_method.loc22_14.2: = bound_method %N.ref, %specific_fn [symbolic = %bound_method.loc22_14.3 (constants.%bound_method.2e8)] +// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc22_14.1: init Core.IntLiteral = call %bound_method.loc22_14.2(%N.ref) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc22_14.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %.loc22_14.1: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call.loc22_14.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc22_14.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %.loc22_14.2: Core.IntLiteral = converted %N.ref, %.loc22_14.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc22_14.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %Int.call: init type = call %Int.ref(%.loc22_14.2) [symbolic = %iN.builtin (constants.%iN.builtin.2cb)] +// CHECK:STDOUT: %.loc22_15.1: type = value_of_initializer %Int.call [symbolic = %iN.builtin (constants.%iN.builtin.2cb)] +// CHECK:STDOUT: %.loc22_15.2: type = converted %Int.call, %.loc22_15.1 [symbolic = %iN.builtin (constants.%iN.builtin.2cb)] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type.loc10_1.1: = complete_type_witness constants.%struct_type.base.n [symbolic = %complete_type.loc10_1.2 (constants.%complete_type.642)] -// CHECK:STDOUT: complete_type_witness = %complete_type.loc10_1.1 +// CHECK:STDOUT: %complete_type.loc23_1.1: = complete_type_witness constants.%struct_type.base.n [symbolic = %complete_type.loc23_1.2 (constants.%complete_type.642)] +// CHECK:STDOUT: complete_type_witness = %complete_type.loc23_1.1 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A.2ee @@ -255,15 +257,15 @@ fn F(a: A(0)*) { // CHECK:STDOUT: fn @F(%a.param: %ptr.0b6) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %ptr.0b6 = name_ref a, %a -// CHECK:STDOUT: %.loc24_22.1: ref %A.10a = deref %a.ref -// CHECK:STDOUT: %.loc24_22.2: ref %B = class_element_access %.loc24_22.1, element0 -// CHECK:STDOUT: %addr: %ptr.432 = addr_of %.loc24_22.2 -// CHECK:STDOUT: %.loc24_22.3: %ptr.432 = converted %a.ref, %addr -// CHECK:STDOUT: %.loc24_18: type = splice_block %ptr.loc24 [concrete = constants.%ptr.432] { +// CHECK:STDOUT: %.loc26_22.1: ref %A.10a = deref %a.ref +// CHECK:STDOUT: %.loc26_22.2: ref %B = class_element_access %.loc26_22.1, element0 +// CHECK:STDOUT: %addr: %ptr.432 = addr_of %.loc26_22.2 +// CHECK:STDOUT: %.loc26_22.3: %ptr.432 = converted %a.ref, %addr +// CHECK:STDOUT: %.loc26_18: type = splice_block %ptr.loc26 [concrete = constants.%ptr.432] { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B] -// CHECK:STDOUT: %ptr.loc24: type = ptr_type %B.ref [concrete = constants.%ptr.432] +// CHECK:STDOUT: %ptr.loc26: type = ptr_type %B.ref [concrete = constants.%ptr.432] // CHECK:STDOUT: } -// CHECK:STDOUT: %b: %ptr.432 = wrapper_binding b, %.loc24_22.3 +// CHECK:STDOUT: %b: %ptr.432 = wrapper_binding b, %.loc26_22.3 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.3c8 = value_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: } @@ -283,12 +285,12 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %A => constants.%A.10a // CHECK:STDOUT: %A.elem.loc7 => constants.%A.elem.093 // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound => constants.%Int.as.ImplicitAs.impl.Convert.bound.741 -// CHECK:STDOUT: %bound_method.loc9_14.3 => constants.%bound_method.ae8 -// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc9_14.2 => constants.%int_0.5c6 +// CHECK:STDOUT: %bound_method.loc22_14.3 => constants.%bound_method.ae8 +// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc22_14.2 => constants.%int_0.5c6 // CHECK:STDOUT: %iN.builtin => // CHECK:STDOUT: %require_complete => -// CHECK:STDOUT: %A.elem.loc9 => +// CHECK:STDOUT: %A.elem.loc22 => // CHECK:STDOUT: %struct_type.base.n => -// CHECK:STDOUT: %complete_type.loc10_1.2 => +// CHECK:STDOUT: %complete_type.loc23_1.2 => // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 8188a108b078..77d5773f0b91 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -58,15 +58,12 @@ library "[[@TEST_NAME]]"; import library "foo"; fn Use() { - // CHECK:STDERR: ╭─┤ fail_generic_arg_mismatch.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_generic_arg_mismatch.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ var unused v: CompleteClass(i32*) = F(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `CompleteClass(i32)` - // CHECK:STDERR: · │ ┃ to `CompleteClass(i32*)` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `CompleteClass(i32)` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(CompleteClass(i32*))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `CompleteClass(i32*)` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused v: CompleteClass(i32*) = F(); @@ -818,14 +815,14 @@ class Class(U: type) { // CHECK:STDOUT: %T.09f: %SubobjectDestroy.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.type.dea: type = fn_type @T.as_type.as.DestroyImpl.impl.Op, @T.as_type.as.DestroyImpl.impl(%T.09f) [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.6e5: %T.as_type.as.DestroyImpl.impl.Op.type.dea = struct_value () [symbolic] -// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.1: type = fn_type @SubobjectDestroy.WithSelf.Op.loc17_3.1 [concrete] +// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.1: type = fn_type @SubobjectDestroy.WithSelf.Op.loc14_3.1 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.1: %SubobjectDestroy.WithSelf.Op.type.6870fd.1 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.1: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.1), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.49a: %SubobjectDestroy.type = facet_value %i32, (%custom_witness.b80ef6.1) [concrete] // CHECK:STDOUT: %DestroyImpl.impl_witness.077: = impl_witness imports.%DestroyImpl.impl_witness_table, @T.as_type.as.DestroyImpl.impl(%SubobjectDestroy.facet.49a) [concrete] // CHECK:STDOUT: %Destroy.facet.c2b: %Destroy.type = facet_value %i32, (%DestroyImpl.impl_witness.077, %custom_witness.b80ef6.1) [concrete] // CHECK:STDOUT: %SelfDestruct.specific_fn.845: = specific_function %SelfDestruct, @SelfDestruct(%Destroy.facet.c2b) [concrete] -// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.3: type = fn_type @SubobjectDestroy.WithSelf.Op.loc17_3.3 [concrete] +// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.3: type = fn_type @SubobjectDestroy.WithSelf.Op.loc14_3.3 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.3: %SubobjectDestroy.WithSelf.Op.type.6870fd.3 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.3: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.3), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.e3b: %SubobjectDestroy.type = facet_value %CompleteClass.860, (%custom_witness.b80ef6.3) [concrete] @@ -897,11 +894,11 @@ class Class(U: type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %v.var: ref %CompleteClass.860 = var_storage %v.var_patt // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%Main.F [concrete = constants.%F] -// CHECK:STDOUT: %.loc17_41: ref %CompleteClass.09c = temporary_storage -// CHECK:STDOUT: %F.call: init %CompleteClass.09c to %.loc17_41 = call %F.ref() -// CHECK:STDOUT: %.loc17_3.1: %CompleteClass.860 = converted %F.call, [concrete = ] +// CHECK:STDOUT: %.loc14_41: ref %CompleteClass.09c = temporary_storage +// CHECK:STDOUT: %F.call: init %CompleteClass.09c to %.loc14_41 = call %F.ref() +// CHECK:STDOUT: %.loc14_3.1: %CompleteClass.860 = converted %F.call, [concrete = ] // CHECK:STDOUT: assign %v.var, -// CHECK:STDOUT: %.loc17_35: type = splice_block %CompleteClass [concrete = constants.%CompleteClass.860] { +// CHECK:STDOUT: %.loc14_35: type = splice_block %CompleteClass [concrete = constants.%CompleteClass.860] { // CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%Main.CompleteClass [concrete = constants.%CompleteClass.generic] // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete = constants.%ptr.a17] @@ -912,10 +909,10 @@ class Class(U: type) { // CHECK:STDOUT: %v.patt: %pattern_type.c65 = ref_binding_pattern v [concrete = constants.%v.patt] // CHECK:STDOUT: %v.var_patt: %pattern_type.c65 = var_pattern %v.patt [concrete = constants.%v.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.facet.loc17_3.1: %Destroy.type = facet_value constants.%CompleteClass.860, (constants.%DestroyImpl.impl_witness.766, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet.336] -// CHECK:STDOUT: %.loc17_3.2: %Destroy.type = converted constants.%CompleteClass.860, %Destroy.facet.loc17_3.1 [concrete = constants.%Destroy.facet.336] -// CHECK:STDOUT: %Destroy.facet.loc17_3.2: %Destroy.type = facet_value constants.%CompleteClass.860, (constants.%DestroyImpl.impl_witness.766, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet.336] -// CHECK:STDOUT: %.loc17_3.3: %Destroy.type = converted constants.%CompleteClass.860, %Destroy.facet.loc17_3.2 [concrete = constants.%Destroy.facet.336] +// CHECK:STDOUT: %Destroy.facet.loc14_3.1: %Destroy.type = facet_value constants.%CompleteClass.860, (constants.%DestroyImpl.impl_witness.766, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet.336] +// CHECK:STDOUT: %.loc14_3.2: %Destroy.type = converted constants.%CompleteClass.860, %Destroy.facet.loc14_3.1 [concrete = constants.%Destroy.facet.336] +// CHECK:STDOUT: %Destroy.facet.loc14_3.2: %Destroy.type = facet_value constants.%CompleteClass.860, (constants.%DestroyImpl.impl_witness.766, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet.336] +// CHECK:STDOUT: %.loc14_3.3: %Destroy.type = converted constants.%CompleteClass.860, %Destroy.facet.loc14_3.2 [concrete = constants.%Destroy.facet.336] // CHECK:STDOUT: %SelfDestruct.specific_fn: = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet.336) [concrete = constants.%SelfDestruct.specific_fn.826] // CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%v.var) // CHECK:STDOUT: return @@ -929,30 +926,30 @@ class Class(U: type) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F [from "foo.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc17_3.1(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc14_3.1(%self.param: ref %i32) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc17_3.2(%self.param: ref %struct_type.n) { +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc14_3.2(%self.param: ref %struct_type.n) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc17_3.1: ref %i32 = struct_access %self.param, element0 -// CHECK:STDOUT: %Destroy.facet.loc17_3.1: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] -// CHECK:STDOUT: %.loc17_3.2: %Destroy.type = converted constants.%i32, %Destroy.facet.loc17_3.1 [concrete = constants.%Destroy.facet.c2b] -// CHECK:STDOUT: %Destroy.facet.loc17_3.2: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] -// CHECK:STDOUT: %.loc17_3.3: %Destroy.type = converted constants.%i32, %Destroy.facet.loc17_3.2 [concrete = constants.%Destroy.facet.c2b] +// CHECK:STDOUT: %.loc14_3.1: ref %i32 = struct_access %self.param, element0 +// CHECK:STDOUT: %Destroy.facet.loc14_3.1: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] +// CHECK:STDOUT: %.loc14_3.2: %Destroy.type = converted constants.%i32, %Destroy.facet.loc14_3.1 [concrete = constants.%Destroy.facet.c2b] +// CHECK:STDOUT: %Destroy.facet.loc14_3.2: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] +// CHECK:STDOUT: %.loc14_3.3: %Destroy.type = converted constants.%i32, %Destroy.facet.loc14_3.2 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %SelfDestruct.specific_fn: = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet.c2b) [concrete = constants.%SelfDestruct.specific_fn.845] -// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc17_3.1) +// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc14_3.1) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc17_3.3(%self.param: ref %CompleteClass.860) { +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc14_3.3(%self.param: ref %CompleteClass.860) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: %CompleteClass.elem.609 = name_ref n, imports.%Main.import_ref.14b [concrete = imports.%field_decl] -// CHECK:STDOUT: %.loc17_3.1: ref %i32 = class_element_access %self.param, element0 -// CHECK:STDOUT: %Destroy.facet.loc17_3.1: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] -// CHECK:STDOUT: %.loc17_3.2: %Destroy.type = converted constants.%i32, %Destroy.facet.loc17_3.1 [concrete = constants.%Destroy.facet.c2b] -// CHECK:STDOUT: %Destroy.facet.loc17_3.2: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] -// CHECK:STDOUT: %.loc17_3.3: %Destroy.type = converted constants.%i32, %Destroy.facet.loc17_3.2 [concrete = constants.%Destroy.facet.c2b] +// CHECK:STDOUT: %.loc14_3.1: ref %i32 = class_element_access %self.param, element0 +// CHECK:STDOUT: %Destroy.facet.loc14_3.1: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] +// CHECK:STDOUT: %.loc14_3.2: %Destroy.type = converted constants.%i32, %Destroy.facet.loc14_3.1 [concrete = constants.%Destroy.facet.c2b] +// CHECK:STDOUT: %Destroy.facet.loc14_3.2: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80ef6.1) [concrete = constants.%Destroy.facet.c2b] +// CHECK:STDOUT: %.loc14_3.3: %Destroy.type = converted constants.%i32, %Destroy.facet.loc14_3.2 [concrete = constants.%Destroy.facet.c2b] // CHECK:STDOUT: %SelfDestruct.specific_fn: = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet.c2b) [concrete = constants.%SelfDestruct.specific_fn.845] -// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc17_3.1) +// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc14_3.1) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index 5a171f8bc2e8..e994a472241a 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -20,15 +20,12 @@ class NoParams {} class EmptyParams() {} var v: NoParams; -// CHECK:STDERR: ╭─┤ fail_empty_params.carbon:[[@LINE+11]]:1 +// CHECK:STDERR: ╭─┤ fail_empty_params.carbon:[[@LINE+8]]:1 // CHECK:STDERR: -> │ var w: EmptyParams() = v; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `NoParams` to -// CHECK:STDERR: · │ ┃ `EmptyParams()` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `NoParams` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(EmptyParams())` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `EmptyParams()` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var w: EmptyParams() = v; @@ -45,15 +42,12 @@ class Outer(T: type) { var v: Outer({}*); // TODO: It would be nice to include the `Outer({}*).` prefix in the name of `Inner`. -// CHECK:STDERR: ╭─┤ fail_nested.carbon:[[@LINE+11]]:1 +// CHECK:STDERR: ╭─┤ fail_nested.carbon:[[@LINE+8]]:1 // CHECK:STDERR: -> │ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Outer({}*)` to -// CHECK:STDERR: · │ ┃ `Inner({.a: i32}*)` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `Outer({}*)` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(Inner({.a: i32}*))` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `Inner({.a: i32}*)` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var w: Outer({}*).Inner({.a: i32}*) = v; @@ -64,13 +58,11 @@ library "[[@TEST_NAME]]"; class C(N: i32) {} -// CHECK:STDERR: ╭─┤ fail_int_value.carbon:[[@LINE+9]]:1 +// CHECK:STDERR: ╭─┤ fail_int_value.carbon:[[@LINE+7]]:1 // CHECK:STDERR: -> │ var v: C(123) = (); // CHECK:STDERR: · ━━━━━━┳━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `()` to `C(123)` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `()` does not implement interface `Core.ImplicitAs(C(123))` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var v: C(123) = (); @@ -86,15 +78,12 @@ class D { class E(F: D) {} -// CHECK:STDERR: ╭─┤ fail_class_param.carbon:[[@LINE+11]]:1 +// CHECK:STDERR: ╭─┤ fail_class_param.carbon:[[@LINE+8]]:1 // CHECK:STDERR: -> │ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `E({.a = 3, .b = 4})` -// CHECK:STDERR: · │ ┃ to `E({.a = 1, .b = 2})` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `E({.a = 3, .b = 4})` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(E({.a = 1, .b = 2}))` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ to `E({.a = 1, .b = 2})` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); @@ -160,7 +149,7 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %v.var_patt: %pattern_type.c07 = var_pattern %v.patt [concrete = constants.%v.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: %w.var: ref %EmptyParams = var_storage %w.var_patt [concrete] -// CHECK:STDOUT: %.loc19: type = splice_block %EmptyParams [concrete = constants.%EmptyParams] { +// CHECK:STDOUT: %.loc16: type = splice_block %EmptyParams [concrete = constants.%EmptyParams] { // CHECK:STDOUT: %EmptyParams.ref: %EmptyParams.type = name_ref EmptyParams, %EmptyParams.decl [concrete = constants.%EmptyParams.generic] // CHECK:STDOUT: %EmptyParams: type = class_type @EmptyParams [concrete = constants.%EmptyParams] // CHECK:STDOUT: } @@ -198,7 +187,7 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.call: init %NoParams to %.loc7_1 = call %T.as.DefaultOrUnformed.impl.Op.specific_fn() // CHECK:STDOUT: assign file.%v.var, %T.as.DefaultOrUnformed.impl.Op.call // CHECK:STDOUT: %v.ref: ref %NoParams = name_ref v, file.%v [concrete = file.%v.var] -// CHECK:STDOUT: %.loc19: %EmptyParams = converted %v.ref, [concrete = ] +// CHECK:STDOUT: %.loc16: %EmptyParams = converted %v.ref, [concrete = ] // CHECK:STDOUT: assign file.%w.var, // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -297,17 +286,17 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %v.var_patt: %pattern_type.dbc = var_pattern %v.patt [concrete = constants.%v.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: %w.var: ref %Inner.8dc = var_storage %w.var_patt [concrete] -// CHECK:STDOUT: %.loc23_35: type = splice_block %Inner [concrete = constants.%Inner.8dc] { -// CHECK:STDOUT: %Outer.ref.loc23: %Outer.type = name_ref Outer, %Outer.decl [concrete = constants.%Outer.generic] -// CHECK:STDOUT: %.loc23_15: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc23_16: type = converted %.loc23_15, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %ptr.loc23_16: type = ptr_type %.loc23_16 [concrete = constants.%ptr.c28] -// CHECK:STDOUT: %Outer.loc23: type = class_type @Outer, @Outer(constants.%ptr.c28) [concrete = constants.%Outer.856] -// CHECK:STDOUT: %.loc23_18: %Inner.type.894 = specific_constant @Outer.%Inner.decl, @Outer(constants.%ptr.c28) [concrete = constants.%Inner.generic.787] -// CHECK:STDOUT: %Inner.ref: %Inner.type.894 = name_ref Inner, %.loc23_18 [concrete = constants.%Inner.generic.787] +// CHECK:STDOUT: %.loc20_35: type = splice_block %Inner [concrete = constants.%Inner.8dc] { +// CHECK:STDOUT: %Outer.ref.loc20: %Outer.type = name_ref Outer, %Outer.decl [concrete = constants.%Outer.generic] +// CHECK:STDOUT: %.loc20_15: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc20_16: type = converted %.loc20_15, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %ptr.loc20_16: type = ptr_type %.loc20_16 [concrete = constants.%ptr.c28] +// CHECK:STDOUT: %Outer.loc20: type = class_type @Outer, @Outer(constants.%ptr.c28) [concrete = constants.%Outer.856] +// CHECK:STDOUT: %.loc20_18: %Inner.type.894 = specific_constant @Outer.%Inner.decl, @Outer(constants.%ptr.c28) [concrete = constants.%Inner.generic.787] +// CHECK:STDOUT: %Inner.ref: %Inner.type.894 = name_ref Inner, %.loc20_18 [concrete = constants.%Inner.generic.787] // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [concrete = constants.%struct_type.a] -// CHECK:STDOUT: %ptr.loc23_34: type = ptr_type %struct_type.a [concrete = constants.%ptr.54f] +// CHECK:STDOUT: %ptr.loc20_34: type = ptr_type %struct_type.a [concrete = constants.%ptr.54f] // CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(constants.%ptr.c28, constants.%ptr.54f) [concrete = constants.%Inner.8dc] // CHECK:STDOUT: } // CHECK:STDOUT: %w: ref %Inner.8dc = wrapper_binding w, %w.var [concrete = %w.var] @@ -370,7 +359,7 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.call: init %Outer.856 to %.loc9_1 = call %T.as.DefaultOrUnformed.impl.Op.specific_fn() // CHECK:STDOUT: assign file.%v.var, %T.as.DefaultOrUnformed.impl.Op.call // CHECK:STDOUT: %v.ref: ref %Outer.856 = name_ref v, file.%v [concrete = file.%v.var] -// CHECK:STDOUT: %.loc23: %Inner.8dc = converted %v.ref, [concrete = ] +// CHECK:STDOUT: %.loc20: %Inner.8dc = converted %v.ref, [concrete = ] // CHECK:STDOUT: assign file.%w.var, // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -473,16 +462,16 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %N.loc4_10.2: %i32 = symbolic_binding N, 0 [symbolic = %N.loc4_10.1 (constants.%N.c34)] // CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref %C.a98 = var_storage %v.var_patt [concrete] -// CHECK:STDOUT: %.loc15_13.1: type = splice_block %C [concrete = constants.%C.a98] { +// CHECK:STDOUT: %.loc13_13.1: type = splice_block %C [concrete = constants.%C.a98] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete = constants.%int_123.fff] // CHECK:STDOUT: %impl.elem0: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] -// CHECK:STDOUT: %bound_method.loc15_13.1: = bound_method %int_123, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %bound_method.loc13_13.1: = bound_method %int_123, %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.loc15_13.2: = bound_method %int_123, %specific_fn [concrete = constants.%bound_method] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc15_13.2(%int_123) [concrete = constants.%int_123.c07] -// CHECK:STDOUT: %.loc15_13.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_123.c07] -// CHECK:STDOUT: %.loc15_13.3: %i32 = converted %int_123, %.loc15_13.2 [concrete = constants.%int_123.c07] +// CHECK:STDOUT: %bound_method.loc13_13.2: = bound_method %int_123, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc13_13.2(%int_123) [concrete = constants.%int_123.c07] +// CHECK:STDOUT: %.loc13_13.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_123.c07] +// CHECK:STDOUT: %.loc13_13.3: %i32 = converted %int_123, %.loc13_13.2 [concrete = constants.%int_123.c07] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_123.c07) [concrete = constants.%C.a98] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref %C.a98 = wrapper_binding v, %v.var [concrete = %v.var] @@ -509,8 +498,8 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15_18: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc15_1: %C.a98 = converted %.loc15_18, [concrete = ] +// CHECK:STDOUT: %.loc13_18: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc13_1: %C.a98 = converted %.loc13_18, [concrete = ] // CHECK:STDOUT: assign file.%v.var, // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -625,32 +614,32 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %F.loc9_10.2: %D = symbolic_binding F, 0 [symbolic = %F.loc9_10.1 (constants.%F)] // CHECK:STDOUT: } // CHECK:STDOUT: %g.var: ref %E.468 = var_storage %g.var_patt [concrete] -// CHECK:STDOUT: %.loc22_26.1: type = splice_block %E [concrete = constants.%E.468] { +// CHECK:STDOUT: %.loc19_26.1: type = splice_block %E [concrete = constants.%E.468] { // CHECK:STDOUT: %E.ref: %E.type = name_ref E, %E.decl [concrete = constants.%E.generic] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc22_25.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) [concrete = constants.%struct.4aa] -// CHECK:STDOUT: %impl.elem0.loc22_25.1: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] -// CHECK:STDOUT: %bound_method.loc22_25.1: = bound_method %int_1, %impl.elem0.loc22_25.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.282] -// CHECK:STDOUT: %specific_fn.loc22_25.1: = specific_function %impl.elem0.loc22_25.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc22_25.2: = bound_method %int_1, %specific_fn.loc22_25.1 [concrete = constants.%bound_method.3bd] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22_25.1: init %i32 = call %bound_method.loc22_25.2(%int_1) [concrete = constants.%int_1.68a] -// CHECK:STDOUT: %.loc22_25.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22_25.1 [concrete = constants.%int_1.68a] -// CHECK:STDOUT: %.loc22_25.3: ref %D = temporary_storage -// CHECK:STDOUT: %.loc22_25.4: ref %i32 = class_element_access %.loc22_25.3, element0 -// CHECK:STDOUT: %.loc22_25.5: init %i32 to %.loc22_25.4 = in_place_init %.loc22_25.2 [concrete = constants.%int_1.68a] -// CHECK:STDOUT: %impl.elem0.loc22_25.2: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] -// CHECK:STDOUT: %bound_method.loc22_25.3: = bound_method %int_2, %impl.elem0.loc22_25.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.8a6] -// CHECK:STDOUT: %specific_fn.loc22_25.2: = specific_function %impl.elem0.loc22_25.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc22_25.4: = bound_method %int_2, %specific_fn.loc22_25.2 [concrete = constants.%bound_method.a55] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22_25.2: init %i32 = call %bound_method.loc22_25.4(%int_2) [concrete = constants.%int_2.2e0] -// CHECK:STDOUT: %.loc22_25.6: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22_25.2 [concrete = constants.%int_2.2e0] -// CHECK:STDOUT: %.loc22_25.7: ref %i32 = class_element_access %.loc22_25.3, element1 -// CHECK:STDOUT: %.loc22_25.8: init %i32 to %.loc22_25.7 = in_place_init %.loc22_25.6 [concrete = constants.%int_2.2e0] -// CHECK:STDOUT: %.loc22_25.9: init %D to %.loc22_25.3 = class_init (%.loc22_25.5, %.loc22_25.8) [concrete = constants.%D.val.b5e] -// CHECK:STDOUT: %.loc22_26.2: init %D = converted %.loc22_25.1, %.loc22_25.9 [concrete = constants.%D.val.b5e] -// CHECK:STDOUT: %.loc22_26.3: ref %D = temporary %.loc22_25.3, %.loc22_26.2 [concrete = constants.%.738] -// CHECK:STDOUT: %.loc22_26.4: %D = acquire_value %.loc22_26.3 [concrete = constants.%D.val.b5e] +// CHECK:STDOUT: %.loc19_25.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) [concrete = constants.%struct.4aa] +// CHECK:STDOUT: %impl.elem0.loc19_25.1: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] +// CHECK:STDOUT: %bound_method.loc19_25.1: = bound_method %int_1, %impl.elem0.loc19_25.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.282] +// CHECK:STDOUT: %specific_fn.loc19_25.1: = specific_function %impl.elem0.loc19_25.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc19_25.2: = bound_method %int_1, %specific_fn.loc19_25.1 [concrete = constants.%bound_method.3bd] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc19_25.1: init %i32 = call %bound_method.loc19_25.2(%int_1) [concrete = constants.%int_1.68a] +// CHECK:STDOUT: %.loc19_25.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc19_25.1 [concrete = constants.%int_1.68a] +// CHECK:STDOUT: %.loc19_25.3: ref %D = temporary_storage +// CHECK:STDOUT: %.loc19_25.4: ref %i32 = class_element_access %.loc19_25.3, element0 +// CHECK:STDOUT: %.loc19_25.5: init %i32 to %.loc19_25.4 = in_place_init %.loc19_25.2 [concrete = constants.%int_1.68a] +// CHECK:STDOUT: %impl.elem0.loc19_25.2: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] +// CHECK:STDOUT: %bound_method.loc19_25.3: = bound_method %int_2, %impl.elem0.loc19_25.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.8a6] +// CHECK:STDOUT: %specific_fn.loc19_25.2: = specific_function %impl.elem0.loc19_25.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc19_25.4: = bound_method %int_2, %specific_fn.loc19_25.2 [concrete = constants.%bound_method.a55] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc19_25.2: init %i32 = call %bound_method.loc19_25.4(%int_2) [concrete = constants.%int_2.2e0] +// CHECK:STDOUT: %.loc19_25.6: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc19_25.2 [concrete = constants.%int_2.2e0] +// CHECK:STDOUT: %.loc19_25.7: ref %i32 = class_element_access %.loc19_25.3, element1 +// CHECK:STDOUT: %.loc19_25.8: init %i32 to %.loc19_25.7 = in_place_init %.loc19_25.6 [concrete = constants.%int_2.2e0] +// CHECK:STDOUT: %.loc19_25.9: init %D to %.loc19_25.3 = class_init (%.loc19_25.5, %.loc19_25.8) [concrete = constants.%D.val.b5e] +// CHECK:STDOUT: %.loc19_26.2: init %D = converted %.loc19_25.1, %.loc19_25.9 [concrete = constants.%D.val.b5e] +// CHECK:STDOUT: %.loc19_26.3: ref %D = temporary %.loc19_25.3, %.loc19_26.2 [concrete = constants.%.738] +// CHECK:STDOUT: %.loc19_26.4: %D = acquire_value %.loc19_26.3 [concrete = constants.%D.val.b5e] // CHECK:STDOUT: %E: type = class_type @E, @E(constants.%D.val.b5e) [concrete = constants.%E.468] // CHECK:STDOUT: } // CHECK:STDOUT: %g: ref %E.468 = wrapper_binding g, %g.var [concrete = %g.var] @@ -693,38 +682,38 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc22_31.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc19_31.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %E.ref: %E.type = name_ref E, file.%E.decl [concrete = constants.%E.generic] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] -// CHECK:STDOUT: %.loc22_53.1: %struct_type.a.b.cfd = struct_literal (%int_3, %int_4) [concrete = constants.%struct.cb7] +// CHECK:STDOUT: %.loc19_53.1: %struct_type.a.b.cfd = struct_literal (%int_3, %int_4) [concrete = constants.%struct.cb7] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %impl.elem0.loc22_53.1: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] -// CHECK:STDOUT: %bound_method.loc22_53.1: = bound_method %int_3, %impl.elem0.loc22_53.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.b3c] -// CHECK:STDOUT: %specific_fn.loc22_53.1: = specific_function %impl.elem0.loc22_53.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc22_53.2: = bound_method %int_3, %specific_fn.loc22_53.1 [concrete = constants.%bound_method.fb0] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22_53.1: init %i32 = call %bound_method.loc22_53.2(%int_3) [concrete = constants.%int_3.9f3] -// CHECK:STDOUT: %.loc22_53.2: init %i32 = converted %int_3, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22_53.1 [concrete = constants.%int_3.9f3] -// CHECK:STDOUT: %.loc22_53.3: ref %D = temporary_storage -// CHECK:STDOUT: %.loc22_53.4: ref %i32 = class_element_access %.loc22_53.3, element0 -// CHECK:STDOUT: %.loc22_53.5: init %i32 to %.loc22_53.4 = in_place_init %.loc22_53.2 [concrete = constants.%int_3.9f3] -// CHECK:STDOUT: %impl.elem0.loc22_53.2: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] -// CHECK:STDOUT: %bound_method.loc22_53.3: = bound_method %int_4, %impl.elem0.loc22_53.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.776] -// CHECK:STDOUT: %specific_fn.loc22_53.2: = specific_function %impl.elem0.loc22_53.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc22_53.4: = bound_method %int_4, %specific_fn.loc22_53.2 [concrete = constants.%bound_method.7fa] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22_53.2: init %i32 = call %bound_method.loc22_53.4(%int_4) [concrete = constants.%int_4.6bf] -// CHECK:STDOUT: %.loc22_53.6: init %i32 = converted %int_4, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22_53.2 [concrete = constants.%int_4.6bf] -// CHECK:STDOUT: %.loc22_53.7: ref %i32 = class_element_access %.loc22_53.3, element1 -// CHECK:STDOUT: %.loc22_53.8: init %i32 to %.loc22_53.7 = in_place_init %.loc22_53.6 [concrete = constants.%int_4.6bf] -// CHECK:STDOUT: %.loc22_53.9: init %D to %.loc22_53.3 = class_init (%.loc22_53.5, %.loc22_53.8) [concrete = constants.%D.val.db4] -// CHECK:STDOUT: %.loc22_55.1: init %D = converted %.loc22_53.1, %.loc22_53.9 [concrete = constants.%D.val.db4] -// CHECK:STDOUT: %.loc22_55.2: ref %D = temporary %.loc22_53.3, %.loc22_55.1 [concrete = constants.%.c27] -// CHECK:STDOUT: %.loc22_55.3: %D = acquire_value %.loc22_55.2 [concrete = constants.%D.val.db4] +// CHECK:STDOUT: %impl.elem0.loc19_53.1: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] +// CHECK:STDOUT: %bound_method.loc19_53.1: = bound_method %int_3, %impl.elem0.loc19_53.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.b3c] +// CHECK:STDOUT: %specific_fn.loc19_53.1: = specific_function %impl.elem0.loc19_53.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc19_53.2: = bound_method %int_3, %specific_fn.loc19_53.1 [concrete = constants.%bound_method.fb0] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc19_53.1: init %i32 = call %bound_method.loc19_53.2(%int_3) [concrete = constants.%int_3.9f3] +// CHECK:STDOUT: %.loc19_53.2: init %i32 = converted %int_3, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc19_53.1 [concrete = constants.%int_3.9f3] +// CHECK:STDOUT: %.loc19_53.3: ref %D = temporary_storage +// CHECK:STDOUT: %.loc19_53.4: ref %i32 = class_element_access %.loc19_53.3, element0 +// CHECK:STDOUT: %.loc19_53.5: init %i32 to %.loc19_53.4 = in_place_init %.loc19_53.2 [concrete = constants.%int_3.9f3] +// CHECK:STDOUT: %impl.elem0.loc19_53.2: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] +// CHECK:STDOUT: %bound_method.loc19_53.3: = bound_method %int_4, %impl.elem0.loc19_53.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.776] +// CHECK:STDOUT: %specific_fn.loc19_53.2: = specific_function %impl.elem0.loc19_53.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc19_53.4: = bound_method %int_4, %specific_fn.loc19_53.2 [concrete = constants.%bound_method.7fa] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc19_53.2: init %i32 = call %bound_method.loc19_53.4(%int_4) [concrete = constants.%int_4.6bf] +// CHECK:STDOUT: %.loc19_53.6: init %i32 = converted %int_4, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc19_53.2 [concrete = constants.%int_4.6bf] +// CHECK:STDOUT: %.loc19_53.7: ref %i32 = class_element_access %.loc19_53.3, element1 +// CHECK:STDOUT: %.loc19_53.8: init %i32 to %.loc19_53.7 = in_place_init %.loc19_53.6 [concrete = constants.%int_4.6bf] +// CHECK:STDOUT: %.loc19_53.9: init %D to %.loc19_53.3 = class_init (%.loc19_53.5, %.loc19_53.8) [concrete = constants.%D.val.db4] +// CHECK:STDOUT: %.loc19_55.1: init %D = converted %.loc19_53.1, %.loc19_53.9 [concrete = constants.%D.val.db4] +// CHECK:STDOUT: %.loc19_55.2: ref %D = temporary %.loc19_53.3, %.loc19_55.1 [concrete = constants.%.c27] +// CHECK:STDOUT: %.loc19_55.3: %D = acquire_value %.loc19_55.2 [concrete = constants.%D.val.db4] // CHECK:STDOUT: %E: type = class_type @E, @E(constants.%D.val.db4) [concrete = constants.%E.dc1] -// CHECK:STDOUT: %.loc22_31.2: ref %E.dc1 = temporary_storage -// CHECK:STDOUT: %.loc22_31.3: init %E.dc1 to %.loc22_31.2 = class_init () [concrete = constants.%E.val] -// CHECK:STDOUT: %.loc22_33: init %E.dc1 = converted %.loc22_31.1, %.loc22_31.3 [concrete = constants.%E.val] -// CHECK:STDOUT: %.loc22_1: %E.468 = converted %.loc22_33, [concrete = ] +// CHECK:STDOUT: %.loc19_31.2: ref %E.dc1 = temporary_storage +// CHECK:STDOUT: %.loc19_31.3: init %E.dc1 to %.loc19_31.2 = class_init () [concrete = constants.%E.val] +// CHECK:STDOUT: %.loc19_33: init %E.dc1 = converted %.loc19_31.1, %.loc19_31.3 [concrete = constants.%E.val] +// CHECK:STDOUT: %.loc19_1: %E.468 = converted %.loc19_33, [concrete = ] // CHECK:STDOUT: assign file.%g.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/implicit_import.carbon b/toolchain/check/testdata/class/implicit_import.carbon index 1342e8ed1eb3..4e5052f26879 100644 --- a/toolchain/check/testdata/class/implicit_import.carbon +++ b/toolchain/check/testdata/class/implicit_import.carbon @@ -41,8 +41,8 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ redecl_after_def.carbon // CHECK:STDERR: │ class C {} -// CHECK:STDERR: · ────┬──── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: class C; @@ -64,8 +64,8 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ redef_after_def.carbon // CHECK:STDERR: │ class C {} -// CHECK:STDERR: · ────┬──── -// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] // CHECK:STDERR: ╰──── // CHECK:STDERR: class C {} diff --git a/toolchain/check/testdata/class/inheritance/fail_base_bad_type.carbon b/toolchain/check/testdata/class/inheritance/fail_base_bad_type.carbon index 745f06bc812e..0653105175bc 100644 --- a/toolchain/check/testdata/class/inheritance/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/inheritance/fail_base_bad_type.carbon @@ -32,15 +32,12 @@ fn AccessMemberWithInvalidBaseError(p: DeriveFromError*) -> i32 { return (*p).n; library "[[@TEST_NAME]]"; class DeriveFromNonType { - // CHECK:STDERR: ╭─┤ fail_derive_from_non_type.carbon:[[@LINE+11]]:16 + // CHECK:STDERR: ╭─┤ fail_derive_from_non_type.carbon:[[@LINE+8]]:16 // CHECK:STDERR: -> │ extend base: 32; // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type - // CHECK:STDERR: · │ ┃ `Core.IntLiteral` to `type` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(type)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Core.IntLiteral` to `type` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: extend base: 32; @@ -66,20 +63,17 @@ class DeriveFromi32 { // It's not really important whether this conversion produces an error or not, // but it shouldn't crash. -// CHECK:STDERR: ╭─┤ fail_derive_from_i32.carbon:[[@LINE+16]]:53 +// CHECK:STDERR: ╭─┤ fail_derive_from_i32.carbon:[[@LINE+13]]:53 // CHECK:STDERR: -> │ fn ConvertToBadBasei32(p: DeriveFromi32*) -> i32* { return p; } // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot -// CHECK:STDERR: · │ ┃ implicitly -// CHECK:STDERR: · │ ┃ convert -// CHECK:STDERR: · │ ┃ expression of -// CHECK:STDERR: · │ ┃ type -// CHECK:STDERR: · │ ┃ `DeriveFromi32*` -// CHECK:STDERR: · │ ┃ to `i32*` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╭───────────────────────────────────────────────────╯ -// CHECK:STDERR: · │ type `DeriveFromi32*` does not implement interface `Core.ImplicitAs(i32*)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ implicitly +// CHECK:STDERR: · ┃ convert +// CHECK:STDERR: · ┃ expression of +// CHECK:STDERR: · ┃ type +// CHECK:STDERR: · ┃ `DeriveFromi32*` +// CHECK:STDERR: · ┃ to `i32*` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn ConvertToBadBasei32(p: DeriveFromi32*) -> i32* { return p; } @@ -112,17 +106,13 @@ class DeriveFromTuple { extend base: (Base,); } -// CHECK:STDERR: ╭─┤ fail_derive_from_tuple.carbon:[[@LINE+13]]:61 +// CHECK:STDERR: ╭─┤ fail_derive_from_tuple.carbon:[[@LINE+9]]:61 // CHECK:STDERR: -> │ fn ConvertToBadBaseTuple(p: DeriveFromTuple*) -> (Base,)* { return p; } // CHECK:STDERR: · ━━━━┳━━━━ // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ // CHECK:STDERR: · ┃ error: cannot implicitly convert expression of type `DeriveFromTuple*` to // CHECK:STDERR: · ┃ `(Base,)*` // CHECK:STDERR: · ┃ [ConversionFailure] -// CHECK:STDERR: · ╭───────────────────────────────────────────────────────────────╯ -// CHECK:STDERR: · │ type `DeriveFromTuple*` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs((Base,)*)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn ConvertToBadBaseTuple(p: DeriveFromTuple*) -> (Base,)* { return p; } @@ -147,17 +137,13 @@ class DeriveFromStruct { extend base: {.a: i32, .b: i32}; } -// CHECK:STDERR: ╭─┤ fail_derive_from_struct.carbon:[[@LINE+13]]:74 +// CHECK:STDERR: ╭─┤ fail_derive_from_struct.carbon:[[@LINE+9]]:74 // CHECK:STDERR: -> │ ...ToBadBaseStruct(p: DeriveFromStruct*) -> {.a: i32, .b: i32}* { return p; } // CHECK:STDERR: · ━━━━┳━━━━ // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ // CHECK:STDERR: · ┃ error: cannot implicitly convert expression of type `DeriveFromStruct*` to // CHECK:STDERR: · ┃ `{.a: i32, .b: i32}*` // CHECK:STDERR: · ┃ [ConversionFailure] -// CHECK:STDERR: · ╭─────────────────────────────────────────────────────────────────────╯ -// CHECK:STDERR: · │ type `DeriveFromStruct*` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs({.a: i32, .b: i32}*)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn ConvertToBadBaseStruct(p: DeriveFromStruct*) -> {.a: i32, .b: i32}* { return p; } @@ -181,8 +167,8 @@ base class Incomplete; class DeriveFromIncomplete { // CHECK:STDERR: ╭─┤ fail_derive_from_incomplete.carbon:[[@LINE+11]]:16 // CHECK:STDERR: │ base class Incomplete; - // CHECK:STDERR: · ───────────┬────────── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ─────┬──── + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ extend base: Incomplete; // CHECK:STDERR: · ━━━━━┳━━━━ @@ -193,17 +179,13 @@ class DeriveFromIncomplete { extend base: Incomplete; } -// CHECK:STDERR: ╭─┤ fail_derive_from_incomplete.carbon:[[@LINE+13]]:74 +// CHECK:STDERR: ╭─┤ fail_derive_from_incomplete.carbon:[[@LINE+9]]:74 // CHECK:STDERR: -> │ ...ToBadBaseIncomplete(p: DeriveFromIncomplete*) -> Incomplete* { return p; } // CHECK:STDERR: · ━━━━┳━━━━ // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ // CHECK:STDERR: · ┃ error: cannot implicitly convert expression of type `DeriveFromIncomplete*` to // CHECK:STDERR: · ┃ `Incomplete*` // CHECK:STDERR: · ┃ [ConversionFailure] -// CHECK:STDERR: · ╭─────────────────────────────────────────────────────────────────────╯ -// CHECK:STDERR: · │ type `DeriveFromIncomplete*` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(Incomplete*)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn ConvertToBadBaseIncomplete(p: DeriveFromIncomplete*) -> Incomplete* { return p; } diff --git a/toolchain/check/testdata/class/inheritance/fail_derived_to_base.carbon b/toolchain/check/testdata/class/inheritance/fail_derived_to_base.carbon index c95c5cf96044..b9d9444c3faf 100644 --- a/toolchain/check/testdata/class/inheritance/fail_derived_to_base.carbon +++ b/toolchain/check/testdata/class/inheritance/fail_derived_to_base.carbon @@ -23,34 +23,27 @@ class B2 { var b: i32; } -// CHECK:STDERR: ╭─┤ fail_derived_to_base.carbon:[[@LINE+12]]:38 +// CHECK:STDERR: ╭─┤ fail_derived_to_base.carbon:[[@LINE+9]]:38 // CHECK:STDERR: -> │ fn ConvertUnrelated(p: B2*) -> A1* { return p; } // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert -// CHECK:STDERR: · │ ┃ expression of type `B2*` to -// CHECK:STDERR: · │ ┃ `A1*` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `B2*` does not implement -// CHECK:STDERR: · │ interface `Core.ImplicitAs(A1*)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ expression of type `B2*` to +// CHECK:STDERR: · ┃ `A1*` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn ConvertUnrelated(p: B2*) -> A1* { return p; } class Incomplete; -// CHECK:STDERR: ╭─┤ fail_derived_to_base.carbon:[[@LINE+14]]:47 +// CHECK:STDERR: ╭─┤ fail_derived_to_base.carbon:[[@LINE+10]]:47 // CHECK:STDERR: -> │ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly -// CHECK:STDERR: · │ ┃ convert expression of -// CHECK:STDERR: · │ ┃ type `Incomplete*` to -// CHECK:STDERR: · │ ┃ `A2*` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `Incomplete*` does not -// CHECK:STDERR: · │ implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(A2*)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ convert expression of +// CHECK:STDERR: · ┃ type `Incomplete*` to +// CHECK:STDERR: · ┃ `A2*` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } diff --git a/toolchain/check/testdata/class/inheritance/fail_extend_cycle.carbon b/toolchain/check/testdata/class/inheritance/fail_extend_cycle.carbon index cd817dab22d6..3f084a208337 100644 --- a/toolchain/check/testdata/class/inheritance/fail_extend_cycle.carbon +++ b/toolchain/check/testdata/class/inheritance/fail_extend_cycle.carbon @@ -20,8 +20,8 @@ base class B { // CHECK:STDERR: ╭─┤ fail_extend_cycle.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ base class A { -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ base class A { // CHECK:STDERR: · ━━━━━━━┳━━━━━━ diff --git a/toolchain/check/testdata/class/method/bound_method_value.carbon b/toolchain/check/testdata/class/method/bound_method_value.carbon index 91347d62cdb5..b32d5511e6e5 100644 --- a/toolchain/check/testdata/class/method/bound_method_value.carbon +++ b/toolchain/check/testdata/class/method/bound_method_value.carbon @@ -18,15 +18,12 @@ class C { } fn F(c: C) { - // CHECK:STDERR: ╭─┤ fail_implicit_conversion.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_implicit_conversion.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ var _: i32 = c.Get; // CHECK:STDERR: · ┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `` to - // CHECK:STDERR: · │ ┃ `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `i32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var _: i32 = c.Get; @@ -40,15 +37,12 @@ class C { } fn F(c: C) -> i32 { - // CHECK:STDERR: ╭─┤ fail_as.carbon:[[@LINE+11]]:10 + // CHECK:STDERR: ╭─┤ fail_as.carbon:[[@LINE+8]]:10 // CHECK:STDERR: -> │ return c.Get as i32; // CHECK:STDERR: · ┳━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `` to `i32` - // CHECK:STDERR: · │ ┃ with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `` does not implement interface - // CHECK:STDERR: · │ `Core.As(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return c.Get as i32; @@ -85,14 +79,11 @@ class C { } fn F(c: C) { - // CHECK:STDERR: ╭─┤ fail_copy.carbon:[[@LINE+10]]:26 + // CHECK:STDERR: ╭─┤ fail_copy.carbon:[[@LINE+7]]:26 // CHECK:STDERR: -> │ var _: typeof(c.Get) = c.Get; - // CHECK:STDERR: · ┳━━━━ - // CHECK:STDERR: · ┗━━┫ error: cannot copy value of type `` - // CHECK:STDERR: · │ ┃ [CopyOfUncopyableType] - // CHECK:STDERR: · ╰────┤ type `` does not implement - // CHECK:STDERR: · │ interface `Core.Copy` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ━┳━━━ + // CHECK:STDERR: · ┗━━┫ error: cannot copy value of type `` + // CHECK:STDERR: · ┃ [CopyOfUncopyableType] // CHECK:STDERR: ╰──── // CHECK:STDERR: var _: typeof(c.Get) = c.Get; diff --git a/toolchain/check/testdata/class/method/fail_call_without_method_syntax.carbon b/toolchain/check/testdata/class/method/fail_call_without_method_syntax.carbon index a2bed5a9bc07..404b307b5e00 100644 --- a/toolchain/check/testdata/class/method/fail_call_without_method_syntax.carbon +++ b/toolchain/check/testdata/class/method/fail_call_without_method_syntax.carbon @@ -26,8 +26,8 @@ class Other {} fn TooFew() -> i32 { // CHECK:STDERR: ╭─┤ fail_call_without_method_syntax.carbon:[[@LINE+11]]:10 // CHECK:STDERR: │ fn Get(self) -> i32 { return self.x; } - // CHECK:STDERR: · ──────────┬────────── - // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] + // CHECK:STDERR: · ─┬─ + // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return Point.Get(); // CHECK:STDERR: · ━━━━━┳━━━━━ @@ -41,8 +41,8 @@ fn TooFew() -> i32 { fn TooMany(p: Point) -> i32 { // CHECK:STDERR: ╭─┤ fail_call_without_method_syntax.carbon:[[@LINE+11]]:10 // CHECK:STDERR: │ fn Get(self) -> i32 { return self.x; } - // CHECK:STDERR: · ──────────┬────────── - // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] + // CHECK:STDERR: · ─┬─ + // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return Point.Get(p, p); // CHECK:STDERR: · ━━━━━━━┳━━━━━━━ @@ -54,7 +54,7 @@ fn TooMany(p: Point) -> i32 { } fn WrongSelfType(o: Other) -> i32 { - // CHECK:STDERR: ╭─┤ fail_call_without_method_syntax.carbon:[[@LINE+15]]:20 + // CHECK:STDERR: ╭─┤ fail_call_without_method_syntax.carbon:[[@LINE+12]]:20 // CHECK:STDERR: │ fn Get(self) -> i32 { return self.x; } // CHECK:STDERR: · ──┬─ // CHECK:STDERR: · ╰──┤ initializing function parameter [InCallToFunctionParam] @@ -62,11 +62,8 @@ fn WrongSelfType(o: Other) -> i32 { // CHECK:STDERR: -> │ return Point.Get(o); // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `Other` to `Point` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Other` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Point)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Other` to `Point` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return Point.Get(o); diff --git a/toolchain/check/testdata/class/method/fail_method.carbon b/toolchain/check/testdata/class/method/fail_method.carbon index 9eea153dd6d6..e54f0ed0dc04 100644 --- a/toolchain/check/testdata/class/method/fail_method.carbon +++ b/toolchain/check/testdata/class/method/fail_method.carbon @@ -24,8 +24,8 @@ fn F(c: Class) { Class.NoSelf(); // CHECK:STDERR: ╭─┤ fail_method.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn WithSelf(self: Class); - // CHECK:STDERR: · ────────────┬──────────── - // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] + // CHECK:STDERR: · ────┬─── + // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Class.WithSelf(); // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━ @@ -38,8 +38,8 @@ fn F(c: Class) { // CHECK:STDERR: ╭─┤ fail_method.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn WithSelf(self: Class); - // CHECK:STDERR: · ────────────┬──────────── - // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] + // CHECK:STDERR: · ────┬─── + // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ A(); // CHECK:STDERR: · ━┳━ diff --git a/toolchain/check/testdata/class/method/fail_method_redefinition.carbon b/toolchain/check/testdata/class/method/fail_method_redefinition.carbon index 11e3ef2d9866..a44fb5ebc30d 100644 --- a/toolchain/check/testdata/class/method/fail_method_redefinition.carbon +++ b/toolchain/check/testdata/class/method/fail_method_redefinition.carbon @@ -14,8 +14,8 @@ class Class { fn F() {} // CHECK:STDERR: ╭─┤ fail_method_redefinition.carbon:[[@LINE+10]]:3 // CHECK:STDERR: │ fn F() {} - // CHECK:STDERR: · ────┬─── - // CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F() {} // CHECK:STDERR: · ━━━━┳━━━ diff --git a/toolchain/check/testdata/class/method/virtual.carbon b/toolchain/check/testdata/class/method/virtual.carbon index 5dbad4abe65f..0ae83c8b10db 100644 --- a/toolchain/check/testdata/class/method/virtual.carbon +++ b/toolchain/check/testdata/class/method/virtual.carbon @@ -263,9 +263,9 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: · ┗━━┫ error: use of undefined generic function // CHECK:STDERR: · ┃ [MissingGenericFunctionDefinition] // CHECK:STDERR: │ virtual fn F(self); -// CHECK:STDERR: · ─────────┬───────── -// CHECK:STDERR: · ╰──┤ generic function declared here -// CHECK:STDERR: · │ [MissingGenericFunctionDefinitionHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ generic function declared here +// CHECK:STDERR: · │ [MissingGenericFunctionDefinitionHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: base class Base(T: type) { @@ -464,7 +464,7 @@ base class Base(T: type) { class D1 { extend base: Base(T1); - // CHECK:STDERR: ╭─┤ fail_impl_generic_specifically_mismatch.carbon:[[@LINE+19]]:3 + // CHECK:STDERR: ╭─┤ fail_impl_generic_specifically_mismatch.carbon:[[@LINE+16]]:3 // CHECK:STDERR: │ virtual fn F(unused self, unused t: T1*) { } // CHECK:STDERR: · ─────────────┬──────────────────────────── // CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function @@ -473,14 +473,11 @@ class D1 { // CHECK:STDERR: -> │ override fn F(unused self, unused t: T2*) { } // CHECK:STDERR: · ━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┯━━━━━━━━ // CHECK:STDERR: · ┗━━━━━━━━━━━━━━━┫ error: cannot implicitly convert - // CHECK:STDERR: · │ │ ┃ expression of type `T1*` to - // CHECK:STDERR: · │ │ ┃ `T2*` - // CHECK:STDERR: · │ │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰─────────────────┤ type `T1*` does not implement - // CHECK:STDERR: · │ │ interface `Core.ImplicitAs(T2*)` - // CHECK:STDERR: · │ │ [MissingImplInMemberAccessInContext] - // CHECK:STDERR: · ╰──────┤ initializing function parameter - // CHECK:STDERR: · │ [InCallToFunctionParam] + // CHECK:STDERR: · │ ┃ expression of type `T1*` to + // CHECK:STDERR: · │ ┃ `T2*` + // CHECK:STDERR: · │ ┃ [ConversionFailure] + // CHECK:STDERR: · ╰────┤ initializing function parameter + // CHECK:STDERR: · │ [InCallToFunctionParam] // CHECK:STDERR: ╰──── // CHECK:STDERR: override fn F(unused self, unused t: T2*) { } @@ -495,7 +492,7 @@ abstract class Base(T: type) { } class Derived(T: type) { extend base: Base(T); - // CHECK:STDERR: ╭─┤ fail_impl_generic_generic_mismatch.carbon:[[@LINE+18]]:3 + // CHECK:STDERR: ╭─┤ fail_impl_generic_generic_mismatch.carbon:[[@LINE+15]]:3 // CHECK:STDERR: │ virtual fn F(unused self, unused t: T*) { } // CHECK:STDERR: · ─────────────┬─────────────────────────── // CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function @@ -504,13 +501,10 @@ class Derived(T: type) { // CHECK:STDERR: -> │ override fn F(unused self, unused t: T) { } // CHECK:STDERR: · ━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┯━━━━━━ // CHECK:STDERR: · ┗━━━━━━━━━━━━━━━━┫ error: cannot implicitly convert - // CHECK:STDERR: · │ │ ┃ expression of type `T*` to `T` - // CHECK:STDERR: · │ │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰──────────────────┤ type `T*` does not implement - // CHECK:STDERR: · │ │ interface `Core.ImplicitAs(T)` - // CHECK:STDERR: · │ │ [MissingImplInMemberAccessInContext] - // CHECK:STDERR: · ╰──────┤ initializing function parameter - // CHECK:STDERR: · │ [InCallToFunctionParam] + // CHECK:STDERR: · │ ┃ expression of type `T*` to `T` + // CHECK:STDERR: · │ ┃ [ConversionFailure] + // CHECK:STDERR: · ╰────┤ initializing function parameter + // CHECK:STDERR: · │ [InCallToFunctionParam] // CHECK:STDERR: ╰──── // CHECK:STDERR: override fn F(unused self, unused t: T) { } diff --git a/toolchain/check/testdata/class/no_definition_in_impl_file.carbon b/toolchain/check/testdata/class/no_definition_in_impl_file.carbon index 2162e675d9d5..7224ac351957 100644 --- a/toolchain/check/testdata/class/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/class/no_definition_in_impl_file.carbon @@ -59,8 +59,8 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ decl_in_api_decl_in_impl.carbon // CHECK:STDERR: │ class C; -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+7]]:1 @@ -89,8 +89,8 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ decl_in_api_decl_and_definition_in_impl.carbon // CHECK:STDERR: │ class D; -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: class D; diff --git a/toolchain/check/testdata/class/partial/access.carbon b/toolchain/check/testdata/class/partial/access.carbon index eebc35251340..741e268295d6 100644 --- a/toolchain/check/testdata/class/partial/access.carbon +++ b/toolchain/check/testdata/class/partial/access.carbon @@ -36,15 +36,12 @@ library "[[@TEST_NAME]]"; import Common; fn F(ref pb: partial Common.B) { - // CHECK:STDERR: ╭─┤ fail_invalid_partial_member_access.carbon:[[@LINE+11]]:27 + // CHECK:STDERR: ╭─┤ fail_invalid_partial_member_access.carbon:[[@LINE+8]]:27 // CHECK:STDERR: -> │ let ref _: Common.A = pb.base; // CHECK:STDERR: · ┳━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of - // CHECK:STDERR: · │ ┃ type `partial Common.A` to `Common.A` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `partial Common.A` does not implement - // CHECK:STDERR: · │ interface `Core.ImplicitAs(Common.A)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type `partial Common.A` to `Common.A` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let ref _: Common.A = pb.base; diff --git a/toolchain/check/testdata/class/partial/qualifier.carbon b/toolchain/check/testdata/class/partial/qualifier.carbon index 07f8aad5ad22..1b161aa3becc 100644 --- a/toolchain/check/testdata/class/partial/qualifier.carbon +++ b/toolchain/check/testdata/class/partial/qualifier.carbon @@ -143,13 +143,11 @@ library "[[@TEST_NAME]]"; base class C { } fn G(p: partial C*) -> C* { - // CHECK:STDERR: ╭─┤ fail_convert_to_nonpartial.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_convert_to_nonpartial.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ return p; // CHECK:STDERR: · ━┳━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `partial C*` to `C*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `partial C*` does not implement interface `Core.ImplicitAs(C*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; diff --git a/toolchain/check/testdata/class/self/fail_self.carbon b/toolchain/check/testdata/class/self/fail_self.carbon index 27553d934f1c..6f17c44109bf 100644 --- a/toolchain/check/testdata/class/self/fail_self.carbon +++ b/toolchain/check/testdata/class/self/fail_self.carbon @@ -271,7 +271,7 @@ class WrongSelf { } fn CallWrongSelf(ws: WrongSelf) { - // CHECK:STDERR: ╭─┤ fail_self_wrong_type.carbon:[[@LINE+14]]:3 + // CHECK:STDERR: ╭─┤ fail_self_wrong_type.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn F(self: Class); // CHECK:STDERR: · ─────┬───── // CHECK:STDERR: · ╰──┤ initializing function parameter [InCallToFunctionParam] @@ -279,10 +279,8 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDERR: -> │ ws.F(); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `WrongSelf` to - // CHECK:STDERR: · │ ┃ `Class` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `WrongSelf` does not implement interface `Core.ImplicitAs(Class)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Class` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: ws.F(); diff --git a/toolchain/check/testdata/class/self/fail_self_param.carbon b/toolchain/check/testdata/class/self/fail_self_param.carbon index 41a93975d41a..f50aa9471e7e 100644 --- a/toolchain/check/testdata/class/self/fail_self_param.carbon +++ b/toolchain/check/testdata/class/self/fail_self_param.carbon @@ -25,8 +25,8 @@ library "[[@TEST_NAME]]"; class C(self: type, x: self) {} // CHECK:STDERR: ╭─┤ fail_self_param.carbon:[[@LINE+11]]:8 // CHECK:STDERR: │ class C(self: type, x: self) {} -// CHECK:STDERR: · ───────────────┬────────────── -// CHECK:STDERR: · ╰──┤ calling generic class declared here [InCallToEntity] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ calling generic class declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ var v: C(()); // CHECK:STDERR: · ━━┳━━ diff --git a/toolchain/check/testdata/class/self/self.carbon b/toolchain/check/testdata/class/self/self.carbon index fdebe1a18d4e..12f12c0967e6 100644 --- a/toolchain/check/testdata/class/self/self.carbon +++ b/toolchain/check/testdata/class/self/self.carbon @@ -97,15 +97,12 @@ fn Class.F(unused self: Class) {} library "[[@TEST_NAME]]"; class Class { - // CHECK:STDERR: ╭─┤ fail_return_self_value.carbon:[[@LINE+11]]:17 + // CHECK:STDERR: ╭─┤ fail_return_self_value.carbon:[[@LINE+8]]:17 // CHECK:STDERR: -> │ fn F(self) -> self; // CHECK:STDERR: · ┳━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type - // CHECK:STDERR: · │ ┃ `Self` to `type` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `Class` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(type)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Self` to `type` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(self) -> self; @@ -468,7 +465,7 @@ class Class { // CHECK:STDOUT: %return.patt: = return_slot_pattern , [concrete = ] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.ref: %Class = name_ref self, %self -// CHECK:STDOUT: %.loc15: type = converted %self.ref, [concrete = ] +// CHECK:STDOUT: %.loc12: type = converted %self.ref, [concrete = ] // CHECK:STDOUT: %self.param: %Class = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [concrete = constants.%Class] // CHECK:STDOUT: %self: %Class = wrapper_binding self, %self.param diff --git a/toolchain/check/testdata/const/basics.carbon b/toolchain/check/testdata/const/basics.carbon index aaf5df059271..770430a1bb28 100644 --- a/toolchain/check/testdata/const/basics.carbon +++ b/toolchain/check/testdata/const/basics.carbon @@ -59,13 +59,11 @@ class C; // CHECK:STDERR: ╰──── // CHECK:STDERR: fn G(p: const (const C)**) -> C** { - // CHECK:STDERR: ╭─┤ fail_collapse_in_error.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_collapse_in_error.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ return p; // CHECK:STDERR: · ━┳━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `const C**` to `C**` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `const C**` does not implement interface `Core.ImplicitAs(C**)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; @@ -124,7 +122,7 @@ class X { } fn PassConstReferenceToReference(p: const X*) { - // CHECK:STDERR: ╭─┤ fail_remove_while_forming_reference.carbon:[[@LINE+13]]:3 + // CHECK:STDERR: ╭─┤ fail_remove_while_forming_reference.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn TakeSelf(ref self); // CHECK:STDERR: · ────┬─── // CHECK:STDERR: · ╰──┤ initializing function parameter [InCallToFunctionParam] @@ -132,9 +130,7 @@ fn PassConstReferenceToReference(p: const X*) { // CHECK:STDERR: -> │ p->(X.TakeSelf)(); // CHECK:STDERR: · ━━━━━┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `const X` to `X` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `const X` does not implement interface `Core.ImplicitAs(X)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: p->(X.TakeSelf)(); diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index bc8246988276..9bcfe22c2137 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -62,7 +62,7 @@ fn F[T: type](a: array(T, 2)) -> T { return F(a); } fn G() -> C { // TODO: We succeed at deducing T here but fail to convert. Is this the right behavior? var a: array(C, 3) = ({}, {}, {}); - // CHECK:STDERR: ╭─┤ fail_bound_mismatch.carbon:[[@LINE+16]]:12 + // CHECK:STDERR: ╭─┤ fail_bound_mismatch.carbon:[[@LINE+13]]:12 // CHECK:STDERR: │ fn F[T: type](a: array(T, 2)) -> T { return F(a); } // CHECK:STDERR: · ───────┬────── // CHECK:STDERR: · ╰──┤ initializing function parameter @@ -71,11 +71,8 @@ fn G() -> C { // CHECK:STDERR: -> │ return F(a); // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `array(C, 3)` to `array(C, 2)` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `array(C, 3)` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(array(C, 2))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `array(C, 3)` to `array(C, 2)` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return F(a); @@ -93,7 +90,7 @@ 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? var a: array(D, 3) = ({}, {}, {}); - // CHECK:STDERR: ╭─┤ fail_type_mismatch.carbon:[[@LINE+16]]:12 + // CHECK:STDERR: ╭─┤ fail_type_mismatch.carbon:[[@LINE+13]]:12 // CHECK:STDERR: │ fn F[N: Core.IntLiteral](unused a: array(C, N)) -> i32 { return N; } // CHECK:STDERR: · ───────┬────── // CHECK:STDERR: · ╰──┤ initializing function parameter @@ -102,11 +99,8 @@ fn G() -> i32 { // CHECK:STDERR: -> │ return F(a); // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `array(D, 3)` to `array(C, 3)` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `array(D, 3)` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(array(C, 3))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `array(D, 3)` to `array(C, 3)` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return F(a); @@ -129,9 +123,9 @@ fn G() -> i32 { // better. // CHECK:STDERR: ╭─┤ fail_bound_type_mismatch.carbon:[[@LINE+12]]:10 // CHECK:STDERR: │ fn F[N: i32](unused a: array(C, N)) -> i32 { return N; } - // CHECK:STDERR: · ──────────────────────┬───────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return F(a); // CHECK:STDERR: · ━━┳━ @@ -154,9 +148,9 @@ fn G() { // // CHECK:STDERR: ╭─┤ fail_todo_array_length_from_tuple.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn F[N: i32](unused a: array(C, N)) {} - // CHECK:STDERR: · ──────────────────┬────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ F(({}, {}, {})); // CHECK:STDERR: · ━━━━━━━┳━━━━━━━ @@ -1198,7 +1192,7 @@ fn G() { // CHECK:STDOUT: %a.ref: ref %Array.96f = name_ref a, %a // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%C) [concrete = constants.%F.specific_fn.c73] // CHECK:STDOUT: %.loc8_11.1: ref %C = splice_block %return.param {} -// CHECK:STDOUT: %.loc27: %Array.ee7 = converted %a.ref, [concrete = ] +// CHECK:STDOUT: %.loc24: %Array.ee7 = converted %a.ref, [concrete = ] // CHECK:STDOUT: %F.call: init %C to %.loc8_11.1 = call %F.specific_fn() // CHECK:STDOUT: %Destroy.facet.loc10_3.1: %Destroy.type = facet_value constants.%Array.96f, (constants.%DestroyImpl.impl_witness.f0d, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet.3c2] // CHECK:STDOUT: %.loc10_3.2: %Destroy.type = converted constants.%Array.96f, %Destroy.facet.loc10_3.1 [concrete = constants.%Destroy.facet.3c2] @@ -1516,7 +1510,7 @@ fn G() { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] // CHECK:STDOUT: %a.ref: ref %Array.f94 = name_ref a, %a // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%int_3.1ba) [concrete = constants.%F.specific_fn] -// CHECK:STDOUT: %.loc28: %Array.96f = converted %a.ref, [concrete = ] +// CHECK:STDOUT: %.loc25: %Array.96f = converted %a.ref, [concrete = ] // CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn() // CHECK:STDOUT: %Destroy.facet.loc11_3.1: %Destroy.type = facet_value constants.%Array.f94, (constants.%DestroyImpl.impl_witness.b21, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet.2c1] // CHECK:STDOUT: %.loc11_3.2: %Destroy.type = converted constants.%Array.f94, %Destroy.facet.loc11_3.1 [concrete = constants.%Destroy.facet.2c1] diff --git a/toolchain/check/testdata/deduce/binding_pattern.carbon b/toolchain/check/testdata/deduce/binding_pattern.carbon index 83664ab3086e..d76fd2b78b2e 100644 --- a/toolchain/check/testdata/deduce/binding_pattern.carbon +++ b/toolchain/check/testdata/deduce/binding_pattern.carbon @@ -19,7 +19,7 @@ class C(T: type) { } fn F(unused generic U: type, generic V: type) { - // CHECK:STDERR: ╭─┤ fail_incompatible_deduce.carbon:[[@LINE+15]]:15 + // CHECK:STDERR: ╭─┤ fail_incompatible_deduce.carbon:[[@LINE+13]]:15 // CHECK:STDERR: │ fn Create(unused value: T) {} // CHECK:STDERR: · ────┬─── // CHECK:STDERR: · ╰──┤ initializing function parameter @@ -28,10 +28,8 @@ fn F(unused generic U: type, generic V: type) { // CHECK:STDERR: -> │ C(V).Create({}); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `{}` to - // CHECK:STDERR: · │ ┃ `V` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `{}` does not implement interface `Core.ImplicitAs(V)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `V` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: C(V).Create({}); diff --git a/toolchain/check/testdata/deduce/symbolic_facets.carbon b/toolchain/check/testdata/deduce/symbolic_facets.carbon index 7138266567e0..318b8d3f377f 100644 --- a/toolchain/check/testdata/deduce/symbolic_facets.carbon +++ b/toolchain/check/testdata/deduce/symbolic_facets.carbon @@ -31,9 +31,9 @@ class D(DD: type) { // // CHECK:STDERR: ╭─┤ fail_missing_interface.carbon:[[@LINE+13]]:5 // CHECK:STDERR: │ fn F(unused generic T: A) {} - // CHECK:STDERR: · ─────────────┬───────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ C(()).F(T); // CHECK:STDERR: · ┳━━━━━━━━━ @@ -62,9 +62,9 @@ class D(DD: type) { // // CHECK:STDERR: ╭─┤ fail_interface_wrong_generic_param.carbon:[[@LINE+13]]:5 // CHECK:STDERR: │ fn F(unused generic T: A) {} - // CHECK:STDERR: · ─────────────┬───────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ C(()).F(T); // CHECK:STDERR: · ┳━━━━━━━━━ diff --git a/toolchain/check/testdata/deduce/tuple.carbon b/toolchain/check/testdata/deduce/tuple.carbon index d068b007f866..6caa2c1f31bd 100644 --- a/toolchain/check/testdata/deduce/tuple.carbon +++ b/toolchain/check/testdata/deduce/tuple.carbon @@ -49,9 +49,9 @@ fn F[T: type](pair: (T, T)) -> T; fn G(pair: (C, D)) -> D { // CHECK:STDERR: ╭─┤ fail_inconsistent.carbon:[[@LINE+12]]:10 // CHECK:STDERR: │ fn F[T: type](pair: (T, T)) -> T; - // CHECK:STDERR: · ────────────────┬──────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return F(pair); // CHECK:STDERR: · ━┳━━━━━ diff --git a/toolchain/check/testdata/deduce/type_operator.carbon b/toolchain/check/testdata/deduce/type_operator.carbon index 5e72880faaba..5cb064164f1c 100644 --- a/toolchain/check/testdata/deduce/type_operator.carbon +++ b/toolchain/check/testdata/deduce/type_operator.carbon @@ -59,9 +59,9 @@ fn F[T: type](p: const T*) -> T { return F(p); } fn G(p: C*) -> const C { // CHECK:STDERR: ╭─┤ fail_const_from_nonconst.carbon:[[@LINE+12]]:10 // CHECK:STDERR: │ fn F[T: type](p: const T*) -> T { return F(p); } - // CHECK:STDERR: · ────────────────┬──────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return F(p); // CHECK:STDERR: · ━━┳━ diff --git a/toolchain/check/testdata/deduce/where.carbon b/toolchain/check/testdata/deduce/where.carbon index 98ea6518aa15..4c05215ac487 100644 --- a/toolchain/check/testdata/deduce/where.carbon +++ b/toolchain/check/testdata/deduce/where.carbon @@ -30,9 +30,9 @@ fn G() { // // CHECK:STDERR: ╭─┤ fail_todo_where.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn F[U: type](unused generic T: Z where .Z1 = C(U)) {} - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ F(() as type); // CHECK:STDERR: · ━━━━━━┳━━━━━━ diff --git a/toolchain/check/testdata/eval/symbolic.carbon b/toolchain/check/testdata/eval/symbolic.carbon index 77e1d2287d58..4d47c4e10fde 100644 --- a/toolchain/check/testdata/eval/symbolic.carbon +++ b/toolchain/check/testdata/eval/symbolic.carbon @@ -36,23 +36,23 @@ eval fn F(generic B: bool) -> type { } fn G(generic B: bool) { + // CHECK:STDERR: ╭─┤ fail_symbolic_call_to_eval_fn_invalid_instantiation.carbon:[[@LINE+12]]:24 + // CHECK:STDERR: -> │ let unused n: F(B) = ({}, {}); + // CHECK:STDERR: · ┳━━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: cannot initialize tuple of 0 elements from + // CHECK:STDERR: · ┃ tuple with 2 elements + // CHECK:STDERR: · ┃ [TupleInitElementCountMismatch] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ G(true); + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ in monomorphization of `G(true)` here [ResolvingSpecificHere] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: let unused n: F(B) = ({}, {}); } // TODO: Provide a location for the "cannot initialize" error message. fn H() { - // CHECK:STDERR: ╭─┤ fail_symbolic_call_to_eval_fn_invalid_instantiation.carbon:[[@LINE+12]]:3 - // CHECK:STDERR: │ let unused n: F(B) = ({}, {}); - // CHECK:STDERR: · ┬─────── - // CHECK:STDERR: · ╰──┤ cannot initialize tuple of 0 elements from tuple - // CHECK:STDERR: · │ with 2 elements - // CHECK:STDERR: · │ [TupleInitElementCountMismatch] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ G(true); - // CHECK:STDERR: · ┳ - // CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific `G(true)` [ResolvingSpecificHere] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: G(true); } diff --git a/toolchain/check/testdata/facet/access.carbon b/toolchain/check/testdata/facet/access.carbon index f8622f01c706..54cf107e1e11 100644 --- a/toolchain/check/testdata/facet/access.carbon +++ b/toolchain/check/testdata/facet/access.carbon @@ -148,14 +148,12 @@ fn F(generic U: Core.Destroy & I where .X = .Self) { // member lookup, but can't call methods without `self`. See the // `compound_access_through_call_with_self_param.carbon` test for the former. // - // CHECK:STDERR: ╭─┤ fail_compound_access_through_call.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_compound_access_through_call.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ u.(I.G)(); // CHECK:STDERR: · ┳━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `U` into type - // CHECK:STDERR: · │ ┃ implementing `I` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `U` does not implement interface `Core.ImplicitAs(I)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ implementing `I` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: u.(I.G)(); @@ -163,14 +161,12 @@ fn F(generic U: Core.Destroy & I where .X = .Self) { // This is the same as the above, since G() returns a non-type value of type // `U`. // - // CHECK:STDERR: ╭─┤ fail_compound_access_through_call.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_compound_access_through_call.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ U.(I.G)().(I.G)(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `U` into type - // CHECK:STDERR: · │ ┃ implementing `I` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `U` does not implement interface `Core.ImplicitAs(I)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ implementing `I` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: U.(I.G)().(I.G)(); @@ -406,15 +402,12 @@ fn F(generic V: Z(.Self)) { // // TODO: The identified facet type `NX` includes `X` and should provide a // same-type constraint `X.X1 == {}` which would allow this conversion. - // CHECK:STDERR: ╭─┤ fail_todo_find_access_value_in_second_nested_access.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_find_access_value_in_second_nested_access.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ {} as V.(Z(V).Z1).(Y(V).Y1).(X.X1); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `{}` to - // CHECK:STDERR: · │ ┃ `V.(Z(V).Z1).(Y(V).Y1).(X.X1)` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `{}` does not implement interface - // CHECK:STDERR: · │ `Core.As(V.(Z(V).Z1).(Y(V).Y1).(X.X1))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `V.(Z(V).Z1).(Y(V).Y1).(X.X1)` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: {} as V.(Z(V).Z1).(Y(V).Y1).(X.X1); @@ -481,13 +474,11 @@ constraint NY(PeriodSelf: type) { // `(C as Y(T)).Y1` but we currently only look in `C`. See the TODO in // `TryFindValueInRewriteConstraints()`. fn F(generic T: Z where C impls NY(.Self)) -> C.(Y(T).Y1) { - // CHECK:STDERR: ╭─┤ fail_todo_find_access_value_in_facet_from_specific_interface.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_find_access_value_in_facet_from_specific_interface.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ return {}; // CHECK:STDERR: · ┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `{}` to `C.(Y(T).Y1)` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `{}` does not implement interface `Core.ImplicitAs(C.(Y(T).Y1))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return {}; diff --git a/toolchain/check/testdata/facet/combine.carbon b/toolchain/check/testdata/facet/combine.carbon index 7295c715747c..5ff73a53f08f 100644 --- a/toolchain/check/testdata/facet/combine.carbon +++ b/toolchain/check/testdata/facet/combine.carbon @@ -104,9 +104,9 @@ fn G[T: A(P2) & B](unused t: T) {} fn F() { // CHECK:STDERR: ╭─┤ fail_wrong_generic_interface.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn G[T: A(P2) & B](unused t: T) {} - // CHECK:STDERR: · ────────────────┬──────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ G({} as C); // CHECK:STDERR: · ━━━━━┳━━━━ @@ -190,9 +190,9 @@ interface K {} fn Test() { // CHECK:STDERR: ╭─┤ fail_compare_not_equal.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn Same[T: type](unused a: WrapType(T), unused b: WrapType(T)) {} - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Same(Type(I & J), Type(K & I & J)); // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -216,9 +216,9 @@ interface J(T: type) {} fn Test() { // CHECK:STDERR: ╭─┤ fail_compare_not_equal_parameterized.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn Same[T: type](unused a: WrapType(T), unused b: WrapType(T)) {} - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Same(Type(I & J(())), Type(J({}) & I)); // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -242,9 +242,9 @@ interface J(T: type) {} fn Test() { // CHECK:STDERR: ╭─┤ fail_compare_not_equal_parameterized_extra.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn Same[T: type](unused a: WrapType(T), unused b: WrapType(T)) {} - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Same(Type(I & J(())), Type(J(()) & J({}) & I)); // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 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 a26a89b93b8e..bd9f218fc575 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 @@ -64,9 +64,9 @@ fn A[T: I({}, {})](unused t: T) {} fn B() { // CHECK:STDERR: ╭─┤ fail_mismatch_impl_constraint_with_fixed_specific.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn A[T: I({}, {})](unused t: T) {} - // CHECK:STDERR: · ────────────────┬──────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ A({} as C); // CHECK:STDERR: · ━━━━━┳━━━━ @@ -91,9 +91,9 @@ fn A[T: I](unused t: T) {} fn B() { // CHECK:STDERR: ╭─┤ fail_mismatch_impl_self_with_fixed_specific.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn A[T: I](unused t: T) {} - // CHECK:STDERR: · ────────────┬──────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ A({} as C({}, {})); // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━━ diff --git a/toolchain/check/testdata/facet/early_impls.carbon b/toolchain/check/testdata/facet/early_impls.carbon index 0290ddcf8ed3..f3bc34aeab8b 100644 --- a/toolchain/check/testdata/facet/early_impls.carbon +++ b/toolchain/check/testdata/facet/early_impls.carbon @@ -273,9 +273,9 @@ interface S(T: type); // conversion fails. // CHECK:STDERR: ╭─┤ fail_early_impls_with_period_self_replaced.carbon:[[@LINE+15]]:56 // CHECK:STDERR: │ class NeedZ(V: Z(.Self)); -// CHECK:STDERR: · ────────────┬──────────── -// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here -// CHECK:STDERR: · │ [DeductionGenericHere] +// CHECK:STDERR: · ──┬── +// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here +// CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ ...sed generic T: type where C impls Z(.Self) and NeedZ(C) impls S(.Self)) {} // CHECK:STDERR: · ┳━━━━━━━ diff --git a/toolchain/check/testdata/facet/early_rewrites.carbon b/toolchain/check/testdata/facet/early_rewrites.carbon index f4b3830685df..8fdbe4085b4c 100644 --- a/toolchain/check/testdata/facet/early_rewrites.carbon +++ b/toolchain/check/testdata/facet/early_rewrites.carbon @@ -134,21 +134,18 @@ class D; // // TODO: Right now the type of `U` ends up with an ImplSelfWitness // which does not resolve the access. So () can't convert to it. -// CHECK:STDERR: ╭─┤ fail_todo_period_self_used_in_access_in_nested_specific.carbon:[[@LINE+17]]:38 +// CHECK:STDERR: ╭─┤ fail_todo_period_self_used_in_access_in_nested_specific.carbon:[[@LINE+14]]:38 // CHECK:STDERR: │ class C(T: Z & Y, U: T.(Z.Z1)) {} -// CHECK:STDERR: · ────────────────┬─────────────── -// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here -// CHECK:STDERR: · │ [DeductionGenericHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here +// CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ impl D as Z where .Z1 = () and .Z2 = C(.Self, .Z1) {} // CHECK:STDERR: · ┳━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert -// CHECK:STDERR: · │ ┃ expression of type `type` to -// CHECK:STDERR: · │ ┃ `.(Z.Z1)` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `type` does not implement -// CHECK:STDERR: · │ interface `Core.ImplicitAs(.(Z.Z1))` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ expression of type `type` to +// CHECK:STDERR: · ┃ `.(Z.Z1)` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: impl D as Z where .Z1 = () and .Z2 = C(.Self, .Z1) {} @@ -177,20 +174,17 @@ class D; // // TODO: Right now the type of `U` ends up with an ImplSelfWitness // which does not resolve the access. So `.Z1` can't convert to it. -// CHECK:STDERR: ╭─┤ fail_todo_period_self_used_in_access_in_nested_specific_before_rewrite_of_access.carbon:[[@LINE+16]]:25 +// CHECK:STDERR: ╭─┤ fail_todo_period_self_used_in_access_in_nested_specific_before_rewrite_of_access.carbon:[[@LINE+13]]:25 // CHECK:STDERR: │ class C(T: Z & Y, U: T.(Z.Z1)) {} -// CHECK:STDERR: · ────────────────┬─────────────── -// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here -// CHECK:STDERR: · │ [DeductionGenericHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here +// CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ impl D as Z where .Z2 = C(.Self, .Z1) and .Z1 = () {} // CHECK:STDERR: · ┳━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type -// CHECK:STDERR: · │ ┃ `type` to `.(Z.Z1)` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `type` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(.(Z.Z1))` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `type` to `.(Z.Z1)` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: impl D as Z where .Z2 = C(.Self, .Z1) and .Z1 = () {} 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 8da1c863683c..88a8667f0586 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 @@ -29,9 +29,9 @@ fn CallGenericMethod(generic T: type, unused generic U: Generic(T)) {} fn G() { // CHECK:STDERR: ╭─┤ fail_convert_class_type_to_generic_facet_value.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn CallGenericMethod(generic T: type, unused generic U: Generic(T)) {} - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ────────┬──────── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ CallGenericMethod(WrongGenericParam, ImplsGeneric); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 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 a30f9ec69e0f..4ba7e2096213 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 @@ -19,9 +19,9 @@ fn Feed[T: Eats](unused e: T) {} // CHECK:STDERR: ╭─┤ fail_convert_facet_value_to_missing_impl.carbon:[[@LINE+14]]:36 // CHECK:STDERR: │ fn Feed[T: Eats](unused e: T) {} -// CHECK:STDERR: · ───────────────┬─────────────── -// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here -// CHECK:STDERR: · │ [DeductionGenericHere] +// CHECK:STDERR: · ──┬─ +// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here +// CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn HandleAnimal[T: Animal](a: T) { Feed(a); } // CHECK:STDERR: · ┳━━━━━━ 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 66fb90d9555a..b4fcec626e86 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 @@ -29,11 +29,11 @@ fn F[T: (type, )](unused generic A: T.0, unused x: HoldsType(T)) {} fn G(holds_to: HoldsType((RuntimeConvertTo, )), generic from: RuntimeConvertFrom) { // CHECK:STDERR: ╭─┤ fail_deduction_uses_runtime_type_conversion.carbon:[[@LINE+15]]:3 // CHECK:STDERR: │ fn F[T: (type, )](unused generic A: T.0, unused x: HoldsType(T)) {} - // CHECK:STDERR: · ───────────────────────┬────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ │ [DeductionGenericHere] - // CHECK:STDERR: · ╰────┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ │ [DeductionGenericHere] + // CHECK:STDERR: · ╰────┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ F(from, holds_to); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ diff --git a/toolchain/check/testdata/facet/nested_facet_types.carbon b/toolchain/check/testdata/facet/nested_facet_types.carbon index 8cb9e497451e..7dd924bfd049 100644 --- a/toolchain/check/testdata/facet/nested_facet_types.carbon +++ b/toolchain/check/testdata/facet/nested_facet_types.carbon @@ -348,14 +348,12 @@ constraint NZ2 { } fn F(generic FF: ((Y where .Y1 = ()) where .Self impls NZ1) where .Self impls NZ2) -> FF.(Z.Z1) { - // CHECK:STDERR: ╭─┤ fail_todo_nested_impl_combine_rewrites_from_named_constraints.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_nested_impl_combine_rewrites_from_named_constraints.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return () as C(()); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `C(())` to - // CHECK:STDERR: · │ ┃ `FF.(Z.Z1)` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `C(())` does not implement interface `Core.ImplicitAs(FF.(Z.Z1))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `FF.(Z.Z1)` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return () as C(()); diff --git a/toolchain/check/testdata/facet/partially_identified.carbon b/toolchain/check/testdata/facet/partially_identified.carbon index a2e9f06c4c72..0cd04a1a678d 100644 --- a/toolchain/check/testdata/facet/partially_identified.carbon +++ b/toolchain/check/testdata/facet/partially_identified.carbon @@ -181,7 +181,7 @@ constraint W { // CHECK:STDERR: ╭─┤ fail_impl_lookup_target_partially_identified.carbon:[[@LINE+13]]:32 // CHECK:STDERR: │ constraint W { // CHECK:STDERR: · ───────┬────── - // CHECK:STDERR: · ╰──┤ constraint is currently being defined + // CHECK:STDERR: · ╰──┤ constraint is incomplete within its definition // CHECK:STDERR: · │ [NamedConstraintIncompleteWithinDefinition] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ require impls X where .XZ = (Self as (W & Z)); diff --git a/toolchain/check/testdata/facet/period_self.carbon b/toolchain/check/testdata/facet/period_self.carbon index 2c230ee7ec33..4b308608e1bb 100644 --- a/toolchain/check/testdata/facet/period_self.carbon +++ b/toolchain/check/testdata/facet/period_self.carbon @@ -182,15 +182,12 @@ fn G(generic U: I(.Self) where .Self impls J(.Self)) { // TODO: This step should work. // - // CHECK:STDERR: ╭─┤ fail_todo_return_of_period_self_impls_interface.carbon:[[@LINE+11]]:14 + // CHECK:STDERR: ╭─┤ fail_todo_return_of_period_self_impls_interface.carbon:[[@LINE+8]]:14 // CHECK:STDERR: -> │ let u: U = U.I1(); // CHECK:STDERR: · ┳━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `.Self` to - // CHECK:STDERR: · │ ┃ `U` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `.Self` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(U)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `U` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let u: U = U.I1(); @@ -228,15 +225,12 @@ interface I(T: type) { } fn F(generic U: I(.Self)) { - // CHECK:STDERR: ╭─┤ fail_todo_return_of_type_period_self_has_type_u.carbon:[[@LINE+11]]:21 + // CHECK:STDERR: ╭─┤ fail_todo_return_of_type_period_self_has_type_u.carbon:[[@LINE+8]]:21 // CHECK:STDERR: -> │ let unused a: U = U.G(); // CHECK:STDERR: · ┳━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `.Self` to `U` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `.Self` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(U)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `.Self` to `U` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused a: U = U.G(); @@ -343,21 +337,16 @@ interface Z {} // This is missing `.Self impls M` so the `final impl` is not used, through // deduction is attempted. // -// CHECK:STDERR: ╭─┤ fail_infinite_cycle_identifying_associated_constant_as_impls_type_missing_impls_m.carbon:[[@LINE+17]]:53 +// CHECK:STDERR: ╭─┤ fail_infinite_cycle_identifying_associated_constant_as_impls_type_missing_impls_m.carbon:[[@LINE+12]]:53 // CHECK:STDERR: -> │ fn F(generic T: L where .W impls Z, a: T.W) -> {} { return a; } // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot -// CHECK:STDERR: · │ ┃ implicitly -// CHECK:STDERR: · │ ┃ convert -// CHECK:STDERR: · │ ┃ expression of -// CHECK:STDERR: · │ ┃ type `T.(L.W)` -// CHECK:STDERR: · │ ┃ to `{}` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `T.(L.W)` does -// CHECK:STDERR: · │ not implement -// CHECK:STDERR: · │ interface -// CHECK:STDERR: · │ `Core.ImplicitAs({})` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ implicitly +// CHECK:STDERR: · ┃ convert +// CHECK:STDERR: · ┃ expression of +// CHECK:STDERR: · ┃ type `T.(L.W)` +// CHECK:STDERR: · ┃ to `{}` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(generic T: L where .W impls Z, a: T.W) -> {} { return a; } @@ -397,15 +386,12 @@ interface Z(T: type) {} // This is missing `.Self impls M` so the `final impl` is not used, through // deduction is attempted. // -// CHECK:STDERR: ╭─┤ fail_infinite_cycle_identifying_associated_constant_in_impls_interface_as_type_missing_m.carbon:[[@LINE+11]]:60 +// CHECK:STDERR: ╭─┤ fail_infinite_cycle_identifying_associated_constant_in_impls_interface_as_type_missing_m.carbon:[[@LINE+8]]:60 // CHECK:STDERR: -> │ fn F(generic T: L where .Self impls Z(.W), a: T.W) -> () { return a; } // CHECK:STDERR: · ━━━━┳━━━━ // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ // CHECK:STDERR: · ┃ error: cannot implicitly convert expression of type `T.(L.W)` to `()` // CHECK:STDERR: · ┃ [ConversionFailure] -// CHECK:STDERR: · ╭──────────────────────────────────────────────────────────────╯ -// CHECK:STDERR: · │ type `T.(L.W)` does not implement interface `Core.ImplicitAs(())` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(generic T: L where .Self impls Z(.W), a: T.W) -> () { return a; } @@ -423,15 +409,12 @@ interface Z(T: L) {} // This is missing `.Self impls M` so the `final impl` is not used, through // deduction is attempted. // -// CHECK:STDERR: ╭─┤ fail_infinite_cycle_identifying_period_self_in_impls_interface_as_type_missing_m.carbon:[[@LINE+11]]:63 +// CHECK:STDERR: ╭─┤ fail_infinite_cycle_identifying_period_self_in_impls_interface_as_type_missing_m.carbon:[[@LINE+8]]:63 // CHECK:STDERR: -> │ fn F(generic T: L where .Self impls Z(.Self), a: T.W) -> () { return a; } // CHECK:STDERR: · ━━━━┳━━━━ // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ // CHECK:STDERR: · ┃ error: cannot implicitly convert expression of type `T.(L.W)` to `()` // CHECK:STDERR: · ┃ [ConversionFailure] -// CHECK:STDERR: · ╭─────────────────────────────────────────────────────────────────╯ -// CHECK:STDERR: · │ type `T.(L.W)` does not implement interface `Core.ImplicitAs(())` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(generic T: L where .Self impls Z(.Self), a: T.W) -> () { return a; } @@ -472,15 +455,12 @@ interface Z(T: Y) {} // This is missing `.Self impls M` so the `final impl` is not used, through // deduction is attempted. // -// CHECK:STDERR: ╭─┤ fail_infinite_cycle_identifying_associated_constant_in_impls_interface_as_facet_type_missing_m.carbon:[[@LINE+11]]:75 +// CHECK:STDERR: ╭─┤ fail_infinite_cycle_identifying_associated_constant_in_impls_interface_as_facet_type_missing_m.carbon:[[@LINE+8]]:75 // CHECK:STDERR: -> │ ...c T: L where .W impls Y and .Self impls Z(.W), a: T.W) -> () { return a; } // CHECK:STDERR: · ━━━━┳━━━━ // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ // CHECK:STDERR: · ┃ error: cannot implicitly convert expression of type `T.(L.W)` to `()` // CHECK:STDERR: · ┃ [ConversionFailure] -// CHECK:STDERR: · ╭─────────────────────────────────────────────────────────────────────╯ -// CHECK:STDERR: · │ type `T.(L.W)` does not implement interface `Core.ImplicitAs(())` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(generic T: L where .W impls Y and .Self impls Z(.W), a: T.W) -> () { return a; } @@ -542,15 +522,12 @@ class C(U: Y, v: U.Y1.L1) { // This creates a bug in the toolchain since the specific is now wrong and we're // unable to get the concrete value of `C(T, ()).C1`. fn F(generic T: Y where .Y1 impls M and C(.Self, ()) impls M) -> C(T, ()).C1 { - // CHECK:STDERR: ╭─┤ fail_todo_specific_resolves_final_impl_while_collecting_witnesses.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_specific_resolves_final_impl_while_collecting_witnesses.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return (); // CHECK:STDERR: · ┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `()` to - // CHECK:STDERR: · │ ┃ `T.(Y.Y1).(L.L1)` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `()` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(T.(Y.Y1).(L.L1))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `T.(Y.Y1).(L.L1)` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return (); 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 2011671dca2a..12a1fe55dac0 100644 --- a/toolchain/check/testdata/facet/tuple_and_struct_type_literal.carbon +++ b/toolchain/check/testdata/facet/tuple_and_struct_type_literal.carbon @@ -136,7 +136,7 @@ fn InterfaceParam(unused generic U: Z) {} fn ConstraintParam(unused generic U: N) {} fn F() { - // CHECK:STDERR: ╭─┤ fail_struct_literal_with_field_to_facet_type_parameter.carbon:[[@LINE+16]]:3 + // CHECK:STDERR: ╭─┤ fail_struct_literal_with_field_to_facet_type_parameter.carbon:[[@LINE+14]]:3 // CHECK:STDERR: │ fn InterfaceParam(unused generic U: Z) {} // CHECK:STDERR: · ┬─── // CHECK:STDERR: · ╰──┤ initializing generic parameter `U` @@ -146,14 +146,12 @@ fn F() { // CHECK:STDERR: -> │ InterfaceParam({.a = ()}); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `{.a: ()}` into - // CHECK:STDERR: · │ ┃ type implementing `Z` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `{.a: ()}` does not implement interface `Core.ImplicitAs(Z)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type implementing `Z` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: InterfaceParam({.a = ()}); - // CHECK:STDERR: ╭─┤ fail_struct_literal_with_field_to_facet_type_parameter.carbon:[[@LINE+16]]:3 + // CHECK:STDERR: ╭─┤ fail_struct_literal_with_field_to_facet_type_parameter.carbon:[[@LINE+14]]:3 // CHECK:STDERR: │ fn ConstraintParam(unused generic U: N) {} // CHECK:STDERR: · ┬─── // CHECK:STDERR: · ╰──┤ initializing generic parameter `U` @@ -163,10 +161,8 @@ fn F() { // CHECK:STDERR: -> │ ConstraintParam({.a = ()}); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `{.a: ()}` into - // CHECK:STDERR: · │ ┃ type implementing `N` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `{.a: ()}` does not implement interface `Core.ImplicitAs(N)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type implementing `N` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: ConstraintParam({.a = ()}); 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 8f69dd424c34..88ab739a35f1 100644 --- a/toolchain/check/testdata/facet/tuple_and_struct_type_value.carbon +++ b/toolchain/check/testdata/facet/tuple_and_struct_type_value.carbon @@ -75,7 +75,7 @@ fn InterfaceParam(unused generic U: Z) {} fn ConstraintParam(unused generic U: N) {} fn F(generic T: {.a: type}) { - // CHECK:STDERR: ╭─┤ fail_struct_value_with_field_to_facet_value.carbon:[[@LINE+16]]:3 + // CHECK:STDERR: ╭─┤ fail_struct_value_with_field_to_facet_value.carbon:[[@LINE+14]]:3 // CHECK:STDERR: │ fn InterfaceParam(unused generic U: Z) {} // CHECK:STDERR: · ┬─── // CHECK:STDERR: · ╰──┤ initializing generic parameter `U` @@ -85,14 +85,12 @@ fn F(generic T: {.a: type}) { // CHECK:STDERR: -> │ InterfaceParam(T); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `{.a: type}` into - // CHECK:STDERR: · │ ┃ type implementing `Z` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `{.a: type}` does not implement interface `Core.ImplicitAs(Z)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type implementing `Z` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: InterfaceParam(T); - // CHECK:STDERR: ╭─┤ fail_struct_value_with_field_to_facet_value.carbon:[[@LINE+16]]:3 + // CHECK:STDERR: ╭─┤ fail_struct_value_with_field_to_facet_value.carbon:[[@LINE+14]]:3 // CHECK:STDERR: │ fn ConstraintParam(unused generic U: N) {} // CHECK:STDERR: · ┬─── // CHECK:STDERR: · ╰──┤ initializing generic parameter `U` @@ -102,10 +100,8 @@ fn F(generic T: {.a: type}) { // CHECK:STDERR: -> │ ConstraintParam(T); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `{.a: type}` into - // CHECK:STDERR: · │ ┃ type implementing `N` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `{.a: type}` does not implement interface `Core.ImplicitAs(N)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type implementing `N` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: ConstraintParam(T); diff --git a/toolchain/check/testdata/facet/validate_rewrite_constraints.carbon b/toolchain/check/testdata/facet/validate_rewrite_constraints.carbon index f6d080009164..3746c426622c 100644 --- a/toolchain/check/testdata/facet/validate_rewrite_constraints.carbon +++ b/toolchain/check/testdata/facet/validate_rewrite_constraints.carbon @@ -50,9 +50,9 @@ fn G() { // // CHECK:STDERR: ╭─┤ fail_generic_interface_facet_value_wrong_specific_impl.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn F(generic U: type, unused generic T: I(U) where .X = ()) {} - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ F({}, C); // CHECK:STDERR: · ┳━━━━━━━ diff --git a/toolchain/check/testdata/for/pattern.carbon b/toolchain/check/testdata/for/pattern.carbon index 5adae6989ace..215b62494bf9 100644 --- a/toolchain/check/testdata/for/pattern.carbon +++ b/toolchain/check/testdata/for/pattern.carbon @@ -106,13 +106,11 @@ import library "empty_range"; class X {} fn Run() { - // CHECK:STDERR: ╭─┤ fail_bad_pattern.carbon:[[@LINE+9]]:7 + // CHECK:STDERR: ╭─┤ fail_bad_pattern.carbon:[[@LINE+7]]:7 // CHECK:STDERR: -> │ for (unused x: X in EmptyRange(C).Make()) { // CHECK:STDERR: · ━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `C` to `X` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `C` does not implement interface `Core.ImplicitAs(X)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: for (unused x: X in EmptyRange(C).Make()) { diff --git a/toolchain/check/testdata/function/builtin/fail_redefined.carbon b/toolchain/check/testdata/function/builtin/fail_redefined.carbon index 833287830118..f87169144456 100644 --- a/toolchain/check/testdata/function/builtin/fail_redefined.carbon +++ b/toolchain/check/testdata/function/builtin/fail_redefined.carbon @@ -15,8 +15,8 @@ fn A(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ╭─┤ fail_redefined.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ fn A(n: i32, m: i32) -> i32 = "int.sadd"; -// CHECK:STDERR: · ──────────────┬────────────── -// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn A(n: i32, unused m: i32) -> i32 { return n; } // CHECK:STDERR: · ━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━ @@ -28,8 +28,8 @@ fn A(n: i32, unused m: i32) -> i32 { return n; } fn B(n: i32, unused m: i32) -> i32 { return n; } // CHECK:STDERR: ╭─┤ fail_redefined.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ fn B(n: i32, unused m: i32) -> i32 { return n; } -// CHECK:STDERR: · ──────────────────┬───────────────── -// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn B(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: · ━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━ @@ -41,8 +41,8 @@ fn B(n: i32, m: i32) -> i32 = "int.sadd"; fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ╭─┤ fail_redefined.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ fn C(n: i32, m: i32) -> i32 = "int.sadd"; -// CHECK:STDERR: · ──────────────┬────────────── -// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: · ━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━ diff --git a/toolchain/check/testdata/function/call/default_values.carbon b/toolchain/check/testdata/function/call/default_values.carbon index d2837b9b3d54..fae23300d9a1 100644 --- a/toolchain/check/testdata/function/call/default_values.carbon +++ b/toolchain/check/testdata/function/call/default_values.carbon @@ -18,11 +18,10 @@ fn F(unused x: C = {}, unused y: C = {}, unused z: C = {}) {} fn H(unused x: C = {}, (unused y: C = {}, unused z: C = {}) = ({}, {})) {} fn G() { - // CHECK:STDERR: ╭─┤ fail_caller_too_many_arguments.carbon:[[@LINE+22]]:3 + // CHECK:STDERR: ╭─┤ fail_caller_too_many_arguments.carbon:[[@LINE+21]]:3 // CHECK:STDERR: │ fn F(unused x: C = {}, unused y: C = {}, unused z: C = {}) {} - // CHECK:STDERR: · ──────────────────────────────┬───────────────────────────── - // CHECK:STDERR: · ╰──┤ calling function declared here - // CHECK:STDERR: · │ [InCallToEntity] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ F({}, {}, {}, {}); // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━ @@ -30,7 +29,7 @@ fn G() { // CHECK:STDERR: · ┃ [CallArgCountMismatch] // CHECK:STDERR: ╰──── // CHECK:STDERR: - // CHECK:STDERR: ╭─┤ fail_caller_too_many_arguments.carbon:[[@LINE-15]]:24 + // CHECK:STDERR: ╭─┤ fail_caller_too_many_arguments.carbon:[[@LINE-14]]:24 // CHECK:STDERR: -> │ fn H(unused x: C = {}, (unused y: C = {}, unused z: C = {}) = ({}, {})) {} // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━─────────── // CHECK:STDERR: · ┗━━┫ error: tuple pattern expects 2 elements, but tuple @@ -53,8 +52,8 @@ fn F(unused x: C, unused y: C = {}) {} fn G() { // CHECK:STDERR: ╭─┤ fail_caller_too_few_arguments.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn F(unused x: C, unused y: C = {}) {} - // CHECK:STDERR: · ──────────────────┬────────────────── - // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ F(); // CHECK:STDERR: · ━┳━ diff --git a/toolchain/check/testdata/function/call/eval_musteval.carbon b/toolchain/check/testdata/function/call/eval_musteval.carbon index 3e27a88d7afa..eb5a95ab1118 100644 --- a/toolchain/check/testdata/function/call/eval_musteval.carbon +++ b/toolchain/check/testdata/function/call/eval_musteval.carbon @@ -31,9 +31,9 @@ musteval fn MustEval(unused n: i32) {} fn RuntimeArg(n: i32) { // CHECK:STDERR: ╭─┤ fail_no_eval_musteval.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ musteval fn MustEval(unused n: i32) {} - // CHECK:STDERR: · ──────────────────┬────────────────── - // CHECK:STDERR: · ╰──┤ compile-time-only function declared here - // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] + // CHECK:STDERR: · ────┬─── + // CHECK:STDERR: · ╰──┤ compile-time-only function declared here + // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ MustEval(n); // CHECK:STDERR: · ━━━━━┳━━━━━ @@ -68,9 +68,9 @@ musteval fn MustEval(unused n: i32) {} musteval fn CallMustEval(n: i32) { // CHECK:STDERR: ╭─┤ fail_todo_musteval_calls_musteval.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ musteval fn MustEval(unused n: i32) {} - // CHECK:STDERR: · ──────────────────┬────────────────── - // CHECK:STDERR: · ╰──┤ compile-time-only function declared here - // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] + // CHECK:STDERR: · ────┬─── + // CHECK:STDERR: · ╰──┤ compile-time-only function declared here + // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ MustEval(n); // CHECK:STDERR: · ━━━━━┳━━━━━ diff --git a/toolchain/check/testdata/function/call/fail_param_count.carbon b/toolchain/check/testdata/function/call/fail_param_count.carbon index b5f57efdfdb8..8dc2469353f2 100644 --- a/toolchain/check/testdata/function/call/fail_param_count.carbon +++ b/toolchain/check/testdata/function/call/fail_param_count.carbon @@ -19,7 +19,7 @@ fn Run2(unused a: i32, unused b: i32) {} fn Main() { // CHECK:STDERR: ╭─┤ fail_param_count.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn Run0() {} - // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ──┬─ // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Run0(1); @@ -31,7 +31,7 @@ fn Main() { Run0(1); // CHECK:STDERR: ╭─┤ fail_param_count.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn Run0() {} - // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ──┬─ // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Run0(0, 1); @@ -44,8 +44,8 @@ fn Main() { // CHECK:STDERR: ╭─┤ fail_param_count.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn Run1(unused a: i32) {} - // CHECK:STDERR: · ────────────┬─────────── - // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Run1(); // CHECK:STDERR: · ━━━┳━━ @@ -56,8 +56,8 @@ fn Main() { Run1(); // CHECK:STDERR: ╭─┤ fail_param_count.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn Run1(unused a: i32) {} - // CHECK:STDERR: · ────────────┬─────────── - // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Run1(0, 1); // CHECK:STDERR: · ━━━━━┳━━━━ @@ -69,8 +69,8 @@ fn Main() { // CHECK:STDERR: ╭─┤ fail_param_count.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn Run2(unused a: i32, unused b: i32) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Run2(); // CHECK:STDERR: · ━━━┳━━ @@ -81,8 +81,8 @@ fn Main() { Run2(); // CHECK:STDERR: ╭─┤ fail_param_count.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn Run2(unused a: i32, unused b: i32) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Run2(0); // CHECK:STDERR: · ━━━┳━━━ diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index 3449eec6eefb..8dc41c4776d6 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -15,7 +15,7 @@ fn G(unused a: i32) {} fn F() { - // CHECK:STDERR: ╭─┤ fail_param_type.carbon:[[@LINE+15]]:5 + // CHECK:STDERR: ╭─┤ fail_param_type.carbon:[[@LINE+12]]:5 // CHECK:STDERR: │ fn G(unused a: i32) {} // CHECK:STDERR: · ───┬── // CHECK:STDERR: · ╰──┤ initializing function parameter [InCallToFunctionParam] @@ -23,11 +23,8 @@ fn F() { // CHECK:STDERR: -> │ G(1.0); // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Core.FloatLiteral` - // CHECK:STDERR: · │ ┃ to `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.FloatLiteral` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `i32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: G(1.0); @@ -92,7 +89,7 @@ fn F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G] // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float] -// CHECK:STDOUT: %.loc33: %i32 = converted %float, [concrete = ] +// CHECK:STDOUT: %.loc30: %i32 = converted %float, [concrete = ] // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } 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 a14224119dc0..a3a3703803d1 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -15,13 +15,11 @@ fn Foo() -> f64 { return 1.0; } fn Run() { - // CHECK:STDERR: ╭─┤ fail_return_type_mismatch.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_return_type_mismatch.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var unused x: i32 = Foo(); // CHECK:STDERR: · ━━━━━━━┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `f64` to `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `f64` does not implement interface `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused x: i32 = Foo(); @@ -75,7 +73,7 @@ fn Run() { // CHECK:STDOUT: %T.09f: %SubobjectDestroy.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.type.dea: type = fn_type @T.as_type.as.DestroyImpl.impl.Op, @T.as_type.as.DestroyImpl.impl(%T.09f) [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.6e5: %T.as_type.as.DestroyImpl.impl.Op.type.dea = struct_value () [symbolic] -// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.687: type = fn_type @SubobjectDestroy.WithSelf.Op.loc27 [concrete] +// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.687: type = fn_type @SubobjectDestroy.WithSelf.Op.loc25 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f: %SubobjectDestroy.WithSelf.Op.type.687 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.49a: %SubobjectDestroy.type = facet_value %i32, (%custom_witness.b80) [concrete] @@ -139,7 +137,7 @@ fn Run() { // CHECK:STDOUT: %x.var: ref %i32 = var_storage %x.var_patt // CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [concrete = constants.%Foo] // CHECK:STDOUT: %Foo.call: init %f64.761 = call %Foo.ref() -// CHECK:STDOUT: %.loc27_3.1: %i32 = converted %Foo.call, [concrete = ] +// CHECK:STDOUT: %.loc25_3.1: %i32 = converted %Foo.call, [concrete = ] // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %x: ref %i32 = wrapper_binding x, %x.var @@ -147,14 +145,14 @@ fn Run() { // CHECK:STDOUT: %x.patt: %pattern_type.d94 = ref_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: %x.var_patt: %pattern_type.d94 = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.facet.loc27_3.1: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80) [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %.loc27_3.2: %Destroy.type = converted constants.%i32, %Destroy.facet.loc27_3.1 [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %Destroy.facet.loc27_3.2: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80) [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %.loc27_3.3: %Destroy.type = converted constants.%i32, %Destroy.facet.loc27_3.2 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %Destroy.facet.loc25_3.1: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc25_3.2: %Destroy.type = converted constants.%i32, %Destroy.facet.loc25_3.1 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %Destroy.facet.loc25_3.2: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc25_3.3: %Destroy.type = converted constants.%i32, %Destroy.facet.loc25_3.2 [concrete = constants.%Destroy.facet] // CHECK:STDOUT: %SelfDestruct.specific_fn: = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet) [concrete = constants.%SelfDestruct.specific_fn] // CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%x.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc27(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc25(%self.param: ref %i32) = "no_op"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/form.carbon b/toolchain/check/testdata/function/call/form.carbon index 69524ac2e6e3..453b690791b2 100644 --- a/toolchain/check/testdata/function/call/form.carbon +++ b/toolchain/check/testdata/function/call/form.carbon @@ -82,15 +82,12 @@ fn G(x:? F()); // --- fail_form_param_not_form.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: ╭─┤ fail_form_param_not_form.carbon:[[@LINE+11]]:10 +// CHECK:STDERR: ╭─┤ fail_form_param_not_form.carbon:[[@LINE+8]]:10 // CHECK:STDERR: -> │ fn F(x:? i32); // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `type` to -// CHECK:STDERR: · │ ┃ `Core.Form` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `type` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(Core.Form)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `Core.Form` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(x:? i32); @@ -152,7 +149,7 @@ fn F(generic Fm: Core.Form, unused x:? Fm) {} fn G() { var x: i32; - // CHECK:STDERR: ╭─┤ fail_todo_composite_generic_form.carbon:[[@LINE+16]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_composite_generic_form.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn F(generic Fm: Core.Form, unused x:? Fm) {} // CHECK:STDERR: · ──────┬────── // CHECK:STDERR: · ╰──┤ initializing generic parameter `Fm` declared here @@ -161,11 +158,8 @@ fn G() { // CHECK:STDERR: -> │ F((form(var i32), form(ref i32)), (x, ref x)); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `(Core.Form, Core.Form)` to `Core.Form` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `(Core.Form, Core.Form)` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Core.Form)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `(Core.Form, Core.Form)` to `Core.Form` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: F((form(var i32), form(ref i32)), (x, ref x)); @@ -182,9 +176,9 @@ fn G() { var v: i32 = 0; // CHECK:STDERR: ╭─┤ fail_todo_deduce_generic_form.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn F[Fm: Core.Form](v:? Fm); - // CHECK:STDERR: · ──────────────┬───────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ F(ref v); // CHECK:STDERR: · ━━━━┳━━━ @@ -204,7 +198,7 @@ fn F(generic Fm: Core.Form, unused x:? Fm) {} fn G() { var x: i32; - // CHECK:STDERR: ╭─┤ fail_form_generic_arg_not_form.carbon:[[@LINE+14]]:3 + // CHECK:STDERR: ╭─┤ fail_form_generic_arg_not_form.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn F(generic Fm: Core.Form, unused x:? Fm) {} // CHECK:STDERR: · ──────┬────── // CHECK:STDERR: · ╰──┤ initializing generic parameter `Fm` declared here @@ -213,9 +207,7 @@ fn G() { // CHECK:STDERR: -> │ F(i32, x); // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `type` to `Core.Form` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `type` does not implement interface `Core.ImplicitAs(Core.Form)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: F(i32, x); @@ -376,15 +368,12 @@ fn G[T: I](x: T) { // --- fail_return_form_not_form.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: ╭─┤ fail_return_form_not_form.carbon:[[@LINE+11]]:12 +// CHECK:STDERR: ╭─┤ fail_return_form_not_form.carbon:[[@LINE+8]]:12 // CHECK:STDERR: -> │ fn F() ->? i32; // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `type` to -// CHECK:STDERR: · │ ┃ `Core.Form` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `type` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(Core.Form)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `Core.Form` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F() ->? i32; diff --git a/toolchain/check/testdata/function/capture/uncaptured_locals.carbon b/toolchain/check/testdata/function/capture/uncaptured_locals.carbon index 3948531f7c58..2e7c923f8649 100644 --- a/toolchain/check/testdata/function/capture/uncaptured_locals.carbon +++ b/toolchain/check/testdata/function/capture/uncaptured_locals.carbon @@ -20,8 +20,8 @@ fn Test() { fn Inner() { // CHECK:STDERR: ╭─┤ fail_reference_uncaptured.carbon:[[@LINE+12]]:23 // CHECK:STDERR: │ let x: X = {}; - // CHECK:STDERR: · ──┬─ - // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let unused y: X = x; // CHECK:STDERR: · ┳ @@ -42,8 +42,8 @@ fn Test() { fn G() -> i32 { // CHECK:STDERR: ╭─┤ fail_reference_uncaptured_var.carbon:[[@LINE+11]]:12 // CHECK:STDERR: │ var n: i32; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return n; // CHECK:STDERR: · ┳ @@ -62,8 +62,8 @@ fn Test(p: i32) { fn H() -> i32 { // CHECK:STDERR: ╭─┤ fail_reference_uncaptured_param.carbon:[[@LINE+11]]:12 // CHECK:STDERR: │ fn Test(p: i32) { - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return p; // CHECK:STDERR: · ┳ @@ -85,8 +85,8 @@ fn Test() { (fn() { // CHECK:STDERR: ╭─┤ fail_reference_uncaptured_lambda.carbon:[[@LINE+12]]:23 // CHECK:STDERR: │ let x: X = {}; - // CHECK:STDERR: · ──┬─ - // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let unused y: X = x; // CHECK:STDERR: · ┳ @@ -107,8 +107,8 @@ fn F() { class Local { // CHECK:STDERR: ╭─┤ fail_reference_uncaptured_local_var_in_class.carbon:[[@LINE+12]]:22 // CHECK:STDERR: │ var n: i32 = 0; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ var field: i32 = n; // CHECK:STDERR: · ┳ @@ -129,8 +129,8 @@ fn F() { class Local { // CHECK:STDERR: ╭─┤ fail_reference_uncaptured_local_let_in_class.carbon:[[@LINE+12]]:27 // CHECK:STDERR: │ let m: i32 = 1; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let member_let: i32 = m; // CHECK:STDERR: · ┳ @@ -152,8 +152,8 @@ fn F() { fn Method() -> i32 { // CHECK:STDERR: ╭─┤ fail_reference_uncaptured_local_var_in_method.carbon:[[@LINE+11]]:14 // CHECK:STDERR: │ var n: i32 = 0; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return n; // CHECK:STDERR: · ┳ @@ -176,8 +176,8 @@ fn F() { interface LocalIface { // CHECK:STDERR: ╭─┤ fail_reference_uncaptured_local_in_interface.carbon:[[@LINE+12]]:18 // CHECK:STDERR: │ var n: i32 = 0; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let X: i32 = n; // CHECK:STDERR: · ┳ @@ -202,8 +202,8 @@ fn F() { } // CHECK:STDERR: ╭─┤ fail_reference_uncaptured_local_in_impl.carbon:[[@LINE+26]]:35 // CHECK:STDERR: │ var n: i32 = 0; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ impl C as LocalIface where .Y = n {}; // CHECK:STDERR: · ┳ @@ -243,8 +243,8 @@ fn F() { fn Get(unused self) -> i32 { // CHECK:STDERR: ╭─┤ fail_reference_uncaptured_local_in_interface_member.carbon:[[@LINE+11]]:14 // CHECK:STDERR: │ var n: i32 = 0; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return n; // CHECK:STDERR: · ┳ @@ -282,8 +282,8 @@ fn F() { var n: i32 = 0; // CHECK:STDERR: ╭─┤ fail_typeof_nested_lambda.carbon:[[@LINE+13]]:46 // CHECK:STDERR: │ var n: i32 = 0; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [UncapturedLocalDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let unused x: typeof((fn() -> i32 { return n; })()) = 0; // CHECK:STDERR: · ┳ diff --git a/toolchain/check/testdata/function/declaration/default_values.carbon b/toolchain/check/testdata/function/declaration/default_values.carbon index 326bab6844cd..ea77d91a6cdb 100644 --- a/toolchain/check/testdata/function/declaration/default_values.carbon +++ b/toolchain/check/testdata/function/declaration/default_values.carbon @@ -30,13 +30,11 @@ library "[[@TEST_NAME]]"; class C {} class D {} -// CHECK:STDERR: ╭─┤ fail_type_mismatch.carbon:[[@LINE+9]]:13 +// CHECK:STDERR: ╭─┤ fail_type_mismatch.carbon:[[@LINE+7]]:13 // CHECK:STDERR: -> │ fn K(x: C = {} as D); // CHECK:STDERR: · ━┳━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `D` to `C` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `D` does not implement interface `Core.ImplicitAs(C)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn K(x: C = {} as D); @@ -137,13 +135,11 @@ impl C as Core.As(D) { fn Convert(unused self: C) -> D { return {} as D; } } -// CHECK:STDERR: ╭─┤ fail_explicit_conversion_not_supported.carbon:[[@LINE+9]]:13 +// CHECK:STDERR: ╭─┤ fail_explicit_conversion_not_supported.carbon:[[@LINE+7]]:13 // CHECK:STDERR: -> │ fn F(a: D = {} as C); // CHECK:STDERR: · ━┳━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `C` to `D` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `C` does not implement interface `Core.ImplicitAs(D)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(a: D = {} as C); diff --git a/toolchain/check/testdata/function/declaration/extern.carbon b/toolchain/check/testdata/function/declaration/extern.carbon index 683851ce2876..f57ae7f928db 100644 --- a/toolchain/check/testdata/function/declaration/extern.carbon +++ b/toolchain/check/testdata/function/declaration/extern.carbon @@ -31,8 +31,8 @@ library "[[@TEST_NAME]]"; extern fn F(); // CHECK:STDERR: ╭─┤ fail_redecl.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ extern fn F(); -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ extern fn F(); // CHECK:STDERR: · ━━━━━━━┳━━━━━━ @@ -48,8 +48,8 @@ library "[[@TEST_NAME]]"; extern fn F(); // CHECK:STDERR: ╭─┤ fail_redecl_extern.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ extern fn F(); -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F(); // CHECK:STDERR: · ━━━┳━━━ @@ -95,8 +95,8 @@ import library "basic"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ basic.carbon // CHECK:STDERR: │ extern fn F(); -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: extern library "basic" fn F(); diff --git a/toolchain/check/testdata/function/declaration/extern_library.carbon b/toolchain/check/testdata/function/declaration/extern_library.carbon index dc2b245b87c2..54830e645837 100644 --- a/toolchain/check/testdata/function/declaration/extern_library.carbon +++ b/toolchain/check/testdata/function/declaration/extern_library.carbon @@ -54,7 +54,7 @@ library "[[@TEST_NAME]]"; import library "extern_library"; -// CHECK:STDERR: ╭─┤ fail_extern_library_nonextern.carbon:[[@LINE+12]]:1 +// CHECK:STDERR: ╭─┤ fail_extern_library_nonextern.carbon:[[@LINE+13]]:1 // CHECK:STDERR: -> │ fn F(); // CHECK:STDERR: · ━━━┳━━━ // CHECK:STDERR: · ┗━━┫ error: redeclarations of `fn F` must match use of `extern` @@ -62,8 +62,9 @@ import library "extern_library"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_library.carbon // CHECK:STDERR: │ extern library "extern_library_owner" fn F(); -// CHECK:STDERR: · ──────────────────────┬────────────────────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here +// CHECK:STDERR: · │ [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(); @@ -95,7 +96,7 @@ extern library "extern_library_owner" fn F(); library "[[@TEST_NAME]]"; // CHECK:STDERR: ╷ ╭── imported from: fail_extern_library_collision.carbon [InImport] -// CHECK:STDERR: ├─┤ extern_library_copy.carbon:[[@LINE+12]]:1 +// CHECK:STDERR: ├─┤ extern_library_copy.carbon:[[@LINE+13]]:1 // CHECK:STDERR: -> │ extern library "extern_library_owner" fn F(); // CHECK:STDERR: · ━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: duplicate name `F` being declared in the same scope @@ -103,8 +104,9 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_library.carbon // CHECK:STDERR: │ extern library "extern_library_owner" fn F(); -// CHECK:STDERR: · ──────────────────────┬────────────────────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here +// CHECK:STDERR: · │ [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: extern library "extern_library_owner" fn F(); @@ -178,7 +180,7 @@ import library "extern_of_import"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_of_import.carbon // CHECK:STDERR: │ fn F(); -// CHECK:STDERR: · ───┬─── +// CHECK:STDERR: · ┬ // CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: diff --git a/toolchain/check/testdata/function/declaration/fail_import_incomplete_return.carbon b/toolchain/check/testdata/function/declaration/fail_import_incomplete_return.carbon index 4735d475dd61..c8c75af6335e 100644 --- a/toolchain/check/testdata/function/declaration/fail_import_incomplete_return.carbon +++ b/toolchain/check/testdata/function/declaration/fail_import_incomplete_return.carbon @@ -27,8 +27,8 @@ fn ReturnDUsed() -> D; fn Call() { // CHECK:STDERR: ╭─┤ fail_incomplete_return.carbon:[[@LINE+15]]:3 // CHECK:STDERR: │ class C; - // CHECK:STDERR: · ────┬─── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn ReturnCUsed() -> C; // CHECK:STDERR: · ──┬─ @@ -43,8 +43,8 @@ fn Call() { ReturnCUsed(); // CHECK:STDERR: ╭─┤ fail_incomplete_return.carbon:[[@LINE+15]]:3 // CHECK:STDERR: │ class D; - // CHECK:STDERR: · ────┬─── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn ReturnDUsed() -> D; // CHECK:STDERR: · ──┬─ @@ -68,17 +68,16 @@ library "[[@TEST_NAME]]"; import library "incomplete_return"; fn CallFAndGIncomplete() { - // CHECK:STDERR: ╭─┤ fail_use_imported.carbon:[[@LINE+17]]:3 + // CHECK:STDERR: ╭─┤ fail_use_imported.carbon:[[@LINE+16]]:3 // CHECK:STDERR: -> │ ReturnCUnused(); // CHECK:STDERR: · ━━━━━━━┳━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: function returns incomplete type `C` // CHECK:STDERR: · ┃ [IncompleteTypeInFunctionReturnType] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── imported from: fail_use_imported.carbon [InImport] // CHECK:STDERR: ├─┤ fail_incomplete_return.carbon // CHECK:STDERR: │ class C; - // CHECK:STDERR: · ────┬─── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn ReturnCUnused() -> C; // CHECK:STDERR: · ──┬─ @@ -86,17 +85,16 @@ fn CallFAndGIncomplete() { // CHECK:STDERR: ╰──── // CHECK:STDERR: ReturnCUnused(); - // CHECK:STDERR: ╭─┤ fail_use_imported.carbon:[[@LINE+17]]:3 + // CHECK:STDERR: ╭─┤ fail_use_imported.carbon:[[@LINE+16]]:3 // CHECK:STDERR: -> │ ReturnCUsed(); // CHECK:STDERR: · ━━━━━━┳━━━━━━ // CHECK:STDERR: · ┗━━┫ error: function returns incomplete type `C` // CHECK:STDERR: · ┃ [IncompleteTypeInFunctionReturnType] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── imported from: fail_use_imported.carbon [InImport] // CHECK:STDERR: ├─┤ fail_incomplete_return.carbon // CHECK:STDERR: │ class C; - // CHECK:STDERR: · ────┬─── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn ReturnCUsed() -> C; // CHECK:STDERR: · ──┬─ @@ -247,7 +245,7 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: %T.09f: %SubobjectDestroy.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.type.dea: type = fn_type @T.as_type.as.DestroyImpl.impl.Op, @T.as_type.as.DestroyImpl.impl(%T.09f) [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.6e5: %T.as_type.as.DestroyImpl.impl.Op.type.dea = struct_value () [symbolic] -// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc43_17.2 [concrete] +// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc41_17.2 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.2: %SubobjectDestroy.WithSelf.Op.type.6870fd.2 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.2: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.2), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.f61: %SubobjectDestroy.type = facet_value %D, (%custom_witness.b80ef6.2) [concrete] @@ -311,25 +309,25 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: %ReturnCUsed.ref: %ReturnCUsed.type = name_ref ReturnCUsed, imports.%Main.ReturnCUsed [concrete = constants.%ReturnCUsed] // CHECK:STDOUT: %ReturnCUsed.call: init = call %ReturnCUsed.ref() // CHECK:STDOUT: %ReturnDUnused.ref: %ReturnDUnused.type = name_ref ReturnDUnused, imports.%Main.ReturnDUnused [concrete = constants.%ReturnDUnused] -// CHECK:STDOUT: %.loc43_17.1: ref %D = temporary_storage -// CHECK:STDOUT: %ReturnDUnused.call: init %D to %.loc43_17.1 = call %ReturnDUnused.ref() -// CHECK:STDOUT: %.loc43_17.2: ref %D = temporary %.loc43_17.1, %ReturnDUnused.call -// CHECK:STDOUT: %Destroy.facet.loc43_17.1: %Destroy.type = facet_value constants.%D, (constants.%DestroyImpl.impl_witness.30f, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %.loc43_17.3: %Destroy.type = converted constants.%D, %Destroy.facet.loc43_17.1 [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %Destroy.facet.loc43_17.2: %Destroy.type = facet_value constants.%D, (constants.%DestroyImpl.impl_witness.30f, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %.loc43_17.4: %Destroy.type = converted constants.%D, %Destroy.facet.loc43_17.2 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc41_17.1: ref %D = temporary_storage +// CHECK:STDOUT: %ReturnDUnused.call: init %D to %.loc41_17.1 = call %ReturnDUnused.ref() +// CHECK:STDOUT: %.loc41_17.2: ref %D = temporary %.loc41_17.1, %ReturnDUnused.call +// CHECK:STDOUT: %Destroy.facet.loc41_17.1: %Destroy.type = facet_value constants.%D, (constants.%DestroyImpl.impl_witness.30f, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc41_17.3: %Destroy.type = converted constants.%D, %Destroy.facet.loc41_17.1 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %Destroy.facet.loc41_17.2: %Destroy.type = facet_value constants.%D, (constants.%DestroyImpl.impl_witness.30f, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc41_17.4: %Destroy.type = converted constants.%D, %Destroy.facet.loc41_17.2 [concrete = constants.%Destroy.facet] // CHECK:STDOUT: %SelfDestruct.specific_fn.1: = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet) [concrete = constants.%SelfDestruct.specific_fn] -// CHECK:STDOUT: %SelfDestruct.call.loc43: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%.loc43_17.2) +// CHECK:STDOUT: %SelfDestruct.call.loc41: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%.loc41_17.2) // CHECK:STDOUT: %ReturnDUsed.ref: %ReturnDUsed.type = name_ref ReturnDUsed, imports.%Main.ReturnDUsed [concrete = constants.%ReturnDUsed] -// CHECK:STDOUT: %.loc44_15.1: ref %D = temporary_storage -// CHECK:STDOUT: %ReturnDUsed.call: init %D to %.loc44_15.1 = call %ReturnDUsed.ref() -// CHECK:STDOUT: %.loc44_15.2: ref %D = temporary %.loc44_15.1, %ReturnDUsed.call -// CHECK:STDOUT: %Destroy.facet.loc44_15.1: %Destroy.type = facet_value constants.%D, (constants.%DestroyImpl.impl_witness.30f, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %.loc44_15.3: %Destroy.type = converted constants.%D, %Destroy.facet.loc44_15.1 [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %Destroy.facet.loc44_15.2: %Destroy.type = facet_value constants.%D, (constants.%DestroyImpl.impl_witness.30f, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %.loc44_15.4: %Destroy.type = converted constants.%D, %Destroy.facet.loc44_15.2 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc42_15.1: ref %D = temporary_storage +// CHECK:STDOUT: %ReturnDUsed.call: init %D to %.loc42_15.1 = call %ReturnDUsed.ref() +// CHECK:STDOUT: %.loc42_15.2: ref %D = temporary %.loc42_15.1, %ReturnDUsed.call +// CHECK:STDOUT: %Destroy.facet.loc42_15.1: %Destroy.type = facet_value constants.%D, (constants.%DestroyImpl.impl_witness.30f, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc42_15.3: %Destroy.type = converted constants.%D, %Destroy.facet.loc42_15.1 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %Destroy.facet.loc42_15.2: %Destroy.type = facet_value constants.%D, (constants.%DestroyImpl.impl_witness.30f, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc42_15.4: %Destroy.type = converted constants.%D, %Destroy.facet.loc42_15.2 [concrete = constants.%Destroy.facet] // CHECK:STDOUT: %SelfDestruct.specific_fn.2: = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet) [concrete = constants.%SelfDestruct.specific_fn] -// CHECK:STDOUT: %SelfDestruct.call.loc44: init %empty_tuple.type = call %SelfDestruct.specific_fn.2(%.loc44_15.2) +// CHECK:STDOUT: %SelfDestruct.call.loc42: init %empty_tuple.type = call %SelfDestruct.specific_fn.2(%.loc42_15.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -339,9 +337,9 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: // CHECK:STDOUT: fn @ReturnDUnused [from "fail_incomplete_return.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc43_17.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc41_17.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc43_17.2(%self.param: ref %D) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc41_17.2(%self.param: ref %D) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: fn @ReturnDUsed [from "fail_incomplete_return.carbon"]; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon index ab58d955a500..3e9b31465b82 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon @@ -14,10 +14,10 @@ // CHECK:STDERR: ╭─┤ fail_param_redecl.carbon:[[@LINE+8]]:14 // CHECK:STDERR: -> │ fn F(n: i32, n: i32); -// CHECK:STDERR: · ───┬── ┳ -// CHECK:STDERR: · │ ┗━━┫ error: duplicate name `n` being declared in the same scope -// CHECK:STDERR: · │ ┃ [NameDeclDuplicate] -// CHECK:STDERR: · ╰─────────┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ ┳ +// CHECK:STDERR: · │ ┗━━┫ error: duplicate name `n` being declared in the same scope +// CHECK:STDERR: · │ ┃ [NameDeclDuplicate] +// CHECK:STDERR: · ╰────────────┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(n: i32, n: i32); diff --git a/toolchain/check/testdata/function/declaration/fail_redecl.carbon b/toolchain/check/testdata/function/declaration/fail_redecl.carbon index f5f6d1bcd169..7ddf57a06b95 100644 --- a/toolchain/check/testdata/function/declaration/fail_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/fail_redecl.carbon @@ -15,7 +15,7 @@ fn A(); // CHECK:STDERR: ╭─┤ fail_redecl.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ fn A(); -// CHECK:STDERR: · ───┬─── +// CHECK:STDERR: · ┬ // CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn A(); @@ -28,8 +28,8 @@ fn A(); fn B(x: ()); // CHECK:STDERR: ╭─┤ fail_redecl.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ fn B(x: ()); -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn B(x: ()); // CHECK:STDERR: · ━━━━━━┳━━━━━ @@ -55,8 +55,8 @@ fn C(x: ()); fn D() {} // CHECK:STDERR: ╭─┤ fail_redecl.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ fn D() {} -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn D(); // CHECK:STDERR: · ━━━┳━━━ @@ -68,8 +68,8 @@ fn D(); fn E() {} // CHECK:STDERR: ╭─┤ fail_redecl.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ fn E() {} -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn E() {} // CHECK:STDERR: · ━━━━┳━━━ diff --git a/toolchain/check/testdata/function/declaration/implicit_import.carbon b/toolchain/check/testdata/function/declaration/implicit_import.carbon index c7cddb207abe..5573231a8fbe 100644 --- a/toolchain/check/testdata/function/declaration/implicit_import.carbon +++ b/toolchain/check/testdata/function/declaration/implicit_import.carbon @@ -42,8 +42,8 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_api.carbon // CHECK:STDERR: │ extern fn A(); -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_extern_api.impl.carbon:[[@LINE+7]]:1 @@ -73,7 +73,7 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_impl.carbon // CHECK:STDERR: │ fn A(); -// CHECK:STDERR: · ───┬─── +// CHECK:STDERR: · ┬ // CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index ca10d98fdeb4..d2ae421a2b2d 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -70,7 +70,7 @@ import library "api"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ api.carbon // CHECK:STDERR: │ fn A(); -// CHECK:STDERR: · ───┬─── +// CHECK:STDERR: · ┬ // CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: @@ -83,8 +83,8 @@ extern fn A(); // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ api.carbon // CHECK:STDERR: │ fn B(b: i32) -> i32; -// CHECK:STDERR: · ──────────┬───────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: extern fn B(b: i32) -> i32; @@ -96,8 +96,8 @@ extern fn B(b: i32) -> i32; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ api.carbon // CHECK:STDERR: │ fn C(c: (i32,)) -> {.c: i32}; -// CHECK:STDERR: · ──────────────┬────────────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: extern fn C(c: (i32,)) -> {.c: i32}; @@ -108,12 +108,12 @@ extern fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ api.carbon // CHECK:STDERR: │ extern fn D(); -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: extern fn D(); -// CHECK:STDERR: ╭─┤ fail_redecl_api.carbon:[[@LINE+144]]:1 +// CHECK:STDERR: ╭─┤ fail_redecl_api.carbon:[[@LINE+147]]:1 // CHECK:STDERR: -> │ extern fn NS.E(); // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: redeclarations of `fn E` must match use of `extern` @@ -121,8 +121,8 @@ extern fn D(); // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ api.carbon // CHECK:STDERR: │ fn NS.E(); -// CHECK:STDERR: · ─────┬──── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╷ ╭── imported from: fail_merge.carbon [InImport] @@ -134,7 +134,7 @@ extern fn D(); // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ api.carbon // CHECK:STDERR: │ fn A(); -// CHECK:STDERR: · ───┬─── +// CHECK:STDERR: · ┬ // CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: @@ -147,8 +147,8 @@ extern fn D(); // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ api.carbon // CHECK:STDERR: │ fn B(b: i32) -> i32; -// CHECK:STDERR: · ──────────┬───────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╷ ╭── imported from: fail_merge.carbon [InImport] @@ -160,8 +160,8 @@ extern fn D(); // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ api.carbon // CHECK:STDERR: │ fn C(c: (i32,)) -> {.c: i32}; -// CHECK:STDERR: · ──────────────┬────────────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╷ ╭── imported from: fail_merge.carbon [InImport] @@ -173,8 +173,8 @@ extern fn D(); // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ api.carbon // CHECK:STDERR: │ extern fn D(); -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╷ ╭── imported from: fail_merge.carbon [InImport] @@ -186,8 +186,8 @@ extern fn D(); // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ api.carbon // CHECK:STDERR: │ fn NS.E(); -// CHECK:STDERR: · ─────┬──── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╷ ╭── imported from: fail_merge_reverse.carbon [InImport] @@ -199,8 +199,9 @@ extern fn D(); // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_api.carbon // CHECK:STDERR: │ extern library "redecl_extern_api" fn A(); -// CHECK:STDERR: · ─────────────────────┬──────────────────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here +// CHECK:STDERR: · │ [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╷ ╭── imported from: fail_merge_reverse.carbon [InImport] @@ -212,9 +213,9 @@ extern fn D(); // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_api.carbon // CHECK:STDERR: │ extern library "redecl_extern_api" fn B(b: i32) -> i32; -// CHECK:STDERR: · ───────────────────────────┬─────────────────────────── -// CHECK:STDERR: · ╰──┤ name is previously declared here -// CHECK:STDERR: · │ [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here +// CHECK:STDERR: · │ [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╷ ╭── imported from: fail_merge_reverse.carbon [InImport] @@ -226,9 +227,9 @@ extern fn D(); // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_api.carbon // CHECK:STDERR: │ extern library "redecl_extern_api" fn C(c: (i32,)) -> {.c: i32}; -// CHECK:STDERR: · ────────────────────────────────┬─────────────────────────────── -// CHECK:STDERR: · ╰──┤ name is previously declared here -// CHECK:STDERR: · │ [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here +// CHECK:STDERR: · │ [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╷ ╭── imported from: fail_merge_reverse.carbon [InImport] @@ -240,8 +241,9 @@ extern fn D(); // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_api.carbon // CHECK:STDERR: │ extern library "redecl_extern_api" fn D(); -// CHECK:STDERR: · ─────────────────────┬──────────────────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here +// CHECK:STDERR: · │ [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╷ ╭── imported from: fail_merge_reverse.carbon [InImport] @@ -253,8 +255,9 @@ extern fn D(); // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_api.carbon // CHECK:STDERR: │ extern library "redecl_extern_api" fn NS.E(); -// CHECK:STDERR: · ──────────────────────┬────────────────────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here +// CHECK:STDERR: · │ [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: extern fn NS.E(); @@ -850,9 +853,9 @@ import library "extern_api"; // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [concrete = constants.%D] {} {} // CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [concrete = constants.%E] {} {} // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var_storage %a.var_patt [concrete] -// CHECK:STDOUT: %.loc203_9.1: type = splice_block %.loc203_9.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc203_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc203_9.3: type = converted %.loc203_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc206_9.1: type = splice_block %.loc206_9.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc206_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc206_9.3: type = converted %.loc206_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %a: ref %empty_tuple.type = wrapper_binding a, %a.var [concrete = %a.var] // CHECK:STDOUT: name_binding_decl { @@ -860,15 +863,15 @@ import library "extern_api"; // CHECK:STDOUT: %a.var_patt: %pattern_type.cb1 = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref %i32 = var_storage %b.var_patt [concrete] -// CHECK:STDOUT: %i32.loc204: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %i32.loc207: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %b: ref %i32 = wrapper_binding b, %b.var [concrete = %b.var] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.d94 = ref_binding_pattern b [concrete = constants.%b.patt.920] // CHECK:STDOUT: %b.var_patt: %pattern_type.d94 = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: %c.var: ref %struct_type.c = var_storage %c.var_patt [concrete] -// CHECK:STDOUT: %.loc205: type = splice_block %struct_type.c [concrete = constants.%struct_type.c] { -// CHECK:STDOUT: %i32.loc205: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %.loc208: type = splice_block %struct_type.c [concrete = constants.%struct_type.c] { +// CHECK:STDOUT: %i32.loc208: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [concrete = constants.%struct_type.c] // CHECK:STDOUT: } // CHECK:STDOUT: %c: ref %struct_type.c = wrapper_binding c, %c.var [concrete = %c.var] @@ -877,9 +880,9 @@ import library "extern_api"; // CHECK:STDOUT: %c.var_patt: %pattern_type.51a = var_pattern %c.patt [concrete = constants.%c.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: %d.var: ref %empty_tuple.type = var_storage %d.var_patt [concrete] -// CHECK:STDOUT: %.loc206_9.1: type = splice_block %.loc206_9.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc206_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc206_9.3: type = converted %.loc206_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc209_9.1: type = splice_block %.loc209_9.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc209_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc209_9.3: type = converted %.loc209_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %d: ref %empty_tuple.type = wrapper_binding d, %d.var [concrete = %d.var] // CHECK:STDOUT: name_binding_decl { @@ -887,9 +890,9 @@ import library "extern_api"; // CHECK:STDOUT: %d.var_patt: %pattern_type.cb1 = var_pattern %d.patt [concrete = constants.%d.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: %e.var: ref %empty_tuple.type = var_storage %e.var_patt [concrete] -// CHECK:STDOUT: %.loc207_9.1: type = splice_block %.loc207_9.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc207_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc207_9.3: type = converted %.loc207_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc210_9.1: type = splice_block %.loc210_9.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc210_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc210_9.3: type = converted %.loc210_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %e: ref %empty_tuple.type = wrapper_binding e, %e.var [concrete = %e.var] // CHECK:STDOUT: name_binding_decl { @@ -914,29 +917,29 @@ import library "extern_api"; // CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [concrete = constants.%B] -// CHECK:STDOUT: %int_1.loc204: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc204: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] -// CHECK:STDOUT: %bound_method.loc204_16.1: = bound_method %int_1.loc204, %impl.elem0.loc204 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc204: = specific_function %impl.elem0.loc204, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc204_16.2: = bound_method %int_1.loc204, %specific_fn.loc204 [concrete = constants.%bound_method] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc204: init %i32 = call %bound_method.loc204_16.2(%int_1.loc204) [concrete = constants.%int_1.68a] -// CHECK:STDOUT: %.loc204_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc204 [concrete = constants.%int_1.68a] -// CHECK:STDOUT: %.loc204_16.2: %i32 = converted %int_1.loc204, %.loc204_16.1 [concrete = constants.%int_1.68a] -// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc204_16.2) +// CHECK:STDOUT: %int_1.loc207: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %impl.elem0.loc207: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] +// CHECK:STDOUT: %bound_method.loc207_16.1: = bound_method %int_1.loc207, %impl.elem0.loc207 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc207: = specific_function %impl.elem0.loc207, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc207_16.2: = bound_method %int_1.loc207, %specific_fn.loc207 [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc207: init %i32 = call %bound_method.loc207_16.2(%int_1.loc207) [concrete = constants.%int_1.68a] +// CHECK:STDOUT: %.loc207_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc207 [concrete = constants.%int_1.68a] +// CHECK:STDOUT: %.loc207_16.2: %i32 = converted %int_1.loc207, %.loc207_16.1 [concrete = constants.%int_1.68a] +// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc207_16.2) // CHECK:STDOUT: assign file.%b.var, %B.call // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %int_1.loc205: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc205_25.1: %tuple.type.985 = tuple_literal (%int_1.loc205) [concrete = constants.%tuple.378] -// CHECK:STDOUT: %impl.elem0.loc205: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] -// CHECK:STDOUT: %bound_method.loc205_25.1: = bound_method %int_1.loc205, %impl.elem0.loc205 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc205: = specific_function %impl.elem0.loc205, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc205_25.2: = bound_method %int_1.loc205, %specific_fn.loc205 [concrete = constants.%bound_method] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc205: init %i32 = call %bound_method.loc205_25.2(%int_1.loc205) [concrete = constants.%int_1.68a] -// CHECK:STDOUT: %.loc205_25.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc205 [concrete = constants.%int_1.68a] -// CHECK:STDOUT: %.loc205_25.3: %i32 = converted %int_1.loc205, %.loc205_25.2 [concrete = constants.%int_1.68a] -// CHECK:STDOUT: %tuple: %tuple.type.294 = tuple_value (%.loc205_25.3) [concrete = constants.%tuple.f6b] -// CHECK:STDOUT: %.loc205_25.4: %tuple.type.294 = converted %.loc205_25.1, %tuple [concrete = constants.%tuple.f6b] -// CHECK:STDOUT: %C.call: init %struct_type.c = call %C.ref(%.loc205_25.4) +// CHECK:STDOUT: %int_1.loc208: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc208_25.1: %tuple.type.985 = tuple_literal (%int_1.loc208) [concrete = constants.%tuple.378] +// CHECK:STDOUT: %impl.elem0.loc208: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] +// CHECK:STDOUT: %bound_method.loc208_25.1: = bound_method %int_1.loc208, %impl.elem0.loc208 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn.loc208: = specific_function %impl.elem0.loc208, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc208_25.2: = bound_method %int_1.loc208, %specific_fn.loc208 [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc208: init %i32 = call %bound_method.loc208_25.2(%int_1.loc208) [concrete = constants.%int_1.68a] +// CHECK:STDOUT: %.loc208_25.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc208 [concrete = constants.%int_1.68a] +// CHECK:STDOUT: %.loc208_25.3: %i32 = converted %int_1.loc208, %.loc208_25.2 [concrete = constants.%int_1.68a] +// CHECK:STDOUT: %tuple: %tuple.type.294 = tuple_value (%.loc208_25.3) [concrete = constants.%tuple.f6b] +// CHECK:STDOUT: %.loc208_25.4: %tuple.type.294 = converted %.loc208_25.1, %tuple [concrete = constants.%tuple.f6b] +// CHECK:STDOUT: %C.call: init %struct_type.c = call %C.ref(%.loc208_25.4) // CHECK:STDOUT: assign file.%c.var, %C.call // CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%D.decl [concrete = constants.%D] // CHECK:STDOUT: %D.call: init %empty_tuple.type = call %D.ref() diff --git a/toolchain/check/testdata/function/declaration/no_definition_in_impl_file.carbon b/toolchain/check/testdata/function/declaration/no_definition_in_impl_file.carbon index e48dc19b1480..c6ca51ba6d56 100644 --- a/toolchain/check/testdata/function/declaration/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/function/declaration/no_definition_in_impl_file.carbon @@ -59,7 +59,7 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ decl_in_api_decl_in_impl.carbon // CHECK:STDERR: │ fn C(); -// CHECK:STDERR: · ───┬─── +// CHECK:STDERR: · ┬ // CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: @@ -89,7 +89,7 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ decl_in_api_decl_and_definition_in_impl.carbon // CHECK:STDERR: │ fn D(); -// CHECK:STDERR: · ───┬─── +// CHECK:STDERR: · ┬ // CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: diff --git a/toolchain/check/testdata/function/deduced_return/fail_redecl.carbon b/toolchain/check/testdata/function/deduced_return/fail_redecl.carbon index c036230ef384..1d4be66ad7c2 100644 --- a/toolchain/check/testdata/function/deduced_return/fail_redecl.carbon +++ b/toolchain/check/testdata/function/deduced_return/fail_redecl.carbon @@ -35,8 +35,8 @@ library "[[@TEST_NAME]]"; fn F() -> auto; // CHECK:STDERR: ╭─┤ fail_forward_decl_then_def.carbon:[[@LINE+11]]:1 // CHECK:STDERR: │ fn F() -> auto; -// CHECK:STDERR: · ───────┬─────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F() -> auto { return 0 as i32; } // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━ @@ -52,8 +52,8 @@ library "[[@TEST_NAME]]"; fn F() -> i32; // CHECK:STDERR: ╭─┤ fail_decl_then_auto_def.carbon:[[@LINE+11]]:1 // CHECK:STDERR: │ fn F() -> i32; -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F() -> auto { return 0 as i32; } // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━ @@ -69,8 +69,8 @@ library "[[@TEST_NAME]]"; fn F() -> auto { return 0 as i32; } // CHECK:STDERR: ╭─┤ fail_auto_def_then_decl.carbon:[[@LINE+11]]:1 // CHECK:STDERR: │ fn F() -> auto { return 0 as i32; } -// CHECK:STDERR: · ────────┬─────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F() -> i32; // CHECK:STDERR: · ━━━━━━━┳━━━━━━ @@ -86,8 +86,8 @@ library "[[@TEST_NAME]]"; fn F() -> auto { return 0 as i32; } // CHECK:STDERR: ╭─┤ fail_redefinition.carbon:[[@LINE+11]]:1 // CHECK:STDERR: │ fn F() -> auto { return 0 as i32; } -// CHECK:STDERR: · ────────┬─────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F() -> auto { return 0 as i32; } // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━ @@ -113,8 +113,8 @@ class C { // CHECK:STDERR: ╭─┤ fail_member_out_of_line.carbon:[[@LINE+11]]:1 // CHECK:STDERR: │ fn F() -> auto; -// CHECK:STDERR: · ───────┬─────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn C.F() -> auto { return 0 as i32; } // CHECK:STDERR: · ━━━━━━━━━┳━━━━━━━━ @@ -171,8 +171,8 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ api_def.carbon // CHECK:STDERR: │ fn F() -> auto { return 0 as i32; } -// CHECK:STDERR: · ────────┬─────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_api_def.impl.carbon:[[@LINE+7]]:1 @@ -200,8 +200,8 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ api_decl.carbon // CHECK:STDERR: │ fn F() -> i32; -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F() -> auto { return 0 as i32; } diff --git a/toolchain/check/testdata/function/deduced_return/fail_return.carbon b/toolchain/check/testdata/function/deduced_return/fail_return.carbon index 478b783afb8c..2790d7ca4f93 100644 --- a/toolchain/check/testdata/function/deduced_return/fail_return.carbon +++ b/toolchain/check/testdata/function/deduced_return/fail_return.carbon @@ -167,8 +167,8 @@ fn Make() -> C*; fn F() -> auto { // CHECK:STDERR: ╭─┤ fail_incomplete.carbon:[[@LINE+11]]:10 // CHECK:STDERR: │ class C; - // CHECK:STDERR: · ────┬─── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return *Make(); // CHECK:STDERR: · ━━━┳━━━ diff --git a/toolchain/check/testdata/function/deduced_return/generic_form.carbon b/toolchain/check/testdata/function/deduced_return/generic_form.carbon index 49e27634e939..2a22537fd648 100644 --- a/toolchain/check/testdata/function/deduced_return/generic_form.carbon +++ b/toolchain/check/testdata/function/deduced_return/generic_form.carbon @@ -163,6 +163,20 @@ fn F[T: type](x: T) -> ref auto { // --- fail_template_ref_auto_non_ref.carbon library "[[@TEST_NAME]]"; +// CHECK:STDERR: ╭─┤ fail_template_ref_auto_non_ref.carbon:[[@LINE+14]]:44 +// CHECK:STDERR: -> │ fn F[template T: type](x: T) -> ref auto { return x.n; } +// CHECK:STDERR: · ┳━━━━━━━━━━ +// CHECK:STDERR: · ┗━━┫ error: cannot bind durable +// CHECK:STDERR: · ┃ reference to +// CHECK:STDERR: · ┃ non-reference value of +// CHECK:STDERR: · ┃ type `i32` +// CHECK:STDERR: · ┃ [ConversionFailureNonRefToRef] +// CHECK:STDERR: ┆ +// CHECK:STDERR: │ F(c); +// CHECK:STDERR: · ──┬─ +// CHECK:STDERR: · ╰──┤ in monomorphization of `F(C)` here [ResolvingSpecificHere] +// CHECK:STDERR: ╰──── +// CHECK:STDERR: fn F[template T: type](x: T) -> ref auto { return x.n; } class C { @@ -170,19 +184,6 @@ class C { } fn G(c: C) { - // CHECK:STDERR: ╭─┤ fail_template_ref_auto_non_ref.carbon:[[@LINE+13]]:3 - // CHECK:STDERR: │ fn F[template T: type](x: T) -> ref auto { return x.n; } - // CHECK:STDERR: · ┬────────── - // CHECK:STDERR: · ╰──┤ cannot bind durable reference to - // CHECK:STDERR: · │ non-reference value of type - // CHECK:STDERR: · │ `i32` - // CHECK:STDERR: · │ [ConversionFailureNonRefToRef] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ F(c); - // CHECK:STDERR: · ━━┳━ - // CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific `F(C)` [ResolvingSpecificHere] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: F(c); } @@ -190,26 +191,26 @@ fn G(c: C) { library "[[@TEST_NAME]]"; fn F[template T: type](ref x: T) -> ref auto { - return F(ref x); -} - -fn G(ref n: i32) { - // CHECK:STDERR: ╭─┤ fail_template_ref_auto_recursion_before_deduced.carbon:[[@LINE+16]]:3 + // CHECK:STDERR: ╭─┤ fail_template_ref_auto_recursion_before_deduced.carbon:[[@LINE+16]]:10 // CHECK:STDERR: │ fn F[template T: type](ref x: T) -> ref auto { // CHECK:STDERR: · ───────────────────────┬────────────────────── // CHECK:STDERR: · ╰──┤ return type of `F` is deduced from its definition // CHECK:STDERR: · │ [ReturnTypeDeducedFromDefinition] - // CHECK:STDERR: │ return F(ref x); - // CHECK:STDERR: · ────┬─── - // CHECK:STDERR: · ╰──┤ call to `F` before its return type is known - // CHECK:STDERR: · │ [CallBeforeReturnTypeDeduced] // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ F(ref n); - // CHECK:STDERR: · ━━━━┳━━━ - // CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific `F(i32)` - // CHECK:STDERR: · ┃ [ResolvingSpecificHere] + // CHECK:STDERR: -> │ return F(ref x); + // CHECK:STDERR: · ━━━━┳━━━ + // CHECK:STDERR: · ┗━━┫ error: call to `F` before its return type is known + // CHECK:STDERR: · ┃ [CallBeforeReturnTypeDeduced] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ F(ref n); + // CHECK:STDERR: · ────┬─── + // CHECK:STDERR: · ╰──┤ in monomorphization of `F(i32)` here [ResolvingSpecificHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: + return F(ref x); +} + +fn G(ref n: i32) { F(ref n); } diff --git a/toolchain/check/testdata/function/deduced_return/returned_var.carbon b/toolchain/check/testdata/function/deduced_return/returned_var.carbon index 67b37e83edff..8982d13f4e19 100644 --- a/toolchain/check/testdata/function/deduced_return/returned_var.carbon +++ b/toolchain/check/testdata/function/deduced_return/returned_var.carbon @@ -79,13 +79,11 @@ library "[[@TEST_NAME]]"; fn F(b: bool) -> auto { if (b) { - // CHECK:STDERR: ╭─┤ fail_return_before_returned_var.carbon:[[@LINE+13]]:5 + // CHECK:STDERR: ╭─┤ fail_return_before_returned_var.carbon:[[@LINE+11]]:5 // CHECK:STDERR: -> │ return true; // CHECK:STDERR: · ━━━━┳━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `bool` to `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `bool` does not implement interface `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: │ } // CHECK:STDERR: │ returned var r: i32 = 0; // CHECK:STDERR: · ─┬─ diff --git a/toolchain/check/testdata/function/deduced_return/template.carbon b/toolchain/check/testdata/function/deduced_return/template.carbon index be56f7607b4b..151abc0f4e25 100644 --- a/toolchain/check/testdata/function/deduced_return/template.carbon +++ b/toolchain/check/testdata/function/deduced_return/template.carbon @@ -36,6 +36,18 @@ fn H() -> i32 { return G(0 as i32); } // --- fail_instantiation_error.carbon library "[[@TEST_NAME]]"; +// CHECK:STDERR: ╭─┤ fail_instantiation_error.carbon:[[@LINE+12]]:47 +// CHECK:STDERR: -> │ fn F[template T: type](x: T) -> auto { return x.n; } +// CHECK:STDERR: · ┳━━ +// CHECK:STDERR: · ┗━━┫ error: member name `n` not +// CHECK:STDERR: · ┃ found in `D` +// CHECK:STDERR: · ┃ [MemberNameNotFoundInInstScope] +// CHECK:STDERR: ┆ +// CHECK:STDERR: │ return F(d); +// CHECK:STDERR: · ──┬─ +// CHECK:STDERR: · ╰──┤ in monomorphization of `F(D)` here [ResolvingSpecificHere] +// CHECK:STDERR: ╰──── +// CHECK:STDERR: fn F[template T: type](x: T) -> auto { return x.n; } class D { @@ -45,19 +57,6 @@ class D { // The definition of `F(D)` is needed to determine the return type, so it's // instantiated at the call. fn G(d: D) -> i32 { - // CHECK:STDERR: ╭─┤ fail_instantiation_error.carbon:[[@LINE+13]]:10 - // CHECK:STDERR: │ fn F[template T: type](x: T) -> auto { return x.n; } - // CHECK:STDERR: · ┬── - // CHECK:STDERR: · ╰──┤ member name `n` not found in - // CHECK:STDERR: · │ `D` - // CHECK:STDERR: · │ [MemberNameNotFoundInInstScope] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ return F(d); - // CHECK:STDERR: · ━━┳━ - // CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific `F(D)` - // CHECK:STDERR: · ┃ [ResolvingSpecificHere] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: return F(d); } @@ -65,26 +64,26 @@ fn G(d: D) -> i32 { library "[[@TEST_NAME]]"; fn F[template T: type](x: T) -> auto { - return F(x); -} - -fn G() { - // CHECK:STDERR: ╭─┤ fail_recursion_before_deduced.carbon:[[@LINE+16]]:3 + // CHECK:STDERR: ╭─┤ fail_recursion_before_deduced.carbon:[[@LINE+16]]:10 // CHECK:STDERR: │ fn F[template T: type](x: T) -> auto { // CHECK:STDERR: · ───────────────────┬────────────────── // CHECK:STDERR: · ╰──┤ return type of `F` is deduced from its definition // CHECK:STDERR: · │ [ReturnTypeDeducedFromDefinition] - // CHECK:STDERR: │ return F(x); - // CHECK:STDERR: · ──┬─ - // CHECK:STDERR: · ╰──┤ call to `F` before its return type is known - // CHECK:STDERR: · │ [CallBeforeReturnTypeDeduced] // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ F(0 as i32); - // CHECK:STDERR: · ━━━━━┳━━━━━ - // CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific `F(i32)` - // CHECK:STDERR: · ┃ [ResolvingSpecificHere] + // CHECK:STDERR: -> │ return F(x); + // CHECK:STDERR: · ━━┳━ + // CHECK:STDERR: · ┗━━┫ error: call to `F` before its return type is known + // CHECK:STDERR: · ┃ [CallBeforeReturnTypeDeduced] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ F(0 as i32); + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ in monomorphization of `F(i32)` here [ResolvingSpecificHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: + return F(x); +} + +fn G() { F(0 as i32); } diff --git a/toolchain/check/testdata/function/definition/basics.carbon b/toolchain/check/testdata/function/definition/basics.carbon index ce6ed55d3889..43604f9671d0 100644 --- a/toolchain/check/testdata/function/definition/basics.carbon +++ b/toolchain/check/testdata/function/definition/basics.carbon @@ -19,8 +19,8 @@ class C; // CHECK:STDERR: ╭─┤ fail_incomplete_type.carbon:[[@LINE+11]]:13 // CHECK:STDERR: │ class C; -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F(unused n: C) {} // CHECK:STDERR: · ┳━━━ diff --git a/toolchain/check/testdata/function/definition/extern.carbon b/toolchain/check/testdata/function/definition/extern.carbon index f0f86278e43f..444ac3709cda 100644 --- a/toolchain/check/testdata/function/definition/extern.carbon +++ b/toolchain/check/testdata/function/definition/extern.carbon @@ -44,8 +44,8 @@ library "[[@TEST_NAME]]"; extern fn F(); // CHECK:STDERR: ╭─┤ fail_def_extern_mismatch.carbon:[[@LINE+11]]:1 // CHECK:STDERR: │ extern fn F(); -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F() {} // CHECK:STDERR: · ━━━━┳━━━ @@ -62,7 +62,7 @@ library "[[@TEST_NAME]]"; fn F(); // CHECK:STDERR: ╭─┤ fail_def_extern_mismatch_reverse.carbon:[[@LINE+11]]:1 // CHECK:STDERR: │ fn F(); -// CHECK:STDERR: · ───┬─── +// CHECK:STDERR: · ┬ // CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ extern fn F() {} @@ -80,8 +80,8 @@ library "[[@TEST_NAME]]"; extern fn F(); // CHECK:STDERR: ╭─┤ fail_extern_diag_suppressed.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ extern fn F(); -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F(); // CHECK:STDERR: · ━━━┳━━━ @@ -91,8 +91,8 @@ extern fn F(); fn F(); // CHECK:STDERR: ╭─┤ fail_extern_diag_suppressed.carbon:[[@LINE+11]]:1 // CHECK:STDERR: │ extern fn F(); -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F() {} // CHECK:STDERR: · ━━━━┳━━━ @@ -109,8 +109,8 @@ library "[[@TEST_NAME]]"; fn F() {} // CHECK:STDERR: ╭─┤ fail_extern_decl_after_def.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ fn F() {} -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ extern fn F(); // CHECK:STDERR: · ━━━━━━━┳━━━━━━ diff --git a/toolchain/check/testdata/function/definition/extern_library.carbon b/toolchain/check/testdata/function/definition/extern_library.carbon index 890a063e3911..3782d89089c6 100644 --- a/toolchain/check/testdata/function/definition/extern_library.carbon +++ b/toolchain/check/testdata/function/definition/extern_library.carbon @@ -66,8 +66,8 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ two_file_impl_mismatch.carbon // CHECK:STDERR: │ extern fn F(); -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F() {} diff --git a/toolchain/check/testdata/function/definition/fail_redef.carbon b/toolchain/check/testdata/function/definition/fail_redef.carbon index 8d914c83742b..ca956b658886 100644 --- a/toolchain/check/testdata/function/definition/fail_redef.carbon +++ b/toolchain/check/testdata/function/definition/fail_redef.carbon @@ -15,8 +15,8 @@ fn F() {} // CHECK:STDERR: ╭─┤ fail_redef.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ fn F() {} -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F() {} // CHECK:STDERR: · ━━━━┳━━━ diff --git a/toolchain/check/testdata/function/definition/implicit_import.carbon b/toolchain/check/testdata/function/definition/implicit_import.carbon index 6a10ff7bdace..1b0e30aee8cb 100644 --- a/toolchain/check/testdata/function/definition/implicit_import.carbon +++ b/toolchain/check/testdata/function/definition/implicit_import.carbon @@ -42,8 +42,8 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_api.carbon // CHECK:STDERR: │ extern fn A(); -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn A() {} @@ -66,7 +66,7 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern_impl.carbon // CHECK:STDERR: │ fn A(); -// CHECK:STDERR: · ───┬─── +// CHECK:STDERR: · ┬ // CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: @@ -89,8 +89,8 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ redecl_after_def.carbon // CHECK:STDERR: │ fn A() {} -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn A(); @@ -112,8 +112,8 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ redef_after_def.carbon // CHECK:STDERR: │ fn A() {} -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn A() {} diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index 9909828a9c73..8532031d951d 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -58,8 +58,8 @@ import library "fns"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ fns.carbon // CHECK:STDERR: │ fn A() {} -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn A() {}; @@ -70,8 +70,8 @@ fn A() {}; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ fns.carbon // CHECK:STDERR: │ fn B(b: i32) -> i32 { return b; } -// CHECK:STDERR: · ──────────┬────────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn B(b: i32) -> i32; @@ -90,8 +90,8 @@ import library "extern"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern.carbon // CHECK:STDERR: │ extern fn A(); -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn A(); @@ -104,8 +104,8 @@ fn A(); // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ extern.carbon // CHECK:STDERR: │ extern fn A(); -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn A() {} @@ -124,7 +124,7 @@ import library "fns"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ fns.carbon // CHECK:STDERR: │ fn D(); -// CHECK:STDERR: · ───┬─── +// CHECK:STDERR: · ┬ // CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: diff --git a/toolchain/check/testdata/function/definition/terse.carbon b/toolchain/check/testdata/function/definition/terse.carbon index 683d33d2aae2..8693ade4397e 100644 --- a/toolchain/check/testdata/function/definition/terse.carbon +++ b/toolchain/check/testdata/function/definition/terse.carbon @@ -127,8 +127,8 @@ library "[[@TEST_NAME]]"; fn DeclaredI32() -> i32; // CHECK:STDERR: ╭─┤ fail_redecl.carbon:[[@LINE+11]]:1 // CHECK:STDERR: │ fn DeclaredI32() -> i32; -// CHECK:STDERR: · ────────────┬─────────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ─────┬───── +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn DeclaredI32() => 0 as i32; // CHECK:STDERR: · ━━━━━━━━━┳━━━━━━━━━ @@ -141,7 +141,7 @@ fn DeclaredI32() => 0 as i32; fn DeclaredUnit(); // CHECK:STDERR: ╭─┤ fail_redecl.carbon:[[@LINE+11]]:1 // CHECK:STDERR: │ fn DeclaredUnit(); -// CHECK:STDERR: · ─────────┬──────── +// CHECK:STDERR: · ──────┬───── // CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn DeclaredUnit() => (); @@ -155,8 +155,8 @@ fn DeclaredUnit() => (); fn TerseFirst() => 0 as i32; // CHECK:STDERR: ╭─┤ fail_redecl.carbon:[[@LINE+11]]:1 // CHECK:STDERR: │ fn TerseFirst() => 0 as i32; -// CHECK:STDERR: · ─────────┬──────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ─────┬──── +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn TerseFirst() => 1 as i32; // CHECK:STDERR: · ━━━━━━━━━┳━━━━━━━━ @@ -175,8 +175,8 @@ class Incomplete; // CHECK:STDERR: ╭─┤ fail_incomplete_return.carbon:[[@LINE+12]]:39 // CHECK:STDERR: │ class Incomplete; -// CHECK:STDERR: · ────────┬──────── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: · ─────┬──── +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn DerefIncomplete(p: Incomplete*) => *p; // CHECK:STDERR: · ┳━ @@ -187,49 +187,51 @@ class Incomplete; // CHECK:STDERR: fn DerefIncomplete(p: Incomplete*) => *p; +// CHECK:STDERR: ╭─┤ fail_incomplete_return.carbon:[[@LINE+39]]:55 +// CHECK:STDERR: │ class Incomplete; +// CHECK:STDERR: · ─────┬──── +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: ┆ +// CHECK:STDERR: -> │ fn GenericDerefIncomplete[template T: type](p: T*) => *p; +// CHECK:STDERR: · ┳━ +// CHECK:STDERR: · ┗━━┫ error: `T` evaluates +// CHECK:STDERR: · ┃ to incomplete +// CHECK:STDERR: · ┃ type +// CHECK:STDERR: · ┃ `Incomplete` +// CHECK:STDERR: · ┃ [IncompleteTypeInMonomorphization] +// CHECK:STDERR: ┆ +// CHECK:STDERR: │ GenericDerefIncomplete(p); +// CHECK:STDERR: · ─────────┬─────────────── +// CHECK:STDERR: · ╰──┤ in monomorphization of `GenericDerefIncomplete(Incomplete)` here +// CHECK:STDERR: · │ [ResolvingSpecificHere] +// CHECK:STDERR: ╰──── +// CHECK:STDERR: +// CHECK:STDERR: ╭─┤ fail_incomplete_return.carbon:[[@LINE+20]]:55 +// CHECK:STDERR: -> │ fn GenericDerefIncomplete[template T: type](p: T*) => *p; +// CHECK:STDERR: · ┳━ +// CHECK:STDERR: · ┗━━┫ error: cannot access +// CHECK:STDERR: · ┃ member of +// CHECK:STDERR: · ┃ interface +// CHECK:STDERR: · ┃ `Core.Copy` in +// CHECK:STDERR: · ┃ type +// CHECK:STDERR: · ┃ `Incomplete` +// CHECK:STDERR: · ┃ that does not +// CHECK:STDERR: · ┃ implement that +// CHECK:STDERR: · ┃ interface +// CHECK:STDERR: · ┃ [MissingImplInMemberAccess] +// CHECK:STDERR: ┆ +// CHECK:STDERR: │ GenericDerefIncomplete(p); +// CHECK:STDERR: · ─────────┬─────────────── +// CHECK:STDERR: · ╰──┤ in monomorphization of `GenericDerefIncomplete(Incomplete)` here +// CHECK:STDERR: · │ [ResolvingSpecificHere] +// CHECK:STDERR: ╰──── +// CHECK:STDERR: fn GenericDerefIncomplete[template T: type](p: T*) => *p; fn CallGenericDerefIncomplete(p: Incomplete*) { - // CHECK:STDERR: ╭─┤ fail_incomplete_return.carbon:[[@LINE+54]]:3 - // CHECK:STDERR: │ class Incomplete; - // CHECK:STDERR: · ────────┬──────── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] - // CHECK:STDERR: ┆ - // CHECK:STDERR: │ fn GenericDerefIncomplete[template T: type](p: T*) => *p; - // CHECK:STDERR: · ┬─ - // CHECK:STDERR: · ╰──┤ `T` evaluates to - // CHECK:STDERR: · │ incomplete type - // CHECK:STDERR: · │ `Incomplete` - // CHECK:STDERR: · │ [IncompleteTypeInMonomorphization] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ GenericDerefIncomplete(p); - // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━ - // CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific - // CHECK:STDERR: · ┃ `GenericDerefIncomplete(Incomplete)` - // CHECK:STDERR: · ┃ [ResolvingSpecificHere] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: - // CHECK:STDERR: ╭─┤ fail_incomplete_return.carbon:[[@LINE+35]]:3 - // CHECK:STDERR: │ fn GenericDerefIncomplete[template T: type](p: T*) => *p; - // CHECK:STDERR: · ┬─ - // CHECK:STDERR: · ╰──┤ cannot access member - // CHECK:STDERR: · │ of interface - // CHECK:STDERR: · │ `Core.Copy` in type - // CHECK:STDERR: · │ `Incomplete` that - // CHECK:STDERR: · │ does not implement - // CHECK:STDERR: · │ that interface - // CHECK:STDERR: · │ [MissingImplInMemberAccess] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ GenericDerefIncomplete(p); - // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━ - // CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific - // CHECK:STDERR: · ┃ `GenericDerefIncomplete(Incomplete)` - // CHECK:STDERR: · ┃ [ResolvingSpecificHere] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_incomplete_return.carbon:[[@LINE+17]]:3 // CHECK:STDERR: │ class Incomplete; - // CHECK:STDERR: · ────────┬──────── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ─────┬──── + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn GenericDerefIncomplete[template T: type](p: T*) => *p; // CHECK:STDERR: · ┬─ @@ -258,7 +260,7 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: ╭─┤ fail_unused.carbon:[[@LINE+9]]:30 // CHECK:STDERR: -> │ fn UnusedTest(x: i32, unused y: i32) => y; // CHECK:STDERR: · ━━━┳━━ ┬ -// CHECK:STDERR: · ┗━━━━━━━━━━┫ error: variable `y` marked `unused` +// CHECK:STDERR: · ┗━━━━━━━━━━┫ error: binding `y` marked `unused` // CHECK:STDERR: · │ ┃ but used // CHECK:STDERR: · │ ┃ [UnusedButUsed] // CHECK:STDERR: · ╰────┤ usage here [UnusedButUsedHere] diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 2600ded940ee..7d3f5dace375 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -105,9 +105,9 @@ fn BigStructParam[T: type](unused x: {.c: T, .d: i32, .e: i32}) {} fn CallBigStructParam() { // CHECK:STDERR: ╭─┤ fail_deduce_bigger_struct.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn BigStructParam[T: type](unused x: {.c: T, .d: i32, .e: i32}) {} - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───────┬────── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ BigStructParam({.c = 3, .d = 4}); // CHECK:STDERR: · ━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━ @@ -127,9 +127,9 @@ fn SmallStructParam[T: type](unused x: {.f: T, .g: i32}) {} fn CallSmallStructParam() { // CHECK:STDERR: ╭─┤ fail_deduce_smaller_struct.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn SmallStructParam[T: type](unused x: {.f: T, .g: i32}) {} - // CHECK:STDERR: · ─────────────────────────┬──────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ────────┬─────── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ SmallStructParam({.f = 5, .g = 6, .h = 7}); // CHECK:STDERR: · ━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━ @@ -149,9 +149,9 @@ fn WrongNameStructParam[T: type](unused x: {.i: T, .different: i32}) {} fn CallWrongNameStructParam() { // CHECK:STDERR: ╭─┤ fail_deduce_struct_wrong_name.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn WrongNameStructParam[T: type](unused x: {.i: T, .different: i32}) {} - // CHECK:STDERR: · ─────────────────────────┬──────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──────────┬───────── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ WrongNameStructParam({.i = 8, .j = 9}); // CHECK:STDERR: · ━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━ @@ -171,9 +171,9 @@ fn WrongOrderStructParam[T: type](unused x: {.first: T, .second: i32}) {} fn CallWrongOrderStructParam() { // CHECK:STDERR: ╭─┤ fail_todo_deduce_struct_wrong_order.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn WrongOrderStructParam[T: type](unused x: {.first: T, .second: i32}) {} - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──────────┬────────── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ WrongOrderStructParam({.second = 11, .first = 10}); // CHECK:STDERR: · ━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -195,9 +195,9 @@ fn ImplicitNotDeducible[T: type, U: type](x: T) -> U; fn CallImplicitNotDeducible() { // CHECK:STDERR: ╭─┤ fail_deduce_incomplete.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn ImplicitNotDeducible[T: type, U: type](x: T) -> U; - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──────────┬───────── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ ImplicitNotDeducible(42); // CHECK:STDERR: · ━━━━━━━━━━━━┳━━━━━━━━━━━ @@ -217,9 +217,9 @@ fn ImplicitNotDeducible[T: type](x: T, y: T) -> T; fn CallImplicitNotDeducible() { // CHECK:STDERR: ╭─┤ fail_deduce_inconsistent.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn ImplicitNotDeducible[T: type](x: T, y: T) -> T; - // CHECK:STDERR: · ─────────────────────────┬──────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──────────┬───────── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ ImplicitNotDeducible(42, {.x = 12}); // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━ 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 85feedb148c9..61224de58e17 100644 --- a/toolchain/check/testdata/function/generic/fail_deduce_imported_function.carbon +++ b/toolchain/check/testdata/function/generic/fail_deduce_imported_function.carbon @@ -27,9 +27,9 @@ fn A[T: Lib.Z](unused x: {.a: T}) {} fn B() { // CHECK:STDERR: ╭─┤ fail_deduce_imported_function.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn A[T: Lib.Z](unused x: {.a: T}) {} - // CHECK:STDERR: · ─────────────────┬───────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ A({.b = {}}); // CHECK:STDERR: · ━━━━━━┳━━━━━ @@ -47,9 +47,9 @@ fn B() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ lib.carbon // CHECK:STDERR: │ fn A[T: Z](unused x: {.a: T}) {} - // CHECK:STDERR: · ───────────────┬─────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: Lib.A({.b = {}}); 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 68d153ae7fb9..0c8445eb4956 100644 --- a/toolchain/check/testdata/function/generic/fail_type_param_mismatch.carbon +++ b/toolchain/check/testdata/function/generic/fail_type_param_mismatch.carbon @@ -12,15 +12,12 @@ fn F(generic T: type, generic U: type) { var p: T*; - // CHECK:STDERR: ╭─┤ fail_type_param_mismatch.carbon:[[@LINE+11]]:21 + // CHECK:STDERR: ╭─┤ fail_type_param_mismatch.carbon:[[@LINE+8]]:21 // CHECK:STDERR: -> │ let unused n: U = *p; // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `T` - // CHECK:STDERR: · │ ┃ to `U` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `T` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(U)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `U` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused n: U = *p; diff --git a/toolchain/check/testdata/function/generic/redeclare.carbon b/toolchain/check/testdata/function/generic/redeclare.carbon index da63d73c7fe9..084127332dbe 100644 --- a/toolchain/check/testdata/function/generic/redeclare.carbon +++ b/toolchain/check/testdata/function/generic/redeclare.carbon @@ -43,8 +43,8 @@ fn F(generic T: type, generic U: type) -> T*; fn F(generic T: type, generic U: type) -> U* { // CHECK:STDERR: ╭─┤ fail_different_return_type.carbon:[[@LINE+11]]:10 // CHECK:STDERR: │ fn F(generic T: type, generic U: type) -> T*; - // CHECK:STDERR: · ──────────────────────┬────────────────────── - // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return F(T); // CHECK:STDERR: · ━━┳━ @@ -76,8 +76,8 @@ fn F(generic T: type, generic U: type) -> T*; fn F(unused generic U: type, generic T: type) -> T* { // CHECK:STDERR: ╭─┤ fail_reorder.carbon:[[@LINE+11]]:10 // CHECK:STDERR: │ fn F(generic T: type, generic U: type) -> T*; - // CHECK:STDERR: · ──────────────────────┬────────────────────── - // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return F(T); // CHECK:STDERR: · ━━┳━ @@ -109,8 +109,8 @@ fn F(generic T: type, generic U: type) -> T*; fn F(generic U: type, generic T: type) -> U* { // CHECK:STDERR: ╭─┤ fail_rename.carbon:[[@LINE+11]]:10 // CHECK:STDERR: │ fn F(generic T: type, generic U: type) -> T*; - // CHECK:STDERR: · ──────────────────────┬────────────────────── - // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return F(T); // CHECK:STDERR: · ━━┳━ diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index 01f305c98c81..b555a23349f2 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -11,6 +11,25 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/resolve_used.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/resolve_used.carbon +// CHECK:STDERR: ╭─┤ min_prelude/parts/int.carbon:11:9 +// CHECK:STDERR: -> │ adapt MakeInt(N); +// CHECK:STDERR: · ━━━━━┳━━━━ +// CHECK:STDERR: · ┗━━┫ error: integer type width of 0 is not positive +// CHECK:STDERR: · ┃ [IntWidthNotPositive] +// CHECK:STDERR: ┆ +// CHECK:STDERR: ├─┤ fail_todo_call_monomorphization_error.carbon +// CHECK:STDERR: │ var unused v: Core.Int(N); +// CHECK:STDERR: · ─────┬───── +// CHECK:STDERR: · ╰──┤ in monomorphization of `i0` here +// CHECK:STDERR: · │ │ [ResolvingSpecificHere] +// CHECK:STDERR: · ╰────┤ in completion of type `i0` here [InTypeCompletion] +// CHECK:STDERR: ┆ +// CHECK:STDERR: │ ErrorIfNIsZero(0); +// CHECK:STDERR: · ───────┬────── +// CHECK:STDERR: · ╰──┤ in monomorphization of `ErrorIfNIsZero(0)` here +// CHECK:STDERR: · │ [ResolvingSpecificHere] +// CHECK:STDERR: ╰──── +// CHECK:STDERR: // --- fail_todo_call_monomorphization_error.carbon @@ -25,23 +44,6 @@ fn ErrorIfNIsZero(generic N: Core.IntLiteral) { } fn CallNegative() { - // CHECK:STDERR: ╭─┤ fail_todo_call_monomorphization_error.carbon:[[@LINE+17]]:3 - // CHECK:STDERR: │ var unused v: Core.Int(N); - // CHECK:STDERR: · ─────┬───── - // CHECK:STDERR: · ╰──┤ `Core.Int(N)` evaluates to incomplete type `i0` - // CHECK:STDERR: · │ [IncompleteTypeInMonomorphization] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ ErrorIfNIsZero(0); - // CHECK:STDERR: · ━━━━━━━┳━━━━━━ - // CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific `ErrorIfNIsZero(0)` - // CHECK:STDERR: · ┃ [ResolvingSpecificHere] - // CHECK:STDERR: ┆ - // CHECK:STDERR: ├─┤ min_prelude/parts/int.carbon - // CHECK:STDERR: │ adapt MakeInt(N); - // CHECK:STDERR: · ─────┬──── - // CHECK:STDERR: · ╰──┤ integer type width of 0 is not positive [IntWidthNotPositive] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: ErrorIfNIsZero(0); } diff --git a/toolchain/check/testdata/function/generic/undefined.carbon b/toolchain/check/testdata/function/generic/undefined.carbon index cbb4a0578506..45aa8b7193a7 100644 --- a/toolchain/check/testdata/function/generic/undefined.carbon +++ b/toolchain/check/testdata/function/generic/undefined.carbon @@ -41,9 +41,9 @@ fn Undefined[T: type](x: T); fn CallUndefined() { // CHECK:STDERR: ╭─┤ fail_call_undefined.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn Undefined[T: type](x: T); - // CHECK:STDERR: · ──────────────┬───────────── - // CHECK:STDERR: · ╰──┤ generic function declared here - // CHECK:STDERR: · │ [MissingGenericFunctionDefinitionHere] + // CHECK:STDERR: · ────┬──── + // CHECK:STDERR: · ╰──┤ generic function declared here + // CHECK:STDERR: · │ [MissingGenericFunctionDefinitionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Undefined(0 as i32); // CHECK:STDERR: · ━━━━┳━━━━ diff --git a/toolchain/check/testdata/generic/complete_type.carbon b/toolchain/check/testdata/generic/complete_type.carbon index e29d2bccc7e1..0d8f28bff1f5 100644 --- a/toolchain/check/testdata/generic/complete_type.carbon +++ b/toolchain/check/testdata/generic/complete_type.carbon @@ -19,30 +19,29 @@ library "[[@TEST_NAME]]"; class B; class A(T: type) { + // CHECK:STDERR: ╭─┤ fail_incomplete_in_class.carbon:[[@LINE+16]]:10 + // CHECK:STDERR: │ class B; + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: ┆ + // CHECK:STDERR: -> │ var v: T; + // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ┗━━┫ error: `T` evaluates to incomplete type `B` + // CHECK:STDERR: · ┃ [IncompleteTypeInMonomorphization] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ fn F(unused x: A(B)) {} + // CHECK:STDERR: · ───┬─── + // CHECK:STDERR: · ╰──┤ in monomorphization of `A(B)` here [ResolvingSpecificHere] + // CHECK:STDERR: · ╰────┤ in completion of type `A(B)` here [InTypeCompletion] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: var v: T; } -// CHECK:STDERR: ╭─┤ fail_incomplete_in_class.carbon:[[@LINE+29]]:13 -// CHECK:STDERR: │ class B; -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] -// CHECK:STDERR: ┆ -// CHECK:STDERR: │ var v: T; -// CHECK:STDERR: · ┬ -// CHECK:STDERR: · ╰──┤ `T` evaluates to incomplete type `B` -// CHECK:STDERR: · │ [IncompleteTypeInMonomorphization] -// CHECK:STDERR: ┆ -// CHECK:STDERR: -> │ fn F(unused x: A(B)) {} -// CHECK:STDERR: · ┳━━━━━━ -// CHECK:STDERR: · ┗━━┫ error: parameter has incomplete type `A(B)` in function -// CHECK:STDERR: · ┃ definition -// CHECK:STDERR: · ┃ [IncompleteTypeInFunctionParam] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_incomplete_in_class.carbon:[[@LINE+12]]:13 // CHECK:STDERR: │ class B; -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F(unused x: A(B)) {} // CHECK:STDERR: · ┳━━━━━━ @@ -77,25 +76,24 @@ library "[[@TEST_NAME]]"; class B; fn F(generic T: type, p: T*) { + // CHECK:STDERR: ╭─┤ fail_incomplete_in_function_at_eof.carbon:[[@LINE+15]]:10 + // CHECK:STDERR: │ class B; + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: ┆ + // CHECK:STDERR: -> │ let _: T = *p; + // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ┗━━┫ error: `T` evaluates to incomplete type `B` + // CHECK:STDERR: · ┃ [IncompleteTypeInMonomorphization] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ fn G(p: B*) { F(B, p); } + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ in monomorphization of `F(B)` here [ResolvingSpecificHere] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: let _: T = *p; } -// CHECK:STDERR: ╭─┤ fail_incomplete_in_function_at_eof.carbon:[[@LINE+16]]:15 -// CHECK:STDERR: │ class B; -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] -// CHECK:STDERR: ┆ -// CHECK:STDERR: │ let _: T = *p; -// CHECK:STDERR: · ┬ -// CHECK:STDERR: · ╰──┤ `T` evaluates to incomplete type `B` -// CHECK:STDERR: · │ [IncompleteTypeInMonomorphization] -// CHECK:STDERR: ┆ -// CHECK:STDERR: -> │ fn G(p: B*) { F(B, p); } -// CHECK:STDERR: · ┳ -// CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific `F(B)` -// CHECK:STDERR: · ┃ [ResolvingSpecificHere] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: fn G(p: B*) { F(B, p); } // CHECK:STDOUT: --- fail_incomplete_in_class.carbon = $fail_incomplete_in_class @@ -157,14 +155,14 @@ fn G(p: B*) { F(B, p); } // CHECK:STDOUT: %x.patt: %pattern_type.709 = wrapper_binding_pattern x, %x.param_patt [concrete = constants.%x.patt] // CHECK:STDOUT: } { // CHECK:STDOUT: %x.param: %A.7d2 = value_param call_param0 -// CHECK:STDOUT: %.loc39: type = splice_block %A [concrete = constants.%A.7d2] { +// CHECK:STDOUT: %.loc38: type = splice_block %A [concrete = constants.%A.7d2] { // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [concrete = constants.%A.generic] // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl.loc4 [concrete = constants.%B] // CHECK:STDOUT: %A: type = class_type @A, @A(constants.%B) [concrete = constants.%A.7d2] // CHECK:STDOUT: } // CHECK:STDOUT: %x: %A.7d2 = wrapper_binding x, %x.param // CHECK:STDOUT: } -// CHECK:STDOUT: %B.decl.loc41: type = class_decl @B [concrete = constants.%B] {} {} +// CHECK:STDOUT: %B.decl.loc40: type = class_decl @B [concrete = constants.%B] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { @@ -184,14 +182,14 @@ fn G(p: B*) { F(B, p); } // CHECK:STDOUT: %A: type = class_type @A, @A(%T.loc6_10.1) [symbolic = %A (constants.%A.59f)] // CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %T.loc6_10.1 [symbolic = %A.elem (constants.%A.elem.ca6)] // CHECK:STDOUT: %struct_type.v: type = struct_type {.v: @A.%T.loc6_10.1 (%T)} [symbolic = %struct_type.v (constants.%struct_type.v.a4d)] -// CHECK:STDOUT: %complete_type.loc8_1.2: = complete_type_witness %struct_type.v [symbolic = %complete_type.loc8_1.2 (constants.%complete_type.136)] +// CHECK:STDOUT: %complete_type.loc24_1.2: = complete_type_witness %struct_type.v [symbolic = %complete_type.loc24_1.2 (constants.%complete_type.136)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %field_decl: @A.%A.elem (%A.elem.ca6) = field_decl v, element0, %T.ref in [concrete] { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_10.2 [symbolic = %T.loc6_10.1 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type.loc8_1.1: = complete_type_witness constants.%struct_type.v.a4d [symbolic = %complete_type.loc8_1.2 (constants.%complete_type.136)] -// CHECK:STDOUT: complete_type_witness = %complete_type.loc8_1.1 +// CHECK:STDOUT: %complete_type.loc24_1.1: = complete_type_witness constants.%struct_type.v.a4d [symbolic = %complete_type.loc24_1.2 (constants.%complete_type.136)] +// CHECK:STDOUT: complete_type_witness = %complete_type.loc24_1.1 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A.59f @@ -219,7 +217,7 @@ fn G(p: B*) { F(B, p); } // CHECK:STDOUT: %A => constants.%A.7d2 // CHECK:STDOUT: %A.elem => constants.%A.elem.77c // CHECK:STDOUT: %struct_type.v => constants.%struct_type.v.410 -// CHECK:STDOUT: %complete_type.loc8_1.2 => constants.%complete_type.a68 +// CHECK:STDOUT: %complete_type.loc24_1.2 => constants.%complete_type.a68 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- incomplete_in_function.carbon = $incomplete_in_function @@ -428,9 +426,9 @@ fn G(p: B*) { F(B, p); } // CHECK:STDOUT: %p.patt: %pattern_type.3c8 = wrapper_binding_pattern p, %p.param_patt [concrete = constants.%p.patt.8dd] // CHECK:STDOUT: } { // CHECK:STDOUT: %p.param: %ptr.432 = value_param call_param0 -// CHECK:STDOUT: %.loc26: type = splice_block %ptr [concrete = constants.%ptr.432] { -// CHECK:STDOUT: %B.ref.loc26_9: type = name_ref B, file.%B.decl [concrete = constants.%B] -// CHECK:STDOUT: %ptr: type = ptr_type %B.ref.loc26_9 [concrete = constants.%ptr.432] +// CHECK:STDOUT: %.loc25: type = splice_block %ptr [concrete = constants.%ptr.432] { +// CHECK:STDOUT: %B.ref.loc25_9: type = name_ref B, file.%B.decl [concrete = constants.%B] +// CHECK:STDOUT: %ptr: type = ptr_type %B.ref.loc25_9 [concrete = constants.%ptr.432] // CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.432 = wrapper_binding p, %p.param // CHECK:STDOUT: } @@ -448,19 +446,19 @@ fn G(p: B*) { F(B, p); } // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc6: = require_complete_type %ptr.loc6_27.1 [symbolic = %require_complete.loc6 (constants.%require_complete.ef1)] -// CHECK:STDOUT: %require_complete.loc7: = require_complete_type %T.loc6_15.1 [symbolic = %require_complete.loc7 (constants.%require_complete.944)] -// CHECK:STDOUT: %pattern_type.loc7: type = pattern_type %T.loc6_15.1 [symbolic = %pattern_type.loc7 (constants.%pattern_type.51d)] -// CHECK:STDOUT: %_.patt.loc7_8.2: @F.%pattern_type.loc7 (%pattern_type.51d) = value_binding_pattern _ [symbolic = %_.patt.loc7_8.2 (constants.%_.patt.ee9)] +// CHECK:STDOUT: %require_complete.loc22: = require_complete_type %T.loc6_15.1 [symbolic = %require_complete.loc22 (constants.%require_complete.944)] +// CHECK:STDOUT: %pattern_type.loc22: type = pattern_type %T.loc6_15.1 [symbolic = %pattern_type.loc22 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %_.patt.loc22_8.2: @F.%pattern_type.loc22 (%pattern_type.51d) = value_binding_pattern _ [symbolic = %_.patt.loc22_8.2 (constants.%_.patt.ee9)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%p.param: @F.%ptr.loc6_27.1 (%ptr.e8f)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: @F.%ptr.loc6_27.1 (%ptr.e8f) = name_ref p, %p -// CHECK:STDOUT: %.loc7_14.1: ref @F.%T.loc6_15.1 (%T) = deref %p.ref -// CHECK:STDOUT: %.loc7_14.2: @F.%T.loc6_15.1 (%T) = acquire_value %.loc7_14.1 -// CHECK:STDOUT: %T.ref.loc7: type = name_ref T, %T.loc6_15.2 [symbolic = %T.loc6_15.1 (constants.%T)] -// CHECK:STDOUT: %_: @F.%T.loc6_15.1 (%T) = wrapper_binding _, %.loc7_14.2 +// CHECK:STDOUT: %.loc22_14.1: ref @F.%T.loc6_15.1 (%T) = deref %p.ref +// CHECK:STDOUT: %.loc22_14.2: @F.%T.loc6_15.1 (%T) = acquire_value %.loc22_14.1 +// CHECK:STDOUT: %T.ref.loc22: type = name_ref T, %T.loc6_15.2 [symbolic = %T.loc6_15.1 (constants.%T)] +// CHECK:STDOUT: %_: @F.%T.loc6_15.1 (%T) = wrapper_binding _, %.loc22_14.2 // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %_.patt.loc7_8.1: @F.%pattern_type.loc7 (%pattern_type.51d) = value_binding_pattern _ [symbolic = %_.patt.loc7_8.2 (constants.%_.patt.ee9)] +// CHECK:STDOUT: %_.patt.loc22_8.1: @F.%pattern_type.loc22 (%pattern_type.51d) = value_binding_pattern _ [symbolic = %_.patt.loc22_8.2 (constants.%_.patt.ee9)] // CHECK:STDOUT: } // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -469,7 +467,7 @@ fn G(p: B*) { F(B, p); } // CHECK:STDOUT: fn @G(%p.param: %ptr.432) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %B.ref.loc26_17: type = name_ref B, file.%B.decl [concrete = constants.%B] +// CHECK:STDOUT: %B.ref.loc25_17: type = name_ref B, file.%B.decl [concrete = constants.%B] // CHECK:STDOUT: %p.ref: %ptr.432 = name_ref p, %p // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%B) [concrete = constants.%F.specific_fn] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%p.ref) @@ -495,8 +493,8 @@ fn G(p: B*) { F(B, p); } // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc6 => constants.%complete_type -// CHECK:STDOUT: %require_complete.loc7 => -// CHECK:STDOUT: %pattern_type.loc7 => constants.%pattern_type.e39 -// CHECK:STDOUT: %_.patt.loc7_8.2 => constants.%_.patt.fb1 +// CHECK:STDOUT: %require_complete.loc22 => +// CHECK:STDOUT: %pattern_type.loc22 => constants.%pattern_type.e39 +// CHECK:STDOUT: %_.patt.loc22_8.2 => constants.%_.patt.fb1 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/generic/dot_self_symbolic_type.carbon b/toolchain/check/testdata/generic/dot_self_symbolic_type.carbon index b8a02e1830c4..f14c8a4dfbd1 100644 --- a/toolchain/check/testdata/generic/dot_self_symbolic_type.carbon +++ b/toolchain/check/testdata/generic/dot_self_symbolic_type.carbon @@ -30,9 +30,9 @@ class D(DD: type) { //@dump-sem-ir-begin // CHECK:STDERR: ╭─┤ fail_dot_self_symbolic_type.carbon:[[@LINE+13]]:5 // CHECK:STDERR: │ fn F(unused generic T: A(CC) where .X = CC) {} - // CHECK:STDERR: · ──────────────────────┬────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ C(DD).F(T); // CHECK:STDERR: · ┳━━━━━━━━━ diff --git a/toolchain/check/testdata/generic/extend_type_completion.carbon b/toolchain/check/testdata/generic/extend_type_completion.carbon index afb5e8acfd37..f9aa91a5d838 100644 --- a/toolchain/check/testdata/generic/extend_type_completion.carbon +++ b/toolchain/check/testdata/generic/extend_type_completion.carbon @@ -34,22 +34,22 @@ fn Array(T: type, N: Core.IntLiteral) -> type = "array.make_type"; interface K(T: type) {} class C(N: i32) { + // CHECK:STDERR: ╭─┤ fail_class_extend_impl_does_need_complete_interface.carbon:[[@LINE+12]]:18 + // CHECK:STDERR: -> │ extend impl as K(Array(i32, N)) {} + // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: array bound of -1 is negative + // CHECK:STDERR: · ┃ [ArrayBoundNegative] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ fn F(unused v: C(-1)) {} + // CHECK:STDERR: · ────┬─── + // CHECK:STDERR: · ╰──┤ in monomorphization of `C(-1)` here [ResolvingSpecificHere] + // CHECK:STDERR: · ╰────┤ in completion of type `C(-1)` here [InTypeCompletion] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: extend impl as K(Array(i32, N)) {} } // C extends K so the type of K is completed, but is invalid. -// CHECK:STDERR: ╭─┤ fail_class_extend_impl_does_need_complete_interface.carbon:[[@LINE+12]]:13 -// CHECK:STDERR: │ extend impl as K(Array(i32, N)) {} -// CHECK:STDERR: · ────────┬─────── -// CHECK:STDERR: · ╰──┤ array bound of -1 is negative [ArrayBoundNegative] -// CHECK:STDERR: ┆ -// CHECK:STDERR: -> │ fn F(unused v: C(-1)) {} -// CHECK:STDERR: · ┳━━━━━━━ -// CHECK:STDERR: · ┗━━┫ error: parameter has incomplete type `C(-1)` in function -// CHECK:STDERR: · ┃ definition -// CHECK:STDERR: · ┃ [IncompleteTypeInFunctionParam] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: fn F(unused v: C(-1)) {} // --- interface_require_impls_doesnt_need_complete_interface.carbon @@ -74,6 +74,25 @@ fn Array(T: type, N: Core.IntLiteral) -> type = "array.make_type"; interface K(T: type) {} interface J(N: i32) { + // CHECK:STDERR: ╭─┤ fail_interface_extend_require_impls_does_need_complete_interface.carbon:[[@LINE+19]]:24 + // CHECK:STDERR: -> │ extend require impls K(Array(i32, N)); + // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: array bound of -1 is negative + // CHECK:STDERR: · ┃ [ArrayBoundNegative] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ extend require impls J(N); + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ in monomorphization of `J(-1)` here + // CHECK:STDERR: · │ │ [ResolvingSpecificHere] + // CHECK:STDERR: · ╰────┤ in completion of type `J(-1)` here + // CHECK:STDERR: · │ [InTypeCompletion] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ fn F(unused v: I(-1)) {} + // CHECK:STDERR: · ────┬─── + // CHECK:STDERR: · ╰──┤ in monomorphization of `I(-1)` here [ResolvingSpecificHere] + // CHECK:STDERR: · ╰────┤ in completion of type `I(-1)` here [InTypeCompletion] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: extend require impls K(Array(i32, N)); } interface I(N: i32) { @@ -86,24 +105,6 @@ interface I(N: i32) { // need a location for the type in context.bind_name_map() to use as the // location to Convert(). // -// CHECK:STDERR: ╭─┤ fail_interface_extend_require_impls_does_need_complete_interface.carbon:[[@LINE+18]]:13 -// CHECK:STDERR: │ extend require impls K(Array(i32, N)); -// CHECK:STDERR: · ────────┬─────── -// CHECK:STDERR: · ╰──┤ array bound of -1 is negative -// CHECK:STDERR: · │ [ArrayBoundNegative] -// CHECK:STDERR: ┆ -// CHECK:STDERR: │ extend require impls J(N); -// CHECK:STDERR: · ──┬─ -// CHECK:STDERR: · ╰──┤ `J(N)` evaluates to incomplete type `J(-1)` -// CHECK:STDERR: · │ [IncompleteTypeInMonomorphization] -// CHECK:STDERR: ┆ -// CHECK:STDERR: -> │ fn F(unused v: I(-1)) {} -// CHECK:STDERR: · ┳━━━━━━━ -// CHECK:STDERR: · ┗━━┫ error: parameter has incomplete type `I(-1)` in function -// CHECK:STDERR: · ┃ definition -// CHECK:STDERR: · ┃ [IncompleteTypeInFunctionParam] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: fn F(unused v: I(-1)) {} // --- constraint_require_impls_doesnt_need_complete_interface.carbon @@ -128,6 +129,25 @@ fn Array(T: type, N: Core.IntLiteral) -> type = "array.make_type"; interface K(T: type) {} constraint J(N: i32) { + // CHECK:STDERR: ╭─┤ fail_constraint_extend_require_impls_does_need_complete_interface.carbon:[[@LINE+19]]:24 + // CHECK:STDERR: -> │ extend require impls K(Array(i32, N)); + // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: array bound of -1 is negative + // CHECK:STDERR: · ┃ [ArrayBoundNegative] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ extend require impls J(N); + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ in monomorphization of `J(-1)` here + // CHECK:STDERR: · │ │ [ResolvingSpecificHere] + // CHECK:STDERR: · ╰────┤ in completion of type `J(-1)` here + // CHECK:STDERR: · │ [InTypeCompletion] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ fn F(unused v: I(-1)) {} + // CHECK:STDERR: · ────┬─── + // CHECK:STDERR: · ╰──┤ in monomorphization of `I(-1)` here [ResolvingSpecificHere] + // CHECK:STDERR: · ╰────┤ in completion of type `I(-1)` here [InTypeCompletion] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: extend require impls K(Array(i32, N)); } constraint I(N: i32) { @@ -135,24 +155,6 @@ constraint I(N: i32) { } // I extends J extends K so the type of K is completed, but is invalid. -// CHECK:STDERR: ╭─┤ fail_constraint_extend_require_impls_does_need_complete_interface.carbon:[[@LINE+18]]:13 -// CHECK:STDERR: │ extend require impls K(Array(i32, N)); -// CHECK:STDERR: · ────────┬─────── -// CHECK:STDERR: · ╰──┤ array bound of -1 is negative -// CHECK:STDERR: · │ [ArrayBoundNegative] -// CHECK:STDERR: ┆ -// CHECK:STDERR: │ extend require impls J(N); -// CHECK:STDERR: · ──┬─ -// CHECK:STDERR: · ╰──┤ `J(N)` evaluates to incomplete type `J(-1)` -// CHECK:STDERR: · │ [IncompleteTypeInMonomorphization] -// CHECK:STDERR: ┆ -// CHECK:STDERR: -> │ fn F(unused v: I(-1)) {} -// CHECK:STDERR: · ┳━━━━━━━ -// CHECK:STDERR: · ┗━━┫ error: parameter has incomplete type `I(-1)` in function -// CHECK:STDERR: · ┃ definition -// CHECK:STDERR: · ┃ [IncompleteTypeInFunctionParam] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: fn F(unused v: I(-1)) {} // --- interface_require_impls_doesnt_need_complete_self.carbon diff --git a/toolchain/check/testdata/generic/fail_generic_copy.carbon b/toolchain/check/testdata/generic/fail_generic_copy.carbon index 97856bafe574..ed5ac5729a54 100644 --- a/toolchain/check/testdata/generic/fail_generic_copy.carbon +++ b/toolchain/check/testdata/generic/fail_generic_copy.carbon @@ -15,12 +15,10 @@ library "[[@TEST_NAME]]"; fn F[T: type](x: T) -> T { - // CHECK:STDERR: ╭─┤ fail_return.carbon:[[@LINE+8]]:10 + // CHECK:STDERR: ╭─┤ fail_return.carbon:[[@LINE+6]]:10 // CHECK:STDERR: -> │ return x; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot copy value of type `T` [CopyOfUncopyableType] - // CHECK:STDERR: · ╰────┤ type `T` does not implement interface `Core.Copy` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ╰──── // CHECK:STDERR: return x; @@ -31,13 +29,11 @@ fn F[T: type](x: T) -> T { library "[[@TEST_NAME]]"; fn F[T: Core.Destroy](x: T) { - // CHECK:STDERR: ╭─┤ fail_var.carbon:[[@LINE+9]]:21 + // CHECK:STDERR: ╭─┤ fail_var.carbon:[[@LINE+7]]:21 // CHECK:STDERR: -> │ var unused y: T = x; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot copy value of type `T` - // CHECK:STDERR: · │ ┃ [CopyOfUncopyableType] - // CHECK:STDERR: · ╰────┤ type `T` does not implement interface `Core.Copy` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [CopyOfUncopyableType] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused y: T = x; diff --git a/toolchain/check/testdata/generic/identify_specific_facet_type.carbon b/toolchain/check/testdata/generic/identify_specific_facet_type.carbon index 077c2467df7c..5ce4aa5504d3 100644 --- a/toolchain/check/testdata/generic/identify_specific_facet_type.carbon +++ b/toolchain/check/testdata/generic/identify_specific_facet_type.carbon @@ -21,24 +21,26 @@ fn Array(T: type, N: Core.IntLiteral) -> type = "array.make_type"; interface K(T: type) {} constraint L(N: i32) { + // CHECK:STDERR: ╭─┤ fail_error_in_identifying_require_facet_type.carbon:[[@LINE+14]]:30 + // CHECK:STDERR: -> │ require impls K(Array(i32, N)); + // CHECK:STDERR: · ───────────────┬───────────┳─── + // CHECK:STDERR: · │ ┗━━┫ error: array bound of -1 is negative + // CHECK:STDERR: · │ ┃ [ArrayBoundNegative] + // CHECK:STDERR: · ╰────────────────┤ in monomorphization of `require` here + // CHECK:STDERR: · │ [ResolvingSpecificHere] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ impl {} as J(-1) {} + // CHECK:STDERR: · ──┬── + // CHECK:STDERR: · ╰──┤ in identification of facet type `J(-1)` here + // CHECK:STDERR: · │ [InFacetTypeIdentification] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: require impls K(Array(i32, N)); } constraint J(N: i32) { require impls L(N); } -// CHECK:STDERR: ╭─┤ fail_error_in_identifying_require_facet_type.carbon:[[@LINE+12]]:1 -// CHECK:STDERR: │ require impls K(Array(i32, N)); -// CHECK:STDERR: · ┬ -// CHECK:STDERR: · ╰──┤ array bound of -1 is negative -// CHECK:STDERR: · │ [ArrayBoundNegative] -// CHECK:STDERR: ┆ -// CHECK:STDERR: -> │ impl {} as J(-1) {} -// CHECK:STDERR: · ━━━━━━━━━┳━━━━━━━━ -// CHECK:STDERR: · ┗━━┫ error: facet type `J(-1)` cannot be identified in `impl as` -// CHECK:STDERR: · ┃ [ImplOfUnidentifiedFacetType] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: impl {} as J(-1) {} // --- fail_error_in_identifying_extend_require_facet_type.carbon @@ -52,21 +54,22 @@ fn Array(T: type, N: Core.IntLiteral) -> type = "array.make_type"; interface K(T: type) {} constraint J(N: i32) { + // CHECK:STDERR: ╭─┤ fail_error_in_identifying_extend_require_facet_type.carbon:[[@LINE+13]]:24 + // CHECK:STDERR: -> │ extend require impls K(Array(i32, N)); + // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: array bound of -1 is negative + // CHECK:STDERR: · ┃ [ArrayBoundNegative] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ impl {} as J(-1) {} + // CHECK:STDERR: · ──┬── + // CHECK:STDERR: · ╰──┤ in monomorphization of `J(-1)` here [ResolvingSpecificHere] + // CHECK:STDERR: · ╰────┤ in identification of facet type `J(-1)` here + // CHECK:STDERR: · │ [InFacetTypeIdentification] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: extend require impls K(Array(i32, N)); } -// CHECK:STDERR: ╭─┤ fail_error_in_identifying_extend_require_facet_type.carbon:[[@LINE+12]]:1 -// CHECK:STDERR: │ extend require impls K(Array(i32, N)); -// CHECK:STDERR: · ────────┬─────── -// CHECK:STDERR: · ╰──┤ array bound of -1 is negative -// CHECK:STDERR: · │ [ArrayBoundNegative] -// CHECK:STDERR: ┆ -// CHECK:STDERR: -> │ impl {} as J(-1) {} -// CHECK:STDERR: · ━━━━━━━━━┳━━━━━━━━ -// CHECK:STDERR: · ┗━━┫ error: facet type `J(-1)` cannot be identified in `impl as` -// CHECK:STDERR: · ┃ [ImplOfUnidentifiedFacetType] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: impl {} as J(-1) {} // --- fail_monomorphization_during_period_self_substitution.carbon @@ -77,6 +80,36 @@ fn Array(T: type, N: Core.IntLiteral) -> type = "array.make_type"; interface Y {} interface CanFailToMonomorphize(N: Core.IntLiteral) { + // CHECK:STDERR: ╭─┤ fail_monomorphization_during_period_self_substitution.carbon:[[@LINE+30]]:21 + // CHECK:STDERR: -> │ let Z1: Array((), N); + // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ┗━━┫ error: array bound of -1 is negative + // CHECK:STDERR: · ┃ [ArrayBoundNegative] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ extend require impls CanFailToMonomorphize(N); + // CHECK:STDERR: · ┬─────────────────────── + // CHECK:STDERR: · ╰──┤ in monomorphization of `CanFailToMonomorphize(-1)` + // CHECK:STDERR: · │ │ here + // CHECK:STDERR: · │ │ [ResolvingSpecificHere] + // CHECK:STDERR: · ╰────┤ in completion of type `CanFailToMonomorphize(-1)` + // CHECK:STDERR: · │ here + // CHECK:STDERR: · │ [InTypeCompletion] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ fn F(generic N: Core.IntLiteral, generic _: S(N) where .Z2 impls Y) {} + // CHECK:STDERR: · ┬ ┬──────────────────────── + // CHECK:STDERR: · ╰────────────────────────────────────────┤ while deducing parameters of + // CHECK:STDERR: · │ │ generic declared here + // CHECK:STDERR: · │ │ [DeductionGenericHere] + // CHECK:STDERR: · ╰────┤ in monomorphization of `S(-1)` + // CHECK:STDERR: · │ here + // CHECK:STDERR: · │ [ResolvingSpecificHere] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ F(-1, T); + // CHECK:STDERR: · ────┬─── + // CHECK:STDERR: · ╰──┤ while substituting generic arguments into the type of `_` + // CHECK:STDERR: · │ [SubstitutingGenericParamType] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: let Z1: Array((), N); let Z2: type; } @@ -98,29 +131,6 @@ constraint S(N: Core.IntLiteral) { fn F(generic N: Core.IntLiteral, generic _: S(N) where .Z2 impls Y) {} fn G(generic T: Y) { - // CHECK:STDERR: ╭─┤ fail_monomorphization_during_period_self_substitution.carbon:[[@LINE+23]]:3 - // CHECK:STDERR: │ let Z1: Array((), N); - // CHECK:STDERR: · ┬ - // CHECK:STDERR: · ╰──┤ array bound of -1 is negative [ArrayBoundNegative] - // CHECK:STDERR: ┆ - // CHECK:STDERR: │ extend require impls CanFailToMonomorphize(N); - // CHECK:STDERR: · ┬─────────────────────── - // CHECK:STDERR: · ╰──┤ `CanFailToMonomorphize(N)` evaluates to incomplete - // CHECK:STDERR: · │ type `CanFailToMonomorphize(-1)` - // CHECK:STDERR: · │ [IncompleteTypeInMonomorphization] - // CHECK:STDERR: ┆ - // CHECK:STDERR: │ fn F(generic N: Core.IntLiteral, generic _: S(N) where .Z2 impls Y) {} - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ F(-1, T); - // CHECK:STDERR: · ┳━━━━━━━ - // CHECK:STDERR: · ┗━━┫ error: constructed invalid specific for - // CHECK:STDERR: · ┃ `S(N) where .(CanFailToMonomorphize(N).Z2) impls Y` from argument - // CHECK:STDERR: · ┃ [SubstitutingGenericParamType] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: F(-1, T); }; @@ -136,29 +146,30 @@ interface Z { } constraint S(N: Core.IntLiteral) { + // CHECK:STDERR: ╭─┤ fail_monomorphization_identify_in_call.carbon:[[@LINE+18]]:24 + // CHECK:STDERR: -> │ extend require impls Z where .Z1 = Array((), N); + // CHECK:STDERR: · ━━━━━━━━━━━━━┳━━━━━━━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: array bound of -1 is negative + // CHECK:STDERR: · ┃ [ArrayBoundNegative] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ fn F(generic N: Core.IntLiteral, generic _: S(N)) {} + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ F(-1, T); + // CHECK:STDERR: · ────┬─── + // CHECK:STDERR: · ╰──┤ in monomorphization of `S(-1)` here [ResolvingSpecificHere] + // CHECK:STDERR: · ╰────┤ in identification of facet type `S(-1)` here + // CHECK:STDERR: · │ [InFacetTypeIdentification] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: extend require impls Z where .Z1 = Array((), N); } fn F(generic N: Core.IntLiteral, generic _: S(N)) {} fn G(generic T: Z) { - // CHECK:STDERR: ╭─┤ fail_monomorphization_identify_in_call.carbon:[[@LINE+17]]:3 - // CHECK:STDERR: │ extend require impls Z where .Z1 = Array((), N); - // CHECK:STDERR: · ─────────────┬──────────── - // CHECK:STDERR: · ╰──┤ array bound of -1 is negative - // CHECK:STDERR: · │ [ArrayBoundNegative] - // CHECK:STDERR: ┆ - // CHECK:STDERR: │ fn F(generic N: Core.IntLiteral, generic _: S(N)) {} - // CHECK:STDERR: · ─────────────────────────┬───────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ F(-1, T); - // CHECK:STDERR: · ━━━━┳━━━ - // CHECK:STDERR: · ┗━━┫ error: facet type `S(-1)` can not be identified - // CHECK:STDERR: · ┃ [ImplLookupInUnidentifiedFacetType] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: F(-1, T); }; @@ -177,24 +188,24 @@ constraint S(N: Core.IntLiteral) { extend require impls Z; } +// CHECK:STDERR: ╭─┤ fail_monomorphization_during_deduction_in_call.carbon:[[@LINE+16]]:42 +// CHECK:STDERR: -> │ fn F(generic N: Core.IntLiteral, generic _: S(N) where .Z1 = Array((), N)) {} +// CHECK:STDERR: · ┬ ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// CHECK:STDERR: · │ ┗━━┫ error: array bound of -1 is +// CHECK:STDERR: · │ ┃ negative +// CHECK:STDERR: · │ ┃ [ArrayBoundNegative] +// CHECK:STDERR: · ╰──────────────────────────────────────────┤ while deducing parameters of +// CHECK:STDERR: · │ generic declared here +// CHECK:STDERR: · │ [DeductionGenericHere] +// CHECK:STDERR: ┆ +// CHECK:STDERR: │ F(-1, T); +// CHECK:STDERR: · ────┬─── +// CHECK:STDERR: · ╰──┤ while substituting generic arguments into the type of `_` +// CHECK:STDERR: · │ [SubstitutingGenericParamType] +// CHECK:STDERR: ╰──── +// CHECK:STDERR: fn F(generic N: Core.IntLiteral, generic _: S(N) where .Z1 = Array((), N)) {} fn G(generic T: Z) { - // CHECK:STDERR: ╭─┤ fail_monomorphization_during_deduction_in_call.carbon:[[@LINE+16]]:3 - // CHECK:STDERR: │ fn F(generic N: Core.IntLiteral, generic _: S(N) where .Z1 = Array((), N)) {} - // CHECK:STDERR: · ──────────────────────────────────────┬──┬────────────────────────────────── - // CHECK:STDERR: · ╰─────┤ while deducing parameters of - // CHECK:STDERR: · │ │ generic declared here - // CHECK:STDERR: · │ │ [DeductionGenericHere] - // CHECK:STDERR: · ╰────┤ array bound of -1 is negative - // CHECK:STDERR: · │ [ArrayBoundNegative] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ F(-1, T); - // CHECK:STDERR: · ┳━━━━━━━ - // CHECK:STDERR: · ┗━━┫ error: constructed invalid specific for - // CHECK:STDERR: · ┃ `S(N) where .(Z.Z1) = ` from argument - // CHECK:STDERR: · ┃ [SubstitutingGenericParamType] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: F(-1, T); }; diff --git a/toolchain/check/testdata/generic/local.carbon b/toolchain/check/testdata/generic/local.carbon index 329d89848aea..740f30a39ac7 100644 --- a/toolchain/check/testdata/generic/local.carbon +++ b/toolchain/check/testdata/generic/local.carbon @@ -31,10 +31,10 @@ fn F() { // TODO: Decide on what behavior we want here. We don't reject the corresponding case outside of a function. // CHECK:STDERR: ╭─┤ fail_param_shadows_class.carbon:[[@LINE+8]]:9 // CHECK:STDERR: -> │ class C(C: type) { - // CHECK:STDERR: · ┳ ───┬─── - // CHECK:STDERR: · ┗━━━━━━━┫ error: duplicate name `C` being declared in the same scope - // CHECK:STDERR: · │ ┃ [NameDeclDuplicate] - // CHECK:STDERR: · ╰────┤ name is previously declared here [NameDeclPrevious] + // CHECK:STDERR: · ┳ ┬ + // CHECK:STDERR: · ┗━━━━┫ error: duplicate name `C` being declared in the same scope + // CHECK:STDERR: · │ ┃ [NameDeclDuplicate] + // CHECK:STDERR: · ╰────┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: class C(C: type) { diff --git a/toolchain/check/testdata/generic/template/argument.carbon b/toolchain/check/testdata/generic/template/argument.carbon index 68ef44ae2db5..85eda030032d 100644 --- a/toolchain/check/testdata/generic/template/argument.carbon +++ b/toolchain/check/testdata/generic/template/argument.carbon @@ -90,24 +90,23 @@ impl C as Core.Copy { class D(template T: type) { // Note thae missing `ref` qualifier on the `self` parameter, which makes // the expression `self.c` non-addressable. + // CHECK:STDERR: ╭─┤ fail_addr_of_non_addressable_dependent_type.carbon:[[@LINE+12]]:29 + // CHECK:STDERR: -> │ fn F(self) -> C* { return &self.c; } + // CHECK:STDERR: · ┳━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference + // CHECK:STDERR: · ┃ expression + // CHECK:STDERR: · ┃ [AddrOfNonRef] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ let e: C* = d.F(); + // CHECK:STDERR: · ─┬─ + // CHECK:STDERR: · ╰──┤ in monomorphization of `F(C)` here [ResolvingSpecificHere] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: fn F(self) -> C* { return &self.c; } var c: C; } var d: D(C) = {.c = {} as C}; -// CHECK:STDERR: ╭─┤ fail_addr_of_non_addressable_dependent_type.carbon:[[@LINE+13]]:13 -// CHECK:STDERR: │ fn F(self) -> C* { return &self.c; } -// CHECK:STDERR: · ┬────── -// CHECK:STDERR: · ╰──┤ cannot take the address of non-reference -// CHECK:STDERR: · │ expression -// CHECK:STDERR: · │ [AddrOfNonRef] -// CHECK:STDERR: ┆ -// CHECK:STDERR: -> │ let e: C* = d.F(); -// CHECK:STDERR: · ━┳━ -// CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific `F(C)` -// CHECK:STDERR: · ┃ [ResolvingSpecificHere] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: let e: C* = d.F(); // --- fail_non_constant_type_argument.carbon diff --git a/toolchain/check/testdata/generic/template/call.carbon b/toolchain/check/testdata/generic/template/call.carbon index 690250a7fb51..efbdd2f4e744 100644 --- a/toolchain/check/testdata/generic/template/call.carbon +++ b/toolchain/check/testdata/generic/template/call.carbon @@ -16,22 +16,22 @@ library "[[@TEST_NAME]]"; class X {} class Y {} fn F[template G: type](H: G, x: X) { + // CHECK:STDERR: ╭─┤ fail_todo_dependent_call_nonconst_arg.carbon:[[@LINE+12]]:3 + // CHECK:STDERR: -> │ H(x); + // CHECK:STDERR: · ━━┳━ + // CHECK:STDERR: · ┗━━┫ error: value of type `` is not callable + // CHECK:STDERR: · ┃ [CallToNonCallable] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ fn GoodCall(x: X) { F(TakeX, x); } + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ in monomorphization of `F()` here + // CHECK:STDERR: · │ [ResolvingSpecificHere] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: H(x); } fn TakeX(unused x: X) {} -// CHECK:STDERR: ╭─┤ fail_todo_dependent_call_nonconst_arg.carbon:[[@LINE+12]]:21 -// CHECK:STDERR: │ H(x); -// CHECK:STDERR: · ──┬─ -// CHECK:STDERR: · ╰──┤ value of type `` is not callable [CallToNonCallable] -// CHECK:STDERR: ┆ -// CHECK:STDERR: -> │ fn GoodCall(x: X) { F(TakeX, x); } -// CHECK:STDERR: · ┳ -// CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific -// CHECK:STDERR: · ┃ `F()` -// CHECK:STDERR: · ┃ [ResolvingSpecificHere] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: fn GoodCall(x: X) { F(TakeX, x); } // --- fail_dependent_call_nonconst_arg_wrong_type.carbon @@ -40,21 +40,21 @@ library "[[@TEST_NAME]]"; class X {} class Y {} fn F[template G: type](H: G, x: X) { + // CHECK:STDERR: ╭─┤ fail_dependent_call_nonconst_arg_wrong_type.carbon:[[@LINE+12]]:3 + // CHECK:STDERR: -> │ H(x); + // CHECK:STDERR: · ━━┳━ + // CHECK:STDERR: · ┗━━┫ error: value of type `` is not callable + // CHECK:STDERR: · ┃ [CallToNonCallable] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ fn BadCall(x: X) { F(TakeY, x); } + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ in monomorphization of `F()` here + // CHECK:STDERR: · │ [ResolvingSpecificHere] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: H(x); } fn TakeY(unused y: Y) {} // TODO: should fail, but not because of UseOfNonExprAsValue -// CHECK:STDERR: ╭─┤ fail_dependent_call_nonconst_arg_wrong_type.carbon:[[@LINE+12]]:20 -// CHECK:STDERR: │ H(x); -// CHECK:STDERR: · ──┬─ -// CHECK:STDERR: · ╰──┤ value of type `` is not callable [CallToNonCallable] -// CHECK:STDERR: ┆ -// CHECK:STDERR: -> │ fn BadCall(x: X) { F(TakeY, x); } -// CHECK:STDERR: · ┳ -// CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific -// CHECK:STDERR: · ┃ `F()` -// CHECK:STDERR: · ┃ [ResolvingSpecificHere] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: fn BadCall(x: X) { F(TakeY, x); } diff --git a/toolchain/check/testdata/generic/template/convert.carbon b/toolchain/check/testdata/generic/template/convert.carbon index a1829c3cbaaf..945bbd3a1754 100644 --- a/toolchain/check/testdata/generic/template/convert.carbon +++ b/toolchain/check/testdata/generic/template/convert.carbon @@ -41,6 +41,18 @@ fn Test2(c: C) -> i32 { library "[[@TEST_NAME]]"; fn F[template T: type](x: T) -> i32 { + // CHECK:STDERR: ╭─┤ fail_cannot_convert.carbon:[[@LINE+12]]:16 + // CHECK:STDERR: -> │ let n: i32 = x; + // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `D` to + // CHECK:STDERR: · ┃ `i32` + // CHECK:STDERR: · ┃ [ConversionFailure] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ return F(d); + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ in monomorphization of `F(D)` here [ResolvingSpecificHere] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: let n: i32 = x; return n; } @@ -48,21 +60,6 @@ fn F[template T: type](x: T) -> i32 { class D {} fn Test(d: D) -> i32 { - // CHECK:STDERR: ╭─┤ fail_cannot_convert.carbon:[[@LINE+15]]:10 - // CHECK:STDERR: │ let n: i32 = x; - // CHECK:STDERR: · ┬ - // CHECK:STDERR: · ╰──┤ cannot implicitly convert expression of type `D` to `i32` - // CHECK:STDERR: · │ │ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `D` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ return F(d); - // CHECK:STDERR: · ┳ - // CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific `F(D)` - // CHECK:STDERR: · ┃ [ResolvingSpecificHere] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: return F(d); } @@ -183,26 +180,24 @@ fn Test2(c: C) { library "[[@TEST_NAME]]"; fn AsI32[template T: type](x: T) -> i32 { + // CHECK:STDERR: ╭─┤ fail_cannot_as.carbon:[[@LINE+12]]:10 + // CHECK:STDERR: -> │ return x as i32; + // CHECK:STDERR: · ━━━┳━━━━ + // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `D` to `i32` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ let _: i32 = AsI32(d); + // CHECK:STDERR: · ──┬── + // CHECK:STDERR: · ╰──┤ in monomorphization of `AsI32(D)` here + // CHECK:STDERR: · │ [ResolvingSpecificHere] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: return x as i32; } class D {} fn Test(d: D) { - // CHECK:STDERR: ╭─┤ fail_cannot_as.carbon:[[@LINE+14]]:16 - // CHECK:STDERR: │ return x as i32; - // CHECK:STDERR: · ────┬─── - // CHECK:STDERR: · ╰──┤ cannot convert expression of type `D` to `i32` with `as` - // CHECK:STDERR: · │ │ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `D` does not implement interface `Core.As(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ let _: i32 = AsI32(d); - // CHECK:STDERR: · ━━┳━━ - // CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific `AsI32(D)` - // CHECK:STDERR: · ┃ [ResolvingSpecificHere] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: let _: i32 = AsI32(d); } @@ -236,26 +231,24 @@ fn Test2(c: C) { library "[[@TEST_NAME]]"; fn AsType[template T: type](x: T, template U: type) { + // CHECK:STDERR: ╭─┤ fail_cannot_as_type.carbon:[[@LINE+12]]:14 + // CHECK:STDERR: -> │ let _: U = x as U; + // CHECK:STDERR: · ┳━━━━━ + // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `D` to `i32` with + // CHECK:STDERR: · ┃ `as` + // CHECK:STDERR: · ┃ [ConversionFailure] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ AsType(d, i32); + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ in monomorphization of `AsType(D, i32)` here [ResolvingSpecificHere] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: let _: U = x as U; } class D {} fn Test(d: D) { - // CHECK:STDERR: ╭─┤ fail_cannot_as_type.carbon:[[@LINE+14]]:3 - // CHECK:STDERR: │ let _: U = x as U; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ cannot convert expression of type `D` to `i32` with `as` - // CHECK:STDERR: · │ │ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `D` does not implement interface `Core.As(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ AsType(d, i32); - // CHECK:STDERR: · ━━━┳━━ - // CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific `AsType(D, i32)` - // CHECK:STDERR: · ┃ [ResolvingSpecificHere] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: AsType(d, i32); } diff --git a/toolchain/check/testdata/generic/template/member_access.carbon b/toolchain/check/testdata/generic/template/member_access.carbon index e8d37cb22321..58c37970555d 100644 --- a/toolchain/check/testdata/generic/template/member_access.carbon +++ b/toolchain/check/testdata/generic/template/member_access.carbon @@ -38,6 +38,17 @@ fn Test2(x: {.m: i32, .n: i32}) { library "[[@TEST_NAME]]"; fn F[template T: type](x: T) -> i32 { + // CHECK:STDERR: ╭─┤ fail_no_such_member.carbon:[[@LINE+11]]:16 + // CHECK:STDERR: -> │ let n: i32 = x.n; + // CHECK:STDERR: · ━┳━ + // CHECK:STDERR: · ┗━━┫ error: member name `n` not found in `D` + // CHECK:STDERR: · ┃ [MemberNameNotFoundInInstScope] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ F(d); + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ in monomorphization of `F(D)` here [ResolvingSpecificHere] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: let n: i32 = x.n; return n; } @@ -47,17 +58,6 @@ class D { } fn Test(d: D) { - // CHECK:STDERR: ╭─┤ fail_no_such_member.carbon:[[@LINE+11]]:3 - // CHECK:STDERR: │ let n: i32 = x.n; - // CHECK:STDERR: · ─┬─ - // CHECK:STDERR: · ╰──┤ member name `n` not found in `D` - // CHECK:STDERR: · │ [MemberNameNotFoundInInstScope] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ F(d); - // CHECK:STDERR: · ┳ - // CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific `F(D)` [ResolvingSpecificHere] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: F(d); } @@ -66,6 +66,18 @@ fn Test(d: D) { library "[[@TEST_NAME]]"; fn F[template T: type](x: T) -> i32 { + // CHECK:STDERR: ╭─┤ fail_member_wrong_type.carbon:[[@LINE+12]]:16 + // CHECK:STDERR: -> │ let n: i32 = x.n; + // CHECK:STDERR: · ┳━━ + // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `F` to + // CHECK:STDERR: · ┃ `i32` + // CHECK:STDERR: · ┃ [ConversionFailure] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ F(e); + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ in monomorphization of `F(E)` here [ResolvingSpecificHere] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: let n: i32 = x.n; return n; } @@ -76,20 +88,6 @@ class E { } fn Test(e: E) { - // CHECK:STDERR: ╭─┤ fail_member_wrong_type.carbon:[[@LINE+14]]:3 - // CHECK:STDERR: │ let n: i32 = x.n; - // CHECK:STDERR: · ┬── - // CHECK:STDERR: · ╰──┤ cannot implicitly convert expression of type `F` to `i32` - // CHECK:STDERR: · │ │ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `F` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ F(e); - // CHECK:STDERR: · ┳ - // CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific `F(E)` [ResolvingSpecificHere] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: F(e); } diff --git a/toolchain/check/testdata/impl/access.carbon b/toolchain/check/testdata/impl/access.carbon index c82c3630adba..57d3e8c6cf6a 100644 --- a/toolchain/check/testdata/impl/access.carbon +++ b/toolchain/check/testdata/impl/access.carbon @@ -51,8 +51,8 @@ class A { fn Get(self: B) -> i32 { // CHECK:STDERR: ╭─┤ fail_impl_in_other_class1.carbon:[[@LINE+11]]:20 // CHECK:STDERR: │ private var m: i32; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return self.m; // CHECK:STDERR: · ━━━┳━━ @@ -80,8 +80,8 @@ class A { fn Get(t: B) -> i32 { // CHECK:STDERR: ╭─┤ fail_impl_in_other_class2.carbon:[[@LINE+11]]:20 // CHECK:STDERR: │ private var m: i32; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return t.m; // CHECK:STDERR: · ━┳━ @@ -106,8 +106,8 @@ impl A as J { fn Get(self: Self) -> i32 { // CHECK:STDERR: ╭─┤ fail_impl_outside_class1.carbon:[[@LINE+11]]:16 // CHECK:STDERR: │ private var n: i32; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return self.n; // CHECK:STDERR: · ━━━┳━━ @@ -131,8 +131,8 @@ impl B as J { fn Get(self: B) -> i32 { // CHECK:STDERR: ╭─┤ fail_impl_outside_class2.carbon:[[@LINE+11]]:16 // CHECK:STDERR: │ private var m: i32; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return self.m; // CHECK:STDERR: · ━━━┳━━ diff --git a/toolchain/check/testdata/impl/assoc_const_self.carbon b/toolchain/check/testdata/impl/assoc_const_self.carbon index 4be38462a401..9b229ec62857 100644 --- a/toolchain/check/testdata/impl/assoc_const_self.carbon +++ b/toolchain/check/testdata/impl/assoc_const_self.carbon @@ -32,15 +32,12 @@ interface I { let V: Self; } -// CHECK:STDERR: ╭─┤ fail_assoc_const_mismatch.carbon:[[@LINE+11]]:12 +// CHECK:STDERR: ╭─┤ fail_assoc_const_mismatch.carbon:[[@LINE+8]]:12 // CHECK:STDERR: -> │ impl {} as I where .V = 0 {} // CHECK:STDERR: · ┳━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type -// CHECK:STDERR: · │ ┃ `Core.IntLiteral` to `{}` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs({})` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `Core.IntLiteral` to `{}` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: impl {} as I where .V = 0 {} @@ -77,21 +74,22 @@ library "[[@TEST_NAME]]"; fn Array(T: type, N: Core.IntLiteral) -> type = "array.make_type"; interface I(N: Core.IntLiteral) { + // CHECK:STDERR: ╭─┤ fail_monomorphization_failure.carbon:[[@LINE+13]]:16 + // CHECK:STDERR: -> │ let V: Array(Self, N); + // CHECK:STDERR: · ━━┳━ + // CHECK:STDERR: · ┗━━┫ error: array bound of -1 is negative [ArrayBoundNegative] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ impl {} as I(-1) where .V = () {} + // CHECK:STDERR: · ─┬ + // CHECK:STDERR: · ╰──┤ in monomorphization of `I(-1)` here + // CHECK:STDERR: · │ │ [ResolvingSpecificHere] + // CHECK:STDERR: · ╰────┤ in completion of type `I(-1)` here + // CHECK:STDERR: · │ [InTypeCompletion] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: let V: Array(Self, N); } -// CHECK:STDERR: ╭─┤ fail_monomorphization_failure.carbon:[[@LINE+12]]:24 -// CHECK:STDERR: │ let V: Array(Self, N); -// CHECK:STDERR: · ──┬─ -// CHECK:STDERR: · ╰──┤ array bound of -1 is negative [ArrayBoundNegative] -// CHECK:STDERR: ┆ -// CHECK:STDERR: -> │ impl {} as I(-1) where .V = () {} -// CHECK:STDERR: · ┳━ -// CHECK:STDERR: · ┗━━┫ error: member access into facet of incomplete type -// CHECK:STDERR: · ┃ `I(-1)` -// CHECK:STDERR: · ┃ [IncompleteTypeInMemberAccessOfFacet] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: impl {} as I(-1) where .V = () {} // --- fail_todo_constrained_fn.carbon @@ -363,26 +361,26 @@ fn CallF() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} { -// CHECK:STDOUT: %.loc19_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc19_7.2: type = converted %.loc19_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc16_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc16_7.2: type = converted %.loc16_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: %.Self.frozen: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] // CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete] // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self.frozen [symbolic_self = constants.%.Self.frozen] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.frozen.as_type] -// CHECK:STDOUT: %.loc19_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.frozen.as_type] +// CHECK:STDOUT: %.loc16_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.frozen.as_type] // CHECK:STDOUT: %V.ref: %I.assoc_type = name_ref V, @V.%assoc0 [concrete = constants.%assoc0.660] -// CHECK:STDOUT: %impl.elem0.loc19_20.1: %.Self.frozen.as_type = impl_witness_access constants.%.f01, element0 [symbolic_self = constants.%impl.elem0.4da] +// CHECK:STDOUT: %impl.elem0.loc16_20.1: %.Self.frozen.as_type = impl_witness_access constants.%.f01, element0 [symbolic_self = constants.%impl.elem0.4da] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %rewrite.loc19_23.1 = requirement_rewrite %impl.elem0.loc19_20.1, %int_0 [concrete] -// CHECK:STDOUT: %impl.elem0.loc19_20.2: %.Self.as_type = impl_witness_access constants.%.00f, element0 [symbolic_self = constants.%impl.elem0.ca3] -// CHECK:STDOUT: %rewrite.loc19_23.2 = requirement_rewrite %impl.elem0.loc19_20.2, %int_0 [concrete] -// CHECK:STDOUT: %.loc19_14.1: type = where_expr [concrete = constants.%I_where.type.8e4] { +// CHECK:STDOUT: %rewrite.loc16_23.1 = requirement_rewrite %impl.elem0.loc16_20.1, %int_0 [concrete] +// CHECK:STDOUT: %impl.elem0.loc16_20.2: %.Self.as_type = impl_witness_access constants.%.00f, element0 [symbolic_self = constants.%impl.elem0.ca3] +// CHECK:STDOUT: %rewrite.loc16_23.2 = requirement_rewrite %impl.elem0.loc16_20.2, %int_0 [concrete] +// CHECK:STDOUT: %.loc16_14.1: type = where_expr [concrete = constants.%I_where.type.8e4] { // CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete] -// CHECK:STDOUT: %rewrite.loc19_23.2 = requirement_rewrite %impl.elem0.loc19_20.2, %int_0 [concrete] +// CHECK:STDOUT: %rewrite.loc16_23.2 = requirement_rewrite %impl.elem0.loc16_20.2, %int_0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19: = impl_self_witness @empty_struct_type.as.I.impl.%.loc19_7.2, @I [concrete = constants.%.aaf] +// CHECK:STDOUT: %.loc16: = impl_self_witness @empty_struct_type.as.I.impl.%.loc16_7.2, @I [concrete = constants.%.aaf] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -402,10 +400,10 @@ fn CallF() { // CHECK:STDOUT: !requires: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc19_7.2 as %I.ref { +// CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc16_7.2 as %I.ref { // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @empty_struct_type.as.I.impl [concrete] // CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] -// CHECK:STDOUT: %.loc19_14.2: %empty_struct_type = converted constants.%int_0, [concrete = ] +// CHECK:STDOUT: %.loc16_14.2: %empty_struct_type = converted constants.%int_0, [concrete = ] // CHECK:STDOUT: %impl_witness_assoc_constant: = impl_witness_assoc_constant [concrete = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -740,25 +738,25 @@ fn CallF() { // CHECK:STDOUT: %N.loc7_14.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc7_14.1 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @empty_struct_type.as..impl [concrete] {} { -// CHECK:STDOUT: %.loc23_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc23_7.2: type = converted %.loc23_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc24_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc24_7.2: type = converted %.loc24_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %I.ref: %I.type.335 = name_ref I, file.%I.decl [concrete = constants.%I.generic] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %impl.elem1: %.2ac = impl_witness_access constants.%Negate.impl_witness, element1 [concrete = constants.%Core.IntLiteral.as.Negate.impl.Op] // CHECK:STDOUT: %bound_method: = bound_method %int_1, %impl.elem1 [concrete = constants.%Core.IntLiteral.as.Negate.impl.Op.bound] // CHECK:STDOUT: %Core.IntLiteral.as.Negate.impl.Op.call: init Core.IntLiteral = call %bound_method(%int_1) [concrete = constants.%int_-1] -// CHECK:STDOUT: %.loc23_16.1: Core.IntLiteral = value_of_initializer %Core.IntLiteral.as.Negate.impl.Op.call [concrete = constants.%int_-1] -// CHECK:STDOUT: %.loc23_16.2: Core.IntLiteral = converted %Core.IntLiteral.as.Negate.impl.Op.call, %.loc23_16.1 [concrete = constants.%int_-1] +// CHECK:STDOUT: %.loc24_16.1: Core.IntLiteral = value_of_initializer %Core.IntLiteral.as.Negate.impl.Op.call [concrete = constants.%int_-1] +// CHECK:STDOUT: %.loc24_16.2: Core.IntLiteral = converted %Core.IntLiteral.as.Negate.impl.Op.call, %.loc24_16.1 [concrete = constants.%int_-1] // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%int_-1)> [concrete = constants.%I.type.8c1] // CHECK:STDOUT: %.Self.frozen: %I.type.8c1 = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.1af] // CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.type [concrete] // CHECK:STDOUT: %.Self.ref: %I.type.8c1 = name_ref .Self, %.Self.frozen [symbolic_self = constants.%.Self.frozen.1af] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.frozen.as_type] -// CHECK:STDOUT: %.loc23_24: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.frozen.as_type] +// CHECK:STDOUT: %.loc24_24: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.frozen.as_type] // CHECK:STDOUT: %V.ref: = name_ref V, [concrete = ] -// CHECK:STDOUT: %.loc23_30: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc24_30: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %rewrite = requirement_rewrite %V.ref, [concrete] -// CHECK:STDOUT: %.loc23_18: type = where_expr [concrete = ] { +// CHECK:STDOUT: %.loc24_18: type = where_expr [concrete = ] { // CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.type [concrete] // CHECK:STDOUT: %rewrite = requirement_rewrite %V.ref, [concrete] // CHECK:STDOUT: } @@ -795,7 +793,7 @@ fn CallF() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @empty_struct_type.as..impl: %.loc23_7.2 as { +// CHECK:STDOUT: impl @empty_struct_type.as..impl: %.loc24_7.2 as { // CHECK:STDOUT: !members: // CHECK:STDOUT: extend // CHECK:STDOUT: witness = diff --git a/toolchain/check/testdata/impl/compound.carbon b/toolchain/check/testdata/impl/compound.carbon index ed779db2aed7..10fd4448ab4f 100644 --- a/toolchain/check/testdata/impl/compound.carbon +++ b/toolchain/check/testdata/impl/compound.carbon @@ -37,15 +37,12 @@ impl {.b: ()} as NonInstance2 { } fn NonInstanceCall2(n: {.b: ()}) { - // CHECK:STDERR: ╭─┤ fail_non-instance.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_non-instance.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ n.(NonInstance2.F2)(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `{.b: ()}` into - // CHECK:STDERR: · │ ┃ type implementing `NonInstance2` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `{.b: ()}` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(NonInstance2)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type implementing `NonInstance2` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: n.(NonInstance2.F2)(); @@ -63,15 +60,12 @@ impl {.c: ()} as NonInstance3 { } fn NonInstanceCallIndirect(p: {.c: ()}*) { - // CHECK:STDERR: ╭─┤ fail_non-instance_indirect.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_non-instance_indirect.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ p->(NonInstance3.F3)(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `{.c: ()}` into - // CHECK:STDERR: · │ ┃ type implementing `NonInstance3` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `{.c: ()}` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(NonInstance3)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type implementing `NonInstance3` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: p->(NonInstance3.F3)(); diff --git a/toolchain/check/testdata/impl/custom_witness/float_fits_in.carbon b/toolchain/check/testdata/impl/custom_witness/float_fits_in.carbon index 59de1168cb1a..453f51fc5274 100644 --- a/toolchain/check/testdata/impl/custom_witness/float_fits_in.carbon +++ b/toolchain/check/testdata/impl/custom_witness/float_fits_in.carbon @@ -51,9 +51,9 @@ fn CheckFail() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ core.carbon // CHECK:STDERR: │ fn CheckFitsIn[U: type, T: FloatFitsIn(U)](unused t: T, unused u: U) {} - // CHECK:STDERR: · ─────────────────────────┬──────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: Core.CheckFitsIn(1.0 as f64, 2.0 as f32); @@ -66,9 +66,9 @@ fn CheckFail() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ core.carbon // CHECK:STDERR: │ fn CheckFitsIn[U: type, T: FloatFitsIn(U)](unused t: T, unused u: U) {} - // CHECK:STDERR: · ─────────────────────────┬──────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: Core.CheckFitsIn(1.0 as f32, 2.0 as f16); diff --git a/toolchain/check/testdata/impl/custom_witness/int_fits_in.carbon b/toolchain/check/testdata/impl/custom_witness/int_fits_in.carbon index b88955172f9f..fa435ac08f97 100644 --- a/toolchain/check/testdata/impl/custom_witness/int_fits_in.carbon +++ b/toolchain/check/testdata/impl/custom_witness/int_fits_in.carbon @@ -51,9 +51,9 @@ fn CheckFail() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ core.carbon // CHECK:STDERR: │ fn CheckFitsIn[U: type, T: IntFitsIn(U)](unused t: T, unused u: U) {} - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: Core.CheckFitsIn(1 as i64, 2 as i32); @@ -66,9 +66,9 @@ fn CheckFail() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ core.carbon // CHECK:STDERR: │ fn CheckFitsIn[U: type, T: IntFitsIn(U)](unused t: T, unused u: U) {} - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: Core.CheckFitsIn(1 as i64, 2 as u32); @@ -81,9 +81,9 @@ fn CheckFail() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ core.carbon // CHECK:STDERR: │ fn CheckFitsIn[U: type, T: IntFitsIn(U)](unused t: T, unused u: U) {} - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: Core.CheckFitsIn(1 as u64, 2 as i32); @@ -96,9 +96,9 @@ fn CheckFail() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ core.carbon // CHECK:STDERR: │ fn CheckFitsIn[U: type, T: IntFitsIn(U)](unused t: T, unused u: U) {} - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: Core.CheckFitsIn(1 as u64, 2 as u32); @@ -120,9 +120,9 @@ fn CheckFail() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ core.carbon // CHECK:STDERR: │ fn CheckFitsIn[U: type, T: IntFitsIn(U)](unused t: T, unused u: U) {} - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: Core.CheckFitsIn(1 as u32, 2 as i32); @@ -135,9 +135,9 @@ fn CheckFail() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ core.carbon // CHECK:STDERR: │ fn CheckFitsIn[U: type, T: IntFitsIn(U)](unused t: T, unused u: U) {} - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: Core.CheckFitsIn(1 as i32, 2 as u32); @@ -159,10 +159,84 @@ fn CheckFail() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ core.carbon // CHECK:STDERR: │ fn CheckFitsIn[U: type, T: IntFitsIn(U)](unused t: T, unused u: U) {} - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: Core.CheckFitsIn(1 as i32, 2 as u32); } + +// --- fail_incomplete.carbon + +library "[[@TEST_NAME]]"; + +import Core; + +class C; + +fn CheckFitsInI32[T: Core.IntFitsIn(i32)](unused p: T*) {} +fn CheckI32FitsIn[U: type, T: Core.IntFitsIn(U)](unused t: T, unused p: U*) {} + +fn CheckFail(p: C*) { + // CHECK:STDERR: ╭─┤ fail_incomplete.carbon:[[@LINE+29]]:3 + // CHECK:STDERR: │ class C; + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: │ + // CHECK:STDERR: │ fn CheckFitsInI32[T: Core.IntFitsIn(i32)](unused p: T*) {} + // CHECK:STDERR: · ───────┬────── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: ┆ + // CHECK:STDERR: -> │ CheckFitsInI32(p); + // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: built-in conversion from incomplete type `C` + // CHECK:STDERR: · ┃ [IncompleteTypeInBuiltinConversion] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: + // CHECK:STDERR: ╭─┤ fail_incomplete.carbon:[[@LINE+13]]:3 + // CHECK:STDERR: │ fn CheckFitsInI32[T: Core.IntFitsIn(i32)](unused p: T*) {} + // CHECK:STDERR: · ───────┬────── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: ┆ + // CHECK:STDERR: -> │ CheckFitsInI32(p); + // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: cannot convert type `C` into type implementing + // CHECK:STDERR: · ┃ `Core.IntFitsIn(i32)` + // CHECK:STDERR: · ┃ [ConversionFailureTypeToFacet] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: + CheckFitsInI32(p); + // CHECK:STDERR: ╭─┤ fail_incomplete.carbon:[[@LINE+29]]:3 + // CHECK:STDERR: │ class C; + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ fn CheckI32FitsIn[U: type, T: Core.IntFitsIn(U)](unused t: T, unused p: U*) {} + // CHECK:STDERR: · ───────┬────── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: ┆ + // CHECK:STDERR: -> │ CheckI32FitsIn(1 as i32, p); + // CHECK:STDERR: · ━━━━━━━━━━━━━┳━━━━━━━━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: built-in conversion to incomplete type `C` + // CHECK:STDERR: · ┃ [IncompleteTypeInBuiltinConversion] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: + // CHECK:STDERR: ╭─┤ fail_incomplete.carbon:[[@LINE+13]]:3 + // CHECK:STDERR: │ fn CheckI32FitsIn[U: type, T: Core.IntFitsIn(U)](unused t: T, unused p: U*) {} + // CHECK:STDERR: · ───────┬────── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: ┆ + // CHECK:STDERR: -> │ CheckI32FitsIn(1 as i32, p); + // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: cannot convert type `i32` into type implementing + // CHECK:STDERR: · ┃ `Core.IntFitsIn(C)` + // CHECK:STDERR: · ┃ [ConversionFailureTypeToFacet] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: + CheckI32FitsIn(1 as i32, p); +} diff --git a/toolchain/check/testdata/impl/eval_musteval.carbon b/toolchain/check/testdata/impl/eval_musteval.carbon index 612a2cecb650..ba619502698d 100644 --- a/toolchain/check/testdata/impl/eval_musteval.carbon +++ b/toolchain/check/testdata/impl/eval_musteval.carbon @@ -170,13 +170,11 @@ import library "interface"; class B { adapt {}; } impl B as Runtime { - // CHECK:STDERR: ╭─┤ fail_impl_musteval.carbon:[[@LINE+15]]:3 + // CHECK:STDERR: ╭─┤ fail_impl_musteval.carbon:[[@LINE+13]]:3 // CHECK:STDERR: -> │ musteval fn F(unused self) -> type { return B; } // CHECK:STDERR: · ━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: non-constant call to compile-time-only function - // CHECK:STDERR: · │ ┃ [NonConstantCallToCompTimeOnlyFunction] - // CHECK:STDERR: · ╰────┤ compile-time-only function declared here - // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] + // CHECK:STDERR: · ┃ [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ interface.carbon // CHECK:STDERR: │ fn F(self) -> type; @@ -189,13 +187,11 @@ impl B as Runtime { } impl B as Eval { - // CHECK:STDERR: ╭─┤ fail_impl_musteval.carbon:[[@LINE+15]]:3 + // CHECK:STDERR: ╭─┤ fail_impl_musteval.carbon:[[@LINE+13]]:3 // CHECK:STDERR: -> │ musteval fn F(unused self) -> type { return B; } // CHECK:STDERR: · ━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: non-constant call to compile-time-only function - // CHECK:STDERR: · │ ┃ [NonConstantCallToCompTimeOnlyFunction] - // CHECK:STDERR: · ╰────┤ compile-time-only function declared here - // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] + // CHECK:STDERR: · ┃ [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ interface.carbon // CHECK:STDERR: │ eval fn F(self) -> type; @@ -237,13 +233,11 @@ impl B as Core.ImplicitAs(BView) { } impl B as MustEval { - // CHECK:STDERR: ╭─┤ fail_todo_impl_musteval_from_musteval_thunk.carbon:[[@LINE+15]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_impl_musteval_from_musteval_thunk.carbon:[[@LINE+13]]:3 // CHECK:STDERR: -> │ musteval fn F(unused self: BView) -> type { return B; } // CHECK:STDERR: · ━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: non-constant call to compile-time-only function - // CHECK:STDERR: · │ ┃ [NonConstantCallToCompTimeOnlyFunction] - // CHECK:STDERR: · ╰────┤ compile-time-only function declared here - // CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] + // CHECK:STDERR: · ┃ [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ interface.carbon // CHECK:STDERR: │ musteval fn F(self) -> type; diff --git a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon index 50157f8820d4..aadf9d84b43f 100644 --- a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon @@ -17,7 +17,7 @@ interface I { // CHECK:STDERR: ╭─┤ fail_extend_partially_defined_interface.carbon:[[@LINE+12]]:5 // CHECK:STDERR: │ interface I { // CHECK:STDERR: · ──────┬────── - // CHECK:STDERR: · ╰──┤ interface is currently being defined + // CHECK:STDERR: · ╰──┤ interface is incomplete within its definition // CHECK:STDERR: · │ [InterfaceIncompleteWithinDefinition] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ extend impl as I; diff --git a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon index 15d69e75b09d..2a66729fae35 100644 --- a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon @@ -15,10 +15,11 @@ interface I; class C { - // CHECK:STDERR: ╭─┤ fail_extend_undefined_interface.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_extend_undefined_interface.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ interface I; - // CHECK:STDERR: · ──────┬───── - // CHECK:STDERR: · ╰──┤ interface was forward declared here [InterfaceForwardDeclaredHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ interface was forward declared here + // CHECK:STDERR: · │ [InterfaceForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ extend impl as I; // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━ @@ -63,7 +64,7 @@ fn F(c: C) { // CHECK:STDOUT: %c.patt: %pattern_type = wrapper_binding_pattern c, %c.param_patt [concrete = constants.%c.patt] // CHECK:STDOUT: } { // CHECK:STDOUT: %c.param: %C = value_param call_param0 -// CHECK:STDOUT: %C.ref.loc32: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc33: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %c: %C = wrapper_binding c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -77,7 +78,7 @@ fn F(c: C) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc29: = impl_self_witness @C.as.I.impl.%Self.ref, @I [concrete = constants.%.b7f] +// CHECK:STDOUT: %.loc30: = impl_self_witness @C.as.I.impl.%Self.ref, @I [concrete = constants.%.b7f] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -90,10 +91,10 @@ fn F(c: C) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%c.param: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref.loc33: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %F.ref.loc33: = name_ref F, [concrete = ] -// CHECK:STDOUT: %c.ref: %C = name_ref c, %c +// CHECK:STDOUT: %C.ref.loc34: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %F.ref.loc34: = name_ref F, [concrete = ] +// CHECK:STDOUT: %c.ref: %C = name_ref c, %c +// CHECK:STDOUT: %F.ref.loc35: = name_ref F, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon index f945f09b6e6d..c95076eed647 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -17,7 +17,7 @@ interface I { fn F(); } class NoF { // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ interface I { fn F(); } - // CHECK:STDERR: · ───┬─── + // CHECK:STDERR: · ┬ // CHECK:STDERR: · ╰──┤ associated function F declared here // CHECK:STDERR: · │ [AssociatedFunctionHere] // CHECK:STDERR: ┆ @@ -34,7 +34,7 @@ class FNotFunction { impl as I { // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+12]]:5 // CHECK:STDERR: │ interface I { fn F(); } - // CHECK:STDERR: · ───┬─── + // CHECK:STDERR: · ┬ // CHECK:STDERR: · ╰──┤ associated function F declared here // CHECK:STDERR: · │ [AssociatedFunctionHere] // CHECK:STDERR: ┆ @@ -50,7 +50,7 @@ class FNotFunction { class FExtraParam { impl as I { - // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+13]]:5 + // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+12]]:5 // CHECK:STDERR: │ interface I { fn F(); } // CHECK:STDERR: · ─┬───── // CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function @@ -59,8 +59,7 @@ class FExtraParam { // CHECK:STDERR: -> │ fn F(b: bool); // CHECK:STDERR: · ━━━━━━━┳━━━━━━ // CHECK:STDERR: · ┗━━┫ error: 0 arguments passed to function expecting 1 argument - // CHECK:STDERR: · │ ┃ [CallArgCountMismatch] - // CHECK:STDERR: · ╰────┤ calling function declared here [InCallToEntity] + // CHECK:STDERR: · ┃ [CallArgCountMismatch] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(b: bool); @@ -69,7 +68,7 @@ class FExtraParam { class FExtraImplicitParam { impl as I { - // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+13]]:5 + // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+12]]:5 // CHECK:STDERR: │ interface I { fn F(); } // CHECK:STDERR: · ─┬───── // CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function @@ -78,8 +77,7 @@ class FExtraImplicitParam { // CHECK:STDERR: -> │ fn F(self); // CHECK:STDERR: · ━━━━━┳━━━━━ // CHECK:STDERR: · ┗━━┫ error: 0 arguments passed to function expecting 1 argument - // CHECK:STDERR: · │ ┃ [CallArgCountMismatch] - // CHECK:STDERR: · ╰────┤ calling function declared here [InCallToEntity] + // CHECK:STDERR: · ┃ [CallArgCountMismatch] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(self); @@ -109,7 +107,7 @@ interface J { fn F(self: bool, b: bool) -> bool; } class FMissingParam { impl as J { - // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+13]]:5 + // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+12]]:5 // CHECK:STDERR: │ interface J { fn F(self: bool, b: bool) -> bool; } // CHECK:STDERR: · ─┬──────────────────────────────── // CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function @@ -118,8 +116,7 @@ class FMissingParam { // CHECK:STDERR: -> │ fn F(self: bool) -> bool; // CHECK:STDERR: · ━━━━━━━━━━━━┳━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: 1 argument passed to function expecting 0 arguments - // CHECK:STDERR: · │ ┃ [CallArgCountMismatch] - // CHECK:STDERR: · ╰────┤ calling function declared here [InCallToEntity] + // CHECK:STDERR: · ┃ [CallArgCountMismatch] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(self: bool) -> bool; @@ -147,7 +144,7 @@ class FMissingImplicitParam { class FMissingReturnType { impl as J { - // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+14]]:5 + // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+12]]:5 // CHECK:STDERR: │ interface J { fn F(self: bool, b: bool) -> bool; } // CHECK:STDERR: · ─┬──────────────────────────────── // CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function @@ -156,9 +153,7 @@ class FMissingReturnType { // CHECK:STDERR: -> │ fn F(self: bool, b: bool); // CHECK:STDERR: · ━━━━━┳━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `()` to `bool` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `()` does not implement interface `Core.ImplicitAs(bool)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(self: bool, b: bool); @@ -167,7 +162,7 @@ class FMissingReturnType { class FDifferentParamType { impl as J { - // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+18]]:5 + // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+15]]:5 // CHECK:STDERR: │ interface J { fn F(self: bool, b: bool) -> bool; } // CHECK:STDERR: · ─┬──────────────────────────────── // CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function @@ -178,11 +173,8 @@ class FDifferentParamType { // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type // CHECK:STDERR: · │ ┃ `bool` to `FDifferentParamType` // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `bool` does not implement interface - // CHECK:STDERR: · │ │ `Core.ImplicitAs(FDifferentParamType)` - // CHECK:STDERR: · │ │ [MissingImplInMemberAccessInContext] - // CHECK:STDERR: · ╰──────┤ initializing function parameter - // CHECK:STDERR: · │ [InCallToFunctionParam] + // CHECK:STDERR: · ╰────┤ initializing function parameter + // CHECK:STDERR: · │ [InCallToFunctionParam] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(self: bool, b: Self) -> bool; @@ -191,7 +183,7 @@ class FDifferentParamType { class FDifferentImplicitParamType { impl as J { - // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+17]]:5 + // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+14]]:5 // CHECK:STDERR: │ interface J { fn F(self: bool, b: bool) -> bool; } // CHECK:STDERR: · ─┬──────────────────────────────── // CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function @@ -203,9 +195,6 @@ class FDifferentImplicitParamType { // CHECK:STDERR: · │ ┃ `FDifferentImplicitParamType` // CHECK:STDERR: · │ ┃ [ConversionFailure] // CHECK:STDERR: · ╰────┤ initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: · ╰──────┤ type `bool` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(FDifferentImplicitParamType)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(self, b: bool) -> bool; @@ -215,19 +204,16 @@ class FDifferentImplicitParamType { class FDifferentReturnType { impl as J { // TODO: Include an "aka" in this diagnostic to explain that the type `Self` is `FDifferentReturnType`. - // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+15]]:5 + // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+12]]:5 // CHECK:STDERR: │ interface J { fn F(self: bool, b: bool) -> bool; } // CHECK:STDERR: · ─┬──────────────────────────────── // CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function // CHECK:STDERR: · │ [ThunkSignature] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F(self: bool, b: bool) -> Self; - // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Self` to `bool` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `FDifferentReturnType` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(bool)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Self` to `bool` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(self: bool, b: bool) -> Self; @@ -240,7 +226,7 @@ interface SelfNested { class SelfNestedBadParam { impl as SelfNested { - // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+17]]:5 + // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+14]]:5 // CHECK:STDERR: │ fn F(x: (Self*, {.x: Self, .y: i32})) -> array(Self, 4); // CHECK:STDERR: · ─────────────┬────────────────────────────────────────── // CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function @@ -252,9 +238,6 @@ class SelfNestedBadParam { // CHECK:STDERR: · │ ┃ `SelfNestedBadParam` to `i32` // CHECK:STDERR: · │ ┃ [ConversionFailure] // CHECK:STDERR: · ╰────┤ initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: · ╰──────┤ type `SelfNestedBadParam` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(x: (SelfNestedBadParam*, {.x: i32, .y: i32})) -> array(SelfNestedBadParam, 4); @@ -263,7 +246,7 @@ class SelfNestedBadParam { class SelfNestedBadReturnType { impl as SelfNested { - // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+17]]:5 + // CHECK:STDERR: ╭─┤ fail_impl_bad_assoc_fn.carbon:[[@LINE+14]]:5 // CHECK:STDERR: │ fn F(x: (Self*, {.x: Self, .y: i32})) -> array(Self, 4); // CHECK:STDERR: · ─────────────┬────────────────────────────────────────── // CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function @@ -272,12 +255,9 @@ class SelfNestedBadReturnType { // CHECK:STDERR: -> │ fn F(x: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i... // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `array(SelfNestedBadParam, 4)` to - // CHECK:STDERR: · │ ┃ `array(SelfNestedBadReturnType, 4)` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `array(SelfNestedBadParam, 4)` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(array(SelfNestedBadReturnType, 4))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `array(SelfNestedBadParam, 4)` to + // CHECK:STDERR: · ┃ `array(SelfNestedBadReturnType, 4)` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(x: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32})) -> array(SelfNestedBadParam, 4); @@ -317,12 +297,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %b.param_patt.792: %pattern_type.831 = value_param_pattern [concrete] // CHECK:STDOUT: %b.patt.d80: %pattern_type.831 = wrapper_binding_pattern b, %b.param_patt.792 [concrete] -// CHECK:STDOUT: %FExtraParam.as.I.impl.F.type.ec7b0b.1: type = fn_type @FExtraParam.as.I.impl.F.loc66_18.1 [concrete] +// CHECK:STDOUT: %FExtraParam.as.I.impl.F.type.ec7b0b.1: type = fn_type @FExtraParam.as.I.impl.F.loc65_18.1 [concrete] // CHECK:STDOUT: %FExtraParam.as.I.impl.F.ef9801.1: %FExtraParam.as.I.impl.F.type.ec7b0b.1 = struct_value () [concrete] // CHECK:STDOUT: %I.facet.476: %I.type = facet_value %FExtraParam, (%I.impl_witness.0d1) [concrete] // CHECK:STDOUT: %I.WithSelf.F.type.f2e: type = fn_type @I.WithSelf.F, @I.WithSelf(%I.facet.476) [concrete] // CHECK:STDOUT: %I.WithSelf.F.91f: %I.WithSelf.F.type.f2e = struct_value () [concrete] -// CHECK:STDOUT: %FExtraParam.as.I.impl.F.type.ec7b0b.2: type = fn_type @FExtraParam.as.I.impl.F.loc66_18.2 [concrete] +// CHECK:STDOUT: %FExtraParam.as.I.impl.F.type.ec7b0b.2: type = fn_type @FExtraParam.as.I.impl.F.loc65_18.2 [concrete] // CHECK:STDOUT: %FExtraParam.as.I.impl.F.ef9801.2: %FExtraParam.as.I.impl.F.type.ec7b0b.2 = struct_value () [concrete] // CHECK:STDOUT: %FExtraImplicitParam: type = class_type @FExtraImplicitParam [concrete] // CHECK:STDOUT: %.77c: = impl_self_witness %FExtraImplicitParam, @I [concrete] @@ -330,12 +310,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %pattern_type.54d: type = pattern_type %FExtraImplicitParam [concrete] // CHECK:STDOUT: %self.param_patt.f41: %pattern_type.54d = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt.cca: %pattern_type.54d = wrapper_binding_pattern self, %self.param_patt.f41 [concrete] -// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.type.54cac2.1: type = fn_type @FExtraImplicitParam.as.I.impl.F.loc85_15.1 [concrete] +// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.type.54cac2.1: type = fn_type @FExtraImplicitParam.as.I.impl.F.loc83_15.1 [concrete] // CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.a42f35.1: %FExtraImplicitParam.as.I.impl.F.type.54cac2.1 = struct_value () [concrete] // CHECK:STDOUT: %I.facet.7ed: %I.type = facet_value %FExtraImplicitParam, (%I.impl_witness.989) [concrete] // CHECK:STDOUT: %I.WithSelf.F.type.0ed: type = fn_type @I.WithSelf.F, @I.WithSelf(%I.facet.7ed) [concrete] // CHECK:STDOUT: %I.WithSelf.F.ec4: %I.WithSelf.F.type.0ed = struct_value () [concrete] -// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.type.54cac2.2: type = fn_type @FExtraImplicitParam.as.I.impl.F.loc85_15.2 [concrete] +// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.type.54cac2.2: type = fn_type @FExtraImplicitParam.as.I.impl.F.loc83_15.2 [concrete] // CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.a42f35.2: %FExtraImplicitParam.as.I.impl.F.type.54cac2.2 = struct_value () [concrete] // CHECK:STDOUT: %FExtraReturnType: type = class_type @FExtraReturnType [concrete] // CHECK:STDOUT: %.ebd: = impl_self_witness %FExtraReturnType, @I [concrete] @@ -359,32 +339,32 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %FMissingParam: type = class_type @FMissingParam [concrete] // CHECK:STDOUT: %.599: = impl_self_witness %FMissingParam, @J [concrete] // CHECK:STDOUT: %J.impl_witness.24e: = impl_witness @FMissingParam.as.J.impl.%J.impl_witness_table [concrete] -// CHECK:STDOUT: %FMissingParam.as.J.impl.F.type.aad6ec.1: type = fn_type @FMissingParam.as.J.impl.F.loc125_29.1 [concrete] +// CHECK:STDOUT: %FMissingParam.as.J.impl.F.type.aad6ec.1: type = fn_type @FMissingParam.as.J.impl.F.loc122_29.1 [concrete] // CHECK:STDOUT: %FMissingParam.as.J.impl.F.dd09dc.1: %FMissingParam.as.J.impl.F.type.aad6ec.1 = struct_value () [concrete] // CHECK:STDOUT: %J.facet.2a3: %J.type = facet_value %FMissingParam, (%J.impl_witness.24e) [concrete] // CHECK:STDOUT: %J.WithSelf.F.type.38e: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet.2a3) [concrete] // CHECK:STDOUT: %J.WithSelf.F.433: %J.WithSelf.F.type.38e = struct_value () [concrete] -// CHECK:STDOUT: %FMissingParam.as.J.impl.F.type.aad6ec.2: type = fn_type @FMissingParam.as.J.impl.F.loc125_29.2 [concrete] +// CHECK:STDOUT: %FMissingParam.as.J.impl.F.type.aad6ec.2: type = fn_type @FMissingParam.as.J.impl.F.loc122_29.2 [concrete] // CHECK:STDOUT: %FMissingParam.as.J.impl.F.dd09dc.2: %FMissingParam.as.J.impl.F.type.aad6ec.2 = struct_value () [concrete] // CHECK:STDOUT: %FMissingImplicitParam: type = class_type @FMissingImplicitParam [concrete] // CHECK:STDOUT: %.f79: = impl_self_witness %FMissingImplicitParam, @J [concrete] // CHECK:STDOUT: %J.impl_witness.0d0: = impl_witness @FMissingImplicitParam.as.J.impl.%J.impl_witness_table [concrete] -// CHECK:STDOUT: %FMissingImplicitParam.as.J.impl.F.type.f666a8.1: type = fn_type @FMissingImplicitParam.as.J.impl.F.loc144_26.1 [concrete] +// CHECK:STDOUT: %FMissingImplicitParam.as.J.impl.F.type.f666a8.1: type = fn_type @FMissingImplicitParam.as.J.impl.F.loc141_26.1 [concrete] // CHECK:STDOUT: %FMissingImplicitParam.as.J.impl.F.620ed1.1: %FMissingImplicitParam.as.J.impl.F.type.f666a8.1 = struct_value () [concrete] // CHECK:STDOUT: %J.facet.ba1: %J.type = facet_value %FMissingImplicitParam, (%J.impl_witness.0d0) [concrete] // CHECK:STDOUT: %J.WithSelf.F.type.5df: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet.ba1) [concrete] // CHECK:STDOUT: %J.WithSelf.F.44b: %J.WithSelf.F.type.5df = struct_value () [concrete] -// CHECK:STDOUT: %FMissingImplicitParam.as.J.impl.F.type.f666a8.2: type = fn_type @FMissingImplicitParam.as.J.impl.F.loc144_26.2 [concrete] +// CHECK:STDOUT: %FMissingImplicitParam.as.J.impl.F.type.f666a8.2: type = fn_type @FMissingImplicitParam.as.J.impl.F.loc141_26.2 [concrete] // CHECK:STDOUT: %FMissingImplicitParam.as.J.impl.F.620ed1.2: %FMissingImplicitParam.as.J.impl.F.type.f666a8.2 = struct_value () [concrete] // CHECK:STDOUT: %FMissingReturnType: type = class_type @FMissingReturnType [concrete] // CHECK:STDOUT: %.199: = impl_self_witness %FMissingReturnType, @J [concrete] // CHECK:STDOUT: %J.impl_witness.50a: = impl_witness @FMissingReturnType.as.J.impl.%J.impl_witness_table [concrete] -// CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.type.9cd56a.1: type = fn_type @FMissingReturnType.as.J.impl.F.loc164_30.1 [concrete] +// CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.type.9cd56a.1: type = fn_type @FMissingReturnType.as.J.impl.F.loc159_30.1 [concrete] // CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.6975be.1: %FMissingReturnType.as.J.impl.F.type.9cd56a.1 = struct_value () [concrete] // CHECK:STDOUT: %J.facet.b68: %J.type = facet_value %FMissingReturnType, (%J.impl_witness.50a) [concrete] // CHECK:STDOUT: %J.WithSelf.F.type.628: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet.b68) [concrete] // CHECK:STDOUT: %J.WithSelf.F.70e: %J.WithSelf.F.type.628 = struct_value () [concrete] -// CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.type.9cd56a.2: type = fn_type @FMissingReturnType.as.J.impl.F.loc164_30.2 [concrete] +// CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.type.9cd56a.2: type = fn_type @FMissingReturnType.as.J.impl.F.loc159_30.2 [concrete] // CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.6975be.2: %FMissingReturnType.as.J.impl.F.type.9cd56a.2 = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete] @@ -394,12 +374,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %pattern_type.5d3: type = pattern_type %FDifferentParamType [concrete] // CHECK:STDOUT: %b.param_patt.0a8: %pattern_type.5d3 = value_param_pattern [concrete] // CHECK:STDOUT: %b.patt.f7e: %pattern_type.5d3 = wrapper_binding_pattern b, %b.param_patt.0a8 [concrete] -// CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.type.4a2e9b.1: type = fn_type @FDifferentParamType.as.J.impl.F.loc188_38.1 [concrete] +// CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.type.4a2e9b.1: type = fn_type @FDifferentParamType.as.J.impl.F.loc180_38.1 [concrete] // CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.28602a.1: %FDifferentParamType.as.J.impl.F.type.4a2e9b.1 = struct_value () [concrete] // CHECK:STDOUT: %J.facet.73e: %J.type = facet_value %FDifferentParamType, (%J.impl_witness.9e2) [concrete] // CHECK:STDOUT: %J.WithSelf.F.type.fec: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet.73e) [concrete] // CHECK:STDOUT: %J.WithSelf.F.236: %J.WithSelf.F.type.fec = struct_value () [concrete] -// CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.type.4a2e9b.2: type = fn_type @FDifferentParamType.as.J.impl.F.loc188_38.2 [concrete] +// CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.type.4a2e9b.2: type = fn_type @FDifferentParamType.as.J.impl.F.loc180_38.2 [concrete] // CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.28602a.2: %FDifferentParamType.as.J.impl.F.type.4a2e9b.2 = struct_value () [concrete] // CHECK:STDOUT: %FDifferentImplicitParamType: type = class_type @FDifferentImplicitParamType [concrete] // CHECK:STDOUT: %.46c: = impl_self_witness %FDifferentImplicitParamType, @J [concrete] @@ -407,12 +387,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %pattern_type.1bc: type = pattern_type %FDifferentImplicitParamType [concrete] // CHECK:STDOUT: %self.param_patt.ea6: %pattern_type.1bc = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt.85b: %pattern_type.1bc = wrapper_binding_pattern self, %self.param_patt.ea6 [concrete] -// CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.1: type = fn_type @FDifferentImplicitParamType.as.J.impl.F.loc211_32.1 [concrete] +// CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.1: type = fn_type @FDifferentImplicitParamType.as.J.impl.F.loc200_32.1 [concrete] // CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.792c78.1: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.1 = struct_value () [concrete] // CHECK:STDOUT: %J.facet.00a: %J.type = facet_value %FDifferentImplicitParamType, (%J.impl_witness.d1a) [concrete] // CHECK:STDOUT: %J.WithSelf.F.type.fa8: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet.00a) [concrete] // CHECK:STDOUT: %J.WithSelf.F.a0b: %J.WithSelf.F.type.fa8 = struct_value () [concrete] -// CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.2: type = fn_type @FDifferentImplicitParamType.as.J.impl.F.loc211_32.2 [concrete] +// CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.2: type = fn_type @FDifferentImplicitParamType.as.J.impl.F.loc200_32.2 [concrete] // CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.792c78.2: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.2 = struct_value () [concrete] // CHECK:STDOUT: %FDifferentReturnType: type = class_type @FDifferentReturnType [concrete] // CHECK:STDOUT: %.ce7: = impl_self_witness %FDifferentReturnType, @J [concrete] @@ -421,12 +401,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %pattern_type.b9f: type = pattern_type %FDifferentReturnType [concrete] // CHECK:STDOUT: %return.param_patt.f37: %pattern_type.b9f = out_param_pattern [concrete] // CHECK:STDOUT: %return.patt.e4f: %pattern_type.b9f = return_slot_pattern %return.param_patt.f37, %FDifferentReturnType [concrete] -// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.type.ff55f4.1: type = fn_type @FDifferentReturnType.as.J.impl.F.loc233_38.1 [concrete] +// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.type.ff55f4.1: type = fn_type @FDifferentReturnType.as.J.impl.F.loc219_38.1 [concrete] // CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.9725a5.1: %FDifferentReturnType.as.J.impl.F.type.ff55f4.1 = struct_value () [concrete] // CHECK:STDOUT: %J.facet.6a7: %J.type = facet_value %FDifferentReturnType, (%J.impl_witness.6a4) [concrete] // CHECK:STDOUT: %J.WithSelf.F.type.b41: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet.6a7) [concrete] // CHECK:STDOUT: %J.WithSelf.F.982: %J.WithSelf.F.type.b41 = struct_value () [concrete] -// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.type.ff55f4.2: type = fn_type @FDifferentReturnType.as.J.impl.F.loc233_38.2 [concrete] +// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.type.ff55f4.2: type = fn_type @FDifferentReturnType.as.J.impl.F.loc219_38.2 [concrete] // CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.9725a5.2: %FDifferentReturnType.as.J.impl.F.type.ff55f4.2 = struct_value () [concrete] // CHECK:STDOUT: %SelfNested.type: type = facet_type <@SelfNested> [concrete] // CHECK:STDOUT: %Self.e81: %SelfNested.type = symbolic_binding Self, 0 [symbolic] @@ -470,7 +450,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %pattern_type.ec1: type = pattern_type %Array.870 [concrete] // CHECK:STDOUT: %return.param_patt.8ed: %pattern_type.ec1 = out_param_pattern [concrete] // CHECK:STDOUT: %return.patt.21a: %pattern_type.ec1 = return_slot_pattern %return.param_patt.8ed, %Array.870 [concrete] -// CHECK:STDOUT: %SelfNestedBadParam.as.SelfNested.impl.F.type.4325e7.1: type = fn_type @SelfNestedBadParam.as.SelfNested.impl.F.loc260_87.1 [concrete] +// CHECK:STDOUT: %SelfNestedBadParam.as.SelfNested.impl.F.type.4325e7.1: type = fn_type @SelfNestedBadParam.as.SelfNested.impl.F.loc243_87.1 [concrete] // CHECK:STDOUT: %SelfNestedBadParam.as.SelfNested.impl.F.5fd896.1: %SelfNestedBadParam.as.SelfNested.impl.F.type.4325e7.1 = struct_value () [concrete] // CHECK:STDOUT: %SelfNested.facet.d0d: %SelfNested.type = facet_value %SelfNestedBadParam, (%SelfNested.impl_witness.09d) [concrete] // CHECK:STDOUT: %SelfNested.WithSelf.F.type.49e: type = fn_type @SelfNested.WithSelf.F, @SelfNested.WithSelf(%SelfNested.facet.d0d) [concrete] @@ -481,7 +461,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %pattern_type.1ec: type = pattern_type %tuple.type.5e1 [concrete] // CHECK:STDOUT: %x.param_patt.255: %pattern_type.1ec = value_param_pattern [concrete] // CHECK:STDOUT: %x.patt.79a: %pattern_type.1ec = wrapper_binding_pattern x, %x.param_patt.255 [concrete] -// CHECK:STDOUT: %SelfNestedBadParam.as.SelfNested.impl.F.type.4325e7.2: type = fn_type @SelfNestedBadParam.as.SelfNested.impl.F.loc260_87.2 [concrete] +// CHECK:STDOUT: %SelfNestedBadParam.as.SelfNested.impl.F.type.4325e7.2: type = fn_type @SelfNestedBadParam.as.SelfNested.impl.F.loc243_87.2 [concrete] // CHECK:STDOUT: %SelfNestedBadParam.as.SelfNested.impl.F.5fd896.2: %SelfNestedBadParam.as.SelfNested.impl.F.type.4325e7.2 = struct_value () [concrete] // CHECK:STDOUT: %SelfNestedBadReturnType: type = class_type @SelfNestedBadReturnType [concrete] // CHECK:STDOUT: %.020: = impl_self_witness %SelfNestedBadReturnType, @SelfNested [concrete] @@ -493,7 +473,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %pattern_type.7fc: type = pattern_type %tuple.type.dce [concrete] // CHECK:STDOUT: %x.param_patt.04c: %pattern_type.7fc = value_param_pattern [concrete] // CHECK:STDOUT: %x.patt.10a: %pattern_type.7fc = wrapper_binding_pattern x, %x.param_patt.04c [concrete] -// CHECK:STDOUT: %SelfNestedBadReturnType.as.SelfNested.impl.F.type.1cbabe.1: type = fn_type @SelfNestedBadReturnType.as.SelfNested.impl.F.loc283_112.1 [concrete] +// CHECK:STDOUT: %SelfNestedBadReturnType.as.SelfNested.impl.F.type.1cbabe.1: type = fn_type @SelfNestedBadReturnType.as.SelfNested.impl.F.loc263_112.1 [concrete] // CHECK:STDOUT: %SelfNestedBadReturnType.as.SelfNested.impl.F.5a7d54.1: %SelfNestedBadReturnType.as.SelfNested.impl.F.type.1cbabe.1 = struct_value () [concrete] // CHECK:STDOUT: %SelfNested.facet.e71: %SelfNested.type = facet_value %SelfNestedBadReturnType, (%SelfNested.impl_witness.849) [concrete] // CHECK:STDOUT: %SelfNested.WithSelf.F.type.369: type = fn_type @SelfNested.WithSelf.F, @SelfNested.WithSelf(%SelfNested.facet.e71) [concrete] @@ -503,7 +483,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %pattern_type.5b0: type = pattern_type %Array.ce4 [concrete] // CHECK:STDOUT: %return.param_patt.c20: %pattern_type.5b0 = out_param_pattern [concrete] // CHECK:STDOUT: %return.patt.02d: %pattern_type.5b0 = return_slot_pattern %return.param_patt.c20, %Array.ce4 [concrete] -// CHECK:STDOUT: %SelfNestedBadReturnType.as.SelfNested.impl.F.type.1cbabe.2: type = fn_type @SelfNestedBadReturnType.as.SelfNested.impl.F.loc283_112.2 [concrete] +// CHECK:STDOUT: %SelfNestedBadReturnType.as.SelfNested.impl.F.type.1cbabe.2: type = fn_type @SelfNestedBadReturnType.as.SelfNested.impl.F.loc263_112.2 [concrete] // CHECK:STDOUT: %SelfNestedBadReturnType.as.SelfNested.impl.F.5a7d54.2: %SelfNestedBadReturnType.as.SelfNested.impl.F.type.1cbabe.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -588,15 +568,15 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern [concrete = constants.%b.param_patt.792] // CHECK:STDOUT: %b.patt: %pattern_type.831 = wrapper_binding_pattern b, %b.param_patt [concrete = constants.%b.patt.d80] // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt.5a1] -// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc108_44.1 [concrete = constants.%return.patt.c0c] +// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc106_44.1 [concrete = constants.%return.patt.c0c] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc108_44.1: type = type_literal bool [concrete = bool] -// CHECK:STDOUT: %.loc108_44.2: Core.Form = init_form %.loc108_44.1 [concrete = constants.%.f34] +// CHECK:STDOUT: %.loc106_44.1: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc106_44.2: Core.Form = init_form %.loc106_44.1 [concrete = constants.%.f34] // CHECK:STDOUT: %self.param: bool = value_param call_param0 -// CHECK:STDOUT: %.loc108_26: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc106_26: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %self: bool = wrapper_binding self, %self.param // CHECK:STDOUT: %b.param: bool = value_param call_param1 -// CHECK:STDOUT: %.loc108_35: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc106_35: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %b: bool = wrapper_binding b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -617,34 +597,34 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: !with Self: // CHECK:STDOUT: %SelfNested.WithSelf.F.decl: @SelfNested.WithSelf.%SelfNested.WithSelf.F.type (%SelfNested.WithSelf.F.type.3a1) = fn_decl @SelfNested.WithSelf.F [symbolic = @SelfNested.WithSelf.%SelfNested.WithSelf.F (constants.%SelfNested.WithSelf.F.796)] { -// CHECK:STDOUT: %x.param_patt.loc238_9.1: @SelfNested.WithSelf.F.%pattern_type.loc238_9 (%pattern_type.871) = value_param_pattern [symbolic = %x.param_patt.loc238_9.2 (constants.%x.param_patt.8f6)] -// CHECK:STDOUT: %x.patt.loc238_9.1: @SelfNested.WithSelf.F.%pattern_type.loc238_9 (%pattern_type.871) = wrapper_binding_pattern x, %x.param_patt.loc238_9.1 [symbolic = %x.patt.loc238_9.2 (constants.%x.patt.48b)] -// CHECK:STDOUT: %return.param_patt.loc238_57.1: @SelfNested.WithSelf.F.%pattern_type.loc238_57 (%pattern_type.4a4) = out_param_pattern [symbolic = %return.param_patt.loc238_57.2 (constants.%return.param_patt.36b)] -// CHECK:STDOUT: %return.patt.loc238_41.1: @SelfNested.WithSelf.F.%pattern_type.loc238_57 (%pattern_type.4a4) = return_slot_pattern %return.param_patt.loc238_57.1, %Array.loc238_57.2 [symbolic = %return.patt.loc238_41.2 (constants.%return.patt.7a8)] +// CHECK:STDOUT: %x.param_patt.loc224_9.1: @SelfNested.WithSelf.F.%pattern_type.loc224_9 (%pattern_type.871) = value_param_pattern [symbolic = %x.param_patt.loc224_9.2 (constants.%x.param_patt.8f6)] +// CHECK:STDOUT: %x.patt.loc224_9.1: @SelfNested.WithSelf.F.%pattern_type.loc224_9 (%pattern_type.871) = wrapper_binding_pattern x, %x.param_patt.loc224_9.1 [symbolic = %x.patt.loc224_9.2 (constants.%x.patt.48b)] +// CHECK:STDOUT: %return.param_patt.loc224_57.1: @SelfNested.WithSelf.F.%pattern_type.loc224_57 (%pattern_type.4a4) = out_param_pattern [symbolic = %return.param_patt.loc224_57.2 (constants.%return.param_patt.36b)] +// CHECK:STDOUT: %return.patt.loc224_41.1: @SelfNested.WithSelf.F.%pattern_type.loc224_57 (%pattern_type.4a4) = return_slot_pattern %return.param_patt.loc224_57.1, %Array.loc224_57.2 [symbolic = %return.patt.loc224_41.2 (constants.%return.patt.7a8)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc238_50: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.e81)] +// CHECK:STDOUT: %Self.ref.loc224_50: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.e81)] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4] -// CHECK:STDOUT: %Self.as_type.loc238_50: type = facet_access_type %Self.ref.loc238_50 [symbolic = %Self.as_type.loc238_16.1 (constants.%Self.as_type.8ab)] -// CHECK:STDOUT: %.loc238_50: type = converted %Self.ref.loc238_50, %Self.as_type.loc238_50 [symbolic = %Self.as_type.loc238_16.1 (constants.%Self.as_type.8ab)] -// CHECK:STDOUT: %Array.loc238_57.2: type = class_type @Array, @Array(constants.%Self.as_type.8ab, constants.%int_4) [symbolic = %Array.loc238_57.1 (constants.%Array.d32)] -// CHECK:STDOUT: %.loc238_57.2: Core.Form = init_form %Array.loc238_57.2 [symbolic = %.loc238_57.1 (constants.%.ec2)] +// CHECK:STDOUT: %Self.as_type.loc224_50: type = facet_access_type %Self.ref.loc224_50 [symbolic = %Self.as_type.loc224_16.1 (constants.%Self.as_type.8ab)] +// CHECK:STDOUT: %.loc224_50: type = converted %Self.ref.loc224_50, %Self.as_type.loc224_50 [symbolic = %Self.as_type.loc224_16.1 (constants.%Self.as_type.8ab)] +// CHECK:STDOUT: %Array.loc224_57.2: type = class_type @Array, @Array(constants.%Self.as_type.8ab, constants.%int_4) [symbolic = %Array.loc224_57.1 (constants.%Array.d32)] +// CHECK:STDOUT: %.loc224_57.2: Core.Form = init_form %Array.loc224_57.2 [symbolic = %.loc224_57.1 (constants.%.ec2)] // CHECK:STDOUT: %x.param: @SelfNested.WithSelf.F.%tuple.type (%tuple.type.684) = value_param call_param0 -// CHECK:STDOUT: %.loc238_38.1: type = splice_block %.loc238_38.3 [symbolic = %tuple.type (constants.%tuple.type.684)] { -// CHECK:STDOUT: %Self.ref.loc238_12: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.e81)] -// CHECK:STDOUT: %Self.as_type.loc238_16.2: type = facet_access_type %Self.ref.loc238_12 [symbolic = %Self.as_type.loc238_16.1 (constants.%Self.as_type.8ab)] -// CHECK:STDOUT: %.loc238_16: type = converted %Self.ref.loc238_12, %Self.as_type.loc238_16.2 [symbolic = %Self.as_type.loc238_16.1 (constants.%Self.as_type.8ab)] -// CHECK:STDOUT: %ptr.loc238_16.2: type = ptr_type %.loc238_16 [symbolic = %ptr.loc238_16.1 (constants.%ptr.a16)] -// CHECK:STDOUT: %Self.ref.loc238_24: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.e81)] -// CHECK:STDOUT: %Self.as_type.loc238_24: type = facet_access_type %Self.ref.loc238_24 [symbolic = %Self.as_type.loc238_16.1 (constants.%Self.as_type.8ab)] -// CHECK:STDOUT: %.loc238_24: type = converted %Self.ref.loc238_24, %Self.as_type.loc238_24 [symbolic = %Self.as_type.loc238_16.1 (constants.%Self.as_type.8ab)] +// CHECK:STDOUT: %.loc224_38.1: type = splice_block %.loc224_38.3 [symbolic = %tuple.type (constants.%tuple.type.684)] { +// CHECK:STDOUT: %Self.ref.loc224_12: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.e81)] +// CHECK:STDOUT: %Self.as_type.loc224_16.2: type = facet_access_type %Self.ref.loc224_12 [symbolic = %Self.as_type.loc224_16.1 (constants.%Self.as_type.8ab)] +// CHECK:STDOUT: %.loc224_16: type = converted %Self.ref.loc224_12, %Self.as_type.loc224_16.2 [symbolic = %Self.as_type.loc224_16.1 (constants.%Self.as_type.8ab)] +// CHECK:STDOUT: %ptr.loc224_16.2: type = ptr_type %.loc224_16 [symbolic = %ptr.loc224_16.1 (constants.%ptr.a16)] +// CHECK:STDOUT: %Self.ref.loc224_24: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.e81)] +// CHECK:STDOUT: %Self.as_type.loc224_24: type = facet_access_type %Self.ref.loc224_24 [symbolic = %Self.as_type.loc224_16.1 (constants.%Self.as_type.8ab)] +// CHECK:STDOUT: %.loc224_24: type = converted %Self.ref.loc224_24, %Self.as_type.loc224_24 [symbolic = %Self.as_type.loc224_16.1 (constants.%Self.as_type.8ab)] // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %struct_type.x.y.loc238_37.2: type = struct_type {.x: @SelfNested.WithSelf.F.%Self.as_type.loc238_16.1 (%Self.as_type.8ab), .y: %i32} [symbolic = %struct_type.x.y.loc238_37.1 (constants.%struct_type.x.y.34d)] -// CHECK:STDOUT: %.loc238_38.2: %tuple.type.693 = tuple_literal (%ptr.loc238_16.2, %struct_type.x.y.loc238_37.2) [symbolic = %tuple (constants.%tuple.ea4)] -// CHECK:STDOUT: %.loc238_38.3: type = converted %.loc238_38.2, constants.%tuple.type.684 [symbolic = %tuple.type (constants.%tuple.type.684)] +// CHECK:STDOUT: %struct_type.x.y.loc224_37.2: type = struct_type {.x: @SelfNested.WithSelf.F.%Self.as_type.loc224_16.1 (%Self.as_type.8ab), .y: %i32} [symbolic = %struct_type.x.y.loc224_37.1 (constants.%struct_type.x.y.34d)] +// CHECK:STDOUT: %.loc224_38.2: %tuple.type.693 = tuple_literal (%ptr.loc224_16.2, %struct_type.x.y.loc224_37.2) [symbolic = %tuple (constants.%tuple.ea4)] +// CHECK:STDOUT: %.loc224_38.3: type = converted %.loc224_38.2, constants.%tuple.type.684 [symbolic = %tuple.type (constants.%tuple.type.684)] // CHECK:STDOUT: } // CHECK:STDOUT: %x: @SelfNested.WithSelf.F.%tuple.type (%tuple.type.684) = wrapper_binding x, %x.param -// CHECK:STDOUT: %return.param: ref @SelfNested.WithSelf.F.%Array.loc238_57.1 (%Array.d32) = out_param call_param1 -// CHECK:STDOUT: %return: ref @SelfNested.WithSelf.F.%Array.loc238_57.1 (%Array.d32) = return_slot %return.param +// CHECK:STDOUT: %return.param: ref @SelfNested.WithSelf.F.%Array.loc224_57.1 (%Array.d32) = out_param call_param1 +// CHECK:STDOUT: %return: ref @SelfNested.WithSelf.F.%Array.loc224_57.1 (%Array.d32) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %SelfNested.assoc_type = assoc_entity element0, %SelfNested.WithSelf.F.decl [concrete = constants.%assoc0.5a5] // CHECK:STDOUT: @@ -680,26 +660,26 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FExtraParam.as.I.impl: %Self.ref as %I.ref { -// CHECK:STDOUT: %FExtraParam.as.I.impl.F.decl.loc66_18.1: %FExtraParam.as.I.impl.F.type.ec7b0b.1 = fn_decl @FExtraParam.as.I.impl.F.loc66_18.1 [concrete = constants.%FExtraParam.as.I.impl.F.ef9801.1] { +// CHECK:STDOUT: %FExtraParam.as.I.impl.F.decl.loc65_18.1: %FExtraParam.as.I.impl.F.type.ec7b0b.1 = fn_decl @FExtraParam.as.I.impl.F.loc65_18.1 [concrete = constants.%FExtraParam.as.I.impl.F.ef9801.1] { // CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern [concrete = constants.%b.param_patt.792] // CHECK:STDOUT: %b.patt: %pattern_type.831 = wrapper_binding_pattern b, %b.param_patt [concrete = constants.%b.patt.d80] // CHECK:STDOUT: } { // CHECK:STDOUT: %b.param: bool = value_param call_param0 -// CHECK:STDOUT: %.loc66: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc65: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %b: bool = wrapper_binding b, %b.param // CHECK:STDOUT: } -// CHECK:STDOUT: %FExtraParam.as.I.impl.F.decl.loc66_18.2: %FExtraParam.as.I.impl.F.type.ec7b0b.2 = fn_decl @FExtraParam.as.I.impl.F.loc66_18.2 [concrete = constants.%FExtraParam.as.I.impl.F.ef9801.2] {} {} -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%FExtraParam.as.I.impl.F.decl.loc66_18.2), @FExtraParam.as.I.impl [concrete] +// CHECK:STDOUT: %FExtraParam.as.I.impl.F.decl.loc65_18.2: %FExtraParam.as.I.impl.F.type.ec7b0b.2 = fn_decl @FExtraParam.as.I.impl.F.loc65_18.2 [concrete = constants.%FExtraParam.as.I.impl.F.ef9801.2] {} {} +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%FExtraParam.as.I.impl.F.decl.loc65_18.2), @FExtraParam.as.I.impl [concrete] // CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.0d1] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %FExtraParam.as.I.impl.F.decl.loc66_18.1 +// CHECK:STDOUT: .F = %FExtraParam.as.I.impl.F.decl.loc65_18.1 // CHECK:STDOUT: extend %I.ref // CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FExtraImplicitParam.as.I.impl: %Self.ref as %I.ref { -// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.decl.loc85_15.1: %FExtraImplicitParam.as.I.impl.F.type.54cac2.1 = fn_decl @FExtraImplicitParam.as.I.impl.F.loc85_15.1 [concrete = constants.%FExtraImplicitParam.as.I.impl.F.a42f35.1] { +// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.decl.loc83_15.1: %FExtraImplicitParam.as.I.impl.F.type.54cac2.1 = fn_decl @FExtraImplicitParam.as.I.impl.F.loc83_15.1 [concrete = constants.%FExtraImplicitParam.as.I.impl.F.a42f35.1] { // CHECK:STDOUT: %self.param_patt: %pattern_type.54d = value_param_pattern [concrete = constants.%self.param_patt.f41] // CHECK:STDOUT: %self.patt: %pattern_type.54d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cca] // CHECK:STDOUT: } { @@ -707,12 +687,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraImplicitParam [concrete = constants.%FExtraImplicitParam] // CHECK:STDOUT: %self: %FExtraImplicitParam = wrapper_binding self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.decl.loc85_15.2: %FExtraImplicitParam.as.I.impl.F.type.54cac2.2 = fn_decl @FExtraImplicitParam.as.I.impl.F.loc85_15.2 [concrete = constants.%FExtraImplicitParam.as.I.impl.F.a42f35.2] {} {} -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%FExtraImplicitParam.as.I.impl.F.decl.loc85_15.2), @FExtraImplicitParam.as.I.impl [concrete] +// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.decl.loc83_15.2: %FExtraImplicitParam.as.I.impl.F.type.54cac2.2 = fn_decl @FExtraImplicitParam.as.I.impl.F.loc83_15.2 [concrete = constants.%FExtraImplicitParam.as.I.impl.F.a42f35.2] {} {} +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%FExtraImplicitParam.as.I.impl.F.decl.loc83_15.2), @FExtraImplicitParam.as.I.impl [concrete] // CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.989] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %FExtraImplicitParam.as.I.impl.F.decl.loc85_15.1 +// CHECK:STDOUT: .F = %FExtraImplicitParam.as.I.impl.F.decl.loc83_15.1 // CHECK:STDOUT: extend %I.ref // CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } @@ -720,10 +700,10 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl @FExtraReturnType.as.I.impl: %Self.ref as %I.ref { // CHECK:STDOUT: %FExtraReturnType.as.I.impl.F.decl: %FExtraReturnType.as.I.impl.F.type = fn_decl @FExtraReturnType.as.I.impl.F [concrete = constants.%FExtraReturnType.as.I.impl.F] { // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt.5a1] -// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc104_15.1 [concrete = constants.%return.patt.c0c] +// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc102_15.1 [concrete = constants.%return.patt.c0c] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc104_15.1: type = type_literal bool [concrete = bool] -// CHECK:STDOUT: %.loc104_15.2: Core.Form = init_form %.loc104_15.1 [concrete = constants.%.f34] +// CHECK:STDOUT: %.loc102_15.1: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc102_15.2: Core.Form = init_form %.loc102_15.1 [concrete = constants.%.f34] // CHECK:STDOUT: %return.param: ref bool = out_param call_param0 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } @@ -737,23 +717,23 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FMissingParam.as.J.impl: %Self.ref as %J.ref { -// CHECK:STDOUT: %FMissingParam.as.J.impl.F.decl.loc125_29.1: %FMissingParam.as.J.impl.F.type.aad6ec.1 = fn_decl @FMissingParam.as.J.impl.F.loc125_29.1 [concrete = constants.%FMissingParam.as.J.impl.F.dd09dc.1] { +// CHECK:STDOUT: %FMissingParam.as.J.impl.F.decl.loc122_29.1: %FMissingParam.as.J.impl.F.type.aad6ec.1 = fn_decl @FMissingParam.as.J.impl.F.loc122_29.1 [concrete = constants.%FMissingParam.as.J.impl.F.dd09dc.1] { // CHECK:STDOUT: %self.param_patt: %pattern_type.831 = value_param_pattern [concrete = constants.%self.param_patt.210] // CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3a9] // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt.5a1] -// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc125_25.1 [concrete = constants.%return.patt.c0c] +// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc122_25.1 [concrete = constants.%return.patt.c0c] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc125_25.1: type = type_literal bool [concrete = bool] -// CHECK:STDOUT: %.loc125_25.2: Core.Form = init_form %.loc125_25.1 [concrete = constants.%.f34] +// CHECK:STDOUT: %.loc122_25.1: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc122_25.2: Core.Form = init_form %.loc122_25.1 [concrete = constants.%.f34] // CHECK:STDOUT: %self.param: bool = value_param call_param0 -// CHECK:STDOUT: %.loc125_16: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc122_16: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %self: bool = wrapper_binding self, %self.param // CHECK:STDOUT: %return.param: ref bool = out_param call_param1 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc108_44.1: type = specific_constant @J.WithSelf.F.%.loc108_44.1, @J.WithSelf.F(constants.%J.facet.2a3) [concrete = bool] -// CHECK:STDOUT: %.loc108_44.2: Core.Form = specific_constant @J.WithSelf.F.%.loc108_44.2, @J.WithSelf.F(constants.%J.facet.2a3) [concrete = constants.%.f34] -// CHECK:STDOUT: %FMissingParam.as.J.impl.F.decl.loc125_29.2: %FMissingParam.as.J.impl.F.type.aad6ec.2 = fn_decl @FMissingParam.as.J.impl.F.loc125_29.2 [concrete = constants.%FMissingParam.as.J.impl.F.dd09dc.2] { +// CHECK:STDOUT: %.loc106_44.1: type = specific_constant @J.WithSelf.F.%.loc106_44.1, @J.WithSelf.F(constants.%J.facet.2a3) [concrete = bool] +// CHECK:STDOUT: %.loc106_44.2: Core.Form = specific_constant @J.WithSelf.F.%.loc106_44.2, @J.WithSelf.F(constants.%J.facet.2a3) [concrete = constants.%.f34] +// CHECK:STDOUT: %FMissingParam.as.J.impl.F.decl.loc122_29.2: %FMissingParam.as.J.impl.F.type.aad6ec.2 = fn_decl @FMissingParam.as.J.impl.F.loc122_29.2 [concrete = constants.%FMissingParam.as.J.impl.F.dd09dc.2] { // CHECK:STDOUT: %.1: %pattern_type.831 = specific_constant constants.%self.param_patt.210, @J.WithSelf.F(constants.%J.facet.2a3) [concrete = constants.%self.param_patt.210] // CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %.1 [concrete = constants.%self.patt.3a9] // CHECK:STDOUT: %.2: %pattern_type.831 = specific_constant constants.%b.param_patt.792, @J.WithSelf.F(constants.%J.facet.2a3) [concrete = constants.%b.param_patt.792] @@ -767,33 +747,33 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FMissingParam.as.J.impl.F.decl.loc125_29.2), @FMissingParam.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FMissingParam.as.J.impl.F.decl.loc122_29.2), @FMissingParam.as.J.impl [concrete] // CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.24e] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %FMissingParam.as.J.impl.F.decl.loc125_29.1 +// CHECK:STDOUT: .F = %FMissingParam.as.J.impl.F.decl.loc122_29.1 // CHECK:STDOUT: extend %J.ref // CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FMissingImplicitParam.as.J.impl: %Self.ref as %J.ref { -// CHECK:STDOUT: %FMissingImplicitParam.as.J.impl.F.decl.loc144_26.1: %FMissingImplicitParam.as.J.impl.F.type.f666a8.1 = fn_decl @FMissingImplicitParam.as.J.impl.F.loc144_26.1 [concrete = constants.%FMissingImplicitParam.as.J.impl.F.620ed1.1] { +// CHECK:STDOUT: %FMissingImplicitParam.as.J.impl.F.decl.loc141_26.1: %FMissingImplicitParam.as.J.impl.F.type.f666a8.1 = fn_decl @FMissingImplicitParam.as.J.impl.F.loc141_26.1 [concrete = constants.%FMissingImplicitParam.as.J.impl.F.620ed1.1] { // CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern [concrete = constants.%b.param_patt.792] // CHECK:STDOUT: %b.patt: %pattern_type.831 = wrapper_binding_pattern b, %b.param_patt [concrete = constants.%b.patt.d80] // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt.5a1] -// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc144_22.1 [concrete = constants.%return.patt.c0c] +// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc141_22.1 [concrete = constants.%return.patt.c0c] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc144_22.1: type = type_literal bool [concrete = bool] -// CHECK:STDOUT: %.loc144_22.2: Core.Form = init_form %.loc144_22.1 [concrete = constants.%.f34] +// CHECK:STDOUT: %.loc141_22.1: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc141_22.2: Core.Form = init_form %.loc141_22.1 [concrete = constants.%.f34] // CHECK:STDOUT: %b.param: bool = value_param call_param0 -// CHECK:STDOUT: %.loc144_13: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc141_13: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %b: bool = wrapper_binding b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param call_param1 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc108_44.1: type = specific_constant @J.WithSelf.F.%.loc108_44.1, @J.WithSelf.F(constants.%J.facet.ba1) [concrete = bool] -// CHECK:STDOUT: %.loc108_44.2: Core.Form = specific_constant @J.WithSelf.F.%.loc108_44.2, @J.WithSelf.F(constants.%J.facet.ba1) [concrete = constants.%.f34] -// CHECK:STDOUT: %FMissingImplicitParam.as.J.impl.F.decl.loc144_26.2: %FMissingImplicitParam.as.J.impl.F.type.f666a8.2 = fn_decl @FMissingImplicitParam.as.J.impl.F.loc144_26.2 [concrete = constants.%FMissingImplicitParam.as.J.impl.F.620ed1.2] { +// CHECK:STDOUT: %.loc106_44.1: type = specific_constant @J.WithSelf.F.%.loc106_44.1, @J.WithSelf.F(constants.%J.facet.ba1) [concrete = bool] +// CHECK:STDOUT: %.loc106_44.2: Core.Form = specific_constant @J.WithSelf.F.%.loc106_44.2, @J.WithSelf.F(constants.%J.facet.ba1) [concrete = constants.%.f34] +// CHECK:STDOUT: %FMissingImplicitParam.as.J.impl.F.decl.loc141_26.2: %FMissingImplicitParam.as.J.impl.F.type.f666a8.2 = fn_decl @FMissingImplicitParam.as.J.impl.F.loc141_26.2 [concrete = constants.%FMissingImplicitParam.as.J.impl.F.620ed1.2] { // CHECK:STDOUT: %.1: %pattern_type.831 = specific_constant constants.%self.param_patt.210, @J.WithSelf.F(constants.%J.facet.ba1) [concrete = constants.%self.param_patt.210] // CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %.1 [concrete = constants.%self.patt.3a9] // CHECK:STDOUT: %.2: %pattern_type.831 = specific_constant constants.%b.param_patt.792, @J.WithSelf.F(constants.%J.facet.ba1) [concrete = constants.%b.param_patt.792] @@ -807,32 +787,32 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FMissingImplicitParam.as.J.impl.F.decl.loc144_26.2), @FMissingImplicitParam.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FMissingImplicitParam.as.J.impl.F.decl.loc141_26.2), @FMissingImplicitParam.as.J.impl [concrete] // CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.0d0] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %FMissingImplicitParam.as.J.impl.F.decl.loc144_26.1 +// CHECK:STDOUT: .F = %FMissingImplicitParam.as.J.impl.F.decl.loc141_26.1 // CHECK:STDOUT: extend %J.ref // CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FMissingReturnType.as.J.impl: %Self.ref as %J.ref { -// CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.decl.loc164_30.1: %FMissingReturnType.as.J.impl.F.type.9cd56a.1 = fn_decl @FMissingReturnType.as.J.impl.F.loc164_30.1 [concrete = constants.%FMissingReturnType.as.J.impl.F.6975be.1] { +// CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.decl.loc159_30.1: %FMissingReturnType.as.J.impl.F.type.9cd56a.1 = fn_decl @FMissingReturnType.as.J.impl.F.loc159_30.1 [concrete = constants.%FMissingReturnType.as.J.impl.F.6975be.1] { // CHECK:STDOUT: %self.param_patt: %pattern_type.831 = value_param_pattern [concrete = constants.%self.param_patt.210] // CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3a9] // CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern [concrete = constants.%b.param_patt.792] // CHECK:STDOUT: %b.patt: %pattern_type.831 = wrapper_binding_pattern b, %b.param_patt [concrete = constants.%b.patt.d80] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: bool = value_param call_param0 -// CHECK:STDOUT: %.loc164_16: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc159_16: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %self: bool = wrapper_binding self, %self.param // CHECK:STDOUT: %b.param: bool = value_param call_param1 -// CHECK:STDOUT: %.loc164_25: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc159_25: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %b: bool = wrapper_binding b, %b.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc108_44.1: type = specific_constant @J.WithSelf.F.%.loc108_44.1, @J.WithSelf.F(constants.%J.facet.b68) [concrete = bool] -// CHECK:STDOUT: %.loc108_44.2: Core.Form = specific_constant @J.WithSelf.F.%.loc108_44.2, @J.WithSelf.F(constants.%J.facet.b68) [concrete = constants.%.f34] -// CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.decl.loc164_30.2: %FMissingReturnType.as.J.impl.F.type.9cd56a.2 = fn_decl @FMissingReturnType.as.J.impl.F.loc164_30.2 [concrete = constants.%FMissingReturnType.as.J.impl.F.6975be.2] { +// CHECK:STDOUT: %.loc106_44.1: type = specific_constant @J.WithSelf.F.%.loc106_44.1, @J.WithSelf.F(constants.%J.facet.b68) [concrete = bool] +// CHECK:STDOUT: %.loc106_44.2: Core.Form = specific_constant @J.WithSelf.F.%.loc106_44.2, @J.WithSelf.F(constants.%J.facet.b68) [concrete = constants.%.f34] +// CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.decl.loc159_30.2: %FMissingReturnType.as.J.impl.F.type.9cd56a.2 = fn_decl @FMissingReturnType.as.J.impl.F.loc159_30.2 [concrete = constants.%FMissingReturnType.as.J.impl.F.6975be.2] { // CHECK:STDOUT: %.1: %pattern_type.831 = specific_constant constants.%self.param_patt.210, @J.WithSelf.F(constants.%J.facet.b68) [concrete = constants.%self.param_patt.210] // CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %.1 [concrete = constants.%self.patt.3a9] // CHECK:STDOUT: %.2: %pattern_type.831 = specific_constant constants.%b.param_patt.792, @J.WithSelf.F(constants.%J.facet.b68) [concrete = constants.%b.param_patt.792] @@ -846,28 +826,28 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FMissingReturnType.as.J.impl.F.decl.loc164_30.2), @FMissingReturnType.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FMissingReturnType.as.J.impl.F.decl.loc159_30.2), @FMissingReturnType.as.J.impl [concrete] // CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.50a] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %FMissingReturnType.as.J.impl.F.decl.loc164_30.1 +// CHECK:STDOUT: .F = %FMissingReturnType.as.J.impl.F.decl.loc159_30.1 // CHECK:STDOUT: extend %J.ref // CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FDifferentParamType.as.J.impl: %Self.ref as %J.ref { -// CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.decl.loc188_38.1: %FDifferentParamType.as.J.impl.F.type.4a2e9b.1 = fn_decl @FDifferentParamType.as.J.impl.F.loc188_38.1 [concrete = constants.%FDifferentParamType.as.J.impl.F.28602a.1] { +// CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.decl.loc180_38.1: %FDifferentParamType.as.J.impl.F.type.4a2e9b.1 = fn_decl @FDifferentParamType.as.J.impl.F.loc180_38.1 [concrete = constants.%FDifferentParamType.as.J.impl.F.28602a.1] { // CHECK:STDOUT: %self.param_patt: %pattern_type.831 = value_param_pattern [concrete = constants.%self.param_patt.210] // CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3a9] // CHECK:STDOUT: %b.param_patt: %pattern_type.5d3 = value_param_pattern [concrete = constants.%b.param_patt.0a8] // CHECK:STDOUT: %b.patt: %pattern_type.5d3 = wrapper_binding_pattern b, %b.param_patt [concrete = constants.%b.patt.f7e] // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt.5a1] -// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc188_34.1 [concrete = constants.%return.patt.c0c] +// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc180_34.1 [concrete = constants.%return.patt.c0c] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc188_34.1: type = type_literal bool [concrete = bool] -// CHECK:STDOUT: %.loc188_34.2: Core.Form = init_form %.loc188_34.1 [concrete = constants.%.f34] +// CHECK:STDOUT: %.loc180_34.1: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc180_34.2: Core.Form = init_form %.loc180_34.1 [concrete = constants.%.f34] // CHECK:STDOUT: %self.param: bool = value_param call_param0 -// CHECK:STDOUT: %.loc188_16: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc180_16: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %self: bool = wrapper_binding self, %self.param // CHECK:STDOUT: %b.param: %FDifferentParamType = value_param call_param1 // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamType [concrete = constants.%FDifferentParamType] @@ -875,9 +855,9 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc108_44.1: type = specific_constant @J.WithSelf.F.%.loc108_44.1, @J.WithSelf.F(constants.%J.facet.73e) [concrete = bool] -// CHECK:STDOUT: %.loc108_44.2: Core.Form = specific_constant @J.WithSelf.F.%.loc108_44.2, @J.WithSelf.F(constants.%J.facet.73e) [concrete = constants.%.f34] -// CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.decl.loc188_38.2: %FDifferentParamType.as.J.impl.F.type.4a2e9b.2 = fn_decl @FDifferentParamType.as.J.impl.F.loc188_38.2 [concrete = constants.%FDifferentParamType.as.J.impl.F.28602a.2] { +// CHECK:STDOUT: %.loc106_44.1: type = specific_constant @J.WithSelf.F.%.loc106_44.1, @J.WithSelf.F(constants.%J.facet.73e) [concrete = bool] +// CHECK:STDOUT: %.loc106_44.2: Core.Form = specific_constant @J.WithSelf.F.%.loc106_44.2, @J.WithSelf.F(constants.%J.facet.73e) [concrete = constants.%.f34] +// CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.decl.loc180_38.2: %FDifferentParamType.as.J.impl.F.type.4a2e9b.2 = fn_decl @FDifferentParamType.as.J.impl.F.loc180_38.2 [concrete = constants.%FDifferentParamType.as.J.impl.F.28602a.2] { // CHECK:STDOUT: %.1: %pattern_type.831 = specific_constant constants.%self.param_patt.210, @J.WithSelf.F(constants.%J.facet.73e) [concrete = constants.%self.param_patt.210] // CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %.1 [concrete = constants.%self.patt.3a9] // CHECK:STDOUT: %.2: %pattern_type.831 = specific_constant constants.%b.param_patt.792, @J.WithSelf.F(constants.%J.facet.73e) [concrete = constants.%b.param_patt.792] @@ -891,38 +871,38 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FDifferentParamType.as.J.impl.F.decl.loc188_38.2), @FDifferentParamType.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FDifferentParamType.as.J.impl.F.decl.loc180_38.2), @FDifferentParamType.as.J.impl [concrete] // CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.9e2] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %FDifferentParamType.as.J.impl.F.decl.loc188_38.1 +// CHECK:STDOUT: .F = %FDifferentParamType.as.J.impl.F.decl.loc180_38.1 // CHECK:STDOUT: extend %J.ref // CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FDifferentImplicitParamType.as.J.impl: %Self.ref as %J.ref { -// CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.decl.loc211_32.1: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.1 = fn_decl @FDifferentImplicitParamType.as.J.impl.F.loc211_32.1 [concrete = constants.%FDifferentImplicitParamType.as.J.impl.F.792c78.1] { +// CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.decl.loc200_32.1: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.1 = fn_decl @FDifferentImplicitParamType.as.J.impl.F.loc200_32.1 [concrete = constants.%FDifferentImplicitParamType.as.J.impl.F.792c78.1] { // CHECK:STDOUT: %self.param_patt: %pattern_type.1bc = value_param_pattern [concrete = constants.%self.param_patt.ea6] // CHECK:STDOUT: %self.patt: %pattern_type.1bc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.85b] // CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern [concrete = constants.%b.param_patt.792] // CHECK:STDOUT: %b.patt: %pattern_type.831 = wrapper_binding_pattern b, %b.param_patt [concrete = constants.%b.patt.d80] // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt.5a1] -// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc211_28.1 [concrete = constants.%return.patt.c0c] +// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc200_28.1 [concrete = constants.%return.patt.c0c] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc211_28.1: type = type_literal bool [concrete = bool] -// CHECK:STDOUT: %.loc211_28.2: Core.Form = init_form %.loc211_28.1 [concrete = constants.%.f34] +// CHECK:STDOUT: %.loc200_28.1: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc200_28.2: Core.Form = init_form %.loc200_28.1 [concrete = constants.%.f34] // CHECK:STDOUT: %self.param: %FDifferentImplicitParamType = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentImplicitParamType [concrete = constants.%FDifferentImplicitParamType] // CHECK:STDOUT: %self: %FDifferentImplicitParamType = wrapper_binding self, %self.param // CHECK:STDOUT: %b.param: bool = value_param call_param1 -// CHECK:STDOUT: %.loc211_19: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc200_19: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %b: bool = wrapper_binding b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc108_44.1: type = specific_constant @J.WithSelf.F.%.loc108_44.1, @J.WithSelf.F(constants.%J.facet.00a) [concrete = bool] -// CHECK:STDOUT: %.loc108_44.2: Core.Form = specific_constant @J.WithSelf.F.%.loc108_44.2, @J.WithSelf.F(constants.%J.facet.00a) [concrete = constants.%.f34] -// CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.decl.loc211_32.2: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.2 = fn_decl @FDifferentImplicitParamType.as.J.impl.F.loc211_32.2 [concrete = constants.%FDifferentImplicitParamType.as.J.impl.F.792c78.2] { +// CHECK:STDOUT: %.loc106_44.1: type = specific_constant @J.WithSelf.F.%.loc106_44.1, @J.WithSelf.F(constants.%J.facet.00a) [concrete = bool] +// CHECK:STDOUT: %.loc106_44.2: Core.Form = specific_constant @J.WithSelf.F.%.loc106_44.2, @J.WithSelf.F(constants.%J.facet.00a) [concrete = constants.%.f34] +// CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.decl.loc200_32.2: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.2 = fn_decl @FDifferentImplicitParamType.as.J.impl.F.loc200_32.2 [concrete = constants.%FDifferentImplicitParamType.as.J.impl.F.792c78.2] { // CHECK:STDOUT: %.1: %pattern_type.831 = specific_constant constants.%self.param_patt.210, @J.WithSelf.F(constants.%J.facet.00a) [concrete = constants.%self.param_patt.210] // CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %.1 [concrete = constants.%self.patt.3a9] // CHECK:STDOUT: %.2: %pattern_type.831 = specific_constant constants.%b.param_patt.792, @J.WithSelf.F(constants.%J.facet.00a) [concrete = constants.%b.param_patt.792] @@ -936,17 +916,17 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FDifferentImplicitParamType.as.J.impl.F.decl.loc211_32.2), @FDifferentImplicitParamType.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FDifferentImplicitParamType.as.J.impl.F.decl.loc200_32.2), @FDifferentImplicitParamType.as.J.impl [concrete] // CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.d1a] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %FDifferentImplicitParamType.as.J.impl.F.decl.loc211_32.1 +// CHECK:STDOUT: .F = %FDifferentImplicitParamType.as.J.impl.F.decl.loc200_32.1 // CHECK:STDOUT: extend %J.ref // CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FDifferentReturnType.as.J.impl: %Self.ref as %J.ref { -// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.decl.loc233_38.1: %FDifferentReturnType.as.J.impl.F.type.ff55f4.1 = fn_decl @FDifferentReturnType.as.J.impl.F.loc233_38.1 [concrete = constants.%FDifferentReturnType.as.J.impl.F.9725a5.1] { +// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.decl.loc219_38.1: %FDifferentReturnType.as.J.impl.F.type.ff55f4.1 = fn_decl @FDifferentReturnType.as.J.impl.F.loc219_38.1 [concrete = constants.%FDifferentReturnType.as.J.impl.F.9725a5.1] { // CHECK:STDOUT: %self.param_patt: %pattern_type.831 = value_param_pattern [concrete = constants.%self.param_patt.210] // CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3a9] // CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern [concrete = constants.%b.param_patt.792] @@ -955,19 +935,19 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.patt: %pattern_type.b9f = return_slot_pattern %return.param_patt, %Self.ref [concrete = constants.%return.patt.e4f] // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentReturnType [concrete = constants.%FDifferentReturnType] -// CHECK:STDOUT: %.loc233_34: Core.Form = init_form %Self.ref [concrete = constants.%.1f5] +// CHECK:STDOUT: %.loc219_34: Core.Form = init_form %Self.ref [concrete = constants.%.1f5] // CHECK:STDOUT: %self.param: bool = value_param call_param0 -// CHECK:STDOUT: %.loc233_16: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc219_16: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %self: bool = wrapper_binding self, %self.param // CHECK:STDOUT: %b.param: bool = value_param call_param1 -// CHECK:STDOUT: %.loc233_25: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc219_25: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %b: bool = wrapper_binding b, %b.param // CHECK:STDOUT: %return.param: ref %FDifferentReturnType = out_param call_param2 // CHECK:STDOUT: %return: ref %FDifferentReturnType = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc108_44.1: type = specific_constant @J.WithSelf.F.%.loc108_44.1, @J.WithSelf.F(constants.%J.facet.6a7) [concrete = bool] -// CHECK:STDOUT: %.loc108_44.2: Core.Form = specific_constant @J.WithSelf.F.%.loc108_44.2, @J.WithSelf.F(constants.%J.facet.6a7) [concrete = constants.%.f34] -// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.decl.loc233_38.2: %FDifferentReturnType.as.J.impl.F.type.ff55f4.2 = fn_decl @FDifferentReturnType.as.J.impl.F.loc233_38.2 [concrete = constants.%FDifferentReturnType.as.J.impl.F.9725a5.2] { +// CHECK:STDOUT: %.loc106_44.1: type = specific_constant @J.WithSelf.F.%.loc106_44.1, @J.WithSelf.F(constants.%J.facet.6a7) [concrete = bool] +// CHECK:STDOUT: %.loc106_44.2: Core.Form = specific_constant @J.WithSelf.F.%.loc106_44.2, @J.WithSelf.F(constants.%J.facet.6a7) [concrete = constants.%.f34] +// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.decl.loc219_38.2: %FDifferentReturnType.as.J.impl.F.type.ff55f4.2 = fn_decl @FDifferentReturnType.as.J.impl.F.loc219_38.2 [concrete = constants.%FDifferentReturnType.as.J.impl.F.9725a5.2] { // CHECK:STDOUT: %.1: %pattern_type.831 = specific_constant constants.%self.param_patt.210, @J.WithSelf.F(constants.%J.facet.6a7) [concrete = constants.%self.param_patt.210] // CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %.1 [concrete = constants.%self.patt.3a9] // CHECK:STDOUT: %.2: %pattern_type.831 = specific_constant constants.%b.param_patt.792, @J.WithSelf.F(constants.%J.facet.6a7) [concrete = constants.%b.param_patt.792] @@ -981,43 +961,43 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FDifferentReturnType.as.J.impl.F.decl.loc233_38.2), @FDifferentReturnType.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FDifferentReturnType.as.J.impl.F.decl.loc219_38.2), @FDifferentReturnType.as.J.impl [concrete] // CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.6a4] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %FDifferentReturnType.as.J.impl.F.decl.loc233_38.1 +// CHECK:STDOUT: .F = %FDifferentReturnType.as.J.impl.F.decl.loc219_38.1 // CHECK:STDOUT: extend %J.ref // CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @SelfNestedBadParam.as.SelfNested.impl: %Self.ref as %SelfNested.ref { -// CHECK:STDOUT: %SelfNestedBadParam.as.SelfNested.impl.F.decl.loc260_87.1: %SelfNestedBadParam.as.SelfNested.impl.F.type.4325e7.1 = fn_decl @SelfNestedBadParam.as.SelfNested.impl.F.loc260_87.1 [concrete = constants.%SelfNestedBadParam.as.SelfNested.impl.F.5fd896.1] { +// CHECK:STDOUT: %SelfNestedBadParam.as.SelfNested.impl.F.decl.loc243_87.1: %SelfNestedBadParam.as.SelfNested.impl.F.type.4325e7.1 = fn_decl @SelfNestedBadParam.as.SelfNested.impl.F.loc243_87.1 [concrete = constants.%SelfNestedBadParam.as.SelfNested.impl.F.5fd896.1] { // CHECK:STDOUT: %x.param_patt: %pattern_type.f03 = value_param_pattern [concrete = constants.%x.param_patt.95a] // CHECK:STDOUT: %x.patt: %pattern_type.f03 = wrapper_binding_pattern x, %x.param_patt [concrete = constants.%x.patt.23c] // CHECK:STDOUT: %return.param_patt: %pattern_type.ec1 = out_param_pattern [concrete = constants.%return.param_patt.8ed] // CHECK:STDOUT: %return.patt: %pattern_type.ec1 = return_slot_pattern %return.param_patt, %Array [concrete = constants.%return.patt.21a] // CHECK:STDOUT: } { -// CHECK:STDOUT: %SelfNestedBadParam.ref.loc260_65: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [concrete = constants.%SelfNestedBadParam] +// CHECK:STDOUT: %SelfNestedBadParam.ref.loc243_65: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [concrete = constants.%SelfNestedBadParam] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4] // CHECK:STDOUT: %Array: type = class_type @Array, @Array(constants.%SelfNestedBadParam, constants.%int_4) [concrete = constants.%Array.870] -// CHECK:STDOUT: %.loc260_86: Core.Form = init_form %Array [concrete = constants.%.a71] +// CHECK:STDOUT: %.loc243_86: Core.Form = init_form %Array [concrete = constants.%.a71] // CHECK:STDOUT: %x.param: %tuple.type.f65 = value_param call_param0 -// CHECK:STDOUT: %.loc260_53.1: type = splice_block %.loc260_53.3 [concrete = constants.%tuple.type.f65] { -// CHECK:STDOUT: %SelfNestedBadParam.ref.loc260_14: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [concrete = constants.%SelfNestedBadParam] -// CHECK:STDOUT: %ptr: type = ptr_type %SelfNestedBadParam.ref.loc260_14 [concrete = constants.%ptr.52e] -// CHECK:STDOUT: %i32.loc260_40: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %i32.loc260_49: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %.loc243_53.1: type = splice_block %.loc243_53.3 [concrete = constants.%tuple.type.f65] { +// CHECK:STDOUT: %SelfNestedBadParam.ref.loc243_14: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [concrete = constants.%SelfNestedBadParam] +// CHECK:STDOUT: %ptr: type = ptr_type %SelfNestedBadParam.ref.loc243_14 [concrete = constants.%ptr.52e] +// CHECK:STDOUT: %i32.loc243_40: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %i32.loc243_49: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %struct_type.x.y: type = struct_type {.x: %i32, .y: %i32} [concrete = constants.%struct_type.x.y.d8c] -// CHECK:STDOUT: %.loc260_53.2: %tuple.type.693 = tuple_literal (%ptr, %struct_type.x.y) [concrete = constants.%tuple.60a] -// CHECK:STDOUT: %.loc260_53.3: type = converted %.loc260_53.2, constants.%tuple.type.f65 [concrete = constants.%tuple.type.f65] +// CHECK:STDOUT: %.loc243_53.2: %tuple.type.693 = tuple_literal (%ptr, %struct_type.x.y) [concrete = constants.%tuple.60a] +// CHECK:STDOUT: %.loc243_53.3: type = converted %.loc243_53.2, constants.%tuple.type.f65 [concrete = constants.%tuple.type.f65] // CHECK:STDOUT: } // CHECK:STDOUT: %x: %tuple.type.f65 = wrapper_binding x, %x.param // CHECK:STDOUT: %return.param: ref %Array.870 = out_param call_param1 // CHECK:STDOUT: %return: ref %Array.870 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc238_57.1: type = specific_constant @SelfNested.WithSelf.F.%Array.loc238_57.2, @SelfNested.WithSelf.F(constants.%SelfNested.facet.d0d) [concrete = constants.%Array.870] -// CHECK:STDOUT: %.loc238_57.2: Core.Form = specific_constant @SelfNested.WithSelf.F.%.loc238_57.2, @SelfNested.WithSelf.F(constants.%SelfNested.facet.d0d) [concrete = constants.%.a71] -// CHECK:STDOUT: %SelfNestedBadParam.as.SelfNested.impl.F.decl.loc260_87.2: %SelfNestedBadParam.as.SelfNested.impl.F.type.4325e7.2 = fn_decl @SelfNestedBadParam.as.SelfNested.impl.F.loc260_87.2 [concrete = constants.%SelfNestedBadParam.as.SelfNested.impl.F.5fd896.2] { +// CHECK:STDOUT: %.loc224_57.1: type = specific_constant @SelfNested.WithSelf.F.%Array.loc224_57.2, @SelfNested.WithSelf.F(constants.%SelfNested.facet.d0d) [concrete = constants.%Array.870] +// CHECK:STDOUT: %.loc224_57.2: Core.Form = specific_constant @SelfNested.WithSelf.F.%.loc224_57.2, @SelfNested.WithSelf.F(constants.%SelfNested.facet.d0d) [concrete = constants.%.a71] +// CHECK:STDOUT: %SelfNestedBadParam.as.SelfNested.impl.F.decl.loc243_87.2: %SelfNestedBadParam.as.SelfNested.impl.F.type.4325e7.2 = fn_decl @SelfNestedBadParam.as.SelfNested.impl.F.loc243_87.2 [concrete = constants.%SelfNestedBadParam.as.SelfNested.impl.F.5fd896.2] { // CHECK:STDOUT: %.1: %pattern_type.1ec = specific_constant constants.%x.param_patt.255, @SelfNested.WithSelf.F(constants.%SelfNested.facet.d0d) [concrete = constants.%x.param_patt.255] // CHECK:STDOUT: %x.patt: %pattern_type.1ec = wrapper_binding_pattern x, %.1 [concrete = constants.%x.patt.79a] // CHECK:STDOUT: %.2: %pattern_type.ec1 = specific_constant constants.%return.patt.21a, @SelfNested.WithSelf.F(constants.%SelfNested.facet.d0d) [concrete = constants.%return.patt.21a] @@ -1027,18 +1007,18 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref %Array.870 = out_param call_param1 // CHECK:STDOUT: %return: ref %Array.870 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %SelfNested.impl_witness_table = impl_witness_table (%SelfNestedBadParam.as.SelfNested.impl.F.decl.loc260_87.2), @SelfNestedBadParam.as.SelfNested.impl [concrete] +// CHECK:STDOUT: %SelfNested.impl_witness_table = impl_witness_table (%SelfNestedBadParam.as.SelfNested.impl.F.decl.loc243_87.2), @SelfNestedBadParam.as.SelfNested.impl [concrete] // CHECK:STDOUT: %SelfNested.impl_witness: = impl_witness %SelfNested.impl_witness_table [concrete = constants.%SelfNested.impl_witness.09d] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .SelfNestedBadParam = -// CHECK:STDOUT: .F = %SelfNestedBadParam.as.SelfNested.impl.F.decl.loc260_87.1 +// CHECK:STDOUT: .F = %SelfNestedBadParam.as.SelfNested.impl.F.decl.loc243_87.1 // CHECK:STDOUT: extend %SelfNested.ref // CHECK:STDOUT: witness = %SelfNested.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @SelfNestedBadReturnType.as.SelfNested.impl: %Self.ref as %SelfNested.ref { -// CHECK:STDOUT: %SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc283_112.1: %SelfNestedBadReturnType.as.SelfNested.impl.F.type.1cbabe.1 = fn_decl @SelfNestedBadReturnType.as.SelfNested.impl.F.loc283_112.1 [concrete = constants.%SelfNestedBadReturnType.as.SelfNested.impl.F.5a7d54.1] { +// CHECK:STDOUT: %SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc263_112.1: %SelfNestedBadReturnType.as.SelfNested.impl.F.type.1cbabe.1 = fn_decl @SelfNestedBadReturnType.as.SelfNested.impl.F.loc263_112.1 [concrete = constants.%SelfNestedBadReturnType.as.SelfNested.impl.F.5a7d54.1] { // CHECK:STDOUT: %x.param_patt: %pattern_type.7fc = value_param_pattern [concrete = constants.%x.param_patt.04c] // CHECK:STDOUT: %x.patt: %pattern_type.7fc = wrapper_binding_pattern x, %x.param_patt [concrete = constants.%x.patt.10a] // CHECK:STDOUT: %return.param_patt: %pattern_type.ec1 = out_param_pattern [concrete = constants.%return.param_patt.8ed] @@ -1047,24 +1027,24 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %SelfNestedBadParam.ref: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [concrete = constants.%SelfNestedBadParam] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4] // CHECK:STDOUT: %Array: type = class_type @Array, @Array(constants.%SelfNestedBadParam, constants.%int_4) [concrete = constants.%Array.870] -// CHECK:STDOUT: %.loc283_111: Core.Form = init_form %Array [concrete = constants.%.a71] +// CHECK:STDOUT: %.loc263_111: Core.Form = init_form %Array [concrete = constants.%.a71] // CHECK:STDOUT: %x.param: %tuple.type.dce = value_param call_param0 -// CHECK:STDOUT: %.loc283_78.1: type = splice_block %.loc283_78.3 [concrete = constants.%tuple.type.dce] { -// CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc283_14: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [concrete = constants.%SelfNestedBadReturnType] -// CHECK:STDOUT: %ptr: type = ptr_type %SelfNestedBadReturnType.ref.loc283_14 [concrete = constants.%ptr.f55] -// CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc283_45: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [concrete = constants.%SelfNestedBadReturnType] +// CHECK:STDOUT: %.loc263_78.1: type = splice_block %.loc263_78.3 [concrete = constants.%tuple.type.dce] { +// CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc263_14: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [concrete = constants.%SelfNestedBadReturnType] +// CHECK:STDOUT: %ptr: type = ptr_type %SelfNestedBadReturnType.ref.loc263_14 [concrete = constants.%ptr.f55] +// CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc263_45: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [concrete = constants.%SelfNestedBadReturnType] // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %struct_type.x.y: type = struct_type {.x: %SelfNestedBadReturnType, .y: %i32} [concrete = constants.%struct_type.x.y.03e] -// CHECK:STDOUT: %.loc283_78.2: %tuple.type.693 = tuple_literal (%ptr, %struct_type.x.y) [concrete = constants.%tuple.ef1] -// CHECK:STDOUT: %.loc283_78.3: type = converted %.loc283_78.2, constants.%tuple.type.dce [concrete = constants.%tuple.type.dce] +// CHECK:STDOUT: %.loc263_78.2: %tuple.type.693 = tuple_literal (%ptr, %struct_type.x.y) [concrete = constants.%tuple.ef1] +// CHECK:STDOUT: %.loc263_78.3: type = converted %.loc263_78.2, constants.%tuple.type.dce [concrete = constants.%tuple.type.dce] // CHECK:STDOUT: } // CHECK:STDOUT: %x: %tuple.type.dce = wrapper_binding x, %x.param // CHECK:STDOUT: %return.param: ref %Array.870 = out_param call_param1 // CHECK:STDOUT: %return: ref %Array.870 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc238_57.1: type = specific_constant @SelfNested.WithSelf.F.%Array.loc238_57.2, @SelfNested.WithSelf.F(constants.%SelfNested.facet.e71) [concrete = constants.%Array.ce4] -// CHECK:STDOUT: %.loc238_57.2: Core.Form = specific_constant @SelfNested.WithSelf.F.%.loc238_57.2, @SelfNested.WithSelf.F(constants.%SelfNested.facet.e71) [concrete = constants.%.069] -// CHECK:STDOUT: %SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc283_112.2: %SelfNestedBadReturnType.as.SelfNested.impl.F.type.1cbabe.2 = fn_decl @SelfNestedBadReturnType.as.SelfNested.impl.F.loc283_112.2 [concrete = constants.%SelfNestedBadReturnType.as.SelfNested.impl.F.5a7d54.2] { +// CHECK:STDOUT: %.loc224_57.1: type = specific_constant @SelfNested.WithSelf.F.%Array.loc224_57.2, @SelfNested.WithSelf.F(constants.%SelfNested.facet.e71) [concrete = constants.%Array.ce4] +// CHECK:STDOUT: %.loc224_57.2: Core.Form = specific_constant @SelfNested.WithSelf.F.%.loc224_57.2, @SelfNested.WithSelf.F(constants.%SelfNested.facet.e71) [concrete = constants.%.069] +// CHECK:STDOUT: %SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc263_112.2: %SelfNestedBadReturnType.as.SelfNested.impl.F.type.1cbabe.2 = fn_decl @SelfNestedBadReturnType.as.SelfNested.impl.F.loc263_112.2 [concrete = constants.%SelfNestedBadReturnType.as.SelfNested.impl.F.5a7d54.2] { // CHECK:STDOUT: %.1: %pattern_type.7fc = specific_constant constants.%x.param_patt.04c, @SelfNested.WithSelf.F(constants.%SelfNested.facet.e71) [concrete = constants.%x.param_patt.04c] // CHECK:STDOUT: %x.patt: %pattern_type.7fc = wrapper_binding_pattern x, %.1 [concrete = constants.%x.patt.10a] // CHECK:STDOUT: %.2: %pattern_type.5b0 = specific_constant constants.%return.patt.02d, @SelfNested.WithSelf.F(constants.%SelfNested.facet.e71) [concrete = constants.%return.patt.02d] @@ -1074,13 +1054,13 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref %Array.ce4 = out_param call_param1 // CHECK:STDOUT: %return: ref %Array.ce4 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %SelfNested.impl_witness_table = impl_witness_table (%SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc283_112.2), @SelfNestedBadReturnType.as.SelfNested.impl [concrete] +// CHECK:STDOUT: %SelfNested.impl_witness_table = impl_witness_table (%SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc263_112.2), @SelfNestedBadReturnType.as.SelfNested.impl [concrete] // CHECK:STDOUT: %SelfNested.impl_witness: = impl_witness %SelfNested.impl_witness_table [concrete = constants.%SelfNested.impl_witness.849] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .SelfNestedBadReturnType = // CHECK:STDOUT: .SelfNestedBadParam = -// CHECK:STDOUT: .F = %SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc283_112.1 +// CHECK:STDOUT: .F = %SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc263_112.1 // CHECK:STDOUT: extend %SelfNested.ref // CHECK:STDOUT: witness = %SelfNested.impl_witness // CHECK:STDOUT: } @@ -1134,7 +1114,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraImplicitParam [concrete = constants.%FExtraImplicitParam] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc71: = impl_self_witness @FExtraImplicitParam.as.I.impl.%Self.ref, @I [concrete = constants.%.77c] +// CHECK:STDOUT: %.loc70: = impl_self_witness @FExtraImplicitParam.as.I.impl.%Self.ref, @I [concrete = constants.%.77c] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -1148,7 +1128,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraReturnType [concrete = constants.%FExtraReturnType] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc91: = impl_self_witness @FExtraReturnType.as.I.impl.%Self.ref, @I [concrete = constants.%.ebd] +// CHECK:STDOUT: %.loc89: = impl_self_witness @FExtraReturnType.as.I.impl.%Self.ref, @I [concrete = constants.%.ebd] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -1162,7 +1142,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingParam [concrete = constants.%FMissingParam] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc111: = impl_self_witness @FMissingParam.as.J.impl.%Self.ref, @J [concrete = constants.%.599] +// CHECK:STDOUT: %.loc109: = impl_self_witness @FMissingParam.as.J.impl.%Self.ref, @J [concrete = constants.%.599] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -1176,7 +1156,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingImplicitParam [concrete = constants.%FMissingImplicitParam] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc130: = impl_self_witness @FMissingImplicitParam.as.J.impl.%Self.ref, @J [concrete = constants.%.f79] +// CHECK:STDOUT: %.loc127: = impl_self_witness @FMissingImplicitParam.as.J.impl.%Self.ref, @J [concrete = constants.%.f79] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -1190,7 +1170,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingReturnType [concrete = constants.%FMissingReturnType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc149: = impl_self_witness @FMissingReturnType.as.J.impl.%Self.ref, @J [concrete = constants.%.199] +// CHECK:STDOUT: %.loc146: = impl_self_witness @FMissingReturnType.as.J.impl.%Self.ref, @J [concrete = constants.%.199] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -1204,7 +1184,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamType [concrete = constants.%FDifferentParamType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc169: = impl_self_witness @FDifferentParamType.as.J.impl.%Self.ref, @J [concrete = constants.%.593] +// CHECK:STDOUT: %.loc164: = impl_self_witness @FDifferentParamType.as.J.impl.%Self.ref, @J [concrete = constants.%.593] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -1218,7 +1198,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentImplicitParamType [concrete = constants.%FDifferentImplicitParamType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc193: = impl_self_witness @FDifferentImplicitParamType.as.J.impl.%Self.ref, @J [concrete = constants.%.46c] +// CHECK:STDOUT: %.loc185: = impl_self_witness @FDifferentImplicitParamType.as.J.impl.%Self.ref, @J [concrete = constants.%.46c] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -1232,7 +1212,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentReturnType [concrete = constants.%FDifferentReturnType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc216: = impl_self_witness @FDifferentReturnType.as.J.impl.%Self.ref, @J [concrete = constants.%.ce7] +// CHECK:STDOUT: %.loc205: = impl_self_witness @FDifferentReturnType.as.J.impl.%Self.ref, @J [concrete = constants.%.ce7] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -1246,7 +1226,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SelfNestedBadParam [concrete = constants.%SelfNestedBadParam] // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [concrete = constants.%SelfNested.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc242: = impl_self_witness @SelfNestedBadParam.as.SelfNested.impl.%Self.ref, @SelfNested [concrete = constants.%.83b] +// CHECK:STDOUT: %.loc228: = impl_self_witness @SelfNestedBadParam.as.SelfNested.impl.%Self.ref, @SelfNested [concrete = constants.%.83b] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -1261,7 +1241,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SelfNestedBadReturnType [concrete = constants.%SelfNestedBadReturnType] // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [concrete = constants.%SelfNested.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc265: = impl_self_witness @SelfNestedBadReturnType.as.SelfNested.impl.%Self.ref, @SelfNested [concrete = constants.%.020] +// CHECK:STDOUT: %.loc248: = impl_self_witness @SelfNestedBadReturnType.as.SelfNested.impl.%Self.ref, @SelfNested [concrete = constants.%.020] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -1276,19 +1256,19 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @FExtraParam.as.I.impl.F.loc66_18.1(%b.param: bool); +// CHECK:STDOUT: fn @FExtraParam.as.I.impl.F.loc65_18.1(%b.param: bool); // CHECK:STDOUT: -// CHECK:STDOUT: fn @FExtraParam.as.I.impl.F.loc66_18.2() [thunk @FExtraParam.as.I.impl.%FExtraParam.as.I.impl.F.decl.loc66_18.1 for @I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet.476)] { +// CHECK:STDOUT: fn @FExtraParam.as.I.impl.F.loc65_18.2() [thunk @FExtraParam.as.I.impl.%FExtraParam.as.I.impl.F.decl.loc65_18.1 for @I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet.476)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %FExtraParam.as.I.impl.F.type.ec7b0b.1 = name_ref F, @FExtraParam.as.I.impl.%FExtraParam.as.I.impl.F.decl.loc66_18.1 [concrete = constants.%FExtraParam.as.I.impl.F.ef9801.1] +// CHECK:STDOUT: %F.ref: %FExtraParam.as.I.impl.F.type.ec7b0b.1 = name_ref F, @FExtraParam.as.I.impl.%FExtraParam.as.I.impl.F.decl.loc65_18.1 [concrete = constants.%FExtraParam.as.I.impl.F.ef9801.1] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @FExtraImplicitParam.as.I.impl.F.loc85_15.1(%self.param: %FExtraImplicitParam); +// CHECK:STDOUT: fn @FExtraImplicitParam.as.I.impl.F.loc83_15.1(%self.param: %FExtraImplicitParam); // CHECK:STDOUT: -// CHECK:STDOUT: fn @FExtraImplicitParam.as.I.impl.F.loc85_15.2() [thunk @FExtraImplicitParam.as.I.impl.%FExtraImplicitParam.as.I.impl.F.decl.loc85_15.1 for @I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet.7ed)] { +// CHECK:STDOUT: fn @FExtraImplicitParam.as.I.impl.F.loc83_15.2() [thunk @FExtraImplicitParam.as.I.impl.%FExtraImplicitParam.as.I.impl.F.decl.loc83_15.1 for @I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet.7ed)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %FExtraImplicitParam.as.I.impl.F.type.54cac2.1 = name_ref F, @FExtraImplicitParam.as.I.impl.%FExtraImplicitParam.as.I.impl.F.decl.loc85_15.1 [concrete = constants.%FExtraImplicitParam.as.I.impl.F.a42f35.1] +// CHECK:STDOUT: %F.ref: %FExtraImplicitParam.as.I.impl.F.type.54cac2.1 = name_ref F, @FExtraImplicitParam.as.I.impl.%FExtraImplicitParam.as.I.impl.F.decl.loc83_15.1 [concrete = constants.%FExtraImplicitParam.as.I.impl.F.a42f35.1] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1298,110 +1278,110 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: fn(%self.param: bool, %b.param: bool) -> out %return.param: bool; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @FMissingParam.as.J.impl.F.loc125_29.1(%self.param: bool) -> out %return.param: bool; +// CHECK:STDOUT: fn @FMissingParam.as.J.impl.F.loc122_29.1(%self.param: bool) -> out %return.param: bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @FMissingParam.as.J.impl.F.loc125_29.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FMissingParam.as.J.impl.%FMissingParam.as.J.impl.F.decl.loc125_29.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.2a3)] { +// CHECK:STDOUT: fn @FMissingParam.as.J.impl.F.loc122_29.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FMissingParam.as.J.impl.%FMissingParam.as.J.impl.F.decl.loc122_29.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.2a3)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %FMissingParam.as.J.impl.F.type.aad6ec.1 = name_ref F, @FMissingParam.as.J.impl.%FMissingParam.as.J.impl.F.decl.loc125_29.1 [concrete = constants.%FMissingParam.as.J.impl.F.dd09dc.1] +// CHECK:STDOUT: %F.ref: %FMissingParam.as.J.impl.F.type.aad6ec.1 = name_ref F, @FMissingParam.as.J.impl.%FMissingParam.as.J.impl.F.decl.loc122_29.1 [concrete = constants.%FMissingParam.as.J.impl.F.dd09dc.1] // CHECK:STDOUT: %FMissingParam.as.J.impl.F.bound: = bound_method %self.param, %F.ref // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @FMissingImplicitParam.as.J.impl.F.loc144_26.1(%b.param: bool) -> out %return.param: bool; +// CHECK:STDOUT: fn @FMissingImplicitParam.as.J.impl.F.loc141_26.1(%b.param: bool) -> out %return.param: bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @FMissingImplicitParam.as.J.impl.F.loc144_26.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FMissingImplicitParam.as.J.impl.%FMissingImplicitParam.as.J.impl.F.decl.loc144_26.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.ba1)] { +// CHECK:STDOUT: fn @FMissingImplicitParam.as.J.impl.F.loc141_26.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FMissingImplicitParam.as.J.impl.%FMissingImplicitParam.as.J.impl.F.decl.loc141_26.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.ba1)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %FMissingImplicitParam.as.J.impl.F.type.f666a8.1 = name_ref F, @FMissingImplicitParam.as.J.impl.%FMissingImplicitParam.as.J.impl.F.decl.loc144_26.1 [concrete = constants.%FMissingImplicitParam.as.J.impl.F.620ed1.1] +// CHECK:STDOUT: %F.ref: %FMissingImplicitParam.as.J.impl.F.type.f666a8.1 = name_ref F, @FMissingImplicitParam.as.J.impl.%FMissingImplicitParam.as.J.impl.F.decl.loc141_26.1 [concrete = constants.%FMissingImplicitParam.as.J.impl.F.620ed1.1] // CHECK:STDOUT: %FMissingImplicitParam.as.J.impl.F.call: init bool = call %F.ref(%b.param) // CHECK:STDOUT: return %FMissingImplicitParam.as.J.impl.F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @FMissingReturnType.as.J.impl.F.loc164_30.1(%self.param: bool, %b.param: bool); +// CHECK:STDOUT: fn @FMissingReturnType.as.J.impl.F.loc159_30.1(%self.param: bool, %b.param: bool); // CHECK:STDOUT: -// CHECK:STDOUT: fn @FMissingReturnType.as.J.impl.F.loc164_30.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FMissingReturnType.as.J.impl.%FMissingReturnType.as.J.impl.F.decl.loc164_30.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.b68)] { +// CHECK:STDOUT: fn @FMissingReturnType.as.J.impl.F.loc159_30.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FMissingReturnType.as.J.impl.%FMissingReturnType.as.J.impl.F.decl.loc159_30.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.b68)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %FMissingReturnType.as.J.impl.F.type.9cd56a.1 = name_ref F, @FMissingReturnType.as.J.impl.%FMissingReturnType.as.J.impl.F.decl.loc164_30.1 [concrete = constants.%FMissingReturnType.as.J.impl.F.6975be.1] +// CHECK:STDOUT: %F.ref: %FMissingReturnType.as.J.impl.F.type.9cd56a.1 = name_ref F, @FMissingReturnType.as.J.impl.%FMissingReturnType.as.J.impl.F.decl.loc159_30.1 [concrete = constants.%FMissingReturnType.as.J.impl.F.6975be.1] // CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.bound: = bound_method %self.param, %F.ref // CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.call: init %empty_tuple.type = call %FMissingReturnType.as.J.impl.F.bound(%self.param, %b.param) -// CHECK:STDOUT: %.loc164: bool = converted %FMissingReturnType.as.J.impl.F.call, [concrete = ] +// CHECK:STDOUT: %.loc159: bool = converted %FMissingReturnType.as.J.impl.F.call, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @FDifferentParamType.as.J.impl.F.loc188_38.1(%self.param: bool, %b.param: %FDifferentParamType) -> out %return.param: bool; +// CHECK:STDOUT: fn @FDifferentParamType.as.J.impl.F.loc180_38.1(%self.param: bool, %b.param: %FDifferentParamType) -> out %return.param: bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @FDifferentParamType.as.J.impl.F.loc188_38.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentParamType.as.J.impl.%FDifferentParamType.as.J.impl.F.decl.loc188_38.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.73e)] { +// CHECK:STDOUT: fn @FDifferentParamType.as.J.impl.F.loc180_38.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentParamType.as.J.impl.%FDifferentParamType.as.J.impl.F.decl.loc180_38.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.73e)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %FDifferentParamType.as.J.impl.F.type.4a2e9b.1 = name_ref F, @FDifferentParamType.as.J.impl.%FDifferentParamType.as.J.impl.F.decl.loc188_38.1 [concrete = constants.%FDifferentParamType.as.J.impl.F.28602a.1] +// CHECK:STDOUT: %F.ref: %FDifferentParamType.as.J.impl.F.type.4a2e9b.1 = name_ref F, @FDifferentParamType.as.J.impl.%FDifferentParamType.as.J.impl.F.decl.loc180_38.1 [concrete = constants.%FDifferentParamType.as.J.impl.F.28602a.1] // CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.bound: = bound_method %self.param, %F.ref -// CHECK:STDOUT: %.loc188: %FDifferentParamType = converted %b.param, [concrete = ] +// CHECK:STDOUT: %.loc180: %FDifferentParamType = converted %b.param, [concrete = ] // CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.call: init bool = call %FDifferentParamType.as.J.impl.F.bound(%self.param, ) // CHECK:STDOUT: return %FDifferentParamType.as.J.impl.F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @FDifferentImplicitParamType.as.J.impl.F.loc211_32.1(%self.param: %FDifferentImplicitParamType, %b.param: bool) -> out %return.param: bool; +// CHECK:STDOUT: fn @FDifferentImplicitParamType.as.J.impl.F.loc200_32.1(%self.param: %FDifferentImplicitParamType, %b.param: bool) -> out %return.param: bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @FDifferentImplicitParamType.as.J.impl.F.loc211_32.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentImplicitParamType.as.J.impl.%FDifferentImplicitParamType.as.J.impl.F.decl.loc211_32.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.00a)] { +// CHECK:STDOUT: fn @FDifferentImplicitParamType.as.J.impl.F.loc200_32.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentImplicitParamType.as.J.impl.%FDifferentImplicitParamType.as.J.impl.F.decl.loc200_32.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.00a)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.1 = name_ref F, @FDifferentImplicitParamType.as.J.impl.%FDifferentImplicitParamType.as.J.impl.F.decl.loc211_32.1 [concrete = constants.%FDifferentImplicitParamType.as.J.impl.F.792c78.1] +// CHECK:STDOUT: %F.ref: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.1 = name_ref F, @FDifferentImplicitParamType.as.J.impl.%FDifferentImplicitParamType.as.J.impl.F.decl.loc200_32.1 [concrete = constants.%FDifferentImplicitParamType.as.J.impl.F.792c78.1] // CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.bound: = bound_method %self.param, %F.ref -// CHECK:STDOUT: %.loc211: %FDifferentImplicitParamType = converted %self.param, [concrete = ] +// CHECK:STDOUT: %.loc200: %FDifferentImplicitParamType = converted %self.param, [concrete = ] // CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.call: init bool = call %FDifferentImplicitParamType.as.J.impl.F.bound(, %b.param) // CHECK:STDOUT: return %FDifferentImplicitParamType.as.J.impl.F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @FDifferentReturnType.as.J.impl.F.loc233_38.1(%self.param: bool, %b.param: bool) -> out %return.param: %FDifferentReturnType; +// CHECK:STDOUT: fn @FDifferentReturnType.as.J.impl.F.loc219_38.1(%self.param: bool, %b.param: bool) -> out %return.param: %FDifferentReturnType; // CHECK:STDOUT: -// CHECK:STDOUT: fn @FDifferentReturnType.as.J.impl.F.loc233_38.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentReturnType.as.J.impl.%FDifferentReturnType.as.J.impl.F.decl.loc233_38.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.6a7)] { +// CHECK:STDOUT: fn @FDifferentReturnType.as.J.impl.F.loc219_38.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentReturnType.as.J.impl.%FDifferentReturnType.as.J.impl.F.decl.loc219_38.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.6a7)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %FDifferentReturnType.as.J.impl.F.type.ff55f4.1 = name_ref F, @FDifferentReturnType.as.J.impl.%FDifferentReturnType.as.J.impl.F.decl.loc233_38.1 [concrete = constants.%FDifferentReturnType.as.J.impl.F.9725a5.1] +// CHECK:STDOUT: %F.ref: %FDifferentReturnType.as.J.impl.F.type.ff55f4.1 = name_ref F, @FDifferentReturnType.as.J.impl.%FDifferentReturnType.as.J.impl.F.decl.loc219_38.1 [concrete = constants.%FDifferentReturnType.as.J.impl.F.9725a5.1] // CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.bound: = bound_method %self.param, %F.ref -// CHECK:STDOUT: %.loc233_38.1: ref %FDifferentReturnType = temporary_storage -// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.call: init %FDifferentReturnType to %.loc233_38.1 = call %FDifferentReturnType.as.J.impl.F.bound(%self.param, %b.param) -// CHECK:STDOUT: %.loc233_38.2: bool = converted %FDifferentReturnType.as.J.impl.F.call, [concrete = ] +// CHECK:STDOUT: %.loc219_38.1: ref %FDifferentReturnType = temporary_storage +// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.call: init %FDifferentReturnType to %.loc219_38.1 = call %FDifferentReturnType.as.J.impl.F.bound(%self.param, %b.param) +// CHECK:STDOUT: %.loc219_38.2: bool = converted %FDifferentReturnType.as.J.impl.F.call, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @SelfNested.WithSelf.F(@SelfNested.%Self: %SelfNested.type) { // CHECK:STDOUT: %Self: %SelfNested.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.e81)] -// CHECK:STDOUT: %Self.as_type.loc238_16.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc238_16.1 (constants.%Self.as_type.8ab)] -// CHECK:STDOUT: %ptr.loc238_16.1: type = ptr_type %Self.as_type.loc238_16.1 [symbolic = %ptr.loc238_16.1 (constants.%ptr.a16)] -// CHECK:STDOUT: %struct_type.x.y.loc238_37.1: type = struct_type {.x: @SelfNested.WithSelf.F.%Self.as_type.loc238_16.1 (%Self.as_type.8ab), .y: %i32} [symbolic = %struct_type.x.y.loc238_37.1 (constants.%struct_type.x.y.34d)] -// CHECK:STDOUT: %tuple: %tuple.type.693 = tuple_value (%ptr.loc238_16.1, %struct_type.x.y.loc238_37.1) [symbolic = %tuple (constants.%tuple.ea4)] -// CHECK:STDOUT: %tuple.type: type = tuple_type (%ptr.loc238_16.1, %struct_type.x.y.loc238_37.1) [symbolic = %tuple.type (constants.%tuple.type.684)] -// CHECK:STDOUT: %pattern_type.loc238_9: type = pattern_type %tuple.type [symbolic = %pattern_type.loc238_9 (constants.%pattern_type.871)] -// CHECK:STDOUT: %x.param_patt.loc238_9.2: @SelfNested.WithSelf.F.%pattern_type.loc238_9 (%pattern_type.871) = value_param_pattern [symbolic = %x.param_patt.loc238_9.2 (constants.%x.param_patt.8f6)] -// CHECK:STDOUT: %x.patt.loc238_9.2: @SelfNested.WithSelf.F.%pattern_type.loc238_9 (%pattern_type.871) = wrapper_binding_pattern x, %x.param_patt.loc238_9.2 [symbolic = %x.patt.loc238_9.2 (constants.%x.patt.48b)] -// CHECK:STDOUT: %Array.loc238_57.1: type = class_type @Array, @Array(%Self.as_type.loc238_16.1, constants.%int_4) [symbolic = %Array.loc238_57.1 (constants.%Array.d32)] -// CHECK:STDOUT: %.loc238_57.1: Core.Form = init_form %Array.loc238_57.1 [symbolic = %.loc238_57.1 (constants.%.ec2)] -// CHECK:STDOUT: %pattern_type.loc238_57: type = pattern_type %Array.loc238_57.1 [symbolic = %pattern_type.loc238_57 (constants.%pattern_type.4a4)] -// CHECK:STDOUT: %return.param_patt.loc238_57.2: @SelfNested.WithSelf.F.%pattern_type.loc238_57 (%pattern_type.4a4) = out_param_pattern [symbolic = %return.param_patt.loc238_57.2 (constants.%return.param_patt.36b)] -// CHECK:STDOUT: %return.patt.loc238_41.2: @SelfNested.WithSelf.F.%pattern_type.loc238_57 (%pattern_type.4a4) = return_slot_pattern %return.param_patt.loc238_57.2, %Array.loc238_57.1 [symbolic = %return.patt.loc238_41.2 (constants.%return.patt.7a8)] +// CHECK:STDOUT: %Self.as_type.loc224_16.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc224_16.1 (constants.%Self.as_type.8ab)] +// CHECK:STDOUT: %ptr.loc224_16.1: type = ptr_type %Self.as_type.loc224_16.1 [symbolic = %ptr.loc224_16.1 (constants.%ptr.a16)] +// CHECK:STDOUT: %struct_type.x.y.loc224_37.1: type = struct_type {.x: @SelfNested.WithSelf.F.%Self.as_type.loc224_16.1 (%Self.as_type.8ab), .y: %i32} [symbolic = %struct_type.x.y.loc224_37.1 (constants.%struct_type.x.y.34d)] +// CHECK:STDOUT: %tuple: %tuple.type.693 = tuple_value (%ptr.loc224_16.1, %struct_type.x.y.loc224_37.1) [symbolic = %tuple (constants.%tuple.ea4)] +// CHECK:STDOUT: %tuple.type: type = tuple_type (%ptr.loc224_16.1, %struct_type.x.y.loc224_37.1) [symbolic = %tuple.type (constants.%tuple.type.684)] +// CHECK:STDOUT: %pattern_type.loc224_9: type = pattern_type %tuple.type [symbolic = %pattern_type.loc224_9 (constants.%pattern_type.871)] +// CHECK:STDOUT: %x.param_patt.loc224_9.2: @SelfNested.WithSelf.F.%pattern_type.loc224_9 (%pattern_type.871) = value_param_pattern [symbolic = %x.param_patt.loc224_9.2 (constants.%x.param_patt.8f6)] +// CHECK:STDOUT: %x.patt.loc224_9.2: @SelfNested.WithSelf.F.%pattern_type.loc224_9 (%pattern_type.871) = wrapper_binding_pattern x, %x.param_patt.loc224_9.2 [symbolic = %x.patt.loc224_9.2 (constants.%x.patt.48b)] +// CHECK:STDOUT: %Array.loc224_57.1: type = class_type @Array, @Array(%Self.as_type.loc224_16.1, constants.%int_4) [symbolic = %Array.loc224_57.1 (constants.%Array.d32)] +// CHECK:STDOUT: %.loc224_57.1: Core.Form = init_form %Array.loc224_57.1 [symbolic = %.loc224_57.1 (constants.%.ec2)] +// CHECK:STDOUT: %pattern_type.loc224_57: type = pattern_type %Array.loc224_57.1 [symbolic = %pattern_type.loc224_57 (constants.%pattern_type.4a4)] +// CHECK:STDOUT: %return.param_patt.loc224_57.2: @SelfNested.WithSelf.F.%pattern_type.loc224_57 (%pattern_type.4a4) = out_param_pattern [symbolic = %return.param_patt.loc224_57.2 (constants.%return.param_patt.36b)] +// CHECK:STDOUT: %return.patt.loc224_41.2: @SelfNested.WithSelf.F.%pattern_type.loc224_57 (%pattern_type.4a4) = return_slot_pattern %return.param_patt.loc224_57.2, %Array.loc224_57.1 [symbolic = %return.patt.loc224_41.2 (constants.%return.patt.7a8)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @SelfNested.WithSelf.F.%tuple.type (%tuple.type.684)) -> out %return.param: @SelfNested.WithSelf.F.%Array.loc238_57.1 (%Array.d32); +// CHECK:STDOUT: fn(%x.param: @SelfNested.WithSelf.F.%tuple.type (%tuple.type.684)) -> out %return.param: @SelfNested.WithSelf.F.%Array.loc224_57.1 (%Array.d32); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SelfNestedBadParam.as.SelfNested.impl.F.loc260_87.1(%x.param: %tuple.type.f65) -> out %return.param: %Array.870; +// CHECK:STDOUT: fn @SelfNestedBadParam.as.SelfNested.impl.F.loc243_87.1(%x.param: %tuple.type.f65) -> out %return.param: %Array.870; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SelfNestedBadParam.as.SelfNested.impl.F.loc260_87.2(%x.param: %tuple.type.5e1) -> out %return.param: %Array.870 [thunk @SelfNestedBadParam.as.SelfNested.impl.%SelfNestedBadParam.as.SelfNested.impl.F.decl.loc260_87.1 for @SelfNested.WithSelf.%SelfNested.WithSelf.F.decl, @SelfNested.WithSelf.F(constants.%SelfNested.facet.d0d)] { +// CHECK:STDOUT: fn @SelfNestedBadParam.as.SelfNested.impl.F.loc243_87.2(%x.param: %tuple.type.5e1) -> out %return.param: %Array.870 [thunk @SelfNestedBadParam.as.SelfNested.impl.%SelfNestedBadParam.as.SelfNested.impl.F.decl.loc243_87.1 for @SelfNested.WithSelf.%SelfNested.WithSelf.F.decl, @SelfNested.WithSelf.F(constants.%SelfNested.facet.d0d)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %SelfNestedBadParam.as.SelfNested.impl.F.type.4325e7.1 = name_ref F, @SelfNestedBadParam.as.SelfNested.impl.%SelfNestedBadParam.as.SelfNested.impl.F.decl.loc260_87.1 [concrete = constants.%SelfNestedBadParam.as.SelfNested.impl.F.5fd896.1] +// CHECK:STDOUT: %F.ref: %SelfNestedBadParam.as.SelfNested.impl.F.type.4325e7.1 = name_ref F, @SelfNestedBadParam.as.SelfNested.impl.%SelfNestedBadParam.as.SelfNested.impl.F.decl.loc243_87.1 [concrete = constants.%SelfNestedBadParam.as.SelfNested.impl.F.5fd896.1] // CHECK:STDOUT: %.3: ref %Array.870 = splice_block %return.param {} // CHECK:STDOUT: %tuple.elem0: %ptr.52e = tuple_access %x.param, element0 // CHECK:STDOUT: %tuple.elem1: %struct_type.x.y.25d = tuple_access %x.param, element1 -// CHECK:STDOUT: %.loc260_87.1: %SelfNestedBadParam = struct_access %tuple.elem1, element0 -// CHECK:STDOUT: %.loc260_87.2: %i32 = converted %.loc260_87.1, [concrete = ] +// CHECK:STDOUT: %.loc243_87.1: %SelfNestedBadParam = struct_access %tuple.elem1, element0 +// CHECK:STDOUT: %.loc243_87.2: %i32 = converted %.loc243_87.1, [concrete = ] // CHECK:STDOUT: %SelfNestedBadParam.as.SelfNested.impl.F.call: init %Array.870 to %.3 = call %F.ref() // CHECK:STDOUT: return %SelfNestedBadParam.as.SelfNested.impl.F.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SelfNestedBadReturnType.as.SelfNested.impl.F.loc283_112.1(%x.param: %tuple.type.dce) -> out %return.param: %Array.870; +// CHECK:STDOUT: fn @SelfNestedBadReturnType.as.SelfNested.impl.F.loc263_112.1(%x.param: %tuple.type.dce) -> out %return.param: %Array.870; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SelfNestedBadReturnType.as.SelfNested.impl.F.loc283_112.2(%x.param: %tuple.type.dce) -> out %return.param: %Array.ce4 [thunk @SelfNestedBadReturnType.as.SelfNested.impl.%SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc283_112.1 for @SelfNested.WithSelf.%SelfNested.WithSelf.F.decl, @SelfNested.WithSelf.F(constants.%SelfNested.facet.e71)] { +// CHECK:STDOUT: fn @SelfNestedBadReturnType.as.SelfNested.impl.F.loc263_112.2(%x.param: %tuple.type.dce) -> out %return.param: %Array.ce4 [thunk @SelfNestedBadReturnType.as.SelfNested.impl.%SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc263_112.1 for @SelfNested.WithSelf.%SelfNested.WithSelf.F.decl, @SelfNested.WithSelf.F(constants.%SelfNested.facet.e71)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %SelfNestedBadReturnType.as.SelfNested.impl.F.type.1cbabe.1 = name_ref F, @SelfNestedBadReturnType.as.SelfNested.impl.%SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc283_112.1 [concrete = constants.%SelfNestedBadReturnType.as.SelfNested.impl.F.5a7d54.1] -// CHECK:STDOUT: %.loc283_112.1: ref %Array.870 = temporary_storage -// CHECK:STDOUT: %SelfNestedBadReturnType.as.SelfNested.impl.F.call: init %Array.870 to %.loc283_112.1 = call %F.ref(%x.param) -// CHECK:STDOUT: %.loc283_112.2: %Array.ce4 = converted %SelfNestedBadReturnType.as.SelfNested.impl.F.call, [concrete = ] +// CHECK:STDOUT: %F.ref: %SelfNestedBadReturnType.as.SelfNested.impl.F.type.1cbabe.1 = name_ref F, @SelfNestedBadReturnType.as.SelfNested.impl.%SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc263_112.1 [concrete = constants.%SelfNestedBadReturnType.as.SelfNested.impl.F.5a7d54.1] +// CHECK:STDOUT: %.loc263_112.1: ref %Array.870 = temporary_storage +// CHECK:STDOUT: %SelfNestedBadReturnType.as.SelfNested.impl.F.call: init %Array.870 to %.loc263_112.1 = call %F.ref(%x.param) +// CHECK:STDOUT: %.loc263_112.2: %Array.ce4 = converted %SelfNestedBadReturnType.as.SelfNested.impl.F.call, [concrete = ] // CHECK:STDOUT: return to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1527,19 +1507,19 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: specific @SelfNested.WithSelf.F(constants.%Self.e81) { // CHECK:STDOUT: %Self => constants.%Self.e81 -// CHECK:STDOUT: %Self.as_type.loc238_16.1 => constants.%Self.as_type.8ab -// CHECK:STDOUT: %ptr.loc238_16.1 => constants.%ptr.a16 -// CHECK:STDOUT: %struct_type.x.y.loc238_37.1 => constants.%struct_type.x.y.34d +// CHECK:STDOUT: %Self.as_type.loc224_16.1 => constants.%Self.as_type.8ab +// CHECK:STDOUT: %ptr.loc224_16.1 => constants.%ptr.a16 +// CHECK:STDOUT: %struct_type.x.y.loc224_37.1 => constants.%struct_type.x.y.34d // CHECK:STDOUT: %tuple => constants.%tuple.ea4 // CHECK:STDOUT: %tuple.type => constants.%tuple.type.684 -// CHECK:STDOUT: %pattern_type.loc238_9 => constants.%pattern_type.871 -// CHECK:STDOUT: %x.param_patt.loc238_9.2 => constants.%x.param_patt.8f6 -// CHECK:STDOUT: %x.patt.loc238_9.2 => constants.%x.patt.48b -// CHECK:STDOUT: %Array.loc238_57.1 => constants.%Array.d32 -// CHECK:STDOUT: %.loc238_57.1 => constants.%.ec2 -// CHECK:STDOUT: %pattern_type.loc238_57 => constants.%pattern_type.4a4 -// CHECK:STDOUT: %return.param_patt.loc238_57.2 => constants.%return.param_patt.36b -// CHECK:STDOUT: %return.patt.loc238_41.2 => constants.%return.patt.7a8 +// CHECK:STDOUT: %pattern_type.loc224_9 => constants.%pattern_type.871 +// CHECK:STDOUT: %x.param_patt.loc224_9.2 => constants.%x.param_patt.8f6 +// CHECK:STDOUT: %x.patt.loc224_9.2 => constants.%x.patt.48b +// CHECK:STDOUT: %Array.loc224_57.1 => constants.%Array.d32 +// CHECK:STDOUT: %.loc224_57.1 => constants.%.ec2 +// CHECK:STDOUT: %pattern_type.loc224_57 => constants.%pattern_type.4a4 +// CHECK:STDOUT: %return.param_patt.loc224_57.2 => constants.%return.param_patt.36b +// CHECK:STDOUT: %return.patt.loc224_41.2 => constants.%return.patt.7a8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @SelfNested.WithSelf(constants.%SelfNested.facet.d0d) { @@ -1551,19 +1531,19 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: specific @SelfNested.WithSelf.F(constants.%SelfNested.facet.d0d) { // CHECK:STDOUT: %Self => constants.%SelfNested.facet.d0d -// CHECK:STDOUT: %Self.as_type.loc238_16.1 => constants.%SelfNestedBadParam -// CHECK:STDOUT: %ptr.loc238_16.1 => constants.%ptr.52e -// CHECK:STDOUT: %struct_type.x.y.loc238_37.1 => constants.%struct_type.x.y.25d +// CHECK:STDOUT: %Self.as_type.loc224_16.1 => constants.%SelfNestedBadParam +// CHECK:STDOUT: %ptr.loc224_16.1 => constants.%ptr.52e +// CHECK:STDOUT: %struct_type.x.y.loc224_37.1 => constants.%struct_type.x.y.25d // CHECK:STDOUT: %tuple => constants.%tuple.17a // CHECK:STDOUT: %tuple.type => constants.%tuple.type.5e1 -// CHECK:STDOUT: %pattern_type.loc238_9 => constants.%pattern_type.1ec -// CHECK:STDOUT: %x.param_patt.loc238_9.2 => constants.%x.param_patt.255 -// CHECK:STDOUT: %x.patt.loc238_9.2 => constants.%x.patt.79a -// CHECK:STDOUT: %Array.loc238_57.1 => constants.%Array.870 -// CHECK:STDOUT: %.loc238_57.1 => constants.%.a71 -// CHECK:STDOUT: %pattern_type.loc238_57 => constants.%pattern_type.ec1 -// CHECK:STDOUT: %return.param_patt.loc238_57.2 => constants.%return.param_patt.8ed -// CHECK:STDOUT: %return.patt.loc238_41.2 => constants.%return.patt.21a +// CHECK:STDOUT: %pattern_type.loc224_9 => constants.%pattern_type.1ec +// CHECK:STDOUT: %x.param_patt.loc224_9.2 => constants.%x.param_patt.255 +// CHECK:STDOUT: %x.patt.loc224_9.2 => constants.%x.patt.79a +// CHECK:STDOUT: %Array.loc224_57.1 => constants.%Array.870 +// CHECK:STDOUT: %.loc224_57.1 => constants.%.a71 +// CHECK:STDOUT: %pattern_type.loc224_57 => constants.%pattern_type.ec1 +// CHECK:STDOUT: %return.param_patt.loc224_57.2 => constants.%return.param_patt.8ed +// CHECK:STDOUT: %return.patt.loc224_41.2 => constants.%return.patt.21a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @SelfNested.WithSelf(constants.%SelfNested.facet.e71) { @@ -1575,18 +1555,18 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: specific @SelfNested.WithSelf.F(constants.%SelfNested.facet.e71) { // CHECK:STDOUT: %Self => constants.%SelfNested.facet.e71 -// CHECK:STDOUT: %Self.as_type.loc238_16.1 => constants.%SelfNestedBadReturnType -// CHECK:STDOUT: %ptr.loc238_16.1 => constants.%ptr.f55 -// CHECK:STDOUT: %struct_type.x.y.loc238_37.1 => constants.%struct_type.x.y.03e +// CHECK:STDOUT: %Self.as_type.loc224_16.1 => constants.%SelfNestedBadReturnType +// CHECK:STDOUT: %ptr.loc224_16.1 => constants.%ptr.f55 +// CHECK:STDOUT: %struct_type.x.y.loc224_37.1 => constants.%struct_type.x.y.03e // CHECK:STDOUT: %tuple => constants.%tuple.ef1 // CHECK:STDOUT: %tuple.type => constants.%tuple.type.dce -// CHECK:STDOUT: %pattern_type.loc238_9 => constants.%pattern_type.7fc -// CHECK:STDOUT: %x.param_patt.loc238_9.2 => constants.%x.param_patt.04c -// CHECK:STDOUT: %x.patt.loc238_9.2 => constants.%x.patt.10a -// CHECK:STDOUT: %Array.loc238_57.1 => constants.%Array.ce4 -// CHECK:STDOUT: %.loc238_57.1 => constants.%.069 -// CHECK:STDOUT: %pattern_type.loc238_57 => constants.%pattern_type.5b0 -// CHECK:STDOUT: %return.param_patt.loc238_57.2 => constants.%return.param_patt.c20 -// CHECK:STDOUT: %return.patt.loc238_41.2 => constants.%return.patt.02d +// CHECK:STDOUT: %pattern_type.loc224_9 => constants.%pattern_type.7fc +// CHECK:STDOUT: %x.param_patt.loc224_9.2 => constants.%x.param_patt.04c +// CHECK:STDOUT: %x.patt.loc224_9.2 => constants.%x.patt.10a +// CHECK:STDOUT: %Array.loc224_57.1 => constants.%Array.ce4 +// CHECK:STDOUT: %.loc224_57.1 => constants.%.069 +// CHECK:STDOUT: %pattern_type.loc224_57 => constants.%pattern_type.5b0 +// CHECK:STDOUT: %return.param_patt.loc224_57.2 => constants.%return.param_patt.c20 +// CHECK:STDOUT: %return.patt.loc224_41.2 => constants.%return.patt.02d // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon index c9f8fce36bb4..77e37f554fc1 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon @@ -16,15 +16,12 @@ library "[[@TEST_NAME]]"; -// CHECK:STDERR: ╭─┤ fail_impl_as_false.carbon:[[@LINE+11]]:13 +// CHECK:STDERR: ╭─┤ fail_impl_as_false.carbon:[[@LINE+8]]:13 // CHECK:STDERR: -> │ impl i32 as false {} // CHECK:STDERR: · ┳━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `bool` -// CHECK:STDERR: · │ ┃ to `type` -// CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] -// CHECK:STDERR: · ╰────┤ type `bool` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(type)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ to `type` +// CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: impl i32 as false {} @@ -98,7 +95,7 @@ impl {.a: bool} as type where .Self impls I {} // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %.loc15: type = converted @i32.as..impl.%false, [concrete = ] +// CHECK:STDOUT: %.loc12: type = converted @i32.as..impl.%false, [concrete = ] // CHECK:STDOUT: impl_decl @i32.as..impl [concrete] {} { // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false] diff --git a/toolchain/check/testdata/impl/fail_impl_bad_type.carbon b/toolchain/check/testdata/impl/fail_impl_bad_type.carbon index 4431d86f43dd..e322bcba58b7 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_type.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_type.carbon @@ -14,14 +14,12 @@ interface I {} -// CHECK:STDERR: ╭─┤ fail_impl_bad_type.carbon:[[@LINE+10]]:6 +// CHECK:STDERR: ╭─┤ fail_impl_bad_type.carbon:[[@LINE+8]]:6 // CHECK:STDERR: -> │ impl true as I {} // CHECK:STDERR: · ┳━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `bool` to -// CHECK:STDERR: · │ ┃ `type` -// CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] -// CHECK:STDERR: · ╰────┤ type `bool` does not implement interface `Core.ImplicitAs(type)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `type` +// CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: impl true as I {} @@ -55,10 +53,10 @@ impl true as I {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @.as.I.impl [concrete] {} { // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: %.loc27: type = converted %true, [concrete = ] +// CHECK:STDOUT: %.loc25: type = converted %true, [concrete = ] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc27: = impl_self_witness , @I [concrete = ] +// CHECK:STDOUT: %.loc25: = impl_self_witness , @I [concrete = ] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { diff --git a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon index 38b49b16a6f2..575a9960e38e 100644 --- a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon +++ b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon @@ -27,7 +27,7 @@ impl bool as I { } impl i32 as I { - // CHECK:STDERR: ╭─┤ fail_self_type_mismatch.carbon:[[@LINE+17]]:3 + // CHECK:STDERR: ╭─┤ fail_self_type_mismatch.carbon:[[@LINE+14]]:3 // CHECK:STDERR: │ fn F(c: C(Self)); // CHECK:STDERR: · ────────┬──────── // CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function @@ -38,10 +38,7 @@ impl i32 as I { // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `C(i32 as I)` to // CHECK:STDERR: · │ ┃ `C(i32)` // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `C(i32 as I)` does not implement interface - // CHECK:STDERR: · │ │ `Core.ImplicitAs(C(i32))` - // CHECK:STDERR: · │ │ [MissingImplInMemberAccessInContext] - // CHECK:STDERR: · ╰──────┤ initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: · ╰────┤ initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(c: C(i32)); @@ -98,7 +95,7 @@ impl i32 as I { // CHECK:STDOUT: %pattern_type.256: type = pattern_type %C.fef [concrete] // CHECK:STDOUT: %c.param_patt.ab3: %pattern_type.256 = value_param_pattern [concrete] // CHECK:STDOUT: %c.patt.e1b: %pattern_type.256 = wrapper_binding_pattern c, %c.param_patt.ab3 [concrete] -// CHECK:STDOUT: %i32.as.I.impl.F.type.48cdab.1: type = fn_type @i32.as.I.impl.F.loc47_18.1 [concrete] +// CHECK:STDOUT: %i32.as.I.impl.F.type.48cdab.1: type = fn_type @i32.as.I.impl.F.loc44_18.1 [concrete] // CHECK:STDOUT: %i32.as.I.impl.F.bd5be1.1: %i32.as.I.impl.F.type.48cdab.1 = struct_value () [concrete] // CHECK:STDOUT: %I.facet.01e: %I.type = facet_value %i32, (%I.impl_witness.f53) [concrete] // CHECK:STDOUT: %I.WithSelf.F.type.091: type = fn_type @I.WithSelf.F, @I.WithSelf(%I.facet.01e) [concrete] @@ -107,7 +104,7 @@ impl i32 as I { // CHECK:STDOUT: %pattern_type.e36: type = pattern_type %C.186 [concrete] // CHECK:STDOUT: %c.param_patt.21f: %pattern_type.e36 = value_param_pattern [concrete] // CHECK:STDOUT: %c.patt.147: %pattern_type.e36 = wrapper_binding_pattern c, %c.param_patt.21f [concrete] -// CHECK:STDOUT: %i32.as.I.impl.F.type.48cdab.2: type = fn_type @i32.as.I.impl.F.loc47_18.2 [concrete] +// CHECK:STDOUT: %i32.as.I.impl.F.type.48cdab.2: type = fn_type @i32.as.I.impl.F.loc44_18.2 [concrete] // CHECK:STDOUT: %i32.as.I.impl.F.bd5be1.2: %i32.as.I.impl.F.type.48cdab.2 = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete] @@ -219,31 +216,31 @@ impl i32 as I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @i32.as.I.impl: %i32 as %I.ref { -// CHECK:STDOUT: %i32.as.I.impl.F.decl.loc47_18.1: %i32.as.I.impl.F.type.48cdab.1 = fn_decl @i32.as.I.impl.F.loc47_18.1 [concrete = constants.%i32.as.I.impl.F.bd5be1.1] { +// CHECK:STDOUT: %i32.as.I.impl.F.decl.loc44_18.1: %i32.as.I.impl.F.type.48cdab.1 = fn_decl @i32.as.I.impl.F.loc44_18.1 [concrete = constants.%i32.as.I.impl.F.bd5be1.1] { // CHECK:STDOUT: %c.param_patt: %pattern_type.256 = value_param_pattern [concrete = constants.%c.param_patt.ab3] // CHECK:STDOUT: %c.patt: %pattern_type.256 = wrapper_binding_pattern c, %c.param_patt [concrete = constants.%c.patt.e1b] // CHECK:STDOUT: } { // CHECK:STDOUT: %c.param: %C.fef = value_param call_param0 -// CHECK:STDOUT: %.loc47: type = splice_block %C [concrete = constants.%C.fef] { +// CHECK:STDOUT: %.loc44: type = splice_block %C [concrete = constants.%C.fef] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %C: type = class_type @C, @C(type, constants.%i32) [concrete = constants.%C.fef] // CHECK:STDOUT: } // CHECK:STDOUT: %c: %C.fef = wrapper_binding c, %c.param // CHECK:STDOUT: } -// CHECK:STDOUT: %i32.as.I.impl.F.decl.loc47_18.2: %i32.as.I.impl.F.type.48cdab.2 = fn_decl @i32.as.I.impl.F.loc47_18.2 [concrete = constants.%i32.as.I.impl.F.bd5be1.2] { +// CHECK:STDOUT: %i32.as.I.impl.F.decl.loc44_18.2: %i32.as.I.impl.F.type.48cdab.2 = fn_decl @i32.as.I.impl.F.loc44_18.2 [concrete = constants.%i32.as.I.impl.F.bd5be1.2] { // CHECK:STDOUT: %.1: %pattern_type.e36 = specific_constant constants.%c.param_patt.21f, @I.WithSelf.F(constants.%I.facet.01e) [concrete = constants.%c.param_patt.21f] // CHECK:STDOUT: %c.patt: %pattern_type.e36 = wrapper_binding_pattern c, %.1 [concrete = constants.%c.patt.147] // CHECK:STDOUT: } { // CHECK:STDOUT: %c.param: %C.186 = value_param call_param0 // CHECK:STDOUT: %c: %C.186 = wrapper_binding c, %c.param // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%i32.as.I.impl.F.decl.loc47_18.2), @i32.as.I.impl [concrete] +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%i32.as.I.impl.F.decl.loc44_18.2), @i32.as.I.impl [concrete] // CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.f53] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = -// CHECK:STDOUT: .F = %i32.as.I.impl.F.decl.loc47_18.1 +// CHECK:STDOUT: .F = %i32.as.I.impl.F.decl.loc44_18.1 // CHECK:STDOUT: extend %I.ref // CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } @@ -278,12 +275,12 @@ impl i32 as I { // CHECK:STDOUT: // CHECK:STDOUT: fn @bool.as.I.impl.F(%c.param: %C.820); // CHECK:STDOUT: -// CHECK:STDOUT: fn @i32.as.I.impl.F.loc47_18.1(%c.param: %C.fef); +// CHECK:STDOUT: fn @i32.as.I.impl.F.loc44_18.1(%c.param: %C.fef); // CHECK:STDOUT: -// CHECK:STDOUT: fn @i32.as.I.impl.F.loc47_18.2(%c.param: %C.186) [thunk @i32.as.I.impl.%i32.as.I.impl.F.decl.loc47_18.1 for @I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet.01e)] { +// CHECK:STDOUT: fn @i32.as.I.impl.F.loc44_18.2(%c.param: %C.186) [thunk @i32.as.I.impl.%i32.as.I.impl.F.decl.loc44_18.1 for @I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet.01e)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %i32.as.I.impl.F.type.48cdab.1 = name_ref F, @i32.as.I.impl.%i32.as.I.impl.F.decl.loc47_18.1 [concrete = constants.%i32.as.I.impl.F.bd5be1.1] -// CHECK:STDOUT: %.loc47: %C.fef = converted %c.param, [concrete = ] +// CHECK:STDOUT: %F.ref: %i32.as.I.impl.F.type.48cdab.1 = name_ref F, @i32.as.I.impl.%i32.as.I.impl.F.decl.loc44_18.1 [concrete = constants.%i32.as.I.impl.F.bd5be1.1] +// CHECK:STDOUT: %.loc44: %C.fef = converted %c.param, [concrete = ] // CHECK:STDOUT: %i32.as.I.impl.F.call: init %empty_tuple.type = call %F.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/forward_decls.carbon b/toolchain/check/testdata/impl/forward_decls.carbon index 8953b553c3d2..6a51eda30d10 100644 --- a/toolchain/check/testdata/impl/forward_decls.carbon +++ b/toolchain/check/testdata/impl/forward_decls.carbon @@ -116,10 +116,11 @@ library "[[@TEST_NAME]]"; interface I; class C; class D {} -// CHECK:STDERR: ╭─┤ fail_associated_const_before_interface_definition.carbon:[[@LINE+11]]:19 +// CHECK:STDERR: ╭─┤ fail_associated_const_before_interface_definition.carbon:[[@LINE+12]]:19 // CHECK:STDERR: │ interface I; -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ interface was forward declared here [InterfaceForwardDeclaredHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ interface was forward declared here +// CHECK:STDERR: · │ [InterfaceForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ impl D as I where .T = C; // CHECK:STDERR: · ━┳ @@ -1100,37 +1101,37 @@ impl C as Y {} // CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [concrete = constants.%C] {} {} // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {} // CHECK:STDOUT: impl_decl @D.as..impl [concrete] {} { -// CHECK:STDOUT: %D.ref.loc17: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %I.ref.loc17: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type] -// CHECK:STDOUT: %.Self.frozen.loc17: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] -// CHECK:STDOUT: %base_facet_type.loc17 = requirement_base_facet_type %I.ref.loc17 [concrete] -// CHECK:STDOUT: %.Self.ref.loc17: %I.type = name_ref .Self, %.Self.frozen.loc17 [symbolic_self = constants.%.Self.frozen] -// CHECK:STDOUT: %.Self.as_type.loc17: type = facet_access_type %.Self.ref.loc17 [symbolic_self = constants.%.Self.frozen.as_type] -// CHECK:STDOUT: %.loc17_19: type = converted %.Self.ref.loc17, %.Self.as_type.loc17 [symbolic_self = constants.%.Self.frozen.as_type] -// CHECK:STDOUT: %T.ref.loc17: = name_ref T, [concrete = ] -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, file.%C.decl.loc4 [concrete = constants.%C] -// CHECK:STDOUT: %rewrite.loc17 = requirement_rewrite %T.ref.loc17, [concrete] -// CHECK:STDOUT: %.loc17_13: type = where_expr [concrete = ] { -// CHECK:STDOUT: %base_facet_type.loc17 = requirement_base_facet_type %I.ref.loc17 [concrete] -// CHECK:STDOUT: %rewrite.loc17 = requirement_rewrite %T.ref.loc17, [concrete] +// CHECK:STDOUT: %D.ref.loc18: type = name_ref D, file.%D.decl [concrete = constants.%D] +// CHECK:STDOUT: %I.ref.loc18: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type] +// CHECK:STDOUT: %.Self.frozen.loc18: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] +// CHECK:STDOUT: %base_facet_type.loc18 = requirement_base_facet_type %I.ref.loc18 [concrete] +// CHECK:STDOUT: %.Self.ref.loc18: %I.type = name_ref .Self, %.Self.frozen.loc18 [symbolic_self = constants.%.Self.frozen] +// CHECK:STDOUT: %.Self.as_type.loc18: type = facet_access_type %.Self.ref.loc18 [symbolic_self = constants.%.Self.frozen.as_type] +// CHECK:STDOUT: %.loc18_19: type = converted %.Self.ref.loc18, %.Self.as_type.loc18 [symbolic_self = constants.%.Self.frozen.as_type] +// CHECK:STDOUT: %T.ref.loc18: = name_ref T, [concrete = ] +// CHECK:STDOUT: %C.ref.loc18: type = name_ref C, file.%C.decl.loc4 [concrete = constants.%C] +// CHECK:STDOUT: %rewrite.loc18 = requirement_rewrite %T.ref.loc18, [concrete] +// CHECK:STDOUT: %.loc18_13: type = where_expr [concrete = ] { +// CHECK:STDOUT: %base_facet_type.loc18 = requirement_base_facet_type %I.ref.loc18 [concrete] +// CHECK:STDOUT: %rewrite.loc18 = requirement_rewrite %T.ref.loc18, [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.decl.loc19: type = interface_decl @I [concrete = constants.%I.type] {} {} -// CHECK:STDOUT: %C.decl.loc20: type = class_decl @C [concrete = constants.%C] {} {} +// CHECK:STDOUT: %I.decl.loc20: type = interface_decl @I [concrete = constants.%I.type] {} {} +// CHECK:STDOUT: %C.decl.loc21: type = class_decl @C [concrete = constants.%C] {} {} // CHECK:STDOUT: impl_decl @D.as..impl [concrete] {} { -// CHECK:STDOUT: %D.ref.loc28: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %I.ref.loc28: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type] -// CHECK:STDOUT: %.Self.frozen.loc28: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] -// CHECK:STDOUT: %base_facet_type.loc28 = requirement_base_facet_type %I.ref.loc28 [concrete] -// CHECK:STDOUT: %.Self.ref.loc28: %I.type = name_ref .Self, %.Self.frozen.loc28 [symbolic_self = constants.%.Self.frozen] -// CHECK:STDOUT: %.Self.as_type.loc28: type = facet_access_type %.Self.ref.loc28 [symbolic_self = constants.%.Self.frozen.as_type] -// CHECK:STDOUT: %.loc28_19: type = converted %.Self.ref.loc28, %.Self.as_type.loc28 [symbolic_self = constants.%.Self.frozen.as_type] -// CHECK:STDOUT: %T.ref.loc28: = name_ref T, [concrete = ] -// CHECK:STDOUT: %C.ref.loc28: type = name_ref C, file.%C.decl.loc4 [concrete = constants.%C] -// CHECK:STDOUT: %rewrite.loc28 = requirement_rewrite %T.ref.loc28, [concrete] -// CHECK:STDOUT: %.loc28_13: type = where_expr [concrete = ] { -// CHECK:STDOUT: %base_facet_type.loc28 = requirement_base_facet_type %I.ref.loc28 [concrete] -// CHECK:STDOUT: %rewrite.loc28 = requirement_rewrite %T.ref.loc28, [concrete] +// CHECK:STDOUT: %D.ref.loc29: type = name_ref D, file.%D.decl [concrete = constants.%D] +// CHECK:STDOUT: %I.ref.loc29: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type] +// CHECK:STDOUT: %.Self.frozen.loc29: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] +// CHECK:STDOUT: %base_facet_type.loc29 = requirement_base_facet_type %I.ref.loc29 [concrete] +// CHECK:STDOUT: %.Self.ref.loc29: %I.type = name_ref .Self, %.Self.frozen.loc29 [symbolic_self = constants.%.Self.frozen] +// CHECK:STDOUT: %.Self.as_type.loc29: type = facet_access_type %.Self.ref.loc29 [symbolic_self = constants.%.Self.frozen.as_type] +// CHECK:STDOUT: %.loc29_19: type = converted %.Self.ref.loc29, %.Self.as_type.loc29 [symbolic_self = constants.%.Self.frozen.as_type] +// CHECK:STDOUT: %T.ref.loc29: = name_ref T, [concrete = ] +// CHECK:STDOUT: %C.ref.loc29: type = name_ref C, file.%C.decl.loc4 [concrete = constants.%C] +// CHECK:STDOUT: %rewrite.loc29 = requirement_rewrite %T.ref.loc29, [concrete] +// CHECK:STDOUT: %.loc29_13: type = where_expr [concrete = ] { +// CHECK:STDOUT: %base_facet_type.loc29 = requirement_base_facet_type %I.ref.loc29 [concrete] +// CHECK:STDOUT: %rewrite.loc29 = requirement_rewrite %T.ref.loc29, [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1147,7 +1148,7 @@ impl C as Y {} // CHECK:STDOUT: !requires: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @D.as..impl: %D.ref.loc17 as { +// CHECK:STDOUT: impl @D.as..impl: %D.ref.loc18 as { // CHECK:STDOUT: !members: // CHECK:STDOUT: extend // CHECK:STDOUT: witness = diff --git a/toolchain/check/testdata/impl/impl_thunk.carbon b/toolchain/check/testdata/impl/impl_thunk.carbon index d822e970bca7..3d7faba5fa2c 100644 --- a/toolchain/check/testdata/impl/impl_thunk.carbon +++ b/toolchain/check/testdata/impl/impl_thunk.carbon @@ -154,7 +154,7 @@ interface X { impl A as X { //@dump-sem-ir-begin - // CHECK:STDERR: ╭─┤ fail_inheritance_value_conversion_copy_return.carbon:[[@LINE+13]]:3 + // CHECK:STDERR: ╭─┤ fail_inheritance_value_conversion_copy_return.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn F() -> Self; // CHECK:STDERR: · ───────┬─────── // CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function @@ -163,8 +163,6 @@ impl A as X { // CHECK:STDERR: -> │ fn F() -> B; // CHECK:STDERR: · ━━━━━━┳━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot copy value of type `A` [CopyOfUncopyableType] - // CHECK:STDERR: · ╰────┤ type `A` does not implement interface `Core.Copy` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F() -> B; @@ -183,7 +181,7 @@ class A {} class B {} impl A as I { - // CHECK:STDERR: ╭─┤ fail_param_type_mismatch.carbon:[[@LINE+15]]:3 + // CHECK:STDERR: ╭─┤ fail_param_type_mismatch.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn F(a: Self); // CHECK:STDERR: · ───────┬────── // CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function @@ -192,10 +190,8 @@ impl A as I { // CHECK:STDERR: -> │ fn F(a: B); // CHECK:STDERR: · ━━━━━┳━┯━━━ // CHECK:STDERR: · ┗━━━━┫ error: cannot implicitly convert expression of type `A` to `B` - // CHECK:STDERR: · │ │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰──────┤ type `A` does not implement interface `Core.ImplicitAs(B)` - // CHECK:STDERR: · │ │ [MissingImplInMemberAccessInContext] - // CHECK:STDERR: · ╰──────┤ initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: · │ ┃ [ConversionFailure] + // CHECK:STDERR: · ╰────┤ initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(a: B); @@ -213,7 +209,7 @@ class A {} class B {} impl A as I { - // CHECK:STDERR: ╭─┤ fail_return_mismatch.carbon:[[@LINE+14]]:3 + // CHECK:STDERR: ╭─┤ fail_return_mismatch.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn F() -> Self; // CHECK:STDERR: · ───────┬─────── // CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function @@ -222,9 +218,7 @@ impl A as I { // CHECK:STDERR: -> │ fn F() -> B; // CHECK:STDERR: · ━━━━━━┳━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `B` to `A` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `B` does not implement interface `Core.ImplicitAs(A)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F() -> B; @@ -296,8 +290,8 @@ impl C as I { // CHECK:STDERR: · ┃ [IncompleteTypeInFunctionParam] // CHECK:STDERR: ┆ // CHECK:STDERR: │ class B; - // CHECK:STDERR: · ────┬─── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn F(c: C); // CHECK:STDERR: · ─────┬───── @@ -319,7 +313,7 @@ class B; class C { impl as I(B) { - // CHECK:STDERR: ╭─┤ fail_param_type_incomplete.carbon:[[@LINE+15]]:5 + // CHECK:STDERR: ╭─┤ fail_param_type_incomplete.carbon:[[@LINE+13]]:5 // CHECK:STDERR: │ fn F(a: T); // CHECK:STDERR: · ─────┬───── // CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function @@ -328,10 +322,8 @@ class C { // CHECK:STDERR: -> │ fn F(c: C); // CHECK:STDERR: · ━━━━━┳━┯━━━ // CHECK:STDERR: · ┗━━━━┫ error: cannot implicitly convert expression of type `B` to `C` - // CHECK:STDERR: · │ │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰──────┤ type `B` does not implement interface `Core.ImplicitAs(C)` - // CHECK:STDERR: · │ │ [MissingImplInMemberAccessInContext] - // CHECK:STDERR: · ╰──────┤ initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: · │ ┃ [ConversionFailure] + // CHECK:STDERR: · ╰────┤ initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(c: C); @@ -1098,23 +1090,23 @@ impl () as I({}) { // CHECK:STDOUT: %pattern_type.e39: type = pattern_type %B [concrete] // CHECK:STDOUT: %return.param_patt.934: %pattern_type.e39 = out_param_pattern [concrete] // CHECK:STDOUT: %return.patt.911: %pattern_type.e39 = return_slot_pattern %return.param_patt.934, %B [concrete] -// CHECK:STDOUT: %A.as.X.impl.F.type.48cdab.1: type = fn_type @A.as.X.impl.F.loc26_14.1 [concrete] +// CHECK:STDOUT: %A.as.X.impl.F.type.48cdab.1: type = fn_type @A.as.X.impl.F.loc24_14.1 [concrete] // CHECK:STDOUT: %A.as.X.impl.F.bd5be1.1: %A.as.X.impl.F.type.48cdab.1 = struct_value () [concrete] // CHECK:STDOUT: %X.facet: %X.type = facet_value %A, (%X.impl_witness) [concrete] -// CHECK:STDOUT: %A.as.X.impl.F.type.48cdab.2: type = fn_type @A.as.X.impl.F.loc26_14.2 [concrete] +// CHECK:STDOUT: %A.as.X.impl.F.type.48cdab.2: type = fn_type @A.as.X.impl.F.loc24_14.2 [concrete] // CHECK:STDOUT: %A.as.X.impl.F.bd5be1.2: %A.as.X.impl.F.type.48cdab.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %SubobjectDestroy.type: type = facet_type <@SubobjectDestroy> [concrete] // CHECK:STDOUT: %T.09f: %SubobjectDestroy.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.type.dea: type = fn_type @T.as_type.as.DestroyImpl.impl.Op, @T.as_type.as.DestroyImpl.impl(%T.09f) [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.6e5: %T.as_type.as.DestroyImpl.impl.Op.type.dea = struct_value () [symbolic] -// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc26_14.2 [concrete] +// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc24_14.2 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.2: %SubobjectDestroy.WithSelf.Op.type.6870fd.2 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.2: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.2), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.9bf: %SubobjectDestroy.type = facet_value %A, (%custom_witness.b80ef6.2) [concrete] // CHECK:STDOUT: %DestroyImpl.impl_witness.6d1: = impl_witness imports.%DestroyImpl.impl_witness_table, @T.as_type.as.DestroyImpl.impl(%SubobjectDestroy.facet.9bf) [concrete] // CHECK:STDOUT: %Destroy.facet.35e: %Destroy.type = facet_value %A, (%DestroyImpl.impl_witness.6d1, %custom_witness.b80ef6.2) [concrete] -// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.4: type = fn_type @SubobjectDestroy.WithSelf.Op.loc26_14.4 [concrete] +// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.4: type = fn_type @SubobjectDestroy.WithSelf.Op.loc24_14.4 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.4: %SubobjectDestroy.WithSelf.Op.type.6870fd.4 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.4: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.4), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.92e: %SubobjectDestroy.type = facet_value %B, (%custom_witness.b80ef6.4) [concrete] @@ -1128,17 +1120,17 @@ impl () as I({}) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @A.as.X.impl: %A.ref as %X.ref { -// CHECK:STDOUT: %A.as.X.impl.F.decl.loc26_14.1: %A.as.X.impl.F.type.48cdab.1 = fn_decl @A.as.X.impl.F.loc26_14.1 [concrete = constants.%A.as.X.impl.F.bd5be1.1] { +// CHECK:STDOUT: %A.as.X.impl.F.decl.loc24_14.1: %A.as.X.impl.F.type.48cdab.1 = fn_decl @A.as.X.impl.F.loc24_14.1 [concrete = constants.%A.as.X.impl.F.bd5be1.1] { // CHECK:STDOUT: %return.param_patt: %pattern_type.e39 = out_param_pattern [concrete = constants.%return.param_patt.934] // CHECK:STDOUT: %return.patt: %pattern_type.e39 = return_slot_pattern %return.param_patt, %B.ref [concrete = constants.%return.patt.911] // CHECK:STDOUT: } { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B] -// CHECK:STDOUT: %.loc26: Core.Form = init_form %B.ref [concrete = constants.%.d83] +// CHECK:STDOUT: %.loc24: Core.Form = init_form %B.ref [concrete = constants.%.d83] // CHECK:STDOUT: %return.param: ref %B = out_param call_param0 // CHECK:STDOUT: %return: ref %B = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %A.as.X.impl.F.decl.loc26_14.2: %A.as.X.impl.F.type.48cdab.2 = fn_decl @A.as.X.impl.F.loc26_14.2 [concrete = constants.%A.as.X.impl.F.bd5be1.2] { +// CHECK:STDOUT: %A.as.X.impl.F.decl.loc24_14.2: %A.as.X.impl.F.type.48cdab.2 = fn_decl @A.as.X.impl.F.loc24_14.2 [concrete = constants.%A.as.X.impl.F.bd5be1.2] { // CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: @@ -1147,57 +1139,57 @@ impl () as I({}) { // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .B = -// CHECK:STDOUT: .F = %A.as.X.impl.F.decl.loc26_14.1 +// CHECK:STDOUT: .F = %A.as.X.impl.F.decl.loc24_14.1 // CHECK:STDOUT: extend %X.ref // CHECK:STDOUT: witness = %X.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @A.as.X.impl.F.loc26_14.1() -> out %return.param: %B; +// CHECK:STDOUT: fn @A.as.X.impl.F.loc24_14.1() -> out %return.param: %B; // CHECK:STDOUT: -// CHECK:STDOUT: fn @A.as.X.impl.F.loc26_14.2() -> out %return.param: %A [thunk @A.as.X.impl.%A.as.X.impl.F.decl.loc26_14.1 for @X.WithSelf.%X.WithSelf.F.decl, @X.WithSelf.F(constants.%X.facet)] { +// CHECK:STDOUT: fn @A.as.X.impl.F.loc24_14.2() -> out %return.param: %A [thunk @A.as.X.impl.%A.as.X.impl.F.decl.loc24_14.1 for @X.WithSelf.%X.WithSelf.F.decl, @X.WithSelf.F(constants.%X.facet)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %A.as.X.impl.F.type.48cdab.1 = name_ref F, @A.as.X.impl.%A.as.X.impl.F.decl.loc26_14.1 [concrete = constants.%A.as.X.impl.F.bd5be1.1] -// CHECK:STDOUT: %.loc26_14.1: ref %B = temporary_storage -// CHECK:STDOUT: %A.as.X.impl.F.call: init %B to %.loc26_14.1 = call %F.ref() -// CHECK:STDOUT: %.loc26_14.2: ref %B = temporary %.loc26_14.1, %A.as.X.impl.F.call -// CHECK:STDOUT: %.loc26_14.3: ref %A = class_element_access %.loc26_14.2, element0 -// CHECK:STDOUT: %.loc26_14.4: ref %A = converted %A.as.X.impl.F.call, %.loc26_14.3 -// CHECK:STDOUT: %.loc26_14.5: %A = acquire_value %.loc26_14.4 -// CHECK:STDOUT: %Destroy.facet.loc26_14.1: %Destroy.type = facet_value constants.%B, (constants.%DestroyImpl.impl_witness.131, constants.%custom_witness.b80ef6.4) [concrete = constants.%Destroy.facet.09e] -// CHECK:STDOUT: %.loc26_14.6: %Destroy.type = converted constants.%B, %Destroy.facet.loc26_14.1 [concrete = constants.%Destroy.facet.09e] -// CHECK:STDOUT: %Destroy.facet.loc26_14.2: %Destroy.type = facet_value constants.%B, (constants.%DestroyImpl.impl_witness.131, constants.%custom_witness.b80ef6.4) [concrete = constants.%Destroy.facet.09e] -// CHECK:STDOUT: %.loc26_14.7: %Destroy.type = converted constants.%B, %Destroy.facet.loc26_14.2 [concrete = constants.%Destroy.facet.09e] +// CHECK:STDOUT: %F.ref: %A.as.X.impl.F.type.48cdab.1 = name_ref F, @A.as.X.impl.%A.as.X.impl.F.decl.loc24_14.1 [concrete = constants.%A.as.X.impl.F.bd5be1.1] +// CHECK:STDOUT: %.loc24_14.1: ref %B = temporary_storage +// CHECK:STDOUT: %A.as.X.impl.F.call: init %B to %.loc24_14.1 = call %F.ref() +// CHECK:STDOUT: %.loc24_14.2: ref %B = temporary %.loc24_14.1, %A.as.X.impl.F.call +// CHECK:STDOUT: %.loc24_14.3: ref %A = class_element_access %.loc24_14.2, element0 +// CHECK:STDOUT: %.loc24_14.4: ref %A = converted %A.as.X.impl.F.call, %.loc24_14.3 +// CHECK:STDOUT: %.loc24_14.5: %A = acquire_value %.loc24_14.4 +// CHECK:STDOUT: %Destroy.facet.loc24_14.1: %Destroy.type = facet_value constants.%B, (constants.%DestroyImpl.impl_witness.131, constants.%custom_witness.b80ef6.4) [concrete = constants.%Destroy.facet.09e] +// CHECK:STDOUT: %.loc24_14.6: %Destroy.type = converted constants.%B, %Destroy.facet.loc24_14.1 [concrete = constants.%Destroy.facet.09e] +// CHECK:STDOUT: %Destroy.facet.loc24_14.2: %Destroy.type = facet_value constants.%B, (constants.%DestroyImpl.impl_witness.131, constants.%custom_witness.b80ef6.4) [concrete = constants.%Destroy.facet.09e] +// CHECK:STDOUT: %.loc24_14.7: %Destroy.type = converted constants.%B, %Destroy.facet.loc24_14.2 [concrete = constants.%Destroy.facet.09e] // CHECK:STDOUT: -// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc26_14.2) +// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc24_14.2) // CHECK:STDOUT: return to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc26_14.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc24_14.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc26_14.2(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc24_14.2(%self.param: ref %A) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc26_14.3(%self.param: ref %struct_type.base.cb7) { +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc24_14.3(%self.param: ref %struct_type.base.cb7) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc26_14.1: ref %A = struct_access %self.param, element0 -// CHECK:STDOUT: %Destroy.facet.loc26_14.1: %Destroy.type = facet_value constants.%A, (constants.%DestroyImpl.impl_witness.6d1, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35e] -// CHECK:STDOUT: %.loc26_14.2: %Destroy.type = converted constants.%A, %Destroy.facet.loc26_14.1 [concrete = constants.%Destroy.facet.35e] -// CHECK:STDOUT: %Destroy.facet.loc26_14.2: %Destroy.type = facet_value constants.%A, (constants.%DestroyImpl.impl_witness.6d1, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35e] -// CHECK:STDOUT: %.loc26_14.3: %Destroy.type = converted constants.%A, %Destroy.facet.loc26_14.2 [concrete = constants.%Destroy.facet.35e] +// CHECK:STDOUT: %.loc24_14.1: ref %A = struct_access %self.param, element0 +// CHECK:STDOUT: %Destroy.facet.loc24_14.1: %Destroy.type = facet_value constants.%A, (constants.%DestroyImpl.impl_witness.6d1, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35e] +// CHECK:STDOUT: %.loc24_14.2: %Destroy.type = converted constants.%A, %Destroy.facet.loc24_14.1 [concrete = constants.%Destroy.facet.35e] +// CHECK:STDOUT: %Destroy.facet.loc24_14.2: %Destroy.type = facet_value constants.%A, (constants.%DestroyImpl.impl_witness.6d1, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35e] +// CHECK:STDOUT: %.loc24_14.3: %Destroy.type = converted constants.%A, %Destroy.facet.loc24_14.2 [concrete = constants.%Destroy.facet.35e] // CHECK:STDOUT: -// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc26_14.1) +// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc24_14.1) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc26_14.4(%self.param: ref %B) { +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc24_14.4(%self.param: ref %B) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %base.ref: %B.elem = name_ref base, @B.%.loc5 [concrete = @B.%.loc5] -// CHECK:STDOUT: %.loc26_14.1: ref %A = class_element_access %self.param, element0 -// CHECK:STDOUT: %Destroy.facet.loc26_14.1: %Destroy.type = facet_value constants.%A, (constants.%DestroyImpl.impl_witness.6d1, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35e] -// CHECK:STDOUT: %.loc26_14.2: %Destroy.type = converted constants.%A, %Destroy.facet.loc26_14.1 [concrete = constants.%Destroy.facet.35e] -// CHECK:STDOUT: %Destroy.facet.loc26_14.2: %Destroy.type = facet_value constants.%A, (constants.%DestroyImpl.impl_witness.6d1, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35e] -// CHECK:STDOUT: %.loc26_14.3: %Destroy.type = converted constants.%A, %Destroy.facet.loc26_14.2 [concrete = constants.%Destroy.facet.35e] +// CHECK:STDOUT: %.loc24_14.1: ref %A = class_element_access %self.param, element0 +// CHECK:STDOUT: %Destroy.facet.loc24_14.1: %Destroy.type = facet_value constants.%A, (constants.%DestroyImpl.impl_witness.6d1, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35e] +// CHECK:STDOUT: %.loc24_14.2: %Destroy.type = converted constants.%A, %Destroy.facet.loc24_14.1 [concrete = constants.%Destroy.facet.35e] +// CHECK:STDOUT: %Destroy.facet.loc24_14.2: %Destroy.type = facet_value constants.%A, (constants.%DestroyImpl.impl_witness.6d1, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35e] +// CHECK:STDOUT: %.loc24_14.3: %Destroy.type = converted constants.%A, %Destroy.facet.loc24_14.2 [concrete = constants.%Destroy.facet.35e] // CHECK:STDOUT: -// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc26_14.1) +// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc24_14.1) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/impl_thunk_min_prelude.carbon b/toolchain/check/testdata/impl/impl_thunk_min_prelude.carbon index f33b35058d53..96748caa8c63 100644 --- a/toolchain/check/testdata/impl/impl_thunk_min_prelude.carbon +++ b/toolchain/check/testdata/impl/impl_thunk_min_prelude.carbon @@ -51,13 +51,11 @@ interface OpWith(U: type) { } impl forall [T: type, U: Core.ImplicitAs(Wrap(T))] Wrap(T) as OpWith(U) { - // CHECK:STDERR: ╭─┤ fail_todo_out_of_line_thunk.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_out_of_line_thunk.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ fn Op(self, other: Self); // CHECK:STDERR: · ━━━━━━━━━━━━┳━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: use of undefined generic function - // CHECK:STDERR: · │ ┃ [MissingGenericFunctionDefinition] - // CHECK:STDERR: · ╰────┤ generic function declared here - // CHECK:STDERR: · │ [MissingGenericFunctionDefinitionHere] + // CHECK:STDERR: · ┃ [MissingGenericFunctionDefinition] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn Op(self, other: Self); diff --git a/toolchain/check/testdata/impl/import_compound.carbon b/toolchain/check/testdata/impl/import_compound.carbon index 613f08a19003..8461a05764bd 100644 --- a/toolchain/check/testdata/impl/import_compound.carbon +++ b/toolchain/check/testdata/impl/import_compound.carbon @@ -46,15 +46,12 @@ library "[[@TEST_NAME]]"; import library "lib"; fn NonInstanceCallImportFail(n: {.i: ()}) { - // CHECK:STDERR: ╭─┤ fail_import_non-instance.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_import_non-instance.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ n.(NonInstance.F)(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `{.i: ()}` into - // CHECK:STDERR: · │ ┃ type implementing `NonInstance` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `{.i: ()}` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(NonInstance)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type implementing `NonInstance` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: n.(NonInstance.F)(); @@ -66,15 +63,12 @@ library "[[@TEST_NAME]]"; import library "lib"; fn NonInstanceCallIndirectImport(p: {.i: ()}*) { - // CHECK:STDERR: ╭─┤ fail_import_non-instance_indirect.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_import_non-instance_indirect.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ p->(NonInstance.F)(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `{.i: ()}` into - // CHECK:STDERR: · │ ┃ type implementing `NonInstance` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `{.i: ()}` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(NonInstance)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type implementing `NonInstance` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: p->(NonInstance.F)(); @@ -509,7 +503,7 @@ fn InstanceCallImportFail() { // CHECK:STDOUT: %n.ref: %struct_type.i = name_ref n, %n // CHECK:STDOUT: %NonInstance.ref: type = name_ref NonInstance, imports.%Main.NonInstance [concrete = constants.%NonInstance.type] // CHECK:STDOUT: %F.ref: %NonInstance.assoc_type = name_ref F, imports.%Main.import_ref.12d [concrete = constants.%assoc0.dae] -// CHECK:STDOUT: %.loc17: %NonInstance.type = converted %n.ref, [concrete = ] +// CHECK:STDOUT: %.loc14: %NonInstance.type = converted %n.ref, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -603,8 +597,8 @@ fn InstanceCallImportFail() { // CHECK:STDOUT: %p.ref: %ptr = name_ref p, %p // CHECK:STDOUT: %NonInstance.ref: type = name_ref NonInstance, imports.%Main.NonInstance [concrete = constants.%NonInstance.type] // CHECK:STDOUT: %F.ref: %NonInstance.assoc_type = name_ref F, imports.%Main.import_ref.12d [concrete = constants.%assoc0.dae] -// CHECK:STDOUT: %.loc17_4.1: ref %struct_type.i = deref %p.ref -// CHECK:STDOUT: %.loc17_4.2: %NonInstance.type = converted %.loc17_4.1, [concrete = ] +// CHECK:STDOUT: %.loc14_4.1: ref %struct_type.i = deref %p.ref +// CHECK:STDOUT: %.loc14_4.2: %NonInstance.type = converted %.loc14_4.1, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/incomplete.carbon b/toolchain/check/testdata/impl/incomplete.carbon index 34c0ef0e2191..6522cfa9eb83 100644 --- a/toolchain/check/testdata/impl/incomplete.carbon +++ b/toolchain/check/testdata/impl/incomplete.carbon @@ -20,10 +20,11 @@ interface I; // Requires I identified. impl {} as I; -// CHECK:STDERR: ╭─┤ fail_empty_struct.carbon:[[@LINE+11]]:1 +// CHECK:STDERR: ╭─┤ fail_empty_struct.carbon:[[@LINE+12]]:1 // CHECK:STDERR: │ interface I; -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ interface was forward declared here [InterfaceForwardDeclaredHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ interface was forward declared here +// CHECK:STDERR: · │ [InterfaceForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ impl {} as I {} // CHECK:STDERR: · ━━━━━━━┳━━━━━━ @@ -48,10 +49,11 @@ class C {} // CHECK:STDERR: impl C as I; -// CHECK:STDERR: ╭─┤ fail_class.carbon:[[@LINE+11]]:1 +// CHECK:STDERR: ╭─┤ fail_class.carbon:[[@LINE+12]]:1 // CHECK:STDERR: │ interface J; -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ interface was forward declared here [InterfaceForwardDeclaredHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ interface was forward declared here +// CHECK:STDERR: · │ [InterfaceForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ impl C as J {} // CHECK:STDERR: · ━━━━━━┳━━━━━━ @@ -67,10 +69,11 @@ library "[[@TEST_NAME]]"; interface J; class C {} -// CHECK:STDERR: ╭─┤ fail_class_no_forward_decl.carbon:[[@LINE+11]]:1 +// CHECK:STDERR: ╭─┤ fail_class_no_forward_decl.carbon:[[@LINE+12]]:1 // CHECK:STDERR: │ interface J; -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ interface was forward declared here [InterfaceForwardDeclaredHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ interface was forward declared here +// CHECK:STDERR: · │ [InterfaceForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ impl C as J {} // CHECK:STDERR: · ━━━━━━┳━━━━━━ @@ -86,10 +89,11 @@ library "[[@TEST_NAME]]"; interface J; class C {} -// CHECK:STDERR: ╭─┤ fail_class_with_rewrite.carbon:[[@LINE+11]]:19 +// CHECK:STDERR: ╭─┤ fail_class_with_rewrite.carbon:[[@LINE+12]]:19 // CHECK:STDERR: │ interface J; -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ interface was forward declared here [InterfaceForwardDeclaredHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ interface was forward declared here +// CHECK:STDERR: · │ [InterfaceForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ impl C as J where .X = (); // CHECK:STDERR: · ━┳ @@ -99,10 +103,11 @@ class C {} // CHECK:STDERR: impl C as J where .X = (); -// CHECK:STDERR: ╭─┤ fail_class_with_rewrite.carbon:[[@LINE+11]]:19 +// CHECK:STDERR: ╭─┤ fail_class_with_rewrite.carbon:[[@LINE+12]]:19 // CHECK:STDERR: │ interface J; -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ interface was forward declared here [InterfaceForwardDeclaredHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ interface was forward declared here +// CHECK:STDERR: · │ [InterfaceForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ impl C as J where .X = () {} // CHECK:STDERR: · ━┳ @@ -171,9 +176,9 @@ interface Incomplete; impl C as I where .Self impls Incomplete { // CHECK:STDERR: ╭─┤ fail_declaration_lookup_into_incomplete.carbon:[[@LINE+21]]:19 // CHECK:STDERR: │ interface Incomplete; - // CHECK:STDERR: · ──────────┬────────── - // CHECK:STDERR: · ╰──┤ interface was forward declared here - // CHECK:STDERR: · │ [InterfaceForwardDeclaredHere] + // CHECK:STDERR: · ─────┬──── + // CHECK:STDERR: · ╰──┤ interface was forward declared here + // CHECK:STDERR: · │ [InterfaceForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F() -> Self.(Incomplete.T); // CHECK:STDERR: · ┳━━━━━━━━━━━ @@ -202,9 +207,9 @@ class C {} // Requires X identified. // CHECK:STDERR: ╭─┤ fail_unidentified_constraint.carbon:[[@LINE+12]]:1 // CHECK:STDERR: │ constraint X; -// CHECK:STDERR: · ──────┬────── -// CHECK:STDERR: · ╰──┤ constraint was forward declared here -// CHECK:STDERR: · │ [NamedConstraintForwardDeclaredHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ constraint was forward declared here +// CHECK:STDERR: · │ [NamedConstraintForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ impl C as X; // CHECK:STDERR: · ━━━━━━┳━━━━━ @@ -240,9 +245,9 @@ constraint A; interface B { // CHECK:STDERR: ╭─┤ fail_incomplete_constraint.carbon:[[@LINE+13]]:17 // CHECK:STDERR: │ constraint A; - // CHECK:STDERR: · ──────┬────── - // CHECK:STDERR: · ╰──┤ constraint was forward declared here - // CHECK:STDERR: · │ [NamedConstraintForwardDeclaredHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ constraint was forward declared here + // CHECK:STDERR: · │ [NamedConstraintForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ require impls A; // CHECK:STDERR: · ┳ @@ -277,11 +282,11 @@ interface B { // CHECK:STDOUT: } // CHECK:STDOUT: %.loc6: = impl_self_witness @empty_struct_type.as.I.impl.%.loc6_7.2, @I [concrete = constants.%.aaf] // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} { -// CHECK:STDOUT: %.loc19_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc19_7.2: type = converted %.loc19_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %I.ref.loc19: type = name_ref I, file.%I.decl [concrete = constants.%I.type] +// CHECK:STDOUT: %.loc20_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc20_7.2: type = converted %.loc20_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %I.ref.loc20: type = name_ref I, file.%I.decl [concrete = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19: = impl_self_witness @empty_struct_type.as.I.impl.%.loc19_7.2, @I [concrete = constants.%.aaf] +// CHECK:STDOUT: %.loc20: = impl_self_witness @empty_struct_type.as.I.impl.%.loc20_7.2, @I [concrete = constants.%.aaf] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I; @@ -323,7 +328,7 @@ interface B { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc26: = impl_self_witness @C.as.J.impl.%C.ref, @J [concrete = constants.%.ffd] +// CHECK:STDOUT: %.loc27: = impl_self_witness @C.as.J.impl.%C.ref, @J [concrete = constants.%.ffd] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @J; @@ -370,7 +375,7 @@ interface B { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc17: = impl_self_witness @C.as.J.impl.%C.ref, @J [concrete = constants.%.ffd] +// CHECK:STDOUT: %.loc18: = impl_self_witness @C.as.J.impl.%C.ref, @J [concrete = constants.%.ffd] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @J; @@ -414,42 +419,42 @@ interface B { // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {} // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} // CHECK:STDOUT: impl_decl @C.as..impl [concrete] {} { -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %J.ref.loc17: type = name_ref J, file.%J.decl [concrete = constants.%J.type] -// CHECK:STDOUT: %.Self.frozen.loc17: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] -// CHECK:STDOUT: %base_facet_type.loc17 = requirement_base_facet_type %J.ref.loc17 [concrete] -// CHECK:STDOUT: %.Self.ref.loc17: %J.type = name_ref .Self, %.Self.frozen.loc17 [symbolic_self = constants.%.Self.frozen] -// CHECK:STDOUT: %.Self.as_type.loc17: type = facet_access_type %.Self.ref.loc17 [symbolic_self = constants.%.Self.frozen.as_type] -// CHECK:STDOUT: %.loc17_19: type = converted %.Self.ref.loc17, %.Self.as_type.loc17 [symbolic_self = constants.%.Self.frozen.as_type] -// CHECK:STDOUT: %X.ref.loc17: = name_ref X, [concrete = ] -// CHECK:STDOUT: %.loc17_25: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %rewrite.loc17 = requirement_rewrite %X.ref.loc17, [concrete] -// CHECK:STDOUT: %.loc17_13: type = where_expr [concrete = ] { -// CHECK:STDOUT: %base_facet_type.loc17 = requirement_base_facet_type %J.ref.loc17 [concrete] -// CHECK:STDOUT: %rewrite.loc17 = requirement_rewrite %X.ref.loc17, [concrete] +// CHECK:STDOUT: %C.ref.loc18: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %J.ref.loc18: type = name_ref J, file.%J.decl [concrete = constants.%J.type] +// CHECK:STDOUT: %.Self.frozen.loc18: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] +// CHECK:STDOUT: %base_facet_type.loc18 = requirement_base_facet_type %J.ref.loc18 [concrete] +// CHECK:STDOUT: %.Self.ref.loc18: %J.type = name_ref .Self, %.Self.frozen.loc18 [symbolic_self = constants.%.Self.frozen] +// CHECK:STDOUT: %.Self.as_type.loc18: type = facet_access_type %.Self.ref.loc18 [symbolic_self = constants.%.Self.frozen.as_type] +// CHECK:STDOUT: %.loc18_19: type = converted %.Self.ref.loc18, %.Self.as_type.loc18 [symbolic_self = constants.%.Self.frozen.as_type] +// CHECK:STDOUT: %X.ref.loc18: = name_ref X, [concrete = ] +// CHECK:STDOUT: %.loc18_25: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %rewrite.loc18 = requirement_rewrite %X.ref.loc18, [concrete] +// CHECK:STDOUT: %.loc18_13: type = where_expr [concrete = ] { +// CHECK:STDOUT: %base_facet_type.loc18 = requirement_base_facet_type %J.ref.loc18 [concrete] +// CHECK:STDOUT: %rewrite.loc18 = requirement_rewrite %X.ref.loc18, [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @C.as..impl [concrete] {} { -// CHECK:STDOUT: %C.ref.loc30: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %J.ref.loc30: type = name_ref J, file.%J.decl [concrete = constants.%J.type] -// CHECK:STDOUT: %.Self.frozen.loc30: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] -// CHECK:STDOUT: %base_facet_type.loc30 = requirement_base_facet_type %J.ref.loc30 [concrete] -// CHECK:STDOUT: %.Self.ref.loc30: %J.type = name_ref .Self, %.Self.frozen.loc30 [symbolic_self = constants.%.Self.frozen] -// CHECK:STDOUT: %.Self.as_type.loc30: type = facet_access_type %.Self.ref.loc30 [symbolic_self = constants.%.Self.frozen.as_type] -// CHECK:STDOUT: %.loc30_19: type = converted %.Self.ref.loc30, %.Self.as_type.loc30 [symbolic_self = constants.%.Self.frozen.as_type] -// CHECK:STDOUT: %X.ref.loc30: = name_ref X, [concrete = ] -// CHECK:STDOUT: %.loc30_25: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %rewrite.loc30 = requirement_rewrite %X.ref.loc30, [concrete] -// CHECK:STDOUT: %.loc30_13: type = where_expr [concrete = ] { -// CHECK:STDOUT: %base_facet_type.loc30 = requirement_base_facet_type %J.ref.loc30 [concrete] -// CHECK:STDOUT: %rewrite.loc30 = requirement_rewrite %X.ref.loc30, [concrete] +// CHECK:STDOUT: %C.ref.loc32: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %J.ref.loc32: type = name_ref J, file.%J.decl [concrete = constants.%J.type] +// CHECK:STDOUT: %.Self.frozen.loc32: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] +// CHECK:STDOUT: %base_facet_type.loc32 = requirement_base_facet_type %J.ref.loc32 [concrete] +// CHECK:STDOUT: %.Self.ref.loc32: %J.type = name_ref .Self, %.Self.frozen.loc32 [symbolic_self = constants.%.Self.frozen] +// CHECK:STDOUT: %.Self.as_type.loc32: type = facet_access_type %.Self.ref.loc32 [symbolic_self = constants.%.Self.frozen.as_type] +// CHECK:STDOUT: %.loc32_19: type = converted %.Self.ref.loc32, %.Self.as_type.loc32 [symbolic_self = constants.%.Self.frozen.as_type] +// CHECK:STDOUT: %X.ref.loc32: = name_ref X, [concrete = ] +// CHECK:STDOUT: %.loc32_25: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %rewrite.loc32 = requirement_rewrite %X.ref.loc32, [concrete] +// CHECK:STDOUT: %.loc32_13: type = where_expr [concrete = ] { +// CHECK:STDOUT: %base_facet_type.loc32 = requirement_base_facet_type %J.ref.loc32 [concrete] +// CHECK:STDOUT: %rewrite.loc32 = requirement_rewrite %X.ref.loc32, [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @J; // CHECK:STDOUT: -// CHECK:STDOUT: impl @C.as..impl: %C.ref.loc17 as { +// CHECK:STDOUT: impl @C.as..impl: %C.ref.loc18 as { // CHECK:STDOUT: !members: // CHECK:STDOUT: extend // CHECK:STDOUT: witness = diff --git a/toolchain/check/testdata/impl/lookup/fail_function_types.carbon b/toolchain/check/testdata/impl/lookup/fail_function_types.carbon index 131aec577332..006162c183f5 100644 --- a/toolchain/check/testdata/impl/lookup/fail_function_types.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_function_types.carbon @@ -24,7 +24,7 @@ impl forall [T: type] T as Z { fn F() { // CHECK:STDERR: ╭─┤ fail_function_type_with_self_type.carbon:[[@LINE+6]]:3 // CHECK:STDERR: -> │ &(().(Z.G)) as type; - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ┳ ━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: ╰──── // CHECK:STDERR: @@ -39,7 +39,7 @@ fn F() { // // CHECK:STDERR: ╭─┤ fail_function_type.carbon:[[@LINE+6]]:3 // CHECK:STDERR: -> │ &F as type; - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ╻╺ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: ╰──── // CHECK:STDERR: diff --git a/toolchain/check/testdata/impl/lookup/impl_cycle.carbon b/toolchain/check/testdata/impl/lookup/impl_cycle.carbon index 142c98cf6492..29bc4c9fde6e 100644 --- a/toolchain/check/testdata/impl/lookup/impl_cycle.carbon +++ b/toolchain/check/testdata/impl/lookup/impl_cycle.carbon @@ -179,9 +179,9 @@ fn F() { // CHECK:STDERR: · │ [ImplLookupCycleNote] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn Compare[T: type, U: ComparableWith(T)](unused t: T, unused u: U) {} - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬─── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Compare({} as C, {} as C); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━ @@ -191,9 +191,9 @@ fn F() { // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_impl_cycle_one_generic_param.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn Compare[T: type, U: ComparableWith(T)](unused t: T, unused u: U) {} - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬─── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Compare({} as C, {} as C); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━ @@ -212,9 +212,9 @@ fn F() { // CHECK:STDERR: · │ [ImplLookupCycleNote] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn Compare[T: type, U: ComparableWith(T)](unused t: T, unused u: U) {} - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬─── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Compare({} as C, {} as D); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━ @@ -224,9 +224,9 @@ fn F() { // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_impl_cycle_one_generic_param.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn Compare[T: type, U: ComparableWith(T)](unused t: T, unused u: U) {} - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬─── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Compare({} as C, {} as D); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━ @@ -245,9 +245,9 @@ fn F() { // CHECK:STDERR: · │ [ImplLookupCycleNote] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn Compare[T: type, U: ComparableWith(T)](unused t: T, unused u: U) {} - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬─── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Compare({} as D, {} as C); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━ @@ -257,9 +257,9 @@ fn F() { // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_impl_cycle_one_generic_param.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn Compare[T: type, U: ComparableWith(T)](unused t: T, unused u: U) {} - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬─── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Compare({} as D, {} as C); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/toolchain/check/testdata/impl/lookup/import_error.carbon b/toolchain/check/testdata/impl/lookup/import_error.carbon index c3d077f75974..4659ea850a69 100644 --- a/toolchain/check/testdata/impl/lookup/import_error.carbon +++ b/toolchain/check/testdata/impl/lookup/import_error.carbon @@ -36,15 +36,12 @@ import library "error_interface_z"; fn F[unused U: type](generic T: Z) { // The value of `.X` is an error. It should not crash though. // - // CHECK:STDERR: ╭─┤ fail_import_error.carbon:[[@LINE+11]]:23 + // CHECK:STDERR: ╭─┤ fail_import_error.carbon:[[@LINE+8]]:23 // CHECK:STDERR: -> │ let unused a: T.X = (); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `()` to `T.(Z.X)` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `()` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(T.(Z.X))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `()` to `T.(Z.X)` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused a: T.X = (); diff --git a/toolchain/check/testdata/impl/lookup/specialization.carbon b/toolchain/check/testdata/impl/lookup/specialization.carbon index b069c31da976..49689f249dec 100644 --- a/toolchain/check/testdata/impl/lookup/specialization.carbon +++ b/toolchain/check/testdata/impl/lookup/specialization.carbon @@ -237,15 +237,12 @@ fn F[D: Y](unused d: D) { // 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+11]]:30 + // CHECK:STDERR: ╭─┤ fail_specialized_class_with_symbolic_facet_value_param.carbon:[[@LINE+8]]:30 // CHECK:STDERR: -> │ let unused a: C(D).(Z.X) = (); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of - // CHECK:STDERR: · │ ┃ type `()` to `C(D).(Z.X)` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `()` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(C(D).(Z.X))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type `()` to `C(D).(Z.X)` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused a: C(D).(Z.X) = (); @@ -343,15 +340,12 @@ impl forall [T: type, U: type] T as Z(U) where .X = () {} fn F[unused U: type](generic 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+11]]:23 + // CHECK:STDERR: ╭─┤ fail_specialization_written_after_generic_use_of_type_constant.carbon:[[@LINE+8]]:23 // CHECK:STDERR: -> │ let unused a: T.X = {} as C; // CHECK:STDERR: · ┳━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `C` to `T.(Z(C).X)` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `C` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(T.(Z(C).X))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `C` to `T.(Z(C).X)` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused a: T.X = {} as C; 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 3d9379aaf063..a1a860745260 100644 --- a/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon +++ b/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon @@ -45,15 +45,12 @@ 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(generic T: Z(C), t: T) { - // CHECK:STDERR: ╭─┤ fail_nonfinal_specialized_symbolic_rewrite.carbon:[[@LINE+11]]:23 + // CHECK:STDERR: ╭─┤ fail_nonfinal_specialized_symbolic_rewrite.carbon:[[@LINE+8]]:23 // CHECK:STDERR: -> │ let unused a: T.X = t; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `T` to `T.(Z(C).X)` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `T` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(T.(Z(C).X))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `T` to `T.(Z(C).X)` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused a: T.X = t; @@ -819,33 +816,33 @@ fn F[T: Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc14: = require_complete_type %T.as_type.loc14_26.1 [symbolic = %require_complete.loc14 (constants.%require_complete.6f0)] // CHECK:STDOUT: %Z.lookup_impl_witness: = lookup_impl_witness %T.loc14_15.1, @Z, @Z(constants.%C) [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc26_18.2: type = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_18.2 (constants.%impl.elem0.5bb)] -// CHECK:STDOUT: %require_complete.loc26_18: = require_complete_type %impl.elem0.loc26_18.2 [symbolic = %require_complete.loc26_18 (constants.%require_complete.fee)] -// CHECK:STDOUT: %pattern_type.loc26: type = pattern_type %impl.elem0.loc26_18.2 [symbolic = %pattern_type.loc26 (constants.%pattern_type.58e)] -// CHECK:STDOUT: %a.patt.loc26_15.2: @F.%pattern_type.loc26 (%pattern_type.58e) = value_binding_pattern a [symbolic = %a.patt.loc26_15.2 (constants.%a.patt)] -// CHECK:STDOUT: %ImplicitAs.type.loc26_23.2: type = facet_type <@ImplicitAs, @ImplicitAs(%impl.elem0.loc26_18.2)> [symbolic = %ImplicitAs.type.loc26_23.2 (constants.%ImplicitAs.type.64b)] -// CHECK:STDOUT: %require_complete.loc26_23: = require_complete_type %ImplicitAs.type.loc26_23.2 [symbolic = %require_complete.loc26_23 (constants.%require_complete.535)] -// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%impl.elem0.loc26_18.2) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.1b5)] +// CHECK:STDOUT: %impl.elem0.loc23_18.2: type = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc23_18.2 (constants.%impl.elem0.5bb)] +// CHECK:STDOUT: %require_complete.loc23_18: = require_complete_type %impl.elem0.loc23_18.2 [symbolic = %require_complete.loc23_18 (constants.%require_complete.fee)] +// CHECK:STDOUT: %pattern_type.loc23: type = pattern_type %impl.elem0.loc23_18.2 [symbolic = %pattern_type.loc23 (constants.%pattern_type.58e)] +// CHECK:STDOUT: %a.patt.loc23_15.2: @F.%pattern_type.loc23 (%pattern_type.58e) = value_binding_pattern a [symbolic = %a.patt.loc23_15.2 (constants.%a.patt)] +// CHECK:STDOUT: %ImplicitAs.type.loc23_23.2: type = facet_type <@ImplicitAs, @ImplicitAs(%impl.elem0.loc23_18.2)> [symbolic = %ImplicitAs.type.loc23_23.2 (constants.%ImplicitAs.type.64b)] +// CHECK:STDOUT: %require_complete.loc23_23: = require_complete_type %ImplicitAs.type.loc23_23.2 [symbolic = %require_complete.loc23_23 (constants.%require_complete.535)] +// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%impl.elem0.loc23_18.2) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.1b5)] // CHECK:STDOUT: %assoc0: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.1b5) = assoc_entity element0, imports.%Core.import_ref.a03 [symbolic = %assoc0 (constants.%assoc0.e44)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%t.param: @F.%T.as_type.loc14_26.1 (%T.as_type)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %t.ref: @F.%T.as_type.loc14_26.1 (%T.as_type) = name_ref t, %t -// CHECK:STDOUT: %ImplicitAs.type.loc26_23.1: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%impl.elem0.5bb)> [symbolic = %ImplicitAs.type.loc26_23.2 (constants.%ImplicitAs.type.64b)] -// CHECK:STDOUT: %.loc26_23.1: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.1b5) = specific_constant imports.%Core.import_ref.383, @ImplicitAs.WithSelf(constants.%impl.elem0.5bb, constants.%Self.862) [symbolic = %assoc0 (constants.%assoc0.e44)] -// CHECK:STDOUT: %Convert.ref: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.1b5) = name_ref Convert, %.loc26_23.1 [symbolic = %assoc0 (constants.%assoc0.e44)] -// CHECK:STDOUT: %.loc26_23.2: @F.%impl.elem0.loc26_18.2 (%impl.elem0.5bb) = converted %t.ref, [concrete = ] -// CHECK:STDOUT: %.loc26_18.1: type = splice_block %impl.elem0.loc26_18.1 [symbolic = %impl.elem0.loc26_18.2 (constants.%impl.elem0.5bb)] { -// CHECK:STDOUT: %T.ref.loc26: %Z.type.a07 = name_ref T, %T.loc14_15.2 [symbolic = %T.loc14_15.1 (constants.%T.bdb)] -// CHECK:STDOUT: %T.as_type.loc26: type = facet_access_type %T.ref.loc26 [symbolic = %T.as_type.loc14_26.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc26_18.2: type = converted %T.ref.loc26, %T.as_type.loc26 [symbolic = %T.as_type.loc14_26.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc26_18.3: %Z.assoc_type.714 = specific_constant @X.%assoc0, @Z.WithSelf(constants.%C, constants.%T.bdb) [concrete = constants.%assoc0.fd2] -// CHECK:STDOUT: %X.ref: %Z.assoc_type.714 = name_ref X, %.loc26_18.3 [concrete = constants.%assoc0.fd2] -// CHECK:STDOUT: %impl.elem0.loc26_18.1: type = impl_witness_access constants.%Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_18.2 (constants.%impl.elem0.5bb)] +// CHECK:STDOUT: %ImplicitAs.type.loc23_23.1: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%impl.elem0.5bb)> [symbolic = %ImplicitAs.type.loc23_23.2 (constants.%ImplicitAs.type.64b)] +// CHECK:STDOUT: %.loc23_23.1: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.1b5) = specific_constant imports.%Core.import_ref.383, @ImplicitAs.WithSelf(constants.%impl.elem0.5bb, constants.%Self.862) [symbolic = %assoc0 (constants.%assoc0.e44)] +// CHECK:STDOUT: %Convert.ref: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.1b5) = name_ref Convert, %.loc23_23.1 [symbolic = %assoc0 (constants.%assoc0.e44)] +// CHECK:STDOUT: %.loc23_23.2: @F.%impl.elem0.loc23_18.2 (%impl.elem0.5bb) = converted %t.ref, [concrete = ] +// CHECK:STDOUT: %.loc23_18.1: type = splice_block %impl.elem0.loc23_18.1 [symbolic = %impl.elem0.loc23_18.2 (constants.%impl.elem0.5bb)] { +// CHECK:STDOUT: %T.ref.loc23: %Z.type.a07 = name_ref T, %T.loc14_15.2 [symbolic = %T.loc14_15.1 (constants.%T.bdb)] +// CHECK:STDOUT: %T.as_type.loc23: type = facet_access_type %T.ref.loc23 [symbolic = %T.as_type.loc14_26.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc23_18.2: type = converted %T.ref.loc23, %T.as_type.loc23 [symbolic = %T.as_type.loc14_26.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc23_18.3: %Z.assoc_type.714 = specific_constant @X.%assoc0, @Z.WithSelf(constants.%C, constants.%T.bdb) [concrete = constants.%assoc0.fd2] +// CHECK:STDOUT: %X.ref: %Z.assoc_type.714 = name_ref X, %.loc23_18.3 [concrete = constants.%assoc0.fd2] +// CHECK:STDOUT: %impl.elem0.loc23_18.1: type = impl_witness_access constants.%Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc23_18.2 (constants.%impl.elem0.5bb)] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: @F.%impl.elem0.loc26_18.2 (%impl.elem0.5bb) = wrapper_binding a, [concrete = ] +// CHECK:STDOUT: %a: @F.%impl.elem0.loc23_18.2 (%impl.elem0.5bb) = wrapper_binding a, [concrete = ] // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %a.patt.loc26_15.1: @F.%pattern_type.loc26 (%pattern_type.58e) = value_binding_pattern a [symbolic = %a.patt.loc26_15.2 (constants.%a.patt)] +// CHECK:STDOUT: %a.patt.loc23_15.1: @F.%pattern_type.loc23 (%pattern_type.58e) = value_binding_pattern a [symbolic = %a.patt.loc23_15.2 (constants.%a.patt)] // CHECK:STDOUT: } // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/name_poisoning.carbon b/toolchain/check/testdata/impl/name_poisoning.carbon index f2bf595c6bb0..a93c37d84d76 100644 --- a/toolchain/check/testdata/impl/name_poisoning.carbon +++ b/toolchain/check/testdata/impl/name_poisoning.carbon @@ -36,22 +36,19 @@ interface I { class B { impl as I { - // CHECK:STDERR: ╭─┤ fail_impl_function_poisoned.carbon:[[@LINE+18]]:13 + // CHECK:STDERR: ╭─┤ fail_impl_function_poisoned.carbon:[[@LINE+15]]:13 // CHECK:STDERR: -> │ fn A(x: B); // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: accessing member from impl before it has a defined value // CHECK:STDERR: · ┃ [ImplAccessMemberBeforeSet] // CHECK:STDERR: ╰──── // CHECK:STDERR: - // CHECK:STDERR: ╭─┤ fail_impl_function_poisoned.carbon:[[@LINE+11]]:13 + // CHECK:STDERR: ╭─┤ fail_impl_function_poisoned.carbon:[[@LINE+8]]:13 // CHECK:STDERR: -> │ fn A(x: B); // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type - // CHECK:STDERR: · │ ┃ `` to `type` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(type)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `` to `type` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn A(x: B); diff --git a/toolchain/check/testdata/impl/orphan.carbon b/toolchain/check/testdata/impl/orphan.carbon index f57d999b2a5c..b24ee8285b85 100644 --- a/toolchain/check/testdata/impl/orphan.carbon +++ b/toolchain/check/testdata/impl/orphan.carbon @@ -391,15 +391,16 @@ library "[[@TEST_NAME]]"; import library "use_extern_class"; -// CHECK:STDERR: ╭─┤ fail_todo_extern_class.carbon:[[@LINE+11]]:1 +// CHECK:STDERR: ╭─┤ fail_todo_extern_class.carbon:[[@LINE+12]]:1 // CHECK:STDERR: -> │ extern class C; // CHECK:STDERR: · ━━━━━━━┳━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: redeclaration of `class C` is redundant [RedeclRedundant] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ fail_use_extern_class.carbon // CHECK:STDERR: │ extern library "extern_class" class C; -// CHECK:STDERR: · ───────────────────┬────────────────── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here +// CHECK:STDERR: · │ [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: extern class C; diff --git a/toolchain/check/testdata/impl/require_satisified_in_interface.carbon b/toolchain/check/testdata/impl/require_satisified_in_interface.carbon index e74c2fc7a97b..b7aef146be40 100644 --- a/toolchain/check/testdata/impl/require_satisified_in_interface.carbon +++ b/toolchain/check/testdata/impl/require_satisified_in_interface.carbon @@ -318,6 +318,17 @@ class W(T: type) { } interface A(N: Core.IntLiteral) { + // CHECK:STDERR: ╭─┤ fail_impl_requires_itself_cycle_with_monomorphization_error.carbon:[[@LINE+11]]:26 + // CHECK:STDERR: -> │ fn AA() -> W(Array((), N)); + // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ┗━━┫ error: array bound of -1 is negative + // CHECK:STDERR: · ┃ [ArrayBoundNegative] + // CHECK:STDERR: ┆ + // CHECK:STDERR: │ T.(A(-1).AA)(); + // CHECK:STDERR: · ───────┬────── + // CHECK:STDERR: · ╰──┤ in monomorphization of `AA()` here [ResolvingSpecificHere] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: fn AA() -> W(Array((), N)); } interface B(N: Core.IntLiteral) { @@ -342,16 +353,5 @@ impl forall [N: Core.IntLiteral, T: C(N)] T as B(N) { } fn F(generic T: C(-1)) { - // CHECK:STDERR: ╭─┤ fail_impl_requires_itself_cycle_with_monomorphization_error.carbon:[[@LINE+11]]:3 - // CHECK:STDERR: │ fn AA() -> W(Array((), N)); - // CHECK:STDERR: · ┬ - // CHECK:STDERR: · ╰──┤ array bound of -1 is negative [ArrayBoundNegative] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ T.(A(-1).AA)(); - // CHECK:STDERR: · ━━━━━━━┳━━━━━━ - // CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific `AA()` - // CHECK:STDERR: · ┃ [ResolvingSpecificHere] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: T.(A(-1).AA)(); } diff --git a/toolchain/check/testdata/impl/use_assoc_entity.carbon b/toolchain/check/testdata/impl/use_assoc_entity.carbon index d5a86bd01c86..b958e728e5f8 100644 --- a/toolchain/check/testdata/impl/use_assoc_entity.carbon +++ b/toolchain/check/testdata/impl/use_assoc_entity.carbon @@ -357,7 +357,7 @@ interface J2 { // CHECK:STDERR: ╭─┤ fail_todo_self_period_associated_type.carbon:[[@LINE+25]]:17 // CHECK:STDERR: │ interface J2 { // CHECK:STDERR: · ───────┬────── - // CHECK:STDERR: · ╰──┤ interface is currently being defined + // CHECK:STDERR: · ╰──┤ interface is incomplete within its definition // CHECK:STDERR: · │ [InterfaceIncompleteWithinDefinition] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F(self, z: Self.U2) -> Self.U2; @@ -369,7 +369,7 @@ interface J2 { // CHECK:STDERR: ╭─┤ fail_todo_self_period_associated_type.carbon:[[@LINE+13]]:29 // CHECK:STDERR: │ interface J2 { // CHECK:STDERR: · ───────┬────── - // CHECK:STDERR: · ╰──┤ interface is currently being defined + // CHECK:STDERR: · ╰──┤ interface is incomplete within its definition // CHECK:STDERR: · │ [InterfaceIncompleteWithinDefinition] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F(self, z: Self.U2) -> Self.U2; diff --git a/toolchain/check/testdata/impl/using_invalid_interface.carbon b/toolchain/check/testdata/impl/using_invalid_interface.carbon index e54968540633..e763637daec8 100644 --- a/toolchain/check/testdata/impl/using_invalid_interface.carbon +++ b/toolchain/check/testdata/impl/using_invalid_interface.carbon @@ -69,15 +69,15 @@ class C { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ fail_invalid_interface.carbon // CHECK:STDERR: │ fn Op(self) -> ArgToI(Arg); -// CHECK:STDERR: · ─────────────┬───────────── -// CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] +// CHECK:STDERR: · ─┬ +// CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(generic T: IMisuse) { T.Op(); } fn G() { var c: C; - // CHECK:STDERR: ╭─┤ fail_misusing_invalid_interface.carbon:[[@LINE+15]]:3 + // CHECK:STDERR: ╭─┤ fail_misusing_invalid_interface.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn F(generic T: IMisuse) { T.Op(); } // CHECK:STDERR: · ─────┬──── // CHECK:STDERR: · ╰──┤ initializing generic parameter `T` declared here @@ -86,10 +86,8 @@ fn G() { // CHECK:STDERR: -> │ F(c); // CHECK:STDERR: · ┳━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `C` into type - // CHECK:STDERR: · │ ┃ implementing `IMisuse` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `C` does not implement interface `Core.ImplicitAs(IMisuse)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ implementing `IMisuse` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: F(c); @@ -133,15 +131,15 @@ class C { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ fail_invalid_interface.carbon // CHECK:STDERR: │ fn Op(self) -> ArgToI(Arg); -// CHECK:STDERR: · ─────────────┬───────────── -// CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] +// CHECK:STDERR: · ─┬ +// CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F(generic T: IMisuse) { T.Op(); } fn G() { var c: C; - // CHECK:STDERR: ╭─┤ fail_using_invalid_interface.carbon:[[@LINE+15]]:3 + // CHECK:STDERR: ╭─┤ fail_using_invalid_interface.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn F(generic T: IMisuse) { T.Op(); } // CHECK:STDERR: · ─────┬──── // CHECK:STDERR: · ╰──┤ initializing generic parameter `T` declared here @@ -150,10 +148,8 @@ fn G() { // CHECK:STDERR: -> │ F(c); // CHECK:STDERR: · ┳━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `C` into type - // CHECK:STDERR: · │ ┃ implementing `IMisuse` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `C` does not implement interface `Core.ImplicitAs(IMisuse)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ implementing `IMisuse` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: F(c); diff --git a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon index 68e0a7cbc988..5b01cfe92f56 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -13,15 +13,12 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_array_non_int_indexing.carbon var a: array(i32, 1) = (12,); -// CHECK:STDERR: ╭─┤ fail_array_non_int_indexing.carbon:[[@LINE+11]]:16 +// CHECK:STDERR: ╭─┤ fail_array_non_int_indexing.carbon:[[@LINE+8]]:16 // CHECK:STDERR: -> │ var b: i32 = a[2.6]; // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type -// CHECK:STDERR: · │ ┃ `Core.FloatLiteral` to `i32` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `Core.FloatLiteral` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(i32)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `Core.FloatLiteral` to `i32` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var b: i32 = a[2.6]; @@ -117,7 +114,7 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %a.var_patt: %pattern_type.dc1 = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: %b.var: ref %i32 = var_storage %b.var_patt [concrete] -// CHECK:STDOUT: %i32.loc27: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %i32.loc24: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %b: ref %i32 = wrapper_binding b, %b.var [concrete = %b.var] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.d94 = ref_binding_pattern b [concrete = constants.%b.patt] @@ -143,14 +140,14 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: assign file.%a.var, %.loc15_1 // CHECK:STDOUT: %a.ref: ref %Array.00c = name_ref a, file.%a [concrete = file.%a.var] // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 26e-1 [concrete = constants.%float] -// CHECK:STDOUT: %.loc27_16: %i32 = converted %float, [concrete = ] -// CHECK:STDOUT: %.loc27_19.1: ref %i32 = array_index %a.ref, [concrete = ] -// CHECK:STDOUT: %.loc27_19.2: %i32 = acquire_value %.loc27_19.1 [concrete = ] -// CHECK:STDOUT: %impl.elem0.loc27: %.2b9 = impl_witness_access constants.%Copy.impl_witness.8af, element0 [concrete = constants.%Int.as.Copy.impl.Op.cae] -// CHECK:STDOUT: %bound_method.loc27_19.1: = bound_method %.loc27_19.2, %impl.elem0.loc27 [concrete = ] -// CHECK:STDOUT: %specific_fn.loc27: = specific_function %impl.elem0.loc27, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc27_19.2: = bound_method %.loc27_19.2, %specific_fn.loc27 [concrete = ] -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc27_19.2(%.loc27_19.2) [concrete = ] +// CHECK:STDOUT: %.loc24_16: %i32 = converted %float, [concrete = ] +// CHECK:STDOUT: %.loc24_19.1: ref %i32 = array_index %a.ref, [concrete = ] +// CHECK:STDOUT: %.loc24_19.2: %i32 = acquire_value %.loc24_19.1 [concrete = ] +// CHECK:STDOUT: %impl.elem0.loc24: %.2b9 = impl_witness_access constants.%Copy.impl_witness.8af, element0 [concrete = constants.%Int.as.Copy.impl.Op.cae] +// CHECK:STDOUT: %bound_method.loc24_19.1: = bound_method %.loc24_19.2, %impl.elem0.loc24 [concrete = ] +// 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_19.2: = bound_method %.loc24_19.2, %specific_fn.loc24 [concrete = ] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc24_19.2(%.loc24_19.2) [concrete = ] // CHECK:STDOUT: assign file.%b.var, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index 2ffecbacee69..77617347ba5c 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -18,7 +18,7 @@ fn G(b: array(i32, 3)) { // Indexing an array value gives a value. // CHECK:STDERR: ╭─┤ fail_expr_category.carbon:[[@LINE+8]]:25 // CHECK:STDERR: -> │ var unused pb: i32* = &b[0]; - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ╻╺━━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference // CHECK:STDERR: · ┃ expression // CHECK:STDERR: · ┃ [AddrOfNonRef] @@ -37,7 +37,7 @@ fn G(b: array(i32, 3)) { // expression) gives a value. // CHECK:STDERR: ╭─┤ fail_expr_category.carbon:[[@LINE+8]]:25 // CHECK:STDERR: -> │ var unused pf: i32* = &F()[0]; - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ╻╺━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference // CHECK:STDERR: · ┃ expression // CHECK:STDERR: · ┃ [AddrOfNonRef] diff --git a/toolchain/check/testdata/interface/compound_member_access.carbon b/toolchain/check/testdata/interface/compound_member_access.carbon index ddae6f396b99..a3a2f35c3537 100644 --- a/toolchain/check/testdata/interface/compound_member_access.carbon +++ b/toolchain/check/testdata/interface/compound_member_access.carbon @@ -57,14 +57,12 @@ fn Simple3(generic T: K2, x: T) { // Compound member access does not. It tries to convert `y` to `K2`, but only // its type `V` can. fn Compound3(generic V: K2, y: V) { - // CHECK:STDERR: ╭─┤ fail_caller_instance_interface_not.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_caller_instance_interface_not.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ y.(K2.Q2)(); // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `V` into type - // CHECK:STDERR: · │ ┃ implementing `K2` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `V` does not implement interface `Core.ImplicitAs(K2)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ implementing `K2` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: y.(K2.Q2)(); @@ -103,8 +101,8 @@ interface L2 { fn Simple5(generic T: L2) { // CHECK:STDERR: ╭─┤ fail_interface_instance_caller_not.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn R2(self); - // CHECK:STDERR: · ──────┬───── - // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] + // CHECK:STDERR: · ─┬ + // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ T.R2(); // CHECK:STDERR: · ━━━┳━━ @@ -115,8 +113,8 @@ fn Simple5(generic T: L2) { T.R2(); // CHECK:STDERR: ╭─┤ fail_interface_instance_caller_not.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn S2(ref self); - // CHECK:STDERR: · ────────┬─────── - // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] + // CHECK:STDERR: · ─┬ + // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ T.S2(); // CHECK:STDERR: · ━━━┳━━ @@ -164,36 +162,30 @@ impl C as A { // Since `A.G` is a non-instance method, compound member access may only be // used with a type, not an instance. fn Fails() { - // CHECK:STDERR: ╭─┤ fail_combine_non_instance.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_combine_non_instance.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ ({} as C).((A & A).G)(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `C` into type - // CHECK:STDERR: · │ ┃ implementing `A` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `C` does not implement interface `Core.ImplicitAs(A)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ implementing `A` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: ({} as C).((A & A).G)(); - // CHECK:STDERR: ╭─┤ fail_combine_non_instance.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_combine_non_instance.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ (({} as C) as (C as (A & A))).((A & A).G)(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `C` into type - // CHECK:STDERR: · │ ┃ implementing `A` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `C` does not implement interface `Core.ImplicitAs(A)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ implementing `A` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: (({} as C) as (C as (A & A))).((A & A).G)(); - // CHECK:STDERR: ╭─┤ fail_combine_non_instance.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_combine_non_instance.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ (({} as C) as (C as (A & A))).(A.G)(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `C` into type - // CHECK:STDERR: · │ ┃ implementing `A` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `C` does not implement interface `Core.ImplicitAs(A)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ implementing `A` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: (({} as C) as (C as (A & A))).(A.G)(); @@ -724,9 +716,9 @@ fn Works() { // CHECK:STDOUT: fn(%y.param: @Compound3.%V.as_type.loc14_32.1 (%V.as_type)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %y.ref: @Compound3.%V.as_type.loc14_32.1 (%V.as_type) = name_ref y, %y -// CHECK:STDOUT: %K2.ref.loc25: type = name_ref K2, file.%K2.decl [concrete = constants.%K2.type] +// CHECK:STDOUT: %K2.ref.loc23: type = name_ref K2, file.%K2.decl [concrete = constants.%K2.type] // CHECK:STDOUT: %Q2.ref: %K2.assoc_type = name_ref Q2, @K2.WithSelf.%assoc0 [concrete = constants.%assoc0.441] -// CHECK:STDOUT: %.loc25: %K2.type = converted %y.ref, [concrete = ] +// CHECK:STDOUT: %.loc23: %K2.type = converted %y.ref, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1532,62 +1524,62 @@ fn Works() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Fails() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc25_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %C.ref.loc25: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc25_5.2: ref %C = temporary_storage -// CHECK:STDOUT: %.loc25_5.3: init %C to %.loc25_5.2 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc25_7: init %C = converted %.loc25_5.1, %.loc25_5.3 [concrete = constants.%C.val] -// CHECK:STDOUT: %A.ref.loc25_15: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %A.ref.loc25_19: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %impl.elem0.loc25: %.b4e = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op] -// CHECK:STDOUT: %bound_method.loc25: = bound_method %A.ref.loc25_15, %impl.elem0.loc25 [concrete = constants.%type.as.BitAndWith.impl.Op.bound] -// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc25: init type = call %bound_method.loc25(%A.ref.loc25_15, %A.ref.loc25_19) [concrete = constants.%A.type] -// CHECK:STDOUT: %G.ref.loc25: %A.assoc_type = name_ref G, @A.WithSelf.%assoc0 [concrete = constants.%assoc0.050] -// CHECK:STDOUT: %.loc25_12: %A.type = converted %.loc25_7, [concrete = ] -// CHECK:STDOUT: %.loc36_6.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %C.ref.loc36_11: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc36_6.2: ref %C = temporary_storage -// CHECK:STDOUT: %.loc36_6.3: init %C to %.loc36_6.2 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc36_8: init %C = converted %.loc36_6.1, %.loc36_6.3 [concrete = constants.%C.val] -// CHECK:STDOUT: %C.ref.loc36_18: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %A.ref.loc36_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %A.ref.loc36_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %impl.elem0.loc36_26: %.b4e = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op] -// CHECK:STDOUT: %bound_method.loc36_26: = bound_method %A.ref.loc36_24, %impl.elem0.loc36_26 [concrete = constants.%type.as.BitAndWith.impl.Op.bound] -// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc36_26: init type = call %bound_method.loc36_26(%A.ref.loc36_24, %A.ref.loc36_28) [concrete = constants.%A.type] -// CHECK:STDOUT: %.loc36_29.1: type = value_of_initializer %type.as.BitAndWith.impl.Op.call.loc36_26 [concrete = constants.%A.type] -// CHECK:STDOUT: %.loc36_29.2: type = converted %type.as.BitAndWith.impl.Op.call.loc36_26, %.loc36_29.1 [concrete = constants.%A.type] -// CHECK:STDOUT: %A.facet.loc36: %A.type = facet_value %C.ref.loc36_18, (constants.%A.impl_witness) [concrete = constants.%A.facet] -// CHECK:STDOUT: %.loc36_20: %A.type = converted %C.ref.loc36_18, %A.facet.loc36 [concrete = constants.%A.facet] -// CHECK:STDOUT: %as_type.loc36: type = facet_access_type %.loc36_20 [concrete = constants.%C] -// CHECK:STDOUT: %.loc36_30: type = converted %.loc36_20, %as_type.loc36 [concrete = constants.%C] -// CHECK:STDOUT: %A.ref.loc36_35: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %A.ref.loc36_39: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %impl.elem0.loc36_37: %.b4e = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op] -// CHECK:STDOUT: %bound_method.loc36_37: = bound_method %A.ref.loc36_35, %impl.elem0.loc36_37 [concrete = constants.%type.as.BitAndWith.impl.Op.bound] -// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc36_37: init type = call %bound_method.loc36_37(%A.ref.loc36_35, %A.ref.loc36_39) [concrete = constants.%A.type] -// CHECK:STDOUT: %G.ref.loc36: %A.assoc_type = name_ref G, @A.WithSelf.%assoc0 [concrete = constants.%assoc0.050] -// CHECK:STDOUT: %.loc36_32: %A.type = converted %.loc36_8, [concrete = ] -// CHECK:STDOUT: %.loc47_6.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %C.ref.loc47_11: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc47_6.2: ref %C = temporary_storage -// CHECK:STDOUT: %.loc47_6.3: init %C to %.loc47_6.2 = class_init () [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc47_8: init %C = converted %.loc47_6.1, %.loc47_6.3 [concrete = constants.%C.val] -// CHECK:STDOUT: %C.ref.loc47_18: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %A.ref.loc47_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %A.ref.loc47_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %impl.elem0.loc47: %.b4e = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op] -// CHECK:STDOUT: %bound_method.loc47: = bound_method %A.ref.loc47_24, %impl.elem0.loc47 [concrete = constants.%type.as.BitAndWith.impl.Op.bound] -// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc47: init type = call %bound_method.loc47(%A.ref.loc47_24, %A.ref.loc47_28) [concrete = constants.%A.type] -// CHECK:STDOUT: %.loc47_29.1: type = value_of_initializer %type.as.BitAndWith.impl.Op.call.loc47 [concrete = constants.%A.type] -// CHECK:STDOUT: %.loc47_29.2: type = converted %type.as.BitAndWith.impl.Op.call.loc47, %.loc47_29.1 [concrete = constants.%A.type] -// CHECK:STDOUT: %A.facet.loc47: %A.type = facet_value %C.ref.loc47_18, (constants.%A.impl_witness) [concrete = constants.%A.facet] -// CHECK:STDOUT: %.loc47_20: %A.type = converted %C.ref.loc47_18, %A.facet.loc47 [concrete = constants.%A.facet] -// CHECK:STDOUT: %as_type.loc47: type = facet_access_type %.loc47_20 [concrete = constants.%C] -// CHECK:STDOUT: %.loc47_30: type = converted %.loc47_20, %as_type.loc47 [concrete = constants.%C] -// CHECK:STDOUT: %A.ref.loc47_34: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %G.ref.loc47: %A.assoc_type = name_ref G, @A.WithSelf.%assoc0 [concrete = constants.%assoc0.050] -// CHECK:STDOUT: %.loc47_32: %A.type = converted %.loc47_8, [concrete = ] +// CHECK:STDOUT: %.loc23_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %C.ref.loc23: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc23_5.2: ref %C = temporary_storage +// CHECK:STDOUT: %.loc23_5.3: init %C to %.loc23_5.2 = class_init () [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc23_7: init %C = converted %.loc23_5.1, %.loc23_5.3 [concrete = constants.%C.val] +// CHECK:STDOUT: %A.ref.loc23_15: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %A.ref.loc23_19: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %impl.elem0.loc23: %.b4e = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %bound_method.loc23: = bound_method %A.ref.loc23_15, %impl.elem0.loc23 [concrete = constants.%type.as.BitAndWith.impl.Op.bound] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc23: init type = call %bound_method.loc23(%A.ref.loc23_15, %A.ref.loc23_19) [concrete = constants.%A.type] +// CHECK:STDOUT: %G.ref.loc23: %A.assoc_type = name_ref G, @A.WithSelf.%assoc0 [concrete = constants.%assoc0.050] +// CHECK:STDOUT: %.loc23_12: %A.type = converted %.loc23_7, [concrete = ] +// CHECK:STDOUT: %.loc32_6.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %C.ref.loc32_11: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc32_6.2: ref %C = temporary_storage +// CHECK:STDOUT: %.loc32_6.3: init %C to %.loc32_6.2 = class_init () [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc32_8: init %C = converted %.loc32_6.1, %.loc32_6.3 [concrete = constants.%C.val] +// CHECK:STDOUT: %C.ref.loc32_18: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %A.ref.loc32_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %A.ref.loc32_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %impl.elem0.loc32_26: %.b4e = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %bound_method.loc32_26: = bound_method %A.ref.loc32_24, %impl.elem0.loc32_26 [concrete = constants.%type.as.BitAndWith.impl.Op.bound] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc32_26: init type = call %bound_method.loc32_26(%A.ref.loc32_24, %A.ref.loc32_28) [concrete = constants.%A.type] +// CHECK:STDOUT: %.loc32_29.1: type = value_of_initializer %type.as.BitAndWith.impl.Op.call.loc32_26 [concrete = constants.%A.type] +// CHECK:STDOUT: %.loc32_29.2: type = converted %type.as.BitAndWith.impl.Op.call.loc32_26, %.loc32_29.1 [concrete = constants.%A.type] +// CHECK:STDOUT: %A.facet.loc32: %A.type = facet_value %C.ref.loc32_18, (constants.%A.impl_witness) [concrete = constants.%A.facet] +// CHECK:STDOUT: %.loc32_20: %A.type = converted %C.ref.loc32_18, %A.facet.loc32 [concrete = constants.%A.facet] +// CHECK:STDOUT: %as_type.loc32: type = facet_access_type %.loc32_20 [concrete = constants.%C] +// CHECK:STDOUT: %.loc32_30: type = converted %.loc32_20, %as_type.loc32 [concrete = constants.%C] +// CHECK:STDOUT: %A.ref.loc32_35: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %A.ref.loc32_39: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %impl.elem0.loc32_37: %.b4e = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %bound_method.loc32_37: = bound_method %A.ref.loc32_35, %impl.elem0.loc32_37 [concrete = constants.%type.as.BitAndWith.impl.Op.bound] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc32_37: init type = call %bound_method.loc32_37(%A.ref.loc32_35, %A.ref.loc32_39) [concrete = constants.%A.type] +// CHECK:STDOUT: %G.ref.loc32: %A.assoc_type = name_ref G, @A.WithSelf.%assoc0 [concrete = constants.%assoc0.050] +// CHECK:STDOUT: %.loc32_32: %A.type = converted %.loc32_8, [concrete = ] +// CHECK:STDOUT: %.loc41_6.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %C.ref.loc41_11: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc41_6.2: ref %C = temporary_storage +// CHECK:STDOUT: %.loc41_6.3: init %C to %.loc41_6.2 = class_init () [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc41_8: init %C = converted %.loc41_6.1, %.loc41_6.3 [concrete = constants.%C.val] +// CHECK:STDOUT: %C.ref.loc41_18: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %A.ref.loc41_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %A.ref.loc41_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %impl.elem0.loc41: %.b4e = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op] +// CHECK:STDOUT: %bound_method.loc41: = bound_method %A.ref.loc41_24, %impl.elem0.loc41 [concrete = constants.%type.as.BitAndWith.impl.Op.bound] +// CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc41: init type = call %bound_method.loc41(%A.ref.loc41_24, %A.ref.loc41_28) [concrete = constants.%A.type] +// CHECK:STDOUT: %.loc41_29.1: type = value_of_initializer %type.as.BitAndWith.impl.Op.call.loc41 [concrete = constants.%A.type] +// CHECK:STDOUT: %.loc41_29.2: type = converted %type.as.BitAndWith.impl.Op.call.loc41, %.loc41_29.1 [concrete = constants.%A.type] +// CHECK:STDOUT: %A.facet.loc41: %A.type = facet_value %C.ref.loc41_18, (constants.%A.impl_witness) [concrete = constants.%A.facet] +// CHECK:STDOUT: %.loc41_20: %A.type = converted %C.ref.loc41_18, %A.facet.loc41 [concrete = constants.%A.facet] +// CHECK:STDOUT: %as_type.loc41: type = facet_access_type %.loc41_20 [concrete = constants.%C] +// CHECK:STDOUT: %.loc41_30: type = converted %.loc41_20, %as_type.loc41 [concrete = constants.%C] +// CHECK:STDOUT: %A.ref.loc41_34: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %G.ref.loc41: %A.assoc_type = name_ref G, @A.WithSelf.%assoc0 [concrete = constants.%assoc0.050] +// CHECK:STDOUT: %.loc41_32: %A.type = converted %.loc41_8, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon index aea62137e84d..50ebb6efd897 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon @@ -13,15 +13,12 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon interface I { - // CHECK:STDERR: ╭─┤ fail_assoc_const_bad_default.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_assoc_const_bad_default.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ let T: type = 42; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `Core.IntLiteral` - // CHECK:STDERR: · │ ┃ to `type` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(type)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `type` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: let T: type = 42; @@ -66,7 +63,7 @@ interface I { // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] { // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%T [concrete = constants.%assoc0.2ce] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete = constants.%int_42] -// CHECK:STDOUT: %.loc27: type = converted %int_42, [concrete = ] +// CHECK:STDOUT: %.loc24: type = converted %int_42, [concrete = ] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/interface/fail_definition_imported.carbon b/toolchain/check/testdata/interface/fail_definition_imported.carbon index 5c4adae76eb7..e2ad0ac18e7c 100644 --- a/toolchain/check/testdata/interface/fail_definition_imported.carbon +++ b/toolchain/check/testdata/interface/fail_definition_imported.carbon @@ -31,8 +31,8 @@ import library "a"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ a.carbon // CHECK:STDERR: │ interface I; -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: interface I {} diff --git a/toolchain/check/testdata/interface/fail_duplicate.carbon b/toolchain/check/testdata/interface/fail_duplicate.carbon index ea1fc27ef5a4..159982949189 100644 --- a/toolchain/check/testdata/interface/fail_duplicate.carbon +++ b/toolchain/check/testdata/interface/fail_duplicate.carbon @@ -20,8 +20,8 @@ interface Interface { } // CHECK:STDERR: ╭─┤ fail_redefine_without_dependents.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ interface Interface { } -// CHECK:STDERR: · ──────────┬────────── -// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] +// CHECK:STDERR: · ────┬──── +// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ interface Interface { // CHECK:STDERR: · ━━━━━━━━━━┳━━━━━━━━━━ @@ -40,8 +40,8 @@ interface Interface {} // CHECK:STDERR: ╭─┤ fail_redefine_with_dependents.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ interface Interface {} -// CHECK:STDERR: · ──────────┬────────── -// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] +// CHECK:STDERR: · ────┬──── +// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ interface Interface { // CHECK:STDERR: · ━━━━━━━━━━┳━━━━━━━━━━ @@ -60,7 +60,7 @@ fn Function(); // CHECK:STDERR: ╭─┤ fail_name_conflict_with_fn.carbon:[[@LINE+11]]:11 // CHECK:STDERR: │ fn Function(); -// CHECK:STDERR: · ───────┬────── +// CHECK:STDERR: · ────┬─── // CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ interface Function; @@ -77,8 +77,8 @@ class Class; // CHECK:STDERR: ╭─┤ fail_name_conflict_with_class.carbon:[[@LINE+11]]:11 // CHECK:STDERR: │ class Class; -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ──┬── +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ interface Class { } // CHECK:STDERR: · ━━┳━━ diff --git a/toolchain/check/testdata/interface/fail_lookup_undefined.carbon b/toolchain/check/testdata/interface/fail_lookup_undefined.carbon index 26f93ea38c1c..88f23a202bdf 100644 --- a/toolchain/check/testdata/interface/fail_lookup_undefined.carbon +++ b/toolchain/check/testdata/interface/fail_lookup_undefined.carbon @@ -16,9 +16,9 @@ interface Undefined; // CHECK:STDERR: ╭─┤ fail_lookup_undefined.carbon:[[@LINE+12]]:4 // CHECK:STDERR: │ interface Undefined; -// CHECK:STDERR: · ──────────┬───────── -// CHECK:STDERR: · ╰──┤ interface was forward declared here -// CHECK:STDERR: · │ [InterfaceForwardDeclaredHere] +// CHECK:STDERR: · ────┬──── +// CHECK:STDERR: · ╰──┤ interface was forward declared here +// CHECK:STDERR: · │ [InterfaceForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn Undefined.F(); // CHECK:STDERR: · ━━━━┳━━━━ @@ -31,9 +31,9 @@ fn Undefined.F(); fn Test() { // CHECK:STDERR: ╭─┤ fail_lookup_undefined.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ interface Undefined; - // CHECK:STDERR: · ──────────┬───────── - // CHECK:STDERR: · ╰──┤ interface was forward declared here - // CHECK:STDERR: · │ [InterfaceForwardDeclaredHere] + // CHECK:STDERR: · ────┬──── + // CHECK:STDERR: · ╰──┤ interface was forward declared here + // CHECK:STDERR: · │ [InterfaceForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Undefined.G(); // CHECK:STDERR: · ━━━━━┳━━━━━ @@ -48,7 +48,7 @@ interface BeingDefined { // CHECK:STDERR: ╭─┤ fail_lookup_undefined.carbon:[[@LINE+12]]:13 // CHECK:STDERR: │ interface BeingDefined { // CHECK:STDERR: · ────────────┬─────────── - // CHECK:STDERR: · ╰──┤ interface is currently being defined + // CHECK:STDERR: · ╰──┤ interface is incomplete within its definition // CHECK:STDERR: · │ [InterfaceIncompleteWithinDefinition] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn H() -> BeingDefined.T; diff --git a/toolchain/check/testdata/interface/fail_member_lookup.carbon b/toolchain/check/testdata/interface/fail_member_lookup.carbon index c5ebae35f71c..a468d80f8f01 100644 --- a/toolchain/check/testdata/interface/fail_member_lookup.carbon +++ b/toolchain/check/testdata/interface/fail_member_lookup.carbon @@ -31,15 +31,12 @@ fn F() { // CHECK:STDERR: Interface.F(); - // CHECK:STDERR: ╭─┤ fail_member_lookup.carbon:[[@LINE+11]]:17 + // CHECK:STDERR: ╭─┤ fail_member_lookup.carbon:[[@LINE+8]]:17 // CHECK:STDERR: -> │ var unused v: Interface.T; // CHECK:STDERR: · ┳━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type - // CHECK:STDERR: · │ ┃ `` to `type` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `` does not - // CHECK:STDERR: · │ implement interface `Core.ImplicitAs(type)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `` to `type` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused v: Interface.T; @@ -110,18 +107,18 @@ fn G(generic U: Different) -> U.(Interface.T); // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: %Different.decl: type = interface_decl @Different [concrete = constants.%Different.type] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { -// CHECK:STDOUT: %U.patt.loc44_15.1: %pattern_type.776 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc44_15.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.patt.loc41_15.1: %pattern_type.776 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc41_15.2 (constants.%U.patt)] // CHECK:STDOUT: %return.patt: = return_slot_pattern , [concrete = ] // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.ref: %Different.type = name_ref U, %U.loc44_15.2 [symbolic = %U.loc44_15.1 (constants.%U)] +// CHECK:STDOUT: %U.ref: %Different.type = name_ref U, %U.loc41_15.2 [symbolic = %U.loc41_15.1 (constants.%U)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [concrete = constants.%Interface.type] // CHECK:STDOUT: %T.ref: %Interface.assoc_type = name_ref T, @T.%assoc1 [concrete = constants.%assoc1] -// CHECK:STDOUT: %U.as_type.loc44_32.2: type = facet_access_type %U.ref [symbolic = %U.as_type.loc44_32.1 (constants.%U.as_type)] -// CHECK:STDOUT: %.loc44: type = splice_block %Different.ref [concrete = constants.%Different.type] { +// CHECK:STDOUT: %U.as_type.loc41_32.2: type = facet_access_type %U.ref [symbolic = %U.as_type.loc41_32.1 (constants.%U.as_type)] +// CHECK:STDOUT: %.loc41: type = splice_block %Different.ref [concrete = constants.%Different.type] { // CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen] // CHECK:STDOUT: %Different.ref: type = name_ref Different, file.%Different.decl [concrete = constants.%Different.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %U.loc44_15.2: %Different.type = symbolic_binding U, 0 [symbolic = %U.loc44_15.1 (constants.%U)] +// CHECK:STDOUT: %U.loc41_15.2: %Different.type = symbolic_binding U, 0 [symbolic = %U.loc41_15.1 (constants.%U)] // CHECK:STDOUT: %return: = return_slot // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -168,9 +165,9 @@ fn G(generic U: Different) -> U.(Interface.T); // CHECK:STDOUT: %v.var: ref = var_storage %v.var_patt [concrete = ] // CHECK:STDOUT: assign %v.var, // CHECK:STDOUT: %.1: = splice_block [concrete = ] { -// CHECK:STDOUT: %Interface.ref.loc30: type = name_ref Interface, file.%Interface.decl [concrete = constants.%Interface.type] +// CHECK:STDOUT: %Interface.ref.loc27: type = name_ref Interface, file.%Interface.decl [concrete = constants.%Interface.type] // CHECK:STDOUT: %T.ref: %Interface.assoc_type = name_ref T, @T.%assoc1 [concrete = constants.%assoc1] -// CHECK:STDOUT: %.loc30: type = converted %T.ref, [concrete = ] +// CHECK:STDOUT: %.loc27: type = converted %T.ref, [concrete = ] // CHECK:STDOUT: } // CHECK:STDOUT: %v: = wrapper_binding v, [concrete = ] // CHECK:STDOUT: name_binding_decl { @@ -180,10 +177,10 @@ fn G(generic U: Different) -> U.(Interface.T); // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @G(%U.loc44_15.2: %Different.type) { -// CHECK:STDOUT: %U.patt.loc44_15.2: %pattern_type.776 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc44_15.2 (constants.%U.patt)] -// CHECK:STDOUT: %U.loc44_15.1: %Different.type = symbolic_binding U, 0 [symbolic = %U.loc44_15.1 (constants.%U)] -// CHECK:STDOUT: %U.as_type.loc44_32.1: type = facet_access_type %U.loc44_15.1 [symbolic = %U.as_type.loc44_32.1 (constants.%U.as_type)] +// CHECK:STDOUT: generic fn @G(%U.loc41_15.2: %Different.type) { +// CHECK:STDOUT: %U.patt.loc41_15.2: %pattern_type.776 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc41_15.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.loc41_15.1: %Different.type = symbolic_binding U, 0 [symbolic = %U.loc41_15.1 (constants.%U)] +// CHECK:STDOUT: %U.as_type.loc41_32.1: type = facet_access_type %U.loc41_15.1 [symbolic = %U.as_type.loc41_32.1 (constants.%U.as_type)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> ; // CHECK:STDOUT: } @@ -200,8 +197,8 @@ fn G(generic U: Different) -> U.(Interface.T); // CHECK:STDOUT: specific @Different.WithSelf(constants.%Self.8ba) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%U) { -// CHECK:STDOUT: %U.patt.loc44_15.2 => constants.%U.patt -// CHECK:STDOUT: %U.loc44_15.1 => constants.%U -// CHECK:STDOUT: %U.as_type.loc44_32.1 => constants.%U.as_type +// CHECK:STDOUT: %U.patt.loc41_15.2 => constants.%U.patt +// CHECK:STDOUT: %U.loc41_15.1 => constants.%U +// CHECK:STDOUT: %U.as_type.loc41_32.1 => constants.%U.as_type // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_redeclare_member.carbon b/toolchain/check/testdata/interface/fail_redeclare_member.carbon index 1c6ec1f8509f..40f2e0c94258 100644 --- a/toolchain/check/testdata/interface/fail_redeclare_member.carbon +++ b/toolchain/check/testdata/interface/fail_redeclare_member.carbon @@ -16,7 +16,7 @@ interface Interface { fn F(); // CHECK:STDERR: ╭─┤ fail_redeclare_member.carbon:[[@LINE+10]]:3 // CHECK:STDERR: │ fn F(); - // CHECK:STDERR: · ───┬─── + // CHECK:STDERR: · ┬ // CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F(); diff --git a/toolchain/check/testdata/interface/fail_type_as_facet.carbon b/toolchain/check/testdata/interface/fail_type_as_facet.carbon index b585abcd5daa..69855d39d7e3 100644 --- a/toolchain/check/testdata/interface/fail_type_as_facet.carbon +++ b/toolchain/check/testdata/interface/fail_type_as_facet.carbon @@ -12,15 +12,12 @@ interface I { let T: type; - // CHECK:STDERR: ╭─┤ fail_type_as_facet.carbon:[[@LINE+11]]:17 + // CHECK:STDERR: ╭─┤ fail_type_as_facet.carbon:[[@LINE+8]]:17 // CHECK:STDERR: -> │ fn F[X: T](x: X); // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `T` - // CHECK:STDERR: · │ ┃ to `type` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `Self.(TODO: element 0 in incomplete Self as I)` - // CHECK:STDERR: · │ does not implement interface `Core.ImplicitAs(type)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `type` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn F[X: T](x: X); diff --git a/toolchain/check/testdata/interface/generic.carbon b/toolchain/check/testdata/interface/generic.carbon index 85ad9a392099..e6480e8b1cb1 100644 --- a/toolchain/check/testdata/interface/generic.carbon +++ b/toolchain/check/testdata/interface/generic.carbon @@ -75,8 +75,8 @@ interface Generic(T: type) {} // CHECK:STDERR: ╭─┤ fail_args_count_mismatch.carbon:[[@LINE+12]]:24 // CHECK:STDERR: │ interface Generic(T: type) {} -// CHECK:STDERR: · ──────────────┬───────────── -// CHECK:STDERR: · ╰──┤ calling generic interface declared here [InCallToEntity] +// CHECK:STDERR: · ───┬─── +// CHECK:STDERR: · ╰──┤ calling generic interface declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F(unused generic T: Generic((), ())) {} // CHECK:STDERR: · ┳━━━━━━━━━━━━━━ diff --git a/toolchain/check/testdata/interface/incomplete.carbon b/toolchain/check/testdata/interface/incomplete.carbon index 258cb01e7332..e87bafad1264 100644 --- a/toolchain/check/testdata/interface/incomplete.carbon +++ b/toolchain/check/testdata/interface/incomplete.carbon @@ -32,8 +32,8 @@ interface I { // CHECK:STDERR: ╭─┤ fail_incomplete_type_impl.carbon:[[@LINE+11]]:26 // CHECK:STDERR: │ class C; -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ impl {} as I where .T = ({} as C) {} // CHECK:STDERR: · ━━━┳━━━ @@ -65,9 +65,9 @@ constraint A; interface B { // CHECK:STDERR: ╭─┤ fail_incomplete_extend_constraint.carbon:[[@LINE+13]]:24 // CHECK:STDERR: │ constraint A; - // CHECK:STDERR: · ──────┬────── - // CHECK:STDERR: · ╰──┤ constraint was forward declared here - // CHECK:STDERR: · │ [NamedConstraintForwardDeclaredHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ constraint was forward declared here + // CHECK:STDERR: · │ [NamedConstraintForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ extend require impls A; // CHECK:STDERR: · ┳ @@ -86,7 +86,7 @@ interface A { // CHECK:STDERR: ╭─┤ fail_extend_require_enclosing.carbon:[[@LINE+12]]:24 // CHECK:STDERR: │ interface A { // CHECK:STDERR: · ──────┬────── - // CHECK:STDERR: · ╰──┤ interface is currently being defined + // CHECK:STDERR: · ╰──┤ interface is incomplete within its definition // CHECK:STDERR: · │ [InterfaceIncompleteWithinDefinition] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ extend require impls A; @@ -105,7 +105,7 @@ interface A(T: type) { // CHECK:STDERR: ╭─┤ fail_extend_require_enclosing_generic.carbon:[[@LINE+13]]:24 // CHECK:STDERR: │ interface A(T: type) { // CHECK:STDERR: · ───────────┬────────── - // CHECK:STDERR: · ╰──┤ interface is currently being defined + // CHECK:STDERR: · ╰──┤ interface is incomplete within its definition // CHECK:STDERR: · │ [InterfaceIncompleteWithinDefinition] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ extend require impls A({}); diff --git a/toolchain/check/testdata/interface/modifiers.carbon b/toolchain/check/testdata/interface/modifiers.carbon index 58b162d31821..97164d8ca4d2 100644 --- a/toolchain/check/testdata/interface/modifiers.carbon +++ b/toolchain/check/testdata/interface/modifiers.carbon @@ -215,8 +215,8 @@ class C { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ final_interfaces.carbon // CHECK:STDERR: │ final fn M(unused self) {} - // CHECK:STDERR: · ────────────┬──────────── - // CHECK:STDERR: · ╰──┤ associated function M declared here [AssociatedFunctionHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ associated function M declared here [AssociatedFunctionHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: impl as FinalMethod { diff --git a/toolchain/check/testdata/interface/no_definition_in_impl_file.carbon b/toolchain/check/testdata/interface/no_definition_in_impl_file.carbon index 11064be7aa19..253f247aa797 100644 --- a/toolchain/check/testdata/interface/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/interface/no_definition_in_impl_file.carbon @@ -59,8 +59,8 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ decl_in_api_decl_in_impl.carbon // CHECK:STDERR: │ interface C; -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+7]]:1 @@ -89,8 +89,8 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ decl_in_api_decl_and_definition_in_impl.carbon // CHECK:STDERR: │ interface D; -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: interface D; diff --git a/toolchain/check/testdata/interface/observe.carbon b/toolchain/check/testdata/interface/observe.carbon index e0a6115948b2..d537f49f8388 100644 --- a/toolchain/check/testdata/interface/observe.carbon +++ b/toolchain/check/testdata/interface/observe.carbon @@ -48,22 +48,19 @@ fn F[T: Transitive](t: T) { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ transitive.carbon // CHECK:STDERR: │ fn TakesC(self, c: C); - // CHECK:STDERR: · ───────────┬────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: t.TakesC(a); - // CHECK:STDERR: ╭─┤ fail_todo_equivalent.carbon:[[@LINE+11]]:4 + // CHECK:STDERR: ╭─┤ fail_todo_equivalent.carbon:[[@LINE+8]]:4 // CHECK:STDERR: -> │ (a as T.C).InR(); // CHECK:STDERR: · ┳━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `T.(Transitive.A)` to - // CHECK:STDERR: · │ ┃ `T.(Transitive.C)` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `T.(Transitive.A)` does not implement interface - // CHECK:STDERR: · │ `Core.As(T.(Transitive.C))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `T.(Transitive.C)` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: (a as T.C).InR(); @@ -82,9 +79,9 @@ fn F[T: C](x: T) { // CHECK:STDERR: ╭─┤ fail_todo_impls.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn RequiresA[T: A](unused x: T) {} - // CHECK:STDERR: · ────────────────┬──────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ────┬──── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ RequiresA(x); // CHECK:STDERR: · ┳━━━━━━━━━━━ @@ -119,9 +116,9 @@ fn G[T: Transitive](t: T) { observe T.A == T.C impls R; // CHECK:STDERR: ╭─┤ fail_todo_equivalent_impls.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn TakesPQR[U: P & Q & R](unused u: U) {} - // CHECK:STDERR: · ────────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ────┬─── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ TakesPQR(a); // CHECK:STDERR: · ┳━━━━━━━━━━ @@ -154,9 +151,9 @@ fn G[T: Transitive](t: T) { // CHECK:STDERR: ╭─┤ fail_equivalent_impls_without_observe.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn TakesPQR[U: P & Q & R](unused u: U) {} - // CHECK:STDERR: · ────────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ────┬─── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ TakesPQR(a); // CHECK:STDERR: · ┳━━━━━━━━━━ @@ -217,9 +214,9 @@ fn F[U: Z](t: U.Z1) { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ transitive.carbon // CHECK:STDERR: │ fn TakesC(self, c: C); - // CHECK:STDERR: · ───────────┬────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: t.TakesC(a); @@ -260,9 +257,9 @@ fn F[T: Y](t: T.Y1) { // CHECK:STDERR: ╭─┤ fail_todo_observe_nested_associated_constants.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn TakesC(self, c: C); - // CHECK:STDERR: · ───────────┬────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ t.TakesC(a); // CHECK:STDERR: · ┳━━━━━━━━━━ @@ -289,9 +286,9 @@ fn F[T: A, U: B where .Self == T, V: C where .Self == U]() { fn InnerF(x: V) { // CHECK:STDERR: ╭─┤ fail_todo_nested_functions_in_outer.carbon:[[@LINE+13]]:5 // CHECK:STDERR: │ fn TakesA[T: A](unused x: T) {} - // CHECK:STDERR: · ───────────────┬────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ TakesA(x); // CHECK:STDERR: · ┳━━━━━━━━ @@ -319,9 +316,9 @@ fn F[T: A, U: B where .Self == T, V: C where .Self == U]() { // CHECK:STDERR: ╭─┤ fail_todo_nested_functions_in_inner.carbon:[[@LINE+13]]:5 // CHECK:STDERR: │ fn TakesA[T: A](unused x: T) {} - // CHECK:STDERR: · ───────────────┬────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ TakesA(x); // CHECK:STDERR: · ┳━━━━━━━━ @@ -347,9 +344,9 @@ fn F[T: A, U: B where .Self == T, V: C where .Self == U]() { fn InnerF(x: V) { // CHECK:STDERR: ╭─┤ fail_nested_functions_lexical_order.carbon:[[@LINE+13]]:5 // CHECK:STDERR: │ fn TakesA[T: A](unused x: T) {} - // CHECK:STDERR: · ───────────────┬────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ TakesA(x); // CHECK:STDERR: · ┳━━━━━━━━ @@ -380,9 +377,9 @@ fn F[T: A, U: B where .Self == T, V: C where .Self == U](x: V) { // CHECK:STDERR: ╭─┤ fail_nested_functions_leak_upward.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn TakesA[T: A](unused x: T) {} - // CHECK:STDERR: · ───────────────┬────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ TakesA(x); // CHECK:STDERR: · ┳━━━━━━━━ @@ -425,9 +422,9 @@ fn F[T: A, U: B](x: U) { observe T == U; // CHECK:STDERR: ╭─┤ fail_invalid_equivalent.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn TakesA[T: A](unused x: T) {} - // CHECK:STDERR: · ───────────────┬────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ TakesA(x); // CHECK:STDERR: · ┳━━━━━━━━ @@ -585,9 +582,9 @@ fn F[W: A, X: I(W)](x: X) { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ generic_observe.carbon // CHECK:STDERR: │ fn TakesT(self, t: T); - // CHECK:STDERR: · ───────────┬────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: x.TakesT(v); diff --git a/toolchain/check/testdata/interface/require.carbon b/toolchain/check/testdata/interface/require.carbon index b1af34cca039..8777cf5366ec 100644 --- a/toolchain/check/testdata/interface/require.carbon +++ b/toolchain/check/testdata/interface/require.carbon @@ -391,15 +391,12 @@ library "[[@TEST_NAME]]"; interface Y {} interface Z(T: type) { - // CHECK:STDERR: ╭─┤ fail_non_type_impls.carbon:[[@LINE+11]]:11 + // CHECK:STDERR: ╭─┤ fail_non_type_impls.carbon:[[@LINE+8]]:11 // CHECK:STDERR: -> │ require 1 impls Y; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type - // CHECK:STDERR: · │ ┃ `Core.IntLiteral` to `type` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(type)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Core.IntLiteral` to `type` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: require 1 impls Y; diff --git a/toolchain/check/testdata/interface/syntactic_merge.carbon b/toolchain/check/testdata/interface/syntactic_merge.carbon index 1b5084c229f3..2ae5c67a0325 100644 --- a/toolchain/check/testdata/interface/syntactic_merge.carbon +++ b/toolchain/check/testdata/interface/syntactic_merge.carbon @@ -98,8 +98,8 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ two_file.carbon // CHECK:STDERR: │ interface Foo(a: C); -// CHECK:STDERR: · ──────────┬───────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ─┬─ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: interface Foo(a: C) {} @@ -111,8 +111,8 @@ interface Foo(a: C) {} // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ two_file.carbon // CHECK:STDERR: │ interface Bar(a: D); -// CHECK:STDERR: · ──────────┬───────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ─┬─ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: interface Bar(a: D) {} @@ -208,8 +208,8 @@ alias D = C; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ alias_two_file.carbon // CHECK:STDERR: │ interface Foo(a: C); -// CHECK:STDERR: · ──────────┬───────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ─┬─ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: interface Foo(a: D) {} diff --git a/toolchain/check/testdata/interop/cpp/basics/cpp_diagnostics.carbon b/toolchain/check/testdata/interop/cpp/basics/cpp_diagnostics.carbon index a9ce9fb7634a..8172369ca13b 100644 --- a/toolchain/check/testdata/interop/cpp/basics/cpp_diagnostics.carbon +++ b/toolchain/check/testdata/interop/cpp/basics/cpp_diagnostics.carbon @@ -544,7 +544,7 @@ void f(const int n) { // CHECK:STDERR: · ╰──┤ variable 'n' declared const here [CppInteropParseNote] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ ++n; - // CHECK:STDERR: · ┳ ─ + // CHECK:STDERR: · ┳ ━ // CHECK:STDERR: · ┗━━┫ error: cannot assign to variable 'n' with const-qualified type 'const // CHECK:STDERR: · ┃ int' // CHECK:STDERR: · ┃ [CppInteropParseError] diff --git a/toolchain/check/testdata/interop/cpp/basics/import/indirect.carbon b/toolchain/check/testdata/interop/cpp/basics/import/indirect.carbon index e1981525b0c1..661c091b43e5 100644 --- a/toolchain/check/testdata/interop/cpp/basics/import/indirect.carbon +++ b/toolchain/check/testdata/interop/cpp/basics/import/indirect.carbon @@ -89,14 +89,13 @@ namespace A { fn TryToUseNotLeaked() { // TODO: Clang's diagnostic for using a class whose definition is not // reachable is confusing. - // CHECK:STDERR: ╭─┤ fail_not_leaked.carbon:[[@LINE+14]]:17 + // CHECK:STDERR: ╭─┤ fail_not_leaked.carbon:[[@LINE+13]]:17 // CHECK:STDERR: -> │ var unused x: Cpp.A.X = 0; // CHECK:STDERR: · ┳━━━━━━ // CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type `X` in name // CHECK:STDERR: · ┃ binding declaration // CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: direct_import.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./shared.h // CHECK:STDERR: │ struct X { // CHECK:STDERR: · ┬ diff --git a/toolchain/check/testdata/interop/cpp/basics/share_ast.carbon b/toolchain/check/testdata/interop/cpp/basics/share_ast.carbon index 1392b44fd7c9..0cf802660861 100644 --- a/toolchain/check/testdata/interop/cpp/basics/share_ast.carbon +++ b/toolchain/check/testdata/interop/cpp/basics/share_ast.carbon @@ -150,7 +150,7 @@ namespace N; inline Cpp ''' // CHECK:STDERR: ╭─┤ fail_carbon_export_does_not_leak.carbon:[[@LINE+8]]:23 // CHECK:STDERR: -> │ using Leak1 = Carbon::ExportedClass; -// CHECK:STDERR: · ───────╴╻ +// CHECK:STDERR: · ━━━━━━━╸╻ // CHECK:STDERR: · ┗━━┫ error: no type named 'ExportedClass' in namespace // CHECK:STDERR: · ┃ 'Carbon' // CHECK:STDERR: · ┃ [CppInteropParseError] @@ -159,7 +159,7 @@ inline Cpp ''' using Leak1 = Carbon::ExportedClass; // CHECK:STDERR: ╭─┤ fail_carbon_export_does_not_leak.carbon:[[@LINE+8]]:26 // CHECK:STDERR: -> │ using Leak2 = Carbon::N::ExportedNested; -// CHECK:STDERR: · ──────────╴╻ +// CHECK:STDERR: · ━━━━━━━━━━╸╻ // CHECK:STDERR: · ┗━━┫ error: no type named 'ExportedNested' in namespace // CHECK:STDERR: · ┃ 'Carbon::N' // CHECK:STDERR: · ┃ [CppInteropParseError] @@ -168,7 +168,7 @@ using Leak1 = Carbon::ExportedClass; using Leak2 = Carbon::N::ExportedNested; // CHECK:STDERR: ╭─┤ fail_carbon_export_does_not_leak.carbon:[[@LINE+7]]:23 // CHECK:STDERR: -> │ using Leak3 = Carbon::PkgA::SameName; -// CHECK:STDERR: · ───────╴╻ +// CHECK:STDERR: · ━━━━━━━╸╻ // CHECK:STDERR: · ┗━━┫ error: no member named 'PkgA' in namespace 'Carbon' // CHECK:STDERR: · ┃ [CppInteropParseError] // CHECK:STDERR: ╰──── diff --git a/toolchain/check/testdata/interop/cpp/class/export/access.carbon b/toolchain/check/testdata/interop/cpp/class/export/access.carbon index 7493d4bc1585..932c12bbb467 100644 --- a/toolchain/check/testdata/interop/cpp/class/export/access.carbon +++ b/toolchain/check/testdata/interop/cpp/class/export/access.carbon @@ -37,7 +37,7 @@ void F() { // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_access_exported_private_var.carbon:[[@LINE+6]]:5 // CHECK:STDERR: -> │ b.a; - // CHECK:STDERR: · ─ ┳ + // CHECK:STDERR: · ━ ┳ // CHECK:STDERR: · ┗━━┫ warning: expression result unused [CppInteropParseWarning] // CHECK:STDERR: ╰──── // CHECK:STDERR: @@ -104,7 +104,7 @@ void F() { // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_access_exported_private_var_in_generic.carbon:[[@LINE+6]]:5 // CHECK:STDERR: -> │ b.a; - // CHECK:STDERR: · ─ ┳ + // CHECK:STDERR: · ━ ┳ // CHECK:STDERR: · ┗━━┫ warning: expression result unused [CppInteropParseWarning] // CHECK:STDERR: ╰──── // CHECK:STDERR: @@ -141,7 +141,7 @@ void F() { // TODO: this error should be that `F` is a private member of `B`. // CHECK:STDERR: ╭─┤ fail_todo_access_exported_private_method_in_generic.carbon:[[@LINE+7]]:5 // CHECK:STDERR: -> │ b.F(); - // CHECK:STDERR: · ─ ┳ + // CHECK:STDERR: · ━ ┳ // CHECK:STDERR: · ┗━━┫ error: no member named 'F' in 'Carbon::Main::B' // CHECK:STDERR: · ┃ [CppInteropParseError] // CHECK:STDERR: ╰──── diff --git a/toolchain/check/testdata/interop/cpp/class/export/base.carbon b/toolchain/check/testdata/interop/cpp/class/export/base.carbon index bcc81d8b84d8..c4af3b8a633a 100644 --- a/toolchain/check/testdata/interop/cpp/class/export/base.carbon +++ b/toolchain/check/testdata/interop/cpp/class/export/base.carbon @@ -97,9 +97,9 @@ struct VirtualDestructor { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon // CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) { -// CHECK:STDERR: · ───────────────────┬─────────────────── -// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here -// CHECK:STDERR: · │ [DeductionGenericHere] +// CHECK:STDERR: · ──────┬───── +// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here +// CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: abstract class AbstractWithVdtor { @@ -151,9 +151,9 @@ import Cpp; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon // CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) { -// CHECK:STDERR: · ───────────────────┬─────────────────── -// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here -// CHECK:STDERR: · │ [DeductionGenericHere] +// CHECK:STDERR: · ──────┬───── +// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here +// CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: abstract class AbstractNonvirtualDtor {} @@ -179,9 +179,9 @@ import Cpp; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon // CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) { -// CHECK:STDERR: · ───────────────────┬─────────────────── -// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here -// CHECK:STDERR: · │ [DeductionGenericHere] +// CHECK:STDERR: · ──────┬───── +// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here +// CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: abstract class AbstractWithMethodNoVptr { @@ -210,9 +210,9 @@ import Cpp; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon // CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) { -// CHECK:STDERR: · ───────────────────┬─────────────────── -// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here -// CHECK:STDERR: · │ [DeductionGenericHere] +// CHECK:STDERR: · ──────┬───── +// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here +// CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: abstract class AbstractWithMethod { @@ -256,9 +256,9 @@ import Cpp; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon // CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) { -// CHECK:STDERR: · ───────────────────┬─────────────────── -// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here -// CHECK:STDERR: · │ [DeductionGenericHere] +// CHECK:STDERR: · ──────┬───── +// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here +// CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: abstract class AbstractToOverride { diff --git a/toolchain/check/testdata/interop/cpp/class/export/class.carbon b/toolchain/check/testdata/interop/cpp/class/export/class.carbon index 675c7c66a0d6..2dd144c64633 100644 --- a/toolchain/check/testdata/interop/cpp/class/export/class.carbon +++ b/toolchain/check/testdata/interop/cpp/class/export/class.carbon @@ -59,16 +59,21 @@ library "[[@TEST_NAME]]"; import Cpp; -// CHECK:STDERR: ╭─┤ fail_incomplete_concrete.carbon:[[@LINE+7]]:1 -// CHECK:STDERR: -> │ class IncompleteConcreteA; -// CHECK:STDERR: · ━━━━━━━━━━━━━┳━━━━━━━━━━━━ -// CHECK:STDERR: · ┗━━┫ error: class was forward declared here -// CHECK:STDERR: · ┃ [ClassForwardDeclaredHere] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: class IncompleteConcreteA; inline Cpp ''' +// CHECK:STDERR: ╭─┤ fail_incomplete_concrete.carbon:[[@LINE+27]]:50 +// CHECK:STDERR: │ class IncompleteConcreteA; +// CHECK:STDERR: · ─────────┬───────── +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: ┆ +// CHECK:STDERR: -> │ Carbon::IncompleteConcreteA incomplete_concrete_a; +// CHECK:STDERR: · ┳ +// CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ +// CHECK:STDERR: · ┃ error: use of incomplete Carbon type `IncompleteConcreteA` +// CHECK:STDERR: · ┃ [IncompleteTypeInCppUse] +// CHECK:STDERR: ╰──── +// CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_incomplete_concrete.carbon:[[@LINE+15]]:29 // CHECK:STDERR: │ class IncompleteConcreteA; // CHECK:STDERR: · ┬ @@ -116,7 +121,7 @@ inline Cpp ''' // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_todo_monomorphization_failure.carbon:[[@LINE+7]]:9 // CHECK:STDERR: -> │ Carbon::T t; -// CHECK:STDERR: · ───────╴╻ +// CHECK:STDERR: · ━━━━━━━╸╻ // CHECK:STDERR: · ┗━━┫ error: no type named 'T' in namespace 'Carbon' // CHECK:STDERR: · ┃ [CppInteropParseError] // CHECK:STDERR: ╰──── diff --git a/toolchain/check/testdata/interop/cpp/class/export/field.carbon b/toolchain/check/testdata/interop/cpp/class/export/field.carbon index c2f1e9f58142..e5d1d0741c49 100644 --- a/toolchain/check/testdata/interop/cpp/class/export/field.carbon +++ b/toolchain/check/testdata/interop/cpp/class/export/field.carbon @@ -77,7 +77,7 @@ void AccessNonexistentField() { Carbon::EmptyClass a; // CHECK:STDERR: ╭─┤ fail_nonexistent_field.carbon:[[@LINE+7]]:5 // CHECK:STDERR: -> │ a.x = 12; - // CHECK:STDERR: · ─ ┳ + // CHECK:STDERR: · ━ ┳ // CHECK:STDERR: · ┗━━┫ error: no member named 'x' in 'Carbon::Main::EmptyClass' // CHECK:STDERR: · ┃ [CppInteropParseError] // CHECK:STDERR: ╰──── @@ -85,7 +85,7 @@ void AccessNonexistentField() { a.x = 12; // CHECK:STDERR: ╭─┤ fail_nonexistent_field.carbon:[[@LINE+7]]:5 // CHECK:STDERR: -> │ a.y = 34; - // CHECK:STDERR: · ─ ┳ + // CHECK:STDERR: · ━ ┳ // CHECK:STDERR: · ┗━━┫ error: no member named 'y' in 'Carbon::Main::EmptyClass' // CHECK:STDERR: · ┃ [CppInteropParseError] // CHECK:STDERR: ╰──── @@ -122,7 +122,7 @@ void AccessUnsupportedField() { Carbon::UnsupportedFieldType a; // CHECK:STDERR: ╭─┤ fail_unsupported_field_type.carbon:[[@LINE+7]]:5 // CHECK:STDERR: -> │ a.x; - // CHECK:STDERR: · ─ ┳ + // CHECK:STDERR: · ━ ┳ // CHECK:STDERR: · ┗━━┫ error: no member named 'x' in 'Carbon::Main::UnsupportedFieldType' // CHECK:STDERR: · ┃ [CppInteropParseError] // CHECK:STDERR: ╰──── @@ -130,7 +130,7 @@ void AccessUnsupportedField() { a.x; // CHECK:STDERR: ╭─┤ fail_unsupported_field_type.carbon:[[@LINE+7]]:5 // CHECK:STDERR: -> │ a.y; - // CHECK:STDERR: · ─ ┳ + // CHECK:STDERR: · ━ ┳ // CHECK:STDERR: · ┗━━┫ error: no member named 'y' in 'Carbon::Main::UnsupportedFieldType' // CHECK:STDERR: · ┃ [CppInteropParseError] // CHECK:STDERR: ╰──── @@ -152,7 +152,7 @@ void AccessAdaptedField() { Carbon::AdaptedClass a; // CHECK:STDERR: ╭─┤ fail_adapter.carbon:[[@LINE+7]]:5 // CHECK:STDERR: -> │ a.x = 12; - // CHECK:STDERR: · ─ ┳ + // CHECK:STDERR: · ━ ┳ // CHECK:STDERR: · ┗━━┫ error: no member named 'x' in 'Carbon::Main::AdaptedClass' // CHECK:STDERR: · ┃ [CppInteropParseError] // CHECK:STDERR: ╰──── diff --git a/toolchain/check/testdata/interop/cpp/class/export/generic.carbon b/toolchain/check/testdata/interop/cpp/class/export/generic.carbon index 327df09c2198..d92b68b29c02 100644 --- a/toolchain/check/testdata/interop/cpp/class/export/generic.carbon +++ b/toolchain/check/testdata/interop/cpp/class/export/generic.carbon @@ -68,7 +68,7 @@ void FUnsupported() { // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_unsupported_specific_arg.carbon:[[@LINE+7]]:11 // CHECK:STDERR: -> │ Carbon::AliasEmptyTuple a; - // CHECK:STDERR: · ───────╴╻ + // CHECK:STDERR: · ━━━━━━━╸╻ // CHECK:STDERR: · ┗━━┫ error: no type named 'AliasEmptyTuple' in namespace 'Carbon' // CHECK:STDERR: · ┃ [CppInteropParseError] // CHECK:STDERR: ╰──── @@ -99,7 +99,7 @@ void FMethodCall() { Carbon::ClassWithMethod c; // CHECK:STDERR: ╭─┤ fail_todo_generic_class_method_call.carbon:[[@LINE+7]]:5 // CHECK:STDERR: -> │ c.M(); - // CHECK:STDERR: · ─ ┳ + // CHECK:STDERR: · ━ ┳ // CHECK:STDERR: · ┗━━┫ error: no member named 'M' in 'Carbon::Main::ClassWithMethod' // CHECK:STDERR: · ┃ [CppInteropParseError] // CHECK:STDERR: ╰──── diff --git a/toolchain/check/testdata/interop/cpp/class/import/access.carbon b/toolchain/check/testdata/interop/cpp/class/import/access.carbon index a70ff4addae5..d1a06b27c2af 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/access.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/access.carbon @@ -85,14 +85,13 @@ fn F(c: Cpp.NonFunctionMemberProtected) { // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused instance_data: i32 = c.instance_data; - // CHECK:STDERR: ╭─┤ fail_import_non_function_member_protected.carbon:[[@LINE+10]]:33 + // CHECK:STDERR: ╭─┤ fail_import_non_function_member_protected.carbon:[[@LINE+9]]:33 // CHECK:STDERR: -> │ let unused static_data: i32 = Cpp.NonFunctionMemberProtected.static_data; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access protected member - // CHECK:STDERR: · │ ┃ `static_data` of type - // CHECK:STDERR: · │ ┃ `Cpp.NonFunctionMemberProtected` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `static_data` of type + // CHECK:STDERR: · ┃ `Cpp.NonFunctionMemberProtected` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused static_data: i32 = Cpp.NonFunctionMemberProtected.static_data; @@ -123,13 +122,12 @@ fn F(d: Derived) { // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused instance_data: i32 = d.instance_data; - // CHECK:STDERR: ╭─┤ fail_import_non_function_member_protected_extend.carbon:[[@LINE+9]]:33 + // CHECK:STDERR: ╭─┤ fail_import_non_function_member_protected_extend.carbon:[[@LINE+8]]:33 // CHECK:STDERR: -> │ let unused static_data: i32 = Derived.static_data; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access protected member - // CHECK:STDERR: · │ ┃ `static_data` of type `Derived` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `static_data` of type `Derived` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused static_data: i32 = Derived.static_data; @@ -186,14 +184,13 @@ fn F(c: Cpp.NonFunctionMemberPrivate) { // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused instance_data: i32 = c.instance_data; - // CHECK:STDERR: ╭─┤ fail_import_non_function_member_private.carbon:[[@LINE+10]]:33 + // CHECK:STDERR: ╭─┤ fail_import_non_function_member_private.carbon:[[@LINE+9]]:33 // CHECK:STDERR: -> │ let unused static_data: i32 = Cpp.NonFunctionMemberPrivate.static_data; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member - // CHECK:STDERR: · │ ┃ `static_data` of type - // CHECK:STDERR: · │ ┃ `Cpp.NonFunctionMemberPrivate` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `static_data` of type + // CHECK:STDERR: · ┃ `Cpp.NonFunctionMemberPrivate` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused static_data: i32 = Cpp.NonFunctionMemberPrivate.static_data; @@ -242,23 +239,21 @@ fn F(d: Derived) { // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused instance_data: i32 = d.instance_data; - // CHECK:STDERR: ╭─┤ fail_import_non_function_member_private_extend.carbon:[[@LINE+11]]:41 + // CHECK:STDERR: ╭─┤ fail_import_non_function_member_private_extend.carbon:[[@LINE+9]]:41 // CHECK:STDERR: -> │ let unused derived_static_data: i32 = Derived.static_data; // CHECK:STDERR: · ━━━━━━━━━┳━━━━━━━━━ // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ // CHECK:STDERR: · ┃ error: cannot access private member `static_data` of type // CHECK:STDERR: · ┃ `Cpp.NonFunctionMemberPrivate` // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰──┤ declared here - // CHECK:STDERR: · │ [ClassMemberDeclaration] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused derived_static_data: i32 = Derived.static_data; // CHECK:STDERR: ╭─┤ fail_import_non_function_member_private_extend.carbon:[[@LINE+14]]:38 // CHECK:STDERR: │ let unused derived_static_data: i32 = Derived.static_data; - // CHECK:STDERR: · ─────────┬───────── - // CHECK:STDERR: · ╰──┤ declared here - // CHECK:STDERR: · │ [ClassMemberDeclaration] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ declared here + // CHECK:STDERR: · │ [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let unused base_static_data: i32 = Cpp.NonFunctionMemberPrivate.static_data; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -282,15 +277,13 @@ class Derived { fn F() { // TODO: `NonFunctionMemberPrivate.static_data` is private, so this // should fail. - // CHECK:STDERR: ╭─┤ fail_import_non_function_member_private_extend_static_within_member_function.carbon:[[@LINE+11]]:47 + // CHECK:STDERR: ╭─┤ fail_import_non_function_member_private_extend_static_within_member_function.carbon:[[@LINE+9]]:47 // CHECK:STDERR: -> │ let unused unqualified_static_data: i32 = static_data; // CHECK:STDERR: · ━━━━━┳━━━━━ // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ // CHECK:STDERR: · ┃ error: cannot access private member `static_data` of type // CHECK:STDERR: · ┃ `Cpp.NonFunctionMemberPrivate` // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰──┤ declared here - // CHECK:STDERR: · │ [ClassMemberDeclaration] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused unqualified_static_data: i32 = static_data; @@ -340,23 +333,21 @@ library "[[@TEST_NAME]]"; import Cpp library "function_member_protected.h"; fn F(c: Cpp.FunctionMemberProtected*) { - // CHECK:STDERR: ╭─┤ fail_import_function_member_protected.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_import_function_member_protected.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ c->instance_fn(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access protected member `instance_fn` of type - // CHECK:STDERR: · │ ┃ `Cpp.FunctionMemberProtected` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.FunctionMemberProtected` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: c->instance_fn(); - // CHECK:STDERR: ╭─┤ fail_import_function_member_protected.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_import_function_member_protected.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ Cpp.FunctionMemberProtected.static_fn(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access protected member `static_fn` of type - // CHECK:STDERR: · │ ┃ `Cpp.FunctionMemberProtected` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.FunctionMemberProtected` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.FunctionMemberProtected.static_fn(); @@ -432,23 +423,21 @@ import Cpp library "function_member_private.h"; class Derived { extend base: Cpp.FunctionMemberPrivate; fn F(self) { - // CHECK:STDERR: ╭─┤ fail_import_function_member_private.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_import_function_member_private.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ self.instance_fn(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `instance_fn` of type - // CHECK:STDERR: · │ ┃ `Cpp.FunctionMemberPrivate` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.FunctionMemberPrivate` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: self.instance_fn(); - // CHECK:STDERR: ╭─┤ fail_import_function_member_private.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_import_function_member_private.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ static_fn(); // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `static_fn` of type - // CHECK:STDERR: · │ ┃ `Cpp.FunctionMemberPrivate` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.FunctionMemberPrivate` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: static_fn(); @@ -484,8 +473,8 @@ class Derived { fn F(c: Cpp.FunctionMemberPrivate*) { // CHECK:STDERR: ╭─┤ fail_import_function_member_private.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ self.instance_fn(); - // CHECK:STDERR: · ────────┬─────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ c->instance_fn(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━ @@ -817,20 +806,19 @@ library "[[@TEST_NAME]]"; import Cpp library "overload_set_base_class.h"; fn F() { - // CHECK:STDERR: ╭─┤ fail_import_overload_set_protected_base_class.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_import_overload_set_protected_base_class.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ Cpp.OverloadProtected.Overload(Cpp.PublicCall.PublicCall()); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access protected member `Overload` of type - // CHECK:STDERR: · │ ┃ `Cpp.OverloadProtected` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.OverloadProtected` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.OverloadProtected.Overload(Cpp.PublicCall.PublicCall()); // CHECK:STDERR: ╭─┤ fail_import_overload_set_protected_base_class.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ Cpp.OverloadProtected.Overload(Cpp.PublicCall.PublicCall()); - // CHECK:STDERR: · ───────────────┬────────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ────┬─── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Cpp.OverloadProtected.Overload(Cpp.ProtectedCall.ProtectedCall()); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -842,8 +830,8 @@ fn F() { Cpp.OverloadProtected.Overload(Cpp.ProtectedCall.ProtectedCall()); // CHECK:STDERR: ╭─┤ fail_import_overload_set_protected_base_class.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ Cpp.OverloadProtected.Overload(Cpp.PublicCall.PublicCall()); - // CHECK:STDERR: · ───────────────┬────────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ────┬─── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Cpp.OverloadProtected.Overload(Cpp.PrivateCall.PrivateCall()); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -906,20 +894,19 @@ library "[[@TEST_NAME]]"; import Cpp library "overload_set_base_class.h"; fn F() { - // CHECK:STDERR: ╭─┤ fail_import_overload_set_private_base_class.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_import_overload_set_private_base_class.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ Cpp.OverloadPrivate.Overload(Cpp.PublicCall.PublicCall()); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `Overload` of type - // CHECK:STDERR: · │ ┃ `Cpp.OverloadPrivate` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.OverloadPrivate` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.OverloadPrivate.Overload(Cpp.PublicCall.PublicCall()); // CHECK:STDERR: ╭─┤ fail_import_overload_set_private_base_class.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ Cpp.OverloadPrivate.Overload(Cpp.PublicCall.PublicCall()); - // CHECK:STDERR: · ──────────────┬───────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ────┬─── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Cpp.OverloadPrivate.Overload(Cpp.ProtectedCall.ProtectedCall()); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -931,8 +918,8 @@ fn F() { Cpp.OverloadPrivate.Overload(Cpp.ProtectedCall.ProtectedCall()); // CHECK:STDERR: ╭─┤ fail_import_overload_set_private_base_class.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ Cpp.OverloadPrivate.Overload(Cpp.PublicCall.PublicCall()); - // CHECK:STDERR: · ──────────────┬───────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ────┬─── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Cpp.OverloadPrivate.Overload(Cpp.PrivateCall.PrivateCall()); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -954,13 +941,12 @@ class Derived { extend base: Cpp.OverloadPrivate; fn F() { - // CHECK:STDERR: ╭─┤ fail_import_overload_set_private_base_class_derived.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_import_overload_set_private_base_class_derived.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ Overload(Cpp.PublicCall.PublicCall()); // CHECK:STDERR: · ┳━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `Overload` of type - // CHECK:STDERR: · │ ┃ `Cpp.OverloadPrivate` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.OverloadPrivate` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Overload(Cpp.PublicCall.PublicCall()); @@ -1069,20 +1055,19 @@ class Derived { extend base: Cpp.Public; fn CallStatic() { - // CHECK:STDERR: ╭─┤ fail_base_class_public_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_public_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ Cpp.Public.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `PrivateStatic` of type - // CHECK:STDERR: · │ ┃ `Cpp.Public` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.Public` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.Public.PrivateStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_public_access_denied.carbon:[[@LINE+12]]:5 // CHECK:STDERR: │ Cpp.Public.PrivateStatic(); - // CHECK:STDERR: · ────────────┬─────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Self.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━ @@ -1096,13 +1081,12 @@ class Derived { fn CallInstance(var instance: Cpp.Public) { //@dump-sem-ir-begin - // CHECK:STDERR: ╭─┤ fail_base_class_public_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_public_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ instance.PrivateInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `PrivateInstance` of type - // CHECK:STDERR: · │ ┃ `Cpp.Public` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.Public` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: instance.PrivateInstance(); @@ -1111,20 +1095,19 @@ class Derived { } fn Call(var instance: Cpp.Public) { - // CHECK:STDERR: ╭─┤ fail_base_class_public_access_denied.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_base_class_public_access_denied.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ Cpp.Public.ProtectedStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access protected member `ProtectedStatic` of type - // CHECK:STDERR: · │ ┃ `Cpp.Public` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.Public` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.Public.ProtectedStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_public_access_denied.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ Cpp.Public.ProtectedStatic(); - // CHECK:STDERR: · ─────────────┬──────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────┬─────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Derived.ProtectedStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━ @@ -1136,8 +1119,8 @@ fn Call(var instance: Cpp.Public) { // CHECK:STDERR: ╭─┤ fail_base_class_public_access_denied.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ Cpp.Public.PrivateStatic(); - // CHECK:STDERR: · ────────────┬─────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Cpp.Public.PrivateStatic(); // CHECK:STDERR: · ━┳━━━━━━━━━━━━━━━━━━━━━━ @@ -1148,8 +1131,8 @@ fn Call(var instance: Cpp.Public) { Cpp.Public.PrivateStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_public_access_denied.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ Cpp.Public.PrivateStatic(); - // CHECK:STDERR: · ────────────┬─────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Derived.PrivateStatic(); // CHECK:STDERR: · ━┳━━━━━━━━━━━━━━━━━━━ @@ -1159,20 +1142,19 @@ fn Call(var instance: Cpp.Public) { // CHECK:STDERR: Derived.PrivateStatic(); - // CHECK:STDERR: ╭─┤ fail_base_class_public_access_denied.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_base_class_public_access_denied.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ instance.ProtectedInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access protected member `ProtectedInstance` of type - // CHECK:STDERR: · │ ┃ `Cpp.Public` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.Public` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: instance.ProtectedInstance(); // CHECK:STDERR: ╭─┤ fail_base_class_public_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ instance.PrivateInstance(); - // CHECK:STDERR: · ────────────┬─────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────┬─────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ instance.PrivateInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━ @@ -1225,20 +1207,19 @@ class Derived { extend base: Cpp.Protected; fn CallStatic() { - // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ Cpp.Protected.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `PrivateStatic` of type - // CHECK:STDERR: · │ ┃ `Cpp.Protected` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.Protected` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.Protected.PrivateStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+12]]:5 // CHECK:STDERR: │ Cpp.Protected.PrivateStatic(); - // CHECK:STDERR: · ─────────────┬───────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Self.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━ @@ -1251,13 +1232,12 @@ class Derived { } fn CallInstance(var instance: Cpp.Protected) { - // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ instance.PrivateInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `PrivateInstance` of type - // CHECK:STDERR: · │ ┃ `Cpp.Protected` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.Protected` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: instance.PrivateInstance(); @@ -1265,20 +1245,19 @@ class Derived { } fn Call(var instance: Cpp.Protected) { - // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ Cpp.Protected.PublicStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access protected member `PublicStatic` of type - // CHECK:STDERR: · │ ┃ `Cpp.Protected` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.Protected` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.Protected.PublicStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ Cpp.Protected.PublicStatic(); - // CHECK:STDERR: · ─────────────┬──────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Derived.PublicStatic(); // CHECK:STDERR: · ━━━┳━━━━━━━━━━━━━━━━ @@ -1288,20 +1267,19 @@ fn Call(var instance: Cpp.Protected) { // CHECK:STDERR: Derived.PublicStatic(); - // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ Cpp.Protected.ProtectedStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access protected member `ProtectedStatic` of type - // CHECK:STDERR: · │ ┃ `Cpp.Protected` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.Protected` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.Protected.ProtectedStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ Cpp.Protected.ProtectedStatic(); - // CHECK:STDERR: · ──────────────┬────────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────┬─────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Derived.ProtectedStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━ @@ -1313,8 +1291,8 @@ fn Call(var instance: Cpp.Protected) { // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ Cpp.Protected.PrivateStatic(); - // CHECK:STDERR: · ─────────────┬───────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Cpp.Protected.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1326,8 +1304,8 @@ fn Call(var instance: Cpp.Protected) { Cpp.Protected.PrivateStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ Cpp.Protected.PrivateStatic(); - // CHECK:STDERR: · ─────────────┬───────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Derived.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━ @@ -1338,30 +1316,28 @@ fn Call(var instance: Cpp.Protected) { // CHECK:STDERR: Derived.PrivateStatic(); - // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ instance.PublicInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access protected member `PublicInstance` of type - // CHECK:STDERR: · │ ┃ `Cpp.Protected` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.Protected` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: instance.PublicInstance(); - // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ instance.ProtectedInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access protected member `ProtectedInstance` of type - // CHECK:STDERR: · │ ┃ `Cpp.Protected` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.Protected` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: instance.ProtectedInstance(); // CHECK:STDERR: ╭─┤ fail_base_class_protected_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ instance.PrivateInstance(); - // CHECK:STDERR: · ────────────┬─────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────┬─────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ instance.PrivateInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━ @@ -1383,20 +1359,19 @@ class Derived { extend base: Cpp.Private; fn CallStatic() { - // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ Cpp.Private.PublicStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `PublicStatic` of type - // CHECK:STDERR: · │ ┃ `Cpp.Private` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.Private` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.Private.PublicStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+12]]:5 // CHECK:STDERR: │ Cpp.Private.PublicStatic(); - // CHECK:STDERR: · ────────────┬─────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Self.PublicStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ @@ -1407,20 +1382,19 @@ class Derived { // CHECK:STDERR: Self.PublicStatic(); - // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ Cpp.Private.ProtectedStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `ProtectedStatic` of type - // CHECK:STDERR: · │ ┃ `Cpp.Private` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.Private` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.Private.ProtectedStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+12]]:5 // CHECK:STDERR: │ Cpp.Private.ProtectedStatic(); - // CHECK:STDERR: · ─────────────┬───────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────┬─────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Self.ProtectedStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━ @@ -1431,20 +1405,19 @@ class Derived { // CHECK:STDERR: Self.ProtectedStatic(); - // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ Cpp.Private.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `PrivateStatic` of type - // CHECK:STDERR: · │ ┃ `Cpp.Private` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.Private` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.Private.PrivateStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+12]]:5 // CHECK:STDERR: │ Cpp.Private.PrivateStatic(); - // CHECK:STDERR: · ────────────┬──────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Self.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━ @@ -1457,35 +1430,32 @@ class Derived { } fn CallInstance(var instance: Cpp.Private) { - // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ instance.PublicInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `PublicInstance` of type - // CHECK:STDERR: · │ ┃ `Cpp.Private` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.Private` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: instance.PublicInstance(); - // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ instance.ProtectedInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `ProtectedInstance` of type - // CHECK:STDERR: · │ ┃ `Cpp.Private` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.Private` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: instance.ProtectedInstance(); - // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ instance.PrivateInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `PrivateInstance` of type - // CHECK:STDERR: · │ ┃ `Cpp.Private` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.Private` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: instance.PrivateInstance(); @@ -1495,8 +1465,8 @@ class Derived { fn Call(var instance: Cpp.Private) { // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ Cpp.Private.PublicStatic(); - // CHECK:STDERR: · ────────────┬─────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Cpp.Private.PublicStatic(); // CHECK:STDERR: · ━┳━━━━━━━━━━━━━━━━━━━━━━ @@ -1507,8 +1477,8 @@ fn Call(var instance: Cpp.Private) { Cpp.Private.PublicStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ Cpp.Private.PublicStatic(); - // CHECK:STDERR: · ────────────┬─────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Derived.PublicStatic(); // CHECK:STDERR: · ━┳━━━━━━━━━━━━━━━━━━ @@ -1520,8 +1490,8 @@ fn Call(var instance: Cpp.Private) { // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ Cpp.Private.ProtectedStatic(); - // CHECK:STDERR: · ─────────────┬───────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────┬─────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Cpp.Private.ProtectedStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1533,8 +1503,8 @@ fn Call(var instance: Cpp.Private) { Cpp.Private.ProtectedStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ Cpp.Private.ProtectedStatic(); - // CHECK:STDERR: · ─────────────┬───────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────┬─────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Derived.ProtectedStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━ @@ -1547,8 +1517,8 @@ fn Call(var instance: Cpp.Private) { // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ Cpp.Private.PrivateStatic(); - // CHECK:STDERR: · ────────────┬──────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Cpp.Private.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1559,8 +1529,8 @@ fn Call(var instance: Cpp.Private) { Cpp.Private.PrivateStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ Cpp.Private.PrivateStatic(); - // CHECK:STDERR: · ────────────┬──────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Derived.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━ @@ -1572,8 +1542,8 @@ fn Call(var instance: Cpp.Private) { // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ instance.PublicInstance(); - // CHECK:STDERR: · ───────────┬─────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────┬────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ instance.PublicInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━ @@ -1585,8 +1555,8 @@ fn Call(var instance: Cpp.Private) { instance.PublicInstance(); // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ instance.ProtectedInstance(); - // CHECK:STDERR: · ─────────────┬──────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ────────┬──────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ instance.ProtectedInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1598,8 +1568,8 @@ fn Call(var instance: Cpp.Private) { instance.ProtectedInstance(); // CHECK:STDERR: ╭─┤ fail_base_class_private_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ instance.PrivateInstance(); - // CHECK:STDERR: · ────────────┬─────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────┬─────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ instance.PrivateInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━ @@ -1652,20 +1622,19 @@ class Derived { extend base: Cpp.PublicProtected; fn CallStatic() { - // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ Cpp.PublicProtected.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `PrivateStatic` of type - // CHECK:STDERR: · │ ┃ `Cpp.PublicProtected` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.PublicProtected` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.PublicProtected.PrivateStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+12]]:5 // CHECK:STDERR: │ Cpp.PublicProtected.PrivateStatic(); - // CHECK:STDERR: · ────────────────┬──────────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Self.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━ @@ -1678,13 +1647,12 @@ class Derived { } fn CallInstance(var instance: Cpp.PublicProtected) { - // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ instance.PrivateInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `PrivateInstance` of type - // CHECK:STDERR: · │ ┃ `Cpp.PublicProtected` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.PublicProtected` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: instance.PrivateInstance(); @@ -1692,20 +1660,19 @@ class Derived { } fn Call(var instance: Cpp.PublicProtected) { - // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ Cpp.PublicProtected.PublicStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access protected member `PublicStatic` of type - // CHECK:STDERR: · │ ┃ `Cpp.PublicProtected` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.PublicProtected` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.PublicProtected.PublicStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ Cpp.PublicProtected.PublicStatic(); - // CHECK:STDERR: · ────────────────┬─────────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Derived.PublicStatic(); // CHECK:STDERR: · ━━━┳━━━━━━━━━━━━━━━━ @@ -1715,20 +1682,19 @@ fn Call(var instance: Cpp.PublicProtected) { // CHECK:STDERR: Derived.PublicStatic(); - // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ Cpp.PublicProtected.ProtectedStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access protected member `ProtectedStatic` of type - // CHECK:STDERR: · │ ┃ `Cpp.PublicProtected` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.PublicProtected` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.PublicProtected.ProtectedStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ Cpp.PublicProtected.ProtectedStatic(); - // CHECK:STDERR: · ─────────────────┬───────────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────┬─────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Derived.ProtectedStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━ @@ -1740,8 +1706,8 @@ fn Call(var instance: Cpp.PublicProtected) { // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ Cpp.PublicProtected.PrivateStatic(); - // CHECK:STDERR: · ────────────────┬──────────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Cpp.PublicProtected.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1753,8 +1719,8 @@ fn Call(var instance: Cpp.PublicProtected) { Cpp.PublicProtected.PrivateStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ Cpp.PublicProtected.PrivateStatic(); - // CHECK:STDERR: · ────────────────┬──────────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Derived.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━ @@ -1765,30 +1731,28 @@ fn Call(var instance: Cpp.PublicProtected) { // CHECK:STDERR: Derived.PrivateStatic(); - // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ instance.PublicInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access protected member `PublicInstance` of type - // CHECK:STDERR: · │ ┃ `Cpp.PublicProtected` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.PublicProtected` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: instance.PublicInstance(); - // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ instance.ProtectedInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access protected member `ProtectedInstance` of type - // CHECK:STDERR: · │ ┃ `Cpp.PublicProtected` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.PublicProtected` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: instance.ProtectedInstance(); // CHECK:STDERR: ╭─┤ fail_base_class_public_protected_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ instance.PrivateInstance(); - // CHECK:STDERR: · ────────────┬─────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────┬─────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ instance.PrivateInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━ @@ -1810,20 +1774,19 @@ class Derived { extend base: Cpp.PublicPrivate; fn CallStatic() { - // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ Cpp.PublicPrivate.PublicStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `PublicStatic` of type - // CHECK:STDERR: · │ ┃ `Cpp.PublicPrivate` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.PublicPrivate` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.PublicPrivate.PublicStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+12]]:5 // CHECK:STDERR: │ Cpp.PublicPrivate.PublicStatic(); - // CHECK:STDERR: · ───────────────┬────────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Self.PublicStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ @@ -1834,20 +1797,19 @@ class Derived { // CHECK:STDERR: Self.PublicStatic(); - // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ Cpp.PublicPrivate.ProtectedStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `ProtectedStatic` of type - // CHECK:STDERR: · │ ┃ `Cpp.PublicPrivate` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.PublicPrivate` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.PublicPrivate.ProtectedStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+12]]:5 // CHECK:STDERR: │ Cpp.PublicPrivate.ProtectedStatic(); - // CHECK:STDERR: · ────────────────┬──────────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────┬─────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Self.ProtectedStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━ @@ -1858,20 +1820,19 @@ class Derived { // CHECK:STDERR: Self.ProtectedStatic(); - // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ Cpp.PublicPrivate.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `PrivateStatic` of type - // CHECK:STDERR: · │ ┃ `Cpp.PublicPrivate` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.PublicPrivate` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.PublicPrivate.PrivateStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+12]]:5 // CHECK:STDERR: │ Cpp.PublicPrivate.PrivateStatic(); - // CHECK:STDERR: · ───────────────┬─────────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Self.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━ @@ -1884,35 +1845,32 @@ class Derived { } fn CallInstance(var instance: Cpp.PublicPrivate) { - // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ instance.PublicInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `PublicInstance` of type - // CHECK:STDERR: · │ ┃ `Cpp.PublicPrivate` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.PublicPrivate` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: instance.PublicInstance(); - // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ instance.ProtectedInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `ProtectedInstance` of type - // CHECK:STDERR: · │ ┃ `Cpp.PublicPrivate` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.PublicPrivate` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: instance.ProtectedInstance(); - // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+9]]:5 + // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ instance.PrivateInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `PrivateInstance` of type - // CHECK:STDERR: · │ ┃ `Cpp.PublicPrivate` - // CHECK:STDERR: · │ ┃ [ClassInvalidMemberAccess] - // CHECK:STDERR: · ╰────┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ┃ `Cpp.PublicPrivate` + // CHECK:STDERR: · ┃ [ClassInvalidMemberAccess] // CHECK:STDERR: ╰──── // CHECK:STDERR: instance.PrivateInstance(); @@ -1922,8 +1880,8 @@ class Derived { fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ Cpp.PublicPrivate.PublicStatic(); - // CHECK:STDERR: · ───────────────┬────────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Cpp.PublicPrivate.PublicStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1935,8 +1893,8 @@ fn Call(var instance: Cpp.PublicPrivate) { Cpp.PublicPrivate.PublicStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ Cpp.PublicPrivate.PublicStatic(); - // CHECK:STDERR: · ───────────────┬────────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Derived.PublicStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━ @@ -1949,8 +1907,8 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ Cpp.PublicPrivate.ProtectedStatic(); - // CHECK:STDERR: · ────────────────┬──────────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────┬─────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Cpp.PublicPrivate.ProtectedStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1962,8 +1920,8 @@ fn Call(var instance: Cpp.PublicPrivate) { Cpp.PublicPrivate.ProtectedStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ Cpp.PublicPrivate.ProtectedStatic(); - // CHECK:STDERR: · ────────────────┬──────────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────┬─────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Derived.ProtectedStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━ @@ -1976,8 +1934,8 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ Cpp.PublicPrivate.PrivateStatic(); - // CHECK:STDERR: · ───────────────┬─────────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Cpp.PublicPrivate.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1989,8 +1947,8 @@ fn Call(var instance: Cpp.PublicPrivate) { Cpp.PublicPrivate.PrivateStatic(); // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ Cpp.PublicPrivate.PrivateStatic(); - // CHECK:STDERR: · ───────────────┬─────────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ──────┬────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Derived.PrivateStatic(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━ @@ -2003,8 +1961,8 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ instance.PublicInstance(); - // CHECK:STDERR: · ───────────┬─────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────┬────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ instance.PublicInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━ @@ -2016,8 +1974,8 @@ fn Call(var instance: Cpp.PublicPrivate) { instance.PublicInstance(); // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ instance.ProtectedInstance(); - // CHECK:STDERR: · ─────────────┬──────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ────────┬──────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ instance.ProtectedInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -2029,8 +1987,8 @@ fn Call(var instance: Cpp.PublicPrivate) { instance.ProtectedInstance(); // CHECK:STDERR: ╭─┤ fail_base_class_public_private_access_denied.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ instance.PrivateInstance(); - // CHECK:STDERR: · ────────────┬─────────── - // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] + // CHECK:STDERR: · ───────┬─────── + // CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ instance.PrivateInstance(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/toolchain/check/testdata/interop/cpp/class/import/base.carbon b/toolchain/check/testdata/interop/cpp/class/import/base.carbon index 4152f454dd05..9b048fd7b3ac 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/base.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/base.carbon @@ -156,146 +156,118 @@ library "[[@TEST_NAME]]"; import Cpp library "multiple_inheritance.h"; fn ConvertA(p: Cpp.C*) -> Cpp.A* { - // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ return p; - // CHECK:STDERR: · ━━━┳━━━━━ - // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `C*` to `Cpp.A*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.C*` does not implement interface `Core.ImplicitAs(Cpp.A*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ━━━━┳━━━━ + // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `C*` to `Cpp.A*` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; } fn ConvertB(p: Cpp.C*) -> Cpp.B* { - // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ return p; - // CHECK:STDERR: · ━━━┳━━━━━ - // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `C*` to `Cpp.B*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.C*` does not implement interface `Core.ImplicitAs(Cpp.B*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ━━━━┳━━━━ + // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `C*` to `Cpp.B*` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; } fn ConvertOneNonEmptyBaseToEmpty1(p: Cpp.OneNonEmptyBase*) -> Cpp.Empty1* { - // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return p; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `OneNonEmptyBase*` to - // CHECK:STDERR: · │ ┃ `Cpp.Empty1*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.OneNonEmptyBase*` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.Empty1*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Cpp.Empty1*` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; } fn ConvertOneNonEmptyBaseToEmpty2(p: Cpp.OneNonEmptyBase*) -> Cpp.Empty2* { - // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return p; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `OneNonEmptyBase*` to - // CHECK:STDERR: · │ ┃ `Cpp.Empty2*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.OneNonEmptyBase*` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.Empty2*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Cpp.Empty2*` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; } fn ConvertTwoNonEmptyBasesToA(p: Cpp.TwoNonEmptyBases*) -> Cpp.A* { - // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return p; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `TwoNonEmptyBases*` - // CHECK:STDERR: · │ ┃ to `Cpp.A*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.TwoNonEmptyBases*` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.A*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `Cpp.A*` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; } fn ConvertTwoNonEmptyBasesToB(p: Cpp.TwoNonEmptyBases*) -> Cpp.B* { - // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return p; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `TwoNonEmptyBases*` - // CHECK:STDERR: · │ ┃ to `Cpp.B*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.TwoNonEmptyBases*` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.B*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `Cpp.B*` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; } fn ConvertOnePolymorphicBaseToA(p: Cpp.OnePolymorphicBase*) -> Cpp.A* { - // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return p; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `OnePolymorphicBase*` - // CHECK:STDERR: · │ ┃ to `Cpp.A*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.OnePolymorphicBase*` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.A*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `Cpp.A*` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; } fn ConvertOnePolymorphicBaseToB(p: Cpp.OnePolymorphicBase*) -> Cpp.B* { - // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return p; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `OnePolymorphicBase*` - // CHECK:STDERR: · │ ┃ to `Cpp.B*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.OnePolymorphicBase*` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.B*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `Cpp.B*` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; } fn ConvertTwoPolymorphicBasesToPolymorphic1(p: Cpp.TwoPolymorphicBases*) -> Cpp.Polymorphic1* { - // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return p; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `TwoPolymorphicBases*` to `Cpp.Polymorphic1*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.TwoPolymorphicBases*` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.Polymorphic1*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `TwoPolymorphicBases*` to `Cpp.Polymorphic1*` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; } fn ConvertTwoPolymorphicBasesToPolymorphic2(p: Cpp.TwoPolymorphicBases*) -> Cpp.Polymorphic2* { - // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_use_multiple_inheritance.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return p; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `TwoPolymorphicBases*` to `Cpp.Polymorphic2*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.TwoPolymorphicBases*` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.Polymorphic2*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `TwoPolymorphicBases*` to `Cpp.Polymorphic2*` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; @@ -344,15 +316,12 @@ library "[[@TEST_NAME]]"; import Cpp library "virtual_inheritance.h"; fn Convert(p: Cpp.VirtB*) -> Cpp.VirtA* { - // CHECK:STDERR: ╭─┤ fail_todo_use_virtual_inheritance.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_use_virtual_inheritance.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return p; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `VirtB*` to - // CHECK:STDERR: · │ ┃ `Cpp.VirtA*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.VirtB*` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.VirtA*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Cpp.VirtA*` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; @@ -383,120 +352,96 @@ library "[[@TEST_NAME]]"; import Cpp library "diamond.h"; fn ConvertBA(p: Cpp.DiamondB*) -> Cpp.DiamondA* { - // CHECK:STDERR: ╭─┤ fail_todo_use_diamond.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_use_diamond.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return p; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `DiamondB*` to - // CHECK:STDERR: · │ ┃ `Cpp.DiamondA*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.DiamondB*` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.DiamondA*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Cpp.DiamondA*` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; } fn ConvertCA(p: Cpp.DiamondC*) -> Cpp.DiamondA* { - // CHECK:STDERR: ╭─┤ fail_todo_use_diamond.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_use_diamond.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return p; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `DiamondC*` to - // CHECK:STDERR: · │ ┃ `Cpp.DiamondA*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.DiamondC*` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.DiamondA*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Cpp.DiamondA*` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; } fn ConvertDB(p: Cpp.DiamondD*) -> Cpp.DiamondB* { - // CHECK:STDERR: ╭─┤ fail_todo_use_diamond.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_use_diamond.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return p; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `DiamondD*` to - // CHECK:STDERR: · │ ┃ `Cpp.DiamondB*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.DiamondD*` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.DiamondB*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Cpp.DiamondB*` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; } fn ConvertDC(p: Cpp.DiamondD*) -> Cpp.DiamondC* { - // CHECK:STDERR: ╭─┤ fail_todo_use_diamond.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_use_diamond.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return p; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `DiamondD*` to - // CHECK:STDERR: · │ ┃ `Cpp.DiamondC*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.DiamondD*` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.DiamondC*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Cpp.DiamondC*` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; } fn AccessBA(d: Cpp.DiamondD) -> i32 { - // CHECK:STDERR: ╭─┤ fail_todo_use_diamond.carbon:[[@LINE+11]]:11 + // CHECK:STDERR: ╭─┤ fail_todo_use_diamond.carbon:[[@LINE+8]]:11 // CHECK:STDERR: -> │ return (d as Cpp.DiamondB).b; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `DiamondD` to - // CHECK:STDERR: · │ ┃ `Cpp.DiamondB` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.DiamondD` does not implement interface - // CHECK:STDERR: · │ `Core.As(Cpp.DiamondB)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Cpp.DiamondB` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return (d as Cpp.DiamondB).b; } fn AccessCA(d: Cpp.DiamondD) -> i32 { - // CHECK:STDERR: ╭─┤ fail_todo_use_diamond.carbon:[[@LINE+11]]:11 + // CHECK:STDERR: ╭─┤ fail_todo_use_diamond.carbon:[[@LINE+8]]:11 // CHECK:STDERR: -> │ return (d as Cpp.DiamondC).b; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `DiamondD` to - // CHECK:STDERR: · │ ┃ `Cpp.DiamondC` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.DiamondD` does not implement interface - // CHECK:STDERR: · │ `Core.As(Cpp.DiamondC)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Cpp.DiamondC` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return (d as Cpp.DiamondC).b; } fn AccessDB(d: Cpp.DiamondD) -> i32 { - // CHECK:STDERR: ╭─┤ fail_todo_use_diamond.carbon:[[@LINE+11]]:10 + // CHECK:STDERR: ╭─┤ fail_todo_use_diamond.carbon:[[@LINE+8]]:10 // CHECK:STDERR: -> │ return d.b; // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `DiamondD` to - // CHECK:STDERR: · │ ┃ `Cpp.DiamondB` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.DiamondD` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.DiamondB)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Cpp.DiamondB` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return d.b; } fn AccessDC(d: Cpp.DiamondD) -> i32 { - // CHECK:STDERR: ╭─┤ fail_todo_use_diamond.carbon:[[@LINE+11]]:10 + // CHECK:STDERR: ╭─┤ fail_todo_use_diamond.carbon:[[@LINE+8]]:10 // CHECK:STDERR: -> │ return d.c; // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `DiamondD` to - // CHECK:STDERR: · │ ┃ `Cpp.DiamondC` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.DiamondD` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.DiamondC)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Cpp.DiamondC` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return d.c; diff --git a/toolchain/check/testdata/interop/cpp/class/import/class.carbon b/toolchain/check/testdata/interop/cpp/class/import/class.carbon index b20e583344f3..e5755e089f95 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/class.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/class.carbon @@ -35,14 +35,13 @@ library "[[@TEST_NAME]]"; import Cpp library "declaration.h"; fn MyF() { - // CHECK:STDERR: ╭─┤ fail_use_declaration_as_definition.carbon:[[@LINE+14]]:19 + // CHECK:STDERR: ╭─┤ fail_use_declaration_as_definition.carbon:[[@LINE+13]]:19 // CHECK:STDERR: -> │ var unused bar: Cpp.DeclBar; // CHECK:STDERR: · ┳━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type `DeclBar` in // CHECK:STDERR: · ┃ name binding declaration // CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_use_declaration_as_definition.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./declaration.h // CHECK:STDERR: │ class DeclBar; // CHECK:STDERR: · ┬ diff --git a/toolchain/check/testdata/interop/cpp/class/import/constructor.carbon b/toolchain/check/testdata/interop/cpp/class/import/constructor.carbon index df6b67aa7ab0..85906a036497 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/constructor.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/constructor.carbon @@ -313,13 +313,12 @@ library "[[@TEST_NAME]]"; import Cpp library "incomplete.h"; fn F() { - // CHECK:STDERR: ╭─┤ fail_import_incomplete.carbon:[[@LINE+13]]:4 + // CHECK:STDERR: ╭─┤ fail_import_incomplete.carbon:[[@LINE+12]]:4 // CHECK:STDERR: -> │ Cpp.IncompleteC.IncompleteC(); // CHECK:STDERR: · ━━━━━━━━━━━━┳━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: member access into incomplete class `Cpp.IncompleteC` // CHECK:STDERR: · ┃ [QualifiedExprInIncompleteClassScope] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_import_incomplete.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./incomplete.h // CHECK:STDERR: │ class IncompleteC; // CHECK:STDERR: · ┬ diff --git a/toolchain/check/testdata/interop/cpp/class/import/non_aggregate_init.carbon b/toolchain/check/testdata/interop/cpp/class/import/non_aggregate_init.carbon index e39ea4e9b0fe..65b392564731 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/non_aggregate_init.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/non_aggregate_init.carbon @@ -29,13 +29,11 @@ library "[[@TEST_NAME]]"; import Cpp library "non_aggregate.h"; fn Make() { - // CHECK:STDERR: ╭─┤ fail_non_aggregate_init.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_non_aggregate_init.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var _: Cpp.X = {}; // CHECK:STDERR: · ━━━━━━┳━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `{}` to `Cpp.X` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `{}` does not implement interface `Core.ImplicitAs(Cpp.X)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var _: Cpp.X = {}; diff --git a/toolchain/check/testdata/interop/cpp/class/import/override.carbon b/toolchain/check/testdata/interop/cpp/class/import/override.carbon index e8bc24bc41ab..57239085eb7b 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/override.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/override.carbon @@ -108,30 +108,24 @@ import Cpp library "overload.h"; class OverloadX { extend base: Cpp.OverloadedBase; // - // CHECK:STDERR: ╭─┤ fail_overload_type.carbon:[[@LINE+32]]:3 + // CHECK:STDERR: ╭─┤ fail_overload_type.carbon:[[@LINE+26]]:3 // CHECK:STDERR: -> │ override fn f(self, x: Cpp.X); // CHECK:STDERR: · ━━━━━━━━━━━━━━━┳━━━━┯━━━━━━━━━ // CHECK:STDERR: · ┗━━━━━━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ │ ┃ `Cpp.Y` to `Cpp.X` - // CHECK:STDERR: · │ │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰─────────┤ type `Cpp.Y` does not implement interface - // CHECK:STDERR: · │ │ `Core.ImplicitAs(Cpp.X)` - // CHECK:STDERR: · │ │ [MissingImplInMemberAccessInContext] - // CHECK:STDERR: · ╰──────┤ initializing function parameter - // CHECK:STDERR: · │ [InCallToFunctionParam] + // CHECK:STDERR: · │ ┃ `Cpp.Y` to `Cpp.X` + // CHECK:STDERR: · │ ┃ [ConversionFailure] + // CHECK:STDERR: · ╰────┤ initializing function parameter + // CHECK:STDERR: · │ [InCallToFunctionParam] // CHECK:STDERR: ╰──── // CHECK:STDERR: - // CHECK:STDERR: ╭─┤ fail_overload_type.carbon:[[@LINE+19]]:3 + // CHECK:STDERR: ╭─┤ fail_overload_type.carbon:[[@LINE+16]]:3 // CHECK:STDERR: -> │ override fn f(self, x: Cpp.X); // CHECK:STDERR: · ━━━━━━━━━━━━━━━┳━━━━┯━━━━━━━━━ // CHECK:STDERR: · ┗━━━━━━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ │ ┃ `Cpp.Y` to `Cpp.X` - // CHECK:STDERR: · │ │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰─────────┤ type `Cpp.Y` does not implement interface - // CHECK:STDERR: · │ │ `Core.ImplicitAs(Cpp.X)` - // CHECK:STDERR: · │ │ [MissingImplInMemberAccessInContext] - // CHECK:STDERR: · ╰──────┤ initializing function parameter - // CHECK:STDERR: · │ [InCallToFunctionParam] + // CHECK:STDERR: · │ ┃ `Cpp.Y` to `Cpp.X` + // CHECK:STDERR: · │ ┃ [ConversionFailure] + // CHECK:STDERR: · ╰────┤ initializing function parameter + // CHECK:STDERR: · │ [InCallToFunctionParam] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./overload.h // CHECK:STDERR: │ virtual void f(Y y); @@ -146,30 +140,24 @@ class OverloadX { class OverloadY { extend base: Cpp.OverloadedBase; // - // CHECK:STDERR: ╭─┤ fail_overload_type.carbon:[[@LINE+32]]:3 + // CHECK:STDERR: ╭─┤ fail_overload_type.carbon:[[@LINE+26]]:3 // CHECK:STDERR: -> │ override fn f(self, y: Cpp.Y); // CHECK:STDERR: · ━━━━━━━━━━━━━━━┳━━━━┯━━━━━━━━━ // CHECK:STDERR: · ┗━━━━━━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ │ ┃ `Cpp.X` to `Cpp.Y` - // CHECK:STDERR: · │ │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰─────────┤ type `Cpp.X` does not implement interface - // CHECK:STDERR: · │ │ `Core.ImplicitAs(Cpp.Y)` - // CHECK:STDERR: · │ │ [MissingImplInMemberAccessInContext] - // CHECK:STDERR: · ╰──────┤ initializing function parameter - // CHECK:STDERR: · │ [InCallToFunctionParam] + // CHECK:STDERR: · │ ┃ `Cpp.X` to `Cpp.Y` + // CHECK:STDERR: · │ ┃ [ConversionFailure] + // CHECK:STDERR: · ╰────┤ initializing function parameter + // CHECK:STDERR: · │ [InCallToFunctionParam] // CHECK:STDERR: ╰──── // CHECK:STDERR: - // CHECK:STDERR: ╭─┤ fail_overload_type.carbon:[[@LINE+19]]:3 + // CHECK:STDERR: ╭─┤ fail_overload_type.carbon:[[@LINE+16]]:3 // CHECK:STDERR: -> │ override fn f(self, y: Cpp.Y); // CHECK:STDERR: · ━━━━━━━━━━━━━━━┳━━━━┯━━━━━━━━━ // CHECK:STDERR: · ┗━━━━━━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ │ ┃ `Cpp.X` to `Cpp.Y` - // CHECK:STDERR: · │ │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰─────────┤ type `Cpp.X` does not implement interface - // CHECK:STDERR: · │ │ `Core.ImplicitAs(Cpp.Y)` - // CHECK:STDERR: · │ │ [MissingImplInMemberAccessInContext] - // CHECK:STDERR: · ╰──────┤ initializing function parameter - // CHECK:STDERR: · │ [InCallToFunctionParam] + // CHECK:STDERR: · │ ┃ `Cpp.X` to `Cpp.Y` + // CHECK:STDERR: · │ ┃ [ConversionFailure] + // CHECK:STDERR: · ╰────┤ initializing function parameter + // CHECK:STDERR: · │ [InCallToFunctionParam] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./overload.h // CHECK:STDERR: │ virtual void f(X x); diff --git a/toolchain/check/testdata/interop/cpp/class/import/template.carbon b/toolchain/check/testdata/interop/cpp/class/import/template.carbon index 5ec7f9521b5e..2aeaf6c6e87b 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/template.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/template.carbon @@ -46,6 +46,26 @@ fn G(p: Cpp.Ai16*) -> Cpp.Base* { // --- instantiation_error.h template struct X { + // CHECK:STDERR: ╷ ╭── included from: fail_use_instantiation_error.carbon [InCppInclude] + // CHECK:STDERR: ├─┤ ./instantiation_error.h:[[@LINE+19]]:25 + // CHECK:STDERR: │ template struct X { + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ in instantiation of template class 'X' + // CHECK:STDERR: · │ requested here + // CHECK:STDERR: · │ [CppInteropParseNote] + // CHECK:STDERR: ┆ + // CHECK:STDERR: -> │ using type = typename T::member; + // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ┗━━┫ error: type 'int' cannot be used prior to '::' + // CHECK:STDERR: · ┃ because it has no members + // CHECK:STDERR: · ┃ [CppInteropParseError] + // CHECK:STDERR: ┆ + // CHECK:STDERR: ├─┤ fail_use_instantiation_error.carbon + // CHECK:STDERR: │ var y: Cpp.Xint.r#type = 0; + // CHECK:STDERR: · ───────┬─────── + // CHECK:STDERR: · ╰──┤ in completion of type `Cpp.X` here [InTypeCompletion] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: using type = typename T::member; }; @@ -65,26 +85,6 @@ import Cpp library "instantiation_error.h"; //@dump-sem-ir-begin var x: Cpp.XY.r#type = 0; -// CHECK:STDERR: ╭─┤ fail_use_instantiation_error.carbon:[[@LINE+20]]:8 -// CHECK:STDERR: -> │ var y: Cpp.Xint.r#type = 0; -// CHECK:STDERR: · ━━━━━━━┳━━━━━━━ -// CHECK:STDERR: · ┗━━┫ error: member access into incomplete class `Cpp.X` -// CHECK:STDERR: · ┃ [QualifiedExprInIncompleteClassScope] -// CHECK:STDERR: ┆ -// CHECK:STDERR: │ ╭── included from: fail_use_instantiation_error.carbon [InCppInclude] -// CHECK:STDERR: ├─┤ ./instantiation_error.h -// CHECK:STDERR: │ template struct X { -// CHECK:STDERR: · ┬ -// CHECK:STDERR: · ╰──┤ in instantiation of template class 'X' -// CHECK:STDERR: · │ requested here -// CHECK:STDERR: · │ [CppInteropParseNote] -// CHECK:STDERR: │ using type = typename T::member; -// CHECK:STDERR: · ┬ -// CHECK:STDERR: · ╰──┤ type 'int' cannot be used prior to '::' because it -// CHECK:STDERR: · │ has no members -// CHECK:STDERR: · │ [CppInteropParseError] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: var y: Cpp.Xint.r#type = 0; //@dump-sem-ir-end @@ -304,11 +304,11 @@ fn G() { // CHECK:STDOUT: %x.var_patt: %pattern_type.d94 = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: %y.var: ref %i32 = var_storage %y.var_patt [concrete] -// CHECK:STDOUT: %.loc29: type = splice_block %type.ref.loc29 [concrete = constants.%i32] { -// CHECK:STDOUT: %Cpp.ref.loc29: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc9: type = splice_block %type.ref.loc9 [concrete = constants.%i32] { +// CHECK:STDOUT: %Cpp.ref.loc9: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Xint.ref: type = name_ref Xint, imports.%X.decl.b67 [concrete = constants.%X.c92] // CHECK:STDOUT: -// CHECK:STDOUT: %type.ref.loc29: type = name_ref r#type, %i32.2 [concrete = constants.%i32] +// CHECK:STDOUT: %type.ref.loc9: type = name_ref r#type, %i32.2 [concrete = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %y: ref %i32 = wrapper_binding y, %y.var [concrete = %y.var] // CHECK:STDOUT: name_binding_decl { @@ -327,14 +327,14 @@ fn G() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7: init %i32 = call %bound_method.loc7_1.2(%int_0.loc7) [concrete = constants.%int_0.753] // CHECK:STDOUT: %.loc7: init %i32 = converted %int_0.loc7, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7 [concrete = constants.%int_0.753] // CHECK:STDOUT: assign file.%x.var, %.loc7 -// CHECK:STDOUT: %int_0.loc29: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0.loc29: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] -// CHECK:STDOUT: %bound_method.loc29_1.1: = bound_method %int_0.loc29, %impl.elem0.loc29 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn.loc29: = specific_function %impl.elem0.loc29, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc29_1.2: = bound_method %int_0.loc29, %specific_fn.loc29 [concrete = constants.%bound_method] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc29: init %i32 = call %bound_method.loc29_1.2(%int_0.loc29) [concrete = constants.%int_0.753] -// CHECK:STDOUT: %.loc29: init %i32 = converted %int_0.loc29, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc29 [concrete = constants.%int_0.753] -// CHECK:STDOUT: assign file.%y.var, %.loc29 +// CHECK:STDOUT: %int_0.loc9: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] +// CHECK:STDOUT: %impl.elem0.loc9: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60] +// CHECK:STDOUT: %bound_method.loc9_1.1: = bound_method %int_0.loc9, %impl.elem0.loc9 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] +// 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_1.2: = bound_method %int_0.loc9, %specific_fn.loc9 [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9: init %i32 = call %bound_method.loc9_1.2(%int_0.loc9) [concrete = constants.%int_0.753] +// CHECK:STDOUT: %.loc9: init %i32 = converted %int_0.loc9, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_0.753] +// CHECK:STDOUT: assign file.%y.var, %.loc9 // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/class/import/union.carbon b/toolchain/check/testdata/interop/cpp/class/import/union.carbon index abe75e2a7a92..9ee4ea9d26be 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/union.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/union.carbon @@ -35,14 +35,13 @@ library "[[@TEST_NAME]]"; import Cpp library "declaration.h"; fn MyF() { - // CHECK:STDERR: ╭─┤ fail_use_declaration_as_definition.carbon:[[@LINE+14]]:19 + // CHECK:STDERR: ╭─┤ fail_use_declaration_as_definition.carbon:[[@LINE+13]]:19 // CHECK:STDERR: -> │ var unused bar: Cpp.DeclBar; // CHECK:STDERR: · ┳━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type `DeclBar` in // CHECK:STDERR: · ┃ name binding declaration // CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_use_declaration_as_definition.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./declaration.h // CHECK:STDERR: │ union DeclBar; // CHECK:STDERR: · ┬ diff --git a/toolchain/check/testdata/interop/cpp/const/access.carbon b/toolchain/check/testdata/interop/cpp/const/access.carbon index f803933b1c70..b84924812ed2 100644 --- a/toolchain/check/testdata/interop/cpp/const/access.carbon +++ b/toolchain/check/testdata/interop/cpp/const/access.carbon @@ -37,21 +37,18 @@ const S& Get(); '''; fn F() { - // CHECK:STDERR: ╭─┤ fail_const_member_assign.carbon:[[@LINE+17]]:3 + // CHECK:STDERR: ╭─┤ fail_const_member_assign.carbon:[[@LINE+14]]:3 // CHECK:STDERR: -> │ Cpp.Get().x = 123; // CHECK:STDERR: · ━━━━━┳━━━━━ // CHECK:STDERR: · ┗━━┫ error: expression is not assignable [AssignmentToNonAssignable] // CHECK:STDERR: ╰──── // CHECK:STDERR: - // CHECK:STDERR: ╭─┤ fail_const_member_assign.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_const_member_assign.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ Cpp.Get().x = 123; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Core.IntLiteral` to - // CHECK:STDERR: · │ ┃ `const i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(const i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `const i32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.Get().x = 123; diff --git a/toolchain/check/testdata/interop/cpp/enum/convert.carbon b/toolchain/check/testdata/interop/cpp/enum/convert.carbon index 25d759629a7a..7947fcceda92 100644 --- a/toolchain/check/testdata/interop/cpp/enum/convert.carbon +++ b/toolchain/check/testdata/interop/cpp/enum/convert.carbon @@ -39,59 +39,48 @@ library "[[@TEST_NAME]]"; import Cpp library "enum.h"; fn F() { - // CHECK:STDERR: ╭─┤ fail_wrong_type.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_wrong_type.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ Cpp.Enum.a as i8; // CHECK:STDERR: · ━━━━┳━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `Cpp.Enum` to `i8` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.Enum` does not implement interface `Core.As(i8)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.Enum.a as i8; - // CHECK:STDERR: ╭─┤ fail_wrong_type.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_wrong_type.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ Cpp.Enum.a as i32; // CHECK:STDERR: · ━━━┳━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `Cpp.Enum` to `i32` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.Enum` does not implement interface `Core.As(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.Enum.a as i32; - // CHECK:STDERR: ╭─┤ fail_wrong_type.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_wrong_type.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ (42 as i8) as Cpp.Enum; // CHECK:STDERR: · ━━━━┳━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `i8` to `Cpp.Enum` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `i8` does not implement interface `Core.As(Cpp.Enum)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: (42 as i8) as Cpp.Enum; - // CHECK:STDERR: ╭─┤ fail_wrong_type.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_wrong_type.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ (42 as i32) as Cpp.Enum; // CHECK:STDERR: · ━━━┳━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `i32` to `Cpp.Enum` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `i32` does not implement interface `Core.As(Cpp.Enum)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: (42 as i32) as Cpp.Enum; - // CHECK:STDERR: ╭─┤ fail_wrong_type.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_wrong_type.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ Cpp.a as Cpp.DifferentSize; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `Cpp.Enum` to - // CHECK:STDERR: · │ ┃ `Cpp.DifferentSize` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.Enum` does not implement interface - // CHECK:STDERR: · │ `Core.As(Cpp.DifferentSize)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Cpp.DifferentSize` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.a as Cpp.DifferentSize; diff --git a/toolchain/check/testdata/interop/cpp/enum/eq.carbon b/toolchain/check/testdata/interop/cpp/enum/eq.carbon index dc11a94fc56c..ff505b90b295 100644 --- a/toolchain/check/testdata/interop/cpp/enum/eq.carbon +++ b/toolchain/check/testdata/interop/cpp/enum/eq.carbon @@ -78,9 +78,9 @@ fn CompareGeneric[U: type, T: Core.EqWith(U)](x: T, y: U) -> bool { fn CompareHeterogeneousFail(x: Cpp.Scoped, y: Cpp.Unscoped) -> bool { // CHECK:STDERR: ╭─┤ fail_heterogeneous.carbon:[[@LINE+13]]:10 // CHECK:STDERR: │ fn CompareGeneric[U: type, T: Core.EqWith(U)](x: T, y: U) -> bool { - // CHECK:STDERR: · ─────────────────────────┬───────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───────┬────── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return CompareGeneric(x, y); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━ diff --git a/toolchain/check/testdata/interop/cpp/enum/incomplete.carbon b/toolchain/check/testdata/interop/cpp/enum/incomplete.carbon index 585375c39fc6..b81c1e616f57 100644 --- a/toolchain/check/testdata/interop/cpp/enum/incomplete.carbon +++ b/toolchain/check/testdata/interop/cpp/enum/incomplete.carbon @@ -52,14 +52,13 @@ 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+14]]:17 + // CHECK:STDERR: ╭─┤ fail_use_declaration_as_definition.carbon:[[@LINE+13]]:17 // CHECK:STDERR: -> │ var unused e: Cpp.UnsizedEnum; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type `UnsizedEnum` in // CHECK:STDERR: · ┃ name binding declaration // CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_use_declaration_as_definition.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./declaration.h // CHECK:STDERR: │ enum UnsizedEnum; // CHECK:STDERR: · ┬ diff --git a/toolchain/check/testdata/interop/cpp/enum/unscoped.carbon b/toolchain/check/testdata/interop/cpp/enum/unscoped.carbon index dcda56d76488..3df8eb310b0d 100644 --- a/toolchain/check/testdata/interop/cpp/enum/unscoped.carbon +++ b/toolchain/check/testdata/interop/cpp/enum/unscoped.carbon @@ -36,28 +36,22 @@ library "[[@TEST_NAME]]"; import Cpp library "enum.h"; fn F() { - // CHECK:STDERR: ╭─┤ fail_wrong_enum.carbon:[[@LINE+11]]:29 + // CHECK:STDERR: ╭─┤ fail_wrong_enum.carbon:[[@LINE+8]]:29 // CHECK:STDERR: -> │ let unused c: Cpp.Other = Cpp.Enum.c; // CHECK:STDERR: · ┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of - // CHECK:STDERR: · │ ┃ type `Cpp.Enum` to `Cpp.Other` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.Enum` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.Other)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type `Cpp.Enum` to `Cpp.Other` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused c: Cpp.Other = Cpp.Enum.c; - // CHECK:STDERR: ╭─┤ fail_wrong_enum.carbon:[[@LINE+11]]:30 + // CHECK:STDERR: ╭─┤ fail_wrong_enum.carbon:[[@LINE+8]]:30 // CHECK:STDERR: -> │ let unused c2: Cpp.Other = Cpp.c; // CHECK:STDERR: · ┳━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of - // CHECK:STDERR: · │ ┃ type `Cpp.Enum` to `Cpp.Other` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.Enum` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.Other)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type `Cpp.Enum` to `Cpp.Other` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused c2: Cpp.Other = Cpp.c; diff --git a/toolchain/check/testdata/interop/cpp/function/export/array.carbon b/toolchain/check/testdata/interop/cpp/function/export/array.carbon index dcdb13fdc1aa..6b841baf5fb6 100644 --- a/toolchain/check/testdata/interop/cpp/function/export/array.carbon +++ b/toolchain/check/testdata/interop/cpp/function/export/array.carbon @@ -68,7 +68,7 @@ int GArrayVarParam() { // CHECK:STDERR: · ╰──┤ 'GArrayVarParam' declared here [CppInteropParseNote] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return Carbon::FArrayVarParam({1, 2, 3, 4, 5}); - // CHECK:STDERR: · ┳───────────────────── + // CHECK:STDERR: · ┳───────━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: no member named 'FArrayVarParam' in namespace 'Carbon'; did // CHECK:STDERR: · │ ┃ you mean 'GArrayVarParam'? // CHECK:STDERR: · │ ┃ [CppInteropParseError] @@ -81,7 +81,7 @@ int GArrayVarParam() { // CHECK:STDERR: · ╰──┤ 'GArrayVarParam' declared here [CppInteropParseNote] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ return Carbon::FArrayVarParam({1, 2, 3, 4, 5}); - // CHECK:STDERR: · ────────────── ┳━━━━━━━━━━━━━━ + // CHECK:STDERR: · ━━━━━━━━━━━━━━ ┳━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: too many arguments to function call, // CHECK:STDERR: · ┃ expected 0, have 1 // CHECK:STDERR: · ┃ [CppInteropParseError] @@ -120,7 +120,7 @@ int GArrayReturn() { // CHECK:STDERR: · ╰──┤ 'GArrayReturn' declared here [CppInteropParseNote] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ auto &&arr = Carbon::FArrayReturn(); - // CHECK:STDERR: · ┳─────────────────── + // CHECK:STDERR: · ┳───────━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: no member named 'FArrayReturn' in namespace 'Carbon'; // CHECK:STDERR: · │ ┃ did you mean 'GArrayReturn'? // CHECK:STDERR: · │ ┃ [CppInteropParseError] @@ -130,7 +130,7 @@ int GArrayReturn() { auto &&arr = Carbon::FArrayReturn(); // CHECK:STDERR: ╭─┤ fail_todo_array_return.carbon:[[@LINE+7]]:13 // CHECK:STDERR: -> │ return arr[0]; - // CHECK:STDERR: · ──╴╻╶ + // CHECK:STDERR: · ━━╸╻╺ // CHECK:STDERR: · ┗━━┫ error: subscripted value is not an array, pointer, or vector // CHECK:STDERR: · ┃ [CppInteropParseError] // CHECK:STDERR: ╰──── diff --git a/toolchain/check/testdata/interop/cpp/function/export/constructor.carbon b/toolchain/check/testdata/interop/cpp/function/export/constructor.carbon index 8efe4102a712..d45f9ae9d33b 100644 --- a/toolchain/check/testdata/interop/cpp/function/export/constructor.carbon +++ b/toolchain/check/testdata/interop/cpp/function/export/constructor.carbon @@ -53,7 +53,7 @@ void CallFactoryIsMethod() { // CHECK:STDERR: · │ [CppInteropParseNote] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Carbon::FactoryIsMethod a(42); - // CHECK:STDERR: · ┳ ── + // CHECK:STDERR: · ┳ ━━ // CHECK:STDERR: · ┗━━┫ error: no matching constructor for initialization // CHECK:STDERR: · ┃ of 'Carbon::FactoryIsMethod' (aka // CHECK:STDERR: · ┃ 'Carbon::Main::FactoryIsMethod') @@ -94,7 +94,7 @@ void CallFactoryDoesntReturnSelf() { // CHECK:STDERR: · │ [CppInteropParseNote] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Carbon::FactoryDoesntReturnSelf a(42); - // CHECK:STDERR: · ┳ ── + // CHECK:STDERR: · ┳ ━━ // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ // CHECK:STDERR: · ┃ error: no matching constructor for initialization of // CHECK:STDERR: · ┃ 'Carbon::FactoryDoesntReturnSelf' (aka @@ -136,7 +136,7 @@ void CallFactoryReturnsByRef() { // CHECK:STDERR: · │ [CppInteropParseNote] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Carbon::FactoryReturnsByRef a(42); - // CHECK:STDERR: · ┳ ── + // CHECK:STDERR: · ┳ ━━ // CHECK:STDERR: · ┗━━┫ error: no matching constructor for // CHECK:STDERR: · ┃ initialization of // CHECK:STDERR: · ┃ 'Carbon::FactoryReturnsByRef' (aka @@ -187,7 +187,7 @@ void CallGenericConstructor() { // CHECK:STDERR: · │ [CppInteropParseNote] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Carbon::GenericConstructor b(0); - // CHECK:STDERR: · ┳ ─ + // CHECK:STDERR: · ┳ ━ // CHECK:STDERR: · ┗━━┫ error: no matching constructor for // CHECK:STDERR: · ┃ initialization of // CHECK:STDERR: · ┃ 'Carbon::GenericConstructor' (aka @@ -231,7 +231,7 @@ void CallGenericClass() { // CHECK:STDERR: · │ [CppInteropParseNote] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Carbon::GenericClass c(0); - // CHECK:STDERR: · ┳ ─ + // CHECK:STDERR: · ┳ ━ // CHECK:STDERR: · ┗━━┫ error: no matching constructor for // CHECK:STDERR: · ┃ initialization of // CHECK:STDERR: · ┃ 'Carbon::GenericClass' diff --git a/toolchain/check/testdata/interop/cpp/function/export/function.carbon b/toolchain/check/testdata/interop/cpp/function/export/function.carbon index ac7914f717ce..fe9dd7c71dbf 100644 --- a/toolchain/check/testdata/interop/cpp/function/export/function.carbon +++ b/toolchain/check/testdata/interop/cpp/function/export/function.carbon @@ -90,12 +90,11 @@ void CallUsingF() { UsingF(); } package OtherGeneric; // CHECK:STDERR: ╷ ╭── imported from: fail_todo_generic.carbon [InImport] -// CHECK:STDERR: ├─┤ other_generic.carbon:[[@LINE+8]]:1 +// CHECK:STDERR: ├─┤ other_generic.carbon:[[@LINE+7]]:1 // CHECK:STDERR: -> │ fn HasGenericArg(generic T: type, a: T) { a; } // CHECK:STDERR: · ━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: 1 argument passed to function expecting 2 arguments -// CHECK:STDERR: · │ ┃ [CallArgCountMismatch] -// CHECK:STDERR: · ╰────┤ calling function declared here [InCallToEntity] +// CHECK:STDERR: · ┃ [CallArgCountMismatch] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn HasGenericArg(generic T: type, a: T) { a; } diff --git a/toolchain/check/testdata/interop/cpp/function/export/generic.carbon b/toolchain/check/testdata/interop/cpp/function/export/generic.carbon index 9200206035ef..91ca9c9f3db4 100644 --- a/toolchain/check/testdata/interop/cpp/function/export/generic.carbon +++ b/toolchain/check/testdata/interop/cpp/function/export/generic.carbon @@ -142,7 +142,7 @@ void CallEnclosingF() { Carbon::EnclosingB b; // CHECK:STDERR: ╭─┤ fail_todo_enclosing_generic.carbon:[[@LINE+7]]:5 // CHECK:STDERR: -> │ b.MemberF(1, 2); - // CHECK:STDERR: · ─ ┳ + // CHECK:STDERR: · ━ ┳ // CHECK:STDERR: · ┗━━┫ error: no member named 'MemberF' in 'Carbon::Main::EnclosingA' // CHECK:STDERR: · ┃ [CppInteropParseError] // CHECK:STDERR: ╰──── diff --git a/toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_bridged.carbon b/toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_bridged.carbon index 50f26cabfb2f..a8500b17282c 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_bridged.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_bridged.carbon @@ -309,14 +309,12 @@ library "[[@TEST_NAME]]"; import Cpp library "short_param.h"; fn F() { - // CHECK:STDERR: ╭─┤ fail_import_short_param_int32_arg.carbon:[[@LINE+15]]:11 + // CHECK:STDERR: ╭─┤ fail_import_short_param_int32_arg.carbon:[[@LINE+13]]:11 // CHECK:STDERR: -> │ Cpp.foo(1 as i32); // CHECK:STDERR: · ┳━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `i32` to - // CHECK:STDERR: · │ ┃ `i16` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `i32` does not implement interface `Core.ImplicitAs(i16)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `i16` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./short_param.h // CHECK:STDERR: │ auto foo(short a) -> void; diff --git a/toolchain/check/testdata/interop/cpp/function/import/class.carbon b/toolchain/check/testdata/interop/cpp/function/import/class.carbon index 33e78d8f2552..28568382ea7b 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/class.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/class.carbon @@ -62,14 +62,13 @@ library "[[@TEST_NAME]]"; import Cpp library "decl_value_param_type.h"; fn F(p: Cpp.ForwardDeclaredClass*) { - // CHECK:STDERR: ╭─┤ fail_import_decl_value_param_type.carbon:[[@LINE+19]]:23 + // CHECK:STDERR: ╭─┤ fail_import_decl_value_param_type.carbon:[[@LINE+18]]:23 // CHECK:STDERR: -> │ Cpp.foo_decl_param1(*p); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: forming value of incomplete type // CHECK:STDERR: · ┃ `Cpp.ForwardDeclaredClass` // CHECK:STDERR: · ┃ [IncompleteTypeInValueConversion] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_import_decl_value_param_type.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./decl_value_param_type.h // CHECK:STDERR: │ class ForwardDeclaredClass; // CHECK:STDERR: · ┬ @@ -82,14 +81,13 @@ fn F(p: Cpp.ForwardDeclaredClass*) { // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.foo_decl_param1(*p); - // CHECK:STDERR: ╭─┤ fail_import_decl_value_param_type.carbon:[[@LINE+19]]:23 + // CHECK:STDERR: ╭─┤ fail_import_decl_value_param_type.carbon:[[@LINE+18]]:23 // CHECK:STDERR: -> │ Cpp.foo_decl_param2(*p); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: forming value of incomplete type // CHECK:STDERR: · ┃ `Cpp.ForwardDeclaredClass` // CHECK:STDERR: · ┃ [IncompleteTypeInValueConversion] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_import_decl_value_param_type.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./decl_value_param_type.h // CHECK:STDERR: │ class ForwardDeclaredClass; // CHECK:STDERR: · ┬ @@ -479,13 +477,12 @@ library "[[@TEST_NAME]]"; import Cpp library "incomplete.h"; fn F() { - // CHECK:STDERR: ╭─┤ fail_import_incomplete.carbon:[[@LINE+13]]:3 + // CHECK:STDERR: ╭─┤ fail_import_incomplete.carbon:[[@LINE+12]]:3 // CHECK:STDERR: -> │ Cpp.Incomplete.foo(); // CHECK:STDERR: · ━━━━━━━━━┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: member access into incomplete class `Cpp.Incomplete` // CHECK:STDERR: · ┃ [QualifiedExprInIncompleteClassScope] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_import_incomplete.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./incomplete.h // CHECK:STDERR: │ class Incomplete; // CHECK:STDERR: · ┬ @@ -575,13 +572,12 @@ library "[[@TEST_NAME]]"; import Cpp library "decl_value_return_type.h"; fn F() { - // CHECK:STDERR: ╭─┤ fail_import_decl_value_return_type.carbon:[[@LINE+18]]:3 + // CHECK:STDERR: ╭─┤ fail_import_decl_value_return_type.carbon:[[@LINE+17]]:3 // CHECK:STDERR: -> │ Cpp.foo_decl_value_return(); // CHECK:STDERR: · ━━━━━━━┳━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: function returns incomplete type `Cpp.DeclValueReturnClass` // CHECK:STDERR: · ┃ [IncompleteTypeInFunctionReturnType] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_import_decl_value_return_type.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./decl_value_return_type.h // CHECK:STDERR: │ class DeclValueReturnClass; // CHECK:STDERR: · ┬ diff --git a/toolchain/check/testdata/interop/cpp/function/import/decayed_param.carbon b/toolchain/check/testdata/interop/cpp/function/import/decayed_param.carbon index 9b8e0d48287b..8994d852fa6a 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/decayed_param.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/decayed_param.carbon @@ -74,15 +74,12 @@ fn F() { // CHECK:STDERR: Cpp.TakesFunction(&n[0]); - // CHECK:STDERR: ╭─┤ fail_todo_call_params_2.carbon:[[@LINE+17]]:21 + // CHECK:STDERR: ╭─┤ fail_todo_call_params_2.carbon:[[@LINE+14]]:21 // CHECK:STDERR: -> │ Cpp.TakesFunction(Cpp.nullptr); // CHECK:STDERR: · ┳━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `Cpp.nullptr_t` to `` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.nullptr_t` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs()` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Cpp.nullptr_t` to `` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./params.h // CHECK:STDERR: │ void TakesFunction(int f(int)); @@ -917,12 +914,12 @@ fn F() { // CHECK:STDOUT: %.loc36_24.2: %i32 = converted %int_0, %.loc36_24.1 [concrete = constants.%int_0.753] // CHECK:STDOUT: %.loc36_25: ref %i32 = array_index %n.ref, %.loc36_24.2 // CHECK:STDOUT: %addr: %ptr.a17 = addr_of %.loc36_25 -// CHECK:STDOUT: %Cpp.ref.loc55_3: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %TakesFunction.ref.loc55: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value] -// CHECK:STDOUT: %Cpp.ref.loc55_21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref.loc52_3: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %TakesFunction.ref.loc52: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value] +// CHECK:STDOUT: %Cpp.ref.loc52_21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: // CHECK:STDOUT: %nullptr.ref: %Cpp.nullptr_t = name_ref nullptr, %uninit [concrete = constants.%uninit] -// CHECK:STDOUT: %.loc55: %.659 = converted %nullptr.ref, [concrete = ] +// CHECK:STDOUT: %.loc52: %.659 = converted %nullptr.ref, [concrete = ] // CHECK:STDOUT: %TakesFunction.call: init %empty_tuple.type = call imports.%TakesFunction.decl() // CHECK:STDOUT: %Destroy.facet.loc20_3.1: %Destroy.type = facet_value constants.%Array.3b5, (constants.%DestroyImpl.impl_witness.be3, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet.843] // CHECK:STDOUT: %.loc20_3.2: %Destroy.type = converted constants.%Array.3b5, %Destroy.facet.loc20_3.1 [concrete = constants.%Destroy.facet.843] diff --git a/toolchain/check/testdata/interop/cpp/function/import/function_ptr.carbon b/toolchain/check/testdata/interop/cpp/function/import/function_ptr.carbon index 9bc606627615..bcb0ffc89bf9 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/function_ptr.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/function_ptr.carbon @@ -165,13 +165,12 @@ library "[[@TEST_NAME]]"; import Cpp library "forward_decl.h"; fn F() { - // CHECK:STDERR: ╭─┤ fail_use_forward_decl.carbon:[[@LINE+16]]:3 + // CHECK:STDERR: ╭─┤ fail_use_forward_decl.carbon:[[@LINE+15]]:3 // CHECK:STDERR: -> │ Cpp.ReturnCallback()(); // CHECK:STDERR: · ━━━━━━━━━━━┳━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: function returns incomplete type `Cpp.Incomplete` // CHECK:STDERR: · ┃ [IncompleteTypeInFunctionReturnType] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_use_forward_decl.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./forward_decl.h // CHECK:STDERR: │ class Incomplete; // CHECK:STDERR: · ┬ diff --git a/toolchain/check/testdata/interop/cpp/function/import/method_ptr.carbon b/toolchain/check/testdata/interop/cpp/function/import/method_ptr.carbon index 09f350714d51..1f2bd0ff669a 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/method_ptr.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/method_ptr.carbon @@ -75,7 +75,7 @@ library "[[@TEST_NAME]]"; import Cpp library "method_ptr.h"; fn F(c: Cpp.C) { - // CHECK:STDERR: ╭─┤ fail_todo_call_method_ptr.carbon:[[@LINE+39]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_call_method_ptr.carbon:[[@LINE+36]]:3 // CHECK:STDERR: -> │ c.(Cpp.GetMethodPtr())(42); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: member name of type `` in @@ -84,7 +84,7 @@ fn F(c: Cpp.C) { // CHECK:STDERR: · ┃ [CompoundMemberAccessDoesNotUseBase] // CHECK:STDERR: ╰──── // CHECK:STDERR: - // CHECK:STDERR: ╭─┤ fail_todo_call_method_ptr.carbon:[[@LINE+30]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_call_method_ptr.carbon:[[@LINE+27]]:3 // CHECK:STDERR: -> │ c.(Cpp.GetMethodPtr())(42); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: semantics TODO: @@ -97,21 +97,18 @@ fn F(c: Cpp.C) { // CHECK:STDERR: · ┃ function pointer // CHECK:STDERR: · ┃ [CppInteropParseError] // CHECK:STDERR: ┆ - // CHECK:STDERR: ├─┤ fail_todo_call_method_ptr.carbon:[[@LINE+17]]:3 + // CHECK:STDERR: ├─┤ fail_todo_call_method_ptr.carbon:[[@LINE+14]]:3 // CHECK:STDERR: │ c.(Cpp.GetMethodPtr())(42); // CHECK:STDERR: · ─────────────┬──────────── // CHECK:STDERR: · ╰──┤ in thunk for C++ function pointer type used here // CHECK:STDERR: · │ [InCppFunctionPointerThunk] // CHECK:STDERR: ╰──── // CHECK:STDERR: - // CHECK:STDERR: ╭─┤ fail_todo_call_method_ptr.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_call_method_ptr.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ c.(Cpp.GetMethodPtr())(42); // CHECK:STDERR: · ━━━━━━━━━━━━━┳━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: 1 argument passed to function expecting 0 arguments // CHECK:STDERR: · ┃ [CallArgCountMismatch] - // CHECK:STDERR: ┆ - // CHECK:STDERR: ├─┤ fail_todo_call_method_ptr.carbon - // CHECK:STDERR: · ╰──┤ calling function declared here [InCallToEntity] // CHECK:STDERR: ╰──── // CHECK:STDERR: c.(Cpp.GetMethodPtr())(42); diff --git a/toolchain/check/testdata/interop/cpp/function/import/overloads.carbon b/toolchain/check/testdata/interop/cpp/function/import/overloads.carbon index a629791b93f3..89334be7e4e9 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/overloads.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/overloads.carbon @@ -283,7 +283,7 @@ import Cpp library "struct_init.h"; fn MakeThreeFields() -> {.a: i32, .b: i32, .c: i32}; fn ThreeFields(value: {.a: i32, .b: i32, .c: i32}, ref reference: {.a: i32, .b: i32, .c: i32}) { - // CHECK:STDERR: ╭─┤ fail_todo_struct_init_nonempty.carbon:[[@LINE+20]]:23 + // CHECK:STDERR: ╭─┤ fail_todo_struct_init_nonempty.carbon:[[@LINE+16]]:23 // CHECK:STDERR: -> │ Cpp.PassThreeFields({.a = 1, .b = 2, .c = 3}); // CHECK:STDERR: · ━━━━━━━━━━━━┳━━━━━━━━━━━ // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ @@ -291,10 +291,6 @@ fn ThreeFields(value: {.a: i32, .b: i32, .c: i32}, ref reference: {.a: i32, .b: // CHECK:STDERR: · ┃ `{.a: Core.IntLiteral, .b: Core.IntLiteral, .c: Core.IntLiteral}` to // CHECK:STDERR: · ┃ `Cpp.ThreeFields` // CHECK:STDERR: · ┃ [ConversionFailure] - // CHECK:STDERR: · ╭─────────────────────────────────╯ - // CHECK:STDERR: · │ type `{.a: Core.IntLiteral, .b: Core.IntLiteral, .c: Core.IntLiteral}` does - // CHECK:STDERR: · │ not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./struct_init.h // CHECK:STDERR: │ auto PassThreeFields(ThreeFields t) -> void; @@ -305,17 +301,13 @@ fn ThreeFields(value: {.a: i32, .b: i32, .c: i32}, ref reference: {.a: i32, .b: // CHECK:STDERR: Cpp.PassThreeFields({.a = 1, .b = 2, .c = 3}); - // CHECK:STDERR: ╭─┤ fail_todo_struct_init_nonempty.carbon:[[@LINE+19]]:23 + // CHECK:STDERR: ╭─┤ fail_todo_struct_init_nonempty.carbon:[[@LINE+15]]:23 // CHECK:STDERR: -> │ Cpp.PassThreeFields(value); // CHECK:STDERR: · ┳━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `{.a: i32, .b: i32, .c: i32}` to - // CHECK:STDERR: · │ ┃ `Cpp.ThreeFields` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `{.a: i32, .b: i32, .c: i32}` does not - // CHECK:STDERR: · │ implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.ThreeFields)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `{.a: i32, .b: i32, .c: i32}` to + // CHECK:STDERR: · ┃ `Cpp.ThreeFields` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./struct_init.h // CHECK:STDERR: │ auto PassThreeFields(ThreeFields t) -> void; @@ -326,17 +318,13 @@ fn ThreeFields(value: {.a: i32, .b: i32, .c: i32}, ref reference: {.a: i32, .b: // CHECK:STDERR: Cpp.PassThreeFields(value); - // CHECK:STDERR: ╭─┤ fail_todo_struct_init_nonempty.carbon:[[@LINE+19]]:23 + // CHECK:STDERR: ╭─┤ fail_todo_struct_init_nonempty.carbon:[[@LINE+15]]:23 // CHECK:STDERR: -> │ Cpp.PassThreeFields(reference); // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `{.a: i32, .b: i32, .c: i32}` to - // CHECK:STDERR: · │ ┃ `Cpp.ThreeFields` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `{.a: i32, .b: i32, .c: i32}` does not - // CHECK:STDERR: · │ implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.ThreeFields)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `{.a: i32, .b: i32, .c: i32}` to + // CHECK:STDERR: · ┃ `Cpp.ThreeFields` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./struct_init.h // CHECK:STDERR: │ auto PassThreeFields(ThreeFields t) -> void; @@ -347,17 +335,13 @@ fn ThreeFields(value: {.a: i32, .b: i32, .c: i32}, ref reference: {.a: i32, .b: // CHECK:STDERR: Cpp.PassThreeFields(reference); - // CHECK:STDERR: ╭─┤ fail_todo_struct_init_nonempty.carbon:[[@LINE+19]]:23 + // CHECK:STDERR: ╭─┤ fail_todo_struct_init_nonempty.carbon:[[@LINE+15]]:23 // CHECK:STDERR: -> │ Cpp.PassThreeFields(MakeThreeFields()); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `{.a: i32, .b: i32, .c: i32}` to - // CHECK:STDERR: · │ ┃ `Cpp.ThreeFields` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `{.a: i32, .b: i32, .c: i32}` does not - // CHECK:STDERR: · │ implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.ThreeFields)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `{.a: i32, .b: i32, .c: i32}` to + // CHECK:STDERR: · ┃ `Cpp.ThreeFields` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./struct_init.h // CHECK:STDERR: │ auto PassThreeFields(ThreeFields t) -> void; @@ -368,7 +352,7 @@ fn ThreeFields(value: {.a: i32, .b: i32, .c: i32}, ref reference: {.a: i32, .b: // CHECK:STDERR: Cpp.PassThreeFields(MakeThreeFields()); - // CHECK:STDERR: ╭─┤ fail_todo_struct_init_nonempty.carbon:[[@LINE+20]]:23 + // CHECK:STDERR: ╭─┤ fail_todo_struct_init_nonempty.carbon:[[@LINE+16]]:23 // CHECK:STDERR: -> │ Cpp.PassThreeFields({.b = 1, .c = 2, .a = 3}); // CHECK:STDERR: · ━━━━━━━━━━━━┳━━━━━━━━━━━ // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ @@ -376,10 +360,6 @@ fn ThreeFields(value: {.a: i32, .b: i32, .c: i32}, ref reference: {.a: i32, .b: // CHECK:STDERR: · ┃ `{.b: Core.IntLiteral, .c: Core.IntLiteral, .a: Core.IntLiteral}` to // CHECK:STDERR: · ┃ `Cpp.ThreeFields` // CHECK:STDERR: · ┃ [ConversionFailure] - // CHECK:STDERR: · ╭─────────────────────────────────╯ - // CHECK:STDERR: · │ type `{.b: Core.IntLiteral, .c: Core.IntLiteral, .a: Core.IntLiteral}` does - // CHECK:STDERR: · │ not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./struct_init.h // CHECK:STDERR: │ auto PassThreeFields(ThreeFields t) -> void; @@ -462,15 +442,12 @@ import Cpp library "struct_init.h"; fn MakeEmpty() -> (); fn Empty(value: (), ref reference: ()) { - // CHECK:STDERR: ╭─┤ fail_struct_init_from_tuple.carbon:[[@LINE+17]]:20 + // CHECK:STDERR: ╭─┤ fail_struct_init_from_tuple.carbon:[[@LINE+14]]:20 // CHECK:STDERR: -> │ Cpp.PassNoFields(()); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `()` - // CHECK:STDERR: · │ ┃ to `Cpp.NoFields` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `()` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.NoFields)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `Cpp.NoFields` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./struct_init.h // CHECK:STDERR: │ auto PassNoFields(NoFields s) -> void; @@ -481,15 +458,12 @@ fn Empty(value: (), ref reference: ()) { // CHECK:STDERR: Cpp.PassNoFields(()); - // CHECK:STDERR: ╭─┤ fail_struct_init_from_tuple.carbon:[[@LINE+17]]:20 + // CHECK:STDERR: ╭─┤ fail_struct_init_from_tuple.carbon:[[@LINE+14]]:20 // CHECK:STDERR: -> │ Cpp.PassNoFields(value); // CHECK:STDERR: · ┳━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `()` - // CHECK:STDERR: · │ ┃ to `Cpp.NoFields` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `()` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.NoFields)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `Cpp.NoFields` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./struct_init.h // CHECK:STDERR: │ auto PassNoFields(NoFields s) -> void; @@ -500,15 +474,12 @@ fn Empty(value: (), ref reference: ()) { // CHECK:STDERR: Cpp.PassNoFields(value); - // CHECK:STDERR: ╭─┤ fail_struct_init_from_tuple.carbon:[[@LINE+17]]:20 + // CHECK:STDERR: ╭─┤ fail_struct_init_from_tuple.carbon:[[@LINE+14]]:20 // CHECK:STDERR: -> │ Cpp.PassNoFields(reference); // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `()` - // CHECK:STDERR: · │ ┃ to `Cpp.NoFields` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `()` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.NoFields)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `Cpp.NoFields` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./struct_init.h // CHECK:STDERR: │ auto PassNoFields(NoFields s) -> void; @@ -519,15 +490,12 @@ fn Empty(value: (), ref reference: ()) { // CHECK:STDERR: Cpp.PassNoFields(reference); - // CHECK:STDERR: ╭─┤ fail_struct_init_from_tuple.carbon:[[@LINE+17]]:20 + // CHECK:STDERR: ╭─┤ fail_struct_init_from_tuple.carbon:[[@LINE+14]]:20 // CHECK:STDERR: -> │ Cpp.PassNoFields(MakeEmpty()); // CHECK:STDERR: · ┳━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `()` - // CHECK:STDERR: · │ ┃ to `Cpp.NoFields` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `()` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.NoFields)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `Cpp.NoFields` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./struct_init.h // CHECK:STDERR: │ auto PassNoFields(NoFields s) -> void; @@ -542,19 +510,14 @@ fn Empty(value: (), ref reference: ()) { fn MakeThreeFields() -> (i32, i32, i32); fn ThreeFields(value: (i32, i32, i32), ref reference: (i32, i32, i32)) { - // CHECK:STDERR: ╭─┤ fail_struct_init_from_tuple.carbon:[[@LINE+21]]:23 + // CHECK:STDERR: ╭─┤ fail_struct_init_from_tuple.carbon:[[@LINE+16]]:23 // CHECK:STDERR: -> │ Cpp.PassThreeFields((1, 2, 3)); - // CHECK:STDERR: · ┳━━━━━━━━ - // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━┛ + // CHECK:STDERR: · ━━━━┳━━━━ + // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━┛ // CHECK:STDERR: · ┃ error: cannot implicitly convert expression of type // CHECK:STDERR: · ┃ `(Core.IntLiteral, Core.IntLiteral, Core.IntLiteral)` to // CHECK:STDERR: · ┃ `Cpp.ThreeFields` // CHECK:STDERR: · ┃ [ConversionFailure] - // CHECK:STDERR: · ╰──┤ type - // CHECK:STDERR: · │ `(Core.IntLiteral, Core.IntLiteral, Core.IntLiteral)` - // CHECK:STDERR: · │ does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.ThreeFields)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./struct_init.h // CHECK:STDERR: │ auto PassThreeFields(ThreeFields t) -> void; @@ -565,15 +528,12 @@ fn ThreeFields(value: (i32, i32, i32), ref reference: (i32, i32, i32)) { // CHECK:STDERR: Cpp.PassThreeFields((1, 2, 3)); - // CHECK:STDERR: ╭─┤ fail_struct_init_from_tuple.carbon:[[@LINE+17]]:23 + // CHECK:STDERR: ╭─┤ fail_struct_init_from_tuple.carbon:[[@LINE+14]]:23 // CHECK:STDERR: -> │ Cpp.PassThreeFields(value); // CHECK:STDERR: · ┳━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `(i32, i32, i32)` to `Cpp.ThreeFields` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `(i32, i32, i32)` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.ThreeFields)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `(i32, i32, i32)` to `Cpp.ThreeFields` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./struct_init.h // CHECK:STDERR: │ auto PassThreeFields(ThreeFields t) -> void; @@ -584,15 +544,12 @@ fn ThreeFields(value: (i32, i32, i32), ref reference: (i32, i32, i32)) { // CHECK:STDERR: Cpp.PassThreeFields(value); - // CHECK:STDERR: ╭─┤ fail_struct_init_from_tuple.carbon:[[@LINE+17]]:23 + // CHECK:STDERR: ╭─┤ fail_struct_init_from_tuple.carbon:[[@LINE+14]]:23 // CHECK:STDERR: -> │ Cpp.PassThreeFields(reference); // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `(i32, i32, i32)` to `Cpp.ThreeFields` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `(i32, i32, i32)` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.ThreeFields)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `(i32, i32, i32)` to `Cpp.ThreeFields` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./struct_init.h // CHECK:STDERR: │ auto PassThreeFields(ThreeFields t) -> void; @@ -603,15 +560,12 @@ fn ThreeFields(value: (i32, i32, i32), ref reference: (i32, i32, i32)) { // CHECK:STDERR: Cpp.PassThreeFields(reference); - // CHECK:STDERR: ╭─┤ fail_struct_init_from_tuple.carbon:[[@LINE+17]]:23 + // CHECK:STDERR: ╭─┤ fail_struct_init_from_tuple.carbon:[[@LINE+14]]:23 // CHECK:STDERR: -> │ Cpp.PassThreeFields(MakeThreeFields()); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `(i32, i32, i32)` to `Cpp.ThreeFields` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `(i32, i32, i32)` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.ThreeFields)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `(i32, i32, i32)` to `Cpp.ThreeFields` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./struct_init.h // CHECK:STDERR: │ auto PassThreeFields(ThreeFields t) -> void; @@ -641,15 +595,12 @@ import Cpp library "int_from_struct.h"; fn F() { // C++ permits `{}` to be used to initialize an int, but Carbon does not. - // CHECK:STDERR: ╭─┤ fail_int_from_struct.carbon:[[@LINE+16]]:15 + // CHECK:STDERR: ╭─┤ fail_int_from_struct.carbon:[[@LINE+13]]:15 // CHECK:STDERR: -> │ Cpp.PassInt({}); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `{}` to - // CHECK:STDERR: · │ ┃ `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `{}` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `i32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./int_from_struct.h // CHECK:STDERR: │ auto PassInt(int n) -> void; @@ -659,15 +610,12 @@ fn F() { // CHECK:STDERR: Cpp.PassInt({}); - // CHECK:STDERR: ╭─┤ fail_int_from_struct.carbon:[[@LINE+16]]:15 + // CHECK:STDERR: ╭─┤ fail_int_from_struct.carbon:[[@LINE+13]]:15 // CHECK:STDERR: -> │ Cpp.PassInt(()); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `()` to - // CHECK:STDERR: · │ ┃ `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `()` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `i32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./int_from_struct.h // CHECK:STDERR: │ auto PassInt(int n) -> void; @@ -688,15 +636,12 @@ fn F() { // C++ overload resolution prefers to convert `{}` to `int` rather than to an // empty struct. So that's the overload we pick, even though we can't call it. - // CHECK:STDERR: ╭─┤ fail_int_from_struct_overloaded.carbon:[[@LINE+17]]:22 + // CHECK:STDERR: ╭─┤ fail_int_from_struct_overloaded.carbon:[[@LINE+14]]:22 // CHECK:STDERR: -> │ Cpp.PassOverloaded({}); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `{}` to `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `{}` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `{}` to `i32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./int_from_struct.h // CHECK:STDERR: │ auto PassOverloaded(int n) -> void; @@ -707,15 +652,12 @@ fn F() { // CHECK:STDERR: Cpp.PassOverloaded({}); - // CHECK:STDERR: ╭─┤ fail_int_from_struct_overloaded.carbon:[[@LINE+17]]:22 + // CHECK:STDERR: ╭─┤ fail_int_from_struct_overloaded.carbon:[[@LINE+14]]:22 // CHECK:STDERR: -> │ Cpp.PassOverloaded(()); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `()` to `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `()` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `()` to `i32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./int_from_struct.h // CHECK:STDERR: │ auto PassOverloaded(int n) -> void; @@ -771,7 +713,7 @@ library "[[@TEST_NAME]]"; import Cpp library "nested_structs.h"; fn F() { - // CHECK:STDERR: ╭─┤ fail_todo_pass_nested_structs.carbon:[[@LINE+19]]:13 + // CHECK:STDERR: ╭─┤ fail_todo_pass_nested_structs.carbon:[[@LINE+15]]:13 // CHECK:STDERR: -> │ Cpp.TakeB({.a = {.x = 1, .y = 2}, .n = 3}); // CHECK:STDERR: · ━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━┛ @@ -779,10 +721,6 @@ fn F() { // CHECK:STDERR: · ┃ `{.a: {.x: Core.IntLiteral, .y: Core.IntLiteral}, .n: Core.IntLiteral}` // CHECK:STDERR: · ┃ to `Cpp.B` // CHECK:STDERR: · ┃ [ConversionFailure] - // CHECK:STDERR: · ╭──────────────────────────╯ - // CHECK:STDERR: · │ type `{.a: {.x: Core.IntLiteral, .y: Core.IntLiteral}, .n: Core.IntLiteral}` - // CHECK:STDERR: · │ does not implement interface `Core.ImplicitAs(Cpp.B)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./nested_structs.h // CHECK:STDERR: │ void TakeB(B); @@ -822,15 +760,12 @@ library "[[@TEST_NAME]]"; import Cpp library "signedness_change.h"; fn F() { - // CHECK:STDERR: ╭─┤ fail_signedness_change_rejected.carbon:[[@LINE+17]]:22 + // CHECK:STDERR: ╭─┤ fail_signedness_change_rejected.carbon:[[@LINE+14]]:22 // CHECK:STDERR: -> │ Cpp.signedness_foo(1 as i32); // CHECK:STDERR: · ┳━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `i32` to `u32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `i32` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(u32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `i32` to `u32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./signedness_change.h // CHECK:STDERR: │ auto signedness_foo(unsigned int a) -> void; @@ -853,15 +788,12 @@ library "[[@TEST_NAME]]"; import Cpp library "downsizing_rejected.h"; fn F() { - // CHECK:STDERR: ╭─┤ fail_import_downsizing_rejected.carbon:[[@LINE+17]]:22 + // CHECK:STDERR: ╭─┤ fail_import_downsizing_rejected.carbon:[[@LINE+14]]:22 // CHECK:STDERR: -> │ Cpp.downsizing_foo(1 as i32); // CHECK:STDERR: · ┳━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `i32` to `i16` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `i32` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i16)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `i32` to `i16` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./downsizing_rejected.h // CHECK:STDERR: │ auto downsizing_foo(short a) -> void; @@ -989,9 +921,9 @@ fn EchoValue[ValueT: I](unused generic value: ValueT) {} fn F() { // CHECK:STDERR: ╭─┤ fail_missing_impl.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn EchoValue[ValueT: I](unused generic value: ValueT) {} - // CHECK:STDERR: · ─────────────────────────┬───────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ────┬──── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ EchoValue(Cpp.missing_impl_foo); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/toolchain/check/testdata/interop/cpp/function/import/pointer.carbon b/toolchain/check/testdata/interop/cpp/function/import/pointer.carbon index c48bb525ed3e..e3ea211ed808 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/pointer.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/pointer.carbon @@ -425,7 +425,7 @@ import Cpp library "deduced_pointer_param.h"; fn F() { // This could return a null pointer, so should not be given the type `Cpp.DeducedPointerS*`. - // CHECK:STDERR: ╭─┤ fail_import_deduced_pointer_param_as_optional_pointer.carbon:[[@LINE+14]]:40 + // CHECK:STDERR: ╭─┤ fail_import_deduced_pointer_param_as_optional_pointer.carbon:[[@LINE+10]]:40 // CHECK:STDERR: -> │ let unused a: Cpp.DeducedPointerS* = Cpp.Indirect({} as Cpp.DeducedPointerS); // CHECK:STDERR: · ━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ @@ -433,10 +433,6 @@ fn F() { // CHECK:STDERR: · ┃ `Core.Optional(Cpp.DeducedPointerS* as Core.OptionalStorage)` to // CHECK:STDERR: · ┃ `Cpp.DeducedPointerS*` // CHECK:STDERR: · ┃ [ConversionFailure] - // CHECK:STDERR: · ╭─────────────────────────────────────────────────────────╯ - // CHECK:STDERR: · │ type `Core.Optional(Cpp.DeducedPointerS* as Core.OptionalStorage)` does not - // CHECK:STDERR: · │ implement interface `Core.ImplicitAs(Cpp.DeducedPointerS*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused a: Cpp.DeducedPointerS* = Cpp.Indirect({} as Cpp.DeducedPointerS); diff --git a/toolchain/check/testdata/interop/cpp/function/import/reference.carbon b/toolchain/check/testdata/interop/cpp/function/import/reference.carbon index 99d191549194..233d0c6bce8d 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/reference.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/reference.carbon @@ -461,15 +461,12 @@ 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+11]]:29 + // CHECK:STDERR: ╭─┤ fail_call_return_const_lvalue_ref_const_correctness.carbon:[[@LINE+8]]:29 // CHECK:STDERR: -> │ let unused ref s: Cpp.S = Cpp.ReturnConstLValue(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of - // CHECK:STDERR: · │ ┃ type `const Cpp.S` to `Cpp.S` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `const Cpp.S` does not implement - // CHECK:STDERR: · │ interface `Core.ImplicitAs(Cpp.S)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type `const Cpp.S` to `Cpp.S` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused ref s: Cpp.S = Cpp.ReturnConstLValue(); diff --git a/toolchain/check/testdata/interop/cpp/function/import/struct.carbon b/toolchain/check/testdata/interop/cpp/function/import/struct.carbon index 266f4ad0cb95..c2ec120aedb3 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/struct.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/struct.carbon @@ -62,14 +62,13 @@ library "[[@TEST_NAME]]"; import Cpp library "decl_value_param_type.h"; fn F(p: Cpp.ForwardDeclaredStruct*) { - // CHECK:STDERR: ╭─┤ fail_import_decl_value_param_type.carbon:[[@LINE+19]]:12 + // CHECK:STDERR: ╭─┤ fail_import_decl_value_param_type.carbon:[[@LINE+18]]:12 // CHECK:STDERR: -> │ Cpp.foo1(*p); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: forming value of incomplete type // CHECK:STDERR: · ┃ `Cpp.ForwardDeclaredStruct` // CHECK:STDERR: · ┃ [IncompleteTypeInValueConversion] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_import_decl_value_param_type.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./decl_value_param_type.h // CHECK:STDERR: │ struct ForwardDeclaredStruct; // CHECK:STDERR: · ┬ @@ -82,14 +81,13 @@ fn F(p: Cpp.ForwardDeclaredStruct*) { // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.foo1(*p); - // CHECK:STDERR: ╭─┤ fail_import_decl_value_param_type.carbon:[[@LINE+19]]:12 + // CHECK:STDERR: ╭─┤ fail_import_decl_value_param_type.carbon:[[@LINE+18]]:12 // CHECK:STDERR: -> │ Cpp.foo2(*p); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: forming value of incomplete type // CHECK:STDERR: · ┃ `Cpp.ForwardDeclaredStruct` // CHECK:STDERR: · ┃ [IncompleteTypeInValueConversion] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_import_decl_value_param_type.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./decl_value_param_type.h // CHECK:STDERR: │ struct ForwardDeclaredStruct; // CHECK:STDERR: · ┬ @@ -350,13 +348,12 @@ library "[[@TEST_NAME]]"; import Cpp library "incomplete.h"; fn F() { - // CHECK:STDERR: ╭─┤ fail_import_incomplete.carbon:[[@LINE+13]]:3 + // CHECK:STDERR: ╭─┤ fail_import_incomplete.carbon:[[@LINE+12]]:3 // CHECK:STDERR: -> │ Cpp.IncompleteStruct.foo(); // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: member access into incomplete class `Cpp.IncompleteStruct` // CHECK:STDERR: · ┃ [QualifiedExprInIncompleteClassScope] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_import_incomplete.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./incomplete.h // CHECK:STDERR: │ struct IncompleteStruct; // CHECK:STDERR: · ┬ @@ -447,13 +444,12 @@ library "[[@TEST_NAME]]"; import Cpp library "decl_value_return_type.h"; fn F() { - // CHECK:STDERR: ╭─┤ fail_import_decl_value_return_type.carbon:[[@LINE+18]]:3 + // CHECK:STDERR: ╭─┤ fail_import_decl_value_return_type.carbon:[[@LINE+17]]:3 // CHECK:STDERR: -> │ Cpp.foo_decl_value_return(); // CHECK:STDERR: · ━━━━━━┳━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: function returns incomplete type `Cpp.DeclValueReturnStruct` // CHECK:STDERR: · ┃ [IncompleteTypeInFunctionReturnType] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_import_decl_value_return_type.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./decl_value_return_type.h // CHECK:STDERR: │ struct DeclValueReturnStruct; // CHECK:STDERR: · ┬ diff --git a/toolchain/check/testdata/interop/cpp/function/import/union.carbon b/toolchain/check/testdata/interop/cpp/function/import/union.carbon index 5bd66085ca32..7679606bb521 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/union.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/union.carbon @@ -62,14 +62,13 @@ library "[[@TEST_NAME]]"; import Cpp library "decl_value_param_type.h"; fn F(p: Cpp.ForwardDeclaredUnion*) { - // CHECK:STDERR: ╭─┤ fail_import_decl_value_param_type.carbon:[[@LINE+19]]:12 + // CHECK:STDERR: ╭─┤ fail_import_decl_value_param_type.carbon:[[@LINE+18]]:12 // CHECK:STDERR: -> │ Cpp.foo1(*p); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: forming value of incomplete type // CHECK:STDERR: · ┃ `Cpp.ForwardDeclaredUnion` // CHECK:STDERR: · ┃ [IncompleteTypeInValueConversion] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_import_decl_value_param_type.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./decl_value_param_type.h // CHECK:STDERR: │ union ForwardDeclaredUnion; // CHECK:STDERR: · ┬ @@ -82,14 +81,13 @@ fn F(p: Cpp.ForwardDeclaredUnion*) { // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.foo1(*p); - // CHECK:STDERR: ╭─┤ fail_import_decl_value_param_type.carbon:[[@LINE+19]]:12 + // CHECK:STDERR: ╭─┤ fail_import_decl_value_param_type.carbon:[[@LINE+18]]:12 // CHECK:STDERR: -> │ Cpp.foo2(*p); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: forming value of incomplete type // CHECK:STDERR: · ┃ `Cpp.ForwardDeclaredUnion` // CHECK:STDERR: · ┃ [IncompleteTypeInValueConversion] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_import_decl_value_param_type.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./decl_value_param_type.h // CHECK:STDERR: │ union ForwardDeclaredUnion; // CHECK:STDERR: · ┬ @@ -306,13 +304,12 @@ library "[[@TEST_NAME]]"; import Cpp library "incomplete.h"; fn F() { - // CHECK:STDERR: ╭─┤ fail_import_incomplete.carbon:[[@LINE+13]]:3 + // CHECK:STDERR: ╭─┤ fail_import_incomplete.carbon:[[@LINE+12]]:3 // CHECK:STDERR: -> │ Cpp.IncompleteUnion.foo(); // CHECK:STDERR: · ━━━━━━━━━┳━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: member access into incomplete class `Cpp.IncompleteUnion` // CHECK:STDERR: · ┃ [QualifiedExprInIncompleteClassScope] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_import_incomplete.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./incomplete.h // CHECK:STDERR: │ union IncompleteUnion; // CHECK:STDERR: · ┬ @@ -402,13 +399,12 @@ library "[[@TEST_NAME]]"; import Cpp library "decl_value_return_type.h"; fn F() { - // CHECK:STDERR: ╭─┤ fail_import_decl_value_return_type.carbon:[[@LINE+18]]:3 + // CHECK:STDERR: ╭─┤ fail_import_decl_value_return_type.carbon:[[@LINE+17]]:3 // CHECK:STDERR: -> │ Cpp.foo_decl_value_return(); // CHECK:STDERR: · ━━━━━━━┳━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: function returns incomplete type `Cpp.DeclValueReturnUnion` // CHECK:STDERR: · ┃ [IncompleteTypeInFunctionReturnType] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_import_decl_value_return_type.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./decl_value_return_type.h // CHECK:STDERR: │ union DeclValueReturnUnion; // CHECK:STDERR: · ┬ diff --git a/toolchain/check/testdata/interop/cpp/impls/as.carbon b/toolchain/check/testdata/interop/cpp/impls/as.carbon index 2bb86a00fe3a..8f78fa0f8220 100644 --- a/toolchain/check/testdata/interop/cpp/impls/as.carbon +++ b/toolchain/check/testdata/interop/cpp/impls/as.carbon @@ -112,18 +112,14 @@ import Cpp library "conversions.h"; fn ConstructorExplicit(s: Cpp.Source) { //@dump-sem-ir-begin - // CHECK:STDERR: ╭─┤ fail_conditionally_explicit_implicit.carbon:[[@LINE+14]]:42 + // CHECK:STDERR: ╭─┤ fail_conditionally_explicit_implicit.carbon:[[@LINE+10]]:42 // CHECK:STDERR: -> │ let _: Cpp.ConditionallyExplicitTrue = s; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert - // CHECK:STDERR: · │ ┃ expression of type `Source` - // CHECK:STDERR: · │ ┃ to - // CHECK:STDERR: · │ ┃ `Cpp.ConditionallyExplicit` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╭────────────────────────────────────────╯ - // CHECK:STDERR: · │ type `Cpp.Source` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.ConditionallyExplicit)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ expression of type `Source` + // CHECK:STDERR: · ┃ to + // CHECK:STDERR: · ┃ `Cpp.ConditionallyExplicit` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: Cpp.ConditionallyExplicitTrue = s; @@ -571,9 +567,9 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: fn @ConstructorExplicit(%s.param: %Source) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %Source = name_ref s, %s -// CHECK:STDOUT: %.loc22_42: %ConditionallyExplicit.9d4 = converted %s.ref, [concrete = ] -// CHECK:STDOUT: %.loc22_13: type = splice_block %ConditionallyExplicitTrue.ref [concrete = constants.%ConditionallyExplicit.9d4] { -// CHECK:STDOUT: %Cpp.ref.loc22: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc18_42: %ConditionallyExplicit.9d4 = converted %s.ref, [concrete = ] +// CHECK:STDOUT: %.loc18_13: type = splice_block %ConditionallyExplicitTrue.ref [concrete = constants.%ConditionallyExplicit.9d4] { +// CHECK:STDOUT: %Cpp.ref.loc18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ConditionallyExplicitTrue.ref: type = name_ref ConditionallyExplicitTrue, imports.%ConditionallyExplicit.decl.6ab [concrete = constants.%ConditionallyExplicit.9d4] // CHECK:STDOUT: } // CHECK:STDOUT: %_: %ConditionallyExplicit.9d4 = wrapper_binding _, [concrete = ] @@ -586,27 +582,27 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: fn @ConversionExplicit(%s.param: %ConditionallyExplicit.3cd) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %ConditionallyExplicit.3cd = name_ref s, %s -// CHECK:STDOUT: %.loc28_21.1: ref %Dest.980 = temporary_storage -// CHECK:STDOUT: %addr: %ptr.ca8 = addr_of %.loc28_21.1 +// CHECK:STDOUT: %.loc24_21.1: ref %Dest.980 = temporary_storage +// CHECK:STDOUT: %addr: %ptr.ca8 = addr_of %.loc24_21.1 // CHECK:STDOUT: %Dest__carbon_thunk.call: init %empty_tuple.type = call imports.%Dest__carbon_thunk.decl(%s.ref, %addr) -// CHECK:STDOUT: %.loc28_21.2: init %Dest.980 to %.loc28_21.1 = mark_in_place_init %Dest__carbon_thunk.call -// CHECK:STDOUT: %.loc28_21.3: init %Dest.980 = converted %s.ref, %.loc28_21.2 -// CHECK:STDOUT: %.loc28_21.4: ref %Dest.980 = temporary %.loc28_21.1, %.loc28_21.3 -// CHECK:STDOUT: %.loc28_21.5: %Dest.980 = acquire_value %.loc28_21.4 -// CHECK:STDOUT: %.loc28_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] { -// CHECK:STDOUT: %Cpp.ref.loc28: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc24_21.2: init %Dest.980 to %.loc24_21.1 = mark_in_place_init %Dest__carbon_thunk.call +// CHECK:STDOUT: %.loc24_21.3: init %Dest.980 = converted %s.ref, %.loc24_21.2 +// CHECK:STDOUT: %.loc24_21.4: ref %Dest.980 = temporary %.loc24_21.1, %.loc24_21.3 +// CHECK:STDOUT: %.loc24_21.5: %Dest.980 = acquire_value %.loc24_21.4 +// CHECK:STDOUT: %.loc24_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] { +// CHECK:STDOUT: %Cpp.ref.loc24: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Dest.ref: type = name_ref Dest, imports.%Dest.decl [concrete = constants.%Dest.980] // CHECK:STDOUT: } -// CHECK:STDOUT: %_: %Dest.980 = wrapper_binding _, %.loc28_21.5 +// CHECK:STDOUT: %_: %Dest.980 = wrapper_binding _, %.loc24_21.5 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %_.patt: %pattern_type.b72 = value_binding_pattern _ [concrete = constants.%_.patt.664] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.facet.loc28_21.1: %Destroy.type = facet_value constants.%Dest.980, (constants.%DestroyImpl.impl_witness.771, constants.%custom_witness.576) [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %.loc28_21.6: %Destroy.type = converted constants.%Dest.980, %Destroy.facet.loc28_21.1 [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %Destroy.facet.loc28_21.2: %Destroy.type = facet_value constants.%Dest.980, (constants.%DestroyImpl.impl_witness.771, constants.%custom_witness.576) [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %.loc28_21.7: %Destroy.type = converted constants.%Dest.980, %Destroy.facet.loc28_21.2 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %Destroy.facet.loc24_21.1: %Destroy.type = facet_value constants.%Dest.980, (constants.%DestroyImpl.impl_witness.771, constants.%custom_witness.576) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc24_21.6: %Destroy.type = converted constants.%Dest.980, %Destroy.facet.loc24_21.1 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %Destroy.facet.loc24_21.2: %Destroy.type = facet_value constants.%Dest.980, (constants.%DestroyImpl.impl_witness.771, constants.%custom_witness.576) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc24_21.7: %Destroy.type = converted constants.%Dest.980, %Destroy.facet.loc24_21.2 [concrete = constants.%Destroy.facet] // CHECK:STDOUT: -// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc28_21.4) +// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc24_21.4) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/impls/copy.carbon b/toolchain/check/testdata/interop/cpp/impls/copy.carbon index 2e6b01bdda67..616cb4d493d9 100644 --- a/toolchain/check/testdata/interop/cpp/impls/copy.carbon +++ b/toolchain/check/testdata/interop/cpp/impls/copy.carbon @@ -134,13 +134,11 @@ fn CopyDeletedMove(c: Cpp.DeletedMove) -> Cpp.DeletedMove { fn CopyNonConstCopy(c: Cpp.NonConstCopy) -> Cpp.NonConstCopy { // TODO: List candidates here. - // CHECK:STDERR: ╭─┤ fail_copy_noncopyable.carbon:[[@LINE+9]]:10 + // CHECK:STDERR: ╭─┤ fail_copy_noncopyable.carbon:[[@LINE+7]]:10 // CHECK:STDERR: -> │ return c; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot copy value of type `NonConstCopy` - // CHECK:STDERR: · │ ┃ [CopyOfUncopyableType] - // CHECK:STDERR: · ╰────┤ type `Cpp.NonConstCopy` does not implement interface `Core.Copy` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [CopyOfUncopyableType] // CHECK:STDERR: ╰──── // CHECK:STDERR: return c; @@ -148,14 +146,11 @@ fn CopyNonConstCopy(c: Cpp.NonConstCopy) -> Cpp.NonConstCopy { fn CopyAmbiguousCopy(c: Cpp.AmbiguousCopy) -> Cpp.AmbiguousCopy { // TODO: List candidates here. - // CHECK:STDERR: ╭─┤ fail_copy_noncopyable.carbon:[[@LINE+10]]:10 + // CHECK:STDERR: ╭─┤ fail_copy_noncopyable.carbon:[[@LINE+7]]:10 // CHECK:STDERR: -> │ return c; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot copy value of type `AmbiguousCopy` - // CHECK:STDERR: · │ ┃ [CopyOfUncopyableType] - // CHECK:STDERR: · ╰────┤ type `Cpp.AmbiguousCopy` does not implement interface - // CHECK:STDERR: · │ `Core.Copy` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [CopyOfUncopyableType] // CHECK:STDERR: ╰──── // CHECK:STDERR: return c; diff --git a/toolchain/check/testdata/interop/cpp/impls/destroy.carbon b/toolchain/check/testdata/interop/cpp/impls/destroy.carbon index caa1f35d02ca..22709054efa9 100644 --- a/toolchain/check/testdata/interop/cpp/impls/destroy.carbon +++ b/toolchain/check/testdata/interop/cpp/impls/destroy.carbon @@ -91,9 +91,9 @@ fn DestroyClassWithProtectedBaseDestructor() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon // CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) { - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused a: Derived = {.base = {}}; @@ -113,7 +113,7 @@ class Derived { fn DestroyClassWithPrivateBaseDestructor() { //@dump-sem-ir-begin // TODO: We should not allow this, as the destructor of the base class is private. - // CHECK:STDERR: ╭─┤ fail_destroy_private_base_destructor.carbon:[[@LINE+19]]:3 + // CHECK:STDERR: ╭─┤ fail_destroy_private_base_destructor.carbon:[[@LINE+43]]:3 // CHECK:STDERR: -> │ var unused a: Derived = {.base = {}}; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot access private member `` of type @@ -127,9 +127,33 @@ fn DestroyClassWithPrivateBaseDestructor() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon // CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) { - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: + // CHECK:STDERR: ╷ ╭── included from: fail_destroy_nondestroyable.carbon [InCppInclude] + // CHECK:STDERR: ├─┤ ./types.h:13:7 + // CHECK:STDERR: -> │ class AmbiguousDestructorT { + // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ┗━━┫ error: destructor of class 'AmbiguousDestructorT<>' is ambiguous + // CHECK:STDERR: · │ ┃ [CppInteropParseError] + // CHECK:STDERR: · ╰────┤ in instantiation of template class 'AmbiguousDestructorT<>' + // CHECK:STDERR: · │ requested here + // CHECK:STDERR: · │ [CppInteropParseNote] + // CHECK:STDERR: │ public: + // CHECK:STDERR: │ ~AmbiguousDestructorT() requires (N != 1); + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ candidate function [CppInteropParseNote] + // CHECK:STDERR: │ ~AmbiguousDestructorT() requires (N != 2); + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ candidate function [CppInteropParseNote] + // CHECK:STDERR: ┆ + // CHECK:STDERR: ├─┤ fail_destroy_nondestroyable.carbon + // CHECK:STDERR: │ var unused a: Cpp.AmbiguousDestructor = {}; + // CHECK:STDERR: · ──────┬──────────────── + // CHECK:STDERR: · ╰──┤ in completion of type `Cpp.AmbiguousDestructorT` here + // CHECK:STDERR: · │ [InTypeCompletion] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused a: Derived = {.base = {}}; @@ -143,31 +167,6 @@ library "[[@TEST_NAME]]"; import Cpp library "types.h"; fn AmbiguousDestroy() { - // CHECK:STDERR: ╭─┤ fail_destroy_nondestroyable.carbon:[[@LINE+25]]:17 - // CHECK:STDERR: -> │ var unused a: Cpp.AmbiguousDestructor = {}; - // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━ - // CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type - // CHECK:STDERR: · ┃ `AmbiguousDestructor` in name binding declaration - // CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] - // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_destroy_nondestroyable.carbon [InCppInclude] - // CHECK:STDERR: ├─┤ ./types.h - // CHECK:STDERR: │ class AmbiguousDestructorT { - // CHECK:STDERR: · ┬ - // CHECK:STDERR: · ╰──┤ in instantiation of template class 'AmbiguousDestructorT<>' requested - // CHECK:STDERR: · │ │ here - // CHECK:STDERR: · │ │ [CppInteropParseNote] - // CHECK:STDERR: · ╰────┤ destructor of class 'AmbiguousDestructorT<>' is ambiguous - // CHECK:STDERR: · │ [CppInteropParseError] - // CHECK:STDERR: │ public: - // CHECK:STDERR: │ ~AmbiguousDestructorT() requires (N != 1); - // CHECK:STDERR: · ┬ - // CHECK:STDERR: · ╰──┤ candidate function [CppInteropParseNote] - // CHECK:STDERR: │ ~AmbiguousDestructorT() requires (N != 2); - // CHECK:STDERR: · ┬ - // CHECK:STDERR: · ╰──┤ candidate function [CppInteropParseNote] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: var unused a: Cpp.AmbiguousDestructor = {}; } @@ -185,9 +184,9 @@ fn DeletedDestroy() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon // CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) { - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_destroy_nondestroyable.carbon:[[@LINE+14]]:3 @@ -199,9 +198,9 @@ fn DeletedDestroy() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon // CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) { - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused a: Cpp.DeletedDestructor = {}; @@ -222,9 +221,9 @@ fn PrivateDestroy() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon // CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) { - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused a: Cpp.PrivateDestructor = {}; @@ -245,9 +244,9 @@ fn ProtectedDestroy() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon // CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) { - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused a: Cpp.ProtectedDestructor = {}; @@ -299,9 +298,9 @@ fn F() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon // CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) { - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: var _: AdaptNoDestroy = Make(); @@ -609,7 +608,7 @@ fn F() { // CHECK:STDOUT: %SubobjectDestroy.facet.be1: %SubobjectDestroy.type = facet_value %PrivateDestructor, (%custom_witness.fe1) [concrete] // CHECK:STDOUT: %DestroyImpl.impl_witness.a8a: = impl_witness imports.%DestroyImpl.impl_witness_table, @T.as_type.as.DestroyImpl.impl(%SubobjectDestroy.facet.be1) [concrete] // CHECK:STDOUT: %Destroy.facet.75a: %Destroy.type = facet_value %PrivateDestructor, (%DestroyImpl.impl_witness.a8a, %custom_witness.fe1) [concrete] -// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc32_3.2 [concrete] +// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc56_3.2 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.2: %SubobjectDestroy.WithSelf.Op.type.6870fd.2 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80ef6.2: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.2), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.1fc: %SubobjectDestroy.type = facet_value %Derived, (%custom_witness.b80ef6.2) [concrete] @@ -625,52 +624,52 @@ fn F() { // CHECK:STDOUT: fn @DestroyClassWithPrivateBaseDestructor() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Derived = var_storage %a.var_patt -// CHECK:STDOUT: %.loc32_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40] -// CHECK:STDOUT: %.loc32_38.1: %struct_type.base.f5e = struct_literal (%.loc32_37.1) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc32_38.2: ref %.c73 = class_element_access %a.var, element0 -// CHECK:STDOUT: %.loc32_37.2: init %.c73 to %.loc32_38.2 = class_init () [concrete = constants.%empty_struct.d8b] -// CHECK:STDOUT: %.loc32_38.3: init %.c73 = converted %.loc32_37.1, %.loc32_37.2 [concrete = constants.%empty_struct.d8b] -// CHECK:STDOUT: %.loc32_38.4: init %PrivateDestructor = as_compatible %.loc32_38.3 [concrete = constants.%PrivateDestructor.val] -// CHECK:STDOUT: %.loc32_38.5: init %Derived to %a.var = class_init (%.loc32_38.4) [concrete = constants.%Derived.val] -// CHECK:STDOUT: %.loc32_3.1: init %Derived = converted %.loc32_38.1, %.loc32_38.5 [concrete = constants.%Derived.val] -// CHECK:STDOUT: assign %a.var, %.loc32_3.1 +// CHECK:STDOUT: %.loc56_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40] +// CHECK:STDOUT: %.loc56_38.1: %struct_type.base.f5e = struct_literal (%.loc56_37.1) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc56_38.2: ref %.c73 = class_element_access %a.var, element0 +// CHECK:STDOUT: %.loc56_37.2: init %.c73 to %.loc56_38.2 = class_init () [concrete = constants.%empty_struct.d8b] +// CHECK:STDOUT: %.loc56_38.3: init %.c73 = converted %.loc56_37.1, %.loc56_37.2 [concrete = constants.%empty_struct.d8b] +// CHECK:STDOUT: %.loc56_38.4: init %PrivateDestructor = as_compatible %.loc56_38.3 [concrete = constants.%PrivateDestructor.val] +// CHECK:STDOUT: %.loc56_38.5: init %Derived to %a.var = class_init (%.loc56_38.4) [concrete = constants.%Derived.val] +// CHECK:STDOUT: %.loc56_3.1: init %Derived = converted %.loc56_38.1, %.loc56_38.5 [concrete = constants.%Derived.val] +// CHECK:STDOUT: assign %a.var, %.loc56_3.1 // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived] // CHECK:STDOUT: %a: ref %Derived = wrapper_binding a, %a.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.746 = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.746 = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.facet.loc32_3.1: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d] -// CHECK:STDOUT: %.loc32_3.2: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc32_3.1 [concrete = constants.%Destroy.facet.35d] -// CHECK:STDOUT: %Destroy.facet.loc32_3.2: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d] -// CHECK:STDOUT: %.loc32_3.3: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc32_3.2 [concrete = constants.%Destroy.facet.35d] +// CHECK:STDOUT: %Destroy.facet.loc56_3.1: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d] +// CHECK:STDOUT: %.loc56_3.2: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc56_3.1 [concrete = constants.%Destroy.facet.35d] +// CHECK:STDOUT: %Destroy.facet.loc56_3.2: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d] +// CHECK:STDOUT: %.loc56_3.3: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc56_3.2 [concrete = constants.%Destroy.facet.35d] // CHECK:STDOUT: // CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc32_3.1(%self.param: ref %struct_type.base.9aa) { +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc56_3.1(%self.param: ref %struct_type.base.9aa) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc32_3.1: ref %PrivateDestructor = struct_access %self.param, element0 -// CHECK:STDOUT: %Destroy.facet.loc32_3.1: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a] -// CHECK:STDOUT: %.loc32_3.2: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc32_3.1 [concrete = constants.%Destroy.facet.75a] -// CHECK:STDOUT: %Destroy.facet.loc32_3.2: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a] -// CHECK:STDOUT: %.loc32_3.3: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc32_3.2 [concrete = constants.%Destroy.facet.75a] +// CHECK:STDOUT: %.loc56_3.1: ref %PrivateDestructor = struct_access %self.param, element0 +// CHECK:STDOUT: %Destroy.facet.loc56_3.1: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a] +// CHECK:STDOUT: %.loc56_3.2: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc56_3.1 [concrete = constants.%Destroy.facet.75a] +// CHECK:STDOUT: %Destroy.facet.loc56_3.2: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a] +// CHECK:STDOUT: %.loc56_3.3: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc56_3.2 [concrete = constants.%Destroy.facet.75a] // CHECK:STDOUT: -// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc32_3.1) +// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc56_3.1) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc32_3.2(%self.param: ref %Derived) { +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc56_3.2(%self.param: ref %Derived) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %base.ref: %Derived.elem = name_ref base, @Derived.%.loc7 [concrete = @Derived.%.loc7] -// CHECK:STDOUT: %.loc32_3.1: ref %PrivateDestructor = class_element_access %self.param, element0 -// CHECK:STDOUT: %Destroy.facet.loc32_3.1: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a] -// CHECK:STDOUT: %.loc32_3.2: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc32_3.1 [concrete = constants.%Destroy.facet.75a] -// CHECK:STDOUT: %Destroy.facet.loc32_3.2: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a] -// CHECK:STDOUT: %.loc32_3.3: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc32_3.2 [concrete = constants.%Destroy.facet.75a] +// CHECK:STDOUT: %.loc56_3.1: ref %PrivateDestructor = class_element_access %self.param, element0 +// CHECK:STDOUT: %Destroy.facet.loc56_3.1: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a] +// CHECK:STDOUT: %.loc56_3.2: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc56_3.1 [concrete = constants.%Destroy.facet.75a] +// CHECK:STDOUT: %Destroy.facet.loc56_3.2: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a] +// CHECK:STDOUT: %.loc56_3.3: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc56_3.2 [concrete = constants.%Destroy.facet.75a] // CHECK:STDOUT: -// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc32_3.1) +// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc56_3.1) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/impls/implicit_as.carbon b/toolchain/check/testdata/interop/cpp/impls/implicit_as.carbon index 96ed02f7c29e..f660b6b816c1 100644 --- a/toolchain/check/testdata/interop/cpp/impls/implicit_as.carbon +++ b/toolchain/check/testdata/interop/cpp/impls/implicit_as.carbon @@ -92,15 +92,12 @@ import Cpp library "implicit_conversions.h"; fn NonConstConversionTest(s: Cpp.NonConstConversion) { //@dump-sem-ir-begin - // CHECK:STDERR: ╭─┤ fail_expr_category.carbon:[[@LINE+11]]:21 + // CHECK:STDERR: ╭─┤ fail_expr_category.carbon:[[@LINE+8]]:21 // CHECK:STDERR: -> │ let _: Cpp.Dest = s; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `NonConstConversion` to `Cpp.Dest` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.NonConstConversion` does not implement - // CHECK:STDERR: · │ interface `Core.ImplicitAs(Cpp.Dest)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `NonConstConversion` to `Cpp.Dest` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: Cpp.Dest = s; @@ -161,17 +158,13 @@ import Cpp library "implicit_conversions.h"; fn DeletedConstructorTest(s: Cpp.Source) { //@dump-sem-ir-begin - // CHECK:STDERR: ╭─┤ fail_deleted.carbon:[[@LINE+13]]:35 + // CHECK:STDERR: ╭─┤ fail_deleted.carbon:[[@LINE+9]]:35 // CHECK:STDERR: -> │ let _: Cpp.DeletedConstructor = s; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert - // CHECK:STDERR: · │ ┃ expression of type `Source` to - // CHECK:STDERR: · │ ┃ `Cpp.DeletedConstructor` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╭─────────────────────────────────╯ - // CHECK:STDERR: · │ type `Cpp.Source` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.DeletedConstructor)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ expression of type `Source` to + // CHECK:STDERR: · ┃ `Cpp.DeletedConstructor` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: Cpp.DeletedConstructor = s; @@ -180,15 +173,12 @@ fn DeletedConstructorTest(s: Cpp.Source) { fn DeletedConversionTest(s: Cpp.DeletedConversion) { //@dump-sem-ir-begin - // CHECK:STDERR: ╭─┤ fail_deleted.carbon:[[@LINE+11]]:21 + // CHECK:STDERR: ╭─┤ fail_deleted.carbon:[[@LINE+8]]:21 // CHECK:STDERR: -> │ let _: Cpp.Dest = s; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `DeletedConversion` to `Cpp.Dest` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.DeletedConversion` does not implement - // CHECK:STDERR: · │ interface `Core.ImplicitAs(Cpp.Dest)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `DeletedConversion` to `Cpp.Dest` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: Cpp.Dest = s; @@ -203,17 +193,13 @@ import Cpp library "implicit_conversions.h"; fn ExplicitConstructorTest(s: Cpp.Source) { //@dump-sem-ir-begin - // CHECK:STDERR: ╭─┤ fail_explicit.carbon:[[@LINE+13]]:36 + // CHECK:STDERR: ╭─┤ fail_explicit.carbon:[[@LINE+9]]:36 // CHECK:STDERR: -> │ let _: Cpp.ExplicitConstructor = s; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert - // CHECK:STDERR: · │ ┃ expression of type `Source` to - // CHECK:STDERR: · │ ┃ `Cpp.ExplicitConstructor` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╭──────────────────────────────────╯ - // CHECK:STDERR: · │ type `Cpp.Source` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.ExplicitConstructor)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ expression of type `Source` to + // CHECK:STDERR: · ┃ `Cpp.ExplicitConstructor` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: Cpp.ExplicitConstructor = s; @@ -222,15 +208,12 @@ fn ExplicitConstructorTest(s: Cpp.Source) { fn ExplicitConversionTest(s: Cpp.ExplicitConversion) { //@dump-sem-ir-begin - // CHECK:STDERR: ╭─┤ fail_explicit.carbon:[[@LINE+11]]:21 + // CHECK:STDERR: ╭─┤ fail_explicit.carbon:[[@LINE+8]]:21 // CHECK:STDERR: -> │ let _: Cpp.Dest = s; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `ExplicitConversion` to `Cpp.Dest` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.ExplicitConversion` does not implement - // CHECK:STDERR: · │ interface `Core.ImplicitAs(Cpp.Dest)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `ExplicitConversion` to `Cpp.Dest` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: Cpp.Dest = s; @@ -257,15 +240,12 @@ import Cpp library "implicit_conversions.h"; fn IntConstructorTest(u: u32) { //@dump-sem-ir-begin - // CHECK:STDERR: ╭─┤ fail_no_u32_to_int_conversion_in_carbon.carbon:[[@LINE+16]]:31 + // CHECK:STDERR: ╭─┤ fail_no_u32_to_int_conversion_in_carbon.carbon:[[@LINE+13]]:31 // CHECK:STDERR: -> │ let _: Cpp.IntConstructor = u; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression - // CHECK:STDERR: · │ ┃ of type `u32` to `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `u32` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ of type `u32` to `i32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ ./implicit_conversions.h // CHECK:STDERR: │ IntConstructor(int); @@ -341,42 +321,32 @@ import Cpp library "aggregate.h"; fn InitFromTuple() { //@dump-sem-ir-begin - // CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_tuple.carbon:[[@LINE+11]]:26 + // CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_tuple.carbon:[[@LINE+8]]:26 // CHECK:STDERR: -> │ let _: Cpp.Aggregate = (); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of - // CHECK:STDERR: · │ ┃ type `()` to `Cpp.Aggregate` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `()` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.Aggregate)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type `()` to `Cpp.Aggregate` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: Cpp.Aggregate = (); - // CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_tuple.carbon:[[@LINE+12]]:26 + // CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_tuple.carbon:[[@LINE+9]]:26 // CHECK:STDERR: -> │ let _: Cpp.Aggregate = (1,); // CHECK:STDERR: · ┳━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of - // CHECK:STDERR: · │ ┃ type `(Core.IntLiteral,)` to - // CHECK:STDERR: · │ ┃ `Cpp.Aggregate` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `(Core.IntLiteral,)` does not implement - // CHECK:STDERR: · │ interface `Core.ImplicitAs(Cpp.Aggregate)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type `(Core.IntLiteral,)` to + // CHECK:STDERR: · ┃ `Cpp.Aggregate` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: Cpp.Aggregate = (1,); - // CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_tuple.carbon:[[@LINE+13]]:26 + // CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_tuple.carbon:[[@LINE+9]]:26 // CHECK:STDERR: -> │ let _: Cpp.Aggregate = (1, 2); // CHECK:STDERR: · ┳━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of - // CHECK:STDERR: · │ ┃ type `(Core.IntLiteral, Core.IntLiteral)` - // CHECK:STDERR: · │ ┃ to `Cpp.Aggregate` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `(Core.IntLiteral, Core.IntLiteral)` does - // CHECK:STDERR: · │ not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.Aggregate)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type `(Core.IntLiteral, Core.IntLiteral)` + // CHECK:STDERR: · ┃ to `Cpp.Aggregate` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: Cpp.Aggregate = (1, 2); @@ -391,42 +361,32 @@ import Cpp library "aggregate.h"; fn InitFromStruct() { //@dump-sem-ir-begin - // CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_struct.carbon:[[@LINE+11]]:26 + // CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_struct.carbon:[[@LINE+8]]:26 // CHECK:STDERR: -> │ let _: Cpp.Aggregate = {}; // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of - // CHECK:STDERR: · │ ┃ type `{}` to `Cpp.Aggregate` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `{}` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.Aggregate)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type `{}` to `Cpp.Aggregate` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: Cpp.Aggregate = {}; - // CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_struct.carbon:[[@LINE+12]]:26 + // CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_struct.carbon:[[@LINE+9]]:26 // CHECK:STDERR: -> │ let _: Cpp.Aggregate = {.x = 1}; // CHECK:STDERR: · ┳━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of - // CHECK:STDERR: · │ ┃ type `{.x: Core.IntLiteral}` to - // CHECK:STDERR: · │ ┃ `Cpp.Aggregate` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `{.x: Core.IntLiteral}` does not implement - // CHECK:STDERR: · │ interface `Core.ImplicitAs(Cpp.Aggregate)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type `{.x: Core.IntLiteral}` to + // CHECK:STDERR: · ┃ `Cpp.Aggregate` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: Cpp.Aggregate = {.x = 1}; - // CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_struct.carbon:[[@LINE+13]]:26 + // CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_struct.carbon:[[@LINE+9]]:26 // CHECK:STDERR: -> │ let _: Cpp.Aggregate = {.x = 1, .y = 2}; - // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━ - // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━┛ + // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━ + // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ // CHECK:STDERR: · ┃ error: cannot implicitly convert expression of type // CHECK:STDERR: · ┃ `{.x: Core.IntLiteral, .y: Core.IntLiteral}` to `Cpp.Aggregate` // CHECK:STDERR: · ┃ [ConversionFailure] - // CHECK:STDERR: · ╰──┤ type `{.x: Core.IntLiteral, .y: Core.IntLiteral}` - // CHECK:STDERR: · │ does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.Aggregate)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: Cpp.Aggregate = {.x = 1, .y = 2}; @@ -455,44 +415,32 @@ import Cpp library "aggregate.h"; fn InitFromStruct() { //@dump-sem-ir-begin - // CHECK:STDERR: ╭─┤ fail_non_aggregate_from_struct.carbon:[[@LINE+11]]:29 + // CHECK:STDERR: ╭─┤ fail_non_aggregate_from_struct.carbon:[[@LINE+8]]:29 // CHECK:STDERR: -> │ let _: Cpp.NonAggregate = {}; // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of - // CHECK:STDERR: · │ ┃ type `{}` to `Cpp.NonAggregate` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `{}` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.NonAggregate)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type `{}` to `Cpp.NonAggregate` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: Cpp.NonAggregate = {}; - // CHECK:STDERR: ╭─┤ fail_non_aggregate_from_struct.carbon:[[@LINE+13]]:29 + // CHECK:STDERR: ╭─┤ fail_non_aggregate_from_struct.carbon:[[@LINE+9]]:29 // CHECK:STDERR: -> │ let _: Cpp.NonAggregate = {.x = 1}; // CHECK:STDERR: · ┳━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of - // CHECK:STDERR: · │ ┃ type `{.x: Core.IntLiteral}` to - // CHECK:STDERR: · │ ┃ `Cpp.NonAggregate` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `{.x: Core.IntLiteral}` does not - // CHECK:STDERR: · │ implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.NonAggregate)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ type `{.x: Core.IntLiteral}` to + // CHECK:STDERR: · ┃ `Cpp.NonAggregate` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: Cpp.NonAggregate = {.x = 1}; - // CHECK:STDERR: ╭─┤ fail_non_aggregate_from_struct.carbon:[[@LINE+14]]:29 + // CHECK:STDERR: ╭─┤ fail_non_aggregate_from_struct.carbon:[[@LINE+9]]:29 // CHECK:STDERR: -> │ let _: Cpp.NonAggregate = {.x = 1, .y = 2}; - // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━ - // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━ + // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ // CHECK:STDERR: · ┃ error: cannot implicitly convert expression of type // CHECK:STDERR: · ┃ `{.x: Core.IntLiteral, .y: Core.IntLiteral}` to `Cpp.NonAggregate` // CHECK:STDERR: · ┃ [ConversionFailure] - // CHECK:STDERR: · ╰──┤ type - // CHECK:STDERR: · │ `{.x: Core.IntLiteral, .y: Core.IntLiteral}` - // CHECK:STDERR: · │ does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.NonAggregate)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: Cpp.NonAggregate = {.x = 1, .y = 2}; @@ -680,9 +628,9 @@ fn InitFromStruct() { // CHECK:STDOUT: fn @NonConstConversionTest(%s.param: %NonConstConversion) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %NonConstConversion = name_ref s, %s -// CHECK:STDOUT: %.loc19_21: %Dest.980 = converted %s.ref, [concrete = ] -// CHECK:STDOUT: %.loc19_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] { -// CHECK:STDOUT: %Cpp.ref.loc19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc16_21: %Dest.980 = converted %s.ref, [concrete = ] +// CHECK:STDOUT: %.loc16_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] { +// CHECK:STDOUT: %Cpp.ref.loc16: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Dest.ref: type = name_ref Dest, imports.%Dest.decl [concrete = constants.%Dest.980] // CHECK:STDOUT: } // CHECK:STDOUT: %_: %Dest.980 = wrapper_binding _, [concrete = ] @@ -844,9 +792,9 @@ fn InitFromStruct() { // CHECK:STDOUT: fn @DeletedConstructorTest(%s.param: %Source) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %Source = name_ref s, %s -// CHECK:STDOUT: %.loc21_35: %DeletedConstructor = converted %s.ref, [concrete = ] -// CHECK:STDOUT: %.loc21_13: type = splice_block %DeletedConstructor.ref [concrete = constants.%DeletedConstructor] { -// CHECK:STDOUT: %Cpp.ref.loc21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc17_35: %DeletedConstructor = converted %s.ref, [concrete = ] +// CHECK:STDOUT: %.loc17_13: type = splice_block %DeletedConstructor.ref [concrete = constants.%DeletedConstructor] { +// CHECK:STDOUT: %Cpp.ref.loc17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %DeletedConstructor.ref: type = name_ref DeletedConstructor, imports.%DeletedConstructor.decl [concrete = constants.%DeletedConstructor] // CHECK:STDOUT: } // CHECK:STDOUT: %_: %DeletedConstructor = wrapper_binding _, [concrete = ] @@ -859,9 +807,9 @@ fn InitFromStruct() { // CHECK:STDOUT: fn @DeletedConversionTest(%s.param: %DeletedConversion) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %DeletedConversion = name_ref s, %s -// CHECK:STDOUT: %.loc38_21: %Dest.980 = converted %s.ref, [concrete = ] -// CHECK:STDOUT: %.loc38_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] { -// CHECK:STDOUT: %Cpp.ref.loc38: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc31_21: %Dest.980 = converted %s.ref, [concrete = ] +// CHECK:STDOUT: %.loc31_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] { +// CHECK:STDOUT: %Cpp.ref.loc31: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Dest.ref: type = name_ref Dest, imports.%Dest.decl [concrete = constants.%Dest.980] // CHECK:STDOUT: } // CHECK:STDOUT: %_: %Dest.980 = wrapper_binding _, [concrete = ] @@ -902,9 +850,9 @@ fn InitFromStruct() { // CHECK:STDOUT: fn @ExplicitConstructorTest(%s.param: %Source) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %Source = name_ref s, %s -// CHECK:STDOUT: %.loc21_36: %ExplicitConstructor = converted %s.ref, [concrete = ] -// CHECK:STDOUT: %.loc21_13: type = splice_block %ExplicitConstructor.ref [concrete = constants.%ExplicitConstructor] { -// CHECK:STDOUT: %Cpp.ref.loc21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc17_36: %ExplicitConstructor = converted %s.ref, [concrete = ] +// CHECK:STDOUT: %.loc17_13: type = splice_block %ExplicitConstructor.ref [concrete = constants.%ExplicitConstructor] { +// CHECK:STDOUT: %Cpp.ref.loc17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ExplicitConstructor.ref: type = name_ref ExplicitConstructor, imports.%ExplicitConstructor.decl [concrete = constants.%ExplicitConstructor] // CHECK:STDOUT: } // CHECK:STDOUT: %_: %ExplicitConstructor = wrapper_binding _, [concrete = ] @@ -917,9 +865,9 @@ fn InitFromStruct() { // CHECK:STDOUT: fn @ExplicitConversionTest(%s.param: %ExplicitConversion) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %ExplicitConversion = name_ref s, %s -// CHECK:STDOUT: %.loc38_21: %Dest.980 = converted %s.ref, [concrete = ] -// CHECK:STDOUT: %.loc38_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] { -// CHECK:STDOUT: %Cpp.ref.loc38: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc31_21: %Dest.980 = converted %s.ref, [concrete = ] +// CHECK:STDOUT: %.loc31_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] { +// CHECK:STDOUT: %Cpp.ref.loc31: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Dest.ref: type = name_ref Dest, imports.%Dest.decl [concrete = constants.%Dest.980] // CHECK:STDOUT: } // CHECK:STDOUT: %_: %Dest.980 = wrapper_binding _, [concrete = ] @@ -1042,28 +990,28 @@ fn InitFromStruct() { // CHECK:STDOUT: fn @IntConstructorTest(%u.param: %u32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %u.ref: %u32 = name_ref u, %u -// CHECK:STDOUT: %.loc24_31.1: ref %IntConstructor = temporary_storage -// CHECK:STDOUT: %.loc24_31.2: %i32 = converted %u.ref, [concrete = ] -// CHECK:STDOUT: %addr: %ptr.100 = addr_of %.loc24_31.1 +// CHECK:STDOUT: %.loc21_31.1: ref %IntConstructor = temporary_storage +// CHECK:STDOUT: %.loc21_31.2: %i32 = converted %u.ref, [concrete = ] +// CHECK:STDOUT: %addr: %ptr.100 = addr_of %.loc21_31.1 // CHECK:STDOUT: %IntConstructor__carbon_thunk.call: init %empty_tuple.type = call imports.%IntConstructor__carbon_thunk.decl(, %addr) -// CHECK:STDOUT: %.loc24_31.3: init %IntConstructor to %.loc24_31.1 = mark_in_place_init %IntConstructor__carbon_thunk.call -// CHECK:STDOUT: %.loc24_31.4: init %IntConstructor = converted %u.ref, %.loc24_31.3 -// CHECK:STDOUT: %.loc24_31.5: ref %IntConstructor = temporary %.loc24_31.1, %.loc24_31.4 -// CHECK:STDOUT: %.loc24_31.6: %IntConstructor = acquire_value %.loc24_31.5 -// CHECK:STDOUT: %.loc24_13: type = splice_block %IntConstructor.ref [concrete = constants.%IntConstructor] { +// CHECK:STDOUT: %.loc21_31.3: init %IntConstructor to %.loc21_31.1 = mark_in_place_init %IntConstructor__carbon_thunk.call +// CHECK:STDOUT: %.loc21_31.4: init %IntConstructor = converted %u.ref, %.loc21_31.3 +// CHECK:STDOUT: %.loc21_31.5: ref %IntConstructor = temporary %.loc21_31.1, %.loc21_31.4 +// CHECK:STDOUT: %.loc21_31.6: %IntConstructor = acquire_value %.loc21_31.5 +// CHECK:STDOUT: %.loc21_13: type = splice_block %IntConstructor.ref [concrete = constants.%IntConstructor] { // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %IntConstructor.ref: type = name_ref IntConstructor, imports.%IntConstructor.decl [concrete = constants.%IntConstructor] // CHECK:STDOUT: } -// CHECK:STDOUT: %_: %IntConstructor = wrapper_binding _, %.loc24_31.6 +// CHECK:STDOUT: %_: %IntConstructor = wrapper_binding _, %.loc21_31.6 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %_.patt: %pattern_type.c4e = value_binding_pattern _ [concrete = constants.%_.patt.151] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.facet.loc24_31.1: %Destroy.type = facet_value constants.%IntConstructor, (constants.%DestroyImpl.impl_witness.1d9, constants.%custom_witness.576) [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %.loc24_31.7: %Destroy.type = converted constants.%IntConstructor, %Destroy.facet.loc24_31.1 [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %Destroy.facet.loc24_31.2: %Destroy.type = facet_value constants.%IntConstructor, (constants.%DestroyImpl.impl_witness.1d9, constants.%custom_witness.576) [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %.loc24_31.8: %Destroy.type = converted constants.%IntConstructor, %Destroy.facet.loc24_31.2 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %Destroy.facet.loc21_31.1: %Destroy.type = facet_value constants.%IntConstructor, (constants.%DestroyImpl.impl_witness.1d9, constants.%custom_witness.576) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc21_31.7: %Destroy.type = converted constants.%IntConstructor, %Destroy.facet.loc21_31.1 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %Destroy.facet.loc21_31.2: %Destroy.type = facet_value constants.%IntConstructor, (constants.%DestroyImpl.impl_witness.1d9, constants.%custom_witness.576) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc21_31.8: %Destroy.type = converted constants.%IntConstructor, %Destroy.facet.loc21_31.2 [concrete = constants.%Destroy.facet] // CHECK:STDOUT: -// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc24_31.5) +// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc21_31.5) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1384,38 +1332,38 @@ fn InitFromStruct() { // CHECK:STDOUT: // CHECK:STDOUT: fn @InitFromTuple() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc19_27.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc19_27.2: %Aggregate = converted %.loc19_27.1, [concrete = ] -// CHECK:STDOUT: %.loc19_13: type = splice_block %Aggregate.ref.loc19 [concrete = constants.%Aggregate] { -// CHECK:STDOUT: %Cpp.ref.loc19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Aggregate.ref.loc19: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate] +// CHECK:STDOUT: %.loc16_27.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc16_27.2: %Aggregate = converted %.loc16_27.1, [concrete = ] +// CHECK:STDOUT: %.loc16_13: type = splice_block %Aggregate.ref.loc16 [concrete = constants.%Aggregate] { +// CHECK:STDOUT: %Cpp.ref.loc16: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Aggregate.ref.loc16: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate] // CHECK:STDOUT: } -// CHECK:STDOUT: %_.loc19: %Aggregate = wrapper_binding _, [concrete = ] +// CHECK:STDOUT: %_.loc16: %Aggregate = wrapper_binding _, [concrete = ] // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %_.patt.loc19: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt] +// CHECK:STDOUT: %_.patt.loc16: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %int_1.loc32: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] -// CHECK:STDOUT: %.loc32_29.1: %tuple.type.985 = tuple_literal (%int_1.loc32) [concrete = constants.%tuple.378] -// CHECK:STDOUT: %.loc32_29.2: %Aggregate = converted %.loc32_29.1, [concrete = ] -// CHECK:STDOUT: %.loc32_13: type = splice_block %Aggregate.ref.loc32 [concrete = constants.%Aggregate] { -// CHECK:STDOUT: %Cpp.ref.loc32: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Aggregate.ref.loc32: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate] +// CHECK:STDOUT: %int_1.loc26: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] +// CHECK:STDOUT: %.loc26_29.1: %tuple.type.985 = tuple_literal (%int_1.loc26) [concrete = constants.%tuple.378] +// CHECK:STDOUT: %.loc26_29.2: %Aggregate = converted %.loc26_29.1, [concrete = ] +// CHECK:STDOUT: %.loc26_13: type = splice_block %Aggregate.ref.loc26 [concrete = constants.%Aggregate] { +// CHECK:STDOUT: %Cpp.ref.loc26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Aggregate.ref.loc26: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate] // CHECK:STDOUT: } -// CHECK:STDOUT: %_.loc32: %Aggregate = wrapper_binding _, [concrete = ] +// CHECK:STDOUT: %_.loc26: %Aggregate = wrapper_binding _, [concrete = ] // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %_.patt.loc32: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt] +// CHECK:STDOUT: %_.patt.loc26: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %int_1.loc46: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] +// CHECK:STDOUT: %int_1.loc36: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2] -// CHECK:STDOUT: %.loc46_31.1: %tuple.type.f94 = tuple_literal (%int_1.loc46, %int_2) [concrete = constants.%tuple.ad8] -// CHECK:STDOUT: %.loc46_31.2: %Aggregate = converted %.loc46_31.1, [concrete = ] -// CHECK:STDOUT: %.loc46_13: type = splice_block %Aggregate.ref.loc46 [concrete = constants.%Aggregate] { -// CHECK:STDOUT: %Cpp.ref.loc46: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Aggregate.ref.loc46: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate] +// CHECK:STDOUT: %.loc36_31.1: %tuple.type.f94 = tuple_literal (%int_1.loc36, %int_2) [concrete = constants.%tuple.ad8] +// CHECK:STDOUT: %.loc36_31.2: %Aggregate = converted %.loc36_31.1, [concrete = ] +// CHECK:STDOUT: %.loc36_13: type = splice_block %Aggregate.ref.loc36 [concrete = constants.%Aggregate] { +// CHECK:STDOUT: %Cpp.ref.loc36: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Aggregate.ref.loc36: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate] // CHECK:STDOUT: } -// CHECK:STDOUT: %_.loc46: %Aggregate = wrapper_binding _, [concrete = ] +// CHECK:STDOUT: %_.loc36: %Aggregate = wrapper_binding _, [concrete = ] // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %_.patt.loc46: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt] +// CHECK:STDOUT: %_.patt.loc36: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: } @@ -1447,38 +1395,38 @@ fn InitFromStruct() { // CHECK:STDOUT: // CHECK:STDOUT: fn @InitFromStruct() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc19_27.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc19_27.2: %Aggregate = converted %.loc19_27.1, [concrete = ] -// CHECK:STDOUT: %.loc19_13: type = splice_block %Aggregate.ref.loc19 [concrete = constants.%Aggregate] { -// CHECK:STDOUT: %Cpp.ref.loc19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Aggregate.ref.loc19: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate] +// CHECK:STDOUT: %.loc16_27.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc16_27.2: %Aggregate = converted %.loc16_27.1, [concrete = ] +// CHECK:STDOUT: %.loc16_13: type = splice_block %Aggregate.ref.loc16 [concrete = constants.%Aggregate] { +// CHECK:STDOUT: %Cpp.ref.loc16: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Aggregate.ref.loc16: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate] // CHECK:STDOUT: } -// CHECK:STDOUT: %_.loc19: %Aggregate = wrapper_binding _, [concrete = ] +// CHECK:STDOUT: %_.loc16: %Aggregate = wrapper_binding _, [concrete = ] // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %_.patt.loc19: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt] +// CHECK:STDOUT: %_.patt.loc16: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %int_1.loc32: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] -// CHECK:STDOUT: %.loc32_33.1: %struct_type.x = struct_literal (%int_1.loc32) [concrete = constants.%struct.147] -// CHECK:STDOUT: %.loc32_33.2: %Aggregate = converted %.loc32_33.1, [concrete = ] -// CHECK:STDOUT: %.loc32_13: type = splice_block %Aggregate.ref.loc32 [concrete = constants.%Aggregate] { -// CHECK:STDOUT: %Cpp.ref.loc32: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Aggregate.ref.loc32: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate] +// CHECK:STDOUT: %int_1.loc26: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] +// CHECK:STDOUT: %.loc26_33.1: %struct_type.x = struct_literal (%int_1.loc26) [concrete = constants.%struct.147] +// CHECK:STDOUT: %.loc26_33.2: %Aggregate = converted %.loc26_33.1, [concrete = ] +// CHECK:STDOUT: %.loc26_13: type = splice_block %Aggregate.ref.loc26 [concrete = constants.%Aggregate] { +// CHECK:STDOUT: %Cpp.ref.loc26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Aggregate.ref.loc26: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate] // CHECK:STDOUT: } -// CHECK:STDOUT: %_.loc32: %Aggregate = wrapper_binding _, [concrete = ] +// CHECK:STDOUT: %_.loc26: %Aggregate = wrapper_binding _, [concrete = ] // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %_.patt.loc32: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt] +// CHECK:STDOUT: %_.patt.loc26: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %int_1.loc46: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] +// CHECK:STDOUT: %int_1.loc36: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2] -// CHECK:STDOUT: %.loc46_41.1: %struct_type.x.y = struct_literal (%int_1.loc46, %int_2) [concrete = constants.%struct.004] -// CHECK:STDOUT: %.loc46_41.2: %Aggregate = converted %.loc46_41.1, [concrete = ] -// CHECK:STDOUT: %.loc46_13: type = splice_block %Aggregate.ref.loc46 [concrete = constants.%Aggregate] { -// CHECK:STDOUT: %Cpp.ref.loc46: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %Aggregate.ref.loc46: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate] +// CHECK:STDOUT: %.loc36_41.1: %struct_type.x.y = struct_literal (%int_1.loc36, %int_2) [concrete = constants.%struct.004] +// CHECK:STDOUT: %.loc36_41.2: %Aggregate = converted %.loc36_41.1, [concrete = ] +// CHECK:STDOUT: %.loc36_13: type = splice_block %Aggregate.ref.loc36 [concrete = constants.%Aggregate] { +// CHECK:STDOUT: %Cpp.ref.loc36: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Aggregate.ref.loc36: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate] // CHECK:STDOUT: } -// CHECK:STDOUT: %_.loc46: %Aggregate = wrapper_binding _, [concrete = ] +// CHECK:STDOUT: %_.loc36: %Aggregate = wrapper_binding _, [concrete = ] // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %_.patt.loc46: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt] +// CHECK:STDOUT: %_.patt.loc36: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: } @@ -1686,38 +1634,38 @@ fn InitFromStruct() { // CHECK:STDOUT: // CHECK:STDOUT: fn @InitFromStruct() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc19_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc19_30.2: %NonAggregate = converted %.loc19_30.1, [concrete = ] -// CHECK:STDOUT: %.loc19_13: type = splice_block %NonAggregate.ref.loc19 [concrete = constants.%NonAggregate] { -// CHECK:STDOUT: %Cpp.ref.loc19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %NonAggregate.ref.loc19: type = name_ref NonAggregate, imports.%NonAggregate.decl [concrete = constants.%NonAggregate] +// CHECK:STDOUT: %.loc16_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc16_30.2: %NonAggregate = converted %.loc16_30.1, [concrete = ] +// CHECK:STDOUT: %.loc16_13: type = splice_block %NonAggregate.ref.loc16 [concrete = constants.%NonAggregate] { +// CHECK:STDOUT: %Cpp.ref.loc16: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %NonAggregate.ref.loc16: type = name_ref NonAggregate, imports.%NonAggregate.decl [concrete = constants.%NonAggregate] // CHECK:STDOUT: } -// CHECK:STDOUT: %_.loc19: %NonAggregate = wrapper_binding _, [concrete = ] +// CHECK:STDOUT: %_.loc16: %NonAggregate = wrapper_binding _, [concrete = ] // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %_.patt.loc19: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt] +// CHECK:STDOUT: %_.patt.loc16: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %int_1.loc33: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] -// CHECK:STDOUT: %.loc33_36.1: %struct_type.x = struct_literal (%int_1.loc33) [concrete = constants.%struct.147] -// CHECK:STDOUT: %.loc33_36.2: %NonAggregate = converted %.loc33_36.1, [concrete = ] -// CHECK:STDOUT: %.loc33_13: type = splice_block %NonAggregate.ref.loc33 [concrete = constants.%NonAggregate] { -// CHECK:STDOUT: %Cpp.ref.loc33: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %NonAggregate.ref.loc33: type = name_ref NonAggregate, imports.%NonAggregate.decl [concrete = constants.%NonAggregate] +// CHECK:STDOUT: %int_1.loc26: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] +// CHECK:STDOUT: %.loc26_36.1: %struct_type.x = struct_literal (%int_1.loc26) [concrete = constants.%struct.147] +// CHECK:STDOUT: %.loc26_36.2: %NonAggregate = converted %.loc26_36.1, [concrete = ] +// CHECK:STDOUT: %.loc26_13: type = splice_block %NonAggregate.ref.loc26 [concrete = constants.%NonAggregate] { +// CHECK:STDOUT: %Cpp.ref.loc26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %NonAggregate.ref.loc26: type = name_ref NonAggregate, imports.%NonAggregate.decl [concrete = constants.%NonAggregate] // CHECK:STDOUT: } -// CHECK:STDOUT: %_.loc33: %NonAggregate = wrapper_binding _, [concrete = ] +// CHECK:STDOUT: %_.loc26: %NonAggregate = wrapper_binding _, [concrete = ] // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %_.patt.loc33: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt] +// CHECK:STDOUT: %_.patt.loc26: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %int_1.loc48: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] +// CHECK:STDOUT: %int_1.loc36: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2] -// CHECK:STDOUT: %.loc48_44.1: %struct_type.x.y = struct_literal (%int_1.loc48, %int_2) [concrete = constants.%struct.004] -// CHECK:STDOUT: %.loc48_44.2: %NonAggregate = converted %.loc48_44.1, [concrete = ] -// CHECK:STDOUT: %.loc48_13: type = splice_block %NonAggregate.ref.loc48 [concrete = constants.%NonAggregate] { -// CHECK:STDOUT: %Cpp.ref.loc48: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %NonAggregate.ref.loc48: type = name_ref NonAggregate, imports.%NonAggregate.decl [concrete = constants.%NonAggregate] +// CHECK:STDOUT: %.loc36_44.1: %struct_type.x.y = struct_literal (%int_1.loc36, %int_2) [concrete = constants.%struct.004] +// CHECK:STDOUT: %.loc36_44.2: %NonAggregate = converted %.loc36_44.1, [concrete = ] +// CHECK:STDOUT: %.loc36_13: type = splice_block %NonAggregate.ref.loc36 [concrete = constants.%NonAggregate] { +// CHECK:STDOUT: %Cpp.ref.loc36: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %NonAggregate.ref.loc36: type = name_ref NonAggregate, imports.%NonAggregate.decl [concrete = constants.%NonAggregate] // CHECK:STDOUT: } -// CHECK:STDOUT: %_.loc48: %NonAggregate = wrapper_binding _, [concrete = ] +// CHECK:STDOUT: %_.loc36: %NonAggregate = wrapper_binding _, [concrete = ] // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %_.patt.loc48: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt] +// CHECK:STDOUT: %_.patt.loc36: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/macros/macros.carbon b/toolchain/check/testdata/interop/cpp/macros/macros.carbon index bb8d7cbac518..5621172628e4 100644 --- a/toolchain/check/testdata/interop/cpp/macros/macros.carbon +++ b/toolchain/check/testdata/interop/cpp/macros/macros.carbon @@ -1014,7 +1014,7 @@ Struct s; '''; fn F() { - // CHECK:STDERR: ╭─┤ fail_todo_assign_array.carbon:[[@LINE+19]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_assign_array.carbon:[[@LINE+16]]:3 // CHECK:STDERR: -> │ Cpp.m = 2; // CHECK:STDERR: · ━━┳━━ // CHECK:STDERR: · ┗━━┫ error: semantics TODO: `lvalue path contains an array type` @@ -1022,15 +1022,12 @@ fn F() { // CHECK:STDERR: · ╰────┤ in `Cpp` name lookup for `m` [InCppNameLookup] // CHECK:STDERR: ╰──── // CHECK:STDERR: - // CHECK:STDERR: ╭─┤ fail_todo_assign_array.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_assign_array.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ Cpp.m = 2; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Core.IntLiteral` to - // CHECK:STDERR: · │ ┃ `array(i32, 3)` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(array(i32, 3))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `array(i32, 3)` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: Cpp.m = 2; diff --git a/toolchain/check/testdata/interop/cpp/namespace/export.carbon b/toolchain/check/testdata/interop/cpp/namespace/export.carbon index a122763b72c6..2ceb49f5c298 100644 --- a/toolchain/check/testdata/interop/cpp/namespace/export.carbon +++ b/toolchain/check/testdata/interop/cpp/namespace/export.carbon @@ -66,7 +66,7 @@ inline Cpp ''' Carbon::C* p; // CHECK:STDERR: ╭─┤ fail_current_package_not_in_carbon.carbon:[[@LINE+7]]:25 // CHECK:STDERR: -> │ namespace Bad = Carbon::SelfPkg; -// CHECK:STDERR: · ───────╴╻ +// CHECK:STDERR: · ━━━━━━━╸╻ // CHECK:STDERR: · ┗━━┫ error: expected namespace name // CHECK:STDERR: · ┃ [CppInteropParseError] // CHECK:STDERR: ╰──── @@ -84,7 +84,7 @@ inline Cpp ''' Carbon::C* p; // CHECK:STDERR: ╭─┤ fail_main_package_not_in_carbon.carbon:[[@LINE+7]]:25 // CHECK:STDERR: -> │ namespace Bad = Carbon::Main; -// CHECK:STDERR: · ───────╴╻ +// CHECK:STDERR: · ━━━━━━━╸╻ // CHECK:STDERR: · ┗━━┫ error: expected namespace name // CHECK:STDERR: · ┃ [CppInteropParseError] // CHECK:STDERR: ╰──── diff --git a/toolchain/check/testdata/interop/cpp/namespace/lookup_after_failure.carbon b/toolchain/check/testdata/interop/cpp/namespace/lookup_after_failure.carbon index 696c3666ce8c..008c93335663 100644 --- a/toolchain/check/testdata/interop/cpp/namespace/lookup_after_failure.carbon +++ b/toolchain/check/testdata/interop/cpp/namespace/lookup_after_failure.carbon @@ -134,7 +134,7 @@ void TestTypoInCarbon() { // CHECK:STDERR: · ╰──┤ 'ExportedType' declared here [CppInteropParseNote] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Carbon::ExportedTyp* p_typo = p1; - // CHECK:STDERR: · ───────╴┎┬───────── + // CHECK:STDERR: · ━━━━━━━╸┎┬───────── // CHECK:STDERR: · ┗━━━┫ error: no type named 'ExportedTyp' in namespace 'Carbon'; did // CHECK:STDERR: · │ ┃ you mean 'ExportedType'? // CHECK:STDERR: · │ ┃ [CppInteropParseError] diff --git a/toolchain/check/testdata/interop/cpp/namespace/roundtrip.carbon b/toolchain/check/testdata/interop/cpp/namespace/roundtrip.carbon index 65f0fe3d1a38..432b4e8fb3a6 100644 --- a/toolchain/check/testdata/interop/cpp/namespace/roundtrip.carbon +++ b/toolchain/check/testdata/interop/cpp/namespace/roundtrip.carbon @@ -70,7 +70,7 @@ void G() { // This is not found because it looks for the identifier `Cpp`, not the keyword `Cpp`. // CHECK:STDERR: ╭─┤ fail_carbon_cpp.carbon:[[@LINE+7]]:11 // CHECK:STDERR: -> │ Carbon::Cpp::F(); - // CHECK:STDERR: · ───────╴╻ + // CHECK:STDERR: · ━━━━━━━╸╻ // CHECK:STDERR: · ┗━━┫ error: no member named 'Cpp' in namespace 'Carbon' // CHECK:STDERR: · ┃ [CppInteropParseError] // CHECK:STDERR: ╰──── @@ -99,7 +99,7 @@ void GRaw() { // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_carbon_raw_cpp.carbon:[[@LINE+7]]:11 // CHECK:STDERR: -> │ Carbon::Cpp::FRaw(); - // CHECK:STDERR: · ───────╴╻ + // CHECK:STDERR: · ━━━━━━━╸╻ // CHECK:STDERR: · ┗━━┫ error: no member named 'Cpp' in namespace 'Carbon' // CHECK:STDERR: · ┃ [CppInteropParseError] // CHECK:STDERR: ╰──── diff --git a/toolchain/check/testdata/interop/cpp/operators/eq_with.carbon b/toolchain/check/testdata/interop/cpp/operators/eq_with.carbon index 2bb1b853ec60..6b654f087172 100644 --- a/toolchain/check/testdata/interop/cpp/operators/eq_with.carbon +++ b/toolchain/check/testdata/interop/cpp/operators/eq_with.carbon @@ -93,18 +93,16 @@ library "[[@TEST_NAME]]"; import Cpp inline '''c++ struct NeqBoolish { auto operator==(NeqBoolish) const -> bool; - // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+20]]:8 + // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+18]]:8 // CHECK:STDERR: -> │ auto operator!=(NeqBoolish) const -> int; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `i32` to `bool` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `i32` does not implement interface `Core.ImplicitAs(bool)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬───────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/operators/comparison.carbon // CHECK:STDERR: │ default fn NotEqual(self, other: Other) -> bool { @@ -117,20 +115,17 @@ struct NeqBoolish { }; struct EqBoolish { - // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+22]]:8 + // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+19]]:8 // CHECK:STDERR: -> │ auto operator==(EqBoolish) const -> int*; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `Core.Optional(i32* as Core.OptionalStorage)` to `bool` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.Optional(i32* as Core.OptionalStorage)` does not - // CHECK:STDERR: · │ implement interface `Core.ImplicitAs(bool)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Core.Optional(i32* as Core.OptionalStorage)` to `bool` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬───────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/operators/comparison.carbon // CHECK:STDERR: │ fn Equal(self, other: Other) -> bool; @@ -148,20 +143,17 @@ struct BothBoolish { False, True, }; - // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+22]]:8 + // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+19]]:8 // CHECK:STDERR: -> │ auto operator==(BothBoolish) const -> Result; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Cpp.Result` to - // CHECK:STDERR: · │ ┃ `bool` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.Result` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(bool)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `bool` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬───────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/operators/comparison.carbon // CHECK:STDERR: │ fn Equal(self, other: Other) -> bool; @@ -171,20 +163,17 @@ struct BothBoolish { // CHECK:STDERR: ╰──── // CHECK:STDERR: auto operator==(BothBoolish) const -> Result; - // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+22]]:8 + // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+19]]:8 // CHECK:STDERR: -> │ auto operator!=(BothBoolish) const -> Result; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Cpp.Result` to - // CHECK:STDERR: · │ ┃ `bool` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.Result` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(bool)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `bool` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬───────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/operators/comparison.carbon // CHECK:STDERR: │ default fn NotEqual(self, other: Other) -> bool { @@ -246,9 +235,9 @@ fn Test(default_eq_only: Cpp.DefaultEqOnly, only_eq_declared: Cpp.OnlyEqDeclared) { // CHECK:STDERR: ╭─┤ fail_todo_comparison_rewrites.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬───────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ EqWith(default_eq_only, default_eq_only); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -263,9 +252,9 @@ fn Test(default_eq_only: Cpp.DefaultEqOnly, // CHECK:STDERR: ╭─┤ fail_todo_comparison_rewrites.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬───────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ EqWith(only_eq_declared, only_eq_declared); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -329,9 +318,9 @@ fn Test(only_neq: Cpp.OnlyNeq, a2: Cpp.A2, b2: Cpp.B2) { // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬───────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ EqWith(only_neq, only_neq); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -362,9 +351,9 @@ fn Test(only_neq: Cpp.OnlyNeq, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬───────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ EqWith(no_relevant_members, no_relevant_members); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -377,9 +366,9 @@ fn Test(only_neq: Cpp.OnlyNeq, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬───────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ EqWith(eq_returns_void, eq_returns_void); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -392,9 +381,9 @@ fn Test(only_neq: Cpp.OnlyNeq, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬───────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ EqWith(neq_returns_void, neq_returns_void); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -414,9 +403,9 @@ fn Test(only_neq: Cpp.OnlyNeq, // CHECK:STDERR: · ╰──┤ candidate function has been explicitly deleted [CppInteropParseNote] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬───────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ EqWith(deleted_neq, deleted_neq); // CHECK:STDERR: · ┳ @@ -429,9 +418,9 @@ fn Test(only_neq: Cpp.OnlyNeq, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬───────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ EqWith(non_const_eq, non_const_eq); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -444,9 +433,9 @@ fn Test(only_neq: Cpp.OnlyNeq, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬───────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ EqWith(a2, b2); // CHECK:STDERR: · ┳━━━━━━━━━━━━━ diff --git a/toolchain/check/testdata/interop/cpp/operators/operators.carbon b/toolchain/check/testdata/interop/cpp/operators/operators.carbon index dc3136716f82..a946e9c95937 100644 --- a/toolchain/check/testdata/interop/cpp/operators/operators.carbon +++ b/toolchain/check/testdata/interop/cpp/operators/operators.carbon @@ -236,15 +236,12 @@ fn F() { var c: Cpp.BinaryC = {}; // Simple assignment. - // CHECK:STDERR: ╭─┤ fail_todo_import_assignment.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_import_assignment.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ c = 42; // CHECK:STDERR: · ┳━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Core.IntLiteral` to - // CHECK:STDERR: · │ ┃ `Cpp.BinaryC` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.BinaryC)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Cpp.BinaryC` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: c = 42; @@ -734,7 +731,7 @@ fn F() { // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+10]]:53 // CHECK:STDERR: -> │ let and_result: Cpp.UnsupportedBinaryC = operator&&(c1, c2); - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ╻╺━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the // CHECK:STDERR: · ┃ address of // CHECK:STDERR: · ┃ non-reference @@ -1012,7 +1009,7 @@ library "[[@TEST_NAME]]"; import Cpp library "incomplete.h"; fn F() { - // CHECK:STDERR: ╭─┤ fail_import_incomplete_unary.carbon:[[@LINE+15]]:34 + // CHECK:STDERR: ╭─┤ fail_import_incomplete_unary.carbon:[[@LINE+14]]:34 // CHECK:STDERR: -> │ let unused result_unary: i32 = -*Cpp.CreateIncomplete(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: looking up a C++ operator with @@ -1020,7 +1017,6 @@ fn F() { // CHECK:STDERR: · ┃ `Cpp.Incomplete` // CHECK:STDERR: · ┃ [IncompleteOperandTypeInCppOperatorLookup] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_import_incomplete_unary.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./incomplete.h // CHECK:STDERR: │ class Incomplete; // CHECK:STDERR: · ┬ @@ -1038,7 +1034,7 @@ import Cpp library "incomplete.h"; fn F() { var complete: Cpp.Complete = Cpp.Complete.Complete(); - // CHECK:STDERR: ╭─┤ fail_import_incomplete_binary.carbon:[[@LINE+15]]:35 + // CHECK:STDERR: ╭─┤ fail_import_incomplete_binary.carbon:[[@LINE+14]]:35 // CHECK:STDERR: -> │ let unused result_binary: i32 = complete + *Cpp.CreateIncomplete(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: looking up a C++ operator with @@ -1046,7 +1042,6 @@ fn F() { // CHECK:STDERR: · ┃ `Cpp.Incomplete` // CHECK:STDERR: · ┃ [IncompleteOperandTypeInCppOperatorLookup] // CHECK:STDERR: ┆ - // CHECK:STDERR: │ ╭── included from: fail_import_incomplete_binary.carbon [InCppInclude] // CHECK:STDERR: ├─┤ ./incomplete.h // CHECK:STDERR: │ class Incomplete; // CHECK:STDERR: · ┬ @@ -1077,8 +1072,8 @@ fn F() { var complete: Cpp.CompleteCpp = Cpp.CompleteCpp.CompleteCpp(); // CHECK:STDERR: ╭─┤ fail_incomplete_operand_carbon_type.carbon:[[@LINE+12]]:28 // CHECK:STDERR: │ class Incomplete; - // CHECK:STDERR: · ────────┬──────── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ─────┬──── + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let unused result: i32 = *CreateIncomplete() + complete; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/toolchain/check/testdata/interop/cpp/operators/ordered_with.carbon b/toolchain/check/testdata/interop/cpp/operators/ordered_with.carbon index 907316a077f4..131c9c14beed 100644 --- a/toolchain/check/testdata/interop/cpp/operators/ordered_with.carbon +++ b/toolchain/check/testdata/interop/cpp/operators/ordered_with.carbon @@ -118,18 +118,16 @@ library "[[@TEST_NAME]]"; import Cpp inline '''c++ struct LessReturnsBoolish { - // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+20]]:8 + // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+18]]:8 // CHECK:STDERR: -> │ auto operator<(LessReturnsBoolish) const -> int; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `i32` to `bool` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `i32` does not implement interface `Core.ImplicitAs(bool)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/operators/comparison.carbon // CHECK:STDERR: │ fn Less(self, other: Other) -> bool; @@ -146,20 +144,17 @@ struct LessReturnsBoolish { struct LessEqualReturnsBoolish { auto operator<(LessEqualReturnsBoolish) const -> bool; - // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+22]]:8 + // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+19]]:8 // CHECK:STDERR: -> │ auto operator<=(LessEqualReturnsBoolish) const -> int*; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `Core.Optional(i32* as Core.OptionalStorage)` to `bool` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.Optional(i32* as Core.OptionalStorage)` does not - // CHECK:STDERR: · │ implement interface `Core.ImplicitAs(bool)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Core.Optional(i32* as Core.OptionalStorage)` to `bool` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/operators/comparison.carbon // CHECK:STDERR: │ fn LessOrEquivalent(self, other: Other) -> bool; @@ -178,20 +173,17 @@ struct GreaterEqualReturnsBoolish { auto operator<(GreaterEqualReturnsBoolish) const -> bool; auto operator<=(GreaterEqualReturnsBoolish) const -> bool; auto operator>(GreaterEqualReturnsBoolish) const -> bool; - // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+22]]:8 + // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+19]]:8 // CHECK:STDERR: -> │ auto operator>=(GreaterEqualReturnsBoolish) const -> Result; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Cpp.Result` to - // CHECK:STDERR: · │ ┃ `bool` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.Result` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(bool)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `bool` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/operators/comparison.carbon // CHECK:STDERR: │ fn GreaterOrEquivalent(self, other: Other) -> bool; @@ -215,18 +207,16 @@ struct GreaterReturnsBoolish { }; struct AllReturnBoolish { - // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+20]]:8 + // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+18]]:8 // CHECK:STDERR: -> │ auto operator<(AllReturnBoolish) const -> double; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `f64` to `bool` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `f64` does not implement interface `Core.ImplicitAs(bool)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/operators/comparison.carbon // CHECK:STDERR: │ fn Less(self, other: Other) -> bool; @@ -236,18 +226,16 @@ struct AllReturnBoolish { // CHECK:STDERR: ╰──── // CHECK:STDERR: auto operator<(AllReturnBoolish) const -> double; - // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+20]]:8 + // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+18]]:8 // CHECK:STDERR: -> │ auto operator<=(AllReturnBoolish) const -> double; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `f64` to `bool` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `f64` does not implement interface `Core.ImplicitAs(bool)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/operators/comparison.carbon // CHECK:STDERR: │ fn LessOrEquivalent(self, other: Other) -> bool; @@ -257,18 +245,16 @@ struct AllReturnBoolish { // CHECK:STDERR: ╰──── // CHECK:STDERR: auto operator<=(AllReturnBoolish) const -> double; - // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+20]]:8 + // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+18]]:8 // CHECK:STDERR: -> │ auto operator>(AllReturnBoolish) const -> double; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `f64` to `bool` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `f64` does not implement interface `Core.ImplicitAs(bool)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/operators/comparison.carbon // CHECK:STDERR: │ fn Greater(self, other: Other) -> bool; @@ -278,18 +264,16 @@ struct AllReturnBoolish { // CHECK:STDERR: ╰──── // CHECK:STDERR: auto operator>(AllReturnBoolish) const -> double; - // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+20]]:8 + // CHECK:STDERR: ╭─┤ fail_todo_returns_boolish.carbon:[[@LINE+18]]:8 // CHECK:STDERR: -> │ auto operator>=(AllReturnBoolish) const -> double; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `f64` to `bool` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `f64` does not implement interface `Core.ImplicitAs(bool)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/operators/comparison.carbon // CHECK:STDERR: │ fn GreaterOrEquivalent(self, other: Other) -> bool; @@ -387,9 +371,9 @@ fn Test(missing_less: Cpp.MissingLess, less_non_const: Cpp.LessNonConst) { // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ OrderedWith(missing_less, missing_less); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -402,9 +386,9 @@ fn Test(missing_less: Cpp.MissingLess, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ OrderedWith(missing_less_equal, missing_less_equal); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -417,9 +401,9 @@ fn Test(missing_less: Cpp.MissingLess, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ OrderedWith(missing_greater, missing_greater); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -432,9 +416,9 @@ fn Test(missing_less: Cpp.MissingLess, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ OrderedWith(missing_greater_equal, missing_greater_equal); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -447,9 +431,9 @@ fn Test(missing_less: Cpp.MissingLess, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ OrderedWith(no_relevant_members, no_relevant_members); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -462,9 +446,9 @@ fn Test(missing_less: Cpp.MissingLess, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ OrderedWith(less_returns_void, less_returns_void); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/toolchain/check/testdata/interop/cpp/operators/spaceship.carbon b/toolchain/check/testdata/interop/cpp/operators/spaceship.carbon index 08e2b25adf04..47895bf1f7f5 100644 --- a/toolchain/check/testdata/interop/cpp/operators/spaceship.carbon +++ b/toolchain/check/testdata/interop/cpp/operators/spaceship.carbon @@ -154,9 +154,9 @@ fn Test(default_spaceship_only: Cpp.DefaultSpaceshipOnly, cross_type_rhs: Cpp.CrossTypeRhs) { // CHECK:STDERR: ╭─┤ fail_todo_spaceship_rewrites.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬───────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ EqWith(default_spaceship_only, default_spaceship_only); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -169,9 +169,9 @@ fn Test(default_spaceship_only: Cpp.DefaultSpaceshipOnly, // CHECK:STDERR: ╭─┤ fail_todo_spaceship_rewrites.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ OrderedWith(default_spaceship_only, default_spaceship_only); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -183,9 +183,9 @@ fn Test(default_spaceship_only: Cpp.DefaultSpaceshipOnly, OrderedWith(default_spaceship_only, default_spaceship_only); // CHECK:STDERR: ╭─┤ fail_todo_spaceship_rewrites.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ OrderedWith(returns_strong_ordering, returns_strong_ordering); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -197,9 +197,9 @@ fn Test(default_spaceship_only: Cpp.DefaultSpaceshipOnly, OrderedWith(returns_strong_ordering, returns_strong_ordering); // CHECK:STDERR: ╭─┤ fail_todo_spaceship_rewrites.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ OrderedWith(returns_partial_ordering, returns_partial_ordering); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -211,9 +211,9 @@ fn Test(default_spaceship_only: Cpp.DefaultSpaceshipOnly, OrderedWith(returns_partial_ordering, returns_partial_ordering); // CHECK:STDERR: ╭─┤ fail_todo_spaceship_rewrites.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ OrderedWith(cross_type_lhs, cross_type_rhs); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -225,9 +225,9 @@ fn Test(default_spaceship_only: Cpp.DefaultSpaceshipOnly, OrderedWith(cross_type_lhs, cross_type_rhs); // CHECK:STDERR: ╭─┤ fail_todo_spaceship_rewrites.carbon:[[@LINE+20]]:3 // CHECK:STDERR: │ fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) { - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ OrderedWith(cross_type_rhs, cross_type_lhs); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -257,9 +257,9 @@ fn EqWith[U: type, T: Core.EqWith(U)](unused x: T, unused y: U) {} fn Test(returns_strong_ordering: Cpp.ReturnsStrongOrdering) { // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn EqWith[U: type, T: Core.EqWith(U)](unused x: T, unused y: U) {} - // CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ EqWith(returns_strong_ordering, returns_strong_ordering); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/toolchain/check/testdata/interop/cpp/primitive_types/array.carbon b/toolchain/check/testdata/interop/cpp/primitive_types/array.carbon index 418944fe2402..430a3a70e0a9 100644 --- a/toolchain/check/testdata/interop/cpp/primitive_types/array.carbon +++ b/toolchain/check/testdata/interop/cpp/primitive_types/array.carbon @@ -63,25 +63,30 @@ library "[[@TEST_NAME]]"; import Cpp; -// CHECK:STDERR: ╭─┤ fail_incomplete.carbon:[[@LINE+6]]:1 -// CHECK:STDERR: -> │ class C; -// CHECK:STDERR: · ━━━━┳━━━ -// CHECK:STDERR: · ┗━━┫ error: class was forward declared here [ClassForwardDeclaredHere] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: class C; fn F() -> array(C, 5)*; inline Cpp ''' void G() { + // CHECK:STDERR: ╭─┤ fail_incomplete.carbon:[[@LINE+23]]:35 + // CHECK:STDERR: │ class C; + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: ┆ + // CHECK:STDERR: -> │ Carbon::C *p = &(*Carbon::F())[0]; + // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ┗━━┫ error: use of incomplete Carbon type `C` + // CHECK:STDERR: · ┃ [IncompleteTypeInCppUse] + // CHECK:STDERR: ╰──── + // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_incomplete.carbon:[[@LINE+12]]:33 // CHECK:STDERR: │ class C; // CHECK:STDERR: · ┬ // CHECK:STDERR: · ╰──┤ forward declaration of 'Carbon::Main::C' [CppInteropParseNote] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Carbon::C *p = &(*Carbon::F())[0]; - // CHECK:STDERR: · ─────────────╴╻ + // CHECK:STDERR: · ━━━━━━━━━━━━━╸╻ // CHECK:STDERR: · ┗━━┫ error: subscript of pointer to incomplete // CHECK:STDERR: · ┃ type 'Carbon::Main::C' // CHECK:STDERR: · ┃ [CppInteropParseError] diff --git a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.darwin.carbon b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.darwin.carbon index cf175add2f50..800b19952e4a 100644 --- a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.darwin.carbon +++ b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.darwin.carbon @@ -85,16 +85,13 @@ import Cpp; fn F() { let carbon_i64: i64 = 1; - // CHECK:STDERR: ╭─┤ fail_implicit_conversion_i64_to_long.carbon:[[@LINE+12]]:35 + // CHECK:STDERR: ╭─┤ fail_implicit_conversion_i64_to_long.carbon:[[@LINE+9]]:35 // CHECK:STDERR: -> │ let unused cpp_long: Cpp.long = carbon_i64; // CHECK:STDERR: · ┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert - // CHECK:STDERR: · │ ┃ expression of type `i64` to - // CHECK:STDERR: · │ ┃ `Cpp.long` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `i64` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.long)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ expression of type `i64` to + // CHECK:STDERR: · ┃ `Cpp.long` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused cpp_long: Cpp.long = carbon_i64; @@ -636,16 +633,13 @@ fn F() { // For portability reasons, this is not allowed even though `u64` // happens to fit in `unsigned long` on this target. - // CHECK:STDERR: ╭─┤ fail_pass_u64_to_ulong.carbon:[[@LINE+12]]:53 + // CHECK:STDERR: ╭─┤ fail_pass_u64_to_ulong.carbon:[[@LINE+9]]:53 // CHECK:STDERR: -> │ let unused cpp_unsigned_long: Cpp.unsigned_long = carbon_u64; // CHECK:STDERR: · ━━━━━┳━━━━ // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ // CHECK:STDERR: · ┃ error: cannot implicitly convert expression of type `u64` to // CHECK:STDERR: · ┃ `Cpp.unsigned_long` // CHECK:STDERR: · ┃ [ConversionFailure] - // CHECK:STDERR: · ╭────────────────────────────────────────────────────────╯ - // CHECK:STDERR: · │ type `u64` does not implement interface `Core.ImplicitAs(Cpp.unsigned_long)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused cpp_unsigned_long: Cpp.unsigned_long = carbon_u64; diff --git a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon index aae4c3f902f0..86e0d1673197 100644 --- a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon +++ b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon @@ -79,15 +79,12 @@ import Cpp; fn F() { let cpp_long: Cpp.long = 1; - // CHECK:STDERR: ╭─┤ fail_implicit_conversion_long_to_i32.carbon:[[@LINE+11]]:32 + // CHECK:STDERR: ╭─┤ fail_implicit_conversion_long_to_i32.carbon:[[@LINE+8]]:32 // CHECK:STDERR: -> │ let unused carbon_i32: i32 = cpp_long; // CHECK:STDERR: · ┳━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression - // CHECK:STDERR: · │ ┃ of type `long` to `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.long` does not implement - // CHECK:STDERR: · │ interface `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ of type `long` to `i32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused carbon_i32: i32 = cpp_long; @@ -724,15 +721,12 @@ fn F() { // For portability reasons, this is not allowed even though `unsigned long` // happens to fit in `u32` on this target. - // CHECK:STDERR: ╭─┤ fail_no_ulong_to_u32.carbon:[[@LINE+17]]:25 + // CHECK:STDERR: ╭─┤ fail_no_ulong_to_u32.carbon:[[@LINE+14]]:25 // CHECK:STDERR: -> │ let carbon_u32: u32 = cpp_unsigned_long; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `unsigned_long` to `u32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.unsigned_long` does not implement - // CHECK:STDERR: · │ interface `Core.ImplicitAs(u32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `unsigned_long` to `u32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_no_ulong_to_u32.carbon:[[@LINE+6]]:7 diff --git a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon index 3973af98fe00..0c93b1cacbe0 100644 --- a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon +++ b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon @@ -78,15 +78,12 @@ import Cpp; fn F() { let cpp_long_long: Cpp.long_long = 1; - // CHECK:STDERR: ╭─┤ fail_implicit_conversion_long_long_to_i64.carbon:[[@LINE+11]]:32 + // CHECK:STDERR: ╭─┤ fail_implicit_conversion_long_long_to_i64.carbon:[[@LINE+8]]:32 // CHECK:STDERR: -> │ let unused carbon_i64: i64 = cpp_long_long; // CHECK:STDERR: · ┳━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression - // CHECK:STDERR: · │ ┃ of type `long_long` to `i64` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.long_long` does not implement - // CHECK:STDERR: · │ interface `Core.ImplicitAs(i64)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ of type `long_long` to `i64` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused carbon_i64: i64 = cpp_long_long; @@ -652,15 +649,12 @@ fn F() { // For portability reasons, this is not allowed even though `unsigned long // long` happens to fit in `u64` on this target. - // CHECK:STDERR: ╭─┤ fail_pass_ulonglong_to_u64.carbon:[[@LINE+17]]:25 + // CHECK:STDERR: ╭─┤ fail_pass_ulonglong_to_u64.carbon:[[@LINE+14]]:25 // CHECK:STDERR: -> │ let carbon_u64: u64 = cpp_unsigned_long_long; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `unsigned_long_long` to `u64` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.unsigned_long_long` does not implement - // CHECK:STDERR: · │ interface `Core.ImplicitAs(u64)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `unsigned_long_long` to `u64` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_pass_ulonglong_to_u64.carbon:[[@LINE+6]]:7 diff --git a/toolchain/check/testdata/interop/cpp/primitive_types/void_pointer.carbon b/toolchain/check/testdata/interop/cpp/primitive_types/void_pointer.carbon index 1ab164360d2a..f2a1ce471171 100644 --- a/toolchain/check/testdata/interop/cpp/primitive_types/void_pointer.carbon +++ b/toolchain/check/testdata/interop/cpp/primitive_types/void_pointer.carbon @@ -76,15 +76,12 @@ 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+11]]:26 + // CHECK:STDERR: ╭─┤ fail_explicit_as_from_void_pointer_to_cpp_class_pointer.carbon:[[@LINE+8]]:26 // CHECK:STDERR: -> │ let unused p: Cpp.S* = input as Cpp.S*; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `void*` - // CHECK:STDERR: · │ ┃ to `Cpp.S*` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.void*` does not implement interface - // CHECK:STDERR: · │ `Core.As(Cpp.S*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `Cpp.S*` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused p: Cpp.S* = input as Cpp.S*; @@ -101,15 +98,12 @@ 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+11]]:22 + // CHECK:STDERR: ╭─┤ fail_explicit_as_from_void_pointer_to_carbon_class_pointer.carbon:[[@LINE+8]]:22 // CHECK:STDERR: -> │ let unused p: C* = input as C*; // CHECK:STDERR: · ┳━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `void*` to - // CHECK:STDERR: · │ ┃ `C*` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Cpp.void*` does not implement interface - // CHECK:STDERR: · │ `Core.As(C*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `C*` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused p: C* = input as C*; @@ -414,14 +408,14 @@ fn F(input: Cpp.void*) { // CHECK:STDOUT: fn @F(%input.param: %ptr.00a) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %input.ref: %ptr.00a = name_ref input, %input -// CHECK:STDOUT: %Cpp.ref.loc21_35: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %S.ref.loc21_38: type = name_ref S, imports.%S.decl [concrete = constants.%S] -// CHECK:STDOUT: %ptr.loc21_40: type = ptr_type %S.ref.loc21_38 [concrete = constants.%ptr.037] -// CHECK:STDOUT: %.loc21_32: %ptr.037 = converted %input.ref, [concrete = ] -// CHECK:STDOUT: %.loc21_22: type = splice_block %ptr.loc21_22 [concrete = constants.%ptr.037] { -// CHECK:STDOUT: %Cpp.ref.loc21_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %S.ref.loc21_20: type = name_ref S, imports.%S.decl [concrete = constants.%S] -// CHECK:STDOUT: %ptr.loc21_22: type = ptr_type %S.ref.loc21_20 [concrete = constants.%ptr.037] +// CHECK:STDOUT: %Cpp.ref.loc18_35: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %S.ref.loc18_38: type = name_ref S, imports.%S.decl [concrete = constants.%S] +// CHECK:STDOUT: %ptr.loc18_40: type = ptr_type %S.ref.loc18_38 [concrete = constants.%ptr.037] +// CHECK:STDOUT: %.loc18_32: %ptr.037 = converted %input.ref, [concrete = ] +// CHECK:STDOUT: %.loc18_22: type = splice_block %ptr.loc18_22 [concrete = constants.%ptr.037] { +// CHECK:STDOUT: %Cpp.ref.loc18_17: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %S.ref.loc18_20: type = name_ref S, imports.%S.decl [concrete = constants.%S] +// CHECK:STDOUT: %ptr.loc18_22: type = ptr_type %S.ref.loc18_20 [concrete = constants.%ptr.037] // CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.037 = wrapper_binding p, [concrete = ] // CHECK:STDOUT: name_binding_decl { @@ -445,12 +439,12 @@ fn F(input: Cpp.void*) { // CHECK:STDOUT: fn @F(%input.param: %ptr.00a) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %input.ref: %ptr.00a = name_ref input, %input -// CHECK:STDOUT: %C.ref.loc21_31: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %ptr.loc21_32: type = ptr_type %C.ref.loc21_31 [concrete = constants.%ptr.6b6] -// CHECK:STDOUT: %.loc21_28: %ptr.6b6 = converted %input.ref, [concrete = ] -// CHECK:STDOUT: %.loc21_18: type = splice_block %ptr.loc21_18 [concrete = constants.%ptr.6b6] { -// CHECK:STDOUT: %C.ref.loc21_17: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %ptr.loc21_18: type = ptr_type %C.ref.loc21_17 [concrete = constants.%ptr.6b6] +// CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %ptr.loc18_32: type = ptr_type %C.ref.loc18_31 [concrete = constants.%ptr.6b6] +// CHECK:STDOUT: %.loc18_28: %ptr.6b6 = converted %input.ref, [concrete = ] +// CHECK:STDOUT: %.loc18_18: type = splice_block %ptr.loc18_18 [concrete = constants.%ptr.6b6] { +// CHECK:STDOUT: %C.ref.loc18_17: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %ptr.loc18_18: type = ptr_type %C.ref.loc18_17 [concrete = constants.%ptr.6b6] // CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.6b6 = wrapper_binding p, [concrete = ] // CHECK:STDOUT: name_binding_decl { diff --git a/toolchain/check/testdata/interop/cpp/range_for.carbon b/toolchain/check/testdata/interop/cpp/range_for.carbon index 5bccb246e04d..ea1846c0eec6 100644 --- a/toolchain/check/testdata/interop/cpp/range_for.carbon +++ b/toolchain/check/testdata/interop/cpp/range_for.carbon @@ -253,9 +253,9 @@ public: // CHECK:STDERR: · │ [InCallToFunctionParam] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn TestIterate[R: Core.Iterate where .ElementType = f64](r: R) { - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/iterate.carbon // CHECK:STDERR: │ fn Begin(self) -> Iterator; @@ -275,9 +275,9 @@ public: // CHECK:STDERR: · │ [InCallToFunctionParam] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn TestIterate[R: Core.Iterate where .ElementType = f64](r: R) { - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/iterate.carbon // CHECK:STDERR: │ fn End(self) -> Sentinel; @@ -397,9 +397,9 @@ public: // CHECK:STDERR: · │ [InCallToFunctionParam] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn TestIterate[R: Core.Iterate where .ElementType = Cpp.DiffMutableADL.Val... - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/iterate.carbon // CHECK:STDERR: │ fn Begin(self) -> Iterator; @@ -419,9 +419,9 @@ public: // CHECK:STDERR: · │ [InCallToFunctionParam] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn TestIterate[R: Core.Iterate where .ElementType = Cpp.DiffMutableADL.Val... - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/iterate.carbon // CHECK:STDERR: │ fn End(self) -> Sentinel; @@ -448,9 +448,9 @@ fn TestIterate[R: Core.Iterate where .ElementType = Cpp.DiffMutableADL.ValueType fn TestIterateDriver(var m: Cpp.DiffMutableADL.MutableRange) { // CHECK:STDERR: ╭─┤ fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+28]]:3 // CHECK:STDERR: │ fn TestIterate[R: Core.Iterate where .ElementType = Cpp.DiffMutableADL.Val... - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ TestIterate(m); // CHECK:STDERR: · ┳━━━━━━━━━━━━━ @@ -461,9 +461,9 @@ fn TestIterateDriver(var m: Cpp.DiffMutableADL.MutableRange) { // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+15]]:3 // CHECK:STDERR: │ fn TestIterate[R: Core.Iterate where .ElementType = Cpp.DiffMutableADL.Val... - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ TestIterate(m); // CHECK:STDERR: · ━━━━━━━┳━━━━━━ @@ -532,9 +532,9 @@ class MutableAndConstRange { // CHECK:STDERR: · │ [InCallToFunctionParam] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn TestIterate[R: Core.Iterate where .ElementType = Cpp.OverloadADL.ValueT... - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/iterate.carbon // CHECK:STDERR: │ fn Begin(self) -> Iterator; @@ -554,9 +554,9 @@ class MutableAndConstRange { // CHECK:STDERR: · │ [InCallToFunctionParam] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn TestIterate[R: Core.Iterate where .ElementType = Cpp.OverloadADL.ValueT... - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ {{.*}}/prelude/iterate.carbon // CHECK:STDERR: │ fn End(self) -> Sentinel; @@ -679,9 +679,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, { // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn Test[R: Core.Iterate](unused r: R) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Test(no_begin_end); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━ @@ -694,9 +694,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn Test[R: Core.Iterate](unused r: R) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Test(no_begin_method); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━ @@ -709,9 +709,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn Test[R: Core.Iterate](unused r: R) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Test(no_end_method); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━ @@ -724,9 +724,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn Test[R: Core.Iterate](unused r: R) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Test(no_begin_adl); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━ @@ -739,9 +739,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn Test[R: Core.Iterate](unused r: R) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Test(no_end_adl); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━ @@ -754,9 +754,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn Test[R: Core.Iterate](unused r: R) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Test(begin_method_end_adl); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -769,9 +769,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn Test[R: Core.Iterate](unused r: R) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Test(begin_adl_end_method); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -784,9 +784,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn Test[R: Core.Iterate](unused r: R) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Test(begin_field_end_method); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -799,9 +799,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn Test[R: Core.Iterate](unused r: R) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Test(begin_method_end_field); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -819,9 +819,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDERR: · │ [CppInteropParseNote] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn Test[R: Core.Iterate](unused r: R) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Test(begin_method_deleted); // CHECK:STDERR: · ┳ @@ -831,9 +831,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn Test[R: Core.Iterate](unused r: R) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Test(begin_method_deleted); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -850,9 +850,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDERR: · ╰──┤ 'end' has been explicitly marked deleted here [CppInteropParseNote] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn Test[R: Core.Iterate](unused r: R) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Test(end_method_deleted); // CHECK:STDERR: · ┳ @@ -862,9 +862,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn Test[R: Core.Iterate](unused r: R) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Test(end_method_deleted); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━ @@ -882,9 +882,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDERR: · │ [CppInteropParseNote] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn Test[R: Core.Iterate](unused r: R) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Test(begin_function_deleted); // CHECK:STDERR: · ┳ @@ -894,9 +894,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn Test[R: Core.Iterate](unused r: R) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Test(begin_function_deleted); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -914,9 +914,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDERR: · │ [CppInteropParseNote] // CHECK:STDERR: ┆ // CHECK:STDERR: │ fn Test[R: Core.Iterate](unused r: R) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Test(end_function_deleted); // CHECK:STDERR: · ┳ @@ -926,9 +926,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_never_valid.carbon:[[@LINE+13]]:3 // CHECK:STDERR: │ fn Test[R: Core.Iterate](unused r: R) {} - // CHECK:STDERR: · ───────────────────┬─────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Test(end_function_deleted); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━ 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 c70574941bf2..71ec26352325 100644 --- a/toolchain/check/testdata/interop/cpp/template/non_type_param.carbon +++ b/toolchain/check/testdata/interop/cpp/template/non_type_param.carbon @@ -41,15 +41,12 @@ library "[[@TEST_NAME]]"; import Cpp library "templates.h"; -// CHECK:STDERR: ╭─┤ fail_int_param_mismatch.carbon:[[@LINE+11]]:1 +// CHECK:STDERR: ╭─┤ fail_int_param_mismatch.carbon:[[@LINE+8]]:1 // CHECK:STDERR: -> │ var s: Cpp.Simple(456) = Cpp.MakeSimple123(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Cpp.Simple` to -// CHECK:STDERR: · │ ┃ `Cpp.Simple` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `Cpp.Simple` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.Simple)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `Cpp.Simple` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var s: Cpp.Simple(456) = Cpp.MakeSimple123(); @@ -143,15 +140,12 @@ library "[[@TEST_NAME]]"; import Cpp library "templates.h"; -// CHECK:STDERR: ╭─┤ fail_type_argument.carbon:[[@LINE+11]]:26 +// CHECK:STDERR: ╭─┤ fail_type_argument.carbon:[[@LINE+8]]:26 // CHECK:STDERR: -> │ var x: Cpp.TwoNonType(1, Cpp.A) = {}; // CHECK:STDERR: · ┳━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of -// CHECK:STDERR: · │ ┃ type `type` to `i32` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `type` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(i32)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ type `type` to `i32` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var x: Cpp.TwoNonType(1, Cpp.A) = {}; @@ -164,15 +158,12 @@ import Cpp library "templates.h"; var n: i32; -// CHECK:STDERR: ╭─┤ fail_no_conversion.carbon:[[@LINE+11]]:26 +// CHECK:STDERR: ╭─┤ fail_no_conversion.carbon:[[@LINE+8]]:26 // CHECK:STDERR: -> │ var x: Cpp.TwoNonType(1, &n) = {}; // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of -// CHECK:STDERR: · │ ┃ type `i32*` to `i32` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `i32*` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(i32)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ type `i32*` to `i32` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var x: Cpp.TwoNonType(1, &n) = {}; diff --git a/toolchain/check/testdata/interop/cpp/template/type_param.carbon b/toolchain/check/testdata/interop/cpp/template/type_param.carbon index dbb3cc7df571..e6e4df2d66ae 100644 --- a/toolchain/check/testdata/interop/cpp/template/type_param.carbon +++ b/toolchain/check/testdata/interop/cpp/template/type_param.carbon @@ -43,15 +43,12 @@ library "[[@TEST_NAME]]"; import Cpp library "templates.h"; -// CHECK:STDERR: ╭─┤ fail_non_type_argument.carbon:[[@LINE+11]]:28 +// CHECK:STDERR: ╭─┤ fail_non_type_argument.carbon:[[@LINE+8]]:28 // CHECK:STDERR: -> │ var x: Cpp.TwoTypes(Cpp.A, true); // CHECK:STDERR: · ┳━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value -// CHECK:STDERR: · │ ┃ of type `bool` to `type` -// CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] -// CHECK:STDERR: · ╰────┤ type `bool` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(type)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ of type `bool` to `type` +// CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: var x: Cpp.TwoTypes(Cpp.A, true); diff --git a/toolchain/check/testdata/lambda/lambda.carbon b/toolchain/check/testdata/lambda/lambda.carbon index e1ae1c1e1cd2..db80314f9e33 100644 --- a/toolchain/check/testdata/lambda/lambda.carbon +++ b/toolchain/check/testdata/lambda/lambda.carbon @@ -179,26 +179,25 @@ fn TestAsTemplateArgument() { library "[[@TEST_NAME]]"; // TODO: This should work even when `f` is not constant. +// CHECK:STDERR: ╭─┤ fail_todo_as_non_constant_template_argument.carbon:[[@LINE+14]]:45 +// CHECK:STDERR: -> │ fn PassToTemplate[template F: type](f: F) { f(42); } +// CHECK:STDERR: · ━━┳━━ +// CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ +// CHECK:STDERR: · ┃ error: value of type `` is not callable +// CHECK:STDERR: · ┃ [CallToNonCallable] +// CHECK:STDERR: ┆ +// CHECK:STDERR: │ PassToTemplate(id_fn); +// CHECK:STDERR: · ┬───────────── +// CHECK:STDERR: · ╰──┤ in monomorphization of `PassToTemplate()` +// CHECK:STDERR: · │ here +// CHECK:STDERR: · │ [ResolvingSpecificHere] +// CHECK:STDERR: ╰──── +// CHECK:STDERR: fn PassToTemplate[template F: type](f: F) { f(42); } alias id_fn = fn (x: i32) -> i32 { return x; }; fn TestAsTemplateArgument() { - // CHECK:STDERR: ╭─┤ fail_todo_as_non_constant_template_argument.carbon:[[@LINE+15]]:3 - // CHECK:STDERR: │ fn PassToTemplate[template F: type](f: F) { f(42); } - // CHECK:STDERR: · ┬──── - // CHECK:STDERR: · ╰──┤ value of type - // CHECK:STDERR: · │ `` - // CHECK:STDERR: · │ is not callable - // CHECK:STDERR: · │ [CallToNonCallable] - // CHECK:STDERR: ┆ - // CHECK:STDERR: -> │ PassToTemplate(id_fn); - // CHECK:STDERR: · ┳━━━━━━━━━━━━━ - // CHECK:STDERR: · ┗━━┫ error: unable to monomorphize specific - // CHECK:STDERR: · ┃ `PassToTemplate()` - // CHECK:STDERR: · ┃ [ResolvingSpecificHere] - // CHECK:STDERR: ╰──── - // CHECK:STDERR: PassToTemplate(id_fn); } @@ -267,15 +266,12 @@ fn Outer() -> i32 { // CHECK:STDERR: ╰──── // CHECK:STDERR: (fn () -> i32 {}); - // CHECK:STDERR: ╭─┤ fail_return.carbon:[[@LINE+11]]:20 + // CHECK:STDERR: ╭─┤ fail_return.carbon:[[@LINE+8]]:20 // CHECK:STDERR: -> │ (fn () -> bool { return 1; }); // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `Core.IntLiteral` to `bool` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(bool)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Core.IntLiteral` to `bool` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: (fn () -> bool { return 1; }); @@ -321,7 +317,7 @@ fn F() { // CHECK:STDERR: ╭─┤ fail_unused.carbon:[[@LINE+11]]:23 // CHECK:STDERR: -> │ (fn (x: i32, unused y: i32) -> i32 { // CHECK:STDERR: · ━━━┳━━ - // CHECK:STDERR: · ┗━━┫ error: variable `y` marked `unused` but used + // CHECK:STDERR: · ┗━━┫ error: binding `y` marked `unused` but used // CHECK:STDERR: · ┃ [UnusedButUsed] // CHECK:STDERR: ┆ // CHECK:STDERR: │ return y; @@ -348,7 +344,7 @@ fn F() { // CHECK:STDERR: ╭─┤ fail_unused.carbon:[[@LINE+9]]:23 // CHECK:STDERR: -> │ (fn (x: i32, unused y: i32) => y); // CHECK:STDERR: · ━━━┳━━ ┬ - // CHECK:STDERR: · ┗━━━━━━━━━━┫ error: variable `y` marked `unused` but + // CHECK:STDERR: · ┗━━━━━━━━━━┫ error: binding `y` marked `unused` but // CHECK:STDERR: · │ ┃ used // CHECK:STDERR: · │ ┃ [UnusedButUsed] // CHECK:STDERR: · ╰────┤ usage here [UnusedButUsedHere] @@ -412,8 +408,8 @@ class Incomplete; fn F() { // CHECK:STDERR: ╭─┤ fail_incomplete_type.carbon:[[@LINE+12]]:15 // CHECK:STDERR: │ class Incomplete; - // CHECK:STDERR: · ────────┬──────── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ─────┬──── + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ (fn (unused x: Incomplete) {}); // CHECK:STDERR: · ┳━━━━━━━━━━━━ @@ -425,8 +421,8 @@ fn F() { (fn (unused x: Incomplete) {}); // CHECK:STDERR: ╭─┤ fail_incomplete_type.carbon:[[@LINE+19]]:10 // CHECK:STDERR: │ class Incomplete; - // CHECK:STDERR: · ────────┬──────── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ─────┬──── + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ (fn () -> Incomplete {}); // CHECK:STDERR: · ━━━━━━┳━━━━━━ @@ -445,8 +441,8 @@ fn F() { (fn () -> Incomplete {}); // CHECK:STDERR: ╭─┤ fail_incomplete_type.carbon:[[@LINE+12]]:27 // CHECK:STDERR: │ class Incomplete; - // CHECK:STDERR: · ────────┬──────── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ─────┬──── + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ (fn (p: Incomplete*) => *p); // CHECK:STDERR: · ┳━ @@ -462,15 +458,12 @@ fn F() { library "[[@TEST_NAME]]"; fn F() { - // CHECK:STDERR: ╭─┤ fail_conversion.carbon:[[@LINE+11]]:16 + // CHECK:STDERR: ╭─┤ fail_conversion.carbon:[[@LINE+8]]:16 // CHECK:STDERR: -> │ let _: i32 = fn () {}; // CHECK:STDERR: · ┳━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `` to `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `` does not implement - // CHECK:STDERR: · │ interface `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `` to `i32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: i32 = fn () {}; diff --git a/toolchain/check/testdata/let/convert.carbon b/toolchain/check/testdata/let/convert.carbon index 5390724ad588..0d64ead80ed9 100644 --- a/toolchain/check/testdata/let/convert.carbon +++ b/toolchain/check/testdata/let/convert.carbon @@ -30,7 +30,7 @@ library "[[@TEST_NAME]]"; fn G() { var a: i32 = 0; let unused n: i32 = a; - // CHECK:STDERR: ╭─┤ fail_let_bound_to_ref_not_mutable.carbon:[[@LINE+17]]:3 + // CHECK:STDERR: ╭─┤ fail_let_bound_to_ref_not_mutable.carbon:[[@LINE+16]]:3 // CHECK:STDERR: -> │ n = 1; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: expression is not assignable [AssignmentToNonAssignable] @@ -39,8 +39,7 @@ fn G() { // CHECK:STDERR: ╭─┤ fail_let_bound_to_ref_not_mutable.carbon:[[@LINE-7]]:14 // CHECK:STDERR: -> │ let unused n: i32 = a; // CHECK:STDERR: · ━━━┳━━ - // CHECK:STDERR: · ┗━━┫ error: variable `n` marked `unused` but used - // CHECK:STDERR: · ┃ [UnusedButUsed] + // CHECK:STDERR: · ┗━━┫ error: binding `n` marked `unused` but used [UnusedButUsed] // CHECK:STDERR: ┆ // CHECK:STDERR: │ n = 1; // CHECK:STDERR: · ┬ diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index a6594651de10..e0d6e2181221 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -16,8 +16,8 @@ fn F() { let unused a: i32 = 1; // CHECK:STDERR: ╭─┤ fail_duplicate_decl.carbon:[[@LINE+11]]:14 // CHECK:STDERR: │ let unused a: i32 = 1; - // CHECK:STDERR: · ───┬── - // CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ let unused a: i32 = 2; // CHECK:STDERR: · ┳ diff --git a/toolchain/check/testdata/let/fail_use_in_init.carbon b/toolchain/check/testdata/let/fail_use_in_init.carbon index b24de42d69ea..fe08465897c5 100644 --- a/toolchain/check/testdata/let/fail_use_in_init.carbon +++ b/toolchain/check/testdata/let/fail_use_in_init.carbon @@ -23,7 +23,7 @@ fn F() { // CHECK:STDERR: ╭─┤ fail_use_in_init.carbon:[[@LINE+8]]:14 // CHECK:STDERR: -> │ let unused a: i32 = a; // CHECK:STDERR: · ━━━┳━━ ┬ - // CHECK:STDERR: · ┗━━━━━━━━┫ error: variable `a` marked `unused` but used + // CHECK:STDERR: · ┗━━━━━━━━┫ error: binding `a` marked `unused` but used // CHECK:STDERR: · │ ┃ [UnusedButUsed] // CHECK:STDERR: · ╰────┤ usage here [UnusedButUsedHere] // CHECK:STDERR: ╰──── diff --git a/toolchain/check/testdata/let/form.carbon b/toolchain/check/testdata/let/form.carbon index b50dce61f4f4..627bbf10c96d 100644 --- a/toolchain/check/testdata/let/form.carbon +++ b/toolchain/check/testdata/let/form.carbon @@ -13,15 +13,12 @@ // --- fail_todo_form_binding.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: ╭─┤ fail_todo_form_binding.carbon:[[@LINE+17]]:9 +// CHECK:STDERR: ╭─┤ fail_todo_form_binding.carbon:[[@LINE+14]]:9 // CHECK:STDERR: -> │ let x:? () = (); // CHECK:STDERR: · ┳━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `()` to -// CHECK:STDERR: · │ ┃ `Core.Form` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `()` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(Core.Form)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `Core.Form` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_todo_form_binding.carbon:[[@LINE+6]]:5 diff --git a/toolchain/check/testdata/match_first/basic.carbon b/toolchain/check/testdata/match_first/basic.carbon index a20fd264fbc5..bd5c0050c9bc 100644 --- a/toolchain/check/testdata/match_first/basic.carbon +++ b/toolchain/check/testdata/match_first/basic.carbon @@ -261,8 +261,8 @@ interface Z {} interface Y { // CHECK:STDERR: ╭─┤ fail_inside_interface.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ interface Y { - // CHECK:STDERR: · ──────┬────── - // CHECK:STDERR: · ╰──┤ in enclosing scope here [MatchFirstInWrongScopeNote] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ in enclosing scope here [MatchFirstInWrongScopeNote] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ match_first { // CHECK:STDERR: · ━┳━━━━━━━━━━━ @@ -283,8 +283,8 @@ interface Z {} constraint N { // CHECK:STDERR: ╭─┤ fail_inside_constraint.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ constraint N { - // CHECK:STDERR: · ───────┬────── - // CHECK:STDERR: · ╰──┤ in enclosing scope here [MatchFirstInWrongScopeNote] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ in enclosing scope here [MatchFirstInWrongScopeNote] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ match_first { // CHECK:STDERR: · ━┳━━━━━━━━━━━ diff --git a/toolchain/check/testdata/named_constraint/basic.carbon b/toolchain/check/testdata/named_constraint/basic.carbon index cb8c09aff76b..966e9d9d7442 100644 --- a/toolchain/check/testdata/named_constraint/basic.carbon +++ b/toolchain/check/testdata/named_constraint/basic.carbon @@ -31,8 +31,8 @@ class ForwardDeclared; // CHECK:STDERR: ╭─┤ fail_name_conflict.carbon:[[@LINE+12]]:12 // CHECK:STDERR: │ class ForwardDeclared; -// CHECK:STDERR: · ───────────┬────────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ───────┬─────── +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ constraint ForwardDeclared {} // CHECK:STDERR: · ┳━━━━━━━━━━━━━━ @@ -50,8 +50,8 @@ constraint Declared {} // CHECK:STDERR: ╭─┤ fail_defined_twice.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ constraint Declared {} -// CHECK:STDERR: · ──────────┬────────── -// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] +// CHECK:STDERR: · ────┬─── +// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ constraint Declared {} // CHECK:STDERR: · ━━━━━━━━━━┳━━━━━━━━━━ diff --git a/toolchain/check/testdata/named_constraint/generic.carbon b/toolchain/check/testdata/named_constraint/generic.carbon index 10d8b5e508bf..edfb67582b22 100644 --- a/toolchain/check/testdata/named_constraint/generic.carbon +++ b/toolchain/check/testdata/named_constraint/generic.carbon @@ -68,7 +68,7 @@ library "[[@TEST_NAME]]"; constraint Generic(T: type) {} // CHECK:STDERR: ╭─┤ fail_inside_definition.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ constraint Generic(T: type) {} -// CHECK:STDERR: · ──────────────┬────────────── +// CHECK:STDERR: · ───┬─── // CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ constraint Generic(T: type) {} @@ -85,7 +85,7 @@ constraint Generic(T: type) {} // CHECK:STDERR: ╭─┤ fail_args_count_mismatch.carbon:[[@LINE+12]]:24 // CHECK:STDERR: │ constraint Generic(T: type) {} -// CHECK:STDERR: · ──────────────┬────────────── +// CHECK:STDERR: · ───┬─── // CHECK:STDERR: · ╰──┤ calling generic constraint declared here [InCallToEntity] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn F(unused generic T: Generic((), ())) {} diff --git a/toolchain/check/testdata/named_constraint/import_constraint_decl.carbon b/toolchain/check/testdata/named_constraint/import_constraint_decl.carbon index f7963241e74c..bf26ed2a3347 100644 --- a/toolchain/check/testdata/named_constraint/import_constraint_decl.carbon +++ b/toolchain/check/testdata/named_constraint/import_constraint_decl.carbon @@ -39,18 +39,17 @@ library "[[@TEST_NAME]]"; import library "a"; class C {} -// CHECK:STDERR: ╭─┤ fail_import_not_identified.carbon:[[@LINE+14]]:1 +// CHECK:STDERR: ╭─┤ fail_import_not_identified.carbon:[[@LINE+13]]:1 // CHECK:STDERR: -> │ impl C as A; // CHECK:STDERR: · ━━━━━━┳━━━━━ // CHECK:STDERR: · ┗━━┫ error: facet type `A` cannot be identified in `impl as` // CHECK:STDERR: · ┃ [ImplOfUnidentifiedFacetType] // CHECK:STDERR: ┆ -// CHECK:STDERR: │ ╭── imported from: fail_import_not_identified.carbon [InImport] // CHECK:STDERR: ├─┤ a.carbon // CHECK:STDERR: │ constraint A; -// CHECK:STDERR: · ──────┬────── -// CHECK:STDERR: · ╰──┤ constraint was forward declared here -// CHECK:STDERR: · │ [NamedConstraintForwardDeclaredHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ constraint was forward declared here +// CHECK:STDERR: · │ [NamedConstraintForwardDeclaredHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: impl C as A; diff --git a/toolchain/check/testdata/named_constraint/incomplete.carbon b/toolchain/check/testdata/named_constraint/incomplete.carbon index d494cf4b6563..e21234eddac3 100644 --- a/toolchain/check/testdata/named_constraint/incomplete.carbon +++ b/toolchain/check/testdata/named_constraint/incomplete.carbon @@ -85,9 +85,9 @@ fn F() { // Converting to facet type `Z` requires `Z` to be identified. // CHECK:STDERR: ╭─┤ fail_impl_lookup_target_not_identified.carbon:[[@LINE+17]]:3 // CHECK:STDERR: │ constraint Z; - // CHECK:STDERR: · ──────┬────── - // CHECK:STDERR: · ╰──┤ constraint was forward declared here - // CHECK:STDERR: · │ [NamedConstraintForwardDeclaredHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ constraint was forward declared here + // CHECK:STDERR: · │ [NamedConstraintForwardDeclaredHere] // CHECK:STDERR: │ // CHECK:STDERR: │ fn AsZ(unused generic T: Z) {} // CHECK:STDERR: · ──┬─ @@ -129,7 +129,7 @@ constraint W { // CHECK:STDERR: ┆ // CHECK:STDERR: │ constraint W { // CHECK:STDERR: · ───────┬────── - // CHECK:STDERR: · ╰──┤ constraint is currently being defined + // CHECK:STDERR: · ╰──┤ constraint is incomplete within its definition // CHECK:STDERR: · │ [NamedConstraintIncompleteWithinDefinition] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ require impls X where .XZ = ReturnFacet(Self); @@ -140,9 +140,9 @@ constraint W { // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_incomplete_self.carbon:[[@LINE+12]]:31 // CHECK:STDERR: │ eval fn ReturnFacet[T: type](generic U: T) -> T; - // CHECK:STDERR: · ────────────────────────┬─────────────────────── - // CHECK:STDERR: · ╰──┤ generic function declared here - // CHECK:STDERR: · │ [MissingGenericFunctionDefinitionHere] + // CHECK:STDERR: · ─────┬───── + // CHECK:STDERR: · ╰──┤ generic function declared here + // CHECK:STDERR: · │ [MissingGenericFunctionDefinitionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ require impls X where .XZ = ReturnFacet(Self); // CHECK:STDERR: · ━━━━━┳━━━━━ diff --git a/toolchain/check/testdata/named_constraint/require.carbon b/toolchain/check/testdata/named_constraint/require.carbon index 55ddb1b21d6b..272c9b394a5f 100644 --- a/toolchain/check/testdata/named_constraint/require.carbon +++ b/toolchain/check/testdata/named_constraint/require.carbon @@ -169,9 +169,9 @@ constraint Y; constraint Z { // CHECK:STDERR: ╭─┤ fail_require_impls_incomplete_constraint.carbon:[[@LINE+13]]:17 // CHECK:STDERR: │ constraint Y; - // CHECK:STDERR: · ──────┬────── - // CHECK:STDERR: · ╰──┤ constraint was forward declared here - // CHECK:STDERR: · │ [NamedConstraintForwardDeclaredHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ constraint was forward declared here + // CHECK:STDERR: · │ [NamedConstraintForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ require impls Y; // CHECK:STDERR: · ┳ @@ -273,9 +273,9 @@ constraint Z; constraint Y { // CHECK:STDERR: ╭─┤ fail_require_impls_incomplete_indirect.carbon:[[@LINE+13]]:17 // CHECK:STDERR: │ constraint Z; - // CHECK:STDERR: · ──────┬────── - // CHECK:STDERR: · ╰──┤ constraint was forward declared here - // CHECK:STDERR: · │ [NamedConstraintForwardDeclaredHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ constraint was forward declared here + // CHECK:STDERR: · │ [NamedConstraintForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ require impls Z; // CHECK:STDERR: · ┳ @@ -421,15 +421,12 @@ library "[[@TEST_NAME]]"; interface Y {} constraint Z(T: type) { - // CHECK:STDERR: ╭─┤ fail_non_type_impls.carbon:[[@LINE+11]]:11 + // CHECK:STDERR: ╭─┤ fail_non_type_impls.carbon:[[@LINE+8]]:11 // CHECK:STDERR: -> │ require 1 impls Y; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type - // CHECK:STDERR: · │ ┃ `Core.IntLiteral` to `type` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(type)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Core.IntLiteral` to `type` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: require 1 impls Y; diff --git a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon index 7582ea239135..88a064e8a9a9 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon @@ -36,8 +36,8 @@ namespace NS; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ namespace.carbon // CHECK:STDERR: │ namespace NS; -// CHECK:STDERR: · ──────┬────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ─┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn NS(); @@ -54,8 +54,8 @@ namespace NS; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ namespace.carbon // CHECK:STDERR: │ namespace NS; -// CHECK:STDERR: · ──────┬────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ─┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn NS(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon index a94a7bb89a1a..019bac0a9333 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon @@ -32,8 +32,8 @@ import library "namespace"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ namespace.carbon // CHECK:STDERR: │ namespace NS; -// CHECK:STDERR: · ──────┬────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ─┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn NS(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon index d88aea0db9ec..841e242b85f7 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon @@ -32,7 +32,7 @@ import library "fn"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ fn.carbon // CHECK:STDERR: │ fn NS(); -// CHECK:STDERR: · ────┬─── +// CHECK:STDERR: · ─┬ // CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon index 616f7de30d33..0c7450f6ce59 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon @@ -32,8 +32,8 @@ package Example library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ namespace.carbon // CHECK:STDERR: │ namespace NS; -// CHECK:STDERR: · ──────┬────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ─┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn NS() {} diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon index 5bec5f78cfed..c492c83335bd 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon @@ -31,7 +31,7 @@ package Example library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ fn.carbon // CHECK:STDERR: │ fn NS() {} -// CHECK:STDERR: · ────┬──── +// CHECK:STDERR: · ─┬ // CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: diff --git a/toolchain/check/testdata/namespace/fail_duplicate.carbon b/toolchain/check/testdata/namespace/fail_duplicate.carbon index 3166d1818831..817843d9f50c 100644 --- a/toolchain/check/testdata/namespace/fail_duplicate.carbon +++ b/toolchain/check/testdata/namespace/fail_duplicate.carbon @@ -19,8 +19,8 @@ fn Foo.Baz() { // CHECK:STDERR: ╭─┤ fail_duplicate.carbon:[[@LINE+10]]:1 // CHECK:STDERR: │ fn Foo.Baz() { -// CHECK:STDERR: · ───────┬────── -// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] +// CHECK:STDERR: · ─┬─ +// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ fn Foo.Baz() { // CHECK:STDERR: · ━━━━━━━┳━━━━━━ diff --git a/toolchain/check/testdata/namespace/imported_indirect.carbon b/toolchain/check/testdata/namespace/imported_indirect.carbon index 1a1ed7dda7a4..fb30a7035f8e 100644 --- a/toolchain/check/testdata/namespace/imported_indirect.carbon +++ b/toolchain/check/testdata/namespace/imported_indirect.carbon @@ -56,18 +56,16 @@ package Same library "[[@TEST_NAME]]"; import library "b"; -// CHECK:STDERR: ╭─┤ fail_named_indirectly_same_package.carbon:[[@LINE+19]]:10 +// CHECK:STDERR: ╭─┤ fail_named_indirectly_same_package.carbon:[[@LINE+17]]:10 // CHECK:STDERR: -> │ fn G() { F(); } // CHECK:STDERR: · ━┳━ // CHECK:STDERR: · ┗━━┫ error: function returns incomplete type `A.C` // CHECK:STDERR: · ┃ [IncompleteTypeInFunctionReturnType] // CHECK:STDERR: ┆ -// CHECK:STDERR: │ ╭── imported from: fail_named_indirectly_same_package.carbon [InImport] -// CHECK:STDERR: │ ├── imported from: b.carbon [InImport] // CHECK:STDERR: ├─┤ a.carbon // CHECK:STDERR: │ class A.C; -// CHECK:STDERR: · ─────┬──── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ b.carbon // CHECK:STDERR: │ fn F() -> A.C; @@ -83,18 +81,16 @@ package Other library "[[@TEST_NAME]]"; import Same library "b"; -// CHECK:STDERR: ╭─┤ fail_named_indirectly_different_package.carbon:[[@LINE+19]]:10 +// CHECK:STDERR: ╭─┤ fail_named_indirectly_different_package.carbon:[[@LINE+17]]:10 // CHECK:STDERR: -> │ fn G() { Same.F(); } // CHECK:STDERR: · ━━━━┳━━━ // CHECK:STDERR: · ┗━━┫ error: function returns incomplete type `Same.A.C` // CHECK:STDERR: · ┃ [IncompleteTypeInFunctionReturnType] // CHECK:STDERR: ┆ -// CHECK:STDERR: │ ╭── imported from: fail_named_indirectly_different_package.carbon [InImport] -// CHECK:STDERR: │ ├── imported from: b.carbon [InImport] // CHECK:STDERR: ├─┤ a.carbon // CHECK:STDERR: │ class A.C; -// CHECK:STDERR: · ─────┬──── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ b.carbon // CHECK:STDERR: │ fn F() -> A.C; diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon index 6b29920ee81d..992e3a1dadab 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon @@ -13,15 +13,12 @@ // 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+11]]:24 + // CHECK:STDERR: ╭─┤ fail_type_mismatch.carbon:[[@LINE+8]]:24 // CHECK:STDERR: -> │ var unused x: bool = not 12; // CHECK:STDERR: · ┳━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `Core.IntLiteral` to `bool` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement - // CHECK:STDERR: · │ interface `Core.ImplicitAs(bool)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Core.IntLiteral` to `bool` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused x: bool = not 12; @@ -47,7 +44,7 @@ fn Main() { // CHECK:STDOUT: %T.09f: %SubobjectDestroy.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.type.dea: type = fn_type @T.as_type.as.DestroyImpl.impl.Op, @T.as_type.as.DestroyImpl.impl(%T.09f) [symbolic] // CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.6e5: %T.as_type.as.DestroyImpl.impl.Op.type.dea = struct_value () [symbolic] -// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.687: type = fn_type @SubobjectDestroy.WithSelf.Op.loc27 [concrete] +// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.687: type = fn_type @SubobjectDestroy.WithSelf.Op.loc24 [concrete] // CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f: %SubobjectDestroy.WithSelf.Op.type.687 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.b80: = custom_witness (%SubobjectDestroy.WithSelf.Op.30f), @SubobjectDestroy [concrete] // CHECK:STDOUT: %SubobjectDestroy.facet.a87: %SubobjectDestroy.type = facet_value bool, (%custom_witness.b80) [concrete] @@ -84,23 +81,23 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.var: ref bool = var_storage %x.var_patt // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12] -// CHECK:STDOUT: %.loc27_24.1: bool = converted %int_12, [concrete = ] -// CHECK:STDOUT: %.loc27_24.2: = not [concrete = ] +// CHECK:STDOUT: %.loc24_24.1: bool = converted %int_12, [concrete = ] +// CHECK:STDOUT: %.loc24_24.2: = not [concrete = ] // CHECK:STDOUT: assign %x.var, -// CHECK:STDOUT: %.loc27_17: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc24_17: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %x: ref bool = wrapper_binding x, %x.var // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type.831 = ref_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: %x.var_patt: %pattern_type.831 = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.facet.loc27_3.1: %Destroy.type = facet_value bool, (constants.%DestroyImpl.impl_witness.778, constants.%custom_witness.b80) [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %.loc27_3.1: %Destroy.type = converted bool, %Destroy.facet.loc27_3.1 [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %Destroy.facet.loc27_3.2: %Destroy.type = facet_value bool, (constants.%DestroyImpl.impl_witness.778, constants.%custom_witness.b80) [concrete = constants.%Destroy.facet] -// CHECK:STDOUT: %.loc27_3.2: %Destroy.type = converted bool, %Destroy.facet.loc27_3.2 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %Destroy.facet.loc24_3.1: %Destroy.type = facet_value bool, (constants.%DestroyImpl.impl_witness.778, constants.%custom_witness.b80) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc24_3.1: %Destroy.type = converted bool, %Destroy.facet.loc24_3.1 [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %Destroy.facet.loc24_3.2: %Destroy.type = facet_value bool, (constants.%DestroyImpl.impl_witness.778, constants.%custom_witness.b80) [concrete = constants.%Destroy.facet] +// CHECK:STDOUT: %.loc24_3.2: %Destroy.type = converted bool, %Destroy.facet.loc24_3.2 [concrete = constants.%Destroy.facet] // CHECK:STDOUT: %SelfDestruct.specific_fn: = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet) [concrete = constants.%SelfDestruct.specific_fn] // CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%x.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc27(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc24(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon index 64d6d056ae09..53097e09b84f 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -14,15 +14,12 @@ fn Main() { var a: i32 = 3; - // CHECK:STDERR: ╭─┤ fail_type_mismatch_assignment.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_type_mismatch_assignment.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ a = 5.6; // CHECK:STDERR: · ┳━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Core.FloatLiteral` - // CHECK:STDERR: · │ ┃ to `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.FloatLiteral` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `i32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: a = 5.6; @@ -121,7 +118,7 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %a.ref: ref %i32 = name_ref a, %a // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 56e-1 [concrete = constants.%float] -// CHECK:STDOUT: %.loc28: %i32 = converted %float, [concrete = ] +// CHECK:STDOUT: %.loc25: %i32 = converted %float, [concrete = ] // CHECK:STDOUT: assign %a.ref, // CHECK:STDOUT: %Destroy.facet.loc16_3.1: %Destroy.type = facet_value constants.%i32, (constants.%DestroyImpl.impl_witness.077, constants.%custom_witness.b80) [concrete = constants.%Destroy.facet] // CHECK:STDOUT: %.loc16_3.2: %Destroy.type = converted constants.%i32, %Destroy.facet.loc16_3.1 [concrete = constants.%Destroy.facet] diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index 700b702fdb07..2ba40a6c4cc0 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -94,7 +94,7 @@ impl C as Core.IndexWith((), ()) { fn F() { let c: C = {}; - // CHECK:STDERR: ╭─┤ fail_wrong_arg_count.carbon:[[@LINE+13]]:3 + // CHECK:STDERR: ╭─┤ fail_wrong_arg_count.carbon:[[@LINE+12]]:3 // CHECK:STDERR: -> │ c[()]; // CHECK:STDERR: · ━━┳━━ // CHECK:STDERR: · ┗━━┫ error: 1 argument passed to generic interface expecting 2 arguments @@ -102,9 +102,8 @@ fn F() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ core_wrong_arg_count.carbon // CHECK:STDERR: │ interface IndexWith(SubscriptType: type, ElementType: type) { - // CHECK:STDERR: · ──────────────────────────────┬────────────────────────────── - // CHECK:STDERR: · ╰──┤ calling generic interface declared here - // CHECK:STDERR: · │ [InCallToEntity] + // CHECK:STDERR: · ────┬──── + // CHECK:STDERR: · ╰──┤ calling generic interface declared here [InCallToEntity] // CHECK:STDERR: ╰──── // CHECK:STDERR: c[()]; diff --git a/toolchain/check/testdata/packages/cross_package_export.carbon b/toolchain/check/testdata/packages/cross_package_export.carbon index c4518c458a63..78c67b858ea7 100644 --- a/toolchain/check/testdata/packages/cross_package_export.carbon +++ b/toolchain/check/testdata/packages/cross_package_export.carbon @@ -29,8 +29,8 @@ package Other library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ conflict.carbon // CHECK:STDERR: │ fn C() {} -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ fail_conflict_on_export_import.carbon // CHECK:STDERR: │ alias C = Other.C; @@ -55,8 +55,8 @@ package Other library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ base.carbon // CHECK:STDERR: │ class C { -// CHECK:STDERR: · ────┬──── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ fail_conflict_on_export_name.carbon // CHECK:STDERR: │ alias C = Other.C; diff --git a/toolchain/check/testdata/packages/cross_package_import.carbon b/toolchain/check/testdata/packages/cross_package_import.carbon index dcd6e8917790..0c56ec24d28f 100644 --- a/toolchain/check/testdata/packages/cross_package_import.carbon +++ b/toolchain/check/testdata/packages/cross_package_import.carbon @@ -35,8 +35,8 @@ package Other library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ other_fn.carbon // CHECK:STDERR: │ fn F() {} -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ fail_todo_main_use_other_extern.carbon // CHECK:STDERR: │ Other.F(); @@ -59,8 +59,8 @@ package Other library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ other_fn.carbon // CHECK:STDERR: │ fn F() {} -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ fail_main_use_other_ambiguous.carbon // CHECK:STDERR: │ Other.F(); @@ -148,8 +148,8 @@ import library "main_other_ns"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ main_other_ns.carbon // CHECK:STDERR: │ namespace Other; -// CHECK:STDERR: · ────────┬─────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ──┬── +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: import Other library "other_fn"; @@ -161,8 +161,8 @@ import Other library "other_fn"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ other_fn.carbon // CHECK:STDERR: │ fn F() {} -// CHECK:STDERR: · ────┬─── -// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn Other.F() {} diff --git a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon index e8aa790a243d..7cff5ea93696 100644 --- a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon +++ b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon @@ -31,7 +31,7 @@ package Example library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ fn.carbon // CHECK:STDERR: │ fn Foo(); -// CHECK:STDERR: · ────┬──── +// CHECK:STDERR: · ─┬─ // CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: diff --git a/toolchain/check/testdata/packages/implicit_imports_entities.carbon b/toolchain/check/testdata/packages/implicit_imports_entities.carbon index 83dcce6d0d24..5daef2b84ea4 100644 --- a/toolchain/check/testdata/packages/implicit_imports_entities.carbon +++ b/toolchain/check/testdata/packages/implicit_imports_entities.carbon @@ -140,8 +140,8 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ local_other.carbon // CHECK:STDERR: │ class Other {} -// CHECK:STDERR: · ──────┬────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ──┬── +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: import Other library "o1"; @@ -170,8 +170,8 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ local_other.carbon // CHECK:STDERR: │ class Other {} -// CHECK:STDERR: · ──────┬────── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ──┬── +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: import Other library "o1"; diff --git a/toolchain/check/testdata/packages/missing_prelude.carbon b/toolchain/check/testdata/packages/missing_prelude.carbon index 750137d5317d..88661e26ecfc 100644 --- a/toolchain/check/testdata/packages/missing_prelude.carbon +++ b/toolchain/check/testdata/packages/missing_prelude.carbon @@ -64,26 +64,20 @@ library "[[@TEST_NAME]]"; import Core library "prelude_fake_int"; // We don't really care whether this works, but it shouldn't crash or otherwise misbehave. -// CHECK:STDERR: ╭─┤ fail_use_fake_int.carbon:[[@LINE+22]]:17 +// CHECK:STDERR: ╭─┤ fail_use_fake_int.carbon:[[@LINE+16]]:17 // CHECK:STDERR: -> │ let n: Core.X = i32; // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type -// CHECK:STDERR: · │ ┃ `Core.X` to `type` -// CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] -// CHECK:STDERR: · ╰────┤ type `Core.X` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(type)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `Core.X` to `type` +// CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: -// CHECK:STDERR: ╭─┤ fail_use_fake_int.carbon:[[@LINE+11]]:17 +// CHECK:STDERR: ╭─┤ fail_use_fake_int.carbon:[[@LINE+8]]:17 // CHECK:STDERR: -> │ let n: Core.X = i32; // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `type` -// CHECK:STDERR: · │ ┃ to `Core.X` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `type` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(Core.X)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ to `Core.X` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let n: Core.X = i32; @@ -506,7 +500,7 @@ let n: type = i32; // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %.loc29: type = splice_block %X.ref [concrete = constants.%X] { +// CHECK:STDOUT: %.loc23: type = splice_block %X.ref [concrete = constants.%X] { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %X.ref: type = name_ref X, imports.%Core.X [concrete = constants.%X] // CHECK:STDOUT: } @@ -572,11 +566,11 @@ let n: type = i32; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int.specific_fn: = specific_function constants.%Int, @Int(Core.IntLiteral, constants.%int_32) [concrete = constants.%Int.specific_fn] -// CHECK:STDOUT: %.loc29_17.1: ref %X = temporary_storage -// CHECK:STDOUT: %Int.call: init %X to %.loc29_17.1 = call %Int.specific_fn() -// CHECK:STDOUT: %.loc29_17.2: type = converted %Int.call, [concrete = ] -// CHECK:STDOUT: %.loc29_17.3: type = type_literal [concrete = ] -// CHECK:STDOUT: %.loc29_17.4: %X = converted %.loc29_17.3, [concrete = ] +// CHECK:STDOUT: %.loc23_17.1: ref %X = temporary_storage +// CHECK:STDOUT: %Int.call: init %X to %.loc23_17.1 = call %Int.specific_fn() +// CHECK:STDOUT: %.loc23_17.2: type = converted %Int.call, [concrete = ] +// CHECK:STDOUT: %.loc23_17.3: type = type_literal [concrete = ] +// CHECK:STDOUT: %.loc23_17.4: %X = converted %.loc23_17.3, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/patterns/struct.carbon b/toolchain/check/testdata/patterns/struct.carbon index 4872059f159a..d2b774c7c573 100644 --- a/toolchain/check/testdata/patterns/struct.carbon +++ b/toolchain/check/testdata/patterns/struct.carbon @@ -217,10 +217,10 @@ library "[[@TEST_NAME]]"; //@dump-sem-ir-begin // CHECK:STDERR: ╭─┤ fail_duplicate_field_name_shorthand.carbon:[[@LINE+16]]:13 // CHECK:STDERR: -> │ let {a: (), a: ()} = {.a = ()}; -// CHECK:STDERR: · ──┬── ┳ -// CHECK:STDERR: · │ ┗━━┫ error: duplicate name `a` being declared in the same scope -// CHECK:STDERR: · │ ┃ [NameDeclDuplicate] -// CHECK:STDERR: · ╰─────────┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ ┳ +// CHECK:STDERR: · │ ┗━━┫ error: duplicate name `a` being declared in the same scope +// CHECK:STDERR: · │ ┃ [NameDeclDuplicate] +// CHECK:STDERR: · ╰───────────┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_duplicate_field_name_shorthand.carbon:[[@LINE+8]]:13 @@ -288,15 +288,12 @@ class C { library "[[@TEST_NAME]]"; //@dump-sem-ir-begin -// CHECK:STDERR: ╭─┤ fail_incorrect_field_type.carbon:[[@LINE+11]]:20 +// CHECK:STDERR: ╭─┤ fail_incorrect_field_type.carbon:[[@LINE+8]]:20 // CHECK:STDERR: -> │ let {.a = x: ()} = {.a = {}}; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `{}` -// CHECK:STDERR: · │ ┃ to `()` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `{}` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(())` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ to `()` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let {.a = x: ()} = {.a = {}}; @@ -306,15 +303,12 @@ let {.a = x: ()} = {.a = {}}; library "[[@TEST_NAME]]"; //@dump-sem-ir-begin -// CHECK:STDERR: ╭─┤ fail_incorrect_scrutinee_type.carbon:[[@LINE+11]]:5 +// CHECK:STDERR: ╭─┤ fail_incorrect_scrutinee_type.carbon:[[@LINE+8]]:5 // CHECK:STDERR: -> │ let {.a = x: ()} = ((), ()); // CHECK:STDERR: · ┳━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `((), ())` to -// CHECK:STDERR: · │ ┃ `{.a: ()}` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `((), ())` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs({.a: ()})` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `{.a: ()}` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let {.a = x: ()} = ((), ()); @@ -1388,15 +1382,15 @@ let {.a = x: ()} = ((), ()); // CHECK:STDOUT: file { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = value_binding_pattern x [concrete = constants.%x.patt] -// CHECK:STDOUT: %.loc15: %pattern_type.e85 = struct_pattern (%x.patt) [concrete = constants.%.298] +// CHECK:STDOUT: %.loc12: %pattern_type.e85 = struct_pattern (%x.patt) [concrete = constants.%.298] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15_27: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc15_28.1: %struct_type.a.225 = struct_literal (%.loc15_27) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc15_28.2: %empty_tuple.type = converted %.loc15_27, [concrete = ] +// CHECK:STDOUT: %.loc12_27: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc12_28.1: %struct_type.a.225 = struct_literal (%.loc12_27) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc12_28.2: %empty_tuple.type = converted %.loc12_27, [concrete = ] // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1418,16 +1412,16 @@ let {.a = x: ()} = ((), ()); // CHECK:STDOUT: file { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = value_binding_pattern x [concrete = constants.%x.patt] -// CHECK:STDOUT: %.loc15: %pattern_type.e85 = struct_pattern (%x.patt) [concrete = constants.%.298] +// CHECK:STDOUT: %.loc12: %pattern_type.e85 = struct_pattern (%x.patt) [concrete = constants.%.298] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15_22: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc15_26: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc15_27: %tuple.type = tuple_literal (%.loc15_22, %.loc15_26) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc15_16: %struct_type.a = converted %.loc15_27, [concrete = ] +// CHECK:STDOUT: %.loc12_22: %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_27: %tuple.type = tuple_literal (%.loc12_22, %.loc12_26) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc12_16: %struct_type.a = converted %.loc12_27, [concrete = ] // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/patterns/underscore.carbon b/toolchain/check/testdata/patterns/underscore.carbon index 6b4c49c070d5..c3ceb9b5aa36 100644 --- a/toolchain/check/testdata/patterns/underscore.carbon +++ b/toolchain/check/testdata/patterns/underscore.carbon @@ -56,11 +56,10 @@ library "[[@TEST_NAME]]"; fn F(generic _: type); fn G() { - // CHECK:STDERR: ╭─┤ fail_function_generic_undefined.carbon:[[@LINE+12]]:3 + // CHECK:STDERR: ╭─┤ fail_function_generic_undefined.carbon:[[@LINE+11]]:3 // CHECK:STDERR: │ fn F(generic _: type); - // CHECK:STDERR: · ───────────┬────────── - // CHECK:STDERR: · ╰──┤ generic function declared here - // CHECK:STDERR: · │ [MissingGenericFunctionDefinitionHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ generic function declared here [MissingGenericFunctionDefinitionHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ F({}); // CHECK:STDERR: · ┳ @@ -448,8 +447,8 @@ fn F() -> {} { // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %.loc19_6: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc19_7: type = converted %.loc19_6, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc18_6: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc18_7: type = converted %.loc18_6, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%empty_struct_type) [concrete = constants.%F.specific_fn] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn() // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/patterns/unused.carbon b/toolchain/check/testdata/patterns/unused.carbon index ee1094f14569..efb9a554269e 100644 --- a/toolchain/check/testdata/patterns/unused.carbon +++ b/toolchain/check/testdata/patterns/unused.carbon @@ -127,7 +127,7 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: ╭─┤ fail_read_from_param_unused_ref.carbon:[[@LINE+10]]:26 // CHECK:STDERR: -> │ fn RefParamUnused(unused ref y: i32) { // CHECK:STDERR: · ━━━━━┳━━━━ -// CHECK:STDERR: · ┗━━┫ error: variable `y` marked `unused` but used +// CHECK:STDERR: · ┗━━┫ error: binding `y` marked `unused` but used // CHECK:STDERR: · ┃ [UnusedButUsed] // CHECK:STDERR: │ var _: i32 = y; // CHECK:STDERR: · ┬ @@ -142,12 +142,11 @@ fn RefParamUnused(unused ref y: i32) { library "[[@TEST_NAME]]"; fn F() -> i32 { - // CHECK:STDERR: ╭─┤ fail_unused_returned_var.carbon:[[@LINE+8]]:23 + // CHECK:STDERR: ╭─┤ fail_unused_returned_var.carbon:[[@LINE+7]]:23 // CHECK:STDERR: -> │ returned var unused x: i32 = 0; // CHECK:STDERR: · ━━━┳━━ - // CHECK:STDERR: · ┗━━┫ error: variable `x` marked `unused` but used - // CHECK:STDERR: · │ ┃ [UnusedButUsed] - // CHECK:STDERR: · ╰────┤ usage here [UnusedButUsedHere] + // CHECK:STDERR: · ┗━━┫ error: binding `x` marked `unused` but used + // CHECK:STDERR: · ┃ [UnusedButUsed] // CHECK:STDERR: ╰──── // CHECK:STDERR: returned var unused x: i32 = 0; @@ -159,11 +158,10 @@ library "[[@TEST_NAME]]"; fn F(x: i32) { var _: i32 = x; - // CHECK:STDERR: ╭─┤ fail_read_from_unused_local_var.carbon:[[@LINE+10]]:14 + // CHECK:STDERR: ╭─┤ fail_read_from_unused_local_var.carbon:[[@LINE+9]]:14 // CHECK:STDERR: -> │ var unused y: i32 = x; // CHECK:STDERR: · ━━━┳━━ - // CHECK:STDERR: · ┗━━┫ error: variable `y` marked `unused` but used - // CHECK:STDERR: · ┃ [UnusedButUsed] + // CHECK:STDERR: · ┗━━┫ error: binding `y` marked `unused` but used [UnusedButUsed] // CHECK:STDERR: │ var unused z: i32 = y; // CHECK:STDERR: · ┬ // CHECK:STDERR: · ╰──┤ usage here [UnusedButUsedHere] @@ -257,11 +255,10 @@ class C { library "[[@TEST_NAME]]"; fn F() { - // CHECK:STDERR: ╭─┤ fail_multiple_uses_of_unused.carbon:[[@LINE+10]]:14 + // CHECK:STDERR: ╭─┤ fail_multiple_uses_of_unused.carbon:[[@LINE+9]]:14 // CHECK:STDERR: -> │ var unused x: i32 = 0; // CHECK:STDERR: · ━━━┳━━ - // CHECK:STDERR: · ┗━━┫ error: variable `x` marked `unused` but used - // CHECK:STDERR: · ┃ [UnusedButUsed] + // CHECK:STDERR: · ┗━━┫ error: binding `x` marked `unused` but used [UnusedButUsed] // CHECK:STDERR: │ x; // CHECK:STDERR: · ┬ // CHECK:STDERR: · ╰──┤ usage here [UnusedButUsedHere] @@ -344,11 +341,10 @@ class C(unused T: type) {} library "[[@TEST_NAME]]"; fn F() { - // CHECK:STDERR: ╭─┤ fail_unused_let_multiple_uses.carbon:[[@LINE+11]]:14 + // CHECK:STDERR: ╭─┤ fail_unused_let_multiple_uses.carbon:[[@LINE+10]]:14 // CHECK:STDERR: -> │ let unused x: i32 = 0; // CHECK:STDERR: · ━━━┳━━ - // CHECK:STDERR: · ┗━━┫ error: variable `x` marked `unused` but used - // CHECK:STDERR: · ┃ [UnusedButUsed] + // CHECK:STDERR: · ┗━━┫ error: binding `x` marked `unused` but used [UnusedButUsed] // CHECK:STDERR: ┆ // CHECK:STDERR: │ var y: i32 = x; // CHECK:STDERR: · ┬ @@ -396,11 +392,10 @@ fn F() { library "[[@TEST_NAME]]"; fn F() -> i32 { - // CHECK:STDERR: ╭─┤ fail_unused_tuple.carbon:[[@LINE+11]]:14 + // CHECK:STDERR: ╭─┤ fail_unused_tuple.carbon:[[@LINE+10]]:14 // CHECK:STDERR: -> │ let unused (a: i32, // CHECK:STDERR: · ━━━┳━━ - // CHECK:STDERR: · ┗━━┫ error: variable `a` marked `unused` but used - // CHECK:STDERR: · ┃ [UnusedButUsed] + // CHECK:STDERR: · ┗━━┫ error: binding `a` marked `unused` but used [UnusedButUsed] // CHECK:STDERR: ┆ // CHECK:STDERR: │ let i: i32 = a; // CHECK:STDERR: · ┬ @@ -408,11 +403,10 @@ fn F() -> i32 { // CHECK:STDERR: ╰──── // CHECK:STDERR: let unused (a: i32, - // CHECK:STDERR: ╭─┤ fail_unused_tuple.carbon:[[@LINE+11]]:14 + // CHECK:STDERR: ╭─┤ fail_unused_tuple.carbon:[[@LINE+10]]:14 // CHECK:STDERR: -> │ b: i32) = (1, 2); // CHECK:STDERR: · ━━━┳━━ - // CHECK:STDERR: · ┗━━┫ error: variable `b` marked `unused` but used - // CHECK:STDERR: · ┃ [UnusedButUsed] + // CHECK:STDERR: · ┗━━┫ error: binding `b` marked `unused` but used [UnusedButUsed] // CHECK:STDERR: │ let i: i32 = a; // CHECK:STDERR: │ let unused j: i32 = b; // CHECK:STDERR: · ┬ diff --git a/toolchain/check/testdata/pointer/convert_qualifiers.carbon b/toolchain/check/testdata/pointer/convert_qualifiers.carbon index 899a2f73d684..275c811f1128 100644 --- a/toolchain/check/testdata/pointer/convert_qualifiers.carbon +++ b/toolchain/check/testdata/pointer/convert_qualifiers.carbon @@ -47,7 +47,7 @@ class X {} fn TakeNonConst(p: X*); -// CHECK:STDERR: ╭─┤ fail_removed_qualifiers.carbon:[[@LINE+16]]:38 +// CHECK:STDERR: ╭─┤ fail_removed_qualifiers.carbon:[[@LINE+13]]:38 // CHECK:STDERR: │ fn TakeNonConst(p: X*); // CHECK:STDERR: · ──┬── // CHECK:STDERR: · ╰──┤ initializing function parameter [InCallToFunctionParam] @@ -55,12 +55,9 @@ fn TakeNonConst(p: X*); // CHECK:STDERR: -> │ fn Const(p: const X*) { TakeNonConst(p); } // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert -// CHECK:STDERR: · │ ┃ expression of type `const X*` -// CHECK:STDERR: · │ ┃ to `X*` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `const X*` does not implement -// CHECK:STDERR: · │ interface `Core.ImplicitAs(X*)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ expression of type `const X*` +// CHECK:STDERR: · ┃ to `X*` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn Const(p: const X*) { TakeNonConst(p); } @@ -77,7 +74,7 @@ fn TakeConstConst(p: const (const X*)*); fn NonConstNonConst(p: X**) { //@dump-sem-ir-begin - // CHECK:STDERR: ╭─┤ fail_todo_nested_qualifiers.carbon:[[@LINE+16]]:18 + // CHECK:STDERR: ╭─┤ fail_todo_nested_qualifiers.carbon:[[@LINE+13]]:18 // CHECK:STDERR: │ fn TakeConstConst(p: const (const X*)*); // CHECK:STDERR: · ──────────┬───────── // CHECK:STDERR: · ╰──┤ initializing function parameter @@ -86,11 +83,8 @@ fn NonConstNonConst(p: X**) { // CHECK:STDERR: -> │ TakeConstConst(p); // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `X**` - // CHECK:STDERR: · │ ┃ to `const (const X*)*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `X**` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(const (const X*)*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `const (const X*)*` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: TakeConstConst(p); @@ -99,7 +93,7 @@ fn NonConstNonConst(p: X**) { fn ConstNonConst(p: const (X*)*) { //@dump-sem-ir-begin - // CHECK:STDERR: ╭─┤ fail_todo_nested_qualifiers.carbon:[[@LINE+16]]:18 + // CHECK:STDERR: ╭─┤ fail_todo_nested_qualifiers.carbon:[[@LINE+13]]:18 // CHECK:STDERR: │ fn TakeConstConst(p: const (const X*)*); // CHECK:STDERR: · ──────────┬───────── // CHECK:STDERR: · ╰──┤ initializing function parameter @@ -108,11 +102,8 @@ fn ConstNonConst(p: const (X*)*) { // CHECK:STDERR: -> │ TakeConstConst(p); // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type - // CHECK:STDERR: · │ ┃ `const (X*)*` to `const (const X*)*` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `const (X*)*` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(const (const X*)*)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `const (X*)*` to `const (const X*)*` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: TakeConstConst(p); @@ -127,7 +118,7 @@ class X {} fn TakeNonConstConst(p: (const X*)*); -// CHECK:STDERR: ╭─┤ fail_nested_added_qualifiers.carbon:[[@LINE+18]]:49 +// CHECK:STDERR: ╭─┤ fail_nested_added_qualifiers.carbon:[[@LINE+15]]:49 // CHECK:STDERR: │ fn TakeNonConstConst(p: (const X*)*); // CHECK:STDERR: · ───────┬────── // CHECK:STDERR: · ╰──┤ initializing function parameter @@ -136,13 +127,10 @@ fn TakeNonConstConst(p: (const X*)*); // CHECK:STDERR: -> │ fn NonConstNonConst(p: X**) { TakeNonConstConst(p); } // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly -// CHECK:STDERR: · │ ┃ convert expression -// CHECK:STDERR: · │ ┃ of type `X**` to -// CHECK:STDERR: · │ ┃ `const X**` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╭───────────────────────────────────────────────╯ -// CHECK:STDERR: · │ type `X**` does not implement interface `Core.ImplicitAs(const X**)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ convert expression +// CHECK:STDERR: · ┃ of type `X**` to +// CHECK:STDERR: · ┃ `const X**` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn NonConstNonConst(p: X**) { TakeNonConstConst(p); } @@ -220,7 +208,7 @@ fn NonConstNonConst(p: X**) { TakeNonConstConst(p); } // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TakeConstConst.ref: %TakeConstConst.type = name_ref TakeConstConst, file.%TakeConstConst.decl [concrete = constants.%TakeConstConst] // CHECK:STDOUT: %p.ref: %ptr.9ae = name_ref p, %p -// CHECK:STDOUT: %.loc28: %ptr.b53 = converted %p.ref, [concrete = ] +// CHECK:STDOUT: %.loc25: %ptr.b53 = converted %p.ref, [concrete = ] // CHECK:STDOUT: %TakeConstConst.call: init %empty_tuple.type = call %TakeConstConst.ref() // CHECK:STDOUT: // CHECK:STDOUT: } @@ -229,7 +217,7 @@ fn NonConstNonConst(p: X**) { TakeNonConstConst(p); } // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TakeConstConst.ref: %TakeConstConst.type = name_ref TakeConstConst, file.%TakeConstConst.decl [concrete = constants.%TakeConstConst] // CHECK:STDOUT: %p.ref: %ptr.060 = name_ref p, %p -// CHECK:STDOUT: %.loc50: %ptr.b53 = converted %p.ref, [concrete = ] +// CHECK:STDOUT: %.loc44: %ptr.b53 = converted %p.ref, [concrete = ] // CHECK:STDOUT: %TakeConstConst.call: init %empty_tuple.type = call %TakeConstConst.ref() // CHECK:STDOUT: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/fail_address_of_error.carbon b/toolchain/check/testdata/pointer/fail_address_of_error.carbon index dd2ce3fd74c6..87779a390852 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_error.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_error.carbon @@ -28,7 +28,7 @@ fn Test() { // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_address_of_error.carbon:[[@LINE+6]]:3 // CHECK:STDERR: -> │ &(&undeclared); - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ┳ ━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: ╰──── // CHECK:STDERR: diff --git a/toolchain/check/testdata/pointer/fail_address_of_value.carbon b/toolchain/check/testdata/pointer/fail_address_of_value.carbon index f8bfd6145f84..eb4b1a42d80d 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_value.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_value.carbon @@ -17,42 +17,42 @@ fn H() -> {.a: i32}; fn AddressOfLiteral() { // CHECK:STDERR: ╭─┤ fail_address_of_value.carbon:[[@LINE+6]]:3 // CHECK:STDERR: -> │ &0; - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ╻╺ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: ╰──── // CHECK:STDERR: &0; // CHECK:STDERR: ╭─┤ fail_address_of_value.carbon:[[@LINE+6]]:3 // CHECK:STDERR: -> │ &true; - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ╻╺━━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: ╰──── // CHECK:STDERR: &true; // CHECK:STDERR: ╭─┤ fail_address_of_value.carbon:[[@LINE+6]]:3 // CHECK:STDERR: -> │ &1.0; - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ╻╺━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: ╰──── // CHECK:STDERR: &1.0; // CHECK:STDERR: ╭─┤ fail_address_of_value.carbon:[[@LINE+6]]:3 // CHECK:STDERR: -> │ &"Hello"; - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ╻╺━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: ╰──── // CHECK:STDERR: &"Hello"; // CHECK:STDERR: ╭─┤ fail_address_of_value.carbon:[[@LINE+6]]:3 // CHECK:STDERR: -> │ &(1, 2); - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ╻╺━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: ╰──── // CHECK:STDERR: &(1, 2); // CHECK:STDERR: ╭─┤ fail_address_of_value.carbon:[[@LINE+6]]:3 // CHECK:STDERR: -> │ &{.a = 5}; - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ╻╺━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: ╰──── // CHECK:STDERR: @@ -62,21 +62,21 @@ fn AddressOfLiteral() { fn AddressOfOperator() { // CHECK:STDERR: ╭─┤ fail_address_of_value.carbon:[[@LINE+6]]:3 // CHECK:STDERR: -> │ &(true and false); - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ┳ ━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: ╰──── // CHECK:STDERR: &(true and false); // CHECK:STDERR: ╭─┤ fail_address_of_value.carbon:[[@LINE+6]]:3 // CHECK:STDERR: -> │ &H().a; - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ╻╺━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: ╰──── // CHECK:STDERR: &H().a; // CHECK:STDERR: ╭─┤ fail_address_of_value.carbon:[[@LINE+6]]:3 // CHECK:STDERR: -> │ &(not true); - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ┳ ━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: ╰──── // CHECK:STDERR: @@ -86,7 +86,7 @@ fn AddressOfOperator() { fn AddressOfCall() { // CHECK:STDERR: ╭─┤ fail_address_of_value.carbon:[[@LINE+6]]:3 // CHECK:STDERR: -> │ &G(); - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ╻╺━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: ╰──── // CHECK:STDERR: @@ -96,14 +96,14 @@ fn AddressOfCall() { fn AddressOfType() { // CHECK:STDERR: ╭─┤ fail_address_of_value.carbon:[[@LINE+6]]:3 // CHECK:STDERR: -> │ &i32; - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ╻╺━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: ╰──── // CHECK:STDERR: &i32; // CHECK:STDERR: ╭─┤ fail_address_of_value.carbon:[[@LINE+6]]:3 // CHECK:STDERR: -> │ &(const i32*); - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ┳ ━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: ╰──── // CHECK:STDERR: @@ -113,7 +113,7 @@ fn AddressOfType() { fn AddressOfTupleElementValue() { // CHECK:STDERR: ╭─┤ fail_address_of_value.carbon:[[@LINE+6]]:3 // CHECK:STDERR: -> │ &((1, 2).0); - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ┳ ━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: ╰──── // CHECK:STDERR: @@ -123,7 +123,7 @@ fn AddressOfTupleElementValue() { fn AddressOfParam(param: i32) { // CHECK:STDERR: ╭─┤ fail_address_of_value.carbon:[[@LINE+8]]:33 // CHECK:STDERR: -> │ var unused param_addr: i32* = ¶m; - // CHECK:STDERR: · ┳ + // CHECK:STDERR: · ╻╺━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot take the address of // CHECK:STDERR: · ┃ non-reference expression // CHECK:STDERR: · ┃ [AddrOfNonRef] diff --git a/toolchain/check/testdata/pointer/fail_deref_type.carbon b/toolchain/check/testdata/pointer/fail_deref_type.carbon index 10420dbbdcb2..47f13b5a9352 100644 --- a/toolchain/check/testdata/pointer/fail_deref_type.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_type.carbon @@ -12,13 +12,12 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/pointer/fail_deref_type.carbon -// CHECK:STDERR: ╭─┤ fail_deref_type.carbon:[[@LINE+9]]:8 +// CHECK:STDERR: ╭─┤ fail_deref_type.carbon:[[@LINE+8]]:8 // CHECK:STDERR: -> │ var p: *i32; // CHECK:STDERR: · ┳ -// CHECK:STDERR: · ┗━━┫ error: cannot dereference operand of non-pointer type `type` -// CHECK:STDERR: · │ ┃ [DerefOfNonPointer] -// CHECK:STDERR: · ╰────┤ to form a pointer type, write the `*` after the pointee type -// CHECK:STDERR: · │ [DerefOfType] +// CHECK:STDERR: · ┗━━┫ error: cannot dereference a type; to form a pointer type, write the +// CHECK:STDERR: · ┃ `*` after the pointee type +// CHECK:STDERR: · ┃ [DerefOfType] // CHECK:STDERR: ╰──── // CHECK:STDERR: var p: *i32; @@ -59,8 +58,8 @@ var p2: i32->foo; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %p.var: ref = var_storage %p.var_patt [concrete = ] // CHECK:STDOUT: %.1: = splice_block [concrete = ] { -// CHECK:STDOUT: %i32.loc24: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc24: ref = deref %i32.loc24 [concrete = ] +// CHECK:STDOUT: %i32.loc23: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %.loc23: ref = deref %i32.loc23 [concrete = ] // CHECK:STDOUT: } // CHECK:STDOUT: %p: = wrapper_binding p, [concrete = ] // CHECK:STDOUT: name_binding_decl { @@ -69,8 +68,8 @@ var p2: i32->foo; // CHECK:STDOUT: } // CHECK:STDOUT: %p2.var: ref = var_storage %p2.var_patt [concrete = ] // CHECK:STDOUT: %.2: = splice_block [concrete = ] { -// CHECK:STDOUT: %i32.loc32: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc32: ref = deref %i32.loc32 [concrete = ] +// CHECK:STDOUT: %i32.loc31: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %.loc31: ref = deref %i32.loc31 [concrete = ] // CHECK:STDOUT: %foo.ref: = name_ref foo, [concrete = ] // CHECK:STDOUT: } // CHECK:STDOUT: %p2: = wrapper_binding p2, [concrete = ] diff --git a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon index a51c182d8ce1..871d13e295d5 100644 --- a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon @@ -13,15 +13,12 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/pointer/fail_type_mismatch.carbon fn ConstMismatch(p: const {}*) -> const ({}*) { - // CHECK:STDERR: ╭─┤ fail_type_mismatch.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_type_mismatch.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return p; // CHECK:STDERR: · ┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `const {}*` to - // CHECK:STDERR: · │ ┃ `const ({}*)` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `const {}*` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(const ({}*))` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `const ({}*)` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return p; @@ -92,7 +89,7 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: fn @ConstMismatch(%p.param: %ptr.bf9) -> out %return.param: %const.987 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.bf9 = name_ref p, %p -// CHECK:STDOUT: %.loc27: %const.987 = converted %p.ref, [concrete = ] +// CHECK:STDOUT: %.loc24: %const.987 = converted %p.ref, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/primitives/float_conversions.carbon b/toolchain/check/testdata/primitives/float_conversions.carbon index 6d05e85c64fd..a6cd78e10933 100644 --- a/toolchain/check/testdata/primitives/float_conversions.carbon +++ b/toolchain/check/testdata/primitives/float_conversions.carbon @@ -107,27 +107,22 @@ import library "test_helpers"; fn F(f: f32) { // Lossy explicit conversion using `as` not permitted. - // CHECK:STDERR: ╭─┤ fail_float_as_int.carbon:[[@LINE+11]]:16 + // CHECK:STDERR: ╭─┤ fail_float_as_int.carbon:[[@LINE+8]]:16 // CHECK:STDERR: -> │ let _: i32 = 12.34 as i32; // CHECK:STDERR: · ┳━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `Core.FloatLiteral` - // CHECK:STDERR: · │ ┃ to `i32` with `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.FloatLiteral` does not implement interface - // CHECK:STDERR: · │ `Core.As(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `i32` with `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: i32 = 12.34 as i32; - // CHECK:STDERR: ╭─┤ fail_float_as_int.carbon:[[@LINE+10]]:16 + // CHECK:STDERR: ╭─┤ fail_float_as_int.carbon:[[@LINE+8]]:16 // CHECK:STDERR: -> │ let _: i32 = f as i32; // CHECK:STDERR: · ┳━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `f32` to `i32` with - // CHECK:STDERR: · │ ┃ `as` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `f32` does not implement interface `Core.As(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `as` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: i32 = f as i32; @@ -154,15 +149,12 @@ library "[[@TEST_NAME]]"; fn F(x: f64) { // Implicit narrowing conversion (f64 -> f32) is not permitted. - // CHECK:STDERR: ╭─┤ fail_float_to_float_narrowing.carbon:[[@LINE+11]]:16 + // CHECK:STDERR: ╭─┤ fail_float_to_float_narrowing.carbon:[[@LINE+8]]:16 // CHECK:STDERR: -> │ let _: f32 = x; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `f64` to - // CHECK:STDERR: · │ ┃ `f32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `f64` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(f32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `f32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: let _: f32 = x; diff --git a/toolchain/check/testdata/primitives/int_conversions.carbon b/toolchain/check/testdata/primitives/int_conversions.carbon index f3c479de32fc..e930e0379435 100644 --- a/toolchain/check/testdata/primitives/int_conversions.carbon +++ b/toolchain/check/testdata/primitives/int_conversions.carbon @@ -28,13 +28,11 @@ library "[[@TEST_NAME]]"; fn TestFailures() { var a: i64 = 1; - // CHECK:STDERR: ╭─┤ fail_narrow_i64_to_i32.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_narrow_i64_to_i32.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var unused b: i32 = a; // CHECK:STDERR: · ━━━━━━━┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `i64` to `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `i64` does not implement interface `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused b: i32 = a; @@ -46,13 +44,11 @@ library "[[@TEST_NAME]]"; fn TestFailures() { var w: u64 = 1; - // CHECK:STDERR: ╭─┤ fail_narrow_u64_to_u32.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_narrow_u64_to_u32.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var unused x: u32 = w; // CHECK:STDERR: · ━━━━━━━┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `u64` to `u32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `u64` does not implement interface `Core.ImplicitAs(u32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused x: u32 = w; @@ -88,7 +84,7 @@ library "[[@TEST_NAME]]"; fn TestCppCompat() { var a: Core.CppCompat.Long32 = 1; - // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_long32_to_i33.carbon:[[@LINE+18]]:17 + // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_long32_to_i33.carbon:[[@LINE+15]]:17 // CHECK:STDERR: -> │ var unused b: i33 = a; // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: bit width of integer type literal must be a multiple @@ -96,14 +92,11 @@ fn TestCppCompat() { // CHECK:STDERR: · ┃ [IntWidthNotMultipleOf8] // CHECK:STDERR: ╰──── // CHECK:STDERR: - // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_long32_to_i33.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_long32_to_i33.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var unused b: i33 = a; - // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ - // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Long32` to `i33` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.CppCompat.Long32` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i33)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ━━━━┳━━━━━━━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Long32` to `i33` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused b: i33 = a; @@ -115,7 +108,7 @@ library "[[@TEST_NAME]]"; fn TestCppCompat() { var c: Core.CppCompat.Long64 = 1; - // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_long64_to_i65.carbon:[[@LINE+18]]:17 + // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_long64_to_i65.carbon:[[@LINE+15]]:17 // CHECK:STDERR: -> │ var unused d: i65 = c; // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: bit width of integer type literal must be a multiple @@ -123,14 +116,11 @@ fn TestCppCompat() { // CHECK:STDERR: · ┃ [IntWidthNotMultipleOf8] // CHECK:STDERR: ╰──── // CHECK:STDERR: - // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_long64_to_i65.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_long64_to_i65.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var unused d: i65 = c; - // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ - // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Long64` to `i65` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.CppCompat.Long64` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i65)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ━━━━┳━━━━━━━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Long64` to `i65` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused d: i65 = c; @@ -142,7 +132,7 @@ library "[[@TEST_NAME]]"; fn TestCppCompat() { var e: Core.CppCompat.LongLong64 = 1; - // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_longlong64_to_i65.carbon:[[@LINE+18]]:17 + // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_longlong64_to_i65.carbon:[[@LINE+15]]:17 // CHECK:STDERR: -> │ var unused f: i65 = e; // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: bit width of integer type literal must be a multiple @@ -150,14 +140,11 @@ fn TestCppCompat() { // CHECK:STDERR: · ┃ [IntWidthNotMultipleOf8] // CHECK:STDERR: ╰──── // CHECK:STDERR: - // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_longlong64_to_i65.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_longlong64_to_i65.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var unused f: i65 = e; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `LongLong64` to `i65` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.CppCompat.LongLong64` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i65)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused f: i65 = e; @@ -169,7 +156,7 @@ library "[[@TEST_NAME]]"; fn TestCppCompat() { var g: Core.CppCompat.ULong32 = 1; - // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_ulong32_to_u33.carbon:[[@LINE+18]]:17 + // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_ulong32_to_u33.carbon:[[@LINE+15]]:17 // CHECK:STDERR: -> │ var unused h: u33 = g; // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: bit width of integer type literal must be a multiple @@ -177,14 +164,11 @@ fn TestCppCompat() { // CHECK:STDERR: · ┃ [IntWidthNotMultipleOf8] // CHECK:STDERR: ╰──── // CHECK:STDERR: - // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_ulong32_to_u33.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_ulong32_to_u33.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var unused h: u33 = g; - // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ - // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `ULong32` to `u33` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.CppCompat.ULong32` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(u33)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ━━━┳━━━━━━━━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `ULong32` to `u33` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused h: u33 = g; @@ -196,7 +180,7 @@ library "[[@TEST_NAME]]"; fn TestCppCompat() { var i: Core.CppCompat.ULong64 = 1; - // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_ulong64_to_u65.carbon:[[@LINE+18]]:17 + // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_ulong64_to_u65.carbon:[[@LINE+15]]:17 // CHECK:STDERR: -> │ var unused j: u65 = i; // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: bit width of integer type literal must be a multiple @@ -204,14 +188,11 @@ fn TestCppCompat() { // CHECK:STDERR: · ┃ [IntWidthNotMultipleOf8] // CHECK:STDERR: ╰──── // CHECK:STDERR: - // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_ulong64_to_u65.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_ulong64_to_u65.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var unused j: u65 = i; - // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ - // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `ULong64` to `u65` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.CppCompat.ULong64` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(u65)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ━━━┳━━━━━━━━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `ULong64` to `u65` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused j: u65 = i; @@ -223,7 +204,7 @@ library "[[@TEST_NAME]]"; fn TestCppCompat() { var k: Core.CppCompat.ULongLong64 = 1; - // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_ulonglong64_to_u65.carbon:[[@LINE+19]]:17 + // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_ulonglong64_to_u65.carbon:[[@LINE+16]]:17 // CHECK:STDERR: -> │ var unused l: u65 = k; // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: bit width of integer type literal must be a multiple @@ -231,15 +212,12 @@ fn TestCppCompat() { // CHECK:STDERR: · ┃ [IntWidthNotMultipleOf8] // CHECK:STDERR: ╰──── // CHECK:STDERR: - // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_ulonglong64_to_u65.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_todo_cpp_compat_widen_ulonglong64_to_u65.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ var unused l: u65 = k; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `ULongLong64` to - // CHECK:STDERR: · │ ┃ `u65` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.CppCompat.ULongLong64` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(u65)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `u65` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused l: u65 = k; @@ -252,14 +230,11 @@ library "[[@TEST_NAME]]"; fn TestCppCompat() { // Long32 is slightly wider than i32. var a: Core.CppCompat.Long32 = 1; - // CHECK:STDERR: ╭─┤ fail_cpp_compat_narrow_long32_to_i32.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_cpp_compat_narrow_long32_to_i32.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var unused b: i32 = a; - // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ - // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Long32` to `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.CppCompat.Long32` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ━━━━┳━━━━━━━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Long32` to `i32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused b: i32 = a; @@ -272,15 +247,12 @@ library "[[@TEST_NAME]]"; fn TestCppCompat() { // i64 is slightly wider than Long64. var c: i64 = 1; - // CHECK:STDERR: ╭─┤ fail_cpp_compat_narrow_i64_to_long64.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_cpp_compat_narrow_i64_to_long64.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ var unused d: Core.CppCompat.Long64 = c; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `i64` to - // CHECK:STDERR: · │ ┃ `Core.CppCompat.Long64` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `i64` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Core.CppCompat.Long64)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Core.CppCompat.Long64` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused d: Core.CppCompat.Long64 = c; @@ -293,14 +265,11 @@ library "[[@TEST_NAME]]"; fn TestCppCompat() { // LongLong64 is slightly wider than i64. var e: Core.CppCompat.LongLong64 = 1; - // CHECK:STDERR: ╭─┤ fail_cpp_compat_narrow_longlong64_to_i64.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_cpp_compat_narrow_longlong64_to_i64.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var unused f: i64 = e; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `LongLong64` to `i64` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.CppCompat.LongLong64` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i64)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused f: i64 = e; @@ -313,14 +282,11 @@ library "[[@TEST_NAME]]"; fn TestCppCompat() { // ULong32 is slightly wider than u32. var g: Core.CppCompat.ULong32 = 1; - // CHECK:STDERR: ╭─┤ fail_cpp_compat_narrow_ulong32_to_u32.carbon:[[@LINE+10]]:3 + // CHECK:STDERR: ╭─┤ fail_cpp_compat_narrow_ulong32_to_u32.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var unused h: u32 = g; - // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ - // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `ULong32` to `u32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.CppCompat.ULong32` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(u32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ━━━┳━━━━━━━━━━━━━ + // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `ULong32` to `u32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused h: u32 = g; @@ -333,15 +299,12 @@ library "[[@TEST_NAME]]"; fn TestCppCompat() { // u64 is slightly wider than ULong64. var i: u64 = 1; - // CHECK:STDERR: ╭─┤ fail_cpp_compat_narrow_u64_to_ulong64.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_cpp_compat_narrow_u64_to_ulong64.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ var unused j: Core.CppCompat.ULong64 = i; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `u64` to - // CHECK:STDERR: · │ ┃ `Core.CppCompat.ULong64` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `u64` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(Core.CppCompat.ULong64)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Core.CppCompat.ULong64` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused j: Core.CppCompat.ULong64 = i; @@ -354,15 +317,12 @@ library "[[@TEST_NAME]]"; fn TestCppCompat() { // ULongLong64 is slightly wider than u64. var k: Core.CppCompat.ULongLong64 = 1; - // CHECK:STDERR: ╭─┤ fail_cpp_compat_narrow_ulonglong64_to_u64.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_cpp_compat_narrow_ulonglong64_to_u64.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ var unused l: u64 = k; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `ULongLong64` to - // CHECK:STDERR: · │ ┃ `u64` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.CppCompat.ULongLong64` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(u64)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `u64` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused l: u64 = k; @@ -383,13 +343,11 @@ library "[[@TEST_NAME]]"; fn TestMixedSign() { var a: i32 = 1; - // CHECK:STDERR: ╭─┤ fail_narrow_sign_change_i32_to_u32.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_narrow_sign_change_i32_to_u32.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var unused b: u32 = a; // CHECK:STDERR: · ━━━━━━━┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `i32` to `u32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `i32` does not implement interface `Core.ImplicitAs(u32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused b: u32 = a; @@ -401,13 +359,11 @@ library "[[@TEST_NAME]]"; fn TestMixedSign() { var c: u32 = 1; - // CHECK:STDERR: ╭─┤ fail_narrow_sign_change_u32_to_i32.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_narrow_sign_change_u32_to_i32.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var unused d: i32 = c; // CHECK:STDERR: · ━━━━━━━┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `u32` to `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `u32` does not implement interface `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused d: i32 = c; @@ -419,13 +375,11 @@ library "[[@TEST_NAME]]"; fn TestMixedSign() { var g: i32 = 1; - // CHECK:STDERR: ╭─┤ fail_narrow_sign_change_i32_to_u64.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_narrow_sign_change_i32_to_u64.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var unused h: u64 = g; // CHECK:STDERR: · ━━━━━━━┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `i32` to `u64` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `i32` does not implement interface `Core.ImplicitAs(u64)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused h: u64 = g; @@ -451,13 +405,11 @@ library "[[@TEST_NAME]]"; fn TestArbitraryWidth() { var a: Core.Int(33) = 1; - // CHECK:STDERR: ╭─┤ fail_narrow_arbitrary_width_i33_to_i32.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_narrow_arbitrary_width_i33_to_i32.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var unused b: Core.Int(32) = a; // CHECK:STDERR: · ━━━━━━━┳━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `i33` to `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `i33` does not implement interface `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused b: Core.Int(32) = a; @@ -469,13 +421,11 @@ library "[[@TEST_NAME]]"; fn TestArbitraryWidth() { var d: Core.UInt(33) = 1; - // CHECK:STDERR: ╭─┤ fail_narrow_arbitrary_width_u33_to_u32.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_narrow_arbitrary_width_u33_to_u32.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var unused e: Core.UInt(32) = d; // CHECK:STDERR: · ━━━━━━━┳━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `u33` to `u32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `u33` does not implement interface `Core.ImplicitAs(u32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused e: Core.UInt(32) = d; @@ -487,13 +437,11 @@ library "[[@TEST_NAME]]"; fn TestArbitraryWidth() { var a: Core.Int(33) = 1; - // CHECK:STDERR: ╭─┤ fail_narrow_arbitrary_width_i33_to_u34.carbon:[[@LINE+9]]:3 + // CHECK:STDERR: ╭─┤ fail_narrow_arbitrary_width_i33_to_u34.carbon:[[@LINE+7]]:3 // CHECK:STDERR: -> │ var unused g: Core.UInt(34) = a; // CHECK:STDERR: · ━━━━━━━┳━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `i33` to `u34` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `i33` does not implement interface `Core.ImplicitAs(u34)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused g: Core.UInt(34) = a; diff --git a/toolchain/check/testdata/primitives/string_literals.carbon b/toolchain/check/testdata/primitives/string_literals.carbon index 8c28b2295ff8..c63aca2b01d6 100644 --- a/toolchain/check/testdata/primitives/string_literals.carbon +++ b/toolchain/check/testdata/primitives/string_literals.carbon @@ -69,8 +69,8 @@ fn F() { // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ incomplete_string.carbon // CHECK:STDERR: │ class String; - // CHECK:STDERR: · ──────┬────── - // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: · ───┬── + // CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: "hello"; diff --git a/toolchain/check/testdata/primitives/type_literals.carbon b/toolchain/check/testdata/primitives/type_literals.carbon index 42df60f1a611..cf06a5cefeec 100644 --- a/toolchain/check/testdata/primitives/type_literals.carbon +++ b/toolchain/check/testdata/primitives/type_literals.carbon @@ -101,7 +101,7 @@ var test_i15: i15; // CHECK:STDERR: ╰──── // CHECK:STDERR: var test_i4: i4; -// CHECK:STDERR: ╭─┤ fail_iN_bad_width.carbon:[[@LINE+8]]:15 +// CHECK:STDERR: ╭─┤ fail_iN_bad_width.carbon:[[@LINE+24]]:15 // CHECK:STDERR: -> │ var test_i12: i12; // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: bit width of integer type literal must be a multiple @@ -109,22 +109,23 @@ var test_i4: i4; // CHECK:STDERR: · ┃ [IntWidthNotMultipleOf8] // CHECK:STDERR: ╰──── // CHECK:STDERR: -var test_i12: i12; -// CHECK:STDERR: ╭─┤ fail_iN_bad_width.carbon:[[@LINE+15]]:23 -// CHECK:STDERR: -> │ var test_i1000000000: i1000000000; -// CHECK:STDERR: · ┳━━━━━━━━━━ -// CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type -// CHECK:STDERR: · ┃ `i1000000000` in name binding declaration -// CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] +// CHECK:STDERR: ╭─┤ min_prelude/parts/int.carbon:11:9 +// CHECK:STDERR: -> │ adapt MakeInt(N); +// CHECK:STDERR: · ┳━━━━━━━━━ +// CHECK:STDERR: · ┗━━┫ error: integer type width of 1000000000 is greater than the maximum +// CHECK:STDERR: · ┃ supported width of 8388608 +// CHECK:STDERR: · ┃ [IntWidthTooLarge] // CHECK:STDERR: ┆ -// CHECK:STDERR: ├─┤ min_prelude/parts/int.carbon -// CHECK:STDERR: │ adapt MakeInt(N); -// CHECK:STDERR: · ┬───────── -// CHECK:STDERR: · ╰──┤ integer type width of 1000000000 is greater than the maximum -// CHECK:STDERR: · │ supported width of 8388608 -// CHECK:STDERR: · │ [IntWidthTooLarge] +// CHECK:STDERR: ├─┤ fail_iN_bad_width.carbon +// CHECK:STDERR: │ var test_i1000000000: i1000000000; +// CHECK:STDERR: · ─────┬───── +// CHECK:STDERR: · ╰──┤ in monomorphization of `i1000000000` here +// CHECK:STDERR: · │ │ [ResolvingSpecificHere] +// CHECK:STDERR: · ╰────┤ in completion of type `i1000000000` here +// CHECK:STDERR: · │ [InTypeCompletion] // CHECK:STDERR: ╰──── // CHECK:STDERR: +var test_i12: i12; var test_i1000000000: i1000000000; // TODO: This diagnostic is not very good. // CHECK:STDERR: ╭─┤ fail_iN_bad_width.carbon:[[@LINE+16]]:33 @@ -182,7 +183,7 @@ var test_u15: u15; // CHECK:STDERR: ╰──── // CHECK:STDERR: var test_u4: u4; -// CHECK:STDERR: ╭─┤ fail_uN_bad_width.carbon:[[@LINE+8]]:15 +// CHECK:STDERR: ╭─┤ fail_uN_bad_width.carbon:[[@LINE+24]]:15 // CHECK:STDERR: -> │ var test_u12: u12; // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: bit width of integer type literal must be a multiple @@ -190,22 +191,23 @@ var test_u4: u4; // CHECK:STDERR: · ┃ [IntWidthNotMultipleOf8] // CHECK:STDERR: ╰──── // CHECK:STDERR: -var test_u12: u12; -// CHECK:STDERR: ╭─┤ fail_uN_bad_width.carbon:[[@LINE+15]]:23 -// CHECK:STDERR: -> │ var test_u1000000000: u1000000000; -// CHECK:STDERR: · ┳━━━━━━━━━━ -// CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type -// CHECK:STDERR: · ┃ `u1000000000` in name binding declaration -// CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] +// CHECK:STDERR: ╭─┤ min_prelude/parts/uint.carbon:11:9 +// CHECK:STDERR: -> │ adapt MakeUInt(N); +// CHECK:STDERR: · ┳━━━━━━━━━━ +// CHECK:STDERR: · ┗━━┫ error: integer type width of 1000000000 is greater than the maximum +// CHECK:STDERR: · ┃ supported width of 8388608 +// CHECK:STDERR: · ┃ [IntWidthTooLarge] // CHECK:STDERR: ┆ -// CHECK:STDERR: ├─┤ min_prelude/parts/uint.carbon -// CHECK:STDERR: │ adapt MakeUInt(N); -// CHECK:STDERR: · ┬────────── -// CHECK:STDERR: · ╰──┤ integer type width of 1000000000 is greater than the maximum -// CHECK:STDERR: · │ supported width of 8388608 -// CHECK:STDERR: · │ [IntWidthTooLarge] +// CHECK:STDERR: ├─┤ fail_uN_bad_width.carbon +// CHECK:STDERR: │ var test_u1000000000: u1000000000; +// CHECK:STDERR: · ─────┬───── +// CHECK:STDERR: · ╰──┤ in monomorphization of `u1000000000` here +// CHECK:STDERR: · │ │ [ResolvingSpecificHere] +// CHECK:STDERR: · ╰────┤ in completion of type `u1000000000` here +// CHECK:STDERR: · │ [InTypeCompletion] // CHECK:STDERR: ╰──── // CHECK:STDERR: +var test_u12: u12; var test_u1000000000: u1000000000; // TODO: This diagnostic is not very good. // CHECK:STDERR: ╭─┤ fail_uN_bad_width.carbon:[[@LINE+16]]:33 @@ -229,119 +231,113 @@ var test_u10000000000000000000: u10000000000000000000; // --- fail_fN_bad_width.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: ╭─┤ fail_fN_bad_width.carbon:[[@LINE+6]]:14 +// CHECK:STDERR: ╭─┤ fail_fN_bad_width.carbon:[[@LINE+88]]:14 // CHECK:STDERR: -> │ var test_f0: f0; // CHECK:STDERR: · ━┳ // CHECK:STDERR: · ┗━━┫ error: name `f0` not found [NameNotFound] // CHECK:STDERR: ╰──── // CHECK:STDERR: +// CHECK:STDERR: ╭─┤ min_prelude/parts/float.carbon:12:9 +// CHECK:STDERR: -> │ adapt MakeFloat(N); +// CHECK:STDERR: · ━━━━━━┳━━━━━ +// CHECK:STDERR: · ┗━━┫ error: unsupported floating-point bit width 1 +// CHECK:STDERR: · ┃ [CompileTimeFloatBitWidth] +// CHECK:STDERR: ┆ +// CHECK:STDERR: ├─┤ fail_fN_bad_width.carbon +// CHECK:STDERR: │ var test_f1: f1; +// CHECK:STDERR: · ─┬ +// CHECK:STDERR: · ╰──┤ in monomorphization of `f1` here [ResolvingSpecificHere] +// CHECK:STDERR: · ╰────┤ in completion of type `f1` here [InTypeCompletion] +// CHECK:STDERR: ╰──── +// CHECK:STDERR: +// CHECK:STDERR: ╭─┤ min_prelude/parts/float.carbon:12:9 +// CHECK:STDERR: -> │ adapt MakeFloat(N); +// CHECK:STDERR: · ━━━━━━┳━━━━━ +// CHECK:STDERR: · ┗━━┫ error: unsupported floating-point bit width 15 +// CHECK:STDERR: · ┃ [CompileTimeFloatBitWidth] +// CHECK:STDERR: ┆ +// CHECK:STDERR: ├─┤ fail_fN_bad_width.carbon +// CHECK:STDERR: │ var test_f15: f15; +// CHECK:STDERR: · ─┬─ +// CHECK:STDERR: · ╰──┤ in monomorphization of `f15` here [ResolvingSpecificHere] +// CHECK:STDERR: · ╰────┤ in completion of type `f15` here [InTypeCompletion] +// CHECK:STDERR: ╰──── +// CHECK:STDERR: +// CHECK:STDERR: ╭─┤ min_prelude/parts/float.carbon:12:9 +// CHECK:STDERR: -> │ adapt MakeFloat(N); +// CHECK:STDERR: · ━━━━━━┳━━━━━ +// CHECK:STDERR: · ┗━━┫ error: unsupported floating-point bit width 80 +// CHECK:STDERR: · ┃ [CompileTimeFloatBitWidth] +// CHECK:STDERR: ┆ +// CHECK:STDERR: ├─┤ fail_fN_bad_width.carbon +// CHECK:STDERR: │ var test_f80: f80; +// CHECK:STDERR: · ─┬─ +// CHECK:STDERR: · ╰──┤ in monomorphization of `f80` here [ResolvingSpecificHere] +// CHECK:STDERR: · ╰────┤ in completion of type `f80` here [InTypeCompletion] +// CHECK:STDERR: ╰──── +// CHECK:STDERR: +// CHECK:STDERR: ╭─┤ min_prelude/parts/float.carbon:12:9 +// CHECK:STDERR: -> │ adapt MakeFloat(N); +// CHECK:STDERR: · ━━━━━━┳━━━━━ +// CHECK:STDERR: · ┗━━┫ error: unsupported floating-point bit width 100 +// CHECK:STDERR: · ┃ [CompileTimeFloatBitWidth] +// CHECK:STDERR: ┆ +// CHECK:STDERR: ├─┤ fail_fN_bad_width.carbon +// CHECK:STDERR: │ var test_f100: f100; +// CHECK:STDERR: · ──┬─ +// CHECK:STDERR: · ╰──┤ in monomorphization of `f100` here [ResolvingSpecificHere] +// CHECK:STDERR: · ╰────┤ in completion of type `f100` here [InTypeCompletion] +// CHECK:STDERR: ╰──── +// CHECK:STDERR: +// CHECK:STDERR: ╭─┤ min_prelude/parts/float.carbon:12:9 +// CHECK:STDERR: -> │ adapt MakeFloat(N); +// CHECK:STDERR: · ━━━━━━┳━━━━━ +// CHECK:STDERR: · ┗━━┫ error: unsupported floating-point bit width 1000000000 +// CHECK:STDERR: · ┃ [CompileTimeFloatBitWidth] +// CHECK:STDERR: ┆ +// CHECK:STDERR: ├─┤ fail_fN_bad_width.carbon +// CHECK:STDERR: │ var test_f1000000000: f1000000000; +// CHECK:STDERR: · ─────┬───── +// CHECK:STDERR: · ╰──┤ in monomorphization of `f1000000000` here +// CHECK:STDERR: · │ │ [ResolvingSpecificHere] +// CHECK:STDERR: · ╰────┤ in completion of type `f1000000000` here +// CHECK:STDERR: · │ [InTypeCompletion] +// CHECK:STDERR: ╰──── +// CHECK:STDERR: +// CHECK:STDERR: ╭─┤ min_prelude/parts/float.carbon:12:9 +// CHECK:STDERR: -> │ adapt MakeFloat(N); +// CHECK:STDERR: · ━━━━━━┳━━━━━ +// CHECK:STDERR: · ┗━━┫ error: unsupported floating-point bit width 1000000000000 +// CHECK:STDERR: · ┃ [CompileTimeFloatBitWidth] +// CHECK:STDERR: ┆ +// CHECK:STDERR: ├─┤ fail_fN_bad_width.carbon +// CHECK:STDERR: │ var test_f1000000000000: f1000000000000; +// CHECK:STDERR: · ─────┬──────── +// CHECK:STDERR: · ╰──┤ in monomorphization of `f1000000000000` here +// CHECK:STDERR: · │ │ [ResolvingSpecificHere] +// CHECK:STDERR: · ╰────┤ in completion of type `f1000000000000` here +// CHECK:STDERR: · │ [InTypeCompletion] +// CHECK:STDERR: ╰──── +// CHECK:STDERR: var test_f0: f0; -// CHECK:STDERR: ╭─┤ fail_fN_bad_width.carbon:[[@LINE+14]]:14 -// CHECK:STDERR: -> │ var test_f1: f1; -// CHECK:STDERR: · ┳━ -// CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type `f1` in name -// CHECK:STDERR: · ┃ binding declaration -// CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] -// CHECK:STDERR: ┆ -// CHECK:STDERR: ├─┤ min_prelude/parts/float.carbon -// CHECK:STDERR: │ adapt MakeFloat(N); -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ unsupported floating-point bit width 1 -// CHECK:STDERR: · │ [CompileTimeFloatBitWidth] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: var test_f1: f1; -// CHECK:STDERR: ╭─┤ fail_fN_bad_width.carbon:[[@LINE+14]]:15 -// CHECK:STDERR: -> │ var test_f15: f15; -// CHECK:STDERR: · ┳━━ -// CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type `f15` in name -// CHECK:STDERR: · ┃ binding declaration -// CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] -// CHECK:STDERR: ┆ -// CHECK:STDERR: ├─┤ min_prelude/parts/float.carbon -// CHECK:STDERR: │ adapt MakeFloat(N); -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ unsupported floating-point bit width 15 -// CHECK:STDERR: · │ [CompileTimeFloatBitWidth] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: var test_f15: f15; // TODO: Decide if we want to expose the x87 80-bit floating point type this way. -// CHECK:STDERR: ╭─┤ fail_fN_bad_width.carbon:[[@LINE+14]]:15 -// CHECK:STDERR: -> │ var test_f80: f80; -// CHECK:STDERR: · ┳━━ -// CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type `f80` in name -// CHECK:STDERR: · ┃ binding declaration -// CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] -// CHECK:STDERR: ┆ -// CHECK:STDERR: ├─┤ min_prelude/parts/float.carbon -// CHECK:STDERR: │ adapt MakeFloat(N); -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ unsupported floating-point bit width 80 -// CHECK:STDERR: · │ [CompileTimeFloatBitWidth] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: var test_f80: f80; -// CHECK:STDERR: ╭─┤ fail_fN_bad_width.carbon:[[@LINE+14]]:16 -// CHECK:STDERR: -> │ var test_f100: f100; -// CHECK:STDERR: · ┳━━━ -// CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type `f100` in name -// CHECK:STDERR: · ┃ binding declaration -// CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] -// CHECK:STDERR: ┆ -// CHECK:STDERR: ├─┤ min_prelude/parts/float.carbon -// CHECK:STDERR: │ adapt MakeFloat(N); -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ unsupported floating-point bit width 100 -// CHECK:STDERR: · │ [CompileTimeFloatBitWidth] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: var test_f100: f100; -// CHECK:STDERR: ╭─┤ fail_fN_bad_width.carbon:[[@LINE+14]]:23 -// CHECK:STDERR: -> │ var test_f1000000000: f1000000000; -// CHECK:STDERR: · ┳━━━━━━━━━━ -// CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type -// CHECK:STDERR: · ┃ `f1000000000` in name binding declaration -// CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] -// CHECK:STDERR: ┆ -// CHECK:STDERR: ├─┤ min_prelude/parts/float.carbon -// CHECK:STDERR: │ adapt MakeFloat(N); -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ unsupported floating-point bit width 1000000000 -// CHECK:STDERR: · │ [CompileTimeFloatBitWidth] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: var test_f1000000000: f1000000000; -// CHECK:STDERR: ╭─┤ fail_fN_bad_width.carbon:[[@LINE+15]]:26 -// CHECK:STDERR: -> │ var test_f1000000000000: f1000000000000; -// CHECK:STDERR: · ┳━━━━━━━━━━━━━ -// CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type -// CHECK:STDERR: · ┃ `f1000000000000` in name binding -// CHECK:STDERR: · ┃ declaration -// CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl] -// CHECK:STDERR: ┆ -// CHECK:STDERR: ├─┤ min_prelude/parts/float.carbon -// CHECK:STDERR: │ adapt MakeFloat(N); -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ unsupported floating-point bit width 1000000000000 -// CHECK:STDERR: · │ [CompileTimeFloatBitWidth] -// CHECK:STDERR: ╰──── -// CHECK:STDERR: var test_f1000000000000: f1000000000000; // --- fail_non_type_as_type.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: ╭─┤ fail_non_type_as_type.carbon:[[@LINE+11]]:1 +// CHECK:STDERR: ╭─┤ fail_non_type_as_type.carbon:[[@LINE+8]]:1 // CHECK:STDERR: -> │ var x: type = 42; // CHECK:STDERR: · ┳━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `Core.IntLiteral` -// CHECK:STDERR: · │ ┃ to `type` -// CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] -// CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(type)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ to `type` +// CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: var x: type = 42; @@ -352,68 +348,56 @@ library "[[@TEST_NAME]]"; // Ensure that type literals get stringified properly. -// CHECK:STDERR: ╭─┤ fail_stringify_type_literals.carbon:[[@LINE+9]]:1 +// CHECK:STDERR: ╭─┤ fail_stringify_type_literals.carbon:[[@LINE+7]]:1 // CHECK:STDERR: -> │ var test_i32: i32 = (); // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `()` to `i32` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `()` does not implement interface `Core.ImplicitAs(i32)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var test_i32: i32 = (); -// CHECK:STDERR: ╭─┤ fail_stringify_type_literals.carbon:[[@LINE+9]]:1 +// CHECK:STDERR: ╭─┤ fail_stringify_type_literals.carbon:[[@LINE+7]]:1 // CHECK:STDERR: -> │ var test_f32: f32 = (); // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `()` to `f32` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `()` does not implement interface `Core.ImplicitAs(f32)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var test_f32: f32 = (); -// CHECK:STDERR: ╭─┤ fail_stringify_type_literals.carbon:[[@LINE+9]]:1 +// CHECK:STDERR: ╭─┤ fail_stringify_type_literals.carbon:[[@LINE+7]]:1 // CHECK:STDERR: -> │ var test_u32: u32 = (); // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `()` to `u32` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `()` does not implement interface `Core.ImplicitAs(u32)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var test_u32: u32 = (); -// CHECK:STDERR: ╭─┤ fail_stringify_type_literals.carbon:[[@LINE+9]]:1 +// CHECK:STDERR: ╭─┤ fail_stringify_type_literals.carbon:[[@LINE+7]]:1 // CHECK:STDERR: -> │ var test_bool: bool = (); // CHECK:STDERR: · ━━━━━━━━━┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `()` to `bool` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `()` does not implement interface `Core.ImplicitAs(bool)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var test_bool: bool = (); -// CHECK:STDERR: ╭─┤ fail_stringify_type_literals.carbon:[[@LINE+9]]:1 +// CHECK:STDERR: ╭─┤ fail_stringify_type_literals.carbon:[[@LINE+7]]:1 // CHECK:STDERR: -> │ var test_char: char = (); // CHECK:STDERR: · ━━━━━━━━━┳━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `()` to `char` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `()` does not implement interface `Core.ImplicitAs(char)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var test_char: char = (); -// CHECK:STDERR: ╭─┤ fail_stringify_type_literals.carbon:[[@LINE+9]]:1 +// CHECK:STDERR: ╭─┤ fail_stringify_type_literals.carbon:[[@LINE+7]]:1 // CHECK:STDERR: -> │ var test_str: str = (); // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `()` to `str` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `()` does not implement interface `Core.ImplicitAs(str)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var test_str: str = (); diff --git a/toolchain/check/testdata/return/fail_type_mismatch.carbon b/toolchain/check/testdata/return/fail_type_mismatch.carbon index 2222482469c0..b1ec8d4618a8 100644 --- a/toolchain/check/testdata/return/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/return/fail_type_mismatch.carbon @@ -13,15 +13,12 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_type_mismatch.carbon fn Main() -> i32 { - // CHECK:STDERR: ╭─┤ fail_type_mismatch.carbon:[[@LINE+11]]:3 + // CHECK:STDERR: ╭─┤ fail_type_mismatch.carbon:[[@LINE+8]]:3 // CHECK:STDERR: -> │ return 1.0; // CHECK:STDERR: · ┳━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `Core.FloatLiteral` - // CHECK:STDERR: · │ ┃ to `i32` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `Core.FloatLiteral` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(i32)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ to `i32` + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: return 1.0; @@ -77,7 +74,7 @@ fn Main() -> i32 { // CHECK:STDOUT: fn @Main() -> out %return.param: %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float] -// CHECK:STDOUT: %.loc27: %i32 = converted %float, [concrete = ] +// CHECK:STDOUT: %.loc24: %i32 = converted %float, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/fail_nested_incomplete.carbon b/toolchain/check/testdata/struct/fail_nested_incomplete.carbon index b800ecf935e3..f81eaa667d92 100644 --- a/toolchain/check/testdata/struct/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/struct/fail_nested_incomplete.carbon @@ -16,8 +16,8 @@ class Incomplete; // CHECK:STDERR: ╭─┤ fail_nested_incomplete.carbon:[[@LINE+12]]:8 // CHECK:STDERR: │ class Incomplete; -// CHECK:STDERR: · ────────┬──────── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: · ─────┬──── +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ var s: {.a: Incomplete}; // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━ diff --git a/toolchain/check/testdata/struct/fail_type_assign.carbon b/toolchain/check/testdata/struct/fail_type_assign.carbon index 0e840faac6f3..7bcc1f7f3fe4 100644 --- a/toolchain/check/testdata/struct/fail_type_assign.carbon +++ b/toolchain/check/testdata/struct/fail_type_assign.carbon @@ -12,13 +12,11 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_type_assign.carbon -// CHECK:STDERR: ╭─┤ fail_type_assign.carbon:[[@LINE+9]]:1 +// CHECK:STDERR: ╭─┤ fail_type_assign.carbon:[[@LINE+7]]:1 // CHECK:STDERR: -> │ var x: {.a: i32} = {.a: i32}; // CHECK:STDERR: · ━━┳━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `type` to `{.a: i32}` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `type` does not implement interface `Core.ImplicitAs({.a: i32})` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var x: {.a: i32} = {.a: i32}; @@ -57,7 +55,7 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %x.var: ref %struct_type.a = var_storage %x.var_patt [concrete] -// CHECK:STDOUT: %.loc24: type = splice_block %struct_type.a [concrete = constants.%struct_type.a] { +// CHECK:STDOUT: %.loc22: type = splice_block %struct_type.a [concrete = constants.%struct_type.a] { // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [concrete = constants.%struct_type.a] // CHECK:STDOUT: } @@ -72,7 +70,7 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [concrete = constants.%struct_type.a] -// CHECK:STDOUT: %.loc24: %struct_type.a = converted %struct_type.a, [concrete = ] +// CHECK:STDOUT: %.loc22: %struct_type.a = converted %struct_type.a, [concrete = ] // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_value_as_type.carbon b/toolchain/check/testdata/struct/fail_value_as_type.carbon index 9ce278153e78..e76a5d4850fb 100644 --- a/toolchain/check/testdata/struct/fail_value_as_type.carbon +++ b/toolchain/check/testdata/struct/fail_value_as_type.carbon @@ -12,15 +12,12 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_value_as_type.carbon -// CHECK:STDERR: ╭─┤ fail_value_as_type.carbon:[[@LINE+11]]:8 +// CHECK:STDERR: ╭─┤ fail_value_as_type.carbon:[[@LINE+8]]:8 // CHECK:STDERR: -> │ var x: {.a = 1}; // CHECK:STDERR: · ┳━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type -// CHECK:STDERR: · │ ┃ `{.a: Core.IntLiteral}` to `type` -// CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] -// CHECK:STDERR: · ╰────┤ type `{.a: Core.IntLiteral}` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(type)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `{.a: Core.IntLiteral}` to `type` +// CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: var x: {.a = 1}; @@ -54,8 +51,8 @@ var x: {.a = 1}; // CHECK:STDOUT: %x.var: ref = var_storage %x.var_patt [concrete = ] // CHECK:STDOUT: %.1: = splice_block [concrete = ] { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] -// CHECK:STDOUT: %.loc26_15.1: %struct_type.a = struct_literal (%int_1) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc26_15.2: type = converted %.loc26_15.1, [concrete = ] +// CHECK:STDOUT: %.loc23_15.1: %struct_type.a = struct_literal (%int_1) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc23_15.2: type = converted %.loc23_15.1, [concrete = ] // CHECK:STDOUT: } // CHECK:STDOUT: %x: = wrapper_binding x, [concrete = ] // CHECK:STDOUT: name_binding_decl { diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index 3b9cab5bd306..dee7226281a6 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -52,15 +52,12 @@ var c_bad: C({.c = 1, .d = 2}) = F(); // --- fail_bad_value.impl.carbon impl package Implicit; -// CHECK:STDERR: ╭─┤ fail_bad_value.impl.carbon:[[@LINE+11]]:1 +// CHECK:STDERR: ╭─┤ fail_bad_value.impl.carbon:[[@LINE+8]]:1 // CHECK:STDERR: -> │ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `C({.a = 1, .b = 2})` -// CHECK:STDERR: · │ ┃ to `C({.a = 3, .b = 4})` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `C({.a = 1, .b = 2})` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(C({.a = 3, .b = 4}))` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ to `C({.a = 3, .b = 4})` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); diff --git a/toolchain/check/testdata/tuple/class_tuples.carbon b/toolchain/check/testdata/tuple/class_tuples.carbon index ec0f81d56a48..9d5b088df6a9 100644 --- a/toolchain/check/testdata/tuple/class_tuples.carbon +++ b/toolchain/check/testdata/tuple/class_tuples.carbon @@ -21,15 +21,12 @@ class D {} var c: C; var d: D; -// CHECK:STDERR: ╭─┤ fail_element_type_mismatch.carbon:[[@LINE+11]]:19 +// CHECK:STDERR: ╭─┤ fail_element_type_mismatch.carbon:[[@LINE+8]]:19 // CHECK:STDERR: -> │ var x: (C*, C*) = (c, d); // CHECK:STDERR: · ┳━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `C` -// CHECK:STDERR: · │ ┃ to `C*` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `C` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(C*)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ to `C*` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var x: (C*, C*) = (c, d); @@ -42,8 +39,8 @@ class Incomplete; // CHECK:STDERR: ╭─┤ fail_nested_incomplete.carbon:[[@LINE+12]]:8 // CHECK:STDERR: │ class Incomplete; -// CHECK:STDERR: · ────────┬──────── -// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: · ─────┬──── +// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ var t: (Complete, Incomplete); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━ @@ -61,15 +58,12 @@ library "[[@TEST_NAME]]"; class C {} -// CHECK:STDERR: ╭─┤ fail_type_assign.carbon:[[@LINE+11]]:16 +// CHECK:STDERR: ╭─┤ fail_type_assign.carbon:[[@LINE+8]]:16 // CHECK:STDERR: -> │ var x: (C, ) = (C, ); // CHECK:STDERR: · ┳━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `type` -// CHECK:STDERR: · │ ┃ to `C` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `type` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(C)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ to `C` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var x: (C, ) = (C, ); @@ -80,14 +74,12 @@ library "[[@TEST_NAME]]"; class C {} var c: C; -// CHECK:STDERR: ╭─┤ fail_value_as_type.carbon:[[@LINE+10]]:8 +// CHECK:STDERR: ╭─┤ fail_value_as_type.carbon:[[@LINE+8]]:8 // CHECK:STDERR: -> │ var x: c; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type `C` to -// CHECK:STDERR: · │ ┃ `type` -// CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] -// CHECK:STDERR: · ╰────┤ type `C` does not implement interface `Core.ImplicitAs(type)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `type` +// CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: var x: c; diff --git a/toolchain/check/testdata/tuple/element_access.carbon b/toolchain/check/testdata/tuple/element_access.carbon index 80a6eee5689e..5b36cbf3888c 100644 --- a/toolchain/check/testdata/tuple/element_access.carbon +++ b/toolchain/check/testdata/tuple/element_access.carbon @@ -160,7 +160,7 @@ library "[[@TEST_NAME]]"; var a: (i32, i32) = (2, 3); var b: i32 = 0; -// CHECK:STDERR: ╭─┤ fail_non_deterministic_type.carbon:[[@LINE+20]]:17 +// CHECK:STDERR: ╭─┤ fail_non_deterministic_type.carbon:[[@LINE+19]]:17 // CHECK:STDERR: -> │ var c: i32 = a.(b); // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: non-constant call to compile-time-only function @@ -168,9 +168,8 @@ var b: i32 = 0; // CHECK:STDERR: ┆ // CHECK:STDERR: ├─┤ min_prelude/parts/int.carbon // CHECK:STDERR: │ fn Convert(self) -> IntLiteral = "int.convert_checked"; -// CHECK:STDERR: · ────────────────┬─────────────── -// CHECK:STDERR: · ╰──┤ compile-time-only function declared here -// CHECK:STDERR: · │ [CompTimeOnlyFunctionHere] +// CHECK:STDERR: · ───┬─── +// CHECK:STDERR: · ╰──┤ compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: ╰──── // CHECK:STDERR: // CHECK:STDERR: ╭─┤ fail_non_deterministic_type.carbon:[[@LINE+7]]:14 @@ -186,15 +185,12 @@ var c: i32 = a.(b); library "[[@TEST_NAME]]"; var a: (i32, i32) = (12, 6); -// CHECK:STDERR: ╭─┤ fail_non_int_indexing.carbon:[[@LINE+11]]:17 +// CHECK:STDERR: ╭─┤ fail_non_int_indexing.carbon:[[@LINE+8]]:17 // CHECK:STDERR: -> │ var b: i32 = a.(2.6); // CHECK:STDERR: · ┳━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type -// CHECK:STDERR: · │ ┃ `Core.FloatLiteral` to `Core.IntLiteral` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `Core.FloatLiteral` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(Core.IntLiteral)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `Core.FloatLiteral` to `Core.IntLiteral` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var b: i32 = a.(2.6); diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index cc542eda8c3d..cc37c8c22627 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -55,15 +55,12 @@ var c_bad: C((1, 2, 3)) = F(); impl package Implicit; -// CHECK:STDERR: ╭─┤ fail_bad_value.impl.carbon:[[@LINE+11]]:1 +// CHECK:STDERR: ╭─┤ fail_bad_value.impl.carbon:[[@LINE+8]]:1 // CHECK:STDERR: -> │ var c_bad: C((3, 4)) = F(); // CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `C((1, 2))` to -// CHECK:STDERR: · │ ┃ `C((3, 4))` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `C((1, 2))` does not implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(C((3, 4)))` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ `C((3, 4))` +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var c_bad: C((3, 4)) = F(); diff --git a/toolchain/check/testdata/typeof/basics.carbon b/toolchain/check/testdata/typeof/basics.carbon index 9ec8164b828b..6165b785883f 100644 --- a/toolchain/check/testdata/typeof/basics.carbon +++ b/toolchain/check/testdata/typeof/basics.carbon @@ -109,9 +109,9 @@ fn G[T: type](x: T, unused y: typeof(x)) {} fn Call() { // CHECK:STDERR: ╭─┤ fail_generic_mismatch.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn G[T: type](x: T, unused y: typeof(x)) {} - // CHECK:STDERR: · ─────────────────────┬──────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ G(true, {} as C); // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━ diff --git a/toolchain/check/testdata/var/fail_duplicate_decl.carbon b/toolchain/check/testdata/var/fail_duplicate_decl.carbon index 5bdf8c3d6d2e..1771a1b96cde 100644 --- a/toolchain/check/testdata/var/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/var/fail_duplicate_decl.carbon @@ -18,8 +18,8 @@ fn Main() { var unused x: () = (); // CHECK:STDERR: ╭─┤ fail_basic.carbon:[[@LINE+11]]:14 // CHECK:STDERR: │ var unused x: () = (); - // CHECK:STDERR: · ──┬── - // CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] + // CHECK:STDERR: · ┬ + // CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ var unused x: () = (); // CHECK:STDERR: · ┳ diff --git a/toolchain/check/testdata/var/fail_init_type_mismatch.carbon b/toolchain/check/testdata/var/fail_init_type_mismatch.carbon index 4caaa64aa2ad..a4aa5f9997e2 100644 --- a/toolchain/check/testdata/var/fail_init_type_mismatch.carbon +++ b/toolchain/check/testdata/var/fail_init_type_mismatch.carbon @@ -12,13 +12,11 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/fail_init_type_mismatch.carbon -// CHECK:STDERR: ╭─┤ fail_init_type_mismatch.carbon:[[@LINE+9]]:1 +// CHECK:STDERR: ╭─┤ fail_init_type_mismatch.carbon:[[@LINE+7]]:1 // CHECK:STDERR: -> │ var x: {} = (); // CHECK:STDERR: · ━━━━┳━━━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `()` to `{}` -// CHECK:STDERR: · │ ┃ [ConversionFailure] -// CHECK:STDERR: · ╰────┤ type `()` does not implement interface `Core.ImplicitAs({})` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: var x: {} = (); @@ -54,9 +52,9 @@ var x: {} = (); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %x.var: ref %empty_struct_type = var_storage %x.var_patt [concrete] -// CHECK:STDOUT: %.loc24_9.1: type = splice_block %.loc24_9.3 [concrete = constants.%empty_struct_type] { -// CHECK:STDOUT: %.loc24_9.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc24_9.3: type = converted %.loc24_9.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc22_9.1: type = splice_block %.loc22_9.3 [concrete = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc22_9.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc22_9.3: type = converted %.loc22_9.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } // CHECK:STDOUT: %x: ref %empty_struct_type = wrapper_binding x, %x.var [concrete = %x.var] // CHECK:STDOUT: name_binding_decl { @@ -67,8 +65,8 @@ var x: {} = (); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc24_14: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc24_1: %empty_struct_type = converted %.loc24_14, [concrete = ] +// CHECK:STDOUT: %.loc22_14: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc22_1: %empty_struct_type = converted %.loc22_14, [concrete = ] // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/fail_init_with_self.carbon b/toolchain/check/testdata/var/fail_init_with_self.carbon index 685489933bcc..09969b026aa3 100644 --- a/toolchain/check/testdata/var/fail_init_with_self.carbon +++ b/toolchain/check/testdata/var/fail_init_with_self.carbon @@ -25,7 +25,7 @@ fn Main() { // CHECK:STDERR: ╭─┤ fail_basic.carbon:[[@LINE+8]]:14 // CHECK:STDERR: -> │ var unused x: () = x; // CHECK:STDERR: · ━━┳━━ ┬ - // CHECK:STDERR: · ┗━━━━━━━━┫ error: variable `x` marked `unused` but used + // CHECK:STDERR: · ┗━━━━━━━━┫ error: binding `x` marked `unused` but used // CHECK:STDERR: · │ ┃ [UnusedButUsed] // CHECK:STDERR: · ╰────┤ usage here [UnusedButUsedHere] // CHECK:STDERR: ╰──── diff --git a/toolchain/check/testdata/var/fail_namespace_conflict.carbon b/toolchain/check/testdata/var/fail_namespace_conflict.carbon index 3b9d451a9177..b09eff4ce7c0 100644 --- a/toolchain/check/testdata/var/fail_namespace_conflict.carbon +++ b/toolchain/check/testdata/var/fail_namespace_conflict.carbon @@ -14,8 +14,8 @@ namespace A; // CHECK:STDERR: ╭─┤ fail_namespace_conflict.carbon:[[@LINE+11]]:5 // CHECK:STDERR: │ namespace A; -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ var A: (); // CHECK:STDERR: · ┳ @@ -27,8 +27,8 @@ var A: (); // CHECK:STDERR: ╭─┤ fail_namespace_conflict.carbon:[[@LINE+11]]:5 // CHECK:STDERR: │ namespace A; -// CHECK:STDERR: · ──────┬───── -// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: · ┬ +// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ var A: () = (); // CHECK:STDERR: · ┳ diff --git a/toolchain/check/testdata/var/fail_not_copyable.carbon b/toolchain/check/testdata/var/fail_not_copyable.carbon index e06dd6bc6874..d1ead61478c4 100644 --- a/toolchain/check/testdata/var/fail_not_copyable.carbon +++ b/toolchain/check/testdata/var/fail_not_copyable.carbon @@ -15,13 +15,11 @@ class X { fn F(x: X) { // TODO: Decide on rules for when classes are copyable. - // CHECK:STDERR: ╭─┤ fail_not_copyable.carbon:[[@LINE+9]]:21 + // CHECK:STDERR: ╭─┤ fail_not_copyable.carbon:[[@LINE+7]]:21 // CHECK:STDERR: -> │ var unused y: X = x; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot copy value of type `X` - // CHECK:STDERR: · │ ┃ [CopyOfUncopyableType] - // CHECK:STDERR: · ╰────┤ type `X` does not implement interface `Core.Copy` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [CopyOfUncopyableType] // CHECK:STDERR: ╰──── // CHECK:STDERR: 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 a0135fab3751..83d5182e9933 100644 --- a/toolchain/check/testdata/var/fail_storage_is_literal.carbon +++ b/toolchain/check/testdata/var/fail_storage_is_literal.carbon @@ -13,15 +13,12 @@ // 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+11]]:17 + // CHECK:STDERR: ╭─┤ fail_storage_is_literal.carbon:[[@LINE+8]]:17 // CHECK:STDERR: -> │ var unused x: 1 = 1; // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert non-type value of type - // CHECK:STDERR: · │ ┃ `Core.IntLiteral` to `type` - // CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not implement interface - // CHECK:STDERR: · │ `Core.ImplicitAs(type)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ `Core.IntLiteral` to `type` + // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: var unused x: 1 = 1; @@ -63,11 +60,11 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.var: ref = var_storage %x.var_patt [concrete = ] -// CHECK:STDOUT: %int_1.loc27_21: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] +// CHECK:STDOUT: %int_1.loc24_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.loc27_17: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] -// CHECK:STDOUT: %.loc27: type = converted %int_1.loc27_17, [concrete = ] +// CHECK:STDOUT: %int_1.loc24_17: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] +// CHECK:STDOUT: %.loc24: type = converted %int_1.loc24_17, [concrete = ] // CHECK:STDOUT: } // CHECK:STDOUT: %x: = wrapper_binding x, [concrete = ] // CHECK:STDOUT: name_binding_decl { diff --git a/toolchain/check/testdata/where_expr/constraints.carbon b/toolchain/check/testdata/where_expr/constraints.carbon index 35cdaab875a6..3b2d8e898b08 100644 --- a/toolchain/check/testdata/where_expr/constraints.carbon +++ b/toolchain/check/testdata/where_expr/constraints.carbon @@ -84,17 +84,13 @@ fn AssociatedTypeImpls(generic W: K where .Associated impls M); library "[[@TEST_NAME]]"; -// CHECK:STDERR: ╭─┤ fail_left_of_impls_non_type.carbon:[[@LINE+13]]:39 +// CHECK:STDERR: ╭─┤ fail_left_of_impls_non_type.carbon:[[@LINE+9]]:39 // CHECK:STDERR: -> │ fn NonTypeImpls(generic U: type where 7 impls type); // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert -// CHECK:STDERR: · │ ┃ non-type value of type -// CHECK:STDERR: · │ ┃ `Core.IntLiteral` to `type` -// CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] -// CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` does not -// CHECK:STDERR: · │ implement interface -// CHECK:STDERR: · │ `Core.ImplicitAs(type)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ non-type value of type +// CHECK:STDERR: · ┃ `Core.IntLiteral` to `type` +// CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn NonTypeImpls(generic U: type where 7 impls type); @@ -103,20 +99,15 @@ fn NonTypeImpls(generic U: type where 7 impls type); library "[[@TEST_NAME]]"; -// CHECK:STDERR: ╭─┤ fail_right_of_impls_non_type.carbon:[[@LINE+16]]:51 +// CHECK:STDERR: ╭─┤ fail_right_of_impls_non_type.carbon:[[@LINE+11]]:51 // CHECK:STDERR: -> │ fn ImplsNonType(generic U: type where .Self impls 7); // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly -// CHECK:STDERR: · │ ┃ convert non-type -// CHECK:STDERR: · │ ┃ value of type -// CHECK:STDERR: · │ ┃ `Core.IntLiteral` -// CHECK:STDERR: · │ ┃ to `type` -// CHECK:STDERR: · │ ┃ [ConversionFailureNonTypeToFacet] -// CHECK:STDERR: · ╰────┤ type `Core.IntLiteral` -// CHECK:STDERR: · │ does not implement -// CHECK:STDERR: · │ interface -// CHECK:STDERR: · │ `Core.ImplicitAs(type)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] +// CHECK:STDERR: · ┃ convert non-type +// CHECK:STDERR: · ┃ value of type +// CHECK:STDERR: · ┃ `Core.IntLiteral` +// CHECK:STDERR: · ┃ to `type` +// CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn ImplsNonType(generic U: type where .Self impls 7); diff --git a/toolchain/check/testdata/where_expr/dot_self_impls.carbon b/toolchain/check/testdata/where_expr/dot_self_impls.carbon index 299806d9ea11..0b57de2a6ee6 100644 --- a/toolchain/check/testdata/where_expr/dot_self_impls.carbon +++ b/toolchain/check/testdata/where_expr/dot_self_impls.carbon @@ -207,9 +207,9 @@ fn Test() { // TODO: This should pass. // CHECK:STDERR: ╭─┤ fail_todo_compare_equal_with_rewrite.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn AssertSame[T: type](unused a: WrapType(T), unused b: WrapType(T)) {} - // CHECK:STDERR: · ─────────────────────────┬──────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬──── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ AssertSame(Type((I where .A = ()) & J), // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -222,9 +222,9 @@ fn Test() { // TODO: This should pass. // CHECK:STDERR: ╭─┤ fail_todo_compare_equal_with_rewrite.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn AssertSame[T: type](unused a: WrapType(T), unused b: WrapType(T)) {} - // CHECK:STDERR: · ─────────────────────────┬──────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬──── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ AssertSame(Type(I & (J where .B = {})), // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -238,9 +238,9 @@ fn Test() { // TODO: This should pass. // CHECK:STDERR: ╭─┤ fail_todo_compare_equal_with_rewrite.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn AssertSame[T: type](unused a: WrapType(T), unused b: WrapType(T)) {} - // CHECK:STDERR: · ─────────────────────────┬──────────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ─────┬──── + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ AssertSame(Type((I where .A = ()) & (J where .B = {})), // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -265,9 +265,9 @@ interface J {} fn Test() { // CHECK:STDERR: ╭─┤ fail_compare_not_equal.carbon:[[@LINE+12]]:3 // CHECK:STDERR: │ fn Same[T: type](unused a: WrapType(T), unused b: WrapType(T)) {} - // CHECK:STDERR: · ─────────────────────────┬────────────────────────────────────── - // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here - // CHECK:STDERR: · │ [DeductionGenericHere] + // CHECK:STDERR: · ──┬─ + // CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here + // CHECK:STDERR: · │ [DeductionGenericHere] // CHECK:STDERR: ┆ // CHECK:STDERR: -> │ Same(Type(I where .Self impls J), Type(J where .Self impls I)); // CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/toolchain/check/testdata/where_expr/equal_rewrite.carbon b/toolchain/check/testdata/where_expr/equal_rewrite.carbon index 530ee72f0407..2ffdfc5299ac 100644 --- a/toolchain/check/testdata/where_expr/equal_rewrite.carbon +++ b/toolchain/check/testdata/where_expr/equal_rewrite.carbon @@ -178,18 +178,13 @@ interface I { } // `2` can't be converted to the type of `I.Member` -// CHECK:STDERR: ╭─┤ fail_check_rewrite_constraints.carbon:[[@LINE+14]]:53 +// CHECK:STDERR: ╭─┤ fail_check_rewrite_constraints.carbon:[[@LINE+9]]:53 // CHECK:STDERR: -> │ fn RewriteTypeMismatch(generic X: I where .Member = 2); // CHECK:STDERR: · ┳ // CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ // CHECK:STDERR: · ┃ error: cannot implicitly convert non-type value of type `Core.IntLiteral` to // CHECK:STDERR: · ┃ `type` // CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet] -// CHECK:STDERR: · ╰──┤ type `Core.IntLiteral` -// CHECK:STDERR: · │ does not implement -// CHECK:STDERR: · │ interface -// CHECK:STDERR: · │ `Core.ImplicitAs(type)` -// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] // CHECK:STDERR: ╰──── // CHECK:STDERR: fn RewriteTypeMismatch(generic X: I where .Member = 2); diff --git a/toolchain/check/testdata/while/while.carbon b/toolchain/check/testdata/while/while.carbon index 39fb2d8b5b1a..7338c20e8106 100644 --- a/toolchain/check/testdata/while/while.carbon +++ b/toolchain/check/testdata/while/while.carbon @@ -80,13 +80,11 @@ fn While() { library "[[@TEST_NAME]]"; fn While() { - // CHECK:STDERR: ╭─┤ fail_bad_condition.carbon:[[@LINE+9]]:9 + // CHECK:STDERR: ╭─┤ fail_bad_condition.carbon:[[@LINE+7]]:9 // CHECK:STDERR: -> │ while ({}) {} // CHECK:STDERR: · ━┳━━ // CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `{}` to `bool` - // CHECK:STDERR: · │ ┃ [ConversionFailure] - // CHECK:STDERR: · ╰────┤ type `{}` does not implement interface `Core.ImplicitAs(bool)` - // CHECK:STDERR: · │ [MissingImplInMemberAccessInContext] + // CHECK:STDERR: · ┃ [ConversionFailure] // CHECK:STDERR: ╰──── // CHECK:STDERR: while ({}) {} diff --git a/toolchain/check/thunk.cpp b/toolchain/check/thunk.cpp index 4248b8734b6a..761b32f41af6 100644 --- a/toolchain/check/thunk.cpp +++ b/toolchain/check/thunk.cpp @@ -332,9 +332,9 @@ static auto StartThunkFunctionDefinition(Context& context, SemIR::InstId callee_id) { // The check below produces diagnostics referring to the signature, so also // note the callee. - Diagnostics::AnnotationScope annot_scope( + Diagnostics::ContextScope diagnostic_context( &context.emitter(), [&](DiagnosticBuilder& builder) { - CARBON_DIAGNOSTIC_LABEL(ThunkCallee, Info, + CARBON_DIAGNOSTIC_LABEL(ThunkCallee, "while building thunk calling this function"); builder.Attach(callee_id, ThunkCallee); }); @@ -354,10 +354,10 @@ static auto BuildThunkDefinition(Context& context, // The checks below produce diagnostics pointing at the callee, so also note // the signature. - Diagnostics::AnnotationScope annot_scope( + Diagnostics::ContextScope diagnostic_context( &context.emitter(), [&](DiagnosticBuilder& builder) { CARBON_DIAGNOSTIC_LABEL( - ThunkSignature, Info, + ThunkSignature, "while building thunk to match the signature of this function"); builder.Attach( context.functions().Get(signature_id).first_owning_decl_id, diff --git a/toolchain/check/type_completion.cpp b/toolchain/check/type_completion.cpp index 4d5e5d8070a5..af7049f4935f 100644 --- a/toolchain/check/type_completion.cpp +++ b/toolchain/check/type_completion.cpp @@ -4,6 +4,9 @@ #include "toolchain/check/type_completion.h" +#include +#include + #include "common/concepts.h" #include "common/increment_scope.h" #include "llvm/ADT/SmallVector.h" @@ -31,86 +34,114 @@ namespace Carbon::Check { -auto DiagnoseIncompleteClass(Context& context, SemIR::ClassId class_id) - -> void { - // The caller must provide context for any diagnostics in type completion. - context.emitter().CheckHasContext(); +// The entity whose incompleteness stopped a type from being completed. It is +// recorded so that the diagnostic can be built after the completion work is +// done, outside the context scope that labels diagnostics from that work. +using IncompleteEntity = + std::variant; +auto DiagnoseIncompleteClass(Context& context, SemIR::ClassId class_id, + Diagnoser diagnoser) -> void { + CARBON_CHECK(diagnoser); const auto& class_info = context.classes().Get(class_id); CARBON_CHECK(!class_info.is_complete(), "Class is not incomplete"); + auto diag = diagnoser(); if (class_info.has_definition_started()) { - CARBON_DIAGNOSTIC(ClassIncompleteWithinDefinition, Error, - "class is incomplete within its definition"); - context.emitter().Emit(class_info.definition_id, - ClassIncompleteWithinDefinition); + CARBON_DIAGNOSTIC_LABEL(ClassIncompleteWithinDefinition, + "class is incomplete within its definition"); + diag.Attach(class_info.definition_id, ClassIncompleteWithinDefinition); } else { - CARBON_DIAGNOSTIC(ClassForwardDeclaredHere, Error, - "class was forward declared here"); - context.emitter().Emit(class_info.latest_decl_id(), - ClassForwardDeclaredHere); + CARBON_DIAGNOSTIC_LABEL(ClassForwardDeclaredHere, + "class was forward declared here"); + diag.Attach(LocIdForDiagnostics::DeclaredName(class_info.latest_decl_id()), + ClassForwardDeclaredHere); } + diag.Emit(); } auto DiagnoseIncompleteInterface(Context& context, - SemIR::InterfaceId interface_id) -> void { - // The caller must provide context for any diagnostics in type completion. - context.emitter().CheckHasContext(); - + SemIR::InterfaceId interface_id, + Diagnoser diagnoser) -> void { + CARBON_CHECK(diagnoser); const auto& interface_info = context.interfaces().Get(interface_id); CARBON_CHECK(!interface_info.is_complete(), "Interface is not incomplete"); + auto diag = diagnoser(); if (interface_info.is_being_defined()) { - CARBON_DIAGNOSTIC(InterfaceIncompleteWithinDefinition, Error, - "interface is currently being defined"); - context.emitter().Emit(interface_info.definition_id, - InterfaceIncompleteWithinDefinition); + CARBON_DIAGNOSTIC_LABEL(InterfaceIncompleteWithinDefinition, + "interface is incomplete within its definition"); + diag.Attach(interface_info.definition_id, + InterfaceIncompleteWithinDefinition); } else { - CARBON_DIAGNOSTIC(InterfaceForwardDeclaredHere, Error, - "interface was forward declared here"); - context.emitter().Emit(interface_info.latest_decl_id(), - InterfaceForwardDeclaredHere); + CARBON_DIAGNOSTIC_LABEL(InterfaceForwardDeclaredHere, + "interface was forward declared here"); + diag.Attach( + LocIdForDiagnostics::DeclaredName(interface_info.latest_decl_id()), + InterfaceForwardDeclaredHere); } + diag.Emit(); } auto DiagnoseAbstractClass(Context& context, SemIR::ClassId class_id, - bool direct_use) -> void { - // The caller must provide context for any diagnostics in type completion. - context.emitter().CheckHasContext(); - + bool direct_use, Diagnoser diagnoser) -> void { + CARBON_CHECK(diagnoser); const auto& class_info = context.classes().Get(class_id); CARBON_CHECK( class_info.inheritance_kind == SemIR::Class::InheritanceKind::Abstract, "Class is not abstract"); - CARBON_DIAGNOSTIC( - ClassAbstractHere, Error, + CARBON_DIAGNOSTIC_LABEL( + ClassAbstractHere, "{0:=0:uses class that|=1:class} was declared abstract here", Diagnostics::IntAsSelect); - context.emitter().Emit(class_info.definition_id, ClassAbstractHere, - static_cast(direct_use)); + auto diag = diagnoser(); + diag.Attach(class_info.definition_id, ClassAbstractHere, + static_cast(direct_use)); + diag.Emit(); } static auto DiagnoseIncompleteNamedConstraint( - Context& context, SemIR::NamedConstraintId named_constraint_id) -> void { - // The caller must provide context for any diagnostics in type completion. - context.emitter().CheckHasContext(); - + Context& context, SemIR::NamedConstraintId named_constraint_id, + Diagnoser diagnoser) -> void { + CARBON_CHECK(diagnoser); const auto& constraint = context.named_constraints().Get(named_constraint_id); CARBON_CHECK(!constraint.is_complete(), "Named constraint is not incomplete"); + auto diag = diagnoser(); if (constraint.is_being_defined()) { - CARBON_DIAGNOSTIC(NamedConstraintIncompleteWithinDefinition, Error, - "constraint is currently being defined"); - context.emitter().Emit(constraint.definition_id, - NamedConstraintIncompleteWithinDefinition); + CARBON_DIAGNOSTIC_LABEL(NamedConstraintIncompleteWithinDefinition, + "constraint is incomplete within its definition"); + diag.Attach(constraint.definition_id, + NamedConstraintIncompleteWithinDefinition); } else { - CARBON_DIAGNOSTIC(NamedConstraintForwardDeclaredHere, Error, - "constraint was forward declared here"); - context.emitter().Emit(constraint.latest_decl_id(), - NamedConstraintForwardDeclaredHere); + CARBON_DIAGNOSTIC_LABEL(NamedConstraintForwardDeclaredHere, + "constraint was forward declared here"); + diag.Attach(LocIdForDiagnostics::DeclaredName(constraint.latest_decl_id()), + NamedConstraintForwardDeclaredHere); } + diag.Emit(); } -static auto RequireCompleteFacetType(Context& context, SemIR::LocId loc_id, - const SemIR::FacetType& facet_type, - bool diagnose) -> bool { +// Emits the diagnostic `diagnoser` builds for `incomplete` not being complete, +// with a label saying why it isn't. +static auto DiagnoseIncomplete(Context& context, IncompleteEntity incomplete, + Diagnoser diagnoser) -> void { + std::visit( + [&](auto id) { + if constexpr (std::same_as) { + DiagnoseIncompleteClass(context, id, diagnoser); + } else if constexpr (std::same_as) { + DiagnoseIncompleteInterface(context, id, diagnoser); + } else { + DiagnoseIncompleteNamedConstraint(context, id, diagnoser); + } + }, + incomplete); +} + +// Requires the interfaces and named constraints `facet_type` extends to be +// complete. Returns false where one isn't, recording it in `incomplete`, or +// where resolving a specific failed. +static auto RequireCompleteFacetType( + Context& context, SemIR::LocId loc_id, const SemIR::FacetType& facet_type, + std::optional* incomplete) -> bool { const auto& declared_facet_type = context.declared_facet_types().Get(facet_type.declared_facet_type_id); @@ -118,9 +149,7 @@ static auto RequireCompleteFacetType(Context& context, SemIR::LocId loc_id, auto interface_id = extends.interface_id; const auto& interface = context.interfaces().Get(interface_id); if (!interface.is_complete()) { - if (diagnose) { - DiagnoseIncompleteInterface(context, interface_id); - } + *incomplete = interface_id; return false; } if (interface.generic_id.has_value()) { @@ -147,9 +176,7 @@ static auto RequireCompleteFacetType(Context& context, SemIR::LocId loc_id, const auto& constraint = context.named_constraints().Get(named_constraint_id); if (!constraint.is_complete()) { - if (diagnose) { - DiagnoseIncompleteNamedConstraint(context, named_constraint_id); - } + *incomplete = named_constraint_id; return false; } if (constraint.generic_id.has_value()) { @@ -189,13 +216,19 @@ namespace { class TypeCompleter { public: // `context` mut not be null. - TypeCompleter(Context* context, SemIR::LocId loc_id, bool diagnose) - : context_(context), loc_id_(loc_id), diagnose_(diagnose) {} + TypeCompleter(Context* context, SemIR::LocId loc_id) + : context_(context), loc_id_(loc_id) {} // Attempts to complete the given type. Returns true if it is now complete, // false if it could not be completed. auto Complete(SemIR::TypeId type_id) -> bool; + // The entity that stopped `Complete` from completing the type, when that is + // what stopped it rather than an error already diagnosed. + auto incomplete() const -> std::optional { + return incomplete_; + } + private: enum class Phase : int8_t { // The next step is to add nested types to the list of types to complete. @@ -356,7 +389,7 @@ class TypeCompleter { Context* context_; llvm::SmallVector work_list_; SemIR::LocId loc_id_; - bool diagnose_; + std::optional incomplete_; }; } // namespace @@ -470,9 +503,7 @@ auto TypeCompleter::AddNestedIncompleteTypes(SemIR::Inst type_inst) -> bool { } } if (!class_info.is_complete()) { - if (diagnose_) { - DiagnoseIncompleteClass(*context_, inst.class_id); - } + incomplete_ = inst.class_id; return false; } if (inst.specific_id.has_value()) { @@ -506,7 +537,7 @@ auto TypeCompleter::AddNestedIncompleteTypes(SemIR::Inst type_inst) -> bool { break; } case CARBON_KIND(SemIR::FacetType inst): { - if (!RequireCompleteFacetType(*context_, loc_id_, inst, diagnose_)) { + if (!RequireCompleteFacetType(*context_, loc_id_, inst, &incomplete_)) { return false; } break; @@ -867,25 +898,53 @@ auto TypeCompleter::BuildInfo(SemIR::TypeId type_id, SemIR::Inst inst) const } } +// Completes `type_id`. If it can't be completed because an entity it is built +// from isn't complete, emits the diagnostic `diagnoser` builds, with a label +// saying which entity. +// +// Completing a type can evaluate what it is built from, such as a specific's +// definition or a builtin's constant, and import its definition from C++, and +// each of those can emit a diagnostic of its own. A context scope attaches a +// label to those at `loc_id`, naming the type being completed. The diagnoser's +// diagnostic is built after the scope ends, so that it does not get that label: +// its message already says what was being completed and where. +static auto CompleteType(Context& context, SemIR::TypeId type_id, + SemIR::LocId loc_id, Diagnoser diagnoser) -> bool { + TypeCompleter completer(&context, loc_id); + bool complete; + { + auto label_fn = [&](DiagnosticBuilder& builder) { + CARBON_DIAGNOSTIC_LABEL(InTypeCompletion, + "in completion of type {0} here", SemIR::TypeId); + builder.Attach(loc_id, InTypeCompletion, type_id); + }; + std::optional scope; + if (loc_id.has_value()) { + scope.emplace(&context.emitter(), label_fn); + } + complete = completer.Complete(type_id); + } + if (!complete && diagnoser && completer.incomplete()) { + DiagnoseIncomplete(context, *completer.incomplete(), diagnoser); + } + return complete; +} + auto TryToCompleteType(Context& context, SemIR::TypeId type_id, - SemIR::LocId loc_id, bool diagnose) -> bool { - return TypeCompleter(&context, loc_id, diagnose).Complete(type_id); + SemIR::LocId loc_id, Diagnoser diagnoser) -> bool { + return CompleteType(context, type_id, loc_id, diagnoser); } auto CompleteTypeOrCheckFail(Context& context, SemIR::TypeId type_id) -> void { - bool complete = - TypeCompleter(&context, SemIR::LocId::None, false).Complete(type_id); + bool complete = TypeCompleter(&context, SemIR::LocId::None).Complete(type_id); CARBON_CHECK(complete, "Expected {0} to be a complete type", context.types().GetAsInst(type_id)); } auto RequireCompleteType(Context& context, SemIR::TypeId type_id, - SemIR::LocId loc_id, - DiagnosticContextFn diagnostic_context) -> bool { - CARBON_CHECK(diagnostic_context); - Diagnostics::ContextScope scope(&context.emitter(), diagnostic_context); - - if (!TypeCompleter(&context, loc_id, true).Complete(type_id)) { + SemIR::LocId loc_id, Diagnoser diagnoser) -> bool { + CARBON_CHECK(diagnoser); + if (!CompleteType(context, type_id, loc_id, diagnoser)) { return false; } @@ -918,18 +977,12 @@ auto TryIsConcreteType(Context& context, SemIR::TypeId type_id, } auto RequireConcreteType(Context& context, SemIR::TypeId type_id, - SemIR::LocId loc_id, - DiagnosticContextFn complete_type_diagnostic_context, - DiagnosticContextFn concrete_type_diagnostic_context) - -> bool { - if (!RequireCompleteType(context, type_id, loc_id, - complete_type_diagnostic_context)) { + SemIR::LocId loc_id, Diagnoser complete_type_diagnoser, + Diagnoser concrete_type_diagnoser) -> bool { + if (!RequireCompleteType(context, type_id, loc_id, complete_type_diagnoser)) { return false; } - - CARBON_CHECK(concrete_type_diagnostic_context); - Diagnostics::ContextScope scope(&context.emitter(), - concrete_type_diagnostic_context); + CARBON_CHECK(concrete_type_diagnoser); // TODO: For symbolic types, should add an implicit constraint that they are // not abstract. @@ -947,16 +1000,19 @@ auto RequireConcreteType(Context& context, SemIR::TypeId type_id, direct_use = true; } } - DiagnoseAbstractClass(context, complete_info.abstract_class_id, direct_use); + DiagnoseAbstractClass(context, complete_info.abstract_class_id, direct_use, + concrete_type_diagnoser); return false; } // Identifies the facet type in the `facet_type_inst_id`. Returns None if an -// error is encountered or diagnosed. +// error is encountered, recording in `incomplete` the constraint that stopped +// it when one did. static auto IdentifyFacetType(Context& context, SemIR::LocId loc_id, SemIR::ConstantId initial_self_const_id, SemIR::ConstantId facet_type_const_id, - bool allow_partially_identified, bool diagnose) + bool allow_partially_identified, + std::optional* incomplete) -> IdentifiedFacetTypeId { if (facet_type_const_id == SemIR::ErrorInst::ConstantId) { return IdentifiedFacetTypeId::None; @@ -1106,10 +1162,7 @@ static auto IdentifyFacetType(Context& context, SemIR::LocId loc_id, continue; } } else { - if (diagnose) { - DiagnoseIncompleteNamedConstraint(context, - extends.named_constraint_id); - } + *incomplete = extends.named_constraint_id; return IdentifiedFacetTypeId::None; } @@ -1164,9 +1217,7 @@ static auto IdentifyFacetType(Context& context, SemIR::LocId loc_id, continue; } } else { - if (diagnose) { - DiagnoseIncompleteNamedConstraint(context, impls.named_constraint_id); - } + *incomplete = impls.named_constraint_id; return IdentifiedFacetTypeId::None; } @@ -1222,9 +1273,7 @@ static auto IdentifyFacetType(Context& context, SemIR::LocId loc_id, continue; } } else { - if (diagnose) { - DiagnoseIncompleteNamedConstraint(context, impls.named_constraint_id); - } + *incomplete = impls.named_constraint_id; return IdentifiedFacetTypeId::None; } @@ -1272,22 +1321,40 @@ auto TryToIdentifyFacetType(Context& context, SemIR::LocId loc_id, SemIR::TypeId facet_type_type_id, bool allow_partially_identified) -> IdentifiedFacetTypeId { + std::optional incomplete; return IdentifyFacetType(context, loc_id, self_const_id, facet_type_type_id.AsConstantId(), - allow_partially_identified, - /*diagnose=*/false); + allow_partially_identified, &incomplete); } auto RequireIdentifiedFacetType(Context& context, SemIR::LocId loc_id, SemIR::ConstantId self_const_id, SemIR::TypeId facet_type_type_id, - DiagnosticContextFn diagnostic_context, - bool diagnose) -> IdentifiedFacetTypeId { - CARBON_CHECK(diagnostic_context); - Diagnostics::ContextScope scope(&context.emitter(), diagnostic_context); - return IdentifyFacetType(context, loc_id, self_const_id, - facet_type_type_id.AsConstantId(), - /*allow_partially_identified=*/false, diagnose); + Diagnoser diagnoser) -> IdentifiedFacetTypeId { + // Identifying a facet type resolves the specifics of what it extends, which + // can emit diagnostics. As in `CompleteType`, a context scope labels those, + // and the diagnoser's diagnostic is built after the scope ends. + std::optional incomplete; + auto identified_id = IdentifiedFacetTypeId::None; + { + auto label_fn = [&](DiagnosticBuilder& builder) { + CARBON_DIAGNOSTIC_LABEL(InFacetTypeIdentification, + "in identification of facet type {0} here", + SemIR::TypeId); + builder.Attach(loc_id, InFacetTypeIdentification, facet_type_type_id); + }; + std::optional scope; + if (loc_id.has_value()) { + scope.emplace(&context.emitter(), label_fn); + } + identified_id = IdentifyFacetType( + context, loc_id, self_const_id, facet_type_type_id.AsConstantId(), + /*allow_partially_identified=*/false, &incomplete); + } + if (!identified_id.has_value() && diagnoser && incomplete) { + DiagnoseIncomplete(context, *incomplete, diagnoser); + } + return identified_id; } } // namespace Carbon::Check diff --git a/toolchain/check/type_completion.h b/toolchain/check/type_completion.h index 231f7eeaae8c..222898d67acd 100644 --- a/toolchain/check/type_completion.h +++ b/toolchain/check/type_completion.h @@ -20,8 +20,13 @@ namespace Carbon::Check { // However, it's important that we use it during monomorphization, where we // don't want to trigger a request for more monomorphization. // TODO: Remove the other call to this function. +// +// If the type is not complete because an entity it is built from isn't, +// `diagnoser`, when set, builds the diagnostic, which gets a label saying +// which entity. auto TryToCompleteType(Context& context, SemIR::TypeId type_id, - SemIR::LocId loc_id, bool diagnose = false) -> bool; + SemIR::LocId loc_id, Diagnoser diagnoser = nullptr) + -> bool; // Completes the type `type_id`. CHECK-fails if it can't be completed. auto CompleteTypeOrCheckFail(Context& context, SemIR::TypeId type_id) -> void; @@ -29,20 +34,18 @@ auto CompleteTypeOrCheckFail(Context& context, SemIR::TypeId type_id) -> void; // Like `TryToCompleteType`, but for cases where it is an error for the type // to be incomplete. // -// If the type is not complete, `diagnoser` is invoked to diagnose the issue, -// if a `diagnoser` is provided. The builder it returns will be annotated to -// describe the reason why the type is not complete. -// -// `diagnoser` should build an error diagnostic. If `type_id` is dependent, -// the completeness of the type will be enforced during monomorphization, and -// `loc_id` is used as the location for a diagnostic produced at that time. +// If the type is not complete because an entity it is built from isn't, +// `diagnoser` builds the diagnostic, which gets a label saying which entity. +// `diagnoser` must be set and should build an error. If `type_id` is +// dependent, the completeness of the type will be enforced during +// monomorphization, and `loc_id` is used as the location for a diagnostic +// produced at that time. // // Note that in general, the code that creates an inst is responsible for // enforcing any type completeness requirements associated with that inst; it // should not rely on its downstream consumers to do so. auto RequireCompleteType(Context& context, SemIR::TypeId type_id, - SemIR::LocId loc_id, - DiagnosticContextFn diagnostic_context) -> bool; + SemIR::LocId loc_id, Diagnoser diagnoser) -> bool; // Returns whether the type is complete and concrete. // @@ -57,17 +60,15 @@ auto TryIsConcreteType(Context& context, SemIR::TypeId type_id, // Returns true for types that are complete and that have an object // representation that may be used as a return type or variable type. // -// The `complete_type_diagnostic_context` is used to contextualize diagnostics -// in checking that the type is complete. The `concrete_type_diagnostic_context` -// is used to contextualize diagnostics in checking that the type is concrete. +// `complete_type_diagnoser` builds the diagnostic when the type is not +// complete, and `concrete_type_diagnoser` when it is complete but not +// concrete. Both must be set. // // Note: class types are abstract if marked using the `abstract` keyword; tuple // and struct types are abstract if any element is abstract. auto RequireConcreteType(Context& context, SemIR::TypeId type_id, - SemIR::LocId loc_id, - DiagnosticContextFn complete_type_diagnostic_context, - DiagnosticContextFn concrete_type_diagnostic_context) - -> bool; + SemIR::LocId loc_id, Diagnoser complete_type_diagnoser, + Diagnoser concrete_type_diagnoser) -> bool; // Performs `RequireIdentifiedFacetType`, but it is not an error if the facet // type is not identified. @@ -86,7 +87,9 @@ auto TryToIdentifyFacetType(Context& context, SemIR::LocId loc_id, // facet expression that is the self that the FacetType is constraining. The // `facet_type_inst_id` must be a FacetType (or ErrorInst). Produces a set of // interfaces that must be implemented for a set of facets, most of them for the -// `self_const_id`. Diagnoses an error and returns None if any error is found. +// `self_const_id`. Returns None if any error is found, and where the error is a +// constraint that isn't complete, builds the diagnostic through `diagnoser` +// when it is set. // // The `self_const_id` is converted to its canonical facet representation (any // `as type` conversion is stripped off), and this is visible in the resulting @@ -102,32 +105,28 @@ auto TryToIdentifyFacetType(Context& context, SemIR::LocId loc_id, // modified by `EvaluateIdentifiedWitnesses` or `SubstIdentifiedWitnesses` to // replace those temporary witnesses. // -// TODO: Remove `diagnose` and split into `TryIdentifyFacetType`. +// TODO: Remove the null-`diagnoser` case, which only impl lookup uses, in +// favor of `TryToIdentifyFacetType`. auto RequireIdentifiedFacetType(Context& context, SemIR::LocId loc_id, SemIR::ConstantId self_const_id, SemIR::TypeId facet_type_type_id, - DiagnosticContextFn diagnostic_context, - bool diagnose = true) -> IdentifiedFacetTypeId; + Diagnoser diagnoser) -> IdentifiedFacetTypeId; -// Emits an error diagnostic explaining that a class is incomplete. -// -// The caller must ensure a Context message will be provided to point to the -// failing operation that requires a complete class. -auto DiagnoseIncompleteClass(Context& context, SemIR::ClassId class_id) -> void; +// Emits the diagnostic `diagnoser` builds, with a label saying why the class +// is incomplete. +auto DiagnoseIncompleteClass(Context& context, SemIR::ClassId class_id, + Diagnoser diagnoser) -> void; -// Emits an error diagnostic explaining that an interface is not defined. -// -// The caller must ensure a Context message will be provided to point to the -// failing operation that requires a complete interface. +// Emits the diagnostic `diagnoser` builds, with a label saying why the +// interface is not defined. auto DiagnoseIncompleteInterface(Context& context, - SemIR::InterfaceId interface_id) -> void; + SemIR::InterfaceId interface_id, + Diagnoser diagnoser) -> void; -// Adds a note to a diagnostic explaining that a class is abstract. -// -// The caller must ensure a Context message will be provided to point to the -// failing operation that requires a concrete class. +// Emits the diagnostic `diagnoser` builds, with a label saying where the class +// was declared abstract. auto DiagnoseAbstractClass(Context& context, SemIR::ClassId class_id, - bool direct_use) -> void; + bool direct_use, Diagnoser diagnoser) -> void; } // namespace Carbon::Check diff --git a/toolchain/check/unused.cpp b/toolchain/check/unused.cpp index 94a0bf33da99..ea3fc7044b30 100644 --- a/toolchain/check/unused.cpp +++ b/toolchain/check/unused.cpp @@ -34,13 +34,18 @@ auto CheckUnusedBinding(Context& context, SemIR::NameId name_id, if (entity_name.is_unused) { if (result.use_loc_id.has_value()) { CARBON_DIAGNOSTIC_ON_SCOPE(UnusedButUsed, Error, - "variable `{0}` marked `unused` but used", + "binding `{0}` marked `unused` but used", SemIR::NameId); - CARBON_DIAGNOSTIC_LABEL(UnusedButUsedHere, Info, "usage here"); - context.emitter() - .Build(decl_loc, UnusedButUsed, name_id) - .Attach(result.use_loc_id, UnusedButUsedHere) - .Emit(); + CARBON_DIAGNOSTIC_LABEL(UnusedButUsedHere, "usage here"); + auto diag = context.emitter().Build(decl_loc, UnusedButUsed, name_id); + // Only attach a label when the use has a location distinct from the + // binding's. + auto use_loc_id = context.insts().GetCanonicalLocId(result.use_loc_id); + if (use_loc_id.has_value() && + use_loc_id != context.insts().GetCanonicalLocId(decl_loc)) { + diag.Attach(result.use_loc_id, UnusedButUsedHere); + } + diag.Emit(); } } else { if (!result.use_loc_id.has_value() && result.is_decl_reachable) { diff --git a/toolchain/diagnostics/check_diagnostics.py b/toolchain/diagnostics/check_diagnostics.py index 2d4badd5cdd4..69e84ddce07d 100755 --- a/toolchain/diagnostics/check_diagnostics.py +++ b/toolchain/diagnostics/check_diagnostics.py @@ -10,8 +10,8 @@ Validates that each diagnostic declared with CARBON_DIAGNOSTIC_KIND is referenced by one (and only one) CARBON_DIAGNOSTIC. -Labels, contexts, and location info have no kind to register, so this also -stands in for the registry. `label` below stands for any of the three: +Labels and location info have no kind to register, so this also does for them +what the registry does for kinds. `label` below stands for either: - Each label is attached somewhere. The compiler warns about most of these, but not about one declared in a header. @@ -47,27 +47,20 @@ from typing import Dict, List, NamedTuple, Set, override IGNORED = set(["TestDiagnostic"]) # The declarations that name something other than a diagnostic kind. A label -# marks a range of source; a context states a problem in terms of the operation -# it happened inside; location info is a step in the path a location was reached -# by. None of them is registered, and each carries a name that output and -# testdata can match on, so all three are checked here. -LABEL_DECL_RE = ( - r"CARBON_DIAGNOSTIC_(?:LABEL|SOFT_CONTEXT|CONTEXT|LOCATION_INFO)" - r"\(\s*(\w+)," -) +# is attached to a range of source; location info is a step in the path a +# location was reached by. Neither is registered, and each has a name that +# output and testdata can match on, so both are checked here. +LABEL_DECL_RE = r"CARBON_DIAGNOSTIC_(?:LABEL|LOCATION_INFO)\(\s*(\w+)," # Labels that no file_test exercises. This is `coverage_test`'s UntestedKinds # for labels, and entries are checked for being genuinely uncovered so that one # that gains a test has to be removed from here. UNCOVERED_LABELS = { # These exist only for unit tests, which write no testdata. - "TestContext", - "TestContext2", "TestInfo", "TestLabel", - "TestSoftContext", - "TestSoftContext2", - "TestSortContext", + # A label with no text, so no row of output names it. + "CppInteropNoteRange", # TODO: This is currently hard to test because it requires building and # importing a module, which attempts to create additional files with # unpredictable names in the module cache, which bazel doesn't permit. @@ -135,8 +128,8 @@ def load_diagnostic_uses_in( line_offset = 0 found: Dict[str, List[Loc]] = collections.defaultdict(lambda: []) - # `CARBON_DIAGNOSTIC_ON_SCOPE` declares a diagnostic too; the label, - # context, and location-info macros do not, and have no kind to register. + # `CARBON_DIAGNOSTIC_ON_SCOPE` declares a diagnostic too; the label and + # location-info macros do not, and have no kind to register. for m in re.finditer( r"CARBON_DIAGNOSTIC(?:_ON_SCOPE)?\(\s*(\w+),", content ): @@ -150,10 +143,10 @@ def load_diagnostic_uses_in( def load_labels_in(path: Path) -> Dict[str, List[Loc]]: - """Returns the path's label, context, and location-info declarations. + """Returns the path's label and location-info declarations. - All three carry a name the same way a kind does, so all three are checked - the same way, and `label` stands for any of them throughout this script. + Both carry a name the same way a kind does, so both are checked the same + way, and `label` stands for either throughout this script. """ content = strip_noise(path.read_text()) diff --git a/toolchain/diagnostics/coverage_test.cpp b/toolchain/diagnostics/coverage_test.cpp index 5408136b7a8f..917d7f4058fc 100644 --- a/toolchain/diagnostics/coverage_test.cpp +++ b/toolchain/diagnostics/coverage_test.cpp @@ -24,6 +24,11 @@ constexpr Kind UntestedKinds[] = { Kind::TestDiagnostic, Kind::TestDiagnosticOnScope, + // This states the problem for a `.Self` facet type that can't be + // identified, on a path no test reaches. + // TODO: Write a test that reaches it. + Kind::PeriodSelfUnidentifiedFacetType, + // Diagnosing erroneous install conditions, but test environments are // typically correct. Kind::BuildTempDirectoryCreationError, diff --git a/toolchain/diagnostics/diagnostic.h b/toolchain/diagnostics/diagnostic.h index 074c740ea028..1c3aeb9b2f74 100644 --- a/toolchain/diagnostics/diagnostic.h +++ b/toolchain/diagnostics/diagnostic.h @@ -30,21 +30,6 @@ enum class Level : int8_t { Error, }; -// What a labeled range of source has to do with the diagnostic it is attached -// to. -// -// A label is read against the code it marks rather than on its own, which is -// what separates one from a message: `declared here` is not a sentence anyone -// would want to read by itself. Anything that doesn't mark source that way is -// not a label: see `CARBON_DIAGNOSTIC_CONTEXT` and -// `CARBON_DIAGNOSTIC_LOCATION_INFO`. -enum class LabelCategory : int8_t { - // Source that explains why the problem happened without being part of it. - Info, - // Source that is directly part of the problem. - Primary, -}; - // Provides a definition of a diagnostic: the message that reports a problem // and stands alone as the sentence describing it. For example: // CARBON_DIAGNOSTIC(MyDiagnostic, Error, "invalid code!"); @@ -64,14 +49,18 @@ enum class LabelCategory : int8_t { // Provides a definition of a label: a phrase attached to a range of source, // saying what that range has to do with the diagnostic. For example: -// CARBON_DIAGNOSTIC_LABEL(ArgsPassedHere, Primary, -// "{0} argument{0:s} passed here", IntAsSelect); -// CARBON_DIAGNOSTIC_LABEL(FunctionDeclaredHere, Info, +// CARBON_DIAGNOSTIC_LABEL(FunctionDeclaredHere, // "calling function declared here"); +// CARBON_DIAGNOSTIC_LABEL(OperandType, "operand has type {0}", TypeOfInstId); // -// The category says what the range is to the diagnostic; see `LabelCategory`. +// A label is read together with the code it is attached to, which is what +// separates one from a message: `declared here` is not a sentence anyone would +// want to read by itself. A label explains the problem; code that is part of +// the problem is one of the message's ranges, added with +// `Emitter::Builder::ExtraRange`. // A label has a format and arguments of its own, so it says only what it needs -// to about the place it marks, and both are validated as a message's are. +// to about the source it is attached to, and both are validated as a message's +// are. // // It has no level, because it is read against the code rather than on its own, // and no kind, because there is no central registry of labels: a label is @@ -82,43 +71,17 @@ enum class LabelCategory : int8_t { // It still carries its own name, so that `--include-diagnostic-kind` can say // which label produced a line and a test can match on it. See // `Emitter::Builder::Attach`. -#define CARBON_DIAGNOSTIC_LABEL(LabelName, CategoryValue, Format, ...) \ - static constexpr auto LabelName = \ - ::Carbon::Diagnostics::LabelBase<__VA_ARGS__>( \ - ::Carbon::Diagnostics::LabelCategory::CategoryValue, #LabelName, \ - Format) - -// Provides a definition of a context: a sentence stating a problem in terms of -// the operation it happened inside. For example: -// CARBON_DIAGNOSTIC_CONTEXT(IncompleteTypeInFunctionReturnType, -// "function returns incomplete type {0}", -// SemIR::TypeId); -// -// A context is not a label. It is a sentence in its own right, the way a -// message is, so where a diagnostic has one it leads and the message is read -// against the code like anything else explaining it; see `LeadingContext`. It -// is attached by a `ContextScope` rather than by the code emitting a -// diagnostic. -#define CARBON_DIAGNOSTIC_CONTEXT(ContextName, Format, ...) \ - static constexpr auto ContextName = \ - ::Carbon::Diagnostics::ContextBase<__VA_ARGS__>(/*is_soft=*/false, \ - #ContextName, Format) - -// Like `CARBON_DIAGNOSTIC_CONTEXT`, for a context used only as a fallback: it -// is dropped when the diagnostic already has one, which is assumed to describe -// the failure better. -#define CARBON_DIAGNOSTIC_SOFT_CONTEXT(ContextName, Format, ...) \ - static constexpr auto ContextName = \ - ::Carbon::Diagnostics::ContextBase<__VA_ARGS__>(/*is_soft=*/true, \ - #ContextName, Format) +#define CARBON_DIAGNOSTIC_LABEL(LabelName, Format, ...) \ + static constexpr auto LabelName = \ + ::Carbon::Diagnostics::LabelBase<__VA_ARGS__>(#LabelName, Format) // Provides a definition of a step in the path by which a location was reached // -- an import, an include, a macro expansion. For example: // CARBON_DIAGNOSTIC_LOCATION_INFO(InImport, "imported from"); // -// This is not a label either: it marks no source, and is drawn as -// `: ` above the file it leads to. It is attached by an -// emitter's `ConvertLoc`, and takes no arguments, because that is all the +// This is not a label: it is attached to no source. The terminal renderer +// shows it as `: ` above the file it leads to. It is attached +// by an emitter's `ConvertLoc`, and takes no arguments, because that is all the // conversion has to give it. #define CARBON_DIAGNOSTIC_LOCATION_INFO(StepName, Format) \ static constexpr auto StepName = \ @@ -170,9 +133,9 @@ struct Loc { // `column_number` can be one more than the line's length. // // This is the range underlined in the source snippet. A message's own - // location is a point that an editor puts a cursor on, so where a range was - // attached to the same line to say what the problem covers, that range is - // drawn in its place rather than this one. See `Emitter::Builder::Attach`. + // location is a point that an editor puts a cursor on, so where one of the + // message's ranges contains it, that range is underlined in its place. See + // `Message::ranges`. int32_t length = 1; }; @@ -229,6 +192,11 @@ struct Message { // cursor, and the range underlined in the snippet. See `Loc::length`. Loc loc; + // The ranges the problem covers beyond `loc`, added with + // `Emitter::Builder::ExtraRange`. One that contains `loc` is underlined in + // place of `loc`'s own range; the rest are underlined with no text. + llvm::SmallVector ranges; + // How `loc` was reached, when it was reached through an import, an include, // or a macro expansion. Inline storage is off because a step is large and // almost nothing is reached through one. @@ -250,22 +218,17 @@ struct Message { FormatFn format_fn; }; -// A range of source attached to a diagnostic, and optionally a phrase saying -// what that range has to do with it. +// A range of source attached to a diagnostic to explain it, and optionally a +// phrase saying what that range has to do with it. // -// A label with no text marks its range and says nothing, which is how a -// diagnostic points at the code its message is about without repeating the -// message against it. +// A label's text can be empty, leaving only its range. struct Label { - // Returns the label's text, which is empty when it only marks a range. + // Returns the label's text, which is empty when the label has none. auto Format() const -> std::string { return format_fn ? format_fn(format, format_args) : std::string(); } - // What this range has to do with the diagnostic. - LabelCategory category; - - // The range of source this marks, from `Loc::column_number` across + // The range of source this is attached to, from `Loc::column_number` across // `Loc::length`. Loc loc; @@ -274,48 +237,16 @@ struct Label { // almost nothing is reached through one. llvm::SmallVector location_info; - // The label's own name; see `CARBON_DIAGNOSTIC_LABEL`. Empty for a label that - // only marks its range, which nothing needs to name because it says nothing. + // The label's own name; see `CARBON_DIAGNOSTIC_LABEL`. llvm::StringLiteral name = ""; - // The label's format for llvm::formatv, and the arguments to apply to it. - // Both are empty for a label that only marks its range. + // The label's format for llvm::formatv, and the arguments to apply to it. An + // empty format makes a label with no text. llvm::StringLiteral format = ""; llvm::SmallVector format_args; - // Empty for a label that only marks its range. - FormatFn format_fn; -}; - -// A problem stated in terms of the operation it happened inside; see -// `CARBON_DIAGNOSTIC_CONTEXT`. -// -// This is not a label: its text stands alone as a sentence rather than being -// read against the source it names, which is what lets it lead a diagnostic in -// place of the message. -struct Context { - // Returns the context's text. - auto Format() const -> std::string { - CARBON_CHECK(format_fn, "A context always has a `format_fn`."); - return format_fn(format, format_args); - } - - // Where the operation was entered. - Loc loc; - - // How `loc` was reached, when it was reached through an import, an include, - // or a macro expansion. Inline storage is off because a step is large and - // almost nothing is reached through one. - llvm::SmallVector location_info; - - // The context's own name; see `CARBON_DIAGNOSTIC_CONTEXT`. - llvm::StringLiteral name; - - // The context's format for llvm::formatv, and the arguments to apply to it. - llvm::StringLiteral format; - llvm::SmallVector format_args; - - // Returns the formatted string. By default, this uses llvm::formatv. + // Returns the formatted string. Empty only in a `Label` built by hand, which + // `Format` treats as having no text. FormatFn format_fn; }; @@ -346,13 +277,6 @@ struct Diagnostic { // The one problem being reported. Message message; - // The operations the problem happened inside, outermost first, which is the - // order their `ContextScope`s were entered in. - // - // A `Context` is undesirably large for inline storage by SmallVector, so we - // specify 0. - llvm::SmallVector contexts; - // The source attached to the message, in the order it was attached. // // A `Label` is undesirably large for inline storage by SmallVector, so we @@ -360,18 +284,6 @@ struct Diagnostic { llvm::SmallVector labels; }; -// Returns the context that leads the diagnostic in place of its message, or -// null when there is none. -// -// A context names the operation that failed, and when a diagnostic has one that -// is what the reader is told about; the message is then read against the code -// like anything else explaining it. Anything presenting a diagnostic as a -// single sentence, such as an editor's hover text, uses this instead of the -// message. -inline auto LeadingContext(const Diagnostic& diagnostic) -> const Context* { - return diagnostic.contexts.empty() ? nullptr : &diagnostic.contexts.front(); -} - // Rejects `Args` a diagnostic or label may not be formatted with, when the // enclosing constructor is instantiated. template @@ -404,18 +316,16 @@ struct DiagnosticBase { }; // Use the CARBON_DIAGNOSTIC_LABEL macro to instantiate this. This stores the -// static information about a label: what it is to the diagnostic, what it is -// called, its format, and the types of its arguments. +// static information about a label: what it is called, its format, and the +// types of its arguments. template struct LabelBase { - explicit constexpr LabelBase(LabelCategory category, llvm::StringLiteral name, + explicit constexpr LabelBase(llvm::StringLiteral name, llvm::StringLiteral format) - : Category(category), Name(name), Format(format) { + : Name(name), Format(format) { CheckArgTypes(); } - // What the labeled range is to the diagnostic. - LabelCategory Category; // The label's own name, which stands in for a diagnostic's kind when naming // what produced a line of output. llvm::StringLiteral Name; @@ -423,27 +333,6 @@ struct LabelBase { llvm::StringLiteral Format; }; -// Use the CARBON_DIAGNOSTIC_CONTEXT macro to instantiate this. This stores the -// static information about a context: whether it is only a fallback, what it is -// called, its format, and the types of its arguments. -template -struct ContextBase { - explicit constexpr ContextBase(bool is_soft, llvm::StringLiteral name, - llvm::StringLiteral format) - : IsSoft(is_soft), Name(name), Format(format) { - CheckArgTypes(); - } - - // Whether this is dropped when the diagnostic already has a context; see - // `CARBON_DIAGNOSTIC_SOFT_CONTEXT`. - bool IsSoft; - // The context's own name, which stands in for a diagnostic's kind when naming - // what produced a line of output. - llvm::StringLiteral Name; - // The context's format for llvm::formatv. - llvm::StringLiteral Format; -}; - // Use the CARBON_DIAGNOSTIC_LOCATION_INFO macro to instantiate this. This // stores the static information about a step in a path: what it is called and // its text. It is not a template, because a step has no arguments. diff --git a/toolchain/diagnostics/emitter.h b/toolchain/diagnostics/emitter.h index 920c3c2307d0..e5a7230a1e4d 100644 --- a/toolchain/diagnostics/emitter.h +++ b/toolchain/diagnostics/emitter.h @@ -32,9 +32,6 @@ using NoTypeDeduction = std::type_identity_t; } // namespace Internal -template -class AnnotationScope; - // The result of `Emitter::ConvertLoc`. This is non-templated to allow // sharing across converters. struct ConvertedLoc { @@ -87,16 +84,10 @@ class Emitter { auto Attach(LocT loc, const LabelBase& label, Internal::NoTypeDeduction... args) -> Builder&; - // Attaches a range of source with nothing to say about it beyond marking - // it. This is what points at the code the message is about without - // repeating the message against it. - // - // `category` says what the range is to the diagnostic, the way a declared - // label's does. A label saying nothing has no phrase to declare, so there - // is nothing for `CARBON_DIAGNOSTIC_LABEL` to hold and the category is - // passed here instead. - auto Attach(LocT loc, LabelCategory category = LabelCategory::Primary) - -> Builder&; + // Adds a range the problem covers beyond the message's location: the + // operand of an `&` that has no address to take, or the whole string + // literal that is missing its terminator. See `Message::ranges`. + auto ExtraRange(LocT loc) -> Builder&; // Emits the built diagnostic and its attached labels. // For the expected usage see the builder API: `Emitter::Build`. @@ -109,7 +100,6 @@ class Emitter { private: friend class Emitter; - friend class ContextBuilder; template explicit Builder(Emitter* emitter, LocT loc, @@ -121,19 +111,11 @@ class Emitter { auto ConvertLoc(LocT loc, llvm::SmallVector& location_info) -> Loc; - // Attaches a label, handling conversion of the location and arguments. The - // category comes from `label`, so this is the one path every label takes - // however it was attached. + // Attaches a label, handling conversion of the location and arguments. template auto AttachLabel(LocT loc, const LabelBase& label, llvm::SmallVector args) -> void; - // Attaches a context, handling conversion of the location and arguments. - // Only a `ContextScope` reaches this, through `ContextBuilder`. - template - auto AttachContext(LocT loc, const ContextBase& context, - llvm::SmallVector args) -> void; - // Returns a function that formats `Args` from the storage types they // convert to. // @@ -160,33 +142,11 @@ class Emitter { Level level_; bool is_on_scope_; int32_t last_byte_offset_ = -1; - // Absent only while the constructor is gathering the context that comes - // before the message. + // Absent only while the constructor is converting the message's location. std::optional message_; - llvm::SmallVector contexts_; llvm::SmallVector labels_; }; - class ContextBuilder { - public: - // Attaches a context describing a higher level operation that failed due to - // the diagnostic being built. The API mirrors the main emission API: - // `Emitter::Emit`. For the expected usage see the builder API: - // `Emitter::Build`. - template - auto Attach(LocT loc, const ContextBase& context, - Internal::NoTypeDeduction... args) -> ContextBuilder&; - - private: - friend class Emitter; - - explicit ContextBuilder(Emitter* emitter, Builder* builder) - : emitter_(emitter), builder_(builder) {} - - Emitter* emitter_; - Builder* builder_; - }; - // `consumer` is required to outlive the diagnostic emitter. explicit Emitter(Consumer* consumer) : consumer_(consumer) {} @@ -227,24 +187,15 @@ class Emitter { // the middle of producing a diagnostic, such as between Clang producing an // error and producing the attached notes. // - // This is called automatically before any diagnostic annotator is added or - // removed, so that a pending diagnostic gets the annotations that were in - // force when it was produced. Destruction deliberately does not flush; see - // the `Flush` test. + // This is called automatically before a `ContextScope` is entered or left, + // so that a pending diagnostic gets the labels of the scopes that were active + // when it was produced. Destruction does not flush; see the `Flush` test. auto Flush() -> void { for (auto& flush_fn : flush_fns_) { flush_fn(); } } - // Verifies that a callback is registered to provide context if a diagnostic - // is emitted. Allows a code path to require context, which then means its - // messages are read against the higher-level operation that failed. - // - // This is best effort as the registered callback can in practice do nothing, - // but that would be highly unusual. - auto CheckHasContext() -> void { CARBON_CHECK(!context_fns_.empty()); } - protected: // Callback type used to report the path a location was reached by from // ConvertLoc. Note that the first parameter type is Loc rather than @@ -253,8 +204,8 @@ class Emitter { llvm::function_refvoid>; // Converts a LocT to a Loc and its `last_byte_offset` (see - // `Message`). ConvertLoc may invoke context_fn to provide context - // messages. + // `Diagnostic::last_byte_offset`). Calls `context_fn` for each step in the + // path by which the location was reached. virtual auto ConvertLoc(LocT loc, ContextFnT context_fn) const -> ConvertedLoc = 0; @@ -270,15 +221,11 @@ class Emitter { template friend class ContextScope; - template - friend class AnnotationScope; Consumer* consumer_; llvm::SmallVectorvoid>, 1> flush_fns_; - llvm::SmallVectorvoid>> - context_fns_; llvm::SmallVectorvoid>> - annotate_fns_; + context_fns_; }; // This relies on `void*` location handling on `Emitter`. @@ -307,19 +254,20 @@ class NoLocEmitter : public Emitter { } }; -// An RAII object that denotes a scope in which any diagnostic produced should -// carry a context label describing the higher-level operation that failed. +// An RAII object that denotes a scope in which every diagnostic emitted gets a +// label naming the operation underway. // // This object is given a function `context` that will be called with a -// `ContextBuilder& builder` for any diagnostic that is emitted through the -// given emitter. That function can provide a context label that explains the -// higher level failure caused by the diagnostic by calling `builder.Attach`. +// `Builder& builder` for any diagnostic that is emitted through the given +// emitter, and that function attaches the label by calling `builder.Attach`. +// The message is left to the emitting code. A caller that can state the +// problem better than the code detecting it passes a diagnoser instead; see +// `/toolchain/docs/diagnostics.md`. template class ContextScope { public: ContextScope(Emitter* emitter, ContextFn context) - requires requires(ContextFn context, - Emitter::ContextBuilder& builder) { + requires requires(ContextFn context, Emitter::Builder& builder) { { context(builder) } -> std::same_as; } : emitter_(emitter), context_(std::move(context)) { @@ -341,39 +289,6 @@ template ContextScope(Emitter* emitter, ContextFn context) -> ContextScope; -// An RAII object that denotes a scope in which any diagnostic produced should -// be annotated in some way. -// -// This object is given a function `annotate` that will be called with a -// `Builder& builder` for any diagnostic that is emitted through the -// given emitter. That function can annotate the diagnostic by calling -// `builder.Attach` to attach labels. -template -class AnnotationScope { - public: - AnnotationScope(Emitter* emitter, AnnotateFn annotate) - requires requires(AnnotateFn annotate, Emitter::Builder& builder) { - { annotate(builder) } -> std::same_as; - } - : emitter_(emitter), annotate_(std::move(annotate)) { - emitter_->Flush(); - emitter_->annotate_fns_.push_back(annotate_); - } - ~AnnotationScope() { - emitter_->Flush(); - emitter_->annotate_fns_.pop_back(); - } - - private: - Emitter* emitter_; - // Make a copy of the annotation function to ensure that it lives long enough. - AnnotateFn annotate_; -}; - -template -AnnotationScope(Emitter* emitter, AnnotateFn annotate) - -> AnnotationScope; - // ============================================================================ // Only internal implementation details below this point. // ============================================================================ @@ -406,23 +321,22 @@ auto Emitter::Builder::Attach(LocT loc, const LabelBase& label, } template -auto Emitter::Builder::Attach(LocT loc, LabelCategory category) - -> Builder& { - // Left without a format and without a `format_fn`, which is how a label says - // it marks its range and no more. +auto Emitter::Builder::ExtraRange(LocT loc) -> Builder& { + CARBON_CHECK(message_, + "A builder has its message from the moment it exists."); + // A range has no `location_info` of its own, so this one is dropped. llvm::SmallVector location_info; - Loc loc_value = ConvertLoc(LocT(loc), location_info); - labels_.push_back(Label{.category = category, - .loc = loc_value, - .location_info = std::move(location_info)}); + message_->ranges.push_back(ConvertLoc(LocT(loc), location_info)); return *this; } template template auto Emitter::Builder::Emit() & -> void { - for (auto annotate_fn : llvm::reverse(emitter_->annotate_fns_)) { - annotate_fn(*this); + // Scope labels follow the ones the emitting code attached, innermost scope + // first, so that the most specific operation is listed first. + for (auto context_fn : llvm::reverse(emitter_->context_fns_)) { + context_fn(*this); } CARBON_CHECK(message_, "A builder has its message from the moment it exists."); @@ -431,7 +345,6 @@ auto Emitter::Builder::Emit() & -> void { .is_on_scope = is_on_scope_, .last_byte_offset = last_byte_offset_, .message = *std::move(message_), - .contexts = std::move(contexts_), .labels = std::move(labels_)}); } @@ -452,14 +365,6 @@ Emitter::Builder::Builder(Emitter* emitter, LocT loc, : emitter_(emitter), level_(diagnostic_base.Level), is_on_scope_(diagnostic_base.IsOnScope) { - // The context describes the operation the message happened inside, so it is - // gathered before the message it encloses -- which is also what makes its - // location the one the diagnostic sorts by. - ContextBuilder context_builder(emitter, this); - for (auto context_fn : emitter_->context_fns_) { - context_fn(context_builder); - } - llvm::SmallVector location_info; Loc loc_value = ConvertLoc(LocT(loc), location_info); message_ = Message{.kind = diagnostic_base.Kind, @@ -479,15 +384,12 @@ auto Emitter::Builder::ConvertLoc( location_info.push_back(LocationInfo{ .loc = step_loc, .name = step.Name, .format = step.Format}); }); - // The diagnostic sorts by where it was first rooted, which is the context's - // location when a `ContextScope` supplied one. + // The diagnostic sorts by its message's location. // - // TODO: A location reached through an import leaves the offset unset, because - // the steps leading to it count as having been added first. That looks - // unintended rather than deliberate, but it decides the order diagnostics are - // printed in, so changing it is its own change with its own testdata. - if (!message_ && contexts_.empty() && labels_.empty() && - location_info.empty()) { + // TODO: A message location reached through an import leaves the offset at + // -1, which decides the order diagnostics are printed in. Decide whether that + // is intended; changing it needs its own testdata update. + if (!message_ && location_info.empty()) { last_byte_offset_ = converted.last_byte_offset; } return converted.loc; @@ -501,8 +403,7 @@ auto Emitter::Builder::AttachLabel(LocT loc, -> void { llvm::SmallVector location_info; Loc loc_value = ConvertLoc(LocT(loc), location_info); - labels_.push_back(Label{.category = label.Category, - .loc = std::move(loc_value), + labels_.push_back(Label{.loc = std::move(loc_value), .location_info = std::move(location_info), .name = label.Name, .format = label.Format, @@ -510,22 +411,6 @@ auto Emitter::Builder::AttachLabel(LocT loc, .format_fn = MakeFormatFn()}); } -template -template -auto Emitter::Builder::AttachContext(LocT loc, - const ContextBase& context, - llvm::SmallVector args) - -> void { - llvm::SmallVector location_info; - Loc loc_value = ConvertLoc(LocT(loc), location_info); - contexts_.push_back(Context{.loc = std::move(loc_value), - .location_info = std::move(location_info), - .name = context.Name, - .format = context.Format, - .format_args = std::move(args), - .format_fn = MakeFormatFn()}); -} - template template auto Emitter::Builder::MakeFormatFn() -> Diagnostics::FormatFn { @@ -564,19 +449,6 @@ auto Emitter::Emit(LocT loc, builder.Emit(); } -template -template -auto Emitter::ContextBuilder::Attach( - LocT loc, const ContextBase& context, - Internal::NoTypeDeduction... args) -> ContextBuilder& { - if (context.IsSoft && !builder_->contexts_.empty()) { - return *this; - } - builder_->AttachContext(LocT(loc), context, - {emitter_->template MakeAny(args)...}); - return *this; -} - template template auto Emitter::Build(LocT loc, diff --git a/toolchain/diagnostics/emitter_test.cpp b/toolchain/diagnostics/emitter_test.cpp index 1a7625c13cec..dab269ed7f35 100644 --- a/toolchain/diagnostics/emitter_test.cpp +++ b/toolchain/diagnostics/emitter_test.cpp @@ -15,8 +15,8 @@ namespace Carbon::Testing { namespace { +using testing::_; using testing::ElementsAre; -using testing::IsEmpty; class FakeEmitter : public Diagnostics::Emitter { public: @@ -71,181 +71,59 @@ TEST_F(EmitterTest, AttachLabel) { // The label has arguments and a format of its own, both validated. CARBON_DIAGNOSTIC(TestDiagnostic, Error, "expected {0}, found {1}", std::string, std::string); - CARBON_DIAGNOSTIC_LABEL(TestLabel, Primary, "this is {0}", std::string); - EXPECT_CALL( - consumer_, - HandleDiagnostic(IsDiagnostic( - Diagnostics::Level::Error, - IsDiagnosticMessage(Diagnostics::Kind::TestDiagnostic, - Diagnostics::Level::Error, 1, 1, - "expected i32, found String"), - IsEmpty(), - ElementsAre(IsDiagnosticLabel(Diagnostics::LabelCategory::Primary, 1, - 2, "this is String"))))); + CARBON_DIAGNOSTIC_LABEL(TestLabel, "this is {0}", std::string); + EXPECT_CALL(consumer_, + HandleDiagnostic(IsDiagnostic( + Diagnostics::Level::Error, + IsDiagnosticMessage(Diagnostics::Kind::TestDiagnostic, + Diagnostics::Level::Error, 1, 1, + "expected i32, found String"), + ElementsAre(IsDiagnosticLabel(1, 2, "this is String"))))); emitter_.Build(1, TestDiagnostic, "i32", "String") .Attach(2, TestLabel, "String") .Emit(); } -TEST_F(EmitterTest, AttachRangeWithNoText) { - // A label with nothing to say marks its range and no more, which is how a - // diagnostic points at the code its message is about. +TEST_F(EmitterTest, ExtraRange) { + // `ExtraRange` adds to the message's ranges and attaches no label. CARBON_DIAGNOSTIC(TestDiagnostic, Error, "simple error"); EXPECT_CALL( consumer_, - HandleDiagnostic(IsDiagnostic( - Diagnostics::Level::Error, - IsDiagnosticMessage(Diagnostics::Kind::TestDiagnostic, - Diagnostics::Level::Error, 1, 1, "simple error"), - IsEmpty(), - ElementsAre(IsDiagnosticLabel(Diagnostics::LabelCategory::Primary, 1, - 2, ""))))); - emitter_.Build(1, TestDiagnostic).Attach(2).Emit(); -} - -TEST_F(EmitterTest, AttachRangeWithNoTextAsInfo) { - // A range that only explains the problem can say nothing about itself too, - // which is what the category on the wordless `Attach` is for: there is no - // phrase to declare, so there is nowhere else to say what the range is. - CARBON_DIAGNOSTIC(TestDiagnostic, Error, "simple error"); - EXPECT_CALL( - consumer_, - HandleDiagnostic(IsDiagnostic( - Diagnostics::Level::Error, - IsDiagnosticMessage(Diagnostics::Kind::TestDiagnostic, - Diagnostics::Level::Error, 1, 1, "simple error"), - IsEmpty(), - ElementsAre( - IsDiagnosticLabel(Diagnostics::LabelCategory::Info, 1, 2, ""))))); - emitter_.Build(1, TestDiagnostic) - .Attach(2, Diagnostics::LabelCategory::Info) - .Emit(); + HandleDiagnostic(IsDiagnosticWithRange( + Diagnostics::Kind::TestDiagnostic, Diagnostics::Level::Error, + {.line_number = 1, .column_number = 1, .length = _}, "simple error", + {.line_number = 1, .column_number = 2, .length = _}))); + emitter_.Build(1, TestDiagnostic).ExtraRange(2).Emit(); } TEST_F(EmitterTest, AttachInfo) { CARBON_DIAGNOSTIC(TestDiagnostic, Warning, "simple warning"); - CARBON_DIAGNOSTIC_LABEL(TestInfo, Info, "note"); + CARBON_DIAGNOSTIC_LABEL(TestInfo, "note"); EXPECT_CALL(consumer_, HandleDiagnostic(IsDiagnostic( Diagnostics::Level::Warning, IsDiagnosticMessage(Diagnostics::Kind::TestDiagnostic, Diagnostics::Level::Warning, 1, 1, "simple warning"), - IsEmpty(), - ElementsAre(IsDiagnosticLabel( - Diagnostics::LabelCategory::Info, 1, 2, "note"))))); + ElementsAre(IsDiagnosticLabel(1, 2, "note"))))); emitter_.Build(1, TestDiagnostic).Attach(2, TestInfo).Emit(); } -TEST_F(EmitterTest, EmitContext) { - CARBON_DIAGNOSTIC_CONTEXT(TestContext, "context"); - CARBON_DIAGNOSTIC(TestDiagnostic, Warning, "simple warning"); - EXPECT_CALL( - consumer_, - HandleDiagnostic(IsDiagnostic( - Diagnostics::Level::Warning, - IsDiagnosticMessage(Diagnostics::Kind::TestDiagnostic, - Diagnostics::Level::Warning, 1, 1, - "simple warning"), - ElementsAre(IsDiagnosticContext(1, 2, "context")), IsEmpty()))); - Diagnostics::ContextScope scope( - &emitter_, [&](auto& builder) { builder.Attach(2, TestContext); }); - emitter_.Emit(1, TestDiagnostic); -} - -TEST_F(EmitterTest, EmitSoftContext) { - CARBON_DIAGNOSTIC_SOFT_CONTEXT(TestSoftContext, "soft context"); - CARBON_DIAGNOSTIC(TestDiagnostic, Warning, "simple warning"); - EXPECT_CALL( - consumer_, - HandleDiagnostic(IsDiagnostic( - Diagnostics::Level::Warning, - IsDiagnosticMessage(Diagnostics::Kind::TestDiagnostic, - Diagnostics::Level::Warning, 1, 1, - "simple warning"), - ElementsAre(IsDiagnosticContext(1, 2, "soft context")), IsEmpty()))); - Diagnostics::ContextScope soft_scope( - &emitter_, [&](auto& builder) { builder.Attach(2, TestSoftContext); }); - emitter_.Emit(1, TestDiagnostic); -} - -TEST_F(EmitterTest, EmitSoftContextAndContext) { - CARBON_DIAGNOSTIC_SOFT_CONTEXT(TestSoftContext, "soft context"); - CARBON_DIAGNOSTIC_CONTEXT(TestContext, "context"); +TEST_F(EmitterTest, ContextScopesAttachLabelsInnermostFirst) { CARBON_DIAGNOSTIC(TestDiagnostic, Warning, "simple warning"); + CARBON_DIAGNOSTIC_LABEL(TestLabel, "in {0}", std::string); EXPECT_CALL(consumer_, HandleDiagnostic(IsDiagnostic( Diagnostics::Level::Warning, IsDiagnosticMessage(Diagnostics::Kind::TestDiagnostic, Diagnostics::Level::Warning, 1, 1, "simple warning"), - ElementsAre(IsDiagnosticContext(1, 3, "soft context"), - IsDiagnosticContext(1, 2, "context")), - IsEmpty()))); - Diagnostics::ContextScope soft_scope( - &emitter_, [&](auto& builder) { builder.Attach(3, TestSoftContext); }); - Diagnostics::ContextScope scope( - &emitter_, [&](auto& builder) { builder.Attach(2, TestContext); }); - emitter_.Emit(1, TestDiagnostic); -} - -TEST_F(EmitterTest, EmitContextAndSoftContext) { - CARBON_DIAGNOSTIC_CONTEXT(TestContext, "context"); - CARBON_DIAGNOSTIC_SOFT_CONTEXT(TestSoftContext, "soft context"); - CARBON_DIAGNOSTIC(TestDiagnostic, Warning, "simple warning"); - EXPECT_CALL( - consumer_, - HandleDiagnostic(IsDiagnostic( - Diagnostics::Level::Warning, - IsDiagnosticMessage(Diagnostics::Kind::TestDiagnostic, - Diagnostics::Level::Warning, 1, 1, - "simple warning"), - ElementsAre(IsDiagnosticContext(1, 3, "context")), IsEmpty()))); - Diagnostics::ContextScope scope( - &emitter_, [&](auto& builder) { builder.Attach(3, TestContext); }); - // This soft context is dropped, since the earlier context supersedes it. - Diagnostics::ContextScope soft_scope( - &emitter_, [&](auto& builder) { builder.Attach(2, TestSoftContext); }); - emitter_.Emit(1, TestDiagnostic); -} - -TEST_F(EmitterTest, EmitTwoContext) { - CARBON_DIAGNOSTIC_CONTEXT(TestContext, "context"); - CARBON_DIAGNOSTIC_CONTEXT(TestContext2, "context 2"); - CARBON_DIAGNOSTIC(TestDiagnostic, Warning, "simple warning"); - EXPECT_CALL(consumer_, - HandleDiagnostic(IsDiagnostic( - Diagnostics::Level::Warning, - IsDiagnosticMessage(Diagnostics::Kind::TestDiagnostic, - Diagnostics::Level::Warning, 1, 1, - "simple warning"), - ElementsAre(IsDiagnosticContext(1, 3, "context"), - IsDiagnosticContext(1, 2, "context 2")), - IsEmpty()))); - Diagnostics::ContextScope scope( - &emitter_, [&](auto& builder) { builder.Attach(3, TestContext); }); - Diagnostics::ContextScope scope2( - &emitter_, [&](auto& builder) { builder.Attach(2, TestContext2); }); - emitter_.Emit(1, TestDiagnostic); -} - -TEST_F(EmitterTest, EmitTwoSoftContext) { - CARBON_DIAGNOSTIC_SOFT_CONTEXT(TestSoftContext, "soft context"); - CARBON_DIAGNOSTIC_SOFT_CONTEXT(TestSoftContext2, "soft context 2"); - CARBON_DIAGNOSTIC(TestDiagnostic, Warning, "simple warning"); - EXPECT_CALL( - consumer_, - HandleDiagnostic(IsDiagnostic( - Diagnostics::Level::Warning, - IsDiagnosticMessage(Diagnostics::Kind::TestDiagnostic, - Diagnostics::Level::Warning, 1, 1, - "simple warning"), - ElementsAre(IsDiagnosticContext(1, 3, "soft context")), IsEmpty()))); - Diagnostics::ContextScope scope( - &emitter_, [&](auto& builder) { builder.Attach(3, TestSoftContext); }); - // This soft context is dropped, since the earlier one supersedes it. - Diagnostics::ContextScope soft_scope( - &emitter_, [&](auto& builder) { builder.Attach(2, TestSoftContext2); }); + ElementsAre(IsDiagnosticLabel(1, 2, "in inner"), + IsDiagnosticLabel(1, 3, "in outer"))))); + Diagnostics::ContextScope outer( + &emitter_, [&](auto& builder) { builder.Attach(3, TestLabel, "outer"); }); + Diagnostics::ContextScope inner( + &emitter_, [&](auto& builder) { builder.Attach(2, TestLabel, "inner"); }); emitter_.Emit(1, TestDiagnostic); } @@ -266,14 +144,14 @@ TEST_F(EmitterTest, Flush) { flushed = false; { - Diagnostics::AnnotationScope annot(&emitter, [](auto&) {}); + Diagnostics::ContextScope scope(&emitter, [](auto&) {}); - // Registering an annotation scope should flush. + // Entering a context scope should flush. EXPECT_TRUE(flushed); flushed = false; } - // Unregistering an annotation scope should flush. + // Leaving a context scope should flush. EXPECT_TRUE(flushed); flushed = false; } diff --git a/toolchain/diagnostics/kind.def b/toolchain/diagnostics/kind.def index 0b4ae0d18c06..f6480c3c0707 100644 --- a/toolchain/diagnostics/kind.def +++ b/toolchain/diagnostics/kind.def @@ -219,7 +219,37 @@ CARBON_DIAGNOSTIC_KIND(NestedWhereInsideWhere) CARBON_DIAGNOSTIC_KIND(SemanticsTodo) -// Location context. +// Requirements that a type be complete, concrete, or an identified facet type, +// stated by the code that required it. +CARBON_DIAGNOSTIC_KIND(AbstractTypeInAdaptDecl) +CARBON_DIAGNOSTIC_KIND(AbstractTypeInFunctionReturnType) +CARBON_DIAGNOSTIC_KIND(AbstractTypeInVarPattern) +CARBON_DIAGNOSTIC_KIND(ExtendImplAsIncomplete) +CARBON_DIAGNOSTIC_KIND(ImplAsIncompleteFacetTypeDefinition) +CARBON_DIAGNOSTIC_KIND(ImplLookupInUnidentifiedFacetType) +CARBON_DIAGNOSTIC_KIND(ImplOfUnidentifiedFacetType) +CARBON_DIAGNOSTIC_KIND(IncompleteOperandTypeInCppOperatorLookup) +CARBON_DIAGNOSTIC_KIND(IncompleteTypeInAdaptDecl) +CARBON_DIAGNOSTIC_KIND(IncompleteTypeInBaseDecl) +CARBON_DIAGNOSTIC_KIND(IncompleteTypeInBindingDecl) +CARBON_DIAGNOSTIC_KIND(IncompleteTypeInBuiltinConversion) +CARBON_DIAGNOSTIC_KIND(IncompleteTypeInConversion) +CARBON_DIAGNOSTIC_KIND(IncompleteTypeInCopyWitness) +CARBON_DIAGNOSTIC_KIND(IncompleteTypeInCppUse) +CARBON_DIAGNOSTIC_KIND(IncompleteTypeInFunctionParam) +CARBON_DIAGNOSTIC_KIND(IncompleteTypeInFunctionReturnType) +CARBON_DIAGNOSTIC_KIND(IncompleteTypeInMemberAccess) +CARBON_DIAGNOSTIC_KIND(IncompleteTypeInMemberAccessOfFacet) +CARBON_DIAGNOSTIC_KIND(IncompleteTypeInMonomorphization) +CARBON_DIAGNOSTIC_KIND(IncompleteTypeInValueConversion) +CARBON_DIAGNOSTIC_KIND(PeriodSelfUnidentifiedFacetType) +CARBON_DIAGNOSTIC_KIND(QualifiedDeclInIncompleteClassScope) +CARBON_DIAGNOSTIC_KIND(QualifiedDeclInUndefinedInterfaceScope) +CARBON_DIAGNOSTIC_KIND(QualifiedExprInIncompleteClassScope) +CARBON_DIAGNOSTIC_KIND(QualifiedExprInIncompleteFacetTypeScope) +CARBON_DIAGNOSTIC_KIND(RequireImplsIncompleteFacetType) +CARBON_DIAGNOSTIC_KIND(RequireImplsUnidentifiedFacetType) +CARBON_DIAGNOSTIC_KIND(StringLiteralTypeIncomplete) // Package/import checking diagnostics. CARBON_DIAGNOSTIC_KIND(CppInteropFuzzing) @@ -273,6 +303,7 @@ CARBON_DIAGNOSTIC_KIND(CallToNonCallable) CARBON_DIAGNOSTIC_KIND(CppCallArgTypeNotSupported) CARBON_DIAGNOSTIC_KIND(CppCallFieldNameNotSupported) CARBON_DIAGNOSTIC_KIND(GenericParamMustBeConstant) +CARBON_DIAGNOSTIC_KIND(VarParamIsRuntime) CARBON_DIAGNOSTIC_KIND(ImplictParamMustBeConstant) CARBON_DIAGNOSTIC_KIND(RefParamNoRefTag) CARBON_DIAGNOSTIC_KIND(RefTagNoRefParam) @@ -303,10 +334,7 @@ CARBON_DIAGNOSTIC_KIND(BaseDeclRepeated) CARBON_DIAGNOSTIC_KIND(BaseIsFinal) CARBON_DIAGNOSTIC_KIND(BaseMissingExtend) CARBON_DIAGNOSTIC_KIND(BaseDeclAfterFieldDecl) -CARBON_DIAGNOSTIC_KIND(ClassAbstractHere) CARBON_DIAGNOSTIC_KIND(ClassSpecificDeclOutsideClass) -CARBON_DIAGNOSTIC_KIND(ClassForwardDeclaredHere) -CARBON_DIAGNOSTIC_KIND(ClassIncompleteWithinDefinition) CARBON_DIAGNOSTIC_KIND(FieldNamedUnderscore) CARBON_DIAGNOSTIC_KIND(FieldWithStructPattern) CARBON_DIAGNOSTIC_KIND(FieldWithTuplePattern) @@ -327,17 +355,9 @@ CARBON_DIAGNOSTIC_KIND(RuntimeConversionDuringCompTimeDeduction) CARBON_DIAGNOSTIC_KIND(ExportNotImportedEntity) CARBON_DIAGNOSTIC_KIND(ExportRedundant) -// Interface checking. -CARBON_DIAGNOSTIC_KIND(InterfaceForwardDeclaredHere) -CARBON_DIAGNOSTIC_KIND(InterfaceIncompleteWithinDefinition) - // MatchFirst checking. CARBON_DIAGNOSTIC_KIND(MatchFirstInWrongScope) -// Named constraint checking. -CARBON_DIAGNOSTIC_KIND(NamedConstraintForwardDeclaredHere) -CARBON_DIAGNOSTIC_KIND(NamedConstraintIncompleteWithinDefinition) - // Impl checking. CARBON_DIAGNOSTIC_KIND(ExtendImplForall) CARBON_DIAGNOSTIC_KIND(ExtendImplOutsideClass) @@ -368,7 +388,6 @@ CARBON_DIAGNOSTIC_KIND(AssociatedConstantGivenDifferentValues) // Impl lookup. CARBON_DIAGNOSTIC_KIND(MissingImplInMemberAccess) -CARBON_DIAGNOSTIC_KIND(MissingImplInMemberAccessInContext) CARBON_DIAGNOSTIC_KIND(ImplLookupCycle) // Require checking. @@ -424,6 +443,7 @@ CARBON_DIAGNOSTIC_KIND(ContinueOutsideLoop) CARBON_DIAGNOSTIC_KIND(CoreNameNotFound) CARBON_DIAGNOSTIC_KIND(CoreNotFound) CARBON_DIAGNOSTIC_KIND(DerefOfNonPointer) +CARBON_DIAGNOSTIC_KIND(DerefOfType) CARBON_DIAGNOSTIC_KIND(CompoundMemberAccessDoesNotUseBase) CARBON_DIAGNOSTIC_KIND(EvalRequiresConstantValue) CARBON_DIAGNOSTIC_KIND(FormExprEvaluationFailure) @@ -480,9 +500,12 @@ CARBON_DIAGNOSTIC_KIND(ReturnStatementDisallowExpr) CARBON_DIAGNOSTIC_KIND(ReturnStatementMissingExpr) CARBON_DIAGNOSTIC_KIND(DeducedReturnTypeMismatch) CARBON_DIAGNOSTIC_KIND(DeducedReturnTypeWithoutReturn) +CARBON_DIAGNOSTIC_KIND(ConversionFailure) CARBON_DIAGNOSTIC_KIND(ConversionFailureFacetToFacet) +CARBON_DIAGNOSTIC_KIND(ConversionFailureNonTypeToFacet) CARBON_DIAGNOSTIC_KIND(ConversionFailureTypeToFacet) CARBON_DIAGNOSTIC_KIND(ConversionFailureNonRefToRef) +CARBON_DIAGNOSTIC_KIND(CopyOfUncopyableType) CARBON_DIAGNOSTIC_KIND(TypeExprEvaluationFailure) CARBON_DIAGNOSTIC_KIND(UnexpectedDeclNameParams) CARBON_DIAGNOSTIC_KIND(QualifiedNameInNonScope) diff --git a/toolchain/diagnostics/mocks.cpp b/toolchain/diagnostics/mocks.cpp index 6bbead7bb858..6b845c6912a8 100644 --- a/toolchain/diagnostics/mocks.cpp +++ b/toolchain/diagnostics/mocks.cpp @@ -14,16 +14,13 @@ auto PrintTo(const Diagnostic& diagnostic, std::ostream* os) -> void { const Loc& loc = diagnostic.message.loc; *os << ", {" << loc.filename << ":" << loc.line_number << ":" << loc.column_number << ", \"" << diagnostic.message.Format() << "\"}"; - for (const auto& context : diagnostic.contexts) { - *os << ", {Context " << context.loc.filename << ":" - << context.loc.line_number << ":" << context.loc.column_number << ", \"" - << context.Format() << "\"}"; + for (const auto& range : diagnostic.message.ranges) { + *os << ", {Range " << range.filename << ":" << range.line_number << ":" + << range.column_number << "+" << range.length << "}"; } for (const auto& label : diagnostic.labels) { - *os << ", {"; - PrintTo(label.category, os); - *os << " " << label.loc.filename << ":" << label.loc.line_number << ":" - << label.loc.column_number << ", \"" << label.Format() << "\"}"; + *os << ", {Label " << label.loc.filename << ":" << label.loc.line_number + << ":" << label.loc.column_number << ", \"" << label.Format() << "\"}"; } *os << "}"; } @@ -39,15 +36,4 @@ auto PrintTo(Level level, std::ostream* os) -> void { } } -auto PrintTo(LabelCategory category, std::ostream* os) -> void { - switch (category) { - case LabelCategory::Info: - *os << "Info"; - break; - case LabelCategory::Primary: - *os << "Primary"; - break; - } -} - } // namespace Carbon::Diagnostics diff --git a/toolchain/diagnostics/mocks.h b/toolchain/diagnostics/mocks.h index 22d20dc4adb2..02fd1c939da6 100644 --- a/toolchain/diagnostics/mocks.h +++ b/toolchain/diagnostics/mocks.h @@ -30,13 +30,6 @@ MATCHER_P(IsDiagnosticsLabelString, matcher, "") { return testing::ExplainMatchResult(matcher, label.Format(), result_listener); } -// NOLINTNEXTLINE(modernize-use-trailing-return-type): From the macro. -MATCHER_P(IsDiagnosticsContextString, matcher, "") { - const Diagnostics::Context& context = arg; - return testing::ExplainMatchResult(matcher, context.Format(), - result_listener); -} - // Matches the location fields both a message and a label carry. template auto IsAtLoc(testing::Matcher line_number, @@ -64,37 +57,22 @@ inline auto IsDiagnosticMessage(testing::Matcher kind, IsDiagnosticsMessageString(message)); } -inline auto IsDiagnosticLabel( - testing::Matcher category, - testing::Matcher line_number, testing::Matcher column_number, - testing::Matcher text) +inline auto IsDiagnosticLabel(testing::Matcher line_number, + testing::Matcher column_number, + testing::Matcher text) -> testing::Matcher { - using testing::AllOf; - using testing::Field; - return AllOf(Field("category", &Diagnostics::Label::category, category), - IsAtLoc(line_number, column_number), - IsDiagnosticsLabelString(text)); -} - -inline auto IsDiagnosticContext(testing::Matcher line_number, - testing::Matcher column_number, - testing::Matcher text) - -> testing::Matcher { - return testing::AllOf( - IsAtLoc(line_number, column_number), - IsDiagnosticsContextString(text)); + return testing::AllOf(IsAtLoc(line_number, column_number), + IsDiagnosticsLabelString(text)); } inline auto IsDiagnostic( testing::Matcher level, testing::Matcher message, - testing::Matcher> contexts, testing::Matcher> labels) -> testing::Matcher { return testing::AllOf( testing::Field("level", &Diagnostics::Diagnostic::level, level), testing::Field("message", &Diagnostics::Diagnostic::message, message), - testing::Field("contexts", &Diagnostics::Diagnostic::contexts, contexts), testing::Field("labels", &Diagnostics::Diagnostic::labels, labels)); } @@ -105,32 +83,36 @@ struct ExpectedLoc { testing::Matcher length; }; -// Matches a diagnostic with one message and one range attached to it with no -// text, checking the lengths of the message's location and of the range as -// well as their starts. +// Matches a diagnostic whose message has one extra range, checking the lengths +// of the message's location and of the range as well as their starts, and that +// has no labels. inline auto IsDiagnosticWithRange(testing::Matcher kind, testing::Matcher level, ExpectedLoc loc, testing::Matcher message, ExpectedLoc range) -> testing::Matcher { + using testing::AllOf; + using testing::Field; return IsDiagnostic( level, - testing::AllOf( - IsDiagnosticMessage(kind, level, loc.line_number, loc.column_number, - message), - testing::Field( - "loc", &Diagnostics::Message::loc, - testing::Field("length", &Diagnostics::Loc::length, loc.length))), - testing::IsEmpty(), - testing::ElementsAre(testing::AllOf( - IsDiagnosticLabel(Diagnostics::LabelCategory::Primary, - range.line_number, range.column_number, ""), - testing::Field("loc", &Diagnostics::Label::loc, - testing::Field("length", &Diagnostics::Loc::length, - range.length))))); + AllOf(IsDiagnosticMessage(kind, level, loc.line_number, loc.column_number, + message), + Field("loc", &Diagnostics::Message::loc, + Field("length", &Diagnostics::Loc::length, loc.length)), + Field("ranges", &Diagnostics::Message::ranges, + testing::ElementsAre(AllOf( + Field("line_number", &Diagnostics::Loc::line_number, + range.line_number), + Field("column_number", &Diagnostics::Loc::column_number, + range.column_number), + Field("length", &Diagnostics::Loc::length, + range.length))))), + testing::IsEmpty()); } +// Matches a diagnostic with a message and nothing else: no extra ranges and no +// labels. inline auto IsSingleDiagnostic(testing::Matcher kind, testing::Matcher level, testing::Matcher line_number, @@ -139,8 +121,11 @@ inline auto IsSingleDiagnostic(testing::Matcher kind, -> testing::Matcher { return IsDiagnostic( level, - IsDiagnosticMessage(kind, level, line_number, column_number, message), - testing::IsEmpty(), testing::IsEmpty()); + testing::AllOf( + IsDiagnosticMessage(kind, level, line_number, column_number, message), + testing::Field("ranges", &Diagnostics::Message::ranges, + testing::IsEmpty())), + testing::IsEmpty()); } // Matches a diagnostic with one message, located at the point just before @@ -157,8 +142,10 @@ inline auto IsPointDiagnostic(testing::Matcher kind, IsDiagnosticMessage(kind, level, line_number, column_number, message), testing::Field( "loc", &Diagnostics::Message::loc, - testing::Field("length", &Diagnostics::Loc::length, 0))), - testing::IsEmpty(), testing::IsEmpty()); + testing::Field("length", &Diagnostics::Loc::length, 0)), + testing::Field("ranges", &Diagnostics::Message::ranges, + testing::IsEmpty())), + testing::IsEmpty()); } } // namespace Carbon::Testing @@ -168,7 +155,6 @@ namespace Carbon::Diagnostics { // Printing helpers for tests. auto PrintTo(const Diagnostic& diagnostic, std::ostream* os) -> void; auto PrintTo(Level level, std::ostream* os) -> void; -auto PrintTo(LabelCategory category, std::ostream* os) -> void; } // namespace Carbon::Diagnostics diff --git a/toolchain/diagnostics/renderer.cpp b/toolchain/diagnostics/renderer.cpp index eb70d0d9b351..71814eeda6c2 100644 --- a/toolchain/diagnostics/renderer.cpp +++ b/toolchain/diagnostics/renderer.cpp @@ -155,9 +155,9 @@ static auto LevelText(Level level) -> llvm::StringRef { // brighten them -- so the weight says nothing reliable there while it still // says something on words. // -// `RotateUnderlineStyles` makes one exception: the heavy underline keeps its -// bold. A terminal that ignores bold on line art loses nothing there, and one -// that renders it matches the underline to the bold text placed under it. +// `RotateUnderlineStyles` makes one exception: the message's underline keeps +// its bold. A terminal that ignores bold on line art loses nothing there, and +// on one that renders it the underline matches the bold text placed under it. static auto UnderlineStyle(const Style& style) -> Style { return style.Bold(false); } @@ -463,12 +463,9 @@ struct PreparedSource { enum class Part : int8_t { // A step in the path by which the part after it was reached. LocationInfo, - // Something read against the code to explain the problem rather than to - // state it: a label, or the message itself once a context is stating the - // problem in its place. + // A label, which explains the problem. Explanation, - // The problem itself: whatever leads the diagnostic, and the source that is - // directly part of it. + // The message and its ranges. Problem, }; @@ -477,26 +474,23 @@ struct PreparedPart { // What this is to the reader. Part role = Part::Explanation; - // Whether this part states the problem: the message, or the context that - // `LeadingContext` returns. Its text begins with the level word and is - // bold, and its underline is the heavy one. - // - // TODO: The design has a context scope attach a label instead of leading the - // diagnostic. Make the message always lead once contexts are labels. + // Whether this part is the message. Its text begins with the level word and + // is bold, with a heavy label line and bar; every other part's text is plain. bool is_leading = false; - // Whether this part's range is drawn as the heavy underline: the range the - // leading part's text is placed under, or a problem range identical to it. - // It keeps the level's center color and is left out of the ramp. Set - // during layout. - bool is_heavy_underline = false; + // Whether this part's range is the one the message's text is placed under: + // the message's own location, or the extra range drawn in its place. It + // keeps the level's own color and bold, is skipped when + // `RotateUnderlineStyles` gives the other ranges on its line their colors, + // and is drawn over them. Set during layout. + bool is_message_underline = false; - // Whether this part's range came from the message's own location rather than - // from a range attached to the diagnostic. Only the message has one. + // Whether this part's range is the message's own location, as opposed to one + // of its extra ranges or a label's range. // - // An attached problem range containing the location takes its place: the - // message's text is placed under that range, and the location has no - // underline of its own. See `FindMessageHost`. + // An extra range containing the location is drawn in place of it, and the + // message's text is placed under that range; see `FindMessageHost`. An extra + // range elsewhere leaves the location underlined. bool from_message_loc = false; // The word leading this part's text, including its separator, and empty for @@ -628,7 +622,7 @@ struct Row { const PreparedPart* part = nullptr; // `Underline` rows: every span underlined, in the order they are drawn: // widest first, so that the narrowest underline on a column is what shows, - // with the heavy underline last so that nothing repaints it. + // with the message's underline last so that nothing repaints it. llvm::SmallVector spans; // `Source` rows: the part whose style the margin arrow and line number take, // set on the one line the leading part's text is placed under, and null on @@ -988,8 +982,9 @@ static auto PlaceLabel(const PreparedSource& against, // Draws the underline under `span`, in source drawn from column `x`, on row // `y`. // -// The heavy underline is drawn heavy in both character sets. ASCII draws a -// heavy line as `^`, so that underline stays distinct without color. +// The message's ranges are part of the problem and a label's only explain it, +// so the message's are drawn heavy and a label's light, on whichever line they +// are. ASCII draws a heavy line as `^`, so the two stay distinct without color. static auto DrawUnderline(Buffer& buffer, int x, int y, const PreparedPart& span, const Style& style) -> void { @@ -1003,27 +998,25 @@ static auto DrawUnderline(Buffer& buffer, int x, int y, buffer.DrawHorizontalLine( x + span.source.span_start, y, span.source.span_length, style, span.source.left_end, span.source.right_end, - span.is_heavy_underline ? Terminal::LineWeight::Heavy - : Terminal::LineWeight::Light); + span.role == Part::Problem ? Terminal::LineWeight::Heavy + : Terminal::LineWeight::Light); } -// Returns the part whose range stands in for `message_part`'s own, or null when -// nothing does and the message's own location is underlined. +// Returns the message's extra range that is drawn in place of `message_part`'s +// own, or null when there is none and the message's own location is underlined. // -// A range attached as part of the problem says where the problem is in terms -// the reader can see, which the message's location -- a point, and often one -// chosen for an editor to put a cursor on rather than for anyone to look at -- -// does not. So a range containing that location is underlined in its place: the -// message underlines nothing of its own, and its text is placed under that -// range. +// The message's location is a point chosen for an editor's cursor, and an +// extra range shows what the problem covers. So an extra range containing the +// location replaces it: the location is not underlined, and the message's text +// is placed under that range. // // It has to contain the location. A range elsewhere, even on the same line, is -// not about the code the location names, and placing the message under it -// would drop the underline on the code the message is about. +// about other code, and placing the message under it would leave the code the +// message is about without an underline. // -// `candidates` are the ranges drawn alongside the message's, which is what a -// range has to be to take its place: one drawn under a location row of its own -// is read against the code below that one instead. +// `candidates` are the ranges drawn under the same location row as the +// message's; a range under another location row is read with the code below +// that location row. static auto FindMessageHost(llvm::ArrayRef candidates, const PreparedPart& message_part) -> PreparedPart* { int column = message_part.source.span_start; @@ -1046,10 +1039,10 @@ static auto FindMessageHost(llvm::ArrayRef candidates, // ramps. Each theme counts its own way through its colors, left to right, so // they run in the order the code they underline is read. // -// The heavy underline is left out of the ramp: it keeps the level's center -// color and its bold, matching the level word. The other problem ranges on its -// line take successive colors from the ramp with the center left out, so that -// only the heavy underline has the center color. +// The message's underline is skipped: it keeps the level's center color and its +// bold, matching the level word. The other problem ranges on its line take +// successive colors from the theme with the center color left out, so that only +// the message's underline has the center color. static auto RotateUnderlineStyles(llvm::ArrayRef spans, Theme problem_theme, Theme explanation_theme) -> void { @@ -1059,7 +1052,7 @@ static auto RotateUnderlineStyles(llvm::ArrayRef spans, return lhs->source.span_start < rhs->source.span_start; }); bool leading_on_line = llvm::any_of(across, [](const PreparedPart* span) { - return span->is_heavy_underline; + return span->is_message_underline; }); llvm::SmallVector around_center; if (leading_on_line) { @@ -1071,11 +1064,11 @@ static auto RotateUnderlineStyles(llvm::ArrayRef spans, } int totals[2] = {0, 0}; for (const PreparedPart* span : across) { - totals[span->role == Part::Problem] += !span->is_heavy_underline; + totals[span->role == Part::Problem] += !span->is_message_underline; } int counts[2] = {0, 0}; for (PreparedPart* span : across) { - if (span->is_heavy_underline) { + if (span->is_message_underline) { span->underline_style = span->style; continue; } @@ -1251,8 +1244,8 @@ static auto PlaceLabels(const Buffer& buffer, // first, so the narrowest underline covering a column is the one that shows: a // range containing another says less about the columns they share than the // range inside it does, and an underline that is part of the problem says more -// than one that only explains it. The heavy underline is the exception; see -// `MoveHeavyUnderlinesLast`. +// than one that only explains it. The message's underline is the exception; +// see `MoveMessageUnderlinesLast`. // // Ranges shouldn't overlap in the first place -- one covering another means two // parts of the diagnostic attached to the same code -- but they are attached by @@ -1278,43 +1271,44 @@ static auto SpansWidestFirst(llvm::ArrayRef line, return spans; } -// Sets `is_heavy_underline` on the spans drawn as the heavy underline and moves -// them to the end of `spans`. Returns the span the leading part's text is -// placed under, or null when that text is not placed on this line. -static auto MoveHeavyUnderlinesLast(llvm::MutableArrayRef spans, - const PreparedPart* message_part, - const PreparedPart* message_host) +// Sets `is_message_underline` on the spans drawn as the message's underline +// and moves them to the end of `spans`. Returns the span the leading part's +// text is placed under, or null when that text is not placed on this line. +static auto MoveMessageUnderlinesLast( + llvm::MutableArrayRef spans, + const PreparedPart* message_part, const PreparedPart* message_host) -> const PreparedPart* { // The leading part's text is placed under its own range, or under the host // of the message's location when the message leads. const PreparedPart* leading_host = message_part && message_part->is_leading ? message_host : nullptr; - const PreparedPart* heavy_underline = nullptr; + const PreparedPart* message_underline = nullptr; for (PreparedPart* span : spans) { - span->is_heavy_underline = span->is_leading || span == leading_host; - if (span->is_heavy_underline) { - heavy_underline = span; + span->is_message_underline = span->is_leading || span == leading_host; + if (span->is_message_underline) { + message_underline = span; } } // A problem range identical to the leading one underlines the same source. - // Identical ranges are drawn over each other, so it takes the heavy - // underline's weight and color; otherwise it would repaint that stretch - // light, in a rotated color. - if (heavy_underline) { + // Identical ranges are drawn over each other, so it takes the color and bold + // of the message's underline; otherwise it would redraw those columns in + // another of the theme's colors. + if (message_underline) { for (PreparedPart* span : spans) { - span->is_heavy_underline |= + span->is_message_underline |= span->role == Part::Problem && - span->source.span_start == heavy_underline->source.span_start && - span->source.span_length == heavy_underline->source.span_length; + span->source.span_start == message_underline->source.span_start && + span->source.span_length == message_underline->source.span_length; } } - // The heavy underline is drawn last, over every other range on the row, so - // that no narrower range redraws a cell of it light. A range inside it shows - // as the tee where its label line leaves the heavy underline. + // The message's underline is drawn last, over every other range on the row, + // so that no narrower range redraws a cell of it in another color or weight. + // A range inside it shows as the tee where its label line leaves the + // message's underline. std::stable_partition( spans.begin(), spans.end(), - [](const PreparedPart* span) { return !span->is_heavy_underline; }); - return heavy_underline; + [](const PreparedPart* span) { return !span->is_message_underline; }); + return message_underline; } // Returns the parts whose words hang off `spans`, in the order of `spans`. @@ -1405,9 +1399,9 @@ class RowLayout { // Adds the rows drawing the spans that fall on one source line: the line // itself, the underline row beneath it, and the label rows under that. // - // `message_part` is the range standing in for the part's own location, and - // `message_host` the attached range that has taken its place, in which case - // the part underlines nothing of its own and its words hang from the host. + // `message_part` is the message's own part, and `message_host` the extra + // range drawn in its place, if any, in which case the message's location is + // not underlined and its text is placed under that range. auto AddLine(llvm::ArrayRef line, PreparedPart* message_part, PreparedPart* message_host) -> void; @@ -1632,8 +1626,8 @@ auto RowLayout::AddLine(llvm::ArrayRef line, llvm::SmallVector spans = SpansWidestFirst(line, message_part, message_host); - const PreparedPart* heavy_underline = - MoveHeavyUnderlinesLast(spans, message_part, message_host); + const PreparedPart* message_underline = + MoveMessageUnderlinesLast(spans, message_part, message_host); RotateUnderlineStyles(spans, problem_theme_, explanation_theme_); // The part's label line and bar follow the range hosting its words, so the // rotation's choice for the host is copied after it is made. @@ -1643,14 +1637,15 @@ auto RowLayout::AddLine(llvm::ArrayRef line, // The `->` in the margin points to the one line to begin reading at: the line // the leading part's text is placed under, wherever it is in the frame. A - // problem range on any other line keeps its color and nothing more. The - // `->` and line number take the leading part's style, matching its level - // word. - rows_.push_back({.kind = Row::Kind::Source, - .part = line.front(), - .points_here = heavy_underline ? &parts_[leading_] : nullptr, - .line_number = line.front()->line_number, - .text = line.front()->source.text}); + // problem range on any other line is drawn the same way as one on this + // line, without the `->`. The `->` and line number take the leading part's + // style, matching its level word. + rows_.push_back( + {.kind = Row::Kind::Source, + .part = line.front(), + .points_here = message_underline ? &parts_[leading_] : nullptr, + .line_number = line.front()->line_number, + .text = line.front()->source.text}); llvm::SmallVector labels = LabelsHangingFrom(spans, message_part, message_host); @@ -1740,9 +1735,9 @@ auto RowLayout::InSnippet() const -> bool { // rather than as one line drawn down both. // // The cell on the underline row is drawn heavy whatever `weight` is, since it -// is part of the heavy underline. Under ASCII, where `weight` is light, that -// cell keeps the tee inside the `^` run, or is the `^` itself when the label -// line is drawn in place of a one-column underline. +// is part of the message's underline. Under ASCII, where `weight` is light, +// that cell keeps the tee inside the `^` run, or is the `^` itself when the +// label line is drawn in place of a one-column underline. static auto DrawLeadingLabelLine(Buffer& buffer, int x, int underline_y, int meet_y, const Style& style, Terminal::LineWeight weight) -> void { @@ -1829,11 +1824,6 @@ auto Renderer::Render(Terminal::OutputBufferRef out, // drawing into anything. Metrics metrics(capabilities_.charset); - // A context names the operation that failed, and leads the diagnostic when - // there is one: it is the failure the reader is being told about, and the - // message is then read against the code like anything else explaining it. - const Context* leading_context = LeadingContext(diagnostic); - // A `PreparedPart` is undesirably large for inline storage by // SmallVector, so we specify 0. llvm::SmallVector parts; @@ -1844,9 +1834,8 @@ auto Renderer::Render(Terminal::OutputBufferRef out, Theme problem_theme = LevelTheme(diagnostic.level, capabilities_); Theme explanation_theme = ExplanationTheme(capabilities_); - // What leads the diagnostic is drawn at its level and everything else as - // something explaining it, except that a primary range is part of the problem - // and so keeps the level's color wherever down the frame it sits. + // The message and its ranges are drawn in the level's colors wherever they + // are in the frame, and every label in the label colors. auto add_part = [&](bool is_leading, bool is_problem, bool from_message_loc, const Loc& loc, std::string text, llvm::StringRef name) { if (is_leading) { @@ -1860,56 +1849,30 @@ auto Renderer::Render(Terminal::OutputBufferRef out, loc, std::move(text), name, is_leading, include_kind_)); }; - // The same file reached the same way is a path drawn once. A path says how a - // file was got to, so every range underlined in that file has the same one, - // and repeating it under each of them says nothing the first didn't. - std::string last_place; - auto add_location_info = [&](llvm::ArrayRef steps, - const Loc& reaches) { - std::string place = reaches.filename.str(); - for (const LocationInfo& step : steps) { - place += "\n" + step.Format() + " " + FormatLocation(step.loc); - } - if (place == last_place) { - return; - } - last_place = std::move(place); - for (const LocationInfo& step : steps) { - parts.push_back(PreparePart( - metrics, Part::LocationInfo, /*from_message_loc=*/false, - /*level_text=*/"", PathStyle(), step.loc, step.Format(), step.name, - /*is_leading=*/false, include_kind_)); - } - }; - - // The contexts, then the message, then everything attached to explain it, - // which is the order they are read in. - for (const Context& context : diagnostic.contexts) { - add_location_info(context.location_info, context.loc); - // Only the leading context is the failure being reported; the rest name - // operations it happened inside, which explain it. - bool is_leading = &context == leading_context; - add_part(is_leading, is_leading, /*from_message_loc=*/false, context.loc, - context.Format(), context.name); - } + // The path to the message's location, then the message, then everything + // attached to explain it, which is the order they are read in. const Message& message = diagnostic.message; - add_location_info(message.location_info, message.loc); - // The message states the problem whether or not a context leads it: a - // context gives it a sentence to sit under, and doesn't demote what it says - // to an explanation of something else. Doing otherwise puts an informational - // label line on a range that is underlined as part of the problem. - bool message_leads = leading_context == nullptr; - add_part(message_leads, /*is_problem=*/true, /*from_message_loc=*/true, + for (const LocationInfo& step : message.location_info) { + parts.push_back(PreparePart( + metrics, Part::LocationInfo, /*from_message_loc=*/false, + /*level_text=*/"", PathStyle(), step.loc, step.Format(), step.name, + /*is_leading=*/false, include_kind_)); + } + add_part(/*is_leading=*/true, /*is_problem=*/true, /*from_message_loc=*/true, message.loc, message.Format(), message.kind.name()); + for (const Loc& range : message.ranges) { + add_part(/*is_leading=*/false, /*is_problem=*/true, + /*from_message_loc=*/false, range, /*text=*/"", /*name=*/""); + } // A label's location information is not drawn: how the file holding a // declaration was reached is rarely useful, and Clang and GCC omit note - // include stacks for the same reason. Only the path to the problem itself, - // the message's own location and a context's, is shown. + // include stacks for the same reason. Only the path to the message's + // location is shown. for (const Label& label : diagnostic.labels) { - add_part(/*is_leading=*/false, label.category == LabelCategory::Primary, + add_part(/*is_leading=*/false, /*is_problem=*/false, /*from_message_loc=*/false, label.loc, label.Format(), label.name); } - CARBON_CHECK(leading >= 0, "Either the context or the message leads."); + CARBON_CHECK(leading >= 0, "The message leads."); // With snippets off, every diagnostic takes the compact form: nothing below // is drawn, so none of its geometry needs deciding. @@ -2021,10 +1984,10 @@ class FrameRenderer { auto DrawFrame(Row::Kind kind, int y, int next_y) -> void; // Returns the stroke weight of the label line and bar of `part`'s label: - // heavy for the leading part under Unicode, matching its heavy underline. - // ASCII draws a heavy line as `^`, which belongs on the underline row alone, - // so there the leading part's label line and bar are light like every other - // label's. + // heavy for the leading part under Unicode, matching the underline it hangs + // from. ASCII draws a heavy line as `^`, which is only used on the underline + // row, so there the leading part's label line and bar are light like every + // other label's. auto LabelWeight(const PreparedPart& part) const -> Terminal::LineWeight; // Draws `text` for `part` from (x, y), after its level word and in bold when diff --git a/toolchain/diagnostics/renderer.h b/toolchain/diagnostics/renderer.h index fba521ba6309..fd210b20ae69 100644 --- a/toolchain/diagnostics/renderer.h +++ b/toolchain/diagnostics/renderer.h @@ -34,9 +34,9 @@ enum class LineNumbers : int8_t { // Draws diagnostics for a terminal. // // A diagnostic renders as one frame holding a snippet of each file it points -// into. The message's text is placed under the range that is wrong, which has a -// heavy underline, and begins with the level word. Every label is placed under -// the range it is attached to. +// into. The message's text is placed under the range that is wrong and begins +// with the level word. Every label is placed under the range it is attached to. +// The message's ranges are underlined heavy and a label's light. // // ╭─┤ foo.carbon:19:3 // 1 │ fn Run0() {} diff --git a/toolchain/diagnostics/renderer_fuzzer.cpp b/toolchain/diagnostics/renderer_fuzzer.cpp index 1be54b333f4e..156232d025a9 100644 --- a/toolchain/diagnostics/renderer_fuzzer.cpp +++ b/toolchain/diagnostics/renderer_fuzzer.cpp @@ -122,25 +122,17 @@ extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data, size_t size) { .format = "", .format_fn = SaysText(bytes.Text().str())}; - // A context leads the diagnostic in place of the message, so this reaches the - // shapes that only exist when one does. - llvm::SmallVector contexts; - int context_count = bytes.Below(3); - for (int i = 0; i < context_count; ++i) { - contexts.push_back({.loc = MakeLoc(bytes, file_text), - .name = "TestContext", - .format = "", - .format_fn = SaysText(bytes.Text().str())}); + int range_count = bytes.Below(3); + for (int i = 0; i < range_count; ++i) { + message.ranges.push_back(MakeLoc(bytes, file_text)); } llvm::SmallVector labels; int label_count = bytes.Below(8); for (int i = 0; i < label_count; ++i) { - auto category = static_cast(bytes.Below(2)); llvm::StringRef words = bytes.Text(); labels.push_back( - {.category = category, - .loc = MakeLoc(bytes, file_text), + {.loc = MakeLoc(bytes, file_text), .name = "TestLabel", .format = "", .format_fn = words.empty() ? FormatFn() : SaysText(words.str())}); @@ -148,7 +140,6 @@ extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data, size_t size) { Diagnostic diagnostic = {.level = level, .message = std::move(message), - .contexts = std::move(contexts), .labels = std::move(labels)}; Renderer renderer(capabilities); diff --git a/toolchain/diagnostics/renderer_test.cpp b/toolchain/diagnostics/renderer_test.cpp index 481433309033..d47b22de2dd7 100644 --- a/toolchain/diagnostics/renderer_test.cpp +++ b/toolchain/diagnostics/renderer_test.cpp @@ -49,12 +49,19 @@ static auto MakeMessage(Loc loc, llvm::StringRef text, .format_fn = Says(text)}; } +// Returns `message` with `ranges` as the ranges the problem covers beyond its +// own location. +static auto WithRanges(Message message, llvm::SmallVector ranges) + -> Message { + message.ranges = std::move(ranges); + return message; +} + // Builds a label attached to `loc` and saying `text`, reached by `origin`. An // empty `text` underlines the range and says nothing. -static auto MakeLabel(LabelCategory category, Loc loc, llvm::StringRef text, +static auto MakeLabel(Loc loc, llvm::StringRef text, llvm::SmallVector origin = {}) -> Label { - return {.category = category, - .loc = loc, + return {.loc = loc, .location_info = std::move(origin), .name = "TestLabel", .format = "", @@ -62,18 +69,6 @@ static auto MakeLabel(LabelCategory category, Loc loc, llvm::StringRef text, .format_fn = text.empty() ? FormatFn() : Says(text)}; } -// Builds a context saying `text` about `loc`, reached by `origin`. -static auto MakeContext(Loc loc, llvm::StringRef text, - llvm::SmallVector origin = {}) - -> Context { - return {.loc = loc, - .location_info = std::move(origin), - .name = "TestContext", - .format = "", - .format_args = {}, - .format_fn = Says(text)}; -} - // The columns of source a diagnostic targets with no terminal to measure, which // is `Renderer`'s own `FormattedSourceColumns`. Spelled again here rather than // exposed: a test that pins the width should say which width it pins. @@ -305,8 +300,7 @@ TEST(RendererTest, MergedShowsOneViewOfTheFile) { Diagnostic diagnostic = { .level = Level::Error, .message = MakeMessage(At(4, 3, 7), "too many arguments"), - .labels = { - MakeLabel(LabelCategory::Info, At(1, 1, 12), "declared here")}}; + .labels = {MakeLabel(At(1, 1, 12), "declared here")}}; // The note is above the error in the file, so it is drawn first, and the two // lines between them are elided. EXPECT_THAT(Render(Plain(), diagnostic), @@ -323,10 +317,9 @@ TEST(RendererTest, MergedShowsOneViewOfTheFile) { } TEST(RendererTest, MergedShowsASingleSkippedLine) { - Diagnostic diagnostic = { - .level = Level::Error, - .message = MakeMessage(At(3, 1, 2), "bad"), - .labels = {MakeLabel(LabelCategory::Info, At(1, 1, 2), "here")}}; + Diagnostic diagnostic = {.level = Level::Error, + .message = MakeMessage(At(3, 1, 2), "bad"), + .labels = {MakeLabel(At(1, 1, 2), "here")}}; // Only line 2 is between them, so it is shown rather than elided. EXPECT_THAT(Render(Plain(), diagnostic), Eq(" .-| foo.carbon:3:1\n" " 1 | fn Run0() {}\n" @@ -346,10 +339,9 @@ TEST(RendererTest, NotesInAnotherFileGetTheirOwnLocationRow) { .line_number = 9, .column_number = 1, .length = 9}; - Diagnostic diagnostic = { - .level = Level::Error, - .message = MakeMessage(At(4, 3, 7), "bad"), - .labels = {MakeLabel(LabelCategory::Info, other, "declared here")}}; + Diagnostic diagnostic = {.level = Level::Error, + .message = MakeMessage(At(4, 3, 7), "bad"), + .labels = {MakeLabel(other, "declared here")}}; EXPECT_THAT(Render(Plain(), diagnostic), Eq(" .-| foo.carbon:4:3\n" "-> 4 | Run0(1);\n" @@ -364,7 +356,7 @@ TEST(RendererTest, NotesInAnotherFileGetTheirOwnLocationRow) { "")); } -TEST(RendererTest, APrimaryLabelTeesIntoItsRange) { +TEST(RendererTest, ALabelTeesIntoItsRange) { // The label line leaves the middle of the underline through a junction, so // the underline and what it says are one line and the words point into the // range rather than off an end of it. @@ -372,8 +364,7 @@ TEST(RendererTest, APrimaryLabelTeesIntoItsRange) { .level = Level::Error, .message = MakeMessage(At(4, 3, 7), "1 argument passed to function expecting 0"), - .labels = {MakeLabel(LabelCategory::Primary, At(4, 3, 7), - "1 argument passed here")}}; + .labels = {MakeLabel(At(4, 3, 7), "1 argument passed here")}}; EXPECT_THAT( Render(Plain(), diagnostic), Eq(" .-| foo.carbon:4:3\n" @@ -394,15 +385,14 @@ TEST(RendererTest, TheShapeTheDesignDocDraws) { .line = "fn Run0() {}", .file_text = LibFile, .line_number = 1, - .column_number = 1, - .length = 12}; + .column_number = 4, + .length = 4}; Terminal::Capabilities capabilities = {.charset = Terminal::Charset::Utf8}; Diagnostic diagnostic = { .level = Level::Error, .message = MakeMessage( At(4, 3, 7), "1 argument passed to function expecting 0 arguments"), - .labels = {MakeLabel(LabelCategory::Info, declaration, - "calling function declared here")}}; + .labels = {MakeLabel(declaration, "calling function declared here")}}; EXPECT_THAT(Render(capabilities, diagnostic), Eq(" ╭─┤ foo.carbon:4:3\n" "-> 4 │ Run0(1);\n" @@ -410,10 +400,10 @@ TEST(RendererTest, TheShapeTheDesignDocDraws) { " · ┗━━┫ error: 1 argument passed to function " "expecting 0 arguments\n" " ┆\n" - " ├─┤ lib.carbon:1:1\n" + " ├─┤ lib.carbon:1:4\n" " 1 │ fn Run0() {}\n" - " · ──────┬─────\n" - " · ╰──┤ calling function declared here\n" + " · ──┬─\n" + " · ╰──┤ calling function declared here\n" " ╰────\n" "")); @@ -426,10 +416,10 @@ TEST(RendererTest, TheShapeTheDesignDocDraws) { " : '--| error: 1 argument passed to function " "expecting 0 arguments\n" " :\n" - " |-| lib.carbon:1:1\n" + " |-| lib.carbon:1:4\n" " 1 | fn Run0() {}\n" - " : ------.-----\n" - " : '--| calling function declared here\n" + " : --.-\n" + " : '--| calling function declared here\n" " '----\n" "")); } @@ -441,7 +431,7 @@ TEST(RendererTest, AFileOnlyLabelIsPlacedUnderItsLocationRow) { Diagnostic diagnostic = { .level = Level::Error, .message = MakeMessage(At(4, 8, 1), "cannot copy argument of type `A`"), - .labels = {MakeLabel(LabelCategory::Info, FileOnly(), + .labels = {MakeLabel(FileOnly(), "type `A` does not implement interface " "`Core.Copy`")}}; EXPECT_THAT( @@ -463,8 +453,8 @@ TEST(RendererTest, ARangeContainingTheMessageLocHostsIt) { // its own. Diagnostic diagnostic = { .level = Level::Error, - .message = MakeMessage(At(4, 3, 1), "bad call"), - .labels = {MakeLabel(LabelCategory::Primary, At(4, 3, 7), "")}}; + .message = + WithRanges(MakeMessage(At(4, 3, 1), "bad call"), {At(4, 3, 7)})}; EXPECT_THAT(Render(Plain(), diagnostic), Eq(" .-| foo.carbon:4:3\n" "-> 4 | Run0(1);\n" @@ -480,12 +470,12 @@ TEST(RendererTest, ARangeElsewhereOnTheLineDoesNotHostTheMessage) { // the message keeps its own underline and text. Diagnostic diagnostic = { .level = Level::Error, - .message = MakeMessage(At(4, 3, 1), "bad call"), - .labels = {MakeLabel(LabelCategory::Primary, At(4, 8, 3), "")}}; + .message = + WithRanges(MakeMessage(At(4, 3, 1), "bad call"), {At(4, 8, 3)})}; EXPECT_THAT(Render(Plain(), diagnostic), Eq(" .-| foo.carbon:4:3\n" "-> 4 | Run0(1);\n" - " : ^ ---\n" + " : ^ ^^^\n" " : '--| error: bad call\n" " '----\n" "")); @@ -494,12 +484,13 @@ TEST(RendererTest, ARangeElsewhereOnTheLineDoesNotHostTheMessage) { TEST(RendererTest, RepeatedSpansAreOneUnderline) { // Two labels attached to the same range draw the same underline in the same // columns, so they are one underline rather than two identical rows. A - // message that a context leads and the range attached to it reach this shape. + // message with an extra range that a label is also attached to produces this + // shape. Diagnostic diagnostic = { .level = Level::Error, - .message = MakeMessage(At(4, 3, 1), "bad call"), - .labels = {MakeLabel(LabelCategory::Primary, At(4, 3, 7), ""), - MakeLabel(LabelCategory::Primary, At(4, 3, 7), "wrong")}}; + .message = + WithRanges(MakeMessage(At(4, 3, 1), "bad call"), {At(4, 3, 7)}), + .labels = {MakeLabel(At(4, 3, 7), "wrong")}}; EXPECT_THAT(Render(Plain(), diagnostic), Eq(" .-| foo.carbon:4:3\n" "-> 4 | Run0(1);\n" @@ -514,16 +505,16 @@ TEST(RendererTest, ARangeCoveringOthersIsRepairedRatherThanStacked) { // A range attached over the whole expression, with ranges attached to the // operands inside it, is the shape overlap actually arrives in. Nothing is in // a position to reject it, so it is drawn as one row: the covering range is - // the heavy underline and stays whole, and each operand shows as the tee + // the message's underline and stays whole, and each operand shows as the tee // where its label line leaves that underline -- which ASCII keeps as the // corner inside the `^` run, since the `^` would hide where the label line // left. Diagnostic diagnostic = { .level = Level::Error, - .message = MakeMessage(At(4, 3, 1), "bad call"), - .labels = {MakeLabel(LabelCategory::Primary, At(4, 3, 7), ""), - MakeLabel(LabelCategory::Info, At(4, 3, 4), "callee"), - MakeLabel(LabelCategory::Info, At(4, 8, 1), "argument")}}; + .message = + WithRanges(MakeMessage(At(4, 3, 1), "bad call"), {At(4, 3, 7)}), + .labels = {MakeLabel(At(4, 3, 4), "callee"), + MakeLabel(At(4, 8, 1), "argument")}}; EXPECT_THAT(Render(Plain(), diagnostic), Eq(" .-| foo.carbon:4:3\n" "-> 4 | Run0(1);\n" @@ -540,11 +531,10 @@ TEST(RendererTest, ALabelOnASingleColumnRangeDropsStraightDown) { // reaching in from the side would read as attaching to the column beside it. // The label line drops straight down the underline's own column, teeing into // it. - Diagnostic diagnostic = { - .level = Level::Error, - .message = MakeMessage(At(4, 8, 1), "bad index"), - .labels = {MakeLabel(LabelCategory::Primary, At(4, 3, 4), "indexed here"), - MakeLabel(LabelCategory::Primary, At(4, 8, 1), "with this")}}; + Diagnostic diagnostic = {.level = Level::Error, + .message = MakeMessage(At(4, 8, 1), "bad index"), + .labels = {MakeLabel(At(4, 3, 4), "indexed here"), + MakeLabel(At(4, 8, 1), "with this")}}; EXPECT_THAT(Render(Plain(), diagnostic), Eq(" .-| foo.carbon:4:8\n" "-> 4 | Run0(1);\n" @@ -558,13 +548,13 @@ TEST(RendererTest, ALabelOnASingleColumnRangeDropsStraightDown) { TEST(RendererTest, OverlappingSpansStillShareOneRow) { // Ranges covering some of the same columns are still one underline row. The - // wider one here is the heavy underline, drawn last, so a range inside it + // wider one here is the message's underline, drawn last, so a range inside it // with no text of its own shows nothing. Diagnostic diagnostic = { .level = Level::Error, - .message = MakeMessage(At(4, 3, 1), "bad call"), - .labels = {MakeLabel(LabelCategory::Primary, At(4, 3, 7), ""), - MakeLabel(LabelCategory::Info, At(4, 7, 3), "")}}; + .message = + WithRanges(MakeMessage(At(4, 3, 1), "bad call"), {At(4, 3, 7)}), + .labels = {MakeLabel(At(4, 7, 3), "")}}; EXPECT_THAT(Render(Plain(), diagnostic), Eq(" .-| foo.carbon:4:3\n" "-> 4 | Run0(1);\n" @@ -574,17 +564,16 @@ TEST(RendererTest, OverlappingSpansStillShareOneRow) { "")); } -TEST(RendererTest, ARangeInsideTheHeavyUnderlineShowsAsItsTee) { - // The heavy underline is drawn last, so a narrower range inside it leaves it - // whole, with no stretch of it light or in a ramp color, and the range shows - // as the tee where its label line leaves the heavy underline. Over any other - // underline, the narrower range is drawn on top. +TEST(RendererTest, ARangeInsideTheMessageUnderlineShowsAsItsTee) { + // The message's underline is drawn last, so a narrower range inside it leaves + // it whole, with no stretch of it light or in another of the theme's colors, + // and the range shows as the tee where its label line leaves the message's + // underline. Over any other underline, the narrower range is drawn on top. Terminal::Capabilities capabilities = {.charset = Terminal::Charset::Utf8}; - Diagnostic diagnostic = { - .level = Level::Error, - .message = MakeMessage(At(4, 3, 7), "bad call"), - .labels = {MakeLabel(LabelCategory::Info, At(4, 3, 4), "callee"), - MakeLabel(LabelCategory::Info, At(4, 8, 1), "argument")}}; + Diagnostic diagnostic = {.level = Level::Error, + .message = MakeMessage(At(4, 3, 7), "bad call"), + .labels = {MakeLabel(At(4, 3, 4), "callee"), + MakeLabel(At(4, 8, 1), "argument")}}; EXPECT_THAT(Render(capabilities, diagnostic), Eq(" ╭─┤ foo.carbon:4:3\n" "-> 4 │ Run0(1);\n" @@ -640,17 +629,26 @@ TEST(RendererTest, UnderlinesNeverHoldACornerOrACrossing) { bool has_words; }; auto render = [&](llvm::ArrayRef ranges, Terminal::Charset charset, - LabelCategory category) { + bool message_owns_wordless) { Terminal::Capabilities capabilities = {.charset = charset}; + // The message's location is past every range, so each underline comes from + // an extra range of the message or from a label. A range with no text is + // the message's in one pass and a label's in the other, so both themes' + // underlines are drawn. + Message message = MakeMessage(at(26, 1), "m"); llvm::SmallVector