]>
Commit | Line | Data |
---|---|---|
dfeec247 | 1 | error[E0369]: cannot add `&str` to `&str` |
532ac7d7 | 2 | --> $DIR/issue-39018.rs:2:22 |
8bb4bdeb | 3 | | |
0531ce1d | 4 | LL | let x = "Hello " + "World!"; |
532ac7d7 XL |
5 | | -------- ^ -------- &str |
6 | | | | | |
48663c56 | 7 | | | `+` cannot be used to concatenate two `&str` strings |
532ac7d7 | 8 | | &str |
e74abb32 | 9 | | |
041b39d2 XL |
10 | 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 | | | |
0531ce1d | 12 | LL | let x = "Hello ".to_owned() + "World!"; |
041b39d2 | 13 | | ^^^^^^^^^^^^^^^^^^^ |
8bb4bdeb | 14 | |
dfeec247 | 15 | error[E0369]: cannot add `World` to `World` |
532ac7d7 | 16 | --> $DIR/issue-39018.rs:8:26 |
8bb4bdeb | 17 | | |
0531ce1d | 18 | LL | let y = World::Hello + World::Goodbye; |
532ac7d7 XL |
19 | | ------------ ^ -------------- World |
20 | | | | |
21 | | World | |
8bb4bdeb XL |
22 | | |
23 | = note: an implementation of `std::ops::Add` might be missing for `World` | |
24 | ||
1b1a35ee | 25 | error[E0369]: cannot add `String` to `&str` |
532ac7d7 | 26 | --> $DIR/issue-39018.rs:11:22 |
0531ce1d XL |
27 | | |
28 | LL | let x = "Hello " + "World!".to_owned(); | |
1b1a35ee | 29 | | -------- ^ ------------------- String |
48663c56 XL |
30 | | | | |
31 | | | `+` cannot be used to concatenate a `&str` with a `String` | |
532ac7d7 | 32 | | &str |
e74abb32 | 33 | | |
0531ce1d XL |
34 | 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 |
35 | | | |
8faf50e0 XL |
36 | LL | let x = "Hello ".to_owned() + &"World!".to_owned(); |
37 | | ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ | |
0531ce1d | 38 | |
1b1a35ee | 39 | error[E0369]: cannot add `&String` to `&String` |
48663c56 XL |
40 | --> $DIR/issue-39018.rs:26:16 |
41 | | | |
42 | LL | let _ = &a + &b; | |
1b1a35ee | 43 | | -- ^ -- &String |
48663c56 XL |
44 | | | | |
45 | | | `+` cannot be used to concatenate two `&str` strings | |
1b1a35ee | 46 | | &String |
e74abb32 | 47 | | |
48663c56 XL |
48 | 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 |
49 | | | |
50 | LL | let _ = a + &b; | |
51 | | ^ | |
52 | ||
1b1a35ee | 53 | error[E0369]: cannot add `String` to `&String` |
48663c56 XL |
54 | --> $DIR/issue-39018.rs:27:16 |
55 | | | |
56 | LL | let _ = &a + b; | |
1b1a35ee | 57 | | -- ^ - String |
48663c56 XL |
58 | | | | |
59 | | | `+` cannot be used to concatenate a `&str` with a `String` | |
1b1a35ee | 60 | | &String |
e74abb32 | 61 | | |
48663c56 XL |
62 | 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 |
63 | | | |
64 | LL | let _ = a + &b; | |
65 | | ^ ^^ | |
66 | ||
67 | error[E0308]: mismatched types | |
68 | --> $DIR/issue-39018.rs:29:17 | |
69 | | | |
70 | LL | let _ = a + b; | |
71 | | ^ | |
72 | | | | |
1b1a35ee | 73 | | expected `&str`, found struct `String` |
48663c56 | 74 | | help: consider borrowing here: `&b` |
48663c56 | 75 | |
1b1a35ee | 76 | error[E0369]: cannot add `String` to `&String` |
48663c56 XL |
77 | --> $DIR/issue-39018.rs:30:15 |
78 | | | |
79 | LL | let _ = e + b; | |
1b1a35ee | 80 | | - ^ - String |
48663c56 XL |
81 | | | | |
82 | | | `+` cannot be used to concatenate a `&str` with a `String` | |
1b1a35ee | 83 | | &String |
e74abb32 | 84 | | |
48663c56 XL |
85 | 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 |
86 | | | |
87 | LL | let _ = e.to_owned() + &b; | |
88 | | ^^^^^^^^^^^^ ^^ | |
89 | ||
1b1a35ee | 90 | error[E0369]: cannot add `&String` to `&String` |
48663c56 XL |
91 | --> $DIR/issue-39018.rs:31:15 |
92 | | | |
93 | LL | let _ = e + &b; | |
1b1a35ee | 94 | | - ^ -- &String |
48663c56 XL |
95 | | | | |
96 | | | `+` cannot be used to concatenate two `&str` strings | |
1b1a35ee | 97 | | &String |
e74abb32 | 98 | | |
48663c56 XL |
99 | 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 |
100 | | | |
101 | LL | let _ = e.to_owned() + &b; | |
102 | | ^^^^^^^^^^^^ | |
103 | ||
1b1a35ee | 104 | error[E0369]: cannot add `&str` to `&String` |
48663c56 XL |
105 | --> $DIR/issue-39018.rs:32:15 |
106 | | | |
107 | LL | let _ = e + d; | |
108 | | - ^ - &str | |
109 | | | | | |
110 | | | `+` cannot be used to concatenate two `&str` strings | |
1b1a35ee | 111 | | &String |
e74abb32 | 112 | | |
48663c56 XL |
113 | 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 |
114 | | | |
115 | LL | let _ = e.to_owned() + d; | |
116 | | ^^^^^^^^^^^^ | |
117 | ||
1b1a35ee | 118 | error[E0369]: cannot add `&&str` to `&String` |
48663c56 XL |
119 | --> $DIR/issue-39018.rs:33:15 |
120 | | | |
121 | LL | let _ = e + &d; | |
122 | | - ^ -- &&str | |
123 | | | | | |
124 | | | `+` cannot be used to concatenate two `&str` strings | |
1b1a35ee | 125 | | &String |
e74abb32 | 126 | | |
48663c56 XL |
127 | 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 |
128 | | | |
129 | LL | let _ = e.to_owned() + &d; | |
130 | | ^^^^^^^^^^^^ | |
131 | ||
dfeec247 | 132 | error[E0369]: cannot add `&&str` to `&&str` |
48663c56 XL |
133 | --> $DIR/issue-39018.rs:34:16 |
134 | | | |
135 | LL | let _ = &c + &d; | |
136 | | -- ^ -- &&str | |
137 | | | | |
138 | | &&str | |
48663c56 | 139 | |
dfeec247 | 140 | error[E0369]: cannot add `&str` to `&&str` |
48663c56 XL |
141 | --> $DIR/issue-39018.rs:35:16 |
142 | | | |
143 | LL | let _ = &c + d; | |
144 | | -- ^ - &str | |
145 | | | | |
146 | | &&str | |
48663c56 | 147 | |
dfeec247 | 148 | error[E0369]: cannot add `&&str` to `&str` |
48663c56 XL |
149 | --> $DIR/issue-39018.rs:36:15 |
150 | | | |
151 | LL | let _ = c + &d; | |
152 | | - ^ -- &&str | |
153 | | | | | |
154 | | | `+` cannot be used to concatenate two `&str` strings | |
155 | | &str | |
e74abb32 | 156 | | |
48663c56 XL |
157 | 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 |
158 | | | |
159 | LL | let _ = c.to_owned() + &d; | |
160 | | ^^^^^^^^^^^^ | |
161 | ||
dfeec247 | 162 | error[E0369]: cannot add `&str` to `&str` |
48663c56 XL |
163 | --> $DIR/issue-39018.rs:37:15 |
164 | | | |
165 | LL | let _ = c + d; | |
166 | | - ^ - &str | |
167 | | | | | |
168 | | | `+` cannot be used to concatenate two `&str` strings | |
169 | | &str | |
e74abb32 | 170 | | |
48663c56 XL |
171 | 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 |
172 | | | |
173 | LL | let _ = c.to_owned() + d; | |
174 | | ^^^^^^^^^^^^ | |
175 | ||
176 | error: aborting due to 14 previous errors | |
8bb4bdeb | 177 | |
48663c56 XL |
178 | Some errors have detailed explanations: E0308, E0369. |
179 | For more information about an error, try `rustc --explain E0308`. |