rust/tests/ui/suggestions/option-content-move2.rs
2023-01-11 09:32:08 +00:00

16 lines
306 B
Rust

struct NotCopyable;
fn func<F: FnMut() -> H, H: FnMut()>(_: F) {}
fn parse() {
let mut var = None;
func(|| {
// Shouldn't suggest `move ||.as_ref()` here
move || {
//~^ ERROR: cannot move out of `var`
var = Some(NotCopyable);
}
});
}
fn main() {}