diff options
Diffstat (limited to '')
-rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0007.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0007.md b/compiler/rustc_error_codes/src/error_codes/E0007.md new file mode 100644 index 000000000..2c22b86af --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0007.md @@ -0,0 +1,22 @@ +#### Note: this error code is no longer emitted by the compiler. + +This error indicates that the bindings in a match arm would require a value to +be moved into more than one location, thus violating unique ownership. Code +like the following is invalid as it requires the entire `Option<String>` to be +moved into a variable called `op_string` while simultaneously requiring the +inner `String` to be moved into a variable called `s`. + +Erroneous code example: + +```compile_fail,E0382 +#![feature(bindings_after_at)] + +let x = Some("s".to_string()); + +match x { + op_string @ Some(s) => {}, // error: use of moved value + None => {}, +} +``` + +See also the error E0303. |