Mark `Layout::dangling` inline

This commit is contained in:
Tim Diekmann 2020-03-26 11:32:22 +01:00
parent 717e0c7b9d
commit db15fe6b38
1 changed files with 1 additions and 0 deletions

View File

@ -141,6 +141,7 @@ impl Layout {
/// sentinel value. Types that lazily allocate must track initialization by
/// some other means.
#[unstable(feature = "alloc_layout_extra", issue = "55724")]
#[inline]
pub const fn dangling(&self) -> NonNull<u8> {
// align is non-zero and a power of two
unsafe { NonNull::new_unchecked(self.align() as *mut u8) }