title: Can I get a trait object of a multi-trait instance without using a generic type?
body: <p>I am trying to get a dynamically dispatchable borrow to an instance of an object implementing both <code>Reader</code> and <code>Seek</code>.</p>
  
  <p>I understand that Rust can do dynamic dispatch as long as there is only one trait involved.</p>
  
  <pre><code>use std::io::{Read, Seek};
  fn user(stream: &amp;mut Read) {}
  </code></pre>
  
  <p>With two or more trait bounds though, I am forced to use a type parameter:</p>
  
  <pre><code>fn user_gen&lt;T: Read + Seek&gt;(stream: &amp;mut T) {}
  </code></pre>
  
  <p>As the actual type underneath is a builder, it would have to store the borrowed object in some way, and using a type parameter for this would make the implementation more complex (I have three type parameters already). </p>
  
  <p>Ideally, I would be able to do something like that:</p>
  
  <pre><code>fn user_dynamic(stream: &amp;mut (Read + Seek)) {}
  </code></pre>
  
  <p>This does not compile:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0225]: only auto traits can be used as additional traits in a trait object
   --&gt; src/main.rs:3:38
    |
  3 | fn user_dynamic(stream: &amp;mut (Read + Seek)) {}
    |                                      ^^^^ non-auto additional trait
  </code></pre>
  
  <p>I understand that dynamic dispatch is done through fat pointers, and usually these only refer to one method table, not to multiple ones. I have not seen a statically compiled language that would support this, but such a feature would help me a lot.</p>