explain what happens in a test
This commit is contained in:
parent
9ec526478f
commit
ff1f0b06cc
@ -8,5 +8,6 @@ fn main() {
|
||||
let bad = unsafe {
|
||||
std::mem::transmute::<u64, &[u8]>(42)
|
||||
};
|
||||
// This created a slice with length 0, so the following will fail the bounds check.
|
||||
bad[0];
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', $DIR/transmute_fat2.rs:11:5
|
||||
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', $DIR/transmute_fat2.rs:12:5
|
||||
|
Loading…
x
Reference in New Issue
Block a user