rust/tests/ui/suggestions/issue-68049-1.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
336 B
Rust
Raw Normal View History

2021-05-08 19:56:59 -05:00
use std::alloc::{GlobalAlloc, Layout};
struct Test(u32);
unsafe impl GlobalAlloc for Test {
unsafe fn alloc(&self, _layout: Layout) -> *mut u8 {
2021-05-10 23:20:43 -05:00
self.0 += 1; //~ ERROR cannot assign
2021-05-08 19:56:59 -05:00
0 as *mut u8
}
unsafe fn dealloc(&self, _ptr: *mut u8, _layout: Layout) {
unimplemented!();
}
}
fn main() { }