标签: rust closures borrow-checker
是什么让以下代码能够编译?
#[derive(Debug)] struct Abc { x: i32, } fn main() { let mut n = Abc { x: 20 }; let c = &move || { println!("{:?}", n); }; (*c)(); n.x = 12; //-> But n is moved?? }