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 1
1
//@ ignore-compare-mode-polonius (explicit revisions)
2
2
//@ revisions: nll polonius_next polonius
3
- //@ [polonius_next] check-pass
3
+ //@ [polonius_next] check-fail
4
4
//@ [polonius_next] compile-flags: -Zpolonius=next
5
5
//@ [polonius] check-pass
6
6
//@ [polonius] compile-flags: -Zpolonius
@@ -23,6 +23,7 @@ impl Foo {
23
23
Some ( s) => s,
24
24
None => ( * other) . new_self ( )
25
25
//[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]
26
27
} ;
27
28
28
29
let c = other;
You can’t perform that action at this time.
0 commit comments