diff options
Diffstat (limited to 'src/test/pretty/raw-address-of.rs')
-rw-r--r-- | src/test/pretty/raw-address-of.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/pretty/raw-address-of.rs b/src/test/pretty/raw-address-of.rs new file mode 100644 index 000000000..6ccc434a1 --- /dev/null +++ b/src/test/pretty/raw-address-of.rs @@ -0,0 +1,12 @@ +// pp-exact +#![feature(raw_ref_op)] + +const C_PTR: () = { let a = 1; &raw const a; }; +static S_PTR: () = { let b = false; &raw const b; }; + +fn main() { + let x = 123; + let mut y = 345; + let c_p = &raw const x; + let parens = unsafe { *(&raw mut (y)) }; +} |