about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-06-11 12:59:30 +0200
committerGitHub <noreply@github.com>2022-06-11 12:59:30 +0200
commitb3c9a2fde4a28bfdced15a1cc8583b155d1d281a (patch)
treecedbc7fc41cd0e256bcdfdbde22f9e1865a5e805
parent54d7b3fb9ce11317ad2dc2c0e258520c3a04443d (diff)
parentf9a924d3c97b5cb8f4b00bcb33dd1a925f68773e (diff)
downloadrust-b3c9a2fde4a28bfdced15a1cc8583b155d1d281a.tar.gz
rust-b3c9a2fde4a28bfdced15a1cc8583b155d1d281a.zip
Rollup merge of #97987 - TaKO8Ki:remove-unnecessary-format-macro, r=Dylan-DPC
remove an unnecessary `String`
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs b/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs
index 207d2870c5c..4c734b1589b 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs
@@ -304,11 +304,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
         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
     }