-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.NLL-completeWorking towards the "valid code works" goalWorking towards the "valid code works" goalT-langRelevant to the language teamRelevant to the language team
Milestone
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
Metadata
Metadata
Assignees
Labels
A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.NLL-completeWorking towards the "valid code works" goalWorking towards the "valid code works" goalT-langRelevant to the language teamRelevant to the language team