Closed
Description
#![warn(rust_2021_incompatible_closure_captures)]
fn main() {
let a = ("hey".to_string(), "123".to_string());
let _ = || {
dbg!(a.0);
};
}
suggests:
let _ = || { let _ = &a;
dbg!(a.0);
};
It adds let _ = &a;
on the same line as the {
. There's also an extra space after the ;
there.
Instead, it'd be nice if it produced:
let _ = || {
let _ = &a;
dbg!(a.0);
};