diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2023-05-18 10:52:35 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-18 10:52:35 +0530 |
| commit | 08efb9d652c840715d15954592426e2befe13b36 (patch) | |
| tree | aa97bae80b39c4e36910dd711e499002f5ab59cd /compiler/rustc_parse/src | |
| parent | cdfaf69498e339b02a90193cc842eed462c8e589 (diff) | |
| parent | 01e33a3600789b0e96511c4ac95fc114b507c79e (diff) | |
| download | rust-08efb9d652c840715d15954592426e2befe13b36.tar.gz rust-08efb9d652c840715d15954592426e2befe13b36.zip | |
Rollup merge of #111633 - nnethercote:avoid-ref-format, r=WaffleLapkin
Avoid `&format("...")` calls in error message code.
Some error message cleanups. Best reviewed one commit at a time.
r? `@davidtwco`
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/lexer/mod.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/validate_attr.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/lexer/mod.rs b/compiler/rustc_parse/src/lexer/mod.rs index 51e90489002..c6e6b46e455 100644 --- a/compiler/rustc_parse/src/lexer/mod.rs +++ b/compiler/rustc_parse/src/lexer/mod.rs @@ -662,7 +662,7 @@ impl<'a> StringReader<'a> { &RUST_2021_PREFIXES_INCOMPATIBLE_SYNTAX, prefix_span, ast::CRATE_NODE_ID, - &format!("prefix `{prefix}` is unknown"), + format!("prefix `{prefix}` is unknown"), BuiltinLintDiagnostics::ReservedPrefix(prefix_span), ); } diff --git a/compiler/rustc_parse/src/validate_attr.rs b/compiler/rustc_parse/src/validate_attr.rs index 982c4615aff..928fdce313d 100644 --- a/compiler/rustc_parse/src/validate_attr.rs +++ b/compiler/rustc_parse/src/validate_attr.rs @@ -186,7 +186,7 @@ fn emit_malformed_attribute( suggestions.push(code); } if should_warn(name) { - sess.buffer_lint(&ILL_FORMED_ATTRIBUTE_INPUT, span, ast::CRATE_NODE_ID, &msg); + sess.buffer_lint(&ILL_FORMED_ATTRIBUTE_INPUT, span, ast::CRATE_NODE_ID, msg); } else { sess.span_diagnostic .struct_span_err(span, error_msg) |
