-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Tracking Issue for ptr::addr_eq
#116324
Comments
Add `ptr::addr_eq` Seconded ACP: rust-lang/libs-team#274 (comment) Tracking issue: rust-lang#116324 cc `@dtolnay` rust-lang#106447
While I think that in the quest to replace |
To clarify, today you can write #![feature(strict_provenance)]
fn addr_eq<T: ?Sized, U: ?Sized>(p: *const T, q: *const U) -> bool {
p.addr() == q.addr()
} (or just inline that code directly, if you can cast to raw pointers first instead of relying on coercion) |
Note that I implemented this via casting to You can copy exactly what the PR does if you want; it works on stable. |
Team member @joshtriplett 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. |
🔔 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. This will be merged soon. |
…lnay Stabilize `ptr::addr_eq` This PR stabilize the `ptr_addr_eq` library feature, representing: ```rust // core::ptr pub fn addr_eq<T: ?Sized, U: ?Sized>(p: *const T, q: *const U) -> bool; ``` FCP has already started [on the tracking issue](rust-lang#116324 (comment)) and is waiting on the final period comment. Note: stabilizing this feature is somewhat of requirement for a new T-lang lint, cf. rust-lang#117758 (comment).
Rollup merge of rust-lang#117968 - Urgau:stabilize-ptr-addr-eq, r=dtolnay Stabilize `ptr::addr_eq` This PR stabilize the `ptr_addr_eq` library feature, representing: ```rust // core::ptr pub fn addr_eq<T: ?Sized, U: ?Sized>(p: *const T, q: *const U) -> bool; ``` FCP has already started [on the tracking issue](rust-lang#116324 (comment)) and is waiting on the final period comment. Note: stabilizing this feature is somewhat of requirement for a new T-lang lint, cf. rust-lang#117758 (comment).
Feature gate:
#![feature(ptr_addr_eq)]
This is a tracking issue for ...
Public API
Steps / History
ptr::addr_eq
for use with pointers-to-DSTs libs-team#274ptr::addr_eq
#116325Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩
The text was updated successfully, but these errors were encountered: