title: Dynamic cast (run-time type inference) in Rust
body: <p>Is this type of polymorphism possible in Rust, or is it planned?</p>
  
  <p>I.e.</p>
  
  <pre><code>trait R { ... }
  struct S { ... }
  impl R for S { ... }
  
  let r: Box&lt;R&gt; = Box::new(S { ... });
  let s: Box&lt;S&gt; = dynamic_cast&lt;Box&lt;S&gt;&gt;(r).expect("r is a boxed S");
  </code></pre>
  
  <p>I am aware that <code>std::mem::transmute</code> provides an unsafe way of doing this, but don't see any explicit support for dynamic_cast (which, I guess, is fine).</p>