rust/tests/ui/consts/const-address-of-mut.rs

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

13 lines
186 B
Rust
Raw Normal View History

2024-08-17 07:19:34 -05:00
//@check-pass
2019-09-18 15:31:25 -05:00
2024-08-17 07:19:34 -05:00
const A: () = { let mut x = 2; &raw mut x; };
static B: () = { let mut x = 2; &raw mut x; };
2019-09-18 15:31:25 -05:00
const fn foo() {
let mut x = 0;
2024-08-17 07:19:34 -05:00
let y = &raw mut x;
2019-09-18 15:31:25 -05:00
}
fn main() {}