I have a trait with an associated const of a &'static reference type, along with a blanket impl:
trait HasMetadata {
const META: &'static Metadata;
}
impl<T> HasMetadata for T {
const META: &'static Metadata = &Metadata {
/* ... */
};
}
I expected to be able to use ptr::eq to compare the values, but it seems the same T can return different pointer values for the associated const. Specifically, in my case, they seemed to match in my regular tests, but not in my doctests, despite the code being identical. This is not a major problem, but I am curious if someone can point me in the direction of documentation that explains the nuance of this behavior.