mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Remove uses of StringLiteral in format strings. (#4416)
Building on #4411, avoid using StringLiteral in format strings. This includes a diagnostic check to prevent regressions (which is also how I gathered issues). Note, I haven't looked at `std::string` uses yet, but we might need things like that to be able to pass strings in code back to the user. StringLiteral though means that it's literally written down in the toolchain, at which point it should probably be written in the format string instead of separately. --------- Co-authored-by: Geoff Romer <gromer@google.com>
This commit is contained in:
co-authored by
Geoff Romer
parent
62c36eceda
commit
302aa1bb30
@@ -77,9 +77,9 @@ auto Context::ConsumeAndAddCloseSymbol(Lex::TokenIndex expected_open,
|
||||
// TODO: Include the location of the matching opening delimiter in the
|
||||
// diagnostic.
|
||||
CARBON_DIAGNOSTIC(ExpectedCloseSymbol, Error,
|
||||
"unexpected tokens before `{0}`", llvm::StringLiteral);
|
||||
"unexpected tokens before `{0}`", Lex::TokenKind);
|
||||
emitter_->Emit(*position_, ExpectedCloseSymbol,
|
||||
open_token_kind.closing_symbol().fixed_spelling());
|
||||
open_token_kind.closing_symbol());
|
||||
|
||||
SkipTo(tokens().GetMatchedClosingToken(expected_open));
|
||||
AddNode(close_kind, Consume(), /*has_error=*/true);
|
||||
|
||||
Reference in New Issue
Block a user