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
I was trying to figure out how to implement PartialEq by using referential equality (still not sure how that goes). The code I wrote looks like this:
impl<'a> PartialEq for StatusBar<'a> {
fn eq(&self, other: &StatusBar<'a>) -> bool {
let p1: *const Self = self;
let p2: *const i32 = &other;
true
}
}
The code in the context of the project can be found here (trying to do a cargo build at that commit should yield the same results as I got).
I'm not sure what I expected to happen. I didn't necessarily expect it to work; I was just trying stuff out to see what the compiler said. I was attempting to follow the example here to get a pointer from a value.
I was trying to figure out how to implement
PartialEq
by using referential equality (still not sure how that goes). The code I wrote looks like this:The code in the context of the project can be found here (trying to do a cargo build at that commit should yield the same results as I got).
I'm not sure what I expected to happen. I didn't necessarily expect it to work; I was just trying stuff out to see what the compiler said. I was attempting to follow the example here to get a pointer from a value.
Meta
rustc --version --verbose
:Backtrace:
The text was updated successfully, but these errors were encountered: