]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/iter_cloned_collect.fixed
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / src / tools / clippy / tests / ui / iter_cloned_collect.fixed
CommitLineData
f20569fa
XL
1// run-rustfix
2
3#![allow(unused)]
4
5use std::collections::HashSet;
6use std::collections::VecDeque;
7
8fn main() {
9 let v = [1, 2, 3, 4, 5];
10 let v2: Vec<isize> = v.to_vec();
11 let v3: HashSet<isize> = v.iter().cloned().collect();
12 let v4: VecDeque<isize> = v.iter().cloned().collect();
13
14 // Handle macro expansion in suggestion
15 let _: Vec<isize> = vec![1, 2, 3].to_vec();
16
17 // Issue #3704
18 unsafe {
19 let _: Vec<u8> = std::ffi::CStr::from_ptr(std::ptr::null())
20 .to_bytes().to_vec();
21 }
22}