summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/borrow-raw-address-of-deref-mutability-ok.rs
blob: e381384fe65ecc69102e2c52393e8fa7df74ef96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// check-pass

#![feature(raw_ref_op)]

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() {}