diff --git a/quest/m3/README.md b/quest/m3/README.md index ccb9886f1..df312b5ab 100644 --- a/quest/m3/README.md +++ b/quest/m3/README.md @@ -22,7 +22,6 @@ generic std gap is planned here even when moq never calls it. - [bytes' Chain as a Buf object](/quest/m3/ts-buf-chain.md) - `Chain::copy_to_bytes` across both halves translates, and with it a `Chain` as a `dyn Buf` - [A Buf object's size](/quest/m3/ts-dyn-buf-size.md) - a `dyn Buf` object holds only the methods some call dispatches to - [A boxed iterator folds as std's box does](/quest/m3/ts-box-folds.md) - a `Box` reads by `next` where std's `Iterator` for `Box` forwards nothing else -- [mem::take as a function value](/quest/m3/ts-take-value.md) - `mem::take`, `replace`, and `swap` passed as a function value translate - [Debug of a RefCell or a Cell](/quest/m3/ts-refcell-debug.md) - `{:?}` of a `RefCell`, `Ref`, `RefMut`, and `Cell` translates as std's writes them - [Placeholders written to a crate's own fmt::Write](/quest/m3/ts-fmt-calls.md) - `write!` with placeholders into a crate's own writer translates, its `write_str` seeing each call std makes - [Waiting: drop the lang fixture's mul_add allowance](/quest/m3/ts-fma-allowance.md) - the differential fails on any `mul_add` difference again once wasm32's `fma` rounds exactly diff --git a/quest/m3/ts-take-value.md b/quest/m3/ts-take-value.md deleted file mode 100644 index 86ae6102b..000000000 --- a/quest/m3/ts-take-value.md +++ /dev/null @@ -1,14 +0,0 @@ -# [XS] mem::take as a function value - -## Goal - -[rust2-ts](/ts/README.md) translates `std::mem::take`, `replace`, and `swap` passed as a -function value, such as `v.iter_mut().map(std::mem::take)`, as their calls do, proven by a -differential test against native Rust. - -## Plan - -Found writing [`dyn Iterator`](https://github.com/moq-dev/rust2/pull/437): the call maps, -but the function value is an "unsupported call to `std::mem::take::>`". - -Public API: the translator's output. diff --git a/ts/README.md b/ts/README.md index 287504ae2..9c11e89fa 100644 --- a/ts/README.md +++ b/ts/README.md @@ -121,7 +121,7 @@ crate translation reaches is refused, and so are two versions of one crate it re | `Duration` | `rt.Duration`: `{ secs, nanos }`, std's whole seconds as an `rt.u64` and the nanoseconds past them, never changed once made | | `Layout`, `alloc::alloc` | `rt.Layout`: `{ size, align }`, never changed once made, checked as std's constructors check it; `alloc` gives an `rt.Block` of its bytes, which a cast of its pointer to `*mut T` the body shows came from `alloc` or `realloc` makes a JS array of `T`s, values JS copies, as an `rt.AtIndex` of its first; a cast back to `*mut u8` only as what `dealloc` or `realloc` takes, which free the array or copy it into a new one; its bytes, read, written, or cast to any other type, are refused, and fail at run time through a pointer from elsewhere | | closure | an arrow function, with `[Symbol.dispose]` if it owns a value that drops, and what makes its clone if a clone can't be itself | -| `fn` pointer, function item as a value | the function, as a closure is typed: a `()` result is `undefined`, where a declared function returns `void` | +| `fn` pointer, function item as a value | the function, or std's an arrow that calls it as a written call does, as a closure is typed: a `()` result is `undefined`, where a declared function returns `void` | | `&dyn Trait`, `&mut dyn Trait`, `Box`, `Arc`, `Rc`, `Weak`, `Pin

` of one | an object with the trait's methods, its supertraits' included: `shape.area$Shape()`; behind an `Arc` or an `Rc`, an `rt.ArcDyn` sharing the count of the `Arc` it was made from | | `dyn Error` | an object of its `source`, `fmt$Debug`, and `fmt$Display`: `e.source$Error()` | | `dyn Any` | an instance of the class its value's type was wrapped in, which a downcast checks for: `a instanceof Any.of$dyns_Square ? a.v : undefined` | diff --git a/ts/fixtures/codec/expected/harness.ts b/ts/fixtures/codec/expected/harness.ts index c7d171c7d..b0260cedd 100644 --- a/ts/fixtures/codec/expected/harness.ts +++ b/ts/fixtures/codec/expected/harness.ts @@ -26,16 +26,16 @@ export function cases(): Array<(a0: rt.ByteSlice, a1: rt.ByteVec) => undefined> decodeScript(a0.data, a0.start, a0.length, a1); }, (a02: rt.ByteSlice, a12: rt.ByteVec): undefined => { encodeScript(a02.data, a02.start, a02.length, a12); - }, zigzag as (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined, sizes as (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined, (a05: rt.ByteSlice, a15: rt.ByteVec): undefined => { - roundtrip$coding_version_Versions(a05.data, a05.start, a05.length, a15); + }, zigzag as (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined, sizes as (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined, (a03: rt.ByteSlice, a13: rt.ByteVec): undefined => { + roundtrip$coding_version_Versions(a03.data, a03.start, a03.length, a13); + }, (a04: rt.ByteSlice, a14: rt.ByteVec): undefined => { + roundtripLite$lite_group_Group(a04.data, a04.start, a04.length, a14); + }, (a05: rt.ByteSlice, a15: rt.ByteVec): undefined => { + roundtripLite$lite_probe_Probe(a05.data, a05.start, a05.length, a15); }, (a06: rt.ByteSlice, a16: rt.ByteVec): undefined => { - roundtripLite$lite_group_Group(a06.data, a06.start, a06.length, a16); + encodeMessages(a06.data, a06.start, a06.length, a16); }, (a07: rt.ByteSlice, a17: rt.ByteVec): undefined => { - roundtripLite$lite_probe_Probe(a07.data, a07.start, a07.length, a17); - }, (a08: rt.ByteSlice, a18: rt.ByteVec): undefined => { - encodeMessages(a08.data, a08.start, a08.length, a18); - }, (a09: rt.ByteSlice, a19: rt.ByteVec): undefined => { - errors(a09.data, a09.start, a09.length, a19); + errors(a07.data, a07.start, a07.length, a17); }]; } diff --git a/ts/fixtures/lang/args/expected/args.ts b/ts/fixtures/lang/args/expected/args.ts index 1688cc083..1351346d4 100644 --- a/ts/fixtures/lang/args/expected/args.ts +++ b/ts/fixtures/lang/args/expected/args.ts @@ -160,8 +160,8 @@ export function args(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { rt.byteVecPush(out, byRef(data) & 0xff); rt.byteVecPush(out, rt.iterFold(rt.iterMap(rt.iterSlice(kept(data, kind)), (s: rt.ByteSlice): rt.u8 => { return opaque(s); - }), 0, (a05: rt.u8, a1: rt.u8): rt.u8 => { - return rt.u8WrappingAdd(a05, a1); + }), 0, (a03: rt.u8, a1: rt.u8): rt.u8 => { + return rt.u8WrappingAdd(a03, a1); })); } else if (_4 === 1) { if (data.length >= 4) { @@ -176,8 +176,8 @@ export function args(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { return _2[1]; }), opaque)), undefined, true); if (!(rt.usizeRem(data.length, 2) === 0)) { - f = (a03: rt.ByteSlice): rt.u8 => { - return sum(a03.data, a03.start, a03.length); + f = (a0: rt.ByteSlice): rt.u8 => { + return sum(a0.data, a0.start, a0.length); }; } else { f = opaque; @@ -185,8 +185,8 @@ export function args(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { rt.byteVecPush(out, f(data)); rt.byteVecPush(out, option_mapOr$0dk8jdr(option_map$1yogfym((data.length !== 0 ? [data.data[data.start], new rt.ByteSlice(data.data, data.start + 1, data.length - 1)] as [rt.u8, rt.ByteSlice] : undefined) as [rt.u8, rt.ByteSlice] | undefined, (_22: [rt.u8, rt.ByteSlice]): rt.ByteSlice => { return _22[1]; - }), 0, (a04: rt.ByteSlice): rt.usize => { - return len(a04.data, a04.start, a04.length); + }), 0, (a02: rt.ByteSlice): rt.usize => { + return len(a02.data, a02.start, a02.length); }) & 0xff); } else if (_4 === 3) { rt.byteVecPush(out, pair(code(out, 1), pick(out, data))); diff --git a/ts/fixtures/lang/borrows/expected/borrows.ts b/ts/fixtures/lang/borrows/expected/borrows.ts index eb1e2df50..7ddb438eb 100644 --- a/ts/fixtures/lang/borrows/expected/borrows.ts +++ b/ts/fixtures/lang/borrows/expected/borrows.ts @@ -156,8 +156,8 @@ export function guards(data: rt.ByteSlice, out: rt.ByteVec): void { rt.byteVecPush(out, _81.value.id); rt.refRelease(_81); drop$tuple2_Option_cell_Ref_borrows_Tagged_Option_cell_RefMut_borrows_Tagged([held, heldMut] as [rt.RefCell | undefined, rt.RefCell | undefined]); - rt.byteVecExtendFromSlice(out, rt.byteVecSlice(rt.refCellClone(bytes, (a02: rt.ByteVec): rt.ByteVec => { - return rt.byteVecFrom(rt.byteVecView(a02)); + rt.byteVecExtendFromSlice(out, rt.byteVecSlice(rt.refCellClone(bytes, (a0: rt.ByteVec): rt.ByteVec => { + return rt.byteVecFrom(rt.byteVecView(a0)); }).value)); rt.byteVecPush(out, rt.refCellClone(number, undefined).value & 0xff); copy[Symbol.dispose](); diff --git a/ts/fixtures/lang/boxes/expected/boxes.ts b/ts/fixtures/lang/boxes/expected/boxes.ts index fa5eb765c..0bdbf8507 100644 --- a/ts/fixtures/lang/boxes/expected/boxes.ts +++ b/ts/fixtures/lang/boxes/expected/boxes.ts @@ -214,8 +214,8 @@ export function boxes(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { rt.iterExtendBytes(out, rt.iterSlice(rt.u64ToBeBytes(hash$boxed_Box_slice_u8(b)).reverse()), undefined, true); rt.byteVecPush(out, a.length & 0xff); rt.byteVecPush(out, a.length === 0 ? 1 : 0); - rt.byteVecPush(out, rt.iterFold(rt.iterSlice(rt.byteSliceView(a)), 0, (a04: rt.u8, a1: rt.u8): rt.u8 => { - return rt.u8WrappingAdd(a04, a1); + rt.byteVecPush(out, rt.iterFold(rt.iterSlice(rt.byteSliceView(a)), 0, (a0: rt.u8, a1: rt.u8): rt.u8 => { + return rt.u8WrappingAdd(a0, a1); })); rt.byteVecPush(out, rt.byteSliceView(a).includes(0) ? 1 : 0); rt.byteVecPush(out, option_unwrapOr$0r2bmpr(rt.byteSliceFirst(a), 170)); diff --git a/ts/fixtures/lang/clones/expected/clones.ts b/ts/fixtures/lang/clones/expected/clones.ts index 9ae078f6b..d73568da2 100644 --- a/ts/fixtures/lang/clones/expected/clones.ts +++ b/ts/fixtures/lang/clones/expected/clones.ts @@ -7454,8 +7454,8 @@ export function owned(data: rt.ByteSlice, plan: Plan.Plan, out: rt.ByteVec): voi }), undefined, 12, true), drop$Vec_clones_Logged), (value: Logged.Logged[]) => rt.iterSlice(value, rt.drop), true); rt.drop(rt.iterToOption(it4.next())); rt.drop(rt.iterToOption(it4.nextBack())); - const clone4: rt.Iter = it4.clone({ i: { v: (a07: Logged.Logged[]): Logged.Logged[] => { - return rt.vecExact(a07.map(Logged.clone$Clone), 8); + const clone4: rt.Iter = it4.clone({ i: { v: (a0: Logged.Logged[]): Logged.Logged[] => { + return rt.vecExact(a0.map(Logged.clone$Clone), 8); } }, o: { v: Logged.clone$Clone } }); flush(log.value, out); rt.drop(it4); @@ -7463,9 +7463,9 @@ export function owned(data: rt.ByteSlice, plan: Plan.Plan, out: rt.ByteVec): voi turns$iter_Flatten_vec_IntoIter_Vec_clones_Logged_clones_owned_closure13_clones_owned_closure14(clone4, (it10: rt.Iter): Logged.Logged | undefined => { return rt.iterToOption(it10.nextBack()); }, plan, (x5: Logged.Logged): rt.u8 => { - const _016: rt.u8 = Logged.id(x5); + const _017: rt.u8 = Logged.id(x5); x5[Symbol.dispose](); - return _016; + return _017; }, out); flush(log.value, out); const it5: rt.Iter = rt.iterSuccessors(logged(40), (x6: Logged.Logged): Logged.Logged | undefined => { @@ -7479,9 +7479,9 @@ export function owned(data: rt.ByteSlice, plan: Plan.Plan, out: rt.ByteVec): voi turns$iter_Successors_clones_Logged_clones_owned_closure15_clones_owned_closure16_clones_owned_closure17(clone5, (it11: rt.Iter): Logged.Logged | undefined => { return rt.iterToOption(it11.next()); }, plan, (x7: Logged.Logged): rt.u8 => { - const _020: rt.u8 = Logged.id(x7); + const _021: rt.u8 = Logged.id(x7); x7[Symbol.dispose](); - return _020; + return _021; }, out); rt.drop(it5); flush(log.value, out); diff --git a/ts/fixtures/lang/collections/expected/collections.ts b/ts/fixtures/lang/collections/expected/collections.ts index 3d78d86df..9b7e259b8 100644 --- a/ts/fixtures/lang/collections/expected/collections.ts +++ b/ts/fixtures/lang/collections/expected/collections.ts @@ -3734,16 +3734,16 @@ export function unlikeEqs(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): voi })(two, _109), log, out); const _115: Left.Left[] = []; const _117: Right.Right[] = []; - putEq(rt.eqSeq((a20: Left.Left, b17: Right.Right): boolean => { - return !Left.ne$cmp_PartialEq_collections_Right(a20, b17); + putEq(rt.eqSeq((a12: Left.Left, b17: Right.Right): boolean => { + return !Left.ne$cmp_PartialEq_collections_Right(a12, b17); })(_115, _117), log, out); const _122: Left.Left[] = []; - putEq(rt.eqSeq((a21: Left.Left, b18: Right.Right): boolean => { - return !Left.ne$cmp_PartialEq_collections_Right(a21, b18); + putEq(rt.eqSeq((a13: Left.Left, b18: Right.Right): boolean => { + return !Left.ne$cmp_PartialEq_collections_Right(a13, b18); })(_122, rights_), log, out); const _128: Right.Right[] = []; - putEq(rt.eqSeq((a22: Left.Left, b19: Right.Right): boolean => { - return !Left.ne$cmp_PartialEq_collections_Right(a22, b19); + putEq(rt.eqSeq((a14: Left.Left, b19: Right.Right): boolean => { + return !Left.ne$cmp_PartialEq_collections_Right(a14, b19); })(mine, _128), log, out); const _133: rt.ByteVec = rt.byteSliceToByteVec(data); putEq(rt.eqSeq(eq$cmp_PartialEq_collections_Right_u8)(_133, rights_), log, out); @@ -3757,21 +3757,21 @@ export function unlikeEqs(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): voi }), undefined, 2, true); const _148: Uint8Array[] = rt.sliceRange(pairs, 0); const _150: Right.Right[] = rt.sliceRange(rights_, 0, rt.min(pairs.length, rights_.length)); - putEq(rt.eqSeq((a23: Uint8Array, b20: Right.Right): boolean => { - return ((a018: rt.ByteSlice, a118: Right.Right): boolean => { - return eq$cmp_PartialEq_collections_Right_array2_u8(a018.data, a018.start, a018.length, a118); - })(rt.byteSliceFrom(a23), b20); + putEq(rt.eqSeq((a15: Uint8Array, b20: Right.Right): boolean => { + return ((a0: rt.ByteSlice, a1: Right.Right): boolean => { + return eq$cmp_PartialEq_collections_Right_array2_u8(a0.data, a0.start, a0.length, a1); + })(rt.byteSliceFrom(a15), b20); })(_148, _150), log, out); const _162: Left.Left[][] = [lefts(), lefts()]; const _169: Right.Right[][] = [rights_, rt.sliceRange(rights_, 0)]; - putEq(rt.eqSeq(rt.eqSeq((a24: Left.Left, b21: Right.Right): boolean => { - return !Left.ne$cmp_PartialEq_collections_Right(a24, b21); + putEq(rt.eqSeq(rt.eqSeq((a16: Left.Left, b21: Right.Right): boolean => { + return !Left.ne$cmp_PartialEq_collections_Right(a16, b21); }))(_162, _169), log, out); const refs: Right.Right[] = rt.iterToArray(rt.iterSlice(rights_), undefined, 4, true); putEq(rt.eqSeq(Left.eq$cmp_PartialEq_ref_collections_Right)(mine, refs), log, out); const _187: Left.Left[] = rt.iterToArray(rt.iterSlice(mine), undefined, 4, true); - putEq(rt.eqSeq((a25: Left.Left, b22: Right.Right): boolean => { - return !Left.ne$cmp_PartialEq_collections_Right(a25, b22); + putEq(rt.eqSeq((a17: Left.Left, b22: Right.Right): boolean => { + return !Left.ne$cmp_PartialEq_collections_Right(a17, b22); })(_187, refs), log, out); const _199: Left.Left[] = rt.iterToArray(rt.iterSlice(lefts()), undefined, 4, true); putEq(rt.eqSeq(Left.eq$cmp_PartialEq_ref_collections_Left)(mine, _199), log, out); @@ -3795,31 +3795,31 @@ export function unlikeEqs(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): voi rt.dequePushBack(q, _245); } const _252: Right.Right[] = rights_; - putEq(rt.eqSeq((a26: Left.Left, b24: Right.Right): boolean => { - return !Left.ne$cmp_PartialEq_collections_Right(a26, b24); + putEq(rt.eqSeq((a18: Left.Left, b24: Right.Right): boolean => { + return !Left.ne$cmp_PartialEq_collections_Right(a18, b24); })(q, _252), log, out); - putEq(rt.eqSeq((a27: Left.Left, b25: Right.Right): boolean => { - return !Left.ne$cmp_PartialEq_collections_Right(a27, b25); + putEq(rt.eqSeq((a19: Left.Left, b25: Right.Right): boolean => { + return !Left.ne$cmp_PartialEq_collections_Right(a19, b25); })(q, rights_), log, out); const _264: Right.Right[] = rights_; - putEq(!rt.eqSeq((a28: Left.Left, b26: Right.Right): boolean => { - return !Left.ne$cmp_PartialEq_collections_Right(a28, b26); + putEq(!rt.eqSeq((a20: Left.Left, b26: Right.Right): boolean => { + return !Left.ne$cmp_PartialEq_collections_Right(a20, b26); })(q, _264), log, out); const _272: Right.Right[] = rights_; - putEq(rt.eqSeq((a29: Left.Left, b27: Right.Right): boolean => { - return !Left.ne$cmp_PartialEq_collections_Right(a29, b27); + putEq(rt.eqSeq((a21: Left.Left, b27: Right.Right): boolean => { + return !Left.ne$cmp_PartialEq_collections_Right(a21, b27); })(q, _272), log, out); const _279: Right.Right[] = pair(); - putEq(rt.eqSeq((a30: Left.Left, b28: Right.Right): boolean => { - return !Left.ne$cmp_PartialEq_collections_Right(a30, b28); + putEq(rt.eqSeq((a22: Left.Left, b28: Right.Right): boolean => { + return !Left.ne$cmp_PartialEq_collections_Right(a22, b28); })(q, _279), log, out); const _287: Right.Right[] = pair(); - putEq(rt.eqSeq((a31: Left.Left, b29: Right.Right): boolean => { - return !Left.ne$cmp_PartialEq_collections_Right(a31, b29); + putEq(rt.eqSeq((a23: Left.Left, b29: Right.Right): boolean => { + return !Left.ne$cmp_PartialEq_collections_Right(a23, b29); })(q, _287), log, out); const _295: Right.Right[] = pair(); - putEq(rt.eqSeq((a32: Left.Left, b30: Right.Right): boolean => { - return !Left.ne$cmp_PartialEq_collections_Right(a32, b30); + putEq(rt.eqSeq((a24: Left.Left, b30: Right.Right): boolean => { + return !Left.ne$cmp_PartialEq_collections_Right(a24, b30); })(q, _295), log, out); const bytes: rt.VecDeque = rt.dequeNew(1, true) as rt.VecDeque; const iter3: rt.Iter = rt.iterRev(rt.iterSlice(rt.byteSliceView(rt.byteSliceRange(data, 0, half)))); @@ -3859,30 +3859,30 @@ export function unlikeEqs(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): voi const exact: Right.Right[] = rt.iterToArray(rt.iterMap(rt.iterSlice(rt.byteSliceView(data)), (_29: rt.u8): Right.Right => { return { _0: _29 as rt.u16 }; }), undefined, 2, true); - putEq(rt.peekableNextIfEq(it, exact, (a031: Left.Left[], a131: Right.Right[]): boolean => { - return rt.eqSeq((a33: Left.Left, b34: Right.Right): boolean => { - return !Left.ne$cmp_PartialEq_collections_Right(a33, b34); - })(a031, a131); + putEq(rt.peekableNextIfEq(it, exact, (a02: Left.Left[], a110: Right.Right[]): boolean => { + return rt.eqSeq((a25: Left.Left, b34: Right.Right): boolean => { + return !Left.ne$cmp_PartialEq_collections_Right(a25, b34); + })(a02, a110); }) !== undefined, log, out); - putEq(rt.peekableNextIfEq(it, rights_, (a033: Left.Left[], a133: Right.Right[]): boolean => { - return rt.eqSeq((a34: Left.Left, b35: Right.Right): boolean => { - return !Left.ne$cmp_PartialEq_collections_Right(a34, b35); - })(a033, a133); + putEq(rt.peekableNextIfEq(it, rights_, (a03: Left.Left[], a111: Right.Right[]): boolean => { + return rt.eqSeq((a26: Left.Left, b35: Right.Right): boolean => { + return !Left.ne$cmp_PartialEq_collections_Right(a26, b35); + })(a03, a111); }) !== undefined, log, out); const _409: Right.Right[] = rt.sliceRange(exact, 0, half); - putEq(rt.peekableNextIfEq(it, _409, (a035: Left.Left[], a135: Right.Right[]): boolean => { - return rt.eqSeq((a35: Left.Left, b36: Right.Right): boolean => { - return !Left.ne$cmp_PartialEq_collections_Right(a35, b36); - })(a035, a135); + putEq(rt.peekableNextIfEq(it, _409, (a04: Left.Left[], a112: Right.Right[]): boolean => { + return rt.eqSeq((a27: Left.Left, b36: Right.Right): boolean => { + return !Left.ne$cmp_PartialEq_collections_Right(a27, b36); + })(a04, a112); }) !== undefined, log, out); rt.byteVecPush(out, rt.iterCount(it) & 0xff); const it2: rt.Peekable> = rt.iterPeekable(rt.iterSlice([rt.dequeClone(bytes), bytes])); const _430: rt.ByteVec = rt.byteSliceToByteVec(data); - putEq(rt.peekableNextIfEq(it2, _430, (a037: rt.VecDeque, a137: rt.ByteVec): boolean => { - return rt.eqSeq(rt.same)(a037, a137); + putEq(rt.peekableNextIfEq(it2, _430, (a05: rt.VecDeque, a113: rt.ByteVec): boolean => { + return rt.eqSeq(rt.same)(a05, a113); }) !== undefined, log, out); - putEq(rt.peekableNextIfEq(it2, stepped, (a038: rt.VecDeque, a138: rt.ByteVec): boolean => { - return rt.eqSeq(rt.same)(a038, a138); + putEq(rt.peekableNextIfEq(it2, stepped, (a06: rt.VecDeque, a114: rt.ByteVec): boolean => { + return rt.eqSeq(rt.same)(a06, a114); }) !== undefined, log, out); rt.byteVecPush(out, rt.iterCount(it2) & 0xff); } @@ -4076,28 +4076,28 @@ export function ownNes(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { }))(_123, _130), log, out); const _139: Picky.Picky[][] = [rt.vecExact(a.map(Picky.clone$Clone), 8), rt.vecExact(b.map(Picky.clone$Clone), 8)]; const _146: Picky.Picky[][] = [rt.vecExact(a.map(Picky.clone$Clone), 8), rt.vecExact(a.map(Picky.clone$Clone), 8)]; - putEq(!rt.eqSlice(rt.eqSlice((a20: Picky.Picky, b12: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a20, b12); + putEq(!rt.eqSlice(rt.eqSlice((a12: Picky.Picky, b12: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a12, b12); }))(_139, _146), log, out); const tuple: (a0: Picky.Picky[]) => [Picky.Picky, rt.u8, Picky.Picky] = (v3: Picky.Picky[]): [Picky.Picky, rt.u8, Picky.Picky] => { return [one(v3, 0), _34(v3, 2) & 0xff, one(v3, 1)] as [Picky.Picky, rt.u8, Picky.Picky]; }; const _158: [Picky.Picky, rt.u8, Picky.Picky] = tuple(a); const _164: [Picky.Picky, rt.u8, Picky.Picky] = tuple(b); - putEq(!rt.eqTuple([(a21: Picky.Picky, b13: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a21, b13); - }, rt.same, (a22: Picky.Picky, b14: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a22, b14); + putEq(!rt.eqTuple([(a13: Picky.Picky, b13: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a13, b13); + }, rt.same, (a14: Picky.Picky, b14: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a14, b14); }])(_158, _164), log, out); const _173: [Picky.Picky, rt.u8, Picky.Picky] = tuple(a); const _179: [Picky.Picky, rt.u8, Picky.Picky] = tuple(b); putEq(rt.eqTuple([Picky.eq$cmp_PartialEq, rt.same, Picky.eq$cmp_PartialEq])(_173, _179), log, out); const _188: [[Picky.Picky, rt.u8, Picky.Picky], rt.u8] = [tuple(a), 1]; const _195: [[Picky.Picky, rt.u8, Picky.Picky], rt.u8] = [tuple(b), 1]; - putEq(!rt.eqTuple([rt.eqTuple([(a23: Picky.Picky, b15: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a23, b15); - }, rt.same, (a24: Picky.Picky, b16: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a24, b16); + putEq(!rt.eqTuple([rt.eqTuple([(a15: Picky.Picky, b15: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a15, b15); + }, rt.same, (a16: Picky.Picky, b16: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a16, b16); }]), rt.same])(_188, _195), log, out); const _205: [Picky.Picky, rt.u8][] = each$collections_Picky_tuple2_collections_Picky_u8_collections_own_nes_closure6(a, (p2: Picky.Picky): [Picky.Picky, rt.u8] => { return [Picky.clone$Clone(p2), p2._0 & 0xff] as [Picky.Picky, rt.u8]; @@ -4105,8 +4105,8 @@ export function ownNes(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { const _209: [Picky.Picky, rt.u8][] = each$collections_Picky_tuple2_collections_Picky_u8_collections_own_nes_closure7(b, (p3: Picky.Picky): [Picky.Picky, rt.u8] => { return [Picky.clone$Clone(p3), p3._0 & 0xff] as [Picky.Picky, rt.u8]; }); - putEq(rt.eqSlice(rt.eqTuple([(a25: Picky.Picky, b17: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a25, b17); + putEq(rt.eqSlice(rt.eqTuple([(a17: Picky.Picky, b17: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a17, b17); }, rt.same]))(_205, _209), log, out); const _217: [Picky.Picky, rt.u8][] = rt.sliceRange(each$collections_Picky_tuple2_collections_Picky_u8_collections_own_nes_closure8(a, (p4: Picky.Picky): [Picky.Picky, rt.u8] => { return [Picky.clone$Clone(p4), p4._0 & 0xff] as [Picky.Picky, rt.u8]; @@ -4114,8 +4114,8 @@ export function ownNes(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { const _224: [Picky.Picky, rt.u8][] = rt.sliceRange(each$collections_Picky_tuple2_collections_Picky_u8_collections_own_nes_closure9(b, (p5: Picky.Picky): [Picky.Picky, rt.u8] => { return [Picky.clone$Clone(p5), p5._0 & 0xff] as [Picky.Picky, rt.u8]; }), 0); - putEq(!rt.eqSlice(rt.eqTuple([(a26: Picky.Picky, b18: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a26, b18); + putEq(!rt.eqSlice(rt.eqTuple([(a18: Picky.Picky, b18: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a18, b18); }, rt.same]))(_217, _224), log, out); const _233: [Picky.Picky | undefined] = [one(a, 0)]; const _241: [Picky.Picky | undefined] = [one(b, 0)]; @@ -4125,13 +4125,13 @@ export function ownNes(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { putEq(!rt.eqTuple([Picky.eq$cmp_PartialEq])(_252, _260), log, out); const _271: [Picky.Picky] = [one(a, 0)]; const _279: [Picky.Picky] = [one(b, 0)]; - putEq(!rt.eqTuple([(a27: Picky.Picky, b19: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a27, b19); + putEq(!rt.eqTuple([(a19: Picky.Picky, b19: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a19, b19); }])(_271, _279), log, out); const _290: [Picky.Picky] = [one(a, 0)]; const _298: [Picky.Picky] = [one(b, 0)]; - putEq(!rt.eqTuple([(a28: Picky.Picky, b20: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a28, b20); + putEq(!rt.eqTuple([(a20: Picky.Picky, b20: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a20, b20); }])(_290, _298), log, out); const _309: Array = each$collections_Picky_Option_collections_Picky_collections_own_nes_closure10(a, (p6: Picky.Picky): Picky.Picky | undefined => { return Picky.clone$Clone(p6); @@ -4153,13 +4153,13 @@ export function ownNes(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { const _335: Picky.Picky[] = each$collections_Picky_boxed_Box_collections_Picky_collections_own_nes_closure15(b, (p11: Picky.Picky): Picky.Picky => { return Picky.clone$Clone(p11); }); - putEq(rt.eqSlice((a29: Picky.Picky, b21: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a29, b21); + putEq(rt.eqSlice((a21: Picky.Picky, b21: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a21, b21); })(_331, _335), log, out); const arc: rt.Arc = new rt.Arc(one(a, 0)); const _349: rt.Arc = rt.arcClone(arc); - putEq(!rt.eqArc((a30: Picky.Picky, b22: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a30, b22); + putEq(!rt.eqArc((a22: Picky.Picky, b22: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a22, b22); }, true)(arc, _349), log, out); _349[Symbol.dispose](); const _356: rt.Arc = rt.arcClone(arc); @@ -4167,71 +4167,71 @@ export function ownNes(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { _356[Symbol.dispose](); const _362: rt.Arc = new rt.Arc(one(a, 0)); const _369: rt.Arc = new rt.Arc(one(b, 0)); - putEq(!rt.eqArc((a31: Picky.Picky, b23: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a31, b23); + putEq(!rt.eqArc((a23: Picky.Picky, b23: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a23, b23); }, true)(_362, _369), log, out); _369[Symbol.dispose](); _362[Symbol.dispose](); const floated: rt.Arc<[Picky.Picky, rt.f32]> = new rt.Arc([one(a, 0), 0.5] as [Picky.Picky, rt.f32]); const _387: rt.Arc<[Picky.Picky, rt.f32]> = rt.arcClone(floated); - putEq(!rt.eqArc(rt.eqTuple([(a32: Picky.Picky, b24: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a32, b24); + putEq(!rt.eqArc(rt.eqTuple([(a24: Picky.Picky, b24: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a24, b24); }, rt.same]))(floated, _387), log, out); _387[Symbol.dispose](); const _394: rt.Arc<[Picky.Picky, rt.f32]> = new rt.Arc([one(b, 0), 0.5] as [Picky.Picky, rt.f32]); - putEq(!rt.eqArc(rt.eqTuple([(a33: Picky.Picky, b25: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a33, b25); + putEq(!rt.eqArc(rt.eqTuple([(a25: Picky.Picky, b25: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a25, b25); }, rt.same]))(floated, _394), log, out); _394[Symbol.dispose](); const _405: rt.Arc = new rt.Arc(one(a, 1)); const _412: rt.Arc = new rt.Arc(one(b, 1)); - putEq(!rt.eqArc((a34: Picky.Picky, b26: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a34, b26); + putEq(!rt.eqArc((a26: Picky.Picky, b26: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a26, b26); }, true)(_405, _412), log, out); _412[Symbol.dispose](); _405[Symbol.dispose](); const shared: rt.Arc[] = each$collections_Picky_sync_Arc_collections_Picky_collections_own_nes_closure16(a, (p12: Picky.Picky): rt.Arc => { return new rt.Arc(Picky.clone$Clone(p12)); }); - const _426: rt.Arc[] = rt.vecExact(shared.map((a041: rt.Arc): rt.Arc => { - return rt.arcClone(a041); + const _426: rt.Arc[] = rt.vecExact(shared.map((a0: rt.Arc): rt.Arc => { + return rt.arcClone(a0); }), 4); - putEq(rt.eqSlice(rt.eqArc((a35: Picky.Picky, b27: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a35, b27); + putEq(rt.eqSlice(rt.eqArc((a27: Picky.Picky, b27: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a27, b27); }, true))(shared, _426), log, out); rt.dropAll(_426); const _433: rt.Arc[] = each$collections_Picky_sync_Arc_collections_Picky_collections_own_nes_closure17(b, (p13: Picky.Picky): rt.Arc => { return new rt.Arc(Picky.clone$Clone(p13)); }); - putEq(rt.eqSlice(rt.eqArc((a36: Picky.Picky, b28: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a36, b28); + putEq(rt.eqSlice(rt.eqArc((a28: Picky.Picky, b28: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a28, b28); }, true))(shared, _433), log, out); rt.dropAll(_433); const _440: [rt.Arc, rt.u8] = [rt.arcClone(arc), 0]; const _444: [rt.Arc, rt.u8] = [new rt.Arc(one(b, 0)), 0]; - putEq(!rt.eqTuple([rt.eqArc((a37: Picky.Picky, b29: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a37, b29); + putEq(!rt.eqTuple([rt.eqArc((a29: Picky.Picky, b29: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a29, b29); }, true), rt.same])(_440, _444), log, out); drop$tuple2_sync_Arc_collections_Picky_u8(_444); drop$tuple2_sync_Arc_collections_Picky_u8(_440); const _455: rt.VecDeque = wrapped$collections_Picky(a); const _459: rt.VecDeque = wrapped$collections_Picky(b); - putEq(rt.eqSeq((a38: Picky.Picky, b30: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a38, b30); + putEq(rt.eqSeq((a30: Picky.Picky, b30: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a30, b30); })(_455, _459), log, out); const _466: rt.VecDeque = wrapped$collections_Picky(a); const _470: rt.VecDeque = wrapped$collections_Picky(b); - putEq(!rt.eqSeq((a39: Picky.Picky, b31: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a39, b31); + putEq(!rt.eqSeq((a31: Picky.Picky, b31: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a31, b31); })(_466, _470), log, out); const _477: rt.VecDeque = wrapped$collections_Picky(a); - putEq(rt.eqSeq((a40: Picky.Picky, b32: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a40, b32); + putEq(rt.eqSeq((a32: Picky.Picky, b32: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a32, b32); })(_477, b), log, out); const _485: rt.VecDeque = wrapped$collections_Picky(a); const _490: Picky.Picky[] = rt.sliceRange(b, 0); - putEq(rt.eqSeq((a41: Picky.Picky, b33: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a41, b33); + putEq(rt.eqSeq((a33: Picky.Picky, b33: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a33, b33); })(_485, _490), log, out); const _496: [Picky.Picky] = [one(a, 0)]; const _504: [Picky.Picky] = [one(b, 0)]; @@ -4240,38 +4240,38 @@ export function ownNes(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { const _531: [rt.Cow, rt.Cow] = [new rt.Borrowed(rt.sliceRange(a, 0)), rt.vecExact(b.map(Picky.clone$Clone), 8)]; const ca: rt.Cow = _531[0]; const cb: rt.Cow = _531[1]; - putEq(rt.eqSlice((a42: Picky.Picky, b34: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a42, b34); + putEq(rt.eqSlice((a34: Picky.Picky, b34: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a34, b34); })(rt.cowSlice(ca), rt.cowSlice(cb)), log, out); - putEq(!rt.eqSlice((a43: Picky.Picky, b35: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a43, b35); + putEq(!rt.eqSlice((a35: Picky.Picky, b35: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a35, b35); })(rt.cowSlice(ca), rt.cowSlice(cb)), log, out); const _553: Picky.Picky[] = rt.sliceRange(b, 0); - putEq(rt.eqSlice((a44: Picky.Picky, b36: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a44, b36); + putEq(rt.eqSlice((a36: Picky.Picky, b36: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a36, b36); })(rt.cowSlice(ca), _553), log, out); - putEq(!rt.eqSlice((a45: Picky.Picky, b37: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a45, b37); + putEq(!rt.eqSlice((a37: Picky.Picky, b37: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a37, b37); })(rt.cowSlice(cb), a), log, out); - putEq(rt.eqSlice((a46: Picky.Picky, b38: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a46, b38); + putEq(rt.eqSlice((a38: Picky.Picky, b38: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a38, b38); })(b, rt.cowSlice(ca)), log, out); const _570: Picky.Picky[] = rt.sliceRange(a, 0); - putEq(!rt.eqSlice((a47: Picky.Picky, b39: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a47, b39); + putEq(!rt.eqSlice((a39: Picky.Picky, b39: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a39, b39); })(_570, rt.cowSlice(cb)), log, out); const _576: Picky.Picky[] = rt.cowSlice(cb); - putEq(rt.eqSlice((a48: Picky.Picky, b40: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a48, b40); + putEq(rt.eqSlice((a40: Picky.Picky, b40: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a40, b40); })(_576, pa), log, out); const owned: rt.Cow[] = each$collections_Picky_borrow_Cow_slice_collections_Picky_collections_own_nes_closure18(a, (p14: Picky.Picky): rt.Cow => { return [Picky.clone$Clone(p14)]; }); - const borrowed: rt.Cow[] = rt.iterToArray(rt.iterMap(rt.sliceChunks(b, 1), (a059: Picky.Picky[]): rt.Cow => { - return new rt.Borrowed(a059); + const borrowed: rt.Cow[] = rt.iterToArray(rt.iterMap(rt.sliceChunks(b, 1), (a02: Picky.Picky[]): rt.Cow => { + return new rt.Borrowed(a02); }), undefined, 12, true); - putEq(!rt.eqSlice(rt.cowBy(rt.eqSlice((a49: Picky.Picky, b41: Picky.Picky): boolean => { - return !Picky.ne$cmp_PartialEq(a49, b41); + putEq(!rt.eqSlice(rt.cowBy(rt.eqSlice((a41: Picky.Picky, b41: Picky.Picky): boolean => { + return !Picky.ne$cmp_PartialEq(a41, b41); })))(owned, borrowed), log, out); rt.dropAll(shared); floated[Symbol.dispose](); @@ -4690,12 +4690,12 @@ export function unlikeCompares(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec) return Uint8Array.of(_35, c.data[c.start + 1]); }), undefined, 2, true); putEq(rt.iterEq(rt.iterCopied(rt.iterLend(rt.iterSlice(pairs), rt.byteSliceFrom), rt.byteSliceToArray), rt.iterSlice(rights_()), (a: Uint8Array, b3: Right.Right): boolean => { - return ((a09: rt.ByteSlice, a19: Right.Right): boolean => { - return eq$cmp_PartialEq_collections_Right_array2_u8(a09.data, a09.start, a09.length, a19); + return ((a0: rt.ByteSlice, a1: Right.Right): boolean => { + return eq$cmp_PartialEq_collections_Right_array2_u8(a0.data, a0.start, a0.length, a1); })(rt.byteSliceFrom(a), b3); }, true), log, out); - putEq(rt.iterEq(rt.iterLend(rt.iterSlice(pairs), rt.byteSliceFrom), rt.iterSlice(theirs), (a010: rt.ByteSlice, a110: Right.Right): boolean => { - return eq$cmp_PartialEq_collections_Right_array2_u8(a010.data, a010.start, a010.length, a110); + putEq(rt.iterEq(rt.iterLend(rt.iterSlice(pairs), rt.byteSliceFrom), rt.iterSlice(theirs), (a02: rt.ByteSlice, a12: Right.Right): boolean => { + return eq$cmp_PartialEq_collections_Right_array2_u8(a02.data, a02.start, a02.length, a12); }, true), log, out); const part3 = rt.iterCmp(rt.iterSlice(mine), rt.iterSlice(theirs), Left.partialCmp$cmp_PartialOrd_collections_Right); _9(part3, log, out); @@ -4704,13 +4704,13 @@ export function unlikeCompares(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec) putEq(rt.iterLt(rt.iterSlice(lefts()), rt.iterSlice(rights_()), Left.partialCmp$cmp_PartialOrd_collections_Right), log, out); putEq(rt.iterGe(rt.iterSlice(mine), rt.iterSlice(theirs), Left.partialCmp$cmp_PartialOrd_collections_Right), log, out); const part7 = rt.iterCmp(rt.iterCopied(rt.iterLend(rt.iterSlice(pairs), rt.byteSliceFrom), rt.byteSliceToArray), rt.iterSlice(rights_()), (a2: Uint8Array, b4: Right.Right): rt.Ordering | undefined => { - return ((a015: rt.ByteSlice, a115: Right.Right): rt.Ordering | undefined => { - return partialCmp$cmp_PartialOrd_collections_Right_array2_u8(a015.data, a015.start, a015.length, a115); + return ((a03: rt.ByteSlice, a13: Right.Right): rt.Ordering | undefined => { + return partialCmp$cmp_PartialOrd_collections_Right_array2_u8(a03.data, a03.start, a03.length, a13); })(rt.byteSliceFrom(a2), b4); }); _9(part7, log, out); - const part9 = rt.iterCmp(rt.iterLend(rt.iterSlice(pairs), rt.byteSliceFrom), rt.iterSlice(theirs), (a016: rt.ByteSlice, a116: Right.Right): rt.Ordering | undefined => { - return partialCmp$cmp_PartialOrd_collections_Right_array2_u8(a016.data, a016.start, a016.length, a116); + const part9 = rt.iterCmp(rt.iterLend(rt.iterSlice(pairs), rt.byteSliceFrom), rt.iterSlice(theirs), (a04: rt.ByteSlice, a14: Right.Right): rt.Ordering | undefined => { + return partialCmp$cmp_PartialOrd_collections_Right_array2_u8(a04.data, a04.start, a04.length, a14); }); _9(part9, log, out); } @@ -4770,8 +4770,8 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _63: [rt.u8, ByRef.ByRef] = [7, a]; const _65: [rt.u8, ByRef.ByRef] = [7, b]; const order = rt.cmpTuple<[rt.u8, ByRef.ByRef], rt.Ordering | undefined>([rt.cmp, ByRef.partialCmp$cmp_PartialOrd_ref])(_63, _65); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_46, _51, _56, order !== undefined && order >= 0], (a05: boolean): rt.u8 => { - return a05 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_46, _51, _56, order !== undefined && order >= 0], (a0: boolean): rt.u8 => { + return a0 ? 1 : 0; })), undefined, true); const _70: [ByRef.ByRef] = [a]; const _72: [ByRef.ByRef] = [b]; @@ -4793,8 +4793,8 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _103: boolean = rt.eqOption(ByRef.eq$cmp_PartialEq_ref)(_105, _107); const _110: ByRef.ByRef | undefined = a; const _112: ByRef.ByRef | undefined = b; - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_103, rt.cmpOption(ByRef.partialCmp$cmp_PartialOrd_ref)(_110, _112) === -1], (a014: boolean): rt.u8 => { - return a014 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_103, rt.cmpOption(ByRef.partialCmp$cmp_PartialOrd_ref)(_110, _112) === -1], (a02: boolean): rt.u8 => { + return a02 ? 1 : 0; })), undefined, true); rt.byteVecPush(out, result_eq$1dt73ez(rt.Ok(a), rt.Ok(b)) ? 1 : 0); const _125: ByRef.ByRef[] = [a, b]; @@ -4818,8 +4818,8 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _152: boolean = rt.cmpSlice(ByRef.partialCmp$cmp_PartialOrd_ref)(_153, _156) === -1; const _161: ByRef.ByRef[] = [a, b]; const _164: ByRef.ByRef[] = [b, a]; - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_147, _152, !rt.eqSlice(ByRef.eq$cmp_PartialEq_ref)(_161, _164)], (a022: boolean): rt.u8 => { - return a022 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_147, _152, !rt.eqSlice(ByRef.eq$cmp_PartialEq_ref)(_161, _164)], (a03: boolean): rt.u8 => { + return a03 ? 1 : 0; })), undefined, true); const _170: rt.VecDeque = rt.dequeFromArray([a, b], 4) as rt.VecDeque; const _173: rt.VecDeque = rt.dequeFromArray([b, a], 4) as rt.VecDeque; @@ -4841,19 +4841,19 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _206: boolean = rt.cellBy(ByRef.eq$cmp_PartialEq_ref)(_208, _210); const _213: rt.RefCell = new rt.RefCell(a); const _215: rt.RefCell = new rt.RefCell(b); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_206, rt.refCellBy(ByRef.partialCmp$cmp_PartialOrd_ref)(_213, _215) === -1], (a030: boolean): rt.u8 => { - return a030 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_206, rt.refCellBy(ByRef.partialCmp$cmp_PartialOrd_ref)(_213, _215) === -1], (a04: boolean): rt.u8 => { + return a04 ? 1 : 0; })), undefined, true); rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(orderByte$ref_orders(rt.iterCmp(rt.iterSlice([a, b]), rt.iterSlice([b, a]), ByRef.partialCmp$cmp_PartialOrd_ref)), cmpByte$ref_orders(rt.iterCmp(rt.iterSlice([a]), rt.iterSlice([b]), ByRef.cmp$cmp_Ord_ref)))), undefined, true); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([rt.iterEq(rt.iterSlice([a, b]), rt.iterSlice([b, a]), ByRef.eq$cmp_PartialEq_ref, true), rt.iterLt(rt.iterSlice([a]), rt.iterSlice([b]), ByRef.partialCmp$cmp_PartialOrd_ref), rt.iterGe(rt.iterSlice([a]), rt.iterSlice([b]), ByRef.partialCmp$cmp_PartialOrd_ref)], (a036: boolean): rt.u8 => { - return a036 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([rt.iterEq(rt.iterSlice([a, b]), rt.iterSlice([b, a]), ByRef.eq$cmp_PartialEq_ref, true), rt.iterLt(rt.iterSlice([a]), rt.iterSlice([b]), ByRef.partialCmp$cmp_PartialOrd_ref), rt.iterGe(rt.iterSlice([a]), rt.iterSlice([b]), ByRef.partialCmp$cmp_PartialOrd_ref)], (a05: boolean): rt.u8 => { + return a05 ? 1 : 0; })), undefined, true); const _256: boolean = ByRef.eq$cmp_PartialEq_ref(a, b); const _260: boolean = !ByRef.eq$cmp_PartialEq_ref(a, b); const _264: boolean = ByRef.partialCmp$cmp_PartialOrd_ref(a, b) === -1; const order2 = ByRef.partialCmp$cmp_PartialOrd_ref(a, b); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_256, _260, _264, order2 !== undefined && order2 >= 0, ByRef.eq$cmp_PartialEq_ref(a, b), ByRef.partialCmp$cmp_PartialOrd_ref(a, b) === 1], (a037: boolean): rt.u8 => { - return a037 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_256, _260, _264, order2 !== undefined && order2 >= 0, ByRef.eq$cmp_PartialEq_ref(a, b), ByRef.partialCmp$cmp_PartialOrd_ref(a, b) === 1], (a06: boolean): rt.u8 => { + return a06 ? 1 : 0; })), undefined, true); rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([ByRef.partialCmp$cmp_PartialOrd_ref(a, b), ByRef.partialCmp$cmp_PartialOrd_ref(a, b)], orderByte$ref_orders)), undefined, true); rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([ByRef.cmp$cmp_Ord_ref(a, b), ByRef.cmp$cmp_Ord_ref(a, b)], cmpByte$ref_orders)), undefined, true); @@ -4892,8 +4892,8 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _374: [rt.u8, ByRef.ByRef] = [7, a2]; const _376: [rt.u8, ByRef.ByRef] = [7, b2]; const order3 = rt.cmpTuple<[rt.u8, ByRef.ByRef], rt.Ordering | undefined>([rt.cmp, ByRef.partialCmp$cmp_PartialOrd_ref])(_374, _376); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_357, _362, _367, order3 !== undefined && order3 >= 0], (a050: boolean): rt.u8 => { - return a050 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_357, _362, _367, order3 !== undefined && order3 >= 0], (a07: boolean): rt.u8 => { + return a07 ? 1 : 0; })), undefined, true); const _381: [ByRef.ByRef] = [a2]; const _383: [ByRef.ByRef] = [b2]; @@ -4915,8 +4915,8 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _414: boolean = rt.eqOption(ByRef.eq$cmp_PartialEq_ref)(_416, _418); const _421: ByRef.ByRef | undefined = a2; const _423: ByRef.ByRef | undefined = b2; - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_414, rt.cmpOption(ByRef.partialCmp$cmp_PartialOrd_ref)(_421, _423) === -1], (a059: boolean): rt.u8 => { - return a059 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_414, rt.cmpOption(ByRef.partialCmp$cmp_PartialOrd_ref)(_421, _423) === -1], (a08: boolean): rt.u8 => { + return a08 ? 1 : 0; })), undefined, true); rt.byteVecPush(out, result_eq$1dt73ez(rt.Ok(a2), rt.Ok(b2)) ? 1 : 0); const _436: ByRef.ByRef[] = [a2, b2]; @@ -4940,8 +4940,8 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _463: boolean = rt.cmpSlice(ByRef.partialCmp$cmp_PartialOrd_ref)(_464, _467) === -1; const _472: ByRef.ByRef[] = [a2, b2]; const _475: ByRef.ByRef[] = [b2, a2]; - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_458, _463, !rt.eqSlice(ByRef.eq$cmp_PartialEq_ref)(_472, _475)], (a067: boolean): rt.u8 => { - return a067 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_458, _463, !rt.eqSlice(ByRef.eq$cmp_PartialEq_ref)(_472, _475)], (a09: boolean): rt.u8 => { + return a09 ? 1 : 0; })), undefined, true); const _481: rt.VecDeque = rt.dequeFromArray([a2, b2], 4) as rt.VecDeque; const _484: rt.VecDeque = rt.dequeFromArray([b2, a2], 4) as rt.VecDeque; @@ -4963,19 +4963,19 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _517: boolean = rt.cellBy(ByRef.eq$cmp_PartialEq_ref)(_519, _521); const _524: rt.RefCell = new rt.RefCell(a2); const _526: rt.RefCell = new rt.RefCell(b2); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_517, rt.refCellBy(ByRef.partialCmp$cmp_PartialOrd_ref)(_524, _526) === -1], (a075: boolean): rt.u8 => { - return a075 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_517, rt.refCellBy(ByRef.partialCmp$cmp_PartialOrd_ref)(_524, _526) === -1], (a010: boolean): rt.u8 => { + return a010 ? 1 : 0; })), undefined, true); rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(orderByte$ref_orders(rt.iterCmp(rt.iterSlice([a2, b2]), rt.iterSlice([b2, a2]), ByRef.partialCmp$cmp_PartialOrd_ref)), cmpByte$ref_orders(rt.iterCmp(rt.iterSlice([a2]), rt.iterSlice([b2]), ByRef.cmp$cmp_Ord_ref)))), undefined, true); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([rt.iterEq(rt.iterSlice([a2, b2]), rt.iterSlice([b2, a2]), ByRef.eq$cmp_PartialEq_ref, true), rt.iterLt(rt.iterSlice([a2]), rt.iterSlice([b2]), ByRef.partialCmp$cmp_PartialOrd_ref), rt.iterGe(rt.iterSlice([a2]), rt.iterSlice([b2]), ByRef.partialCmp$cmp_PartialOrd_ref)], (a081: boolean): rt.u8 => { - return a081 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([rt.iterEq(rt.iterSlice([a2, b2]), rt.iterSlice([b2, a2]), ByRef.eq$cmp_PartialEq_ref, true), rt.iterLt(rt.iterSlice([a2]), rt.iterSlice([b2]), ByRef.partialCmp$cmp_PartialOrd_ref), rt.iterGe(rt.iterSlice([a2]), rt.iterSlice([b2]), ByRef.partialCmp$cmp_PartialOrd_ref)], (a011: boolean): rt.u8 => { + return a011 ? 1 : 0; })), undefined, true); const _567: boolean = ByRef.eq$cmp_PartialEq_ref(a2, b2); const _570: boolean = !ByRef.eq$cmp_PartialEq_ref(a2, b2); const _573: boolean = ByRef.partialCmp$cmp_PartialOrd_ref(a2, b2) === -1; const order4 = ByRef.partialCmp$cmp_PartialOrd_ref(a2, b2); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_567, _570, _573, order4 !== undefined && order4 >= 0, ByRef.eq$cmp_PartialEq_ref(a2, b2), ByRef.partialCmp$cmp_PartialOrd_ref(a2, b2) === 1], (a082: boolean): rt.u8 => { - return a082 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_567, _570, _573, order4 !== undefined && order4 >= 0, ByRef.eq$cmp_PartialEq_ref(a2, b2), ByRef.partialCmp$cmp_PartialOrd_ref(a2, b2) === 1], (a012: boolean): rt.u8 => { + return a012 ? 1 : 0; })), undefined, true); rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([ByRef.partialCmp$cmp_PartialOrd_ref(a2, b2), ByRef.partialCmp$cmp_PartialOrd_ref(a2, b2)], orderByte$ref_orders)), undefined, true); rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([ByRef.cmp$cmp_Ord_ref(a2, b2), ByRef.cmp$cmp_Ord_ref(a2, b2)], cmpByte$ref_orders)), undefined, true); @@ -5014,8 +5014,8 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _677: [rt.u8, ByVal.ByVal] = [7, a3]; const _679: [rt.u8, ByVal.ByVal] = [7, b3]; const order5 = rt.cmpTuple<[rt.u8, ByVal.ByVal], rt.Ordering | undefined>([rt.cmp, ByVal.partialCmp$cmp_PartialOrd])(_677, _679); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_660, _665, _670, order5 !== undefined && order5 >= 0], (a095: boolean): rt.u8 => { - return a095 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_660, _665, _670, order5 !== undefined && order5 >= 0], (a013: boolean): rt.u8 => { + return a013 ? 1 : 0; })), undefined, true); const _684: [ByVal.ByVal] = [a3]; const _686: [ByVal.ByVal] = [b3]; @@ -5037,8 +5037,8 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _717: boolean = rt.eqOption(ByVal.eq$cmp_PartialEq)(_719, _721); const _724: ByVal.ByVal | undefined = a3; const _726: ByVal.ByVal | undefined = b3; - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_717, rt.cmpOption(ByVal.partialCmp$cmp_PartialOrd)(_724, _726) === -1], (a0104: boolean): rt.u8 => { - return a0104 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_717, rt.cmpOption(ByVal.partialCmp$cmp_PartialOrd)(_724, _726) === -1], (a014: boolean): rt.u8 => { + return a014 ? 1 : 0; })), undefined, true); rt.byteVecPush(out, result_eq$163neqy(rt.Ok(a3), rt.Ok(b3)) ? 1 : 0); const _739: ByVal.ByVal[] = [a3, b3]; @@ -5062,8 +5062,8 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _766: boolean = rt.cmpSlice(ByVal.partialCmp$cmp_PartialOrd)(_767, _770) === -1; const _775: ByVal.ByVal[] = [a3, b3]; const _778: ByVal.ByVal[] = [b3, a3]; - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_761, _766, !rt.eqSlice(ByVal.eq$cmp_PartialEq)(_775, _778)], (a0112: boolean): rt.u8 => { - return a0112 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_761, _766, !rt.eqSlice(ByVal.eq$cmp_PartialEq)(_775, _778)], (a015: boolean): rt.u8 => { + return a015 ? 1 : 0; })), undefined, true); const _784: rt.VecDeque = rt.dequeFromArray([a3, b3], 4) as rt.VecDeque; const _787: rt.VecDeque = rt.dequeFromArray([b3, a3], 4) as rt.VecDeque; @@ -5085,19 +5085,19 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _820: boolean = rt.cellBy(ByVal.eq$cmp_PartialEq)(_822, _824); const _827: rt.RefCell = new rt.RefCell(a3); const _829: rt.RefCell = new rt.RefCell(b3); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_820, rt.refCellBy(ByVal.partialCmp$cmp_PartialOrd)(_827, _829) === -1], (a0120: boolean): rt.u8 => { - return a0120 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_820, rt.refCellBy(ByVal.partialCmp$cmp_PartialOrd)(_827, _829) === -1], (a016: boolean): rt.u8 => { + return a016 ? 1 : 0; })), undefined, true); rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(orderByte$ref_orders(rt.iterCmp(rt.iterSlice([a3, b3]), rt.iterSlice([b3, a3]), ByVal.partialCmp$cmp_PartialOrd)), cmpByte$ref_orders(rt.iterCmp(rt.iterSlice([a3]), rt.iterSlice([b3]), ByVal.cmp$cmp_Ord)))), undefined, true); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([rt.iterEq(rt.iterSlice([a3, b3]), rt.iterSlice([b3, a3]), ByVal.eq$cmp_PartialEq, true), rt.iterLt(rt.iterSlice([a3]), rt.iterSlice([b3]), ByVal.partialCmp$cmp_PartialOrd), rt.iterGe(rt.iterSlice([a3]), rt.iterSlice([b3]), ByVal.partialCmp$cmp_PartialOrd)], (a0126: boolean): rt.u8 => { - return a0126 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([rt.iterEq(rt.iterSlice([a3, b3]), rt.iterSlice([b3, a3]), ByVal.eq$cmp_PartialEq, true), rt.iterLt(rt.iterSlice([a3]), rt.iterSlice([b3]), ByVal.partialCmp$cmp_PartialOrd), rt.iterGe(rt.iterSlice([a3]), rt.iterSlice([b3]), ByVal.partialCmp$cmp_PartialOrd)], (a017: boolean): rt.u8 => { + return a017 ? 1 : 0; })), undefined, true); const _870: boolean = ByVal.eq$cmp_PartialEq(a3, b3); const _873: boolean = !ByVal.eq$cmp_PartialEq(a3, b3); const _876: boolean = ByVal.partialCmp$cmp_PartialOrd(a3, b3) === -1; const order6 = ByVal.partialCmp$cmp_PartialOrd(a3, b3); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_870, _873, _876, order6 !== undefined && order6 >= 0, ByVal.eq$cmp_PartialEq(a3, b3), ByVal.partialCmp$cmp_PartialOrd(a3, b3) === 1], (a0127: boolean): rt.u8 => { - return a0127 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_870, _873, _876, order6 !== undefined && order6 >= 0, ByVal.eq$cmp_PartialEq(a3, b3), ByVal.partialCmp$cmp_PartialOrd(a3, b3) === 1], (a018: boolean): rt.u8 => { + return a018 ? 1 : 0; })), undefined, true); rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([ByVal.partialCmp$cmp_PartialOrd(a3, b3), ByVal.partialCmp$cmp_PartialOrd(a3, b3)], orderByte$ref_orders)), undefined, true); rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([ByVal.cmp$cmp_Ord(a3, b3), ByVal.cmp$cmp_Ord(a3, b3)], cmpByte$ref_orders)), undefined, true); @@ -5136,8 +5136,8 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _984: [rt.u8, ByVal.ByVal] = [7, a4]; const _986: [rt.u8, ByVal.ByVal] = [7, b4]; const order7 = rt.cmpTuple<[rt.u8, ByVal.ByVal], rt.Ordering | undefined>([rt.cmp, ByVal.partialCmp$cmp_PartialOrd])(_984, _986); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_967, _972, _977, order7 !== undefined && order7 >= 0], (a0140: boolean): rt.u8 => { - return a0140 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_967, _972, _977, order7 !== undefined && order7 >= 0], (a019: boolean): rt.u8 => { + return a019 ? 1 : 0; })), undefined, true); const _991: [ByVal.ByVal] = [a4]; const _993: [ByVal.ByVal] = [b4]; @@ -5159,8 +5159,8 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _1024: boolean = rt.eqOption(ByVal.eq$cmp_PartialEq)(_1026, _1028); const _1031: ByVal.ByVal | undefined = a4; const _1033: ByVal.ByVal | undefined = b4; - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_1024, rt.cmpOption(ByVal.partialCmp$cmp_PartialOrd)(_1031, _1033) === -1], (a0149: boolean): rt.u8 => { - return a0149 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_1024, rt.cmpOption(ByVal.partialCmp$cmp_PartialOrd)(_1031, _1033) === -1], (a020: boolean): rt.u8 => { + return a020 ? 1 : 0; })), undefined, true); rt.byteVecPush(out, result_eq$163neqy(rt.Ok(a4), rt.Ok(b4)) ? 1 : 0); const _1046: ByVal.ByVal[] = [a4, b4]; @@ -5184,8 +5184,8 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _1073: boolean = rt.cmpSlice(ByVal.partialCmp$cmp_PartialOrd)(_1074, _1077) === -1; const _1082: ByVal.ByVal[] = [a4, b4]; const _1085: ByVal.ByVal[] = [b4, a4]; - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_1068, _1073, !rt.eqSlice(ByVal.eq$cmp_PartialEq)(_1082, _1085)], (a0157: boolean): rt.u8 => { - return a0157 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_1068, _1073, !rt.eqSlice(ByVal.eq$cmp_PartialEq)(_1082, _1085)], (a021: boolean): rt.u8 => { + return a021 ? 1 : 0; })), undefined, true); const _1091: rt.VecDeque = rt.dequeFromArray([a4, b4], 4) as rt.VecDeque; const _1094: rt.VecDeque = rt.dequeFromArray([b4, a4], 4) as rt.VecDeque; @@ -5207,19 +5207,19 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _1127: boolean = rt.cellBy(ByVal.eq$cmp_PartialEq)(_1129, _1131); const _1134: rt.RefCell = new rt.RefCell(a4); const _1136: rt.RefCell = new rt.RefCell(b4); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_1127, rt.refCellBy(ByVal.partialCmp$cmp_PartialOrd)(_1134, _1136) === -1], (a0165: boolean): rt.u8 => { - return a0165 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_1127, rt.refCellBy(ByVal.partialCmp$cmp_PartialOrd)(_1134, _1136) === -1], (a022: boolean): rt.u8 => { + return a022 ? 1 : 0; })), undefined, true); rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(orderByte$ref_orders(rt.iterCmp(rt.iterSlice([a4, b4]), rt.iterSlice([b4, a4]), ByVal.partialCmp$cmp_PartialOrd)), cmpByte$ref_orders(rt.iterCmp(rt.iterSlice([a4]), rt.iterSlice([b4]), ByVal.cmp$cmp_Ord)))), undefined, true); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([rt.iterEq(rt.iterSlice([a4, b4]), rt.iterSlice([b4, a4]), ByVal.eq$cmp_PartialEq, true), rt.iterLt(rt.iterSlice([a4]), rt.iterSlice([b4]), ByVal.partialCmp$cmp_PartialOrd), rt.iterGe(rt.iterSlice([a4]), rt.iterSlice([b4]), ByVal.partialCmp$cmp_PartialOrd)], (a0171: boolean): rt.u8 => { - return a0171 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([rt.iterEq(rt.iterSlice([a4, b4]), rt.iterSlice([b4, a4]), ByVal.eq$cmp_PartialEq, true), rt.iterLt(rt.iterSlice([a4]), rt.iterSlice([b4]), ByVal.partialCmp$cmp_PartialOrd), rt.iterGe(rt.iterSlice([a4]), rt.iterSlice([b4]), ByVal.partialCmp$cmp_PartialOrd)], (a023: boolean): rt.u8 => { + return a023 ? 1 : 0; })), undefined, true); const _1177: boolean = ByVal.eq$cmp_PartialEq(a4, b4); const _1180: boolean = !ByVal.eq$cmp_PartialEq(a4, b4); const _1183: boolean = ByVal.partialCmp$cmp_PartialOrd(a4, b4) === -1; const order8 = ByVal.partialCmp$cmp_PartialOrd(a4, b4); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_1177, _1180, _1183, order8 !== undefined && order8 >= 0, ByVal.eq$cmp_PartialEq(a4, b4), ByVal.partialCmp$cmp_PartialOrd(a4, b4) === 1], (a0172: boolean): rt.u8 => { - return a0172 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_1177, _1180, _1183, order8 !== undefined && order8 >= 0, ByVal.eq$cmp_PartialEq(a4, b4), ByVal.partialCmp$cmp_PartialOrd(a4, b4) === 1], (a024: boolean): rt.u8 => { + return a024 ? 1 : 0; })), undefined, true); rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([ByVal.partialCmp$cmp_PartialOrd(a4, b4), ByVal.partialCmp$cmp_PartialOrd(a4, b4)], orderByte$ref_orders)), undefined, true); rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([ByVal.cmp$cmp_Ord(a4, b4), ByVal.cmp$cmp_Ord(a4, b4)], cmpByte$ref_orders)), undefined, true); @@ -5258,8 +5258,8 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _1279: boolean = rt.eqSlice(Mixed.eq$cmp_PartialEq)(_1281, _1283); const _1286: Mixed.Mixed[] = [a5]; const _1289: Mixed.Mixed[] = [b5]; - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_1269, _1274, _1279, rt.cmpSlice(Mixed.partialCmp$cmp_PartialOrd)(_1286, _1289) === -1], (a0185: boolean): rt.u8 => { - return a0185 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_1269, _1274, _1279, rt.cmpSlice(Mixed.partialCmp$cmp_PartialOrd)(_1286, _1289) === -1], (a025: boolean): rt.u8 => { + return a025 ? 1 : 0; })), undefined, true); const _1294: [Mixed.Mixed] = [a5]; const _1296: [Mixed.Mixed] = [b5]; @@ -5302,11 +5302,11 @@ export function refOrders(_kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): vo const _1376: boolean = order10 !== undefined && order10 >= 0; const _1385: Boxed.Boxed[] = [a6]; const _1388: Boxed.Boxed[] = [b6]; - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_1362, _1369, _1376, !rt.eqSlice(eq$cmp_PartialEq_boxed_Box_collections_Boxed)(_1385, _1388)], (a0199: boolean): rt.u8 => { - return a0199 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_1362, _1369, _1376, !rt.eqSlice(eq$cmp_PartialEq_boxed_Box_collections_Boxed)(_1385, _1388)], (a026: boolean): rt.u8 => { + return a026 ? 1 : 0; })), undefined, true); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([rt.iterEq(rt.iterSlice([a6]), rt.iterSlice([b6]), eq$cmp_PartialEq_boxed_Box_collections_Boxed, true), !rt.iterEq(rt.iterSlice([a6]), rt.iterSlice([b6]), eq$cmp_PartialEq_boxed_Box_collections_Boxed, true), rt.iterLt(rt.iterSlice([a6]), rt.iterSlice([b6]), partialCmp$cmp_PartialOrd_boxed_Box_collections_Boxed)], (a0203: boolean): rt.u8 => { - return a0203 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([rt.iterEq(rt.iterSlice([a6]), rt.iterSlice([b6]), eq$cmp_PartialEq_boxed_Box_collections_Boxed, true), !rt.iterEq(rt.iterSlice([a6]), rt.iterSlice([b6]), eq$cmp_PartialEq_boxed_Box_collections_Boxed, true), rt.iterLt(rt.iterSlice([a6]), rt.iterSlice([b6]), partialCmp$cmp_PartialOrd_boxed_Box_collections_Boxed)], (a027: boolean): rt.u8 => { + return a027 ? 1 : 0; })), undefined, true); rt.byteVecPush(out, orderByte$ref_orders(rt.iterCmp(rt.iterSlice([a6]), rt.iterSlice([b6]), partialCmp$cmp_PartialOrd_boxed_Box_collections_Boxed))); } diff --git a/ts/fixtures/lang/counts/expected/counts.ts b/ts/fixtures/lang/counts/expected/counts.ts index c82e37ed9..66015caff 100644 --- a/ts/fixtures/lang/counts/expected/counts.ts +++ b/ts/fixtures/lang/counts/expected/counts.ts @@ -179,8 +179,8 @@ export function arcs(data: rt.ByteSlice, out: rt.ByteVec): void { weakObject[Symbol.dispose](); } new rt.Arc(new Noisy.Noisy(224, rt.arcClone(log)))[Symbol.dispose](); - const _228: rt.Arc | undefined = option_map$1srhyy0(rt.sliceFirst(strong), (a02: rt.Arc): rt.Arc => { - return rt.arcClone(a02); + const _228: rt.Arc | undefined = option_map$1srhyy0(rt.sliceFirst(strong), (a0: rt.Arc): rt.Arc => { + return rt.arcClone(a0); }); rt.byteVecPush(out, option_mapOr$1iuqai4(option_asDeref$0hypa7g(_228), 253, (noisy3: Noisy.Noisy): rt.u8 => { return noisy3.id; @@ -189,9 +189,9 @@ export function arcs(data: rt.ByteSlice, out: rt.ByteVec): void { rt.dropAll(strong); rt.iterExtendBytes(out, rt.iterMap(rt.iterSlice(weak), (w: rt.Weak): rt.u8 => { const _54: rt.Arc | undefined = rt.weakUpgrade(w); - const _05: rt.u8 = _54 === undefined ? 1 : 0; + const _06: rt.u8 = _54 === undefined ? 1 : 0; rt.drop(_54); - return _05; + return _06; }), undefined, true); rt.iterExtendBytes(out, rt.iterMap(rt.iterSlice(weak), (w2: rt.Weak): rt.u8 => { return rt.weakWeakCount(w2) & 0xff; @@ -267,8 +267,8 @@ export function clonedArcs(data: rt.ByteSlice, out: rt.ByteVec): void { rt.iterExtend(noisy, rt.iterOption(_92, rt.drop), "fold", 8, true); made2[Symbol.dispose](); } else if (_34 === 4) { - const all: rt.Arc[] = rt.iterToArray(rt.iterMap(rt.iterSlice(handles), (a04: rt.Arc): rt.Arc => { - return rt.arcClone(a04); + const all: rt.Arc[] = rt.iterToArray(rt.iterMap(rt.iterSlice(handles), (a02: rt.Arc): rt.Arc => { + return rt.arcClone(a02); }), undefined, 4, true); _191 = true; rt.byteVecPush(out, handles[at].strong & 0xff); @@ -521,9 +521,9 @@ export function uniqueArcs(data: rt.ByteSlice, out: rt.ByteVec): void { } for (const _110 of weak) { rt.byteVecPush(out, option_mapOr$1q3ff8g(rt.weakUpgrade(_110), 253, (s: rt.Arc): rt.u8 => { - const _0: rt.u8 = s.value; + const _03: rt.u8 = s.value; s[Symbol.dispose](); - return _0; + return _03; })); rt.byteVecPush(out, _110.arc.strong & 0xff); rt.byteVecPush(out, rt.weakWeakCount(_110) & 0xff); @@ -624,8 +624,8 @@ export function clonedRcs(data: rt.ByteSlice, out: rt.ByteVec): void { rt.iterExtend(noisy, rt.iterOption(_92, rt.drop), "fold", 8, true); made2[Symbol.dispose](); } else if (_34 === 4) { - const all: rt.Arc[] = rt.iterToArray(rt.iterMap(rt.iterSlice(handles), (a04: rt.Arc): rt.Arc => { - return rt.arcClone(a04); + const all: rt.Arc[] = rt.iterToArray(rt.iterMap(rt.iterSlice(handles), (a02: rt.Arc): rt.Arc => { + return rt.arcClone(a02); }), undefined, 4, true); _191 = true; rt.byteVecPush(out, handles[at].strong & 0xff); @@ -947,8 +947,8 @@ export function rcs(data: rt.ByteSlice, out: rt.ByteVec): void { weakObject[Symbol.dispose](); } new rt.Arc(new Noisy.Noisy(224, rt.arcClone(log)))[Symbol.dispose](); - const _228: rt.Arc | undefined = option_map$1srhyy0(rt.sliceFirst(strong), (a02: rt.Arc): rt.Arc => { - return rt.arcClone(a02); + const _228: rt.Arc | undefined = option_map$1srhyy0(rt.sliceFirst(strong), (a0: rt.Arc): rt.Arc => { + return rt.arcClone(a0); }); rt.byteVecPush(out, option_mapOr$1iuqai4(option_asDeref$0hypa7g(_228), 253, (noisy3: Noisy.Noisy): rt.u8 => { return noisy3.id; @@ -957,9 +957,9 @@ export function rcs(data: rt.ByteSlice, out: rt.ByteVec): void { rt.dropAll(strong); rt.iterExtendBytes(out, rt.iterMap(rt.iterSlice(weak), (w: rt.Weak): rt.u8 => { const _54: rt.Arc | undefined = rt.weakUpgrade(w); - const _05: rt.u8 = _54 === undefined ? 1 : 0; + const _06: rt.u8 = _54 === undefined ? 1 : 0; rt.drop(_54); - return _05; + return _06; }), undefined, true); rt.iterExtendBytes(out, rt.iterMap(rt.iterSlice(weak), (w2: rt.Weak): rt.u8 => { return rt.weakWeakCount(w2) & 0xff; @@ -1056,9 +1056,9 @@ export function uniqueRcs(data: rt.ByteSlice, out: rt.ByteVec): void { } for (const _110 of weak) { rt.byteVecPush(out, option_mapOr$1q3ff8g(rt.weakUpgrade(_110), 253, (s: rt.Arc): rt.u8 => { - const _0: rt.u8 = s.value; + const _03: rt.u8 = s.value; s[Symbol.dispose](); - return _0; + return _03; })); rt.byteVecPush(out, _110.arc.strong & 0xff); rt.byteVecPush(out, rt.weakWeakCount(_110) & 0xff); diff --git a/ts/fixtures/lang/cows/expected/cows.ts b/ts/fixtures/lang/cows/expected/cows.ts index 9f31ae5a2..13cf20c47 100644 --- a/ts/fixtures/lang/cows/expected/cows.ts +++ b/ts/fixtures/lang/cows/expected/cows.ts @@ -43,8 +43,8 @@ export function cows(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { put(out, s); const shared: rt.Arc = new rt.Arc(s); put(out, shared.value); - put(out, option_unwrapOr$1iemzn8(option_map$1uo1d4o(rt.iterNth(rt.strSplit(s, "\\"), 1), (a03: string): string => { - return a03; + put(out, option_unwrapOr$1iemzn8(option_map$1uo1d4o(rt.iterNth(rt.strSplit(s, "\\"), 1), (a0: string): string => { + return a0; }), "fallback")); put(out, cow(first, owned)); put(out, first); diff --git a/ts/fixtures/lang/cycles/expected/cycles.ts b/ts/fixtures/lang/cycles/expected/cycles.ts index b70511bd2..7569b038d 100644 --- a/ts/fixtures/lang/cycles/expected/cycles.ts +++ b/ts/fixtures/lang/cycles/expected/cycles.ts @@ -1136,8 +1136,8 @@ export function closures(data: rt.ByteSlice, steps: rt.ByteSlice, out: rt.ByteVe return Logged.called(captured6, l & 0xff); } return undefined; - }, () => make4(((a04: rt.Arc>): rt.Arc> => { - return rt.arcClone(a04); + }, () => make4(((a0: rt.Arc>): rt.Arc> => { + return rt.arcClone(a0); })(captured5), Logged.clone$Clone(captured6))), (): void => { captured5[Symbol.dispose](); captured6[Symbol.dispose](); diff --git a/ts/fixtures/lang/dyns/expected/dyns.ts b/ts/fixtures/lang/dyns/expected/dyns.ts index 509ad3052..07675b3a2 100644 --- a/ts/fixtures/lang/dyns/expected/dyns.ts +++ b/ts/fixtures/lang/dyns/expected/dyns.ts @@ -903,9 +903,9 @@ export function iters(data: rt.ByteSlice, out: rt.ByteVec): void { const taken: rt.u8 | undefined = option_map$08a6hpg(option_andThen$0v0bj8w(rt.arcGetMut(shared), (it2: rt.Iter): Tagged.Tagged | undefined => { return rt.iterToOption(it2.next()); }), (t5: Tagged.Tagged): rt.u8 => { - const _013: rt.u8 = t5._0; + const _014: rt.u8 = t5._0; t5[Symbol.dispose](); - return _013; + return _014; }); dropped(out); const args30: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtOption(taken, f, rt.u8Debug)]; @@ -941,9 +941,9 @@ export function iters(data: rt.ByteSlice, out: rt.ByteVec): void { return new rt.ArcDyn(arc, rt.iterDyn(rt.iterFrom(arc.value, (it: Countdown.Countdown) => Countdown.next$iter_Iterator(it), rt.drop))); }); const part7 = option_map$0oedb57(rt.weakUpgrade(weak3), (it6: rt.Arc>): [rt.usize, rt.usize | undefined] => { - const _017: [rt.usize, rt.usize | undefined] = it6.value.sizeHint(); + const _018: [rt.usize, rt.usize | undefined] = it6.value.sizeHint(); it6[Symbol.dispose](); - return _017; + return _018; }); const args38: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtOption(part7, f, (value: [rt.usize, rt.usize | undefined], f: rt.Formatter) => rt.fmtTuple([(f: rt.Formatter) => rt.usizeDebug(value[0], f), (f: rt.Formatter) => rt.fmtOption(value[1], f, rt.usizeDebug)], f))]; put(out, rt.fmtFormat([args38[0], " "])); @@ -1224,9 +1224,9 @@ export function pointers(dataData: Uint8Array, dataStart: number, dataLen: numbe rt.refRelease(_495); put(out, _491); const part3 = option_map$0j05j69(ok$00p9ap8(rt.arcDowncast(new rt.Arc(new Any.of$u32(dataData[dataStart] as rt.u32)), Any.of$u32, (object) => object.v)), (n3: rt.Arc): rt.u32 => { - const _08: rt.u32 = n3.value; + const _09: rt.u32 = n3.value; n3[Symbol.dispose](); - return _08; + return _09; }); const args36: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtOption(part3, f, rt.u32Debug)]; put(out, rt.fmtFormat([args36[0], " "])); diff --git a/ts/fixtures/lang/edits/expected/core/bool.ts b/ts/fixtures/lang/edits/expected/core/bool.ts new file mode 100644 index 000000000..17d957542 --- /dev/null +++ b/ts/fixtures/lang/edits/expected/core/bool.ts @@ -0,0 +1,12 @@ +// Generated by rust2-ts. Do not edit. + +import * as rt from "../rt.ts"; + +export function thenSome$0d5am30(self: boolean, t: rt.u8): rt.u8 | undefined { + if (!self) { + return undefined; + } + return t; +} + +//# sourceMappingURL=bool.ts.map diff --git a/ts/fixtures/lang/edits/expected/edits.Down.ts b/ts/fixtures/lang/edits/expected/edits.Down.ts new file mode 100644 index 000000000..6714674c2 --- /dev/null +++ b/ts/fixtures/lang/edits/expected/edits.Down.ts @@ -0,0 +1,19 @@ +// Generated by rust2-ts. Do not edit. + +import * as rt from "./rt.ts"; + +/** The crate's own iterator, counting down to zero. */ +export interface Down { + _0: rt.u8; +} + +export function next$iter_Iterator(self: Down): 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=edits.Down.ts.map diff --git a/ts/fixtures/lang/edits/expected/edits.Logged.ts b/ts/fixtures/lang/edits/expected/edits.Logged.ts new file mode 100644 index 000000000..1af48be7d --- /dev/null +++ b/ts/fixtures/lang/edits/expected/edits.Logged.ts @@ -0,0 +1,35 @@ +// Generated by rust2-ts. Do not edit. + +import * as rt from "./rt.ts"; + +export function default$Default(): Logged { + return new Logged(0, undefined); +} + +/** + * Logs its id as it drops, so what `mem::replace` gives back and leaves shows by when each + * drops. + */ +export class Logged { + id: rt.u8; + log: rt.RefCell | undefined; + + constructor(id: rt.u8, log: rt.RefCell | undefined) { + this.id = id; + this.log = log; + } + + [Symbol.dispose](): void { + drop$ops_Drop(this); + } +} + +export function drop$ops_Drop(self: Logged): void { + if (self.log !== undefined) { + const _7: rt.RefCell = rt.refCellBorrowMut(self.log); + rt.byteVecPush(_7.value, self.id); + rt.refMutRelease(_7); + } +} + +//# sourceMappingURL=edits.Logged.ts.map diff --git a/ts/fixtures/lang/edits/expected/edits.ts b/ts/fixtures/lang/edits/expected/edits.ts index ec9864035..d26d06fe7 100644 --- a/ts/fixtures/lang/edits/expected/edits.ts +++ b/ts/fixtures/lang/edits/expected/edits.ts @@ -1,8 +1,11 @@ // Generated by rust2-ts. Do not edit. import * as rt from "./rt.ts"; +import { thenSome$0d5am30 } from "./core/bool.ts"; import { unwrapOr$039uout as option_unwrapOr$039uout, unwrapOr$1j4op5y as option_unwrapOr$1j4op5y, unwrapOr$0r2bmpr as option_unwrapOr$0r2bmpr, map$0xa0bn7 as option_map$0xa0bn7, map$1u8sh4f as option_map$1u8sh4f, mapOr$14njs1h as option_mapOr$14njs1h, mapOr$1llunel as option_mapOr$1llunel, filter$184yuq2, clone$0vcwlo5 as option_clone$0vcwlo5 } from "./core/option.ts"; +import * as Down from "./edits.Down.ts"; import * as Lean from "./edits.Lean.ts"; +import * as Logged from "./edits.Logged.ts"; import * as Named from "./edits.Named.ts"; import * as Stamp from "./edits.Stamp.ts"; import * as Tally from "./edits.Tally.ts"; @@ -256,8 +259,8 @@ export function edits(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { return rt.u16Add(i4 as rt.u16, b5 as rt.u16); }), undefined, 2, true); }), undefined, 12, true); - const _453: rt.u16[][] = rt.vecExact(nested.map((a027: rt.u16[]): rt.u16[] => { - return rt.vecExact(a027.slice(), 2); + const _453: rt.u16[][] = rt.vecExact(nested.map((a02: rt.u16[]): rt.u16[] => { + return rt.vecExact(a02.slice(), 2); }), 12); rt.byteVecPush(out, rt.eqSlice(rt.eqSlice(rt.same))(_453, nested) ? 1 : 0); const pair: [string, rt.u8] = [text(data), at(0)]; @@ -350,8 +353,8 @@ export function edits(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { rt.byteVecPush(out, option_mapOr$14njs1h(optional$edits_Named(_604(part3)), 65535, (n2: Named.Named): rt.u16 => { return n2.id; }) & 0xff); - const part4 = option_unwrapOr$039uout(option_map$1u8sh4f(rt.sliceFirst(kept), (a09: Named.Named): Named.Named[] => { - return [a09]; + const part4 = option_unwrapOr$039uout(option_map$1u8sh4f(rt.sliceFirst(kept), (a0: Named.Named): Named.Named[] => { + return [a0]; }), kept); putU16s(out, _605(part4)); const part5 = [_604(7)]; @@ -590,4 +593,301 @@ export function bytes(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { } } +/** `f` of `place` and `value`, as a function value of two parameters is called. */ +export function apply$Option_u8_u8_Option_u8_Option_T_replace_u8(_: (a0: rt.Place, a1: rt.u8) => rt.u8 | undefined, place: rt.Place, value: rt.u8): rt.u8 | undefined { + return ((a0: rt.Place, a1: rt.u8): rt.u8 | undefined => { + const old = a0.v; + a0.v = a1; + return old; + })(place, value); +} + +/** `f` of `place` and `value`, as a function value of two parameters is called. */ +export function apply$String_String_String_mem_replace_String(_: (a0: rt.Place, a1: string) => string, place: rt.Place, value: string): string { + return ((a0: rt.Place, a1: string): string => { + const old = a0.v; + a0.v = a1; + return old; + })(place, value); +} + +/** `f` of `place` and `value`, as a function value of two parameters is called. */ +export function apply$String_char_unit_String_push(_: (a0: rt.Place, a1: rt.char) => undefined, place: rt.Place, value: rt.char): void { + ((a0: rt.Place, a1: rt.char): undefined => { + a0.v = a0.v + String.fromCodePoint(a1); + })(place, value); +} + +/** `f` of `place` and `value`, as a function value of two parameters is called. */ +export function apply$String_mut_String_unit_mem_swap_String(_: (a0: rt.Place, a1: rt.Place) => undefined, place: rt.Place, value: rt.Place): void { + ((a0: rt.Place, a1: rt.Place): undefined => { + const swapped = a0.v; + a0.v = a1.v; + a1.v = swapped; + })(place, value); +} + +/** `f` of `place` and `value`, as a function value of two parameters is called. */ +export function apply$String_ref_String_unit_Clone_clone_from_String(_: (a0: rt.Place, a1: string) => undefined, place: rt.Place, value: string): void { + ((a0: rt.Place, a1: string): undefined => { + a0.v = a1; + })(place, value); +} + +/** `f` of `place` and `value`, as a function value of two parameters is called. */ +export function apply$String_ref_str_unit_String_push_str(_: (a0: rt.Place, a1: string) => undefined, place: rt.Place, value: string): void { + ((a0: rt.Place, a1: string): undefined => { + a0.v = a0.v + a1; + })(place, value); +} + +/** `f` of `place` and `value`, as a function value of two parameters is called. */ +export function apply$edits_Logged_edits_Logged_edits_Logged_mem_replace_edits_Logged(_: (a0: Logged.Logged, a1: Logged.Logged) => Logged.Logged, place: Logged.Logged, value: Logged.Logged): Logged.Logged { + return ((a0: Logged.Logged, a1: Logged.Logged): Logged.Logged => { + return rt.replaceIn(a0, a1); + })(place, value); +} + +/** `f` of `place` and `value`, as a function value of two parameters is called. */ +export function apply$edits_Logged_mut_edits_Logged_unit_mem_swap_edits_Logged(_: (a0: Logged.Logged, a1: Logged.Logged) => undefined, place: Logged.Logged, value: Logged.Logged): void { + ((a0: Logged.Logged, a1: Logged.Logged): undefined => { + Object.assign(a0, rt.replaceIn(a1, a0)); + })(place, value); +} + +/** `f` of `place` and `value`, as a function value of two parameters is called. */ +export function apply$u8_mut_u8_unit_mem_swap_u8(_: (a0: rt.Place, a1: rt.Place) => undefined, place: rt.Place, value: rt.Place): void { + ((a0: rt.Place, a1: rt.Place): undefined => { + const swapped = a0.v; + a0.v = a1.v; + a1.v = swapped; + })(place, value); +} + +/** `f` of `place` and `value`, as a function value of two parameters is called. */ +export function apply$u8_u8_u8_mem_replace_u8(_: (a0: rt.Place, a1: rt.u8) => rt.u8, place: rt.Place, value: rt.u8): rt.u8 { + return ((a0: rt.Place, a1: rt.u8): rt.u8 => { + const old = a0.v; + a0.v = a1; + return old; + })(place, value); +} + +/** + * `mem::take`, `replace`, and `swap` passed as function values: to an iterator's `map`, to + * a generic function, and as `fn` pointers, of bytes JS keeps in a place, of objects it + * writes in place, and of values that drop; and other function values that a call + * lowers differently, as `next`. + */ +export function values(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { + const at: (a0: rt.usize) => rt.u8 = (i: rt.usize): rt.u8 => { + return option_unwrapOr$0r2bmpr(rt.byteSliceGet(data, i), 0); + }; + const _5: rt.u8 = rt.u8Rem(kind, 4); + if (_5 === 0) { + const bytes: rt.ByteVec = rt.byteSliceToByteVec(data); + rt.byteVecExtendFromSlice(out, rt.byteVecSlice(rt.iterToByteVec(rt.iterMap(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(bytes))), (a019: rt.Place): rt.u8 => { + const taken7 = a019.v; + a019.v = 0; + return taken7; + }), undefined, true))); + rt.byteVecExtendFromSlice(out, rt.byteVecSlice(bytes)); + const held: rt.ByteVec[] = rt.iterToArray(rt.iterMap(rt.byteSliceChunks(data, 2), (a020: rt.ByteSlice): rt.ByteVec => { + return rt.byteSliceToByteVec(a020); + }), undefined, 12, true); + rt.iterExtendBytes(out, rt.iterMap(rt.iterMap(rt.iterSlice(rt.iterToArray(rt.iterMap(rt.iterSlice(held), (a021: rt.ByteVec): rt.ByteVec => { + return rt.replaceIn(a021, new rt.ByteVec()); + }), undefined, 12, true)), (a022: rt.ByteVec): rt.usize => { + return a022.length; + }), (n2: rt.usize): rt.u8 => { + return n2 & 0xff; + }), undefined, true); + rt.iterExtendBytes(out, rt.iterMap(rt.iterMap(rt.iterSlice(held), (a023: rt.ByteVec): rt.usize => { + return a023.length; + }), (n3: rt.usize): rt.u8 => { + return n3 & 0xff; + }), undefined, true); + const texts: string[] = rt.iterToArray(rt.iterMap(rt.iterSlice(rt.byteSliceView(data)), (_210: rt.u8): string => { + return text(rt.byteSliceFrom(Uint8Array.of(_210))); + }), undefined, 12, true); + put(out, rt.strsJoin(rt.iterToArray(rt.iterMap(rt.iterRev(rt.iterSliceMut(texts)), (a024: rt.Place): string => { + const taken9 = a024.v; + a024.v = ""; + return taken9; + }), undefined, 12, true), "")); + put(out, rt.strsJoin(texts, "")); + } else if (_5 === 1) { + let n: rt.u8 = at(0); + const _66: rt.u8 = at(1); + rt.byteVecPush(out, apply$u8_u8_u8_mem_replace_u8((a08: rt.Place, a17: rt.u8): rt.u8 => { + const old6 = a08.v; + a08.v = a17; + return old6; + }, rt.place(() => n, (value3) => n = value3), _66)); + rt.byteVecPush(out, n); + const replace: (a0: rt.Place, a1: rt.u8) => rt.u8 = (a09: rt.Place, a18: rt.u8): rt.u8 => { + const old7 = a09.v; + a09.v = a18; + return old7; + }; + const _75: rt.u8 = at(2); + rt.byteVecPush(out, replace(rt.place(() => n, (value4) => n = value4), _75)); + rt.byteVecPush(out, n); + let s: string = text(data); + const _83: string = text(rt.byteSliceFrom(Uint8Array.of(at(0)))); + put(out, apply$String_String_String_mem_replace_String((a010: rt.Place, a19: string): string => { + const old8 = a010.v; + a010.v = a19; + return old8; + }, rt.place(() => s, (value5) => s = value5), _83)); + put(out, s); + const v: rt.ByteVec = rt.byteSliceToByteVec(data); + const old2: rt.ByteVec = ((a011: rt.ByteVec): rt.ByteVec => { + return rt.replaceIn(a011, new rt.ByteVec()); + })(v); + rt.byteVecPush(out, old2.length & 0xff); + rt.byteVecPush(out, v.length & 0xff); + let held2: rt.u8 | undefined = thenSome$0d5am30(rt.u8Rem(at(0), 2) === 0, at(1)); + const _121: rt.u8 = at(2); + rt.iterExtendBytes(out, rt.iterOption(apply$Option_u8_u8_Option_u8_Option_T_replace_u8((a012: rt.Place, a110: rt.u8): rt.u8 | undefined => { + const old9 = a012.v; + a012.v = a110; + return old9; + }, rt.place(() => held2, (value6) => held2 = value6), _121)), undefined, true); + rt.iterExtendBytes(out, rt.iterOption(held2), undefined, true); + apply$String_ref_str_unit_String_push_str((a013: rt.Place, a111: string): undefined => { + a013.v = a013.v + a111; + }, rt.place(() => s, (value7) => s = value7), "+"); + apply$String_char_unit_String_push((a014: rt.Place, a112: rt.char): undefined => { + a014.v = a014.v + String.fromCodePoint(a112); + }, rt.place(() => s, (value8) => s = value8), 33); + const _136: rt.usize = old2.length; + const _134: string = rt.fmtToString((f: rt.Formatter) => rt.usizeDisplay(_136, f)); + apply$String_ref_String_unit_Clone_clone_from_String((a015: rt.Place, a113: string): undefined => { + a015.v = a113; + }, rt.place(() => s, (value9) => s = value9), _134); + put(out, s); + const bytes2: rt.ByteVec = rt.byteSliceToByteVec(data); + rt.iterForEach(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(bytes2))), (a016: rt.Place): undefined => { + a016.v = rt.toAsciiUppercase(a016.v); + }); + rt.byteVecExtendFromSlice(out, rt.byteVecSlice(bytes2)); + const next: (a0: rt.Iter) => rt.u8 | undefined = (a017: rt.Iter): rt.u8 | undefined => { + return rt.iterToOption(a017.next()); + }; + const it: rt.Iter = rt.byteVecIntoIter(bytes2); + while (true) { + const _152: rt.u8 | undefined = next(it); + if (_152 !== undefined) { + rt.byteVecPush(out, _152); + } else { + break; + } + } + rt.byteVecPush(out, next(it) === undefined ? 1 : 0); + const next2: (a0: Down.Down) => rt.u8 | undefined = (a018: Down.Down): rt.u8 | undefined => { + return rt.iterToOption(Down.next$iter_Iterator(a018)); + }; + const down: Down.Down = { _0: rt.u8Rem(at(0), 4) }; + while (true) { + const _170: rt.u8 | undefined = next2(down); + if (_170 !== undefined) { + rt.byteVecPush(out, _170); + } else { + break; + } + } + rt.byteVecPush(out, next2(down) === undefined ? 1 : 0); + } else if (_5 === 2) { + const _183: [rt.u8, rt.u8] = [at(0), at(1)]; + let a: rt.u8 = _183[0]; + let b3: rt.u8 = _183[1]; + apply$u8_mut_u8_unit_mem_swap_u8((a05: rt.Place, a14: rt.Place): undefined => { + const swapped2 = a05.v; + a05.v = a14.v; + a14.v = swapped2; + }, rt.place(() => a, (value) => a = value), rt.place(() => b3, (value2) => b3 = value2)); + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(a, b3)), undefined, true); + const _200: [rt.ByteVec, rt.ByteVec] = [rt.byteSliceToByteVec(data), rt.byteVecFrom(Uint8Array.of(at(2)))]; + const x: rt.ByteVec = _200[0]; + const y: rt.ByteVec = _200[1]; + ((a06: rt.ByteVec, a15: rt.ByteVec): undefined => { + Object.assign(a06, rt.replaceIn(a15, a06)); + })(x, y); + rt.byteVecExtendFromSlice(out, rt.byteVecSlice(x)); + rt.byteVecExtendFromSlice(out, rt.byteVecSlice(y)); + const texts2: string[] = rt.iterToArray(rt.iterMap(rt.iterSlice(rt.byteSliceView(data)), (_22: rt.u8): string => { + return text(rt.byteSliceFrom(Uint8Array.of(_22))); + }), undefined, 12, true); + const others: string[] = rt.iterToArray(rt.iterMap(rt.iterRev(rt.iterSlice(rt.byteSliceView(data))), (_26: rt.u8): string => { + const b6: rt.u8 = _26; + return text(rt.byteSliceFrom(Uint8Array.of(b6, b6))); + }), undefined, 12, true); + rt.iterForEach(rt.iterZip(rt.iterSliceMut(texts2), rt.iterSliceMut(others), [false, false]), (_27: [rt.Place, rt.Place]): undefined => { + apply$String_mut_String_unit_mem_swap_String((a07: rt.Place, a16: rt.Place): undefined => { + const swapped4 = a07.v; + a07.v = a16.v; + a16.v = swapped4; + }, _27[0], _27[1]); + }); + put(out, rt.strsJoin(texts2, "")); + put(out, rt.strsJoin(others, "")); + } else { + const log: rt.RefCell = new rt.RefCell(new rt.ByteVec()); + const logged: (a0: rt.u8) => Logged.Logged = (id: rt.u8): Logged.Logged => { + return new Logged.Logged(id, log); + }; + const held3: Logged.Logged[] = rt.iterToArray(rt.iterMap(rt.iterSlice(rt.byteSliceView(data)), (_2: rt.u8): Logged.Logged => { + return logged(_2); + }), undefined, 8, true); + const taken4: Logged.Logged[] = rt.iterToArray(rt.iterMap(rt.iterSlice(held3), (a0: Logged.Logged): Logged.Logged => { + return rt.replaceIn(a0, Logged.default$Default()); + }), undefined, 8, true); + const _260: rt.RefCell = rt.refCellBorrowMut(log); + rt.byteVecPush(_260.value, 240); + rt.refMutRelease(_260); + rt.dropAll(taken4); + const _266: rt.RefCell = rt.refCellBorrowMut(log); + rt.byteVecPush(_266.value, 241); + rt.refMutRelease(_266); + const part = at(0); + const one: Logged.Logged = logged(part); + const part2 = at(1); + const _277: Logged.Logged = logged(part2); + apply$edits_Logged_edits_Logged_edits_Logged_mem_replace_edits_Logged((a02: Logged.Logged, a1: Logged.Logged): Logged.Logged => { + return rt.replaceIn(a02, a1); + }, one, _277)[Symbol.dispose](); + const _286: rt.RefCell = rt.refCellBorrowMut(log); + rt.byteVecPush(_286.value, 242); + rt.refMutRelease(_286); + const replace2: (a0: Logged.Logged, a1: Logged.Logged) => Logged.Logged = (a03: Logged.Logged, a12: Logged.Logged): Logged.Logged => { + return rt.replaceIn(a03, a12); + }; + const part3 = at(2); + const _291: Logged.Logged = logged(part3); + const old3: Logged.Logged = replace2(one, _291); + const part4 = at(3); + const other: Logged.Logged = logged(part4); + apply$edits_Logged_mut_edits_Logged_unit_mem_swap_edits_Logged((a04: Logged.Logged, a13: Logged.Logged): undefined => { + Object.assign(a04, rt.replaceIn(a13, a04)); + }, one, other); + const _309: rt.RefCell = rt.refCellBorrowMut(log); + rt.byteVecPush(_309.value, 243); + rt.refMutRelease(_309); + other[Symbol.dispose](); + const _316: rt.RefCell = rt.refCellBorrowMut(log); + rt.byteVecPush(_316.value, 244); + rt.refMutRelease(_316); + old3[Symbol.dispose](); + const _322: rt.RefCell = rt.refCellBorrowMut(log); + rt.byteVecPush(_322.value, 245); + rt.refMutRelease(_322); + one[Symbol.dispose](); + rt.dropAll(held3); + const _328: rt.RefCell = rt.refCellBorrow(log); + rt.byteVecExtendFromSlice(out, rt.byteVecSlice(_328.value)); + rt.refRelease(_328); + } +} + //# sourceMappingURL=edits.ts.map diff --git a/ts/fixtures/lang/edits/expected/lib.ts b/ts/fixtures/lang/edits/expected/lib.ts index d5243a15e..6213aacfe 100644 --- a/ts/fixtures/lang/edits/expected/lib.ts +++ b/ts/fixtures/lang/edits/expected/lib.ts @@ -1,14 +1,14 @@ // Generated by rust2-ts. Do not edit. import * as rt from "./rt.ts"; -import { edits, bytes } from "./edits.ts"; +import { edits, bytes, values } from "./edits.ts"; /** * Each case's name and what it runs. The first two bytes, big-endian, pick one modulo * their count, so a case added at the end moves no other. */ export function cases(): [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined][] { - return [["edits::edits", edits as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["edits::bytes", bytes as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined]]; + return [["edits::edits", edits as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["edits::bytes", bytes as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["edits::values", values as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined]]; } //# sourceMappingURL=lib.ts.map diff --git a/ts/fixtures/lang/edits/src/edits.rs b/ts/fixtures/lang/edits/src/edits.rs index 63ae38cfc..5bbe3e7e1 100644 --- a/ts/fixtures/lang/edits/src/edits.rs +++ b/ts/fixtures/lang/edits/src/edits.rs @@ -1,8 +1,9 @@ //! `Vec`'s and slices' editing and sorting methods, with closures that log what they are //! called with, `Clone` and comparisons of vectors, tuples, boxes, and `Option`s that are -//! not `Copy`, `mem::take`, `mem::size_of`, `Ord`'s defaults on the crate's own types, and -//! `str`'s byte searches. +//! not `Copy`, `mem::take`, `replace`, and `swap`, called and as function values, +//! `mem::size_of`, `Ord`'s defaults on the crate's own types, and `str`'s byte searches. +use std::cell::RefCell; use std::cmp::Ordering; use std::collections::{BTreeSet, VecDeque}; @@ -513,3 +514,146 @@ pub fn bytes(kind: u8, data: &[u8], out: &mut Vec) { } } } + +/// Logs its id as it drops, so what `mem::replace` gives back and leaves shows by when each +/// drops. +#[derive(Default)] +struct Logged<'a> { + id: u8, + log: Option<&'a RefCell>>, +} + +impl Drop for Logged<'_> { + fn drop(&mut self) { + if let Some(log) = self.log { + log.borrow_mut().push(self.id); + } + } +} + +/// The crate's own iterator, counting down to zero. +struct Down(u8); + +impl Iterator for Down { + type Item = u8; + + fn next(&mut self) -> Option { + self.0 = self.0.checked_sub(1)?; + Some(self.0) + } +} + +/// `f` of `place` and `value`, as a function value of two parameters is called. +fn apply(f: impl FnOnce(&mut T, U) -> R, place: &mut T, value: U) -> R { + f(place, value) +} + +/// `mem::take`, `replace`, and `swap` passed as function values: to an iterator's `map`, to +/// a generic function, and as `fn` pointers, of bytes JS keeps in a place, of objects it +/// writes in place, and of values that drop; and other function values that a call +/// lowers differently, as `next`. +pub fn values(kind: u8, data: &[u8], out: &mut Vec) { + let at = |i: usize| data.get(i).copied().unwrap_or(0); + match kind % 4 { + 0 => { + let mut bytes = data.to_vec(); + let taken: Vec = bytes.iter_mut().map(std::mem::take).collect(); + out.extend_from_slice(&taken); + out.extend_from_slice(&bytes); + let mut held: Vec> = data.chunks(2).map(<[u8]>::to_vec).collect(); + let taken: Vec> = held.iter_mut().map(std::mem::take).collect(); + out.extend(taken.iter().map(Vec::len).map(|n| n as u8)); + out.extend(held.iter().map(Vec::len).map(|n| n as u8)); + let mut texts: Vec = data.iter().map(|&b| text(&[b])).collect(); + let taken: Vec = texts.iter_mut().rev().map(std::mem::take).collect(); + put(out, &taken.concat()); + put(out, &texts.concat()); + } + 1 => { + let mut n = at(0); + out.push(apply(std::mem::replace, &mut n, at(1))); + out.push(n); + let replace: fn(&mut u8, u8) -> u8 = std::mem::replace; + out.push(replace(&mut n, at(2))); + out.push(n); + let mut s = text(data); + let old = apply(std::mem::replace, &mut s, text(&[at(0)])); + put(out, &old); + put(out, &s); + let mut v = data.to_vec(); + let take: fn(&mut Vec) -> Vec = std::mem::take; + let old = take(&mut v); + out.push(old.len() as u8); + out.push(v.len() as u8); + // Others of std's that write what a `&mut` borrows, as values too. + let mut held = (at(0) % 2 == 0).then_some(at(1)); + out.extend(apply(Option::replace, &mut held, at(2))); + out.extend(held); + apply(String::push_str, &mut s, "+"); + apply(String::push, &mut s, '!'); + apply(Clone::clone_from, &mut s, &old.len().to_string()); + put(out, &s); + let mut bytes = data.to_vec(); + bytes.iter_mut().for_each(u8::make_ascii_uppercase); + out.extend_from_slice(&bytes); + // A value of std's `next` returns `None` past the end, as its call does. + let next: fn(&mut std::vec::IntoIter) -> Option = Iterator::next; + let mut it = bytes.into_iter(); + while let Some(b) = next(&mut it) { + out.push(b); + } + out.push(next(&mut it).is_none() as u8); + // And of the crate's own. + let next: fn(&mut Down) -> Option = Down::next; + let mut down = Down(at(0) % 4); + while let Some(b) = next(&mut down) { + out.push(b); + } + out.push(next(&mut down).is_none() as u8); + } + 2 => { + let (mut a, mut b) = (at(0), at(1)); + apply(std::mem::swap, &mut a, &mut b); + out.extend([a, b]); + let swap: fn(&mut Vec, &mut Vec) = std::mem::swap; + let (mut x, mut y) = (data.to_vec(), vec![at(2)]); + swap(&mut x, &mut y); + out.extend_from_slice(&x); + out.extend_from_slice(&y); + let mut texts: Vec = data.iter().map(|&b| text(&[b])).collect(); + let mut others: Vec = data.iter().rev().map(|&b| text(&[b, b])).collect(); + texts + .iter_mut() + .zip(others.iter_mut()) + .for_each(|(t, o)| apply(std::mem::swap, t, o)); + put(out, &texts.concat()); + put(out, &others.concat()); + } + _ => { + // Each replaced value drops where its caller drops what it gave back, and each + // left in place where its owner drops it. + let log = RefCell::new(Vec::new()); + let logged = |id: u8| Logged { id, log: Some(&log) }; + { + let mut held: Vec = data.iter().map(|&b| logged(b)).collect(); + let taken: Vec = held.iter_mut().map(std::mem::take).collect(); + log.borrow_mut().push(0xf0); + drop(taken); + log.borrow_mut().push(0xf1); + let mut one = logged(at(0)); + drop(apply(std::mem::replace, &mut one, logged(at(1)))); + log.borrow_mut().push(0xf2); + let replace: fn(&mut _, _) -> _ = std::mem::replace; + let old = replace(&mut one, logged(at(2))); + let mut other = logged(at(3)); + apply(std::mem::swap, &mut one, &mut other); + log.borrow_mut().push(0xf3); + drop(other); + log.borrow_mut().push(0xf4); + drop(old); + log.borrow_mut().push(0xf5); + } + out.extend_from_slice(&log.borrow()); + } + } +} diff --git a/ts/fixtures/lang/edits/src/lib.rs b/ts/fixtures/lang/edits/src/lib.rs index dcb369dcf..b885660af 100644 --- a/ts/fixtures/lang/edits/src/lib.rs +++ b/ts/fixtures/lang/edits/src/lib.rs @@ -15,5 +15,9 @@ use harness::Case; /// Each case's name and what it runs. The first two bytes, big-endian, pick one modulo /// their count, so a case added at the end moves no other. fn cases() -> Vec<(&'static str, Case)> { - vec![("edits::edits", edits::edits), ("edits::bytes", edits::bytes)] + vec![ + ("edits::edits", edits::edits), + ("edits::bytes", edits::bytes), + ("edits::values", edits::values), + ] } diff --git a/ts/fixtures/lang/errors/expected/errors.ts b/ts/fixtures/lang/errors/expected/errors.ts index eede2767f..2a68c59d9 100644 --- a/ts/fixtures/lang/errors/expected/errors.ts +++ b/ts/fixtures/lang/errors/expected/errors.ts @@ -472,8 +472,8 @@ export function eqs(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { return rt.i64Mul((_27 << 24) >> 24 as rt.i64, 2); }); rt.iterExtend(ints, _78, undefined, 8, true); - pairs$Result_i8_num_TryFromIntError(rt.iterToArray(rt.iterMap(rt.iterSlice(ints), (a03: rt.i64): rt.Result => { - return rt.i8TryFrom(a03); + pairs$Result_i8_num_TryFromIntError(rt.iterToArray(rt.iterMap(rt.iterSlice(ints), (a02: rt.i64): rt.Result => { + return rt.i8TryFrom(a02); }), undefined, 2, true), out); } else if (_32 === 9) { pairs$Result_ref_str_str_Utf8Error(rt.iterToArray(rt.iterMap(rt.iterSlice(bytes), (b6: rt.ByteSlice): rt.Result => { @@ -489,8 +489,8 @@ export function eqs(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { return (((_25 << 24) >> 24 as rt.f64)) / 4.0; }); rt.iterExtend(secs, _105, undefined, 8, true); - pairs$Result_time_Duration_time_TryFromFloatSecsError(rt.iterToArray(rt.iterMap(rt.iterSlice(secs), (a02: rt.f64): rt.Result => { - return rt.durationTryFromSecsF64(a02); + pairs$Result_time_Duration_time_TryFromFloatSecsError(rt.iterToArray(rt.iterMap(rt.iterSlice(secs), (a0: rt.f64): rt.Result => { + return rt.durationTryFromSecsF64(a0); }), undefined, 16, true), out); } else if (_32 === 12) { pairs$Result_Option_u8_num_ParseIntError(rt.iterToArray(rt.iterMap(rt.iterSlice(all), (s6: string): rt.Result => { diff --git a/ts/fixtures/lang/ints/expected/lib.ts b/ts/fixtures/lang/ints/expected/lib.ts index c0721f889..d56b6c679 100644 --- a/ts/fixtures/lang/ints/expected/lib.ts +++ b/ts/fixtures/lang/ints/expected/lib.ts @@ -10,8 +10,8 @@ import { u8Op, u16Op, u32Op, u64Op, u128Op, usizeOp, i8Op, i16Op, i32Op, i64Op, export function cases(): [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined][] { return [["ints::u8_op", u8Op as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ints::u16_op", u16Op as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ints::u32_op", u32Op as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ints::u64_op", u64Op as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ints::u128_op", u128Op as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ints::usize_op", usizeOp as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ints::i8_op", i8Op as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ints::i16_op", i16Op as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ints::i32_op", i32Op as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ints::i64_op", i64Op as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ints::i128_op", i128Op as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ints::isize_op", isizeOp as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ints::neg", neg as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ints::cast", cast as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ints::convert", (_210: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): undefined => { convert(data, out); - }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ints::parses", (a015: rt.u8, a115: rt.ByteSlice, a215: rt.ByteVec): undefined => { - parses(a015, a115.data, a115.start, a115.length, a215); + }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ints::parses", (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec): undefined => { + parses(a0, a1.data, a1.start, a1.length, a2); }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ints::widenings", widenings as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined]]; } diff --git a/ts/fixtures/lang/iters/expected/iters.ts b/ts/fixtures/lang/iters/expected/iters.ts index 24ac00490..10e632ec5 100644 --- a/ts/fixtures/lang/iters/expected/iters.ts +++ b/ts/fixtures/lang/iters/expected/iters.ts @@ -555,14 +555,14 @@ export function peekedOthers(data: rt.ByteSlice, out: rt.ByteVec): void { const bytes: rt.ByteVec = rt.byteSliceToByteVec(data); const it10: rt.Peekable> = rt.iterPeekable(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(bytes)))); const _242: rt.u8 = option_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; + const _239: rt.Place | undefined = rt.peekableNextIfEq(it10, _242, (a018: rt.Place, a114: rt.u8): boolean => { + return a018.v === a114; }); if (_239 !== undefined) { _239.v = _239.v ^ 64; } - rt.byteVecPush(out, option_mapOr$0ev76sb(rt.peekableNextIfEq(it10, 3, (a020: rt.Place, a116: rt.u8): boolean => { - return a020.v === a116; + rt.byteVecPush(out, option_mapOr$0ev76sb(rt.peekableNextIfEq(it10, 3, (a019: rt.Place, a115: rt.u8): boolean => { + return a019.v === a115; }), 170, (b9: rt.Place): rt.u8 => { return b9.v; })); diff --git a/ts/fixtures/lang/joins/expected/joins.ts b/ts/fixtures/lang/joins/expected/joins.ts index 4b8fe65c9..80506a562 100644 --- a/ts/fixtures/lang/joins/expected/joins.ts +++ b/ts/fixtures/lang/joins/expected/joins.ts @@ -123,10 +123,10 @@ export function joins(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { wides(rt.slicesJoin(slices, 2), out); wides(rt.slicesJoin(slices, 2, [sep2]), out); wides(rt.slicesJoin(slices, 2, rt.sliceRange(wideSeps, 0)), out); - const boxed2: rt.u16[][] = rt.iterToArray(rt.iterMap(rt.iterMap(rt.iterSlice(wide), (a015: rt.u16[]): rt.u16[] => { - return rt.vecExact(a015.slice(), 2); - }), (a016: rt.u16[]): rt.u16[] => { - return a016; + const boxed2: rt.u16[][] = rt.iterToArray(rt.iterMap(rt.iterMap(rt.iterSlice(wide), (a02: rt.u16[]): rt.u16[] => { + return rt.vecExact(a02.slice(), 2); + }), (a03: rt.u16[]): rt.u16[] => { + return a03; }), undefined, 8, true); wides(rt.slicesJoin(boxed2, 2), out); wides(rt.slicesJoin(boxed2, 2, [sep2]), out); @@ -191,8 +191,8 @@ export function joins(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { const sep4: string = text(seps); put(out, rt.strsJoin(owned2, "")); put(out, rt.strsJoin(owned2, sep4)); - const borrowed: string[] = rt.iterToArray(rt.iterMap(rt.iterSlice(owned2), (a02: string): string => { - return a02; + const borrowed: string[] = rt.iterToArray(rt.iterMap(rt.iterSlice(owned2), (a0: string): string => { + return a0; }), undefined, 8, true); put(out, rt.strsJoin(borrowed, "")); put(out, rt.strsJoin(borrowed, sep4)); diff --git a/ts/fixtures/lang/locals/expected/locals.ts b/ts/fixtures/lang/locals/expected/locals.ts index 1b617e66f..80c45ca44 100644 --- a/ts/fixtures/lang/locals/expected/locals.ts +++ b/ts/fixtures/lang/locals/expected/locals.ts @@ -71,9 +71,9 @@ export function locals(data: rt.ByteSlice, out: rt.ByteVec): void { })(POLLING.get())); rt.byteVecPush(out, ((p2: Polling.Polling): rt.u8 => { const _64: rt.RefCell = rt.refCellBorrow(p2.held); - const _05: rt.u8 = _64.value.length & 0xff; + const _06: rt.u8 = _64.value.length & 0xff; rt.refRelease(_64); - return _05; + return _06; })(POLLING.get())); rt.byteVecPush(out, withBorrow$1qygtee(HELD, (held: Noisy.Noisy | undefined): rt.u8 => { return option_mapOr$0cqaybi(held, 253, (n: Noisy.Noisy): rt.u8 => { @@ -105,9 +105,9 @@ export function locals(data: rt.ByteSlice, out: rt.ByteVec): void { } else if (_46 === 2) { rt.byteVecPush(out, result_mapOr$18ipla0(rt.Ok(((log6: rt.RefCell): rt.usize => { const _512: rt.RefCell = rt.refCellBorrow(log6); - const _020: rt.usize = _512.value.length; + const _021: rt.usize = _512.value.length; rt.refRelease(_512); - return _020; + return _021; })(LOG.get())), 253, (n4: rt.usize): rt.u8 => { return n4 & 0xff; })); @@ -117,9 +117,9 @@ export function locals(data: rt.ByteSlice, out: rt.ByteVec): void { const _318: rt.u8 = c3.v & 0xff; const _910: rt.RefCell = rt.refCellBorrow(log5); const _78: rt.ByteVec = _910.value; - const _019: rt.u8 = _318 ^ _78.data[rt.idx(_78, 0)]; + const _020: rt.u8 = _318 ^ _78.data[rt.idx(_78, 0)]; rt.refRelease(_910); - return _019; + return _020; })(LOG.get()); })(COUNT.get())); } else if (_46 === 4) { @@ -132,9 +132,9 @@ export function locals(data: rt.ByteSlice, out: rt.ByteVec): void { rt.byteVecPush(_611.value, op); rt.refMutRelease(_611); const _1110: rt.RefCell = rt.refCellBorrow(p4.held); - const _016: rt.usize = _1110.value.length; + const _017: rt.usize = _1110.value.length; rt.refRelease(_1110); - return _016; + return _017; })(POLLING.get()); rt.byteVecPush(out, option_mapOr$0ucbp7g(outer, 253, (_23: [rt.u64, rt.u64]): rt.u8 => { return rt.u64Low(_23[0]) & 0xff; @@ -182,9 +182,9 @@ export function locals(data: rt.ByteSlice, out: rt.ByteVec): void { })); rt.drop(old); rt.byteVecPush(out, option_mapOr$0cqaybi(take$1x34chv(HELD), 253, (n3: Noisy.Noisy): rt.u8 => { - const _012: rt.u8 = n3.id; + const _013: rt.u8 = n3.id; n3[Symbol.dispose](); - return _012; + return _013; })); rt.localKeyWithBorrowMutPlace(TALLY, (tally2: rt.Place): undefined => { tally2.v = rt.u32WrappingAdd(rt.u32WrappingMul(tally2.v, 3), op as rt.u32); @@ -228,9 +228,9 @@ export function locals(data: rt.ByteSlice, out: rt.ByteVec): void { const _518: rt.RefCell = rt.refCellBorrowMut(held4); const taken = _518.value; _518.value = undefined; - const _022: Noisy.Noisy | undefined = taken; + const _024: Noisy.Noisy | undefined = taken; rt.refMutRelease(_518); - return _022; + return _024; })(HELD.get())); serial(true); const _208: rt.Mutex = rt.mutexLock(log.value); diff --git a/ts/fixtures/lang/objects/expected/objects.ts b/ts/fixtures/lang/objects/expected/objects.ts index 39c0a43a8..c8dbddc3b 100644 --- a/ts/fixtures/lang/objects/expected/objects.ts +++ b/ts/fixtures/lang/objects/expected/objects.ts @@ -452,9 +452,9 @@ export function objects(data: rt.ByteSlice, out: rt.ByteVec): void { const weak: rt.Weak = new rt.Weak(); relink(weak, two); rt.byteVecPush(out, option_mapOr$1q3ff8g(rt.weakUpgrade(weak), 238, (a3: rt.Arc): rt.u8 => { - const _04: rt.u8 = a3.value; + const _05: rt.u8 = a3.value; a3[Symbol.dispose](); - return _04; + return _05; })); rt.byteVecPush(out, two.weak & 0xff); const a: Window.Window = Window.withStart(Window.default$Default(), by); diff --git a/ts/fixtures/lang/orders/expected/orders.ts b/ts/fixtures/lang/orders/expected/orders.ts index aa7ba1c57..f19e440d3 100644 --- a/ts/fixtures/lang/orders/expected/orders.ts +++ b/ts/fixtures/lang/orders/expected/orders.ts @@ -223,8 +223,8 @@ export function sorted(data: rt.ByteSlice, out: rt.ByteVec): void { return rt.u8Div(a5, 4) <= rt.u8Div(b8, 4); }) ? 1 : 0, rt.iterIsSortedBy(rt.iterMap(rt.iterSlice(rt.byteSliceView(_12)), (_25: rt.u8): rt.u8 => { return rt.u8Rem(_25, 8); - }), rt.le) ? 1 : 0, rt.iterIsSortedBy(rt.iterSlice(rt.byteSliceView(_12)), rt.le) ? 1 : 0, rt.sliceIsSorted(strings, rt.cmpLe(rt.cmpStr)) ? 1 : 0, rt.iterIsSortedBy(rt.iterMap(rt.iterSlice(strings), (a06: string): rt.usize => { - return rt.stringLen(a06); + }), rt.le) ? 1 : 0, rt.iterIsSortedBy(rt.iterSlice(rt.byteSliceView(_12)), rt.le) ? 1 : 0, rt.sliceIsSorted(strings, rt.cmpLe(rt.cmpStr)) ? 1 : 0, rt.iterIsSortedBy(rt.iterMap(rt.iterSlice(strings), (a0: string): rt.usize => { + return rt.stringLen(a0); }), rt.le) ? 1 : 0, rt.iterIsSortedBy(rt.iterMap(rt.iterSlice(rt.byteSliceView(_12)), (_29: rt.u8): rt.f64 => { return (_29 as rt.f64) / 3.0; }), rt.cmpLe(rt.f64PartialCmp)) ? 1 : 0)), undefined, true); @@ -647,8 +647,8 @@ export function tuples(data: rt.ByteSlice, out: rt.ByteVec): void { const _136: [Part.Part, rt.f64] = [part2, fy]; const _132: boolean = rt.cmpTuple<[Part.Part, rt.f64], rt.Ordering | undefined>([Part.partialCmp$cmp_PartialOrd, rt.f64PartialCmp])(_134, _136) === -1; const order_ = rt.cmpTuple<[rt.f64, rt.u8], rt.Ordering | undefined>([rt.f64PartialCmp, rt.cmp])([fx, x] as [rt.f64, rt.u8], [fy, y] as [rt.f64, rt.u8]); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_132, order_ !== undefined && order_ >= 0], (a010: boolean): rt.u8 => { - return a010 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_132, order_ !== undefined && order_ >= 0], (a0: boolean): rt.u8 => { + return a0 ? 1 : 0; })), undefined, true); flush(out); const _146: [Part.Part, rt.u8][] = [[part_, x] as [Part.Part, rt.u8]]; @@ -703,8 +703,8 @@ export function tuples(data: rt.ByteSlice, out: rt.ByteVec): void { rt.iterExtendBytes(out, rt.iterMap(rt.iterSlice(pairs), (p6: [rt.u8, Part.Part]): rt.u8 => { return p6[1].tag; }), undefined, true); - rt.localKeyWithBorrowMut(LOG, (a021: rt.ByteVec): undefined => { - rt.byteVecClear(a021); + rt.localKeyWithBorrowMut(LOG, (a02: rt.ByteVec): undefined => { + rt.byteVecClear(a02); }); const floats: [rt.f64, rt.u8][] = rt.iterToArray(rt.iterMap(rt.iterSlice(rt.byteSliceView(data)), (_26: rt.u8): [rt.f64, rt.u8] => { const b3: rt.u8 = _26; @@ -929,8 +929,8 @@ export function held(data: rt.ByteSlice, out: rt.ByteVec): void { const _100: rt.Result[] = [a]; const _104: rt.Result[] = [b]; const order3 = rt.cmpSlice(result_partialCmp$0spmpix)(_100, _104); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_89, order3 !== undefined && order3 >= 0], (a06: boolean): rt.u8 => { - return a06 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_89, order3 !== undefined && order3 >= 0], (a02: boolean): rt.u8 => { + return a02 ? 1 : 0; })), undefined, true); flush(out); rt.idx(_10[1], 0); @@ -952,8 +952,8 @@ export function held(data: rt.ByteSlice, out: rt.ByteVec): void { const _152: boolean = result_eq$15zrpyn(x, y); const _157: [rt.Result, rt.i32] = [x, 1]; const _159: [rt.Result, rt.i32] = [y, 0]; - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_140, _143, _146, _149, _152, rt.cmpTuple<[rt.Result, rt.i32], rt.Ordering | undefined>([result_partialCmp$0v2kxbo, rt.cmp])(_157, _159) === -1], (a09: boolean): rt.u8 => { - return a09 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_140, _143, _146, _149, _152, rt.cmpTuple<[rt.Result, rt.i32], rt.Ordering | undefined>([result_partialCmp$0v2kxbo, rt.cmp])(_157, _159) === -1], (a03: boolean): rt.u8 => { + return a03 ? 1 : 0; })), undefined, true); rt.idx(_10[1], 0); const _163: rt.Poll = _5(_10[1].data[_10[1].start]); @@ -969,8 +969,8 @@ export function held(data: rt.ByteSlice, out: rt.ByteVec): void { const _205: boolean = poll_partialCmp$1r9dhkr(q, 2) === 1; const _210 = p as rt.Poll | undefined; const _212 = q as rt.Poll | undefined; - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_196, _199, _202, _205, !rt.eqOption(poll_eq$1h9nnoh)(_210, _212)], (a011: boolean): rt.u8 => { - return a011 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_196, _199, _202, _205, !rt.eqOption(poll_eq$1h9nnoh)(_210, _212)], (a04: boolean): rt.u8 => { + return a04 ? 1 : 0; })), undefined, true); rt.byteVecPush(out, order(poll_partialCmp$1fsj76o(x as rt.Poll>, y as rt.Poll>))); } @@ -1000,8 +1000,8 @@ export function held(data: rt.ByteSlice, out: rt.ByteVec): void { rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(order(rt.cmpDeque(Part.partialCmp$cmp_PartialOrd)(d, e)), rt.cmpDeque(Part.cmp$cmp_Ord)(d, e) & 0xff, order(rt.cmpDeque(Part.partialCmp$cmp_PartialOrd)(e, d)))), undefined, true); const _263: boolean = rt.cmpDeque(Part.partialCmp$cmp_PartialOrd)(d, e) === -1; const order7 = rt.cmpDeque(Part.partialCmp$cmp_PartialOrd)(d, e); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_263, order7 !== undefined && order7 >= 0, rt.cmpDeque(Part.partialCmp$cmp_PartialOrd)(e, d) === 1, rt.eqSeq(Part.eq$cmp_PartialEq)(d, e)], (a020: boolean): rt.u8 => { - return a020 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([_263, order7 !== undefined && order7 >= 0, rt.cmpDeque(Part.partialCmp$cmp_PartialOrd)(e, d) === 1, rt.eqSeq(Part.eq$cmp_PartialEq)(d, e)], (a05: boolean): rt.u8 => { + return a05 ? 1 : 0; })), undefined, true); const _280: rt.VecDeque | undefined = d; const _283: rt.VecDeque | undefined = e; @@ -1169,8 +1169,8 @@ export function btrees(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { rt.byteVecPush(out, rt.btreeLen(rt.btreeCollectKeys(rt.btreeNew(Torn.cmp$cmp_Ord) as rt.BTreeSet, rt.iterToArray(rt.iterSlice([]), undefined, 3, true), 3, true, Torn.lt$cmp_PartialOrd, (a7: Torn.Torn, b8: Torn.Torn): boolean => { return !Torn.ne$cmp_PartialEq(a7, b8); })) & 0xff); - const _91: rt.Iter = rt.iterMap(rt.sliceChunks(keys2, 2), (a017: Torn.Torn[]): Torn.Torn[] => { - return rt.vecExact(a017.slice(), 3); + const _91: rt.Iter = rt.iterMap(rt.sliceChunks(keys2, 2), (a0: Torn.Torn[]): Torn.Torn[] => { + return rt.vecExact(a0.slice(), 3); }); rt.iterExtendBytes(out, rt.iterFlatMap(rt.btreeKeys(rt.btreeCollectKeys(rt.btreeNew(rt.cmpSlice(Torn.cmp$cmp_Ord)) as rt.BTreeSet, rt.iterToArray(_91, undefined, 12, true), 12, true, rt.cmpLt(rt.cmpSlice(Torn.partialCmp$cmp_PartialOrd)), rt.eqSlice((a8: Torn.Torn, b9: Torn.Torn): boolean => { return !Torn.ne$cmp_PartialEq(a8, b9); @@ -1202,8 +1202,8 @@ export function btrees(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { rt.btreeExtendKeys(left, _138); const _142: rt.Iter = rt.iterSlice(_129[1]); rt.btreeExtendKeys(right, _142); - rt.localKeyWithBorrowMut(LOG, (a025: rt.ByteVec): undefined => { - rt.byteVecClear(a025); + rt.localKeyWithBorrowMut(LOG, (a02: rt.ByteVec): undefined => { + rt.byteVecClear(a02); }); rt.iterExtendBytes(out, rt.iterMap(rt.btreeKeys(rt.btreeFromSorted(rt.btreeNew(Torn.cmp$cmp_Ord) as rt.BTreeSet, rt.btreeUnion(left, right), (a9: Torn.Torn, b10: Torn.Torn): boolean => { return !Torn.ne$cmp_PartialEq(a9, b10); @@ -1221,13 +1221,13 @@ export function btrees(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { })), (k10: Torn.Torn): rt.u8 => { return k10.tag; }), undefined, true); - rt.iterExtendBytes(out, rt.iterMap(rt.btreeKeys(rt.btreeFromSorted(rt.btreeNew(Torn.cmp$cmp_Ord) as rt.BTreeSet, rt.btreeDifference(left, right), (a20: Torn.Torn, b13: Torn.Torn): boolean => { - return !Torn.ne$cmp_PartialEq(a20, b13); + rt.iterExtendBytes(out, rt.iterMap(rt.btreeKeys(rt.btreeFromSorted(rt.btreeNew(Torn.cmp$cmp_Ord) as rt.BTreeSet, rt.btreeDifference(left, right), (a12: Torn.Torn, b13: Torn.Torn): boolean => { + return !Torn.ne$cmp_PartialEq(a12, b13); })), (k11: Torn.Torn): rt.u8 => { return k11.tag; }), undefined, true); - rt.localKeyWithBorrowMut(LOG, (a034: rt.ByteVec): undefined => { - rt.byteVecClear(a034); + rt.localKeyWithBorrowMut(LOG, (a03: rt.ByteVec): undefined => { + rt.byteVecClear(a03); }); } const apart: Apart.Apart[] = rt.vecFromElem({}, short.length, undefined); diff --git a/ts/fixtures/lang/refs/expected/refs.ts b/ts/fixtures/lang/refs/expected/refs.ts index 2a89ebc29..cf5f97921 100644 --- a/ts/fixtures/lang/refs/expected/refs.ts +++ b/ts/fixtures/lang/refs/expected/refs.ts @@ -1510,21 +1510,21 @@ export function compared(split: rt.u8, dataData: Uint8Array, dataStart: number, const y: rt.f32[] = rt.iterToArray(rt.iterMap(rt.iterSlice(rt.byteSliceView(right)), few), undefined, 4, true); let one: rt.u8 | undefined = rt.byteSliceFirst(rt.byteVecSlice(b)); const _74: boolean = rt.iterEq(rt.iterChain(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterOption(rt.optionAsMut(rt.place(() => one, (value) => one = value)))), rt.iterSliceMut(rt.byteVecView(b)), rt.cellBy(rt.same), true); - rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([rt.iterEq(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSliceMut(rt.byteVecView(b)), rt.cellBy(rt.same), true), !rt.iterEq(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSliceMut(rt.byteVecView(b)), rt.cellBy(rt.same), true), rt.iterLt(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSliceMut(rt.byteVecView(b)), rt.cellBy(rt.cmp)), rt.iterLe(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSliceMut(rt.byteVecView(b)), rt.cellBy(rt.cmp)), rt.iterGt(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSliceMut(rt.byteVecView(b)), rt.cellBy(rt.cmp)), rt.iterGe(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSliceMut(rt.byteVecView(b)), rt.cellBy(rt.cmp)), rt.iterEq(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSlice(rt.byteSliceView(rt.byteVecSlice(b))), (a03: rt.Place, a1: rt.u8): boolean => { - return a03.v === a1; - }, true), !rt.iterEq(rt.iterSlice(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSliceMut(rt.byteVecView(b)), (a04: rt.u8, a12: rt.Place): boolean => { - return a04 === a12.v; - }, true), _74, rt.iterLt(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(b))), rt.iterChain(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterOption(rt.optionAsMut(rt.place(() => one, (value2) => one = value2)))), rt.cellBy(rt.cmp)), rt.iterEq(rt.iterSliceMut(x), rt.iterSliceMut(y), rt.cellBy(rt.same), true), !rt.iterEq(rt.iterSliceMut(x), rt.iterSliceMut(y), rt.cellBy(rt.same), true), rt.iterLt(rt.iterSliceMut(x), rt.iterSliceMut(y), rt.cellBy(rt.f32PartialCmp)), rt.iterLe(rt.iterSliceMut(x), rt.iterSliceMut(y), rt.cellBy(rt.f32PartialCmp)), rt.iterGt(rt.iterSliceMut(x), rt.iterSliceMut(y), rt.cellBy(rt.f32PartialCmp)), rt.iterGe(rt.iterSliceMut(x), rt.iterSliceMut(y), rt.cellBy(rt.f32PartialCmp)), rt.iterEq(rt.iterSlice(x), rt.iterSliceMut(y), (a05: rt.f32, a13: rt.Place): boolean => { - return a05 === a13.v; - }, true), !rt.iterEq(rt.iterSliceMut(x), rt.iterSlice(y), (a06: rt.Place, a14: rt.f32): boolean => { - return a06.v === a14; - }, true)], (a07: boolean): rt.u8 => { - return a07 ? 1 : 0; + rt.iterExtendBytes(out, rt.iterSlice(rt.bytesMap([rt.iterEq(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSliceMut(rt.byteVecView(b)), rt.cellBy(rt.same), true), !rt.iterEq(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSliceMut(rt.byteVecView(b)), rt.cellBy(rt.same), true), rt.iterLt(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSliceMut(rt.byteVecView(b)), rt.cellBy(rt.cmp)), rt.iterLe(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSliceMut(rt.byteVecView(b)), rt.cellBy(rt.cmp)), rt.iterGt(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSliceMut(rt.byteVecView(b)), rt.cellBy(rt.cmp)), rt.iterGe(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSliceMut(rt.byteVecView(b)), rt.cellBy(rt.cmp)), rt.iterEq(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSlice(rt.byteSliceView(rt.byteVecSlice(b))), (a0: rt.Place, a1: rt.u8): boolean => { + return a0.v === a1; + }, true), !rt.iterEq(rt.iterSlice(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSliceMut(rt.byteVecView(b)), (a02: rt.u8, a12: rt.Place): boolean => { + return a02 === a12.v; + }, true), _74, rt.iterLt(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(b))), rt.iterChain(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterOption(rt.optionAsMut(rt.place(() => one, (value2) => one = value2)))), rt.cellBy(rt.cmp)), rt.iterEq(rt.iterSliceMut(x), rt.iterSliceMut(y), rt.cellBy(rt.same), true), !rt.iterEq(rt.iterSliceMut(x), rt.iterSliceMut(y), rt.cellBy(rt.same), true), rt.iterLt(rt.iterSliceMut(x), rt.iterSliceMut(y), rt.cellBy(rt.f32PartialCmp)), rt.iterLe(rt.iterSliceMut(x), rt.iterSliceMut(y), rt.cellBy(rt.f32PartialCmp)), rt.iterGt(rt.iterSliceMut(x), rt.iterSliceMut(y), rt.cellBy(rt.f32PartialCmp)), rt.iterGe(rt.iterSliceMut(x), rt.iterSliceMut(y), rt.cellBy(rt.f32PartialCmp)), rt.iterEq(rt.iterSlice(x), rt.iterSliceMut(y), (a03: rt.f32, a13: rt.Place): boolean => { + return a03 === a13.v; + }, true), !rt.iterEq(rt.iterSliceMut(x), rt.iterSlice(y), (a04: rt.Place, a14: rt.f32): boolean => { + return a04.v === a14; + }, true)], (a05: boolean): rt.u8 => { + return a05 ? 1 : 0; })), undefined, true); - rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(rt.iterCmp(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSliceMut(rt.byteVecView(b)), rt.cellBy(rt.cmp)) & 0xff, rt.iterCmp(rt.iterZip(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSlice(rt.byteSliceView(left)), [false, false]), rt.iterZip(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(b))), rt.iterSlice(rt.byteSliceView(right)), [false, false]), rt.cmpTuple<[rt.Place, rt.u8], rt.Ordering>([rt.cellBy(rt.cmp), rt.cmp])) & 0xff, rt.iterCmp(rt.iterMap(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), (a08: rt.Place): rt.Place | undefined => { - return a08; - }), rt.iterMap(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(b))), (a09: rt.Place): rt.Place | undefined => { - return a09; + rt.iterExtendBytes(out, rt.iterSlice(Uint8Array.of(rt.iterCmp(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSliceMut(rt.byteVecView(b)), rt.cellBy(rt.cmp)) & 0xff, rt.iterCmp(rt.iterZip(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSlice(rt.byteSliceView(left)), [false, false]), rt.iterZip(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(b))), rt.iterSlice(rt.byteSliceView(right)), [false, false]), rt.cmpTuple<[rt.Place, rt.u8], rt.Ordering>([rt.cellBy(rt.cmp), rt.cmp])) & 0xff, rt.iterCmp(rt.iterMap(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), (a06: rt.Place): rt.Place | undefined => { + return a06; + }), rt.iterMap(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(b))), (a07: rt.Place): rt.Place | undefined => { + return a07; }), rt.cmpOption(rt.cellBy(rt.cmp))) & 0xff, order(rt.iterCmp(rt.iterSliceMut(rt.byteSliceView(rt.byteVecSlice(a))), rt.iterSliceMut(rt.byteVecView(b)), rt.cellBy(rt.cmp))), order(rt.iterCmp(rt.iterSliceMut(x), rt.iterSliceMut(y), rt.cellBy(rt.f32PartialCmp))), order(rt.iterCmp(rt.iterZip(rt.iterSliceMut(x), rt.iterSlice(rt.byteVecView(a)), [false, false]), rt.iterZip(rt.iterSliceMut(y), rt.iterSlice(rt.byteVecView(b)), [false, false]), rt.cmpTuple<[rt.Place, rt.u8], rt.Ordering | undefined>([rt.cellBy(rt.f32PartialCmp), rt.cmp]))))), undefined, true); } diff --git a/ts/fixtures/lang/returns/expected/returns.ts b/ts/fixtures/lang/returns/expected/returns.ts index ed3915604..113cb83ce 100644 --- a/ts/fixtures/lang/returns/expected/returns.ts +++ b/ts/fixtures/lang/returns/expected/returns.ts @@ -525,14 +525,12 @@ export function numbers(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void if (!(rt.u8Rem(kind, 2) === 0)) { f = (a02: rt.ByteSlice): rt.Result => { const part11 = lateSelf(a02.data, a02.start, a02.length); - const result3: rt.Result = part11 === undefined ? rt.Err(out$u64.err as returns_Error.Error) : rt.Ok(part11); - return result3; + return part11 === undefined ? rt.Err(out$u64.err as returns_Error.Error) : rt.Ok(part11); }; } else { f = (a0: rt.ByteSlice): rt.Result => { const part10 = big(a0); - const result2: rt.Result = part10 === undefined ? rt.Err(out$u64.err as returns_Error.Error) : rt.Ok(part10); - return result2; + return part10 === undefined ? rt.Err(out$u64.err as returns_Error.Error) : rt.Ok(part10); }; } pushBig(out, f(data)); @@ -633,21 +631,18 @@ export function returns(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void if (!(rt.usizeRem(data.length, 2) === 0)) { f = (a02: rt.ByteSlice): rt.Result<[rt.u64, rt.ByteSlice], returns_Error.Error> => { const part51 = narrow(a02.data, a02.start, a02.length); - const result3: rt.Result<[rt.u64, rt.ByteSlice], returns_Error.Error> = part51 === undefined ? rt.Err(out$tuple2_u64_ref_slice_u8.err as returns_Error.Error) : rt.Ok([part51, new rt.ByteSlice(out$tuple2_u64_ref_slice_u8.p_1Data, out$tuple2_u64_ref_slice_u8.p_1Start, out$tuple2_u64_ref_slice_u8.p_1Len)] as [rt.u64, rt.ByteSlice]); - return result3; + return part51 === undefined ? rt.Err(out$tuple2_u64_ref_slice_u8.err as returns_Error.Error) : rt.Ok([part51, new rt.ByteSlice(out$tuple2_u64_ref_slice_u8.p_1Data, out$tuple2_u64_ref_slice_u8.p_1Start, out$tuple2_u64_ref_slice_u8.p_1Len)] as [rt.u64, rt.ByteSlice]); }; } else { f = (a0: rt.ByteSlice): rt.Result<[rt.u64, rt.ByteSlice], returns_Error.Error> => { const part50 = wide(a0.data, a0.start, a0.length); - const result2: rt.Result<[rt.u64, rt.ByteSlice], returns_Error.Error> = part50 === undefined ? rt.Err(out$tuple2_u64_ref_slice_u8.err as returns_Error.Error) : rt.Ok([part50, new rt.ByteSlice(out$tuple2_u64_ref_slice_u8.p_1Data, out$tuple2_u64_ref_slice_u8.p_1Start, out$tuple2_u64_ref_slice_u8.p_1Len)] as [rt.u64, rt.ByteSlice]); - return result2; + return part50 === undefined ? rt.Err(out$tuple2_u64_ref_slice_u8.err as returns_Error.Error) : rt.Ok([part50, new rt.ByteSlice(out$tuple2_u64_ref_slice_u8.p_1Data, out$tuple2_u64_ref_slice_u8.p_1Start, out$tuple2_u64_ref_slice_u8.p_1Len)] as [rt.u64, rt.ByteSlice]); }; } pushNumber(out, f(data)); for (const _74 of rt.iterToArray(rt.iterMap(rt.iterSlice([data, rt.byteSliceRange(data, rt.min(data.length, 3))]), (a03: rt.ByteSlice): rt.Result<[rt.u64, rt.ByteSlice], returns_Error.Error> => { const part53 = count(a03.data, a03.start, a03.length); - const result4: rt.Result<[rt.u64, rt.ByteSlice], returns_Error.Error> = part53 === undefined ? rt.Err(out$tuple2_u64_ref_slice_u8.err as returns_Error.Error) : rt.Ok([part53, new rt.ByteSlice(out$tuple2_u64_ref_slice_u8.p_1Data, out$tuple2_u64_ref_slice_u8.p_1Start, out$tuple2_u64_ref_slice_u8.p_1Len)] as [rt.u64, rt.ByteSlice]); - return result4; + return part53 === undefined ? rt.Err(out$tuple2_u64_ref_slice_u8.err as returns_Error.Error) : rt.Ok([part53, new rt.ByteSlice(out$tuple2_u64_ref_slice_u8.p_1Data, out$tuple2_u64_ref_slice_u8.p_1Start, out$tuple2_u64_ref_slice_u8.p_1Len)] as [rt.u64, rt.ByteSlice]); }), undefined, 16, true)) { pushNumber(out, _74); } diff --git a/ts/fixtures/lang/sorts/expected/lib.ts b/ts/fixtures/lang/sorts/expected/lib.ts index 3d8e272f3..0895e0b1c 100644 --- a/ts/fixtures/lang/sorts/expected/lib.ts +++ b/ts/fixtures/lang/sorts/expected/lib.ts @@ -10,8 +10,8 @@ import { sorts, disorders, btrees } from "./sorts.ts"; export function cases(): [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined][] { return [["sorts::sorts", (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec): undefined => { sorts(a0, a1.data, a1.start, a1.length, a2); - }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["sorts::disorders", disorders as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["sorts::btrees", (a03: rt.u8, a13: rt.ByteSlice, a23: rt.ByteVec): undefined => { - btrees(a03, a13.data, a13.start, a13.length, a23); + }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["sorts::disorders", disorders as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["sorts::btrees", (a02: rt.u8, a12: rt.ByteSlice, a22: rt.ByteVec): undefined => { + btrees(a02, a12.data, a12.start, a12.length, a22); }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined]]; } diff --git a/ts/fixtures/lang/strs/expected/lib.ts b/ts/fixtures/lang/strs/expected/lib.ts index 386762ccd..6f6e0d8b4 100644 --- a/ts/fixtures/lang/strs/expected/lib.ts +++ b/ts/fixtures/lang/strs/expected/lib.ts @@ -8,10 +8,10 @@ import { strs, slices, edits, parses, iters, drains, hinted, gets } from "./strs * their count, so a case added at the end moves no other. */ export function cases(): [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined][] { - return [["strs::strs", strs as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["strs::slices", slices as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["strs::edits", (a03: rt.u8, a13: rt.ByteSlice, a23: rt.ByteVec): undefined => { - edits(a03, a13.data, a13.start, a13.length, a23); - }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["strs::parses", parses as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["strs::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], ["strs::drains", (a06: rt.u8, a16: rt.ByteSlice, a26: rt.ByteVec): undefined => { - drains(a06, a16.data, a16.start, a16.length, a26); + return [["strs::strs", strs as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["strs::slices", slices as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["strs::edits", (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec): undefined => { + edits(a0, a1.data, a1.start, a1.length, a2); + }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["strs::parses", parses as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["strs::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], ["strs::drains", (a02: rt.u8, a12: rt.ByteSlice, a22: rt.ByteVec): undefined => { + drains(a02, a12.data, a12.start, a12.length, a22); }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["strs::hinted", hinted as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["strs::gets", gets as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined]]; } diff --git a/ts/fixtures/lang/zeros/expected/lib.ts b/ts/fixtures/lang/zeros/expected/lib.ts index 04b8fae62..d539567de 100644 --- a/ts/fixtures/lang/zeros/expected/lib.ts +++ b/ts/fixtures/lang/zeros/expected/lib.ts @@ -18,8 +18,8 @@ export function drop$zeros_Lock_zeros_Loud(_1: Lock.Lock): void { * their count, so a case added at the end moves no other. */ export function cases(): [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined][] { - return [["zeros::zeros", zeros 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", keys as (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], ["zeros::writes", (a05: rt.u8, a15: rt.ByteSlice, a25: rt.ByteVec): undefined => { - writes(a05, a15.data, a15.start, a15.length, a25); + return [["zeros::zeros", zeros 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", keys as (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], ["zeros::writes", (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec): undefined => { + writes(a0, a1.data, a1.start, a1.length, a2); }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined]]; } diff --git a/ts/fixtures/stock/expected/buf.ts b/ts/fixtures/stock/expected/buf.ts index d01d211cc..5642610ef 100644 --- a/ts/fixtures/stock/expected/buf.ts +++ b/ts/fixtures/stock/expected/buf.ts @@ -245,8 +245,8 @@ export function read$buf_Pieces(buf: Pieces.Pieces, n: rt.usize): rt.u128 { }; const _4: rt.usize = rt.usizeRem(n, 19); if (_4 === 15) { - const part7 = result_map$0hs8st9(rt.bufTryGet(buf, 2, false, rt.u16FromBeBytes, Pieces.remaining$bytes_Buf, Pieces.chunk$bytes_Buf, Pieces.advance$bytes_Buf as (a0: Pieces.Pieces, a1: rt.usize) => undefined, Pieces.copyToSlice$bytes_Buf as (a0: Pieces.Pieces, a1: rt.ByteSlice) => undefined), (a046: rt.u16): rt.u128 => { - return a046 as rt.u128; + const part7 = result_map$0hs8st9(rt.bufTryGet(buf, 2, false, rt.u16FromBeBytes, Pieces.remaining$bytes_Buf, Pieces.chunk$bytes_Buf, Pieces.advance$bytes_Buf as (a0: Pieces.Pieces, a1: rt.usize) => undefined, Pieces.copyToSlice$bytes_Buf as (a0: Pieces.Pieces, a1: rt.ByteSlice) => undefined), (a02: rt.u16): rt.u128 => { + return a02 as rt.u128; }); return _3(part7); } @@ -263,8 +263,8 @@ export function read$buf_Pieces(buf: Pieces.Pieces, n: rt.usize): rt.u128 { if (_4 === 18) { const part3: rt.u8 | undefined = Pieces.tryGetU8$bytes_Buf(buf); const err: TryGetError.TryGetError | undefined = part3 === undefined ? out$u8.err as TryGetError.TryGetError : undefined; - const part4 = result_map$01kzrm1((err !== undefined ? rt.Err(err as TryGetError.TryGetError) : rt.Ok(part3 as rt.u8)) as rt.Result, (a033: rt.u8): rt.u128 => { - return a033 as rt.u128; + const part4 = result_map$01kzrm1((err !== undefined ? rt.Err(err as TryGetError.TryGetError) : rt.Ok(part3 as rt.u8)) as rt.Result, (a0: rt.u8): rt.u128 => { + return a0 as rt.u128; }); return _3(part4); } @@ -330,8 +330,8 @@ export function read$buf_Provided(buf: Provided.Provided, n: rt.usize): rt.u128 }; const _4: rt.usize = rt.usizeRem(n, 19); if (_4 === 15) { - const part7 = result_map$0hs8st9(rt.bufTryGet(buf, 2, false, rt.u16FromBeBytes, Provided.remaining$bytes_Buf, Provided.chunk$bytes_Buf, Provided.advance$bytes_Buf as (a0: Provided.Provided, a1: rt.usize) => undefined, Provided.copyToSlice$bytes_Buf as (a0: Provided.Provided, a1: rt.ByteSlice) => undefined), (a046: rt.u16): rt.u128 => { - return a046 as rt.u128; + const part7 = result_map$0hs8st9(rt.bufTryGet(buf, 2, false, rt.u16FromBeBytes, Provided.remaining$bytes_Buf, Provided.chunk$bytes_Buf, Provided.advance$bytes_Buf as (a0: Provided.Provided, a1: rt.usize) => undefined, Provided.copyToSlice$bytes_Buf as (a0: Provided.Provided, a1: rt.ByteSlice) => undefined), (a02: rt.u16): rt.u128 => { + return a02 as rt.u128; }); return _3(part7); } @@ -348,8 +348,8 @@ export function read$buf_Provided(buf: Provided.Provided, n: rt.usize): rt.u128 if (_4 === 18) { const part3: rt.u8 | undefined = Provided.tryGetU8$bytes_Buf(buf); const err: TryGetError.TryGetError | undefined = part3 === undefined ? out$u8.err as TryGetError.TryGetError : undefined; - const part4 = result_map$01kzrm1((err !== undefined ? rt.Err(err as TryGetError.TryGetError) : rt.Ok(part3 as rt.u8)) as rt.Result, (a033: rt.u8): rt.u128 => { - return a033 as rt.u128; + const part4 = result_map$01kzrm1((err !== undefined ? rt.Err(err as TryGetError.TryGetError) : rt.Ok(part3 as rt.u8)) as rt.Result, (a0: rt.u8): rt.u128 => { + return a0 as rt.u128; }); return _3(part4); } @@ -633,8 +633,8 @@ export function read$bytes_buf_Take_bytes_Bytes(buf: Take.Take, n: }; const _4: rt.usize = rt.usizeRem(n, 19); if (_4 === 15) { - const part7 = result_map$0hs8st9(rt.bufTryGet(buf, 2, false, rt.u16FromBeBytes, Take.remaining$bytes_Buf_bytes_Bytes, Take.chunk$bytes_Buf_bytes_Bytes, Take.advance$bytes_Buf_bytes_Bytes as (a0: Take.Take, a1: rt.usize) => undefined, Take.copyToSlice$bytes_Buf_bytes_Bytes as (a0: Take.Take, a1: rt.ByteSlice) => undefined), (a046: rt.u16): rt.u128 => { - return a046 as rt.u128; + const part7 = result_map$0hs8st9(rt.bufTryGet(buf, 2, false, rt.u16FromBeBytes, Take.remaining$bytes_Buf_bytes_Bytes, Take.chunk$bytes_Buf_bytes_Bytes, Take.advance$bytes_Buf_bytes_Bytes as (a0: Take.Take, a1: rt.usize) => undefined, Take.copyToSlice$bytes_Buf_bytes_Bytes as (a0: Take.Take, a1: rt.ByteSlice) => undefined), (a02: rt.u16): rt.u128 => { + return a02 as rt.u128; }); return _3(part7); } @@ -651,8 +651,8 @@ export function read$bytes_buf_Take_bytes_Bytes(buf: Take.Take, n: if (_4 === 18) { const part3: rt.u8 | undefined = Take.tryGetU8$bytes_Buf_bytes_Bytes(buf); const err: TryGetError.TryGetError | undefined = part3 === undefined ? out$u8.err as TryGetError.TryGetError : undefined; - const part4 = result_map$01kzrm1((err !== undefined ? rt.Err(err as TryGetError.TryGetError) : rt.Ok(part3 as rt.u8)) as rt.Result, (a033: rt.u8): rt.u128 => { - return a033 as rt.u128; + const part4 = result_map$01kzrm1((err !== undefined ? rt.Err(err as TryGetError.TryGetError) : rt.Ok(part3 as rt.u8)) as rt.Result, (a0: rt.u8): rt.u128 => { + return a0 as rt.u128; }); return _3(part4); } diff --git a/ts/fixtures/stock/expected/harness.ts b/ts/fixtures/stock/expected/harness.ts index 38d57564d..dee338c2f 100644 --- a/ts/fixtures/stock/expected/harness.ts +++ b/ts/fixtures/stock/expected/harness.ts @@ -14,24 +14,24 @@ export function cases(): [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefine slices(a0.data, a0.start, a0.length, a1); }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["made", (a02: rt.ByteSlice, a12: rt.ByteVec): undefined => { made(a02.data, a02.start, a02.length, a12); - }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["events", events as (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["random", (a04: rt.ByteSlice, a14: rt.ByteVec): undefined => { - random(a04.data, a04.start, a04.length, a14); - }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["buf::bytes_mut", bytesMut as (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["buf::reads", (a06: rt.ByteSlice, a16: rt.ByteVec): undefined => { - reads(a06.data, a06.start, a06.length, a16); - }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["buf::writes", (a07: rt.ByteSlice, a17: rt.ByteVec): undefined => { - writes(a07.data, a07.start, a07.length, a17); - }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["buf::edits", (a08: rt.ByteSlice, a18: rt.ByteVec): undefined => { - edits(a08.data, a08.start, a08.length, a18); - }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["buf::reserves", (a09: rt.ByteSlice, a19: rt.ByteVec): undefined => { - reserves(a09.data, a09.start, a09.length, a19); - }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["buf::dyns", (a010: rt.ByteSlice, a110: rt.ByteVec): undefined => { - dyns(a010.data, a010.start, a010.length, a110); - }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["maps::map", maps_map as (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["maps::table", (a012: rt.ByteSlice, a112: rt.ByteVec): undefined => { - table(a012.data, a012.start, a012.length, a112); - }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["maps::capacity", (a013: rt.ByteSlice, a113: rt.ByteVec): undefined => { - capacity(a013.data, a013.start, a013.length, a113); - }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["maps::linked", linked as (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["maps::linked_iters", (a015: rt.ByteSlice, a115: rt.ByteVec): undefined => { - linkedIters(a015.data, a015.start, a015.length, a115); + }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["events", events as (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["random", (a03: rt.ByteSlice, a13: rt.ByteVec): undefined => { + random(a03.data, a03.start, a03.length, a13); + }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["buf::bytes_mut", bytesMut as (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["buf::reads", (a04: rt.ByteSlice, a14: rt.ByteVec): undefined => { + reads(a04.data, a04.start, a04.length, a14); + }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["buf::writes", (a05: rt.ByteSlice, a15: rt.ByteVec): undefined => { + writes(a05.data, a05.start, a05.length, a15); + }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["buf::edits", (a06: rt.ByteSlice, a16: rt.ByteVec): undefined => { + edits(a06.data, a06.start, a06.length, a16); + }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["buf::reserves", (a07: rt.ByteSlice, a17: rt.ByteVec): undefined => { + reserves(a07.data, a07.start, a07.length, a17); + }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["buf::dyns", (a08: rt.ByteSlice, a18: rt.ByteVec): undefined => { + dyns(a08.data, a08.start, a08.length, a18); + }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["maps::map", maps_map as (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["maps::table", (a09: rt.ByteSlice, a19: rt.ByteVec): undefined => { + table(a09.data, a09.start, a09.length, a19); + }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["maps::capacity", (a010: rt.ByteSlice, a110: rt.ByteVec): undefined => { + capacity(a010.data, a010.start, a010.length, a110); + }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["maps::linked", linked as (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined], ["maps::linked_iters", (a011: rt.ByteSlice, a111: rt.ByteVec): undefined => { + linkedIters(a011.data, a011.start, a011.length, a111); }] as [string, (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined]]; } diff --git a/ts/fixtures/task/expected/drops/objects.ts b/ts/fixtures/task/expected/drops/objects.ts index b352bf48c..6a74d5ce2 100644 --- a/ts/fixtures/task/expected/drops/objects.ts +++ b/ts/fixtures/task/expected/drops/objects.ts @@ -121,9 +121,9 @@ export function shared(log: Log.Log, id: rt.u32): void { rt.arcDrop(wrap, lib_drop$drops_Wrap_u32); rt.dropAll(parts); const part3 = option_mapOr$0lu2pr2(rt.weakUpgrade(weak), 0, (p2: rt.Arc): rt.u32 => { - const _03: rt.u32 = p2.value.id$Part(); + const _04: rt.u32 = p2.value.id$Part(); p2[Symbol.dispose](); - return _03; + return _04; }); const args8: rt.Fmt[] = [(f: rt.Formatter) => rt.u32Display(part3, f)]; Log.note(log, rt.fmtFormat(["weak ", args8[0]])); diff --git a/ts/src/lower/body.rs b/ts/src/lower/body.rs index 05d799ffe..48436603f 100644 --- a/ts/src/lower/body.rs +++ b/ts/src/lower/body.rs @@ -334,33 +334,32 @@ impl<'b, 'a, 'tcx> Body<'b, 'a, 'tcx> { pub fn fn_value(&mut self, def_id: rustc_hir::def_id::DefId, gargs: GenericArgsRef<'tcx>, span: Span) -> Expr { let tcx = self.t.tcx; let sig = self.t.sig(def_id, gargs); - let names: Vec = (0..sig.inputs().len()).map(|i| self.fresh(&format!("a{i}"))).collect(); - // std's mappings take a `&mut` they declare that is an `rt.Place` as what it points - // at, as a call's operands pass it. - let pointees = match self.t.mapped(def_id, gargs) { - true => super::pointer::pointees(self.t, def_id, gargs), - false => Vec::new(), - }; - let values: Vec = std::iter::zip(&names, sig.inputs()) - .enumerate() - .map( - |(i, (name, &ty))| match pointees.get(i) == Some(&true) && self.t.place_pointee(ty).is_some() { - true => Expr::ident(name).member("v"), - false => Expr::ident(name), - }, - ) - .collect(); + // A constructor makes its value, as a call of it does. + if matches!(tcx.def_kind(def_id), rustc_hir::def::DefKind::Ctor(..)) { + let names: Vec = (0..sig.inputs().len()).map(|i| self.fresh(&format!("a{i}"))).collect(); + let mut body = Vec::new(); + let made = self.call_def(def_id, gargs, names.iter().map(Expr::ident).collect(), span, &mut body); + body.push(StmtKind::Return(Some(made.typed())).at(None)); + let params = std::iter::zip(names, sig.inputs()) + .map(|(name, ty)| Param { + name, + ty: Some(self.t.ty(*ty, span)), + }) + .collect(); + let ret = self.t.ty(sig.output(), span); + return Expr::Arrow(params, ret, body); + } // A binding's export, or a function whose body translates, is named directly. - if !matches!(tcx.def_kind(def_id), rustc_hir::def::DefKind::Ctor(..)) - && let Ok(Some(instance)) = Instance::try_resolve(tcx, self.t.typing_env_pub(), def_id, gargs) - { + if let Ok(Some(instance)) = Instance::try_resolve(tcx, self.t.typing_env_pub(), def_id, gargs) { let sym = match self.t.bound_fn(instance, span) { Some(sym) => Some(sym), - // One that takes byte slices as their parts, or hands back its `Ok`'s, is wrapped - // to take and return them whole. + // One that takes byte slices as their parts, hands back its `Ok`'s parts, or is a + // `next`, which returns an item or `rt.DONE`, is wrapped to take and return what + // a call does. None => (self.t.lowers(self.t.typing_env_pub(), instance) && self.t.parted(instance).is_empty() - && self.t.slotted(instance).is_none()) + && self.t.slotted(instance).is_none() + && !super::iter::is_next(tcx, instance.def_id())) .then(|| self.t.callee(instance, span)), }; if let Some(sym) = sym { @@ -370,25 +369,8 @@ impl<'b, 'a, 'tcx> Body<'b, 'a, 'tcx> { }; } } - let mut body = Vec::new(); - let call = self.call_def(def_id, gargs, values, span, &mut body); - body.push( - match sig.output().is_unit() { - true => StmtKind::Expr(call), - false => StmtKind::Return(Some(call.typed())), - } - .at(None), - ); - let params = names - .into_iter() - .zip(sig.inputs()) - .map(|(name, ty)| { - let ty = self.t.ty(*ty, span); - Param { name, ty: Some(ty) } - }) - .collect(); - let ret = self.t.ty(sig.output(), span); - Expr::Arrow(params, ret, body) + // Any other, std's included, is its reify shim, which calls it as written calls do. + super::mir::fn_value(self, def_id, gargs, span) } } diff --git a/ts/src/lower/mir/call.rs b/ts/src/lower/mir/call.rs index 5a203ab0f..2cda95d6e 100644 --- a/ts/src/lower/mir/call.rs +++ b/ts/src/lower/mir/call.rs @@ -260,7 +260,17 @@ impl<'m, 'b, 'a, 'tcx> Fx<'m, 'b, 'a, 'tcx> { } }; if let ty::FnDef(inner, inner_args) = *callee_ty.peel_refs().kind() { - return self.b.call_def(inner, inner_args.skip_binder(), values, span, out); + let inner_args = inner_args.skip_binder(); + // std's that takes a `&mut` is called as its value, which lowers the call as a + // written one does, given the `&mut`s as they are passed. + if self.b.t.mapped(inner, inner_args) + && !matches!(tcx.def_kind(inner), rustc_hir::def::DefKind::Ctor(..)) + && (self.b.t.sig(inner, inner_args).inputs().iter()) + .any(|i| matches!(i.kind(), ty::Ref(_, _, rustc_ast::Mutability::Mut))) + { + return self.b.fn_value(inner, inner_args, span).call(values); + } + return self.b.call_def(inner, inner_args, values, span, out); } // A `&mut` to a function JS copies, such as a box of one, or to a reference to one, as // std's impls for a `&mut` and a box forward through, is its place: call what is diff --git a/ts/src/lower/mir/mod.rs b/ts/src/lower/mir/mod.rs index 4407424fa..3ace9fd18 100644 --- a/ts/src/lower/mir/mod.rs +++ b/ts/src/lower/mir/mod.rs @@ -80,6 +80,62 @@ pub fn function<'a, 'tcx>(t: &mut Translator<'a, 'tcx>, instance: Instance<'tcx> }) } +/// A function as a value: an arrow whose body is its reify shim, which calls it as a +/// written call does, so std's that replace what a `&mut` borrows, such as `mem::take`, +/// lower as their calls do. Its spans are `span`'s, where the function is named. +pub fn fn_value<'tcx>( + b: &mut Body<'_, '_, 'tcx>, + def_id: rustc_hir::def_id::DefId, + args: ty::GenericArgsRef<'tcx>, + span: Span, +) -> Expr { + let tcx = b.t.tcx; + let shim = Instance { + def: ty::InstanceKind::Shim(ty::ShimKind::Reify(def_id, None)), + args, + }; + let mut mir = shim.instantiate_mir_and_normalize_erasing_regions( + tcx, + b.t.typing_env_pub(), + EarlyBinder::bind(tcx, tcx.instance_mir(shim.def).clone()), + ); + mir.span = span; + for decl in mir.local_decls.iter_mut() { + decl.source_info.span = span; + } + // Its arguments are named `a0` on, as debug info names a function's. + let args: Vec = mir.args_iter().collect(); + for (i, local) in args.into_iter().enumerate() { + mir.var_debug_info.push(mir::VarDebugInfo { + name: rustc_span::Symbol::intern(&format!("a{i}")), + source_info: mir.local_decls[local].source_info, + composite: None, + value: mir::VarDebugInfoContents::Place(local.into()), + argument_index: Some(i as u16 + 1), + }); + } + for block in mir.basic_blocks.as_mut() { + for stmt in &mut block.statements { + stmt.source_info.span = span; + } + let term = block.terminator_mut(); + term.source_info.span = span; + if let TerminatorKind::Call { fn_span, .. } = &mut term.kind { + *fn_span = span; + } + } + // The shim's parameters are whole, whatever the body it is in takes. + let parted = std::mem::take(&mut b.parted); + let slotted = b.slotted.take(); + let mut fx = Fx::new(b, &mir, Env::Plain, span); + let params = fx.params(); + let body = fx.lower(); + b.parted = parted; + b.slotted = slotted; + let ret = b.t.ty(mir.return_ty(), span); + Expr::Arrow(params, ret, body) +} + /// The MIR of `instance`, with its generic arguments in place. fn instance_mir<'tcx>(t: &mut Translator<'_, 'tcx>, instance: Instance<'tcx>, span: Span) -> Option> { let tcx = t.tcx; @@ -311,7 +367,7 @@ pub struct Fx<'m, 'b, 'a, 'tcx> { assigned: IndexVec, span: Span, pub labels: u32, - /// Whether this is an `Iterator::next`, which returns an item or `rt.DONE`. + /// Whether this is an `Iterator::next`'s body, which returns an item or `rt.DONE`. next: bool, /// Blocks whose only statement is `unreachable`. unreachable: FxHashSet, @@ -434,7 +490,9 @@ impl<'m, 'b, 'a, 'tcx> Fx<'m, 'b, 'a, 'tcx> { assigned: IndexVec::from_elem_n(false, n), span, labels: 0, - next: crate::lower::iter::is_next(tcx, mir.source.def_id()), + // A shim of `next`, such as its value's, returns the `Option` its callers take. + next: matches!(mir.source.instance, ty::InstanceKind::Item(_)) + && crate::lower::iter::is_next(tcx, mir.source.def_id()), unreachable: FxHashSet::default(), rereadable_parts: None, redirect: FxHashMap::default(),