title: Array as a struct field
body: <p>I would like to create a non binary tree structure in Rust. Here is a try</p>
  
  <pre><code>struct TreeNode&lt;T&gt; {
      tag : T,
      father : Weak&lt;TreeNode&lt;T&gt;&gt;,
      childrenlists : [Rc&lt;TreeNode&lt;T&gt;&gt;]
  }
  </code></pre>
  
  <p>Unfortunately, this does not compile.</p>
  
  <pre><code>main.rs:4:1: 8:2 error: the trait `core::marker::Sized` is not implemented for the type `[alloc::rc::Rc&lt;TreeNode&lt;T&gt;&gt;]` [E0277]
  main.rs:4 struct TreeNode&lt;T&gt; {
  main.rs:5     tag : T,
  main.rs:6     father : Weak&lt;TreeNode&lt;T&gt;&gt;,
  main.rs:7     childrenlist : [Rc&lt;TreeNode&lt;T&gt;&gt;]
  main.rs:8 }
  main.rs:4:1: 8:2 note: `[alloc::rc::Rc&lt;TreeNode&lt;T&gt;&gt;]` does not have a constant size known at compile-time
  main.rs:4 struct TreeNode&lt;T&gt; {
  main.rs:5     tag : T,
  main.rs:6     father : Weak&lt;TreeNode&lt;T&gt;&gt;,
  main.rs:7     childrenlist : [Rc&lt;TreeNode&lt;T&gt;&gt;]
  main.rs:8 }
  error: aborting due to previous error
  </code></pre>
  
  <p>The code compiles if we replace an array with a <code>Vec</code>. However, the structure is immutable and I do not need an overallocated <code>Vec</code>.</p>
  
  <p>I heard it could be possible to have a struct field with size unknown at compile time, provided it is unique. How can we do it?</p>