These are chat archives for rust-lang/rust

5th
Feb 2016
Denis Lisov
@tanriol
Feb 05 2016 14:18
Does Rust stdlib have some Arc-like wrapper implementing Eq as "points to the same object"?
Vdimir
@Vdimir
Feb 05 2016 18:04
Denis Lisov
@tanriol
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
@netvl
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
@retep998
Feb 05 2016 20:34
The only way to compare for address equality is through raw pointers
Denis Lisov
@tanriol
Feb 05 2016 20:43
Thanks for the direction.