Closed
Description
This code (containing tabs) gives an error (playground):
let b = "hello";
let _a = b + ", World!";
The error works fine on stable:
|
3 | let _a = b + ", World!";
| ^^^^^^^^^^^^^^ `+` 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
|
3 | let _a = b.to_owned() + ", World!";
| ^^^^^^^^^^^^
But is mispositioned on rustc 1.25.0-nightly (73ac5d6 2018-01-11) as well as on rustc 1.24.0-beta.2 (a19122c 2018-01-10):
|
3 | let _a = b + ", World!";
| ^^^^^^^^^^^^^^ `+` 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
|
3 | let _a = b.to_owned() + ", World!";
| ^^^^^^^^^^^^
cc @estebank