-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Lift T: Sized
bounds from some strict_provenance
pointer methods
#103702
Lift T: Sized
bounds from some strict_provenance
pointer methods
#103702
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
d42428b
to
1f34e11
Compare
This should probably also change the similar methods on |
@h4x5 good catch! Weirdly enough there is no |
Reassigning yaahc's reviews as she has stepped down from the review rotation. r? rust-lang/libs-api |
This was previously discussed in the original PR here. Is there any specific use case that allowing this would enable? Alternatively, @Gankra do you have any objections to removing these bounds since you added them in the first place? I personally can't see any harm in removing these bounds for |
@Amanieu The However, there's no way to easily modify the address of a pointer to a dynamic object, so tagging a Having |
@Amanieu I can't recall the exact use case, but I wanted some of these methods when working on
That is actually a shame and exposing at least some option here would be really nice (the perfect solution would be to stabilize In general extending our support of un- |
We already have an (unstable) API for fat pointer manipulation: #81513 I'm tending towards accepting this PR, but I'd like to hear more opinions from the libs-api team on how these APIs interact with each other. |
Discussed in the libs-api meeting. No concerns from us. @bors r+ |
…m-pointer-methods-where-applicable, r=m-ou-se Lift `T: Sized` bounds from some `strict_provenance` pointer methods This PR removes requirement for `T` (pointee type) to be `Sized` to call `pointer::{addr, expose_addr, with_addr, map_addr}`. These functions don't use `T`'s size, so there is no reason for them to require this. Updated public API: cc `@Gankra,` rust-lang#95228 r? libs-api
Rollup of 5 pull requests Successful merges: - rust-lang#103702 (Lift `T: Sized` bounds from some `strict_provenance` pointer methods) - rust-lang#106441 (relax reference requirement on SocketAddrExt::from_abstract_name) - rust-lang#106718 (finish trait solver skeleton work) - rust-lang#106950 (Don't do pointer arithmetic on pointers to deallocated memory) - rust-lang#107014 (rustdoc: remove deprecated / unused code from main.js) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This PR removes requirement for
T
(pointee type) to beSized
to callpointer::{addr, expose_addr, with_addr, map_addr}
. These functions don't useT
's size, so there is no reason for them to require this. Updated public API:cc @Gankra, #95228
r? libs-api