title: Vector of objects belonging to a trait
body: <p>Consider the following code:</p>
  
  <pre><code>trait Animal {
      fn make_sound(&amp;self) -&gt; String;
  }
  
  struct Cat;
  impl Animal for Cat {
      fn make_sound(&amp;self) -&gt; String {
          "meow".to_string()
      }
  }
  
  struct Dog;
  impl Animal for Dog {
      fn make_sound(&amp;self) -&gt; String {
          "woof".to_string()
      }
  }
  
  fn main () {
      let dog: Dog = Dog;
      let cat: Cat = Cat;
      let v: Vec&lt;Animal&gt; = Vec::new();
      v.push(cat);
      v.push(dog);
      for animal in v.iter() {
          println!("{}", animal.make_sound());
      }
  }
  </code></pre>
  
  <p>The compiler tells me that <code>v</code> is a vector of <code>Animal</code> when I try to push <code>cat</code> (type mismatch)</p>
  
  <p>So, how can I make a vector of objects belonging to a trait and calls the corresponding trait method on each element?</p>