mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
14 lines
231 B
Rust
14 lines
231 B
Rust
use std::mem;
|
|
|
|
struct Test { f: usize }
|
|
impl Drop for Test {
|
|
fn drop(&mut self) {}
|
|
}
|
|
|
|
fn main() {
|
|
let mut x = (Test { f: 2 }, Test { f: 4 });
|
|
mem::drop(x.0);
|
|
x.0.f = 3;
|
|
//~^ ERROR assign of moved value: `x.0`
|
|
}
|