]> git.lizzy.rs Git - rust.git/blob - tests/ui/error-codes/E0506.stderr
Rollup merge of #106707 - ehuss:remove-dupe-sha-1, r=Mark-Simulacrum
[rust.git] / tests / ui / error-codes / E0506.stderr
1 error[E0506]: cannot assign to `fancy_num` because it is borrowed
2   --> $DIR/E0506.rs:8:5
3    |
4 LL |     let fancy_ref = &fancy_num;
5    |                     ---------- borrow of `fancy_num` occurs here
6 LL |     fancy_num = FancyNum { num: 6 };
7    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
8 LL |
9 LL |     println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);
10    |                                                 ------------- borrow later used here
11
12 error: aborting due to previous error
13
14 For more information about this error, try `rustc --explain E0506`.