]> git.lizzy.rs Git - rust.git/blob - tests/run-pass/mut_range_bound.rs
add lint declaration and example that should trigger the lint
[rust.git] / tests / run-pass / mut_range_bound.rs
1 #![feature(plugin)]
2 #![plugin(clippy)]
3
4 // cause the build to fail if this warning is invoked
5 #![deny(check_for_loop_mut_bound)]
6
7 // an example
8 fn mut_range_bound() {
9     let mut m = 4;
10     for i in 0..m { continue; } // ERROR One of the range bounds is mutable
11 }
12
13 fn main(){
14     mut_range_bound();
15 }