]> git.proxmox.com Git - rustc.git/blame - src/test/ui/borrowck/move-in-pattern-mut.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / borrowck / move-in-pattern-mut.rs
CommitLineData
f035d41b
XL
1// Issue #63988
2#[derive(Debug)]
3struct S;
4fn foo(_: Option<S>) {}
5
6enum E {
7 V {
8 s: S,
9 }
10}
11fn bar(_: E) {}
12
13fn main() {
14 let s = Some(S);
15 if let Some(mut x) = s {
16 x = S;
17 }
1b1a35ee 18 foo(s); //~ ERROR use of partially moved value: `s`
f035d41b
XL
19 let mut e = E::V { s: S };
20 let E::V { s: mut x } = e;
21 x = S;
1b1a35ee 22 bar(e); //~ ERROR use of partially moved value: `e`
f035d41b 23}