2019-09-20 06:25:05 +00:00
|
|
|
// Tests from for_loop.rs that don't have suggestions
|
|
|
|
|
|
|
|
#[warn(
|
|
|
|
clippy::needless_range_loop,
|
|
|
|
clippy::explicit_iter_loop,
|
|
|
|
clippy::explicit_into_iter_loop,
|
|
|
|
clippy::iter_next_loop,
|
|
|
|
clippy::reverse_range_loop,
|
|
|
|
clippy::for_kv_map
|
|
|
|
)]
|
|
|
|
#[allow(
|
|
|
|
clippy::linkedlist,
|
|
|
|
clippy::shadow_unrelated,
|
|
|
|
clippy::unnecessary_mut_passed,
|
|
|
|
clippy::cognitive_complexity,
|
|
|
|
clippy::similar_names,
|
|
|
|
unused,
|
|
|
|
dead_code
|
|
|
|
)]
|
2019-11-07 12:44:57 +00:00
|
|
|
#[allow(clippy::many_single_char_names, unused_variables)]
|
2019-09-20 06:25:05 +00:00
|
|
|
fn main() {
|
|
|
|
for i in 5..5 {
|
|
|
|
println!("{}", i);
|
|
|
|
}
|
|
|
|
|
|
|
|
let vec = vec![1, 2, 3, 4];
|
|
|
|
|
|
|
|
for _v in vec.iter().next() {}
|
|
|
|
|
|
|
|
for i in (5 + 2)..(8 - 1) {
|
|
|
|
println!("{}", i);
|
|
|
|
}
|
|
|
|
|
|
|
|
const ZERO: usize = 0;
|
|
|
|
|
|
|
|
for i in ZERO..vec.len() {
|
|
|
|
if f(&vec[i], &vec[i]) {
|
|
|
|
panic!("at the disco");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|