@@ -11,7 +11,7 @@ error[E0283]: type annotations needed
11
11
--> $DIR/issue-72690.rs:11:9
12
12
|
13
13
LL | |x| String::from("x".as_ref());
14
- | ^^^^^^^^^^^^ cannot infer type for struct `String `
14
+ | ^^^^^^^^^^^^ cannot infer type for reference `&_ `
15
15
|
16
16
= note: cannot satisfy `String: From<&_>`
17
17
= note: required by `from`
@@ -20,11 +20,13 @@ error[E0283]: type annotations needed for `&T`
20
20
--> $DIR/issue-72690.rs:15:17
21
21
|
22
22
LL | 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`
26
24
|
27
25
= 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
+ | ^^^^^
28
30
29
31
error[E0283]: type annotations needed
30
32
--> $DIR/issue-72690.rs:19:5
@@ -61,10 +63,6 @@ LL | String::from("x".as_ref());
61
63
|
62
64
= note: cannot satisfy `String: From<&_>`
63
65
= note: required by `from`
64
- help: consider giving this binding the explicit type `String`
65
- |
66
- LL | let _: String = String::from("x");
67
- | ^^^^^^^^
68
66
69
67
error[E0283]: type annotations needed
70
68
--> $DIR/issue-72690.rs:47:5
@@ -74,10 +72,6 @@ LL | String::from("x".as_ref());
74
72
|
75
73
= note: cannot satisfy `String: From<&_>`
76
74
= note: required by `from`
77
- help: consider giving this binding the explicit type `String`
78
- |
79
- LL | let _: String = String::from("x");
80
- | ^^^^^^^^
81
75
82
76
error[E0283]: type annotations needed
83
77
--> $DIR/issue-72690.rs:55:5
@@ -87,10 +81,6 @@ LL | String::from("x".as_ref());
87
81
|
88
82
= note: cannot satisfy `String: From<&_>`
89
83
= note: required by `from`
90
- help: consider giving this binding the explicit type `String`
91
- |
92
- LL | let _: String = String::from("x");
93
- | ^^^^^^^^
94
84
95
85
error: aborting due to 9 previous errors
96
86
0 commit comments