about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorNoah Lev <camelidcamel@gmail.com>2022-01-18 16:32:58 -0800
committerNoah Lev <camelidcamel@gmail.com>2022-01-18 16:32:58 -0800
commit7507fb6306d540a6f07f6f325d25925311b037a2 (patch)
tree12a542834342654472e176d188f5f5f5a4952970 /src/test/ui
parent6e42bc378fe2225c21d13957c1299ee349fcdfaf (diff)
downloadrust-7507fb6306d540a6f07f6f325d25925311b037a2.tar.gz
rust-7507fb6306d540a6f07f6f325d25925311b037a2.zip
Shorten and improve messages
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/issues/issue-47377.stderr15
-rw-r--r--src/test/ui/issues/issue-47380.stderr15
-rw-r--r--src/test/ui/span/issue-39018.stderr98
-rw-r--r--src/test/ui/str/str-concat-on-double-ref.stderr15
-rw-r--r--src/test/ui/terminal-width/non-1-width-unicode-multiline-label.stderr19
5 files changed, 55 insertions, 107 deletions
diff --git a/src/test/ui/issues/issue-47377.stderr b/src/test/ui/issues/issue-47377.stderr
index 97fbb53bd02..e4b907070a6 100644
--- a/src/test/ui/issues/issue-47377.stderr
+++ b/src/test/ui/issues/issue-47377.stderr
@@ -2,18 +2,13 @@ error[E0369]: cannot add `&str` to `&str`
   --> $DIR/issue-47377.rs:4:14
    |
 LL |      let _a = b + ", World!";
-   |               - ^ ---------- &str
-   |               | |
-   |               | `+` cannot be used to concatenate two `&str` strings
+   |               --^ ---------- &str
+   |               |||
+   |               ||`+` cannot be used to concatenate two `&str` strings
+   |               |help: create an owned `String` from a string reference: `.to_owned()`
    |               &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.
-help: use `to_owned()` to create an owned `String` from a string reference
-   |
-LL |      let _a = b.to_owned() + ", World!";
-   |                +++++++++++
+   = note: string concatenation requires an owned `String` on the left
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issues/issue-47380.stderr b/src/test/ui/issues/issue-47380.stderr
index 7a73d41a035..7ad369fcd0e 100644
--- a/src/test/ui/issues/issue-47380.stderr
+++ b/src/test/ui/issues/issue-47380.stderr
@@ -2,18 +2,13 @@ error[E0369]: cannot add `&str` to `&str`
   --> $DIR/issue-47380.rs:3:35
    |
 LL |     println!("🦀🦀🦀🦀🦀"); let _a = b + ", World!";
-   |                                      - ^ ---------- &str
-   |                                      | |
-   |                                      | `+` cannot be used to concatenate two `&str` strings
+   |                                      --^ ---------- &str
+   |                                      |||
+   |                                      ||`+` cannot be used to concatenate two `&str` strings
+   |                                      |help: create an owned `String` from a string reference: `.to_owned()`
    |                                      &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.
-help: use `to_owned()` to create an owned `String` from a string reference
-   |
-LL |     println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!";
-   |                                       +++++++++++
+   = note: string concatenation requires an owned `String` on the left
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/span/issue-39018.stderr b/src/test/ui/span/issue-39018.stderr
index 9e466f3a9a0..9cfb015e753 100644
--- a/src/test/ui/span/issue-39018.stderr
+++ b/src/test/ui/span/issue-39018.stderr
@@ -2,18 +2,13 @@ error[E0369]: cannot add `&str` to `&str`
   --> $DIR/issue-39018.rs:2:22
    |
 LL |     let x = "Hello " + "World!";
-   |             -------- ^ -------- &str
-   |             |        |
-   |             |        `+` cannot be used to concatenate two `&str` strings
+   |             ---------^ -------- &str
+   |             |       ||
+   |             |       |`+` cannot be used to concatenate two `&str` strings
+   |             |       help: create an owned `String` from a string reference: `.to_owned()`
    |             &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.
-help: use `to_owned()` to create an owned `String` from a string reference
-   |
-LL |     let x = "Hello ".to_owned() + "World!";
-   |                     +++++++++++
+   = note: string concatenation requires an owned `String` on the left
 
 error[E0369]: cannot add `World` to `World`
   --> $DIR/issue-39018.rs:8:26
@@ -49,7 +44,7 @@ LL |     let x = "Hello " + "World!".to_owned();
    |             |        `+` cannot be used to concatenate a `&str` with a `String`
    |             &str
    |
