-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Stabilise weak_ptr_eq #61797
Stabilise weak_ptr_eq #61797
Conversation
r? @kennytm (rust_highfive has picked a reviewer for you, use r? to override) |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
I think the failure is unrelated to this pr. |
Can we first change the method into a normal method (taking |
☔ The latest upstream changes (presumably #61915) made this pull request unmergeable. Please resolve the merge conflicts. |
There's not much code to look at, that seems fine. ;) The docs could be improved though IMO. It first says "Returns I think A better term might be "reference-counted object". |
I mostly copied the documentation from
(emphasis mine) The part in between brackets is arguably the most important part, maybe that should be moved to the forefront of the sentence more.
I agree with this, what do you suggest as concrete improvement? |
That was deliberate; as I explained above, values that "compare equal but are not the same" is an odd concept. It indicates that the mathematical integer value "5" might have more to its "identity" that the fact that it is 5? Or maybe integers have provenance? I know what the text means, but I don't think the parenthetical helps. This is the old problem of comparing values vs. comparing locations (addresses) that hold values, except that it uses exactly the wrong term for what this code really does. |
I agree with your point. What terminology should be used instead? Should "values" not be mentioned at all perhaps and only talk of pointers? I'm really looking for some concrete documentation changes and any help here would be appreciated. |
strawman proposal: "reference-counted object". |
Alternatively we could be talking about comparing things "by their address", as we do in |
@RalfJung what do you think about the following? /// Returns `true` if the address of the two reference counted objects (the
/// `Weaks`) are equal.
///
/// # Notes
///
/// Since this compares addresses it means that `Weak::new()` will always
/// equal each other. Also do you want me to make the change to |
The parenthetical is odd -- the object itself isn't weak, only the reference is.
Yes, this should be done consistently. |
Team member @sfackler has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
Is the |
The edit I suggested at #61797 (comment) is still outstanding. |
I've just messed up this branch, will fix it asap. |
I've just rebased on master, update the stable attribute to 1.39 and added the doc changes as requested by @RalfJung. |
@SimonSapin I think the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me: Docs look good enough for me (the entire Rc/Arc "value" terminology could be improved but that's a separate issue).
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
@bors r=RalfJung rollup |
📌 Commit 307804a has been approved by |
… r=RalfJung Stabilise weak_ptr_eq Implemented in rust-lang#55987. Closes rust-lang#55981.
… r=RalfJung Stabilise weak_ptr_eq Implemented in rust-lang#55987. Closes rust-lang#55981.
Implemented in #55987.
Closes #55981.