2021-06-27 01:22:46 -05:00
|
|
|
// edition:2021
|
2020-12-02 21:25:22 -06:00
|
|
|
|
|
|
|
|
|
|
|
enum SingleVariant {
|
|
|
|
Point(i32, i32),
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut point = SingleVariant::Point(10, -10);
|
|
|
|
|
|
|
|
let c = || {
|
2021-02-02 20:07:52 -06:00
|
|
|
let SingleVariant::Point(ref mut x, _) = point;
|
|
|
|
*x += 1;
|
2020-12-02 21:25:22 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
let b = c;
|
|
|
|
let a = c; //~ ERROR use of moved value: `c` [E0382]
|
|
|
|
}
|