diff --git a/rust-version b/rust-version index 3520d790eca8..af5cbdfb6ca3 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -7445622bcb515c822a2fc6e8c57c90478c1a56bb +2d851b33181b1404856cb1d8b20d261adda54ffb diff --git a/tests/compile-fail/slice-too-big.rs b/tests/compile-fail/slice-too-big.rs new file mode 100644 index 000000000000..08ab48175aed --- /dev/null +++ b/tests/compile-fail/slice-too-big.rs @@ -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 +} }