about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNoah Lev <camelidcamel@gmail.com>2022-01-12 22:23:56 -0800
committerNoah Lev <camelidcamel@gmail.com>2022-01-12 22:23:56 -0800
commit935a99a4d1abfb517dfadf11fa29500348cc2b1c (patch)
treeb49a628d7b5792534711eca3bc9a549b3f38862c
parent69db5e2c8c8bca8bc513cbe4ffa37dff234ad508 (diff)
downloadrust-935a99a4d1abfb517dfadf11fa29500348cc2b1c.tar.gz
rust-935a99a4d1abfb517dfadf11fa29500348cc2b1c.zip
Add line breaks to make message easier to read
-rw-r--r--compiler/rustc_typeck/src/check/op.rs6
-rw-r--r--src/test/ui/issues/issue-47377.stderr4
-rw-r--r--src/test/ui/issues/issue-47380.stderr4
-rw-r--r--src/test/ui/span/issue-39018.stderr28
-rw-r--r--src/test/ui/str/str-concat-on-double-ref.stderr4
-rw-r--r--src/test/ui/terminal-width/non-1-width-unicode-multiline-label.stderr4
6 files changed, 36 insertions, 14 deletions
diff --git a/compiler/rustc_typeck/src/check/op.rs b/compiler/rustc_typeck/src/check/op.rs
index 8bb0613f456..be1b01ae294 100644
--- a/compiler/rustc_typeck/src/check/op.rs
+++ b/compiler/rustc_typeck/src/check/op.rs
@@ -549,9 +549,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         is_assign: IsAssign,
         op: hir::BinOp,
     ) -> bool {
-        let str_concat_note = "String concatenation appends the string on the right to the \
-                                    string on the left and may require reallocation. This \
-                                    requires ownership of the string on the left.";
+        let str_concat_note = "String concatenation appends the string on the right to the
+string on the left and may require reallocation.
+This requires ownership of the string on the left.";
         let rm_borrow_msg = "remove the borrow to obtain an owned `String`";
         let to_owned_msg = "use `to_owned()` to create an owned `String` from a string reference";
 
diff --git a/src/test/ui/issues/issue-47377.stderr b/src/test/ui/issues/issue-47377.stderr
index 2e00de84087..97fbb53bd02 100644
--- a/src/test/ui/issues/issue-47377.stderr
+++ b/src/test/ui/issues/issue-47377.stderr
@@ -7,7 +7,9 @@ LL |      let _a = b + ", World!";
    |               | `+` cannot be used to concatenate two `&str` strings
    |               &str
    |
-   = note: String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left.
+   = note: String concatenation appends the string on the right to the
+           string on the left and may require reallocation.
+           This requires ownership of the string on the left.
 help: use `to_owned()` to create an owned `String` from a string reference
    |
 LL |      let _a = b.to_owned() + ", World!";
diff --git a/src/test/ui/issues/issue-47380.stderr b/src/test/ui/issues/issue-47380.stderr
index fec64009444..7a73d41a035 100644
--- a/src/test/ui/issues/issue-47380.stderr
+++ b/src/test/ui/issues/issue-47380.stderr
@@ -7,7 +7,9 @@ LL |     println!("🦀🦀🦀🦀🦀"); let _a = b + ", World!";
    |                                      | `+` cannot be used to concatenate two `&str` strings
    |                                      &str
    |
-   = note: String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left.
+   = note: String concatenation appends the string on the right to the
+           string on the left and may require reallocation.
+           This requires ownership of the string on the left.
 help: use `to_owned()` to create an owned `String` from a string reference
    |
 LL |     println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!";
diff --git a/src/test/ui/span/issue-39018.stderr b/src/test/ui/span/issue-39018.stderr
index 9054dd931ca..9e466f3a9a0 100644
--- a/src/test/ui/span/issue-39018.stderr
+++ b/src/test/ui/span/issue-39018.stderr
@@ -7,7 +7,9 @@ LL |     let x = "Hello " + "World!";
    |             |        `+` cannot be used to concatenate two `&str` strings
    |             &str
    |
-   = note: String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left.
+   = note: String concatenation appends the string on the right to the
+           string on the left and may require reallocation.
+           This requires ownership of the string on the left.
 help: use `to_owned()` to create an owned `String` from a string reference
    |
 LL |     let x = "Hello ".to_owned() + "World!";
@@ -62,7 +64,9 @@ LL |     let _ = &a + &b;
    |             &String
    |             help: remove the borrow to obtain an owned `String`
    |
-   = note: String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left.
+   = note: String concatenation appends the string on the right to the
+           string on the left and may require reallocation.
+           This requires ownership of the string on the left.
 
 error[E0369]: cannot add `String` to `&String`
   --> $DIR/issue-39018.rs:27:16
@@ -111,7 +115,9 @@ LL |     let _ = e + &b;
    |             | `+` cannot be used to concatenate two `&str` strings
    |             &String
    |
-   = note: String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left.
+   = note: String concatenation appends the string on the right to the
+           string on the left and may require reallocation.
+           This requires ownership of the string on the left.
 help: use `to_owned()` to create an owned `String` from a string reference
    |
 LL |     let _ = e.to_owned() + &b;
@@ -126,7 +132,9 @@ LL |     let _ = e + d;
    |             | `+` cannot be used to concatenate two `&str` strings
    |             &String
    |
-   = note: String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left.
+   = note: String concatenation appends the string on the right to the
+           string on the left and may require reallocation.
+           This requires ownership of the string on the left.
 help: use `to_owned()` to create an owned `String` from a string reference
    |
 LL |     let _ = e.to_owned() + d;
@@ -141,7 +149,9 @@ LL |     let _ = e + &d;
    |             | `+` cannot be used to concatenate two `&str` strings
    |             &String
    |
-   = note: String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left.
+   = note: String concatenation appends the string on the right to the
+           string on the left and may require reallocation.
+           This requires ownership of the string on the left.
 help: use `to_owned()` to create an owned `String` from a string reference
    |
 LL |     let _ = e.to_owned() + &d;
@@ -172,7 +182,9 @@ LL |     let _ = c + &d;
    |             | `+` cannot be used to concatenate two `&str` strings
    |             &str
    |
-   = note: String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left.
+   = note: String concatenation appends the string on the right to the
+           string on the left and may require reallocation.
+           This requires ownership of the string on the left.
 help: use `to_owned()` to create an owned `String` from a string reference
    |
 LL |     let _ = c.to_owned() + &d;
@@ -187,7 +199,9 @@ LL |     let _ = c + d;
    |             | `+` cannot be used to concatenate two `&str` strings
    |             &str
    |
-   = note: String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left.
+   = note: String concatenation appends the string on the right to the
+           string on the left and may require reallocation.
+           This requires ownership of the string on the left.
 help: use `to_owned()` to create an owned `String` from a string reference
    |
 LL |     let _ = c.to_owned() + d;
diff --git a/src/test/ui/str/str-concat-on-double-ref.stderr b/src/test/ui/str/str-concat-on-double-ref.stderr
index e8b5c2bbd85..d239ec0d9fc 100644
--- a/src/test/ui/str/str-concat-on-double-ref.stderr
+++ b/src/test/ui/str/str-concat-on-double-ref.stderr
@@ -7,7 +7,9 @@ LL |     let c = a + b;
    |             | `+` cannot be used to concatenate two `&str` strings
    |             &String
    |
-   = note: String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left.
+   = note: String concatenation appends the string on the right to the
+           string on the left and may require reallocation.
+           This requires ownership of the string on the left.
 help: use `to_owned()` to create an owned `String` from a string reference
    |
 LL |     let c = a.to_owned() + b;
diff --git a/src/test/ui/terminal-width/non-1-width-unicode-multiline-label.stderr b/src/test/ui/terminal-width/non-1-width-unicode-multiline-label.stderr
index 72005a88980..55e993db3d3 100644
--- a/src/test/ui/terminal-width/non-1-width-unicode-multiline-label.stderr
+++ b/src/test/ui/terminal-width/non-1-width-unicode-multiline-label.stderr
@@ -7,7 +7,9 @@ LL | ...ཽཾཿ྄ཱྀྀྂྃ྅྆྇ྈྉྊྋྌྍྎྏྐྑྒྒྷྔ
    |                                                  |              `+` cannot be used to concatenate two `&str` strings
    |                                                  &str
    |
-   = note: String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left.
+   = note: String concatenation appends the string on the right to the
+           string on the left and may require reallocation.
+           This requires ownership of the string on the left.
 help: use `to_owned()` to create an owned `String` from a string reference
    |
 LL |     let _ = "ༀ༁༂༃༄༅༆༇༈༉༊་༌།༎༏༐༑༒༓༔༕༖༗༘༙༚༛༜༝༞༟༠༡༢༣༤༥༦༧༨༩༪༫༬༭༮༯༰༱༲༳༴༵༶༷༸༹༺༻༼༽༾༿ཀཁགགྷངཅཆཇ཈ཉཊཋཌཌྷཎཏཐདདྷནཔཕབབྷམཙཚཛཛྷཝཞཟའཡརལཤཥསཧཨཀྵཪཫཬ཭཮཯཰ཱཱཱིིུུྲྀཷླྀཹེཻོཽཾཿ྄ཱྀྀྂྃ྅྆྇ྈྉྊྋྌྍྎྏྐྑྒྒྷྔྕྖྗ྘ྙྚྛྜྜྷྞྟྠྡྡྷྣྤྥྦྦྷྨྩྪྫྫྷྭྮྯྰྱྲླྴྵྶྷྸྐྵྺྻྼ྽྾྿࿀࿁࿂࿃࿄࿅࿆࿇࿈࿉࿊࿋࿌࿍࿎࿏࿐࿑࿒࿓࿔࿕࿖࿗࿘࿙࿚"; let _a = unicode_is_fun.to_owned() + " really fun!";