From eec77d3db6f75445cf860e8b363f9f0d0ac7ad4b Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Fri, 30 Oct 2026 20:38:04 -0700 Subject: [PATCH 1/3] chore(quest): claim quest/m3/ts-iter-cycle.md Quest-Claim: ec5ea6db4c23475c From 296939e0a326268a3881ca0d45f58ed2cba632b7 Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Fri, 30 Oct 2026 21:16:57 -0700 Subject: [PATCH 2/3] feat(ts): translate Iterator::cycle rt.iterCycle holds the iterator as std's Cycle does, with a clone of it made by the rt.Clones the translation gives, and clones that again each time the one it reads ends. Its next, size_hint, try_fold, and advance_by follow std's at the pinned toolchain, and a count of one that holds a Cycle goes through rt.ownedCount, which advances a Take as std's Take::count does. Co-Authored-By: Claude Opus 5.5 --- quest/m3/README.md | 1 - quest/m3/ts-iter-cycle.md | 17 - ts/README.md | 6 +- ts/fixtures/lang/expected/core/option.ts | 22 + ts/fixtures/lang/expected/cycles.Countdown.ts | 23 + ts/fixtures/lang/expected/cycles.Logged.ts | 49 + ts/fixtures/lang/expected/cycles.ts | 1227 +++++++++++++++++ ts/fixtures/lang/expected/harness.ts | 3 +- ts/fixtures/lang/src/cycles.rs | 297 ++++ ts/fixtures/lang/src/harness.rs | 3 +- ts/fixtures/lang/src/lib.rs | 1 + ts/fixtures/reject/census.md | 539 ++++---- ts/fixtures/reject/expected.txt | 181 ++- ts/fixtures/reject/src/lib.rs | 5 - ts/fixtures/reject/ts.toml | 1 - ts/runtime/rt/iter.ts | 94 ++ ts/src/lower/iter.rs | 23 +- 17 files changed, 2096 insertions(+), 396 deletions(-) delete mode 100644 quest/m3/ts-iter-cycle.md create mode 100644 ts/fixtures/lang/expected/cycles.Countdown.ts create mode 100644 ts/fixtures/lang/expected/cycles.Logged.ts create mode 100644 ts/fixtures/lang/expected/cycles.ts create mode 100644 ts/fixtures/lang/src/cycles.rs diff --git a/quest/m3/README.md b/quest/m3/README.md index 3194dd105..e8e9638a0 100644 --- a/quest/m3/README.md +++ b/quest/m3/README.md @@ -32,5 +32,4 @@ generic std gap is planned here even when moq never calls it. - [Cow of a slice, and Wrapping](/quest/m3/ts-cow-slices.md) - `Cow<[T]>` and `Wrapping` translate, `PartialEq` included - [LinkedList](/quest/m3/ts-linked-list.md) - `LinkedList` and its methods translate - [Zip's next_back in constant time](/quest/m3/ts-zip-back.md) - a reversed zip of random-access iterators skips the longer side's excess at once -- [Cycling std's iterators](/quest/m3/ts-iter-cycle.md) - `Iterator::cycle` translates, cloning its iterator each time it ends - [Comparing iterators](/quest/m3/ts-iter-compare.md) - `eq`, `cmp`, `lt`, and the rest of `Iterator`'s comparisons translate against any `IntoIterator` diff --git a/quest/m3/ts-iter-cycle.md b/quest/m3/ts-iter-cycle.md deleted file mode 100644 index 758450aec..000000000 --- a/quest/m3/ts-iter-cycle.md +++ /dev/null @@ -1,17 +0,0 @@ -# [S] Cycling std's iterators - -## Goal - -`Iterator::cycle` translates, proven by a differential test against native Rust, which -the reject fixture's `cycled` refuses today. - -## Plan - -Found by [#322](https://github.com/moq-dev/rust2/pull/322), which gave each `rt.Iter` -that std implements `Clone` for a `clone(h)` and the translation its `rt.Clones`. std's -`Cycle` holds its iterator as it was and a clone it reads, which it clones again each -time that ends, so an adaptor of the runtime's can hold the original and its `Clones` -and clone it the same way. Planned without a moq consumer, under the maintainer's -2026-10-27 decision that rust2 aims to support all of std. - -Public API: the translator's output. diff --git a/ts/README.md b/ts/README.md index 41dbec868..abac475b7 100644 --- a/ts/README.md +++ b/ts/README.md @@ -246,7 +246,9 @@ owns its items holds, an adaptor's closure, or the crate's own iterator, it clon what the translation gives it, as `it.clone({ v: Item.clone$Clone })`. A closure clones as Rust clones its captures: one that writes none of them, each of which only copies or clones as itself, is its own clone, and another whose clone translation reaches is made by a -function of its captures, which makes the clone again of theirs, in order. +function of its captures, which makes the clone again of theirs, in order. `cycle` takes +the same clones, as `rt.iterCycle(it, { v: Item.clone$Clone })`, by which it clones its +iterator as it is made and again each time a clone ends. A `str` is a JS string, which is UTF-16: `chars` steps by code point, and a search by a `char`, a `&str`, a predicate, or an array or slice of chars, as in `rt.strSplit(s, "/")`, takes the text or the @@ -675,7 +677,7 @@ that can be `undefined`, a collection's `capacity`, looking up a key by another type it borrows as through the crate's own `Borrow`, a `&mut` to a value JS copies that std makes, other than a map's, or hands a closure, as `iter_mut` and `and_modify` do, one into a `Result`'s payload passed on or kept, `Hasher::write` of bytes, the adaptors -without a mapping in `src/lower/iter.rs` (such as `cycle`, `unzip`, and `partition`), an +without a mapping in `src/lower/iter.rs` (such as `unzip` and `partition`), an own `impl Iterator` with `next_back`, `len`, or another provided method of its own, a pointer's address (`{:p}`), `write!` with a placeholder into the crate's own `fmt::Write`, a `str` pattern other than a diff --git a/ts/fixtures/lang/expected/core/option.ts b/ts/fixtures/lang/expected/core/option.ts index 2ba0a95bf..9a2537d4d 100644 --- a/ts/fixtures/lang/expected/core/option.ts +++ b/ts/fixtures/lang/expected/core/option.ts @@ -16,6 +16,7 @@ import type * as counts_Noisy from "../counts.Noisy.ts"; import type * as RcNode from "../counts.RcNode.ts"; import type * as RcShared from "../counts.RcShared.ts"; import type * as Twin from "../counts.Twin.ts"; +import type * as cycles_Logged from "../cycles.Logged.ts"; import * as Made from "../defaults.Made.ts"; import type * as Shape from "../dyns.Shape.ts"; import * as Named from "../edits.Named.ts"; @@ -308,6 +309,13 @@ export function map$003seos(self: slices_Item.Item | undefined, f: (a0: slices_I return f(self); } +export function map$1u07cey(self: cycles_Logged.Logged | undefined, f: (a0: cycles_Logged.Logged) => rt.u8): rt.u8 | undefined { + if (self === undefined) { + return undefined; + } + return f(self); +} + export function map$1u8sh4f(self: Named.Named | undefined, _: (a0: Named.Named) => Named.Named[]): Named.Named[] | undefined { if (self === undefined) { return undefined; @@ -542,6 +550,13 @@ export function map$0gl6wke(self: [rt.usize, string] | undefined, f: (a0: [rt.us return f(self); } +export function map$05nbzug(self: rt.usize | undefined, f: (a0: rt.usize) => rt.u8): rt.u8 | undefined { + if (self === undefined) { + return undefined; + } + return f(self); +} + export function inspect$0di0vx1(self: rt.u8 | undefined, f: (a0: rt.u8) => undefined): rt.u8 | undefined { if (self !== undefined) { f(self); @@ -626,6 +641,13 @@ export function mapOr$1yabfom(self: Logged.Logged | undefined, default_: rt.u8, return Logged.id(self); } +export function mapOr$0djjvgl(self: cycles_Logged.Logged | undefined, default_: rt.u8, f: (a0: cycles_Logged.Logged) => rt.u8): rt.u8 { + if (self === undefined) { + return default_; + } + return f(self); +} + export function mapOr$1ybqvup(self: Meters.Meters | undefined, default_: rt.u64, f: (a0: Meters.Meters) => rt.u64): rt.u64 { if (self === undefined) { return default_; diff --git a/ts/fixtures/lang/expected/cycles.Countdown.ts b/ts/fixtures/lang/expected/cycles.Countdown.ts new file mode 100644 index 000000000..f687d1876 --- /dev/null +++ b/ts/fixtures/lang/expected/cycles.Countdown.ts @@ -0,0 +1,23 @@ +// Generated by rust2-ts. Do not edit. + +import * as rt from "./rt.ts"; + +export function clone$Clone(self: Countdown): Countdown { + return { _0: self._0 }; +} + +/** The crate's own iterator, which `cycle` clones by its `Clone`. */ +export interface Countdown { + _0: rt.u8; +} + +export function next$Iterator(self: Countdown): rt.u8 | rt.Done { + const _2: rt.u8 | undefined = rt.u8CheckedSub(self._0, 1); + if (_2 !== undefined) { + self._0 = _2; + return self._0; + } + return rt.DONE; +} + +//# sourceMappingURL=cycles.Countdown.ts.map diff --git a/ts/fixtures/lang/expected/cycles.Logged.ts b/ts/fixtures/lang/expected/cycles.Logged.ts new file mode 100644 index 000000000..bb3066c83 --- /dev/null +++ b/ts/fixtures/lang/expected/cycles.Logged.ts @@ -0,0 +1,49 @@ +// Generated by rust2-ts. Do not edit. + +import * as rt from "./rt.ts"; + +/** + * Logs its id as it drops, and as it is cloned, the id with the high bit set: its clone's + * id is one more. + */ +export class Logged { + id: rt.u8; + log: rt.Arc>; + + constructor(id: rt.u8, log: rt.Arc>) { + this.id = id; + this.log = log; + } + + [Symbol.dispose](): void { + drop$Drop(this); + this.log[Symbol.dispose](); + } +} + +export function id(self: Logged): rt.u8 { + return self.id; +} + +/** Logs `x`, as a closure that holds it is called. */ +export function called(self: Logged, x: rt.u8): rt.u8 { + const _6: rt.RefCell = rt.refCellBorrowMut(self.log.value); + rt.byteVecPush(_6.value, 64 | (x & 63)); + rt.refMutRelease(_6); + return x ^ self.id; +} + +export function clone$Clone(self: Logged): Logged { + const _5: rt.RefCell = rt.refCellBorrowMut(self.log.value); + rt.byteVecPush(_5.value, 128 | self.id); + rt.refMutRelease(_5); + return new Logged(rt.u8WrappingAdd(self.id, 1), rt.arcClone(self.log)); +} + +export function drop$Drop(self: Logged): void { + const _5: rt.RefCell = rt.refCellBorrowMut(self.log.value); + rt.byteVecPush(_5.value, self.id); + rt.refMutRelease(_5); +} + +//# sourceMappingURL=cycles.Logged.ts.map diff --git a/ts/fixtures/lang/expected/cycles.ts b/ts/fixtures/lang/expected/cycles.ts new file mode 100644 index 000000000..2e6ab5066 --- /dev/null +++ b/ts/fixtures/lang/expected/cycles.ts @@ -0,0 +1,1227 @@ +// Generated by rust2-ts. Do not edit. + +import * as rt from "./rt.ts"; +import { thenSome$0d5am30 } from "./core/bool.ts"; +import { unwrapOr$0r2bmpr, unwrapOr$1rbuegs, map$1u07cey, map$05nbzug, mapOr$0djjvgl, mapOr$1surhce, mapOr$02k4ito, mapOr$06gg5x7 } from "./core/option.ts"; +import * as Countdown from "./cycles.Countdown.ts"; +import * as Logged from "./cycles.Logged.ts"; + +/** Puts what was logged since the last flush, after a marker. */ +export function flush(log: rt.RefCell, out: rt.ByteVec): void { + rt.byteVecPush(out, 253); + const _8: rt.RefCell = rt.refCellBorrowMut(log); + rt.iterExtendBytes(out, rt.byteVecDrain(_8.value, undefined), "fold", true); + rt.refMutRelease(_8); +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$Chain_Iter_u8_Take_Rev_Iter_u8_cycles_closure1(it: rt.Iter, steps: rt.ByteSlice, put: (a0: rt.u8) => rt.u8, out: rt.ByteVec): void { + let item!: rt.u8 | undefined; + const it2: rt.Iter = rt.iterCycle(it); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: rt.u8) => boolean = (_2: rt.u8): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: rt.u8): boolean => { + return nth(item3); + }); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: rt.u8): boolean => { + return nth(item2); + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$1surhce(item, 238, put)); + } +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$Countdown_cycles_closure4(it: Countdown.Countdown, steps: rt.ByteSlice, put: (a0: rt.u8) => rt.u8, out: rt.ByteVec): void { + let item!: rt.u8 | undefined; + const it2: rt.Iter = rt.iterCycle(rt.iterFrom(it, (it: Countdown.Countdown) => Countdown.next$Iterator(it)), { v: Countdown.clone$Clone }); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: rt.u8) => boolean = (_2: rt.u8): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: rt.u8): boolean => { + return nth(item3); + }); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: rt.u8): boolean => { + return nth(item2); + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$1surhce(item, 238, put)); + } +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$Cycle_IntoIter_Logged_owned_closure6(it: rt.Iter, steps: rt.ByteSlice, put: (a0: Logged.Logged) => rt.u8, out: rt.ByteVec): void { + let item!: Logged.Logged | undefined; + const it2: rt.Iter = rt.iterCycle(it, { i: { v: Logged.clone$Clone } }); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: Logged.Logged) => boolean = (_2: Logged.Logged): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n, rt.drop); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: Logged.Logged): boolean => { + return nth(item3); + }, rt.drop); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: Logged.Logged): boolean => { + const _02: boolean = nth(item2); + item2[Symbol.dispose](); + return _02; + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$0djjvgl(item, 238, put)); + } + rt.drop(it2); +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$Cycle_Iter_u8_cycles_closure1(it: rt.Iter, steps: rt.ByteSlice, put: (a0: rt.u8) => rt.u8, out: rt.ByteVec): void { + let item!: rt.u8 | undefined; + const it2: rt.Iter = rt.iterCycle(it); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: rt.u8) => boolean = (_2: rt.u8): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: rt.u8): boolean => { + return nth(item3); + }); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: rt.u8): boolean => { + return nth(item2); + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$1surhce(item, 238, put)); + } +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$Empty_u8_cycles_closure3(it: rt.Iter, steps: rt.ByteSlice, put: (a0: rt.u8) => rt.u8, out: rt.ByteVec): void { + let item!: rt.u8 | undefined; + const it2: rt.Iter = rt.iterCycle(it); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: rt.u8) => boolean = (_2: rt.u8): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: rt.u8): boolean => { + return nth(item3); + }); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: rt.u8): boolean => { + return nth(item2); + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$1surhce(item, 238, put)); + } +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$Enumerate_Iter_u8_cycles_closure9(it: rt.Iter<[rt.usize, rt.u8]>, steps: rt.ByteSlice, put: (a0: [rt.usize, rt.u8]) => rt.u8, out: rt.ByteVec): void { + let item!: [rt.usize, rt.u8] | undefined; + const it2: rt.Iter<[rt.usize, rt.u8]> = rt.iterCycle(it); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: [rt.usize, rt.u8]) => boolean = (_2: [rt.usize, rt.u8]): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: [rt.usize, rt.u8]): boolean => { + return nth(item3); + }); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: [rt.usize, rt.u8]): boolean => { + return nth(item2); + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$06gg5x7(item, 238, put)); + } +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$Filter_Iter_u8_cycles_closure8_cycles_closure1(it: rt.Iter, steps: rt.ByteSlice, put: (a0: rt.u8) => rt.u8, out: rt.ByteVec): void { + let item!: rt.u8 | undefined; + const it2: rt.Iter = rt.iterCycle(it); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: rt.u8) => boolean = (_2: rt.u8): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: rt.u8): boolean => { + return nth(item3); + }); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: rt.u8): boolean => { + return nth(item2); + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$1surhce(item, 238, put)); + } +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$Filter_Map_Take_Iter_u8_closures_closure5_closures_closure6_closures_closure7(it: rt.Iter, steps: rt.ByteSlice, put: (a0: rt.u8) => rt.u8, out: rt.ByteVec): void { + let item!: rt.u8 | undefined; + const it2: rt.Iter = rt.iterCycle(it, { i: { f: rt.closureClone }, f: rt.closureClone }); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: rt.u8) => boolean = (_2: rt.u8): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: rt.u8): boolean => { + return nth(item3); + }); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: rt.u8): boolean => { + return nth(item2); + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$1surhce(item, 238, put)); + } + rt.drop(it2); +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$Flatten_Chunks_u8_cycles_closure1(it: rt.Iter, steps: rt.ByteSlice, put: (a0: rt.u8) => rt.u8, out: rt.ByteVec): void { + let item!: rt.u8 | undefined; + const it2: rt.Iter = rt.iterCycle(it); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: rt.u8) => boolean = (_2: rt.u8): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: rt.u8): boolean => { + return nth(item3); + }); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: rt.u8): boolean => { + return nth(item2); + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$1surhce(item, 238, put)); + } +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$IntoIter_u8_cycles_closure2(it: rt.Iter, steps: rt.ByteSlice, put: (a0: rt.u8) => rt.u8, out: rt.ByteVec): void { + let item!: rt.u8 | undefined; + const it2: rt.Iter = rt.iterCycle(it); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: rt.u8) => boolean = (_2: rt.u8): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: rt.u8): boolean => { + return nth(item3); + }); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: rt.u8): boolean => { + return nth(item2); + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$1surhce(item, 238, put)); + } +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$Iter_u8_cycles_closure1(it: rt.Iter, steps: rt.ByteSlice, put: (a0: rt.u8) => rt.u8, out: rt.ByteVec): void { + let item!: rt.u8 | undefined; + const it2: rt.Iter = rt.iterCycle(it); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: rt.u8) => boolean = (_2: rt.u8): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: rt.u8): boolean => { + return nth(item3); + }); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: rt.u8): boolean => { + return nth(item2); + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$1surhce(item, 238, put)); + } +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$Peekable_Iter_u8_cycles_closure1(it: rt.Peekable, steps: rt.ByteSlice, put: (a0: rt.u8) => rt.u8, out: rt.ByteVec): void { + let item!: rt.u8 | undefined; + const it2: rt.Iter = rt.iterCycle(it); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: rt.u8) => boolean = (_2: rt.u8): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: rt.u8): boolean => { + return nth(item3); + }); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: rt.u8): boolean => { + return nth(item2); + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$1surhce(item, 238, put)); + } +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$RangeInclusive_u8_cycles_closure6(it: rt.RangeInclusive, steps: rt.ByteSlice, put: (a0: rt.u8) => rt.u8, out: rt.ByteVec): void { + let item!: rt.u8 | undefined; + const it2: rt.Iter = rt.iterCycle(it); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: rt.u8) => boolean = (_2: rt.u8): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: rt.u8): boolean => { + return nth(item3); + }); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: rt.u8): boolean => { + return nth(item2); + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$1surhce(item, 238, put)); + } +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$RangeInclusive_u8_cycles_closure7(it: rt.RangeInclusive, steps: rt.ByteSlice, put: (a0: rt.u8) => rt.u8, out: rt.ByteVec): void { + let item!: rt.u8 | undefined; + const it2: rt.Iter = rt.iterCycle(it); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: rt.u8) => boolean = (_2: rt.u8): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: rt.u8): boolean => { + return nth(item3); + }); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: rt.u8): boolean => { + return nth(item2); + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$1surhce(item, 238, put)); + } +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$Range_u8_cycles_closure5(it: rt.Range, steps: rt.ByteSlice, put: (a0: rt.u8) => rt.u8, out: rt.ByteVec): void { + let item!: rt.u8 | undefined; + const it2: rt.Iter = rt.iterCycle(it); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: rt.u8) => boolean = (_2: rt.u8): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: rt.u8): boolean => { + return nth(item3); + }); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: rt.u8): boolean => { + return nth(item2); + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$1surhce(item, 238, put)); + } +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$Skip_Iter_u8_cycles_closure1(it: rt.Iter, steps: rt.ByteSlice, put: (a0: rt.u8) => rt.u8, out: rt.ByteVec): void { + let item!: rt.u8 | undefined; + const it2: rt.Iter = rt.iterCycle(it); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: rt.u8) => boolean = (_2: rt.u8): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: rt.u8): boolean => { + return nth(item3); + }); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: rt.u8): boolean => { + return nth(item2); + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$1surhce(item, 238, put)); + } +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$StepBy_Iter_u8_cycles_closure1(it: rt.Iter, steps: rt.ByteSlice, put: (a0: rt.u8) => rt.u8, out: rt.ByteVec): void { + let item!: rt.u8 | undefined; + const it2: rt.Iter = rt.iterCycle(it); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: rt.u8) => boolean = (_2: rt.u8): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: rt.u8): boolean => { + return nth(item3); + }); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: rt.u8): boolean => { + return nth(item2); + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$1surhce(item, 238, put)); + } +} + +/** + * `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, + * or `find` or `position` of the item a count picks, each item as `put` makes it, or + * 0xee for none. + */ +export function read$Take_Iter_u8_cycles_closure1(it: rt.Iter, steps: rt.ByteSlice, put: (a0: rt.u8) => rt.u8, out: rt.ByteVec): void { + let item!: rt.u8 | undefined; + const it2: rt.Iter = rt.iterCycle(it); + const _8: [rt.usize, rt.usize | undefined] = it2.sizeHint(); + const lower: rt.usize = _8[0]; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(lower & 0xff, (lower >>> 24) & 0xff, mapOr$02k4ito(_8[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + const iter: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 12); + while (true) { + const _22: rt.u8 | rt.Done = iter.next(); + if (_22 === rt.DONE) { + break; + } + const step: rt.u8 = _22; + const n: rt.usize = rt.usizeRem(step >> 2 as rt.usize, 9); + let left: rt.usize = n; + const nth: (a0: rt.u8) => boolean = (_2: rt.u8): boolean => { + const hit: boolean = left === 0; + left = rt.usizeWrappingSub(left, 1); + return hit; + }; + const _36: rt.u8 = step & 3; + if (_36 === 0) { + item = rt.iterToOption(it2.next()); + } else if (_36 === 1) { + item = rt.iterNth(it2, n); + } else if (_36 === 2) { + item = rt.iterFind(it2, (item3: rt.u8): boolean => { + return nth(item3); + }); + } else { + rt.byteVecPush(out, mapOr$02k4ito(rt.iterPosition(it2, (item2: rt.u8): boolean => { + return nth(item2); + }), 238, (i: rt.usize): rt.u8 => { + return i & 0xff; + })); + continue; + } + rt.byteVecPush(out, mapOr$1surhce(item, 238, put)); + } +} + +/** + * `cycle` of std's iterators and adaptors and of the crate's own, each partly read, + * empty, or both, the first byte of `data` a count and the rest the steps `read` takes. + */ +export function cycles(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { + let item!: rt.u8 | undefined; + const n: rt.usize = mapOr$1surhce(rt.byteSliceFirst(data), 0, (_2: rt.u8): rt.u8 => { + return rt.u8Rem(_2, 5); + }) as rt.usize; + const steps: rt.ByteSlice = unwrapOr$1rbuegs(rt.byteSliceGetRange(data, 1), rt.byteSliceFrom(Uint8Array.of())); + const _12: rt.u8 = rt.u8Rem(kind, 6); + if (_12 === 0) { + const it: rt.Iter = rt.iterSlice(rt.byteSliceView(data)); + rt.iterNth(it, n); + read$Iter_u8_cycles_closure1(it, steps, (x18: rt.u8): rt.u8 => { + return x18; + }, out); + const it2: rt.Iter = rt.iterSlice(rt.byteSliceView(data)); + rt.iterForEach(rt.iterBorrow(it2), (_a03: rt.u8): undefined => { + undefined; + }); + read$Iter_u8_cycles_closure1(it2, steps, (x19: rt.u8): rt.u8 => { + return x19; + }, out); + read$Iter_u8_cycles_closure1(rt.iterSlice(rt.byteSliceView(rt.byteSliceRange(data, 0, 0))), steps, (x20: rt.u8): rt.u8 => { + return x20; + }, out); + read$Take_Iter_u8_cycles_closure1(rt.iterTake(rt.iterSlice(rt.byteSliceView(data)), n), steps, (x21: rt.u8): rt.u8 => { + return x21; + }, out); + read$IntoIter_u8_cycles_closure2(rt.iterOption(n & 0xff), steps, (x22: rt.u8): rt.u8 => { + return x22; + }, out); + rt.iterEmpty(); + read$Empty_u8_cycles_closure3(rt.iterEmpty() as rt.Iter, steps, (x23: rt.u8): rt.u8 => { + return x23; + }, out); + read$Countdown_cycles_closure4({ _0: rt.u8Mul(n & 0xff, 2) }, steps, (x24: rt.u8): rt.u8 => { + return x24; + }, out); + } else if (_12 === 1) { + const lo: rt.u8 = rt.u8Rem(unwrapOr$0r2bmpr(rt.byteSliceFirst(data), 0), 8); + const hi: rt.u8 = rt.u8Rem(unwrapOr$0r2bmpr(rt.byteSliceGet(data, 1), 9), 12); + read$Range_u8_cycles_closure5(new rt.Range(lo, hi), steps, (x8: rt.u8): rt.u8 => { + return x8; + }, out); + const range: rt.RangeInclusive = new rt.RangeInclusive(lo, hi, rt.u8Step); + range.next(); + read$RangeInclusive_u8_cycles_closure6(range.clone(), steps, (x9: rt.u8): rt.u8 => { + return x9; + }, out); + rt.iterForEach(rt.iterBorrow(range), (_a02: rt.u8): undefined => { + undefined; + }); + read$RangeInclusive_u8_cycles_closure7(range, steps, (x10: rt.u8): rt.u8 => { + return x10; + }, out); + read$Filter_Iter_u8_cycles_closure8_cycles_closure1(rt.iterFilter(rt.iterSlice(rt.byteSliceView(data)), (_25: rt.u8): boolean => { + return rt.u8Rem(_25, 3) !== 0; + }), steps, (x12: rt.u8): rt.u8 => { + return x12; + }, out); + read$Chain_Iter_u8_Take_Rev_Iter_u8_cycles_closure1(rt.iterChain(rt.iterSlice(rt.byteSliceView(data)), rt.iterTake(rt.iterRev(rt.iterSlice(rt.byteSliceView(data))), 2)), steps, (x13: rt.u8): rt.u8 => { + return x13; + }, out); + read$StepBy_Iter_u8_cycles_closure1(rt.iterStepBy(rt.iterSlice(rt.byteSliceView(data)), rt.usizeAdd(n, 1)), steps, (x14: rt.u8): rt.u8 => { + return x14; + }, out); + read$Skip_Iter_u8_cycles_closure1(rt.iterSkip(rt.iterSlice(rt.byteSliceView(data)), n), steps, (x15: rt.u8): rt.u8 => { + return x15; + }, out); + read$Enumerate_Iter_u8_cycles_closure9(rt.iterEnumerate(rt.iterSlice(rt.byteSliceView(data))), steps, (_29: [rt.usize, rt.u8]): rt.u8 => { + return (_29[0] & 0xff) ^ _29[1]; + }, out); + const peeked: rt.Peekable = rt.iterPeekable(rt.iterSlice(rt.byteSliceView(data))); + rt.peekablePeek(peeked); + read$Peekable_Iter_u8_cycles_closure1(peeked, steps, (x16: rt.u8): rt.u8 => { + return x16; + }, out); + read$Flatten_Chunks_u8_cycles_closure1(rt.iterFlatten(rt.byteSliceChunks(data, rt.usizeAdd(n, 1)), (value: rt.ByteSlice) => rt.iterSlice(rt.byteSliceView(value))), steps, (x17: rt.u8): rt.u8 => { + return x17; + }, out); + } else if (_12 === 2) { + const m: rt.usize = rt.u8Rem(unwrapOr$0r2bmpr(rt.byteSliceLast(data), 0), 40) as rt.usize; + rt.iterExtendBytes(out, rt.iterTake(rt.iterCycle(rt.iterSlice(rt.byteSliceView(data))), m), "next"); + rt.byteVecPush(out, rt.ownedCount(rt.iterTake(rt.iterCycle(rt.iterSlice(rt.byteSliceView(data))), m)) & 0xff); + rt.byteVecPush(out, rt.iterFold(rt.iterTake(rt.iterCycle(rt.iterSlice(rt.byteSliceView(data))), m), 0, (a: rt.u8, _3: rt.u8): rt.u8 => { + return rt.u8WrappingAdd(a, _3); + })); + rt.iterExtendBytes(out, rt.iterMap(rt.iterZip(rt.iterSlice(rt.byteSliceView(data)), rt.iterCycle(rt.iterSlice(rt.byteSliceView(rt.byteSliceFrom(Uint8Array.of(107, 101, 121)))))), (_22: [rt.u8, rt.u8]): rt.u8 => { + return _22[0] ^ _22[1]; + }), "next"); + rt.iterExtendBytes(out, rt.iterTake(rt.iterStepBy(rt.iterSkip(rt.iterCycle(new rt.RangeInclusive(1, 3, rt.u8Step)), n), 2), m), "next"); + rt.iterExtendBytes(out, rt.iterSlice(rt.byteVecView(rt.iterToByteVec(rt.iterTake(rt.iterCycle(rt.iterSlice(rt.byteSliceView(data))), m), "next"))), undefined, true); + rt.byteVecPush(out, rt.iterAny(rt.iterTake(rt.iterCycle(rt.iterSlice(rt.byteSliceView(data))), m), (_23: rt.u8): boolean => { + return _23 === 7; + }) ? 1 : 0); + rt.byteVecPush(out, rt.ownedCount(rt.iterCycle(rt.iterSlice(rt.byteSliceView(rt.byteSliceRange(data, 0, 0))))) & 0xff); + rt.iterExtendBytes(out, rt.iterOption(rt.iterLast(rt.iterCycle(rt.iterSlice(rt.byteSliceView(rt.byteSliceRange(data, 0, 0)))))), undefined, true); + rt.iterExtendBytes(out, rt.iterTake(rt.iterCycle(rt.iterSlice(rt.byteSliceView(rt.byteSliceRange(data, 0, 0)))), m), "next"); + const at: rt.Arc> = new rt.Arc(new rt.Cell(0)); + const make = (captured: rt.Arc>): () => rt.u8 | undefined => { + return rt.closure(rt.cloning((): rt.u8 | undefined => { + const a2: rt.u8 = captured.value.v; + rt.cellSet(captured.value, rt.u8WrappingAdd(a2, 1)); + const _1110: rt.usize = rt.u8Rem(a2, 5) as rt.usize; + if (!(_1110 < 5)) { + rt.panic("index out of bounds: the len is " + 5 + " but the index is " + _1110); + } + return thenSome$0d5am30([true, false, true, false, false][_1110], a2); + }, () => make(((a0: rt.Arc>): rt.Arc> => { + return rt.arcClone(a0); + })(captured))), (): void => { + captured[Symbol.dispose](); + }); + }; + const pausing: rt.Iter = rt.iterFromFn(make(at)); + rt.byteVecPush(out, rt.ownedCount(rt.iterTake(rt.iterCycle(pausing.clone({ v: rt.closureClone }), { v: rt.closureClone }), m)) & 0xff); + const it3: rt.Iter = rt.iterCycle(pausing.clone({ v: rt.closureClone }), { v: rt.closureClone }); + const _180: rt.usize = rt.usizeRem(m, 9); + let iterStart: rt.usize = 0; + const iterEnd: rt.usize = _180; + while (iterStart++ < iterEnd) { + rt.byteVecPush(out, mapOr$1surhce(rt.iterToOption(it3.next()), 238, (x6: rt.u8): rt.u8 => { + return x6; + })); + } + rt.byteVecPush(out, rt.ownedCount(rt.iterTake(rt.iterBorrow(it3), m)) & 0xff); + rt.byteVecPush(out, rt.iterFold(rt.iterTake(rt.iterCycle(pausing, { v: rt.closureClone }), m), 0, (a3: rt.u8, x7: rt.u8): rt.u8 => { + return rt.u8WrappingAdd(a3, x7); + }, true)); + rt.drop(it3); + } else if (_12 === 3) { + closures(data, steps, out); + } else if (_12 === 4) { + owned(data, n, steps, out); + } else { + const it4: rt.Iter = rt.iterCycle(rt.iterSlice(rt.byteSliceView(data))); + rt.iterNth(it4, n); + const clone: rt.Iter = it4.clone(); + const iter2: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(steps)), 16); + while (true) { + const _210: rt.u8 | rt.Done = iter2.next(); + if (_210 === rt.DONE) { + break; + } + const step: rt.u8 = _210; + const _215: rt.u8 = step & 3; + if (_215 === 0) { + item = rt.iterToOption(it4.next()); + } else if (_215 === 1) { + item = rt.iterToOption(clone.next()); + } else if (_215 === 2) { + item = rt.iterNth(it4, rt.usizeRem(step >> 2 as rt.usize, 9)); + } else { + item = rt.iterNth(clone, rt.usizeRem(step >> 2 as rt.usize, 9)); + } + rt.byteVecPush(out, mapOr$1surhce(item, 238, (x: rt.u8): rt.u8 => { + return x; + })); + } + rt.byteVecPush(out, rt.iterCycle(rt.iterSlice(rt.byteSliceView(rt.byteSliceRange(data, 0, 0)))).clone().sizeHint()[0] & 0xff); + read$Cycle_Iter_u8_cycles_closure1(it4.clone(), steps, (x2: rt.u8): rt.u8 => { + return x2; + }, out); + read$Cycle_Iter_u8_cycles_closure1(rt.iterCycle(rt.iterSlice(rt.byteSliceView(rt.byteSliceRange(data, 0, 0)))), steps, (x3: rt.u8): rt.u8 => { + return x3; + }, out); + } +} + +/** + * Adaptors whose closures log as they are called and hold a value that logs as it is + * cloned and dropped: when each clone of them is made, and when each drops. + */ +export function closures(data: rt.ByteSlice, steps: rt.ByteSlice, out: rt.ByteVec): void { + const log: rt.Arc> = new rt.Arc(new rt.RefCell(new rt.ByteVec())); + const logged: (a0: rt.u8) => Logged.Logged = (id: rt.u8): Logged.Logged => { + return new Logged.Logged(id, rt.arcClone(log)); + }; + const tag: Logged.Logged = logged(16); + const _13: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(data)), 3); + const make = (captured: Logged.Logged): (a0: rt.u8) => rt.u8 => { + return rt.closure(rt.cloning((_2: rt.u8): rt.u8 => { + return Logged.called(captured, _2); + }, () => make(Logged.clone$Clone(captured))), (): void => { + captured[Symbol.dispose](); + }); + }; + const it: rt.Iter = rt.iterMap(_13, make(tag)); + it.next(); + const it2: rt.Iter = rt.iterCycle(it, { f: rt.closureClone }); + flush(log.value, out); + let iterStart: rt.i32 = 0; + const iterEnd: rt.i32 = 7; + while (iterStart++ < iterEnd) { + rt.iterExtendBytes(out, rt.iterOption(rt.iterToOption(it2.next())), undefined, true); + } + flush(log.value, out); + let left: rt.usize = rt.usizeRem(data.length, 5); + rt.iterExtendBytes(out, rt.iterOption(rt.iterFind(it2, (_22: rt.u8): boolean => { + left = rt.usizeWrappingSub(left, 1); + return left === 4294967295; + })), undefined, true); + flush(log.value, out); + let left2: rt.usize = rt.usizeRem(data.length, 7); + rt.iterExtendBytes(out, rt.iterOption(map$05nbzug(rt.iterPosition(it2, (_25: rt.u8): boolean => { + left2 = rt.usizeWrappingSub(left2, 1); + return left2 === 4294967295; + }), (i: rt.usize): rt.u8 => { + return i & 0xff; + })), undefined, true); + flush(log.value, out); + rt.iterExtendBytes(out, rt.iterOption(rt.iterNth(it2, 5)), undefined, true); + flush(log.value, out); + rt.drop(it2); + flush(log.value, out); + const _71: [Logged.Logged, rt.u8] = [logged(32), 0]; + const tag2: Logged.Logged = _71[0]; + const count: rt.u8 = 0; + const _76: rt.Iter = rt.iterTake(rt.iterSlice(rt.byteSliceView(data)), 4); + const make2 = (captured2: rt.u8, captured3: Logged.Logged): (a0: rt.u8) => rt.u8 => { + return rt.closure(rt.cloning((_27: rt.u8): rt.u8 => { + const x2: rt.u8 = _27; + captured2 = rt.u8WrappingAdd(captured2, 1); + return Logged.called(captured3, x2) ^ captured2; + }, () => make2(captured2, Logged.clone$Clone(captured3))), (): void => { + captured3[Symbol.dispose](); + }); + }; + const it3: rt.Iter = rt.iterMap(_76, make2(count, tag2)); + const gate: Logged.Logged = logged(48); + const make3 = (captured4: Logged.Logged): (a0: rt.u8) => boolean => { + return rt.closure(rt.cloning((_28: rt.u8): boolean => { + return (Logged.called(captured4, _28) & 3) !== 0; + }, () => make3(Logged.clone$Clone(captured4))), (): void => { + captured4[Symbol.dispose](); + }); + }; + read$Filter_Map_Take_Iter_u8_closures_closure5_closures_closure6_closures_closure7(rt.iterFilter(it3, make3(gate)), steps, (x4: rt.u8): rt.u8 => { + return x4; + }, out); + flush(log.value, out); + const left3: rt.Arc> = new rt.Arc(new rt.Cell(rt.usizeRem(data.length, 4))); + const tag3: Logged.Logged = logged(56); + const make4 = (captured5: rt.Arc>, captured6: Logged.Logged): () => rt.u8 | undefined => { + return rt.closure(rt.cloning((): rt.u8 | undefined => { + const _29: rt.usize | undefined = rt.usizeCheckedSub(captured5.value.v, 1); + if (_29 !== undefined) { + const l: rt.usize = _29; + rt.cellSet(captured5.value, l); + return Logged.called(captured6, l & 0xff); + } + return undefined; + }, () => make4(((a04: rt.Arc>): rt.Arc> => { + return rt.arcClone(a04); + })(captured5), Logged.clone$Clone(captured6))), (): void => { + captured5[Symbol.dispose](); + captured6[Symbol.dispose](); + }); + }; + const it6: rt.Iter = rt.iterCycle(rt.iterFromFn(make4(left3, tag3)), { v: rt.closureClone }); + flush(log.value, out); + rt.iterExtendBytes(out, rt.iterOption(rt.iterToOption(it6.next())), undefined, true); + rt.byteVecPush(out, rt.iterPosition(it6, (_210: rt.u8): boolean => { + return false; + }) === undefined ? 1 : 0); + flush(log.value, out); + rt.byteVecPush(out, rt.iterToOption(it6.next()) === undefined ? 1 : 0); + rt.byteVecPush(out, rt.iterNth(it6, 2) === undefined ? 1 : 0); + flush(log.value, out); + rt.drop(it6); + flush(log.value, out); + log[Symbol.dispose](); +} + +/** + * Iterators that own their items, each cloned as the iterator is at each wrap, and + * dropped as `nth` skips them and as the cycle drops what it holds and its clone. + */ +export function owned(data: rt.ByteSlice, n: rt.usize, steps: rt.ByteSlice, out: rt.ByteVec): void { + const log: rt.Arc> = new rt.Arc(new rt.RefCell(new rt.ByteVec())); + const logged: (a0: rt.u8) => Logged.Logged = (id: rt.u8): Logged.Logged => { + return new Logged.Logged(id, rt.arcClone(log)); + }; + const it: rt.Iter = rt.iterSlice(rt.iterToArray(rt.iterMap(rt.iterTake(rt.iterSlice(rt.byteSliceView(data)), 4), (_2: rt.u8): Logged.Logged => { + return logged(_2 & 112); + }), undefined, 8, true), rt.drop); + rt.drop(rt.iterToOption(it.next())); + flush(log.value, out); + const it2: rt.Iter = rt.iterCycle(it, { v: Logged.clone$Clone }); + flush(log.value, out); + rt.iterExtendBytes(out, rt.iterOption(map$1u07cey(rt.iterNth(it2, n, rt.drop), (x: Logged.Logged): rt.u8 => { + const _03: rt.u8 = Logged.id(x); + x[Symbol.dispose](); + return _03; + })), undefined, true); + flush(log.value, out); + rt.iterExtendBytes(out, rt.iterOption(map$1u07cey(rt.iterNth(it2, rt.usizeAdd(n, 3), rt.drop), (x2: Logged.Logged): rt.u8 => { + const _04: rt.u8 = Logged.id(x2); + x2[Symbol.dispose](); + return _04; + })), undefined, true); + flush(log.value, out); + let left: rt.usize = rt.usizeMul(n, 2); + rt.iterExtendBytes(out, rt.iterOption(map$1u07cey(rt.iterFind(it2, (_22: Logged.Logged): boolean => { + left = rt.usizeWrappingSub(left, 1); + return left === 4294967295; + }, rt.drop), (x3: Logged.Logged): rt.u8 => { + const _06: rt.u8 = Logged.id(x3); + x3[Symbol.dispose](); + return _06; + })), undefined, true); + flush(log.value, out); + const clone: rt.Iter = it2.clone({ i: { v: Logged.clone$Clone } }); + flush(log.value, out); + rt.drop(it2); + flush(log.value, out); + read$Cycle_IntoIter_Logged_owned_closure6(clone, steps, (x4: Logged.Logged): rt.u8 => { + const _07: rt.u8 = Logged.id(x4); + x4[Symbol.dispose](); + return _07; + }, out); + flush(log.value, out); + const empty: Logged.Logged[] = []; + const it3: rt.Iter = rt.iterCycle(rt.iterSlice(empty, rt.drop), { v: Logged.clone$Clone }); + const _75: Logged.Logged | undefined = rt.iterNth(it3, 3, rt.drop); + rt.byteVecPush(out, _75 === undefined ? 1 : 0); + rt.drop(_75); + const _81: Logged.Logged | undefined = rt.iterFind(it3, (_24: Logged.Logged): boolean => { + return true; + }, rt.drop); + rt.byteVecPush(out, _81 === undefined ? 1 : 0); + rt.drop(_81); + const _85: [rt.usize, rt.usize | undefined] = it3.sizeHint(); + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(_85[0] & 0xff, mapOr$02k4ito(_85[1], 254, (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }))), undefined, true); + rt.drop(it3); + log[Symbol.dispose](); +} + +//# sourceMappingURL=cycles.ts.map diff --git a/ts/fixtures/lang/expected/harness.ts b/ts/fixtures/lang/expected/harness.ts index 17cdd6c68..e1967b85c 100644 --- a/ts/fixtures/lang/expected/harness.ts +++ b/ts/fixtures/lang/expected/harness.ts @@ -14,6 +14,7 @@ import { hashMaps, sets, btreeMaps, deques, vecs, stores, optionals, setOps, unl import { combinators } from "./combinators.ts"; import { arcs, clonedArcs, cyclicArcs, uniqueArcs, clonedRcs, cyclicRcs, rcs, uniqueRcs, copies } from "./counts.ts"; import { cows } from "./cows.ts"; +import { cycles } from "./cycles.ts"; import { defaults } from "./defaults.ts"; import { durations } from "./durations.ts"; import { dyns, shared, anys, fns } from "./dyns.ts"; @@ -197,7 +198,7 @@ export function cases(): [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) collections(data71, out72); }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["collections::unlike_eqs", unlikeEqs as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["zeros::impls", impls as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["zeros::keys", zeros_keys as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["keys::arrays", arrays as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["iters::zips", zips as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["iters::zips_back", zipsBack as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["collections::own_nes", ownNes as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["fmt::iters", (_2172: rt.u8, data72: rt.ByteSlice, out73: rt.ByteVec): undefined => { fmt_iters(data72, out73); - }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["zeros::unread", unread as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["iters::range_froms", rangeFroms as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["clones::iters", iters as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["collections::cell_eqs", cellEqs as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined]]; + }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["zeros::unread", unread as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["iters::range_froms", rangeFroms as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["clones::iters", iters as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["collections::cell_eqs", cellEqs as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["cycles::cycles", cycles as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined]]; } /** Run one case. */ diff --git a/ts/fixtures/lang/src/cycles.rs b/ts/fixtures/lang/src/cycles.rs new file mode 100644 index 000000000..deed321bb --- /dev/null +++ b/ts/fixtures/lang/src/cycles.rs @@ -0,0 +1,297 @@ +//! `Iterator::cycle`: its iterator read on, and then clones of it as it was cycled, each +//! made as the last ends, read by `next`, `nth`, and folds that stop early, with what +//! each clone owns cloned and dropped as std's are. + +use std::cell::{Cell, RefCell}; +use std::rc::Rc; + +/// Logs its id as it drops, and as it is cloned, the id with the high bit set: its clone's +/// id is one more. +struct Logged { + id: u8, + log: Rc>>, +} + +impl Logged { + fn id(&self) -> u8 { + self.id + } + + /// Logs `x`, as a closure that holds it is called. + fn called(&self, x: u8) -> u8 { + self.log.borrow_mut().push(0x40 | x & 0x3f); + x ^ self.id + } +} + +impl Clone for Logged { + fn clone(&self) -> Self { + self.log.borrow_mut().push(0x80 | self.id); + Self { + id: self.id.wrapping_add(1), + log: self.log.clone(), + } + } +} + +impl Drop for Logged { + fn drop(&mut self) { + self.log.borrow_mut().push(self.id); + } +} + +/// Puts what was logged since the last flush, after a marker. +fn flush(log: &RefCell>, out: &mut Vec) { + out.push(0xfd); + out.extend(log.borrow_mut().drain(..)); +} + +/// The crate's own iterator, which `cycle` clones by its `Clone`. +#[derive(Clone)] +struct Countdown(u8); + +impl Iterator for Countdown { + type Item = u8; + + fn next(&mut self) -> Option { + self.0 = self.0.checked_sub(1)?; + Some(self.0) + } +} + +/// `it` cycled, its size hint, and then read as each of `steps` picks: by `next`, `nth`, +/// or `find` or `position` of the item a count picks, each item as `put` makes it, or +/// 0xee for none. +fn read(it: I, steps: &[u8], put: impl Fn(I::Item) -> u8, out: &mut Vec) { + let mut it = it.cycle(); + let (lower, upper) = it.size_hint(); + out.extend([lower as u8, (lower >> 24) as u8, upper.map_or(0xfe, |n| n as u8)]); + for &step in steps.iter().take(12) { + let n = usize::from(step >> 2) % 9; + let mut left = n; + let mut nth = |_: &I::Item| { + let hit = left == 0; + left = left.wrapping_sub(1); + hit + }; + let item = match step & 3 { + 0 => it.next(), + 1 => it.nth(n), + 2 => it.find(|item| nth(item)), + _ => { + out.push(it.position(|item| nth(&item)).map_or(0xee, |i| i as u8)); + continue; + } + }; + out.push(item.map_or(0xee, &put)); + } +} + +/// `cycle` of std's iterators and adaptors and of the crate's own, each partly read, +/// empty, or both, the first byte of `data` a count and the rest the steps `read` takes. +pub fn cycles(kind: u8, data: &[u8], out: &mut Vec) { + let n = usize::from(data.first().map_or(0, |&b| b % 5)); + let steps = data.get(1..).unwrap_or(&[]); + let id = |x: &u8| *x; + match kind % 6 { + // Partly read before it is cycled, read through, and empty. + 0 => { + let mut it = data.iter(); + it.nth(n); + read(it, steps, id, out); + let mut it = data.iter(); + it.by_ref().for_each(drop); + read(it, steps, id, out); + read(data[..0].iter(), steps, id, out); + read(data.iter().take(n), steps, id, out); + read(Some(n as u8).into_iter(), steps, |x| x, out); + read(std::iter::empty::(), steps, |x| x, out); + read(Countdown(n as u8 * 2), steps, |x| x, out); + } + // Ranges, an inclusive one folded its own way, and adaptors, some empty only once read. + 1 => { + let lo = data.first().copied().unwrap_or(0) % 8; + let hi = data.get(1).copied().unwrap_or(9) % 12; + read(lo..hi, steps, |x| x, out); + let mut range = lo..=hi; + range.next(); + read(range.clone(), steps, |x| x, out); + range.by_ref().for_each(drop); + read(range, steps, |x| x, out); + read(data.iter().filter(|&&x| x % 3 != 0), steps, id, out); + read(data.iter().chain(data.iter().rev().take(2)), steps, id, out); + read(data.iter().step_by(n + 1), steps, id, out); + read(data.iter().skip(n), steps, id, out); + read(data.iter().enumerate(), steps, |(i, x)| i as u8 ^ x, out); + let mut peeked = data.iter().peekable(); + peeked.peek(); + read(peeked, steps, id, out); + read(data.chunks(n + 1).flatten(), steps, id, out); + } + // Taken across several wraps, and consumed by value. + 2 => { + let m = usize::from(data.last().copied().unwrap_or(0) % 40); + out.extend(data.iter().cycle().take(m)); + out.push(data.iter().cycle().take(m).count() as u8); + out.push(data.iter().cycle().take(m).fold(0u8, |a, &x| a.wrapping_add(x))); + out.extend(data.iter().zip(b"key".iter().cycle()).map(|(a, b)| a ^ b)); + out.extend((1..=3u8).cycle().skip(n).step_by(2).take(m)); + let v: Vec = data.iter().copied().cycle().take(m).collect(); + out.extend(v); + out.push(data.iter().cycle().take(m).any(|&x| x == 7) as u8); + #[allow(clippy::infinite_iter, reason = "the cycle of nothing ends")] + { + out.push(data[..0].iter().cycle().count() as u8); + out.extend(data[..0].iter().cycle().last()); + } + out.extend(data[..0].iter().cycle().take(m)); + // A source that pauses, whose clones share where it is, so a later clone can be + // empty: `next` returns `None` there and reads on after, `count` of a `take` + // stops there, and a fold reads past it. + let at = Rc::new(Cell::new(0u8)); + let pausing = std::iter::from_fn(move || { + let a = at.get(); + at.set(a.wrapping_add(1)); + [true, false, true, false, false][usize::from(a % 5)].then_some(a) + }); + out.push(pausing.clone().cycle().take(m).count() as u8); + let mut it = pausing.clone().cycle(); + for _ in 0..m % 9 { + out.push(it.next().map_or(0xee, |x| x)); + } + out.push(it.by_ref().take(m).count() as u8); + out.push(pausing.cycle().take(m).fold(0u8, |a, x| a.wrapping_add(x))); + } + 3 => closures(data, steps, out), + 4 => owned(data, n, steps, out), + // Clones of a cycle, read in turns with it. + _ => { + let mut it = data.iter().cycle(); + it.nth(n); + let mut clone = it.clone(); + for &step in steps.iter().take(16) { + let item = match step & 3 { + 0 => it.next(), + 1 => clone.next(), + 2 => it.nth(usize::from(step >> 2) % 9), + _ => clone.nth(usize::from(step >> 2) % 9), + }; + out.push(item.map_or(0xee, id)); + } + let clone = data[..0].iter().cycle().clone(); + out.push(clone.size_hint().0 as u8); + // A cycle of a cycle, which clones it only if it is empty. + read(it.clone(), steps, id, out); + read(data[..0].iter().cycle(), steps, id, out); + } + } +} + +/// Adaptors whose closures log as they are called and hold a value that logs as it is +/// cloned and dropped: when each clone of them is made, and when each drops. +fn closures(data: &[u8], steps: &[u8], out: &mut Vec) { + let log = Rc::new(RefCell::new(Vec::new())); + let logged = |id: u8| Logged { id, log: log.clone() }; + + let tag = logged(0x10); + let mut it = data.iter().take(3).map(move |&x| tag.called(x)); + it.next(); + let mut it = it.cycle(); + flush(&log, out); + for _ in 0..7 { + out.extend(it.next()); + } + flush(&log, out); + let mut left = data.len() % 5; + out.extend(it.find(|_| { + left = left.wrapping_sub(1); + left == usize::MAX + })); + flush(&log, out); + let mut left = data.len() % 7; + out.extend( + it.position(|_| { + left = left.wrapping_sub(1); + left == usize::MAX + }) + .map(|i| i as u8), + ); + flush(&log, out); + out.extend(it.nth(5)); + flush(&log, out); + drop(it); + flush(&log, out); + + // A closure that counts its calls, which each clone counts on from where it was cycled, + // and a filter of what it returns. + let (tag, mut count) = (logged(0x20), 0u8); + let it = data.iter().take(4).map(move |&x| { + count = count.wrapping_add(1); + tag.called(x) ^ count + }); + let gate = logged(0x30); + let it = it.filter(move |&x| gate.called(x) & 3 != 0); + read(it, steps, |x| x, out); + flush(&log, out); + + // A source whose clones share what they read, which only the iterator cycled yields: + // each clone after is empty, which ends both `next` and a fold. + let left = Rc::new(Cell::new(data.len() % 4)); + let tag = logged(0x38); + let it = std::iter::from_fn(move || { + let l = left.get().checked_sub(1)?; + left.set(l); + Some(tag.called(l as u8)) + }); + let mut it = it.cycle(); + flush(&log, out); + out.extend(it.next()); + out.push(it.position(|_| false).is_none() as u8); + flush(&log, out); + out.push(it.next().is_none() as u8); + out.push(it.nth(2).is_none() as u8); + flush(&log, out); + drop(it); + flush(&log, out); +} + +/// Iterators that own their items, each cloned as the iterator is at each wrap, and +/// dropped as `nth` skips them and as the cycle drops what it holds and its clone. +fn owned(data: &[u8], n: usize, steps: &[u8], out: &mut Vec) { + let log = Rc::new(RefCell::new(Vec::new())); + let logged = |id: u8| Logged { id, log: log.clone() }; + + let items: Vec = data.iter().take(4).map(|&b| logged(b & 0x70)).collect(); + let mut it = items.into_iter(); + it.next(); + flush(&log, out); + let mut it = it.cycle(); + flush(&log, out); + out.extend(it.nth(n).map(|x| x.id())); + flush(&log, out); + out.extend(it.nth(n + 3).map(|x| x.id())); + flush(&log, out); + // Past as many as leaves it mid-way through a clone, for most counts. + let mut left = n * 2; + out.extend( + it.find(|_| { + left = left.wrapping_sub(1); + left == usize::MAX + }) + .map(|x| x.id()), + ); + flush(&log, out); + let clone = it.clone(); + flush(&log, out); + drop(it); + flush(&log, out); + read(clone, steps, |x| x.id(), out); + flush(&log, out); + + let empty: Vec = Vec::new(); + let mut it = empty.into_iter().cycle(); + out.push(it.nth(3).is_none() as u8); + out.push(it.find(|_| true).is_none() as u8); + let (lower, upper) = it.size_hint(); + out.extend([lower as u8, upper.map_or(0xfe, |n| n as u8)]); +} diff --git a/ts/fixtures/lang/src/harness.rs b/ts/fixtures/lang/src/harness.rs index b915c9dc1..53e60cce9 100644 --- a/ts/fixtures/lang/src/harness.rs +++ b/ts/fixtures/lang/src/harness.rs @@ -2,7 +2,7 @@ //! case and the rest is its input. use crate::{ - arrays, atomics, borrows, bounds, captures, cells, chars, chunks, clones, collections, combinators, counts, cows, + arrays, atomics, borrows, bounds, captures, cells, chars, chunks, clones, collections, cycles, combinators, counts, cows, defaults, durations, dyns, edits, errors, floats, fmt, folds, generics, hashes, hints, holds, ints, iters, keys, locals, locks, nested, objects, orders, pointers, refs, shapes, singles, slices, splits, statics, strs, utf8, wrappers, zeros, @@ -184,6 +184,7 @@ fn cases() -> Vec<(&'static str, Case)> { ("iters::range_froms", iters::range_froms), ("clones::iters", clones::iters), ("collections::cell_eqs", collections::cell_eqs), + ("cycles::cycles", cycles::cycles), ] } diff --git a/ts/fixtures/lang/src/lib.rs b/ts/fixtures/lang/src/lib.rs index e584f3340..e427a559c 100644 --- a/ts/fixtures/lang/src/lib.rs +++ b/ts/fixtures/lang/src/lib.rs @@ -33,6 +33,7 @@ mod clones; mod collections; mod combinators; mod counts; +mod cycles; mod cows; mod defaults; mod durations; diff --git a/ts/fixtures/reject/census.md b/ts/fixtures/reject/census.md index b1619fcd5..6ff1adccf 100644 --- a/ts/fixtures/reject/census.md +++ b/ts/fixtures/reject/census.md @@ -1,19 +1,19 @@ # Census of `reject-fixture` -- Refusals: 118 -- Function instances: 143 +- Refusals: 117 +- Function instances: 142 - Generic functions no instance reached, lowered over their type parameters: 10 ## By construct | Count | Construct | First | | ---: | --- | --- | -| 15 | unsupported call to `_` | fixtures/reject/src/lib.rs:124:11 | -| 12 | a raw pointer to `_` in `_`, which the crate may put another object in place of | fixtures/reject/src/lib.rs:628:10 | -| 8 | a raw pointer to `_` in a variable assigned again while it may point there | fixtures/reject/src/lib.rs:636:10 | -| 4 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | fixtures/reject/src/lib.rs:232:16 | -| 4 | a variant of `_`, which is not supported: either is the same JS string | fixtures/reject/src/lib.rs:349:2 | -| 3 | a copy of a closure that changes what it captured | fixtures/reject/src/lib.rs:242:14 | +| 14 | unsupported call to `_` | fixtures/reject/src/lib.rs:167:8 | +| 12 | a raw pointer to `_` in `_`, which the crate may put another object in place of | fixtures/reject/src/lib.rs:623:10 | +| 8 | a raw pointer to `_` in a variable assigned again while it may point there | fixtures/reject/src/lib.rs:631:10 | +| 4 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | fixtures/reject/src/lib.rs:227:16 | +| 4 | a variant of `_`, which is not supported: either is the same JS string | fixtures/reject/src/lib.rs:344:2 | +| 3 | a copy of a closure that changes what it captured | fixtures/reject/src/lib.rs:237:14 | | 3 | an assignment through a reference to `_` | fixtures/reject/src/lib.rs:90:2 | | 3 | replacing the value behind a reference to `_` | fixtures/reject/src/lib.rs:98:2 | | 3 | unsupported type `_` | fixtures/reject/src/lib.rs:7:14 | @@ -21,55 +21,55 @@ | 2 | `_` of `_`, whose `None` is `rt.None`, which is not supported yet | fixtures/reject/src/lib.rs:37:4 | | 2 | `_` of `_`, whose `clone_from` is its own, which is not supported yet | fixtures/reject/src/lib.rs:21:4 | | 2 | `_`, a trait object of another crate's trait, which is not supported yet | fixtures/reject/src/lib.rs:11:16 | -| 2 | `_`, a trait object of the generic trait `_`, which is not supported yet | fixtures/reject/src/lib.rs:477:23 | -| 2 | a coercion to `_`, which is not supported yet | fixtures/reject/src/lib.rs:468:40 | -| 2 | an iterator of the crate implementing `_`, which is not supported yet | fixtures/reject/src/lib.rs:157:1 | -| 2 | overriding `_`, which std's adaptors call in place of `next` or beside it | fixtures/reject/src/lib.rs:137:2 | -| 2 | passing `_`, which drops, to `_`, which is not supported yet | fixtures/reject/src/lib.rs:344:4 | -| 2 | unsupported type `_` from another crate | fixtures/reject/src/lib.rs:451:32 | -| 1 | `Buf::copy_to_bytes` of `_`, a value JS copies, which is not supported | fixtures/reject/src/lib.rs:781:2 | -| 1 | `BufMut::put` of `_` into a `BytesMut`, which picks the methods it calls by a capacity that depends on whether the other handles of its storage dropped, which is not supported | fixtures/reject/src/lib.rs:407:2 | -| 1 | `Bytes::from_owner` of `_`, which would drop with the last clone of what it makes, which is not supported | fixtures/reject/src/lib.rs:392:2 | +| 2 | `_`, a trait object of the generic trait `_`, which is not supported yet | fixtures/reject/src/lib.rs:472:23 | +| 2 | a coercion to `_`, which is not supported yet | fixtures/reject/src/lib.rs:463:40 | +| 2 | an iterator of the crate implementing `_`, which is not supported yet | fixtures/reject/src/lib.rs:152:1 | +| 2 | overriding `_`, which std's adaptors call in place of `next` or beside it | fixtures/reject/src/lib.rs:132:2 | +| 2 | passing `_`, which drops, to `_`, which is not supported yet | fixtures/reject/src/lib.rs:339:4 | +| 2 | unsupported type `_` from another crate | fixtures/reject/src/lib.rs:446:32 | +| 1 | `Buf::copy_to_bytes` of `_`, a value JS copies, which is not supported | fixtures/reject/src/lib.rs:776:2 | +| 1 | `BufMut::put` of `_` into a `BytesMut`, which picks the methods it calls by a capacity that depends on whether the other handles of its storage dropped, which is not supported | fixtures/reject/src/lib.rs:402:2 | +| 1 | `Bytes::from_owner` of `_`, which would drop with the last clone of what it makes, which is not supported | fixtures/reject/src/lib.rs:387:2 | | 1 | `Pointer` formatting, as in `{:p}`, is not supported | fixtures/reject/src/lib.rs:56:2 | -| 1 | `_` is not supported yet | fixtures/reject/src/lib.rs:360:18 | +| 1 | `_` is not supported yet | fixtures/reject/src/lib.rs:355:18 | | 1 | `_` is not supported: its `Pending` and `Ready` would both be `rt.OuterPending` | fixtures/reject/src/lib.rs:79:20 | | 1 | `_` is not supported: its field `_` is `_`, typed `_`, whose `None` would be `rt.None` as `_` | fixtures/reject/src/lib.rs:31:2 | -| 1 | `_` is not supported: its field `_` is `_`, typed `_`, whose `Pending` would be `rt.OuterPending` as `_` | fixtures/reject/src/lib.rs:515:2 | -| 1 | `_` of `_` by `_`, which is not supported yet | fixtures/reject/src/lib.rs:271:6 | -| 1 | `_` of `_`, which is not supported yet | fixtures/reject/src/lib.rs:558:4 | -| 1 | `_` with a mutable reference to a value JS copies, which its mapping would copy | fixtures/reject/src/lib.rs:534:12 | -| 1 | `_`, which is not supported yet | fixtures/reject/src/lib.rs:279:9 | -| 1 | `_`, which reads a capacity that depends on whether the other handles of its storage dropped, which is not supported | fixtures/reject/src/lib.rs:401:6 | -| 1 | `collect` of `_`, which sorts by `_`'s own `Ord`, of entries that drop, which is not supported yet | fixtures/reject/src/lib.rs:985:22 | +| 1 | `_` is not supported: its field `_` is `_`, typed `_`, whose `Pending` would be `rt.OuterPending` as `_` | fixtures/reject/src/lib.rs:510:2 | +| 1 | `_` of `_` by `_`, which is not supported yet | fixtures/reject/src/lib.rs:266:6 | +| 1 | `_` of `_`, which is not supported yet | fixtures/reject/src/lib.rs:553:4 | +| 1 | `_` with a mutable reference to a value JS copies, which its mapping would copy | fixtures/reject/src/lib.rs:529:12 | +| 1 | `_`, which is not supported yet | fixtures/reject/src/lib.rs:274:9 | +| 1 | `_`, which reads a capacity that depends on whether the other handles of its storage dropped, which is not supported | fixtures/reject/src/lib.rs:396:6 | +| 1 | `collect` of `_`, which sorts by `_`'s own `Ord`, of entries that drop, which is not supported yet | fixtures/reject/src/lib.rs:980:22 | | 1 | `fmt::Arguments` with a placeholder, or not made in place, written to `_`'s own `fmt::Write`, which is not supported yet: std splits what a placeholder writes into `write_str` calls the runtime does not make | fixtures/reject/src/lib.rs:62:10 | -| 1 | a `collect` in place of `_`, a zip std reads by index, holding values that drop, which is not supported yet | fixtures/reject/src/lib.rs:221:40 | -| 1 | a `skip` of `_`, a zip std reads by index, of items that drop, which is not supported yet | fixtures/reject/src/lib.rs:214:8 | +| 1 | a `collect` in place of `_`, a zip std reads by index, holding values that drop, which is not supported yet | fixtures/reject/src/lib.rs:216:40 | +| 1 | a `skip` of `_`, a zip std reads by index, of items that drop, which is not supported yet | fixtures/reject/src/lib.rs:209:8 | | 1 | a cast from `_` to `_` | fixtures/reject/src/lib.rs:75:2 | -| 1 | a cast from a pointer to `_` to one to `_`, which reads the bytes of one type as another | fixtures/reject/src/lib.rs:575:27 | -| 1 | a coercion to `_` | fixtures/reject/src/lib.rs:309:2 | -| 1 | a constant of type `_`, a pointer into memory translation can't name | fixtures/reject/src/lib.rs:798:3 | -| 1 | a dangling pointer to `_`, a value of no bytes made of more than structs and tuples | fixtures/reject/src/lib.rs:757:11 | +| 1 | a cast from a pointer to `_` to one to `_`, which reads the bytes of one type as another | fixtures/reject/src/lib.rs:570:27 | +| 1 | a coercion to `_` | fixtures/reject/src/lib.rs:304:2 | +| 1 | a constant of type `_`, a pointer into memory translation can't name | fixtures/reject/src/lib.rs:793:3 | +| 1 | a dangling pointer to `_`, a value of no bytes made of more than structs and tuples | fixtures/reject/src/lib.rs:752:11 | | 1 | a future of `_`, which can be `rt.Pending`, as the future's own `Pending` is | fixtures/reject/src/lib.rs:84:34 | -| 1 | a mutable reference into a `Result`'s payload, passed on or kept | fixtures/reject/src/lib.rs:380:12 | +| 1 | a mutable reference into a `Result`'s payload, passed on or kept | fixtures/reject/src/lib.rs:375:12 | | 1 | a mutable static, which any code may write | fixtures/reject/src/lib.rs:68:11 | -| 1 | a pointer's address, which JS has no counterpart of | fixtures/reject/src/lib.rs:580:17 | +| 1 | a pointer's address, which JS has no counterpart of | fixtures/reject/src/lib.rs:575:17 | | 1 | a printable type must implement `Display` or `Debug` | fixtures/reject/src/lib.rs:71:1 | -| 1 | a raw pointer to `_` behind a reference, which is the object and not where it is kept | fixtures/reject/src/lib.rs:597:10 | -| 1 | a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet | fixtures/reject/src/lib.rs:699:10 | +| 1 | a raw pointer to `_` behind a reference, which is the object and not where it is kept | fixtures/reject/src/lib.rs:592:10 | +| 1 | a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet | fixtures/reject/src/lib.rs:694:10 | | 1 | a scalar constant of type `_` | fixtures/reject/src/lib.rs:8:2 | -| 1 | a trait object of `_`, which is not supported yet | fixtures/reject/src/lib.rs:494:26 | +| 1 | a trait object of `_`, which is not supported yet | fixtures/reject/src/lib.rs:489:26 | | 1 | a zero-sized constant of type `_` | fixtures/reject/src/lib.rs:50:2 | -| 1 | an upcast from `_` to `_`, which is not supported yet | fixtures/reject/src/lib.rs:552:32 | +| 1 | an upcast from `_` to `_`, which is not supported yet | fixtures/reject/src/lib.rs:547:32 | | 1 | arithmetic on `_` | fixtures/reject/src/lib.rs:8:2 | -| 1 | comparing `_` as a key, which is not supported yet | fixtures/reject/src/lib.rs:253:75 | -| 1 | comparing pointers to `()`, which has no bytes and so no address of its own | fixtures/reject/src/lib.rs:748:2 | -| 1 | comparing pointers to `_` in an atomic, which JS has no address of | fixtures/reject/src/lib.rs:797:15 | -| 1 | comparing pointers to `_`, each a place JS makes of its own | fixtures/reject/src/lib.rs:616:2 | -| 1 | constructing `_` | fixtures/reject/src/lib.rs:367:53 | -| 1 | hashing `_` as a key, which is not supported yet | fixtures/reject/src/lib.rs:253:75 | -| 1 | hashing `_` through `_`'s own `Hash::hash_slice`, which is not supported yet | fixtures/reject/src/lib.rs:328:16 | -| 1 | passing `_`, a closure that owns a value that drops, to `_`, which is not supported yet | fixtures/reject/src/lib.rs:337:13 | -| 1 | union `_`, whose fields overlap in `_` and `f64`, which JS keeps apart | fixtures/reject/src/lib.rs:602:1 | +| 1 | comparing `_` as a key, which is not supported yet | fixtures/reject/src/lib.rs:248:75 | +| 1 | comparing pointers to `()`, which has no bytes and so no address of its own | fixtures/reject/src/lib.rs:743:2 | +| 1 | comparing pointers to `_` in an atomic, which JS has no address of | fixtures/reject/src/lib.rs:792:15 | +| 1 | comparing pointers to `_`, each a place JS makes of its own | fixtures/reject/src/lib.rs:611:2 | +| 1 | constructing `_` | fixtures/reject/src/lib.rs:362:53 | +| 1 | hashing `_` as a key, which is not supported yet | fixtures/reject/src/lib.rs:248:75 | +| 1 | hashing `_` through `_`'s own `Hash::hash_slice`, which is not supported yet | fixtures/reject/src/lib.rs:323:16 | +| 1 | passing `_`, a closure that owns a value that drops, to `_`, which is not supported yet | fixtures/reject/src/lib.rs:332:13 | +| 1 | union `_`, whose fields overlap in `_` and `f64`, which JS keeps apart | fixtures/reject/src/lib.rs:597:1 | ## By API @@ -77,79 +77,78 @@ The type or module each refused type or path belongs to. | Count | API | First | | ---: | --- | --- | -| 16 | `(u32, u32)` | fixtures/reject/src/lib.rs:628:10 | -| 7 | `std::borrow::Cow` | fixtures/reject/src/lib.rs:349:2 | +| 16 | `(u32, u32)` | fixtures/reject/src/lib.rs:623:10 | +| 7 | `std::borrow::Cow` | fixtures/reject/src/lib.rs:344:2 | | 6 | `f16` | fixtures/reject/src/lib.rs:7:14 | -| 5 | `Gap` | fixtures/reject/src/lib.rs:933:10 | +| 5 | `Gap` | fixtures/reject/src/lib.rs:928:10 | | 5 | `Option` | fixtures/reject/src/lib.rs:16:15 | -| 5 | `u32` | fixtures/reject/src/lib.rs:575:27 | +| 5 | `u32` | fixtures/reject/src/lib.rs:570:27 | | 4 | `Iterator` | fixtures/reject/src/lib.rs:37:4 | -| 4 | `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:707:15 | +| 4 | `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:702:15 | | 4 | `std::pin::Pin` | fixtures/reject/src/lib.rs:98:2 | -| 3 | `std::vec::Vec` | fixtures/reject/src/lib.rs:328:16 | -| 3 | `u8` | fixtures/reject/src/lib.rs:271:6 | -| 3 | `{closure}` | fixtures/reject/src/lib.rs:337:13 | +| 3 | `std::vec::Vec` | fixtures/reject/src/lib.rs:323:16 | +| 3 | `u8` | fixtures/reject/src/lib.rs:266:6 | +| 3 | `{closure}` | fixtures/reject/src/lib.rs:332:13 | | 2 | `Poll` | fixtures/reject/src/lib.rs:79:20 | | 2 | `Reused` | fixtures/reject/src/lib.rs:21:4 | -| 2 | `Scaled` | fixtures/reject/src/lib.rs:477:23 | -| 2 | `dyn Scaled` | fixtures/reject/src/lib.rs:477:23 | -| 2 | `dyn std::any::Any` | fixtures/reject/src/lib.rs:552:32 | +| 2 | `Scaled` | fixtures/reject/src/lib.rs:472:23 | +| 2 | `dyn Scaled` | fixtures/reject/src/lib.rs:472:23 | +| 2 | `dyn std::any::Any` | fixtures/reject/src/lib.rs:547:32 | | 2 | `dyn std::iter::Iterator` | fixtures/reject/src/lib.rs:11:16 | | 2 | `slice` | fixtures/reject/src/lib.rs:21:4 | -| 2 | `std::any::TypeId` | fixtures/reject/src/lib.rs:558:2 | -| 2 | `std::collections::BTreeSet` | fixtures/reject/src/lib.rs:253:75 | -| 2 | `std::collections::HashMap` | fixtures/reject/src/lib.rs:271:6 | -| 2 | `std::iter::Iterator` | fixtures/reject/src/lib.rs:232:16 | -| 2 | `std::mem::MaybeUninit` | fixtures/reject/src/lib.rs:947:19 | -| 2 | `std::std` | fixtures/reject/src/lib.rs:587:11 | -| 2 | `std::sync::Arc` | fixtures/reject/src/lib.rs:309:2 | +| 2 | `std::any::TypeId` | fixtures/reject/src/lib.rs:553:2 | +| 2 | `std::collections::BTreeSet` | fixtures/reject/src/lib.rs:248:75 | +| 2 | `std::collections::HashMap` | fixtures/reject/src/lib.rs:266:6 | +| 2 | `std::iter::Iterator` | fixtures/reject/src/lib.rs:227:16 | +| 2 | `std::mem::MaybeUninit` | fixtures/reject/src/lib.rs:942:19 | +| 2 | `std::std` | fixtures/reject/src/lib.rs:582:11 | +| 2 | `std::sync::Arc` | fixtures/reject/src/lib.rs:304:2 | | 2 | `std::sync::MutexGuard` | fixtures/reject/src/lib.rs:90:2 | -| 2 | `std::vec::IntoIter` | fixtures/reject/src/lib.rs:447:17 | -| 1 | `Batched` | fixtures/reject/src/lib.rs:328:16 | -| 1 | `Bits` | fixtures/reject/src/lib.rs:602:1 | -| 1 | `Blank` | fixtures/reject/src/lib.rs:781:2 | -| 1 | `BytesMut` | fixtures/reject/src/lib.rs:401:6 | -| 1 | `Counted` | fixtures/reject/src/lib.rs:407:2 | -| 1 | `DoubleEndedIterator` | fixtures/reject/src/lib.rs:157:1 | -| 1 | `Entry` | fixtures/reject/src/lib.rs:337:13 | -| 1 | `FusedIterator` | fixtures/reject/src/lib.rs:205:1 | -| 1 | `HashMap` | fixtures/reject/src/lib.rs:271:6 | -| 1 | `Hasher` | fixtures/reject/src/lib.rs:279:9 | -| 1 | `Hits` | fixtures/reject/src/lib.rs:740:21 | -| 1 | `Lane` | fixtures/reject/src/lib.rs:897:19 | +| 2 | `std::vec::IntoIter` | fixtures/reject/src/lib.rs:442:17 | +| 1 | `Batched` | fixtures/reject/src/lib.rs:323:16 | +| 1 | `Bits` | fixtures/reject/src/lib.rs:597:1 | +| 1 | `Blank` | fixtures/reject/src/lib.rs:776:2 | +| 1 | `BytesMut` | fixtures/reject/src/lib.rs:396:6 | +| 1 | `Counted` | fixtures/reject/src/lib.rs:402:2 | +| 1 | `DoubleEndedIterator` | fixtures/reject/src/lib.rs:152:1 | +| 1 | `Entry` | fixtures/reject/src/lib.rs:332:13 | +| 1 | `FusedIterator` | fixtures/reject/src/lib.rs:200:1 | +| 1 | `HashMap` | fixtures/reject/src/lib.rs:266:6 | +| 1 | `Hasher` | fixtures/reject/src/lib.rs:274:9 | +| 1 | `Hits` | fixtures/reject/src/lib.rs:735:21 | +| 1 | `Lane` | fixtures/reject/src/lib.rs:892:19 | | 1 | `Maybe` | fixtures/reject/src/lib.rs:31:2 | -| 1 | `Only` | fixtures/reject/src/lib.rs:757:11 | -| 1 | `Plain` | fixtures/reject/src/lib.rs:851:10 | +| 1 | `Only` | fixtures/reject/src/lib.rs:752:11 | +| 1 | `Plain` | fixtures/reject/src/lib.rs:846:10 | | 1 | `Sink` | fixtures/reject/src/lib.rs:62:10 | -| 1 | `Span2` | fixtures/reject/src/lib.rs:628:10 | -| 1 | `String` | fixtures/reject/src/lib.rs:804:4 | +| 1 | `Span2` | fixtures/reject/src/lib.rs:623:10 | +| 1 | `String` | fixtures/reject/src/lib.rs:799:4 | | 1 | `T \| undefined` | fixtures/reject/src/lib.rs:31:2 | -| 1 | `Tail` | fixtures/reject/src/lib.rs:504:30 | -| 1 | `Track` | fixtures/reject/src/lib.rs:877:19 | -| 1 | `Waiting` | fixtures/reject/src/lib.rs:515:2 | -| 1 | `Window` | fixtures/reject/src/lib.rs:689:2 | -| 1 | `[u8; 4]` | fixtures/reject/src/lib.rs:494:26 | -| 1 | `dyn Keyed` | fixtures/reject/src/lib.rs:552:32 | -| 1 | `poll` | fixtures/reject/src/lib.rs:515:2 | -| 1 | `rt.Poll` | fixtures/reject/src/lib.rs:515:2 | -| 1 | `std::any::Any` | fixtures/reject/src/lib.rs:558:4 | -| 1 | `std::cell::Cell` | fixtures/reject/src/lib.rs:985:22 | -| 1 | `std::collections::BTreeMap` | fixtures/reject/src/lib.rs:985:22 | -| 1 | `std::iter::Extend` | fixtures/reject/src/lib.rs:955:6 | -| 1 | `std::iter::Map` | fixtures/reject/src/lib.rs:221:40 | -| 1 | `std::iter::Zip` | fixtures/reject/src/lib.rs:214:8 | -| 1 | `std::net::AddrParseError` | fixtures/reject/src/lib.rs:451:32 | -| 1 | `std::net::Ipv4Addr` | fixtures/reject/src/lib.rs:451:32 | -| 1 | `std::ops::Range` | fixtures/reject/src/lib.rs:172:8 | -| 1 | `std::option::Option` | fixtures/reject/src/lib.rs:387:2 | -| 1 | `std::slice::IterMut` | fixtures/reject/src/lib.rs:786:15 | -| 1 | `std::slice::Iter` | fixtures/reject/src/lib.rs:124:11 | -| 1 | `std::std::Layout` | fixtures/reject/src/lib.rs:585:15 | -| 1 | `std::str` | fixtures/reject/src/lib.rs:452:4 | -| 1 | `std::sync::Mutex` | fixtures/reject/src/lib.rs:534:12 | -| 1 | `std::sync::Weak` | fixtures/reject/src/lib.rs:468:40 | +| 1 | `Tail` | fixtures/reject/src/lib.rs:499:30 | +| 1 | `Track` | fixtures/reject/src/lib.rs:872:19 | +| 1 | `Waiting` | fixtures/reject/src/lib.rs:510:2 | +| 1 | `Window` | fixtures/reject/src/lib.rs:684:2 | +| 1 | `[u8; 4]` | fixtures/reject/src/lib.rs:489:26 | +| 1 | `dyn Keyed` | fixtures/reject/src/lib.rs:547:32 | +| 1 | `poll` | fixtures/reject/src/lib.rs:510:2 | +| 1 | `rt.Poll` | fixtures/reject/src/lib.rs:510:2 | +| 1 | `std::any::Any` | fixtures/reject/src/lib.rs:553:4 | +| 1 | `std::cell::Cell` | fixtures/reject/src/lib.rs:980:22 | +| 1 | `std::collections::BTreeMap` | fixtures/reject/src/lib.rs:980:22 | +| 1 | `std::iter::Extend` | fixtures/reject/src/lib.rs:950:6 | +| 1 | `std::iter::Map` | fixtures/reject/src/lib.rs:216:40 | +| 1 | `std::iter::Zip` | fixtures/reject/src/lib.rs:209:8 | +| 1 | `std::net::AddrParseError` | fixtures/reject/src/lib.rs:446:32 | +| 1 | `std::net::Ipv4Addr` | fixtures/reject/src/lib.rs:446:32 | +| 1 | `std::ops::Range` | fixtures/reject/src/lib.rs:167:8 | +| 1 | `std::option::Option` | fixtures/reject/src/lib.rs:382:2 | +| 1 | `std::slice::IterMut` | fixtures/reject/src/lib.rs:781:15 | +| 1 | `std::std::Layout` | fixtures/reject/src/lib.rs:580:15 | +| 1 | `std::str` | fixtures/reject/src/lib.rs:447:4 | +| 1 | `std::sync::Mutex` | fixtures/reject/src/lib.rs:529:12 | +| 1 | `std::sync::Weak` | fixtures/reject/src/lib.rs:463:40 | | 1 | `std::task::Poll` | fixtures/reject/src/lib.rs:84:34 | -| 1 | `str` | fixtures/reject/src/lib.rs:344:4 | +| 1 | `str` | fixtures/reject/src/lib.rs:339:4 | | 1 | `u64` | fixtures/reject/src/lib.rs:75:2 | | 1 | `value` | fixtures/reject/src/lib.rs:31:2 | | 1 | `{async closure}` | fixtures/reject/src/lib.rs:50:2 | @@ -158,170 +157,168 @@ The type or module each refused type or path belongs to. | Count | Construct | Type or path | First | | ---: | --- | --- | --- | -| 6 | a raw pointer to `_` in a variable assigned again while it may point there | `(u32, u32)` | fixtures/reject/src/lib.rs:636:10 | -| 4 | a variant of `_`, which is not supported: either is the same JS string | `std::borrow::Cow` | fixtures/reject/src/lib.rs:349:2 | -| 3 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Gap` | fixtures/reject/src/lib.rs:933:10 | +| 6 | a raw pointer to `_` in a variable assigned again while it may point there | `(u32, u32)` | fixtures/reject/src/lib.rs:631:10 | +| 4 | a variant of `_`, which is not supported: either is the same JS string | `std::borrow::Cow` | fixtures/reject/src/lib.rs:344:2 | +| 3 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Gap` | fixtures/reject/src/lib.rs:928:10 | | 3 | unsupported type `_` | `f16` | fixtures/reject/src/lib.rs:7:14 | | 2 | `_` is not supported: its `None` and `Some` would both be `rt.None` | `Option` | fixtures/reject/src/lib.rs:16:15 | | 2 | `_` of `_`, whose `None` is `rt.None`, which is not supported yet | `Iterator::scan`, `Option` | fixtures/reject/src/lib.rs:37:4 | | 2 | `_`, a trait object of another crate's trait, which is not supported yet | `dyn std::iter::Iterator` | fixtures/reject/src/lib.rs:11:16 | -| 2 | `_`, a trait object of the generic trait `_`, which is not supported yet | `dyn Scaled`, `Scaled` | fixtures/reject/src/lib.rs:477:23 | -| 2 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::mem::MaybeUninit`, `Gap` | fixtures/reject/src/lib.rs:947:19 | -| 2 | a raw pointer to `_` in a variable assigned again while it may point there | `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:716:15 | +| 2 | `_`, a trait object of the generic trait `_`, which is not supported yet | `dyn Scaled`, `Scaled` | fixtures/reject/src/lib.rs:472:23 | +| 2 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::mem::MaybeUninit`, `Gap` | fixtures/reject/src/lib.rs:942:19 | +| 2 | a raw pointer to `_` in a variable assigned again while it may point there | `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:711:15 | | 2 | an assignment through a reference to `_` | `std::pin::Pin` | fixtures/reject/src/lib.rs:114:2 | | 2 | replacing the value behind a reference to `_` | `std::pin::Pin` | fixtures/reject/src/lib.rs:98:2 | -| 2 | unsupported call to `_` | `::sum` | fixtures/reject/src/lib.rs:447:17 | -| 1 | `Buf::copy_to_bytes` of `_`, a value JS copies, which is not supported | `Blank` | fixtures/reject/src/lib.rs:781:2 | -| 1 | `BufMut::put` of `_` into a `BytesMut`, which picks the methods it calls by a capacity that depends on whether the other handles of its storage dropped, which is not supported | `Counted` | fixtures/reject/src/lib.rs:407:2 | -| 1 | `Bytes::from_owner` of `_`, which would drop with the last clone of what it makes, which is not supported | `std::sync::Arc` | fixtures/reject/src/lib.rs:392:2 | -| 1 | `_` is not supported yet | `std::borrow::Cow` | fixtures/reject/src/lib.rs:360:18 | +| 2 | unsupported call to `_` | `::sum` | fixtures/reject/src/lib.rs:442:17 | +| 1 | `Buf::copy_to_bytes` of `_`, a value JS copies, which is not supported | `Blank` | fixtures/reject/src/lib.rs:776:2 | +| 1 | `BufMut::put` of `_` into a `BytesMut`, which picks the methods it calls by a capacity that depends on whether the other handles of its storage dropped, which is not supported | `Counted` | fixtures/reject/src/lib.rs:402:2 | +| 1 | `Bytes::from_owner` of `_`, which would drop with the last clone of what it makes, which is not supported | `std::sync::Arc` | fixtures/reject/src/lib.rs:387:2 | +| 1 | `_` is not supported yet | `std::borrow::Cow` | fixtures/reject/src/lib.rs:355:18 | | 1 | `_` is not supported: its `Pending` and `Ready` would both be `rt.OuterPending` | `Poll` | fixtures/reject/src/lib.rs:79:20 | | 1 | `_` is not supported: its field `_` is `_`, typed `_`, whose `None` would be `rt.None` as `_` | `Maybe`, `value`, `Option`, `T \| undefined`, `Option` | fixtures/reject/src/lib.rs:31:2 | -| 1 | `_` is not supported: its field `_` is `_`, typed `_`, whose `Pending` would be `rt.OuterPending` as `_` | `Waiting`, `poll`, `Poll`, `rt.Poll`, `Poll` | fixtures/reject/src/lib.rs:515:2 | -| 1 | `_` of `_` by `_`, which is not supported yet | `HashMap::contains_key`, `std::collections::HashMap`, `u8` | fixtures/reject/src/lib.rs:271:6 | -| 1 | `_` of `_`, which is not supported yet | `std::any::Any::type_id`, `dyn std::any::Any` | fixtures/reject/src/lib.rs:558:4 | -| 1 | `_` of `_`, whose `clone_from` is its own, which is not supported yet | `slice::clone_from_slice`, `Reused` | fixtures/reject/src/lib.rs:304:4 | +| 1 | `_` is not supported: its field `_` is `_`, typed `_`, whose `Pending` would be `rt.OuterPending` as `_` | `Waiting`, `poll`, `Poll`, `rt.Poll`, `Poll` | fixtures/reject/src/lib.rs:510:2 | +| 1 | `_` of `_` by `_`, which is not supported yet | `HashMap::contains_key`, `std::collections::HashMap`, `u8` | fixtures/reject/src/lib.rs:266:6 | +| 1 | `_` of `_`, which is not supported yet | `std::any::Any::type_id`, `dyn std::any::Any` | fixtures/reject/src/lib.rs:553:4 | +| 1 | `_` of `_`, whose `clone_from` is its own, which is not supported yet | `slice::clone_from_slice`, `Reused` | fixtures/reject/src/lib.rs:299:4 | | 1 | `_` of `_`, whose `clone_from` is its own, which is not supported yet | `slice::fill`, `Reused` | fixtures/reject/src/lib.rs:21:4 | -| 1 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | `std::collections::HashMap::into_keys` | fixtures/reject/src/lib.rs:836:6 | -| 1 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | `std::iter::Extend::extend` | fixtures/reject/src/lib.rs:955:6 | -| 1 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | `std::iter::Iterator::count` | fixtures/reject/src/lib.rs:232:38 | -| 1 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | `std::iter::Iterator::filter` | fixtures/reject/src/lib.rs:232:16 | -| 1 | `_` with a mutable reference to a value JS copies, which its mapping would copy | `std::sync::Mutex::get_mut` | fixtures/reject/src/lib.rs:534:12 | -| 1 | `_`, which is not supported yet | `Hasher::write` | fixtures/reject/src/lib.rs:279:9 | -| 1 | `_`, which reads a capacity that depends on whether the other handles of its storage dropped, which is not supported | `BytesMut::capacity` | fixtures/reject/src/lib.rs:401:6 | -| 1 | `collect` of `_`, which sorts by `_`'s own `Ord`, of entries that drop, which is not supported yet | `std::collections::BTreeMap`, `std::cell::Cell` | fixtures/reject/src/lib.rs:985:22 | +| 1 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | `std::collections::HashMap::into_keys` | fixtures/reject/src/lib.rs:831:6 | +| 1 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | `std::iter::Extend::extend` | fixtures/reject/src/lib.rs:950:6 | +| 1 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | `std::iter::Iterator::count` | fixtures/reject/src/lib.rs:227:38 | +| 1 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | `std::iter::Iterator::filter` | fixtures/reject/src/lib.rs:227:16 | +| 1 | `_` with a mutable reference to a value JS copies, which its mapping would copy | `std::sync::Mutex::get_mut` | fixtures/reject/src/lib.rs:529:12 | +| 1 | `_`, which is not supported yet | `Hasher::write` | fixtures/reject/src/lib.rs:274:9 | +| 1 | `_`, which reads a capacity that depends on whether the other handles of its storage dropped, which is not supported | `BytesMut::capacity` | fixtures/reject/src/lib.rs:396:6 | +| 1 | `collect` of `_`, which sorts by `_`'s own `Ord`, of entries that drop, which is not supported yet | `std::collections::BTreeMap`, `std::cell::Cell` | fixtures/reject/src/lib.rs:980:22 | | 1 | `fmt::Arguments` with a placeholder, or not made in place, written to `_`'s own `fmt::Write`, which is not supported yet: std splits what a placeholder writes into `write_str` calls the runtime does not make | `Sink` | fixtures/reject/src/lib.rs:62:10 | -| 1 | a `collect` in place of `_`, a zip std reads by index, holding values that drop, which is not supported yet | `std::iter::Map` | fixtures/reject/src/lib.rs:221:40 | -| 1 | a `skip` of `_`, a zip std reads by index, of items that drop, which is not supported yet | `std::iter::Zip` | fixtures/reject/src/lib.rs:214:8 | +| 1 | a `collect` in place of `_`, a zip std reads by index, holding values that drop, which is not supported yet | `std::iter::Map` | fixtures/reject/src/lib.rs:216:40 | +| 1 | a `skip` of `_`, a zip std reads by index, of items that drop, which is not supported yet | `std::iter::Zip` | fixtures/reject/src/lib.rs:209:8 | | 1 | a cast from `_` to `_` | `u64`, `f16` | fixtures/reject/src/lib.rs:75:2 | -| 1 | a cast from a pointer to `_` to one to `_`, which reads the bytes of one type as another | `u32`, `u8` | fixtures/reject/src/lib.rs:575:27 | -| 1 | a coercion to `_` | `std::sync::Arc` | fixtures/reject/src/lib.rs:309:2 | -| 1 | a coercion to `_`, which is not supported yet | `&Tail` | fixtures/reject/src/lib.rs:504:30 | -| 1 | a coercion to `_`, which is not supported yet | `std::sync::Weak` | fixtures/reject/src/lib.rs:468:40 | -| 1 | a constant of type `_`, a pointer into memory translation can't name | `&u32` | fixtures/reject/src/lib.rs:798:3 | -| 1 | a dangling pointer to `_`, a value of no bytes made of more than structs and tuples | `Only` | fixtures/reject/src/lib.rs:757:11 | +| 1 | a cast from a pointer to `_` to one to `_`, which reads the bytes of one type as another | `u32`, `u8` | fixtures/reject/src/lib.rs:570:27 | +| 1 | a coercion to `_` | `std::sync::Arc` | fixtures/reject/src/lib.rs:304:2 | +| 1 | a coercion to `_`, which is not supported yet | `&Tail` | fixtures/reject/src/lib.rs:499:30 | +| 1 | a coercion to `_`, which is not supported yet | `std::sync::Weak` | fixtures/reject/src/lib.rs:463:40 | +| 1 | a constant of type `_`, a pointer into memory translation can't name | `&u32` | fixtures/reject/src/lib.rs:793:3 | +| 1 | a dangling pointer to `_`, a value of no bytes made of more than structs and tuples | `Only` | fixtures/reject/src/lib.rs:752:11 | | 1 | a future of `_`, which can be `rt.Pending`, as the future's own `Pending` is | `std::task::Poll` | fixtures/reject/src/lib.rs:84:34 | -| 1 | a raw pointer to `_` behind a reference, which is the object and not where it is kept | `std::vec::Vec` | fixtures/reject/src/lib.rs:597:10 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Lane` | fixtures/reject/src/lib.rs:897:19 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Plain` | fixtures/reject/src/lib.rs:851:10 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Span2` | fixtures/reject/src/lib.rs:628:10 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Track` | fixtures/reject/src/lib.rs:877:19 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Window` | fixtures/reject/src/lib.rs:689:2 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:707:15 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Hits` | fixtures/reject/src/lib.rs:740:21 | -| 1 | a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet | `(u32, u32)` | fixtures/reject/src/lib.rs:699:10 | +| 1 | a raw pointer to `_` behind a reference, which is the object and not where it is kept | `std::vec::Vec` | fixtures/reject/src/lib.rs:592:10 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Lane` | fixtures/reject/src/lib.rs:892:19 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Plain` | fixtures/reject/src/lib.rs:846:10 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Span2` | fixtures/reject/src/lib.rs:623:10 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Track` | fixtures/reject/src/lib.rs:872:19 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Window` | fixtures/reject/src/lib.rs:684:2 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:702:15 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Hits` | fixtures/reject/src/lib.rs:735:21 | +| 1 | a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet | `(u32, u32)` | fixtures/reject/src/lib.rs:694:10 | | 1 | a scalar constant of type `_` | `f16` | fixtures/reject/src/lib.rs:8:2 | -| 1 | a trait object of `_`, which is not supported yet | `[u8; 4]` | fixtures/reject/src/lib.rs:494:26 | +| 1 | a trait object of `_`, which is not supported yet | `[u8; 4]` | fixtures/reject/src/lib.rs:489:26 | | 1 | a zero-sized constant of type `_` | `{async closure}` | fixtures/reject/src/lib.rs:50:2 | | 1 | an assignment through a reference to `_` | `std::sync::MutexGuard` | fixtures/reject/src/lib.rs:90:2 | -| 1 | an iterator of the crate implementing `_`, which is not supported yet | `DoubleEndedIterator` | fixtures/reject/src/lib.rs:157:1 | -| 1 | an iterator of the crate implementing `_`, which is not supported yet | `FusedIterator` | fixtures/reject/src/lib.rs:205:1 | -| 1 | an upcast from `_` to `_`, which is not supported yet | `dyn Keyed`, `dyn std::any::Any` | fixtures/reject/src/lib.rs:552:32 | +| 1 | an iterator of the crate implementing `_`, which is not supported yet | `DoubleEndedIterator` | fixtures/reject/src/lib.rs:152:1 | +| 1 | an iterator of the crate implementing `_`, which is not supported yet | `FusedIterator` | fixtures/reject/src/lib.rs:200:1 | +| 1 | an upcast from `_` to `_`, which is not supported yet | `dyn Keyed`, `dyn std::any::Any` | fixtures/reject/src/lib.rs:547:32 | | 1 | arithmetic on `_` | `f16` | fixtures/reject/src/lib.rs:8:2 | -| 1 | comparing `_` as a key, which is not supported yet | `std::collections::BTreeSet` | fixtures/reject/src/lib.rs:253:75 | -| 1 | comparing pointers to `_` in an atomic, which JS has no address of | `u32` | fixtures/reject/src/lib.rs:797:15 | -| 1 | comparing pointers to `_`, each a place JS makes of its own | `u32` | fixtures/reject/src/lib.rs:616:2 | -| 1 | constructing `_` | `std::borrow::Cow` | fixtures/reject/src/lib.rs:367:53 | -| 1 | hashing `_` as a key, which is not supported yet | `std::collections::BTreeSet` | fixtures/reject/src/lib.rs:253:75 | -| 1 | hashing `_` through `_`'s own `Hash::hash_slice`, which is not supported yet | `std::vec::Vec`, `Batched` | fixtures/reject/src/lib.rs:328:16 | -| 1 | overriding `_`, which std's adaptors call in place of `next` or beside it | `Iterator::fold` | fixtures/reject/src/lib.rs:137:2 | -| 1 | overriding `_`, which std's adaptors call in place of `next` or beside it | `Iterator::size_hint` | fixtures/reject/src/lib.rs:185:2 | -| 1 | passing `_`, a closure that owns a value that drops, to `_`, which is not supported yet | `{closure}`, `Entry::or_insert_with` | fixtures/reject/src/lib.rs:337:13 | -| 1 | passing `_`, which drops, to `_`, which is not supported yet | `{closure}`, `String::retain` | fixtures/reject/src/lib.rs:804:4 | -| 1 | passing `_`, which drops, to `_`, which is not supported yet | `{closure}`, `str::contains` | fixtures/reject/src/lib.rs:344:4 | +| 1 | comparing `_` as a key, which is not supported yet | `std::collections::BTreeSet` | fixtures/reject/src/lib.rs:248:75 | +| 1 | comparing pointers to `_` in an atomic, which JS has no address of | `u32` | fixtures/reject/src/lib.rs:792:15 | +| 1 | comparing pointers to `_`, each a place JS makes of its own | `u32` | fixtures/reject/src/lib.rs:611:2 | +| 1 | constructing `_` | `std::borrow::Cow` | fixtures/reject/src/lib.rs:362:53 | +| 1 | hashing `_` as a key, which is not supported yet | `std::collections::BTreeSet` | fixtures/reject/src/lib.rs:248:75 | +| 1 | hashing `_` through `_`'s own `Hash::hash_slice`, which is not supported yet | `std::vec::Vec`, `Batched` | fixtures/reject/src/lib.rs:323:16 | +| 1 | overriding `_`, which std's adaptors call in place of `next` or beside it | `Iterator::fold` | fixtures/reject/src/lib.rs:132:2 | +| 1 | overriding `_`, which std's adaptors call in place of `next` or beside it | `Iterator::size_hint` | fixtures/reject/src/lib.rs:180:2 | +| 1 | passing `_`, a closure that owns a value that drops, to `_`, which is not supported yet | `{closure}`, `Entry::or_insert_with` | fixtures/reject/src/lib.rs:332:13 | +| 1 | passing `_`, which drops, to `_`, which is not supported yet | `{closure}`, `String::retain` | fixtures/reject/src/lib.rs:799:4 | +| 1 | passing `_`, which drops, to `_`, which is not supported yet | `{closure}`, `str::contains` | fixtures/reject/src/lib.rs:339:4 | | 1 | replacing the value behind a reference to `_` | `std::sync::MutexGuard` | fixtures/reject/src/lib.rs:119:2 | -| 1 | union `_`, whose fields overlap in `_` and `f64`, which JS keeps apart | `Bits`, `u32` | fixtures/reject/src/lib.rs:602:1 | -| 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:558:2 | -| 1 | unsupported call to `_` | `::deref` | fixtures/reject/src/lib.rs:361:2 | -| 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:387:2 | -| 1 | unsupported call to `_` | `::cycle` | fixtures/reject/src/lib.rs:124:11 | -| 1 | unsupported call to `_` | `::is_sorted` | fixtures/reject/src/lib.rs:786:15 | -| 1 | unsupported call to `_` | `::clone_from` | fixtures/reject/src/lib.rs:911:10 | -| 1 | unsupported call to `_` | `::hash` | fixtures/reject/src/lib.rs:319:10 | -| 1 | unsupported call to `_` | `std::any::TypeId::of` | fixtures/reject/src/lib.rs:558:17 | -| 1 | unsupported call to `_` | `std::ops::Range::contains` | fixtures/reject/src/lib.rs:172:8 | -| 1 | unsupported call to `_` | `std::std::Layout::new` | fixtures/reject/src/lib.rs:585:15 | -| 1 | unsupported call to `_` | `std::std::alloc` | fixtures/reject/src/lib.rs:587:11 | -| 1 | unsupported call to `_` | `std::std::dealloc` | fixtures/reject/src/lib.rs:590:3 | -| 1 | unsupported call to `_` | `std::str::parse` | fixtures/reject/src/lib.rs:452:4 | -| 1 | unsupported type `_` from another crate | `std::net::AddrParseError` | fixtures/reject/src/lib.rs:451:32 | -| 1 | unsupported type `_` from another crate | `std::net::Ipv4Addr` | fixtures/reject/src/lib.rs:451:32 | +| 1 | union `_`, whose fields overlap in `_` and `f64`, which JS keeps apart | `Bits`, `u32` | fixtures/reject/src/lib.rs:597:1 | +| 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:553:2 | +| 1 | unsupported call to `_` | `::deref` | fixtures/reject/src/lib.rs:356:2 | +| 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:382:2 | +| 1 | unsupported call to `_` | `::is_sorted` | fixtures/reject/src/lib.rs:781:15 | +| 1 | unsupported call to `_` | `::clone_from` | fixtures/reject/src/lib.rs:906:10 | +| 1 | unsupported call to `_` | `::hash` | fixtures/reject/src/lib.rs:314:10 | +| 1 | unsupported call to `_` | `std::any::TypeId::of` | fixtures/reject/src/lib.rs:553:17 | +| 1 | unsupported call to `_` | `std::ops::Range::contains` | fixtures/reject/src/lib.rs:167:8 | +| 1 | unsupported call to `_` | `std::std::Layout::new` | fixtures/reject/src/lib.rs:580:15 | +| 1 | unsupported call to `_` | `std::std::alloc` | fixtures/reject/src/lib.rs:582:11 | +| 1 | unsupported call to `_` | `std::std::dealloc` | fixtures/reject/src/lib.rs:585:3 | +| 1 | unsupported call to `_` | `std::str::parse` | fixtures/reject/src/lib.rs:447:4 | +| 1 | unsupported type `_` from another crate | `std::net::AddrParseError` | fixtures/reject/src/lib.rs:446:32 | +| 1 | unsupported type `_` from another crate | `std::net::Ipv4Addr` | fixtures/reject/src/lib.rs:446:32 | ## Spans -
unsupported call to `_` (15) +
unsupported call to `_` (14) -- fixtures/reject/src/lib.rs:124:11: unsupported call to ` as std::iter::Iterator>::cycle` -- fixtures/reject/src/lib.rs:172:8: unsupported call to `std::ops::Range::::contains::` -- fixtures/reject/src/lib.rs:319:10: unsupported call to `::hash::` -- fixtures/reject/src/lib.rs:361:2: unsupported call to ` as std::ops::Deref>::deref` -- fixtures/reject/src/lib.rs:387:2: unsupported call to ` as std::cmp::PartialEq>::eq` -- fixtures/reject/src/lib.rs:447:17: unsupported call to ` as std::iter::Iterator>::sum::` -- fixtures/reject/src/lib.rs:447:38: unsupported call to ` as std::iter::Iterator>::sum::` -- fixtures/reject/src/lib.rs:452:4: unsupported call to `core::str::::parse::` -- fixtures/reject/src/lib.rs:558:2: unsupported call to `::eq` -- fixtures/reject/src/lib.rs:558:17: unsupported call to `std::any::TypeId::of::` -- fixtures/reject/src/lib.rs:585:15: unsupported call to `std::alloc::Layout::new::` -- fixtures/reject/src/lib.rs:587:11: unsupported call to `std::alloc::alloc` -- fixtures/reject/src/lib.rs:590:3: unsupported call to `std::alloc::dealloc` -- fixtures/reject/src/lib.rs:786:15: unsupported call to ` as std::iter::Iterator>::is_sorted` -- fixtures/reject/src/lib.rs:911:10: unsupported call to ` as std::clone::Clone>::clone_from` +- fixtures/reject/src/lib.rs:167:8: unsupported call to `std::ops::Range::::contains::` +- fixtures/reject/src/lib.rs:314:10: unsupported call to `::hash::` +- fixtures/reject/src/lib.rs:356:2: unsupported call to ` as std::ops::Deref>::deref` +- fixtures/reject/src/lib.rs:382:2: unsupported call to ` as std::cmp::PartialEq>::eq` +- fixtures/reject/src/lib.rs:442:17: unsupported call to ` as std::iter::Iterator>::sum::` +- fixtures/reject/src/lib.rs:442:38: unsupported call to ` as std::iter::Iterator>::sum::` +- fixtures/reject/src/lib.rs:447:4: unsupported call to `core::str::::parse::` +- fixtures/reject/src/lib.rs:553:2: unsupported call to `::eq` +- fixtures/reject/src/lib.rs:553:17: unsupported call to `std::any::TypeId::of::` +- fixtures/reject/src/lib.rs:580:15: unsupported call to `std::alloc::Layout::new::` +- fixtures/reject/src/lib.rs:582:11: unsupported call to `std::alloc::alloc` +- fixtures/reject/src/lib.rs:585:3: unsupported call to `std::alloc::dealloc` +- fixtures/reject/src/lib.rs:781:15: unsupported call to ` as std::iter::Iterator>::is_sorted` +- fixtures/reject/src/lib.rs:906:10: unsupported call to ` as std::clone::Clone>::clone_from`
a raw pointer to `_` in `_`, which the crate may put another object in place of (12) -- fixtures/reject/src/lib.rs:628:10: a raw pointer to `(u32, u32)` in `Span2`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:689:2: a raw pointer to `(u32, u32)` in `Window`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:707:15: a raw pointer to `(u32, u32)` in `std::cell::UnsafeCell<(u32, u32)>`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:740:21: a raw pointer to `std::cell::UnsafeCell` in `Hits`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:851:10: a raw pointer to `(u32, u32)` in `Plain`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:877:19: a raw pointer to `(u32, u32)` in `Track`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:897:19: a raw pointer to `(u32, u32)` in `Lane`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:933:10: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:934:10: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:935:58: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:947:19: a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:948:19: a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:623:10: a raw pointer to `(u32, u32)` in `Span2`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:684:2: a raw pointer to `(u32, u32)` in `Window`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:702:15: a raw pointer to `(u32, u32)` in `std::cell::UnsafeCell<(u32, u32)>`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:735:21: a raw pointer to `std::cell::UnsafeCell` in `Hits`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:846:10: a raw pointer to `(u32, u32)` in `Plain`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:872:19: a raw pointer to `(u32, u32)` in `Track`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:892:19: a raw pointer to `(u32, u32)` in `Lane`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:928:10: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:929:10: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:930:58: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:942:19: a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:943:19: a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of
a raw pointer to `_` in a variable assigned again while it may point there (8) -- fixtures/reject/src/lib.rs:636:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:644:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:653:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:661:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:670:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:678:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:716:15: a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:729:15: a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:631:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:639:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:648:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:656:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:665:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:673:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:711:15: a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:724:15: a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there
`_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it (4) -- fixtures/reject/src/lib.rs:232:16: `std::iter::Iterator::filter` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it -- fixtures/reject/src/lib.rs:232:38: `std::iter::Iterator::count` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it -- fixtures/reject/src/lib.rs:836:6: `std::collections::HashMap::::into_keys` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it -- fixtures/reject/src/lib.rs:955:6: `std::iter::Extend::extend` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it +- fixtures/reject/src/lib.rs:227:16: `std::iter::Iterator::filter` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it +- fixtures/reject/src/lib.rs:227:38: `std::iter::Iterator::count` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it +- fixtures/reject/src/lib.rs:831:6: `std::collections::HashMap::::into_keys` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it +- fixtures/reject/src/lib.rs:950:6: `std::iter::Extend::extend` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it
a variant of `_`, which is not supported: either is the same JS string (4) -- fixtures/reject/src/lib.rs:349:2: a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string -- fixtures/reject/src/lib.rs:350:30: a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string -- fixtures/reject/src/lib.rs:351:27: a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string -- fixtures/reject/src/lib.rs:356:2: a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string +- fixtures/reject/src/lib.rs:344:2: a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string +- fixtures/reject/src/lib.rs:345:30: a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string +- fixtures/reject/src/lib.rs:346:27: a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string +- fixtures/reject/src/lib.rs:351:2: a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string
a copy of a closure that changes what it captured (3) -- fixtures/reject/src/lib.rs:242:14: a copy of a closure that changes what it captured -- fixtures/reject/src/lib.rs:527:14: a copy of a closure that changes what it captured -- fixtures/reject/src/lib.rs:528:14: a copy of a closure that changes what it captured +- fixtures/reject/src/lib.rs:237:14: a copy of a closure that changes what it captured +- fixtures/reject/src/lib.rs:522:14: a copy of a closure that changes what it captured +- fixtures/reject/src/lib.rs:523:14: a copy of a closure that changes what it captured
@@ -329,7 +326,7 @@ The type or module each refused type or path belongs to. - fixtures/reject/src/lib.rs:90:2: an assignment through a reference to `std::sync::MutexGuard<'_, u8>` - fixtures/reject/src/lib.rs:114:2: an assignment through a reference to `std::pin::Pin>>` -- fixtures/reject/src/lib.rs:226:2: an assignment through a reference to `std::pin::Pin<&mut Noisy>` +- fixtures/reject/src/lib.rs:221:2: an assignment through a reference to `std::pin::Pin<&mut Noisy>`
@@ -359,14 +356,14 @@ The type or module each refused type or path belongs to.
`_` of `_`, whose `None` is `rt.None`, which is not supported yet (2) - fixtures/reject/src/lib.rs:37:4: `Iterator::scan` of `Option>`, whose `None` is `rt.None`, which is not supported yet -- fixtures/reject/src/lib.rs:248:11: `Iterator::scan` of `Option<()>`, whose `None` is `rt.None`, which is not supported yet +- fixtures/reject/src/lib.rs:243:11: `Iterator::scan` of `Option<()>`, whose `None` is `rt.None`, which is not supported yet
`_` of `_`, whose `clone_from` is its own, which is not supported yet (2) - fixtures/reject/src/lib.rs:21:4: `slice::fill` of `Reused`, whose `clone_from` is its own, which is not supported yet -- fixtures/reject/src/lib.rs:304:4: `slice::clone_from_slice` of `Reused`, whose `clone_from` is its own, which is not supported yet +- fixtures/reject/src/lib.rs:299:4: `slice::clone_from_slice` of `Reused`, whose `clone_from` is its own, which is not supported yet
@@ -379,61 +376,61 @@ The type or module each refused type or path belongs to.
`_`, a trait object of the generic trait `_`, which is not supported yet (2) -- fixtures/reject/src/lib.rs:477:23: `dyn Scaled`, a trait object of the generic trait `Scaled`, which is not supported yet -- fixtures/reject/src/lib.rs:478:4: `dyn Scaled`, a trait object of the generic trait `Scaled`, which is not supported yet +- fixtures/reject/src/lib.rs:472:23: `dyn Scaled`, a trait object of the generic trait `Scaled`, which is not supported yet +- fixtures/reject/src/lib.rs:473:4: `dyn Scaled`, a trait object of the generic trait `Scaled`, which is not supported yet
a coercion to `_`, which is not supported yet (2) -- fixtures/reject/src/lib.rs:468:40: a coercion to `std::sync::Weak`, which is not supported yet -- fixtures/reject/src/lib.rs:504:30: a coercion to `&Tail`, which is not supported yet +- fixtures/reject/src/lib.rs:463:40: a coercion to `std::sync::Weak`, which is not supported yet +- fixtures/reject/src/lib.rs:499:30: a coercion to `&Tail`, which is not supported yet
an iterator of the crate implementing `_`, which is not supported yet (2) -- fixtures/reject/src/lib.rs:157:1: an iterator of the crate implementing `DoubleEndedIterator`, which is not supported yet -- fixtures/reject/src/lib.rs:205:1: an iterator of the crate implementing `FusedIterator`, which is not supported yet +- fixtures/reject/src/lib.rs:152:1: an iterator of the crate implementing `DoubleEndedIterator`, which is not supported yet +- fixtures/reject/src/lib.rs:200:1: an iterator of the crate implementing `FusedIterator`, which is not supported yet
overriding `_`, which std's adaptors call in place of `next` or beside it (2) -- fixtures/reject/src/lib.rs:137:2: overriding `Iterator::fold`, which std's adaptors call in place of `next` or beside it -- fixtures/reject/src/lib.rs:185:2: overriding `Iterator::size_hint`, which std's adaptors call in place of `next` or beside it +- fixtures/reject/src/lib.rs:132:2: overriding `Iterator::fold`, which std's adaptors call in place of `next` or beside it +- fixtures/reject/src/lib.rs:180:2: overriding `Iterator::size_hint`, which std's adaptors call in place of `next` or beside it
passing `_`, which drops, to `_`, which is not supported yet (2) -- fixtures/reject/src/lib.rs:344:4: passing `{closure@fixtures/reject/src/lib.rs:344:13: 344:27}`, which drops, to `str::contains`, which is not supported yet -- fixtures/reject/src/lib.rs:804:4: passing `{closure@fixtures/reject/src/lib.rs:804:11: 804:19}`, which drops, to `String::retain`, which is not supported yet +- fixtures/reject/src/lib.rs:339:4: passing `{closure@fixtures/reject/src/lib.rs:339:13: 339:27}`, which drops, to `str::contains`, which is not supported yet +- fixtures/reject/src/lib.rs:799:4: passing `{closure@fixtures/reject/src/lib.rs:799:11: 799:19}`, which drops, to `String::retain`, which is not supported yet
unsupported type `_` from another crate (2) -- fixtures/reject/src/lib.rs:451:32: unsupported type `std::net::AddrParseError` from another crate -- fixtures/reject/src/lib.rs:451:32: unsupported type `std::net::Ipv4Addr` from another crate +- fixtures/reject/src/lib.rs:446:32: unsupported type `std::net::AddrParseError` from another crate +- fixtures/reject/src/lib.rs:446:32: unsupported type `std::net::Ipv4Addr` from another crate
`Buf::copy_to_bytes` of `_`, a value JS copies, which is not supported (1) -- fixtures/reject/src/lib.rs:781:2: `Buf::copy_to_bytes` of `Blank`, a value JS copies, which is not supported +- fixtures/reject/src/lib.rs:776:2: `Buf::copy_to_bytes` of `Blank`, a value JS copies, which is not supported
`BufMut::put` of `_` into a `BytesMut`, which picks the methods it calls by a capacity that depends on whether the other handles of its storage dropped, which is not supported (1) -- fixtures/reject/src/lib.rs:407:2: `BufMut::put` of `Counted` into a `BytesMut`, which picks the methods it calls by a capacity that depends on whether the other handles of its storage dropped, which is not supported +- fixtures/reject/src/lib.rs:402:2: `BufMut::put` of `Counted` into a `BytesMut`, which picks the methods it calls by a capacity that depends on whether the other handles of its storage dropped, which is not supported
`Bytes::from_owner` of `_`, which would drop with the last clone of what it makes, which is not supported (1) -- fixtures/reject/src/lib.rs:392:2: `Bytes::from_owner` of `std::sync::Arc<[u8]>`, which would drop with the last clone of what it makes, which is not supported +- fixtures/reject/src/lib.rs:387:2: `Bytes::from_owner` of `std::sync::Arc<[u8]>`, which would drop with the last clone of what it makes, which is not supported
@@ -445,7 +442,7 @@ The type or module each refused type or path belongs to.
`_` is not supported yet (1) -- fixtures/reject/src/lib.rs:360:18: `std::borrow::Cow<'_, [u8]>` is not supported yet +- fixtures/reject/src/lib.rs:355:18: `std::borrow::Cow<'_, [u8]>` is not supported yet
@@ -463,43 +460,43 @@ The type or module each refused type or path belongs to.
`_` is not supported: its field `_` is `_`, typed `_`, whose `Pending` would be `rt.OuterPending` as `_` (1) -- fixtures/reject/src/lib.rs:515:2: `Waiting>` is not supported: its field `poll` is `Poll`, typed `rt.Poll`, whose `Pending` would be `rt.OuterPending` as `Poll>` +- fixtures/reject/src/lib.rs:510:2: `Waiting>` is not supported: its field `poll` is `Poll`, typed `rt.Poll`, whose `Pending` would be `rt.OuterPending` as `Poll>`
`_` of `_` by `_`, which is not supported yet (1) -- fixtures/reject/src/lib.rs:271:6: `HashMap::contains_key` of `std::collections::HashMap` by `u8`, which is not supported yet +- fixtures/reject/src/lib.rs:266:6: `HashMap::contains_key` of `std::collections::HashMap` by `u8`, which is not supported yet
`_` of `_`, which is not supported yet (1) -- fixtures/reject/src/lib.rs:558:4: `std::any::Any::type_id` of `dyn std::any::Any`, which is not supported yet +- fixtures/reject/src/lib.rs:553:4: `std::any::Any::type_id` of `dyn std::any::Any`, which is not supported yet
`_` with a mutable reference to a value JS copies, which its mapping would copy (1) -- fixtures/reject/src/lib.rs:534:12: `std::sync::Mutex::::get_mut` with a mutable reference to a value JS copies, which its mapping would copy +- fixtures/reject/src/lib.rs:529:12: `std::sync::Mutex::::get_mut` with a mutable reference to a value JS copies, which its mapping would copy
`_`, which is not supported yet (1) -- fixtures/reject/src/lib.rs:279:9: `Hasher::write`, which is not supported yet +- fixtures/reject/src/lib.rs:274:9: `Hasher::write`, which is not supported yet
`_`, which reads a capacity that depends on whether the other handles of its storage dropped, which is not supported (1) -- fixtures/reject/src/lib.rs:401:6: `BytesMut::capacity`, which reads a capacity that depends on whether the other handles of its storage dropped, which is not supported +- fixtures/reject/src/lib.rs:396:6: `BytesMut::capacity`, which reads a capacity that depends on whether the other handles of its storage dropped, which is not supported
`collect` of `_`, which sorts by `_`'s own `Ord`, of entries that drop, which is not supported yet (1) -- fixtures/reject/src/lib.rs:985:22: `collect` of `std::collections::BTreeMap, Noisy>`, which sorts by `std::cell::Cell`'s own `Ord`, of entries that drop, which is not supported yet +- fixtures/reject/src/lib.rs:980:22: `collect` of `std::collections::BTreeMap, Noisy>`, which sorts by `std::cell::Cell`'s own `Ord`, of entries that drop, which is not supported yet
@@ -511,13 +508,13 @@ The type or module each refused type or path belongs to.
a `collect` in place of `_`, a zip std reads by index, holding values that drop, which is not supported yet (1) -- fixtures/reject/src/lib.rs:221:40: a `collect` in place of `std::iter::Map, {closure@fixtures/reject/src/lib.rs:220:32: 220:40}>, std::ops::Range>, {closure@fixtures/reject/src/lib.rs:221:24: 221:32}>`, a zip std reads by index, holding values that drop, which is not supported yet +- fixtures/reject/src/lib.rs:216:40: a `collect` in place of `std::iter::Map, {closure@fixtures/reject/src/lib.rs:215:32: 215:40}>, std::ops::Range>, {closure@fixtures/reject/src/lib.rs:216:24: 216:32}>`, a zip std reads by index, holding values that drop, which is not supported yet
a `skip` of `_`, a zip std reads by index, of items that drop, which is not supported yet (1) -- fixtures/reject/src/lib.rs:214:8: a `skip` of `std::iter::Zip, {closure@fixtures/reject/src/lib.rs:213:27: 213:31}>, std::iter::Map, {closure@fixtures/reject/src/lib.rs:213:59: 213:63}>>`, a zip std reads by index, of items that drop, which is not supported yet +- fixtures/reject/src/lib.rs:209:8: a `skip` of `std::iter::Zip, {closure@fixtures/reject/src/lib.rs:208:27: 208:31}>, std::iter::Map, {closure@fixtures/reject/src/lib.rs:208:59: 208:63}>>`, a zip std reads by index, of items that drop, which is not supported yet
@@ -529,25 +526,25 @@ The type or module each refused type or path belongs to.
a cast from a pointer to `_` to one to `_`, which reads the bytes of one type as another (1) -- fixtures/reject/src/lib.rs:575:27: a cast from a pointer to `u32` to one to `u8`, which reads the bytes of one type as another +- fixtures/reject/src/lib.rs:570:27: a cast from a pointer to `u32` to one to `u8`, which reads the bytes of one type as another
a coercion to `_` (1) -- fixtures/reject/src/lib.rs:309:2: a coercion to `std::sync::Arc<[u8]>` +- fixtures/reject/src/lib.rs:304:2: a coercion to `std::sync::Arc<[u8]>`
a constant of type `_`, a pointer into memory translation can't name (1) -- fixtures/reject/src/lib.rs:798:3: a constant of type `&u32`, a pointer into memory translation can't name +- fixtures/reject/src/lib.rs:793:3: a constant of type `&u32`, a pointer into memory translation can't name
a dangling pointer to `_`, a value of no bytes made of more than structs and tuples (1) -- fixtures/reject/src/lib.rs:757:11: a dangling pointer to `Only`, a value of no bytes made of more than structs and tuples +- fixtures/reject/src/lib.rs:752:11: a dangling pointer to `Only`, a value of no bytes made of more than structs and tuples
@@ -559,7 +556,7 @@ The type or module each refused type or path belongs to.
a mutable reference into a `Result`'s payload, passed on or kept (1) -- fixtures/reject/src/lib.rs:380:12: a mutable reference into a `Result`'s payload, passed on or kept +- fixtures/reject/src/lib.rs:375:12: a mutable reference into a `Result`'s payload, passed on or kept
@@ -571,7 +568,7 @@ The type or module each refused type or path belongs to.
a pointer's address, which JS has no counterpart of (1) -- fixtures/reject/src/lib.rs:580:17: a pointer's address, which JS has no counterpart of +- fixtures/reject/src/lib.rs:575:17: a pointer's address, which JS has no counterpart of
@@ -583,13 +580,13 @@ The type or module each refused type or path belongs to.
a raw pointer to `_` behind a reference, which is the object and not where it is kept (1) -- fixtures/reject/src/lib.rs:597:10: a raw pointer to `std::vec::Vec` behind a reference, which is the object and not where it is kept +- fixtures/reject/src/lib.rs:592:10: a raw pointer to `std::vec::Vec` behind a reference, which is the object and not where it is kept
a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet (1) -- fixtures/reject/src/lib.rs:699:10: a raw pointer to `(u32, u32)` in an element, a payload, or a union field, which is not supported yet +- fixtures/reject/src/lib.rs:694:10: a raw pointer to `(u32, u32)` in an element, a payload, or a union field, which is not supported yet
@@ -601,7 +598,7 @@ The type or module each refused type or path belongs to.
a trait object of `_`, which is not supported yet (1) -- fixtures/reject/src/lib.rs:494:26: a trait object of `[u8; 4]`, which is not supported yet +- fixtures/reject/src/lib.rs:489:26: a trait object of `[u8; 4]`, which is not supported yet
@@ -613,7 +610,7 @@ The type or module each refused type or path belongs to.
an upcast from `_` to `_`, which is not supported yet (1) -- fixtures/reject/src/lib.rs:552:32: an upcast from `dyn Keyed` to `dyn std::any::Any`, which is not supported yet +- fixtures/reject/src/lib.rs:547:32: an upcast from `dyn Keyed` to `dyn std::any::Any`, which is not supported yet
@@ -625,54 +622,54 @@ The type or module each refused type or path belongs to.
comparing `_` as a key, which is not supported yet (1) -- fixtures/reject/src/lib.rs:253:75: comparing `std::collections::BTreeSet` as a key, which is not supported yet +- fixtures/reject/src/lib.rs:248:75: comparing `std::collections::BTreeSet` as a key, which is not supported yet
comparing pointers to `()`, which has no bytes and so no address of its own (1) -- fixtures/reject/src/lib.rs:748:2: comparing pointers to `()`, which has no bytes and so no address of its own +- fixtures/reject/src/lib.rs:743:2: comparing pointers to `()`, which has no bytes and so no address of its own
comparing pointers to `_` in an atomic, which JS has no address of (1) -- fixtures/reject/src/lib.rs:797:15: comparing pointers to `u32` in an atomic, which JS has no address of +- fixtures/reject/src/lib.rs:792:15: comparing pointers to `u32` in an atomic, which JS has no address of
comparing pointers to `_`, each a place JS makes of its own (1) -- fixtures/reject/src/lib.rs:616:2: comparing pointers to `u32`, each a place JS makes of its own +- fixtures/reject/src/lib.rs:611:2: comparing pointers to `u32`, each a place JS makes of its own
constructing `_` (1) -- fixtures/reject/src/lib.rs:367:53: constructing `std::borrow::Cow<'_, std::sync::Arc>` +- fixtures/reject/src/lib.rs:362:53: constructing `std::borrow::Cow<'_, std::sync::Arc>`
hashing `_` as a key, which is not supported yet (1) -- fixtures/reject/src/lib.rs:253:75: hashing `std::collections::BTreeSet` as a key, which is not supported yet +- fixtures/reject/src/lib.rs:248:75: hashing `std::collections::BTreeSet` as a key, which is not supported yet
hashing `_` through `_`'s own `Hash::hash_slice`, which is not supported yet (1) -- fixtures/reject/src/lib.rs:328:16: hashing `std::vec::Vec` through `Batched`'s own `Hash::hash_slice`, which is not supported yet +- fixtures/reject/src/lib.rs:323:16: hashing `std::vec::Vec` through `Batched`'s own `Hash::hash_slice`, which is not supported yet
passing `_`, a closure that owns a value that drops, to `_`, which is not supported yet (1) -- fixtures/reject/src/lib.rs:337:13: passing `{closure@fixtures/reject/src/lib.rs:337:28: 337:35}`, a closure that owns a value that drops, to `Entry::or_insert_with`, which is not supported yet +- fixtures/reject/src/lib.rs:332:13: passing `{closure@fixtures/reject/src/lib.rs:332:28: 332:35}`, a closure that owns a value that drops, to `Entry::or_insert_with`, which is not supported yet
union `_`, whose fields overlap in `_` and `f64`, which JS keeps apart (1) -- fixtures/reject/src/lib.rs:602:1: union `Bits`, whose fields overlap in `u32` and `f64`, which JS keeps apart +- fixtures/reject/src/lib.rs:597:1: union `Bits`, whose fields overlap in `u32` and `f64`, which JS keeps apart
diff --git a/ts/fixtures/reject/expected.txt b/ts/fixtures/reject/expected.txt index a7556f84b..564e3df56 100644 --- a/ts/fixtures/reject/expected.txt +++ b/ts/fixtures/reject/expected.txt @@ -25,94 +25,93 @@ replacing the value behind a reference to `std::sync::MutexGuard<'_, u8>` at fix replacing the value behind a reference to `std::pin::Pin fn(&'a mut std::task::Context<'b>) -> std::task::Poll>>>` at fixtures/reject/src/lib.rs:98:2 an assignment through a reference to `std::pin::Pin>>` at fixtures/reject/src/lib.rs:114:2 replacing the value behind a reference to `std::pin::Pin>` at fixtures/reject/src/lib.rs:106:2 -unsupported call to ` as std::iter::Iterator>::cycle` at fixtures/reject/src/lib.rs:124:11 -unsupported call to `std::ops::Range::::contains::` at fixtures/reject/src/lib.rs:172:8 -a `skip` of `std::iter::Zip, {closure@fixtures/reject/src/lib.rs:213:27: 213:31}>, std::iter::Map, {closure@fixtures/reject/src/lib.rs:213:59: 213:63}>>`, a zip std reads by index, of items that drop, which is not supported yet at fixtures/reject/src/lib.rs:214:8 -a `collect` in place of `std::iter::Map, {closure@fixtures/reject/src/lib.rs:220:32: 220:40}>, std::ops::Range>, {closure@fixtures/reject/src/lib.rs:221:24: 221:32}>`, a zip std reads by index, holding values that drop, which is not supported yet at fixtures/reject/src/lib.rs:221:40 -an assignment through a reference to `std::pin::Pin<&mut Noisy>` at fixtures/reject/src/lib.rs:226:2 -`std::iter::Iterator::filter` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it at fixtures/reject/src/lib.rs:232:16 -`std::iter::Iterator::count` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it at fixtures/reject/src/lib.rs:232:38 -a copy of a closure that changes what it captured at fixtures/reject/src/lib.rs:242:14 -`Iterator::scan` of `Option<()>`, whose `None` is `rt.None`, which is not supported yet at fixtures/reject/src/lib.rs:248:11 -hashing `std::collections::BTreeSet` as a key, which is not supported yet at fixtures/reject/src/lib.rs:253:75 -comparing `std::collections::BTreeSet` as a key, which is not supported yet at fixtures/reject/src/lib.rs:253:75 -`HashMap::contains_key` of `std::collections::HashMap` by `u8`, which is not supported yet at fixtures/reject/src/lib.rs:271:6 -`slice::clone_from_slice` of `Reused`, whose `clone_from` is its own, which is not supported yet at fixtures/reject/src/lib.rs:304:4 -a coercion to `std::sync::Arc<[u8]>` at fixtures/reject/src/lib.rs:309:2 -a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string at fixtures/reject/src/lib.rs:349:2 -a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string at fixtures/reject/src/lib.rs:351:27 -a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string at fixtures/reject/src/lib.rs:350:30 -a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string at fixtures/reject/src/lib.rs:356:2 -`std::borrow::Cow<'_, [u8]>` is not supported yet at fixtures/reject/src/lib.rs:360:18 -unsupported call to ` as std::ops::Deref>::deref` at fixtures/reject/src/lib.rs:361:2 -constructing `std::borrow::Cow<'_, std::sync::Arc>` at fixtures/reject/src/lib.rs:367:53 -hashing `std::vec::Vec` through `Batched`'s own `Hash::hash_slice`, which is not supported yet at fixtures/reject/src/lib.rs:328:16 -passing `{closure@fixtures/reject/src/lib.rs:337:28: 337:35}`, a closure that owns a value that drops, to `Entry::or_insert_with`, which is not supported yet at fixtures/reject/src/lib.rs:337:13 -passing `{closure@fixtures/reject/src/lib.rs:344:13: 344:27}`, which drops, to `str::contains`, which is not supported yet at fixtures/reject/src/lib.rs:344:4 -unsupported call to ` as std::iter::Iterator>::sum::` at fixtures/reject/src/lib.rs:447:17 -unsupported call to ` as std::iter::Iterator>::sum::` at fixtures/reject/src/lib.rs:447:38 -a mutable reference into a `Result`'s payload, passed on or kept at fixtures/reject/src/lib.rs:380:12 -unsupported call to ` as std::cmp::PartialEq>::eq` at fixtures/reject/src/lib.rs:387:2 -`Bytes::from_owner` of `std::sync::Arc<[u8]>`, which would drop with the last clone of what it makes, which is not supported at fixtures/reject/src/lib.rs:392:2 -`BytesMut::capacity`, which reads a capacity that depends on whether the other handles of its storage dropped, which is not supported at fixtures/reject/src/lib.rs:401:6 -`BufMut::put` of `Counted` into a `BytesMut`, which picks the methods it calls by a capacity that depends on whether the other handles of its storage dropped, which is not supported at fixtures/reject/src/lib.rs:407:2 -unsupported call to `core::str::::parse::` at fixtures/reject/src/lib.rs:452:4 -unsupported type `std::net::Ipv4Addr` from another crate at fixtures/reject/src/lib.rs:451:32 -unsupported type `std::net::AddrParseError` from another crate at fixtures/reject/src/lib.rs:451:32 -a coercion to `std::sync::Weak`, which is not supported yet at fixtures/reject/src/lib.rs:468:40 -`dyn Scaled`, a trait object of the generic trait `Scaled`, which is not supported yet at fixtures/reject/src/lib.rs:477:23 -`dyn Scaled`, a trait object of the generic trait `Scaled`, which is not supported yet at fixtures/reject/src/lib.rs:478:4 -a trait object of `[u8; 4]`, which is not supported yet at fixtures/reject/src/lib.rs:494:26 -a coercion to `&Tail`, which is not supported yet at fixtures/reject/src/lib.rs:504:30 -`std::sync::Mutex::::get_mut` with a mutable reference to a value JS copies, which its mapping would copy at fixtures/reject/src/lib.rs:534:12 -`Waiting>` is not supported: its field `poll` is `Poll`, typed `rt.Poll`, whose `Pending` would be `rt.OuterPending` as `Poll>` at fixtures/reject/src/lib.rs:515:2 -a copy of a closure that changes what it captured at fixtures/reject/src/lib.rs:527:14 -a copy of a closure that changes what it captured at fixtures/reject/src/lib.rs:528:14 -an upcast from `dyn Keyed` to `dyn std::any::Any`, which is not supported yet at fixtures/reject/src/lib.rs:552:32 -`std::any::Any::type_id` of `dyn std::any::Any`, which is not supported yet at fixtures/reject/src/lib.rs:558:4 -unsupported call to `std::any::TypeId::of::` at fixtures/reject/src/lib.rs:558:17 -unsupported call to `::eq` at fixtures/reject/src/lib.rs:558:2 -a cast from a pointer to `u32` to one to `u8`, which reads the bytes of one type as another at fixtures/reject/src/lib.rs:575:27 -a pointer's address, which JS has no counterpart of at fixtures/reject/src/lib.rs:580:17 -unsupported call to `std::alloc::Layout::new::` at fixtures/reject/src/lib.rs:585:15 -unsupported call to `std::alloc::alloc` at fixtures/reject/src/lib.rs:587:11 -unsupported call to `std::alloc::dealloc` at fixtures/reject/src/lib.rs:590:3 -a raw pointer to `std::vec::Vec` behind a reference, which is the object and not where it is kept at fixtures/reject/src/lib.rs:597:10 -union `Bits`, whose fields overlap in `u32` and `f64`, which JS keeps apart at fixtures/reject/src/lib.rs:608:10 -comparing pointers to `u32`, each a place JS makes of its own at fixtures/reject/src/lib.rs:616:2 -a raw pointer to `(u32, u32)` in `Span2`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:628:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:636:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:644:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:653:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:661:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:670:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:678:10 -a raw pointer to `(u32, u32)` in `Window`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:689:2 -a raw pointer to `(u32, u32)` in an element, a payload, or a union field, which is not supported yet at fixtures/reject/src/lib.rs:699:10 -a raw pointer to `(u32, u32)` in `std::cell::UnsafeCell<(u32, u32)>`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:707:15 -a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:716:15 -a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:729:15 -a raw pointer to `std::cell::UnsafeCell` in `Hits`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:740:21 -comparing pointers to `()`, which has no bytes and so no address of its own at fixtures/reject/src/lib.rs:748:2 -a dangling pointer to `Only`, a value of no bytes made of more than structs and tuples at fixtures/reject/src/lib.rs:757:11 -`Buf::copy_to_bytes` of `Blank`, a value JS copies, which is not supported at fixtures/reject/src/lib.rs:781:2 -unsupported call to ` as std::iter::Iterator>::is_sorted` at fixtures/reject/src/lib.rs:786:15 -comparing pointers to `u32` in an atomic, which JS has no address of at fixtures/reject/src/lib.rs:797:15 -a constant of type `&u32`, a pointer into memory translation can't name at fixtures/reject/src/lib.rs:798:3 -passing `{closure@fixtures/reject/src/lib.rs:804:11: 804:19}`, which drops, to `String::retain`, which is not supported yet at fixtures/reject/src/lib.rs:804:4 -`std::collections::HashMap::::into_keys` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it at fixtures/reject/src/lib.rs:836:6 -a raw pointer to `(u32, u32)` in `Plain`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:851:10 -a raw pointer to `(u32, u32)` in `Track`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:877:19 -a raw pointer to `(u32, u32)` in `Lane`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:897:19 -a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:933:10 -a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:934:10 -a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:935:58 -a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:947:19 -a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:948:19 -`std::iter::Extend::extend` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it at fixtures/reject/src/lib.rs:955:6 -`collect` of `std::collections::BTreeMap, Noisy>`, which sorts by `std::cell::Cell`'s own `Ord`, of entries that drop, which is not supported yet at fixtures/reject/src/lib.rs:985:22 -overriding `Iterator::fold`, which std's adaptors call in place of `next` or beside it at fixtures/reject/src/lib.rs:137:2 -an iterator of the crate implementing `DoubleEndedIterator`, which is not supported yet at fixtures/reject/src/lib.rs:157:1 -overriding `Iterator::size_hint`, which std's adaptors call in place of `next` or beside it at fixtures/reject/src/lib.rs:185:2 -an iterator of the crate implementing `FusedIterator`, which is not supported yet at fixtures/reject/src/lib.rs:205:1 -`Hasher::write`, which is not supported yet at fixtures/reject/src/lib.rs:279:9 +unsupported call to `std::ops::Range::::contains::` at fixtures/reject/src/lib.rs:167:8 +a `skip` of `std::iter::Zip, {closure@fixtures/reject/src/lib.rs:208:27: 208:31}>, std::iter::Map, {closure@fixtures/reject/src/lib.rs:208:59: 208:63}>>`, a zip std reads by index, of items that drop, which is not supported yet at fixtures/reject/src/lib.rs:209:8 +a `collect` in place of `std::iter::Map, {closure@fixtures/reject/src/lib.rs:215:32: 215:40}>, std::ops::Range>, {closure@fixtures/reject/src/lib.rs:216:24: 216:32}>`, a zip std reads by index, holding values that drop, which is not supported yet at fixtures/reject/src/lib.rs:216:40 +an assignment through a reference to `std::pin::Pin<&mut Noisy>` at fixtures/reject/src/lib.rs:221:2 +`std::iter::Iterator::filter` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it at fixtures/reject/src/lib.rs:227:16 +`std::iter::Iterator::count` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it at fixtures/reject/src/lib.rs:227:38 +a copy of a closure that changes what it captured at fixtures/reject/src/lib.rs:237:14 +`Iterator::scan` of `Option<()>`, whose `None` is `rt.None`, which is not supported yet at fixtures/reject/src/lib.rs:243:11 +hashing `std::collections::BTreeSet` as a key, which is not supported yet at fixtures/reject/src/lib.rs:248:75 +comparing `std::collections::BTreeSet` as a key, which is not supported yet at fixtures/reject/src/lib.rs:248:75 +`HashMap::contains_key` of `std::collections::HashMap` by `u8`, which is not supported yet at fixtures/reject/src/lib.rs:266:6 +`slice::clone_from_slice` of `Reused`, whose `clone_from` is its own, which is not supported yet at fixtures/reject/src/lib.rs:299:4 +a coercion to `std::sync::Arc<[u8]>` at fixtures/reject/src/lib.rs:304:2 +a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string at fixtures/reject/src/lib.rs:344:2 +a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string at fixtures/reject/src/lib.rs:346:27 +a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string at fixtures/reject/src/lib.rs:345:30 +a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string at fixtures/reject/src/lib.rs:351:2 +`std::borrow::Cow<'_, [u8]>` is not supported yet at fixtures/reject/src/lib.rs:355:18 +unsupported call to ` as std::ops::Deref>::deref` at fixtures/reject/src/lib.rs:356:2 +constructing `std::borrow::Cow<'_, std::sync::Arc>` at fixtures/reject/src/lib.rs:362:53 +hashing `std::vec::Vec` through `Batched`'s own `Hash::hash_slice`, which is not supported yet at fixtures/reject/src/lib.rs:323:16 +passing `{closure@fixtures/reject/src/lib.rs:332:28: 332:35}`, a closure that owns a value that drops, to `Entry::or_insert_with`, which is not supported yet at fixtures/reject/src/lib.rs:332:13 +passing `{closure@fixtures/reject/src/lib.rs:339:13: 339:27}`, which drops, to `str::contains`, which is not supported yet at fixtures/reject/src/lib.rs:339:4 +unsupported call to ` as std::iter::Iterator>::sum::` at fixtures/reject/src/lib.rs:442:17 +unsupported call to ` as std::iter::Iterator>::sum::` at fixtures/reject/src/lib.rs:442:38 +a mutable reference into a `Result`'s payload, passed on or kept at fixtures/reject/src/lib.rs:375:12 +unsupported call to ` as std::cmp::PartialEq>::eq` at fixtures/reject/src/lib.rs:382:2 +`Bytes::from_owner` of `std::sync::Arc<[u8]>`, which would drop with the last clone of what it makes, which is not supported at fixtures/reject/src/lib.rs:387:2 +`BytesMut::capacity`, which reads a capacity that depends on whether the other handles of its storage dropped, which is not supported at fixtures/reject/src/lib.rs:396:6 +`BufMut::put` of `Counted` into a `BytesMut`, which picks the methods it calls by a capacity that depends on whether the other handles of its storage dropped, which is not supported at fixtures/reject/src/lib.rs:402:2 +unsupported call to `core::str::::parse::` at fixtures/reject/src/lib.rs:447:4 +unsupported type `std::net::Ipv4Addr` from another crate at fixtures/reject/src/lib.rs:446:32 +unsupported type `std::net::AddrParseError` from another crate at fixtures/reject/src/lib.rs:446:32 +a coercion to `std::sync::Weak`, which is not supported yet at fixtures/reject/src/lib.rs:463:40 +`dyn Scaled`, a trait object of the generic trait `Scaled`, which is not supported yet at fixtures/reject/src/lib.rs:472:23 +`dyn Scaled`, a trait object of the generic trait `Scaled`, which is not supported yet at fixtures/reject/src/lib.rs:473:4 +a trait object of `[u8; 4]`, which is not supported yet at fixtures/reject/src/lib.rs:489:26 +a coercion to `&Tail`, which is not supported yet at fixtures/reject/src/lib.rs:499:30 +`std::sync::Mutex::::get_mut` with a mutable reference to a value JS copies, which its mapping would copy at fixtures/reject/src/lib.rs:529:12 +`Waiting>` is not supported: its field `poll` is `Poll`, typed `rt.Poll`, whose `Pending` would be `rt.OuterPending` as `Poll>` at fixtures/reject/src/lib.rs:510:2 +a copy of a closure that changes what it captured at fixtures/reject/src/lib.rs:522:14 +a copy of a closure that changes what it captured at fixtures/reject/src/lib.rs:523:14 +an upcast from `dyn Keyed` to `dyn std::any::Any`, which is not supported yet at fixtures/reject/src/lib.rs:547:32 +`std::any::Any::type_id` of `dyn std::any::Any`, which is not supported yet at fixtures/reject/src/lib.rs:553:4 +unsupported call to `std::any::TypeId::of::` at fixtures/reject/src/lib.rs:553:17 +unsupported call to `::eq` at fixtures/reject/src/lib.rs:553:2 +a cast from a pointer to `u32` to one to `u8`, which reads the bytes of one type as another at fixtures/reject/src/lib.rs:570:27 +a pointer's address, which JS has no counterpart of at fixtures/reject/src/lib.rs:575:17 +unsupported call to `std::alloc::Layout::new::` at fixtures/reject/src/lib.rs:580:15 +unsupported call to `std::alloc::alloc` at fixtures/reject/src/lib.rs:582:11 +unsupported call to `std::alloc::dealloc` at fixtures/reject/src/lib.rs:585:3 +a raw pointer to `std::vec::Vec` behind a reference, which is the object and not where it is kept at fixtures/reject/src/lib.rs:592:10 +union `Bits`, whose fields overlap in `u32` and `f64`, which JS keeps apart at fixtures/reject/src/lib.rs:603:10 +comparing pointers to `u32`, each a place JS makes of its own at fixtures/reject/src/lib.rs:611:2 +a raw pointer to `(u32, u32)` in `Span2`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:623:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:631:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:639:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:648:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:656:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:665:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:673:10 +a raw pointer to `(u32, u32)` in `Window`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:684:2 +a raw pointer to `(u32, u32)` in an element, a payload, or a union field, which is not supported yet at fixtures/reject/src/lib.rs:694:10 +a raw pointer to `(u32, u32)` in `std::cell::UnsafeCell<(u32, u32)>`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:702:15 +a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:711:15 +a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:724:15 +a raw pointer to `std::cell::UnsafeCell` in `Hits`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:735:21 +comparing pointers to `()`, which has no bytes and so no address of its own at fixtures/reject/src/lib.rs:743:2 +a dangling pointer to `Only`, a value of no bytes made of more than structs and tuples at fixtures/reject/src/lib.rs:752:11 +`Buf::copy_to_bytes` of `Blank`, a value JS copies, which is not supported at fixtures/reject/src/lib.rs:776:2 +unsupported call to ` as std::iter::Iterator>::is_sorted` at fixtures/reject/src/lib.rs:781:15 +comparing pointers to `u32` in an atomic, which JS has no address of at fixtures/reject/src/lib.rs:792:15 +a constant of type `&u32`, a pointer into memory translation can't name at fixtures/reject/src/lib.rs:793:3 +passing `{closure@fixtures/reject/src/lib.rs:799:11: 799:19}`, which drops, to `String::retain`, which is not supported yet at fixtures/reject/src/lib.rs:799:4 +`std::collections::HashMap::::into_keys` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it at fixtures/reject/src/lib.rs:831:6 +a raw pointer to `(u32, u32)` in `Plain`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:846:10 +a raw pointer to `(u32, u32)` in `Track`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:872:19 +a raw pointer to `(u32, u32)` in `Lane`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:892:19 +a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:928:10 +a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:929:10 +a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:930:58 +a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:942:19 +a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:943:19 +`std::iter::Extend::extend` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it at fixtures/reject/src/lib.rs:950:6 +`collect` of `std::collections::BTreeMap, Noisy>`, which sorts by `std::cell::Cell`'s own `Ord`, of entries that drop, which is not supported yet at fixtures/reject/src/lib.rs:980:22 +overriding `Iterator::fold`, which std's adaptors call in place of `next` or beside it at fixtures/reject/src/lib.rs:132:2 +an iterator of the crate implementing `DoubleEndedIterator`, which is not supported yet at fixtures/reject/src/lib.rs:152:1 +overriding `Iterator::size_hint`, which std's adaptors call in place of `next` or beside it at fixtures/reject/src/lib.rs:180:2 +an iterator of the crate implementing `FusedIterator`, which is not supported yet at fixtures/reject/src/lib.rs:200:1 +`Hasher::write`, which is not supported yet at fixtures/reject/src/lib.rs:274:9 diff --git a/ts/fixtures/reject/src/lib.rs b/ts/fixtures/reject/src/lib.rs index 3b675d0bb..413ab6a86 100644 --- a/ts/fixtures/reject/src/lib.rs +++ b/ts/fixtures/reject/src/lib.rs @@ -119,11 +119,6 @@ pub fn swap_guards<'a>(a: &mut std::sync::MutexGuard<'a, u8>, b: &mut std::sync: std::mem::swap(a, b); } -/// An adaptor without a mapping. -pub fn cycled(v: &[u8]) -> usize { - v.iter().cycle().take(3).count() -} - /// An iterator whose `fold` std's adaptors would call in place of its `next`. pub struct Folds; diff --git a/ts/fixtures/reject/ts.toml b/ts/fixtures/reject/ts.toml index a05f8bf6f..fee27bbb7 100644 --- a/ts/fixtures/reject/ts.toml +++ b/ts/fixtures/reject/ts.toml @@ -19,7 +19,6 @@ roots = [ "replace_boxed_poll_fn", "replace_boxed_future", "replace_boxed_bytes", - "cycled", "folds", "backs", "keyed", diff --git a/ts/runtime/rt/iter.ts b/ts/runtime/rt/iter.ts index 9fa8001ec..ca7c984ac 100644 --- a/ts/runtime/rt/iter.ts +++ b/ts/runtime/rt/iter.ts @@ -627,6 +627,14 @@ export function iterStepBy(it: Iter, step: number, drop?: Drop): Iter(it: Iter, h?: Clones): Iter { + return new CycleIter(it.clone(h), it, h); +} + /** * `Iterator::copied` of items JS copies by `copy`, which std's skips through: its `nth` * and `advance_by` are its iterator's. @@ -2695,6 +2703,92 @@ class StepByIter extends Adaptor { } } +/** + * std's `Cycle`: `iter`, read, and `orig`, the iterator as it was, which it clones by `h` + * in place of `iter` each time that ends. It drops `orig` and then `iter`, as std's fields + * order them. + */ +class CycleIter extends Iter implements Disposable { + readonly orig: Iter; + iter: Iter; + private readonly h: Clones | undefined; + + constructor(orig: Iter, iter: Iter, h: Clones | undefined) { + super(); + this.orig = orig; + this.iter = iter; + this.h = h; + } + + /** A clone of `orig` in place of `iter`, which drops once the clone is made. */ + private restart(): void { + const ended = this.iter; + this.iter = this.orig.clone(this.h); + dispose(ended); + } + + next(): T | Done { + const item = this.iter.next(); + if (item !== DONE) return item; + this.restart(); + return this.iter.next(); + } + + /** std's: by `orig`'s, either empty or endless. */ + override sizeHint(): SizeHint { + const [lower, upper] = this.orig.sizeHint(); + if (lower > 0) return [USIZE_MAX, undefined]; + return upper === 0 ? [0, 0] : [0, undefined]; + } + + /** std's: `orig` by `h.i`, then `iter`. */ + override clone(h?: Clones): Iter { + return new CycleIter(this.orig.clone(h?.i), this.iter.clone(h?.i), this.h); + } + + /** std's: `iter` advanced, then clones, until one advances no further than it had left. */ + override advanceBy(n: number, drop?: Drop): number { + n = this.iter.advanceBy(n, drop); + while (n > 0) { + this.restart(); + const left = this.iter.advanceBy(n, drop); + if (left === n) return n; + n = left; + } + return 0; + } + + /** + * std's `try_fold`: the rest of `iter` folded, then a clone, which ends it if that was + * empty, and then clones without end. `fold` is std's default, by `next`. + */ + override folded(fold = false): Iter { + if (fold) return this; + let reading = this.iter.folded(); + // Which clone it reads: 0 for none yet, 1 for the first, and 2 for one after. + let clones = 0; + let empty = true; + return new FromNext(this, (cycle) => { + for (;;) { + const item = reading.next(); + if (item !== DONE) { + if (clones === 1) empty = false; + return item; + } + if (clones === 1 && empty) return DONE; + clones = Math.min(clones + 1, 2); + cycle.restart(); + reading = cycle.iter.folded(); + } + }); + } + + [Symbol.dispose](): void { + dispose(this.orig); + dispose(this.iter); + } +} + class InspectIter extends Calling void> { override sizeHint(): SizeHint { return this.inner.sizeHint(); diff --git a/ts/src/lower/iter.rs b/ts/src/lower/iter.rs index a166f3ee7..707db1f5b 100644 --- a/ts/src/lower/iter.rs +++ b/ts/src/lower/iter.rs @@ -452,13 +452,23 @@ pub fn call<'tcx>( let fused = fused(b, self_ty, None); method(name, tail(rest, vec![fused])) } + // What clones its iterator, as it is made and each time a clone of it ends. + "cycle" => { + let clones = clones(b, self_ty, span)?; + method(name, tail(rest, vec![clones])) + } // `rt.owned`, which drops what `self_ty` holds and its items by `dropper` as - // std's own does, where either drops: else `rt.iter`, so a bundle that never - // drops doesn't carry it. + // std's own does, where either drops, or counts a `Cycle` as std's `Take::count` + // does, by its `advance_by`, which stops at a clone that yields nothing where + // `try_fold` reads on: else `rt.iter`, so a bundle that never drops doesn't + // carry it. "count" | "last" => { let dropper = b.t.dropper(item, span); let none: Vec = none.into_iter().filter(|_| name == "last").collect(); - match drops_iter(b, self_ty, span) || !undefined(&dropper) { + let cycles = name == "count" + && (self_ty.walk().filter_map(|arg| arg.as_type())) + .any(|t| std_iter_path(tcx, t).is_some_and(|p| p == ["iter", "adapters", "cycle", "Cycle"])); + match drops_iter(b, self_ty, span) || !undefined(&dropper) || cycles { true => Some(Expr::rt_of("owned", name).call(tail(vec![recv.clone()], [vec![dropper], none].concat()))), false => method(name, none), } @@ -858,8 +868,9 @@ fn clones<'tcx>(b: &mut Body<'_, '_, 'tcx>, ty: Ty<'tcx>, span: Span) -> Option< let path = library::std_path(tcx, adt.did()); let path: Vec<&str> = path.iter().map(String::as_str).collect(); Some(match path.as_slice() { - // Those that borrow what they read, as their clones do too. - [ + // Those that borrow what they read, as their clones do too, or hold nothing. + ["iter", "sources", "empty", "Empty"] + | [ "slice", "iter", "Iter" | "Windows" | "Chunks" | "ChunksExact" | "RChunks" | "RChunksExact", @@ -904,7 +915,7 @@ fn clones<'tcx>(b: &mut Body<'_, '_, 'tcx>, ty: Ty<'tcx>, span: Span) -> Option< "iter", "adapters", _, - "Enumerate" | "Skip" | "Take" | "StepBy" | "Fuse" | "Rev" | "Copied" | "Cloned", + "Enumerate" | "Skip" | "Take" | "StepBy" | "Fuse" | "Rev" | "Copied" | "Cloned" | "Cycle", ] => parts(vec![("i", clones(b, arg(0)?, span)?)]), ["iter", "adapters", _, "Chain" | "Zip"] => { parts(vec![("i", clones(b, arg(0)?, span)?), ("o", clones(b, arg(1)?, span)?)]) From c50e912c6706a15e8687ef5a46e8cfc520dd8f5c Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Fri, 30 Oct 2026 21:21:29 -0700 Subject: [PATCH 3/3] style(ts): order the cycles fixture's module as rustfmt does Co-Authored-By: Claude Opus 5.5 --- ts/fixtures/lang/src/harness.rs | 6 +++--- ts/fixtures/lang/src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ts/fixtures/lang/src/harness.rs b/ts/fixtures/lang/src/harness.rs index 53e60cce9..e809f4ee4 100644 --- a/ts/fixtures/lang/src/harness.rs +++ b/ts/fixtures/lang/src/harness.rs @@ -2,9 +2,9 @@ //! case and the rest is its input. use crate::{ - arrays, atomics, borrows, bounds, captures, cells, chars, chunks, clones, collections, cycles, combinators, counts, cows, - defaults, durations, dyns, edits, errors, floats, fmt, folds, generics, hashes, hints, holds, ints, iters, keys, - locals, locks, nested, objects, orders, pointers, refs, shapes, singles, slices, splits, statics, strs, utf8, + arrays, atomics, borrows, bounds, captures, cells, chars, chunks, clones, collections, combinators, counts, cows, + cycles, defaults, durations, dyns, edits, errors, floats, fmt, folds, generics, hashes, hints, holds, ints, iters, + keys, locals, locks, nested, objects, orders, pointers, refs, shapes, singles, slices, splits, statics, strs, utf8, wrappers, zeros, }; diff --git a/ts/fixtures/lang/src/lib.rs b/ts/fixtures/lang/src/lib.rs index e427a559c..ccc8c9282 100644 --- a/ts/fixtures/lang/src/lib.rs +++ b/ts/fixtures/lang/src/lib.rs @@ -33,8 +33,8 @@ mod clones; mod collections; mod combinators; mod counts; -mod cycles; mod cows; +mod cycles; mod defaults; mod durations; mod dyns;