-
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
Add A: 'static
bound for Arc/Rc::pin_in
#120092
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
r? libs-api |
@bors r+ |
…r, r=Amanieu Add `A: 'static` bound for `Arc/Rc::pin_in` Analogous to rust-lang#79327 Needed to preserve pin's [drop guarantee](https://doc.rust-lang.org/std/pin/index.html#drop-guarantee)
…r, r=Amanieu Add `A: 'static` bound for `Arc/Rc::pin_in` Analogous to rust-lang#79327 Needed to preserve pin's [drop guarantee](https://doc.rust-lang.org/std/pin/index.html#drop-guarantee)
This seems like something that needs a comment somewhere to explain these bounds -- someone just finding them in the code might be very confused about why they are needed. |
@bors r- @zetanumbers Can you add a comment explaining why this is needed? Also add it to the original |
So it's a bit tricky to argue what bounds should be on So #79327 was justified because otherwise it violates pin's drop guarantee, which says that memory that holds pointee of a pinned (smart) pointer is allowed to be deallocated only after dropping the pointee, unless pointee is So why is there even /// This is kinda like `Arc::get_mut` but with `Pin`
fn pin_arc_get_mut(this: &mut Pin<Arc<T>>) -> Option<Pin<&mut T>> {
// implementation
} |
So I say it would probably will never be less beneficial to have this bound, since |
Actually I would like to add this |
It would require an ACP, along with a real use case for it. |
For this PR, I think just a simple sentence saying that |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (46961d2): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 676.479s -> 677.39s (0.13%) |
EDIT: After reading |
A comment in a closed PR is likely to be lost. It's better to open an issue or a discussion on Zulip - with more details on why the function is useless, maybe doing some code search on the web to find existing uses.
|
Analogous to #79327
Needed to preserve pin's drop guarantee