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:
commit
3a5c44c2d8
2 changed files with 8 additions and 1 deletions
|
|
@ -1 +1 @@
|
|||
7445622bcb515c822a2fc6e8c57c90478c1a56bb
|
||||
2d851b33181b1404856cb1d8b20d261adda54ffb
|
||||
|
|
|
|||
7
tests/compile-fail/slice-too-big.rs
Normal file
7
tests/compile-fail/slice-too-big.rs
Normal 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
|
||||
} }
|
||||
Loading…
Add table
Add a link
Reference in a new issue