mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
13 lines
265 B
Rust
13 lines
265 B
Rust
#![feature(plugin)]
|
|
#![plugin(clippy)]
|
|
|
|
#![deny(out_of_bounds_indexing)]
|
|
#![allow(no_effect)]
|
|
|
|
fn main() {
|
|
let x = [1,2,3,4];
|
|
x[0];
|
|
x[3];
|
|
x[4]; //~ERROR: const index-expr is out of bounds
|
|
x[1 << 3]; //~ERROR: const index-expr is out of bounds
|
|
}
|