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: cannot satisfy `String: From<&_>`
8 note: required by `from`
9 --> $SRC_DIR/core/src/convert/mod.rs:LL:COL
11 LL | fn from(_: T) -> Self;
12 | ^^^^^^^^^^^^^^^^^^^^^^
14 error[E0282]: type annotations needed
15 --> $DIR/issue-72690.rs:11:6
17 LL | |x| String::from("x".as_ref());
18 | ^ consider giving this closure parameter a type
20 error[E0283]: type annotations needed for `&T`
21 --> $DIR/issue-72690.rs:15:17
23 LL | let _ = "x".as_ref();
24 | - ^^^^^^ cannot infer type for type parameter `T` declared on the trait `AsRef`
26 | consider giving this pattern the explicit type `&T`, where the type parameter `T` is specified
28 = note: cannot satisfy `str: AsRef<_>`
30 error[E0283]: type annotations needed
31 --> $DIR/issue-72690.rs:19:5
33 LL | String::from("x".as_ref());
34 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
36 = note: cannot satisfy `String: From<&_>`
37 note: required by `from`
38 --> $SRC_DIR/core/src/convert/mod.rs:LL:COL
40 LL | fn from(_: T) -> Self;
41 | ^^^^^^^^^^^^^^^^^^^^^^
43 error[E0283]: type annotations needed
44 --> $DIR/issue-72690.rs:25:5
46 LL | String::from("x".as_ref());
47 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
49 = note: cannot satisfy `String: From<&_>`
50 note: required by `from`
51 --> $SRC_DIR/core/src/convert/mod.rs:LL:COL
53 LL | fn from(_: T) -> Self;
54 | ^^^^^^^^^^^^^^^^^^^^^^
56 error[E0283]: type annotations needed
57 --> $DIR/issue-72690.rs:33:5
59 LL | String::from("x".as_ref());
60 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
62 = note: cannot satisfy `String: From<&_>`
63 note: required by `from`
64 --> $SRC_DIR/core/src/convert/mod.rs:LL:COL
66 LL | fn from(_: T) -> Self;
67 | ^^^^^^^^^^^^^^^^^^^^^^
69 error[E0283]: type annotations needed
70 --> $DIR/issue-72690.rs:41:5
72 LL | String::from("x".as_ref());
73 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
75 = note: cannot satisfy `String: From<&_>`
76 note: required by `from`
77 --> $SRC_DIR/core/src/convert/mod.rs:LL:COL
79 LL | fn from(_: T) -> Self;
80 | ^^^^^^^^^^^^^^^^^^^^^^
82 error[E0283]: type annotations needed
83 --> $DIR/issue-72690.rs:47:5
85 LL | String::from("x".as_ref());
86 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
88 = note: cannot satisfy `String: From<&_>`
89 note: required by `from`
90 --> $SRC_DIR/core/src/convert/mod.rs:LL:COL
92 LL | fn from(_: T) -> Self;
93 | ^^^^^^^^^^^^^^^^^^^^^^
95 error[E0283]: type annotations needed
96 --> $DIR/issue-72690.rs:55:5
98 LL | String::from("x".as_ref());
99 | ^^^^^^^^^^^^ cannot infer type for reference `&_`
101 = note: cannot satisfy `String: From<&_>`
102 note: required by `from`
103 --> $SRC_DIR/core/src/convert/mod.rs:LL:COL
105 LL | fn from(_: T) -> Self;
106 | ^^^^^^^^^^^^^^^^^^^^^^
108 error: aborting due to 9 previous errors
110 Some errors have detailed explanations: E0282, E0283.
111 For more information about an error, try `rustc --explain E0282`.