Skip to content

fix: do not compare references to pointers to compare pointers #3236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

samueltardieu
Copy link

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.

Solution

Remove the extra references.

As this is only an optimization which was missed, it is not possible to design a test which failed before this PR and succeeds after.

`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.
@samueltardieu
Copy link
Author

@carllerche @hawkw Hi there, any chance to get a review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant