Skip to content

Commit b3c9a2f

Browse files
authored
Rollup merge of #97987 - TaKO8Ki:remove-unnecessary-format-macro, r=Dylan-DPC
remove an unnecessary `String`
2 parents 54d7b3f + f9a924d commit b3c9a2f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
304304
error_code: TypeAnnotationNeeded,
305305
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
306306
let error_code = error_code.into();
307-
let mut err = self.tcx.sess.struct_span_err_with_code(
308-
span,
309-
&format!("type annotations needed"),
310-
error_code,
311-
);
307+
let mut err =
308+
self.tcx.sess.struct_span_err_with_code(span, "type annotations needed", error_code);
312309
err.span_label(span, arg_data.cannot_infer_msg());
313310
err
314311
}

0 commit comments

Comments
 (0)