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`
This commit is contained in:
Dylan DPC 2023-05-18 10:52:35 +05:30 committed by GitHub
commit 08efb9d652
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 139 additions and 147 deletions

View file

@ -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),
);
}

View file

@ -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)