]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs
1 fn main() {
2     let mut _a = 3;
3     let b = &mut _a;
4     {
5         let c = &*b;
6         _a = 4; //~ ERROR cannot assign to `_a` because it is borrowed
7         drop(c);
8     }
9     drop(b);
10 }