title: Can you cast a memory address as a usize into a reference with a lifetime?
body: <p>I know we can cast from reference -&gt; raw pointer -&gt; address (<code>usize</code>), but can we do it backwards especially with lifetime annotations? For example, I have following code:</p>
  <pre><code>struct Name&lt;'a&gt; {
      name: &amp;'a str,
  }
  
  impl&lt;'a&gt; Name&lt;'a&gt; {
      fn to_addr&lt;'b&gt;(&amp;'b self) -&gt; usize { /* ... */ }
      fn from_addr&lt;'b&gt;(address: usize) -&gt; &amp;'b Name&lt;'a&gt; {
          // assuming the address is valid,
          // is this even possible to return an reference with both lifetimes?
      }
  }
  </code></pre>