Skip to content

Commit d7f414d

Browse files
authored
Rollup merge of rust-lang#100301 - TaKO8Ki:avoid-&str-to-String-conversions, r=compiler-errors
Avoid `&str` to `String` conversions This patch removes the recently added unnecessary `&str` to `String` conversions. follow-up to rust-lang#99718
2 parents fac84e8 + abbd34d commit d7f414d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: compiler/rustc_typeck/src/check/coercion.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1589,11 +1589,11 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
15891589
) {
15901590
let hir::ExprKind::Loop(_, _, _, loop_span) = expr.kind else { return;};
15911591
let mut span: MultiSpan = vec![loop_span].into();
1592-
span.push_span_label(loop_span, "this might have zero elements to iterate on".to_string());
1592+
span.push_span_label(loop_span, "this might have zero elements to iterate on");
15931593
for ret_expr in ret_exprs {
15941594
span.push_span_label(
15951595
ret_expr.span,
1596-
"if the loop doesn't execute, this value would never get returned".to_string(),
1596+
"if the loop doesn't execute, this value would never get returned",
15971597
);
15981598
}
15991599
err.span_note(

0 commit comments

Comments
 (0)