]> git.proxmox.com Git - rustc.git/blame - src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-single-variant-diagnostics.rs
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / test / ui / closures / 2229_closure_analysis / diagnostics / closure-origin-single-variant-diagnostics.rs
CommitLineData
5869c6ff
XL
1#![feature(capture_disjoint_fields)]
2//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
3//~| `#[warn(incomplete_features)]` on by default
4//~| see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
5
6// Check that precise paths are being reported back in the error message.
7
8enum SingleVariant {
9 Point(i32, i32),
10}
11
12fn main() {
13 let mut point = SingleVariant::Point(10, -10);
14
15 let c = || {
6a06907d
XL
16 let SingleVariant::Point(ref mut x, _) = point;
17 *x += 1;
5869c6ff
XL
18 };
19
20 let b = c;
21 let a = c; //~ ERROR use of moved value: `c` [E0382]
22}