mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
18 lines
310 B
Rust
18 lines
310 B
Rust
fn main() {
|
|
let x = vec![1];
|
|
let y = x;
|
|
x; //~ ERROR use of moved value
|
|
|
|
let x = vec![1];
|
|
let mut y = x;
|
|
x; //~ ERROR use of moved value
|
|
|
|
let x = (Some(vec![1]), ());
|
|
|
|
match x {
|
|
(Some(y), ()) => {},
|
|
_ => {},
|
|
}
|
|
x; //~ ERROR use of partially moved value
|
|
}
|