]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/reassignment_immutable_fields.rs
Rollup merge of #106570 - Xaeroxe:div-duration-tests, r=JohnTitor
[rust.git] / tests / ui / borrowck / reassignment_immutable_fields.rs
1 // This test is currently disallowed, but we hope someday to support it.
2 //
3 // FIXME(#21232)
4
5 fn assign_both_fields_and_use() {
6     let x: (u32, u32);
7     x.0 = 1; //~ ERROR
8     x.1 = 22;
9     drop(x.0);
10     drop(x.1);
11 }
12
13 fn assign_both_fields_the_use_var() {
14     let x: (u32, u32);
15     x.0 = 1; //~ ERROR
16     x.1 = 22;
17     drop(x);
18 }
19
20 fn main() { }