about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTakayuki Maeda <takoyaki0316@gmail.com>2022-08-09 12:27:53 +0900
committerTakayuki Maeda <takoyaki0316@gmail.com>2022-08-09 12:27:53 +0900
commitabbd34d00e0a5ee15060ef92dc6b0225dd2897a5 (patch)
treeedfa4d69162f4c0e1628f1090e0f0e309a58ac27
parent93ab13b4e894ab74258c40aaf29872db2b17b6b4 (diff)
downloadrust-abbd34d00e0a5ee15060ef92dc6b0225dd2897a5.tar.gz
rust-abbd34d00e0a5ee15060ef92dc6b0225dd2897a5.zip
avoid `&str` to `String` conversions
-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(