]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/issue-39018.stderr
Remove E0308 note when primary label has all info
[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    |             |        `+` cannot be used to concatenate two `&str` strings
8    |             &str
9    |
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    |
12 LL |     let x = "Hello ".to_owned() + "World!";
13    |             ^^^^^^^^^^^^^^^^^^^
14
15 error[E0369]: binary operation `+` cannot be applied to type `World`
16   --> $DIR/issue-39018.rs:8:26
17    |
18 LL |     let y = World::Hello + World::Goodbye;
19    |             ------------ ^ -------------- World
20    |             |
21    |             World
22    |
23    = note: an implementation of `std::ops::Add` might be missing for `World`
24
25 error[E0369]: binary operation `+` cannot be applied to type `&str`
26   --> $DIR/issue-39018.rs:11:22
27    |
28 LL |     let x = "Hello " + "World!".to_owned();
29    |             -------- ^ ------------------- std::string::String
30    |             |        |
31    |             |        `+` cannot be used to concatenate a `&str` with a `String`
32    |             &str
33    |
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    |
36 LL |     let x = "Hello ".to_owned() + &"World!".to_owned();
37    |             ^^^^^^^^^^^^^^^^^^^   ^^^^^^^^^^^^^^^^^^^^
38
39 error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
40   --> $DIR/issue-39018.rs:26:16
41    |
42 LL |     let _ = &a + &b;
43    |             -- ^ -- &std::string::String
44    |             |  |
45    |             |  `+` cannot be used to concatenate two `&str` strings
46    |             &std::string::String
47    |
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
53 error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
54   --> $DIR/issue-39018.rs:27:16
55    |
56 LL |     let _ = &a + b;
57    |             -- ^ - std::string::String
58    |             |  |
59    |             |  `+` cannot be used to concatenate a `&str` with a `String`
60    |             &std::string::String
61    |
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    |                 |
73    |                 expected &str, found struct `std::string::String`
74    |                 help: consider borrowing here: `&b`
75
76 error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
77   --> $DIR/issue-39018.rs:30:15
78    |
79 LL |     let _ = e + b;
80    |             - ^ - std::string::String
81    |             | |
82    |             | `+` cannot be used to concatenate a `&str` with a `String`
83    |             &std::string::String
84    |
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
90 error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
91   --> $DIR/issue-39018.rs:31:15
92    |
93 LL |     let _ = e + &b;
94    |             - ^ -- &std::string::String
95    |             | |
96    |             | `+` cannot be used to concatenate two `&str` strings
97    |             &std::string::String
98    |
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
104 error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
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
111    |             &std::string::String
112    |
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
118 error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
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
125    |             &std::string::String
126    |
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
132 error[E0369]: binary operation `+` cannot be applied to type `&&str`
133   --> $DIR/issue-39018.rs:34:16
134    |
135 LL |     let _ = &c + &d;
136    |             -- ^ -- &&str
137    |             |
138    |             &&str
139    |
140    = note: an implementation of `std::ops::Add` might be missing for `&&str`
141
142 error[E0369]: binary operation `+` cannot be applied to type `&&str`
143   --> $DIR/issue-39018.rs:35:16
144    |
145 LL |     let _ = &c + d;
146    |             -- ^ - &str
147    |             |
148    |             &&str
149    |
150    = note: an implementation of `std::ops::Add` might be missing for `&&str`
151
152 error[E0369]: binary operation `+` cannot be applied to type `&str`
153   --> $DIR/issue-39018.rs:36:15
154    |
155 LL |     let _ = c + &d;
156    |             - ^ -- &&str
157    |             | |
158    |             | `+` cannot be used to concatenate two `&str` strings
159    |             &str
160    |
161 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
162    |
163 LL |     let _ = c.to_owned() + &d;
164    |             ^^^^^^^^^^^^
165
166 error[E0369]: binary operation `+` cannot be applied to type `&str`
167   --> $DIR/issue-39018.rs:37:15
168    |
169 LL |     let _ = c + d;
170    |             - ^ - &str
171    |             | |
172    |             | `+` cannot be used to concatenate two `&str` strings
173    |             &str
174    |
175 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
176    |
177 LL |     let _ = c.to_owned() + d;
178    |             ^^^^^^^^^^^^
179
180 error: aborting due to 14 previous errors
181
182 Some errors have detailed explanations: E0308, E0369.
183 For more information about an error, try `rustc --explain E0308`.