File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1+ error[E0499]: cannot borrow `**other` as mutable more than once at a time
2+ --> $DIR/issue-46589.rs:24:21
3+ |
4+ LL | *other = match (*other).get_self() {
5+ | -------- first mutable borrow occurs here
6+ LL | Some(s) => s,
7+ LL | None => (*other).new_self()
8+ | ^^^^^^^^
9+ | |
10+ | second mutable borrow occurs here
11+ | first borrow later used here
12+
13+ error: aborting due to 1 previous error
14+
15+ For more information about this error, try `rustc --explain E0499`.
Original file line number Diff line number Diff line change 11//@ ignore-compare-mode-polonius (explicit revisions)
22//@ revisions: nll polonius_next polonius
3- //@ [polonius_next] check-pass
3+ //@ [polonius_next] check-fail
44//@ [polonius_next] compile-flags: -Zpolonius=next
55//@ [polonius] check-pass
66//@ [polonius] compile-flags: -Zpolonius
@@ -23,6 +23,7 @@ impl Foo {
2323 Some ( s) => s,
2424 None => ( * other) . new_self ( )
2525 //[nll]~^ ERROR cannot borrow `**other` as mutable more than once at a time [E0499]
26+ //[polonius_next]~^^ ERROR cannot borrow `**other` as mutable more than once at a time [E0499]
2627 } ;
2728
2829 let c = other;
You can’t perform that action at this time.
0 commit comments