Auto merge of #929 - RalfJung:slice-too-big, r=RalfJung

test too big slice

Test for an upcoming rustc PR.
This commit is contained in:
bors 2019-08-31 06:45:28 +00:00
commit 3a5c44c2d8
2 changed files with 8 additions and 1 deletions

View file

@ -1 +1 @@
7445622bcb515c822a2fc6e8c57c90478c1a56bb
2d851b33181b1404856cb1d8b20d261adda54ffb

View file

@ -0,0 +1,7 @@
use std::mem;
use std::usize;
fn main() { unsafe {
let ptr = Box::into_raw(Box::new(0u8));
let _x: &[u8] = mem::transmute((ptr, usize::MAX)); //~ ERROR: invalid slice: total size is bigger than largest supported object
} }