Skip to content

Commit

Permalink
Add 81270
Browse files Browse the repository at this point in the history
  • Loading branch information
fanninpm committed Jan 30, 2021
1 parent 787a0cc commit 1cd0e19
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions ices/81270.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#![feature(allocator_api)]
use std::alloc::{AllocError, Allocator, Global, Layout};
use std::marker::PhantomData;
use std::ptr::NonNull;

struct S<A> {
a: PhantomData<A>,
b: [u8; 1],
}
unsafe impl<A> Allocator for S<A> {
fn allocate(&self, _: Layout) -> Result<NonNull<[u8]>, AllocError> {
todo!();
}
unsafe fn deallocate(&self, _: NonNull<u8>, _: Layout) {
todo!();
}
}

fn main() {
let x: Box<u8, S<u8>> = Box::new_in(
0,
S {
a: PhantomData,
b: [0; 1],
},
);
}

0 comments on commit 1cd0e19

Please sign in to comment.