Files
rust/tests/ui/const-generics/vec-macro-in-static-array.stderr
T
Esteban Küber 87d8f5885b Provide more context on type errors in const context
- On `const` and `static` point at the type (like we do for let bindings)
- On fn calls, point at const parameter in fn definition
- On type, point at const parameter in type definition
- On array type lengths, explain that array length is always `usize`
- On enum variant discriminant, mention `repr`
2026-03-14 20:13:43 +00:00

15 lines
462 B
Plaintext

error[E0308]: mismatched types
--> $DIR/vec-macro-in-static-array.rs:5:26
|
LL | static VEC: [u32; 256] = vec![];
| ---------- ^^^^^^ expected `[u32; 256]`, found `Vec<_>`
| |
| expected because of the type of the static
|
= note: expected array `[u32; 256]`
found struct `Vec<_>`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0308`.