title: Generic struct field with trait bounds
body: <p>I'm trying to implement a structure with a field of generic type which has trait bounds. I want to have a value of <code>Group.admin</code> to be <code>Printable</code>. It doesn't matter what exactly type it is.</p>
  
  <pre><code>struct Group&lt;T: Printable&gt; {
      admin: T,
  }
  
  struct Person {
      name: String,
  }
  
  impl Person {
      fn new() -&gt; Person {
          Person {
              name: String::from("Bob"),
          }
      }
  }
  
  trait Printable {
      fn print(&amp;self);
  }
  
  impl Printable for Person {
      fn print(&amp;self) {
          println!("{}", self.name);
      }
  }
  
  fn group_test&lt;T: Printable&gt;() -&gt; Group&lt;T&gt; {
      Group {
          admin: Person::new(),
      }
  }
  </code></pre>
  
  <p>But the compiler doesn't allow this:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0308]: mismatched types
    --&gt; src/lib.rs:27:16
     |
  27 |         admin: Person::new(),
     |                ^^^^^^^^^^^^^ expected type parameter, found struct `Person`
     |
     = note: expected type `T`
                found type `Person`
  </code></pre>
  
  <p>I'm not sure what's wrong here. Maybe I have to cast value of <code>Person::new()</code> to <code>&lt;T: Printable&gt;</code> somehow?</p>