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