Skip to content

Instantly share code, notes, and snippets.

@erickt
Created July 6, 2016 22:36
Show Gist options
  • Save erickt/4039add4a45e13598f8192e0f5e96f35 to your computer and use it in GitHub Desktop.
Save erickt/4039add4a45e13598f8192e0f5e96f35 to your computer and use it in GitHub Desktop.
error: unresolved name `y` [--explain E0425]
--> tests/test_generator.rs:13:9
|>
13 |> y + 1
|> ^
#[generator]
fn gen_ints() -> usize {
let x = {
yield_!(1);
let y = 2;
yield_!(2);
y + 1
};
yield_!(x);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment