Closed
Description
#![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<_>>());
}
error: internal compiler error: unexpected region for local data ReStatic
--> ...\test.rs:9:11
|
9 | .map(&|(f, _)| f)
| ^^^^^^^^^^
error: aborting due to previous error
rustc 1.26.0-nightly (06fa27d7c 2018-04-01)
binary: rustc
commit-hash: 06fa27d7c84a21af8449e06f3c50b243c4d5a7ad
commit-date: 2018-04-01
host: x86_64-pc-windows-gnu
release: 1.26.0-nightly
LLVM version: 6.0