1 error[E0369]: binary operation `+` cannot be applied to type `&str`
2 --> $DIR/issue-39018.rs:2:22
4 LL | let x = "Hello " + "World!";
5 | -------- ^ -------- &str
7 | | `+` can't be used to concatenate two `&str` strings
9 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
11 LL | let x = "Hello ".to_owned() + "World!";
14 error[E0369]: binary operation `+` cannot be applied to type `World`
15 --> $DIR/issue-39018.rs:8:26
17 LL | let y = World::Hello + World::Goodbye;
18 | ------------ ^ -------------- World
22 = note: an implementation of `std::ops::Add` might be missing for `World`
24 error[E0369]: binary operation `+` cannot be applied to type `&str`
25 --> $DIR/issue-39018.rs:11:22
27 LL | let x = "Hello " + "World!".to_owned();
28 | -------- ^ ------------------- std::string::String
30 | | `+` can't be used to concatenate a `&str` with a `String`
32 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
34 LL | let x = "Hello ".to_owned() + &"World!".to_owned();
35 | ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
37 error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
38 --> $DIR/issue-39018.rs:26:16
41 | -- ^ -- &std::string::String
43 | | `+` can't be used to concatenate two `&str` strings
44 | &std::string::String
45 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
50 error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
51 --> $DIR/issue-39018.rs:27:16
54 | -- ^ - std::string::String
56 | | `+` can't be used to concatenate a `&str` with a `String`
57 | &std::string::String
58 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
60 LL | let _ = &a.to_owned() + &b;
63 error[E0308]: mismatched types
64 --> $DIR/issue-39018.rs:29:17
69 | expected &str, found struct `std::string::String`
70 | help: consider borrowing here: `&b`
72 = note: expected type `&str`
73 found type `std::string::String`
75 error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
76 --> $DIR/issue-39018.rs:30:15
79 | - ^ - std::string::String
81 | | `+` can't be used to concatenate a `&str` with a `String`
82 | &std::string::String
83 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
85 LL | let _ = e.to_owned() + &b;
88 error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
89 --> $DIR/issue-39018.rs:31:15
92 | - ^ -- &std::string::String
94 | | `+` can't be used to concatenate two `&str` strings
95 | &std::string::String
96 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
98 LL | let _ = e.to_owned() + &b;
101 error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
102 --> $DIR/issue-39018.rs:32:15
107 | | `+` can't be used to concatenate two `&str` strings
108 | &std::string::String
109 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
111 LL | let _ = e.to_owned() + d;
114 error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
115 --> $DIR/issue-39018.rs:33:15
120 | | `+` can't be used to concatenate two `&str` strings
121 | &std::string::String
122 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
124 LL | let _ = e.to_owned() + &d;
127 error[E0369]: binary operation `+` cannot be applied to type `&&str`
128 --> $DIR/issue-39018.rs:34:16
130 LL | let _ = &c + &d;
135 = note: an implementation of `std::ops::Add` might be missing for `&&str`
137 error[E0369]: binary operation `+` cannot be applied to type `&&str`
138 --> $DIR/issue-39018.rs:35:16
145 = note: an implementation of `std::ops::Add` might be missing for `&&str`
147 error[E0369]: binary operation `+` cannot be applied to type `&str`
148 --> $DIR/issue-39018.rs:36:15
153 | | `+` can't be used to concatenate two `&str` strings
155 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
157 LL | let _ = c.to_owned() + &d;
160 error[E0369]: binary operation `+` cannot be applied to type `&str`
161 --> $DIR/issue-39018.rs:37:15
166 | | `+` can't be used to concatenate two `&str` strings
168 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
170 LL | let _ = c.to_owned() + d;
173 error: aborting due to 14 previous errors
175 Some errors have detailed explanations: E0308, E0369.
176 For more information about an error, try `rustc --explain E0308`.