@@ -11,7 +11,7 @@ error[E0283]: type annotations needed
1111 --> $DIR/issue-72690.rs:11:9
1212 |
1313LL | |x| String::from("x".as_ref());
14- | ^^^^^^^^^^^^ cannot infer type for struct `String `
14+ | ^^^^^^^^^^^^ cannot infer type for reference `&_ `
1515 |
1616 = note: cannot satisfy `String: From<&_>`
1717 = note: required by `from`
@@ -20,11 +20,13 @@ error[E0283]: type annotations needed for `&T`
2020 --> $DIR/issue-72690.rs:15:17
2121 |
2222LL | let _ = "x".as_ref();
23- | - ^^^^^^ cannot infer type for type parameter `T` declared on the trait `AsRef`
24- | |
25- | consider giving this pattern the explicit type `&T`, where the type parameter `T` is specified
23+ | ^^^^^^ cannot infer type for type parameter `T` declared on the trait `AsRef`
2624 |
2725 = note: cannot satisfy `str: AsRef<_>`
26+ help: consider giving this binding the explicit type `&T`, where the type parameter `T` is specified
27+ |
28+ LL | let _: str = "x".as_ref();
29+ | ^^^^^
2830
2931error[E0283]: type annotations needed
3032 --> $DIR/issue-72690.rs:19:5
@@ -61,10 +63,6 @@ LL | String::from("x".as_ref());
6163 |
6264 = note: cannot satisfy `String: From<&_>`
6365 = note: required by `from`
64- help: consider giving this binding the explicit type `String`
65- |
66- LL | let _: String = String::from("x");
67- | ^^^^^^^^
6866
6967error[E0283]: type annotations needed
7068 --> $DIR/issue-72690.rs:47:5
@@ -74,10 +72,6 @@ LL | String::from("x".as_ref());
7472 |
7573 = note: cannot satisfy `String: From<&_>`
7674 = note: required by `from`
77- help: consider giving this binding the explicit type `String`
78- |
79- LL | let _: String = String::from("x");
80- | ^^^^^^^^
8175
8276error[E0283]: type annotations needed
8377 --> $DIR/issue-72690.rs:55:5
@@ -87,10 +81,6 @@ LL | String::from("x".as_ref());
8781 |
8882 = note: cannot satisfy `String: From<&_>`
8983 = note: required by `from`
90- help: consider giving this binding the explicit type `String`
91- |
92- LL | let _: String = String::from("x");
93- | ^^^^^^^^
9484
9585error: aborting due to 9 previous errors
9686
0 commit comments