error[E07001]: referential transparency violated ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:6:9 │ 6 │ &mut (&s).v; │ ^^^^^^^^^^^ │ │ │ │ │ Immutable because of this position │ Invalid mutable borrow from an immutable reference error[E07001]: referential transparency violated ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:7:9 │ 7 │ &mut (&s.x).f; │ ^^^^^^^^^^^^^ │ │ │ │ │ Immutable because of this position │ Invalid mutable borrow from an immutable reference error[E07001]: referential transparency violated ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:10:9 │ 8 │ let sref = &s; │ -- Immutable because of this position 9 │ let xref = &s.x; 10 │ &mut sref.v; │ ^^^^^^^^^^^ Invalid mutable borrow from an immutable reference error[E07001]: referential transparency violated ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:11:9 │ 9 │ let xref = &s.x; │ ---- Immutable because of this position 10 │ &mut sref.v; 11 │ &mut xref.v; │ ^^^^^^^^^^^ Invalid mutable borrow from an immutable reference error[E03010]: unbound field ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:11:14 │ 11 │ &mut xref.v; │ ^^^^^^ Unbound field 'v' in '0x8675309::M::X' error[E07001]: referential transparency violated ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:15:9 │ 14 │ fun t2(s: &S, x: &X) { │ -- Immutable because of this position 15 │ x.f = x.f + 1; │ ^^^ Invalid mutable borrow from an immutable reference error[E07001]: referential transparency violated ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:16:9 │ 14 │ fun t2(s: &S, x: &X) { │ -- Immutable because of this position 15 │ x.f = x.f + 1; 16 │ s.x.f = s.x.f + 1 │ ^^^^^ Invalid mutable borrow from an immutable reference