]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0007.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0007.md
1 #### Note: this error code is no longer emitted by the compiler.
2
3 This error indicates that the bindings in a match arm would require a value to
4 be moved into more than one location, thus violating unique ownership. Code
5 like the following is invalid as it requires the entire `Option<String>` to be
6 moved into a variable called `op_string` while simultaneously requiring the
7 inner `String` to be moved into a variable called `s`.
8
9 Erroneous code example:
10
11 ```compile_fail,E0382
12 #![feature(bindings_after_at)]
13
14 let x = Some("s".to_string());
15
16 match x {
17     op_string @ Some(s) => {}, // error: use of moved value
18     None => {},
19 }
20 ```
21
22 See also the error E0303.