-help: call `.to_owned()` on the left and add a borrow on the right
+help: create an owned `String` on the left and add a borrow on the right
    |
 LL |     let x = "Hello ".to_owned() + &"World!".to_owned();
    |                     +++++++++++   +
@@ -64,9 +59,7 @@ 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 requires an owned `String` on the left
 
 error[E0369]: cannot add `String` to `&String`
   --> $DIR/issue-39018.rs:27:16
@@ -101,7 +94,7 @@ LL |     let _ = e + b;
    |             | `+` cannot be used to concatenate a `&str` with a `String`
    |             &String
    |
-help: call `.to_owned()` on the left and add a borrow on the right
+help: create an owned `String` on the left and add a borrow on the right
    |
 LL |     let _ = e.to_owned() + &b;
    |              +++++++++++   +
@@ -110,52 +103,37 @@ error[E0369]: cannot add `&String` to `&String`
   --> $DIR/issue-39018.rs:31:15
    |
 LL |     let _ = e + &b;
-   |             - ^ -- &String
-   |             | |
-   |             | `+` cannot be used to concatenate two `&str` strings
+   |             --^ -- &String
+   |             |||
+   |             ||`+` cannot be used to concatenate two `&str` strings
+   |             |help: create an owned `String` from a string reference: `.to_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.
-help: use `to_owned()` to create an owned `String` from a string reference
-   |
-LL |     let _ = e.to_owned() + &b;
-   |              +++++++++++
+   = note: string concatenation requires an owned `String` on the left
 
 error[E0369]: cannot add `&str` to `&String`
   --> $DIR/issue-39018.rs:32:15
    |
 LL |     let _ = e + d;
-   |             - ^ - &str
-   |             | |
-   |             | `+` cannot be used to concatenate two `&str` strings
+   |             --^ - &str
+   |             |||
+   |             ||`+` cannot be used to concatenate two `&str` strings
+   |             |help: create an owned `String` from a string reference: `.to_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.
-help: use `to_owned()` to create an owned `String` from a string reference
-   |
-LL |     let _ = e.to_owned() + d;
-   |              +++++++++++
+   = note: string concatenation requires an owned `String` on the left
 
 error[E0369]: cannot add `&&str` to `&String`
   --> $DIR/issue-39018.rs:33:15
    |
 LL |     let _ = e + &d;
-   |             - ^ -- &&str
-   |             | |
-   |             | `+` cannot be used to concatenate two `&str` strings
+   |             --^ -- &&str
+   |             |||
+   |             ||`+` cannot be used to concatenate two `&str` strings
+   |             |help: create an owned `String` from a string reference: `.to_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.
-help: use `to_owned()` to create an owned `String` from a string reference
-   |
-LL |     let _ = e.to_owned() + &d;
-   |              +++++++++++
+   = note: string concatenation requires an owned `String` on the left
 
 error[E0369]: cannot add `&&str` to `&&str`
   --> $DIR/issue-39018.rs:34:16
@@ -177,35 +155,25 @@ error[E0369]: cannot add `&&str` to `&str`
   --> $DIR/issue-39018.rs:36:15
    |
 LL |     let _ = c + &d;
-   |             - ^ -- &&str
-   |             | |
-   |             | `+` cannot be used to concatenate two `&str` strings
+   |             --^ -- &&str
+   |             |||
+   |             ||`+` cannot be used to concatenate two `&str` strings
+   |             |help: create an owned `String` from a string reference: `.to_owned()`
    |             &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.
-help: use `to_owned()` to create an owned `String` from a string reference
-   |
-LL |     let _ = c.to_owned() + &d;
-   |              +++++++++++
+   = note: string concatenation requires an owned `String` on the left
 
 error[E0369]: cannot add `&str` to `&str`
   --> $DIR/issue-39018.rs:37:15
    |
 LL |     let _ = c + d;
-   |             - ^ - &str
-   |             | |
-   |             | `+` cannot be used to concatenate two `&str` strings
+   |             --^ - &str
+   |             |||
+   |             ||`+` cannot be used to concatenate two `&str` strings
+   |             |help: create an owned `String` from a string reference: `.to_owned()`
    |             &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.
-help: use `to_owned()` to create an owned `String` from a string reference
-   |
-LL |     let _ = c.to_owned() + d;
-   |              +++++++++++
+   = note: string concatenation requires an owned `String` on the left
 
 error: aborting due to 14 previous errors
 
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 d239ec0d9fc..251bc7ac0ea 100644
--- a/src/test/ui/str/str-concat-on-double-ref.stderr
+++ b/src/test/ui/str/str-concat-on-double-ref.stderr
@@ -2,18 +2,13 @@ error[E0369]: cannot add `&str` to `&String`
   --> $DIR/str-concat-on-double-ref.rs:4:15
    |
 LL |     let c = a + b;
-   |             - ^ - &str
-   |             | |
-   |             | `+` cannot be used to concatenate two `&str` strings
+   |             --^ - &str
+   |             |||
+   |             ||`+` cannot be used to concatenate two `&str` strings
+   |             |help: create an owned `String` from a string reference: `.to_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.
-help: use `to_owned()` to create an owned `String` from a string reference
-   |
-LL |     let c = a.to_owned() + b;
-   |              +++++++++++
+   = note: string concatenation requires an owned `String` on the left
 
 error: aborting due to previous error
 
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 55e993db3d3..a97ecc4ce15 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
@@ -1,19 +1,14 @@
 error[E0369]: cannot add `&str` to `&str`
   --> $DIR/non-1-width-unicode-multiline-label.rs:5:260
    |
