summary refs log tree commit diff
path: root/src/test/ui/issues/issue-49579.rs
blob: 34f277af01e97b1e5e51774d1e2e0ff84b4105a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// compile-pass
// ignore-emscripten no i128 support

#![feature(nll)]

fn fibs(n: u32) -> impl Iterator<Item=u128> {
    (0 .. n)
    .scan((0, 1), |st, _| {
        *st = (st.1, st.0 + st.1);
        Some(*st)
    })
    .map(&|(f, _)| f)
}

fn main() {
    println!("{:?}", fibs(10).collect::<Vec<_>>());
}