rust/tests/ui/nll/polonius/iterating-updating-cursor-issue-63908.nll.stderr
Rémy Rakic b99fe2b720 mark polonius=next's NLL imprecisions as known-bugs
- 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.
2025-08-08 15:15:09 +00:00

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`.