Issue #1204: A tuple match subject with a list element moves out of a reference

Open and answer this issue on GitHub.

ready · opened 2026-11-03 · updated 2026-11-03 · 0 comments

A tuple match subject with a list element moves out of a reference.

Probe: xs: ref Vec[K], K not Copy:

match (xs[0], w) { (K::A(x), K::A(y)) => ..., _ => ... }

lowers to match (*index::get(&xs, 0), w); rustc refuses it (cannot move out of a shared reference).

To build

  1. Lend each part of a tuple subject on its own (check_core_flow_arm by_reference, emit_match_subject).
  2. A tests/compiler program with the probe.

Found by b40 (#1161); worked around there with a nested match, which goes when this is fixed.


Generated by Claude Code

Back to Open Issues