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