2019-07-16 00:30:23 -05:00
|
|
|
#![warn(clippy::out_of_bounds_indexing)]
|
2019-10-01 18:37:22 -05:00
|
|
|
#![allow(clippy::no_effect, const_err)]
|
2019-07-16 00:30:23 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = [1, 2, 3, 4];
|
|
|
|
|
|
|
|
// issue 3102
|
|
|
|
let num = 1;
|
|
|
|
&x[num..10]; // should trigger out of bounds error
|
|
|
|
&x[10..num]; // should trigger out of bounds error
|
|
|
|
}
|