You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let a :Arc<dynSomeTrait> = getA();let b :Arc<dynSomeTrait> = getB();// The following two approaches don't work as expectedlet eq1 = std::ptr::eq(a.as_ref(), b.as_ref());let eq2 = Arc::ptr_eq(&a,&b);
I expected to see this happen:
trait object comparison works as expected, with no false positives or false negatives.
Instead, this happened:
see StackOverflow explanation. Fat pointer comparison is a complex topic and I believe it's a papercut issue that the developper has to understand the internals of fat pointer layout to be able to check for equality