1
Fork 0

Auto merge of #100036 - DrMeepster:box_free_free_box, r=oli-obk

Remove `box_free` lang item

This PR removes the `box_free` lang item, replacing it with `Box`'s `Drop` impl. Box dropping is still slightly magic because the contained value is still dropped by the compiler.
This commit is contained in:
bors 2023-06-17 16:10:57 +00:00
commit a8a29070f0
17 changed files with 91 additions and 146 deletions

View file

@ -123,12 +123,6 @@
//! pointers to these functions even if they never get called anywhere. This can
//! be seen as a special case of taking a function reference.
//!
//! #### Boxes
//! Since `Box` expression have special compiler support, no explicit calls to
//! `exchange_malloc()` and `box_free()` may show up in MIR, even if the
//! compiler will generate them. We have to observe `Rvalue::Box` expressions
//! and Box-typed drop-statements for that purpose.
//!
//!
//! Interaction with Cross-Crate Inlining
//! -------------------------------------