diff options
| author | bors <bors@rust-lang.org> | 2018-01-14 14:11:59 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-01-14 14:11:59 +0000 |
| commit | adc9d86363e0997f8378ea0260dfec3a9d09bcf0 (patch) | |
| tree | 17c17a9b7db959a54ec3407af798f9737427b9bb /src/test | |
| parent | 5d6f6e65ffb61a7acec28f1a08491de321e32be5 (diff) | |
| parent | 00ce7eed7d03b63a91c90d1fc5736b1f6450e239 (diff) | |
Auto merge of #47322 - nikomatsakis:nll-ice, r=pnkfelix
resolve type and region variables in "NLL dropck" Fixes #47022. r? @pnkfelix
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/nll/issue-47022.rs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/test/ui/nll/issue-47022.rs b/src/test/ui/nll/issue-47022.rs new file mode 100644 index 00000000000..a7362c34c17 --- /dev/null +++ b/src/test/ui/nll/issue-47022.rs @@ -0,0 +1,47 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// must-compile-successfully + +#![allow(warnings)] +#![feature(nll)] + +struct LoadedObject { + bodies: Vec<Body>, + color: Color, +} + +struct Body; + +#[derive(Clone)] +struct Color; + +struct Graphic { + color: Color, +} + +fn convert(objects: Vec<LoadedObject>) -> (Vec<Body>, Vec<Graphic>) { + objects + .into_iter() + .flat_map(|LoadedObject { bodies, color, .. }| { + bodies.into_iter().map(move |body| { + ( + body, + Graphic { + color: color.clone(), + }, + ) + }) + }) + .unzip() +} + +fn main() {} + |
