]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/dangling.rs
Stabilize File::options()
[rust.git] / src / test / ui / consts / const-eval / dangling.rs
1 #![feature(const_raw_ptr_deref)]
2
3 use std::mem;
4
5 // Make sure we error with the right kind of error on a too large slice.
6 const TEST: () = { unsafe {
7     let slice: *const [u8] = mem::transmute((1usize, usize::MAX));
8     let _val = &*slice; //~ ERROR: evaluation of constant value failed
9     //~| slice is bigger than largest supported object
10 } };
11
12 fn main() {}