E0046

E0046#

Warning name: unused_rest_mark

Useless .. in struct or constructor pattern.

.. can be used to ignore unmatched fields in struct pattern, or ignore unmatched labelled arguments in constructor pattern. But if all fields/labelled arguments are already matched, the .. is useless, and this warning will be emitted.

Erroneous example#

///|
struct Point {
  x : Int
  y : Int
}

///|
fn f(p : Point) -> Unit {
  let { x, y, .. } = p
  println(x + y)
}

///|
test {
  f({ x: 1, y: 2 })
}