From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/pretty/raw-address-of.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/pretty/raw-address-of.rs (limited to 'tests/pretty/raw-address-of.rs') diff --git a/tests/pretty/raw-address-of.rs b/tests/pretty/raw-address-of.rs new file mode 100644 index 000000000..6ccc434a1 --- /dev/null +++ b/tests/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)) }; +} -- cgit v1.2.3