summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/closure-in-impl-trait.rs
blob: 3593a1d5c8d10970916b5d9b9e8022882c34ab40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// run-pass
#![allow(unused_must_use)]
fn bug<T>() -> impl Iterator<Item = [(); { |x: u32| { x }; 4 }]> {
    std::iter::empty()
}

fn ok<T>() -> Box<dyn Iterator<Item = [(); { |x: u32| { x }; 4 }]>> {
    Box::new(std::iter::empty())
}

fn main() {
    for _item in ok::<u32>() {}
    for _item in bug::<u32>() {}
}