mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-21 10:33:27 +00:00
26 lines
621 B
Rust
26 lines
621 B
Rust
|
//@run-rustfix
|
||
|
//@aux-build:proc_macros.rs:proc-macro
|
||
|
#![allow(clippy::useless_vec, unused)]
|
||
|
#![warn(clippy::iter_skip_zero)]
|
||
|
|
||
|
#[macro_use]
|
||
|
extern crate proc_macros;
|
||
|
|
||
|
use std::iter::once;
|
||
|
|
||
|
fn main() {
|
||
|
let _ = [1, 2, 3].iter().skip(0);
|
||
|
let _ = vec![1, 2, 3].iter().skip(0);
|
||
|
let _ = once([1, 2, 3]).skip(0);
|
||
|
let _ = vec![1, 2, 3].iter().chain([1, 2, 3].iter().skip(0)).skip(0);
|
||
|
// 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);
|
||
|
}
|
||
|
}
|