@@ -6,6 +6,14 @@ LL | arr: [i32; N],
6
6
|
7
7
= note: the length of array `[i32; N]` must be type `usize`
8
8
9
+ error: the constant `N` is not of type `usize`
10
+ --> $DIR/bad-array-size-in-type-err.rs:19:32
11
+ |
12
+ LL | pub struct Blorb<const N: u16>([String; N]);
13
+ | ^^^^^^^^^^^ expected `usize`, found `u16`
14
+ |
15
+ = note: the length of array `[String; N]` must be type `usize`
16
+
9
17
error[E0308]: mismatched types
10
18
--> $DIR/bad-array-size-in-type-err.rs:7:38
11
19
|
@@ -20,6 +28,37 @@ LL | let _ = BadArraySize::<2> { arr: [0, 0, 0] };
20
28
|
21
29
= note: the length of array `[i32; 2]` must be type `usize`
22
30
23
- error: aborting due to 3 previous errors
31
+ error: the constant `2` is not of type `usize`
32
+ --> $DIR/bad-array-size-in-type-err.rs:13:14
33
+ |
34
+ LL | for _ in val.arr {}
35
+ | ^^^^^^^ expected `usize`, found `u8`
36
+ |
37
+ = note: the length of array `[i32; 2]` must be type `usize`
38
+
39
+ error[E0277]: `[i32; 2]` is not an iterator
40
+ --> $DIR/bad-array-size-in-type-err.rs:13:14
41
+ |
42
+ LL | for _ in val.arr {}
43
+ | ^^^^^^^ `[i32; 2]` is not an iterator; try calling `.into_iter()` or `.iter()`
44
+ |
45
+ = help: the trait `IntoIterator` is not implemented for `[i32; 2]`
46
+ = help: the following other types implement trait `IntoIterator`:
47
+ &[T; N]
48
+ &[T]
49
+ &mut [T; N]
50
+ &mut [T]
51
+ [T; N]
52
+
53
+ error[E0493]: destructor of `Wrap` cannot be evaluated at compile-time
54
+ --> $DIR/bad-array-size-in-type-err.rs:21:16
55
+ |
56
+ LL | pub const fn i(_: Wrap) {}
57
+ | ^ - value is dropped here
58
+ | |
59
+ | the destructor for this type cannot be evaluated in constant functions
60
+
61
+ error: aborting due to 7 previous errors
24
62
25
- For more information about this error, try `rustc --explain E0308`.
63
+ Some errors have detailed explanations: E0277, E0308, E0493.
64
+ For more information about an error, try `rustc --explain E0277`.
0 commit comments