]> git.proxmox.com Git - rustc.git/blob - tests/ui/nll/issue-47022.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / nll / issue-47022.rs
1 // check-pass
2
3 struct LoadedObject {
4 bodies: Vec<Body>,
5 color: Color,
6 }
7
8 struct Body;
9
10 #[derive(Clone)]
11 struct Color;
12
13 struct Graphic {
14 color: Color,
15 }
16
17 fn convert(objects: Vec<LoadedObject>) -> (Vec<Body>, Vec<Graphic>) {
18 objects
19 .into_iter()
20 .flat_map(|LoadedObject { bodies, color, .. }| {
21 bodies.into_iter().map(move |body| {
22 (
23 body,
24 Graphic {
25 color: color.clone(),
26 },
27 )
28 })
29 })
30 .unzip()
31 }
32
33 fn main() {}