Fix diagnostic style issues (#7982)

Remove trailing `.`s and leading capitalization from diagnostics, and
separate clauses with `;` rather than `.`, per
https://docs.carbon-lang.dev/toolchain/docs/diagnostics.html#diagnostic-message-style-guide
This commit is contained in:
Richard Smith authored and GitHub committed 2026-10-15 20:15:28 +00:00
1 parent 7beb29f8b2
commit d87891f3a6
11 files changed
+39 -39

No files matched your search

+2 -2
View File
@@ -268,7 +268,7 @@ static auto HandlePatternList(Context& context, NodeKind node_kind,
if (state.in_field_shorthand_pattern) {
if (node_kind == NodeKind::TuplePatternStart) {
CARBON_DIAGNOSTIC(NestedTuplePatternInStructPatternShortField, Error,
"Tuple pattern in shorthand struct pattern field. Use "
"tuple pattern in shorthand struct pattern field; use "
"`.field = (...)` instead");
context.emitter().Emit(*context.position(),
NestedTuplePatternInStructPatternShortField);
@@ -276,7 +276,7 @@ static auto HandlePatternList(Context& context, NodeKind node_kind,
context.ReturnErrorOnState();
} else if (node_kind == NodeKind::StructPatternStart) {
CARBON_DIAGNOSTIC(NestedStructPatternStructPatternShortField, Error,
"Struct pattern in shorthand struct pattern field. Use "
"struct pattern in shorthand struct pattern field; use "
"`.field = {{...}` instead");
context.emitter().Emit(*context.position(),
NestedStructPatternStructPatternShortField);