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 = 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
24 LL | String::from(<str as AsRef<T>>::as_ref("x"));
25 | ++++++++++++++++++++++++++ ~
27 error[E0282]: type annotations needed
28 --> $DIR/issue-72690.rs:12:6
30 LL | |x| String::from("x".as_ref());
33 help: consider giving this closure parameter an explicit type
35 LL | |x: /* Type */| String::from("x".as_ref());
38 error[E0283]: type annotations needed
39 --> $DIR/issue-72690.rs:12:26
41 LL | |x| String::from("x".as_ref());
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
51 LL | |x| String::from(<str as AsRef<T>>::as_ref("x"));
52 | ++++++++++++++++++++++++++ ~
54 error[E0283]: type annotations needed for `&T`
55 --> $DIR/issue-72690.rs:17:9
57 LL | let _ = "x".as_ref();
58 | ^ ------ type must be known at this point
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
67 LL | let _: &T = "x".as_ref();
70 error[E0283]: type annotations needed
71 --> $DIR/issue-72690.rs:21:5
73 LL | String::from("x".as_ref());
74 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
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;
80 error[E0283]: type annotations needed
81 --> $DIR/issue-72690.rs:21:22
83 LL | String::from("x".as_ref());
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
93 LL | String::from(<str as AsRef<T>>::as_ref("x"));
94 | ++++++++++++++++++++++++++ ~
96 error[E0283]: type annotations needed
97 --> $DIR/issue-72690.rs:28:5
99 LL | String::from("x".as_ref());
100 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
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;
106 error[E0283]: type annotations needed
107 --> $DIR/issue-72690.rs:28:22
109 LL | String::from("x".as_ref());
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
119 LL | String::from(<str as AsRef<T>>::as_ref("x"));
120 | ++++++++++++++++++++++++++ ~
122 error[E0283]: type annotations needed
123 --> $DIR/issue-72690.rs:37:5
125 LL | String::from("x".as_ref());
126 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
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;
132 error[E0283]: type annotations needed
133 --> $DIR/issue-72690.rs:37:22
135 LL | String::from("x".as_ref());
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
145 LL | String::from(<str as AsRef<T>>::as_ref("x"));
146 | ++++++++++++++++++++++++++ ~
148 error[E0283]: type annotations needed
149 --> $DIR/issue-72690.rs:46:5
151 LL | String::from("x".as_ref());
152 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
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;
158 error[E0283]: type annotations needed
159 --> $DIR/issue-72690.rs:46:22
161 LL | String::from("x".as_ref());
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
171 LL | String::from(<str as AsRef<T>>::as_ref("x"));
172 | ++++++++++++++++++++++++++ ~
174 error[E0283]: type annotations needed
175 --> $DIR/issue-72690.rs:53:5
177 LL | String::from("x".as_ref());
178 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
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;
184 error[E0283]: type annotations needed
185 --> $DIR/issue-72690.rs:53:22
187 LL | String::from("x".as_ref());
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
197 LL | String::from(<str as AsRef<T>>::as_ref("x"));
198 | ++++++++++++++++++++++++++ ~
200 error[E0283]: type annotations needed
201 --> $DIR/issue-72690.rs:62:5
203 LL | String::from("x".as_ref());
204 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
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;
210 error[E0283]: type annotations needed
211 --> $DIR/issue-72690.rs:62:22
213 LL | String::from("x".as_ref());
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
223 LL | String::from(<str as AsRef<T>>::as_ref("x"));
224 | ++++++++++++++++++++++++++ ~
226 error: aborting due to 17 previous errors
228 Some errors have detailed explanations: E0282, E0283.
229 For more information about an error, try `rustc --explain E0282`.