#![allow(unused_variables)] #![feature(allocator_api, slice_ptr_get)] fn main() { fn _inner() -> core::result::Result<(), impl core::fmt::Debug> { use std::alloc::{Allocator, Layout, System}; unsafe { let ptr = System.allocate(Layout::new::())?.as_mut_ptr() as *mut i32; ptr.write(5); let x = Box::from_raw_in(ptr, System); } Ok::<(), std::alloc::AllocError>(()) } _inner().unwrap() }