about summary refs log tree commit diff
path: root/tests/ui/array-slice-vec/bounds-check-no-overflow.rs
blob: c5ff805a853e0c943fcc1e8e0a36bb335cbd4c0a (plain)
1
2
3
4
5
6
7
8
9
10
//@ run-fail
//@ error-pattern:index out of bounds
//@ needs-subprocess

use std::mem::size_of;

fn main() {
    let xs = [1, 2, 3];
    xs[usize::MAX / size_of::<isize>() + 1];
}