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