clippy 0.0.49

A bunch of helpful lints to avoid common pitfalls in Rust
1
2
3
4
5
6
7
8
9
10
11
12
13
#![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
}