Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
danakj committed Dec 23, 2024
1 parent db4b066 commit 7802852
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions toolchain/check/convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -809,8 +809,7 @@ static auto PerformBuiltinConversion(Context& context, SemIR::LocId loc_id,
// extraneous `converted` semir instructions on the adapted types, and as a
// shortcut to doing the explicit calls to walk the parts of the
// tuple/struct which happens inside PerformBuiltinConversion().
if (auto foundation_type_id =
GetFoundationType(context, value_type_id);
if (auto foundation_type_id = GetFoundationType(context, value_type_id);
foundation_type_id != value_type_id &&
(context.types().Is<SemIR::TupleType>(foundation_type_id) ||
context.types().Is<SemIR::StructType>(foundation_type_id))) {
Expand All @@ -830,8 +829,7 @@ static auto PerformBuiltinConversion(Context& context, SemIR::LocId loc_id,
// the type (or some part of it) is not copyable.
DiagnosticAnnotationScope annotate_diagnostics(
&context.emitter(), [&](auto& builder) {
CARBON_DIAGNOSTIC(InCopy, Note, "in copy of `{0}`",
TypeOfInstId);
CARBON_DIAGNOSTIC(InCopy, Note, "in copy of `{0}`", TypeOfInstId);
builder.Note(value_id, InCopy, value_id);
});

Expand All @@ -857,10 +855,8 @@ static auto PerformBuiltinConversion(Context& context, SemIR::LocId loc_id,
// T explicitly converts to U if T is compatible with U.
if (target.kind == ConversionTarget::Kind::ExplicitAs &&
target.type_id != value_type_id) {
auto target_foundation_id =
GetFoundationType(context, target.type_id);
auto value_foundation_id =
GetFoundationType(context, value_type_id);
auto target_foundation_id = GetFoundationType(context, target.type_id);
auto value_foundation_id = GetFoundationType(context, value_type_id);
if (target_foundation_id == value_foundation_id) {
// For a struct or tuple literal, perform a category conversion if
// necessary.
Expand Down

0 comments on commit 7802852

Please sign in to comment.