In Rust, this works:
fn main() {
let a = [0; 32];
println!("{:?}", a);
}
but this doesn't:
fn main() {
let a = [0; 33];
println!("{:?}", a);
}
Compile error:
error[E0277]: the trait bound `[{integer}; 33]: std::fmt::Debug` is not satisfied
--> src/main.rs:3:22
|
3 | println!("{:?}", a);
| ^ the trait `std::fmt::Debug` is not implemented for `[{integer}; 33]`
|
= note: `[{integer}; 33]` cannot be formatted using `:?`; if it is defined in your crate, add `#[derive(Debug)]` or manually implement it
= note: required by `std::fmt::Debug::fmt`
I assume that the std::fmt::Debug
function somehow detects types up to a length of 32 elements, but then drops it's detection. Or why doesn't it work?