For example:
struct Foo<'a> { bar: &'a str }
fn main() {
let foo_instance = Foo { bar: "bar" };
let some_vector: Vec<&Foo> = vec![&foo_instance];
assert!(*some_vector[0] == foo_instance);
}
I want to check if
foo_instance
references the same instance as*some_vector[0]
, but I can't do this ...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
Is it possible to do that?