mirror of
https://github.com/tokio-rs/tracing.git
synced 2026-01-25 04:16:18 +00:00
fix: Do not compare references to pointers to compare pointers (#3236)
`self` and `other` are references, and the `ptr::eq()` call intends to determine if they designate the same object. Putting them behind another level of reference will always return `false`, as those short-lived references will be compared instead.
This commit is contained in:
@@ -448,7 +448,7 @@ impl Eq for Metadata<'_> {}
|
||||
impl PartialEq for Metadata<'_> {
|
||||
#[inline]
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
if core::ptr::eq(&self, &other) {
|
||||
if core::ptr::eq(self, other) {
|
||||
true
|
||||
} else if cfg!(not(debug_assertions)) {
|
||||
// In a well-behaving application, two `Metadata` can be assumed to
|
||||
|
||||
Reference in New Issue
Block a user