rust/src/test/ui/span/issue-39018.stderr

177 lines
7.5 KiB
Plaintext
Raw Normal View History

error[E0369]: binary operation `+` cannot be applied to type `&str`
--> $DIR/issue-39018.rs:2:22
|
2018-02-22 18:42:32 -06:00
LL | let x = "Hello " + "World!";
| -------- ^ -------- &str
| | |
2019-05-16 22:05:00 -05:00
| | `+` cannot be used to concatenate two `&str` strings
| &str
2017-05-16 08:12:24 -05:00
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
2017-06-28 01:16:04 -05:00
|
2018-02-24 17:01:39 -06:00
LL | let x = "Hello ".to_owned() + "World!";
2017-06-28 01:16:04 -05:00
| ^^^^^^^^^^^^^^^^^^^
error[E0369]: binary operation `+` cannot be applied to type `World`
--> $DIR/issue-39018.rs:8:26
|
2018-02-22 18:42:32 -06:00
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:22
|
2018-02-24 17:59:34 -06:00
LL | let x = "Hello " + "World!".to_owned();
2019-05-16 21:56:11 -05:00
| -------- ^ ------------------- std::string::String
| | |
2019-05-16 22:05:00 -05:00
| | `+` cannot be used to concatenate a `&str` with a `String`
| &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!".to_owned();
| ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
--> $DIR/issue-39018.rs:26:16
|
LL | let _ = &a + &b;
| -- ^ -- &std::string::String
| | |
2019-05-16 22:05:00 -05:00
| | `+` cannot be used to concatenate two `&str` strings
| &std::string::String
help: 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 _ = a + &b;
| ^
error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
--> $DIR/issue-39018.rs:27:16
|
LL | let _ = &a + b;
2019-05-16 21:56:11 -05:00
| -- ^ - std::string::String
| | |
2019-05-16 22:05:00 -05:00
| | `+` cannot be used to concatenate a `&str` with a `String`
| &std::string::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 _ = &a.to_owned() + &b;
| ^^^^^^^^^^^^^ ^^
error[E0308]: mismatched types
--> $DIR/issue-39018.rs:29:17
|
LL | let _ = a + b;
| ^
| |
| expected &str, found struct `std::string::String`
| help: consider borrowing here: `&b`
|
= note: expected type `&str`
found type `std::string::String`
error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
--> $DIR/issue-39018.rs:30:15
|
LL | let _ = e + b;
2019-05-16 21:56:11 -05:00
| - ^ - std::string::String
| | |
2019-05-16 22:05:00 -05:00
| | `+` cannot be used to concatenate a `&str` with a `String`
| &std::string::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 _ = e.to_owned() + &b;
| ^^^^^^^^^^^^ ^^
error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
--> $DIR/issue-39018.rs:31:15
|
LL | let _ = e + &b;
| - ^ -- &std::string::String
| | |
2019-05-16 22:05:00 -05:00
| | `+` cannot be used to concatenate two `&str` strings
| &std::string::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 _ = e.to_owned() + &b;
| ^^^^^^^^^^^^
error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
--> $DIR/issue-39018.rs:32:15
|
LL | let _ = e + d;
| - ^ - &str
| | |
2019-05-16 22:05:00 -05:00
| | `+` cannot be used to concatenate two `&str` strings
| &std::string::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 _ = e.to_owned() + d;
| ^^^^^^^^^^^^
error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
--> $DIR/issue-39018.rs:33:15
|
LL | let _ = e + &d;
| - ^ -- &&str
| | |
2019-05-16 22:05:00 -05:00
| | `+` cannot be used to concatenate two `&str` strings
| &std::string::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 _ = e.to_owned() + &d;
| ^^^^^^^^^^^^
error[E0369]: binary operation `+` cannot be applied to type `&&str`
--> $DIR/issue-39018.rs:34:16
|
LL | let _ = &c + &d;
| -- ^ -- &&str
| |
| &&str
|
= note: an implementation of `std::ops::Add` might be missing for `&&str`
error[E0369]: binary operation `+` cannot be applied to type `&&str`
--> $DIR/issue-39018.rs:35:16
|
LL | let _ = &c + d;
| -- ^ - &str
| |
| &&str
|
= note: an implementation of `std::ops::Add` might be missing for `&&str`
error[E0369]: binary operation `+` cannot be applied to type `&str`
--> $DIR/issue-39018.rs:36:15
|
LL | let _ = c + &d;
| - ^ -- &&str
| | |
2019-05-16 22:05:00 -05:00
| | `+` cannot 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 _ = c.to_owned() + &d;
| ^^^^^^^^^^^^
error[E0369]: binary operation `+` cannot be applied to type `&str`
--> $DIR/issue-39018.rs:37:15
|
LL | let _ = c + d;
| - ^ - &str
| | |
2019-05-16 22:05:00 -05:00
| | `+` cannot 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 _ = c.to_owned() + d;
| ^^^^^^^^^^^^
error: aborting due to 14 previous errors
Some errors have detailed explanations: E0308, E0369.
For more information about an error, try `rustc --explain E0308`.