7 ms·
This is still a problem with the latest version of Rust: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3da1b87b04c15d28ee71b1fc53dfb4
by xobs 4y ago
This is still a problem with the latest version of Rust:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3da1b87b04c15d28ee71b1fc53dfb477 https://play.rust-lang.org/?version=stable&mode=debug&editio...
If you set the array size to 32, then it works. You can get around this by using a macro, instead of `Default`, or implementing Default yourself, but it's still a limitation where you can't use an array of more than 32 elements.
- steveklabnik 4y agoIIRC this is a problem specific to Default, see here: https://github.com/rust-lang/rust/issues/61415#issuecomment-671081515 https://github.com/rust-lang/rust/issues/61415#issuecomment-... And here: https://github.com/rust-lang/rust/pull/62435 https://github.com/rust-lang/rust/pull/62435
- bacon_waffle 4y ago> You can get around this by using a macro, instead of `Default`, or implementing Default yourself For folks who aren't familiar with Rust, implementing Default yourself looks something like: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=bbfc93b17a0657e83e760d0cf20e519b https://play.rust-lang.org/?version=stable&mode=debug&editio...