I'm having trouble initializing a fixed length array. [My attempts so far all result in the same "use of possibly uninitialized variable: `foo_array`" error](https://play.rust-lang.org/?gist=856973d22eaa99630b62f0ecafa7ee92&version=nightly):

```
#[derive(Debug)]
struct Foo { a: u32, b: u32 }

impl Default for Foo {
    fn default() -> Foo { Foo{a:1, b:2} }
}

pub fn main() {
    let mut foo_array: [Foo; 10];

    // Do something here to in-place initialize foo_array?

    for f in foo_array.iter() {
        println!("{:?}", f);
    }
}

```

```none
error[E0381]: use of possibly uninitialized variable: `foo_array`
  --> src/main.rs:13:14
   |
13 |     for f in foo_array.iter() {
   |              ^^^^^^^^^ use of possibly uninitialized `foo_array`

```

I implemented the `Default` trait, but Rust does not seem to call this by default akin to a C++ constructor.

What is the proper way to initialize a fixed length array? I'd like to do an efficient in-place initialization rather than some sort of copy.

Related: [Why is the Copy trait needed for default (struct valued) array initialization?](https://stackoverflow.com/questions/27876588/why-is-the-copy-trait-needed-for-default-struct-valued-array-initialization)

Related: [Is there a way to not have to initialize arrays twice?](https://stackoverflow.com/questions/26185618/is-there-a-way-to-not-have-to-initialize-arrays-twice)