Move tests from test/run-fail to UI
This commit is contained in:
10
src/test/ui/array-slice-vec/bounds-check-no-overflow.rs
Normal file
10
src/test/ui/array-slice-vec/bounds-check-no-overflow.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// run-fail
|
||||
// error-pattern:index out of bounds
|
||||
|
||||
use std::usize;
|
||||
use std::mem::size_of;
|
||||
|
||||
fn main() {
|
||||
let xs = [1, 2, 3];
|
||||
xs[usize::MAX / size_of::<isize>() + 1];
|
||||
}
|
||||
Reference in New Issue
Block a user