diff --git a/quest/m2/README.md b/quest/m2/README.md index 372185fcc..49eed83c9 100644 --- a/quest/m2/README.md +++ b/quest/m2/README.md @@ -28,7 +28,6 @@ The fork's feature quests folded into the [exporter](/quest/m1/ffi-export/README - [Byte slices without objects](/quest/m2/ts-byte-views/README.md) - reading through a translated cursor allocates no object per read - [Async in the TypeScript translator](/quest/m2/ts-async.md) - moq-net's and kio's async code translates with Rust's lazy futures -- [Shared ownership](/quest/m2/ts-shared.md) - `Arc`/`Rc`/`Weak` keep exact counts, and locks and atomics become plain values - [Translate moq-net's model to TypeScript](/quest/m2/ts-model/README.md) - the model translates with kio, moq-clock, and moq-pattern, for moq to compare against WASM - [Waiting: Swift 6.4 in nixpkgs-unstable](/quest/m2/uniffi-swift-arm.md) - the nightly UniFFI fixtures move back to arm - [Waiting: ubrn reads UniFFI 0.32](/quest/m2/ubrn-release.md) - the binding benchmark's browser runner pins a ubrn release, not an open PR diff --git a/quest/m2/ts-model/README.md b/quest/m2/ts-model/README.md index af15a9765..b5d04dfb2 100644 --- a/quest/m2/ts-model/README.md +++ b/quest/m2/ts-model/README.md @@ -46,7 +46,6 @@ Public API: the translator's output for moq-net's model. ## Required -- [Shared ownership](/quest/m2/ts-shared.md) - kio's waiters are `Arc`/`Weak` with observable counts, and its atomics and locks are plain values - [The rest of std the model reaches](/quest/m2/ts-model/std-rest.md) - `Vec` and `VecDeque` capacity - [hashbrown as the runtime's map](/quest/m2/ts-model/hashbrown.md) - hashlink's `hashbrown` tables translate as `rt.HashMap`, with std's capacity - [Async in the TypeScript translator](/quest/m2/ts-async.md) - kio's producers and consumers are futures diff --git a/quest/m2/ts-shared.md b/quest/m2/ts-shared.md deleted file mode 100644 index 8b8ab0eca..000000000 --- a/quest/m2/ts-shared.md +++ /dev/null @@ -1,44 +0,0 @@ -# [M] Shared ownership in the TypeScript translator - -## Goal - -[rust2-ts](/ts/README.md) translates `Arc`, `Rc`, and `Weak` with Rust's exact -counts: `strong_count`, `weak_count`, and `upgrade` match native, and the last -strong drop runs `Drop` where Rust runs it. `Mutex`, `RwLock`, atomics, -`OnceLock`, `OnceCell`, `Cell`, and `RefCell` translate as the single-threaded -values they are in JS, proven by differential tests. - -## Plan - -Decided with the maintainer on 2026-10-23: deterministic reference counts in -`rt.ts`, not GC-backed `WeakRef`. kio's `WaiterList` frees slots when -`Weak::upgrade` fails and reads `weak_count`, so drop timing is observable. - -The async spike ([#16](https://github.com/moq-dev/rust2/pull/16)) landed what its -kio-shaped fixture needs, in `rt/task.ts`: `rt.Arc`, an `Arc` or an `Rc`, counts -strong and weak references and drops its value with the last strong one, `rt.Weak` -upgrades while one is left, and `rt.Mutex` is its own guard, which a lock gives as -`Ok`: the translator aborts on panic, as wasm32 does, so nothing poisons a mutex. A -guard's drop unlocks it, `try_lock` while held gives `WouldBlock`, and a re-entrant -`lock` panics with wasm32's message. `new_cyclic` gives its function a `Weak` that -upgrades once the function returns. `rt.Atomic` holds a `bool` or an integer, and its -operations check their orderings as std does. `rt.OnceCell` and `rt.OnceLock` hold -their `Option`, and a `OnceLock` initialized from within its own initialization panics as wasm32's does; -their `Clone`, `Debug`, `get_mut`, and `get_or_try_init` are still refused. -`rt.Cell` is the place that holds its value. `rt.RefCell`, a `RefCell` or an `RwLock`, -is its own guard and counts its borrows: a conflicting borrow panics, and a conflicting -lock aborts, each with wasm32's message. Their `Clone`, `get_mut`, `into_inner`, -`try_borrow`, `Ref::map`, and `Ref::clone` are still refused. -A `thread_local!` key is an `rt.LocalKey`, a module's value that makes its value on -first use, as wasm32's `LazyStorage` does, and never drops it. A `static` atomic is a -module's value too, an `rt.Atomic` of the value the static's memory starts with. -Left: the refused methods above. - -- `Send` and `Sync` bounds have no meaning in JS; accept them. -- The counts cost the async handoff at most 3% on the [TS benchmark](/ts/README.md#bench), - within its A/A noise. On 2026-10-31, a hand-edited translation without `Weak`'s count - and without the clone and drop around `WaiterList::wake`'s `upgrade`, which the fixture - never observes, timed 0.99x the translation in Node and Chrome and 0.97x in Bun and - Firefox, the geometric mean over 3 depths and 3 runs, whose A/A gaps spanned 0.93-1.12. - -Public API: the translator's output for shared and interior-mutable types. diff --git a/quest/m3/README.md b/quest/m3/README.md index aa58a1f40..c5b64b215 100644 --- a/quest/m3/README.md +++ b/quest/m3/README.md @@ -33,6 +33,7 @@ generic std gap is planned here even when moq never calls it. - [ptr::replace whose result nothing reads](/quest/m3/ts-ptr-replace-unread.md) - `ptr::replace` with its result discarded type-checks - [std's sorts call their tests in std's order](/quest/m3/ts-sort-order.md) - `slice::sort` and a B-tree's `collect` call `lt` or `cmp` as std's driftsort does past 16 elements - [A B-tree's searches call Ord as std's do](/quest/m3/ts-btree-search-order.md) - a B-tree's lookups and inserts call a key's own `Ord` in std's order and number +- [The rest of a guard's maps](/quest/m3/ts-guard-maps.md) - `RefMut::map`, the guards' `filter_map` and `map_split`, and an `RwLock` guard's `map` translate - [A str's checked and inclusive parts](/quest/m3/ts-str-get.md) - `str::get` and indexing a `str` by `a..=b` or `..=b` translate - [The rest of a boxed slice's impls](/quest/m3/ts-boxed-slice-rest.md) - `clone_from`, `AsRef`, `AsMut`, `TryFrom` into a boxed array, and `Box` into bytes translate for boxed slices - [A reversed zip's per-pair cost](/quest/m3/ts-zip-rev-overhead.md) - a reversed by-index zip costs per pair what a forward one does, or the gap is explained diff --git a/quest/m3/ts-bytes-capacity.md b/quest/m3/ts-bytes-capacity.md index 3b4827e1f..ea29eb887 100644 --- a/quest/m3/ts-bytes-capacity.md +++ b/quest/m3/ts-bytes-capacity.md @@ -18,7 +18,7 @@ or taken from a `Bytes`, `reserve` throws a `rust2-ts:` error past 512 MiB, coun the handle read past, where `bytes`' panic, or its growing instead, depends on which handles dropped. Exact capacity removes that limit. -- Count the live handles of a storage, as [shared ownership](/quest/m2/ts-shared.md) counts +- Count the live handles of a storage, as `rt.Arc` counts an `Arc`'s, which makes a `Bytes` a value that drops. - Measure the count's cost on the codec's [TS benchmark](/ts/README.md#bench). diff --git a/quest/m3/ts-guard-maps.md b/quest/m3/ts-guard-maps.md new file mode 100644 index 000000000..0d5d42d68 --- /dev/null +++ b/quest/m3/ts-guard-maps.md @@ -0,0 +1,16 @@ +# [S] The rest of a guard's maps + +## Goal + +[rust2-ts](/ts/README.md) translates `RefMut::map`, `Ref::filter_map`, `Ref::map_split`, +`RefMut::filter_map`, `RefMut::map_split`, and the `map` of an `RwLock`'s guards, each +releasing its cell's borrow as the last guard drops, as std's do. Today they are refused. +Proven by differential tests against native Rust. + +## Plan + +`Ref::map` makes an `rt.RefMap`, which holds the part it lends and counts its borrow in +the cell. A mapped `RefMut` lends a `&mut`, which is an `rt.Place` where JS copies the +part, so writes through it must reach that place rather than a copy in the guard. + +Public API: the translator's output. diff --git a/ts/README.md b/ts/README.md index ca63ebd06..b6904a224 100644 --- a/ts/README.md +++ b/ts/README.md @@ -121,11 +121,11 @@ crate translation reaches is refused, and so are two versions of one crate it re | `static` | a module's value, named for the static, that every use shares, read from the memory rustc evaluated; one that reads another static or a class is an `rt.LazyCell` of it, made on first use, since that may not be made yet when its module is. A `static mut`, and a pointer in one into memory the translation can't name, fail translation | | a type that drops | a class with `[Symbol.dispose]`: its `Drop` impl, then its fields | | a type's function | a function of the type's module, taking `self` first: `Decoder.slice(dec, 4)` after `import * as Decoder` | -| `Arc`, `Rc`, `Weak`, `Mutex` | `rt.Arc` for either, with its strong and weak counts, and `new_cyclic`'s `Weak` upgrading only once its value is made, `get_mut` lending its value only while no other `Arc` or `Weak` shares it, `make_mut` cloning it into a new `rt.Arc` while another `Arc` shares it, or moving it there while only `Weak`s do, which then dangle, and `into_inner` giving it only from the last strong `Arc`, after which its `Weak`s no longer upgrade; `rt.Weak`, counted in its `rt.Arc` until it drops, and of no `Arc` once made by `Weak::new`; `rt.Mutex`, its own guard, which a lock gives as `Ok` and the guard's drop unlocks: locking it again while held panics and `try_lock` gives `WouldBlock`, as wasm32's do, and a panic aborts, so nothing poisons it and `thread::panicking` is `false` | +| `Arc`, `Rc`, `Weak`, `Mutex` | `rt.Arc` for either, with its strong and weak counts, and `new_cyclic`'s `Weak` upgrading only once its value is made, `get_mut` lending its value only while no other `Arc` or `Weak` shares it, `make_mut` cloning it into a new `rt.Arc` while another `Arc` shares it, or moving it there while only `Weak`s do, which then dangle, and `into_inner` giving it only from the last strong `Arc`, after which its `Weak`s no longer upgrade; `rt.Weak`, counted in its `rt.Arc` until it drops, and of no `Arc` once made by `Weak::new`; `rt.Mutex`, its own guard, which a lock gives as `Ok` and the guard's drop unlocks: locking it again while held panics and `try_lock` gives `WouldBlock`, as wasm32's do, and a panic aborts, so nothing poisons it and `thread::panicking` is `false`; a `Mutex`'s, a `RefCell`'s, and an `RwLock`'s `into_inner` gives its value and `get_mut` lends it, or an `rt.Place` of it where JS copies it | | `PoisonError`, `TryLockError` | the `T` it holds; `rt.TryLockError`, tagged as `Bound` is | -| `Cell`, `UnsafeCell`, `RefCell`, `RwLock` | `rt.Cell`, the place holding its value in `v`, for either of the first two: `UnsafeCell::get`'s pointer is the cell where it is an `rt.Place`, and otherwise the object in `v`, refused where the crate may put another cell or object in its place; `rt.RefCell` for either of the others, its own guard, counting its borrows: borrowing it while that conflicts panics as `RefCell`'s does, and locking it so aborts as wasm32's `RwLock` does | +| `Cell`, `UnsafeCell`, `RefCell`, `RwLock` | `rt.Cell`, the place holding its value in `v`, for either of the first two: `UnsafeCell::get`'s pointer is the cell where it is an `rt.Place`, and otherwise the object in `v`, refused where the crate may put another cell or object in its place; `rt.RefCell` for either of the others, its own guard, counting its borrows: borrowing it while that conflicts panics as `RefCell`'s does, and locking it so aborts as wasm32's `RwLock` does; `try_borrow` and `try_borrow_mut` fail with `rt.BorrowError` and `rt.BorrowMutError` instead, a clone borrows the cell, `Ref::clone` counts another borrow of it, and `Ref::map` makes an `rt.RefMap`, the part it lends, which releases the cell's borrow as it drops | | `thread_local!`, `LocalKey` | an `rt.LocalKey`, a module's value, which makes its value on first use from the `const` or the expression and never drops it, as wasm32's do; `with` calls its function on that value, `try_with` never fails, the `Cell` and `RefCell` helpers lower from std, and a `RefCell` key's `set` and `with_borrow_mut` borrow it as `borrow_mut` does | -| `OnceCell`, `OnceLock` | `rt.OnceCell` and `rt.OnceLock`, holding the `Option` in `v`; a `OnceLock` initialized from within its own initialization panics, as wasm32's does | +| `OnceCell`, `OnceLock` | `rt.OnceCell` and `rt.OnceLock`, holding the `Option` in `v`, which is the place `get_mut` lends where JS copies the value; a `OnceLock` initialized from within its own initialization panics, as wasm32's does, and `get_or_try_init`'s error leaves either empty | | `Once`, `OnceState` | `rt.Once`, an `rt.OnceLock` that holds `true` once `call_once` or `call_once_force` ran its function, and panics as wasm32's does if run again from within it; `rt.OnceState`, that `Once`, which a panic never poisons, as it aborts | | `LazyCell`, `LazyLock` in a `static` or `const` | `rt.LazyCell` and `rt.LazyLock`, which run their function on the first `force` or `Deref`, once; forced from within it, either panics as std's does | | `AtomicU32` and the others of `bool` and integers, `AtomicPtr` | `rt.Atomic`, the `rt.Place` of its value; an `atomic::Ordering` is its discriminant, and one an operation can't take panics as std's does. An `AtomicPtr` compares pointers only to what JS keeps as an object or bytes, as raw pointers do | diff --git a/ts/fixtures/lang/caller.ts b/ts/fixtures/lang/caller.ts index b4485c5cc..7e32158ab 100644 --- a/ts/fixtures/lang/caller.ts +++ b/ts/fixtures/lang/caller.ts @@ -349,7 +349,9 @@ const dyns = [[], [1, 2], [3, 0, 7], [255, 1, 255, 0, 1, 2, 3, 4, 5], [0, 3, 2, /** * `cells` scripts of (op, operand) pairs on every kind, so each cell and value type: reads * and sets, a `None` and a `()` held, initializing from within initialization and - * panicking in it, empty and full, and a cell replaced. + * panicking in it, empty and full, and a cell replaced; clones, `Debug`, and `get_mut`, + * empty and full; and `get_or_try_init` failing, succeeding, set, and set or initialized + * again from within, failing after or not. */ const cellsOp = op("cells::cells"); const cellScripts = [ @@ -361,6 +363,15 @@ const cellScripts = [ [7, 1], [2, 1, 5, 3, 6, 3, 7, 1], [8, 4, 0, 0, 8, 5, 0, 0, 1, 3, 8, 6], + [9, 0, 9, 1, 0, 0], + [10, 0, 10, 1, 11, 2, 0, 0], + [11, 1, 2, 1, 11, 4, 0, 0, 4, 0, 11, 5], + [12, 0, 12, 6, 0, 0, 12, 1], + [12, 1, 12, 2], + [12, 2], + [12, 3, 4, 0, 12, 7], + [12, 11], + [12, 7, 12, 4], [], ]; const cells = Array.from({ length: 256 }, (_, kind) => cellScripts.map((script) => Uint8Array.of(cellsOp, kind, ...script))).flat(); @@ -380,6 +391,21 @@ const locks = [[0, 1, 5, 6, 2, 7, 3, 8, 3, 0, 1], [4, 0, 4, 1], [2, 9, 2, 10, 4, (bytes) => Uint8Array.of(op("locks::locks"), 0, ...bytes), ); +/** + * `borrows::guards` scripts: each operation on cells empty and not, cloned while borrowed + * shared and exclusive, and borrowed exclusively while a mapped or cloned guard holds it. + */ +const guards = [ + [0x04, 0x05, 0x06, 0x03, 0x07, 0x02, 0x01], + [0x10, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0b, 0x0c, 0x0d], + [0x08, 0xe1, 0xf1], + [0x08, 0xe6], + [0xf6], +].map((bytes) => Uint8Array.of(op("borrows::guards"), 0, ...bytes)); + +/** `locks::rwlocks` scripts: `get_mut` and `into_inner` among writes and reads. */ +const rwlocks = [[6, 7, 0, 6, 2, 14, 15, 1]].map((bytes) => Uint8Array.of(op("locks::rwlocks"), 0, ...bytes)); + /** * `statics::onces` scripts: a `Once` forced, called, and forced again, which drops the * function it never runs, each static's, each `call_once` and `call_once_force` run again @@ -727,4 +753,4 @@ const asciiCases = [ ...Array.from({ length: 8 * 3 * 3 }, (_, i) => Uint8Array.of(op("ascii::parts"), 0x10 | (i % 8), Math.floor(i / 8) % 3, Math.floor(i / 24))), ]; -export const cases: Uint8Array[] = [...loops, ...durations, ...ints(), ...utf8, ...floats, ...formats, ...parsed, ...singlesCases, ...singlesFormats, ...singlesParsed, ...dyns, ...cells, ...shared, ...locks, ...onces, ...bounds, ...unsafeCells, ...edits, ...subslices, ...consumers, ...closures, ...elements, ...ranges, ...reducers, ...sliceEdits, ...drains, ...iters, ...hinted, ...peekedOthers, ...hints, ...reserves, ...setOps, ...zeros, ...writes, ...floatsMulAdds, ...singlesMulAdds, ...unlikeEqs, ...ownNes, ...rangeFroms, ...compares, ...unlikeCompares, ...rangeMethods, ...wraps(), ...refOrders, ...saturates(), ...methods(), ...separated, ...asciiCases]; +export const cases: Uint8Array[] = [...loops, ...durations, ...ints(), ...utf8, ...floats, ...formats, ...parsed, ...singlesCases, ...singlesFormats, ...singlesParsed, ...dyns, ...cells, ...shared, ...locks, ...guards, ...rwlocks, ...onces, ...bounds, ...unsafeCells, ...edits, ...subslices, ...consumers, ...closures, ...elements, ...ranges, ...reducers, ...sliceEdits, ...drains, ...iters, ...hinted, ...peekedOthers, ...hints, ...reserves, ...setOps, ...zeros, ...writes, ...floatsMulAdds, ...singlesMulAdds, ...unlikeEqs, ...ownNes, ...rangeFroms, ...compares, ...unlikeCompares, ...rangeMethods, ...wraps(), ...refOrders, ...saturates(), ...methods(), ...separated, ...asciiCases]; diff --git a/ts/fixtures/lang/expected/borrows.Tagged.ts b/ts/fixtures/lang/expected/borrows.Tagged.ts new file mode 100644 index 000000000..93bbfb49a --- /dev/null +++ b/ts/fixtures/lang/expected/borrows.Tagged.ts @@ -0,0 +1,39 @@ +// Generated by rust2-ts. Do not edit. + +import * as rt from "./rt.ts"; + +/** + * Logs its id as it is cloned, with the high bit set, and as it drops; its clone's id + * is one more. + */ +export class Tagged { + id: rt.u8; + n: rt.u32; + log: rt.Arc>; + + constructor(id: rt.u8, n: rt.u32, log: rt.Arc>) { + this.id = id; + this.n = n; + this.log = log; + } + + [Symbol.dispose](): void { + drop$ops_Drop(this); + this.log[Symbol.dispose](); + } +} + +export function clone$Clone(self: Tagged): Tagged { + const _5: rt.Mutex = rt.mutexLock(self.log.value); + rt.byteVecPush(_5.value, 128 | self.id); + rt.mutexUnlock(_5); + return new Tagged(rt.u8WrappingAdd(self.id, 1), self.n, rt.arcClone(self.log)); +} + +export function drop$ops_Drop(self: Tagged): void { + const _5: rt.Mutex = rt.mutexLock(self.log.value); + rt.byteVecPush(_5.value, self.id); + rt.mutexUnlock(_5); +} + +//# sourceMappingURL=borrows.Tagged.ts.map diff --git a/ts/fixtures/lang/expected/borrows.ts b/ts/fixtures/lang/expected/borrows.ts index 7211645be..a6f76cb49 100644 --- a/ts/fixtures/lang/expected/borrows.ts +++ b/ts/fixtures/lang/expected/borrows.ts @@ -1,10 +1,13 @@ // Generated by rust2-ts. Do not edit. import * as rt from "./rt.ts"; -import { copy$Option_tuple2_u64_u64, copy$tuple2_u64_u64 } from "./lib.ts"; +import { copy$Option_tuple2_u64_u64, copy$tuple2_u64_u64, drop$Result_cell_RefMut_Vec_u8_cell_BorrowMutError, drop$Result_cell_RefMut_borrows_Tagged_cell_BorrowMutError, drop$Result_cell_Ref_Vec_u8_cell_BorrowError, drop$tuple2_Option_cell_Ref_borrows_Tagged_Option_cell_RefMut_borrows_Tagged, drop$tuple2_Result_cell_Ref_Vec_u8_cell_BorrowError_cell_Ref_Vec_u8, drop$tuple2_cell_Ref_Vec_u8_cell_Ref_u8 } from "./lib.ts"; import * as borrows_Noisy from "./borrows.Noisy.ts"; import * as borrows_Polling from "./borrows.Polling.ts"; -import { mapOr$0qqbaqw as option_mapOr$0qqbaqw, mapOr$0ucbp7g as option_mapOr$0ucbp7g } from "./core/option.ts"; +import * as borrows_Tagged from "./borrows.Tagged.ts"; +import { then$1jgls7y } from "./core/bool.ts"; +import { unwrapOr$0r2bmpr as option_unwrapOr$0r2bmpr, mapOr$0qqbaqw as option_mapOr$0qqbaqw, mapOr$0ucbp7g as option_mapOr$0ucbp7g } from "./core/option.ts"; +import { map$0n1xnuw as result_map$0n1xnuw, unwrapOr$0k9nfhn as result_unwrapOr$0k9nfhn } from "./core/result.ts"; /** * Each byte an operation on the cells, its value the operand; each puts what it read and @@ -108,6 +111,200 @@ export function borrows(data: rt.ByteSlice, out: rt.ByteVec): void { log[Symbol.dispose](); } +/** + * Each byte an operation on `RefCell`s, its value the operand: cloned, written through + * `get_mut`, taken apart, tried, and borrowed through mapped and cloned guards; each puts + * what it read and what dropped. + */ +export function guards(data: rt.ByteSlice, out: rt.ByteVec): void { + const log: rt.Arc> = new rt.Arc(new rt.Mutex(new rt.ByteVec())); + const tag: (a0: rt.u8) => borrows_Tagged.Tagged = (id2: rt.u8): borrows_Tagged.Tagged => { + return new borrows_Tagged.Tagged(id2, 0, rt.arcClone(log)); + }; + const number: rt.RefCell = new rt.RefCell(0); + const bytes: rt.RefCell = new rt.RefCell(new rt.ByteVec()); + let tagged: rt.RefCell = new rt.RefCell(tag(0)); + for (const op of rt.byteSliceView(data)) { + const _22: rt.u8 = rt.u8Rem(op, 8); + if (_22 === 0) { + const _24: rt.u32 = op as rt.u32; + const _25: rt.Place = rt.valuePlace(number); + _25.v = rt.u32Add(_25.v, _24); + rt.byteVecPush(bytes.value, op); + const _31: borrows_Tagged.Tagged = tagged.value; + _31.n = rt.u32Add(_31.n, 1); + const _39: rt.RefCell = rt.refCellBorrow(number); + rt.byteVecPush(out, _39.value & 0xff); + rt.refRelease(_39); + } else if (_22 === 1) { + const _46: rt.RefCell = rt.refCellBorrowMut(twin$ref_cell_RefCell_u32(number)); + _46.value = rt.u32Add(_46.value, 1); + rt.refMutRelease(_46); + const _53: rt.RefCell = rt.refCellBorrow(number); + rt.byteVecPush(out, _53.value & 0xff); + rt.refRelease(_53); + rt.byteVecPush(out, twin$ref_sync_Arc_sync_Mutex_Vec_u8(log).strong & 0xff); + const held: rt.RefCell | undefined = then$1jgls7y((op >> 4) === 14, (): rt.RefCell => { + return rt.refCellBorrow(tagged); + }); + const heldMut: rt.RefCell | undefined = then$1jgls7y((op >> 4) === 15, (): rt.RefCell => { + return rt.refCellBorrowMut(tagged); + }); + const copy: rt.RefCell = rt.refCellClone(tagged, borrows_Tagged.clone$Clone); + const _81: rt.RefCell = rt.refCellBorrow(copy); + 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)); + }).value)); + rt.byteVecPush(out, rt.refCellClone(number, undefined).value & 0xff); + copy[Symbol.dispose](); + } else if (_22 === 2) { + const inner: borrows_Tagged.Tagged = new rt.RefCell(tag(op)).value; + rt.byteVecPush(out, inner.id); + flush(log.value, out); + inner[Symbol.dispose](); + } else if (_22 === 3) { + const shared: rt.RefCell = rt.refCellBorrow(bytes); + const read: rt.Result, rt.BorrowError> = rt.refCellTryBorrow(bytes); + rt.byteVecPush(out, read.ok ? 1 : 0); + const _116: rt.Result, rt.BorrowMutError> = rt.refCellTryBorrowMut(bytes); + if (_116.ok) { + rt.byteVecPush(out, 254); + } else { + const part3 = new rt.BorrowMutError(); + const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.borrowMutErrorDisplay(part3, f), (f: rt.Formatter) => rt.borrowMutErrorDebug(part3, f)]; + rt.byteVecExtendFromSlice(out, rt.stringAsBytes(rt.fmtFormat([args2[0], " ", args2[1]]))); + } + if (_116.ok) { + drop$Result_cell_RefMut_Vec_u8_cell_BorrowMutError(_116); + } + drop$tuple2_Result_cell_Ref_Vec_u8_cell_BorrowError_cell_Ref_Vec_u8([read, shared] as [rt.Result, rt.BorrowError>, rt.RefCell]); + const write: rt.Result, rt.BorrowMutError> = rt.refCellTryBorrowMut(bytes); + rt.byteVecPush(out, write.ok ? 1 : 0); + const _141: rt.Result, rt.BorrowError> = rt.refCellTryBorrow(bytes); + if (_141.ok) { + rt.byteVecPush(out, 254); + } else { + const part4 = new rt.BorrowError(); + const args4: rt.Fmt[] = [(f: rt.Formatter) => rt.borrowErrorDisplay(part4, f), (f: rt.Formatter) => rt.borrowErrorDebug(part4, f)]; + rt.byteVecExtendFromSlice(out, rt.stringAsBytes(rt.fmtFormat([args4[0], " ", args4[1]]))); + } + if (_141.ok) { + drop$Result_cell_Ref_Vec_u8_cell_BorrowError(_141); + } + drop$Result_cell_RefMut_Vec_u8_cell_BorrowMutError(write); + rt.byteVecPush(out, result_unwrapOr$0k9nfhn(result_map$0n1xnuw(rt.refCellTryBorrowMut(bytes), (b3: rt.RefCell): rt.u8 => { + rt.byteVecPush(b3.value, op); + const _05: rt.u8 = b3.value.length & 0xff; + rt.refMutRelease(b3); + return _05; + }), 253)); + } else if (_22 === 4) { + const n: rt.RefCell = rt.refMap(rt.refCellBorrow(tagged), (t2: borrows_Tagged.Tagged): rt.u32 => { + return t2.n; + }); + const id: rt.RefCell = rt.refMap(rt.refCellBorrow(tagged), (t3: borrows_Tagged.Tagged): rt.u8 => { + return t3.id; + }); + rt.byteVecExtendFromSlice(out, rt.byteSliceFrom(Uint8Array.of(n.value & 0xff, id.value))); + const _186: rt.Result, rt.BorrowMutError> = rt.refCellTryBorrowMut(tagged); + rt.byteVecPush(out, !_186.ok ? 1 : 0); + drop$Result_cell_RefMut_borrows_Tagged_cell_BorrowMutError(_186); + rt.refRelease(n); + const _193: rt.Result, rt.BorrowMutError> = rt.refCellTryBorrowMut(tagged); + rt.byteVecPush(out, !_193.ok ? 1 : 0); + drop$Result_cell_RefMut_borrows_Tagged_cell_BorrowMutError(_193); + rt.refRelease(id); + const _200: rt.Result, rt.BorrowMutError> = rt.refCellTryBorrowMut(tagged); + rt.byteVecPush(out, !_200.ok ? 1 : 0); + drop$Result_cell_RefMut_borrows_Tagged_cell_BorrowMutError(_200); + const half: rt.RefCell = rt.refMap(rt.refCellBorrow(bytes), (b2: rt.ByteVec): rt.ByteSlice => { + const part2 = rt.usizeDiv(b2.length, 2); + return rt.byteSliceRange(rt.byteVecSlice(b2), part2); + }); + rt.byteVecPush(out, half.value.length & 0xff); + const last: rt.RefCell = rt.refMap(half, (s: rt.ByteSlice): rt.u8 => { + return option_unwrapOr$0r2bmpr(rt.byteSliceLast(s), 253); + }); + rt.byteVecPush(out, last.value); + const _219: rt.Result, rt.BorrowMutError> = rt.refCellTryBorrowMut(bytes); + rt.byteVecPush(out, !_219.ok ? 1 : 0); + drop$Result_cell_RefMut_Vec_u8_cell_BorrowMutError(_219); + rt.refRelease(last); + const _226: rt.Result, rt.BorrowMutError> = rt.refCellTryBorrowMut(bytes); + rt.byteVecPush(out, !_226.ok ? 1 : 0); + drop$Result_cell_RefMut_Vec_u8_cell_BorrowMutError(_226); + } else if (_22 === 5) { + const a: rt.RefCell = rt.refCellBorrow(bytes); + const b: rt.RefCell = rt.refClone(a); + rt.refRelease(a); + const _237: rt.Result, rt.BorrowMutError> = rt.refCellTryBorrowMut(bytes); + rt.byteVecPush(out, !_237.ok ? 1 : 0); + drop$Result_cell_RefMut_Vec_u8_cell_BorrowMutError(_237); + const c: rt.RefCell = rt.refMap(rt.refClone(b), (v: rt.ByteVec): rt.u8 => { + return option_unwrapOr$0r2bmpr(rt.byteSliceFirst(rt.byteVecSlice(v)), 253); + }); + const d: rt.RefCell = rt.refClone(c); + drop$tuple2_cell_Ref_Vec_u8_cell_Ref_u8([b, c] as [rt.RefCell, rt.RefCell]); + rt.byteVecPush(out, d.value); + const _254: rt.Result, rt.BorrowMutError> = rt.refCellTryBorrowMut(bytes); + rt.byteVecPush(out, !_254.ok ? 1 : 0); + drop$Result_cell_RefMut_Vec_u8_cell_BorrowMutError(_254); + rt.refRelease(d); + const _261: rt.Result, rt.BorrowMutError> = rt.refCellTryBorrowMut(bytes); + rt.byteVecPush(out, !_261.ok ? 1 : 0); + drop$Result_cell_RefMut_Vec_u8_cell_BorrowMutError(_261); + } else if (_22 === 6) { + const _263: rt.u8 = op >> 4; + if (_263 === 14) { + const _n: rt.RefCell = rt.refMap(rt.refCellBorrow(tagged), (t: borrows_Tagged.Tagged): rt.u32 => { + return t.n; + }); + rt.refMutRelease(rt.refCellBorrowMut(tagged)); + rt.refRelease(_n); + } else if (_263 === 15) { + const a2: rt.RefCell = rt.refCellBorrow(tagged); + const _b: rt.RefCell = rt.refClone(a2); + rt.refRelease(a2); + rt.refMutRelease(rt.refCellBorrowMut(tagged)); + rt.refRelease(_b); + } else { + const _281: rt.RefCell = rt.refCellBorrowMut(tagged); + rt.byteVecPush(out, _281.value.id); + rt.refMutRelease(_281); + } + } else { + const _285: rt.RefCell = new rt.RefCell(tag(op)); + const old2 = tagged; + tagged = _285; + const _291: borrows_Tagged.Tagged = old2.value; + rt.byteVecPush(out, _291.id); + _291[Symbol.dispose](); + } + flush(log.value, out); + } + rt.byteVecPush(out, number.value & 0xff); + rt.byteVecExtendFromSlice(out, rt.byteVecSlice(bytes.value)); + const last2: borrows_Tagged.Tagged = tagged.value; + rt.byteVecPush(out, last2.id); + flush(log.value, out); + last2[Symbol.dispose](); + flush(log.value, out); + log[Symbol.dispose](); +} + +/** A clone of `t`, which for a reference is that reference. */ +export function twin$ref_cell_RefCell_u32(t: rt.RefCell): rt.RefCell { + return t; +} + +/** A clone of `t`, which for a reference is that reference. */ +export function twin$ref_sync_Arc_sync_Mutex_Vec_u8(t: rt.Arc>): rt.Arc> { + return t; +} + /** Puts what dropped since the last flush. */ export function flush(log: rt.Mutex, out: rt.ByteVec): void { const log2: rt.Mutex = rt.mutexLock(log); diff --git a/ts/fixtures/lang/expected/cells.ts b/ts/fixtures/lang/expected/cells.ts index 33a9aaa93..bf9e6e2d6 100644 --- a/ts/fixtures/lang/expected/cells.ts +++ b/ts/fixtures/lang/expected/cells.ts @@ -2,9 +2,13 @@ import * as rt from "./rt.ts"; import { thenSome$0d5am30 } from "./core/bool.ts"; +import { unwrapOr$0r2bmpr as option_unwrapOr$0r2bmpr } from "./core/option.ts"; +import { err$1nbmqmx, map$1ma2nl9 as result_map$1ma2nl9, map$0l5uclx as result_map$0l5uclx, map$14n87rz as result_map$14n87rz, map$0h1vl84 as result_map$0h1vl84, map$03hz3l7 as result_map$03hz3l7, map$0yqi183 as result_map$0yqi183 } from "./core/result.ts"; /** Steps of an operation and an operand on one cell, each putting what it read. */ export function cellOption(dataData: Uint8Array, dataStart: number, dataLen: number, out: rt.ByteVec): void { + let text!: string; + let result!: rt.Result; const make: (a0: rt.u8) => rt.u8 | undefined = maybe; const put: (a0: rt.ByteVec, a1: rt.u8 | undefined) => undefined = putMaybe as (a0: rt.ByteVec, a1: rt.u8 | undefined) => undefined; let cell: rt.OnceCell = new rt.OnceCell(rt.None); @@ -22,7 +26,7 @@ export function cellOption(dataData: Uint8Array, dataStart: number, dataLen: num dataLen2 = restLen; const op2: rt.u8 = op; const v2: rt.u8 = v; - const _18: rt.u8 = rt.u8Rem(op2, 9); + const _18: rt.u8 = rt.u8Rem(op2, 13); if (_18 === 0) { const _20: rt.u8 | undefined | rt.None = cell.v; if (_20 === rt.None) { @@ -83,31 +87,113 @@ export function cellOption(dataData: Uint8Array, dataStart: number, dataLen: num rt.byteVecExtendFromSlice(out, rt.byteVecSlice(inner)); } else if (_18 === 7) { const _76: rt.u8 | undefined = rt.onceGetOrInit(cell, (): rt.u8 | undefined => { - const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; - rt.panicFmt(["init ", args2[0]]); + const args8: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; + rt.panicFmt(["init ", args8[0]]); }, undefined, rt.None); put(out, _76); - } else if (rt.u8Rem(v2, 2) === 0) { - cell = new rt.OnceCell(make(v2)); + } else if (_18 === 8) { + if (rt.u8Rem(v2, 2) === 0) { + cell = new rt.OnceCell(make(v2)); + } else { + cell = new rt.OnceCell(rt.None); + } + } else if (_18 === 9) { + const alias: rt.OnceCell = twin$ref_cell_OnceCell_Option_u8(cell); + const copy: rt.OnceCell = rt.onceClone(cell, undefined, rt.None); + let inner2 = undefined as rt.OnceCell | undefined; + const _95: rt.OnceCell = cell; + const t5: rt.u8 | undefined = rt.onceGetOrInit(cell, (): rt.u8 | undefined => { + inner2 = rt.onceClone(_95, undefined, rt.None); + return make(v2); + }, undefined, rt.None); + put(out, t5); + rt.byteVecPush(out, alias.v !== rt.None ? 1 : 0); + const iter: rt.Iter> = rt.iterFlatten(rt.iterSlice([copy, inner2]), (value: rt.OnceCell | undefined) => rt.iterOption(value), false, undefined, true); + while (true) { + const _112: rt.OnceCell | rt.Done = iter.next(); + if (_112 === rt.DONE) { + break; + } + const _116: rt.u8 | undefined | rt.None = _112.v; + if (_116 === rt.None) { + rt.byteVecPush(out, 238); + } else { + put(out, _116); + } + } + } else if (_18 === 10) { + let inner3: string = ""; + const _125: rt.OnceCell = cell; + const t7: rt.u8 | undefined = rt.onceGetOrInit(cell, (): rt.u8 | undefined => { + const args6: rt.Fmt[] = [(f: rt.Formatter) => rt.onceDebug(_125, f, "OnceCell", (value: rt.u8 | undefined, f: rt.Formatter) => rt.fmtOption(value, f, rt.u8Debug), rt.None)]; + inner3 = rt.fmtFormat([args6[0]]); + return make(v2); + }, undefined, rt.None); + put(out, t7); + if (rt.u8Rem(v2, 2) === 0) { + const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceCell", (value: rt.u8 | undefined, f: rt.Formatter) => rt.fmtOption(value, f, rt.u8Debug), rt.None)]; + text = rt.fmtFormat([args2[0], " ", args2[1]]); + } else { + const args4: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceCell", (value: rt.u8 | undefined, f: rt.Formatter) => rt.fmtOption(value, f, rt.u8Debug), rt.None)]; + text = rt.fmtFormat([args4[0], " ", rt.fmtSpec({ alternate: true }, args4[1])]); + } + rt.byteVecExtendFromSlice(out, rt.stringAsBytes(text)); + } else if (_18 === 11) { + const _155: rt.Place | undefined = rt.optionAsMut(cell, rt.None); + if (_155 === undefined) { + rt.byteVecPush(out, 0); + } else { + _155.v = make(v2); + rt.byteVecPush(out, 1); + const _162: rt.u8 | undefined = rt.optionUnwrap(cell.v, rt.None); + put(out, _162); + } } else { - cell = new rt.OnceCell(rt.None); + const _166: rt.u8 = rt.u8Rem(v2, 4); + if (_166 === 0 || _166 === 1) { + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$Option_u8(make, v2); + }, undefined, rt.None); + } else if (_166 === 2) { + const _174: rt.OnceCell = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + rt.onceSet(_174, make(v2 ^ 1), rt.None); + return made$Option_u8(make, v2); + }, undefined, rt.None); + } else { + const _179: rt.OnceCell = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$Option_u8(make, option_unwrapOr$0r2bmpr(err$1nbmqmx(result_map$1ma2nl9(rt.onceGetOrTryInit(_179, (): rt.Result => { + return made$Option_u8(make, v2 ^ 1); + }, undefined, rt.None), (_22: rt.u8 | undefined): undefined => {})), v2)); + }, undefined, rt.None); + } + if (result.ok) { + const t8: rt.u8 | undefined = result.value; + rt.byteVecPush(out, 1); + put(out, t8); + } else { + rt.byteVecExtendFromSlice(out, rt.byteSliceFrom(Uint8Array.of(0, result.error))); + } } } - const _85: rt.u8 | undefined | rt.None = cell.v; - if (_85 === rt.None) { + const _190: rt.u8 | undefined | rt.None = cell.v; + if (_190 === rt.None) { rt.byteVecPush(out, 238); } else { - put(out, _85); + put(out, _190); } } /** Steps of an operation and an operand on one cell, each putting what it read. */ export function cellString(dataData: Uint8Array, dataStart: number, dataLen: number, out: rt.ByteVec): void { + let text!: string; + let result!: rt.Result; const make: (a0: rt.u8) => string = (v3: rt.u8): string => { return rt.fmtToString((f: rt.Formatter) => rt.u8Display(v3, f)); }; - const put: (a0: rt.ByteVec, a1: string) => undefined = (out2: rt.ByteVec, t6: string): undefined => { - rt.byteVecExtendFromSlice(out2, rt.stringAsBytes(t6)); + const put: (a0: rt.ByteVec, a1: string) => undefined = (out2: rt.ByteVec, t10: string): undefined => { + rt.byteVecExtendFromSlice(out2, rt.stringAsBytes(t10)); }; let cell: rt.OnceCell = new rt.OnceCell(undefined); let dataData2: Uint8Array = dataData; @@ -124,7 +210,7 @@ export function cellString(dataData: Uint8Array, dataStart: number, dataLen: num dataLen2 = restLen; const op2: rt.u8 = op; const v2: rt.u8 = v; - const _18: rt.u8 = rt.u8Rem(op2, 9); + const _18: rt.u8 = rt.u8Rem(op2, 13); if (_18 === 0) { const _20: string | undefined = cell.v; if (_20 === undefined) { @@ -185,29 +271,111 @@ export function cellString(dataData: Uint8Array, dataStart: number, dataLen: num rt.byteVecExtendFromSlice(out, rt.byteVecSlice(inner)); } else if (_18 === 7) { const _76: string = rt.onceGetOrInit(cell, (): string => { - const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; - rt.panicFmt(["init ", args2[0]]); + const args8: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; + rt.panicFmt(["init ", args8[0]]); }); put(out, _76); - } else if (rt.u8Rem(v2, 2) === 0) { - cell = new rt.OnceCell(make(v2)); + } else if (_18 === 8) { + if (rt.u8Rem(v2, 2) === 0) { + cell = new rt.OnceCell(make(v2)); + } else { + cell = new rt.OnceCell(undefined); + } + } else if (_18 === 9) { + const alias: rt.OnceCell = twin$ref_cell_OnceCell_String(cell); + const copy: rt.OnceCell = rt.onceClone(cell, undefined); + let inner2 = undefined as rt.OnceCell | undefined; + const _95: rt.OnceCell = cell; + const t5: string = rt.onceGetOrInit(cell, (): string => { + inner2 = rt.onceClone(_95, undefined); + return make(v2); + }); + put(out, t5); + rt.byteVecPush(out, alias.v !== undefined ? 1 : 0); + const iter: rt.Iter> = rt.iterFlatten(rt.iterSlice([copy, inner2]), (value: rt.OnceCell | undefined) => rt.iterOption(value), false, undefined, true); + while (true) { + const _112: rt.OnceCell | rt.Done = iter.next(); + if (_112 === rt.DONE) { + break; + } + const _116: string | undefined = _112.v; + if (_116 === undefined) { + rt.byteVecPush(out, 238); + } else { + put(out, _116); + } + } + } else if (_18 === 10) { + let inner3: string = ""; + const _125: rt.OnceCell = cell; + const t7: string = rt.onceGetOrInit(cell, (): string => { + const args6: rt.Fmt[] = [(f: rt.Formatter) => rt.onceDebug(_125, f, "OnceCell", rt.fmtStr)]; + inner3 = rt.fmtFormat([args6[0]]); + return make(v2); + }); + put(out, t7); + if (rt.u8Rem(v2, 2) === 0) { + const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceCell", rt.fmtStr)]; + text = rt.fmtFormat([args2[0], " ", args2[1]]); + } else { + const args4: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceCell", rt.fmtStr)]; + text = rt.fmtFormat([args4[0], " ", rt.fmtSpec({ alternate: true }, args4[1])]); + } + rt.byteVecExtendFromSlice(out, rt.stringAsBytes(text)); + } else if (_18 === 11) { + const _155: rt.Place | undefined = rt.optionAsMut(cell); + if (_155 === undefined) { + rt.byteVecPush(out, 0); + } else { + _155.v = make(v2); + rt.byteVecPush(out, 1); + const _162: string = rt.optionUnwrap(cell.v); + put(out, _162); + } } else { - cell = new rt.OnceCell(undefined); + const _166: rt.u8 = rt.u8Rem(v2, 4); + if (_166 === 0 || _166 === 1) { + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$String(make, v2); + }); + } else if (_166 === 2) { + const _174: rt.OnceCell = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + rt.onceSet(_174, make(v2 ^ 1)); + return made$String(make, v2); + }); + } else { + const _179: rt.OnceCell = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$String(make, option_unwrapOr$0r2bmpr(err$1nbmqmx(result_map$0l5uclx(rt.onceGetOrTryInit(_179, (): rt.Result => { + return made$String(make, v2 ^ 1); + }), (_22: string): undefined => {})), v2)); + }); + } + if (result.ok) { + const t8: string = result.value; + rt.byteVecPush(out, 1); + put(out, t8); + } else { + rt.byteVecExtendFromSlice(out, rt.byteSliceFrom(Uint8Array.of(0, result.error))); + } } } - const _85: string | undefined = cell.v; - if (_85 === undefined) { + const _190: string | undefined = cell.v; + if (_190 === undefined) { rt.byteVecPush(out, 238); } else { - put(out, _85); + put(out, _190); } } /** Steps of an operation and an operand on one cell, each putting what it read. */ export function cellU64(dataData: Uint8Array, dataStart: number, dataLen: number, out: rt.ByteVec): void { + let text!: string; + let result!: rt.Result; const make: (a0: rt.u8) => rt.u64 = wide; - const put: (a0: rt.ByteVec, a1: rt.u64) => undefined = (out2: rt.ByteVec, t6: rt.u64): undefined => { - rt.byteVecExtendFromSlice(out2, rt.byteSliceFrom(rt.u64ToBeBytes(t6))); + const put: (a0: rt.ByteVec, a1: rt.u64) => undefined = (out2: rt.ByteVec, t10: rt.u64): undefined => { + rt.byteVecExtendFromSlice(out2, rt.byteSliceFrom(rt.u64ToBeBytes(t10))); }; let cell: rt.OnceCell = new rt.OnceCell(undefined); let dataData2: Uint8Array = dataData; @@ -224,7 +392,7 @@ export function cellU64(dataData: Uint8Array, dataStart: number, dataLen: number dataLen2 = restLen; const op2: rt.u8 = op; const v2: rt.u8 = v; - const _18: rt.u8 = rt.u8Rem(op2, 9); + const _18: rt.u8 = rt.u8Rem(op2, 13); if (_18 === 0) { const _20: rt.u64 | undefined = cell.v; if (_20 === undefined) { @@ -285,31 +453,113 @@ export function cellU64(dataData: Uint8Array, dataStart: number, dataLen: number rt.byteVecExtendFromSlice(out, rt.byteVecSlice(inner)); } else if (_18 === 7) { const _76: rt.u64 = rt.onceGetOrInit(cell, (): rt.u64 => { - const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; - rt.panicFmt(["init ", args2[0]]); + const args8: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; + rt.panicFmt(["init ", args8[0]]); }); put(out, _76); - } else if (rt.u8Rem(v2, 2) === 0) { - cell = new rt.OnceCell(make(v2)); + } else if (_18 === 8) { + if (rt.u8Rem(v2, 2) === 0) { + cell = new rt.OnceCell(make(v2)); + } else { + cell = new rt.OnceCell(undefined); + } + } else if (_18 === 9) { + const alias: rt.OnceCell = twin$ref_cell_OnceCell_u64(cell); + const copy: rt.OnceCell = rt.onceClone(cell, undefined); + let inner2 = undefined as rt.OnceCell | undefined; + const _95: rt.OnceCell = cell; + const t5: rt.u64 = rt.onceGetOrInit(cell, (): rt.u64 => { + inner2 = rt.onceClone(_95, undefined); + return make(v2); + }); + put(out, t5); + rt.byteVecPush(out, alias.v !== undefined ? 1 : 0); + const iter: rt.Iter> = rt.iterFlatten(rt.iterSlice([copy, inner2]), (value: rt.OnceCell | undefined) => rt.iterOption(value), false, undefined, true); + while (true) { + const _112: rt.OnceCell | rt.Done = iter.next(); + if (_112 === rt.DONE) { + break; + } + const _116: rt.u64 | undefined = _112.v; + if (_116 === undefined) { + rt.byteVecPush(out, 238); + } else { + put(out, _116); + } + } + } else if (_18 === 10) { + let inner3: string = ""; + const _125: rt.OnceCell = cell; + const t7: rt.u64 = rt.onceGetOrInit(cell, (): rt.u64 => { + const args6: rt.Fmt[] = [(f: rt.Formatter) => rt.onceDebug(_125, f, "OnceCell", rt.u64Debug)]; + inner3 = rt.fmtFormat([args6[0]]); + return make(v2); + }); + put(out, t7); + if (rt.u8Rem(v2, 2) === 0) { + const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceCell", rt.u64Debug)]; + text = rt.fmtFormat([args2[0], " ", args2[1]]); + } else { + const args4: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceCell", rt.u64Debug)]; + text = rt.fmtFormat([args4[0], " ", rt.fmtSpec({ alternate: true }, args4[1])]); + } + rt.byteVecExtendFromSlice(out, rt.stringAsBytes(text)); + } else if (_18 === 11) { + const _155: rt.Place | undefined = rt.optionAsMut(cell); + if (_155 === undefined) { + rt.byteVecPush(out, 0); + } else { + _155.v = make(v2); + rt.byteVecPush(out, 1); + const _162: rt.u64 = rt.optionUnwrap(cell.v); + put(out, _162); + } } else { - cell = new rt.OnceCell(undefined); + const _166: rt.u8 = rt.u8Rem(v2, 4); + if (_166 === 0 || _166 === 1) { + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$u64(make, v2); + }); + } else if (_166 === 2) { + const _174: rt.OnceCell = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + rt.onceSet(_174, make(v2 ^ 1)); + return made$u64(make, v2); + }); + } else { + const _179: rt.OnceCell = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$u64(make, option_unwrapOr$0r2bmpr(err$1nbmqmx(result_map$0h1vl84(rt.onceGetOrTryInit(_179, (): rt.Result => { + return made$u64(make, v2 ^ 1); + }), (_22: rt.u64): undefined => {})), v2)); + }); + } + if (result.ok) { + const t8: rt.u64 = result.value; + rt.byteVecPush(out, 1); + put(out, t8); + } else { + rt.byteVecExtendFromSlice(out, rt.byteSliceFrom(Uint8Array.of(0, result.error))); + } } } - const _85: rt.u64 | undefined = cell.v; - if (_85 === undefined) { + const _190: rt.u64 | undefined = cell.v; + if (_190 === undefined) { rt.byteVecPush(out, 238); } else { - put(out, _85); + put(out, _190); } } /** Steps of an operation and an operand on one cell, each putting what it read. */ export function cellU8(dataData: Uint8Array, dataStart: number, dataLen: number, out: rt.ByteVec): void { + let text!: string; + let result!: rt.Result; const make: (a0: rt.u8) => rt.u8 = (v3: rt.u8): rt.u8 => { return v3; }; - const put: (a0: rt.ByteVec, a1: rt.u8) => undefined = (out2: rt.ByteVec, t6: rt.u8): undefined => { - rt.byteVecPush(out2, t6); + const put: (a0: rt.ByteVec, a1: rt.u8) => undefined = (out2: rt.ByteVec, t10: rt.u8): undefined => { + rt.byteVecPush(out2, t10); }; let cell: rt.OnceCell = new rt.OnceCell(undefined); let dataData2: Uint8Array = dataData; @@ -326,7 +576,7 @@ export function cellU8(dataData: Uint8Array, dataStart: number, dataLen: number, dataLen2 = restLen; const op2: rt.u8 = op; const v2: rt.u8 = v; - const _18: rt.u8 = rt.u8Rem(op2, 9); + const _18: rt.u8 = rt.u8Rem(op2, 13); if (_18 === 0) { const _20: rt.u8 | undefined = cell.v; if (_20 === undefined) { @@ -387,26 +637,108 @@ export function cellU8(dataData: Uint8Array, dataStart: number, dataLen: number, rt.byteVecExtendFromSlice(out, rt.byteVecSlice(inner)); } else if (_18 === 7) { const _76: rt.u8 = rt.onceGetOrInit(cell, (): rt.u8 => { - const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; - rt.panicFmt(["init ", args2[0]]); + const args8: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; + rt.panicFmt(["init ", args8[0]]); }); put(out, _76); - } else if (rt.u8Rem(v2, 2) === 0) { - cell = new rt.OnceCell(make(v2)); + } else if (_18 === 8) { + if (rt.u8Rem(v2, 2) === 0) { + cell = new rt.OnceCell(make(v2)); + } else { + cell = new rt.OnceCell(undefined); + } + } else if (_18 === 9) { + const alias: rt.OnceCell = twin$ref_cell_OnceCell_u8(cell); + const copy: rt.OnceCell = rt.onceClone(cell, undefined); + let inner2 = undefined as rt.OnceCell | undefined; + const _95: rt.OnceCell = cell; + const t5: rt.u8 = rt.onceGetOrInit(cell, (): rt.u8 => { + inner2 = rt.onceClone(_95, undefined); + return make(v2); + }); + put(out, t5); + rt.byteVecPush(out, alias.v !== undefined ? 1 : 0); + const iter: rt.Iter> = rt.iterFlatten(rt.iterSlice([copy, inner2]), (value: rt.OnceCell | undefined) => rt.iterOption(value), false, undefined, true); + while (true) { + const _112: rt.OnceCell | rt.Done = iter.next(); + if (_112 === rt.DONE) { + break; + } + const _116: rt.u8 | undefined = _112.v; + if (_116 === undefined) { + rt.byteVecPush(out, 238); + } else { + put(out, _116); + } + } + } else if (_18 === 10) { + let inner3: string = ""; + const _125: rt.OnceCell = cell; + const t7: rt.u8 = rt.onceGetOrInit(cell, (): rt.u8 => { + const args6: rt.Fmt[] = [(f: rt.Formatter) => rt.onceDebug(_125, f, "OnceCell", rt.u8Debug)]; + inner3 = rt.fmtFormat([args6[0]]); + return make(v2); + }); + put(out, t7); + if (rt.u8Rem(v2, 2) === 0) { + const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceCell", rt.u8Debug)]; + text = rt.fmtFormat([args2[0], " ", args2[1]]); + } else { + const args4: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceCell", rt.u8Debug)]; + text = rt.fmtFormat([args4[0], " ", rt.fmtSpec({ alternate: true }, args4[1])]); + } + rt.byteVecExtendFromSlice(out, rt.stringAsBytes(text)); + } else if (_18 === 11) { + const _155: rt.Place | undefined = rt.optionAsMut(cell); + if (_155 === undefined) { + rt.byteVecPush(out, 0); + } else { + _155.v = make(v2); + rt.byteVecPush(out, 1); + const _162: rt.u8 = rt.optionUnwrap(cell.v); + put(out, _162); + } } else { - cell = new rt.OnceCell(undefined); + const _166: rt.u8 = rt.u8Rem(v2, 4); + if (_166 === 0 || _166 === 1) { + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$u8(make, v2); + }); + } else if (_166 === 2) { + const _174: rt.OnceCell = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + rt.onceSet(_174, make(v2 ^ 1)); + return made$u8(make, v2); + }); + } else { + const _179: rt.OnceCell = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$u8(make, option_unwrapOr$0r2bmpr(err$1nbmqmx(result_map$03hz3l7(rt.onceGetOrTryInit(_179, (): rt.Result => { + return made$u8(make, v2 ^ 1); + }), (_22: rt.u8): undefined => {})), v2)); + }); + } + if (result.ok) { + const t8: rt.u8 = result.value; + rt.byteVecPush(out, 1); + put(out, t8); + } else { + rt.byteVecExtendFromSlice(out, rt.byteSliceFrom(Uint8Array.of(0, result.error))); + } } } - const _85: rt.u8 | undefined = cell.v; - if (_85 === undefined) { + const _190: rt.u8 | undefined = cell.v; + if (_190 === undefined) { rt.byteVecPush(out, 238); } else { - put(out, _85); + put(out, _190); } } /** Steps of an operation and an operand on one cell, each putting what it read. */ export function cellUnit(dataData: Uint8Array, dataStart: number, dataLen: number, out: rt.ByteVec): void { + let text!: string; + let result!: rt.Result; const make: (a0: rt.u8) => undefined = (_2: rt.u8): undefined => {}; const put: (a0: rt.ByteVec, a1: undefined) => undefined = (out2: rt.ByteVec, _3: undefined): undefined => { rt.byteVecPush(out2, 170); @@ -426,7 +758,7 @@ export function cellUnit(dataData: Uint8Array, dataStart: number, dataLen: numbe dataLen2 = restLen; const op2: rt.u8 = op; const v2: rt.u8 = v; - const _18: rt.u8 = rt.u8Rem(op2, 9); + const _18: rt.u8 = rt.u8Rem(op2, 13); if (_18 === 0) { const _20: undefined | rt.None = cell.v; if (_20 === rt.None) { @@ -486,15 +818,94 @@ export function cellUnit(dataData: Uint8Array, dataStart: number, dataLen: numbe rt.byteVecExtendFromSlice(out, rt.byteVecSlice(inner)); } else if (_18 === 7) { const _76: undefined = rt.onceGetOrInit(cell, (): undefined => { - const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; - rt.panicFmt(["init ", args2[0]]); + const args8: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; + rt.panicFmt(["init ", args8[0]]); }, undefined, rt.None); put(out, _76); - } else if (rt.u8Rem(v2, 2) === 0) { - make(v2); - cell = new rt.OnceCell(undefined); + } else if (_18 === 8) { + if (rt.u8Rem(v2, 2) === 0) { + make(v2); + cell = new rt.OnceCell(undefined); + } else { + cell = new rt.OnceCell(rt.None); + } + } else if (_18 === 9) { + const alias: rt.OnceCell = twin$ref_cell_OnceCell_unit(cell); + const copy: rt.OnceCell = rt.onceClone(cell, undefined, rt.None); + let inner2 = undefined as rt.OnceCell | undefined; + const _95: rt.OnceCell = cell; + const t3: undefined = rt.onceGetOrInit(cell, (): undefined => { + inner2 = rt.onceClone(_95, undefined, rt.None); + make(v2); + }, undefined, rt.None); + put(out, t3); + rt.byteVecPush(out, alias.v !== rt.None ? 1 : 0); + const iter: rt.Iter> = rt.iterFlatten(rt.iterSlice([copy, inner2]), (value: rt.OnceCell | undefined) => rt.iterOption(value), false, undefined, true); + while (true) { + const _112: rt.OnceCell | rt.Done = iter.next(); + if (_112 === rt.DONE) { + break; + } + if (_112.v === rt.None) { + rt.byteVecPush(out, 238); + } else { + put(out, undefined); + } + } + } else if (_18 === 10) { + let inner3: string = ""; + const _125: rt.OnceCell = cell; + const t4: undefined = rt.onceGetOrInit(cell, (): undefined => { + const args6: rt.Fmt[] = [(f: rt.Formatter) => rt.onceDebug(_125, f, "OnceCell", rt.fmtUnit, rt.None)]; + inner3 = rt.fmtFormat([args6[0]]); + make(v2); + }, undefined, rt.None); + put(out, t4); + if (rt.u8Rem(v2, 2) === 0) { + const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceCell", rt.fmtUnit, rt.None)]; + text = rt.fmtFormat([args2[0], " ", args2[1]]); + } else { + const args4: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceCell", rt.fmtUnit, rt.None)]; + text = rt.fmtFormat([args4[0], " ", rt.fmtSpec({ alternate: true }, args4[1])]); + } + rt.byteVecExtendFromSlice(out, rt.stringAsBytes(text)); + } else if (_18 === 11) { + if (rt.optionAsMut(cell, rt.None) === undefined) { + rt.byteVecPush(out, 0); + } else { + make(v2); + rt.byteVecPush(out, 1); + const _162: undefined = rt.optionUnwrap(cell.v, rt.None); + put(out, _162); + } } else { - cell = new rt.OnceCell(rt.None); + const _166: rt.u8 = rt.u8Rem(v2, 4); + if (_166 === 0 || _166 === 1) { + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$unit(make, v2); + }, undefined, rt.None); + } else if (_166 === 2) { + const _174: rt.OnceCell = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + make(v2 ^ 1); + rt.onceSet(_174, undefined, rt.None); + return made$unit(make, v2); + }, undefined, rt.None); + } else { + const _179: rt.OnceCell = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$unit(make, option_unwrapOr$0r2bmpr(err$1nbmqmx(result_map$0yqi183(rt.onceGetOrTryInit(_179, (): rt.Result => { + return made$unit(make, v2 ^ 1); + }, undefined, rt.None), (_23: undefined): undefined => {})), v2)); + }, undefined, rt.None); + } + if (result.ok) { + const t5: undefined = result.value; + rt.byteVecPush(out, 1); + put(out, t5); + } else { + rt.byteVecExtendFromSlice(out, rt.byteSliceFrom(Uint8Array.of(0, result.error))); + } } } if (cell.v === rt.None) { @@ -504,6 +915,194 @@ export function cellUnit(dataData: Uint8Array, dataStart: number, dataLen: numbe } } +/** Steps of an operation and an operand on one cell, each putting what it read. */ +export function cellVec(dataData: Uint8Array, dataStart: number, dataLen: number, out: rt.ByteVec): void { + let text!: string; + let result!: rt.Result; + const make: (a0: rt.u8) => rt.ByteVec = (v3: rt.u8): rt.ByteVec => { + return rt.byteVecOf(v3, rt.u8Rem(v3, 4) as rt.usize); + }; + const put: (a0: rt.ByteVec, a1: rt.ByteVec) => undefined = (out2: rt.ByteVec, t10: rt.ByteVec): undefined => { + rt.byteVecExtendFromSlice(out2, rt.byteVecSlice(t10)); + }; + let cell: rt.OnceCell = new rt.OnceCell(undefined); + let dataData2: Uint8Array = dataData; + let dataStart2: number = dataStart; + let dataLen2: number = dataLen; + while (dataLen2 >= 2) { + const op: rt.u8 = dataData2[dataStart2]; + const v: rt.u8 = dataData2[dataStart2 + 1]; + const restData: Uint8Array = dataData2; + const restStart: number = dataStart2 + 2; + const restLen: number = dataLen2 - 2; + dataData2 = restData; + dataStart2 = restStart; + dataLen2 = restLen; + const op2: rt.u8 = op; + const v2: rt.u8 = v; + const _18: rt.u8 = rt.u8Rem(op2, 13); + if (_18 === 0) { + const _20: rt.ByteVec | undefined = cell.v; + if (_20 === undefined) { + rt.byteVecPush(out, 0); + } else { + rt.byteVecPush(out, 1); + put(out, _20); + } + } else if (_18 === 1) { + const _26: rt.Result = rt.onceSet(cell, make(v2)); + if (_26.ok) { + rt.byteVecPush(out, 1); + } else { + const t: rt.ByteVec = _26.error; + rt.byteVecPush(out, 0); + put(out, t); + } + } else if (_18 === 2) { + const _34: rt.ByteVec = rt.onceGetOrInit(cell, (): rt.ByteVec => { + return make(v2); + }); + put(out, _34); + } else if (_18 === 3) { + let seen: rt.u8 = 2; + const _44: rt.OnceCell = cell; + const t2: rt.ByteVec = rt.onceGetOrInit(cell, (): rt.ByteVec => { + seen = _44.v !== undefined ? 1 : 0; + return make(v2); + }); + put(out, t2); + rt.byteVecPush(out, seen); + } else if (_18 === 4) { + const _50: rt.ByteVec | undefined = rt.onceTake(cell); + if (_50 === undefined) { + rt.byteVecPush(out, 0); + } else { + const t3: rt.ByteVec = _50; + rt.byteVecPush(out, 1); + put(out, t3); + } + } else if (_18 === 5) { + const _60: rt.OnceCell = cell; + const _57: rt.ByteVec = rt.onceGetOrInit(cell, (): rt.ByteVec => { + rt.onceSet(_60, make(v2 ^ 1)); + return make(v2); + }); + put(out, _57); + } else if (_18 === 6) { + const inner: rt.ByteVec = new rt.ByteVec(); + const _69: rt.OnceCell = cell; + const t4: rt.ByteVec = rt.onceGetOrInit(cell, (): rt.ByteVec => { + put(inner, rt.onceGetOrInit(_69, (): rt.ByteVec => { + return make(v2 ^ 1); + })); + return make(v2); + }); + put(out, t4); + rt.byteVecExtendFromSlice(out, rt.byteVecSlice(inner)); + } else if (_18 === 7) { + const _76: rt.ByteVec = rt.onceGetOrInit(cell, (): rt.ByteVec => { + const args8: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; + rt.panicFmt(["init ", args8[0]]); + }); + put(out, _76); + } else if (_18 === 8) { + if (rt.u8Rem(v2, 2) === 0) { + cell = new rt.OnceCell(make(v2)); + } else { + cell = new rt.OnceCell(undefined); + } + } else if (_18 === 9) { + const alias: rt.OnceCell = twin$ref_cell_OnceCell_Vec_u8(cell); + const copy: rt.OnceCell = rt.onceClone(cell, (a0: rt.ByteVec): rt.ByteVec => { + return rt.byteVecFrom(rt.byteVecView(a0)); + }); + let inner2 = undefined as rt.OnceCell | undefined; + const _95: rt.OnceCell = cell; + const t5: rt.ByteVec = rt.onceGetOrInit(cell, (): rt.ByteVec => { + inner2 = rt.onceClone(_95, (a02: rt.ByteVec): rt.ByteVec => { + return rt.byteVecFrom(rt.byteVecView(a02)); + }); + return make(v2); + }); + put(out, t5); + rt.byteVecPush(out, alias.v !== undefined ? 1 : 0); + const iter: rt.Iter> = rt.iterFlatten(rt.iterSlice([copy, inner2]), (value: rt.OnceCell | undefined) => rt.iterOption(value), false, undefined, true); + while (true) { + const _112: rt.OnceCell | rt.Done = iter.next(); + if (_112 === rt.DONE) { + break; + } + const _116: rt.ByteVec | undefined = _112.v; + if (_116 === undefined) { + rt.byteVecPush(out, 238); + } else { + put(out, _116); + } + } + } else if (_18 === 10) { + let inner3: string = ""; + const _125: rt.OnceCell = cell; + const t7: rt.ByteVec = rt.onceGetOrInit(cell, (): rt.ByteVec => { + const args6: rt.Fmt[] = [(f: rt.Formatter) => rt.onceDebug(_125, f, "OnceCell", (value: rt.ByteVec, f: rt.Formatter) => rt.fmtList(rt.byteVecView(value), f, rt.u8Debug))]; + inner3 = rt.fmtFormat([args6[0]]); + return make(v2); + }); + put(out, t7); + if (rt.u8Rem(v2, 2) === 0) { + const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceCell", (value: rt.ByteVec, f: rt.Formatter) => rt.fmtList(rt.byteVecView(value), f, rt.u8Debug))]; + text = rt.fmtFormat([args2[0], " ", args2[1]]); + } else { + const args4: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceCell", (value: rt.ByteVec, f: rt.Formatter) => rt.fmtList(rt.byteVecView(value), f, rt.u8Debug))]; + text = rt.fmtFormat([args4[0], " ", rt.fmtSpec({ alternate: true }, args4[1])]); + } + rt.byteVecExtendFromSlice(out, rt.stringAsBytes(text)); + } else if (_18 === 11) { + const _155: rt.ByteVec | undefined = cell.v; + if (_155 === undefined) { + rt.byteVecPush(out, 0); + } else { + Object.assign(_155, make(v2)); + rt.byteVecPush(out, 1); + const _162: rt.ByteVec = rt.optionUnwrap(cell.v); + put(out, _162); + } + } else { + const _166: rt.u8 = rt.u8Rem(v2, 4); + if (_166 === 0 || _166 === 1) { + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$Vec_u8(make, v2); + }); + } else if (_166 === 2) { + const _174: rt.OnceCell = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + rt.onceSet(_174, make(v2 ^ 1)); + return made$Vec_u8(make, v2); + }); + } else { + const _179: rt.OnceCell = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$Vec_u8(make, option_unwrapOr$0r2bmpr(err$1nbmqmx(result_map$14n87rz(rt.onceGetOrTryInit(_179, (): rt.Result => { + return made$Vec_u8(make, v2 ^ 1); + }), (_22: rt.ByteVec): undefined => {})), v2)); + }); + } + if (result.ok) { + const t8: rt.ByteVec = result.value; + rt.byteVecPush(out, 1); + put(out, t8); + } else { + rt.byteVecExtendFromSlice(out, rt.byteSliceFrom(Uint8Array.of(0, result.error))); + } + } + } + const _190: rt.ByteVec | undefined = cell.v; + if (_190 === undefined) { + rt.byteVecPush(out, 238); + } else { + put(out, _190); + } +} + /** Steps on the cell and value type `kind` picks. */ export function cells(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { const cases: Array<(a0: rt.ByteSlice, a1: rt.ByteVec) => undefined> = [(a0: rt.ByteSlice, a1: rt.ByteVec): undefined => { @@ -526,12 +1125,18 @@ export function cells(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void { cellString(a09.data, a09.start, a09.length, a19); }, (a010: rt.ByteSlice, a110: rt.ByteVec): undefined => { lockString(a010.data, a010.start, a010.length, a110); + }, (a011: rt.ByteSlice, a111: rt.ByteVec): undefined => { + cellVec(a011.data, a011.start, a011.length, a111); + }, (a012: rt.ByteSlice, a112: rt.ByteVec): undefined => { + lockVec(a012.data, a012.start, a012.length, a112); }]; cases[rt.idx(cases, rt.usizeRem(kind as rt.usize, cases.length))](data, out); } /** Steps of an operation and an operand on one cell, each putting what it read. */ export function lockOption(dataData: Uint8Array, dataStart: number, dataLen: number, out: rt.ByteVec): void { + let text!: string; + let result!: rt.Result; const make: (a0: rt.u8) => rt.u8 | undefined = maybe; const put: (a0: rt.ByteVec, a1: rt.u8 | undefined) => undefined = putMaybe as (a0: rt.ByteVec, a1: rt.u8 | undefined) => undefined; let cell: rt.OnceLock = new rt.OnceLock(rt.None); @@ -549,7 +1154,7 @@ export function lockOption(dataData: Uint8Array, dataStart: number, dataLen: num dataLen2 = restLen; const op2: rt.u8 = op; const v2: rt.u8 = v; - const _18: rt.u8 = rt.u8Rem(op2, 9); + const _18: rt.u8 = rt.u8Rem(op2, 13); if (_18 === 0) { const _20: rt.u8 | undefined | rt.None = cell.v; if (_20 === rt.None) { @@ -610,31 +1215,113 @@ export function lockOption(dataData: Uint8Array, dataStart: number, dataLen: num rt.byteVecExtendFromSlice(out, rt.byteVecSlice(inner)); } else if (_18 === 7) { const _76: rt.u8 | undefined = rt.onceGetOrInit(cell, (): rt.u8 | undefined => { - const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; - rt.panicFmt(["init ", args2[0]]); + const args8: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; + rt.panicFmt(["init ", args8[0]]); }, undefined, rt.None); put(out, _76); - } else if (rt.u8Rem(v2, 2) === 0) { - cell = new rt.OnceLock(make(v2)); + } else if (_18 === 8) { + if (rt.u8Rem(v2, 2) === 0) { + cell = new rt.OnceLock(make(v2)); + } else { + cell = new rt.OnceLock(rt.None); + } + } else if (_18 === 9) { + const alias: rt.OnceLock = twin$ref_sync_OnceLock_Option_u8(cell); + const copy: rt.OnceLock = rt.onceClone(cell, undefined, rt.None); + let inner2 = undefined as rt.OnceLock | undefined; + const _95: rt.OnceLock = cell; + const t5: rt.u8 | undefined = rt.onceGetOrInit(cell, (): rt.u8 | undefined => { + inner2 = rt.onceClone(_95, undefined, rt.None); + return make(v2); + }, undefined, rt.None); + put(out, t5); + rt.byteVecPush(out, alias.v !== rt.None ? 1 : 0); + const iter: rt.Iter> = rt.iterFlatten(rt.iterSlice([copy, inner2]), (value: rt.OnceLock | undefined) => rt.iterOption(value), false, undefined, true); + while (true) { + const _112: rt.OnceLock | rt.Done = iter.next(); + if (_112 === rt.DONE) { + break; + } + const _116: rt.u8 | undefined | rt.None = _112.v; + if (_116 === rt.None) { + rt.byteVecPush(out, 238); + } else { + put(out, _116); + } + } + } else if (_18 === 10) { + let inner3: string = ""; + const _125: rt.OnceLock = cell; + const t7: rt.u8 | undefined = rt.onceGetOrInit(cell, (): rt.u8 | undefined => { + const args6: rt.Fmt[] = [(f: rt.Formatter) => rt.onceDebug(_125, f, "OnceLock", (value: rt.u8 | undefined, f: rt.Formatter) => rt.fmtOption(value, f, rt.u8Debug), rt.None)]; + inner3 = rt.fmtFormat([args6[0]]); + return make(v2); + }, undefined, rt.None); + put(out, t7); + if (rt.u8Rem(v2, 2) === 0) { + const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceLock", (value: rt.u8 | undefined, f: rt.Formatter) => rt.fmtOption(value, f, rt.u8Debug), rt.None)]; + text = rt.fmtFormat([args2[0], " ", args2[1]]); + } else { + const args4: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceLock", (value: rt.u8 | undefined, f: rt.Formatter) => rt.fmtOption(value, f, rt.u8Debug), rt.None)]; + text = rt.fmtFormat([args4[0], " ", rt.fmtSpec({ alternate: true }, args4[1])]); + } + rt.byteVecExtendFromSlice(out, rt.stringAsBytes(text)); + } else if (_18 === 11) { + const _155: rt.Place | undefined = rt.optionAsMut(cell, rt.None); + if (_155 === undefined) { + rt.byteVecPush(out, 0); + } else { + _155.v = make(v2); + rt.byteVecPush(out, 1); + const _162: rt.u8 | undefined = rt.optionUnwrap(cell.v, rt.None); + put(out, _162); + } } else { - cell = new rt.OnceLock(rt.None); + const _166: rt.u8 = rt.u8Rem(v2, 4); + if (_166 === 0 || _166 === 1) { + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$Option_u8(make, v2); + }, undefined, rt.None); + } else if (_166 === 2) { + const _174: rt.OnceLock = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + rt.onceSet(_174, make(v2 ^ 1), rt.None); + return made$Option_u8(make, v2); + }, undefined, rt.None); + } else { + const _179: rt.OnceLock = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$Option_u8(make, option_unwrapOr$0r2bmpr(err$1nbmqmx(result_map$1ma2nl9(rt.onceGetOrTryInit(_179, (): rt.Result => { + return made$Option_u8(make, v2 ^ 1); + }, undefined, rt.None), (_22: rt.u8 | undefined): undefined => {})), v2)); + }, undefined, rt.None); + } + if (result.ok) { + const t8: rt.u8 | undefined = result.value; + rt.byteVecPush(out, 1); + put(out, t8); + } else { + rt.byteVecExtendFromSlice(out, rt.byteSliceFrom(Uint8Array.of(0, result.error))); + } } } - const _85: rt.u8 | undefined | rt.None = cell.v; - if (_85 === rt.None) { + const _190: rt.u8 | undefined | rt.None = cell.v; + if (_190 === rt.None) { rt.byteVecPush(out, 238); } else { - put(out, _85); + put(out, _190); } } /** Steps of an operation and an operand on one cell, each putting what it read. */ export function lockString(dataData: Uint8Array, dataStart: number, dataLen: number, out: rt.ByteVec): void { + let text!: string; + let result!: rt.Result; const make: (a0: rt.u8) => string = (v3: rt.u8): string => { return rt.fmtToString((f: rt.Formatter) => rt.u8Display(v3, f)); }; - const put: (a0: rt.ByteVec, a1: string) => undefined = (out2: rt.ByteVec, t6: string): undefined => { - rt.byteVecExtendFromSlice(out2, rt.stringAsBytes(t6)); + const put: (a0: rt.ByteVec, a1: string) => undefined = (out2: rt.ByteVec, t10: string): undefined => { + rt.byteVecExtendFromSlice(out2, rt.stringAsBytes(t10)); }; let cell: rt.OnceLock = new rt.OnceLock(undefined); let dataData2: Uint8Array = dataData; @@ -651,7 +1338,7 @@ export function lockString(dataData: Uint8Array, dataStart: number, dataLen: num dataLen2 = restLen; const op2: rt.u8 = op; const v2: rt.u8 = v; - const _18: rt.u8 = rt.u8Rem(op2, 9); + const _18: rt.u8 = rt.u8Rem(op2, 13); if (_18 === 0) { const _20: string | undefined = cell.v; if (_20 === undefined) { @@ -712,29 +1399,111 @@ export function lockString(dataData: Uint8Array, dataStart: number, dataLen: num rt.byteVecExtendFromSlice(out, rt.byteVecSlice(inner)); } else if (_18 === 7) { const _76: string = rt.onceGetOrInit(cell, (): string => { - const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; - rt.panicFmt(["init ", args2[0]]); + const args8: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; + rt.panicFmt(["init ", args8[0]]); }); put(out, _76); - } else if (rt.u8Rem(v2, 2) === 0) { - cell = new rt.OnceLock(make(v2)); + } else if (_18 === 8) { + if (rt.u8Rem(v2, 2) === 0) { + cell = new rt.OnceLock(make(v2)); + } else { + cell = new rt.OnceLock(undefined); + } + } else if (_18 === 9) { + const alias: rt.OnceLock = twin$ref_sync_OnceLock_String(cell); + const copy: rt.OnceLock = rt.onceClone(cell, undefined); + let inner2 = undefined as rt.OnceLock | undefined; + const _95: rt.OnceLock = cell; + const t5: string = rt.onceGetOrInit(cell, (): string => { + inner2 = rt.onceClone(_95, undefined); + return make(v2); + }); + put(out, t5); + rt.byteVecPush(out, alias.v !== undefined ? 1 : 0); + const iter: rt.Iter> = rt.iterFlatten(rt.iterSlice([copy, inner2]), (value: rt.OnceLock | undefined) => rt.iterOption(value), false, undefined, true); + while (true) { + const _112: rt.OnceLock | rt.Done = iter.next(); + if (_112 === rt.DONE) { + break; + } + const _116: string | undefined = _112.v; + if (_116 === undefined) { + rt.byteVecPush(out, 238); + } else { + put(out, _116); + } + } + } else if (_18 === 10) { + let inner3: string = ""; + const _125: rt.OnceLock = cell; + const t7: string = rt.onceGetOrInit(cell, (): string => { + const args6: rt.Fmt[] = [(f: rt.Formatter) => rt.onceDebug(_125, f, "OnceLock", rt.fmtStr)]; + inner3 = rt.fmtFormat([args6[0]]); + return make(v2); + }); + put(out, t7); + if (rt.u8Rem(v2, 2) === 0) { + const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceLock", rt.fmtStr)]; + text = rt.fmtFormat([args2[0], " ", args2[1]]); + } else { + const args4: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceLock", rt.fmtStr)]; + text = rt.fmtFormat([args4[0], " ", rt.fmtSpec({ alternate: true }, args4[1])]); + } + rt.byteVecExtendFromSlice(out, rt.stringAsBytes(text)); + } else if (_18 === 11) { + const _155: rt.Place | undefined = rt.optionAsMut(cell); + if (_155 === undefined) { + rt.byteVecPush(out, 0); + } else { + _155.v = make(v2); + rt.byteVecPush(out, 1); + const _162: string = rt.optionUnwrap(cell.v); + put(out, _162); + } } else { - cell = new rt.OnceLock(undefined); + const _166: rt.u8 = rt.u8Rem(v2, 4); + if (_166 === 0 || _166 === 1) { + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$String(make, v2); + }); + } else if (_166 === 2) { + const _174: rt.OnceLock = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + rt.onceSet(_174, make(v2 ^ 1)); + return made$String(make, v2); + }); + } else { + const _179: rt.OnceLock = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$String(make, option_unwrapOr$0r2bmpr(err$1nbmqmx(result_map$0l5uclx(rt.onceGetOrTryInit(_179, (): rt.Result => { + return made$String(make, v2 ^ 1); + }), (_22: string): undefined => {})), v2)); + }); + } + if (result.ok) { + const t8: string = result.value; + rt.byteVecPush(out, 1); + put(out, t8); + } else { + rt.byteVecExtendFromSlice(out, rt.byteSliceFrom(Uint8Array.of(0, result.error))); + } } } - const _85: string | undefined = cell.v; - if (_85 === undefined) { + const _190: string | undefined = cell.v; + if (_190 === undefined) { rt.byteVecPush(out, 238); } else { - put(out, _85); + put(out, _190); } } /** Steps of an operation and an operand on one cell, each putting what it read. */ export function lockU64(dataData: Uint8Array, dataStart: number, dataLen: number, out: rt.ByteVec): void { + let text!: string; + let result!: rt.Result; const make: (a0: rt.u8) => rt.u64 = wide; - const put: (a0: rt.ByteVec, a1: rt.u64) => undefined = (out2: rt.ByteVec, t6: rt.u64): undefined => { - rt.byteVecExtendFromSlice(out2, rt.byteSliceFrom(rt.u64ToBeBytes(t6))); + const put: (a0: rt.ByteVec, a1: rt.u64) => undefined = (out2: rt.ByteVec, t10: rt.u64): undefined => { + rt.byteVecExtendFromSlice(out2, rt.byteSliceFrom(rt.u64ToBeBytes(t10))); }; let cell: rt.OnceLock = new rt.OnceLock(undefined); let dataData2: Uint8Array = dataData; @@ -751,7 +1520,7 @@ export function lockU64(dataData: Uint8Array, dataStart: number, dataLen: number dataLen2 = restLen; const op2: rt.u8 = op; const v2: rt.u8 = v; - const _18: rt.u8 = rt.u8Rem(op2, 9); + const _18: rt.u8 = rt.u8Rem(op2, 13); if (_18 === 0) { const _20: rt.u64 | undefined = cell.v; if (_20 === undefined) { @@ -812,31 +1581,113 @@ export function lockU64(dataData: Uint8Array, dataStart: number, dataLen: number rt.byteVecExtendFromSlice(out, rt.byteVecSlice(inner)); } else if (_18 === 7) { const _76: rt.u64 = rt.onceGetOrInit(cell, (): rt.u64 => { - const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; - rt.panicFmt(["init ", args2[0]]); + const args8: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; + rt.panicFmt(["init ", args8[0]]); }); put(out, _76); - } else if (rt.u8Rem(v2, 2) === 0) { - cell = new rt.OnceLock(make(v2)); + } else if (_18 === 8) { + if (rt.u8Rem(v2, 2) === 0) { + cell = new rt.OnceLock(make(v2)); + } else { + cell = new rt.OnceLock(undefined); + } + } else if (_18 === 9) { + const alias: rt.OnceLock = twin$ref_sync_OnceLock_u64(cell); + const copy: rt.OnceLock = rt.onceClone(cell, undefined); + let inner2 = undefined as rt.OnceLock | undefined; + const _95: rt.OnceLock = cell; + const t5: rt.u64 = rt.onceGetOrInit(cell, (): rt.u64 => { + inner2 = rt.onceClone(_95, undefined); + return make(v2); + }); + put(out, t5); + rt.byteVecPush(out, alias.v !== undefined ? 1 : 0); + const iter: rt.Iter> = rt.iterFlatten(rt.iterSlice([copy, inner2]), (value: rt.OnceLock | undefined) => rt.iterOption(value), false, undefined, true); + while (true) { + const _112: rt.OnceLock | rt.Done = iter.next(); + if (_112 === rt.DONE) { + break; + } + const _116: rt.u64 | undefined = _112.v; + if (_116 === undefined) { + rt.byteVecPush(out, 238); + } else { + put(out, _116); + } + } + } else if (_18 === 10) { + let inner3: string = ""; + const _125: rt.OnceLock = cell; + const t7: rt.u64 = rt.onceGetOrInit(cell, (): rt.u64 => { + const args6: rt.Fmt[] = [(f: rt.Formatter) => rt.onceDebug(_125, f, "OnceLock", rt.u64Debug)]; + inner3 = rt.fmtFormat([args6[0]]); + return make(v2); + }); + put(out, t7); + if (rt.u8Rem(v2, 2) === 0) { + const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceLock", rt.u64Debug)]; + text = rt.fmtFormat([args2[0], " ", args2[1]]); + } else { + const args4: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceLock", rt.u64Debug)]; + text = rt.fmtFormat([args4[0], " ", rt.fmtSpec({ alternate: true }, args4[1])]); + } + rt.byteVecExtendFromSlice(out, rt.stringAsBytes(text)); + } else if (_18 === 11) { + const _155: rt.Place | undefined = rt.optionAsMut(cell); + if (_155 === undefined) { + rt.byteVecPush(out, 0); + } else { + _155.v = make(v2); + rt.byteVecPush(out, 1); + const _162: rt.u64 = rt.optionUnwrap(cell.v); + put(out, _162); + } } else { - cell = new rt.OnceLock(undefined); + const _166: rt.u8 = rt.u8Rem(v2, 4); + if (_166 === 0 || _166 === 1) { + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$u64(make, v2); + }); + } else if (_166 === 2) { + const _174: rt.OnceLock = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + rt.onceSet(_174, make(v2 ^ 1)); + return made$u64(make, v2); + }); + } else { + const _179: rt.OnceLock = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$u64(make, option_unwrapOr$0r2bmpr(err$1nbmqmx(result_map$0h1vl84(rt.onceGetOrTryInit(_179, (): rt.Result => { + return made$u64(make, v2 ^ 1); + }), (_22: rt.u64): undefined => {})), v2)); + }); + } + if (result.ok) { + const t8: rt.u64 = result.value; + rt.byteVecPush(out, 1); + put(out, t8); + } else { + rt.byteVecExtendFromSlice(out, rt.byteSliceFrom(Uint8Array.of(0, result.error))); + } } } - const _85: rt.u64 | undefined = cell.v; - if (_85 === undefined) { + const _190: rt.u64 | undefined = cell.v; + if (_190 === undefined) { rt.byteVecPush(out, 238); } else { - put(out, _85); + put(out, _190); } } /** Steps of an operation and an operand on one cell, each putting what it read. */ export function lockU8(dataData: Uint8Array, dataStart: number, dataLen: number, out: rt.ByteVec): void { + let text!: string; + let result!: rt.Result; const make: (a0: rt.u8) => rt.u8 = (v3: rt.u8): rt.u8 => { return v3; }; - const put: (a0: rt.ByteVec, a1: rt.u8) => undefined = (out2: rt.ByteVec, t6: rt.u8): undefined => { - rt.byteVecPush(out2, t6); + const put: (a0: rt.ByteVec, a1: rt.u8) => undefined = (out2: rt.ByteVec, t10: rt.u8): undefined => { + rt.byteVecPush(out2, t10); }; let cell: rt.OnceLock = new rt.OnceLock(undefined); let dataData2: Uint8Array = dataData; @@ -853,7 +1704,7 @@ export function lockU8(dataData: Uint8Array, dataStart: number, dataLen: number, dataLen2 = restLen; const op2: rt.u8 = op; const v2: rt.u8 = v; - const _18: rt.u8 = rt.u8Rem(op2, 9); + const _18: rt.u8 = rt.u8Rem(op2, 13); if (_18 === 0) { const _20: rt.u8 | undefined = cell.v; if (_20 === undefined) { @@ -914,26 +1765,108 @@ export function lockU8(dataData: Uint8Array, dataStart: number, dataLen: number, rt.byteVecExtendFromSlice(out, rt.byteVecSlice(inner)); } else if (_18 === 7) { const _76: rt.u8 = rt.onceGetOrInit(cell, (): rt.u8 => { - const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; - rt.panicFmt(["init ", args2[0]]); + const args8: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; + rt.panicFmt(["init ", args8[0]]); }); put(out, _76); - } else if (rt.u8Rem(v2, 2) === 0) { - cell = new rt.OnceLock(make(v2)); + } else if (_18 === 8) { + if (rt.u8Rem(v2, 2) === 0) { + cell = new rt.OnceLock(make(v2)); + } else { + cell = new rt.OnceLock(undefined); + } + } else if (_18 === 9) { + const alias: rt.OnceLock = twin$ref_sync_OnceLock_u8(cell); + const copy: rt.OnceLock = rt.onceClone(cell, undefined); + let inner2 = undefined as rt.OnceLock | undefined; + const _95: rt.OnceLock = cell; + const t5: rt.u8 = rt.onceGetOrInit(cell, (): rt.u8 => { + inner2 = rt.onceClone(_95, undefined); + return make(v2); + }); + put(out, t5); + rt.byteVecPush(out, alias.v !== undefined ? 1 : 0); + const iter: rt.Iter> = rt.iterFlatten(rt.iterSlice([copy, inner2]), (value: rt.OnceLock | undefined) => rt.iterOption(value), false, undefined, true); + while (true) { + const _112: rt.OnceLock | rt.Done = iter.next(); + if (_112 === rt.DONE) { + break; + } + const _116: rt.u8 | undefined = _112.v; + if (_116 === undefined) { + rt.byteVecPush(out, 238); + } else { + put(out, _116); + } + } + } else if (_18 === 10) { + let inner3: string = ""; + const _125: rt.OnceLock = cell; + const t7: rt.u8 = rt.onceGetOrInit(cell, (): rt.u8 => { + const args6: rt.Fmt[] = [(f: rt.Formatter) => rt.onceDebug(_125, f, "OnceLock", rt.u8Debug)]; + inner3 = rt.fmtFormat([args6[0]]); + return make(v2); + }); + put(out, t7); + if (rt.u8Rem(v2, 2) === 0) { + const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceLock", rt.u8Debug)]; + text = rt.fmtFormat([args2[0], " ", args2[1]]); + } else { + const args4: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceLock", rt.u8Debug)]; + text = rt.fmtFormat([args4[0], " ", rt.fmtSpec({ alternate: true }, args4[1])]); + } + rt.byteVecExtendFromSlice(out, rt.stringAsBytes(text)); + } else if (_18 === 11) { + const _155: rt.Place | undefined = rt.optionAsMut(cell); + if (_155 === undefined) { + rt.byteVecPush(out, 0); + } else { + _155.v = make(v2); + rt.byteVecPush(out, 1); + const _162: rt.u8 = rt.optionUnwrap(cell.v); + put(out, _162); + } } else { - cell = new rt.OnceLock(undefined); + const _166: rt.u8 = rt.u8Rem(v2, 4); + if (_166 === 0 || _166 === 1) { + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$u8(make, v2); + }); + } else if (_166 === 2) { + const _174: rt.OnceLock = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + rt.onceSet(_174, make(v2 ^ 1)); + return made$u8(make, v2); + }); + } else { + const _179: rt.OnceLock = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$u8(make, option_unwrapOr$0r2bmpr(err$1nbmqmx(result_map$03hz3l7(rt.onceGetOrTryInit(_179, (): rt.Result => { + return made$u8(make, v2 ^ 1); + }), (_22: rt.u8): undefined => {})), v2)); + }); + } + if (result.ok) { + const t8: rt.u8 = result.value; + rt.byteVecPush(out, 1); + put(out, t8); + } else { + rt.byteVecExtendFromSlice(out, rt.byteSliceFrom(Uint8Array.of(0, result.error))); + } } } - const _85: rt.u8 | undefined = cell.v; - if (_85 === undefined) { + const _190: rt.u8 | undefined = cell.v; + if (_190 === undefined) { rt.byteVecPush(out, 238); } else { - put(out, _85); + put(out, _190); } } /** Steps of an operation and an operand on one cell, each putting what it read. */ export function lockUnit(dataData: Uint8Array, dataStart: number, dataLen: number, out: rt.ByteVec): void { + let text!: string; + let result!: rt.Result; const make: (a0: rt.u8) => undefined = (_2: rt.u8): undefined => {}; const put: (a0: rt.ByteVec, a1: undefined) => undefined = (out2: rt.ByteVec, _3: undefined): undefined => { rt.byteVecPush(out2, 170); @@ -953,7 +1886,7 @@ export function lockUnit(dataData: Uint8Array, dataStart: number, dataLen: numbe dataLen2 = restLen; const op2: rt.u8 = op; const v2: rt.u8 = v; - const _18: rt.u8 = rt.u8Rem(op2, 9); + const _18: rt.u8 = rt.u8Rem(op2, 13); if (_18 === 0) { const _20: undefined | rt.None = cell.v; if (_20 === rt.None) { @@ -1013,15 +1946,94 @@ export function lockUnit(dataData: Uint8Array, dataStart: number, dataLen: numbe rt.byteVecExtendFromSlice(out, rt.byteVecSlice(inner)); } else if (_18 === 7) { const _76: undefined = rt.onceGetOrInit(cell, (): undefined => { - const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; - rt.panicFmt(["init ", args2[0]]); + const args8: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; + rt.panicFmt(["init ", args8[0]]); }, undefined, rt.None); put(out, _76); - } else if (rt.u8Rem(v2, 2) === 0) { - make(v2); - cell = new rt.OnceLock(undefined); + } else if (_18 === 8) { + if (rt.u8Rem(v2, 2) === 0) { + make(v2); + cell = new rt.OnceLock(undefined); + } else { + cell = new rt.OnceLock(rt.None); + } + } else if (_18 === 9) { + const alias: rt.OnceLock = twin$ref_sync_OnceLock_unit(cell); + const copy: rt.OnceLock = rt.onceClone(cell, undefined, rt.None); + let inner2 = undefined as rt.OnceLock | undefined; + const _95: rt.OnceLock = cell; + const t3: undefined = rt.onceGetOrInit(cell, (): undefined => { + inner2 = rt.onceClone(_95, undefined, rt.None); + make(v2); + }, undefined, rt.None); + put(out, t3); + rt.byteVecPush(out, alias.v !== rt.None ? 1 : 0); + const iter: rt.Iter> = rt.iterFlatten(rt.iterSlice([copy, inner2]), (value: rt.OnceLock | undefined) => rt.iterOption(value), false, undefined, true); + while (true) { + const _112: rt.OnceLock | rt.Done = iter.next(); + if (_112 === rt.DONE) { + break; + } + if (_112.v === rt.None) { + rt.byteVecPush(out, 238); + } else { + put(out, undefined); + } + } + } else if (_18 === 10) { + let inner3: string = ""; + const _125: rt.OnceLock = cell; + const t4: undefined = rt.onceGetOrInit(cell, (): undefined => { + const args6: rt.Fmt[] = [(f: rt.Formatter) => rt.onceDebug(_125, f, "OnceLock", rt.fmtUnit, rt.None)]; + inner3 = rt.fmtFormat([args6[0]]); + make(v2); + }, undefined, rt.None); + put(out, t4); + if (rt.u8Rem(v2, 2) === 0) { + const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceLock", rt.fmtUnit, rt.None)]; + text = rt.fmtFormat([args2[0], " ", args2[1]]); + } else { + const args4: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceLock", rt.fmtUnit, rt.None)]; + text = rt.fmtFormat([args4[0], " ", rt.fmtSpec({ alternate: true }, args4[1])]); + } + rt.byteVecExtendFromSlice(out, rt.stringAsBytes(text)); + } else if (_18 === 11) { + if (rt.optionAsMut(cell, rt.None) === undefined) { + rt.byteVecPush(out, 0); + } else { + make(v2); + rt.byteVecPush(out, 1); + const _162: undefined = rt.optionUnwrap(cell.v, rt.None); + put(out, _162); + } } else { - cell = new rt.OnceLock(rt.None); + const _166: rt.u8 = rt.u8Rem(v2, 4); + if (_166 === 0 || _166 === 1) { + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$unit(make, v2); + }, undefined, rt.None); + } else if (_166 === 2) { + const _174: rt.OnceLock = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + make(v2 ^ 1); + rt.onceSet(_174, undefined, rt.None); + return made$unit(make, v2); + }, undefined, rt.None); + } else { + const _179: rt.OnceLock = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$unit(make, option_unwrapOr$0r2bmpr(err$1nbmqmx(result_map$0yqi183(rt.onceGetOrTryInit(_179, (): rt.Result => { + return made$unit(make, v2 ^ 1); + }, undefined, rt.None), (_23: undefined): undefined => {})), v2)); + }, undefined, rt.None); + } + if (result.ok) { + const t5: undefined = result.value; + rt.byteVecPush(out, 1); + put(out, t5); + } else { + rt.byteVecExtendFromSlice(out, rt.byteSliceFrom(Uint8Array.of(0, result.error))); + } } } if (cell.v === rt.None) { @@ -1031,6 +2043,303 @@ export function lockUnit(dataData: Uint8Array, dataStart: number, dataLen: numbe } } +/** Steps of an operation and an operand on one cell, each putting what it read. */ +export function lockVec(dataData: Uint8Array, dataStart: number, dataLen: number, out: rt.ByteVec): void { + let text!: string; + let result!: rt.Result; + const make: (a0: rt.u8) => rt.ByteVec = (v3: rt.u8): rt.ByteVec => { + return rt.byteVecOf(v3, rt.u8Rem(v3, 4) as rt.usize); + }; + const put: (a0: rt.ByteVec, a1: rt.ByteVec) => undefined = (out2: rt.ByteVec, t10: rt.ByteVec): undefined => { + rt.byteVecExtendFromSlice(out2, rt.byteVecSlice(t10)); + }; + let cell: rt.OnceLock = new rt.OnceLock(undefined); + let dataData2: Uint8Array = dataData; + let dataStart2: number = dataStart; + let dataLen2: number = dataLen; + while (dataLen2 >= 2) { + const op: rt.u8 = dataData2[dataStart2]; + const v: rt.u8 = dataData2[dataStart2 + 1]; + const restData: Uint8Array = dataData2; + const restStart: number = dataStart2 + 2; + const restLen: number = dataLen2 - 2; + dataData2 = restData; + dataStart2 = restStart; + dataLen2 = restLen; + const op2: rt.u8 = op; + const v2: rt.u8 = v; + const _18: rt.u8 = rt.u8Rem(op2, 13); + if (_18 === 0) { + const _20: rt.ByteVec | undefined = cell.v; + if (_20 === undefined) { + rt.byteVecPush(out, 0); + } else { + rt.byteVecPush(out, 1); + put(out, _20); + } + } else if (_18 === 1) { + const _26: rt.Result = rt.onceSet(cell, make(v2)); + if (_26.ok) { + rt.byteVecPush(out, 1); + } else { + const t: rt.ByteVec = _26.error; + rt.byteVecPush(out, 0); + put(out, t); + } + } else if (_18 === 2) { + const _34: rt.ByteVec = rt.onceGetOrInit(cell, (): rt.ByteVec => { + return make(v2); + }); + put(out, _34); + } else if (_18 === 3) { + let seen: rt.u8 = 2; + const _44: rt.OnceLock = cell; + const t2: rt.ByteVec = rt.onceGetOrInit(cell, (): rt.ByteVec => { + seen = _44.v !== undefined ? 1 : 0; + return make(v2); + }); + put(out, t2); + rt.byteVecPush(out, seen); + } else if (_18 === 4) { + const _50: rt.ByteVec | undefined = rt.onceTake(cell); + if (_50 === undefined) { + rt.byteVecPush(out, 0); + } else { + const t3: rt.ByteVec = _50; + rt.byteVecPush(out, 1); + put(out, t3); + } + } else if (_18 === 5) { + const _60: rt.OnceLock = cell; + const _57: rt.ByteVec = rt.onceGetOrInit(cell, (): rt.ByteVec => { + rt.onceSet(_60, make(v2 ^ 1)); + return make(v2); + }); + put(out, _57); + } else if (_18 === 6) { + const inner: rt.ByteVec = new rt.ByteVec(); + const _69: rt.OnceLock = cell; + const t4: rt.ByteVec = rt.onceGetOrInit(cell, (): rt.ByteVec => { + put(inner, rt.onceGetOrInit(_69, (): rt.ByteVec => { + return make(v2 ^ 1); + })); + return make(v2); + }); + put(out, t4); + rt.byteVecExtendFromSlice(out, rt.byteVecSlice(inner)); + } else if (_18 === 7) { + const _76: rt.ByteVec = rt.onceGetOrInit(cell, (): rt.ByteVec => { + const args8: rt.Fmt[] = [(f: rt.Formatter) => rt.u8Display(v2, f)]; + rt.panicFmt(["init ", args8[0]]); + }); + put(out, _76); + } else if (_18 === 8) { + if (rt.u8Rem(v2, 2) === 0) { + cell = new rt.OnceLock(make(v2)); + } else { + cell = new rt.OnceLock(undefined); + } + } else if (_18 === 9) { + const alias: rt.OnceLock = twin$ref_sync_OnceLock_Vec_u8(cell); + const copy: rt.OnceLock = rt.onceClone(cell, (a0: rt.ByteVec): rt.ByteVec => { + return rt.byteVecFrom(rt.byteVecView(a0)); + }); + let inner2 = undefined as rt.OnceLock | undefined; + const _95: rt.OnceLock = cell; + const t5: rt.ByteVec = rt.onceGetOrInit(cell, (): rt.ByteVec => { + inner2 = rt.onceClone(_95, (a02: rt.ByteVec): rt.ByteVec => { + return rt.byteVecFrom(rt.byteVecView(a02)); + }); + return make(v2); + }); + put(out, t5); + rt.byteVecPush(out, alias.v !== undefined ? 1 : 0); + const iter: rt.Iter> = rt.iterFlatten(rt.iterSlice([copy, inner2]), (value: rt.OnceLock | undefined) => rt.iterOption(value), false, undefined, true); + while (true) { + const _112: rt.OnceLock | rt.Done = iter.next(); + if (_112 === rt.DONE) { + break; + } + const _116: rt.ByteVec | undefined = _112.v; + if (_116 === undefined) { + rt.byteVecPush(out, 238); + } else { + put(out, _116); + } + } + } else if (_18 === 10) { + let inner3: string = ""; + const _125: rt.OnceLock = cell; + const t7: rt.ByteVec = rt.onceGetOrInit(cell, (): rt.ByteVec => { + const args6: rt.Fmt[] = [(f: rt.Formatter) => rt.onceDebug(_125, f, "OnceLock", (value: rt.ByteVec, f: rt.Formatter) => rt.fmtList(rt.byteVecView(value), f, rt.u8Debug))]; + inner3 = rt.fmtFormat([args6[0]]); + return make(v2); + }); + put(out, t7); + if (rt.u8Rem(v2, 2) === 0) { + const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceLock", (value: rt.ByteVec, f: rt.Formatter) => rt.fmtList(rt.byteVecView(value), f, rt.u8Debug))]; + text = rt.fmtFormat([args2[0], " ", args2[1]]); + } else { + const args4: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, inner3), (f: rt.Formatter) => rt.onceDebug(cell, f, "OnceLock", (value: rt.ByteVec, f: rt.Formatter) => rt.fmtList(rt.byteVecView(value), f, rt.u8Debug))]; + text = rt.fmtFormat([args4[0], " ", rt.fmtSpec({ alternate: true }, args4[1])]); + } + rt.byteVecExtendFromSlice(out, rt.stringAsBytes(text)); + } else if (_18 === 11) { + const _155: rt.ByteVec | undefined = cell.v; + if (_155 === undefined) { + rt.byteVecPush(out, 0); + } else { + Object.assign(_155, make(v2)); + rt.byteVecPush(out, 1); + const _162: rt.ByteVec = rt.optionUnwrap(cell.v); + put(out, _162); + } + } else { + const _166: rt.u8 = rt.u8Rem(v2, 4); + if (_166 === 0 || _166 === 1) { + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$Vec_u8(make, v2); + }); + } else if (_166 === 2) { + const _174: rt.OnceLock = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + rt.onceSet(_174, make(v2 ^ 1)); + return made$Vec_u8(make, v2); + }); + } else { + const _179: rt.OnceLock = cell; + result = rt.onceGetOrTryInit(cell, (): rt.Result => { + return made$Vec_u8(make, option_unwrapOr$0r2bmpr(err$1nbmqmx(result_map$14n87rz(rt.onceGetOrTryInit(_179, (): rt.Result => { + return made$Vec_u8(make, v2 ^ 1); + }), (_22: rt.ByteVec): undefined => {})), v2)); + }); + } + if (result.ok) { + const t8: rt.ByteVec = result.value; + rt.byteVecPush(out, 1); + put(out, t8); + } else { + rt.byteVecExtendFromSlice(out, rt.byteSliceFrom(Uint8Array.of(0, result.error))); + } + } + } + const _190: rt.ByteVec | undefined = cell.v; + if (_190 === undefined) { + rt.byteVecPush(out, 238); + } else { + put(out, _190); + } +} + +/** A clone of `t`, which for a reference is that reference. */ +export function twin$ref_cell_OnceCell_Option_u8(t: rt.OnceCell): rt.OnceCell { + return t; +} + +/** A clone of `t`, which for a reference is that reference. */ +export function twin$ref_cell_OnceCell_String(t: rt.OnceCell): rt.OnceCell { + return t; +} + +/** A clone of `t`, which for a reference is that reference. */ +export function twin$ref_cell_OnceCell_Vec_u8(t: rt.OnceCell): rt.OnceCell { + return t; +} + +/** A clone of `t`, which for a reference is that reference. */ +export function twin$ref_cell_OnceCell_u64(t: rt.OnceCell): rt.OnceCell { + return t; +} + +/** A clone of `t`, which for a reference is that reference. */ +export function twin$ref_cell_OnceCell_u8(t: rt.OnceCell): rt.OnceCell { + return t; +} + +/** A clone of `t`, which for a reference is that reference. */ +export function twin$ref_cell_OnceCell_unit(t: rt.OnceCell): rt.OnceCell { + return t; +} + +/** A clone of `t`, which for a reference is that reference. */ +export function twin$ref_sync_OnceLock_Option_u8(t: rt.OnceLock): rt.OnceLock { + return t; +} + +/** A clone of `t`, which for a reference is that reference. */ +export function twin$ref_sync_OnceLock_String(t: rt.OnceLock): rt.OnceLock { + return t; +} + +/** A clone of `t`, which for a reference is that reference. */ +export function twin$ref_sync_OnceLock_Vec_u8(t: rt.OnceLock): rt.OnceLock { + return t; +} + +/** A clone of `t`, which for a reference is that reference. */ +export function twin$ref_sync_OnceLock_u64(t: rt.OnceLock): rt.OnceLock { + return t; +} + +/** A clone of `t`, which for a reference is that reference. */ +export function twin$ref_sync_OnceLock_u8(t: rt.OnceLock): rt.OnceLock { + return t; +} + +/** A clone of `t`, which for a reference is that reference. */ +export function twin$ref_sync_OnceLock_unit(t: rt.OnceLock): rt.OnceLock { + return t; +} + +/** What `make` makes of `v`, or `v` back as an error for every third byte. */ +export function made$Option_u8(make: (a0: rt.u8) => rt.u8 | undefined, v: rt.u8): rt.Result { + if (rt.u8Rem(v, 3) === 0) { + return rt.Err(v); + } + return rt.Ok(make(v)); +} + +/** What `make` makes of `v`, or `v` back as an error for every third byte. */ +export function made$String(make: (a0: rt.u8) => string, v: rt.u8): rt.Result { + if (rt.u8Rem(v, 3) === 0) { + return rt.Err(v); + } + return rt.Ok(make(v)); +} + +/** What `make` makes of `v`, or `v` back as an error for every third byte. */ +export function made$Vec_u8(make: (a0: rt.u8) => rt.ByteVec, v: rt.u8): rt.Result { + if (rt.u8Rem(v, 3) === 0) { + return rt.Err(v); + } + return rt.Ok(make(v)); +} + +/** What `make` makes of `v`, or `v` back as an error for every third byte. */ +export function made$u64(make: (a0: rt.u8) => rt.u64, v: rt.u8): rt.Result { + if (rt.u8Rem(v, 3) === 0) { + return rt.Err(v); + } + return rt.Ok(make(v)); +} + +/** What `make` makes of `v`, or `v` back as an error for every third byte. */ +export function made$u8(make: (a0: rt.u8) => rt.u8, v: rt.u8): rt.Result { + if (rt.u8Rem(v, 3) === 0) { + return rt.Err(v); + } + return rt.Ok(make(v)); +} + +/** What `make` makes of `v`, or `v` back as an error for every third byte. */ +export function made$unit(make: (a0: rt.u8) => undefined, v: rt.u8): rt.Result { + if (rt.u8Rem(v, 3) === 0) { + return rt.Err(v); + } + make(v); + return rt.OK; +} + /** A `u64` past 2^53, from one byte. */ export function wide(v: rt.u8): rt.u64 { return rt.u64Mul(v as rt.u64, { hi: 0x1010101, lo: 0x1010101 } as rt.u64); diff --git a/ts/fixtures/lang/expected/core/bool.ts b/ts/fixtures/lang/expected/core/bool.ts index 923325e2d..18a25a453 100644 --- a/ts/fixtures/lang/expected/core/bool.ts +++ b/ts/fixtures/lang/expected/core/bool.ts @@ -1,6 +1,7 @@ // Generated by rust2-ts. Do not edit. import * as rt from "../rt.ts"; +import type * as borrows_Tagged from "../borrows.Tagged.ts"; import * as defaults_Made from "../defaults.Made.ts"; import type * as Hop from "../keys.Hop.ts"; import type * as Way from "../keys.Way.ts"; @@ -223,6 +224,13 @@ export function then$0ea5h05(self: boolean, f: () => rt.u32): rt.u32 | undefined return f(); } +export function then$1jgls7y(self: boolean, f: () => rt.RefCell): rt.RefCell | undefined { + if (!self) { + return undefined; + } + return f(); +} + export function then$0wlzj76(self: boolean, f: () => rt.Ordering): rt.Ordering | undefined { if (!self) { return undefined; diff --git a/ts/fixtures/lang/expected/core/result.ts b/ts/fixtures/lang/expected/core/result.ts index dc466cac4..806dbe900 100644 --- a/ts/fixtures/lang/expected/core/result.ts +++ b/ts/fixtures/lang/expected/core/result.ts @@ -487,6 +487,13 @@ export function err$05f656d(self: rt.Result): rt.u16 | undefined return self.error; } +export function err$1nbmqmx(self: rt.Result): rt.u8 | undefined { + if (self.ok) { + return undefined; + } + return self.error; +} + export function asRef$0iljode(self: rt.Result<[rt.u32, rt.u32], rt.u8>): rt.Result<[rt.u32, rt.u32], rt.u8> { if (self.ok) { return rt.Ok(self.value); @@ -536,6 +543,37 @@ export function map$0fm1w6u(self: rt.Result, op: (a0 return self as rt.Result, rt.ParseBoolError>; } +export function map$0n1xnuw(self: rt.Result, rt.BorrowMutError>, op: (a0: rt.RefCell) => rt.u8): rt.Result { + if (self.ok) { + return rt.Ok(op(self.value)); + } + return self as rt.Result; +} + +export function map$1ma2nl9(self: rt.Result, op: (a0: rt.u8 | undefined) => undefined): rt.Result { + if (self.ok) { + op(self.value); + return rt.OK; + } + return self as rt.Result; +} + +export function map$0l5uclx(self: rt.Result, op: (a0: string) => undefined): rt.Result { + if (self.ok) { + op(self.value); + return rt.OK; + } + return self as rt.Result; +} + +export function map$14n87rz(self: rt.Result, op: (a0: rt.ByteVec) => undefined): rt.Result { + if (self.ok) { + op(self.value); + return rt.OK; + } + return self as rt.Result; +} + export function map$17yn9bi(self: rt.Result<[rt.u32, rt.u32], rt.u8>, _: (a0: [rt.u32, rt.u32]) => [rt.u32, rt.u32]): rt.Result<[rt.u32, rt.u32], rt.u8> { if (self.ok) { return rt.Ok(self.value); @@ -557,6 +595,30 @@ export function map$0nfi04k(self: rt.Result<[rt.u32, rt.u32], rt.u8>, op: (a0: [ return self as rt.Result; } +export function map$0h1vl84(self: rt.Result, op: (a0: rt.u64) => undefined): rt.Result { + if (self.ok) { + op(self.value); + return rt.OK; + } + return self as rt.Result; +} + +export function map$03hz3l7(self: rt.Result, op: (a0: rt.u8) => undefined): rt.Result { + if (self.ok) { + op(self.value); + return rt.OK; + } + return self as rt.Result; +} + +export function map$0yqi183(self: rt.Result, op: (a0: undefined) => undefined): rt.Result { + if (self.ok) { + op(self.value); + return rt.OK; + } + return self; +} + export function map$0zzqmaz(self: rt.Result, rt.Arc>, op: (a0: rt.Arc<[rt.u8, rt.u8]>) => [rt.usize, rt.u8]): rt.Result<[rt.usize, rt.u8], rt.Arc> { if (self.ok) { return rt.Ok(op(self.value)); @@ -585,14 +647,6 @@ export function map$132mdj8(self: rt.Result, op: (a0: rt.u8) => r return self; } -export function map$03hz3l7(self: rt.Result, op: (a0: rt.u8) => undefined): rt.Result { - if (self.ok) { - op(self.value); - return rt.OK; - } - return self as rt.Result; -} - export function mapOr$0fbyajt(self: rt.Result, default_: rt.usize, _: (a0: rt.ByteSlice) => rt.usize): rt.usize { if (self.ok) { return self.value.length; @@ -816,6 +870,13 @@ export function unwrapOr$1k2j44a(self: rt.Result, default_: rt.u return default_; } +export function unwrapOr$0k9nfhn(self: rt.Result, default_: rt.u8): rt.u8 { + if (self.ok) { + return self.value; + } + return default_; +} + export function unwrapOr$0a4h2e7(self: rt.Result, default_: rt.u8): rt.u8 { if (self.ok) { return self.value; diff --git a/ts/fixtures/lang/expected/harness.ts b/ts/fixtures/lang/expected/harness.ts index ad4b9f138..6c77b4360 100644 --- a/ts/fixtures/lang/expected/harness.ts +++ b/ts/fixtures/lang/expected/harness.ts @@ -5,7 +5,7 @@ import { args } from "./args.ts"; import { fromFns, maps, lent as arrays_lent, asSlices, given, flattened as arrays_flattened } from "./arrays.ts"; import { bytes as ascii_bytes, chars as ascii_chars, slices as ascii_slices, parts as ascii_parts } from "./ascii.ts"; import { atomics } from "./atomics.ts"; -import { borrows as borrows_borrows } from "./borrows.ts"; +import { borrows as borrows_borrows, guards } from "./borrows.ts"; import { bounds as bounds_bounds } from "./bounds.ts"; import { boxes, places as boxes_places } from "./boxes.ts"; import { captures } from "./captures.ts"; @@ -250,7 +250,9 @@ export function cases(): [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) partWritten(data87, out88); }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["pointers::aimed", (_2188: rt.u8, data88: rt.ByteSlice, out89: rt.ByteVec): undefined => { aimed(data88, out89); - }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ascii::parts", ascii_parts as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["boxes::places", boxes_places as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["arrays::flattened", arrays_flattened as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["args::args", args as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["returns::returns", returns as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined]]; + }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["ascii::parts", ascii_parts as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["boxes::places", boxes_places as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["arrays::flattened", arrays_flattened as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["args::args", args as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["returns::returns", returns as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["borrows::guards", (_2189: rt.u8, data89: rt.ByteSlice, out90: rt.ByteVec): undefined => { + guards(data89, out90); + }] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined]]; } /** Run one case. */ diff --git a/ts/fixtures/lang/expected/lib.ts b/ts/fixtures/lang/expected/lib.ts index 79069092b..601bc539c 100644 --- a/ts/fixtures/lang/expected/lib.ts +++ b/ts/fixtures/lang/expected/lib.ts @@ -1,6 +1,7 @@ // Generated by rust2-ts. Do not edit. import * as rt from "./rt.ts"; +import type * as borrows_Tagged from "./borrows.Tagged.ts"; import type * as clones_Logged from "./clones.Logged.ts"; import type * as collections_Picky from "./collections.Picky.ts"; import type * as Quirky from "./collections.Quirky.ts"; @@ -777,6 +778,36 @@ export function copy$wraps_Tick_usize(v: Tick.Tick): Tick.Tick | undefined): void { + if (_1 !== undefined) { + rt.refMutRelease(_1); + } +} + +export function drop$Option_cell_Ref_borrows_Tagged(_1: rt.RefCell | undefined): void { + if (_1 !== undefined) { + rt.refRelease(_1); + } +} + +export function drop$Result_cell_RefMut_Vec_u8_cell_BorrowMutError(_1: rt.Result, rt.BorrowMutError>): void { + if (_1.ok) { + rt.refMutRelease(_1.value); + } +} + +export function drop$Result_cell_RefMut_borrows_Tagged_cell_BorrowMutError(_1: rt.Result, rt.BorrowMutError>): void { + if (_1.ok) { + rt.refMutRelease(_1.value); + } +} + +export function drop$Result_cell_Ref_Vec_u8_cell_BorrowError(_1: rt.Result, rt.BorrowError>): void { + if (_1.ok) { + rt.refRelease(_1.value); + } +} + export function drop$Result_sync_MutexGuard_locks_Tally_sync_TryLockError_sync_MutexGuard_locks_Tally(_1: rt.Result, rt.TryLockError>>): void { if (_1.ok) { rt.mutexUnlock(_1.value); @@ -893,10 +924,25 @@ export function drop$sync_TryLockError_sync_RwLockWriteGuard_locks_Tally(_1: rt. } } +export function drop$tuple2_Option_cell_Ref_borrows_Tagged_Option_cell_RefMut_borrows_Tagged(_1: [rt.RefCell | undefined, rt.RefCell | undefined]): void { + drop$Option_cell_Ref_borrows_Tagged(_1[0]); + drop$Option_cell_RefMut_borrows_Tagged(_1[1]); +} + +export function drop$tuple2_Result_cell_Ref_Vec_u8_cell_BorrowError_cell_Ref_Vec_u8(_1: [rt.Result, rt.BorrowError>, rt.RefCell]): void { + drop$Result_cell_Ref_Vec_u8_cell_BorrowError(_1[0]); + rt.refRelease(_1[1]); +} + export function drop$tuple2_Vec_tuples_Logged_tuples_Tally(_1: [tuples_Logged.Logged[], tuples_Tally.Tally]): void { rt.dropAll(_1[0]); } +export function drop$tuple2_cell_Ref_Vec_u8_cell_Ref_u8(_1: [rt.RefCell, rt.RefCell]): void { + rt.refRelease(_1[0]); + rt.refRelease(_1[1]); +} + export function drop$tuple2_sync_Arc_collections_Picky_u8(_1: [rt.Arc, rt.u8]): void { _1[0][Symbol.dispose](); } diff --git a/ts/fixtures/lang/expected/locks.ts b/ts/fixtures/lang/expected/locks.ts index c9e17a433..4d2bf8ef5 100644 --- a/ts/fixtures/lang/expected/locks.ts +++ b/ts/fixtures/lang/expected/locks.ts @@ -2,74 +2,83 @@ import * as rt from "./rt.ts"; import { drop$Result_sync_MutexGuard_locks_Tally_sync_TryLockError_sync_MutexGuard_locks_Tally, drop$Result_sync_MutexGuard_u32_sync_TryLockError_sync_MutexGuard_u32, drop$Result_sync_RwLockReadGuard_locks_Tally_sync_TryLockError_sync_RwLockReadGuard_locks_Tally, drop$Result_sync_RwLockWriteGuard_locks_Tally_sync_TryLockError_sync_RwLockWriteGuard_locks_Tally } from "./lib.ts"; -import { isSomeAnd$09tpccf } from "./core/option.ts"; +import { isSomeAnd$09tpccf, unwrapOr$0r2bmpr as option_unwrapOr$0r2bmpr } from "./core/option.ts"; import * as locks_Lock from "./locks.Lock.ts"; import * as locks_Tally from "./locks.Tally.ts"; /** Each byte an operation on the mutexes, its value the operand; each puts what it read. */ export function locks(data: rt.ByteSlice, out: rt.ByteVec): void { - let _71!: boolean; + let _85!: boolean; const shared: rt.Arc> = new rt.Arc(new rt.Mutex(locks_Tally.default$Default())); const other: rt.Arc> = rt.arcClone(shared); const own: rt.Mutex = new rt.Mutex(new rt.ByteVec()); const number: rt.Mutex = new rt.Mutex(0); + const slot: rt.Mutex = new rt.Mutex(undefined); const lock: locks_Lock.Lock = { _0: new rt.Mutex(7) }; for (const op of rt.byteSliceView(data)) { - const _17: rt.u8 = rt.u8Rem(op, 8); - if (_17 === 0) { + const _18: rt.u8 = rt.u8Rem(op, 8); + if (_18 === 0) { const tally: rt.Mutex = rt.mutexLock(shared.value); tally.value.n = rt.u64Add(tally.value.n, op as rt.u64); rt.byteVecPush(tally.value.seen, op); rt.mutexUnlock(tally); - } else if (_17 === 1) { + } else if (_18 === 1) { const tally2: rt.Mutex = rt.mutexLock(other.value); rt.byteVecPush(out, rt.u64Low(tally2.value.n) & 0xff); rt.byteVecPush(out, tally2.value.seen.length & 0xff); rt.mutexUnlock(tally2); - } else if (_17 === 2) { + } else if (_18 === 2) { rt.byteVecPush(own.value, op); - } else if (_17 === 3) { - const _50: rt.u32 = op as rt.u32; - const _53: rt.Mutex = rt.mutexLock(number); - _53.value = rt.u32Add(_53.value, _50); - rt.mutexUnlock(_53); - const _62: rt.Mutex = rt.mutexLock(number); - rt.byteVecPush(out, _62.value & 0xff); - rt.mutexUnlock(_62); - } else if (_17 === 4) { - const held: rt.Mutex = rt.mutexLock(shared.value); - const _72: rt.Result, rt.TryLockError>> = rt.mutexTryLock(other.value); - if (!_72.ok) { - _71 = true; + const _52: rt.u32 = op as rt.u32; + const _53: rt.Place = rt.valuePlace(number); + _53.v = rt.u32Add(_53.v, _52); + const held: rt.Place = rt.valuePlace(slot); + const taken = held.v; + held.v = undefined; + rt.byteVecPush(out, option_unwrapOr$0r2bmpr(taken, 253)); + held.v = op; + } else if (_18 === 3) { + const _64: rt.u32 = op as rt.u32; + const _67: rt.Mutex = rt.mutexLock(number); + _67.value = rt.u32Add(_67.value, _64); + rt.mutexUnlock(_67); + const _76: rt.Mutex = rt.mutexLock(number); + rt.byteVecPush(out, _76.value & 0xff); + rt.mutexUnlock(_76); + } else if (_18 === 4) { + const held2: rt.Mutex = rt.mutexLock(shared.value); + const _86: rt.Result, rt.TryLockError>> = rt.mutexTryLock(other.value); + if (!_86.ok) { + _85 = true; } else { - _71 = false; + _85 = false; } - rt.byteVecPush(out, _71 ? 1 : 0); - drop$Result_sync_MutexGuard_locks_Tally_sync_TryLockError_sync_MutexGuard_locks_Tally(_72); - rt.mutexUnlock(held); - const _78: rt.Result, rt.TryLockError>> = rt.mutexTryLock(other.value); - if (_78.ok) { - const tally3: rt.Mutex = _78.value; + rt.byteVecPush(out, _85 ? 1 : 0); + drop$Result_sync_MutexGuard_locks_Tally_sync_TryLockError_sync_MutexGuard_locks_Tally(_86); + rt.mutexUnlock(held2); + const _92: rt.Result, rt.TryLockError>> = rt.mutexTryLock(other.value); + if (_92.ok) { + const tally3: rt.Mutex = _92.value; rt.byteVecPush(out, tally3.value.seen.length & 0xff); rt.mutexUnlock(tally3); } else { rt.byteVecPush(out, 254); } - } else if (_17 === 5) { - const _90: rt.u32 = op as rt.u32; - const _93: rt.Mutex = rt.mutexLock(lock._0); - _93.value = rt.u32Add(_93.value, _90); - rt.mutexUnlock(_93); + } else if (_18 === 5) { + const _104: rt.u32 = op as rt.u32; + const _107: rt.Mutex = rt.mutexLock(lock._0); + _107.value = rt.u32Add(_107.value, _104); + rt.mutexUnlock(_107); const args2: rt.Fmt[] = [(f: rt.Formatter) => locks_Lock.fmt$fmt_Debug(lock, f)]; const free: string = rt.fmtFormat([args2[0]]); const guard: rt.Result, rt.TryLockError>> = rt.mutexTryLock(lock._0); const args4: rt.Fmt[] = [(f: rt.Formatter) => locks_Lock.fmt$fmt_Debug(lock, f)]; - const held2: string = rt.fmtFormat([args4[0]]); - const _125: boolean = guard.ok; - const args6: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, free), (f: rt.Formatter) => rt.fmtPad(f, held2), (f: rt.Formatter) => rt.fmtBool(_125, f)]; + const held3: string = rt.fmtFormat([args4[0]]); + const _139: boolean = guard.ok; + const args6: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, free), (f: rt.Formatter) => rt.fmtPad(f, held3), (f: rt.Formatter) => rt.fmtBool(_139, f)]; rt.byteVecExtendFromSlice(out, rt.stringAsBytes(rt.fmtFormat([args6[0], " ", args6[1], " ", args6[2]]))); drop$Result_sync_MutexGuard_u32_sync_TryLockError_sync_MutexGuard_u32(guard); - } else if (_17 === 6) { + } else if (_18 === 6) { rt.byteVecPush(out, false ? 1 : 0); } else { const tally4: rt.Mutex = rt.mutexLock(shared.value); @@ -79,6 +88,8 @@ export function locks(data: rt.ByteSlice, out: rt.ByteVec): void { } rt.byteVecExtendFromSlice(out, rt.byteVecSlice(own.value)); rt.byteVecPush(out, shared.strong & 0xff); + rt.byteVecPush(out, number.value & 0xff); + rt.byteVecPush(out, option_unwrapOr$0r2bmpr(slot.value, 253)); other[Symbol.dispose](); shared[Symbol.dispose](); } @@ -106,79 +117,94 @@ export function relock(data: rt.ByteSlice, out: rt.ByteVec): void { * read. */ export function rwlocks(data: rt.ByteSlice, out: rt.ByteVec): void { - let _74!: boolean; - let _90!: boolean; + let _75!: boolean; + let _91!: boolean; const lock: rt.Arc> = new rt.Arc(new rt.RefCell(locks_Tally.default$Default())); const number: rt.RefCell = new rt.RefCell(0); + const owned: rt.RefCell = new rt.RefCell(new rt.ByteVec()); for (const op of rt.byteSliceView(data)) { - const _12: rt.u8 = rt.u8Rem(op, 6); - if (_12 === 0) { + const _13: rt.u8 = rt.u8Rem(op, 8); + if (_13 === 0) { const tally: rt.RefCell = rt.rwLockWrite(lock.value); tally.value.n = rt.u64Add(tally.value.n, op as rt.u64); rt.byteVecPush(tally.value.seen, op); rt.refMutRelease(tally); - } else if (_12 === 1) { + } else if (_13 === 1) { const a: rt.RefCell = rt.rwLockRead(lock.value); const b: rt.RefCell = rt.rwLockRead(lock.value); rt.byteVecPush(out, a.value.seen.length & 0xff); rt.byteVecPush(out, rt.u64Low(b.value.n) & 0xff); rt.refRelease(b); rt.refRelease(a); - } else if (_12 === 2) { - const _46: rt.u32 = op as rt.u32; - const _49: rt.RefCell = rt.rwLockWrite(number); - _49.value = rt.u32Add(_49.value, _46); - rt.refMutRelease(_49); - const _58: rt.RefCell = rt.rwLockRead(number); - rt.byteVecPush(out, _58.value & 0xff); - rt.refRelease(_58); - } else if (_12 === 3) { + } else if (_13 === 2) { + const _47: rt.u32 = op as rt.u32; + const _50: rt.RefCell = rt.rwLockWrite(number); + _50.value = rt.u32Add(_50.value, _47); + rt.refMutRelease(_50); + const _59: rt.RefCell = rt.rwLockRead(number); + rt.byteVecPush(out, _59.value & 0xff); + rt.refRelease(_59); + } else if (_13 === 3) { const read: rt.RefCell = rt.rwLockRead(lock.value); - const _69: rt.Result, rt.TryLockError>> = rt.rwLockTryRead(lock.value); - rt.byteVecPush(out, _69.ok ? 1 : 0); - drop$Result_sync_RwLockReadGuard_locks_Tally_sync_TryLockError_sync_RwLockReadGuard_locks_Tally(_69); - const _75: rt.Result, rt.TryLockError>> = rt.rwLockTryWrite(lock.value); - if (!_75.ok) { - _74 = true; + const _70: rt.Result, rt.TryLockError>> = rt.rwLockTryRead(lock.value); + rt.byteVecPush(out, _70.ok ? 1 : 0); + drop$Result_sync_RwLockReadGuard_locks_Tally_sync_TryLockError_sync_RwLockReadGuard_locks_Tally(_70); + const _76: rt.Result, rt.TryLockError>> = rt.rwLockTryWrite(lock.value); + if (!_76.ok) { + _75 = true; } else { - _74 = false; + _75 = false; } - rt.byteVecPush(out, _74 ? 1 : 0); - drop$Result_sync_RwLockWriteGuard_locks_Tally_sync_TryLockError_sync_RwLockWriteGuard_locks_Tally(_75); + rt.byteVecPush(out, _75 ? 1 : 0); + drop$Result_sync_RwLockWriteGuard_locks_Tally_sync_TryLockError_sync_RwLockWriteGuard_locks_Tally(_76); rt.refRelease(read); const write: rt.Result, rt.TryLockError>> = rt.rwLockTryWrite(lock.value); rt.byteVecPush(out, write.ok ? 1 : 0); - const _91: rt.Result, rt.TryLockError>> = rt.rwLockTryRead(lock.value); - if (!_91.ok) { - _90 = true; + const _92: rt.Result, rt.TryLockError>> = rt.rwLockTryRead(lock.value); + if (!_92.ok) { + _91 = true; } else { - _90 = false; + _91 = false; } - rt.byteVecPush(out, _90 ? 1 : 0); - drop$Result_sync_RwLockReadGuard_locks_Tally_sync_TryLockError_sync_RwLockReadGuard_locks_Tally(_91); + rt.byteVecPush(out, _91 ? 1 : 0); + drop$Result_sync_RwLockReadGuard_locks_Tally_sync_TryLockError_sync_RwLockReadGuard_locks_Tally(_92); drop$Result_sync_RwLockWriteGuard_locks_Tally_sync_TryLockError_sync_RwLockWriteGuard_locks_Tally(write); - } else if (_12 === 4) { - const _96: rt.Result, rt.TryLockError>> = rt.rwLockTryWrite(lock.value); - if (_96.ok) { - const tally2: rt.RefCell = _96.value; + } else if (_13 === 4) { + const _97: rt.Result, rt.TryLockError>> = rt.rwLockTryWrite(lock.value); + if (_97.ok) { + const tally2: rt.RefCell = _97.value; rt.byteVecPush(out, tally2.value.seen.length & 0xff); rt.refMutRelease(tally2); } else { rt.byteVecPush(out, 254); } - } else { + } else if (_13 === 5) { const made: rt.RefCell = new rt.RefCell(new rt.ByteVec()); - const _112: rt.RefCell = rt.rwLockWrite(made); - rt.byteVecPush(_112.value, op); - rt.refMutRelease(_112); - const _119: rt.RefCell = rt.rwLockRead(made); - rt.byteVecExtendFromSlice(out, rt.byteVecSlice(_119.value)); - rt.refRelease(_119); + const _113: rt.RefCell = rt.rwLockWrite(made); + rt.byteVecPush(_113.value, op); + rt.refMutRelease(_113); + const _120: rt.RefCell = rt.rwLockRead(made); + rt.byteVecExtendFromSlice(out, rt.byteVecSlice(_120.value)); + rt.refRelease(_120); + } else if (_13 === 6) { + const _123: rt.u32 = op as rt.u32; + const _124: rt.Place = rt.valuePlace(number); + _124.v = rt.u32Add(_124.v, _123); + rt.byteVecPush(owned.value, op); + const _137: rt.RefCell = rt.rwLockRead(number); + rt.byteVecPush(out, _137.value & 0xff); + rt.refRelease(_137); + } else { + const tally3: locks_Tally.Tally = new rt.RefCell({ n: op as rt.u64, seen: rt.byteVecFrom(Uint8Array.of(op)) }).value; + rt.byteVecPush(out, rt.u64Low(tally3.n) & 0xff); + rt.byteVecExtendFromSlice(out, rt.byteVecSlice(tally3.seen)); } } - const _127: rt.RefCell = rt.rwLockRead(lock.value); - rt.byteVecPush(out, rt.u64Low(_127.value.n) & 0xff); - rt.refRelease(_127); + const _158: rt.RefCell = rt.rwLockRead(lock.value); + rt.byteVecPush(out, rt.u64Low(_158.value.n) & 0xff); + rt.refRelease(_158); + rt.byteVecPush(out, number.value & 0xff); + rt.byteVecExtendFromSlice(out, rt.byteVecSlice(owned.value)); lock[Symbol.dispose](); } diff --git a/ts/fixtures/lang/src/borrows.rs b/ts/fixtures/lang/src/borrows.rs index 93b55a795..e81f94ad6 100644 --- a/ts/fixtures/lang/src/borrows.rs +++ b/ts/fixtures/lang/src/borrows.rs @@ -1,8 +1,10 @@ //! `Cell`s and `RefCell`s on one thread: read, written, replaced, and taken, of numbers, //! tuples, and values that drop; borrowed shared and exclusive, held in bindings and -//! dropped; and borrowed again while held, which panics as wasm32's does. +//! dropped; and borrowed again while held, which panics as wasm32's does. `RefCell`s +//! cloned, written through `get_mut`, taken apart, tried, and borrowed through mapped and +//! cloned guards, each released as it drops. -use std::cell::{Cell, RefCell}; +use std::cell::{Cell, Ref, RefCell}; use std::sync::{Arc, Mutex}; /// Logs its id when it drops. @@ -114,6 +116,165 @@ pub fn borrows(data: &[u8], out: &mut Vec) { flush(&log, out); } +/// Logs its id as it is cloned, with the high bit set, and as it drops; its clone's id +/// is one more. +struct Tagged { + id: u8, + n: u32, + log: Arc>>, +} + +impl Clone for Tagged { + fn clone(&self) -> Self { + self.log.lock().unwrap().push(0x80 | self.id); + Self { + id: self.id.wrapping_add(1), + n: self.n, + log: self.log.clone(), + } + } +} + +impl Drop for Tagged { + fn drop(&mut self) { + self.log.lock().unwrap().push(self.id); + } +} + +/// Each byte an operation on `RefCell`s, its value the operand: cloned, written through +/// `get_mut`, taken apart, tried, and borrowed through mapped and cloned guards; each puts +/// what it read and what dropped. +pub fn guards(data: &[u8], out: &mut Vec) { + let log = Arc::new(Mutex::new(Vec::new())); + let tag = |id| Tagged { + id, + n: 0, + log: log.clone(), + }; + let mut number = RefCell::new(0u32); + let mut bytes: RefCell> = RefCell::new(Vec::new()); + let mut tagged = RefCell::new(tag(0)); + for &op in data { + match op % 8 { + 0 => { + *number.get_mut() += u32::from(op); + bytes.get_mut().push(op); + tagged.get_mut().n += 1; + out.push(*number.borrow() as u8); + } + // A clone borrows what it clones, which panics while it is mutably borrowed, and a + // clone of a reference to it, or to an `Arc`, is that reference. + 1 => { + let alias = twin(&&number); + *alias.borrow_mut() += 1; + out.push(*number.borrow() as u8); + out.push(Arc::strong_count(twin(&&log)) as u8); + let held = (op >> 4 == 0xe).then(|| tagged.borrow()); + let held_mut = (op >> 4 == 0xf).then(|| tagged.borrow_mut()); + let copy = tagged.clone(); + out.push(copy.borrow().id); + drop((held, held_mut)); + out.extend_from_slice(&bytes.clone().into_inner()); + out.push(number.clone().into_inner() as u8); + } + // Taken apart, which drops nothing until what it held does. + 2 => { + let inner = RefCell::new(tag(op)).into_inner(); + out.push(inner.id); + flush(&log, out); + drop(inner); + } + // Tried while borrowed shared, then exclusive, then free. + 3 => { + let shared = bytes.borrow(); + let read = bytes.try_borrow(); + out.push(read.is_ok() as u8); + match bytes.try_borrow_mut() { + Ok(_) => out.push(0xfe), + Err(e) => out.extend_from_slice(format!("{e} {e:?}").as_bytes()), + } + drop((read, shared)); + let write = bytes.try_borrow_mut(); + out.push(write.is_ok() as u8); + match bytes.try_borrow() { + Ok(_) => out.push(0xfe), + Err(e) => out.extend_from_slice(format!("{e} {e:?}").as_bytes()), + } + drop(write); + let pushed = bytes.try_borrow_mut().map(|mut b| { + b.push(op); + b.len() as u8 + }); + out.push(pushed.unwrap_or(0xfd)); + } + // Mapped to a part, and that to a part of its own, released as each drops. + 4 => { + let n = Ref::map(tagged.borrow(), |t| &t.n); + let id = Ref::map(tagged.borrow(), |t| &t.id); + out.extend_from_slice(&[*n as u8, *id]); + out.push(tagged.try_borrow_mut().is_err() as u8); + drop(n); + out.push(tagged.try_borrow_mut().is_err() as u8); + drop(id); + out.push(tagged.try_borrow_mut().is_err() as u8); + let half = Ref::map(bytes.borrow(), |b| &b[b.len() / 2..]); + out.push(half.len() as u8); + let last = Ref::map(half, |s| s.last().unwrap_or(&0xfd)); + out.push(*last); + out.push(bytes.try_borrow_mut().is_err() as u8); + drop(last); + out.push(bytes.try_borrow_mut().is_err() as u8); + } + // Cloned, each clone a borrow of its own, mapped or not. + 5 => { + let a = bytes.borrow(); + let b = Ref::clone(&a); + drop(a); + out.push(bytes.try_borrow_mut().is_err() as u8); + let c = Ref::map(Ref::clone(&b), |v| v.first().unwrap_or(&0xfd)); + let d = Ref::clone(&c); + drop((b, c)); + out.push(*d); + out.push(bytes.try_borrow_mut().is_err() as u8); + drop(d); + out.push(bytes.try_borrow_mut().is_err() as u8); + } + // Borrowed exclusively while a mapped or cloned guard holds it, which panics. + 6 => match op >> 4 { + 0xe => { + let _n = Ref::map(tagged.borrow(), |t| &t.n); + let _w = tagged.borrow_mut(); + } + 0xf => { + let a = tagged.borrow(); + let _b = Ref::clone(&a); + drop(a); + let _w = tagged.borrow_mut(); + } + _ => out.push(tagged.borrow_mut().id), + }, + // The cell replaced, and the one it was taken apart. + _ => { + let old = std::mem::replace(&mut tagged, RefCell::new(tag(op))); + out.push(old.into_inner().id); + } + } + flush(&log, out); + } + out.push(number.into_inner() as u8); + out.extend_from_slice(&bytes.into_inner()); + let last = tagged.into_inner(); + out.push(last.id); + flush(&log, out); + drop(last); + flush(&log, out); +} + +/// A clone of `t`, which for a reference is that reference. +fn twin(t: &T) -> T { + t.clone() +} + /// Puts what dropped since the last flush. fn flush(log: &Mutex>, out: &mut Vec) { let mut log = log.lock().unwrap(); diff --git a/ts/fixtures/lang/src/cells.rs b/ts/fixtures/lang/src/cells.rs index e64bd4cac..8cdbf3d35 100644 --- a/ts/fixtures/lang/src/cells.rs +++ b/ts/fixtures/lang/src/cells.rs @@ -1,5 +1,6 @@ //! One-time cells, `OnceCell` and `OnceLock`, of values that are numbers, wide integers, -//! `Option`s whose `None` is `rt.None`, `()`, and strings: read, set, initialized, taken, +//! `Option`s whose `None` is `rt.None`, `()`, strings, and vectors: read, set, initialized, taken, +//! cloned, debugged, written through `get_mut`, initialized by a function that may fail, //! and initialized again from within their own initialization, which panics. use std::cell::OnceCell; @@ -16,7 +17,7 @@ macro_rules! cells { while let [op, v, rest @ ..] = data { data = rest; let (op, v) = (*op, *v); - match op % 9 { + match op % 13 { 0 => match cell.get() { Some(t) => { out.push(1); @@ -67,10 +68,71 @@ macro_rules! cells { out.extend_from_slice(&inner); } 7 => put(out, cell.get_or_init(|| panic!("init {v}"))), - _ => match v % 2 { + 8 => match v % 2 { 0 => cell = $cell::from(make(v)), _ => cell = Default::default(), }, + // A clone holds a clone of what it holds, and nothing while it initializes. + 9 => { + let alias = twin(&&cell); + let copy = cell.clone(); + let mut inner = None; + let t = cell.get_or_init(|| { + inner = Some(cell.clone()); + make(v) + }); + put(out, t); + out.push(alias.get().is_some() as u8); + for copy in [Some(copy), inner].into_iter().flatten() { + match copy.into_inner() { + Some(t) => put(out, &t), + None => out.push(0xee), + } + } + } + // Debugged, and debugged while it initializes. + 10 => { + let mut inner = String::new(); + let t = cell.get_or_init(|| { + inner = format!("{cell:?}"); + make(v) + }); + put(out, t); + let text = match v % 2 { + 0 => format!("{inner} {cell:?}"), + _ => format!("{inner} {cell:#?}"), + }; + out.extend_from_slice(text.as_bytes()); + } + 11 => match cell.get_mut() { + Some(t) => { + *t = make(v); + out.push(1); + put(out, cell.get().unwrap()); + } + None => out.push(0), + }, + // Fails, or not, and is set from within its own initialization. + _ => { + let result = match v % 4 { + 0 | 1 => cell.get_or_try_init(|| made(make, v)), + 2 => cell.get_or_try_init(|| { + _ = cell.set(make(v ^ 1)); + made(make, v) + }), + _ => cell.get_or_try_init(|| { + let inner = cell.get_or_try_init(|| made(make, v ^ 1)).map(|_| ()).err(); + made(make, inner.unwrap_or(v)) + }), + }; + match result { + Ok(t) => { + out.push(1); + put(out, t); + } + Err(e) => out.extend_from_slice(&[0, e]), + } + } } } match cell.into_inner() { @@ -99,6 +161,21 @@ cells! { lock_unit: OnceLock<()>, |_| (), |out, _| out.push(0xaa); cell_string: OnceCell, |v| v.to_string(), |out, t| out.extend_from_slice(t.as_bytes()); lock_string: OnceLock, |v| v.to_string(), |out, t| out.extend_from_slice(t.as_bytes()); + cell_vec: OnceCell>, |v| vec![v; usize::from(v % 4)], |out, t| out.extend_from_slice(t); + lock_vec: OnceLock>, |v| vec![v; usize::from(v % 4)], |out, t| out.extend_from_slice(t); +} + +/// A clone of `t`, which for a reference is that reference. +fn twin(t: &T) -> T { + t.clone() +} + +/// What `make` makes of `v`, or `v` back as an error for every third byte. +fn made(make: fn(u8) -> T, v: u8) -> Result { + match v % 3 { + 0 => Err(v), + _ => Ok(make(v)), + } } /// A `u64` past 2^53, from one byte. diff --git a/ts/fixtures/lang/src/harness.rs b/ts/fixtures/lang/src/harness.rs index 667375b25..9a6d553cb 100644 --- a/ts/fixtures/lang/src/harness.rs +++ b/ts/fixtures/lang/src/harness.rs @@ -268,6 +268,7 @@ fn cases() -> Vec<(&'static str, Case)> { ("arrays::flattened", arrays::flattened), ("args::args", args::args), ("returns::returns", returns::returns), + ("borrows::guards", |_, data, out| borrows::guards(data, out)), ] } diff --git a/ts/fixtures/lang/src/lib.rs b/ts/fixtures/lang/src/lib.rs index 0499de34f..cec049032 100644 --- a/ts/fixtures/lang/src/lib.rs +++ b/ts/fixtures/lang/src/lib.rs @@ -24,7 +24,13 @@ //! `harness::run` is the entry point both sides of the differential test run, and //! `fmt::Fault` an error only `caller.ts` prints. -#![feature(iter_order_by, split_as_slice, wrapping_int_impl, wrapping_next_power_of_two)] +#![feature( + iter_order_by, + once_cell_try, + split_as_slice, + wrapping_int_impl, + wrapping_next_power_of_two +)] mod args; mod arrays; diff --git a/ts/fixtures/lang/src/locks.rs b/ts/fixtures/lang/src/locks.rs index 5deb81bca..618590207 100644 --- a/ts/fixtures/lang/src/locks.rs +++ b/ts/fixtures/lang/src/locks.rs @@ -1,8 +1,8 @@ //! Mutexes on one thread, where a panic aborts and so never poisons one: made by //! `Default`, read and written through a guard, recovered from a `PoisonError` that never -//! comes, read by `get_mut` without locking, tried while held and free, and locked again +//! comes, read and written by `get_mut` without locking, taken apart, tried while held and free, and locked again //! while held, which panics as wasm32's does; and read-write locks, read and written, -//! tried while read and while written. +//! tried while read and while written, written through `get_mut`, and taken apart. use std::fmt; use std::sync::{Arc, Mutex, PoisonError, RwLock, TryLockError}; @@ -31,7 +31,8 @@ pub fn locks(data: &[u8], out: &mut Vec) { let shared: Arc> = Arc::default(); let other = shared.clone(); let mut own: Mutex> = Mutex::default(); - let number: Mutex = Mutex::default(); + let mut number: Mutex = Mutex::default(); + let mut slot: Mutex> = Mutex::default(); let lock = Lock(Mutex::new(7)); for &op in data { match op % 8 { @@ -45,7 +46,14 @@ pub fn locks(data: &[u8], out: &mut Vec) { out.push(tally.n as u8); out.push(tally.seen.len() as u8); } - 2 => own.get_mut().unwrap().push(op), + // A value JS copies, written in place, as moq's `Content` takes its own. + 2 => { + own.get_mut().unwrap().push(op); + *number.get_mut().unwrap() += u32::from(op); + let held = slot.get_mut().unwrap_or_else(PoisonError::into_inner); + out.push(held.take().unwrap_or(0xfd)); + *held = Some(op); + } 3 => { *number.lock().unwrap() += u32::from(op); out.push(*number.lock().unwrap() as u8); @@ -79,6 +87,8 @@ pub fn locks(data: &[u8], out: &mut Vec) { } out.extend_from_slice(own.get_mut().unwrap_or_else(PoisonError::into_inner)); out.push(Arc::strong_count(&shared) as u8); + out.push(number.into_inner().unwrap() as u8); + out.push(slot.into_inner().unwrap().unwrap_or(0xfd)); } /// Locks a mutex while a guard of it is held, if the first byte is odd, which panics. @@ -97,9 +107,10 @@ pub fn relock(data: &[u8], out: &mut Vec) { /// read. pub fn rwlocks(data: &[u8], out: &mut Vec) { let lock: Arc> = Arc::default(); - let number = RwLock::new(0u32); + let mut number = RwLock::new(0u32); + let mut owned: RwLock> = RwLock::default(); for &op in data { - match op % 6 { + match op % 8 { 0 => { let mut tally = lock.write().unwrap(); tally.n += u64::from(op); @@ -131,12 +142,28 @@ pub fn rwlocks(data: &[u8], out: &mut Vec) { Err(TryLockError::WouldBlock) => out.push(0xfe), Err(TryLockError::Poisoned(err)) => out.push(err.into_inner().n as u8), }, - _ => { + 5 => { let made: RwLock> = RwLock::default(); made.write().unwrap().push(op); out.extend_from_slice(&made.read().unwrap()); } + 6 => { + *number.get_mut().unwrap() += u32::from(op); + owned.get_mut().unwrap_or_else(PoisonError::into_inner).push(op); + out.push(*number.read().unwrap() as u8); + } + _ => { + let made = RwLock::new(Tally { + n: u64::from(op), + seen: vec![op], + }); + let tally = made.into_inner().unwrap(); + out.push(tally.n as u8); + out.extend_from_slice(&tally.seen); + } } } out.push(lock.read().unwrap().n as u8); + out.push(number.into_inner().unwrap() as u8); + out.extend_from_slice(&owned.into_inner().unwrap_or_else(PoisonError::into_inner)); } diff --git a/ts/fixtures/reject/census.md b/ts/fixtures/reject/census.md index e9355d31b..9510bc21a 100644 --- a/ts/fixtures/reject/census.md +++ b/ts/fixtures/reject/census.md @@ -1,20 +1,20 @@ # Census of `reject-fixture` -- Refusals: 218 -- Function instances: 273 +- Refusals: 217 +- Function instances: 272 - Generic functions no instance reached, lowered over their type parameters: 13 ## By construct | Count | Construct | First | | ---: | --- | --- | -| 45 | a raw pointer to `_` in `_`, which the crate may put another object in place of | fixtures/reject/src/lib.rs:617:10 | +| 45 | a raw pointer to `_` in `_`, which the crate may put another object in place of | fixtures/reject/src/lib.rs:610:10 | | 26 | unsupported call to `_` | fixtures/reject/src/lib.rs:167:8 | -| 19 | a raw pointer to `_` in a variable assigned again while it may point there | fixtures/reject/src/lib.rs:625:10 | -| 15 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | fixtures/reject/src/lib.rs:1346:33 | -| 15 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | fixtures/reject/src/lib.rs:1664:18 | -| 6 | `_` with a mutable reference to a value JS copies, which its mapping would copy | fixtures/reject/src/lib.rs:523:12 | -| 5 | a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet | fixtures/reject/src/lib.rs:688:10 | +| 19 | a raw pointer to `_` in a variable assigned again while it may point there | fixtures/reject/src/lib.rs:618:10 | +| 15 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | fixtures/reject/src/lib.rs:1339:33 | +| 15 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | fixtures/reject/src/lib.rs:1657:18 | +| 5 | `_` with a mutable reference to a value JS copies, which its mapping would copy | fixtures/reject/src/lib.rs:1237:22 | +| 5 | a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet | fixtures/reject/src/lib.rs:681:10 | | 4 | a variant of `_`, which is not supported: either is the same JS string | fixtures/reject/src/lib.rs:338:2 | | 3 | a copy of a closure that changes what it captured | fixtures/reject/src/lib.rs:231:14 | | 3 | an assignment through a reference to `_` | fixtures/reject/src/lib.rs:90:2 | @@ -25,60 +25,60 @@ | 2 | `_` of `_`, whose `clone_from` is its own, which is not supported yet | fixtures/reject/src/lib.rs:21:4 | | 2 | `_`, a trait object of another crate's trait, which is not supported yet | fixtures/reject/src/lib.rs:11:16 | | 2 | `_`, a trait object of the generic trait `_`, which is not supported yet | fixtures/reject/src/lib.rs:466:23 | -| 2 | a cast from a pointer to `_` to one to `_`, which reads the bytes of one type as another | fixtures/reject/src/lib.rs:564:27 | +| 2 | a cast from a pointer to `_` to one to `_`, which reads the bytes of one type as another | fixtures/reject/src/lib.rs:557:27 | | 2 | a coercion to `_`, which is not supported yet | fixtures/reject/src/lib.rs:457:40 | -| 2 | a raw pointer to a place of `()`, which has no address of its own | fixtures/reject/src/lib.rs:737:15 | +| 2 | a raw pointer to a place of `()`, which has no address of its own | fixtures/reject/src/lib.rs:730:15 | | 2 | an iterator of the crate implementing `_`, which is not supported yet | fixtures/reject/src/lib.rs:152:1 | | 2 | overriding `_`, which std's adaptors call in place of `next` or beside it | fixtures/reject/src/lib.rs:132:2 | | 2 | passing `_`, which drops, to `_`, which is not supported yet | fixtures/reject/src/lib.rs:333:4 | | 2 | unsupported type `_` from another crate | fixtures/reject/src/lib.rs:440:32 | -| 1 | `Buf::copy_to_bytes` of `_`, a value JS copies, which is not supported | fixtures/reject/src/lib.rs:770:2 | +| 1 | `Buf::copy_to_bytes` of `_`, a value JS copies, which is not supported | fixtures/reject/src/lib.rs:763:2 | | 1 | `BufMut::put` of `_` into a `BytesMut`, which picks the methods it calls by a capacity that depends on whether the other handles of its storage dropped, which is not supported | fixtures/reject/src/lib.rs:396:2 | | 1 | `Bytes::from_owner` of `_`, which would drop with the last clone of what it makes, which is not supported | fixtures/reject/src/lib.rs:381:2 | -| 1 | `Extend` of `_` by `_`, whose `_` of `_` is not supported yet | fixtures/reject/src/lib.rs:1281:31 | +| 1 | `Extend` of `_` by `_`, whose `_` of `_` is not supported yet | fixtures/reject/src/lib.rs:1274:31 | | 1 | `Pointer` formatting, as in `{:p}`, is not supported | fixtures/reject/src/lib.rs:56:2 | | 1 | `_` is not supported: its `Pending` and `Ready` would both be `rt.OuterPending` | fixtures/reject/src/lib.rs:79:20 | | 1 | `_` is not supported: its field `_` is `_`, typed `_`, whose `None` would be `rt.None` as `_` | fixtures/reject/src/lib.rs:31:2 | | 1 | `_` is not supported: its field `_` is `_`, typed `_`, whose `Pending` would be `rt.OuterPending` as `_` | fixtures/reject/src/lib.rs:504:2 | | 1 | `_` of `_` by `_`, which is not supported yet | fixtures/reject/src/lib.rs:260:6 | -| 1 | `_` of `_`, which is not supported yet | fixtures/reject/src/lib.rs:547:4 | +| 1 | `_` of `_`, which is not supported yet | fixtures/reject/src/lib.rs:540:4 | | 1 | `_`, which is not supported yet | fixtures/reject/src/lib.rs:268:9 | | 1 | `_`, which reads a capacity that depends on whether the other handles of its storage dropped, which is not supported | fixtures/reject/src/lib.rs:390:6 | -| 1 | `clone_from` of `_`, whose items' `clone_from` is their own, which is not supported yet | fixtures/reject/src/lib.rs:2128:4 | -| 1 | `collect` of `_`, which sorts by `_`'s own `Ord`, of entries that drop, which is not supported yet | fixtures/reject/src/lib.rs:964:22 | +| 1 | `clone_from` of `_`, whose items' `clone_from` is their own, which is not supported yet | fixtures/reject/src/lib.rs:2121:4 | +| 1 | `collect` of `_`, which sorts by `_`'s own `Ord`, of entries that drop, which is not supported yet | fixtures/reject/src/lib.rs:957:22 | | 1 | `fmt::Arguments` with a placeholder, or not made in place, written to `_`'s own `fmt::Write`, which is not supported yet: std splits what a placeholder writes into `write_str` calls the runtime does not make | fixtures/reject/src/lib.rs:62:10 | | 1 | a `collect` in place of `_`, a zip std reads by index, holding values that drop, which is not supported yet | fixtures/reject/src/lib.rs:216:40 | | 1 | a `skip` of `_`, a zip std reads by index, of items that drop, which is not supported yet | fixtures/reject/src/lib.rs:209:8 | | 1 | a cast from `_` to `_` | fixtures/reject/src/lib.rs:75:2 | -| 1 | a cast from `_` to `_`, which reads the bytes of one type as another | fixtures/reject/src/lib.rs:1722:33 | -| 1 | a coercion of `_` to `_`, a pointer to a slice | fixtures/reject/src/lib.rs:1723:28 | +| 1 | a cast from `_` to `_`, which reads the bytes of one type as another | fixtures/reject/src/lib.rs:1715:33 | +| 1 | a coercion of `_` to `_`, a pointer to a slice | fixtures/reject/src/lib.rs:1716:28 | | 1 | a coercion to `_` | fixtures/reject/src/lib.rs:298:2 | -| 1 | a constant of type `_`, a pointer into memory translation can't name | fixtures/reject/src/lib.rs:787:3 | -| 1 | a dangling pointer to `_`, a value of no bytes made of more than structs and tuples | fixtures/reject/src/lib.rs:746:11 | +| 1 | a constant of type `_`, a pointer into memory translation can't name | fixtures/reject/src/lib.rs:780:3 | +| 1 | a dangling pointer to `_`, a value of no bytes made of more than structs and tuples | fixtures/reject/src/lib.rs:739:11 | | 1 | a future of `_`, which can be `rt.Pending`, as the future's own `Pending` is | fixtures/reject/src/lib.rs:84:34 | | 1 | a mutable reference into a `Result`'s payload, passed on or kept | fixtures/reject/src/lib.rs:369:12 | | 1 | a mutable static, which any code may write | fixtures/reject/src/lib.rs:68:11 | -| 1 | a pointer's address, which JS has no counterpart of | fixtures/reject/src/lib.rs:569:17 | +| 1 | a pointer's address, which JS has no counterpart of | fixtures/reject/src/lib.rs:562:17 | | 1 | a printable type must implement `Display` or `Debug` | fixtures/reject/src/lib.rs:71:1 | -| 1 | a raw pointer to `_` behind a reference, which is the object and not where it is kept | fixtures/reject/src/lib.rs:586:10 | -| 1 | a reference through which a raw pointer may be made into `_` in an element, a payload, or a union field, which is not supported yet | fixtures/reject/src/lib.rs:1373:11 | +| 1 | a raw pointer to `_` behind a reference, which is the object and not where it is kept | fixtures/reject/src/lib.rs:579:10 | +| 1 | a reference through which a raw pointer may be made into `_` in an element, a payload, or a union field, which is not supported yet | fixtures/reject/src/lib.rs:1366:11 | | 1 | a scalar constant of type `_` | fixtures/reject/src/lib.rs:8:2 | | 1 | a trait object of `_`, which is not supported yet | fixtures/reject/src/lib.rs:483:26 | | 1 | a zero-sized constant of type `_` | fixtures/reject/src/lib.rs:50:2 | -| 1 | an upcast from `_` to `_`, which is not supported yet | fixtures/reject/src/lib.rs:541:32 | +| 1 | an upcast from `_` to `_`, which is not supported yet | fixtures/reject/src/lib.rs:534:32 | | 1 | arithmetic on `_` | fixtures/reject/src/lib.rs:8:2 | -| 1 | comparing `_` | fixtures/reject/src/lib.rs:1721:41 | +| 1 | comparing `_` | fixtures/reject/src/lib.rs:1714:41 | | 1 | comparing `_` as a key, which is not supported yet | fixtures/reject/src/lib.rs:242:75 | -| 1 | comparing pointers to `_` in an atomic, which JS has no address of | fixtures/reject/src/lib.rs:786:15 | -| 1 | comparing pointers to `_`, each a place JS makes of its own | fixtures/reject/src/lib.rs:605:2 | -| 1 | comparing pointers to `_`, which has no bytes and so no address of its own | fixtures/reject/src/lib.rs:737:70 | -| 1 | const generic types are not supported: `_` | fixtures/reject/src/lib.rs:2107:1 | +| 1 | comparing pointers to `_` in an atomic, which JS has no address of | fixtures/reject/src/lib.rs:779:15 | +| 1 | comparing pointers to `_`, each a place JS makes of its own | fixtures/reject/src/lib.rs:598:2 | +| 1 | comparing pointers to `_`, which has no bytes and so no address of its own | fixtures/reject/src/lib.rs:730:70 | +| 1 | const generic types are not supported: `_` | fixtures/reject/src/lib.rs:2100:1 | | 1 | constructing `_` | fixtures/reject/src/lib.rs:356:53 | | 1 | hashing `_` as a key, which is not supported yet | fixtures/reject/src/lib.rs:242:75 | -| 1 | hashing `_` by its address, which JS has no counterpart of | fixtures/reject/src/lib.rs:1725:5 | +| 1 | hashing `_` by its address, which JS has no counterpart of | fixtures/reject/src/lib.rs:1718:5 | | 1 | hashing `_` through `_`'s own `Hash::hash_slice`, which is not supported yet | fixtures/reject/src/lib.rs:317:16 | | 1 | passing `_`, a closure that owns a value that drops, to `_`, which is not supported yet | fixtures/reject/src/lib.rs:326:13 | -| 1 | union `_`, whose fields overlap in `_` and `f64`, which JS keeps apart | fixtures/reject/src/lib.rs:591:1 | +| 1 | union `_`, whose fields overlap in `_` and `f64`, which JS keeps apart | fixtures/reject/src/lib.rs:584:1 | ## By API @@ -86,158 +86,157 @@ The type or module each refused type or path belongs to. | Count | API | First | | ---: | --- | --- | -| 39 | `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:696:15 | -| 24 | `(u32, u32)` | fixtures/reject/src/lib.rs:617:10 | +| 39 | `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:689:15 | +| 24 | `(u32, u32)` | fixtures/reject/src/lib.rs:610:10 | | 6 | `[u8; 4]` | fixtures/reject/src/lib.rs:483:26 | | 6 | `f16` | fixtures/reject/src/lib.rs:7:14 | | 6 | `std::borrow::Cow` | fixtures/reject/src/lib.rs:338:2 | -| 5 | `Gap` | fixtures/reject/src/lib.rs:917:10 | +| 5 | `Gap` | fixtures/reject/src/lib.rs:910:10 | | 5 | `Option` | fixtures/reject/src/lib.rs:16:15 | -| 5 | `u32` | fixtures/reject/src/lib.rs:564:27 | +| 5 | `u32` | fixtures/reject/src/lib.rs:557:27 | | 5 | `u8` | fixtures/reject/src/lib.rs:260:6 | | 4 | `Iterator` | fixtures/reject/src/lib.rs:37:4 | | 4 | `std::pin::Pin` | fixtures/reject/src/lib.rs:98:2 | | 4 | `std::str` | fixtures/reject/src/lib.rs:441:4 | -| 3 | `*const [u8; 4]` | fixtures/reject/src/lib.rs:1722:33 | -| 3 | `Mid` | fixtures/reject/src/lib.rs:1364:34 | -| 3 | `Outer` | fixtures/reject/src/lib.rs:1364:34 | +| 3 | `*const [u8; 4]` | fixtures/reject/src/lib.rs:1715:33 | +| 3 | `Mid` | fixtures/reject/src/lib.rs:1357:34 | +| 3 | `Outer` | fixtures/reject/src/lib.rs:1357:34 | | 3 | `std::option::Option` | fixtures/reject/src/lib.rs:376:2 | -| 3 | `std::ptr` | fixtures/reject/src/lib.rs:1719:3 | +| 3 | `std::ptr` | fixtures/reject/src/lib.rs:1712:3 | | 3 | `std::vec::Vec` | fixtures/reject/src/lib.rs:317:16 | | 3 | `{closure}` | fixtures/reject/src/lib.rs:326:13 | -| 2 | `(u16, u16)` | fixtures/reject/src/lib.rs:1185:31 | -| 2 | `InArray` | fixtures/reject/src/lib.rs:1311:9 | -| 2 | `InPayload` | fixtures/reject/src/lib.rs:1323:9 | -| 2 | `InTuple` | fixtures/reject/src/lib.rs:1315:9 | -| 2 | `InWritten` | fixtures/reject/src/lib.rs:1335:9 | -| 2 | `Inside` | fixtures/reject/src/lib.rs:1855:20 | +| 2 | `(u16, u16)` | fixtures/reject/src/lib.rs:1178:31 | +| 2 | `InArray` | fixtures/reject/src/lib.rs:1304:9 | +| 2 | `InPayload` | fixtures/reject/src/lib.rs:1316:9 | +| 2 | `InTuple` | fixtures/reject/src/lib.rs:1308:9 | +| 2 | `InWritten` | fixtures/reject/src/lib.rs:1328:9 | +| 2 | `Inside` | fixtures/reject/src/lib.rs:1848:20 | | 2 | `Poll` | fixtures/reject/src/lib.rs:79:20 | | 2 | `Reused` | fixtures/reject/src/lib.rs:21:4 | | 2 | `Scaled` | fixtures/reject/src/lib.rs:466:23 | -| 2 | `[u8; 2]` | fixtures/reject/src/lib.rs:1736:37 | -| 2 | `[u8; 3]` | fixtures/reject/src/lib.rs:1736:15 | +| 2 | `[u8; 2]` | fixtures/reject/src/lib.rs:1729:37 | +| 2 | `[u8; 3]` | fixtures/reject/src/lib.rs:1729:15 | | 2 | `dyn Scaled` | fixtures/reject/src/lib.rs:466:23 | -| 2 | `dyn std::any::Any` | fixtures/reject/src/lib.rs:541:32 | +| 2 | `dyn std::any::Any` | fixtures/reject/src/lib.rs:534:32 | | 2 | `dyn std::iter::Iterator` | fixtures/reject/src/lib.rs:11:16 | | 2 | `slice` | fixtures/reject/src/lib.rs:21:4 | -| 2 | `std::any::TypeId` | fixtures/reject/src/lib.rs:547:2 | +| 2 | `std::any::TypeId` | fixtures/reject/src/lib.rs:540:2 | | 2 | `std::collections::BTreeSet` | fixtures/reject/src/lib.rs:242:75 | -| 2 | `std::collections::LinkedList` | fixtures/reject/src/lib.rs:2127:4 | -| 2 | `std::mem::MaybeUninit` | fixtures/reject/src/lib.rs:931:19 | +| 2 | `std::collections::LinkedList` | fixtures/reject/src/lib.rs:2120:4 | +| 2 | `std::mem::MaybeUninit` | fixtures/reject/src/lib.rs:924:19 | | 2 | `std::ops::Range` | fixtures/reject/src/lib.rs:167:8 | -| 2 | `std::ptr::const_ptr` | fixtures/reject/src/lib.rs:1722:73 | -| 2 | `std::std` | fixtures/reject/src/lib.rs:576:11 | +| 2 | `std::ptr::const_ptr` | fixtures/reject/src/lib.rs:1715:73 | +| 2 | `std::std` | fixtures/reject/src/lib.rs:569:11 | | 2 | `std::sync::Arc` | fixtures/reject/src/lib.rs:298:2 | | 2 | `std::sync::MutexGuard` | fixtures/reject/src/lib.rs:90:2 | | 2 | `std::vec::IntoIter` | fixtures/reject/src/lib.rs:436:17 | -| 1 | `(std::vec::Vec, Tens)` | fixtures/reject/src/lib.rs:1281:31 | -| 1 | `(u16, ByKeyReplace)` | fixtures/reject/src/lib.rs:1630:55 | -| 1 | `(u16, ByKeySet)` | fixtures/reject/src/lib.rs:1622:51 | -| 1 | `(u16, ByKeyTake)` | fixtures/reject/src/lib.rs:1637:52 | -| 1 | `(u16, ByRefReplace)` | fixtures/reject/src/lib.rs:1606:32 | -| 1 | `(u16, ByRefTake)` | fixtures/reject/src/lib.rs:1614:32 | -| 1 | `(u16, InTuple)` | fixtures/reject/src/lib.rs:1355:33 | -| 1 | `(u8, u8)` | fixtures/reject/src/lib.rs:1281:31 | -| 1 | `*const [u8]` | fixtures/reject/src/lib.rs:1723:28 | -| 1 | `*const u8` | fixtures/reject/src/lib.rs:1722:33 | -| 1 | `*mut [u8; 4]` | fixtures/reject/src/lib.rs:1721:41 | -| 1 | `Aliased` | fixtures/reject/src/lib.rs:1129:29 | -| 1 | `Assigned` | fixtures/reject/src/lib.rs:2022:20 | +| 1 | `(std::vec::Vec, Tens)` | fixtures/reject/src/lib.rs:1274:31 | +| 1 | `(u16, ByKeyReplace)` | fixtures/reject/src/lib.rs:1623:55 | +| 1 | `(u16, ByKeySet)` | fixtures/reject/src/lib.rs:1615:51 | +| 1 | `(u16, ByKeyTake)` | fixtures/reject/src/lib.rs:1630:52 | +| 1 | `(u16, ByRefReplace)` | fixtures/reject/src/lib.rs:1599:32 | +| 1 | `(u16, ByRefTake)` | fixtures/reject/src/lib.rs:1607:32 | +| 1 | `(u16, InTuple)` | fixtures/reject/src/lib.rs:1348:33 | +| 1 | `(u8, u8)` | fixtures/reject/src/lib.rs:1274:31 | +| 1 | `*const [u8]` | fixtures/reject/src/lib.rs:1716:28 | +| 1 | `*const u8` | fixtures/reject/src/lib.rs:1715:33 | +| 1 | `*mut [u8; 4]` | fixtures/reject/src/lib.rs:1714:41 | +| 1 | `Aliased` | fixtures/reject/src/lib.rs:1122:29 | +| 1 | `Assigned` | fixtures/reject/src/lib.rs:2015:20 | | 1 | `Batched` | fixtures/reject/src/lib.rs:317:16 | -| 1 | `Behind` | fixtures/reject/src/lib.rs:1761:22 | -| 1 | `Bits` | fixtures/reject/src/lib.rs:591:1 | -| 1 | `Blank` | fixtures/reject/src/lib.rs:770:2 | -| 1 | `Block` | fixtures/reject/src/lib.rs:2107:1 | -| 1 | `ByBox` | fixtures/reject/src/lib.rs:1513:35 | -| 1 | `ByClosure` | fixtures/reject/src/lib.rs:1528:35 | -| 1 | `ByExchanged` | fixtures/reject/src/lib.rs:1574:30 | -| 1 | `ByInstance` | fixtures/reject/src/lib.rs:1554:35 | -| 1 | `ByKeyReplace` | fixtures/reject/src/lib.rs:1630:55 | -| 1 | `ByKeySet` | fixtures/reject/src/lib.rs:1622:51 | -| 1 | `ByKeyTake` | fixtures/reject/src/lib.rs:1637:52 | -| 1 | `ByObject` | fixtures/reject/src/lib.rs:1541:35 | -| 1 | `ByRead` | fixtures/reject/src/lib.rs:1464:35 | -| 1 | `ByRefReplace` | fixtures/reject/src/lib.rs:1606:32 | -| 1 | `ByRefTake` | fixtures/reject/src/lib.rs:1614:32 | -| 1 | `ByReplace` | fixtures/reject/src/lib.rs:1502:35 | -| 1 | `BySwap` | fixtures/reject/src/lib.rs:1490:35 | -| 1 | `BySwapped` | fixtures/reject/src/lib.rs:1563:76 | -| 1 | `ByWrite` | fixtures/reject/src/lib.rs:1477:35 | +| 1 | `Behind` | fixtures/reject/src/lib.rs:1754:22 | +| 1 | `Bits` | fixtures/reject/src/lib.rs:584:1 | +| 1 | `Blank` | fixtures/reject/src/lib.rs:763:2 | +| 1 | `Block` | fixtures/reject/src/lib.rs:2100:1 | +| 1 | `ByBox` | fixtures/reject/src/lib.rs:1506:35 | +| 1 | `ByClosure` | fixtures/reject/src/lib.rs:1521:35 | +| 1 | `ByExchanged` | fixtures/reject/src/lib.rs:1567:30 | +| 1 | `ByInstance` | fixtures/reject/src/lib.rs:1547:35 | +| 1 | `ByKeyReplace` | fixtures/reject/src/lib.rs:1623:55 | +| 1 | `ByKeySet` | fixtures/reject/src/lib.rs:1615:51 | +| 1 | `ByKeyTake` | fixtures/reject/src/lib.rs:1630:52 | +| 1 | `ByObject` | fixtures/reject/src/lib.rs:1534:35 | +| 1 | `ByRead` | fixtures/reject/src/lib.rs:1457:35 | +| 1 | `ByRefReplace` | fixtures/reject/src/lib.rs:1599:32 | +| 1 | `ByRefTake` | fixtures/reject/src/lib.rs:1607:32 | +| 1 | `ByReplace` | fixtures/reject/src/lib.rs:1495:35 | +| 1 | `BySwap` | fixtures/reject/src/lib.rs:1483:35 | +| 1 | `BySwapped` | fixtures/reject/src/lib.rs:1556:76 | +| 1 | `ByWrite` | fixtures/reject/src/lib.rs:1470:35 | | 1 | `BytesMut` | fixtures/reject/src/lib.rs:390:6 | -| 1 | `Called` | fixtures/reject/src/lib.rs:1095:28 | -| 1 | `Chosen` | fixtures/reject/src/lib.rs:1916:17 | -| 1 | `Closed` | fixtures/reject/src/lib.rs:2088:15 | -| 1 | `Compared` | fixtures/reject/src/lib.rs:1883:22 | -| 1 | `Copied` | fixtures/reject/src/lib.rs:1185:31 | +| 1 | `Called` | fixtures/reject/src/lib.rs:1088:28 | +| 1 | `Chosen` | fixtures/reject/src/lib.rs:1909:17 | +| 1 | `Closed` | fixtures/reject/src/lib.rs:2081:15 | +| 1 | `Compared` | fixtures/reject/src/lib.rs:1876:22 | +| 1 | `Copied` | fixtures/reject/src/lib.rs:1178:31 | | 1 | `Counted` | fixtures/reject/src/lib.rs:396:2 | -| 1 | `Deep` | fixtures/reject/src/lib.rs:1797:18 | -| 1 | `Deeper` | fixtures/reject/src/lib.rs:2048:22 | +| 1 | `Deep` | fixtures/reject/src/lib.rs:1790:18 | +| 1 | `Deeper` | fixtures/reject/src/lib.rs:2041:22 | | 1 | `DoubleEndedIterator` | fixtures/reject/src/lib.rs:152:1 | -| 1 | `Dynamic` | fixtures/reject/src/lib.rs:2072:20 | -| 1 | `Enclosing` | fixtures/reject/src/lib.rs:1900:22 | +| 1 | `Dynamic` | fixtures/reject/src/lib.rs:2065:20 | +| 1 | `Enclosing` | fixtures/reject/src/lib.rs:1893:22 | | 1 | `Entry` | fixtures/reject/src/lib.rs:326:13 | -| 1 | `Escaped` | fixtures/reject/src/lib.rs:1081:43 | +| 1 | `Escaped` | fixtures/reject/src/lib.rs:1074:43 | | 1 | `FusedIterator` | fixtures/reject/src/lib.rs:200:1 | -| 1 | `Fused` | fixtures/reject/src/lib.rs:737:70 | +| 1 | `Fused` | fixtures/reject/src/lib.rs:730:70 | | 1 | `HashMap` | fixtures/reject/src/lib.rs:260:6 | | 1 | `Hasher` | fixtures/reject/src/lib.rs:268:9 | -| 1 | `Hits` | fixtures/reject/src/lib.rs:729:21 | -| 1 | `InField` | fixtures/reject/src/lib.rs:1327:9 | -| 1 | `InGeneric` | fixtures/reject/src/lib.rs:1331:9 | -| 1 | `InNested` | fixtures/reject/src/lib.rs:1319:9 | -| 1 | `Lane` | fixtures/reject/src/lib.rs:881:19 | -| 1 | `Loaded` | fixtures/reject/src/lib.rs:1151:29 | -| 1 | `Looped` | fixtures/reject/src/lib.rs:1119:26 | -| 1 | `Mapped` | fixtures/reject/src/lib.rs:1196:39 | +| 1 | `Hits` | fixtures/reject/src/lib.rs:722:21 | +| 1 | `InField` | fixtures/reject/src/lib.rs:1320:9 | +| 1 | `InGeneric` | fixtures/reject/src/lib.rs:1324:9 | +| 1 | `InNested` | fixtures/reject/src/lib.rs:1312:9 | +| 1 | `Lane` | fixtures/reject/src/lib.rs:874:19 | +| 1 | `Loaded` | fixtures/reject/src/lib.rs:1144:29 | +| 1 | `Looped` | fixtures/reject/src/lib.rs:1112:26 | +| 1 | `Mapped` | fixtures/reject/src/lib.rs:1189:39 | | 1 | `Maybe` | fixtures/reject/src/lib.rs:31:2 | -| 1 | `Onced` | fixtures/reject/src/lib.rs:1242:46 | -| 1 | `Only` | fixtures/reject/src/lib.rs:746:11 | -| 1 | `Parked` | fixtures/reject/src/lib.rs:2147:20 | -| 1 | `Parking` | fixtures/reject/src/lib.rs:2147:20 | -| 1 | `Plain` | fixtures/reject/src/lib.rs:835:10 | -| 1 | `Pushed` | fixtures/reject/src/lib.rs:1257:22 | -| 1 | `Repeated` | fixtures/reject/src/lib.rs:1230:18 | -| 1 | `Replaced` | fixtures/reject/src/lib.rs:1967:20 | -| 1 | `Rewritten` | fixtures/reject/src/lib.rs:1139:47 | -| 1 | `Shared` | fixtures/reject/src/lib.rs:1838:20 | +| 1 | `Onced` | fixtures/reject/src/lib.rs:1235:46 | +| 1 | `Only` | fixtures/reject/src/lib.rs:739:11 | +| 1 | `Parked` | fixtures/reject/src/lib.rs:2140:20 | +| 1 | `Parking` | fixtures/reject/src/lib.rs:2140:20 | +| 1 | `Plain` | fixtures/reject/src/lib.rs:828:10 | +| 1 | `Pushed` | fixtures/reject/src/lib.rs:1250:22 | +| 1 | `Repeated` | fixtures/reject/src/lib.rs:1223:18 | +| 1 | `Replaced` | fixtures/reject/src/lib.rs:1960:20 | +| 1 | `Rewritten` | fixtures/reject/src/lib.rs:1132:47 | +| 1 | `Shared` | fixtures/reject/src/lib.rs:1831:20 | | 1 | `Sink` | fixtures/reject/src/lib.rs:62:10 | -| 1 | `Slotted` | fixtures/reject/src/lib.rs:1819:21 | -| 1 | `Span2` | fixtures/reject/src/lib.rs:617:10 | -| 1 | `String` | fixtures/reject/src/lib.rs:793:4 | -| 1 | `Swapped` | fixtures/reject/src/lib.rs:1985:20 | +| 1 | `Slotted` | fixtures/reject/src/lib.rs:1812:21 | +| 1 | `Span2` | fixtures/reject/src/lib.rs:610:10 | +| 1 | `String` | fixtures/reject/src/lib.rs:786:4 | +| 1 | `Swapped` | fixtures/reject/src/lib.rs:1978:20 | | 1 | `T \| undefined` | fixtures/reject/src/lib.rs:31:2 | | 1 | `Tail` | fixtures/reject/src/lib.rs:493:30 | -| 1 | `Taken` | fixtures/reject/src/lib.rs:2003:20 | -| 1 | `Target` | fixtures/reject/src/lib.rs:1678:10 | -| 1 | `Tens` | fixtures/reject/src/lib.rs:1281:31 | -| 1 | `Track` | fixtures/reject/src/lib.rs:861:19 | -| 1 | `Unboxed` | fixtures/reject/src/lib.rs:1776:16 | +| 1 | `Taken` | fixtures/reject/src/lib.rs:1996:20 | +| 1 | `Target` | fixtures/reject/src/lib.rs:1671:10 | +| 1 | `Tens` | fixtures/reject/src/lib.rs:1274:31 | +| 1 | `Track` | fixtures/reject/src/lib.rs:854:19 | +| 1 | `Unboxed` | fixtures/reject/src/lib.rs:1769:16 | | 1 | `Waiting` | fixtures/reject/src/lib.rs:504:2 | -| 1 | `Window` | fixtures/reject/src/lib.rs:678:2 | -| 1 | `Wrapped` | fixtures/reject/src/lib.rs:1944:21 | -| 1 | `[InArray; 2]` | fixtures/reject/src/lib.rs:1346:33 | -| 1 | `[InWritten; 1]` | fixtures/reject/src/lib.rs:1407:35 | -| 1 | `[std::cell::UnsafeCell; 2]` | fixtures/reject/src/lib.rs:2101:20 | -| 1 | `dyn Keyed` | fixtures/reject/src/lib.rs:541:32 | +| 1 | `Window` | fixtures/reject/src/lib.rs:671:2 | +| 1 | `Wrapped` | fixtures/reject/src/lib.rs:1937:21 | +| 1 | `[InArray; 2]` | fixtures/reject/src/lib.rs:1339:33 | +| 1 | `[InWritten; 1]` | fixtures/reject/src/lib.rs:1400:35 | +| 1 | `[std::cell::UnsafeCell; 2]` | fixtures/reject/src/lib.rs:2094:20 | +| 1 | `dyn Keyed` | fixtures/reject/src/lib.rs:534:32 | | 1 | `poll` | fixtures/reject/src/lib.rs:504:2 | | 1 | `rt.Poll` | fixtures/reject/src/lib.rs:504:2 | -| 1 | `std::any::Any` | fixtures/reject/src/lib.rs:547:4 | -| 1 | `std::cell::Cell` | fixtures/reject/src/lib.rs:964:22 | -| 1 | `std::collections::BTreeMap` | fixtures/reject/src/lib.rs:964:22 | +| 1 | `std::any::Any` | fixtures/reject/src/lib.rs:540:4 | +| 1 | `std::cell::Cell` | fixtures/reject/src/lib.rs:957:22 | +| 1 | `std::collections::BTreeMap` | fixtures/reject/src/lib.rs:957:22 | | 1 | `std::collections::HashMap` | fixtures/reject/src/lib.rs:260:6 | -| 1 | `std::default::Default` | fixtures/reject/src/lib.rs:2129:2 | +| 1 | `std::default::Default` | fixtures/reject/src/lib.rs:2122:2 | | 1 | `std::iter::Map` | fixtures/reject/src/lib.rs:216:40 | | 1 | `std::iter::Zip` | fixtures/reject/src/lib.rs:209:8 | -| 1 | `std::iter` | fixtures/reject/src/lib.rs:1244:22 | +| 1 | `std::iter` | fixtures/reject/src/lib.rs:1237:22 | | 1 | `std::net::AddrParseError` | fixtures/reject/src/lib.rs:440:32 | | 1 | `std::net::Ipv4Addr` | fixtures/reject/src/lib.rs:440:32 | -| 1 | `std::num` | fixtures/reject/src/lib.rs:1286:4 | -| 1 | `std::ops::RangeFrom` | fixtures/reject/src/lib.rs:993:32 | -| 1 | `std::ops::RangeTo` | fixtures/reject/src/lib.rs:993:11 | -| 1 | `std::ptr::mut_ptr` | fixtures/reject/src/lib.rs:1722:56 | -| 1 | `std::slice::IterMut` | fixtures/reject/src/lib.rs:775:15 | -| 1 | `std::std::Layout` | fixtures/reject/src/lib.rs:574:15 | -| 1 | `std::sync::Mutex` | fixtures/reject/src/lib.rs:523:12 | +| 1 | `std::num` | fixtures/reject/src/lib.rs:1279:4 | +| 1 | `std::ops::RangeFrom` | fixtures/reject/src/lib.rs:986:32 | +| 1 | `std::ops::RangeTo` | fixtures/reject/src/lib.rs:986:11 | +| 1 | `std::ptr::mut_ptr` | fixtures/reject/src/lib.rs:1715:56 | +| 1 | `std::slice::IterMut` | fixtures/reject/src/lib.rs:768:15 | +| 1 | `std::std::Layout` | fixtures/reject/src/lib.rs:567:15 | | 1 | `std::sync::Weak` | fixtures/reject/src/lib.rs:457:40 | | 1 | `std::task::Poll` | fixtures/reject/src/lib.rs:84:34 | | 1 | `str` | fixtures/reject/src/lib.rs:333:4 | @@ -249,174 +248,173 @@ The type or module each refused type or path belongs to. | Count | Construct | Type or path | First | | ---: | --- | --- | --- | -| 14 | a raw pointer to `_` in a variable assigned again while it may point there | `(u32, u32)` | fixtures/reject/src/lib.rs:625:10 | +| 14 | a raw pointer to `_` in a variable assigned again while it may point there | `(u32, u32)` | fixtures/reject/src/lib.rs:618:10 | | 4 | a variant of `_`, which is not supported: either is the same JS string | `std::borrow::Cow` | fixtures/reject/src/lib.rs:338:2 | -| 3 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Gap` | fixtures/reject/src/lib.rs:917:10 | -| 3 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `Mid`, `Outer` | fixtures/reject/src/lib.rs:1364:34 | +| 3 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Gap` | fixtures/reject/src/lib.rs:910:10 | +| 3 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `Mid`, `Outer` | fixtures/reject/src/lib.rs:1357:34 | | 3 | unsupported type `_` | `f16` | fixtures/reject/src/lib.rs:7:14 | | 2 | `_` is not supported: its `None` and `Some` would both be `rt.None` | `Option` | fixtures/reject/src/lib.rs:16:15 | | 2 | `_` of `_`, whose `None` is `rt.None`, which is not supported yet | `Iterator::scan`, `Option` | fixtures/reject/src/lib.rs:37:4 | | 2 | `_`, a trait object of another crate's trait, which is not supported yet | `dyn std::iter::Iterator` | fixtures/reject/src/lib.rs:11:16 | | 2 | `_`, a trait object of the generic trait `_`, which is not supported yet | `dyn Scaled`, `Scaled` | fixtures/reject/src/lib.rs:466:23 | -| 2 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::mem::MaybeUninit`, `Gap` | fixtures/reject/src/lib.rs:931:19 | -| 2 | a raw pointer to `_` in a variable assigned again while it may point there | `[u8; 4]` | fixtures/reject/src/lib.rs:1743:26 | -| 2 | a raw pointer to `_` in a variable assigned again while it may point there | `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:705:15 | -| 2 | a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet | `[u8; 2]` | fixtures/reject/src/lib.rs:1736:37 | -| 2 | a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet | `[u8; 3]` | fixtures/reject/src/lib.rs:1736:15 | -| 2 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Inside` | fixtures/reject/src/lib.rs:1855:20 | -| 2 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `[u8; 4]` | fixtures/reject/src/lib.rs:1743:26 | +| 2 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::mem::MaybeUninit`, `Gap` | fixtures/reject/src/lib.rs:924:19 | +| 2 | a raw pointer to `_` in a variable assigned again while it may point there | `[u8; 4]` | fixtures/reject/src/lib.rs:1736:26 | +| 2 | a raw pointer to `_` in a variable assigned again while it may point there | `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:698:15 | +| 2 | a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet | `[u8; 2]` | fixtures/reject/src/lib.rs:1729:37 | +| 2 | a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet | `[u8; 3]` | fixtures/reject/src/lib.rs:1729:15 | +| 2 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Inside` | fixtures/reject/src/lib.rs:1848:20 | +| 2 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `[u8; 4]` | fixtures/reject/src/lib.rs:1736:26 | | 2 | an assignment through a reference to `_` | `std::pin::Pin` | fixtures/reject/src/lib.rs:114:2 | | 2 | replacing the value behind a reference to `_` | `std::pin::Pin` | fixtures/reject/src/lib.rs:98:2 | | 2 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:376:2 | | 2 | unsupported call to `_` | `::sum` | fixtures/reject/src/lib.rs:436:17 | -| 1 | `Buf::copy_to_bytes` of `_`, a value JS copies, which is not supported | `Blank` | fixtures/reject/src/lib.rs:770:2 | +| 1 | `Buf::copy_to_bytes` of `_`, a value JS copies, which is not supported | `Blank` | fixtures/reject/src/lib.rs:763:2 | | 1 | `BufMut::put` of `_` into a `BytesMut`, which picks the methods it calls by a capacity that depends on whether the other handles of its storage dropped, which is not supported | `Counted` | fixtures/reject/src/lib.rs:396:2 | | 1 | `Bytes::from_owner` of `_`, which would drop with the last clone of what it makes, which is not supported | `std::sync::Arc` | fixtures/reject/src/lib.rs:381:2 | -| 1 | `Extend` of `_` by `_`, whose `_` of `_` is not supported yet | `(std::vec::Vec, Tens)`, `(u8, u8)`, `Tens`, `u8` | fixtures/reject/src/lib.rs:1281:31 | +| 1 | `Extend` of `_` by `_`, whose `_` of `_` is not supported yet | `(std::vec::Vec, Tens)`, `(u8, u8)`, `Tens`, `u8` | fixtures/reject/src/lib.rs:1274:31 | | 1 | `_` is not supported: its `Pending` and `Ready` would both be `rt.OuterPending` | `Poll` | fixtures/reject/src/lib.rs:79:20 | | 1 | `_` is not supported: its field `_` is `_`, typed `_`, whose `None` would be `rt.None` as `_` | `Maybe`, `value`, `Option`, `T \| undefined`, `Option` | fixtures/reject/src/lib.rs:31:2 | | 1 | `_` is not supported: its field `_` is `_`, typed `_`, whose `Pending` would be `rt.OuterPending` as `_` | `Waiting`, `poll`, `Poll`, `rt.Poll`, `Poll` | fixtures/reject/src/lib.rs:504:2 | | 1 | `_` of `_` by `_`, which is not supported yet | `HashMap::contains_key`, `std::collections::HashMap`, `u8` | fixtures/reject/src/lib.rs:260:6 | -| 1 | `_` of `_`, which is not supported yet | `std::any::Any::type_id`, `dyn std::any::Any` | fixtures/reject/src/lib.rs:547:4 | +| 1 | `_` of `_`, which is not supported yet | `std::any::Any::type_id`, `dyn std::any::Any` | fixtures/reject/src/lib.rs:540:4 | | 1 | `_` of `_`, whose `clone_from` is its own, which is not supported yet | `slice::clone_from_slice`, `Reused` | fixtures/reject/src/lib.rs:293:4 | | 1 | `_` of `_`, whose `clone_from` is its own, which is not supported yet | `slice::fill`, `Reused` | fixtures/reject/src/lib.rs:21:4 | -| 1 | `_` with a mutable reference to a value JS copies, which its mapping would copy | `std::collections::LinkedList::retain` | fixtures/reject/src/lib.rs:2127:4 | -| 1 | `_` with a mutable reference to a value JS copies, which its mapping would copy | `std::default::Default::default` | fixtures/reject/src/lib.rs:2129:2 | -| 1 | `_` with a mutable reference to a value JS copies, which its mapping would copy | `std::iter::once` | fixtures/reject/src/lib.rs:1244:22 | -| 1 | `_` with a mutable reference to a value JS copies, which its mapping would copy | `std::str::from_utf8_mut` | fixtures/reject/src/lib.rs:1651:20 | -| 1 | `_` with a mutable reference to a value JS copies, which its mapping would copy | `std::str::get_unchecked_mut` | fixtures/reject/src/lib.rs:1646:13 | -| 1 | `_` with a mutable reference to a value JS copies, which its mapping would copy | `std::sync::Mutex::get_mut` | fixtures/reject/src/lib.rs:523:12 | +| 1 | `_` with a mutable reference to a value JS copies, which its mapping would copy | `std::collections::LinkedList::retain` | fixtures/reject/src/lib.rs:2120:4 | +| 1 | `_` with a mutable reference to a value JS copies, which its mapping would copy | `std::default::Default::default` | fixtures/reject/src/lib.rs:2122:2 | +| 1 | `_` with a mutable reference to a value JS copies, which its mapping would copy | `std::iter::once` | fixtures/reject/src/lib.rs:1237:22 | +| 1 | `_` with a mutable reference to a value JS copies, which its mapping would copy | `std::str::from_utf8_mut` | fixtures/reject/src/lib.rs:1644:20 | +| 1 | `_` with a mutable reference to a value JS copies, which its mapping would copy | `std::str::get_unchecked_mut` | fixtures/reject/src/lib.rs:1639:13 | | 1 | `_`, which is not supported yet | `Hasher::write` | fixtures/reject/src/lib.rs:268:9 | | 1 | `_`, which reads a capacity that depends on whether the other handles of its storage dropped, which is not supported | `BytesMut::capacity` | fixtures/reject/src/lib.rs:390:6 | -| 1 | `clone_from` of `_`, whose items' `clone_from` is their own, which is not supported yet | `std::collections::LinkedList` | fixtures/reject/src/lib.rs:2128:4 | -| 1 | `collect` of `_`, which sorts by `_`'s own `Ord`, of entries that drop, which is not supported yet | `std::collections::BTreeMap`, `std::cell::Cell` | fixtures/reject/src/lib.rs:964:22 | +| 1 | `clone_from` of `_`, whose items' `clone_from` is their own, which is not supported yet | `std::collections::LinkedList` | fixtures/reject/src/lib.rs:2121:4 | +| 1 | `collect` of `_`, which sorts by `_`'s own `Ord`, of entries that drop, which is not supported yet | `std::collections::BTreeMap`, `std::cell::Cell` | fixtures/reject/src/lib.rs:957:22 | | 1 | `fmt::Arguments` with a placeholder, or not made in place, written to `_`'s own `fmt::Write`, which is not supported yet: std splits what a placeholder writes into `write_str` calls the runtime does not make | `Sink` | fixtures/reject/src/lib.rs:62:10 | | 1 | a `collect` in place of `_`, a zip std reads by index, holding values that drop, which is not supported yet | `std::iter::Map` | fixtures/reject/src/lib.rs:216:40 | | 1 | a `skip` of `_`, a zip std reads by index, of items that drop, which is not supported yet | `std::iter::Zip` | fixtures/reject/src/lib.rs:209:8 | | 1 | a cast from `_` to `_` | `u64`, `f16` | fixtures/reject/src/lib.rs:75:2 | -| 1 | a cast from `_` to `_`, which reads the bytes of one type as another | `*const [u8; 4]`, `*const u8` | fixtures/reject/src/lib.rs:1722:33 | -| 1 | a cast from a pointer to `_` to one to `_`, which reads the bytes of one type as another | `[u8; 4]`, `u8` | fixtures/reject/src/lib.rs:1722:17 | -| 1 | a cast from a pointer to `_` to one to `_`, which reads the bytes of one type as another | `u32`, `u8` | fixtures/reject/src/lib.rs:564:27 | -| 1 | a coercion of `_` to `_`, a pointer to a slice | `*const [u8; 4]`, `*const [u8]` | fixtures/reject/src/lib.rs:1723:28 | +| 1 | a cast from `_` to `_`, which reads the bytes of one type as another | `*const [u8; 4]`, `*const u8` | fixtures/reject/src/lib.rs:1715:33 | +| 1 | a cast from a pointer to `_` to one to `_`, which reads the bytes of one type as another | `[u8; 4]`, `u8` | fixtures/reject/src/lib.rs:1715:17 | +| 1 | a cast from a pointer to `_` to one to `_`, which reads the bytes of one type as another | `u32`, `u8` | fixtures/reject/src/lib.rs:557:27 | +| 1 | a coercion of `_` to `_`, a pointer to a slice | `*const [u8; 4]`, `*const [u8]` | fixtures/reject/src/lib.rs:1716:28 | | 1 | a coercion to `_` | `std::sync::Arc` | fixtures/reject/src/lib.rs:298:2 | | 1 | a coercion to `_`, which is not supported yet | `&Tail` | fixtures/reject/src/lib.rs:493:30 | | 1 | a coercion to `_`, which is not supported yet | `std::sync::Weak` | fixtures/reject/src/lib.rs:457:40 | -| 1 | a constant of type `_`, a pointer into memory translation can't name | `&u32` | fixtures/reject/src/lib.rs:787:3 | -| 1 | a dangling pointer to `_`, a value of no bytes made of more than structs and tuples | `Only` | fixtures/reject/src/lib.rs:746:11 | +| 1 | a constant of type `_`, a pointer into memory translation can't name | `&u32` | fixtures/reject/src/lib.rs:780:3 | +| 1 | a dangling pointer to `_`, a value of no bytes made of more than structs and tuples | `Only` | fixtures/reject/src/lib.rs:739:11 | | 1 | a future of `_`, which can be `rt.Pending`, as the future's own `Pending` is | `std::task::Poll` | fixtures/reject/src/lib.rs:84:34 | -| 1 | a raw pointer to `_` behind a reference, which is the object and not where it is kept | `std::vec::Vec` | fixtures/reject/src/lib.rs:586:10 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u16, u16)`, `Copied` | fixtures/reject/src/lib.rs:1185:31 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u16, u16)`, `Pushed` | fixtures/reject/src/lib.rs:1257:22 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Lane` | fixtures/reject/src/lib.rs:881:19 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Plain` | fixtures/reject/src/lib.rs:835:10 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Span2` | fixtures/reject/src/lib.rs:617:10 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Track` | fixtures/reject/src/lib.rs:861:19 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Window` | fixtures/reject/src/lib.rs:678:2 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:696:15 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `ByKeyReplace`, `(u16, ByKeyReplace)` | fixtures/reject/src/lib.rs:1630:55 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `ByKeySet`, `(u16, ByKeySet)` | fixtures/reject/src/lib.rs:1622:51 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `ByKeyTake`, `(u16, ByKeyTake)` | fixtures/reject/src/lib.rs:1637:52 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `ByRefReplace`, `(u16, ByRefReplace)` | fixtures/reject/src/lib.rs:1606:32 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `ByRefTake`, `(u16, ByRefTake)` | fixtures/reject/src/lib.rs:1614:32 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Aliased` | fixtures/reject/src/lib.rs:1129:29 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `ByBox` | fixtures/reject/src/lib.rs:1513:35 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `ByClosure` | fixtures/reject/src/lib.rs:1528:35 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `ByExchanged` | fixtures/reject/src/lib.rs:1574:30 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `ByInstance` | fixtures/reject/src/lib.rs:1554:35 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `ByObject` | fixtures/reject/src/lib.rs:1541:35 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `ByRead` | fixtures/reject/src/lib.rs:1464:35 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `ByReplace` | fixtures/reject/src/lib.rs:1502:35 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `BySwap` | fixtures/reject/src/lib.rs:1490:35 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `BySwapped` | fixtures/reject/src/lib.rs:1563:76 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `ByWrite` | fixtures/reject/src/lib.rs:1477:35 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Called` | fixtures/reject/src/lib.rs:1095:28 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Escaped` | fixtures/reject/src/lib.rs:1081:43 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Hits` | fixtures/reject/src/lib.rs:729:21 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `InArray` | fixtures/reject/src/lib.rs:1311:9 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `InField` | fixtures/reject/src/lib.rs:1327:9 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `InGeneric` | fixtures/reject/src/lib.rs:1331:9 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `InNested` | fixtures/reject/src/lib.rs:1319:9 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `InPayload` | fixtures/reject/src/lib.rs:1323:9 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `InTuple` | fixtures/reject/src/lib.rs:1315:9 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `InWritten` | fixtures/reject/src/lib.rs:1335:9 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Loaded` | fixtures/reject/src/lib.rs:1151:29 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Looped` | fixtures/reject/src/lib.rs:1119:26 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Mapped` | fixtures/reject/src/lib.rs:1196:39 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Onced` | fixtures/reject/src/lib.rs:1242:46 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Repeated` | fixtures/reject/src/lib.rs:1230:18 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Rewritten` | fixtures/reject/src/lib.rs:1139:47 | -| 1 | a raw pointer to `_` in a variable assigned again while it may point there | `Target` | fixtures/reject/src/lib.rs:1678:10 | -| 1 | a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet | `(u32, u32)` | fixtures/reject/src/lib.rs:688:10 | -| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `InArray`, `[InArray; 2]` | fixtures/reject/src/lib.rs:1346:33 | -| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `InTuple`, `(u16, InTuple)` | fixtures/reject/src/lib.rs:1355:33 | -| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `InWritten`, `[InWritten; 1]` | fixtures/reject/src/lib.rs:1407:35 | -| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `Parked`, `Parking` | fixtures/reject/src/lib.rs:2147:20 | -| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Assigned` | fixtures/reject/src/lib.rs:2022:20 | -| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Closed` | fixtures/reject/src/lib.rs:2088:15 | -| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Deeper` | fixtures/reject/src/lib.rs:2048:22 | -| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Dynamic` | fixtures/reject/src/lib.rs:2072:20 | -| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Replaced` | fixtures/reject/src/lib.rs:1967:20 | -| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Swapped` | fixtures/reject/src/lib.rs:1985:20 | -| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Taken` | fixtures/reject/src/lib.rs:2003:20 | -| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `[std::cell::UnsafeCell; 2]` | fixtures/reject/src/lib.rs:2101:20 | -| 1 | a reference through which a raw pointer may be made into `_` in an element, a payload, or a union field, which is not supported yet | `InPayload` | fixtures/reject/src/lib.rs:1373:11 | -| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Behind` | fixtures/reject/src/lib.rs:1761:22 | -| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Chosen` | fixtures/reject/src/lib.rs:1916:17 | -| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Compared` | fixtures/reject/src/lib.rs:1883:22 | -| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Deep` | fixtures/reject/src/lib.rs:1797:18 | -| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Enclosing` | fixtures/reject/src/lib.rs:1900:22 | -| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Shared` | fixtures/reject/src/lib.rs:1838:20 | -| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Slotted` | fixtures/reject/src/lib.rs:1819:21 | -| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Unboxed` | fixtures/reject/src/lib.rs:1776:16 | -| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Wrapped` | fixtures/reject/src/lib.rs:1944:21 | -| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:1664:18 | -| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `std::option::Option` | fixtures/reject/src/lib.rs:2118:13 | +| 1 | a raw pointer to `_` behind a reference, which is the object and not where it is kept | `std::vec::Vec` | fixtures/reject/src/lib.rs:579:10 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u16, u16)`, `Copied` | fixtures/reject/src/lib.rs:1178:31 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u16, u16)`, `Pushed` | fixtures/reject/src/lib.rs:1250:22 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Lane` | fixtures/reject/src/lib.rs:874:19 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Plain` | fixtures/reject/src/lib.rs:828:10 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Span2` | fixtures/reject/src/lib.rs:610:10 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Track` | fixtures/reject/src/lib.rs:854:19 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Window` | fixtures/reject/src/lib.rs:671:2 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:689:15 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `ByKeyReplace`, `(u16, ByKeyReplace)` | fixtures/reject/src/lib.rs:1623:55 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `ByKeySet`, `(u16, ByKeySet)` | fixtures/reject/src/lib.rs:1615:51 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `ByKeyTake`, `(u16, ByKeyTake)` | fixtures/reject/src/lib.rs:1630:52 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `ByRefReplace`, `(u16, ByRefReplace)` | fixtures/reject/src/lib.rs:1599:32 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `ByRefTake`, `(u16, ByRefTake)` | fixtures/reject/src/lib.rs:1607:32 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Aliased` | fixtures/reject/src/lib.rs:1122:29 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `ByBox` | fixtures/reject/src/lib.rs:1506:35 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `ByClosure` | fixtures/reject/src/lib.rs:1521:35 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `ByExchanged` | fixtures/reject/src/lib.rs:1567:30 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `ByInstance` | fixtures/reject/src/lib.rs:1547:35 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `ByObject` | fixtures/reject/src/lib.rs:1534:35 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `ByRead` | fixtures/reject/src/lib.rs:1457:35 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `ByReplace` | fixtures/reject/src/lib.rs:1495:35 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `BySwap` | fixtures/reject/src/lib.rs:1483:35 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `BySwapped` | fixtures/reject/src/lib.rs:1556:76 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `ByWrite` | fixtures/reject/src/lib.rs:1470:35 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Called` | fixtures/reject/src/lib.rs:1088:28 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Escaped` | fixtures/reject/src/lib.rs:1074:43 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Hits` | fixtures/reject/src/lib.rs:722:21 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `InArray` | fixtures/reject/src/lib.rs:1304:9 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `InField` | fixtures/reject/src/lib.rs:1320:9 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `InGeneric` | fixtures/reject/src/lib.rs:1324:9 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `InNested` | fixtures/reject/src/lib.rs:1312:9 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `InPayload` | fixtures/reject/src/lib.rs:1316:9 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `InTuple` | fixtures/reject/src/lib.rs:1308:9 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `InWritten` | fixtures/reject/src/lib.rs:1328:9 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Loaded` | fixtures/reject/src/lib.rs:1144:29 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Looped` | fixtures/reject/src/lib.rs:1112:26 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Mapped` | fixtures/reject/src/lib.rs:1189:39 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Onced` | fixtures/reject/src/lib.rs:1235:46 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Repeated` | fixtures/reject/src/lib.rs:1223:18 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Rewritten` | fixtures/reject/src/lib.rs:1132:47 | +| 1 | a raw pointer to `_` in a variable assigned again while it may point there | `Target` | fixtures/reject/src/lib.rs:1671:10 | +| 1 | a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet | `(u32, u32)` | fixtures/reject/src/lib.rs:681:10 | +| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `InArray`, `[InArray; 2]` | fixtures/reject/src/lib.rs:1339:33 | +| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `InTuple`, `(u16, InTuple)` | fixtures/reject/src/lib.rs:1348:33 | +| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `InWritten`, `[InWritten; 1]` | fixtures/reject/src/lib.rs:1400:35 | +| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `Parked`, `Parking` | fixtures/reject/src/lib.rs:2140:20 | +| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Assigned` | fixtures/reject/src/lib.rs:2015:20 | +| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Closed` | fixtures/reject/src/lib.rs:2081:15 | +| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Deeper` | fixtures/reject/src/lib.rs:2041:22 | +| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Dynamic` | fixtures/reject/src/lib.rs:2065:20 | +| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Replaced` | fixtures/reject/src/lib.rs:1960:20 | +| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Swapped` | fixtures/reject/src/lib.rs:1978:20 | +| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Taken` | fixtures/reject/src/lib.rs:1996:20 | +| 1 | a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `[std::cell::UnsafeCell; 2]` | fixtures/reject/src/lib.rs:2094:20 | +| 1 | a reference through which a raw pointer may be made into `_` in an element, a payload, or a union field, which is not supported yet | `InPayload` | fixtures/reject/src/lib.rs:1366:11 | +| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Behind` | fixtures/reject/src/lib.rs:1754:22 | +| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Chosen` | fixtures/reject/src/lib.rs:1909:17 | +| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Compared` | fixtures/reject/src/lib.rs:1876:22 | +| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Deep` | fixtures/reject/src/lib.rs:1790:18 | +| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Enclosing` | fixtures/reject/src/lib.rs:1893:22 | +| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Shared` | fixtures/reject/src/lib.rs:1831:20 | +| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Slotted` | fixtures/reject/src/lib.rs:1812:21 | +| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Unboxed` | fixtures/reject/src/lib.rs:1769:16 | +| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `Wrapped` | fixtures/reject/src/lib.rs:1937:21 | +| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:1657:18 | +| 1 | a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there | `std::option::Option` | fixtures/reject/src/lib.rs:2111:13 | | 1 | a scalar constant of type `_` | `f16` | fixtures/reject/src/lib.rs:8:2 | | 1 | a trait object of `_`, which is not supported yet | `[u8; 4]` | fixtures/reject/src/lib.rs:483:26 | | 1 | a zero-sized constant of type `_` | `{async closure}` | fixtures/reject/src/lib.rs:50:2 | | 1 | an assignment through a reference to `_` | `std::sync::MutexGuard` | fixtures/reject/src/lib.rs:90:2 | | 1 | an iterator of the crate implementing `_`, which is not supported yet | `DoubleEndedIterator` | fixtures/reject/src/lib.rs:152:1 | | 1 | an iterator of the crate implementing `_`, which is not supported yet | `FusedIterator` | fixtures/reject/src/lib.rs:200:1 | -| 1 | an upcast from `_` to `_`, which is not supported yet | `dyn Keyed`, `dyn std::any::Any` | fixtures/reject/src/lib.rs:541:32 | +| 1 | an upcast from `_` to `_`, which is not supported yet | `dyn Keyed`, `dyn std::any::Any` | fixtures/reject/src/lib.rs:534:32 | | 1 | arithmetic on `_` | `f16` | fixtures/reject/src/lib.rs:8:2 | -| 1 | comparing `_` | `*mut [u8; 4]` | fixtures/reject/src/lib.rs:1721:41 | +| 1 | comparing `_` | `*mut [u8; 4]` | fixtures/reject/src/lib.rs:1714:41 | | 1 | comparing `_` as a key, which is not supported yet | `std::collections::BTreeSet` | fixtures/reject/src/lib.rs:242:75 | -| 1 | comparing pointers to `_` in an atomic, which JS has no address of | `u32` | fixtures/reject/src/lib.rs:786:15 | -| 1 | comparing pointers to `_`, each a place JS makes of its own | `u32` | fixtures/reject/src/lib.rs:605:2 | -| 1 | comparing pointers to `_`, which has no bytes and so no address of its own | `Fused` | fixtures/reject/src/lib.rs:737:70 | -| 1 | const generic types are not supported: `_` | `Block` | fixtures/reject/src/lib.rs:2107:1 | +| 1 | comparing pointers to `_` in an atomic, which JS has no address of | `u32` | fixtures/reject/src/lib.rs:779:15 | +| 1 | comparing pointers to `_`, each a place JS makes of its own | `u32` | fixtures/reject/src/lib.rs:598:2 | +| 1 | comparing pointers to `_`, which has no bytes and so no address of its own | `Fused` | fixtures/reject/src/lib.rs:730:70 | +| 1 | const generic types are not supported: `_` | `Block` | fixtures/reject/src/lib.rs:2100:1 | | 1 | constructing `_` | `std::borrow::Cow` | fixtures/reject/src/lib.rs:356:53 | | 1 | hashing `_` as a key, which is not supported yet | `std::collections::BTreeSet` | fixtures/reject/src/lib.rs:242:75 | -| 1 | hashing `_` by its address, which JS has no counterpart of | `*const [u8; 4]` | fixtures/reject/src/lib.rs:1725:5 | +| 1 | hashing `_` by its address, which JS has no counterpart of | `*const [u8; 4]` | fixtures/reject/src/lib.rs:1718:5 | | 1 | hashing `_` through `_`'s own `Hash::hash_slice`, which is not supported yet | `std::vec::Vec`, `Batched` | fixtures/reject/src/lib.rs:317:16 | | 1 | overriding `_`, which std's adaptors call in place of `next` or beside it | `Iterator::fold` | fixtures/reject/src/lib.rs:132:2 | | 1 | overriding `_`, which std's adaptors call in place of `next` or beside it | `Iterator::size_hint` | fixtures/reject/src/lib.rs:180:2 | | 1 | passing `_`, a closure that owns a value that drops, to `_`, which is not supported yet | `{closure}`, `Entry::or_insert_with` | fixtures/reject/src/lib.rs:326:13 | -| 1 | passing `_`, which drops, to `_`, which is not supported yet | `{closure}`, `String::retain` | fixtures/reject/src/lib.rs:793:4 | +| 1 | passing `_`, which drops, to `_`, which is not supported yet | `{closure}`, `String::retain` | fixtures/reject/src/lib.rs:786:4 | | 1 | passing `_`, which drops, to `_`, which is not supported yet | `{closure}`, `str::contains` | fixtures/reject/src/lib.rs:333:4 | | 1 | replacing the value behind a reference to `_` | `std::sync::MutexGuard` | fixtures/reject/src/lib.rs:119:2 | -| 1 | union `_`, whose fields overlap in `_` and `f64`, which JS keeps apart | `Bits`, `u32` | fixtures/reject/src/lib.rs:591:1 | -| 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:547:2 | -| 1 | unsupported call to `_` | `::contains` | fixtures/reject/src/lib.rs:993:32 | -| 1 | unsupported call to `_` | `::is_sorted` | fixtures/reject/src/lib.rs:775:15 | -| 1 | unsupported call to `_` | `::clone_from` | fixtures/reject/src/lib.rs:895:10 | +| 1 | union `_`, whose fields overlap in `_` and `f64`, which JS keeps apart | `Bits`, `u32` | fixtures/reject/src/lib.rs:584:1 | +| 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:540:2 | +| 1 | unsupported call to `_` | `::contains` | fixtures/reject/src/lib.rs:986:32 | +| 1 | unsupported call to `_` | `::is_sorted` | fixtures/reject/src/lib.rs:768:15 | +| 1 | unsupported call to `_` | `::clone_from` | fixtures/reject/src/lib.rs:888:10 | | 1 | unsupported call to `_` | `::hash` | fixtures/reject/src/lib.rs:308:10 | -| 1 | unsupported call to `_` | `std::any::TypeId::of` | fixtures/reject/src/lib.rs:547:17 | +| 1 | unsupported call to `_` | `std::any::TypeId::of` | fixtures/reject/src/lib.rs:540:17 | | 1 | unsupported call to `_` | `std::borrow::Cow::is_borrowed` | fixtures/reject/src/lib.rs:350:2 | -| 1 | unsupported call to `_` | `std::num::is_ascii_octdigit` | fixtures/reject/src/lib.rs:1286:4 | +| 1 | unsupported call to `_` | `std::num::is_ascii_octdigit` | fixtures/reject/src/lib.rs:1279:4 | | 1 | unsupported call to `_` | `std::ops::Range::contains` | fixtures/reject/src/lib.rs:167:8 | -| 1 | unsupported call to `_` | `std::ops::Range::is_empty` | fixtures/reject/src/lib.rs:998:9 | -| 1 | unsupported call to `_` | `std::ops::RangeTo::contains` | fixtures/reject/src/lib.rs:993:11 | -| 1 | unsupported call to `_` | `std::ptr::addr_eq` | fixtures/reject/src/lib.rs:1721:14 | -| 1 | unsupported call to `_` | `std::ptr::const_ptr::len` | fixtures/reject/src/lib.rs:1727:76 | -| 1 | unsupported call to `_` | `std::ptr::const_ptr::offset` | fixtures/reject/src/lib.rs:1722:73 | -| 1 | unsupported call to `_` | `std::ptr::copy_nonoverlapping` | fixtures/reject/src/lib.rs:1720:3 | -| 1 | unsupported call to `_` | `std::ptr::copy` | fixtures/reject/src/lib.rs:1719:3 | -| 1 | unsupported call to `_` | `std::ptr::mut_ptr::add` | fixtures/reject/src/lib.rs:1722:56 | -| 1 | unsupported call to `_` | `std::std::Layout::new` | fixtures/reject/src/lib.rs:574:15 | -| 1 | unsupported call to `_` | `std::std::alloc` | fixtures/reject/src/lib.rs:576:11 | -| 1 | unsupported call to `_` | `std::std::dealloc` | fixtures/reject/src/lib.rs:579:3 | -| 1 | unsupported call to `_` | `std::str::as_bytes_mut` | fixtures/reject/src/lib.rs:1645:13 | +| 1 | unsupported call to `_` | `std::ops::Range::is_empty` | fixtures/reject/src/lib.rs:991:9 | +| 1 | unsupported call to `_` | `std::ops::RangeTo::contains` | fixtures/reject/src/lib.rs:986:11 | +| 1 | unsupported call to `_` | `std::ptr::addr_eq` | fixtures/reject/src/lib.rs:1714:14 | +| 1 | unsupported call to `_` | `std::ptr::const_ptr::len` | fixtures/reject/src/lib.rs:1720:76 | +| 1 | unsupported call to `_` | `std::ptr::const_ptr::offset` | fixtures/reject/src/lib.rs:1715:73 | +| 1 | unsupported call to `_` | `std::ptr::copy_nonoverlapping` | fixtures/reject/src/lib.rs:1713:3 | +| 1 | unsupported call to `_` | `std::ptr::copy` | fixtures/reject/src/lib.rs:1712:3 | +| 1 | unsupported call to `_` | `std::ptr::mut_ptr::add` | fixtures/reject/src/lib.rs:1715:56 | +| 1 | unsupported call to `_` | `std::std::Layout::new` | fixtures/reject/src/lib.rs:567:15 | +| 1 | unsupported call to `_` | `std::std::alloc` | fixtures/reject/src/lib.rs:569:11 | +| 1 | unsupported call to `_` | `std::std::dealloc` | fixtures/reject/src/lib.rs:572:3 | +| 1 | unsupported call to `_` | `std::str::as_bytes_mut` | fixtures/reject/src/lib.rs:1638:13 | | 1 | unsupported call to `_` | `std::str::parse` | fixtures/reject/src/lib.rs:441:4 | | 1 | unsupported type `_` from another crate | `std::net::AddrParseError` | fixtures/reject/src/lib.rs:440:32 | | 1 | unsupported type `_` from another crate | `std::net::Ipv4Addr` | fixtures/reject/src/lib.rs:440:32 | @@ -425,51 +423,51 @@ The type or module each refused type or path belongs to.
a raw pointer to `_` in `_`, which the crate may put another object in place of (45) -- fixtures/reject/src/lib.rs:617:10: a raw pointer to `(u32, u32)` in `Span2`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:678:2: a raw pointer to `(u32, u32)` in `Window`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:696:15: a raw pointer to `(u32, u32)` in `std::cell::UnsafeCell<(u32, u32)>`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:729:21: a raw pointer to `std::cell::UnsafeCell` in `Hits`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:835:10: a raw pointer to `(u32, u32)` in `Plain`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:861:19: a raw pointer to `(u32, u32)` in `Track`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:881:19: a raw pointer to `(u32, u32)` in `Lane`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:917:10: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:918:10: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:919:58: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:931:19: a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:932:19: a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1081:43: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Escaped`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1095:28: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Called`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1119:26: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Looped`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1129:29: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Aliased`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1139:47: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Rewritten`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1151:29: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Loaded`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1185:31: a raw pointer to `(u16, u16)` in `Copied`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1196:39: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Mapped`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1230:18: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Repeated`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1242:46: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Onced`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1257:22: a raw pointer to `(u16, u16)` in `Pushed`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1311:9: a raw pointer to `std::cell::UnsafeCell` in `InArray`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1315:9: a raw pointer to `std::cell::UnsafeCell` in `InTuple`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1319:9: a raw pointer to `std::cell::UnsafeCell` in `InNested`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1323:9: a raw pointer to `std::cell::UnsafeCell` in `InPayload`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1327:9: a raw pointer to `std::cell::UnsafeCell` in `InField`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1331:9: a raw pointer to `std::cell::UnsafeCell` in `InGeneric`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1335:9: a raw pointer to `std::cell::UnsafeCell` in `InWritten`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1464:35: a raw pointer to `std::cell::UnsafeCell` in `ByRead`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1477:35: a raw pointer to `std::cell::UnsafeCell` in `ByWrite`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1490:35: a raw pointer to `std::cell::UnsafeCell` in `BySwap`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1502:35: a raw pointer to `std::cell::UnsafeCell` in `ByReplace`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1513:35: a raw pointer to `std::cell::UnsafeCell` in `ByBox`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1528:35: a raw pointer to `std::cell::UnsafeCell` in `ByClosure`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1541:35: a raw pointer to `std::cell::UnsafeCell` in `ByObject`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1554:35: a raw pointer to `std::cell::UnsafeCell` in `ByInstance`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1563:76: a raw pointer to `std::cell::UnsafeCell` in `BySwapped`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1574:30: a raw pointer to `std::cell::UnsafeCell` in `ByExchanged`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1606:32: a raw pointer to `ByRefReplace` in `(u16, ByRefReplace)`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1614:32: a raw pointer to `ByRefTake` in `(u16, ByRefTake)`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1622:51: a raw pointer to `ByKeySet` in `(u16, ByKeySet)`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1630:55: a raw pointer to `ByKeyReplace` in `(u16, ByKeyReplace)`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1637:52: a raw pointer to `ByKeyTake` in `(u16, ByKeyTake)`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:610:10: a raw pointer to `(u32, u32)` in `Span2`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:671:2: a raw pointer to `(u32, u32)` in `Window`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:689:15: a raw pointer to `(u32, u32)` in `std::cell::UnsafeCell<(u32, u32)>`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:722:21: a raw pointer to `std::cell::UnsafeCell` in `Hits`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:828:10: a raw pointer to `(u32, u32)` in `Plain`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:854:19: a raw pointer to `(u32, u32)` in `Track`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:874:19: a raw pointer to `(u32, u32)` in `Lane`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:910:10: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:911:10: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:912:58: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:924:19: a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:925:19: a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1074:43: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Escaped`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1088:28: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Called`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1112:26: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Looped`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1122:29: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Aliased`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1132:47: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Rewritten`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1144:29: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Loaded`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1178:31: a raw pointer to `(u16, u16)` in `Copied`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1189:39: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Mapped`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1223:18: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Repeated`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1235:46: a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Onced`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1250:22: a raw pointer to `(u16, u16)` in `Pushed`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1304:9: a raw pointer to `std::cell::UnsafeCell` in `InArray`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1308:9: a raw pointer to `std::cell::UnsafeCell` in `InTuple`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1312:9: a raw pointer to `std::cell::UnsafeCell` in `InNested`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1316:9: a raw pointer to `std::cell::UnsafeCell` in `InPayload`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1320:9: a raw pointer to `std::cell::UnsafeCell` in `InField`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1324:9: a raw pointer to `std::cell::UnsafeCell` in `InGeneric`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1328:9: a raw pointer to `std::cell::UnsafeCell` in `InWritten`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1457:35: a raw pointer to `std::cell::UnsafeCell` in `ByRead`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1470:35: a raw pointer to `std::cell::UnsafeCell` in `ByWrite`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1483:35: a raw pointer to `std::cell::UnsafeCell` in `BySwap`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1495:35: a raw pointer to `std::cell::UnsafeCell` in `ByReplace`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1506:35: a raw pointer to `std::cell::UnsafeCell` in `ByBox`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1521:35: a raw pointer to `std::cell::UnsafeCell` in `ByClosure`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1534:35: a raw pointer to `std::cell::UnsafeCell` in `ByObject`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1547:35: a raw pointer to `std::cell::UnsafeCell` in `ByInstance`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1556:76: a raw pointer to `std::cell::UnsafeCell` in `BySwapped`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1567:30: a raw pointer to `std::cell::UnsafeCell` in `ByExchanged`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1599:32: a raw pointer to `ByRefReplace` in `(u16, ByRefReplace)`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1607:32: a raw pointer to `ByRefTake` in `(u16, ByRefTake)`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1615:51: a raw pointer to `ByKeySet` in `(u16, ByKeySet)`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1623:55: a raw pointer to `ByKeyReplace` in `(u16, ByKeyReplace)`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1630:52: a raw pointer to `ByKeyTake` in `(u16, ByKeyTake)`, which the crate may put another object in place of
@@ -482,110 +480,109 @@ The type or module each refused type or path belongs to. - fixtures/reject/src/lib.rs:436:17: unsupported call to ` as std::iter::Iterator>::sum::` - fixtures/reject/src/lib.rs:436:38: unsupported call to ` as std::iter::Iterator>::sum::` - fixtures/reject/src/lib.rs:441:4: unsupported call to `core::str::::parse::` -- fixtures/reject/src/lib.rs:547:2: unsupported call to `::eq` -- fixtures/reject/src/lib.rs:547:17: unsupported call to `std::any::TypeId::of::` -- fixtures/reject/src/lib.rs:574:15: unsupported call to `std::alloc::Layout::new::` -- fixtures/reject/src/lib.rs:576:11: unsupported call to `std::alloc::alloc` -- fixtures/reject/src/lib.rs:579:3: unsupported call to `std::alloc::dealloc` -- fixtures/reject/src/lib.rs:775:15: unsupported call to ` as std::iter::Iterator>::is_sorted` -- fixtures/reject/src/lib.rs:895:10: unsupported call to ` as std::clone::Clone>::clone_from` -- fixtures/reject/src/lib.rs:993:11: unsupported call to `std::ops::RangeTo::::contains::` -- fixtures/reject/src/lib.rs:993:32: unsupported call to ` as std::ops::RangeBounds>::contains::` -- fixtures/reject/src/lib.rs:998:9: unsupported call to `std::ops::Range::<&mut u8>::is_empty` -- fixtures/reject/src/lib.rs:1286:4: unsupported call to `core::num::::is_ascii_octdigit` -- fixtures/reject/src/lib.rs:1645:13: unsupported call to `core::str::::as_bytes_mut` -- fixtures/reject/src/lib.rs:1719:3: unsupported call to `std::ptr::copy::<[u8; 4]>` -- fixtures/reject/src/lib.rs:1720:3: unsupported call to `std::ptr::copy_nonoverlapping::<[u8; 4]>` -- fixtures/reject/src/lib.rs:1721:14: unsupported call to `std::ptr::addr_eq::<[u8; 4], [u8; 4]>` -- fixtures/reject/src/lib.rs:1722:56: unsupported call to `std::ptr::mut_ptr::::add` -- fixtures/reject/src/lib.rs:1722:73: unsupported call to `std::ptr::const_ptr::::offset` -- fixtures/reject/src/lib.rs:1726:14: unsupported call to `> as std::cmp::PartialEq>::eq` -- fixtures/reject/src/lib.rs:1727:76: unsupported call to `std::ptr::const_ptr::::len` +- fixtures/reject/src/lib.rs:540:2: unsupported call to `::eq` +- fixtures/reject/src/lib.rs:540:17: unsupported call to `std::any::TypeId::of::` +- fixtures/reject/src/lib.rs:567:15: unsupported call to `std::alloc::Layout::new::` +- fixtures/reject/src/lib.rs:569:11: unsupported call to `std::alloc::alloc` +- fixtures/reject/src/lib.rs:572:3: unsupported call to `std::alloc::dealloc` +- fixtures/reject/src/lib.rs:768:15: unsupported call to ` as std::iter::Iterator>::is_sorted` +- fixtures/reject/src/lib.rs:888:10: unsupported call to ` as std::clone::Clone>::clone_from` +- fixtures/reject/src/lib.rs:986:11: unsupported call to `std::ops::RangeTo::::contains::` +- fixtures/reject/src/lib.rs:986:32: unsupported call to ` as std::ops::RangeBounds>::contains::` +- fixtures/reject/src/lib.rs:991:9: unsupported call to `std::ops::Range::<&mut u8>::is_empty` +- fixtures/reject/src/lib.rs:1279:4: unsupported call to `core::num::::is_ascii_octdigit` +- fixtures/reject/src/lib.rs:1638:13: unsupported call to `core::str::::as_bytes_mut` +- fixtures/reject/src/lib.rs:1712:3: unsupported call to `std::ptr::copy::<[u8; 4]>` +- fixtures/reject/src/lib.rs:1713:3: unsupported call to `std::ptr::copy_nonoverlapping::<[u8; 4]>` +- fixtures/reject/src/lib.rs:1714:14: unsupported call to `std::ptr::addr_eq::<[u8; 4], [u8; 4]>` +- fixtures/reject/src/lib.rs:1715:56: unsupported call to `std::ptr::mut_ptr::::add` +- fixtures/reject/src/lib.rs:1715:73: unsupported call to `std::ptr::const_ptr::::offset` +- fixtures/reject/src/lib.rs:1719:14: unsupported call to `> as std::cmp::PartialEq>::eq` +- fixtures/reject/src/lib.rs:1720:76: unsupported call to `std::ptr::const_ptr::::len`
a raw pointer to `_` in a variable assigned again while it may point there (19) -- fixtures/reject/src/lib.rs:625:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:633:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:642:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:650:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:659:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:667:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:705:15: a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:718:15: a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:1010:26: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:1023:22: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:1033:12: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:1042:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:1052:17: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:1057:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:1678:10: a raw pointer to `Target` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:1691:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:1706:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:1743:26: a raw pointer to `[u8; 4]` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:1744:10: a raw pointer to `[u8; 4]` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:618:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:626:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:635:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:643:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:652:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:660:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:698:15: a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:711:15: a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:1003:26: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:1016:22: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:1026:12: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:1035:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:1045:17: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:1050:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:1671:10: a raw pointer to `Target` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:1684:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:1699:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:1736:26: a raw pointer to `[u8; 4]` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:1737:10: a raw pointer to `[u8; 4]` in a variable assigned again while it may point there
a reference through which a raw pointer may be made into `_` in `_`, which the crate may put another object in place of (15) -- fixtures/reject/src/lib.rs:1346:33: a reference through which a raw pointer may be made into `InArray` in `[InArray; 2]`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1355:33: a reference through which a raw pointer may be made into `InTuple` in `(u16, InTuple)`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1364:34: a reference through which a raw pointer may be made into `Mid` in `Outer`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1385:33: a reference through which a raw pointer may be made into `Mid` in `Outer`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1398:35: a reference through which a raw pointer may be made into `Mid` in `Outer`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1407:35: a reference through which a raw pointer may be made into `InWritten` in `[InWritten; 1]`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1967:20: a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Replaced`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1985:20: a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Swapped`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:2003:20: a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Taken`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:2022:20: a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Assigned`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:2048:22: a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Deeper`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:2072:20: a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Dynamic`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:2088:15: a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Closed`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:2101:20: a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `[std::cell::UnsafeCell; 2]`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:2147:20: a reference through which a raw pointer may be made into `Parked` in `Parking`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1339:33: a reference through which a raw pointer may be made into `InArray` in `[InArray; 2]`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1348:33: a reference through which a raw pointer may be made into `InTuple` in `(u16, InTuple)`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1357:34: a reference through which a raw pointer may be made into `Mid` in `Outer`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1378:33: a reference through which a raw pointer may be made into `Mid` in `Outer`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1391:35: a reference through which a raw pointer may be made into `Mid` in `Outer`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1400:35: a reference through which a raw pointer may be made into `InWritten` in `[InWritten; 1]`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1960:20: a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Replaced`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1978:20: a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Swapped`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:1996:20: a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Taken`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:2015:20: a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Assigned`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:2041:22: a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Deeper`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:2065:20: a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Dynamic`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:2081:15: a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Closed`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:2094:20: a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `[std::cell::UnsafeCell; 2]`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:2140:20: a reference through which a raw pointer may be made into `Parked` in `Parking`, which the crate may put another object in place of
a reference to `_`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there (15) -- fixtures/reject/src/lib.rs:1664:18: a reference to `std::cell::UnsafeCell`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there -- fixtures/reject/src/lib.rs:1743:26: a reference to `[u8; 4]`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there -- fixtures/reject/src/lib.rs:1761:22: a reference to `Behind`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there -- fixtures/reject/src/lib.rs:1776:16: a reference to `Unboxed`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there -- fixtures/reject/src/lib.rs:1797:18: a reference to `Deep`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there -- fixtures/reject/src/lib.rs:1819:21: a reference to `Slotted`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there -- fixtures/reject/src/lib.rs:1838:20: a reference to `Shared`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there -- fixtures/reject/src/lib.rs:1855:20: a reference to `Inside`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there -- fixtures/reject/src/lib.rs:1868:26: a reference to `Inside`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there -- fixtures/reject/src/lib.rs:1883:22: a reference to `Compared`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there -- fixtures/reject/src/lib.rs:1900:22: a reference to `Enclosing`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there -- fixtures/reject/src/lib.rs:1916:17: a reference to `Chosen`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there -- fixtures/reject/src/lib.rs:1929:19: a reference to `[u8; 4]`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there -- fixtures/reject/src/lib.rs:1944:21: a reference to `Wrapped>`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there -- fixtures/reject/src/lib.rs:2118:13: a reference to `std::option::Option>`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there +- fixtures/reject/src/lib.rs:1657:18: a reference to `std::cell::UnsafeCell`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there +- fixtures/reject/src/lib.rs:1736:26: a reference to `[u8; 4]`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there +- fixtures/reject/src/lib.rs:1754:22: a reference to `Behind`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there +- fixtures/reject/src/lib.rs:1769:16: a reference to `Unboxed`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there +- fixtures/reject/src/lib.rs:1790:18: a reference to `Deep`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there +- fixtures/reject/src/lib.rs:1812:21: a reference to `Slotted`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there +- fixtures/reject/src/lib.rs:1831:20: a reference to `Shared`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there +- fixtures/reject/src/lib.rs:1848:20: a reference to `Inside`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there +- fixtures/reject/src/lib.rs:1861:26: a reference to `Inside`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there +- fixtures/reject/src/lib.rs:1876:22: a reference to `Compared`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there +- fixtures/reject/src/lib.rs:1893:22: a reference to `Enclosing`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there +- fixtures/reject/src/lib.rs:1909:17: a reference to `Chosen`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there +- fixtures/reject/src/lib.rs:1922:19: a reference to `[u8; 4]`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there +- fixtures/reject/src/lib.rs:1937:21: a reference to `Wrapped>`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there +- fixtures/reject/src/lib.rs:2111:13: a reference to `std::option::Option>`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there
-
`_` with a mutable reference to a value JS copies, which its mapping would copy (6) +
`_` with a mutable reference to a value JS copies, which its mapping would copy (5) -- fixtures/reject/src/lib.rs:523:12: `std::sync::Mutex::::get_mut` with a mutable reference to a value JS copies, which its mapping would copy -- fixtures/reject/src/lib.rs:1244:22: `std::iter::once` with a mutable reference to a value JS copies, which its mapping would copy -- fixtures/reject/src/lib.rs:1646:13: `core::str::::get_unchecked_mut` with a mutable reference to a value JS copies, which its mapping would copy -- fixtures/reject/src/lib.rs:1651:20: `std::str::from_utf8_mut` with a mutable reference to a value JS copies, which its mapping would copy -- fixtures/reject/src/lib.rs:2127:4: `std::collections::LinkedList::::retain` with a mutable reference to a value JS copies, which its mapping would copy -- fixtures/reject/src/lib.rs:2129:2: `std::default::Default::default` with a mutable reference to a value JS copies, which its mapping would copy +- fixtures/reject/src/lib.rs:1237:22: `std::iter::once` with a mutable reference to a value JS copies, which its mapping would copy +- fixtures/reject/src/lib.rs:1639:13: `core::str::::get_unchecked_mut` with a mutable reference to a value JS copies, which its mapping would copy +- fixtures/reject/src/lib.rs:1644:20: `std::str::from_utf8_mut` with a mutable reference to a value JS copies, which its mapping would copy +- fixtures/reject/src/lib.rs:2120:4: `std::collections::LinkedList::::retain` with a mutable reference to a value JS copies, which its mapping would copy +- fixtures/reject/src/lib.rs:2122:2: `std::default::Default::default` with a mutable reference to a value JS copies, which its mapping would copy
a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet (5) -- fixtures/reject/src/lib.rs:688:10: a raw pointer to `(u32, u32)` in an element, a payload, or a union field, which is not supported yet -- fixtures/reject/src/lib.rs:1736:15: a raw pointer to `[u8; 3]` in an element, a payload, or a union field, which is not supported yet -- fixtures/reject/src/lib.rs:1736:18: a raw pointer to `[u8; 3]` in an element, a payload, or a union field, which is not supported yet -- fixtures/reject/src/lib.rs:1736:37: a raw pointer to `[u8; 2]` in an element, a payload, or a union field, which is not supported yet -- fixtures/reject/src/lib.rs:1736:44: a raw pointer to `[u8; 2]` in an element, a payload, or a union field, which is not supported yet +- fixtures/reject/src/lib.rs:681:10: a raw pointer to `(u32, u32)` in an element, a payload, or a union field, which is not supported yet +- fixtures/reject/src/lib.rs:1729:15: a raw pointer to `[u8; 3]` in an element, a payload, or a union field, which is not supported yet +- fixtures/reject/src/lib.rs:1729:18: a raw pointer to `[u8; 3]` in an element, a payload, or a union field, which is not supported yet +- fixtures/reject/src/lib.rs:1729:37: a raw pointer to `[u8; 2]` in an element, a payload, or a union field, which is not supported yet +- fixtures/reject/src/lib.rs:1729:44: a raw pointer to `[u8; 2]` in an element, a payload, or a union field, which is not supported yet
@@ -667,8 +664,8 @@ The type or module each refused type or path belongs to.
a cast from a pointer to `_` to one to `_`, which reads the bytes of one type as another (2) -- fixtures/reject/src/lib.rs:564:27: a cast from a pointer to `u32` to one to `u8`, which reads the bytes of one type as another -- fixtures/reject/src/lib.rs:1722:17: a cast from a pointer to `[u8; 4]` to one to `u8`, which reads the bytes of one type as another +- fixtures/reject/src/lib.rs:557:27: a cast from a pointer to `u32` to one to `u8`, which reads the bytes of one type as another +- fixtures/reject/src/lib.rs:1715:17: a cast from a pointer to `[u8; 4]` to one to `u8`, which reads the bytes of one type as another
@@ -681,8 +678,8 @@ The type or module each refused type or path belongs to.
a raw pointer to a place of `()`, which has no address of its own (2) -- fixtures/reject/src/lib.rs:737:15: a raw pointer to a place of `()`, which has no address of its own -- fixtures/reject/src/lib.rs:737:29: a raw pointer to a place of `()`, which has no address of its own +- fixtures/reject/src/lib.rs:730:15: a raw pointer to a place of `()`, which has no address of its own +- fixtures/reject/src/lib.rs:730:29: a raw pointer to a place of `()`, which has no address of its own
@@ -703,7 +700,7 @@ The type or module each refused type or path belongs to.
passing `_`, which drops, to `_`, which is not supported yet (2) - fixtures/reject/src/lib.rs:333:4: passing `{closure@fixtures/reject/src/lib.rs:333:13: 333:27}`, which drops, to `str::contains`, which is not supported yet -- fixtures/reject/src/lib.rs:793:4: passing `{closure@fixtures/reject/src/lib.rs:793:11: 793:19}`, which drops, to `String::retain`, which is not supported yet +- fixtures/reject/src/lib.rs:786:4: passing `{closure@fixtures/reject/src/lib.rs:786:11: 786:19}`, which drops, to `String::retain`, which is not supported yet
@@ -716,7 +713,7 @@ The type or module each refused type or path belongs to.
`Buf::copy_to_bytes` of `_`, a value JS copies, which is not supported (1) -- fixtures/reject/src/lib.rs:770:2: `Buf::copy_to_bytes` of `Blank`, a value JS copies, which is not supported +- fixtures/reject/src/lib.rs:763:2: `Buf::copy_to_bytes` of `Blank`, a value JS copies, which is not supported
@@ -734,7 +731,7 @@ The type or module each refused type or path belongs to.
`Extend` of `_` by `_`, whose `_` of `_` is not supported yet (1) -- fixtures/reject/src/lib.rs:1281:31: `Extend` of `(std::vec::Vec, Tens)` by `(u8, u8)`, whose `Tens` of `u8` is not supported yet +- fixtures/reject/src/lib.rs:1274:31: `Extend` of `(std::vec::Vec, Tens)` by `(u8, u8)`, whose `Tens` of `u8` is not supported yet
@@ -770,7 +767,7 @@ The type or module each refused type or path belongs to.
`_` of `_`, which is not supported yet (1) -- fixtures/reject/src/lib.rs:547:4: `std::any::Any::type_id` of `dyn std::any::Any`, which is not supported yet +- fixtures/reject/src/lib.rs:540:4: `std::any::Any::type_id` of `dyn std::any::Any`, which is not supported yet
@@ -788,13 +785,13 @@ The type or module each refused type or path belongs to.
`clone_from` of `_`, whose items' `clone_from` is their own, which is not supported yet (1) -- fixtures/reject/src/lib.rs:2128:4: `clone_from` of `std::collections::LinkedList`, whose items' `clone_from` is their own, which is not supported yet +- fixtures/reject/src/lib.rs:2121:4: `clone_from` of `std::collections::LinkedList`, whose items' `clone_from` is their own, which is not supported yet
`collect` of `_`, which sorts by `_`'s own `Ord`, of entries that drop, which is not supported yet (1) -- fixtures/reject/src/lib.rs:964:22: `collect` of `std::collections::BTreeMap, Noisy>`, which sorts by `std::cell::Cell`'s own `Ord`, of entries that drop, which is not supported yet +- fixtures/reject/src/lib.rs:957:22: `collect` of `std::collections::BTreeMap, Noisy>`, which sorts by `std::cell::Cell`'s own `Ord`, of entries that drop, which is not supported yet
@@ -824,13 +821,13 @@ The type or module each refused type or path belongs to.
a cast from `_` to `_`, which reads the bytes of one type as another (1) -- fixtures/reject/src/lib.rs:1722:33: a cast from `*const [u8; 4]` to `*const u8`, which reads the bytes of one type as another +- fixtures/reject/src/lib.rs:1715:33: a cast from `*const [u8; 4]` to `*const u8`, which reads the bytes of one type as another
a coercion of `_` to `_`, a pointer to a slice (1) -- fixtures/reject/src/lib.rs:1723:28: a coercion of `*const [u8; 4]` to `*const [u8]`, a pointer to a slice +- fixtures/reject/src/lib.rs:1716:28: a coercion of `*const [u8; 4]` to `*const [u8]`, a pointer to a slice
@@ -842,13 +839,13 @@ The type or module each refused type or path belongs to.
a constant of type `_`, a pointer into memory translation can't name (1) -- fixtures/reject/src/lib.rs:787:3: a constant of type `&u32`, a pointer into memory translation can't name +- fixtures/reject/src/lib.rs:780:3: a constant of type `&u32`, a pointer into memory translation can't name
a dangling pointer to `_`, a value of no bytes made of more than structs and tuples (1) -- fixtures/reject/src/lib.rs:746:11: a dangling pointer to `Only`, a value of no bytes made of more than structs and tuples +- fixtures/reject/src/lib.rs:739:11: a dangling pointer to `Only`, a value of no bytes made of more than structs and tuples
@@ -872,7 +869,7 @@ The type or module each refused type or path belongs to.
a pointer's address, which JS has no counterpart of (1) -- fixtures/reject/src/lib.rs:569:17: a pointer's address, which JS has no counterpart of +- fixtures/reject/src/lib.rs:562:17: a pointer's address, which JS has no counterpart of
@@ -884,13 +881,13 @@ The type or module each refused type or path belongs to.
a raw pointer to `_` behind a reference, which is the object and not where it is kept (1) -- fixtures/reject/src/lib.rs:586:10: a raw pointer to `std::vec::Vec` behind a reference, which is the object and not where it is kept +- fixtures/reject/src/lib.rs:579:10: a raw pointer to `std::vec::Vec` behind a reference, which is the object and not where it is kept
a reference through which a raw pointer may be made into `_` in an element, a payload, or a union field, which is not supported yet (1) -- fixtures/reject/src/lib.rs:1373:11: a reference through which a raw pointer may be made into `InPayload` in an element, a payload, or a union field, which is not supported yet +- fixtures/reject/src/lib.rs:1366:11: a reference through which a raw pointer may be made into `InPayload` in an element, a payload, or a union field, which is not supported yet
@@ -914,7 +911,7 @@ The type or module each refused type or path belongs to.
an upcast from `_` to `_`, which is not supported yet (1) -- fixtures/reject/src/lib.rs:541:32: an upcast from `dyn Keyed` to `dyn std::any::Any`, which is not supported yet +- fixtures/reject/src/lib.rs:534:32: an upcast from `dyn Keyed` to `dyn std::any::Any`, which is not supported yet
@@ -926,7 +923,7 @@ The type or module each refused type or path belongs to.
comparing `_` (1) -- fixtures/reject/src/lib.rs:1721:41: comparing `*mut [u8; 4]` +- fixtures/reject/src/lib.rs:1714:41: comparing `*mut [u8; 4]`
@@ -938,25 +935,25 @@ The type or module each refused type or path belongs to.
comparing pointers to `_` in an atomic, which JS has no address of (1) -- fixtures/reject/src/lib.rs:786:15: comparing pointers to `u32` in an atomic, which JS has no address of +- fixtures/reject/src/lib.rs:779:15: comparing pointers to `u32` in an atomic, which JS has no address of
comparing pointers to `_`, each a place JS makes of its own (1) -- fixtures/reject/src/lib.rs:605:2: comparing pointers to `u32`, each a place JS makes of its own +- fixtures/reject/src/lib.rs:598:2: comparing pointers to `u32`, each a place JS makes of its own
comparing pointers to `_`, which has no bytes and so no address of its own (1) -- fixtures/reject/src/lib.rs:737:70: comparing pointers to `Fused`, which has no bytes and so no address of its own +- fixtures/reject/src/lib.rs:730:70: comparing pointers to `Fused`, which has no bytes and so no address of its own
const generic types are not supported: `_` (1) -- fixtures/reject/src/lib.rs:2107:1: const generic types are not supported: `Block` +- fixtures/reject/src/lib.rs:2100:1: const generic types are not supported: `Block`
@@ -974,7 +971,7 @@ The type or module each refused type or path belongs to.
hashing `_` by its address, which JS has no counterpart of (1) -- fixtures/reject/src/lib.rs:1725:5: hashing `*const [u8; 4]` by its address, which JS has no counterpart of +- fixtures/reject/src/lib.rs:1718:5: hashing `*const [u8; 4]` by its address, which JS has no counterpart of
@@ -992,6 +989,6 @@ The type or module each refused type or path belongs to.
union `_`, whose fields overlap in `_` and `f64`, which JS keeps apart (1) -- fixtures/reject/src/lib.rs:591:1: union `Bits`, whose fields overlap in `u32` and `f64`, which JS keeps apart +- fixtures/reject/src/lib.rs:584:1: union `Bits`, whose fields overlap in `u32` and `f64`, which JS keeps apart
diff --git a/ts/fixtures/reject/expected.txt b/ts/fixtures/reject/expected.txt index b99ed51e6..f7db6d56a 100644 --- a/ts/fixtures/reject/expected.txt +++ b/ts/fixtures/reject/expected.txt @@ -26,9 +26,9 @@ replacing the value behind a reference to `std::pin::Pin>>` at fixtures/reject/src/lib.rs:114:2 replacing the value behind a reference to `std::pin::Pin>` at fixtures/reject/src/lib.rs:106:2 unsupported call to `std::ops::Range::::contains::` at fixtures/reject/src/lib.rs:167:8 -unsupported call to `std::ops::RangeTo::::contains::` at fixtures/reject/src/lib.rs:993:11 -unsupported call to ` as std::ops::RangeBounds>::contains::` at fixtures/reject/src/lib.rs:993:32 -unsupported call to `std::ops::Range::<&mut u8>::is_empty` at fixtures/reject/src/lib.rs:998:9 +unsupported call to `std::ops::RangeTo::::contains::` at fixtures/reject/src/lib.rs:986:11 +unsupported call to ` as std::ops::RangeBounds>::contains::` at fixtures/reject/src/lib.rs:986:32 +unsupported call to `std::ops::Range::<&mut u8>::is_empty` at fixtures/reject/src/lib.rs:991:9 a `skip` of `std::iter::Zip, {closure@fixtures/reject/src/lib.rs:208:27: 208:31}>, std::iter::Map, {closure@fixtures/reject/src/lib.rs:208:59: 208:63}>>`, a zip std reads by index, of items that drop, which is not supported yet at fixtures/reject/src/lib.rs:209:8 a `collect` in place of `std::iter::Map, {closure@fixtures/reject/src/lib.rs:215:32: 215:40}>, std::ops::Range>, {closure@fixtures/reject/src/lib.rs:216:24: 216:32}>`, a zip std reads by index, holding values that drop, which is not supported yet at fixtures/reject/src/lib.rs:216:40 an assignment through a reference to `std::pin::Pin<&mut Noisy>` at fixtures/reject/src/lib.rs:221:2 @@ -63,155 +63,154 @@ a coercion to `std::sync::Weak`, which is not supported yet at fixt `dyn Scaled`, a trait object of the generic trait `Scaled`, which is not supported yet at fixtures/reject/src/lib.rs:467:4 a trait object of `[u8; 4]`, which is not supported yet at fixtures/reject/src/lib.rs:483:26 a coercion to `&Tail`, which is not supported yet at fixtures/reject/src/lib.rs:493:30 -`std::sync::Mutex::::get_mut` with a mutable reference to a value JS copies, which its mapping would copy at fixtures/reject/src/lib.rs:523:12 `Waiting>` is not supported: its field `poll` is `Poll`, typed `rt.Poll`, whose `Pending` would be `rt.OuterPending` as `Poll>` at fixtures/reject/src/lib.rs:504:2 a copy of a closure that changes what it captured at fixtures/reject/src/lib.rs:516:14 a copy of a closure that changes what it captured at fixtures/reject/src/lib.rs:517:14 -an upcast from `dyn Keyed` to `dyn std::any::Any`, which is not supported yet at fixtures/reject/src/lib.rs:541:32 -`std::any::Any::type_id` of `dyn std::any::Any`, which is not supported yet at fixtures/reject/src/lib.rs:547:4 -unsupported call to `std::any::TypeId::of::` at fixtures/reject/src/lib.rs:547:17 -unsupported call to `::eq` at fixtures/reject/src/lib.rs:547:2 -a cast from a pointer to `u32` to one to `u8`, which reads the bytes of one type as another at fixtures/reject/src/lib.rs:564:27 -a pointer's address, which JS has no counterpart of at fixtures/reject/src/lib.rs:569:17 -unsupported call to `std::alloc::Layout::new::` at fixtures/reject/src/lib.rs:574:15 -unsupported call to `std::alloc::alloc` at fixtures/reject/src/lib.rs:576:11 -unsupported call to `std::alloc::dealloc` at fixtures/reject/src/lib.rs:579:3 -a raw pointer to `std::vec::Vec` behind a reference, which is the object and not where it is kept at fixtures/reject/src/lib.rs:586:10 -union `Bits`, whose fields overlap in `u32` and `f64`, which JS keeps apart at fixtures/reject/src/lib.rs:597:10 -comparing pointers to `u32`, each a place JS makes of its own at fixtures/reject/src/lib.rs:605:2 -a raw pointer to `(u32, u32)` in `Span2`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:617:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:625:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:633:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:642:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:650:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:659:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:667:10 -a reference to `std::cell::UnsafeCell`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1664:18 -a raw pointer to `Target` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1678:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1691:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1706:10 -a reference to `Behind`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1761:22 -a reference to `Unboxed`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1776:16 -a reference to `Deep`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1797:18 -a reference to `Slotted`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1819:21 -a reference to `Shared`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1838:20 -a reference to `Inside`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1855:20 -a reference to `Inside`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1868:26 -a reference to `Wrapped>`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1944:21 -a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Replaced`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1967:20 -a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Swapped`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1985:20 -a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Taken`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:2003:20 -a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Assigned`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:2022:20 -a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Deeper`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:2048:22 -a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Dynamic`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:2072:20 -a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Closed`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:2088:15 -a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `[std::cell::UnsafeCell; 2]`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:2101:20 -a reference to `Compared`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1883:22 -a reference to `Enclosing`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1900:22 -a reference to `Chosen`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1916:17 -a reference to `[u8; 4]`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1929:19 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1010:26 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1023:22 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1033:12 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1042:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1052:17 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1057:10 -a raw pointer to `(u32, u32)` in `Window`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:678:2 -a raw pointer to `(u32, u32)` in an element, a payload, or a union field, which is not supported yet at fixtures/reject/src/lib.rs:688:10 -a raw pointer to `(u32, u32)` in `std::cell::UnsafeCell<(u32, u32)>`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:696:15 -a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:705:15 -a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:718:15 -a raw pointer to `std::cell::UnsafeCell` in `Hits`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:729:21 -a raw pointer to a place of `()`, which has no address of its own at fixtures/reject/src/lib.rs:737:15 -a raw pointer to a place of `()`, which has no address of its own at fixtures/reject/src/lib.rs:737:29 -comparing pointers to `Fused`, which has no bytes and so no address of its own at fixtures/reject/src/lib.rs:737:70 -a dangling pointer to `Only`, a value of no bytes made of more than structs and tuples at fixtures/reject/src/lib.rs:746:11 -`Buf::copy_to_bytes` of `Blank`, a value JS copies, which is not supported at fixtures/reject/src/lib.rs:770:2 -unsupported call to ` as std::iter::Iterator>::is_sorted` at fixtures/reject/src/lib.rs:775:15 -comparing pointers to `u32` in an atomic, which JS has no address of at fixtures/reject/src/lib.rs:786:15 -a constant of type `&u32`, a pointer into memory translation can't name at fixtures/reject/src/lib.rs:787:3 -passing `{closure@fixtures/reject/src/lib.rs:793:11: 793:19}`, which drops, to `String::retain`, which is not supported yet at fixtures/reject/src/lib.rs:793:4 -a raw pointer to `(u32, u32)` in `Plain`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:835:10 -a raw pointer to `(u32, u32)` in `Track`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:861:19 -a raw pointer to `(u32, u32)` in `Lane`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:881:19 -a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:917:10 -a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:918:10 -a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:919:58 -a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:931:19 -a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:932:19 -`collect` of `std::collections::BTreeMap, Noisy>`, which sorts by `std::cell::Cell`'s own `Ord`, of entries that drop, which is not supported yet at fixtures/reject/src/lib.rs:964:22 -a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Looped`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1119:26 -a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Aliased`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1129:29 -a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Rewritten`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1139:47 -a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Loaded`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1151:29 -a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Mapped`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1196:39 -a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Repeated`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1230:18 -a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Onced`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1242:46 -`std::iter::once` with a mutable reference to a value JS copies, which its mapping would copy at fixtures/reject/src/lib.rs:1244:22 -a raw pointer to `(u16, u16)` in `Pushed`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1257:22 -`Extend` of `(std::vec::Vec, Tens)` by `(u8, u8)`, whose `Tens` of `u8` is not supported yet at fixtures/reject/src/lib.rs:1281:31 -unsupported call to `core::num::::is_ascii_octdigit` at fixtures/reject/src/lib.rs:1286:4 -a reference through which a raw pointer may be made into `InArray` in `[InArray; 2]`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1346:33 -a reference through which a raw pointer may be made into `InTuple` in `(u16, InTuple)`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1355:33 -a reference through which a raw pointer may be made into `Mid` in `Outer`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1364:34 -a reference through which a raw pointer may be made into `InPayload` in an element, a payload, or a union field, which is not supported yet at fixtures/reject/src/lib.rs:1373:11 -a reference through which a raw pointer may be made into `Mid` in `Outer`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1385:33 -a reference through which a raw pointer may be made into `Mid` in `Outer`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1398:35 -a reference through which a raw pointer may be made into `InWritten` in `[InWritten; 1]`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1407:35 -a raw pointer to `std::cell::UnsafeCell` in `ByRead`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1464:35 -a raw pointer to `std::cell::UnsafeCell` in `ByWrite`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1477:35 -a raw pointer to `std::cell::UnsafeCell` in `BySwap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1490:35 -a raw pointer to `std::cell::UnsafeCell` in `ByReplace`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1502:35 -a raw pointer to `std::cell::UnsafeCell` in `ByBox`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1513:35 -a raw pointer to `std::cell::UnsafeCell` in `ByClosure`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1528:35 -a raw pointer to `std::cell::UnsafeCell` in `ByObject`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1541:35 -a raw pointer to `std::cell::UnsafeCell` in `ByInstance`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1554:35 -a raw pointer to `std::cell::UnsafeCell` in `BySwapped`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1563:76 -a raw pointer to `std::cell::UnsafeCell` in `ByExchanged`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1574:30 -a raw pointer to `ByRefReplace` in `(u16, ByRefReplace)`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1606:32 -a raw pointer to `ByRefTake` in `(u16, ByRefTake)`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1614:32 -a raw pointer to `ByKeySet` in `(u16, ByKeySet)`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1622:51 -a raw pointer to `ByKeyReplace` in `(u16, ByKeyReplace)`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1630:55 -a raw pointer to `ByKeyTake` in `(u16, ByKeyTake)`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1637:52 -unsupported call to `core::str::::as_bytes_mut` at fixtures/reject/src/lib.rs:1645:13 -`core::str::::get_unchecked_mut` with a mutable reference to a value JS copies, which its mapping would copy at fixtures/reject/src/lib.rs:1646:13 -`std::str::from_utf8_mut` with a mutable reference to a value JS copies, which its mapping would copy at fixtures/reject/src/lib.rs:1651:20 -unsupported call to `std::ptr::copy::<[u8; 4]>` at fixtures/reject/src/lib.rs:1719:3 -unsupported call to `std::ptr::copy_nonoverlapping::<[u8; 4]>` at fixtures/reject/src/lib.rs:1720:3 -unsupported call to `std::ptr::addr_eq::<[u8; 4], [u8; 4]>` at fixtures/reject/src/lib.rs:1721:14 -comparing `*mut [u8; 4]` at fixtures/reject/src/lib.rs:1721:41 -a cast from a pointer to `[u8; 4]` to one to `u8`, which reads the bytes of one type as another at fixtures/reject/src/lib.rs:1722:17 -a cast from `*const [u8; 4]` to `*const u8`, which reads the bytes of one type as another at fixtures/reject/src/lib.rs:1722:33 -unsupported call to `std::ptr::mut_ptr::::add` at fixtures/reject/src/lib.rs:1722:56 -unsupported call to `std::ptr::const_ptr::::offset` at fixtures/reject/src/lib.rs:1722:73 -a coercion of `*const [u8; 4]` to `*const [u8]`, a pointer to a slice at fixtures/reject/src/lib.rs:1723:28 -hashing `*const [u8; 4]` by its address, which JS has no counterpart of at fixtures/reject/src/lib.rs:1725:5 -unsupported call to `> as std::cmp::PartialEq>::eq` at fixtures/reject/src/lib.rs:1726:14 -unsupported call to `std::ptr::const_ptr::::len` at fixtures/reject/src/lib.rs:1727:76 -a raw pointer to `[u8; 3]` in an element, a payload, or a union field, which is not supported yet at fixtures/reject/src/lib.rs:1736:15 -a raw pointer to `[u8; 3]` in an element, a payload, or a union field, which is not supported yet at fixtures/reject/src/lib.rs:1736:18 -a raw pointer to `[u8; 2]` in an element, a payload, or a union field, which is not supported yet at fixtures/reject/src/lib.rs:1736:37 -a raw pointer to `[u8; 2]` in an element, a payload, or a union field, which is not supported yet at fixtures/reject/src/lib.rs:1736:44 -a reference to `[u8; 4]`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1743:26 -a raw pointer to `[u8; 4]` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1743:26 -a raw pointer to `[u8; 4]` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1744:10 -const generic types are not supported: `Block` at fixtures/reject/src/lib.rs:2111:21 -`std::collections::LinkedList::::retain` with a mutable reference to a value JS copies, which its mapping would copy at fixtures/reject/src/lib.rs:2127:4 -`clone_from` of `std::collections::LinkedList`, whose items' `clone_from` is their own, which is not supported yet at fixtures/reject/src/lib.rs:2128:4 -`std::default::Default::default` with a mutable reference to a value JS copies, which its mapping would copy at fixtures/reject/src/lib.rs:2129:2 +an upcast from `dyn Keyed` to `dyn std::any::Any`, which is not supported yet at fixtures/reject/src/lib.rs:534:32 +`std::any::Any::type_id` of `dyn std::any::Any`, which is not supported yet at fixtures/reject/src/lib.rs:540:4 +unsupported call to `std::any::TypeId::of::` at fixtures/reject/src/lib.rs:540:17 +unsupported call to `::eq` at fixtures/reject/src/lib.rs:540:2 +a cast from a pointer to `u32` to one to `u8`, which reads the bytes of one type as another at fixtures/reject/src/lib.rs:557:27 +a pointer's address, which JS has no counterpart of at fixtures/reject/src/lib.rs:562:17 +unsupported call to `std::alloc::Layout::new::` at fixtures/reject/src/lib.rs:567:15 +unsupported call to `std::alloc::alloc` at fixtures/reject/src/lib.rs:569:11 +unsupported call to `std::alloc::dealloc` at fixtures/reject/src/lib.rs:572:3 +a raw pointer to `std::vec::Vec` behind a reference, which is the object and not where it is kept at fixtures/reject/src/lib.rs:579:10 +union `Bits`, whose fields overlap in `u32` and `f64`, which JS keeps apart at fixtures/reject/src/lib.rs:590:10 +comparing pointers to `u32`, each a place JS makes of its own at fixtures/reject/src/lib.rs:598:2 +a raw pointer to `(u32, u32)` in `Span2`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:610:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:618:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:626:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:635:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:643:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:652:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:660:10 +a reference to `std::cell::UnsafeCell`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1657:18 +a raw pointer to `Target` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1671:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1684:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1699:10 +a reference to `Behind`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1754:22 +a reference to `Unboxed`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1769:16 +a reference to `Deep`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1790:18 +a reference to `Slotted`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1812:21 +a reference to `Shared`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1831:20 +a reference to `Inside`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1848:20 +a reference to `Inside`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1861:26 +a reference to `Wrapped>`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1937:21 +a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Replaced`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1960:20 +a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Swapped`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1978:20 +a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Taken`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1996:20 +a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Assigned`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:2015:20 +a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Deeper`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:2041:22 +a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Dynamic`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:2065:20 +a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `Closed`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:2081:15 +a reference through which a raw pointer may be made into `std::cell::UnsafeCell` in `[std::cell::UnsafeCell; 2]`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:2094:20 +a reference to `Compared`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1876:22 +a reference to `Enclosing`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1893:22 +a reference to `Chosen`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1909:17 +a reference to `[u8; 4]`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1922:19 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1003:26 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1016:22 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1026:12 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1035:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1045:17 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1050:10 +a raw pointer to `(u32, u32)` in `Window`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:671:2 +a raw pointer to `(u32, u32)` in an element, a payload, or a union field, which is not supported yet at fixtures/reject/src/lib.rs:681:10 +a raw pointer to `(u32, u32)` in `std::cell::UnsafeCell<(u32, u32)>`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:689:15 +a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:698:15 +a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:711:15 +a raw pointer to `std::cell::UnsafeCell` in `Hits`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:722:21 +a raw pointer to a place of `()`, which has no address of its own at fixtures/reject/src/lib.rs:730:15 +a raw pointer to a place of `()`, which has no address of its own at fixtures/reject/src/lib.rs:730:29 +comparing pointers to `Fused`, which has no bytes and so no address of its own at fixtures/reject/src/lib.rs:730:70 +a dangling pointer to `Only`, a value of no bytes made of more than structs and tuples at fixtures/reject/src/lib.rs:739:11 +`Buf::copy_to_bytes` of `Blank`, a value JS copies, which is not supported at fixtures/reject/src/lib.rs:763:2 +unsupported call to ` as std::iter::Iterator>::is_sorted` at fixtures/reject/src/lib.rs:768:15 +comparing pointers to `u32` in an atomic, which JS has no address of at fixtures/reject/src/lib.rs:779:15 +a constant of type `&u32`, a pointer into memory translation can't name at fixtures/reject/src/lib.rs:780:3 +passing `{closure@fixtures/reject/src/lib.rs:786:11: 786:19}`, which drops, to `String::retain`, which is not supported yet at fixtures/reject/src/lib.rs:786:4 +a raw pointer to `(u32, u32)` in `Plain`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:828:10 +a raw pointer to `(u32, u32)` in `Track`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:854:19 +a raw pointer to `(u32, u32)` in `Lane`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:874:19 +a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:910:10 +a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:911:10 +a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:912:58 +a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:924:19 +a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:925:19 +`collect` of `std::collections::BTreeMap, Noisy>`, which sorts by `std::cell::Cell`'s own `Ord`, of entries that drop, which is not supported yet at fixtures/reject/src/lib.rs:957:22 +a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Looped`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1112:26 +a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Aliased`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1122:29 +a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Rewritten`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1132:47 +a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Loaded`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1144:29 +a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Mapped`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1189:39 +a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Repeated`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1223:18 +a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Onced`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1235:46 +`std::iter::once` with a mutable reference to a value JS copies, which its mapping would copy at fixtures/reject/src/lib.rs:1237:22 +a raw pointer to `(u16, u16)` in `Pushed`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1250:22 +`Extend` of `(std::vec::Vec, Tens)` by `(u8, u8)`, whose `Tens` of `u8` is not supported yet at fixtures/reject/src/lib.rs:1274:31 +unsupported call to `core::num::::is_ascii_octdigit` at fixtures/reject/src/lib.rs:1279:4 +a reference through which a raw pointer may be made into `InArray` in `[InArray; 2]`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1339:33 +a reference through which a raw pointer may be made into `InTuple` in `(u16, InTuple)`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1348:33 +a reference through which a raw pointer may be made into `Mid` in `Outer`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1357:34 +a reference through which a raw pointer may be made into `InPayload` in an element, a payload, or a union field, which is not supported yet at fixtures/reject/src/lib.rs:1366:11 +a reference through which a raw pointer may be made into `Mid` in `Outer`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1378:33 +a reference through which a raw pointer may be made into `Mid` in `Outer`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1391:35 +a reference through which a raw pointer may be made into `InWritten` in `[InWritten; 1]`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1400:35 +a raw pointer to `std::cell::UnsafeCell` in `ByRead`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1457:35 +a raw pointer to `std::cell::UnsafeCell` in `ByWrite`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1470:35 +a raw pointer to `std::cell::UnsafeCell` in `BySwap`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1483:35 +a raw pointer to `std::cell::UnsafeCell` in `ByReplace`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1495:35 +a raw pointer to `std::cell::UnsafeCell` in `ByBox`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1506:35 +a raw pointer to `std::cell::UnsafeCell` in `ByClosure`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1521:35 +a raw pointer to `std::cell::UnsafeCell` in `ByObject`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1534:35 +a raw pointer to `std::cell::UnsafeCell` in `ByInstance`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1547:35 +a raw pointer to `std::cell::UnsafeCell` in `BySwapped`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1556:76 +a raw pointer to `std::cell::UnsafeCell` in `ByExchanged`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1567:30 +a raw pointer to `ByRefReplace` in `(u16, ByRefReplace)`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1599:32 +a raw pointer to `ByRefTake` in `(u16, ByRefTake)`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1607:32 +a raw pointer to `ByKeySet` in `(u16, ByKeySet)`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1615:51 +a raw pointer to `ByKeyReplace` in `(u16, ByKeyReplace)`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1623:55 +a raw pointer to `ByKeyTake` in `(u16, ByKeyTake)`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1630:52 +unsupported call to `core::str::::as_bytes_mut` at fixtures/reject/src/lib.rs:1638:13 +`core::str::::get_unchecked_mut` with a mutable reference to a value JS copies, which its mapping would copy at fixtures/reject/src/lib.rs:1639:13 +`std::str::from_utf8_mut` with a mutable reference to a value JS copies, which its mapping would copy at fixtures/reject/src/lib.rs:1644:20 +unsupported call to `std::ptr::copy::<[u8; 4]>` at fixtures/reject/src/lib.rs:1712:3 +unsupported call to `std::ptr::copy_nonoverlapping::<[u8; 4]>` at fixtures/reject/src/lib.rs:1713:3 +unsupported call to `std::ptr::addr_eq::<[u8; 4], [u8; 4]>` at fixtures/reject/src/lib.rs:1714:14 +comparing `*mut [u8; 4]` at fixtures/reject/src/lib.rs:1714:41 +a cast from a pointer to `[u8; 4]` to one to `u8`, which reads the bytes of one type as another at fixtures/reject/src/lib.rs:1715:17 +a cast from `*const [u8; 4]` to `*const u8`, which reads the bytes of one type as another at fixtures/reject/src/lib.rs:1715:33 +unsupported call to `std::ptr::mut_ptr::::add` at fixtures/reject/src/lib.rs:1715:56 +unsupported call to `std::ptr::const_ptr::::offset` at fixtures/reject/src/lib.rs:1715:73 +a coercion of `*const [u8; 4]` to `*const [u8]`, a pointer to a slice at fixtures/reject/src/lib.rs:1716:28 +hashing `*const [u8; 4]` by its address, which JS has no counterpart of at fixtures/reject/src/lib.rs:1718:5 +unsupported call to `> as std::cmp::PartialEq>::eq` at fixtures/reject/src/lib.rs:1719:14 +unsupported call to `std::ptr::const_ptr::::len` at fixtures/reject/src/lib.rs:1720:76 +a raw pointer to `[u8; 3]` in an element, a payload, or a union field, which is not supported yet at fixtures/reject/src/lib.rs:1729:15 +a raw pointer to `[u8; 3]` in an element, a payload, or a union field, which is not supported yet at fixtures/reject/src/lib.rs:1729:18 +a raw pointer to `[u8; 2]` in an element, a payload, or a union field, which is not supported yet at fixtures/reject/src/lib.rs:1729:37 +a raw pointer to `[u8; 2]` in an element, a payload, or a union field, which is not supported yet at fixtures/reject/src/lib.rs:1729:44 +a reference to `[u8; 4]`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:1736:26 +a raw pointer to `[u8; 4]` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1736:26 +a raw pointer to `[u8; 4]` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:1737:10 +const generic types are not supported: `Block` at fixtures/reject/src/lib.rs:2104:21 +`std::collections::LinkedList::::retain` with a mutable reference to a value JS copies, which its mapping would copy at fixtures/reject/src/lib.rs:2120:4 +`clone_from` of `std::collections::LinkedList`, whose items' `clone_from` is their own, which is not supported yet at fixtures/reject/src/lib.rs:2121:4 +`std::default::Default::default` with a mutable reference to a value JS copies, which its mapping would copy at fixtures/reject/src/lib.rs:2122:2 overriding `Iterator::fold`, which std's adaptors call in place of `next` or beside it at fixtures/reject/src/lib.rs:132:2 an iterator of the crate implementing `DoubleEndedIterator`, which is not supported yet at fixtures/reject/src/lib.rs:152:1 overriding `Iterator::size_hint`, which std's adaptors call in place of `next` or beside it at fixtures/reject/src/lib.rs:180:2 an iterator of the crate implementing `FusedIterator`, which is not supported yet at fixtures/reject/src/lib.rs:200:1 `Hasher::write`, which is not supported yet at fixtures/reject/src/lib.rs:268:9 -a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Escaped`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1081:43 -a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Called`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1095:28 -a raw pointer to `(u16, u16)` in `Copied`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1185:31 -a raw pointer to `std::cell::UnsafeCell` in `InArray`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1311:9 -a raw pointer to `std::cell::UnsafeCell` in `InTuple`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1315:9 -a raw pointer to `std::cell::UnsafeCell` in `InNested`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1319:9 -a raw pointer to `std::cell::UnsafeCell` in `InPayload`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1323:9 -a raw pointer to `std::cell::UnsafeCell` in `InField`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1327:9 -a raw pointer to `std::cell::UnsafeCell` in `InGeneric`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1331:9 -a raw pointer to `std::cell::UnsafeCell` in `InWritten`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1335:9 -a reference to `std::option::Option>`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:2118:13 +a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Escaped`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1074:43 +a raw pointer to `std::cell::UnsafeCell<(u16, u16)>` in `Called`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1088:28 +a raw pointer to `(u16, u16)` in `Copied`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1178:31 +a raw pointer to `std::cell::UnsafeCell` in `InArray`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1304:9 +a raw pointer to `std::cell::UnsafeCell` in `InTuple`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1308:9 +a raw pointer to `std::cell::UnsafeCell` in `InNested`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1312:9 +a raw pointer to `std::cell::UnsafeCell` in `InPayload`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1316:9 +a raw pointer to `std::cell::UnsafeCell` in `InField`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1320:9 +a raw pointer to `std::cell::UnsafeCell` in `InGeneric`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1324:9 +a raw pointer to `std::cell::UnsafeCell` in `InWritten`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:1328:9 +a reference to `std::option::Option>`, through which a raw pointer may be made, in a variable assigned again while that pointer may point there at fixtures/reject/src/lib.rs:2111:13 diff --git a/ts/fixtures/reject/mistyped.txt b/ts/fixtures/reject/mistyped.txt index 63c27e962..f4071b687 100644 --- a/ts/fixtures/reject/mistyped.txt +++ b/ts/fixtures/reject/mistyped.txt @@ -1,2 +1,2 @@ -lib.Rows.ts:22:20 doesn't type-check, which is a bug in rust2-ts: error TS2339: Property 'data' does not exist on type 'u8[]'. at fixtures/reject/src/lib.rs:2161:3 -lib.ts:8:47 doesn't type-check, which is a bug in rust2-ts: error TS2740: Type 'ByteVec' is missing the following properties from type 'u8[]': pop, push, concat, join, and 28 more. at fixtures/reject/src/lib.rs:2167:4 +lib.Rows.ts:22:20 doesn't type-check, which is a bug in rust2-ts: error TS2339: Property 'data' does not exist on type 'u8[]'. at fixtures/reject/src/lib.rs:2154:3 +lib.ts:8:47 doesn't type-check, which is a bug in rust2-ts: error TS2740: Type 'ByteVec' is missing the following properties from type 'u8[]': pop, push, concat, join, and 28 more. at fixtures/reject/src/lib.rs:2160:4 diff --git a/ts/fixtures/reject/src/lib.rs b/ts/fixtures/reject/src/lib.rs index 94f0a7dd0..3d6a01d66 100644 --- a/ts/fixtures/reject/src/lib.rs +++ b/ts/fixtures/reject/src/lib.rs @@ -518,13 +518,6 @@ pub fn rebound_reference(a: &u32, b: &u32) -> (u32, u32) { (x(), y()) } -/// `get_mut` of a mutex of a number, whose `&mut` the mapping would copy. -pub fn mutex_number(m: &mut std::sync::Mutex) -> u8 { - let n = m.get_mut().unwrap(); - *n += 1; - *n -} - pub trait Keyed: std::any::Any { fn key(&self) -> u8; } diff --git a/ts/fixtures/reject/ts.toml b/ts/fixtures/reject/ts.toml index 11ec55020..dca637264 100644 --- a/ts/fixtures/reject/ts.toml +++ b/ts/fixtures/reject/ts.toml @@ -55,7 +55,6 @@ roots = [ "generic_object", "first_of", "tail_read", - "mutex_number", "missing", "generic_pending", "rebound_reference", diff --git a/ts/runtime/rt/task.ts b/ts/runtime/rt/task.ts index 0a50af0e2..04883dce5 100644 --- a/ts/runtime/rt/task.ts +++ b/ts/runtime/rt/task.ts @@ -4,7 +4,7 @@ // A value whose drop JS can observe has `[Symbol.dispose]`, which runs its `Drop` impl // and drops its fields. `None` is `undefined`, which drops as nothing. -import { Err, type None, OK, Ok, Panic, panic, type Place, place, type Result } from "../rt.ts"; +import { type Debug, debugTupleField, debugTupleFinish, Err, type FmtResult, type Formatter, fmtDebugTuple, fmtPad, type None, OK, Ok, Panic, panic, type Place, place, type Result } from "../rt.ts"; // Drops @@ -185,7 +185,7 @@ export function arcGetMut(arc: Arc): T | undefined { /** `Arc::get_mut` of a value JS copies: where it is, if no other `Arc` or `Weak` shares it. */ export function arcGetMutPlace(arc: Arc): Place | undefined { - return arcUnique(arc) ? arcPlace(arc) : undefined; + return arcUnique(arc) ? valuePlace(arc) : undefined; } /** @@ -204,7 +204,7 @@ export function arcMakeMutPlace( clone: ((value: T) => T) | undefined, drop: (arc: Arc) => void, ): Place { - return arcPlace(arcOwn(p, clone, drop)); + return valuePlace(arcOwn(p, clone, drop)); } function arcUnique(arc: Arc): boolean { @@ -223,11 +223,12 @@ function arcOwn(p: Place>, clone: ((value: T) => T) | undefined, drop: return p.v; } -function arcPlace(arc: Arc): Place { +/** Where the value of an `Arc`, a `Mutex`, or a `RefCell` is, which a `&mut` to it lends where JS copies it. */ +export function valuePlace(holder: { value: T }): Place { return place( - () => arc.value, + () => holder.value, (value) => { - arc.value = value; + holder.value = value; }, ); } @@ -391,9 +392,92 @@ export function rwLockTryWrite(lock: RefCell): Result, TryLockE return Ok(lock); } +/** + * A `Ref` that `Ref::map` made: the part of a cell's value it lends, whose borrow that + * cell counts. + */ +export class RefMap extends RefCell { + readonly cell: RefCell; + + constructor(value: T, cell: RefCell) { + super(value); + this.cell = cell; + } +} + +/** The cell whose borrow `r`, a `Ref`, holds. */ +function refCellOf(r: RefCell): RefCell { + return r instanceof RefMap ? r.cell : r; +} + /** A `Ref`'s or an `RwLockReadGuard`'s drop. */ -export function refRelease(cell: RefCell): void { - cell.borrows--; +export function refRelease(r: RefCell): void { + refCellOf(r).borrows--; +} + +/** `Ref::map`: a `Ref` of the part of `r`'s value `f` lends, which takes over `r`'s borrow. */ +export function refMap(r: RefCell, f: (value: T) => U): RefCell { + return new RefMap(f(r.value), refCellOf(r)); +} + +/** `Ref::clone`: `r` again, a shared borrow of its own, which never conflicts. */ +export function refClone(r: RefCell): RefCell { + refCellOf(r).borrows++; + return r; +} + +/** `RefCell::try_borrow`'s error: the cell is mutably borrowed. */ +export class BorrowError {} + +/** `RefCell::try_borrow_mut`'s error: the cell is borrowed. */ +export class BorrowMutError {} + +const BORROW_ERROR: Result = /* @__PURE__ */ Err(/* @__PURE__ */ new BorrowError()); +const BORROW_MUT_ERROR: Result = /* @__PURE__ */ Err(/* @__PURE__ */ new BorrowMutError()); + +/** `RefCell::try_borrow`: a shared borrow, or `BorrowError` while an exclusive one is held. */ +export function refCellTryBorrow(cell: RefCell): Result, BorrowError> { + if (cell.borrows < 0) return BORROW_ERROR; + cell.borrows++; + return Ok(cell); +} + +/** `RefCell::try_borrow_mut`: an exclusive borrow, or `BorrowMutError` while any other is held. */ +export function refCellTryBorrowMut(cell: RefCell): Result, BorrowMutError> { + if (cell.borrows !== 0) return BORROW_MUT_ERROR; + cell.borrows = -1; + return Ok(cell); +} + +/** `Debug` of `BorrowError`. */ +export function borrowErrorDebug(_: BorrowError, f: Formatter): FmtResult { + return f.out.writeStr("BorrowError"); +} + +/** `Display` of `BorrowError`. */ +export function borrowErrorDisplay(_: BorrowError, f: Formatter): FmtResult { + return fmtPad(f, "RefCell already mutably borrowed"); +} + +/** `Debug` of `BorrowMutError`. */ +export function borrowMutErrorDebug(_: BorrowMutError, f: Formatter): FmtResult { + return f.out.writeStr("BorrowMutError"); +} + +/** `Display` of `BorrowMutError`. */ +export function borrowMutErrorDisplay(_: BorrowMutError, f: Formatter): FmtResult { + return fmtPad(f, "RefCell already borrowed"); +} + +/** + * `Clone` of a `RefCell`: one of its value's clone by `clone`, or the value itself if + * that is undefined, made while borrowing it, which panics while it is mutably borrowed. + */ +export function refCellClone(cell: RefCell, clone?: (value: T) => T): RefCell { + refCellBorrow(cell); + const value = clone ? clone(cell.value) : cell.value; + refRelease(cell); + return new RefCell(value); } /** A `RefMut`'s or an `RwLockWriteGuard`'s drop. */ @@ -724,6 +808,45 @@ export function onceGetOrInit(cell: OnceCell, f: () => T return value; } +/** + * `OnceCell::get_or_try_init`: as `onceGetOrInit`, but an error from `f` leaves the cell + * empty and is given back, before a `OnceCell` that `f` set would panic. + */ +export function onceGetOrTryInit(cell: OnceCell, f: () => Result, dropF?: (f: () => Result) => void): Result; +export function onceGetOrTryInit(cell: OnceCell, f: () => Result, dropF: ((f: () => Result) => void) | undefined, none: None): Result; +export function onceGetOrTryInit(cell: OnceCell, f: () => Result, dropF?: (f: () => Result) => void, none?: None): Result { + if (cell.v !== none) { + dropF?.(f); + return Ok(cell.v as T); + } + recursive(cell); + const lock = cell instanceof OnceLock; + if (lock) cell.running = true; + const result = f(); + if (lock) cell.running = false; + if (!result.ok) return result; + if (!lock && cell.v !== none) panic("reentrant init"); + cell.v = result.value; + return result; +} + +/** `Clone` of a `OnceCell` or a `OnceLock`: one holding a clone by `clone` of what it holds, or that itself if `clone` is undefined. */ +export function onceClone>(cell: C, clone: ((value: T) => T) | undefined): C; +export function onceClone>(cell: C, clone: ((value: T) => T) | undefined, none: None): C; +export function onceClone(cell: OnceCell, clone: ((value: T) => T) | undefined, none?: None): OnceCell { + const v = cell.v === none || !clone ? cell.v : clone(cell.v as T); + return cell instanceof OnceLock ? new OnceLock(v) : new OnceCell(v); +} + +/** `Debug` of a `OnceCell` or a `OnceLock`, named `name`: what it holds, or ``. */ +export function onceDebug(cell: OnceCell, f: Formatter, name: string, debug: Debug): FmtResult; +export function onceDebug(cell: OnceCell, f: Formatter, name: string, debug: Debug, none: None): FmtResult; +export function onceDebug(cell: OnceCell, f: Formatter, name: string, debug: Debug, none?: None): FmtResult { + const v = cell.v; + const field = v === none ? (f: Formatter) => f.out.writeStr("") : (f: Formatter) => debug(v as T, f); + return debugTupleFinish(debugTupleField(fmtDebugTuple(f, name), field)); +} + /** `Once`: a `OnceLock` that holds `true` once its function has run. */ export type Once = OnceLock; diff --git a/ts/src/lower/fmt.rs b/ts/src/lower/fmt.rs index 5f968d4ec..b80cae1c2 100644 --- a/ts/src/lower/fmt.rs +++ b/ts/src/lower/fmt.rs @@ -422,6 +422,20 @@ pub fn std_impl<'tcx>( (Std::ErrorKind, Trait::Debug) => rt("writeStr", vec![f, value]), (Std::ParseBoolError, Trait::Debug) => rt("parseBoolErrorDebug", vec![value, f]), (Std::ParseBoolError, Trait::Display) => rt("parseBoolErrorDisplay", vec![value, f]), + (Std::BorrowError, Trait::Debug) => Expr::rt("borrowErrorDebug", vec![value, f]), + (Std::BorrowError, Trait::Display) => Expr::rt("borrowErrorDisplay", vec![value, f]), + (Std::BorrowMutError, Trait::Debug) => Expr::rt("borrowMutErrorDebug", vec![value, f]), + (Std::BorrowMutError, Trait::Display) => Expr::rt("borrowMutErrorDisplay", vec![value, f]), + // What it holds, or ``. + (std @ (Std::OnceCell | Std::OnceLock), Trait::Debug) => { + let held = b.fmt_fn(tr, args.type_at(0), span); + let none = b.t.none_arg(args.type_at(0)); + let name = Expr::Str(format!("{std:?}")); + Expr::rt( + "onceDebug", + [vec![value, f, name, held], none.into_iter().collect()].concat(), + ) + } (Std::ParseCharError, Trait::Debug) => rt("parseCharErrorDebug", vec![value, f]), (Std::ParseCharError, Trait::Display) => rt("parseCharErrorDisplay", vec![value, f]), (Std::ParseFloatError, Trait::Debug) => rt("parseFloatErrorDebug", vec![value, f]), diff --git a/ts/src/lower/library.rs b/ts/src/lower/library.rs index ffef575b6..a99df894a 100644 --- a/ts/src/lower/library.rs +++ b/ts/src/lower/library.rs @@ -74,6 +74,9 @@ pub enum Std { RefCell, Ref, RefMut, + /// `rt.BorrowError` and `rt.BorrowMutError`: why `try_borrow` and `try_borrow_mut` failed. + BorrowError, + BorrowMutError, /// `rt.Cell`, a place holding its value: a `Cell`'s or an `UnsafeCell`'s. Cell, /// `rt.LocalKey`: a thread-local, a module's value. @@ -310,6 +313,8 @@ impl Std { ["cmp", "Ordering"] => Some(Self::Ordering), ["sync", "atomic", "Ordering"] => Some(Self::AtomicOrdering), ["cell", "once", "OnceCell"] => Some(Self::OnceCell), + ["cell", "BorrowError"] => Some(Self::BorrowError), + ["cell", "BorrowMutError"] => Some(Self::BorrowMutError), ["sync", "once_lock", "OnceLock"] => Some(Self::OnceLock), ["sync", "once", "Once"] => Some(Self::Once), ["sync", "once", "OnceState"] => Some(Self::OnceState), @@ -896,7 +901,8 @@ fn discards(owner: &str, name: &str) -> Option<&'static [usize]> { // over, and `fill` its value if there is no slot for it. ("slice", "fill" | "fill_with" | "clone_from_slice") => &[0], // `get_or_init::` drops its function uncalled if the cell is set. - ("OnceCell" | "OnceLock", "get_or_init") => &[1], + ("OnceCell" | "OnceLock", "get_or_init" | "get_or_try_init") => &[1], + ("Ref", "map") => &[], ("Once", "call_once" | "call_once_force") => &[0], ("Arc" | "Rc", "new_cyclic") => &[1], // `pop_if::` drops its test uncalled if there is no element. @@ -927,7 +933,7 @@ fn takes_none(owner: &str, name: &str) -> bool { ) | ("Peekable", "peek" | "next_if" | "next_if_eq") | ( "OnceCell" | "OnceLock", - "get" | "set" | "get_or_init" | "take" | "into_inner" + "get" | "get_mut" | "set" | "get_or_init" | "get_or_try_init" | "take" | "into_inner" ) | ("Arc" | "Rc", "into_inner") | ("DoubleEndedIterator", "next_back" | "nth_back" | "rfind") diff --git a/ts/src/lower/mir/call.rs b/ts/src/lower/mir/call.rs index 2e0cb27cf..5e115617c 100644 --- a/ts/src/lower/mir/call.rs +++ b/ts/src/lower/mir/call.rs @@ -336,7 +336,7 @@ impl<'m, 'b, 'a, 'tcx> Fx<'m, 'b, 'a, 'tcx> { let t = &*self.b.t; // Mappings that lend an element JS copies as its place, as a map's `get_mut` does, the // item a `Peekable` peeked, the place a `&mut dyn Any` wraps, a `RefCell` key's value, - // or an `Arc`'s. + // or the value of an `Arc`, a lock, or a cell. let lends = match library::key(tcx, def_id) { Some((owner, name)) => match (owner.as_str(), name.as_str()) { ("slice", "get_mut" | "first_mut" | "last_mut" | "iter_mut" | "split_first_mut" | "split_last_mut") @@ -344,7 +344,8 @@ impl<'m, 'b, 'a, 'tcx> Fx<'m, 'b, 'a, 'tcx> { | ("dyn Any", "downcast_mut") | ("Peekable", "peek_mut") | ("LocalKey", "with_borrow_mut") - | ("Arc" | "Rc", "get_mut" | "make_mut") => true, + | ("Arc" | "Rc", "get_mut" | "make_mut") + | ("Mutex" | "RwLock" | "RefCell" | "OnceCell" | "OnceLock", "get_mut") => true, ("IntoIterator", "into_iter") => gargs.types().next().is_some_and(|ty| { let ty = crate::lower::iter::unbox_ref(tcx, ty); ty.ref_mutability() == Some(ty::Mutability::Mut) diff --git a/ts/src/lower/mir/rvalue.rs b/ts/src/lower/mir/rvalue.rs index b3f48dc05..e718796f9 100644 --- a/ts/src/lower/mir/rvalue.rs +++ b/ts/src/lower/mir/rvalue.rs @@ -617,7 +617,9 @@ impl<'m, 'b, 'a, 'tcx> Fx<'m, 'b, 'a, 'tcx> { } (Std::Result, i) => Expr::result(i == 0, values.pop().unwrap()), (Std::FmtError, _) => Expr::New(Box::new(Expr::Rt("FmtError".into())), Vec::new()), - (Std::ParseBoolError, _) => Expr::New(Box::new(Expr::Rt("ParseBoolError".into())), Vec::new()), + (std @ (Std::ParseBoolError | Std::BorrowError | Std::BorrowMutError), _) => { + Expr::New(Box::new(Expr::Rt(format!("{std:?}"))), Vec::new()) + } // `ResumeTy`, an async body's context. (Std::Context, _) => values.pop().unwrap_or_else(Expr::undefined), (Std::RangeTo | Std::RangeToInclusive, _) => { diff --git a/ts/src/lower/mod.rs b/ts/src/lower/mod.rs index 3aaf04cfc..c84d658ca 100644 --- a/ts/src/lower/mod.rs +++ b/ts/src/lower/mod.rs @@ -1488,6 +1488,8 @@ impl<'a, 'tcx> Translator<'a, 'tcx> { _ => Type::Rt("TryFromFloatSecsErrorKind", vec![]), }, library::Std::ParseBoolError => Type::Rt("ParseBoolError", vec![]), + library::Std::BorrowError => Type::Rt("BorrowError", vec![]), + library::Std::BorrowMutError => Type::Rt("BorrowMutError", vec![]), library::Std::ParseCharError => Type::Rt("ParseCharError", vec![]), library::Std::ParseFloatError => Type::Rt("ParseFloatError", vec![]), library::Std::TryFromFloatSecsError => Type::Rt("TryFromFloatSecsError", vec![]), diff --git a/ts/src/lower/task.rs b/ts/src/lower/task.rs index e80407498..c46c9bf40 100644 --- a/ts/src/lower/task.rs +++ b/ts/src/lower/task.rs @@ -134,6 +134,8 @@ pub fn call<'tcx>( }; let self_ty = call.args.types().next(); let self_std = self_ty.and_then(std_of); + // A clone of a reference is that reference, not a clone of what it points at. + let owned_std = self_std.filter(|_| self_ty.is_some_and(|t| !t.is_ref())); let e = match (owner, name) { ("Arc" | "Rc", "new") => Expr::New(Box::new(Expr::Rt("Arc".into())), args), ("Arc" | "Rc", "new_cyclic") => Expr::rt("arcNewCyclic", args), @@ -202,10 +204,22 @@ pub fn call<'tcx>( let [l, r] = two(args); l.member("arc").binary("===", r.member("arc")) } - ("Clone", "clone") if self_std == Some(Std::Arc) => Expr::rt("arcClone", args), - ("Clone", "clone") if self_std == Some(Std::Weak) => Expr::rt("weakClone", args), + ("Clone", "clone") if owned_std == Some(Std::Arc) => Expr::rt("arcClone", args), + ("Clone", "clone") if owned_std == Some(Std::Weak) => Expr::rt("weakClone", args), + // A `RefCell`'s clone borrows it, and a one-time cell's clones what it holds, if anything. + ("Clone", "clone") if matches!(owned_std, Some(Std::RefCell | Std::OnceCell | Std::OnceLock)) => { + let inner = held(self_ty); + let clone = super::collections::clone_fn(b, inner, call.span); + match owned_std { + Some(Std::RefCell) => Expr::rt("refCellClone", vec![first(args), clone]), + _ => { + let none = b.t.none_arg(inner); + Expr::rt("onceClone", [first(args), clone].into_iter().chain(none).collect()) + } + } + } // A waker is the executor's, whose `clone` is its own. - ("Clone", "clone") if self_std == Some(Std::Waker) => first(args).member("clone").call(vec![]), + ("Clone", "clone") if owned_std == Some(Std::Waker) => first(args).member("clone").call(vec![]), // A reference is the object it points at, which its own `Deref` gives: read out of a // `&mut` that is an `rt.Place`, whose place `DerefMut` lends on. ("Deref", "deref") if let Some(ty) = self_ty.filter(|t| t.is_ref()) => b.t.pointee_value(ty, first(args)), @@ -229,7 +243,11 @@ pub fn call<'tcx>( // The mutex is its own guard, and a panic aborts, so nothing poisons it. ("Mutex", "lock") => Expr::result(true, Expr::rt("mutexLock", args)), ("Mutex", "try_lock") => Expr::rt("mutexTryLock", args), - ("Mutex", "get_mut") => Expr::result(true, first(args).member("value")), + // What it holds, lent as where it is where JS copies it. + ("Mutex" | "RwLock", "get_mut") => Expr::result(true, lend_value(b, call, first(args))), + ("RefCell", "get_mut") => lend_value(b, call, first(args)), + ("Mutex" | "RwLock", "into_inner") => Expr::result(true, first(args).member("value")), + ("RefCell", "into_inner") => first(args).member("value"), // A `PoisonError` is what it holds. ("PoisonError", "into_inner" | "get_ref" | "get_mut") => first(args), // Mapped rather than lowered from core's MIR, so one of a lock unwraps its guard in place. @@ -240,6 +258,10 @@ pub fn call<'tcx>( ("RefCell" | "RwLock", "new") => Expr::New(Box::new(Expr::Rt("RefCell".into())), args), ("RefCell", "borrow") => Expr::rt("refCellBorrow", args), ("RefCell", "borrow_mut") => Expr::rt("refCellBorrowMut", args), + ("RefCell", "try_borrow") => Expr::rt("refCellTryBorrow", args), + ("RefCell", "try_borrow_mut") => Expr::rt("refCellTryBorrowMut", args), + ("Ref", "map") => Expr::rt("refMap", args), + ("Ref", "clone") => Expr::rt("refClone", args), ("RefCell", "replace") => Expr::rt("refCellReplace", args), ("RefCell", "take") => { let ty = call.args.type_at(0); @@ -519,21 +541,45 @@ fn once<'tcx>( "get" | "into_inner" => first(args).member("v"), "take" => Expr::rt("onceTake", args.into_iter().chain(none).collect()), "set" => Expr::rt("onceSet", args.into_iter().chain(none).collect()), + // The place of what it holds where JS copies that, which is the cell's own. + "get_mut" if b.t.needs_place(inner) => Expr::rt("optionAsMut", args.into_iter().chain(none).collect()), + "get_mut" => first(args).member("v"), // With what drops `f`, as `discards` says, uncalled if the cell is set. - "get_or_init" => { + "get_or_init" | "get_or_try_init" => { let Some(mut droppers) = b.t.droppers([call.args.type_at(1)], call.span) else { return Ok(Some(Expr::undefined())); }; if none.is_some() { droppers.resize(1, Expr::undefined()); } - Expr::rt("onceGetOrInit", args.into_iter().chain(droppers).chain(none).collect()) + let f = match name { + "get_or_init" => "onceGetOrInit", + _ => "onceGetOrTryInit", + }; + Expr::rt(f, args.into_iter().chain(droppers).chain(none).collect()) } _ => return Ok(None), }; Ok(Some(e)) } +/// The type a cell or lock of type `ty` holds. +fn held(ty: Option>) -> Ty<'_> { + match ty.map(|ty| ty.kind()) { + Some(ty::Adt(_, args)) => args.type_at(0), + _ => unreachable!("a cell or lock is a struct"), + } +} + +/// What `get_mut` of `holder`, a `Mutex`, a `RefCell`, or an `RwLock`, lends: its value, +/// or where that is where JS copies it. +fn lend_value<'tcx>(b: &Body<'_, '_, 'tcx>, call: &Call<'tcx>, holder: Expr) -> Expr { + match b.t.needs_place(call.args.type_at(0)) { + true => Expr::rt("valuePlace", vec![holder]), + false => holder.member("value"), + } +} + /// `OnceCell::new()` or `OnceLock::new()` of `cell`: empty. pub fn once_new<'tcx>(b: &Body<'_, '_, 'tcx>, cell: Ty<'tcx>) -> Expr { let ty::Adt(_, args) = cell.kind() else {