Closed
Description
fn main() {
let x: u8 = 5;
const Y: u8 = x;
}
results in:
error[E0434]: can't capture dynamic environment in a fn item
--> src/main.rs:3:19
|
3 | const Y: u8 = x;
| ^
|
= help: use the `|| { ... }` closure form instead
error: aborting due to previous error
(which of course doesn't work — actually carrying out the suggestion results in the same suggestion).