We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f12561 commit 40c5eefCopy full SHA for 40c5eef
src/test/ui/array-slice-vec/infer_array_len.rs
@@ -0,0 +1,21 @@
1
+// see issue #70529
2
+struct A;
3
+
4
+impl From<A> for [u8; 2] {
5
+ fn from(a: A) -> Self {
6
+ [0; 2]
7
+ }
8
+}
9
10
+impl From<A> for [u8; 3] {
11
12
+ [0; 3]
13
14
15
16
17
+fn main() {
18
+ let a = A;
19
+ let [_, _] = a.into();
20
+ //~^ ERROR type annotations needed
21
src/test/ui/array-slice-vec/infer_array_len.stderr
@@ -0,0 +1,11 @@
+error[E0282]: type annotations needed
+ --> $DIR/infer_array_len.rs:19:9
+ |
+LL | let [_, _] = a.into();
+ | ^^^^^^ consider giving this pattern a type
+ = note: type must be known at this point
+error: aborting due to previous error
+For more information about this error, try `rustc --explain E0282`.
0 commit comments