Skip to content

Commit ab355f6

Browse files
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.
1 parent 1619fa8 commit ab355f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tracing-core/src/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ impl Eq for Metadata<'_> {}
448448
impl PartialEq for Metadata<'_> {
449449
#[inline]
450450
fn eq(&self, other: &Self) -> bool {
451-
if core::ptr::eq(&self, &other) {
451+
if core::ptr::eq(self, other) {
452452
true
453453
} else if cfg!(not(debug_assertions)) {
454454
// In a well-behaving application, two `Metadata` can be assumed to

0 commit comments

Comments
 (0)