Skip to content

test too big slice #929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
} }