mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 23:20:39 +00:00
24 lines
493 B
Rust
24 lines
493 B
Rust
//@run-rustfix
|
|
|
|
#![allow(unused)]
|
|
#![warn(clippy::explicit_into_iter_fn_arg)]
|
|
|
|
fn a<T>(_: T) {}
|
|
fn b<T: IntoIterator<Item = i32>>(_: T) {}
|
|
fn c(_: impl IntoIterator<Item = i32>) {}
|
|
fn d<T>(_: T)
|
|
where
|
|
T: IntoIterator<Item = i32>,
|
|
{
|
|
}
|
|
fn e<T: IntoIterator<Item = i32>>(_: T) {}
|
|
fn f(_: std::vec::IntoIter<i32>) {}
|
|
|
|
fn main() {
|
|
a(vec![1, 2].into_iter());
|
|
b(vec![1, 2]);
|
|
c(vec![1, 2]);
|
|
d(vec![1, 2]);
|
|
e([&1, &2, &3].into_iter().cloned());
|
|
f(vec![1, 2].into_iter());
|
|
}
|