1 error[E0283]: type annotations needed
2 --> $DIR/issue-72690.rs:7:5
4 LL | String::from("x".as_ref());
5 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
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;
11 error[E0283]: type annotations needed
12 --> $DIR/issue-72690.rs:7:22
14 LL | String::from("x".as_ref());
17 | | cannot infer type for type parameter `T` declared on the trait `AsRef`
18 | this method call resolves to `&T`
20 = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
21 - impl AsRef<OsStr> for str;
22 - impl AsRef<Path> for str;
23 - impl AsRef<[u8]> for str;
24 - impl AsRef<str> for str;
26 error[E0282]: type annotations needed
27 --> $DIR/issue-72690.rs:12:6
29 LL | |x| String::from("x".as_ref());
30 | ^ consider giving this closure parameter a type
32 error[E0283]: type annotations needed
33 --> $DIR/issue-72690.rs:12:26
35 LL | |x| String::from("x".as_ref());
38 | | cannot infer type for type parameter `T` declared on the trait `AsRef`
39 | this method call resolves to `&T`
41 = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
42 - impl AsRef<OsStr> for str;
43 - impl AsRef<Path> for str;
44 - impl AsRef<[u8]> for str;
45 - impl AsRef<str> for str;
47 error[E0283]: type annotations needed for `&T`
48 --> $DIR/issue-72690.rs:17:17
50 LL | let _ = "x".as_ref();
51 | - ^^^^^^ cannot infer type for type parameter `T` declared on the trait `AsRef`
53 | consider giving this pattern the explicit type `&T`, where the type parameter `T` is specified
55 = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
56 - impl AsRef<OsStr> for str;
57 - impl AsRef<Path> for str;
58 - impl AsRef<[u8]> for str;
59 - impl AsRef<str> for str;
61 error[E0283]: type annotations needed
62 --> $DIR/issue-72690.rs:21:5
64 LL | String::from("x".as_ref());
65 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
67 = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
68 - impl<> From<&String> for String;
69 - impl<> From<&str> for String;
71 error[E0283]: type annotations needed
72 --> $DIR/issue-72690.rs:21:22
74 LL | String::from("x".as_ref());
77 | | cannot infer type for type parameter `T` declared on the trait `AsRef`
78 | this method call resolves to `&T`
80 = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
81 - impl AsRef<OsStr> for str;
82 - impl AsRef<Path> for str;
83 - impl AsRef<[u8]> for str;
84 - impl AsRef<str> for str;
86 error[E0283]: type annotations needed
87 --> $DIR/issue-72690.rs:28:5
89 LL | String::from("x".as_ref());
90 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
92 = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
93 - impl<> From<&String> for String;
94 - impl<> From<&str> for String;
96 error[E0283]: type annotations needed
97 --> $DIR/issue-72690.rs:28:22
99 LL | String::from("x".as_ref());
102 | | cannot infer type for type parameter `T` declared on the trait `AsRef`
103 | this method call resolves to `&T`
105 = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
106 - impl AsRef<OsStr> for str;
107 - impl AsRef<Path> for str;
108 - impl AsRef<[u8]> for str;
109 - impl AsRef<str> for str;
111 error[E0283]: type annotations needed
112 --> $DIR/issue-72690.rs:37:5
114 LL | String::from("x".as_ref());
115 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
117 = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
118 - impl<> From<&String> for String;
119 - impl<> From<&str> for String;
121 error[E0283]: type annotations needed
122 --> $DIR/issue-72690.rs:37:22
124 LL | String::from("x".as_ref());
127 | | cannot infer type for type parameter `T` declared on the trait `AsRef`
128 | this method call resolves to `&T`
130 = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
131 - impl AsRef<OsStr> for str;
132 - impl AsRef<Path> for str;
133 - impl AsRef<[u8]> for str;
134 - impl AsRef<str> for str;
136 error[E0283]: type annotations needed
137 --> $DIR/issue-72690.rs:46:5
139 LL | String::from("x".as_ref());
140 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
142 = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
143 - impl<> From<&String> for String;
144 - impl<> From<&str> for String;
146 error[E0283]: type annotations needed
147 --> $DIR/issue-72690.rs:46:22
149 LL | String::from("x".as_ref());
152 | | cannot infer type for type parameter `T` declared on the trait `AsRef`
153 | this method call resolves to `&T`
155 = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
156 - impl AsRef<OsStr> for str;
157 - impl AsRef<Path> for str;
158 - impl AsRef<[u8]> for str;
159 - impl AsRef<str> for str;
161 error[E0283]: type annotations needed
162 --> $DIR/issue-72690.rs:53:5
164 LL | String::from("x".as_ref());
165 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
167 = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
168 - impl<> From<&String> for String;
169 - impl<> From<&str> for String;
171 error[E0283]: type annotations needed
172 --> $DIR/issue-72690.rs:53:22
174 LL | String::from("x".as_ref());
177 | | cannot infer type for type parameter `T` declared on the trait `AsRef`
178 | this method call resolves to `&T`
180 = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
181 - impl AsRef<OsStr> for str;
182 - impl AsRef<Path> for str;
183 - impl AsRef<[u8]> for str;
184 - impl AsRef<str> for str;
186 error[E0283]: type annotations needed
187 --> $DIR/issue-72690.rs:62:5
189 LL | String::from("x".as_ref());
190 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
192 = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
193 - impl<> From<&String> for String;
194 - impl<> From<&str> for String;
196 error[E0283]: type annotations needed
197 --> $DIR/issue-72690.rs:62:22
199 LL | String::from("x".as_ref());
202 | | cannot infer type for type parameter `T` declared on the trait `AsRef`
203 | this method call resolves to `&T`
205 = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
206 - impl AsRef<OsStr> for str;
207 - impl AsRef<Path> for str;
208 - impl AsRef<[u8]> for str;
209 - impl AsRef<str> for str;
211 error: aborting due to 17 previous errors
213 Some errors have detailed explanations: E0282, E0283.
214 For more information about an error, try `rustc --explain E0282`.