From e6284f2488ea2e260889c0efa7cf8ecbf9eddcdc Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Tue, 27 Oct 2026 23:40:31 -0700 Subject: [PATCH] chore(quest): plan the take_apart crash #130's ICE report recorded Co-Authored-By: Claude Opus 5.5 --- quest/m2/README.md | 1 + quest/m2/ts-scalar-ice.md | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 quest/m2/ts-scalar-ice.md diff --git a/quest/m2/README.md b/quest/m2/README.md index 572d2f664..4977d9a8a 100644 --- a/quest/m2/README.md +++ b/quest/m2/README.md @@ -27,6 +27,7 @@ The fork's feature quests folded into the [exporter](/quest/m1/ffi-export/README ## Required - [A tuple's parts read after their variables change](/quest/m2/ts-swap-parts.md) - `(a, b) = (b, a)` swaps instead of copying one into both +- [Byte-slice locals that crash the translator](/quest/m2/ts-scalar-ice.md) - `take_apart` never reaches the arm `find_scalars` promised it wouldn't - [Fixture cases by name](/quest/m2/ts-harness-names.md) - adding a harness case never renumbers another - [Byte slices without objects](/quest/m2/ts-byte-views/README.md) - reading through a translated cursor allocates no object per read - [Drop in the TypeScript translator](/quest/m2/ts-drop.md) - every value that drops in moq-net and kio drops where Rust drops it diff --git a/quest/m2/ts-scalar-ice.md b/quest/m2/ts-scalar-ice.md new file mode 100644 index 000000000..c45b02f31 --- /dev/null +++ b/quest/m2/ts-scalar-ice.md @@ -0,0 +1,21 @@ +# [S] Byte-slice locals that crash the translator + +## Goal + +rust2-ts never panics in `Fx::take_apart` (`ts/src/lower/mir/scalar.rs`): every value +`find_scalars` holds as parts can be taken apart, or `find_scalars` declines it, proven by a +fixture that crashed before the fix and by differential tests against native Rust. + +## Plan + +Decided with the maintainer on 2026-10-27: a rustc ICE report that +[#130](https://github.com/kixelated/rust2/pull/130) committed by accident records +`take_apart` reaching `unreachable!("checked by find_scalars")`. The input is lost, and +`main` still has the arm (`Shape::Enum`), so reproduce it first: likely an enum-shaped value +taken apart where `find_scalars` assumed none, from the codec, moq's model census, or a +fixture variant. + +- Fix it where `find_scalars` and `take_apart` disagree, and check the file's other + `checked by find_scalars` assumptions for the same gap. + +Public API: none, unless the fix changes the translator's output.