about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-08-09 17:34:56 +0530
committerGitHub <noreply@github.com>2022-08-09 17:34:56 +0530
commitd7f414d540f3e4ccc9926bff7c4d87420da8decc (patch)
treeb9cbdf86927d0a101e347b4c0d0436e73b0a32f4
parentfac84e8bb65349e3b26cb5c4e7acf7694b8e6659 (diff)
parentabbd34d00e0a5ee15060ef92dc6b0225dd2897a5 (diff)
downloadrust-d7f414d540f3e4ccc9926bff7c4d87420da8decc.tar.gz
rust-d7f414d540f3e4ccc9926bff7c4d87420da8decc.zip
Rollup merge of #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 #99718
-rw-r--r--compiler/rustc_typeck/src/check/coercion.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_typeck/src/check/coercion.rs b/compiler/rustc_typeck/src/check/coercion.rs
index 21d0a7869d6..540a8c3a83d 100644
--- a/compiler/rustc_typeck/src/check/coercion.rs
+++ b/compiler/rustc_typeck/src/check/coercion.rs
@@ -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(