]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/issue-68049-1.rs
Auto merge of #93718 - thomcc:used-macho, r=pnkfelix
[rust.git] / src / test / ui / suggestions / issue-68049-1.rs
1 use std::alloc::{GlobalAlloc, Layout};
2
3 struct Test(u32);
4
5 unsafe impl GlobalAlloc for Test {
6     unsafe fn alloc(&self, _layout: Layout) -> *mut u8 {
7         self.0 += 1; //~ ERROR cannot assign
8         0 as *mut u8
9     }
10
11     unsafe fn dealloc(&self, _ptr: *mut u8, _layout: Layout) {
12         unimplemented!();
13     }
14 }
15
16 fn main() { }