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