mirror of
https://github.com/rust-lang/rust.git
synced 2025-09-28 05:34:45 +00:00

- linked-list cursor-like patterns - issue-46589 These are known-bugs for the polonius alpha, where they show the same imprecision as NLLs, but are supported by the old datalog implementation.
19 lines
807 B
Plaintext
19 lines
807 B
Plaintext
error[E0506]: cannot assign to `*node_ref` because it is borrowed
|
|
--> $DIR/iterating-updating-cursor-issue-63908.rs:43:5
|
|
|
|
|
LL | fn remove_last_node_iterative<T>(mut node_ref: &mut List<T>) {
|
|
| - let's call the lifetime of this reference `'1`
|
|
LL | loop {
|
|
LL | let next_ref = &mut node_ref.as_mut().unwrap().next;
|
|
| -------- `*node_ref` is borrowed here
|
|
...
|
|
LL | node_ref = next_ref;
|
|
| ------------------- assignment requires that `*node_ref` is borrowed for `'1`
|
|
...
|
|
LL | *node_ref = None;
|
|
| ^^^^^^^^^ `*node_ref` is assigned to here but it was already borrowed
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
For more information about this error, try `rustc --explain E0506`.
|