I can print in Debug
the following array:
fn main() {
let array = [0; 5];
println!("{:?}", array);
}
However, if the size is bigger, let's say it's 50, the trait std::fmt::Debug
will not be implemented by default:
fn main() {
let array = [0; 50];
println!("{:?}", array);
}
Compilation error:
error[E0277]: the trait bound
[{integer}; 50]: std::fmt::Debug
is not satisfied
Why is the std::fmt::Debug
trait not implemented for some sizes of arrays?