-LL | ...ཽཾཿ྄ཱྀྀྂྃ྅྆྇ྈྉྊྋྌྍྎྏྐྑྒྒྷྔྕྖྗ྘ྙྚྛྜྜྷྞྟྠྡྡྷྣྤྥྦྦྷྨྩྪྫྫྷྭྮྯྰྱྲླྴྵྶྷྸྐྵྺྻྼ྽྾྿࿀࿁࿂࿃࿄࿅࿆࿇...࿋࿌࿍࿎࿏࿐࿑࿒࿓࿔࿕࿖࿗࿘࿙࿚"; let _a = unicode_is_fun + " really fun!";
-   |                                                  -------------- ^ -------------- &str
-   |                                                  |              |
-   |                                                  |              `+` cannot be used to concatenate two `&str` strings
-   |                                                  &str
+LL | ...྅྆྇ྈྉྊྋྌྍྎྏྐྑྒྒྷྔྕྖྗ྘ྙྚྛྜྜྷྞྟྠྡྡྷྣྤྥྦྦྷྨྩྪྫྫྷྭྮྯྰྱྲླྴྵྶྷྸྐྵྺྻྼ྽྾྿࿀࿁࿂࿃࿄࿅࿆࿇࿈࿉࿊࿋࿌࿍࿎...࿒࿓࿔࿕࿖࿗࿘࿙࿚"; let _a = unicode_is_fun + " really fun!";
+   |                                                 ---------------^ -------------- &str
+   |                                                 |             ||
+   |                                                 |             |`+` cannot be used to concatenate two `&str` strings
+   |                                                 |             help: create an owned `String` from a string reference: `.to_owned()`
+   |                                                 &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.
-help: use `to_owned()` to create an owned `String` from a string reference
-   |
-LL |     let _ = "ༀ༁༂༃༄༅༆༇༈༉༊་༌།༎༏༐༑༒༓༔༕༖༗༘༙༚༛༜༝༞༟༠༡༢༣༤༥༦༧༨༩༪༫༬༭༮༯༰༱༲༳༴༵༶༷༸༹༺༻༼༽༾༿ཀཁགགྷངཅཆཇ཈ཉཊཋཌཌྷཎཏཐདདྷནཔཕབབྷམཙཚཛཛྷཝཞཟའཡརལཤཥསཧཨཀྵཪཫཬ཭཮཯཰ཱཱཱིིུུྲྀཷླྀཹེཻོཽཾཿ྄ཱྀྀྂྃ྅྆྇ྈྉྊྋྌྍྎྏྐྑྒྒྷྔྕྖྗ྘ྙྚྛྜྜྷྞྟྠྡྡྷྣྤྥྦྦྷྨྩྪྫྫྷྭྮྯྰྱྲླྴྵྶྷྸྐྵྺྻྼ྽྾྿࿀࿁࿂࿃࿄࿅࿆࿇࿈࿉࿊࿋࿌࿍࿎࿏࿐࿑࿒࿓࿔࿕࿖࿗࿘࿙࿚"; let _a = unicode_is_fun.to_owned() + " really fun!";
-   |                                                                                                                                                                                         +++++++++++
+   = note: string concatenation requires an owned `String` on the left
 
 error: aborting due to previous error