2020-10-24 18:21:40 -05:00
|
|
|
use std::mem;
|
2019-08-30 08:04:12 -05:00
|
|
|
|
|
|
|
// Make sure we error with the right kind of error on a too large slice.
|
2021-05-15 08:10:14 -05:00
|
|
|
const TEST: () = { unsafe {
|
2019-08-30 08:04:12 -05:00
|
|
|
let slice: *const [u8] = mem::transmute((1usize, usize::MAX));
|
2021-06-18 12:31:56 -05:00
|
|
|
let _val = &*slice; //~ ERROR: evaluation of constant value failed
|
2021-05-15 08:10:14 -05:00
|
|
|
//~| slice is bigger than largest supported object
|
2019-08-30 08:04:12 -05:00
|
|
|
} };
|
|
|
|
|
|
|
|
fn main() {}
|