Rollup merge of #97987 - TaKO8Ki:remove-unnecessary-format-macro, r=Dylan-DPC

remove an unnecessary `String`
This commit is contained in:
Dylan DPC 2022-06-11 12:59:30 +02:00 committed by GitHub
commit b3c9a2fde4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -304,11 +304,8 @@ fn bad_inference_failure_err(
error_code: TypeAnnotationNeeded,
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
let error_code = error_code.into();
let mut err = self.tcx.sess.struct_span_err_with_code(
span,
&format!("type annotations needed"),
error_code,
);
let mut err =
self.tcx.sess.struct_span_err_with_code(span, "type annotations needed", error_code);
err.span_label(span, arg_data.cannot_infer_msg());
err
}