]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-partial-reinit-3.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / borrowck-partial-reinit-3.rs
1 use std::mem;
2
3 struct Test { f: usize }
4 impl Drop for Test {
5     fn drop(&mut self) {}
6 }
7
8 fn main() {
9     let mut x = (Test { f: 2 }, Test { f: 4 });
10     mem::drop(x.0);
11     x.0.f = 3;
12     //~^ ERROR assign of moved value: `x.0`
13 }