]> git.lizzy.rs Git - rust.git/blob - tests/ui/out_of_bounds_indexing/issue-3102.rs
Fix type checks for `manual_str_repeat`
[rust.git] / tests / ui / out_of_bounds_indexing / issue-3102.rs
1 #![warn(clippy::out_of_bounds_indexing)]
2 #![allow(clippy::no_effect, const_err)]
3
4 fn main() {
5     let x = [1, 2, 3, 4];
6
7     // issue 3102
8     let num = 1;
9     &x[num..10]; // should trigger out of bounds error
10     &x[10..num]; // should trigger out of bounds error
11 }