How to check if two variables point to the same object in memory?
<p>For example:</p>

<pre><code>struct Foo&lt;'a&gt; { bar: &amp;'a str }

fn main() {
    let foo_instance = Foo { bar: "bar" };
    let some_vector: Vec&lt;&amp;Foo&gt; = vec![&amp;foo_instance];

    assert!(*some_vector[0] == foo_instance);
}
</code></pre>

<ol>
<li><p>I want to check if <code>foo_instance</code> references the same instance as <code>*some_vector[0]</code>, but I can't do this ...</p></li>
<li><p>I don't want to know if the two instances are equal; I want to check if the variables point to the same instance in the memory</p></li>
</ol>

<p>Is it possible to do that?</p>