Generic size_of in array constructor

I've got this sample code here: Rust Playground

Function g returns the size of a type T. f constructs an array with element type T and of length size of T. They both use size_of. g compiles. f doesn't. What am I doing wrong?

This is a known bug where trait bounds aren't applied in that location: https://github.com/rust-lang/rust/issues/43408

1 Like