diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2022-03-21 16:52:41 +1100 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2022-03-21 17:04:03 +1100 |
| commit | 1f3ee7f32e1345e70f31adf1cb2d6f11d1d87c9a (patch) | |
| tree | 5979e8a7dbd451f5c73d192b3b9529d52964e890 /library/alloc/src/alloc.rs | |
| parent | 4df2a28aee55f73d4e898c931664b8087b06522d (diff) | |
| download | rust-1f3ee7f32e1345e70f31adf1cb2d6f11d1d87c9a.tar.gz rust-1f3ee7f32e1345e70f31adf1cb2d6f11d1d87c9a.zip | |
Rename `~const Drop` to `~const Destruct`
Diffstat (limited to 'library/alloc/src/alloc.rs')
| -rw-r--r-- | library/alloc/src/alloc.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/library/alloc/src/alloc.rs b/library/alloc/src/alloc.rs index bd7d721b5e1..44389ee47b0 100644 --- a/library/alloc/src/alloc.rs +++ b/library/alloc/src/alloc.rs @@ -14,6 +14,8 @@ use core::ptr::{self, NonNull}; #[doc(inline)] pub use core::alloc::*; +use core::marker::Destruct; + #[cfg(test)] mod tests; @@ -324,12 +326,16 @@ unsafe fn exchange_malloc(size: usize, align: usize) -> *mut u8 { #[cfg_attr(not(test), lang = "box_free")] #[inline] #[rustc_const_unstable(feature = "const_box", issue = "92521")] +#[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping // This signature has to be the same as `Box`, otherwise an ICE will happen. // When an additional parameter to `Box` is added (like `A: Allocator`), this has to be added here as // well. // For example if `Box` is changed to `struct Box<T: ?Sized, A: Allocator>(Unique<T>, A)`, // this function has to be changed to `fn box_free<T: ?Sized, A: Allocator>(Unique<T>, A)` as well. -pub(crate) const unsafe fn box_free<T: ?Sized, A: ~const Allocator + ~const Drop>( +pub(crate) const unsafe fn box_free< + T: ?Sized, + A: ~const Allocator + ~const Drop + ~const Destruct, +>( ptr: Unique<T>, alloc: A, ) { |
