Skip to main content

MUTATING_LIST_METHODS

Constant MUTATING_LIST_METHODS 

Source
pub const MUTATING_LIST_METHODS: &[&str];
Expand description

The in-place List mutators (DQ18) lowered natively per target via desugared_list_mutating_method. These resolve in the checker to a Void return and require a mut receiver (enforced by the ownership pass), so each backend emits them in statement position as a value-less mutation:

  • rust / js / ts: recv.push(x)
  • python: recv.append(x)
  • go: recv = append(recv, x) (slice growth is reassignment in Go; the mut receiver guarantees recv is a valid lvalue — a let mut binding or a mutable field place)

append is Bock’s spelling alias for push; both lower identically.