How come this works,
let a = Box::new([2; 10]);
println!( "foo {:?}", a );
But this doesn't,
let a = Box::new([2; 100]);
println!( "foo {:?}", a );
Why does an array's length determine the trait implementations? The error seems unrelated to the question. Conversely, how can achive the effect I desire with the above code.
The error is reproduced is:
error[E0277]: arrays only have std trait implementations for lengths 0..=32
--> ./test.rs:4:27
|
4 | println!( "foo {:?}", a );
| ^ the trait `std::array::LengthAtMost32` is not implemented for `[{integer}; 100]`
|
= note: required because of the requirements on the impl of `std::fmt::Debug` for `[{integer}; 100]`
= note: required because of the requirements on the impl of `std::fmt::Debug` for `std::boxed::Box<[{integer}; 100]>`
= note: required by `std::fmt::Debug::fmt`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.