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:
#![allow(unused)]
#![feature(bindings_after_at)]
fn main() {
let x = Some("s".to_string());
match x {
op_string @ Some(s) => {}, // error: use of moved value
None => {},
}
} See also the error E0303.
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/error_codes/E0007.html