mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 11:34:11 +00:00
13 lines
244 B
Rust
Executable File
13 lines
244 B
Rust
Executable File
#![feature(plugin)]
|
|
#![plugin(clippy)]
|
|
|
|
#![deny(out_of_bounds_indexing)]
|
|
|
|
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
|
|
}
|