]> git.proxmox.com Git - rustc.git/blob - compiler/rustc_error_codes/src/error_codes/E0007.md
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / compiler / rustc_error_codes / src / error_codes / E0007.md
1 This error indicates that the bindings in a match arm would require a value to
2 be moved into more than one location, thus violating unique ownership. Code
3 like the following is invalid as it requires the entire `Option<String>` to be
4 moved into a variable called `op_string` while simultaneously requiring the
5 inner `String` to be moved into a variable called `s`.
6
7 Erroneous code example:
8
9 ```compile_fail,E0007
10 let x = Some("s".to_string());
11
12 match x {
13 op_string @ Some(s) => {}, // error: cannot bind by-move with sub-bindings
14 None => {},
15 }
16 ```
17
18 See also the error E0303.