rust/tests/ui/out_of_bounds_indexing/issue-3102.rs
2023-08-22 17:17:48 +02:00

12 lines
181 B
Rust

#![warn(clippy::out_of_bounds_indexing)]
#![allow(clippy::no_effect)]
fn main() {
let x = [1, 2, 3, 4];
// issue 3102
let num = 1;
&x[num..10];
&x[10..num];
}