Bytes(..) with a text result: rustc “temporary value dropped while borrowed”Open and answer this issue on GitHub.
ready · opened 2026-10-30 · updated 2026-10-30 · 0 comments
Found by the yaml lane (y1-tree-core, #928).
G::w(Bytes([97, 97])) catch { return }
with a rule whose result is text (a view into the input) fails in rustc with temporary value dropped while borrowed. let input = Bytes([97, 97]) first, then G::w(input), works. The compiler should keep the temporary (ADR-353 D8-D10 keep) or refuse with an NK error naming the fix; it must not reach rustc.
To build
tests/compiler/tests/grammar_*.nika.