diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-03-29 12:32:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-29 12:32:26 +0100 |
| commit | fda206633da99468b4f813a2f888e05e31bafa2d (patch) | |
| tree | f61f165ab84dc996ed1b412aa5fdfdb64e1ae279 /src/test/ui/span | |
| parent | 647d09fced568c7275211e3d7e1a084d94757a2a (diff) | |
| parent | 4644c3a6aa0ff0ad394175a029f5531728ecff31 (diff) | |
| download | rust-fda206633da99468b4f813a2f888e05e31bafa2d.tar.gz rust-fda206633da99468b4f813a2f888e05e31bafa2d.zip | |
Rollup merge of #59467 - hgallagher1993:local_branch, r=estebank
Better diagnostic for binary operation on BoxedValues Fixes #59458
Diffstat (limited to 'src/test/ui/span')
| -rw-r--r-- | src/test/ui/span/issue-39018.stderr | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/test/ui/span/issue-39018.stderr b/src/test/ui/span/issue-39018.stderr index 00f1b11df19..a5b91f090d2 100644 --- a/src/test/ui/span/issue-39018.stderr +++ b/src/test/ui/span/issue-39018.stderr @@ -1,26 +1,35 @@ 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 + | | | + | | `+` can't be used to concatenate two `&str` strings + | &str 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(); |
