title: Box<Any> downcast return None in dylib module
body: <p>I use dylib as plugin solution. When I call function <code>register</code>(in the code below, <code>fun</code> is my project name)：</p>
  
  <pre><code>let register = plugin.get::&lt;unsafe extern fn(&amp;mut fun::mem::Mem)&gt;("register").unwrap();
  unsafe {
      register(&amp;mut mem);
  }
  </code></pre>
  
  <p>In dylib's <code>register</code> function, <code>mem.get_mut::&lt;fun::router::Router&gt;("router")</code> return <code>None</code></p>
  
  <p>But if I use <code>mem.get_mut::&lt;fun::router::Router&gt;("router")</code> in <code>main.rs</code>. It return <code>Router</code> as I want.</p>
  
  <p>I test more and get some result below:</p>
  
  <p>In dylib:</p>
  
  <ul>
  <li><code>mem.get_mut::&lt;String&gt;("test")</code> work well.  </li>
  <li><code>mem.get_mut::&lt;fun::Bob&gt;("bob")</code> return <code>None</code>.</li>
  </ul>
  
  <p>In <code>main.rs</code>:</p>
  
  <ul>
  <li><code>mem.get_mut::&lt;String&gt;("test")</code> work well.  </li>
  <li><code>mem.get_mut::&lt;fun::Bob&gt;("bob")</code> work well.</li>
  </ul>
  
  <p><strong>My question:</strong></p>
  
  <p><strong>Why downcast_mut return None in dylib if downcast's generic type defined in Main module ?</strong></p>
  
  <p>mem struct:</p>
  
  <pre><code>#[derive(Debug)]
  pub struct Mem {
      pub value: HashMap&lt;String, Box&lt;Any&gt;&gt;,
  }
  </code></pre>
  
  <p>get_mut:</p>
  
  <pre><code>pub fn get_mut&lt;T: Any&gt;(&amp;mut self, key: &amp;str) -&gt; Option&lt;&amp;mut T&gt; {
      match self.value.get_mut(key) {
          Some(val) =&gt; {
              match val.downcast_mut::&lt;T&gt;() {
                  Some(value) =&gt; Some(value),
                  None =&gt; None,
              }
          }
          None =&gt; None,
      }
  }
  </code></pre>
  
  <p>Sorry for my poor description.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>TypeId test result:</p>
  
  <pre><code># in dylib's function:
  Router TypeId: TypeId { t: 10245301028242226491 }
  String TypeId: TypeId { t: 2231836747111135853 }
  
  # in `main.rs`'s function:
  Router TypeId: TypeId { t: 11005875220745415326 }
  String TypeId: TypeId { t: 2231836747111135853 }
  </code></pre>
  
  <p><strong>TypeId is different. Any solution for this problem?</strong></p>