mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-25 04:23:22 +00:00
26 lines
620 B
Rust
26 lines
620 B
Rust
|
// run-rustfix
|
||
|
|
||
|
#![allow(unused)]
|
||
|
|
||
|
use std::collections::HashSet;
|
||
|
use std::collections::VecDeque;
|
||
|
|
||
|
fn main() {
|
||
|
let v = [1, 2, 3, 4, 5];
|
||
|
let v2: Vec<isize> = v.iter().cloned().collect();
|
||
|
let v3: HashSet<isize> = v.iter().cloned().collect();
|
||
|
let v4: VecDeque<isize> = v.iter().cloned().collect();
|
||
|
|
||
|
// Handle macro expansion in suggestion
|
||
|
let _: Vec<isize> = vec![1, 2, 3].iter().cloned().collect();
|
||
|
|
||
|
// Issue #3704
|
||
|
unsafe {
|
||
|
let _: Vec<u8> = std::ffi::CStr::from_ptr(std::ptr::null())
|
||
|
.to_bytes()
|
||
|
.iter()
|
||
|
.cloned()
|
||
|
.collect();
|
||
|
}
|
||
|
}
|