os-rust/tests/ui/borrowck/borrow-raw-address-of-deref-mutability-ok.rs

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

22 lines
347 B
Rust
Raw Normal View History

2019-09-18 21:31:25 +01:00
//@ check-pass
fn raw_reborrow() {
let x = &0;
let y = &mut 0;
let p = &raw const *x;
let r = &raw const *y;
let s = &raw mut *y;
}
unsafe fn raw_reborrow_of_raw() {
let x = &0 as *const i32;
let y = &mut 0 as *mut i32;
let p = &raw const *x;
let r = &raw const *y;
let s = &raw mut *y;
}
fn main() {}