Skip to content

Commit

Permalink
Rollup merge of rust-lang#100301 - TaKO8Ki:avoid-&str-to-String-conve…
Browse files Browse the repository at this point in the history
…rsions, 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
  • Loading branch information
Dylan-DPC committed Aug 9, 2022
2 parents fac84e8 + abbd34d commit d7f414d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_typeck/src/check/coercion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1589,11 +1589,11 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
) {
let hir::ExprKind::Loop(_, _, _, loop_span) = expr.kind else { return;};
let mut span: MultiSpan = vec![loop_span].into();
span.push_span_label(loop_span, "this might have zero elements to iterate on".to_string());
span.push_span_label(loop_span, "this might have zero elements to iterate on");
for ret_expr in ret_exprs {
span.push_span_label(
ret_expr.span,
"if the loop doesn't execute, this value would never get returned".to_string(),
"if the loop doesn't execute, this value would never get returned",
);
}
err.span_note(
Expand Down

0 comments on commit d7f414d

Please sign in to comment.