These are chat archives for rust-lang/rust

Feb 2016
Denis Lisov
Feb 05 2016 14:18
Does Rust stdlib have some Arc-like wrapper implementing Eq as "points to the same object"?
Feb 05 2016 18:04
Denis Lisov
Feb 05 2016 19:15
@Vdimir, not what I mean. This one delegates to the T's Eq, while I wanted to have something like "equal if and only if they point to the same address". Specifically for the case when the inner objects don't implement Eq at all.
Vladimir Matveev
Feb 05 2016 20:24
@tanriol doesn't casting to a raw pointer work?
let p1: &u32 = ...;
let p2: &u32 = ...;
if p1 as *const u32 == p2 as *const u32 { ... } else { ... }
Peter Atashian
Feb 05 2016 20:34
The only way to compare for address equality is through raw pointers
Denis Lisov
Feb 05 2016 20:43
Thanks for the direction.