about summary refs log tree commit diff
path: root/src/test/ui/span
diff options
context:
space:
mode:
authorhgallagher1993 <hgallagher1993@gmail.com>2019-03-27 13:13:09 -0400
committerhgallagher1993 <hgallagher1993@gmail.com>2019-03-27 13:13:09 -0400
commit4d648ce1b936de167260ed4d11f8c3d2f6462ff0 (patch)
tree82dc159bcfc5ec0a32ffc378147df04cf3a7927f /src/test/ui/span
parentc5fb4d0d2f464bc9ab61f7693ed4dde4d9326820 (diff)
downloadrust-4d648ce1b936de167260ed4d11f8c3d2f6462ff0.tar.gz
rust-4d648ce1b936de167260ed4d11f8c3d2f6462ff0.zip
Better diagnostic for binary operation on BoxedValues
Diffstat (limited to 'src/test/ui/span')
-rw-r--r--src/test/ui/span/issue-39018.stderr22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/test/ui/span/issue-39018.stderr b/src/test/ui/span/issue-39018.stderr
index 00f1b11df19..6e475483987 100644
--- a/src/test/ui/span/issue-39018.stderr
+++ b/src/test/ui/span/issue-39018.stderr
@@ -1,26 +1,36 @@
 error[E0369]: binary operation `+` cannot be applied to type `&str`
-  --> $DIR/issue-39018.rs:2:13
+  --> $DIR/issue-39018.rs:2:22
    |
 LL |     let x = "Hello " + "World!";
-   |             ^^^^^^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
+   |             ---------^---------
+   |             |          |
+   |             |          &str
+   |             &str
+   |             `+` can't be used to concatenate two `&str` strings
 help: `to_owned()` can be used to create an owned `String` from a string reference. 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
    |
 LL |     let x = "Hello ".to_owned() + "World!";
    |             ^^^^^^^^^^^^^^^^^^^
 
 error[E0369]: binary operation `+` cannot be applied to type `World`
-  --> $DIR/issue-39018.rs:8:13
+  --> $DIR/issue-39018.rs:8:26
    |
 LL |     let y = World::Hello + World::Goodbye;
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |             ------------ ^ -------------- World
+   |             |
+   |             World
    |
    = note: an implementation of `std::ops::Add` might be missing for `World`
 
 error[E0369]: binary operation `+` cannot be applied to type `&str`
-  --> $DIR/issue-39018.rs:11:13
+  --> $DIR/issue-39018.rs:11:22
    |
 LL |     let x = "Hello " + "World!".to_owned();
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `+` can't be used to concatenate a `&str` with a `String`
+   |             ---------^--------------------
+   |             |          |
+   |             |          std::string::String
+   |             &str
+   |             `+` can't be used to concatenate a `&str` with a `String`
 help: `to_owned()` can be used to create an owned `String` from a string reference. 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
    |
 LL |     let x = "Hello ".to_owned() + &"World!".to_owned();