-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
generalize Box::into_non_null over allocators #150390
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
Conversation
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
I haven’t looked at the other PR but this change seems incorrect (forgets the allocator, so it’s impossible to reconstruct the |
|
@hanna-kruppe You are correct in that this is in effect |
|
Is there a reason this generalization is done on |
|
Oh, and making code generic over allocators can sometimes change what UB Miri detects. See rust-lang/miri#3870 for example. CC @RalfJung |
It's done on both because |
|
Yeah this breaks the Stacked Borrows logic for turning a Box into a raw pointer. That cannot be done in code which is generic over the allocator since whether or not the Box has But also, as Hanna said, this PR breaks the API design principles that |
Never mind, didn't pay attention again to whether it takes the box by ref or not. |
|
Those just take a reference to the Box, so they do not forget the allocator.
|
|
See also #141219 |
Thanks, I see this change is indeed going against the stated direction, and that direction makes sense. It does seem to force |
|
You can use |
This is extracted from #150344 to see if it is the cause of the Miri failure.