-
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
change the box_free
lang item to accept pointers to unsized types
#37708
Conversation
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
r? @eddyb |
Do you think you could also change trans to take advantage of this? IIRC it does its own DST logic. |
The only places rustc generates calls to |
travis likes it + issue reported. |
@bors r+ |
📌 Commit de371e5 has been approved by |
Doesn't have the |
added |
@bors r+ |
📌 Commit 323c20c has been approved by |
change the `box_free` lang item to accept pointers to unsized types in miri we use the `box_free` lang item as the destructor for `Box` objects, since the function's api matches that of an `fn drop(&mut self)` in a hypothetical `impl<T: ?Sized> Drop for Box<T>` exactly. This works fine except if we insert a check in the `size_of` intrinsic to ensure that it is only called with sized types, since the `box_free` lang item calls that intrinsic. cc @eddyb no clue who to r? here, probably lang team?
change the `box_free` lang item to accept pointers to unsized types in miri we use the `box_free` lang item as the destructor for `Box` objects, since the function's api matches that of an `fn drop(&mut self)` in a hypothetical `impl<T: ?Sized> Drop for Box<T>` exactly. This works fine except if we insert a check in the `size_of` intrinsic to ensure that it is only called with sized types, since the `box_free` lang item calls that intrinsic. cc @eddyb no clue who to r? here, probably lang team?
Rollup of 30 pull requests - Successful merges: #37190, #37368, #37481, #37503, #37527, #37535, #37551, #37584, #37600, #37613, #37615, #37659, #37662, #37669, #37682, #37688, #37690, #37692, #37693, #37694, #37695, #37696, #37698, #37699, #37705, #37708, #37709, #37716, #37724, #37727 - Failed merges: #37640, #37689, #37717
in miri we use the
box_free
lang item as the destructor forBox
objects, since the function's api matches that of anfn drop(&mut self)
in a hypotheticalimpl<T: ?Sized> Drop for Box<T>
exactly.This works fine except if we insert a check in the
size_of
intrinsic to ensure that it is only called with sized types, since thebox_free
lang item calls that intrinsic.cc @eddyb
no clue who to r? here, probably lang team?