]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrow-raw-address-of-deref-mutability-ok.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / borrow-raw-address-of-deref-mutability-ok.rs
1 // check-pass
2
3 #![feature(raw_ref_op)]
4
5 fn raw_reborrow() {
6     let x = &0;
7     let y = &mut 0;
8
9     let p = &raw const *x;
10     let r = &raw const *y;
11     let s = &raw mut *y;
12 }
13
14 unsafe fn raw_reborrow_of_raw() {
15     let x = &0 as *const i32;
16     let y = &mut 0 as *mut i32;
17
18     let p = &raw const *x;
19     let r = &raw const *y;
20     let s = &raw mut *y;
21 }
22
23 fn main() {}