]> git.proxmox.com Git - rustc.git/blame - src/test/ui/nll/issue-62007-assign-const-index.stderr
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / nll / issue-62007-assign-const-index.stderr
CommitLineData
dc9dc135
XL
1error[E0499]: cannot borrow `list[_].value` as mutable more than once at a time
2 --> $DIR/issue-62007-assign-const-index.rs:23:21
3 |
4LL | fn to_refs<T>(mut list: [&mut List<T>; 2]) -> Vec<&mut T> {
5 | - let's call the lifetime of this reference `'1`
6...
7LL | result.push(&mut list[0].value);
fc512014 8 | ^^^^^^^^^^^^^^^^^^ `list[_].value` was mutably borrowed here in the previous iteration of the loop
dc9dc135
XL
9...
10LL | return result;
11 | ------ returning this value requires that `list[_].value` is borrowed for `'1`
12
13error[E0499]: cannot borrow `list[_].next` as mutable more than once at a time
14 --> $DIR/issue-62007-assign-const-index.rs:24:26
15 |
16LL | fn to_refs<T>(mut list: [&mut List<T>; 2]) -> Vec<&mut T> {
17 | - let's call the lifetime of this reference `'1`
18...
19LL | if let Some(n) = list[0].next.as_mut() {
c295e0f8 20 | ^^^^^^^^^^^^^^^^^^^^^
dc9dc135 21 | |
fc512014 22 | `list[_].next` was mutably borrowed here in the previous iteration of the loop
dc9dc135
XL
23 | argument requires that `list[_].next` is borrowed for `'1`
24
25error: aborting due to 2 previous errors
26
27For more information about this error, try `rustc --explain E0499`.