Skip to content

Commit

Permalink
Auto merge of #929 - RalfJung:slice-too-big, r=RalfJung
Browse files Browse the repository at this point in the history
test too big slice

Test for an upcoming rustc PR.
  • Loading branch information
bors committed Aug 31, 2019
2 parents 2bf8c3a + dfca026 commit 3a5c44c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7445622bcb515c822a2fc6e8c57c90478c1a56bb
2d851b33181b1404856cb1d8b20d261adda54ffb
7 changes: 7 additions & 0 deletions tests/compile-fail/slice-too-big.rs
Original file line number Diff line number Diff line change
@@ -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
} }

0 comments on commit 3a5c44c

Please sign in to comment.