1 // This tests passes in Polonius mode, so is skipped in the automated compare-mode.
2 // We will manually check it passes in Polonius tests, as we can't have a test here
3 // which conditionally passes depending on a test revision/compile-flags.
5 // ignore-compare-mode-polonius
10 fn get_self(&mut self) -> Option<&mut Self> {
14 fn new_self(&mut self) -> &mut Self {
18 fn trigger_bug(&mut self) {
19 let other = &mut (&mut *self);
21 *other = match (*other).get_self() {
23 None => (*other).new_self()
24 //~^ ERROR cannot borrow `**other` as mutable more than once at a time [E0499]