]> git.lizzy.rs Git - rust.git/blob - tests/ui/inference/issue-72690.stderr
Rollup merge of #106835 - compiler-errors:new-solver-gat-rebase-oops, r=lcnr
[rust.git] / tests / ui / inference / issue-72690.stderr
1 error[E0283]: type annotations needed
2   --> $DIR/issue-72690.rs:7:5
3    |
4 LL |     String::from("x".as_ref());
5    |     ^^^^^^^^^^^^ cannot infer type for reference `&_`
6    |
7    = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
8            - impl<> From<&String> for String;
9            - impl<> From<&str> for String;
10
11 error[E0283]: type annotations needed
12   --> $DIR/issue-72690.rs:7:22
13    |
14 LL |     String::from("x".as_ref());
15    |                      ^^^^^^
16    |
17    = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
18            - impl AsRef<OsStr> for str;
19            - impl AsRef<Path> for str;
20            - impl AsRef<[u8]> for str;
21            - impl AsRef<str> for str;
22 help: try using a fully qualified path to specify the expected types
23    |
24 LL |     String::from(<str as AsRef<T>>::as_ref("x"));
25    |                  ++++++++++++++++++++++++++   ~
26
27 error[E0282]: type annotations needed
28   --> $DIR/issue-72690.rs:12:6
29    |
30 LL |     |x| String::from("x".as_ref());
31    |      ^
32    |
33 help: consider giving this closure parameter an explicit type
34    |
35 LL |     |x: /* Type */| String::from("x".as_ref());
36    |       ++++++++++++
37
38 error[E0283]: type annotations needed
39   --> $DIR/issue-72690.rs:12:26
40    |
41 LL |     |x| String::from("x".as_ref());
42    |                          ^^^^^^
43    |
44    = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
45            - impl AsRef<OsStr> for str;
46            - impl AsRef<Path> for str;
47            - impl AsRef<[u8]> for str;
48            - impl AsRef<str> for str;
49 help: try using a fully qualified path to specify the expected types
50    |
51 LL |     |x| String::from(<str as AsRef<T>>::as_ref("x"));
52    |                      ++++++++++++++++++++++++++   ~
53
54 error[E0283]: type annotations needed for `&T`
55   --> $DIR/issue-72690.rs:17:9
56    |
57 LL |     let _ = "x".as_ref();
58    |         ^       ------ type must be known at this point
59    |
60    = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
61            - impl AsRef<OsStr> for str;
62            - impl AsRef<Path> for str;
63            - impl AsRef<[u8]> for str;
64            - impl AsRef<str> for str;
65 help: consider giving this pattern a type, where the type for type parameter `T` is specified
66    |
67 LL |     let _: &T = "x".as_ref();
68    |          ++++
69
70 error[E0283]: type annotations needed
71   --> $DIR/issue-72690.rs:21:5
72    |
73 LL |     String::from("x".as_ref());
74    |     ^^^^^^^^^^^^ cannot infer type for reference `&_`
75    |
76    = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
77            - impl<> From<&String> for String;
78            - impl<> From<&str> for String;
79
80 error[E0283]: type annotations needed
81   --> $DIR/issue-72690.rs:21:22
82    |
83 LL |     String::from("x".as_ref());
84    |                      ^^^^^^
85    |
86    = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
87            - impl AsRef<OsStr> for str;
88            - impl AsRef<Path> for str;
89            - impl AsRef<[u8]> for str;
90            - impl AsRef<str> for str;
91 help: try using a fully qualified path to specify the expected types
92    |
93 LL |     String::from(<str as AsRef<T>>::as_ref("x"));
94    |                  ++++++++++++++++++++++++++   ~
95
96 error[E0283]: type annotations needed
97   --> $DIR/issue-72690.rs:28:5
98    |
99 LL |     String::from("x".as_ref());
100    |     ^^^^^^^^^^^^ cannot infer type for reference `&_`
101    |
102    = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
103            - impl<> From<&String> for String;
104            - impl<> From<&str> for String;
105
106 error[E0283]: type annotations needed
107   --> $DIR/issue-72690.rs:28:22
108    |
109 LL |     String::from("x".as_ref());
110    |                      ^^^^^^
111    |
112    = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
113            - impl AsRef<OsStr> for str;
114            - impl AsRef<Path> for str;
115            - impl AsRef<[u8]> for str;
116            - impl AsRef<str> for str;
117 help: try using a fully qualified path to specify the expected types
118    |
119 LL |     String::from(<str as AsRef<T>>::as_ref("x"));
120    |                  ++++++++++++++++++++++++++   ~
121
122 error[E0283]: type annotations needed
123   --> $DIR/issue-72690.rs:37:5
124    |
125 LL |     String::from("x".as_ref());
126    |     ^^^^^^^^^^^^ cannot infer type for reference `&_`
127    |
128    = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
129            - impl<> From<&String> for String;
130            - impl<> From<&str> for String;
131
132 error[E0283]: type annotations needed
133   --> $DIR/issue-72690.rs:37:22
134    |
135 LL |     String::from("x".as_ref());
136    |                      ^^^^^^
137    |
138    = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
139            - impl AsRef<OsStr> for str;
140            - impl AsRef<Path> for str;
141            - impl AsRef<[u8]> for str;
142            - impl AsRef<str> for str;
143 help: try using a fully qualified path to specify the expected types
144    |
145 LL |     String::from(<str as AsRef<T>>::as_ref("x"));
146    |                  ++++++++++++++++++++++++++   ~
147
148 error[E0283]: type annotations needed
149   --> $DIR/issue-72690.rs:46:5
150    |
151 LL |     String::from("x".as_ref());
152    |     ^^^^^^^^^^^^ cannot infer type for reference `&_`
153    |
154    = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
155            - impl<> From<&String> for String;
156            - impl<> From<&str> for String;
157
158 error[E0283]: type annotations needed
159   --> $DIR/issue-72690.rs:46:22
160    |
161 LL |     String::from("x".as_ref());
162    |                      ^^^^^^
163    |
164    = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
165            - impl AsRef<OsStr> for str;
166            - impl AsRef<Path> for str;
167            - impl AsRef<[u8]> for str;
168            - impl AsRef<str> for str;
169 help: try using a fully qualified path to specify the expected types
170    |
171 LL |     String::from(<str as AsRef<T>>::as_ref("x"));
172    |                  ++++++++++++++++++++++++++   ~
173
174 error[E0283]: type annotations needed
175   --> $DIR/issue-72690.rs:53:5
176    |
177 LL |     String::from("x".as_ref());
178    |     ^^^^^^^^^^^^ cannot infer type for reference `&_`
179    |
180    = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
181            - impl<> From<&String> for String;
182            - impl<> From<&str> for String;
183
184 error[E0283]: type annotations needed
185   --> $DIR/issue-72690.rs:53:22
186    |
187 LL |     String::from("x".as_ref());
188    |                      ^^^^^^
189    |
190    = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
191            - impl AsRef<OsStr> for str;
192            - impl AsRef<Path> for str;
193            - impl AsRef<[u8]> for str;
194            - impl AsRef<str> for str;
195 help: try using a fully qualified path to specify the expected types
196    |
197 LL |     String::from(<str as AsRef<T>>::as_ref("x"));
198    |                  ++++++++++++++++++++++++++   ~
199
200 error[E0283]: type annotations needed
201   --> $DIR/issue-72690.rs:62:5
202    |
203 LL |     String::from("x".as_ref());
204    |     ^^^^^^^^^^^^ cannot infer type for reference `&_`
205    |
206    = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
207            - impl<> From<&String> for String;
208            - impl<> From<&str> for String;
209
210 error[E0283]: type annotations needed
211   --> $DIR/issue-72690.rs:62:22
212    |
213 LL |     String::from("x".as_ref());
214    |                      ^^^^^^
215    |
216    = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
217            - impl AsRef<OsStr> for str;
218            - impl AsRef<Path> for str;
219            - impl AsRef<[u8]> for str;
220            - impl AsRef<str> for str;
221 help: try using a fully qualified path to specify the expected types
222    |
223 LL |     String::from(<str as AsRef<T>>::as_ref("x"));
224    |                  ++++++++++++++++++++++++++   ~
225
226 error: aborting due to 17 previous errors
227
228 Some errors have detailed explanations: E0282, E0283.
229 For more information about an error, try `rustc --explain E0282`.