-
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
Remove useless 'static
bounds on Box
allocator
#118634
Conversation
rust-lang#79327 added `'static` bounds to the allocator parameter for various `Box` + `Pin` APIs to ensure soundness. But it was a bit overzealous, some of the bounds aren't actually needed.
r? @thomcc (rustbot has picked a reviewer for you, use r? to override) |
This would be incorrect and violate pin's drop guarantee which in turn can break existing correct code assuming this rule. |
@zetanumbers can you show an example about how removing the |
I'm going to be away for a few months, so I'm rerolling my PRs so that folks don't have to wait for me. Sorry/thanks. r? libs |
@zetanumbers, can you elaborate on that unsoundness? Or maybe @TimDiekmann can take a look as the person who first added this? |
I've tried to elaborate on unsoundness of this change given my knowledge in this comment: #120092 (comment)
|
In other words: leaking a |
Then we should capture that information in code comments! |
Again, does anyone have a concrete example of how this PR specifically would allow unsoundness? Because as far as I can tell, no such example can be constructed. |
After spending some time reading through the The other 2 impls are just forwarding impls based on the first one, so they are also fine. @bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (c5f69bd): 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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 649.976s -> 650.169s (0.03%) |
#79327 added
'static
bounds to the allocator parameter for variousBox
+Pin
APIs to ensure soundness. But it was a bit overzealous, some of the bounds aren't actually needed.