2019-12-10 21:03:13 +00:00
|
|
|
error[E0369]: cannot add `&str` to `&str`
|
2019-03-27 17:13:09 +00:00
|
|
|
--> $DIR/issue-39018.rs:2:22
|
2017-01-14 20:25:33 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | let x = "Hello " + "World!";
|
2022-01-19 00:38:06 +00:00
|
|
|
| -------- ^ -------- &str
|
|
|
|
| | |
|
|
|
|
| | `+` cannot be used to concatenate two `&str` strings
|
2019-03-27 17:13:09 +00:00
|
|
|
| &str
|
2019-10-24 05:20:58 +00:00
|
|
|
|
|
2022-01-19 00:32:58 +00:00
|
|
|
= note: string concatenation requires an owned `String` on the left
|
2022-01-19 00:38:06 +00:00
|
|
|
help: create an owned `String` from a string reference
|
|
|
|
|
|
|
|
|
LL | let x = "Hello ".to_owned() + "World!";
|
|
|
|
| +++++++++++
|
2017-01-14 20:25:33 +00:00
|
|
|
|
2019-12-10 21:03:13 +00:00
|
|
|
error[E0369]: cannot add `World` to `World`
|
2019-03-27 17:13:09 +00:00
|
|
|
--> $DIR/issue-39018.rs:8:26
|
2017-01-14 20:25:33 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | let y = World::Hello + World::Goodbye;
|
2019-03-27 17:13:09 +00:00
|
|
|
| ------------ ^ -------------- World
|
|
|
|
| |
|
|
|
|
| World
|
2017-01-14 20:25:33 +00:00
|
|
|
|
|
2021-09-28 14:48:54 +00:00
|
|
|
note: an implementation of `Add<_>` might be missing for `World`
|
|
|
|
--> $DIR/issue-39018.rs:15:1
|
|
|
|
|
|
|
|
|
LL | enum World {
|
|
|
|
| ^^^^^^^^^^ must implement `Add<_>`
|
2022-12-12 11:55:46 +00:00
|
|
|
note: the trait `Add` must be implemented
|
2021-09-28 14:48:54 +00:00
|
|
|
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
2017-01-14 20:25:33 +00:00
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
error[E0369]: cannot add `String` to `&str`
|
2019-03-27 17:13:09 +00:00
|
|
|
--> $DIR/issue-39018.rs:11:22
|
2018-02-21 06:46:51 +00:00
|
|
|
|
|
2018-02-24 23:59:34 +00:00
|
|
|
LL | let x = "Hello " + "World!".to_owned();
|
2020-09-02 07:40:56 +00:00
|
|
|
| -------- ^ ------------------- String
|
2019-05-17 02:56:11 +00:00
|
|
|
| | |
|
2019-05-17 03:05:00 +00:00
|
|
|
| | `+` cannot be used to concatenate a `&str` with a `String`
|
2019-03-27 17:13:09 +00:00
|
|
|
| &str
|
2019-10-24 05:20:58 +00:00
|
|
|
|
|
2022-01-19 00:32:58 +00:00
|
|
|
help: create an owned `String` on the left and add a borrow on the right
|
2018-02-21 06:46:51 +00:00
|
|
|
|
|
2018-07-22 05:33:32 +00:00
|
|
|
LL | let x = "Hello ".to_owned() + &"World!".to_owned();
|
2022-01-13 06:04:39 +00:00
|
|
|
| +++++++++++ +
|
2018-02-21 06:46:51 +00:00
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
error[E0369]: cannot add `&String` to `&String`
|
2019-05-17 02:29:02 +00:00
|
|
|
--> $DIR/issue-39018.rs:26:16
|
|
|
|
|
|
|
|
|
LL | let _ = &a + &b;
|
2020-09-02 07:40:56 +00:00
|
|
|
| -- ^ -- &String
|
2019-05-17 02:29:02 +00:00
|
|
|
| | |
|
2019-05-17 03:05:00 +00:00
|
|
|
| | `+` cannot be used to concatenate two `&str` strings
|
2020-09-02 07:40:56 +00:00
|
|
|
| &String
|
2019-10-24 05:20:58 +00:00
|
|
|
|
|
2022-01-19 00:32:58 +00:00
|
|
|
= note: string concatenation requires an owned `String` on the left
|
2022-01-19 00:38:06 +00:00
|
|
|
help: remove the borrow to obtain an owned `String`
|
|
|
|
|
|
|
|
|
LL - let _ = &a + &b;
|
|
|
|
LL + let _ = a + &b;
|
2022-06-08 17:34:57 +00:00
|
|
|
|
|
2019-05-17 02:29:02 +00:00
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
error[E0369]: cannot add `String` to `&String`
|
2019-05-17 02:29:02 +00:00
|
|
|
--> $DIR/issue-39018.rs:27:16
|
|
|
|
|
|
|
|
|
LL | let _ = &a + b;
|
2020-09-02 07:40:56 +00:00
|
|
|
| -- ^ - String
|
2019-05-17 02:56:11 +00:00
|
|
|
| | |
|
2019-05-17 03:05:00 +00:00
|
|
|
| | `+` cannot be used to concatenate a `&str` with a `String`
|
2020-09-02 07:40:56 +00:00
|
|
|
| &String
|
2019-10-24 05:20:58 +00:00
|
|
|
|
|
2022-01-13 06:20:13 +00:00
|
|
|
help: remove the borrow on the left and add one on the right
|
2019-05-17 02:29:02 +00:00
|
|
|
|
|
2022-01-13 06:04:39 +00:00
|
|
|
LL - let _ = &a + b;
|
|
|
|
LL + let _ = a + &b;
|
2022-06-08 17:34:57 +00:00
|
|
|
|
|
2019-05-17 02:29:02 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/issue-39018.rs:29:17
|
|
|
|
|
|
|
|
|
LL | let _ = a + b;
|
|
|
|
| ^
|
|
|
|
| |
|
2023-01-03 02:00:33 +00:00
|
|
|
| expected `&str`, found `String`
|
2019-05-17 02:29:02 +00:00
|
|
|
| help: consider borrowing here: `&b`
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
error[E0369]: cannot add `String` to `&String`
|
2019-05-17 02:29:02 +00:00
|
|
|
--> $DIR/issue-39018.rs:30:15
|
|
|
|
|
|
|
|
|
LL | let _ = e + b;
|
2020-09-02 07:40:56 +00:00
|
|
|
| - ^ - String
|
2019-05-17 02:56:11 +00:00
|
|
|
| | |
|
2019-05-17 03:05:00 +00:00
|
|
|
| | `+` cannot be used to concatenate a `&str` with a `String`
|
2020-09-02 07:40:56 +00:00
|
|
|
| &String
|
2019-10-24 05:20:58 +00:00
|
|
|
|
|
2022-01-19 00:32:58 +00:00
|
|
|
help: create an owned `String` on the left and add a borrow on the right
|
2019-05-17 02:29:02 +00:00
|
|
|
|
|
|
|
|
LL | let _ = e.to_owned() + &b;
|
2022-01-13 06:04:39 +00:00
|
|
|
| +++++++++++ +
|
2019-05-17 02:29:02 +00:00
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
error[E0369]: cannot add `&String` to `&String`
|
2019-05-17 02:29:02 +00:00
|
|
|
--> $DIR/issue-39018.rs:31:15
|
|
|
|
|
|
|
|
|
LL | let _ = e + &b;
|
2022-01-19 00:38:06 +00:00
|
|
|
| - ^ -- &String
|
|
|
|
| | |
|
|
|
|
| | `+` cannot be used to concatenate two `&str` strings
|
2020-09-02 07:40:56 +00:00
|
|
|
| &String
|
2019-10-24 05:20:58 +00:00
|
|
|
|
|
2022-01-19 00:32:58 +00:00
|
|
|
= note: string concatenation requires an owned `String` on the left
|
2022-01-19 00:38:06 +00:00
|
|
|
help: create an owned `String` from a string reference
|
|
|
|
|
|
|
|
|
LL | let _ = e.to_owned() + &b;
|
|
|
|
| +++++++++++
|
2019-05-17 02:29:02 +00:00
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
error[E0369]: cannot add `&str` to `&String`
|
2019-05-17 02:29:02 +00:00
|
|
|
--> $DIR/issue-39018.rs:32:15
|
|
|
|
|
|
|
|
|
LL | let _ = e + d;
|
2022-01-19 00:38:06 +00:00
|
|
|
| - ^ - &str
|
|
|
|
| | |
|
|
|
|
| | `+` cannot be used to concatenate two `&str` strings
|
2020-09-02 07:40:56 +00:00
|
|
|
| &String
|
2019-10-24 05:20:58 +00:00
|
|
|
|
|
2022-01-19 00:32:58 +00:00
|
|
|
= note: string concatenation requires an owned `String` on the left
|
2022-01-19 00:38:06 +00:00
|
|
|
help: create an owned `String` from a string reference
|
|
|
|
|
|
|
|
|
LL | let _ = e.to_owned() + d;
|
|
|
|
| +++++++++++
|
2019-05-17 02:29:02 +00:00
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
error[E0369]: cannot add `&&str` to `&String`
|
2019-05-17 02:29:02 +00:00
|
|
|
--> $DIR/issue-39018.rs:33:15
|
|
|
|
|
|
|
|
|
LL | let _ = e + &d;
|
2022-01-19 00:38:06 +00:00
|
|
|
| - ^ -- &&str
|
|
|
|
| | |
|
|
|
|
| | `+` cannot be used to concatenate two `&str` strings
|
2020-09-02 07:40:56 +00:00
|
|
|
| &String
|
2019-10-24 05:20:58 +00:00
|
|
|
|
|
2022-01-19 00:32:58 +00:00
|
|
|
= note: string concatenation requires an owned `String` on the left
|
2022-01-19 00:38:06 +00:00
|
|
|
help: create an owned `String` from a string reference
|
|
|
|
|
|
|
|
|
LL | let _ = e.to_owned() + &d;
|
|
|
|
| +++++++++++
|
2019-05-17 02:29:02 +00:00
|
|
|
|
2019-12-10 21:03:13 +00:00
|
|
|
error[E0369]: cannot add `&&str` to `&&str`
|
2019-05-17 02:29:02 +00:00
|
|
|
--> $DIR/issue-39018.rs:34:16
|
|
|
|
|
|
|
|
|
LL | let _ = &c + &d;
|
|
|
|
| -- ^ -- &&str
|
|
|
|
| |
|
|
|
|
| &&str
|
|
|
|
|
2019-12-10 21:03:13 +00:00
|
|
|
error[E0369]: cannot add `&str` to `&&str`
|
2019-05-17 02:29:02 +00:00
|
|
|
--> $DIR/issue-39018.rs:35:16
|
|
|
|
|
|
|
|
|
LL | let _ = &c + d;
|
|
|
|
| -- ^ - &str
|
|
|
|
| |
|
|
|
|
| &&str
|
|
|
|
|
2019-12-10 21:03:13 +00:00
|
|
|
error[E0369]: cannot add `&&str` to `&str`
|
2019-05-17 02:29:02 +00:00
|
|
|
--> $DIR/issue-39018.rs:36:15
|
|
|
|
|
|
|
|
|
LL | let _ = c + &d;
|
2022-01-19 00:38:06 +00:00
|
|
|
| - ^ -- &&str
|
|
|
|
| | |
|
|
|
|
| | `+` cannot be used to concatenate two `&str` strings
|
2019-05-17 02:29:02 +00:00
|
|
|
| &str
|
2019-10-24 05:20:58 +00:00
|
|
|
|
|
2022-01-19 00:32:58 +00:00
|
|
|
= note: string concatenation requires an owned `String` on the left
|
2022-01-19 00:38:06 +00:00
|
|
|
help: create an owned `String` from a string reference
|
|
|
|
|
|
|
|
|
LL | let _ = c.to_owned() + &d;
|
|
|
|
| +++++++++++
|
2019-05-17 02:29:02 +00:00
|
|
|
|
2019-12-10 21:03:13 +00:00
|
|
|
error[E0369]: cannot add `&str` to `&str`
|
2019-05-17 02:29:02 +00:00
|
|
|
--> $DIR/issue-39018.rs:37:15
|
|
|
|
|
|
|
|
|
LL | let _ = c + d;
|
2022-01-19 00:38:06 +00:00
|
|
|
| - ^ - &str
|
|
|
|
| | |
|
|
|
|
| | `+` cannot be used to concatenate two `&str` strings
|
2019-05-17 02:29:02 +00:00
|
|
|
| &str
|
2019-10-24 05:20:58 +00:00
|
|
|
|
|
2022-01-19 00:32:58 +00:00
|
|
|
= note: string concatenation requires an owned `String` on the left
|
2022-01-19 00:38:06 +00:00
|
|
|
help: create an owned `String` from a string reference
|
|
|
|
|
|
|
|
|
LL | let _ = c.to_owned() + d;
|
|
|
|
| +++++++++++
|
2019-05-17 02:29:02 +00:00
|
|
|
|
|
|
|
error: aborting due to 14 previous errors
|
2017-01-14 20:25:33 +00:00
|
|
|
|
2019-05-17 02:29:02 +00:00
|
|
|
Some errors have detailed explanations: E0308, E0369.
|
|
|
|
For more information about an error, try `rustc --explain E0308`.
|