diff --git a/library/core/src/alloc/mod.rs b/library/core/src/alloc/mod.rs index 06a761531b676..4946d140d4cc6 100644 --- a/library/core/src/alloc/mod.rs +++ b/library/core/src/alloc/mod.rs @@ -404,3 +404,16 @@ where unsafe { (**self).shrink(ptr, old_layout, new_layout) } } } + +#[unstable(feature = "allocator_api", issue = "32838")] +unsafe impl Allocator for ! { + #[inline] + fn allocate(&self, _: Layout) -> Result, AllocError> { + *self + } + + #[inline] + unsafe fn deallocate(&self, _: NonNull, _: Layout) { + *self + } +}