2023-08-24 14:32:12 -05:00
|
|
|
//@aux-build:proc_macros.rs
|
2023-09-12 11:13:53 -05:00
|
|
|
#![allow(clippy::useless_vec, clippy::iter_out_of_bounds, unused)]
|
2023-07-31 16:53:53 -05:00
|
|
|
#![warn(clippy::iter_skip_zero)]
|
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
extern crate proc_macros;
|
|
|
|
|
|
|
|
use std::iter::once;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _ = [1, 2, 3].iter().skip(1);
|
|
|
|
let _ = vec![1, 2, 3].iter().skip(1);
|
|
|
|
let _ = once([1, 2, 3]).skip(1);
|
|
|
|
let _ = vec![1, 2, 3].iter().chain([1, 2, 3].iter().skip(1)).skip(1);
|
|
|
|
// Don't lint
|
|
|
|
let _ = [1, 2, 3].iter().skip(1);
|
|
|
|
let _ = vec![1, 2, 3].iter().skip(1);
|
|
|
|
external! {
|
|
|
|
let _ = [1, 2, 3].iter().skip(0);
|
|
|
|
}
|
|
|
|
with_span! {
|
|
|
|
let _ = [1, 2, 3].iter().skip(0);
|
|
|
|
}
|
|
|
|
}
|