Closed
Description
The following closures capture x by value both
playground
fn main() {
let c: fn() = {
let x = 1;
|| {
let _ = x;
}
};
let c: fn() = {
let x = 1;
|| match x {
_ => println!("Hello World!"),
}
};
}
yet we recognize the first as non capturing and the second as capturing by ref.