diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/consts/issue-miri-1910.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/consts/issue-miri-1910.rs b/src/test/ui/consts/issue-miri-1910.rs new file mode 100644 index 000000000..2b23626e3 --- /dev/null +++ b/src/test/ui/consts/issue-miri-1910.rs @@ -0,0 +1,11 @@ +// error-pattern unable to turn pointer into raw bytes +#![feature(const_ptr_read)] + +const C: () = unsafe { + let foo = Some(&42 as *const i32); + let one_and_a_half_pointers = std::mem::size_of::<*const i32>()/2*3; + (&foo as *const _ as *const u8).add(one_and_a_half_pointers).read(); +}; + +fn main() { +} |