From f4c2217cf967b8ecc16f889183123f381cc0dd91 Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Fri, 30 Oct 2026 10:52:04 -0700 Subject: [PATCH 1/4] chore(quest): claim quest/m3/ts-next-if-eq-other.md Quest-Claim: 0946d550ddbb4c78 From 93044f87e8216b2f07f1e5e174ce83698b188ede Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Fri, 30 Oct 2026 11:10:09 -0700 Subject: [PATCH 2/4] feat(ts): translate next_if_eq against another type than the item `Peekable::next_if_eq` compares by the item's `PartialEq`: of another type than the item, by that impl's `eq` as a call to it lowers, std's or the crate's, with a `[u8; N]` item lent as the `rt.ByteSlice` its reference is. A pair the call lowering refuses fails at the span. Co-Authored-By: Claude Opus 5.5 --- quest/m3/README.md | 1 - quest/m3/ts-next-if-eq-other.md | 15 -- ts/fixtures/lang/caller.ts | 10 +- ts/fixtures/lang/expected/core/option.ts | 34 +++- ts/fixtures/lang/expected/harness.ts | 6 +- ts/fixtures/lang/expected/iters.Quarter.ts | 16 ++ ts/fixtures/lang/expected/iters.ts | 203 ++++++++++++++++++++- ts/fixtures/lang/src/harness.rs | 1 + ts/fixtures/lang/src/iters.rs | 92 ++++++++++ ts/fixtures/reject/census.md | 18 +- ts/fixtures/reject/expected.txt | 2 +- ts/fixtures/reject/src/lib.rs | 6 +- ts/fixtures/reject/ts.toml | 2 +- ts/runtime/rt/iter.ts | 6 +- ts/src/census.rs | 1 - ts/src/lower/iter.rs | 30 ++- 16 files changed, 390 insertions(+), 53 deletions(-) delete mode 100644 quest/m3/ts-next-if-eq-other.md create mode 100644 ts/fixtures/lang/expected/iters.Quarter.ts diff --git a/quest/m3/README.md b/quest/m3/README.md index d09dabbd1..24040e72c 100644 --- a/quest/m3/README.md +++ b/quest/m3/README.md @@ -31,7 +31,6 @@ generic std gap is planned here even when moq never calls it. - [References to byte-array keys a collection yields](/quest/m3/ts-byte-key-refs.md) - `keys`, `iter`, `get_key_value`, and `HashSet::get` of a `[u8; N]` key translate - [Vec and slice accessors of elements whose None is rt.None](/quest/m3/ts-option-elements.md) - `Vec::pop` and `slice::last` of `Option` elements keep `None` apart from `Some(None)` - [Size hints of std's iterators](/quest/m3/ts-size-hints.md) - `size_hint` translates, and `Vec`'s collect and extend panic past `isize::MAX` as std's do -- [Peekable::next_if_eq against another type](/quest/m3/ts-next-if-eq-other.md) - `next_if_eq` with an expected value of another type than the item, such as a `&str` of `String` items, translates - [Waiting: a slice object for a mutable part of other values](/quest/m3/ts-slice-object.md) - waits on a moq profile showing the `Proxy` view's traps matter, then decides on an `rt.ByteSlice`-like form - [Port the workflow guard to kixelated/quest](/quest/m3/quest-workflow-guard.md) - quest's environment guard parses YAML as this repository's does - [A parameter read only where lowering leaves nothing](/quest/m3/ts-unread-params.md) - an instance whose lowering drops every read of a parameter marks it unused, so `tsc` accepts it diff --git a/quest/m3/ts-next-if-eq-other.md b/quest/m3/ts-next-if-eq-other.md deleted file mode 100644 index 79dd619de..000000000 --- a/quest/m3/ts-next-if-eq-other.md +++ /dev/null @@ -1,15 +0,0 @@ -# [XS] Peekable::next_if_eq against another type - -## Goal - -`Peekable::next_if_eq` translates where the expected value is of another type than the -item, as `next_if_eq("a")` of `String` items is, comparing by the item's `PartialEq`, -proven by a differential test against native Rust. - -## Plan - -Refused at its span today, as the reject fixture's `peeked_str` is: the mapping compares -by `eq_fn` of the item's own type. std's string types compare by content across types, -and a crate's own `PartialEq` resolves as any trait method does. - -Public API: the translator's output. diff --git a/ts/fixtures/lang/caller.ts b/ts/fixtures/lang/caller.ts index 235b0e200..c9d42869b 100644 --- a/ts/fixtures/lang/caller.ts +++ b/ts/fixtures/lang/caller.ts @@ -374,6 +374,14 @@ const ranges = [0, 1, 2, 3, 4].flatMap((n) => { */ const reducers = [[], [9], [9, 9], [8, 4, 12, 0x40, 0x80]].map((bytes) => Uint8Array.of(op("iters::reducers"), 0, ...bytes)); +/** + * `iters::peeked_others` of no items, one, a run that matches the first throughout, and + * items that each match one comparison and miss the next. + */ +const peekedOthers = [[], [3], [4, 4, 4, 4], [0, 1, 2, 3, 4, 5, 6], [1, 0, 0, 2, 5, 9]].map((bytes) => + Uint8Array.of(op("iters::peeked_others"), 0, ...bytes), +); + /** * `edits` of each kind over zero to four items, at every three bounds up to one past the * end, so parts are empty, at the end, backwards, and out of bounds. @@ -404,4 +412,4 @@ const iters = Array.from({ length: 12 }, (_, kind) => [[], [2, 7, 9, 14], [0, 2, const hintedOp = op("strs::hinted"); const hinted = Array.from({ length: 10 * 7 * 21 }, (_, i) => Uint8Array.of(hintedOp, i % 10, Math.floor(i / 10) % 7, Math.floor(i / 70))); -export const cases: Uint8Array[] = [...loops, ...durations, ...ints(), ...utf8, ...floats, ...formats, ...parsed, ...dyns, ...cells, ...shared, ...locks, ...onces, ...bounds, ...unsafeCells, ...edits, ...subslices, ...consumers, ...closures, ...ranges, ...reducers, ...sliceEdits, ...drains, ...iters, ...hinted]; +export const cases: Uint8Array[] = [...loops, ...durations, ...ints(), ...utf8, ...floats, ...formats, ...parsed, ...dyns, ...cells, ...shared, ...locks, ...onces, ...bounds, ...unsafeCells, ...edits, ...subslices, ...consumers, ...closures, ...ranges, ...reducers, ...peekedOthers, ...sliceEdits, ...drains, ...iters, ...hinted]; diff --git a/ts/fixtures/lang/expected/core/option.ts b/ts/fixtures/lang/expected/core/option.ts index 968055a4f..5d525dc29 100644 --- a/ts/fixtures/lang/expected/core/option.ts +++ b/ts/fixtures/lang/expected/core/option.ts @@ -17,6 +17,7 @@ import type * as Twin from "../counts.Twin.ts"; import * as Made from "../defaults.Made.ts"; import type * as Shape from "../dyns.Shape.ts"; import * as Named from "../edits.Named.ts"; +import type * as Quarter from "../iters.Quarter.ts"; import type * as Tilt from "../iters.Tilt.ts"; import { side, order } from "../keys.ts"; import type * as Hop from "../keys.Hop.ts"; @@ -225,6 +226,13 @@ export function map$0xa0bn7(self: Named.Named | undefined, f: (a0: Named.Named) return f(self); } +export function map$1uo1d4o(self: string | undefined, _: (a0: string) => string): string | undefined { + if (self === undefined) { + return undefined; + } + return self; +} + export function map$0600mq0(self: Dir.Dir | undefined, f: (a0: Dir.Dir) => shapes_Shape.Shape): shapes_Shape.Shape | undefined { if (self === undefined) { return undefined; @@ -288,18 +296,18 @@ export function map$11y9s7r(self: slices_Pair.Pair[] | undefined, f: (a0: slices return f(self); } -export function map$0lcwx9x(self: Way.Way | undefined, f: (a0: Way.Way) => boolean): boolean | undefined { +export function map$1httady(self: string[] | undefined, f: (a0: string[]) => string): string | undefined { if (self === undefined) { return undefined; } return f(self); } -export function map$1uo1d4o(self: string | undefined, _: (a0: string) => string): string | undefined { +export function map$0lcwx9x(self: Way.Way | undefined, f: (a0: Way.Way) => boolean): boolean | undefined { if (self === undefined) { return undefined; } - return self; + return f(self); } export function map$0qyyft9(self: rt.u16[] | undefined, _: (a0: rt.u16[]) => rt.u8): rt.u8 | undefined { @@ -575,6 +583,13 @@ export function mapOr$0rtdylj(self: Point.Point | undefined, default_: rt.u8, f: return f(self); } +export function mapOr$1lznlgz(self: Quarter.Quarter | undefined, default_: rt.u8, f: (a0: Quarter.Quarter) => rt.u8): rt.u8 { + if (self === undefined) { + return default_; + } + return f(self); +} + export function mapOr$1to2ul4(self: [Rank.Rank, Tally.Tally] | undefined, default_: rt.u8, f: (a0: [Rank.Rank, Tally.Tally]) => rt.u8): rt.u8 { if (self === undefined) { return default_; @@ -715,6 +730,13 @@ export function mapOr$1surhce(self: rt.u8 | undefined, default_: rt.u8, f: (a0: return f(self); } +export function mapOr$0ev76sb(self: rt.Place | undefined, default_: rt.u8, f: (a0: rt.Place) => rt.u8): rt.u8 { + if (self === undefined) { + return default_; + } + return f(self); +} + export function mapOr$0mmpeqx(self: [rt.u8, rt.u8] | undefined, default_: rt.u8, f: (a0: [rt.u8, rt.u8]) => rt.u8): rt.u8 { if (self === undefined) { return default_; @@ -874,6 +896,12 @@ export function asDeref$0s3650c(self: rt.Arc | undefined): rt.u8 | undefi }); } +export function asDeref$0w8at8i(self: string | undefined): string | undefined { + return map$1uo1d4o(self, (a0: string): string => { + return a0; + }); +} + export function and$06om98g(self: rt.u8 | undefined, optb: rt.u8 | undefined): rt.u8 | undefined { if (self === undefined) { return undefined; diff --git a/ts/fixtures/lang/expected/harness.ts b/ts/fixtures/lang/expected/harness.ts index f5a000130..062fa20ab 100644 --- a/ts/fixtures/lang/expected/harness.ts +++ b/ts/fixtures/lang/expected/harness.ts @@ -24,7 +24,7 @@ import { methods } from "./generics.ts"; import { values, random, bytes as hashes_bytes } from "./hashes.ts"; import { holds } from "./holds.ts"; import { u8Op, u16Op, u32Op, u64Op, u128Op, usizeOp, i8Op, i16Op, i32Op, i64Op, i128Op, isizeOp, i8Neg, i16Neg, i32Neg, i64Neg, i128Neg, isizeNeg, cast as ints_cast, convert, parses as ints_parses, widenings } from "./ints.ts"; -import { adaptors, consumers, reducers, skips, ranked, ranges, options, own, values as iters_values, returned } from "./iters.ts"; +import { adaptors, consumers, reducers, peekedOthers, skips, ranked, ranges, options, own, values as iters_values, returned } from "./iters.ts"; import { keys, overrides, bytes as keys_bytes } from "./keys.ts"; import { locals } from "./locals.ts"; import { locks, relock, rwlocks } from "./locks.ts"; @@ -90,7 +90,7 @@ export function cases(): [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) refs(data21, out21); }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["fmt::counts", (_2121: rt.u8, data22: rt.ByteSlice, out22: rt.ByteVec): void => { counts(data22, out22); - }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["fmt::rounding", (_2122: rt.u8, _399: rt.ByteSlice, out23: rt.ByteVec): void => { + }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["fmt::rounding", (_2122: rt.u8, _3100: rt.ByteSlice, out23: rt.ByteVec): void => { rounding(out23); }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["iters::skips", skips] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["wrappers::wrappers", wrappers] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["edits::edits", edits] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["utf8::decodes", decodes] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["floats::floats", floats] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["atomics::atomics", atomics] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["keys::overrides", overrides] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["dyns::dyns", (_2123: rt.u8, data23: rt.ByteSlice, out24: rt.ByteVec): void => { dyns(data23, out24); @@ -182,6 +182,8 @@ export function cases(): [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) asSlices(data66, out67); }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["ints::widenings", widenings] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["shapes::uninhabited", (_2167: rt.u8, data67: rt.ByteSlice, out68: rt.ByteVec): void => { uninhabited(data67, out68); + }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["iters::peeked_others", (_2168: rt.u8, data68: rt.ByteSlice, out69: rt.ByteVec): void => { + peekedOthers(data68, out69); }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void]]; } diff --git a/ts/fixtures/lang/expected/iters.Quarter.ts b/ts/fixtures/lang/expected/iters.Quarter.ts new file mode 100644 index 000000000..74c6165dd --- /dev/null +++ b/ts/fixtures/lang/expected/iters.Quarter.ts @@ -0,0 +1,16 @@ +// Generated by rust2-ts. Do not edit. + +import * as rt from "./rt.ts"; + +/** A byte that equals a `u8` of the same remainder by 4, counting each comparison. */ +export interface Quarter { + _0: rt.u8; + _1: rt.Cell; +} + +export function eq$PartialEq_u8(self: Quarter, other: rt.u8): boolean { + rt.cellSet(self._1, rt.u8Add(self._1.v, 1)); + return rt.u8Rem(self._0, 4) === rt.u8Rem(other, 4); +} + +//# sourceMappingURL=iters.Quarter.ts.map diff --git a/ts/fixtures/lang/expected/iters.ts b/ts/fixtures/lang/expected/iters.ts index 8a1aa1707..90aa0d483 100644 --- a/ts/fixtures/lang/expected/iters.ts +++ b/ts/fixtures/lang/expected/iters.ts @@ -3,7 +3,7 @@ import * as rt from "./rt.ts"; import { copy$Bumped, copy$u8_u8 } from "./lib.ts"; import { thenSome$0b23a33, thenSome$0d5am30 } from "./core/bool.ts"; -import { unwrapOr$1tvry1i, unwrapOr$00uis1j, unwrapOr$0r2bmpr, unwrapOr$14m5xjm, unwrapOrDefault$0wx44sw, map$0cs071d, mapOr$0tmtgfi, mapOr$1kiffmd, mapOr$1a3irjf, mapOr$0atjiti, mapOr$1surhce, mapOr$0mmpeqx, mapOr$1t0muvr, mapOr$0sl5app, mapOr$02k4ito, mapOr$06gg5x7, filter$0v80fk8 } from "./core/option.ts"; +import { unwrapOr$1tvry1i, unwrapOr$00uis1j, unwrapOr$0r2bmpr, unwrapOr$14m5xjm, unwrapOrDefault$165pyh5, unwrapOrDefault$0wx44sw, map$1uo1d4o, map$1httady, map$0cs071d, mapOr$1lznlgz, mapOr$0lcrgk1, mapOr$0tmtgfi, mapOr$1kiffmd, mapOr$1a3irjf, mapOr$0atjiti, mapOr$1surhce, mapOr$0ev76sb, mapOr$0mmpeqx, mapOr$1t0muvr, mapOr$0sl5app, mapOr$02k4ito, mapOr$06gg5x7, asDeref$0w8at8i, filter$0v80fk8 } from "./core/option.ts"; import { unwrapOr$01jdcm7 } from "./core/result.ts"; import * as Bumped from "./iters.Bumped.ts"; import * as Countdown from "./iters.Countdown.ts"; @@ -12,6 +12,7 @@ import * as Evens from "./iters.Evens.ts"; import * as Gaps from "./iters.Gaps.ts"; import * as Halving from "./iters.Halving.ts"; import * as Held from "./iters.Held.ts"; +import * as Quarter from "./iters.Quarter.ts"; import * as Tag from "./iters.Tag.ts"; import * as Tilt from "./iters.Tilt.ts"; import * as Wrapper from "./iters.Wrapper.ts"; @@ -381,6 +382,206 @@ export function reducers(data: rt.ByteSlice, out: rt.ByteVec): void { rt.iterExtendBytes(out, rt.iterSlice(rt.byteVecView(log))); } +export function eq$PartialEq_Quarter_u8(self: rt.u8, other: Quarter.Quarter): boolean { + rt.cellSet(other._1, rt.u8Add(other._1.v, 16)); + return rt.u8Rem(self, 4) === rt.u8Rem(other._0, 4); +} + +export function eq$PartialEq_Quarter_u8s(self: rt.ByteSlice, other: Quarter.Quarter): boolean { + rt.cellSet(other._1, rt.u8Add(other._1.v, 64)); + return rt.iterSum(rt.iterSlice(rt.byteSliceView(self)), rt.u8Add, 0) === other._0; +} + +/** + * `Peekable::next_if_eq` against another type than the item's, by the item's + * `PartialEq`: std's across strings and slices, and the crate's own. Each matches the + * first item, and a mismatch keeps the item for the next `next`. + */ +export function peekedOthers(data: rt.ByteSlice, out: rt.ByteVec): void { + const _3: (a0: rt.u8) => string = (b: rt.u8): string => { + const _42: rt.char = rt.u8Add(97, rt.u8Rem(b, 3)) as rt.char; + return rt.fmtToString((f: rt.Formatter) => rt.fmtCharDisplay(_42, f)); + }; + const _4: (a0: string | undefined) => rt.u8 = (w: string | undefined): rt.u8 => { + return mapOr$0lcrgk1(w, 170, (w2: string): rt.u8 => { + const _33: rt.ByteSlice = rt.stringAsBytes(w2); + rt.idx(_33, 0); + return _33.data[_33.start]; + }); + }; + const _158: (a0: rt.u16[] | undefined) => rt.u8 = (v: rt.u16[] | undefined): rt.u8 => { + return mapOr$1kiffmd(v, 170, (v2: rt.u16[]): rt.u8 => { + return v2.length & 0xff; + }); + }; + const _159: (a0: rt.u8) => rt.u16[] = (b2: rt.u8): rt.u16[] => { + return rt.vecFromElem((((rt.u8Rem(b2, 2) as rt.u16)) << 9) & 0xffff, rt.u8Rem(b2, 3) as rt.usize, undefined); + }; + const words: string[] = rt.iterToArray(rt.iterMap(rt.iterSlice(rt.byteSliceView(data)), (_2: rt.u8): string => { + return _3(_2); + })); + const _12: string | undefined = rt.sliceFirst(words); + const first: string = unwrapOrDefault$165pyh5(_12 === undefined ? undefined : _12); + const it: rt.Peekable = rt.iterPeekable(rt.iterSlice(words.slice())); + const part = asDeref$0w8at8i(rt.peekableNextIfEq(it, "a", (a0: string, a1: string): boolean => { + return a0 === a1; + })); + rt.byteVecPush(out, _4(part)); + const part2 = asDeref$0w8at8i(rt.peekableNextIfEq(it, "b", (a02: string, a12: string): boolean => { + return a02 === a12; + })); + rt.byteVecPush(out, _4(part2)); + const part3 = asDeref$0w8at8i(rt.iterToOption(it.next())); + rt.byteVecPush(out, _4(part3)); + const it2: rt.Peekable = rt.iterPeekable(rt.iterSlice(words)); + const part4 = map$1uo1d4o(rt.peekableNextIfEq(it2, first, (a03: string, a13: string): boolean => { + return a03 === a13; + }), (a04: string): string => { + return a04; + }); + rt.byteVecPush(out, _4(part4)); + const part5 = map$1uo1d4o(rt.peekableNextIfEq(it2, "c", (a05: string, a14: string): boolean => { + return a05 === a14; + }), (a06: string): string => { + return a06; + }); + rt.byteVecPush(out, _4(part5)); + const part6 = map$1uo1d4o(rt.iterToOption(it2.next()), (a07: string): string => { + return a07; + }); + rt.byteVecPush(out, _4(part6)); + const it3: rt.Peekable = rt.iterPeekable(rt.iterMap(rt.iterSlice(words), (a08: string): string => { + return a08; + })); + const part7 = rt.peekableNextIfEq(it3, first, (a09: string, a15: string): boolean => { + return a09 === a15; + }); + rt.byteVecPush(out, _4(part7)); + const part8 = rt.iterToOption(it3.next()); + rt.byteVecPush(out, _4(part8)); + const it4: rt.Peekable = rt.iterPeekable(rt.iterMap(rt.iterSlice(rt.byteSliceView(data)), (_24: rt.u8): string[] => { + return [_3(_24)]; + })); + const _107: string[] = [first]; + const part9 = map$1httady(rt.peekableNextIfEq(it4, _107, (a010: string[], a16: string[]): boolean => { + return rt.eqSlice(rt.same)(a010, a16); + }), (v3: string[]): string => { + return v3[rt.idx(v3, 0)]; + }); + rt.byteVecPush(out, _4(part9)); + const part10 = map$1httady(rt.iterToOption(it4.next()), (v4: string[]): string => { + return v4[rt.idx(v4, 0)]; + }); + rt.byteVecPush(out, _4(part10)); + const it5: rt.Peekable = rt.iterPeekable(rt.iterMap(rt.iterSlice(words), (w3: string): string => { + return w3; + })); + const part11 = asDeref$0w8at8i(rt.peekableNextIfEq(it5, "b", (a011: string, a17: string): boolean => { + return a011 === a17; + })); + rt.byteVecPush(out, _4(part11)); + const part12 = asDeref$0w8at8i(rt.iterToOption(it5.next())); + rt.byteVecPush(out, _4(part12)); + const part13 = asDeref$0w8at8i(rt.peekableNextIfEq(rt.iterPeekable(rt.iterSlice(words.slice())), first, (a012: string, a18: string): boolean => { + return a012 === a18; + })); + rt.byteVecPush(out, _4(part13)); + const it7: rt.Peekable = rt.iterPeekable(rt.iterMap(rt.iterSlice(rt.byteSliceView(data)), (_26: rt.u8): rt.u16[] => { + return _159(_26); + })); + const _172: rt.u16[] = [0]; + const _171: rt.u16[] = rt.sliceRange(_172, 0); + const part14 = rt.peekableNextIfEq(it7, _171, (a013: rt.u16[], a19: rt.u16[]): boolean => { + return rt.eqSlice(rt.same)(a013, a19); + }); + rt.byteVecPush(out, _158(part14)); + const part15 = rt.peekableNextIfEq(it7, [512, 512], (a014: rt.u16[], a110: rt.u16[]): boolean => { + return rt.eqSlice(rt.same)(a014, a110); + }); + rt.byteVecPush(out, _158(part15)); + const _189: rt.u16[] = []; + const _188: rt.u16[] = rt.sliceRange(_189, 0); + const part16 = rt.peekableNextIfEq(it7, _188, (a015: rt.u16[], a111: rt.u16[]): boolean => { + return rt.eqSlice(rt.same)(a015, a111); + }); + rt.byteVecPush(out, _158(part16)); + const part17 = rt.iterToOption(it7.next()); + rt.byteVecPush(out, _158(part17)); + const it8: rt.Peekable = rt.iterPeekable(rt.iterMap(rt.iterSlice(rt.byteSliceView(data)), (_28: rt.u8): rt.ByteVec => { + const b6: rt.u8 = _28; + return rt.byteVecOf(rt.u8Rem(b6, 2), rt.u8Rem(b6, 3) as rt.usize); + })); + const _203: rt.ByteSlice = rt.byteSliceRange(rt.byteSliceFrom(Uint8Array.of(1)), 0); + rt.byteVecPush(out, mapOr$1a3irjf(rt.peekableNextIfEq(it8, _203, (a016: rt.ByteVec, a112: rt.ByteSlice): boolean => { + return rt.eqBytes(a016, a112); + }), 170, (v5: rt.ByteVec): rt.u8 => { + return v5.length & 0xff; + })); + rt.byteVecPush(out, mapOr$1a3irjf(rt.iterToOption(it8.next()), 170, (v6: rt.ByteVec): rt.u8 => { + return v6.length & 0xff; + })); + const calls: rt.Cell = new rt.Cell(0); + const it9: rt.Peekable = rt.iterPeekable(rt.iterMap(rt.byteSliceChunksExact(data, 2), (c: rt.ByteSlice): Uint8Array => { + rt.idx(c, 0); + const _314: rt.u8 = rt.u8Rem(c.data[c.start], 2); + rt.idx(c, 1); + return Uint8Array.of(_314, rt.u8Rem(c.data[c.start + 1], 2)); + })); + const _217: rt.ByteSlice = rt.byteSliceRange(rt.byteSliceFrom(Uint8Array.of(0, 1)), 0); + rt.byteVecPush(out, mapOr$0sl5app(rt.peekableNextIfEq(it9, _217, (a, b7): boolean => { + return ((a017: rt.ByteSlice, a113: rt.ByteSlice): boolean => { + return rt.eqBytes(a017, a113); + })(rt.byteSliceFrom(a), b7); + }), 170, (p: Uint8Array): rt.u8 => { + return p[1]; + })); + rt.byteVecPush(out, mapOr$0sl5app(rt.iterToOption(it9.next()), 170, (p2: Uint8Array): rt.u8 => { + return p2[0]; + })); + rt.byteVecPush(out, mapOr$0sl5app(rt.peekableNextIfEq(it9, { _0: 1, _1: calls }, (a2, b8): boolean => { + return eq$PartialEq_Quarter_u8s(rt.byteSliceFrom(a2), b8); + }), 170, (p3: Uint8Array): rt.u8 => { + return p3[0]; + })); + rt.byteVecPush(out, mapOr$0sl5app(rt.iterToOption(it9.next()), 170, (p4: Uint8Array): rt.u8 => { + return p4[1]; + })); + const bytes: rt.ByteVec = rt.byteSliceToByteVec(data); + const it10: rt.Peekable> = rt.iterPeekable(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(bytes)))); + const _242: rt.u8 = unwrapOr$0r2bmpr(rt.byteSliceFirst(data), 0); + const _239: rt.Place | undefined = rt.peekableNextIfEq(it10, _242, (a019: rt.Place, a115: rt.u8): boolean => { + return a019.v === a115; + }); + if (_239 !== undefined) { + _239.v = _239.v ^ 64; + } + rt.byteVecPush(out, mapOr$0ev76sb(rt.peekableNextIfEq(it10, 3, (a020: rt.Place, a116: rt.u8): boolean => { + return a020.v === a116; + }), 170, (b9: rt.Place): rt.u8 => { + return b9.v; + })); + rt.iterExtendBytes(out, rt.iterSlice(rt.byteVecView(bytes))); + const it11: rt.Peekable = rt.iterPeekable(rt.iterMap(rt.iterSlice(rt.byteSliceView(data)), (_210: rt.u8): Quarter.Quarter => { + return { _0: _210, _1: calls }; + })); + const want: rt.u8 = unwrapOr$0r2bmpr(rt.byteSliceFirst(data), 0); + while (true) { + const _262: Quarter.Quarter | undefined = rt.peekableNextIfEq(it11, want, Quarter.eq$PartialEq_u8); + if (_262 !== undefined) { + rt.byteVecPush(out, _262._0); + } else { + break; + } + } + rt.byteVecPush(out, mapOr$1lznlgz(rt.iterToOption(it11.next()), 170, (q2: Quarter.Quarter): rt.u8 => { + return q2._0; + })); + const it12: rt.Peekable = rt.iterPeekable(rt.iterSlice(rt.byteSliceView(data))); + rt.byteVecPush(out, unwrapOr$0r2bmpr(rt.peekableNextIfEq(it12, { _0: want ^ 1, _1: calls }, eq$PartialEq_Quarter_u8), 170)); + rt.byteVecPush(out, unwrapOr$0r2bmpr(rt.peekableNextIfEq(it12, { _0: want, _1: calls }, eq$PartialEq_Quarter_u8), 170)); + rt.byteVecPush(out, calls.v); +} + export function rotateFree$RotateFree_u8(self: rt.u8): rt.u8 { return ((self << 1) & 0xff) | (self >> 7); } diff --git a/ts/fixtures/lang/src/harness.rs b/ts/fixtures/lang/src/harness.rs index 813a3a45f..9be39af9e 100644 --- a/ts/fixtures/lang/src/harness.rs +++ b/ts/fixtures/lang/src/harness.rs @@ -155,6 +155,7 @@ fn cases() -> Vec<(&'static str, Case)> { ("arrays::as_slices", |_, data, out| arrays::as_slices(data, out)), ("ints::widenings", ints::widenings), ("shapes::uninhabited", |_, data, out| shapes::uninhabited(data, out)), + ("iters::peeked_others", |_, data, out| iters::peeked_others(data, out)), ] } diff --git a/ts/fixtures/lang/src/iters.rs b/ts/fixtures/lang/src/iters.rs index 21d6133d8..6ea889a58 100644 --- a/ts/fixtures/lang/src/iters.rs +++ b/ts/fixtures/lang/src/iters.rs @@ -272,6 +272,98 @@ pub fn reducers(data: &[u8], out: &mut Vec) { out.extend(log); } +/// A byte that equals a `u8` of the same remainder by 4, counting each comparison. +struct Quarter<'a>(u8, &'a std::cell::Cell); + +impl PartialEq for Quarter<'_> { + fn eq(&self, other: &u8) -> bool { + self.1.set(self.1.get() + 1); + self.0 % 4 == other % 4 + } +} + +impl PartialEq> for u8 { + fn eq(&self, other: &Quarter<'_>) -> bool { + other.1.set(other.1.get() + 0x10); + self % 4 == other.0 % 4 + } +} + +/// By the pair's sum, which reads the array through the reference `eq` takes. +impl PartialEq> for [u8; 2] { + fn eq(&self, other: &Quarter<'_>) -> bool { + other.1.set(other.1.get() + 0x40); + self.iter().sum::() == other.0 + } +} + +/// `Peekable::next_if_eq` against another type than the item's, by the item's +/// `PartialEq`: std's across strings and slices, and the crate's own. Each matches the +/// first item, and a mismatch keeps the item for the next `next`. +pub fn peeked_others(data: &[u8], out: &mut Vec) { + use std::borrow::Cow; + let letter = |b: u8| char::from(b'a' + b % 3).to_string(); + let head = |w: Option<&str>| w.map_or(0xaa, |w| w.as_bytes()[0]); + let words: Vec = data.iter().map(|&b| letter(b)).collect(); + let first = words.first().cloned().unwrap_or_default(); + let mut it = words.clone().into_iter().peekable(); + out.push(head(it.next_if_eq("a").as_deref())); + out.push(head(it.next_if_eq(&"b").as_deref())); + out.push(head(it.next().as_deref())); + // By `&String: PartialEq<&str>`, which compares what each points at. + let mut it = words.iter().peekable(); + out.push(head(it.next_if_eq(&first.as_str()).map(String::as_str))); + out.push(head(it.next_if_eq(&"c").map(String::as_str))); + out.push(head(it.next().map(String::as_str))); + let mut it = words.iter().map(String::as_str).peekable(); + out.push(head(it.next_if_eq(&first))); + out.push(head(it.next())); + let mut it = data.iter().map(|&b| vec![letter(b)]).peekable(); + out.push(head(it.next_if_eq(&vec![first.as_str()]).as_ref().map(|v| v[0].as_str()))); + out.push(head(it.next().as_ref().map(|v| v[0].as_str()))); + let mut it = words.iter().map(|w| Cow::Borrowed(w.as_str())).peekable(); + out.push(head(it.next_if_eq(&"b").as_deref())); + out.push(head(it.next().as_deref())); + let mut it = words.clone().into_iter().peekable(); + out.push(head(it.next_if_eq(&Cow::Owned(first.clone())).as_deref())); + + let len = |v: Option>| v.map_or(0xaa, |v| v.len() as u8); + let runs = |b: u8| vec![u16::from(b % 2) << 9; usize::from(b % 3)]; + let mut it = data.iter().map(|&b| runs(b)).peekable(); + out.push(len(it.next_if_eq(&[0u16][..]))); + out.push(len(it.next_if_eq(&[0x200, 0x200]))); + out.push(len(it.next_if_eq(&&[][..]))); + out.push(len(it.next())); + let mut it = data.iter().map(|&b| vec![b % 2; usize::from(b % 3)]).peekable(); + out.push(it.next_if_eq(&[1][..]).map_or(0xaa, |v| v.len() as u8)); + out.push(it.next().map_or(0xaa, |v| v.len() as u8)); + let calls = std::cell::Cell::new(0); + let mut it = data.chunks_exact(2).map(|c| [c[0] % 2, c[1] % 2]).peekable(); + out.push(it.next_if_eq(&[0, 1][..]).map_or(0xaa, |p| p[1])); + out.push(it.next().map_or(0xaa, |p| p[0])); + out.push(it.next_if_eq(&Quarter(1, &calls)).map_or(0xaa, |p| p[0])); + out.push(it.next().map_or(0xaa, |p| p[1])); + // `&mut u8` items, each a place, against a `&u8`, written through once taken. + let mut bytes = data.to_vec(); + let mut it = bytes.iter_mut().peekable(); + if let Some(b) = it.next_if_eq(&data.first().unwrap_or(&0)) { + *b ^= 0x40; + } + out.push(it.next_if_eq(&&3).map_or(0xaa, |b| *b)); + out.extend(bytes); + + let mut it = data.iter().map(|&b| Quarter(b, &calls)).peekable(); + let want = data.first().copied().unwrap_or(0); + while let Some(q) = it.next_if_eq(&want) { + out.push(q.0); + } + out.push(it.next().map_or(0xaa, |q| q.0)); + let mut it = data.iter().copied().peekable(); + out.push(it.next_if_eq(&Quarter(want ^ 1, &calls)).unwrap_or(0xaa)); + out.push(it.next_if_eq(&Quarter(want, &calls)).unwrap_or(0xaa)); + out.push(calls.get()); +} + trait RotateFree { fn rotate_free(self) -> Self; } diff --git a/ts/fixtures/reject/census.md b/ts/fixtures/reject/census.md index 84d19070e..82ec2bd4d 100644 --- a/ts/fixtures/reject/census.md +++ b/ts/fixtures/reject/census.md @@ -8,7 +8,7 @@ | Count | Construct | First | | ---: | --- | --- | -| 15 | unsupported call to `_` | fixtures/reject/src/lib.rs:136:11 | +| 16 | unsupported call to `_` | fixtures/reject/src/lib.rs:136:11 | | 12 | a raw pointer to `_` in `_`, which the crate may put another object in place of | fixtures/reject/src/lib.rs:661:10 | | 8 | a raw pointer to `_` in a variable assigned again while it may point there | fixtures/reject/src/lib.rs:669:10 | | 5 | passing `_`, which drops, to `_`, which is not supported yet | fixtures/reject/src/lib.rs:372:4 | @@ -46,7 +46,6 @@ | 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:429:6 | | 1 | `f64::mul_add`, which rounds once, where JS would round twice | fixtures/reject/src/lib.rs:480:4 | | 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:74:10 | -| 1 | `next_if_eq` of `_` items with a `_`, which is not supported yet | fixtures/reject/src/lib.rs:904:27 | | 1 | a `zip` of `_` and `_`, which std reads by index, of items that drop, which is not supported yet | fixtures/reject/src/lib.rs:231:30 | | 1 | a `zip` of `_`, whose closures std calls one item further through `next` than through `fold` | fixtures/reject/src/lib.rs:182:51 | | 1 | a cast from `_` to `_` | fixtures/reject/src/lib.rs:87:2 | @@ -114,7 +113,6 @@ The type or module each refused type or path belongs to. | 2 | `std::std` | fixtures/reject/src/lib.rs:620:11 | | 2 | `std::sync::MutexGuard` | fixtures/reject/src/lib.rs:102:2 | | 2 | `std::vec::IntoIter` | fixtures/reject/src/lib.rs:475:17 | -| 2 | `str` | fixtures/reject/src/lib.rs:372:4 | | 1 | `BTreeMap` | fixtures/reject/src/lib.rs:861:56 | | 1 | `Batched` | fixtures/reject/src/lib.rs:355:16 | | 1 | `BinaryHeap` | fixtures/reject/src/lib.rs:819:7 | @@ -150,6 +148,7 @@ The type or module each refused type or path belongs to. | 1 | `rt.Poll` | fixtures/reject/src/lib.rs:548:2 | | 1 | `std::any::Any` | fixtures/reject/src/lib.rs:591:4 | | 1 | `std::collections::HashSet` | fixtures/reject/src/lib.rs:899:6 | +| 1 | `std::collections::VecDeque` | fixtures/reject/src/lib.rs:904:27 | | 1 | `std::iter::Chain` | fixtures/reject/src/lib.rs:182:51 | | 1 | `std::iter::Rev` | fixtures/reject/src/lib.rs:176:14 | | 1 | `std::net::AddrParseError` | fixtures/reject/src/lib.rs:484:32 | @@ -159,10 +158,10 @@ The type or module each refused type or path belongs to. | 1 | `std::slice::Iter` | fixtures/reject/src/lib.rs:136:11 | | 1 | `std::std::Layout` | fixtures/reject/src/lib.rs:618:15 | | 1 | `std::str` | fixtures/reject/src/lib.rs:485:4 | -| 1 | `std::string::String` | fixtures/reject/src/lib.rs:904:27 | | 1 | `std::sync::Mutex` | fixtures/reject/src/lib.rs:567:12 | | 1 | `std::sync::Weak` | fixtures/reject/src/lib.rs:501:40 | | 1 | `std::task::Poll` | fixtures/reject/src/lib.rs:96:34 | +| 1 | `str` | fixtures/reject/src/lib.rs:372:4 | | 1 | `u64` | fixtures/reject/src/lib.rs:87:2 | | 1 | `value` | fixtures/reject/src/lib.rs:31:2 | | 1 | `{async closure}` | fixtures/reject/src/lib.rs:62:2 | @@ -206,7 +205,6 @@ The type or module each refused type or path belongs to. | 1 | `_`, which is not supported yet | `Hasher::write` | fixtures/reject/src/lib.rs:289: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:429:6 | | 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:74:10 | -| 1 | `next_if_eq` of `_` items with a `_`, which is not supported yet | `std::string::String`, `str` | fixtures/reject/src/lib.rs:904:27 | | 1 | a `zip` of `_` and `_`, which std reads by index, of items that drop, which is not supported yet | `std::iter::Map`, `std::ops::Range` | fixtures/reject/src/lib.rs:231:30 | | 1 | a `zip` of `_`, whose closures std calls one item further through `next` than through `fold` | `std::iter::Chain` | fixtures/reject/src/lib.rs:182:51 | | 1 | a cast from `_` to `_` | `u64`, `f32` | fixtures/reject/src/lib.rs:87:2 | @@ -256,6 +254,7 @@ The type or module each refused type or path belongs to. | 1 | union `_`, whose fields overlap in `_` and `f64`, which JS keeps apart | `Bits`, `u32` | fixtures/reject/src/lib.rs:635:1 | | 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:591:2 | | 1 | unsupported call to `_` | `::deref` | fixtures/reject/src/lib.rs:389:2 | +| 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:904:27 | | 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:415:2 | | 1 | unsupported call to `_` | `::cycle` | fixtures/reject/src/lib.rs:136:11 | | 1 | unsupported call to `_` | `::is_sorted` | fixtures/reject/src/lib.rs:824:15 | @@ -272,7 +271,7 @@ The type or module each refused type or path belongs to. ## Spans -
unsupported call to `_` (15) +
unsupported call to `_` (16) - fixtures/reject/src/lib.rs:136:11: unsupported call to ` as std::iter::Iterator>::cycle` - fixtures/reject/src/lib.rs:190:8: unsupported call to `std::ops::Range::::contains::` @@ -288,6 +287,7 @@ The type or module each refused type or path belongs to. - fixtures/reject/src/lib.rs:620:11: unsupported call to `std::alloc::alloc` - fixtures/reject/src/lib.rs:623:3: unsupported call to `std::alloc::dealloc` - fixtures/reject/src/lib.rs:824:15: unsupported call to ` as std::iter::Iterator>::is_sorted` +- fixtures/reject/src/lib.rs:904:27: unsupported call to ` as std::cmp::PartialEq>>::eq` - fixtures/reject/src/lib.rs:979:10: unsupported call to ` as std::clone::Clone>::clone_from`
@@ -561,12 +561,6 @@ The type or module each refused type or path belongs to.
-
`next_if_eq` of `_` items with a `_`, which is not supported yet (1) - -- fixtures/reject/src/lib.rs:904:27: `next_if_eq` of `std::string::String` items with a `str`, which is not supported yet - -
-
a `zip` of `_` and `_`, which std reads by index, of items that drop, which is not supported yet (1) - fixtures/reject/src/lib.rs:231:30: a `zip` of `std::iter::Map, {closure@fixtures/reject/src/lib.rs:231:15: 231:19}>` and `std::ops::Range`, which std reads by index, of items that drop, which is not supported yet diff --git a/ts/fixtures/reject/expected.txt b/ts/fixtures/reject/expected.txt index f183bad35..c9e0ff5de 100644 --- a/ts/fixtures/reject/expected.txt +++ b/ts/fixtures/reject/expected.txt @@ -111,7 +111,7 @@ passing `Spent`, which drops, to `VecDeque::drain`, which is not supported yet a passing `Spent`, which drops, to `BTreeMap::range`, which is not supported yet at fixtures/reject/src/lib.rs:861:56 passing `{closure@fixtures/reject/src/lib.rs:867:11: 867:19}`, which drops, to `String::retain`, which is not supported yet at fixtures/reject/src/lib.rs:867:4 `std::collections::HashSet::::get` 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:899:6 -`next_if_eq` of `std::string::String` items with a `str`, which is not supported yet at fixtures/reject/src/lib.rs:904:27 +unsupported call to ` as std::cmp::PartialEq>>::eq` at fixtures/reject/src/lib.rs:904:27 a raw pointer to `(u32, u32)` in `Plain`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:919: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:945: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:965:19 diff --git a/ts/fixtures/reject/src/lib.rs b/ts/fixtures/reject/src/lib.rs index 18b45ed73..29231b777 100644 --- a/ts/fixtures/reject/src/lib.rs +++ b/ts/fixtures/reject/src/lib.rs @@ -899,9 +899,9 @@ pub fn byte_key(set: &std::collections::HashSet<[u8; 2]>, key: [u8; 2]) -> u8 { set.get(&key).map_or(0, |k| k[0]) } -/// `next_if_eq` compares the item to another type by `PartialEq`, not the item's own. -pub fn peeked_str(v: Vec) -> bool { - v.into_iter().peekable().next_if_eq("a").is_some() +/// `next_if_eq` compares by the item's `PartialEq>`, which is refused as `==` is. +pub fn peeked_deque(v: Vec>) -> bool { + v.into_iter().peekable().next_if_eq(&vec![1]).is_some() } pub struct Plain { diff --git a/ts/fixtures/reject/ts.toml b/ts/fixtures/reject/ts.toml index d0744595d..1fe9d86d9 100644 --- a/ts/fixtures/reject/ts.toml +++ b/ts/fixtures/reject/ts.toml @@ -94,7 +94,7 @@ roots = [ "bound_ranges", "string_retained", "byte_key", - "peeked_str", + "peeked_deque", "put_replaced", "object_replaced", "closure_replaced", diff --git a/ts/runtime/rt/iter.ts b/ts/runtime/rt/iter.ts index e345db733..d36d6e346 100644 --- a/ts/runtime/rt/iter.ts +++ b/ts/runtime/rt/iter.ts @@ -2563,9 +2563,9 @@ export function peekableNextIf(p: Peekable, f: (item: T) => boolean, none? } /** `Peekable::next_if_eq`: `next_if` by `eq` of the next item and `expected`. */ -export function peekableNextIfEq(p: Peekable, expected: T, eq: (a: T, b: T) => boolean): T | undefined; -export function peekableNextIfEq(p: Peekable, expected: T, eq: (a: T, b: T) => boolean, none: None): T | None; -export function peekableNextIfEq(p: Peekable, expected: T, eq: (a: T, b: T) => boolean, none?: None): T | undefined | None { +export function peekableNextIfEq(p: Peekable, expected: U, eq: (a: T, b: U) => boolean): T | undefined; +export function peekableNextIfEq(p: Peekable, expected: U, eq: (a: T, b: U) => boolean, none: None): T | None; +export function peekableNextIfEq(p: Peekable, expected: U, eq: (a: T, b: U) => boolean, none?: None): T | undefined | None { return peekableNextIf(p, (item: T) => eq(item, expected), none); } diff --git a/ts/src/census.rs b/ts/src/census.rs index d261fc5e2..8c1dc1612 100644 --- a/ts/src/census.rs +++ b/ts/src/census.rs @@ -187,7 +187,6 @@ const VERBATIM: &[&str] = &[ "let ... else", "match", "next", - "next_if_eq", "ref mut", "rt.None", "rt.OuterPending", diff --git a/ts/src/lower/iter.rs b/ts/src/lower/iter.rs index 865f59926..7c7199cbf 100644 --- a/ts/src/lower/iter.rs +++ b/ts/src/lower/iter.rs @@ -12,7 +12,7 @@ use super::Translator; use super::body::Body; use super::library::{self, Call, Std}; use super::num::Int; -use crate::ts::{Expr, Param, Type}; +use crate::ts::{Expr, Param, StmtKind, Type}; /// `Iterator::next`, and the trait's `Item`. fn trait_items(tcx: ty::TyCtxt<'_>) -> Option<(DefId, DefId)> { @@ -478,16 +478,28 @@ pub fn call<'tcx>( "peek" | "next_if" => method(&camel, [rest, none.into_iter().collect()].concat()), // An item JS copies is lent as its place, and an object as itself. "peek_mut" => method(&camel, vec![Expr::lit(b.t.needs_place(item).to_string())]), - // By the item's own `PartialEq`, which `eq_fn` has only of the item's type. + // By the item's `PartialEq`: `eq_fn` of its own type, else the impl's `eq`, as a + // call to it lowers. "next_if_eq" => { let expected = targ(1)?; - if expected != item { - return Some(b.err( - span, - format!("`next_if_eq` of `{item}` items with a `{expected}`, which is not supported yet"), - )); - } - let eq = super::collections::eq_fn(b, item, span); + let eq = match expected == item { + true => super::collections::eq_fn(b, item, span), + false => { + let eq = super::collections::trait_fn(tcx, "PartialEq", "eq"); + let eq = b.fn_value(eq, tcx.mk_args(&[item.into(), expected.into()]), span); + match super::byte_array(item) { + // The `eq` takes a `&[u8; N]`, an `rt.ByteSlice` of the item's bytes. + true => { + let (a, c) = (b.fresh("a"), b.fresh("b")); + let lent = Expr::rt("byteSliceFrom", vec![Expr::ident(&a)]); + let call = eq.call(vec![lent, Expr::ident(&c)]); + let params = [a, c].map(|name| Param { name, ty: None }).into(); + Expr::Arrow(params, Type::Builtin("boolean"), vec![StmtKind::Return(Some(call)).at(None)]) + } + false => eq, + } + } + }; method(&camel, [rest, vec![eq], none.into_iter().collect()].concat()) } // By the comparator, which `best` calls with the best so far and then the next, as From 59b7836b7ec16bb3a679ae8335861538d540b4da Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Fri, 30 Oct 2026 11:15:30 -0700 Subject: [PATCH 3/4] style(ts): format next_if_eq's lowering and fixture Co-Authored-By: Claude Opus 5.5 --- ts/fixtures/lang/src/iters.rs | 4 +++- ts/src/lower/iter.rs | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ts/fixtures/lang/src/iters.rs b/ts/fixtures/lang/src/iters.rs index 6ea889a58..6e3672003 100644 --- a/ts/fixtures/lang/src/iters.rs +++ b/ts/fixtures/lang/src/iters.rs @@ -319,7 +319,9 @@ pub fn peeked_others(data: &[u8], out: &mut Vec) { out.push(head(it.next_if_eq(&first))); out.push(head(it.next())); let mut it = data.iter().map(|&b| vec![letter(b)]).peekable(); - out.push(head(it.next_if_eq(&vec![first.as_str()]).as_ref().map(|v| v[0].as_str()))); + out.push(head( + it.next_if_eq(&vec![first.as_str()]).as_ref().map(|v| v[0].as_str()), + )); out.push(head(it.next().as_ref().map(|v| v[0].as_str()))); let mut it = words.iter().map(|w| Cow::Borrowed(w.as_str())).peekable(); out.push(head(it.next_if_eq(&"b").as_deref())); diff --git a/ts/src/lower/iter.rs b/ts/src/lower/iter.rs index 7c7199cbf..034e853c9 100644 --- a/ts/src/lower/iter.rs +++ b/ts/src/lower/iter.rs @@ -494,7 +494,11 @@ pub fn call<'tcx>( let lent = Expr::rt("byteSliceFrom", vec![Expr::ident(&a)]); let call = eq.call(vec![lent, Expr::ident(&c)]); let params = [a, c].map(|name| Param { name, ty: None }).into(); - Expr::Arrow(params, Type::Builtin("boolean"), vec![StmtKind::Return(Some(call)).at(None)]) + Expr::Arrow( + params, + Type::Builtin("boolean"), + vec![StmtKind::Return(Some(call)).at(None)], + ) } false => eq, } From a35bd2ecd89fea6315f05a3600d283c3e7fbece2 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 30 Oct 2026 11:58:04 -0700 Subject: [PATCH 4/4] test(ts): regenerate the lang harness and reject census after merging main Co-Authored-By: Claude Opus 5.5 --- ts/fixtures/lang/expected/harness.ts | 6 ++- ts/fixtures/reject/census.md | 72 +++++++++++++--------------- 2 files changed, 38 insertions(+), 40 deletions(-) diff --git a/ts/fixtures/lang/expected/harness.ts b/ts/fixtures/lang/expected/harness.ts index 0801da818..76ee08217 100644 --- a/ts/fixtures/lang/expected/harness.ts +++ b/ts/fixtures/lang/expected/harness.ts @@ -24,7 +24,7 @@ import { methods } from "./generics.ts"; import { values, random, bytes as hashes_bytes } from "./hashes.ts"; import { holds } from "./holds.ts"; import { u8Op, u16Op, u32Op, u64Op, u128Op, usizeOp, i8Op, i16Op, i32Op, i64Op, i128Op, isizeOp, i8Neg, i16Neg, i32Neg, i64Neg, i128Neg, isizeNeg, cast as ints_cast, convert, parses as ints_parses, widenings } from "./ints.ts"; -import { adaptors, consumers, reducers, skips, ranked, ranges, options, own, values as iters_values, returned } from "./iters.ts"; +import { adaptors, consumers, reducers, peekedOthers, skips, ranked, ranges, options, own, values as iters_values, returned } from "./iters.ts"; import { keys, overrides, bytes as keys_bytes, lentKeys, lentValues } from "./keys.ts"; import { locals } from "./locals.ts"; import { locks, relock, rwlocks } from "./locks.ts"; @@ -183,7 +183,9 @@ export function cases(): [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) asSlices(data66, out67); }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["ints::widenings", widenings] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["shapes::uninhabited", (_2167: rt.u8, data67: rt.ByteSlice, out68: rt.ByteVec): void => { uninhabited(data67, out68); - }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["keys::lent_keys", lentKeys] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["keys::lent_values", lentValues] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["singles::singles", singles] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["singles::formats", singles_formats] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["singles::parses", singles_parses] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void]]; + }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["keys::lent_keys", lentKeys] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["keys::lent_values", lentValues] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["singles::singles", singles] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["singles::formats", singles_formats] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["singles::parses", singles_parses] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void], ["iters::peeked_others", (_2168: rt.u8, data68: rt.ByteSlice, out69: rt.ByteVec): void => { + peekedOthers(data68, out69); + }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => void]]; } /** Run one case. */ diff --git a/ts/fixtures/reject/census.md b/ts/fixtures/reject/census.md index 3085a501f..45b1f9898 100644 --- a/ts/fixtures/reject/census.md +++ b/ts/fixtures/reject/census.md @@ -1,14 +1,14 @@ # Census of `reject-fixture` -- Refusals: 128 -- Function instances: 150 +- Refusals: 129 +- Function instances: 152 - 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:136:11 | +| 17 | unsupported call to `_` | fixtures/reject/src/lib.rs:136:11 | | 12 | a raw pointer to `_` in `_`, which the crate may put another object in place of | fixtures/reject/src/lib.rs:661:10 | | 8 | a raw pointer to `_` in a variable assigned again while it may point there | fixtures/reject/src/lib.rs:669:10 | | 5 | passing `_`, which drops, to `_`, which is not supported yet | fixtures/reject/src/lib.rs:372:4 | @@ -46,7 +46,6 @@ | 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:429:6 | | 1 | `f64::mul_add`, which rounds once, where JS would round twice | fixtures/reject/src/lib.rs:480:4 | | 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:74:10 | -| 1 | `next_if_eq` of `_` items with a `_`, which is not supported yet | fixtures/reject/src/lib.rs:899:27 | | 1 | a `zip` of `_` and `_`, which std reads by index, of items that drop, which is not supported yet | fixtures/reject/src/lib.rs:231:30 | | 1 | a `zip` of `_`, whose closures std calls one item further through `next` than through `fold` | fixtures/reject/src/lib.rs:182:51 | | 1 | a cast from `_` to `_` | fixtures/reject/src/lib.rs:87:2 | @@ -86,16 +85,16 @@ The type or module each refused type or path belongs to. | 7 | `std::borrow::Cow` | fixtures/reject/src/lib.rs:377:2 | | 6 | `Option` | fixtures/reject/src/lib.rs:16:15 | | 6 | `f16` | fixtures/reject/src/lib.rs:7:14 | -| 5 | `Gap` | fixtures/reject/src/lib.rs:996:10 | +| 5 | `Gap` | fixtures/reject/src/lib.rs:1011:10 | | 5 | `u32` | fixtures/reject/src/lib.rs:608:27 | | 4 | `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:740:15 | | 4 | `std::pin::Pin` | fixtures/reject/src/lib.rs:110:2 | +| 4 | `std::vec::Vec` | fixtures/reject/src/lib.rs:355:16 | | 4 | `{closure}` | fixtures/reject/src/lib.rs:364:13 | | 3 | `Iterator` | fixtures/reject/src/lib.rs:149:2 | | 3 | `Spent` | fixtures/reject/src/lib.rs:856:4 | | 3 | `std::collections::HashMap` | fixtures/reject/src/lib.rs:53:13 | | 3 | `std::sync::Arc` | fixtures/reject/src/lib.rs:313:2 | -| 3 | `std::vec::Vec` | fixtures/reject/src/lib.rs:355:16 | | 3 | `u8` | fixtures/reject/src/lib.rs:281:6 | | 2 | `Poll` | fixtures/reject/src/lib.rs:91:20 | | 2 | `Reused` | fixtures/reject/src/lib.rs:21:4 | @@ -108,12 +107,11 @@ The type or module each refused type or path belongs to. | 2 | `std::collections::BTreeSet` | fixtures/reject/src/lib.rs:263:75 | | 2 | `std::iter::Iterator` | fixtures/reject/src/lib.rs:242:16 | | 2 | `std::iter::Map` | fixtures/reject/src/lib.rs:155:23 | -| 2 | `std::mem::MaybeUninit` | fixtures/reject/src/lib.rs:1010:19 | +| 2 | `std::mem::MaybeUninit` | fixtures/reject/src/lib.rs:1025:19 | | 2 | `std::ops::Range` | fixtures/reject/src/lib.rs:190:8 | | 2 | `std::std` | fixtures/reject/src/lib.rs:620:11 | | 2 | `std::sync::MutexGuard` | fixtures/reject/src/lib.rs:102:2 | | 2 | `std::vec::IntoIter` | fixtures/reject/src/lib.rs:475:17 | -| 2 | `str` | fixtures/reject/src/lib.rs:372:4 | | 1 | `Arc` | fixtures/reject/src/lib.rs:41:2 | | 1 | `BTreeMap` | fixtures/reject/src/lib.rs:856:56 | | 1 | `Batched` | fixtures/reject/src/lib.rs:355:16 | @@ -127,18 +125,18 @@ The type or module each refused type or path belongs to. | 1 | `HashMap` | fixtures/reject/src/lib.rs:281:6 | | 1 | `Hasher` | fixtures/reject/src/lib.rs:289:9 | | 1 | `Hits` | fixtures/reject/src/lib.rs:773:21 | -| 1 | `Lane` | fixtures/reject/src/lib.rs:960:19 | +| 1 | `Lane` | fixtures/reject/src/lib.rs:975:19 | | 1 | `Maybe` | fixtures/reject/src/lib.rs:31:2 | | 1 | `Noisy` | fixtures/reject/src/lib.rs:53:13 | | 1 | `Only` | fixtures/reject/src/lib.rs:790:11 | -| 1 | `Plain` | fixtures/reject/src/lib.rs:914:10 | +| 1 | `Plain` | fixtures/reject/src/lib.rs:929:10 | | 1 | `Rc` | fixtures/reject/src/lib.rs:258:2 | | 1 | `Sink` | fixtures/reject/src/lib.rs:74:10 | | 1 | `Span2` | fixtures/reject/src/lib.rs:661:10 | | 1 | `String` | fixtures/reject/src/lib.rs:862:4 | | 1 | `T \| undefined` | fixtures/reject/src/lib.rs:31:2 | | 1 | `Tail` | fixtures/reject/src/lib.rs:537:30 | -| 1 | `Track` | fixtures/reject/src/lib.rs:940:19 | +| 1 | `Track` | fixtures/reject/src/lib.rs:955:19 | | 1 | `VecDeque` | fixtures/reject/src/lib.rs:856:29 | | 1 | `Vec` | fixtures/reject/src/lib.rs:856:4 | | 1 | `Waiting` | fixtures/reject/src/lib.rs:548:2 | @@ -149,8 +147,9 @@ The type or module each refused type or path belongs to. | 1 | `poll` | fixtures/reject/src/lib.rs:548:2 | | 1 | `rt.Poll` | fixtures/reject/src/lib.rs:548:2 | | 1 | `std::any::Any` | fixtures/reject/src/lib.rs:591:4 | +| 1 | `std::collections::VecDeque` | fixtures/reject/src/lib.rs:899:27 | | 1 | `std::iter::Chain` | fixtures/reject/src/lib.rs:182:51 | -| 1 | `std::iter::Extend` | fixtures/reject/src/lib.rs:1018:6 | +| 1 | `std::iter::Extend` | fixtures/reject/src/lib.rs:1033:6 | | 1 | `std::iter::Rev` | fixtures/reject/src/lib.rs:176:14 | | 1 | `std::net::AddrParseError` | fixtures/reject/src/lib.rs:484:32 | | 1 | `std::net::Ipv4Addr` | fixtures/reject/src/lib.rs:484:32 | @@ -159,10 +158,10 @@ The type or module each refused type or path belongs to. | 1 | `std::slice::Iter` | fixtures/reject/src/lib.rs:136:11 | | 1 | `std::std::Layout` | fixtures/reject/src/lib.rs:618:15 | | 1 | `std::str` | fixtures/reject/src/lib.rs:485:4 | -| 1 | `std::string::String` | fixtures/reject/src/lib.rs:899:27 | | 1 | `std::sync::Mutex` | fixtures/reject/src/lib.rs:567:12 | | 1 | `std::sync::Weak` | fixtures/reject/src/lib.rs:501:40 | | 1 | `std::task::Poll` | fixtures/reject/src/lib.rs:96:34 | +| 1 | `str` | fixtures/reject/src/lib.rs:372:4 | | 1 | `u64` | fixtures/reject/src/lib.rs:87:2 | | 1 | `value` | fixtures/reject/src/lib.rs:31:2 | | 1 | `{async closure}` | fixtures/reject/src/lib.rs:62:2 | @@ -173,12 +172,12 @@ The type or module each refused type or path belongs to. | ---: | --- | --- | --- | | 6 | a raw pointer to `_` in a variable assigned again while it may point there | `(u32, u32)` | fixtures/reject/src/lib.rs:669:10 | | 4 | a variant of `_`, which is not supported: either is the same JS string | `std::borrow::Cow` | fixtures/reject/src/lib.rs:377: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:996:10 | +| 3 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Gap` | fixtures/reject/src/lib.rs:1011: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 | `_`, 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:510: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:1010:19 | +| 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:1025:19 | | 2 | a raw pointer to `_` in a variable assigned again while it may point there | `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:749:15 | | 2 | an assignment through a reference to `_` | `std::pin::Pin` | fixtures/reject/src/lib.rs:126:2 | | 2 | replacing the value behind a reference to `_` | `std::pin::Pin` | fixtures/reject/src/lib.rs:110:2 | @@ -198,7 +197,7 @@ The type or module each refused type or path belongs to. | 1 | `_` of `_`, whose `clone_from` is its own, which is not supported yet | `slice::clone_from_slice`, `Reused` | fixtures/reject/src/lib.rs:331: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:894: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:1018: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:1033: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:242: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:242:16 | | 1 | `_` through a held type's own, which is not supported yet | `::ne` | fixtures/reject/src/lib.rs:313:2 | @@ -206,7 +205,6 @@ The type or module each refused type or path belongs to. | 1 | `_`, which is not supported yet | `Hasher::write` | fixtures/reject/src/lib.rs:289: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:429:6 | | 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:74:10 | -| 1 | `next_if_eq` of `_` items with a `_`, which is not supported yet | `std::string::String`, `str` | fixtures/reject/src/lib.rs:899:27 | | 1 | a `zip` of `_` and `_`, which std reads by index, of items that drop, which is not supported yet | `std::iter::Map`, `std::ops::Range` | fixtures/reject/src/lib.rs:231:30 | | 1 | a `zip` of `_`, whose closures std calls one item further through `next` than through `fold` | `std::iter::Chain` | fixtures/reject/src/lib.rs:182:51 | | 1 | a cast from `_` to `_` | `u64`, `f16` | fixtures/reject/src/lib.rs:87:2 | @@ -218,10 +216,10 @@ The type or module each refused type or path belongs to. | 1 | a dangling pointer to `_`, a value of no bytes made of more than structs and tuples | `Only` | fixtures/reject/src/lib.rs:790: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:96: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:630: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:960: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:914: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:975: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:929: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:661: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:940:19 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Track` | fixtures/reject/src/lib.rs:955: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:722: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:740: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:773:21 | @@ -256,10 +254,12 @@ The type or module each refused type or path belongs to. | 1 | union `_`, whose fields overlap in `_` and `f64`, which JS keeps apart | `Bits`, `u32` | fixtures/reject/src/lib.rs:635:1 | | 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:591:2 | | 1 | unsupported call to `_` | `::deref` | fixtures/reject/src/lib.rs:389:2 | +| 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:899:27 | | 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:415:2 | | 1 | unsupported call to `_` | `::cycle` | fixtures/reject/src/lib.rs:136:11 | | 1 | unsupported call to `_` | `::is_sorted` | fixtures/reject/src/lib.rs:819:15 | -| 1 | unsupported call to `_` | `::clone_from` | fixtures/reject/src/lib.rs:974:10 | +| 1 | unsupported call to `_` | `::clone_from` | fixtures/reject/src/lib.rs:989:10 | +| 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:914:27 | | 1 | unsupported call to `_` | `::hash` | fixtures/reject/src/lib.rs:346:10 | | 1 | unsupported call to `_` | `std::any::TypeId::of` | fixtures/reject/src/lib.rs:591:17 | | 1 | unsupported call to `_` | `std::ops::Range::contains` | fixtures/reject/src/lib.rs:190:8 | @@ -272,7 +272,7 @@ The type or module each refused type or path belongs to. ## Spans -
unsupported call to `_` (15) +
unsupported call to `_` (17) - fixtures/reject/src/lib.rs:136:11: unsupported call to ` as std::iter::Iterator>::cycle` - fixtures/reject/src/lib.rs:190:8: unsupported call to `std::ops::Range::::contains::` @@ -288,7 +288,9 @@ The type or module each refused type or path belongs to. - fixtures/reject/src/lib.rs:620:11: unsupported call to `std::alloc::alloc` - fixtures/reject/src/lib.rs:623:3: unsupported call to `std::alloc::dealloc` - fixtures/reject/src/lib.rs:819:15: unsupported call to ` as std::iter::Iterator>::is_sorted` -- fixtures/reject/src/lib.rs:974:10: unsupported call to ` as std::clone::Clone>::clone_from` +- fixtures/reject/src/lib.rs:899:27: unsupported call to ` as std::cmp::PartialEq>>::eq` +- fixtures/reject/src/lib.rs:914:27: unsupported call to ` as std::cmp::PartialEq<&[Right]>>::eq` +- fixtures/reject/src/lib.rs:989:10: unsupported call to ` as std::clone::Clone>::clone_from`
@@ -298,14 +300,14 @@ The type or module each refused type or path belongs to. - fixtures/reject/src/lib.rs:722:2: a raw pointer to `(u32, u32)` in `Window`, which the crate may put another object in place of - fixtures/reject/src/lib.rs:740: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:773: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:914:10: a raw pointer to `(u32, u32)` in `Plain`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:940:19: a raw pointer to `(u32, u32)` in `Track`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:960:19: a raw pointer to `(u32, u32)` in `Lane`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:996:10: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:997:10: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:998:58: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1010: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:1011: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:929:10: a raw pointer to `(u32, u32)` in `Plain`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:955:19: a raw pointer to `(u32, u32)` in `Track`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:975:19: a raw pointer to `(u32, u32)` in `Lane`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1011:10: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1012:10: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1013:58: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1025: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:1026:19: a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of
@@ -337,7 +339,7 @@ The type or module each refused type or path belongs to. - fixtures/reject/src/lib.rs:242: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:242: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:894: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:1018: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:1033: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
@@ -561,12 +563,6 @@ The type or module each refused type or path belongs to. -
`next_if_eq` of `_` items with a `_`, which is not supported yet (1) - -- fixtures/reject/src/lib.rs:899:27: `next_if_eq` of `std::string::String` items with a `str`, which is not supported yet - -
-
a `zip` of `_` and `_`, which std reads by index, of items that drop, which is not supported yet (1) - fixtures/reject/src/lib.rs:231:30: a `zip` of `std::iter::Map, {closure@fixtures/reject/src/lib.rs:231:15: 231:19}>` and `std::ops::Range`, which std reads by index, of items that drop, which is not supported yet