Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
26e4157
chore(quest): claim quest/m3/ts-iter-adaptor-debug.md
kixelated Nov 3, 2026
c49160d
feat(ts): translate Debug of std's iterator adaptors
kixelated Nov 3, 2026
c0d41b0
fix(ts): write an adaptor's borrowed or own iterator as Rust holds it
kixelated Nov 3, 2026
e3e118b
Merge remote-tracking branch 'origin/main' into quest/m3/ts-iter-adap…
kixelated Nov 3, 2026
f72df38
test(ts): update a snapshot main's slices added for the exact fused flag
kixelated Nov 3, 2026
c6d21ab
fix(ts): write an adaptor's boxed or borrowed iterator as what it poi…
kixelated Nov 3, 2026
3536711
Merge origin/main into quest/m3/ts-iter-adaptor-debug, and translate …
kixelated Nov 3, 2026
1404ed3
test(ts): update a snapshot main's ends added for the exact fused flag
kixelated Nov 3, 2026
c4f18b4
fix(ts): write an adaptor's own iterator as its next reads it, throug…
kixelated Nov 3, 2026
93364cb
fix(ts): find a borrowed own iterator's place through any references …
kixelated Nov 3, 2026
6b85d2a
Merge remote-tracking branch 'origin/main' into quest/m3/ts-iter-adap…
kixelated Nov 3, 2026
b9b955d
test(ts): update snapshots main's edits and strs added for the exact …
kixelated Nov 3, 2026
a302191
fix(ts): write an adaptor's wrapped iterator as peel_iter holds it
kixelated Nov 3, 2026
b504eb1
Merge remote-tracking branch 'origin/main' into quest/m3/ts-iter-adap…
kixelated Nov 3, 2026
cf6c641
Merge remote-tracking branch 'origin/main' into quest/m3/ts-iter-adap…
kixelated Nov 3, 2026
9dd26af
test(ts): update the clones snapshot main added for the exact fused flag
kixelated Nov 3, 2026
99db3fa
Merge remote-tracking branch 'origin/main' into quest/m3/ts-iter-adap…
kixelated Nov 3, 2026
a7c30ee
Merge remote-tracking branch 'origin/main' into quest/m3/ts-iter-adap…
kixelated Nov 3, 2026
a0a2d51
Merge remote-tracking branch 'origin/main' into quest/m3/ts-iter-adap…
kixelated Nov 3, 2026
e230f3f
Merge remote-tracking branch 'origin/main' into quest/m3/ts-iter-adap…
kixelated Nov 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion quest/m3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ generic std gap is planned here even when moq never calls it.
- [Waiting: drop the lang fixture's mul_add allowance](/quest/m3/ts-fma-allowance.md) - the differential fails on any `mul_add` difference again once wasm32's `fma` rounds exactly
- [Waiting: type-check in process with tsrs](/quest/m3/ts-tsrs.md) - rust2-ts checks bindings through tsrs instead of `tsc` once it is a stable library
- [A slice of one byte behind any &mut](/quest/m3/ts-slice-of-one.md) - `slice::from_mut` and `array::from_mut` of a `&mut u8` translate
- [Debug of std's iterator adaptors](/quest/m3/ts-iter-adaptor-debug.md) - `Debug` of `Map`, `Zip`, `Peekable`, `DecodeUtf16`, and the other adaptors writes what std's does
- [Waiting: a slice object for a mutable part of other values](/quest/m3/ts-slice-object.md) - waits on a moq profile showing the `Proxy` view's traps matter, then decides on an `rt.ByteSlice`-like form
- [Port the workflow guard to kixelated/quest](/quest/m3/quest-workflow-guard.md) - quest's environment guard parses YAML as this repository's does
- [An adaptor of the crate's own iterator held as a value](/quest/m3/ts-own-iter-value.md) - `map` and the other adaptors of a fieldless enum that implements `Iterator`, taken by value, translate
- [Debug of std's other iterators](/quest/m3/ts-iter-source-debug.md) - `Debug` of `Once`, `Repeat`, `FromFn`, an array's `IntoIter`, and std's other iterators writes what std's does
- [A vector keeps the capacity its pushes grew as it shrinks](/quest/m3/ts-vec-clear-capacity.md) - every step that drops a pushed `Vec`'s length keeps its capacity, as std guarantees
- [A vector's exact capacity as it shrinks](/quest/m3/ts-vec-exact-capacity.md) - a deque made from a `Vec` splits its slices where std's does
- [A B-tree's searches call Ord as std's do](/quest/m3/ts-btree-search-order.md) - a B-tree's lookups and inserts call a key's own `Ord` in std's order and number
Expand Down
25 changes: 0 additions & 25 deletions quest/m3/ts-iter-adaptor-debug.md

This file was deleted.

18 changes: 18 additions & 0 deletions quest/m3/ts-iter-source-debug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# [S] Debug of std's other iterators

## Goal

[rust2-ts](/ts/README.md) translates `Debug` of std's iterators that still have no
mapping, so an adaptor over one writes what std's does instead of being refused:
iterator sources such as `Once`, `Repeat`, `RepeatN`, `FromFn`, `Successors`,
`OnceWith`, and `RepeatWith`, an array's and an `Option`'s or `Result`'s iterators, and
`str`'s iterators other than `Chars` and `Bytes`. Proven by differential tests against
native Rust.

## Plan

Found while translating `Debug` of the adaptors: `char::decode_utf16([..])` refuses at
its span, as `Debug` of `array::IntoIter` has no mapping. Read each of std's impls, which
write private fields of their own (`Once { inner: IntoIter { inner: Item { opt } } }`),
and survey which share a shape before choosing how the runtime writes them, as
`iter_debug` and `adaptor_debug` in `src/lower/fmt.rs` do.
16 changes: 16 additions & 0 deletions quest/m3/ts-own-iter-value.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [S] An adaptor of the crate's own iterator held as a value

## Goal

[rust2-ts](/ts/README.md) translates an adaptor taking by value an iterator of the
crate's own whose JS value is copied, as a fieldless enum's is, such as
`Toggle::Ready.map(f)`, so its `next` reads and writes the iterator's place. Proven by
differential tests against native Rust.

## Plan

Found while translating `Debug` of std's adaptors: `toggle.map(|x| x)` of a fieldless
enum that implements `Iterator` fails to type-check, as `rt.iterFrom` is given the enum's
value where its `next` takes a `rt.Place`; `(&mut toggle).map(|x| x)` translates. Find
where `into_iter` of an owned iterator of the crate's own makes its source, and give it
the place its `next` reads through.
6 changes: 5 additions & 1 deletion ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ collections writes their items in the order each iterates, a hash map's or set's
and of their iterators and `Chars` the items each has left, in std's wrapper; a deque's
`Iter` and `IterMut` write the two slices of its buffer they have left, swapped as std's
swap them, and its `Drain` its counts; a list's `Iter` and `IterMut` write what is left and
its length, as std's do. `Debug` of `Bound`, `Ordering`, `Reverse`, and `ControlFlow` is
its length, as std's do. `Debug` of std's iterator adaptors, `Map` through `Flatten`,
`DecodeUtf16`, and a `str`'s escapes, writes their fields as std's does, each iterator it
wraps by its own `Debug`, no closure, and the state each keeps, such as what a `Peekable` peeked, what a
`Skip` has left to skip, and the countdown std's `StepBy` of a small unsigned range keeps
in its end. `Debug` of `Bound`, `Ordering`, `Reverse`, and `ControlFlow` is
their derived one, whichever way each is held, and a guard of a cell or a lock, mapped or
not, writes what it lends by its own `Debug` and `Display`. `Debug` of a `Cell`, a
`RefCell`, a `Mutex`, and an `RwLock` writes what each holds, or `<borrowed>` and
Expand Down
Loading