rust/tests/ui/suggestions/dont_suggest_raw_pointer_syntax-issue-127562.rs

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

8 lines
177 B
Rust
Raw Normal View History

fn main() {
let val = 2;
let ptr = std::ptr::addr_of!(val);
unsafe {
*ptr = 3; //~ ERROR cannot assign to `*ptr`, which is behind a `*const` pointer
}
}