]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/issue-68049-1.rs
Rollup merge of #106797 - FawazTirmizi:dev/issues/104284, r=bjorn3
[rust.git] / tests / 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() { }