blob: 0acb7b1bf2b787439d6852e48c96bf729dad7e41 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
use std::alloc::{GlobalAlloc, Layout};
struct Test(u32);
unsafe impl GlobalAlloc for Test {
unsafe fn alloc(&self, _layout: Layout) -> *mut u8 {
self.0 += 1; //~ ERROR cannot assign
0 as *mut u8
}
unsafe fn dealloc(&self, _ptr: *mut u8, _layout: Layout) {
unimplemented!();
}
}
fn main() { }
|