title: Drop can't be used in the generic struct implementing extended trait
body: <blockquote>
  <p><strong>TL;DR</strong> <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=99952dfdc8dab353992d2681de6b6f58" rel="nofollow noreferrer">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=99952dfdc8dab353992d2681de6b6f58</a></p>
  <p><strong>Full version</strong> <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=38d0c934cb7e55b868d73bd2dde94454" rel="nofollow noreferrer">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=38d0c934cb7e55b868d73bd2dde94454</a></p>
  </blockquote>
  <p>I don't quite understand why this doesn't work:</p>
  <pre><code>pub trait State {}
  pub trait WithFinal: State {}
  pub struct Machine&lt;T: State&gt; {
      pub state: T,
      error: Option&lt;fn(&amp;Event, &amp;T)&gt;,
      transition: Option&lt;fn(&amp;T, &amp;T, Event)&gt;, // fn(&amp;current_state, &amp;previous_state)
  }
  
  impl&lt;T: WithFinal&gt; Drop for Machine&lt;T&gt; {
      fn drop(&amp;mut self) {}
  }
  </code></pre>
  <pre><code>   Compiling scdlang v0.1.0 (/home/wildan/Projects/OSS/scdlang)
  error[E0367]: The requirement `T: statechart::WithFinal` is added only by the Drop impl.
    --&gt; src/main.rs:92:5
     |
  92 | /     impl&lt;T: WithFinal&gt; Drop for Machine&lt;T&gt; {
  93 | |         fn drop(&amp;mut self) {}
  94 | |     }
     | |_____^
     |
  note: The same requirement must be part of the struct/enum definition
    --&gt; src/main.rs:74:5
     |
  74 | /     pub struct Machine&lt;T: State&gt; {
  75 | |         pub state: T,
  76 | |         error: Option&lt;fn(&amp;Event, &amp;T)&gt;,
  77 | |         transition: Option&lt;fn(&amp;T, &amp;T, Event)&gt;, // fn(&amp;current_state, &amp;previous_state)
  78 | |     }
     | |_____^
  
  error: aborting due to previous error
  
  For more information about this error, try `rustc --explain E0367`.
  error: Could not compile `scdlang`.
  
  To learn more, run the command again with --verbose.
  </code></pre>
  <p>I thought it should be working because <code>WithFinal</code> extend trait <code>State</code></p>
  <p>However, both these 2 <code>impl</code> work just fine:</p>
  <pre><code>trait DropLike {
      fn drop(&amp;mut self);
  }
  
  impl&lt;T: WithFinal&gt; DropLike for Machine&lt;T&gt; {
      fn drop(&amp;mut self) {}
  }
  
  impl&lt;T: State&gt; Drop for Machine&lt;T&gt; {
      fn drop(&amp;mut self) {}
  }
  
  </code></pre>