x[3]; // Ok, should not produce stderr.
let y = &x;
- y[0];
+ y[0]; // Ok, referencing shouldn't affect this lint. See the issue 6021
+ y[4]; // Ok, rustc will handle references too.
let v = vec![0; 5];
v[0];
v[10];
v[1 << 3];
- //
- // Continue tests at end function to minimize the changes to this file's corresponding stderr.
- //
-
const N: usize = 15; // Out of bounds
const M: usize = 3; // In bounds
x[N]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.