about summary refs log tree commit diff
path: root/src/test/ui/array-slice-vec/bounds-check-no-overflow.rs
blob: 70cbb0672544fc44fc9fd41641b9f4ef2e4f4325 (plain)
1
2
3
4
5
6
7
8
9
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];
}