diff --git a/quest/m3/README.md b/quest/m3/README.md index 628c33f97..6f53e6e56 100644 --- a/quest/m3/README.md +++ b/quest/m3/README.md @@ -25,7 +25,7 @@ generic std gap is planned here even when moq never calls it. - [Waiting: type-check in process with tsrs](/quest/m3/ts-tsrs.md) - rust2-ts checks bindings through tsrs instead of `tsc` once it is a stable library - [A zip of TrustedLen iterators folded by its size hint](/quest/m3/ts-zip-fold.md) - `count` and the other folds of a `zip` of `TrustedLen` iterators read only the pairs its size hint holds - [A B-tree's drop order](/quest/m3/ts-btree-drop.md) - dropping a whole `BTreeMap` or `BTreeSet` drops its entries node by node, as std's does -- [Drop order in std's folds and iterators](/quest/m3/ts-drop-order.md) - the values that drop still refused in std's folds, zips, flattens, and collects drop as std's do +- [Drop order in std's folds and iterators](/quest/m3/ts-drop-order.md) - the values that drop still refused in std's consumers, zips, flattens, and collects drop as std's do - [References to byte arrays std takes](/quest/m3/ts-byte-refs-taken.md) - `extend` by references to arrays, adaptors' closures over held arrays, and a collection of both forms translate - [Equality of std containers of unlike elements](/quest/m3/ts-eq-unlike.md) - `==` and `next_if_eq` of a `Vec` against a `&[Right]`, and of `VecDeque` against `Vec`, translate - [Waiting: a slice object for a mutable part of other values](/quest/m3/ts-slice-object.md) - waits on a moq profile showing the `Proxy` view's traps matter, then decides on an `rt.ByteSlice`-like form diff --git a/quest/m3/ts-drop-order.md b/quest/m3/ts-drop-order.md index 8b06f9b71..9200a0896 100644 --- a/quest/m3/ts-drop-order.md +++ b/quest/m3/ts-drop-order.md @@ -3,36 +3,42 @@ ## Goal [rust2-ts](/ts/README.md) translates the values that drop which it still refuses -inside std's iterators and formatting, each dropping where std's does, in std's order, +inside std's iterators, each dropping where std's does, in std's order, proven by the task fixture's differential tests against native Rust. None appears in moq's census at the pinned revision; rust2 aims to support all of std. ## Plan Moved from the m2 drop quest on 2026-10-27, once moq-net, its model, and kio had no -drop refusal left ([#139](https://github.com/moq-dev/rust2/pull/139)). Each is refused -with a span where std's order is one JS's can't follow yet: +drop refusal left ([#139](https://github.com/moq-dev/rust2/pull/139)). `DebugList::entries`, +ranges of bounds that drop, a drain or a B-tree's `range` of a range that drops, a hash +map's `into_keys` and `into_values`, and the closures `for_each` and `fold` own landed in +[#307](https://github.com/moq-dev/rust2/pull/307), with the task fixture's `inside` step. +Each left is refused with a span where std's order is one JS's can't follow yet: - A closure that owns a value that drops given to a std function that takes another - value that drops by value, such as `for_each` of items that drop, that keeps it - other than in an adaptor, or that calls it through `FnOnce` other than where - `discards` in `library.rs` says, as `or_insert_with` does (`called_closures`). -- `into_keys` and `into_values` of a hash map whose other half drops: `fold` drops it - after the half it yields, `next` before. -- `zip` of two `TrustedRandomAccess` iterators of items that drop. -- A `flatten` whose inner iterator holds items once ended. -- A B-tree's `collect` of entries that drop, sorted by the crate's own `Ord`. -- `DebugList::entries` of items that drop. -- `RangeInclusive::new` of bounds that drop, such as `Arc::new(a)..=Arc::new(b)`, refused - where the range is built, found by [#247](https://github.com/moq-dev/rust2/pull/247) on - 2026-10-29. -- A range that drops given to a drain or a B-tree's `range`, which std drops once it has - read the range's bounds, or at once for an empty B-tree. + value that drops by value, other than `for_each` and `fold` (`iter::releases`), such as + `reduce`, `max_by_key`, or `partition` of items that drop; one that keeps it other + than in an adaptor; or one that calls it through `FnOnce` other than where `discards` + in `library.rs` says, as `or_insert_with` does (`called_closures`). Each consumer whose + std folds takes a `release` the way `rt.iterFold` does. The reject fixture's + `called_closure` reproduces `or_insert_with`. +- `zip` of two `TrustedRandomAccess` iterators of items that drop, as the reject fixture's + `zip_dropped`, `v.iter().map(|&n| Noisy(n)).zip(0..2).count()`: std's `next` makes one + item past the shorter side and drops it, and its `next_back` trims the longer side. +- A `flatten` or `flat_map` whose inner iterator holds items once ended, as + `v.into_iter().map(|v| v.into_iter().take(1)).flatten()` of a `Vec>` whose `T` + drops. std's `try_fold` keeps an ended inner iterator until the next one replaces it, or + drops it after the source once the source ends, where `next` drops it as it ends. Every + adaptor whose `try_fold` is its source's, such as `map`, `filter`'s `next`, and `rev`'s + through `try_rfold`, reads it that way, so `rt.Iter::folded` would follow through each, + a hot path to measure on the [TS benchmark](/ts/README.md#bench). +- A B-tree's `collect` of entries that drop, sorted by the crate's own `Ord`, as + `v.into_iter().collect::>()` of an `O` whose `Ord` is its own: an `Ord` + that disagrees with itself leaves equal keys in the order std's driftsort does, which + decides which of them drop. Each `rt.Iter` has a `fold` and `rfold` that drop what it holds where std's do, and the by-value consumers std folds go through it: build on those rather than `rt.drop`. -Watch the cost: measure any change to a hot path on the -[TS benchmark](/ts/README.md#bench). - Public API: the translator's output for values that drop in std's iterators. diff --git a/ts/README.md b/ts/README.md index 968be877c..608626388 100644 --- a/ts/README.md +++ b/ts/README.md @@ -97,7 +97,7 @@ crate translation reaches is refused, and so are two versions of one crate it re | an iterator | `rt.Iter`, whose adaptors are runtime functions: `rt.iterMap(rt.iterSlice(v), f)` | | `a..b`, `a..=b` | `rt.Range`, `rt.RangeInclusive`, which are iterators too | | `a..`, `..b`, `..=b`, `Bound` | `{ start }`, `{ end }`, `{ end, inclusive: true }`; `rt.RangeBound`, a union tagged by variant | -| a range a drain or a B-tree's `range` takes | itself, or of a type other than std's ranges and a pair of `Bound`s, `rt.boundsOf` of it and its `start_bound` and `end_bound`, which the runtime calls where std's does | +| a range a drain or a B-tree's `range` takes | itself, or of a type other than std's ranges and a pair of `Bound`s, `rt.boundsOf` of it and its `start_bound` and `end_bound`, which the runtime calls where std's does; one that drops, the parameter of the call `rt.dropAfter` makes, which drops it once the call returns, as std drops it before it does anything JS can see | | `HashMap`, `HashSet`, `BTreeMap`, `BTreeSet`, `VecDeque`, `BinaryHeap` | `rt.HashMap` and so on, each a plain object whose functions are the runtime's: `rt.hashGet(map, key)` | | `PeekMut` | `rt.PeekMut`, the `rt.Place` of a heap's greatest element, which sifts it down as it drops once `DerefMut` lent it | | `Ordering`, `DefaultHasher`, `RandomState` | `rt.Ordering`, which is `-1`, `0`, or `1`; `rt.Hasher`; `rt.RandomState`, the keys of the `DefaultHasher` it builds, never changed once made | @@ -645,9 +645,9 @@ behind `&`, `&mut`, `Box`, or `Arc` ([trait objects](/quest/m3/ts-dyn.md)), fail hand-written TS ([bindings](#bindings)). These fail translation: `f16` and `f128`, async closures, a `Poll` of a `Poll` of a `Poll`, a future whose output can be pending, an instance of a generic type whose field is a `Poll` of a type parameter that can be pending, a closure that owns a value -that drops given to a std function that drops it beside another value that drops, as -`for_each` of items that drop does, or keeps it other than in an iterator adaptor, and -values that drop in some iterators ([drop order](/quest/m3/ts-drop-order.md)), a `Cow` of other than `str`, a std +that drops given to a std function that drops it beside another value that drops, other +than `for_each` and `fold`, as `reduce` of items that drop does, or keeps it other than in +an iterator adaptor, and values that drop in some iterators ([drop order](/quest/m3/ts-drop-order.md)), a `Cow` of other than `str`, a std function without a mapping of its own that makes or reads an `Option` whose `None` is `rt.None`, as `Iterator::scan` of `Option`s does, an `Option` of an `Option` of `()` or another `Option`, an instance of a generic type whose field is an `Option` of a type parameter diff --git a/ts/fixtures/lang/expected/fmt.ts b/ts/fixtures/lang/expected/fmt.ts index 38b671d5e..13bc66062 100644 --- a/ts/fixtures/lang/expected/fmt.ts +++ b/ts/fixtures/lang/expected/fmt.ts @@ -694,7 +694,9 @@ export function wrapped(data: rt.ByteSlice, out: rt.ByteVec): void { const held: rt.Range> = new rt.Range(new rt.Arc(a), new rt.Arc(b)); const _366: rt.Range> = new rt.Range(new rt.Arc(lo), new rt.Arc(hi)); const args22: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtRange(held, f, (value: rt.Arc, f: rt.Formatter) => rt.i32Debug(value.value, f)), (f: rt.Formatter) => rt.fmtRange(_366, f, (value: rt.Arc, f: rt.Formatter) => Clip.fmt$Debug(value.value, f))]; - put(out, rt.fmtFormat([args22[0], " ", rt.fmtSpec({ plus: true, zero: true, width: 4 }, args22[0]), " ", args22[1]])); + const _362: string = rt.fmtFormat([args22[0], " ", rt.fmtSpec({ plus: true, zero: true, width: 4 }, args22[0]), " ", args22[1]]); + rt.dropAll([_366.start, _366.end]); + put(out, _362); const shared: Shared.Shared = new Shared.Shared(new rt.Arc({ _0: at(7), _1: 5 }), new rt.Range(at(8) as rt.u16, 300), { end: at(9), inclusive: true }); const args24: rt.Fmt[] = [(f: rt.Formatter) => Shared.fmt$Debug(shared, f)]; put(out, rt.fmtFormat([args24[0], " ", rt.fmtSpec({ alternate: true }, args24[0])])); @@ -707,6 +709,7 @@ export function wrapped(data: rt.ByteSlice, out: rt.ByteVec): void { put(out, rt.fmtFormat([args26[0], " ", args26[1], " ", rt.fmtSpec({ align: ">", width: 9, precision: 2 }, args26[0])])); t[Symbol.dispose](); shared[Symbol.dispose](); + rt.dropAll([held.start, held.end]); list[Symbol.dispose](); rc[Symbol.dispose](); nested_[Symbol.dispose](); diff --git a/ts/fixtures/reject/census.md b/ts/fixtures/reject/census.md index 4bb6a9f3f..d36414e8e 100644 --- a/ts/fixtures/reject/census.md +++ b/ts/fixtures/reject/census.md @@ -1,77 +1,76 @@ # Census of `reject-fixture` -- Refusals: 126 -- Function instances: 152 +- Refusals: 121 +- Function instances: 147 - Generic functions no instance reached, lowered over their type parameters: 10 ## By construct | Count | Construct | First | | ---: | --- | --- | -| 17 | unsupported call to `_` | fixtures/reject/src/lib.rs:138:11 | -| 12 | a raw pointer to `_` in `_`, which the crate may put another object in place of | fixtures/reject/src/lib.rs:658:10 | -| 8 | a raw pointer to `_` in a variable assigned again while it may point there | fixtures/reject/src/lib.rs:666:10 | -| 5 | passing `_`, which drops, to `_`, which is not supported yet | fixtures/reject/src/lib.rs:374:4 | -| 4 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | fixtures/reject/src/lib.rs:244:16 | -| 4 | a variant of `_`, which is not supported: either is the same JS string | fixtures/reject/src/lib.rs:379:2 | -| 3 | a copy of a closure that changes what it captured | fixtures/reject/src/lib.rs:254:14 | -| 3 | an assignment through a reference to `_` | fixtures/reject/src/lib.rs:104:2 | -| 3 | replacing the value behind a reference to `_` | fixtures/reject/src/lib.rs:112:2 | +| 17 | unsupported call to `_` | fixtures/reject/src/lib.rs:129:11 | +| 12 | a raw pointer to `_` in `_`, which the crate may put another object in place of | fixtures/reject/src/lib.rs:648:10 | +| 8 | a raw pointer to `_` in a variable assigned again while it may point there | fixtures/reject/src/lib.rs:656:10 | +| 4 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | fixtures/reject/src/lib.rs:235:16 | +| 4 | a variant of `_`, which is not supported: either is the same JS string | fixtures/reject/src/lib.rs:369:2 | +| 3 | a copy of a closure that changes what it captured | fixtures/reject/src/lib.rs:245:14 | +| 3 | an assignment through a reference to `_` | fixtures/reject/src/lib.rs:95:2 | +| 3 | replacing the value behind a reference to `_` | fixtures/reject/src/lib.rs:103:2 | | 3 | unsupported type `_` | fixtures/reject/src/lib.rs:7:14 | | 2 | `_` is not supported: its `None` and `Some` would both be `rt.None` | fixtures/reject/src/lib.rs:16:15 | | 2 | `_` of `_`, whose `None` is `rt.None`, which is not supported yet | fixtures/reject/src/lib.rs:42:4 | | 2 | `_` of `_`, whose `clone_from` is its own, which is not supported yet | fixtures/reject/src/lib.rs:21:4 | | 2 | `_`, a trait object of another crate's trait, which is not supported yet | fixtures/reject/src/lib.rs:11:16 | -| 2 | `_`, a trait object of the generic trait `_`, which is not supported yet | fixtures/reject/src/lib.rs:507:23 | -| 2 | a coercion to `_`, which is not supported yet | fixtures/reject/src/lib.rs:498:40 | -| 2 | an iterator of the crate implementing `_`, which is not supported yet | fixtures/reject/src/lib.rs:171:1 | -| 2 | overriding `_`, which std's adaptors call in place of `next` or beside it | fixtures/reject/src/lib.rs:151:2 | -| 2 | passing `_`, a closure that owns a value that drops, to `_`, which is not supported yet | fixtures/reject/src/lib.rs:366:13 | -| 2 | unsupported type `_` from another crate | fixtures/reject/src/lib.rs:481:32 | -| 1 | `Buf::copy_to_bytes` of `_`, a value JS copies, which is not supported | fixtures/reject/src/lib.rs:811: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:437: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:422:2 | -| 1 | `Pointer` formatting, as in `{:p}`, is not supported | fixtures/reject/src/lib.rs:70:2 | -| 1 | `_` is not supported yet | fixtures/reject/src/lib.rs:390:18 | -| 1 | `_` is not supported: its `Pending` and `Ready` would both be `rt.OuterPending` | fixtures/reject/src/lib.rs:93:20 | +| 2 | `_`, a trait object of the generic trait `_`, which is not supported yet | fixtures/reject/src/lib.rs:497:23 | +| 2 | a coercion to `_`, which is not supported yet | fixtures/reject/src/lib.rs:488:40 | +| 2 | an iterator of the crate implementing `_`, which is not supported yet | fixtures/reject/src/lib.rs:162:1 | +| 2 | overriding `_`, which std's adaptors call in place of `next` or beside it | fixtures/reject/src/lib.rs:142:2 | +| 2 | passing `_`, which drops, to `_`, which is not supported yet | fixtures/reject/src/lib.rs:364:4 | +| 2 | unsupported type `_` from another crate | fixtures/reject/src/lib.rs:471:32 | +| 1 | `Buf::copy_to_bytes` of `_`, a value JS copies, which is not supported | fixtures/reject/src/lib.rs:801: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:427: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:412:2 | +| 1 | `Pointer` formatting, as in `{:p}`, is not supported | fixtures/reject/src/lib.rs:61:2 | +| 1 | `_` is not supported yet | fixtures/reject/src/lib.rs:380:18 | +| 1 | `_` is not supported: its `Pending` and `Ready` would both be `rt.OuterPending` | fixtures/reject/src/lib.rs:84: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:545:2 | -| 1 | `_` of `_` by `_`, which is not supported yet | fixtures/reject/src/lib.rs:283:6 | -| 1 | `_` of `_`, which drops `_`, which is not supported yet | fixtures/reject/src/lib.rs:55:13 | -| 1 | `_` of `_`, which is not supported yet | fixtures/reject/src/lib.rs:588:4 | -| 1 | `_` through a held type's own, which is not supported yet | fixtures/reject/src/lib.rs:315:2 | -| 1 | `_` with a mutable reference to a value JS copies, which its mapping would copy | fixtures/reject/src/lib.rs:564:12 | -| 1 | `_`, which is not supported yet | fixtures/reject/src/lib.rs:291: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:431:6 | -| 1 | `fmt::Arguments` with a placeholder, or not made in place, written to `_`'s own `fmt::Write`, which is not supported yet: std splits what a placeholder writes into `write_str` calls the runtime does not make | fixtures/reject/src/lib.rs:76:10 | -| 1 | a `zip` of `_` and `_`, which std reads by index, of items that drop, which is not supported yet | fixtures/reject/src/lib.rs:233:30 | -| 1 | a `zip` of `_`, whose closures std calls one item further through `next` than through `fold` | fixtures/reject/src/lib.rs:184:51 | -| 1 | a cast from `_` to `_` | fixtures/reject/src/lib.rs:89:2 | -| 1 | a cast from a pointer to `_` to one to `_`, which reads the bytes of one type as another | fixtures/reject/src/lib.rs:605:27 | -| 1 | a coercion to `_` | fixtures/reject/src/lib.rs:338:2 | -| 1 | a constant of type `_`, a pointer into memory translation can't name | fixtures/reject/src/lib.rs:828:3 | -| 1 | a dangling pointer to `_`, a value of no bytes made of more than structs and tuples | fixtures/reject/src/lib.rs:787:11 | -| 1 | a future of `_`, which can be `rt.Pending`, as the future's own `Pending` is | fixtures/reject/src/lib.rs:98:34 | -| 1 | a mutable reference into a `Result`'s payload, passed on or kept | fixtures/reject/src/lib.rs:410:12 | -| 1 | a mutable static, which any code may write | fixtures/reject/src/lib.rs:82:11 | -| 1 | a pointer's address, which JS has no counterpart of | fixtures/reject/src/lib.rs:610:17 | -| 1 | a printable type must implement `Display` or `Debug` | fixtures/reject/src/lib.rs:85:1 | -| 1 | a raw pointer to `_` behind a reference, which is the object and not where it is kept | fixtures/reject/src/lib.rs:627:10 | -| 1 | a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet | fixtures/reject/src/lib.rs:729:10 | +| 1 | `_` is not supported: its field `_` is `_`, typed `_`, whose `Pending` would be `rt.OuterPending` as `_` | fixtures/reject/src/lib.rs:535:2 | +| 1 | `_` of `_` by `_`, which is not supported yet | fixtures/reject/src/lib.rs:274:6 | +| 1 | `_` of `_`, which is not supported yet | fixtures/reject/src/lib.rs:578:4 | +| 1 | `_` through a held type's own, which is not supported yet | fixtures/reject/src/lib.rs:306:2 | +| 1 | `_` with a mutable reference to a value JS copies, which its mapping would copy | fixtures/reject/src/lib.rs:554:12 | +| 1 | `_`, which is not supported yet | fixtures/reject/src/lib.rs:282: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:421:6 | +| 1 | `fmt::Arguments` with a placeholder, or not made in place, written to `_`'s own `fmt::Write`, which is not supported yet: std splits what a placeholder writes into `write_str` calls the runtime does not make | fixtures/reject/src/lib.rs:67:10 | +| 1 | a `zip` of `_` and `_`, which std reads by index, of items that drop, which is not supported yet | fixtures/reject/src/lib.rs:224:30 | +| 1 | a `zip` of `_`, whose closures std calls one item further through `next` than through `fold` | fixtures/reject/src/lib.rs:175:51 | +| 1 | a cast from `_` to `_` | fixtures/reject/src/lib.rs:80:2 | +| 1 | a cast from a pointer to `_` to one to `_`, which reads the bytes of one type as another | fixtures/reject/src/lib.rs:595:27 | +| 1 | a coercion to `_` | fixtures/reject/src/lib.rs:329:2 | +| 1 | a constant of type `_`, a pointer into memory translation can't name | fixtures/reject/src/lib.rs:818:3 | +| 1 | a dangling pointer to `_`, a value of no bytes made of more than structs and tuples | fixtures/reject/src/lib.rs:777:11 | +| 1 | a future of `_`, which can be `rt.Pending`, as the future's own `Pending` is | fixtures/reject/src/lib.rs:89:34 | +| 1 | a mutable reference into a `Result`'s payload, passed on or kept | fixtures/reject/src/lib.rs:400:12 | +| 1 | a mutable static, which any code may write | fixtures/reject/src/lib.rs:73:11 | +| 1 | a pointer's address, which JS has no counterpart of | fixtures/reject/src/lib.rs:600:17 | +| 1 | a printable type must implement `Display` or `Debug` | fixtures/reject/src/lib.rs:76:1 | +| 1 | a raw pointer to `_` behind a reference, which is the object and not where it is kept | fixtures/reject/src/lib.rs:617:10 | +| 1 | a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet | fixtures/reject/src/lib.rs:719:10 | | 1 | a scalar constant of type `_` | fixtures/reject/src/lib.rs:8:2 | -| 1 | a trait object of `_`, which is not supported yet | fixtures/reject/src/lib.rs:524:26 | -| 1 | a zero-sized constant of type `_` | fixtures/reject/src/lib.rs:64:2 | -| 1 | an upcast from `_` to `_`, which is not supported yet | fixtures/reject/src/lib.rs:582:32 | +| 1 | a trait object of `_`, which is not supported yet | fixtures/reject/src/lib.rs:514:26 | +| 1 | a zero-sized constant of type `_` | fixtures/reject/src/lib.rs:55:2 | +| 1 | an upcast from `_` to `_`, which is not supported yet | fixtures/reject/src/lib.rs:572:32 | | 1 | arithmetic on `_` | fixtures/reject/src/lib.rs:8:2 | | 1 | collecting `_`, whose `None` is `rt.None`, which is not supported yet | fixtures/reject/src/lib.rs:36:43 | -| 1 | comparing `_` as a key, which is not supported yet | fixtures/reject/src/lib.rs:265:75 | -| 1 | comparing pointers to `()`, which has no bytes and so no address of its own | fixtures/reject/src/lib.rs:778:2 | -| 1 | comparing pointers to `_` in an atomic, which JS has no address of | fixtures/reject/src/lib.rs:827:15 | -| 1 | comparing pointers to `_`, each a place JS makes of its own | fixtures/reject/src/lib.rs:646:2 | -| 1 | constructing `_` | fixtures/reject/src/lib.rs:397:53 | -| 1 | hashing `_` as a key, which is not supported yet | fixtures/reject/src/lib.rs:265:75 | -| 1 | hashing `_` through `_`'s own `Hash::hash_slice`, which is not supported yet | fixtures/reject/src/lib.rs:357:16 | -| 1 | union `_`, whose fields overlap in `_` and `f64`, which JS keeps apart | fixtures/reject/src/lib.rs:632:1 | +| 1 | comparing `_` as a key, which is not supported yet | fixtures/reject/src/lib.rs:256:75 | +| 1 | comparing pointers to `()`, which has no bytes and so no address of its own | fixtures/reject/src/lib.rs:768:2 | +| 1 | comparing pointers to `_` in an atomic, which JS has no address of | fixtures/reject/src/lib.rs:817:15 | +| 1 | comparing pointers to `_`, each a place JS makes of its own | fixtures/reject/src/lib.rs:636:2 | +| 1 | constructing `_` | fixtures/reject/src/lib.rs:387:53 | +| 1 | hashing `_` as a key, which is not supported yet | fixtures/reject/src/lib.rs:256:75 | +| 1 | hashing `_` through `_`'s own `Hash::hash_slice`, which is not supported yet | fixtures/reject/src/lib.rs:348:16 | +| 1 | passing `_`, a closure that owns a value that drops, to `_`, which is not supported yet | fixtures/reject/src/lib.rs:357:13 | +| 1 | union `_`, whose fields overlap in `_` and `f64`, which JS keeps apart | fixtures/reject/src/lib.rs:622:1 | ## By API @@ -79,292 +78,271 @@ The type or module each refused type or path belongs to. | Count | API | First | | ---: | --- | --- | -| 16 | `(u32, u32)` | fixtures/reject/src/lib.rs:658:10 | -| 7 | `std::borrow::Cow` | fixtures/reject/src/lib.rs:379:2 | +| 16 | `(u32, u32)` | fixtures/reject/src/lib.rs:648:10 | +| 7 | `std::borrow::Cow` | fixtures/reject/src/lib.rs:369:2 | | 6 | `Option` | fixtures/reject/src/lib.rs:16:15 | | 6 | `f16` | fixtures/reject/src/lib.rs:7:14 | -| 5 | `Gap` | fixtures/reject/src/lib.rs:1008:10 | -| 5 | `Iterator` | fixtures/reject/src/lib.rs:42:4 | -| 5 | `u32` | fixtures/reject/src/lib.rs:605:27 | -| 4 | `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:737:15 | -| 4 | `std::pin::Pin` | fixtures/reject/src/lib.rs:112:2 | -| 4 | `std::vec::Vec` | fixtures/reject/src/lib.rs:357:16 | -| 4 | `{closure}` | fixtures/reject/src/lib.rs:366:13 | -| 3 | `Spent` | fixtures/reject/src/lib.rs:853:4 | -| 3 | `std::collections::HashMap` | fixtures/reject/src/lib.rs:55:13 | -| 3 | `std::sync::Arc` | fixtures/reject/src/lib.rs:315:2 | -| 3 | `u8` | fixtures/reject/src/lib.rs:283:6 | -| 2 | `Poll` | fixtures/reject/src/lib.rs:93:20 | +| 5 | `Gap` | fixtures/reject/src/lib.rs:973:10 | +| 5 | `u32` | fixtures/reject/src/lib.rs:595:27 | +| 4 | `Iterator` | fixtures/reject/src/lib.rs:42:4 | +| 4 | `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:727:15 | +| 4 | `std::pin::Pin` | fixtures/reject/src/lib.rs:103:2 | +| 4 | `std::vec::Vec` | fixtures/reject/src/lib.rs:348:16 | +| 3 | `std::sync::Arc` | fixtures/reject/src/lib.rs:306:2 | +| 3 | `u8` | fixtures/reject/src/lib.rs:274:6 | +| 3 | `{closure}` | fixtures/reject/src/lib.rs:357:13 | +| 2 | `Poll` | fixtures/reject/src/lib.rs:84:20 | | 2 | `Reused` | fixtures/reject/src/lib.rs:21:4 | -| 2 | `Scaled` | fixtures/reject/src/lib.rs:507:23 | -| 2 | `dyn Scaled` | fixtures/reject/src/lib.rs:507:23 | -| 2 | `dyn std::any::Any` | fixtures/reject/src/lib.rs:582:32 | +| 2 | `Scaled` | fixtures/reject/src/lib.rs:497:23 | +| 2 | `dyn Scaled` | fixtures/reject/src/lib.rs:497:23 | +| 2 | `dyn std::any::Any` | fixtures/reject/src/lib.rs:572: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:588:2 | -| 2 | `std::collections::BTreeSet` | fixtures/reject/src/lib.rs:265:75 | -| 2 | `std::iter::Iterator` | fixtures/reject/src/lib.rs:244:16 | -| 2 | `std::mem::MaybeUninit` | fixtures/reject/src/lib.rs:1022:19 | -| 2 | `std::ops::Range` | fixtures/reject/src/lib.rs:192:8 | -| 2 | `std::std` | fixtures/reject/src/lib.rs:617:11 | -| 2 | `std::sync::MutexGuard` | fixtures/reject/src/lib.rs:104:2 | -| 2 | `std::vec::IntoIter` | fixtures/reject/src/lib.rs:477:17 | -| 1 | `BTreeMap` | fixtures/reject/src/lib.rs:853:56 | -| 1 | `Batched` | fixtures/reject/src/lib.rs:357:16 | -| 1 | `Bits` | fixtures/reject/src/lib.rs:632:1 | -| 1 | `Blank` | fixtures/reject/src/lib.rs:811:2 | -| 1 | `BytesMut` | fixtures/reject/src/lib.rs:431:6 | -| 1 | `Counted` | fixtures/reject/src/lib.rs:437:2 | -| 1 | `DoubleEndedIterator` | fixtures/reject/src/lib.rs:171:1 | -| 1 | `Entry` | fixtures/reject/src/lib.rs:366:13 | -| 1 | `FusedIterator` | fixtures/reject/src/lib.rs:225:1 | -| 1 | `HashMap` | fixtures/reject/src/lib.rs:283:6 | -| 1 | `Hasher` | fixtures/reject/src/lib.rs:291:9 | -| 1 | `Hits` | fixtures/reject/src/lib.rs:770:21 | -| 1 | `Lane` | fixtures/reject/src/lib.rs:972:19 | +| 2 | `std::any::TypeId` | fixtures/reject/src/lib.rs:578:2 | +| 2 | `std::collections::BTreeSet` | fixtures/reject/src/lib.rs:256:75 | +| 2 | `std::collections::HashMap` | fixtures/reject/src/lib.rs:274:6 | +| 2 | `std::iter::Iterator` | fixtures/reject/src/lib.rs:235:16 | +| 2 | `std::mem::MaybeUninit` | fixtures/reject/src/lib.rs:987:19 | +| 2 | `std::ops::Range` | fixtures/reject/src/lib.rs:183:8 | +| 2 | `std::std` | fixtures/reject/src/lib.rs:607:11 | +| 2 | `std::sync::MutexGuard` | fixtures/reject/src/lib.rs:95:2 | +| 2 | `std::vec::IntoIter` | fixtures/reject/src/lib.rs:467:17 | +| 1 | `Batched` | fixtures/reject/src/lib.rs:348:16 | +| 1 | `Bits` | fixtures/reject/src/lib.rs:622:1 | +| 1 | `Blank` | fixtures/reject/src/lib.rs:801:2 | +| 1 | `BytesMut` | fixtures/reject/src/lib.rs:421:6 | +| 1 | `Counted` | fixtures/reject/src/lib.rs:427:2 | +| 1 | `DoubleEndedIterator` | fixtures/reject/src/lib.rs:162:1 | +| 1 | `Entry` | fixtures/reject/src/lib.rs:357:13 | +| 1 | `FusedIterator` | fixtures/reject/src/lib.rs:216:1 | +| 1 | `HashMap` | fixtures/reject/src/lib.rs:274:6 | +| 1 | `Hasher` | fixtures/reject/src/lib.rs:282:9 | +| 1 | `Hits` | fixtures/reject/src/lib.rs:760:21 | +| 1 | `Lane` | fixtures/reject/src/lib.rs:937:19 | | 1 | `Maybe` | fixtures/reject/src/lib.rs:31:2 | -| 1 | `Noisy` | fixtures/reject/src/lib.rs:55:13 | -| 1 | `Only` | fixtures/reject/src/lib.rs:787:11 | -| 1 | `Plain` | fixtures/reject/src/lib.rs:926:10 | -| 1 | `Sink` | fixtures/reject/src/lib.rs:76:10 | -| 1 | `Span2` | fixtures/reject/src/lib.rs:658:10 | -| 1 | `String` | fixtures/reject/src/lib.rs:859:4 | +| 1 | `Only` | fixtures/reject/src/lib.rs:777:11 | +| 1 | `Plain` | fixtures/reject/src/lib.rs:891:10 | +| 1 | `Sink` | fixtures/reject/src/lib.rs:67:10 | +| 1 | `Span2` | fixtures/reject/src/lib.rs:648:10 | +| 1 | `String` | fixtures/reject/src/lib.rs:824:4 | | 1 | `T \| undefined` | fixtures/reject/src/lib.rs:31:2 | -| 1 | `Tail` | fixtures/reject/src/lib.rs:534:30 | -| 1 | `Track` | fixtures/reject/src/lib.rs:952:19 | -| 1 | `VecDeque` | fixtures/reject/src/lib.rs:853:29 | -| 1 | `Vec` | fixtures/reject/src/lib.rs:853:4 | -| 1 | `Waiting` | fixtures/reject/src/lib.rs:545:2 | -| 1 | `Window` | fixtures/reject/src/lib.rs:719:2 | -| 1 | `[u8; 4]` | fixtures/reject/src/lib.rs:524:26 | -| 1 | `dyn Keyed` | fixtures/reject/src/lib.rs:582:32 | -| 1 | `into_keys` | fixtures/reject/src/lib.rs:55:13 | -| 1 | `poll` | fixtures/reject/src/lib.rs:545:2 | -| 1 | `rt.Poll` | fixtures/reject/src/lib.rs:545:2 | -| 1 | `std::any::Any` | fixtures/reject/src/lib.rs:588:4 | -| 1 | `std::collections::VecDeque` | fixtures/reject/src/lib.rs:896:27 | -| 1 | `std::iter::Chain` | fixtures/reject/src/lib.rs:184:51 | -| 1 | `std::iter::Extend` | fixtures/reject/src/lib.rs:1030:6 | -| 1 | `std::iter::Map` | fixtures/reject/src/lib.rs:233:30 | -| 1 | `std::net::AddrParseError` | fixtures/reject/src/lib.rs:481:32 | -| 1 | `std::net::Ipv4Addr` | fixtures/reject/src/lib.rs:481:32 | -| 1 | `std::option::Option` | fixtures/reject/src/lib.rs:417:2 | -| 1 | `std::slice::IterMut` | fixtures/reject/src/lib.rs:816:15 | -| 1 | `std::slice::Iter` | fixtures/reject/src/lib.rs:138:11 | -| 1 | `std::std::Layout` | fixtures/reject/src/lib.rs:615:15 | -| 1 | `std::str` | fixtures/reject/src/lib.rs:482:4 | -| 1 | `std::sync::Mutex` | fixtures/reject/src/lib.rs:564:12 | -| 1 | `std::sync::Weak` | fixtures/reject/src/lib.rs:498:40 | -| 1 | `std::task::Poll` | fixtures/reject/src/lib.rs:98:34 | -| 1 | `str` | fixtures/reject/src/lib.rs:374:4 | -| 1 | `u64` | fixtures/reject/src/lib.rs:89:2 | +| 1 | `Tail` | fixtures/reject/src/lib.rs:524:30 | +| 1 | `Track` | fixtures/reject/src/lib.rs:917:19 | +| 1 | `Waiting` | fixtures/reject/src/lib.rs:535:2 | +| 1 | `Window` | fixtures/reject/src/lib.rs:709:2 | +| 1 | `[u8; 4]` | fixtures/reject/src/lib.rs:514:26 | +| 1 | `dyn Keyed` | fixtures/reject/src/lib.rs:572:32 | +| 1 | `poll` | fixtures/reject/src/lib.rs:535:2 | +| 1 | `rt.Poll` | fixtures/reject/src/lib.rs:535:2 | +| 1 | `std::any::Any` | fixtures/reject/src/lib.rs:578:4 | +| 1 | `std::collections::VecDeque` | fixtures/reject/src/lib.rs:861:27 | +| 1 | `std::iter::Chain` | fixtures/reject/src/lib.rs:175:51 | +| 1 | `std::iter::Extend` | fixtures/reject/src/lib.rs:995:6 | +| 1 | `std::iter::Map` | fixtures/reject/src/lib.rs:224:30 | +| 1 | `std::net::AddrParseError` | fixtures/reject/src/lib.rs:471:32 | +| 1 | `std::net::Ipv4Addr` | fixtures/reject/src/lib.rs:471:32 | +| 1 | `std::option::Option` | fixtures/reject/src/lib.rs:407:2 | +| 1 | `std::slice::IterMut` | fixtures/reject/src/lib.rs:806:15 | +| 1 | `std::slice::Iter` | fixtures/reject/src/lib.rs:129:11 | +| 1 | `std::std::Layout` | fixtures/reject/src/lib.rs:605:15 | +| 1 | `std::str` | fixtures/reject/src/lib.rs:472:4 | +| 1 | `std::sync::Mutex` | fixtures/reject/src/lib.rs:554:12 | +| 1 | `std::sync::Weak` | fixtures/reject/src/lib.rs:488:40 | +| 1 | `std::task::Poll` | fixtures/reject/src/lib.rs:89:34 | +| 1 | `str` | fixtures/reject/src/lib.rs:364:4 | +| 1 | `u64` | fixtures/reject/src/lib.rs:80:2 | | 1 | `value` | fixtures/reject/src/lib.rs:31:2 | -| 1 | `{async closure}` | fixtures/reject/src/lib.rs:64:2 | +| 1 | `{async closure}` | fixtures/reject/src/lib.rs:55:2 | ## By type or path | Count | Construct | Type or path | First | | ---: | --- | --- | --- | -| 6 | a raw pointer to `_` in a variable assigned again while it may point there | `(u32, u32)` | fixtures/reject/src/lib.rs:666:10 | -| 4 | a variant of `_`, which is not supported: either is the same JS string | `std::borrow::Cow` | fixtures/reject/src/lib.rs:379: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:1008:10 | +| 6 | a raw pointer to `_` in a variable assigned again while it may point there | `(u32, u32)` | fixtures/reject/src/lib.rs:656:10 | +| 4 | a variant of `_`, which is not supported: either is the same JS string | `std::borrow::Cow` | fixtures/reject/src/lib.rs:369: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:973:10 | | 3 | unsupported type `_` | `f16` | fixtures/reject/src/lib.rs:7:14 | | 2 | `_` is not supported: its `None` and `Some` would both be `rt.None` | `Option` | fixtures/reject/src/lib.rs:16:15 | | 2 | `_` of `_`, whose `None` is `rt.None`, which is not supported yet | `Iterator::scan`, `Option` | fixtures/reject/src/lib.rs:42: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:507: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:1022:19 | -| 2 | a raw pointer to `_` in a variable assigned again while it may point there | `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:746:15 | -| 2 | an assignment through a reference to `_` | `std::pin::Pin` | fixtures/reject/src/lib.rs:128:2 | -| 2 | replacing the value behind a reference to `_` | `std::pin::Pin` | fixtures/reject/src/lib.rs:112:2 | -| 2 | unsupported call to `_` | `::sum` | fixtures/reject/src/lib.rs:477:17 | -| 1 | `Buf::copy_to_bytes` of `_`, a value JS copies, which is not supported | `Blank` | fixtures/reject/src/lib.rs:811: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:437: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:422:2 | -| 1 | `_` is not supported yet | `std::borrow::Cow` | fixtures/reject/src/lib.rs:390:18 | -| 1 | `_` is not supported: its `Pending` and `Ready` would both be `rt.OuterPending` | `Poll` | fixtures/reject/src/lib.rs:93:20 | +| 2 | `_`, a trait object of the generic trait `_`, which is not supported yet | `dyn Scaled`, `Scaled` | fixtures/reject/src/lib.rs:497: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:987:19 | +| 2 | a raw pointer to `_` in a variable assigned again while it may point there | `std::cell::UnsafeCell` | fixtures/reject/src/lib.rs:736:15 | +| 2 | an assignment through a reference to `_` | `std::pin::Pin` | fixtures/reject/src/lib.rs:119:2 | +| 2 | replacing the value behind a reference to `_` | `std::pin::Pin` | fixtures/reject/src/lib.rs:103:2 | +| 2 | unsupported call to `_` | `::sum` | fixtures/reject/src/lib.rs:467:17 | +| 1 | `Buf::copy_to_bytes` of `_`, a value JS copies, which is not supported | `Blank` | fixtures/reject/src/lib.rs:801: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:427: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:412:2 | +| 1 | `_` is not supported yet | `std::borrow::Cow` | fixtures/reject/src/lib.rs:380:18 | +| 1 | `_` is not supported: its `Pending` and `Ready` would both be `rt.OuterPending` | `Poll` | fixtures/reject/src/lib.rs:84: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:545:2 | -| 1 | `_` of `_` by `_`, which is not supported yet | `HashMap::contains_key`, `std::collections::HashMap`, `u8` | fixtures/reject/src/lib.rs:283:6 | -| 1 | `_` of `_`, which drops `_`, which is not supported yet | `into_keys`, `std::collections::HashMap`, `Noisy` | fixtures/reject/src/lib.rs:55:13 | -| 1 | `_` of `_`, which is not supported yet | `std::any::Any::type_id`, `dyn std::any::Any` | fixtures/reject/src/lib.rs:588:4 | -| 1 | `_` of `_`, whose `clone_from` is its own, which is not supported yet | `slice::clone_from_slice`, `Reused` | fixtures/reject/src/lib.rs:333:4 | +| 1 | `_` is not supported: its field `_` is `_`, typed `_`, whose `Pending` would be `rt.OuterPending` as `_` | `Waiting`, `poll`, `Poll`, `rt.Poll`, `Poll` | fixtures/reject/src/lib.rs:535:2 | +| 1 | `_` of `_` by `_`, which is not supported yet | `HashMap::contains_key`, `std::collections::HashMap`, `u8` | fixtures/reject/src/lib.rs:274:6 | +| 1 | `_` of `_`, which is not supported yet | `std::any::Any::type_id`, `dyn std::any::Any` | fixtures/reject/src/lib.rs:578:4 | +| 1 | `_` of `_`, whose `clone_from` is its own, which is not supported yet | `slice::clone_from_slice`, `Reused` | fixtures/reject/src/lib.rs:324:4 | | 1 | `_` of `_`, whose `clone_from` is its own, which is not supported yet | `slice::fill`, `Reused` | fixtures/reject/src/lib.rs:21:4 | -| 1 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | `std::collections::HashMap::into_keys` | fixtures/reject/src/lib.rs:891:6 | -| 1 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | `std::iter::Extend::extend` | fixtures/reject/src/lib.rs:1030:6 | -| 1 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | `std::iter::Iterator::count` | fixtures/reject/src/lib.rs:244:38 | -| 1 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | `std::iter::Iterator::filter` | fixtures/reject/src/lib.rs:244:16 | -| 1 | `_` through a held type's own, which is not supported yet | `::ne` | fixtures/reject/src/lib.rs:315:2 | -| 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:564:12 | -| 1 | `_`, which is not supported yet | `Hasher::write` | fixtures/reject/src/lib.rs:291: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:431:6 | -| 1 | `fmt::Arguments` with a placeholder, or not made in place, written to `_`'s own `fmt::Write`, which is not supported yet: std splits what a placeholder writes into `write_str` calls the runtime does not make | `Sink` | fixtures/reject/src/lib.rs:76:10 | -| 1 | a `zip` of `_` and `_`, which std reads by index, of items that drop, which is not supported yet | `std::iter::Map`, `std::ops::Range` | fixtures/reject/src/lib.rs:233:30 | -| 1 | a `zip` of `_`, whose closures std calls one item further through `next` than through `fold` | `std::iter::Chain` | fixtures/reject/src/lib.rs:184:51 | -| 1 | a cast from `_` to `_` | `u64`, `f16` | fixtures/reject/src/lib.rs:89:2 | -| 1 | a cast from a pointer to `_` to one to `_`, which reads the bytes of one type as another | `u32`, `u8` | fixtures/reject/src/lib.rs:605:27 | -| 1 | a coercion to `_` | `std::sync::Arc` | fixtures/reject/src/lib.rs:338:2 | -| 1 | a coercion to `_`, which is not supported yet | `&Tail` | fixtures/reject/src/lib.rs:534:30 | -| 1 | a coercion to `_`, which is not supported yet | `std::sync::Weak` | fixtures/reject/src/lib.rs:498:40 | -| 1 | a constant of type `_`, a pointer into memory translation can't name | `&u32` | fixtures/reject/src/lib.rs:828:3 | -| 1 | a dangling pointer to `_`, a value of no bytes made of more than structs and tuples | `Only` | fixtures/reject/src/lib.rs:787: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:98: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:627:10 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Lane` | fixtures/reject/src/lib.rs:972: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:926: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:658: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:952: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:719: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:737:15 | -| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Hits` | fixtures/reject/src/lib.rs:770:21 | -| 1 | a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet | `(u32, u32)` | fixtures/reject/src/lib.rs:729:10 | +| 1 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | `std::collections::HashMap::into_keys` | fixtures/reject/src/lib.rs:856:6 | +| 1 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | `std::iter::Extend::extend` | fixtures/reject/src/lib.rs:995:6 | +| 1 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | `std::iter::Iterator::count` | fixtures/reject/src/lib.rs:235:38 | +| 1 | `_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it | `std::iter::Iterator::filter` | fixtures/reject/src/lib.rs:235:16 | +| 1 | `_` through a held type's own, which is not supported yet | `::ne` | fixtures/reject/src/lib.rs:306:2 | +| 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:554:12 | +| 1 | `_`, which is not supported yet | `Hasher::write` | fixtures/reject/src/lib.rs:282: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:421:6 | +| 1 | `fmt::Arguments` with a placeholder, or not made in place, written to `_`'s own `fmt::Write`, which is not supported yet: std splits what a placeholder writes into `write_str` calls the runtime does not make | `Sink` | fixtures/reject/src/lib.rs:67:10 | +| 1 | a `zip` of `_` and `_`, which std reads by index, of items that drop, which is not supported yet | `std::iter::Map`, `std::ops::Range` | fixtures/reject/src/lib.rs:224:30 | +| 1 | a `zip` of `_`, whose closures std calls one item further through `next` than through `fold` | `std::iter::Chain` | fixtures/reject/src/lib.rs:175:51 | +| 1 | a cast from `_` to `_` | `u64`, `f16` | fixtures/reject/src/lib.rs:80:2 | +| 1 | a cast from a pointer to `_` to one to `_`, which reads the bytes of one type as another | `u32`, `u8` | fixtures/reject/src/lib.rs:595:27 | +| 1 | a coercion to `_` | `std::sync::Arc` | fixtures/reject/src/lib.rs:329:2 | +| 1 | a coercion to `_`, which is not supported yet | `&Tail` | fixtures/reject/src/lib.rs:524:30 | +| 1 | a coercion to `_`, which is not supported yet | `std::sync::Weak` | fixtures/reject/src/lib.rs:488:40 | +| 1 | a constant of type `_`, a pointer into memory translation can't name | `&u32` | fixtures/reject/src/lib.rs:818:3 | +| 1 | a dangling pointer to `_`, a value of no bytes made of more than structs and tuples | `Only` | fixtures/reject/src/lib.rs:777: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:89: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:617:10 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `(u32, u32)`, `Lane` | fixtures/reject/src/lib.rs:937: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:891: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:648: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:917: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:709: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:727:15 | +| 1 | a raw pointer to `_` in `_`, which the crate may put another object in place of | `std::cell::UnsafeCell`, `Hits` | fixtures/reject/src/lib.rs:760:21 | +| 1 | a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet | `(u32, u32)` | fixtures/reject/src/lib.rs:719:10 | | 1 | a scalar constant of type `_` | `f16` | fixtures/reject/src/lib.rs:8:2 | -| 1 | a trait object of `_`, which is not supported yet | `[u8; 4]` | fixtures/reject/src/lib.rs:524:26 | -| 1 | a zero-sized constant of type `_` | `{async closure}` | fixtures/reject/src/lib.rs:64:2 | -| 1 | an assignment through a reference to `_` | `std::sync::MutexGuard` | fixtures/reject/src/lib.rs:104:2 | -| 1 | an iterator of the crate implementing `_`, which is not supported yet | `DoubleEndedIterator` | fixtures/reject/src/lib.rs:171:1 | -| 1 | an iterator of the crate implementing `_`, which is not supported yet | `FusedIterator` | fixtures/reject/src/lib.rs:225:1 | -| 1 | an upcast from `_` to `_`, which is not supported yet | `dyn Keyed`, `dyn std::any::Any` | fixtures/reject/src/lib.rs:582:32 | +| 1 | a trait object of `_`, which is not supported yet | `[u8; 4]` | fixtures/reject/src/lib.rs:514:26 | +| 1 | a zero-sized constant of type `_` | `{async closure}` | fixtures/reject/src/lib.rs:55:2 | +| 1 | an assignment through a reference to `_` | `std::sync::MutexGuard` | fixtures/reject/src/lib.rs:95:2 | +| 1 | an iterator of the crate implementing `_`, which is not supported yet | `DoubleEndedIterator` | fixtures/reject/src/lib.rs:162:1 | +| 1 | an iterator of the crate implementing `_`, which is not supported yet | `FusedIterator` | fixtures/reject/src/lib.rs:216:1 | +| 1 | an upcast from `_` to `_`, which is not supported yet | `dyn Keyed`, `dyn std::any::Any` | fixtures/reject/src/lib.rs:572:32 | | 1 | arithmetic on `_` | `f16` | fixtures/reject/src/lib.rs:8:2 | | 1 | collecting `_`, whose `None` is `rt.None`, which is not supported yet | `Option` | fixtures/reject/src/lib.rs:36:43 | -| 1 | comparing `_` as a key, which is not supported yet | `std::collections::BTreeSet` | fixtures/reject/src/lib.rs:265:75 | -| 1 | comparing pointers to `_` in an atomic, which JS has no address of | `u32` | fixtures/reject/src/lib.rs:827:15 | -| 1 | comparing pointers to `_`, each a place JS makes of its own | `u32` | fixtures/reject/src/lib.rs:646:2 | -| 1 | constructing `_` | `std::borrow::Cow` | fixtures/reject/src/lib.rs:397:53 | -| 1 | hashing `_` as a key, which is not supported yet | `std::collections::BTreeSet` | fixtures/reject/src/lib.rs:265:75 | -| 1 | hashing `_` through `_`'s own `Hash::hash_slice`, which is not supported yet | `std::vec::Vec`, `Batched` | fixtures/reject/src/lib.rs:357:16 | -| 1 | overriding `_`, which std's adaptors call in place of `next` or beside it | `Iterator::fold` | fixtures/reject/src/lib.rs:151:2 | -| 1 | overriding `_`, which std's adaptors call in place of `next` or beside it | `Iterator::size_hint` | fixtures/reject/src/lib.rs:205: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:366:13 | -| 1 | passing `_`, a closure that owns a value that drops, to `_`, which is not supported yet | `{closure}`, `Iterator::for_each` | fixtures/reject/src/lib.rs:367:16 | -| 1 | passing `_`, which drops, to `_`, which is not supported yet | `Spent`, `BTreeMap::range` | fixtures/reject/src/lib.rs:853:56 | -| 1 | passing `_`, which drops, to `_`, which is not supported yet | `Spent`, `Vec::drain` | fixtures/reject/src/lib.rs:853:4 | -| 1 | passing `_`, which drops, to `_`, which is not supported yet | `Spent`, `VecDeque::drain` | fixtures/reject/src/lib.rs:853:29 | -| 1 | passing `_`, which drops, to `_`, which is not supported yet | `{closure}`, `String::retain` | fixtures/reject/src/lib.rs:859:4 | -| 1 | passing `_`, which drops, to `_`, which is not supported yet | `{closure}`, `str::contains` | fixtures/reject/src/lib.rs:374:4 | -| 1 | replacing the value behind a reference to `_` | `std::sync::MutexGuard` | fixtures/reject/src/lib.rs:133:2 | -| 1 | union `_`, whose fields overlap in `_` and `f64`, which JS keeps apart | `Bits`, `u32` | fixtures/reject/src/lib.rs:632:1 | -| 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:588:2 | -| 1 | unsupported call to `_` | `::deref` | fixtures/reject/src/lib.rs:391:2 | -| 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:896:27 | -| 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:417:2 | -| 1 | unsupported call to `_` | `::cycle` | fixtures/reject/src/lib.rs:138:11 | -| 1 | unsupported call to `_` | `::is_sorted` | fixtures/reject/src/lib.rs:816:15 | -| 1 | unsupported call to `_` | `::clone_from` | fixtures/reject/src/lib.rs:986:10 | -| 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:911:27 | -| 1 | unsupported call to `_` | `::hash` | fixtures/reject/src/lib.rs:348:10 | -| 1 | unsupported call to `_` | `std::any::TypeId::of` | fixtures/reject/src/lib.rs:588:17 | -| 1 | unsupported call to `_` | `std::ops::Range::contains` | fixtures/reject/src/lib.rs:192:8 | -| 1 | unsupported call to `_` | `std::std::Layout::new` | fixtures/reject/src/lib.rs:615:15 | -| 1 | unsupported call to `_` | `std::std::alloc` | fixtures/reject/src/lib.rs:617:11 | -| 1 | unsupported call to `_` | `std::std::dealloc` | fixtures/reject/src/lib.rs:620:3 | -| 1 | unsupported call to `_` | `std::str::parse` | fixtures/reject/src/lib.rs:482:4 | -| 1 | unsupported type `_` from another crate | `std::net::AddrParseError` | fixtures/reject/src/lib.rs:481:32 | -| 1 | unsupported type `_` from another crate | `std::net::Ipv4Addr` | fixtures/reject/src/lib.rs:481:32 | +| 1 | comparing `_` as a key, which is not supported yet | `std::collections::BTreeSet` | fixtures/reject/src/lib.rs:256:75 | +| 1 | comparing pointers to `_` in an atomic, which JS has no address of | `u32` | fixtures/reject/src/lib.rs:817:15 | +| 1 | comparing pointers to `_`, each a place JS makes of its own | `u32` | fixtures/reject/src/lib.rs:636:2 | +| 1 | constructing `_` | `std::borrow::Cow` | fixtures/reject/src/lib.rs:387:53 | +| 1 | hashing `_` as a key, which is not supported yet | `std::collections::BTreeSet` | fixtures/reject/src/lib.rs:256:75 | +| 1 | hashing `_` through `_`'s own `Hash::hash_slice`, which is not supported yet | `std::vec::Vec`, `Batched` | fixtures/reject/src/lib.rs:348:16 | +| 1 | overriding `_`, which std's adaptors call in place of `next` or beside it | `Iterator::fold` | fixtures/reject/src/lib.rs:142:2 | +| 1 | overriding `_`, which std's adaptors call in place of `next` or beside it | `Iterator::size_hint` | fixtures/reject/src/lib.rs:196: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:357:13 | +| 1 | passing `_`, which drops, to `_`, which is not supported yet | `{closure}`, `String::retain` | fixtures/reject/src/lib.rs:824:4 | +| 1 | passing `_`, which drops, to `_`, which is not supported yet | `{closure}`, `str::contains` | fixtures/reject/src/lib.rs:364:4 | +| 1 | replacing the value behind a reference to `_` | `std::sync::MutexGuard` | fixtures/reject/src/lib.rs:124:2 | +| 1 | union `_`, whose fields overlap in `_` and `f64`, which JS keeps apart | `Bits`, `u32` | fixtures/reject/src/lib.rs:622:1 | +| 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:578:2 | +| 1 | unsupported call to `_` | `::deref` | fixtures/reject/src/lib.rs:381:2 | +| 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:861:27 | +| 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:407:2 | +| 1 | unsupported call to `_` | `::cycle` | fixtures/reject/src/lib.rs:129:11 | +| 1 | unsupported call to `_` | `::is_sorted` | fixtures/reject/src/lib.rs:806:15 | +| 1 | unsupported call to `_` | `::clone_from` | fixtures/reject/src/lib.rs:951:10 | +| 1 | unsupported call to `_` | `::eq` | fixtures/reject/src/lib.rs:876:27 | +| 1 | unsupported call to `_` | `::hash` | fixtures/reject/src/lib.rs:339:10 | +| 1 | unsupported call to `_` | `std::any::TypeId::of` | fixtures/reject/src/lib.rs:578:17 | +| 1 | unsupported call to `_` | `std::ops::Range::contains` | fixtures/reject/src/lib.rs:183:8 | +| 1 | unsupported call to `_` | `std::std::Layout::new` | fixtures/reject/src/lib.rs:605:15 | +| 1 | unsupported call to `_` | `std::std::alloc` | fixtures/reject/src/lib.rs:607:11 | +| 1 | unsupported call to `_` | `std::std::dealloc` | fixtures/reject/src/lib.rs:610:3 | +| 1 | unsupported call to `_` | `std::str::parse` | fixtures/reject/src/lib.rs:472:4 | +| 1 | unsupported type `_` from another crate | `std::net::AddrParseError` | fixtures/reject/src/lib.rs:471:32 | +| 1 | unsupported type `_` from another crate | `std::net::Ipv4Addr` | fixtures/reject/src/lib.rs:471:32 | ## Spans
unsupported call to `_` (17) -- fixtures/reject/src/lib.rs:138:11: unsupported call to ` as std::iter::Iterator>::cycle` -- fixtures/reject/src/lib.rs:192:8: unsupported call to `std::ops::Range::::contains::` -- fixtures/reject/src/lib.rs:348:10: unsupported call to `::hash::` -- fixtures/reject/src/lib.rs:391:2: unsupported call to ` as std::ops::Deref>::deref` -- fixtures/reject/src/lib.rs:417:2: unsupported call to ` as std::cmp::PartialEq>::eq` -- fixtures/reject/src/lib.rs:477:17: unsupported call to ` as std::iter::Iterator>::sum::` -- fixtures/reject/src/lib.rs:477:38: unsupported call to ` as std::iter::Iterator>::sum::` -- fixtures/reject/src/lib.rs:482:4: unsupported call to `core::str::::parse::` -- fixtures/reject/src/lib.rs:588:2: unsupported call to `::eq` -- fixtures/reject/src/lib.rs:588:17: unsupported call to `std::any::TypeId::of::` -- fixtures/reject/src/lib.rs:615:15: unsupported call to `std::alloc::Layout::new::` -- fixtures/reject/src/lib.rs:617:11: unsupported call to `std::alloc::alloc` -- fixtures/reject/src/lib.rs:620:3: unsupported call to `std::alloc::dealloc` -- fixtures/reject/src/lib.rs:816:15: unsupported call to ` as std::iter::Iterator>::is_sorted` -- fixtures/reject/src/lib.rs:896:27: unsupported call to ` as std::cmp::PartialEq>>::eq` -- fixtures/reject/src/lib.rs:911:27: unsupported call to ` as std::cmp::PartialEq<&[Right]>>::eq` -- fixtures/reject/src/lib.rs:986:10: unsupported call to ` as std::clone::Clone>::clone_from` +- fixtures/reject/src/lib.rs:129:11: unsupported call to ` as std::iter::Iterator>::cycle` +- fixtures/reject/src/lib.rs:183:8: unsupported call to `std::ops::Range::::contains::` +- fixtures/reject/src/lib.rs:339:10: unsupported call to `::hash::` +- fixtures/reject/src/lib.rs:381:2: unsupported call to ` as std::ops::Deref>::deref` +- fixtures/reject/src/lib.rs:407:2: unsupported call to ` as std::cmp::PartialEq>::eq` +- fixtures/reject/src/lib.rs:467:17: unsupported call to ` as std::iter::Iterator>::sum::` +- fixtures/reject/src/lib.rs:467:38: unsupported call to ` as std::iter::Iterator>::sum::` +- fixtures/reject/src/lib.rs:472:4: unsupported call to `core::str::::parse::` +- fixtures/reject/src/lib.rs:578:2: unsupported call to `::eq` +- fixtures/reject/src/lib.rs:578:17: unsupported call to `std::any::TypeId::of::` +- fixtures/reject/src/lib.rs:605:15: unsupported call to `std::alloc::Layout::new::` +- fixtures/reject/src/lib.rs:607:11: unsupported call to `std::alloc::alloc` +- fixtures/reject/src/lib.rs:610:3: unsupported call to `std::alloc::dealloc` +- fixtures/reject/src/lib.rs:806:15: unsupported call to ` as std::iter::Iterator>::is_sorted` +- fixtures/reject/src/lib.rs:861:27: unsupported call to ` as std::cmp::PartialEq>>::eq` +- fixtures/reject/src/lib.rs:876:27: unsupported call to ` as std::cmp::PartialEq<&[Right]>>::eq` +- fixtures/reject/src/lib.rs:951:10: unsupported call to ` as std::clone::Clone>::clone_from`
a raw pointer to `_` in `_`, which the crate may put another object in place of (12) -- fixtures/reject/src/lib.rs:658:10: a raw pointer to `(u32, u32)` in `Span2`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:719:2: a raw pointer to `(u32, u32)` in `Window`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:737: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:770: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:926:10: a raw pointer to `(u32, u32)` in `Plain`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:952:19: a raw pointer to `(u32, u32)` in `Track`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:972:19: a raw pointer to `(u32, u32)` in `Lane`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1008:10: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1009:10: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1010:58: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of -- fixtures/reject/src/lib.rs:1022: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:1023: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:648:10: a raw pointer to `(u32, u32)` in `Span2`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:709:2: a raw pointer to `(u32, u32)` in `Window`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:727: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:760: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:891:10: a raw pointer to `(u32, u32)` in `Plain`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:917:19: a raw pointer to `(u32, u32)` in `Track`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:937:19: a raw pointer to `(u32, u32)` in `Lane`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:973:10: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:974:10: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:975:58: a raw pointer to `(u32, u32)` in `Gap`, which the crate may put another object in place of +- fixtures/reject/src/lib.rs:987: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:988:19: a raw pointer to `std::mem::MaybeUninit<(u32, u32)>` in `Gap`, which the crate may put another object in place of
a raw pointer to `_` in a variable assigned again while it may point there (8) -- fixtures/reject/src/lib.rs:666:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:674:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:683:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:691:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:700:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:708:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:746:15: a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there -- fixtures/reject/src/lib.rs:759:15: a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there - -
- -
passing `_`, which drops, to `_`, which is not supported yet (5) - -- fixtures/reject/src/lib.rs:374:4: passing `{closure@fixtures/reject/src/lib.rs:374:13: 374:27}`, which drops, to `str::contains`, which is not supported yet -- fixtures/reject/src/lib.rs:853:4: passing `Spent`, which drops, to `Vec::drain`, which is not supported yet -- fixtures/reject/src/lib.rs:853:29: passing `Spent`, which drops, to `VecDeque::drain`, which is not supported yet -- fixtures/reject/src/lib.rs:853:56: passing `Spent`, which drops, to `BTreeMap::range`, which is not supported yet -- fixtures/reject/src/lib.rs:859:4: passing `{closure@fixtures/reject/src/lib.rs:859:11: 859:19}`, which drops, to `String::retain`, which is not supported yet +- fixtures/reject/src/lib.rs:656:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:664:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:673:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:681:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:690:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:698:10: a raw pointer to `(u32, u32)` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:736:15: a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there +- fixtures/reject/src/lib.rs:749:15: a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there
`_` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it (4) -- fixtures/reject/src/lib.rs:244:16: `std::iter::Iterator::filter` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it -- fixtures/reject/src/lib.rs:244:38: `std::iter::Iterator::count` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it -- fixtures/reject/src/lib.rs:891:6: `std::collections::HashMap::::into_keys` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it -- fixtures/reject/src/lib.rs:1030:6: `std::iter::Extend::extend` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it +- fixtures/reject/src/lib.rs:235:16: `std::iter::Iterator::filter` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it +- fixtures/reject/src/lib.rs:235:38: `std::iter::Iterator::count` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it +- fixtures/reject/src/lib.rs:856:6: `std::collections::HashMap::::into_keys` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it +- fixtures/reject/src/lib.rs:995:6: `std::iter::Extend::extend` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it
a variant of `_`, which is not supported: either is the same JS string (4) -- fixtures/reject/src/lib.rs:379:2: a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string -- fixtures/reject/src/lib.rs:380:30: a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string -- fixtures/reject/src/lib.rs:381:27: a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string -- fixtures/reject/src/lib.rs:386:2: a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string +- fixtures/reject/src/lib.rs:369:2: a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string +- fixtures/reject/src/lib.rs:370:30: a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string +- fixtures/reject/src/lib.rs:371:27: a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string +- fixtures/reject/src/lib.rs:376:2: a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string
a copy of a closure that changes what it captured (3) -- fixtures/reject/src/lib.rs:254:14: a copy of a closure that changes what it captured -- fixtures/reject/src/lib.rs:557:14: a copy of a closure that changes what it captured -- fixtures/reject/src/lib.rs:558:14: a copy of a closure that changes what it captured +- fixtures/reject/src/lib.rs:245:14: a copy of a closure that changes what it captured +- fixtures/reject/src/lib.rs:547:14: a copy of a closure that changes what it captured +- fixtures/reject/src/lib.rs:548:14: a copy of a closure that changes what it captured
an assignment through a reference to `_` (3) -- fixtures/reject/src/lib.rs:104:2: an assignment through a reference to `std::sync::MutexGuard<'_, u8>` -- fixtures/reject/src/lib.rs:128:2: an assignment through a reference to `std::pin::Pin>>` -- fixtures/reject/src/lib.rs:238:2: an assignment through a reference to `std::pin::Pin<&mut Noisy>` +- fixtures/reject/src/lib.rs:95:2: an assignment through a reference to `std::sync::MutexGuard<'_, u8>` +- fixtures/reject/src/lib.rs:119:2: an assignment through a reference to `std::pin::Pin>>` +- fixtures/reject/src/lib.rs:229:2: an assignment through a reference to `std::pin::Pin<&mut Noisy>`
replacing the value behind a reference to `_` (3) -- fixtures/reject/src/lib.rs:112:2: replacing the value behind a reference to `std::pin::Pin fn(&'a mut std::task::Context<'b>) -> std::task::Poll>>>` -- fixtures/reject/src/lib.rs:120:2: replacing the value behind a reference to `std::pin::Pin>` -- fixtures/reject/src/lib.rs:133:2: replacing the value behind a reference to `std::sync::MutexGuard<'_, u8>` +- fixtures/reject/src/lib.rs:103:2: replacing the value behind a reference to `std::pin::Pin fn(&'a mut std::task::Context<'b>) -> std::task::Poll>>>` +- fixtures/reject/src/lib.rs:111:2: replacing the value behind a reference to `std::pin::Pin>` +- fixtures/reject/src/lib.rs:124:2: replacing the value behind a reference to `std::sync::MutexGuard<'_, u8>`
@@ -372,7 +350,7 @@ The type or module each refused type or path belongs to. - fixtures/reject/src/lib.rs:7:14: unsupported type `f16` - fixtures/reject/src/lib.rs:7:25: unsupported type `f16` -- fixtures/reject/src/lib.rs:87:51: unsupported type `f16` +- fixtures/reject/src/lib.rs:78:51: unsupported type `f16` @@ -386,14 +364,14 @@ The type or module each refused type or path belongs to.
`_` of `_`, whose `None` is `rt.None`, which is not supported yet (2) - fixtures/reject/src/lib.rs:42:4: `Iterator::scan` of `Option>`, whose `None` is `rt.None`, which is not supported yet -- fixtures/reject/src/lib.rs:260:11: `Iterator::scan` of `Option<()>`, whose `None` is `rt.None`, which is not supported yet +- fixtures/reject/src/lib.rs:251:11: `Iterator::scan` of `Option<()>`, whose `None` is `rt.None`, which is not supported yet
`_` of `_`, whose `clone_from` is its own, which is not supported yet (2) - fixtures/reject/src/lib.rs:21:4: `slice::fill` of `Reused`, whose `clone_from` is its own, which is not supported yet -- fixtures/reject/src/lib.rs:333:4: `slice::clone_from_slice` of `Reused`, whose `clone_from` is its own, which is not supported yet +- fixtures/reject/src/lib.rs:324:4: `slice::clone_from_slice` of `Reused`, whose `clone_from` is its own, which is not supported yet
@@ -406,79 +384,79 @@ The type or module each refused type or path belongs to.
`_`, a trait object of the generic trait `_`, which is not supported yet (2) -- fixtures/reject/src/lib.rs:507:23: `dyn Scaled`, a trait object of the generic trait `Scaled`, which is not supported yet -- fixtures/reject/src/lib.rs:508:4: `dyn Scaled`, a trait object of the generic trait `Scaled`, which is not supported yet +- fixtures/reject/src/lib.rs:497:23: `dyn Scaled`, a trait object of the generic trait `Scaled`, which is not supported yet +- fixtures/reject/src/lib.rs:498:4: `dyn Scaled`, a trait object of the generic trait `Scaled`, which is not supported yet
a coercion to `_`, which is not supported yet (2) -- fixtures/reject/src/lib.rs:498:40: a coercion to `std::sync::Weak`, which is not supported yet -- fixtures/reject/src/lib.rs:534:30: a coercion to `&Tail`, which is not supported yet +- fixtures/reject/src/lib.rs:488:40: a coercion to `std::sync::Weak`, which is not supported yet +- fixtures/reject/src/lib.rs:524:30: a coercion to `&Tail`, which is not supported yet
an iterator of the crate implementing `_`, which is not supported yet (2) -- fixtures/reject/src/lib.rs:171:1: an iterator of the crate implementing `DoubleEndedIterator`, which is not supported yet -- fixtures/reject/src/lib.rs:225:1: an iterator of the crate implementing `FusedIterator`, which is not supported yet +- fixtures/reject/src/lib.rs:162:1: an iterator of the crate implementing `DoubleEndedIterator`, which is not supported yet +- fixtures/reject/src/lib.rs:216:1: an iterator of the crate implementing `FusedIterator`, which is not supported yet
overriding `_`, which std's adaptors call in place of `next` or beside it (2) -- fixtures/reject/src/lib.rs:151:2: overriding `Iterator::fold`, which std's adaptors call in place of `next` or beside it -- fixtures/reject/src/lib.rs:205:2: overriding `Iterator::size_hint`, which std's adaptors call in place of `next` or beside it +- fixtures/reject/src/lib.rs:142:2: overriding `Iterator::fold`, which std's adaptors call in place of `next` or beside it +- fixtures/reject/src/lib.rs:196:2: overriding `Iterator::size_hint`, which std's adaptors call in place of `next` or beside it
-
passing `_`, a closure that owns a value that drops, to `_`, which is not supported yet (2) +
passing `_`, which drops, to `_`, which is not supported yet (2) -- fixtures/reject/src/lib.rs:366:13: passing `{closure@fixtures/reject/src/lib.rs:366:28: 366:35}`, a closure that owns a value that drops, to `Entry::or_insert_with`, which is not supported yet -- fixtures/reject/src/lib.rs:367:16: passing `{closure@fixtures/reject/src/lib.rs:367:25: 367:33}`, a closure that owns a value that drops, to `Iterator::for_each`, which is not supported yet +- fixtures/reject/src/lib.rs:364:4: passing `{closure@fixtures/reject/src/lib.rs:364:13: 364:27}`, which drops, to `str::contains`, which is not supported yet +- fixtures/reject/src/lib.rs:824:4: passing `{closure@fixtures/reject/src/lib.rs:824:11: 824:19}`, which drops, to `String::retain`, which is not supported yet
unsupported type `_` from another crate (2) -- fixtures/reject/src/lib.rs:481:32: unsupported type `std::net::AddrParseError` from another crate -- fixtures/reject/src/lib.rs:481:32: unsupported type `std::net::Ipv4Addr` from another crate +- fixtures/reject/src/lib.rs:471:32: unsupported type `std::net::AddrParseError` from another crate +- fixtures/reject/src/lib.rs:471:32: unsupported type `std::net::Ipv4Addr` from another crate
`Buf::copy_to_bytes` of `_`, a value JS copies, which is not supported (1) -- fixtures/reject/src/lib.rs:811:2: `Buf::copy_to_bytes` of `Blank`, a value JS copies, which is not supported +- fixtures/reject/src/lib.rs:801:2: `Buf::copy_to_bytes` of `Blank`, a value JS copies, which is not supported
`BufMut::put` of `_` into a `BytesMut`, which picks the methods it calls by a capacity that depends on whether the other handles of its storage dropped, which is not supported (1) -- fixtures/reject/src/lib.rs:437:2: `BufMut::put` of `Counted` into a `BytesMut`, which picks the methods it calls by a capacity that depends on whether the other handles of its storage dropped, which is not supported +- fixtures/reject/src/lib.rs:427:2: `BufMut::put` of `Counted` into a `BytesMut`, which picks the methods it calls by a capacity that depends on whether the other handles of its storage dropped, which is not supported
`Bytes::from_owner` of `_`, which would drop with the last clone of what it makes, which is not supported (1) -- fixtures/reject/src/lib.rs:422:2: `Bytes::from_owner` of `std::sync::Arc<[u8]>`, which would drop with the last clone of what it makes, which is not supported +- fixtures/reject/src/lib.rs:412:2: `Bytes::from_owner` of `std::sync::Arc<[u8]>`, which would drop with the last clone of what it makes, which is not supported
`Pointer` formatting, as in `{:p}`, is not supported (1) -- fixtures/reject/src/lib.rs:70:2: `Pointer` formatting, as in `{:p}`, is not supported +- fixtures/reject/src/lib.rs:61:2: `Pointer` formatting, as in `{:p}`, is not supported
`_` is not supported yet (1) -- fixtures/reject/src/lib.rs:390:18: `std::borrow::Cow<'_, [u8]>` is not supported yet +- fixtures/reject/src/lib.rs:380:18: `std::borrow::Cow<'_, [u8]>` is not supported yet
`_` is not supported: its `Pending` and `Ready` would both be `rt.OuterPending` (1) -- fixtures/reject/src/lib.rs:93:20: `Poll>>>` is not supported: its `Pending` and `Ready` would both be `rt.OuterPending` +- fixtures/reject/src/lib.rs:84:20: `Poll>>>` is not supported: its `Pending` and `Ready` would both be `rt.OuterPending`
@@ -490,139 +468,133 @@ The type or module each refused type or path belongs to.
`_` is not supported: its field `_` is `_`, typed `_`, whose `Pending` would be `rt.OuterPending` as `_` (1) -- fixtures/reject/src/lib.rs:545:2: `Waiting>` is not supported: its field `poll` is `Poll`, typed `rt.Poll`, whose `Pending` would be `rt.OuterPending` as `Poll>` +- fixtures/reject/src/lib.rs:535:2: `Waiting>` is not supported: its field `poll` is `Poll`, typed `rt.Poll`, whose `Pending` would be `rt.OuterPending` as `Poll>`
`_` of `_` by `_`, which is not supported yet (1) -- fixtures/reject/src/lib.rs:283:6: `HashMap::contains_key` of `std::collections::HashMap` by `u8`, which is not supported yet - -
- -
`_` of `_`, which drops `_`, which is not supported yet (1) - -- fixtures/reject/src/lib.rs:55:13: `into_keys` of `std::collections::HashMap`, which drops `Noisy`, which is not supported yet +- fixtures/reject/src/lib.rs:274:6: `HashMap::contains_key` of `std::collections::HashMap` by `u8`, which is not supported yet
`_` of `_`, which is not supported yet (1) -- fixtures/reject/src/lib.rs:588:4: `std::any::Any::type_id` of `dyn std::any::Any`, which is not supported yet +- fixtures/reject/src/lib.rs:578:4: `std::any::Any::type_id` of `dyn std::any::Any`, which is not supported yet
`_` through a held type's own, which is not supported yet (1) -- fixtures/reject/src/lib.rs:315:2: ` as PartialEq>::ne` through a held type's own, which is not supported yet +- fixtures/reject/src/lib.rs:306:2: ` as PartialEq>::ne` through a held type's own, which is not supported yet
`_` with a mutable reference to a value JS copies, which its mapping would copy (1) -- fixtures/reject/src/lib.rs:564: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:554:12: `std::sync::Mutex::::get_mut` with a mutable reference to a value JS copies, which its mapping would copy
`_`, which is not supported yet (1) -- fixtures/reject/src/lib.rs:291:9: `Hasher::write`, which is not supported yet +- fixtures/reject/src/lib.rs:282:9: `Hasher::write`, which is not supported yet
`_`, which reads a capacity that depends on whether the other handles of its storage dropped, which is not supported (1) -- fixtures/reject/src/lib.rs:431:6: `BytesMut::capacity`, which reads a capacity that depends on whether the other handles of its storage dropped, which is not supported +- fixtures/reject/src/lib.rs:421:6: `BytesMut::capacity`, which reads a capacity that depends on whether the other handles of its storage dropped, which is not supported
`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 (1) -- fixtures/reject/src/lib.rs:76:10: `fmt::Arguments` with a placeholder, or not made in place, written to `Sink`'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:67:10: `fmt::Arguments` with a placeholder, or not made in place, written to `Sink`'s own `fmt::Write`, which is not supported yet: std splits what a placeholder writes into `write_str` calls the runtime does not make
a `zip` of `_` and `_`, which std reads by index, of items that drop, which is not supported yet (1) -- fixtures/reject/src/lib.rs:233:30: a `zip` of `std::iter::Map, {closure@fixtures/reject/src/lib.rs:233:15: 233:19}>` and `std::ops::Range`, which std reads by index, of items that drop, which is not supported yet +- fixtures/reject/src/lib.rs:224:30: a `zip` of `std::iter::Map, {closure@fixtures/reject/src/lib.rs:224:15: 224:19}>` and `std::ops::Range`, which std reads by index, of items that drop, which is not supported yet
a `zip` of `_`, whose closures std calls one item further through `next` than through `fold` (1) -- fixtures/reject/src/lib.rs:184:51: a `zip` of `std::iter::Chain, {closure@fixtures/reject/src/lib.rs:184:15: 184:18}>, std::iter::Copied>>`, whose closures std calls one item further through `next` than through `fold` +- fixtures/reject/src/lib.rs:175:51: a `zip` of `std::iter::Chain, {closure@fixtures/reject/src/lib.rs:175:15: 175:18}>, std::iter::Copied>>`, whose closures std calls one item further through `next` than through `fold`
a cast from `_` to `_` (1) -- fixtures/reject/src/lib.rs:89:2: a cast from `u64` to `f16` +- fixtures/reject/src/lib.rs:80:2: a cast from `u64` to `f16`
a cast from a pointer to `_` to one to `_`, which reads the bytes of one type as another (1) -- fixtures/reject/src/lib.rs:605: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:595:27: a cast from a pointer to `u32` to one to `u8`, which reads the bytes of one type as another
a coercion to `_` (1) -- fixtures/reject/src/lib.rs:338:2: a coercion to `std::sync::Arc<[u8]>` +- fixtures/reject/src/lib.rs:329:2: a coercion to `std::sync::Arc<[u8]>`
a constant of type `_`, a pointer into memory translation can't name (1) -- fixtures/reject/src/lib.rs:828:3: a constant of type `&u32`, a pointer into memory translation can't name +- fixtures/reject/src/lib.rs:818: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:787:11: a dangling pointer to `Only`, a value of no bytes made of more than structs and tuples +- fixtures/reject/src/lib.rs:777:11: a dangling pointer to `Only`, a value of no bytes made of more than structs and tuples
a future of `_`, which can be `rt.Pending`, as the future's own `Pending` is (1) -- fixtures/reject/src/lib.rs:98:34: a future of `std::task::Poll`, which can be `rt.Pending`, as the future's own `Pending` is +- fixtures/reject/src/lib.rs:89:34: a future of `std::task::Poll`, which can be `rt.Pending`, as the future's own `Pending` is
a mutable reference into a `Result`'s payload, passed on or kept (1) -- fixtures/reject/src/lib.rs:410:12: a mutable reference into a `Result`'s payload, passed on or kept +- fixtures/reject/src/lib.rs:400:12: a mutable reference into a `Result`'s payload, passed on or kept
a mutable static, which any code may write (1) -- fixtures/reject/src/lib.rs:82:11: a mutable static, which any code may write +- fixtures/reject/src/lib.rs:73:11: a mutable static, which any code may write
a pointer's address, which JS has no counterpart of (1) -- fixtures/reject/src/lib.rs:610:17: a pointer's address, which JS has no counterpart of +- fixtures/reject/src/lib.rs:600:17: a pointer's address, which JS has no counterpart of
a printable type must implement `Display` or `Debug` (1) -- fixtures/reject/src/lib.rs:85:1: a printable type must implement `Display` or `Debug` +- fixtures/reject/src/lib.rs:76:1: a printable type must implement `Display` or `Debug`
a raw pointer to `_` behind a reference, which is the object and not where it is kept (1) -- fixtures/reject/src/lib.rs:627: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:617:10: a raw pointer to `std::vec::Vec` behind a reference, which is the object and not where it is kept
a raw pointer to `_` in an element, a payload, or a union field, which is not supported yet (1) -- fixtures/reject/src/lib.rs:729: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:719:10: a raw pointer to `(u32, u32)` in an element, a payload, or a union field, which is not supported yet
@@ -634,19 +606,19 @@ The type or module each refused type or path belongs to.
a trait object of `_`, which is not supported yet (1) -- fixtures/reject/src/lib.rs:524:26: a trait object of `[u8; 4]`, which is not supported yet +- fixtures/reject/src/lib.rs:514:26: a trait object of `[u8; 4]`, which is not supported yet
a zero-sized constant of type `_` (1) -- fixtures/reject/src/lib.rs:64:2: a zero-sized constant of type `{async closure@fixtures/reject/src/lib.rs:63:10: 63:18}` +- fixtures/reject/src/lib.rs:55:2: a zero-sized constant of type `{async closure@fixtures/reject/src/lib.rs:54:10: 54:18}`
an upcast from `_` to `_`, which is not supported yet (1) -- fixtures/reject/src/lib.rs:582:32: an upcast from `dyn Keyed` to `dyn std::any::Any`, which is not supported yet +- fixtures/reject/src/lib.rs:572:32: an upcast from `dyn Keyed` to `dyn std::any::Any`, which is not supported yet
@@ -664,48 +636,54 @@ The type or module each refused type or path belongs to.
comparing `_` as a key, which is not supported yet (1) -- fixtures/reject/src/lib.rs:265:75: comparing `std::collections::BTreeSet` as a key, which is not supported yet +- fixtures/reject/src/lib.rs:256:75: comparing `std::collections::BTreeSet` as a key, which is not supported yet
comparing pointers to `()`, which has no bytes and so no address of its own (1) -- fixtures/reject/src/lib.rs:778:2: comparing pointers to `()`, which has no bytes and so no address of its own +- fixtures/reject/src/lib.rs:768:2: comparing pointers to `()`, which has no bytes and so no address of its own
comparing pointers to `_` in an atomic, which JS has no address of (1) -- fixtures/reject/src/lib.rs:827:15: comparing pointers to `u32` in an atomic, which JS has no address of +- fixtures/reject/src/lib.rs:817: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:646:2: comparing pointers to `u32`, each a place JS makes of its own +- fixtures/reject/src/lib.rs:636:2: comparing pointers to `u32`, each a place JS makes of its own
constructing `_` (1) -- fixtures/reject/src/lib.rs:397:53: constructing `std::borrow::Cow<'_, std::sync::Arc>` +- fixtures/reject/src/lib.rs:387:53: constructing `std::borrow::Cow<'_, std::sync::Arc>`
hashing `_` as a key, which is not supported yet (1) -- fixtures/reject/src/lib.rs:265:75: hashing `std::collections::BTreeSet` as a key, which is not supported yet +- fixtures/reject/src/lib.rs:256:75: hashing `std::collections::BTreeSet` as a key, which is not supported yet
hashing `_` through `_`'s own `Hash::hash_slice`, which is not supported yet (1) -- fixtures/reject/src/lib.rs:357:16: hashing `std::vec::Vec` through `Batched`'s own `Hash::hash_slice`, which is not supported yet +- fixtures/reject/src/lib.rs:348:16: hashing `std::vec::Vec` through `Batched`'s own `Hash::hash_slice`, which is not supported yet + +
+ +
passing `_`, a closure that owns a value that drops, to `_`, which is not supported yet (1) + +- fixtures/reject/src/lib.rs:357:13: passing `{closure@fixtures/reject/src/lib.rs:357:28: 357:35}`, a closure that owns a value that drops, to `Entry::or_insert_with`, which is not supported yet
union `_`, whose fields overlap in `_` and `f64`, which JS keeps apart (1) -- fixtures/reject/src/lib.rs:632:1: union `Bits`, whose fields overlap in `u32` and `f64`, which JS keeps apart +- fixtures/reject/src/lib.rs:622: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 275657c8c..a497a6173 100644 --- a/ts/fixtures/reject/expected.txt +++ b/ts/fixtures/reject/expected.txt @@ -1,8 +1,8 @@ no item `lopsided` in the crate no item `missing` in the crate no item `bound_ranges` in the crate -a root must not be generic at fixtures/reject/src/lib.rs:87:1 -a printable type must implement `Display` or `Debug` at fixtures/reject/src/lib.rs:85:1 +a root must not be generic at fixtures/reject/src/lib.rs:78:1 +a printable type must implement `Display` or `Debug` at fixtures/reject/src/lib.rs:76:1 unsupported type `f16` at fixtures/reject/src/lib.rs:7:14 a scalar constant of type `f16` at fixtures/reject/src/lib.rs:8:2 arithmetic on `f16` at fixtures/reject/src/lib.rs:8:2 @@ -15,111 +15,106 @@ unsupported type `f16` at fixtures/reject/src/lib.rs:7:25 `Iterator::scan` of `Option>`, whose `None` is `rt.None`, which is not supported yet at fixtures/reject/src/lib.rs:42:4 `Maybe<()>` is not supported: its field `value` is `Option`, typed `T | undefined`, whose `None` would be `rt.None` as `Option<()>` at fixtures/reject/src/lib.rs:31:2 collecting `Option<()>`, whose `None` is `rt.None`, which is not supported yet at fixtures/reject/src/lib.rs:36:43 -`into_keys` of `std::collections::HashMap`, which drops `Noisy`, which is not supported yet at fixtures/reject/src/lib.rs:55:13 -a zero-sized constant of type `{async closure@fixtures/reject/src/lib.rs:63:10: 63:18}` at fixtures/reject/src/lib.rs:64:2 -`Pointer` formatting, as in `{:p}`, is not supported at fixtures/reject/src/lib.rs:70:11 -`fmt::Arguments` with a placeholder, or not made in place, written to `Sink`'s own `fmt::Write`, which is not supported yet: std splits what a placeholder writes into `write_str` calls the runtime does not make at fixtures/reject/src/lib.rs:76:10 -a mutable static, which any code may write at fixtures/reject/src/lib.rs:82:11 -`Poll>>>` is not supported: its `Pending` and `Ready` would both be `rt.OuterPending` at fixtures/reject/src/lib.rs:93:20 -a future of `std::task::Poll`, which can be `rt.Pending`, as the future's own `Pending` is at fixtures/reject/src/lib.rs:98:34 -an assignment through a reference to `std::sync::MutexGuard<'_, u8>` at fixtures/reject/src/lib.rs:104:2 -replacing the value behind a reference to `std::sync::MutexGuard<'_, u8>` at fixtures/reject/src/lib.rs:133:2 -replacing the value behind a reference to `std::pin::Pin fn(&'a mut std::task::Context<'b>) -> std::task::Poll>>>` at fixtures/reject/src/lib.rs:112:2 -an assignment through a reference to `std::pin::Pin>>` at fixtures/reject/src/lib.rs:128:2 -replacing the value behind a reference to `std::pin::Pin>` at fixtures/reject/src/lib.rs:120:2 -unsupported call to ` as std::iter::Iterator>::cycle` at fixtures/reject/src/lib.rs:138:11 -a `zip` of `std::iter::Chain, {closure@fixtures/reject/src/lib.rs:184:15: 184:18}>, std::iter::Copied>>`, whose closures std calls one item further through `next` than through `fold` at fixtures/reject/src/lib.rs:184:51 -unsupported call to `std::ops::Range::::contains::` at fixtures/reject/src/lib.rs:192:8 -a `zip` of `std::iter::Map, {closure@fixtures/reject/src/lib.rs:233:15: 233:19}>` and `std::ops::Range`, which std reads by index, of items that drop, which is not supported yet at fixtures/reject/src/lib.rs:233:30 -an assignment through a reference to `std::pin::Pin<&mut Noisy>` at fixtures/reject/src/lib.rs:238:2 -`std::iter::Iterator::filter` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it at fixtures/reject/src/lib.rs:244:16 -`std::iter::Iterator::count` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it at fixtures/reject/src/lib.rs:244:38 -a copy of a closure that changes what it captured at fixtures/reject/src/lib.rs:254:14 -`Iterator::scan` of `Option<()>`, whose `None` is `rt.None`, which is not supported yet at fixtures/reject/src/lib.rs:260:11 -hashing `std::collections::BTreeSet` as a key, which is not supported yet at fixtures/reject/src/lib.rs:265:75 -comparing `std::collections::BTreeSet` as a key, which is not supported yet at fixtures/reject/src/lib.rs:265:75 -`HashMap::contains_key` of `std::collections::HashMap` by `u8`, which is not supported yet at fixtures/reject/src/lib.rs:283:6 -`slice::clone_from_slice` of `Reused`, whose `clone_from` is its own, which is not supported yet at fixtures/reject/src/lib.rs:333:4 -a coercion to `std::sync::Arc<[u8]>` at fixtures/reject/src/lib.rs:338:2 -a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string at fixtures/reject/src/lib.rs:379:2 -a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string at fixtures/reject/src/lib.rs:381:27 -a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string at fixtures/reject/src/lib.rs:380:30 -a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string at fixtures/reject/src/lib.rs:386:2 -`std::borrow::Cow<'_, [u8]>` is not supported yet at fixtures/reject/src/lib.rs:390:18 -unsupported call to ` as std::ops::Deref>::deref` at fixtures/reject/src/lib.rs:391:2 -constructing `std::borrow::Cow<'_, std::sync::Arc>` at fixtures/reject/src/lib.rs:397:53 -hashing `std::vec::Vec` through `Batched`'s own `Hash::hash_slice`, which is not supported yet at fixtures/reject/src/lib.rs:357:16 -passing `{closure@fixtures/reject/src/lib.rs:366:28: 366:35}`, a closure that owns a value that drops, to `Entry::or_insert_with`, which is not supported yet at fixtures/reject/src/lib.rs:366:13 -passing `{closure@fixtures/reject/src/lib.rs:367:25: 367:33}`, a closure that owns a value that drops, to `Iterator::for_each`, which is not supported yet at fixtures/reject/src/lib.rs:367:16 -passing `{closure@fixtures/reject/src/lib.rs:374:13: 374:27}`, which drops, to `str::contains`, which is not supported yet at fixtures/reject/src/lib.rs:374:4 -unsupported call to ` as std::iter::Iterator>::sum::` at fixtures/reject/src/lib.rs:477:17 -unsupported call to ` as std::iter::Iterator>::sum::` at fixtures/reject/src/lib.rs:477:38 -a mutable reference into a `Result`'s payload, passed on or kept at fixtures/reject/src/lib.rs:410:12 -unsupported call to ` as std::cmp::PartialEq>::eq` at fixtures/reject/src/lib.rs:417:2 -`Bytes::from_owner` of `std::sync::Arc<[u8]>`, which would drop with the last clone of what it makes, which is not supported at fixtures/reject/src/lib.rs:422:2 -`BytesMut::capacity`, which reads a capacity that depends on whether the other handles of its storage dropped, which is not supported at fixtures/reject/src/lib.rs:431:6 -`BufMut::put` of `Counted` into a `BytesMut`, which picks the methods it calls by a capacity that depends on whether the other handles of its storage dropped, which is not supported at fixtures/reject/src/lib.rs:437:2 -unsupported call to `core::str::::parse::` at fixtures/reject/src/lib.rs:482:4 -unsupported type `std::net::Ipv4Addr` from another crate at fixtures/reject/src/lib.rs:481:32 -unsupported type `std::net::AddrParseError` from another crate at fixtures/reject/src/lib.rs:481:32 -a coercion to `std::sync::Weak`, which is not supported yet at fixtures/reject/src/lib.rs:498:40 -`dyn Scaled`, a trait object of the generic trait `Scaled`, which is not supported yet at fixtures/reject/src/lib.rs:507:23 -`dyn Scaled`, a trait object of the generic trait `Scaled`, which is not supported yet at fixtures/reject/src/lib.rs:508:4 -a trait object of `[u8; 4]`, which is not supported yet at fixtures/reject/src/lib.rs:524:26 -a coercion to `&Tail`, which is not supported yet at fixtures/reject/src/lib.rs:534: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:564: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:545:2 -a copy of a closure that changes what it captured at fixtures/reject/src/lib.rs:557:14 -a copy of a closure that changes what it captured at fixtures/reject/src/lib.rs:558:14 -an upcast from `dyn Keyed` to `dyn std::any::Any`, which is not supported yet at fixtures/reject/src/lib.rs:582:32 -`std::any::Any::type_id` of `dyn std::any::Any`, which is not supported yet at fixtures/reject/src/lib.rs:588:4 -unsupported call to `std::any::TypeId::of::` at fixtures/reject/src/lib.rs:588:17 -unsupported call to `::eq` at fixtures/reject/src/lib.rs:588: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:605:27 -a pointer's address, which JS has no counterpart of at fixtures/reject/src/lib.rs:610:17 -unsupported call to `std::alloc::Layout::new::` at fixtures/reject/src/lib.rs:615:15 -unsupported call to `std::alloc::alloc` at fixtures/reject/src/lib.rs:617:11 -unsupported call to `std::alloc::dealloc` at fixtures/reject/src/lib.rs:620: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:627:10 -union `Bits`, whose fields overlap in `u32` and `f64`, which JS keeps apart at fixtures/reject/src/lib.rs:638:10 -comparing pointers to `u32`, each a place JS makes of its own at fixtures/reject/src/lib.rs:646: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:658:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:666:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:674:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:683:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:691:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:700:10 -a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:708: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:719: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:729: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:737:15 -a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:746:15 -a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:759: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:770:21 -comparing pointers to `()`, which has no bytes and so no address of its own at fixtures/reject/src/lib.rs:778:2 -a dangling pointer to `Only`, a value of no bytes made of more than structs and tuples at fixtures/reject/src/lib.rs:787:11 -`Buf::copy_to_bytes` of `Blank`, a value JS copies, which is not supported at fixtures/reject/src/lib.rs:811:2 -unsupported call to ` as std::iter::Iterator>::is_sorted` at fixtures/reject/src/lib.rs:816:15 -comparing pointers to `u32` in an atomic, which JS has no address of at fixtures/reject/src/lib.rs:827:15 -a constant of type `&u32`, a pointer into memory translation can't name at fixtures/reject/src/lib.rs:828:3 -passing `Spent`, which drops, to `Vec::drain`, which is not supported yet at fixtures/reject/src/lib.rs:853:4 -passing `Spent`, which drops, to `VecDeque::drain`, which is not supported yet at fixtures/reject/src/lib.rs:853:29 -passing `Spent`, which drops, to `BTreeMap::range`, which is not supported yet at fixtures/reject/src/lib.rs:853:56 -passing `{closure@fixtures/reject/src/lib.rs:859:11: 859:19}`, which drops, to `String::retain`, which is not supported yet at fixtures/reject/src/lib.rs:859:4 -`std::collections::HashMap::::into_keys` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it at fixtures/reject/src/lib.rs:891:6 -unsupported call to ` as std::cmp::PartialEq>>::eq` at fixtures/reject/src/lib.rs:896:27 -unsupported call to ` as std::cmp::PartialEq<&[Right]>>::eq` at fixtures/reject/src/lib.rs:911:27 -a raw pointer to `(u32, u32)` in `Plain`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:926: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:952: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:972: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:1008: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:1009: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:1010: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:1022: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:1023:19 -`std::iter::Extend::extend` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it at fixtures/reject/src/lib.rs:1030:6 -overriding `Iterator::fold`, which std's adaptors call in place of `next` or beside it at fixtures/reject/src/lib.rs:151:2 -an iterator of the crate implementing `DoubleEndedIterator`, which is not supported yet at fixtures/reject/src/lib.rs:171:1 -overriding `Iterator::size_hint`, which std's adaptors call in place of `next` or beside it at fixtures/reject/src/lib.rs:205:2 -an iterator of the crate implementing `FusedIterator`, which is not supported yet at fixtures/reject/src/lib.rs:225:1 -`Hasher::write`, which is not supported yet at fixtures/reject/src/lib.rs:291:9 +a zero-sized constant of type `{async closure@fixtures/reject/src/lib.rs:54:10: 54:18}` at fixtures/reject/src/lib.rs:55:2 +`Pointer` formatting, as in `{:p}`, is not supported at fixtures/reject/src/lib.rs:61:11 +`fmt::Arguments` with a placeholder, or not made in place, written to `Sink`'s own `fmt::Write`, which is not supported yet: std splits what a placeholder writes into `write_str` calls the runtime does not make at fixtures/reject/src/lib.rs:67:10 +a mutable static, which any code may write at fixtures/reject/src/lib.rs:73:11 +`Poll>>>` is not supported: its `Pending` and `Ready` would both be `rt.OuterPending` at fixtures/reject/src/lib.rs:84:20 +a future of `std::task::Poll`, which can be `rt.Pending`, as the future's own `Pending` is at fixtures/reject/src/lib.rs:89:34 +an assignment through a reference to `std::sync::MutexGuard<'_, u8>` at fixtures/reject/src/lib.rs:95:2 +replacing the value behind a reference to `std::sync::MutexGuard<'_, u8>` at fixtures/reject/src/lib.rs:124:2 +replacing the value behind a reference to `std::pin::Pin fn(&'a mut std::task::Context<'b>) -> std::task::Poll>>>` at fixtures/reject/src/lib.rs:103:2 +an assignment through a reference to `std::pin::Pin>>` at fixtures/reject/src/lib.rs:119:2 +replacing the value behind a reference to `std::pin::Pin>` at fixtures/reject/src/lib.rs:111:2 +unsupported call to ` as std::iter::Iterator>::cycle` at fixtures/reject/src/lib.rs:129:11 +a `zip` of `std::iter::Chain, {closure@fixtures/reject/src/lib.rs:175:15: 175:18}>, std::iter::Copied>>`, whose closures std calls one item further through `next` than through `fold` at fixtures/reject/src/lib.rs:175:51 +unsupported call to `std::ops::Range::::contains::` at fixtures/reject/src/lib.rs:183:8 +a `zip` of `std::iter::Map, {closure@fixtures/reject/src/lib.rs:224:15: 224:19}>` and `std::ops::Range`, which std reads by index, of items that drop, which is not supported yet at fixtures/reject/src/lib.rs:224:30 +an assignment through a reference to `std::pin::Pin<&mut Noisy>` at fixtures/reject/src/lib.rs:229:2 +`std::iter::Iterator::filter` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it at fixtures/reject/src/lib.rs:235:16 +`std::iter::Iterator::count` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it at fixtures/reject/src/lib.rs:235:38 +a copy of a closure that changes what it captured at fixtures/reject/src/lib.rs:245:14 +`Iterator::scan` of `Option<()>`, whose `None` is `rt.None`, which is not supported yet at fixtures/reject/src/lib.rs:251:11 +hashing `std::collections::BTreeSet` as a key, which is not supported yet at fixtures/reject/src/lib.rs:256:75 +comparing `std::collections::BTreeSet` as a key, which is not supported yet at fixtures/reject/src/lib.rs:256:75 +`HashMap::contains_key` of `std::collections::HashMap` by `u8`, which is not supported yet at fixtures/reject/src/lib.rs:274:6 +`slice::clone_from_slice` of `Reused`, whose `clone_from` is its own, which is not supported yet at fixtures/reject/src/lib.rs:324:4 +a coercion to `std::sync::Arc<[u8]>` at fixtures/reject/src/lib.rs:329:2 +a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string at fixtures/reject/src/lib.rs:369:2 +a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string at fixtures/reject/src/lib.rs:371:27 +a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string at fixtures/reject/src/lib.rs:370:30 +a variant of `std::borrow::Cow<'_, str>`, which is not supported: either is the same JS string at fixtures/reject/src/lib.rs:376:2 +`std::borrow::Cow<'_, [u8]>` is not supported yet at fixtures/reject/src/lib.rs:380:18 +unsupported call to ` as std::ops::Deref>::deref` at fixtures/reject/src/lib.rs:381:2 +constructing `std::borrow::Cow<'_, std::sync::Arc>` at fixtures/reject/src/lib.rs:387:53 +hashing `std::vec::Vec` through `Batched`'s own `Hash::hash_slice`, which is not supported yet at fixtures/reject/src/lib.rs:348:16 +passing `{closure@fixtures/reject/src/lib.rs:357:28: 357:35}`, a closure that owns a value that drops, to `Entry::or_insert_with`, which is not supported yet at fixtures/reject/src/lib.rs:357:13 +passing `{closure@fixtures/reject/src/lib.rs:364:13: 364:27}`, which drops, to `str::contains`, which is not supported yet at fixtures/reject/src/lib.rs:364:4 +unsupported call to ` as std::iter::Iterator>::sum::` at fixtures/reject/src/lib.rs:467:17 +unsupported call to ` as std::iter::Iterator>::sum::` at fixtures/reject/src/lib.rs:467:38 +a mutable reference into a `Result`'s payload, passed on or kept at fixtures/reject/src/lib.rs:400:12 +unsupported call to ` as std::cmp::PartialEq>::eq` at fixtures/reject/src/lib.rs:407:2 +`Bytes::from_owner` of `std::sync::Arc<[u8]>`, which would drop with the last clone of what it makes, which is not supported at fixtures/reject/src/lib.rs:412:2 +`BytesMut::capacity`, which reads a capacity that depends on whether the other handles of its storage dropped, which is not supported at fixtures/reject/src/lib.rs:421:6 +`BufMut::put` of `Counted` into a `BytesMut`, which picks the methods it calls by a capacity that depends on whether the other handles of its storage dropped, which is not supported at fixtures/reject/src/lib.rs:427:2 +unsupported call to `core::str::::parse::` at fixtures/reject/src/lib.rs:472:4 +unsupported type `std::net::Ipv4Addr` from another crate at fixtures/reject/src/lib.rs:471:32 +unsupported type `std::net::AddrParseError` from another crate at fixtures/reject/src/lib.rs:471:32 +a coercion to `std::sync::Weak`, which is not supported yet at fixtures/reject/src/lib.rs:488:40 +`dyn Scaled`, a trait object of the generic trait `Scaled`, which is not supported yet at fixtures/reject/src/lib.rs:497:23 +`dyn Scaled`, a trait object of the generic trait `Scaled`, which is not supported yet at fixtures/reject/src/lib.rs:498:4 +a trait object of `[u8; 4]`, which is not supported yet at fixtures/reject/src/lib.rs:514:26 +a coercion to `&Tail`, which is not supported yet at fixtures/reject/src/lib.rs:524: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:554: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:535:2 +a copy of a closure that changes what it captured at fixtures/reject/src/lib.rs:547:14 +a copy of a closure that changes what it captured at fixtures/reject/src/lib.rs:548:14 +an upcast from `dyn Keyed` to `dyn std::any::Any`, which is not supported yet at fixtures/reject/src/lib.rs:572:32 +`std::any::Any::type_id` of `dyn std::any::Any`, which is not supported yet at fixtures/reject/src/lib.rs:578:4 +unsupported call to `std::any::TypeId::of::` at fixtures/reject/src/lib.rs:578:17 +unsupported call to `::eq` at fixtures/reject/src/lib.rs:578: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:595:27 +a pointer's address, which JS has no counterpart of at fixtures/reject/src/lib.rs:600:17 +unsupported call to `std::alloc::Layout::new::` at fixtures/reject/src/lib.rs:605:15 +unsupported call to `std::alloc::alloc` at fixtures/reject/src/lib.rs:607:11 +unsupported call to `std::alloc::dealloc` at fixtures/reject/src/lib.rs:610: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:617:10 +union `Bits`, whose fields overlap in `u32` and `f64`, which JS keeps apart at fixtures/reject/src/lib.rs:628:10 +comparing pointers to `u32`, each a place JS makes of its own at fixtures/reject/src/lib.rs:636: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:648:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:656:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:664:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:673:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:681:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:690:10 +a raw pointer to `(u32, u32)` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:698: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:709: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:719: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:727:15 +a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:736:15 +a raw pointer to `std::cell::UnsafeCell` in a variable assigned again while it may point there at fixtures/reject/src/lib.rs:749: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:760:21 +comparing pointers to `()`, which has no bytes and so no address of its own at fixtures/reject/src/lib.rs:768:2 +a dangling pointer to `Only`, a value of no bytes made of more than structs and tuples at fixtures/reject/src/lib.rs:777:11 +`Buf::copy_to_bytes` of `Blank`, a value JS copies, which is not supported at fixtures/reject/src/lib.rs:801:2 +unsupported call to ` as std::iter::Iterator>::is_sorted` at fixtures/reject/src/lib.rs:806:15 +comparing pointers to `u32` in an atomic, which JS has no address of at fixtures/reject/src/lib.rs:817:15 +a constant of type `&u32`, a pointer into memory translation can't name at fixtures/reject/src/lib.rs:818:3 +passing `{closure@fixtures/reject/src/lib.rs:824:11: 824:19}`, which drops, to `String::retain`, which is not supported yet at fixtures/reject/src/lib.rs:824:4 +`std::collections::HashMap::::into_keys` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it at fixtures/reject/src/lib.rs:856:6 +unsupported call to ` as std::cmp::PartialEq>>::eq` at fixtures/reject/src/lib.rs:861:27 +unsupported call to ` as std::cmp::PartialEq<&[Right]>>::eq` at fixtures/reject/src/lib.rs:876:27 +a raw pointer to `(u32, u32)` in `Plain`, which the crate may put another object in place of at fixtures/reject/src/lib.rs:891: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:917: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:937: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:973: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:974: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:975: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:987: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:988:19 +`std::iter::Extend::extend` of a reference to an array of bytes it is generic over, which its mapping would take as the array, not as a slice of it at fixtures/reject/src/lib.rs:995:6 +overriding `Iterator::fold`, which std's adaptors call in place of `next` or beside it at fixtures/reject/src/lib.rs:142:2 +an iterator of the crate implementing `DoubleEndedIterator`, which is not supported yet at fixtures/reject/src/lib.rs:162:1 +overriding `Iterator::size_hint`, which std's adaptors call in place of `next` or beside it at fixtures/reject/src/lib.rs:196:2 +an iterator of the crate implementing `FusedIterator`, which is not supported yet at fixtures/reject/src/lib.rs:216:1 +`Hasher::write`, which is not supported yet at fixtures/reject/src/lib.rs:282:9 diff --git a/ts/fixtures/reject/src/lib.rs b/ts/fixtures/reject/src/lib.rs index e8faf1f12..a83a0e645 100644 --- a/ts/fixtures/reject/src/lib.rs +++ b/ts/fixtures/reject/src/lib.rs @@ -49,15 +49,6 @@ impl Drop for Noisy { fn drop(&mut self) {} } -/// std's `fold` of `into_keys` drops each value after its key, where `next` drops it first. -pub fn keys(m: std::collections::HashMap) -> u8 { - let mut sum = 0; - for k in m.into_keys() { - sum += k; - } - sum -} - /// An async closure is a coroutine closure, not an async body. pub fn async_closure() -> u8 { let f = async || 1u8; @@ -359,12 +350,11 @@ pub fn batched(v: Vec) -> usize { set.len() } -/// Closures that own a value that drops, which `or_insert_with` would call but never drop -/// if the key is there, and which `for_each` drops before the items it doesn't reach. -pub fn called_closure(v: Vec, m: &mut std::collections::HashMap) { - let (a, b) = (Noisy(1), Noisy(2)); +/// A closure that owns a value that drops, which `or_insert_with` would call but never drop +/// if the key is there. +pub fn called_closure(m: &mut std::collections::HashMap) { + let b = Noisy(2); m.entry(1).or_insert_with(move || b); - v.into_iter().for_each(move |x| assert!(x.0 != (&a).0)); } /// A closure that owns a value that drops, given as a `Pattern`, which `contains` would @@ -828,31 +818,6 @@ pub fn pointer_statics(p: *mut u32) -> u32 { *NAMED } -/// A range that drops, which std drops once it has read the range's bounds. -pub struct Spent; - -impl Drop for Spent { - fn drop(&mut self) {} -} - -impl std::ops::RangeBounds for Spent { - fn start_bound(&self) -> std::ops::Bound<&usize> { - std::ops::Bound::Unbounded - } - - fn end_bound(&self) -> std::ops::Bound<&usize> { - std::ops::Bound::Unbounded - } -} - -pub fn spent_range( - v: &mut Vec, - q: &mut std::collections::VecDeque, - map: &std::collections::BTreeMap, -) -> usize { - v.drain(Spent).count() + q.drain(Spent).count() + map.range(Spent).count() -} - /// A closure that owns a value that drops, which `String::retain` would call but never drop. pub fn string_retained(s: &mut String) { let n = Noisy(1); diff --git a/ts/fixtures/reject/ts.toml b/ts/fixtures/reject/ts.toml index b142d0f83..4031ab9ac 100644 --- a/ts/fixtures/reject/ts.toml +++ b/ts/fixtures/reject/ts.toml @@ -8,7 +8,6 @@ roots = [ "generic_unit", "collected", "Noisy", - "keys", "async_closure", "pointer", "written", @@ -88,7 +87,6 @@ roots = [ "blank_bytes", "places_sorted", "pointer_statics", - "spent_range", "bound_ranges", "string_retained", "byte_key", diff --git a/ts/fixtures/task/expected/drops.ts b/ts/fixtures/task/expected/drops.ts index edb535293..d3bf64243 100644 --- a/ts/fixtures/task/expected/drops.ts +++ b/ts/fixtures/task/expected/drops.ts @@ -7,6 +7,7 @@ import { isSomeAnd$17cacqw, unwrapOr$0v6ziq2, unwrapOr$1tvry1i, map$0lq7mno, map import { ok$0whpnxs, err$0fnxqh3, asRef$01pd5k9, mapOr$1hlk3iq, mapOrElse$196aho3, andThen$0r804hk, unwrapOr$13024tg } from "./core/result.ts"; import { scoped, discarded, iterated } from "./drops/closures.ts"; import { folded as folds_folded, rfolded as folds_rfolded } from "./drops/folds.ts"; +import { inside as inside_inside } from "./drops/inside.ts"; import { looped, collected, drained, extended } from "./drops/iters.ts"; import { boxed, shared, anys, fns } from "./drops/objects.ts"; import { run as once_run } from "./drops/once.ts"; @@ -1262,6 +1263,15 @@ export function rfolded(log: Log.Log, id: rt.u32, arg: rt.u8): void { folds_rfolded(log, id, arg); } +/** + * Run scenario `arg % 10` of where std drops values inside its iterators and formatting. + * Three panic, each with std's message: in a `for_each`, a drain past the end, and a + * range that panics as `String`'s drop it. + */ +export function inside(log: Log.Log, id: rt.u32, arg: rt.u8): void { + inside_inside(log, id, arg); +} + /** * Run scenario `arg % 9` of what a `Vec`'s edits, its, a tuple's, and a box's `clone`, * `Ord`'s defaults, and an iterator's `max` and `min` drop. One ends in an index past the diff --git a/ts/fixtures/task/expected/drops/closures.ts b/ts/fixtures/task/expected/drops/closures.ts index 3c1383427..b64ab0c00 100644 --- a/ts/fixtures/task/expected/drops/closures.ts +++ b/ts/fixtures/task/expected/drops/closures.ts @@ -606,14 +606,13 @@ export function iterated(log: Log.Log, id: rt.u32): void { const o: Guard.Guard = guard(28); const _369: rt.Iter = rt.iterSlice([1, 2]); const captured17 = o; - const _372: (a0: rt.u32) => undefined = rt.closure((_214: rt.u32): undefined => { + rt.iterForEach(_369, rt.closure((_214: rt.u32): undefined => { const part7 = rt.u32Add(_214, Guard.id(captured17)); const args32: rt.Fmt[] = [(f: rt.Formatter) => rt.u32Display(part7, f)]; Log.note(log, rt.fmtFormat(["each ", args32[0]])); }, (): void => { captured17[Symbol.dispose](); - }); - rt.dropAfter(_372, () => rt.iterForEach(_369, _372)); + }), undefined, true); const args20: rt.Fmt[] = [(f: rt.Formatter) => rt.u32Display(sum, f)]; Log.note(log, rt.fmtFormat(["sum ", args20[0]])); const _386: [Guard.Guard, Guard.Guard, Guard.Guard] = [guard(44), guard(45), guard(46)]; diff --git a/ts/fixtures/task/expected/drops/inside.Bomb.ts b/ts/fixtures/task/expected/drops/inside.Bomb.ts new file mode 100644 index 000000000..cb5fa7a00 --- /dev/null +++ b/ts/fixtures/task/expected/drops/inside.Bomb.ts @@ -0,0 +1,36 @@ +// Generated by rust2-ts. Do not edit. + +import * as rt from "../rt.ts"; + +/** A range whose drop panics, which shows where std drops it. */ +export class Bomb { + _0: rt.usize; + _1: rt.usize; + + constructor(_0: rt.usize, _1: rt.usize) { + this._0 = _0; + this._1 = _1; + } + + [Symbol.dispose](): void { + drop$Drop(this); + } +} + +export function drop$Drop(self: Bomb): void { + const arg = self._0; + const _8: rt.Fmt = (f: rt.Formatter) => rt.usizeDisplay(arg, f); + const arg2 = self._1; + const args2: rt.Fmt[] = [_8, (f: rt.Formatter) => rt.usizeDisplay(arg2, f)]; + rt.panicFmt(["range ", args2[0], "..", args2[1], " dropped"]); +} + +export function startBound$RangeBounds_usize(self: Bomb): rt.RangeBound { + return { tag: "Included", _0: self._0 } as rt.RangeBound; +} + +export function endBound$RangeBounds_usize(self: Bomb): rt.RangeBound { + return { tag: "Excluded", _0: self._1 } as rt.RangeBound; +} + +//# sourceMappingURL=inside.Bomb.ts.map diff --git a/ts/fixtures/task/expected/drops/inside.Listed.ts b/ts/fixtures/task/expected/drops/inside.Listed.ts new file mode 100644 index 000000000..55ac2635d --- /dev/null +++ b/ts/fixtures/task/expected/drops/inside.Listed.ts @@ -0,0 +1,47 @@ +// Generated by rust2-ts. Do not edit. + +import * as rt from "../rt.ts"; +import * as Shown from "../drops/inside.Shown.ts"; +import * as Log from "../log.Log.ts"; +import * as Guard from "../model.Guard.ts"; + +/** Writes the guards a step makes from `0..n` by `entries` of each kind of iterable. */ +export class Listed { + _0: rt.u32; + _1: Log.Log; + _2: rt.u8; + + constructor(_0: rt.u32, _1: Log.Log, _2: rt.u8) { + this._0 = _0; + this._1 = _1; + this._2 = _2; + } + + [Symbol.dispose](): void { + this._1[Symbol.dispose](); + } +} + +export function fmt$Debug(self: Listed, f: rt.Formatter): rt.Result { + const guard: (a0: rt.u8) => Shown.Shown = (n: rt.u8): Shown.Shown => { + return new Shown.Shown(Guard.new(rt.u32Add(self._0, n as rt.u32), Log.clone$Clone(self._1))); + }; + const list: rt.DebugList = rt.fmtDebugList(f); + const _11: rt.Iter = rt.iterMap(new rt.Range(0, self._2), guard); + rt.debugListEntries(list, _11, (value: Shown.Shown, f: rt.Formatter) => Shown.fmt$Debug(value, f), rt.drop); + const _16: Shown.Shown[] = rt.iterToArray(rt.iterMap(new rt.Range(10, rt.u8Add(10, self._2)), guard), undefined, 8, true); + rt.debugListEntries(list, _16, (value: Shown.Shown, f: rt.Formatter) => Shown.fmt$Debug(value, f), rt.drop); + const _24: rt.Iter = rt.iterMap(rt.iterSlice(rt.iterToArray(rt.iterMap(new rt.Range(20, rt.u8Add(20, self._2)), guard), undefined, 8, true), rt.drop), (g: Shown.Shown): rt.u32 => { + const _03: rt.u32 = Guard.id(g._0); + g[Symbol.dispose](); + return _03; + }); + rt.debugListEntries(list, _24, rt.u32Debug); + const kept: Shown.Shown[] = rt.iterToArray(rt.iterMap(new rt.Range(30, rt.u8Add(30, self._2)), guard), undefined, 8, true); + rt.debugListEntries(list, kept, (value: Shown.Shown, f: rt.Formatter) => Shown.fmt$Debug(value, f)); + const _0: rt.Result = rt.debugListFinish(list); + rt.dropAll(kept); + return _0; +} + +//# sourceMappingURL=inside.Listed.ts.map diff --git a/ts/fixtures/task/expected/drops/inside.Shown.ts b/ts/fixtures/task/expected/drops/inside.Shown.ts new file mode 100644 index 000000000..92018f043 --- /dev/null +++ b/ts/fixtures/task/expected/drops/inside.Shown.ts @@ -0,0 +1,26 @@ +// Generated by rust2-ts. Do not edit. + +import * as rt from "../rt.ts"; +import * as Guard from "../model.Guard.ts"; + +/** A guard written as its id. */ +export class Shown { + _0: Guard.Guard; + + constructor(_0: Guard.Guard) { + this._0 = _0; + } + + [Symbol.dispose](): void { + this._0[Symbol.dispose](); + } +} + +export function fmt$Debug(self: Shown, f: rt.Formatter): rt.Result { + Guard.note(self._0, "shown"); + const part = Guard.id(self._0); + const args2: rt.Fmt[] = [(f: rt.Formatter) => rt.u32Display(part, f)]; + return rt.fmtWriteFmt(f, [args2[0]]); +} + +//# sourceMappingURL=inside.Shown.ts.map diff --git a/ts/fixtures/task/expected/drops/inside.Spent.ts b/ts/fixtures/task/expected/drops/inside.Spent.ts new file mode 100644 index 000000000..608f07cf5 --- /dev/null +++ b/ts/fixtures/task/expected/drops/inside.Spent.ts @@ -0,0 +1,33 @@ +// Generated by rust2-ts. Do not edit. + +import * as rt from "../rt.ts"; +import * as Guard from "../model.Guard.ts"; + +/** A `RangeBounds` that logs reading its bounds and its drop. */ +export class Spent { + _0: Guard.Guard; + _1: rt.usize; + _2: rt.usize; + + constructor(_0: Guard.Guard, _1: rt.usize, _2: rt.usize) { + this._0 = _0; + this._1 = _1; + this._2 = _2; + } + + [Symbol.dispose](): void { + this._0[Symbol.dispose](); + } +} + +export function startBound$RangeBounds_usize(self: Spent): rt.RangeBound { + Guard.note(self._0, "start"); + return { tag: "Included", _0: self._1 } as rt.RangeBound; +} + +export function endBound$RangeBounds_usize(self: Spent): rt.RangeBound { + Guard.note(self._0, "end"); + return { tag: "Excluded", _0: self._2 } as rt.RangeBound; +} + +//# sourceMappingURL=inside.Spent.ts.map diff --git a/ts/fixtures/task/expected/drops/inside.ts b/ts/fixtures/task/expected/drops/inside.ts new file mode 100644 index 000000000..32b5d7db1 --- /dev/null +++ b/ts/fixtures/task/expected/drops/inside.ts @@ -0,0 +1,363 @@ +// Generated by rust2-ts. Do not edit. + +import * as rt from "../rt.ts"; +import { drop$Key_Guard, drop$RangeInclusive_Key, drop$Range_Guard, drop$Range_Key } from "../lib.ts"; +import { map$1raha9y, map$0782hf5 } from "../core/option.ts"; +import * as Bomb from "../drops/inside.Bomb.ts"; +import * as Listed from "../drops/inside.Listed.ts"; +import * as Spent from "../drops/inside.Spent.ts"; +import * as Key from "../drops.Key.ts"; +import * as Log from "../log.Log.ts"; +import * as Guard from "../model.Guard.ts"; + +/** Run scenario `arg % 10`. */ +export function inside(log: Log.Log, id: rt.u32, arg: rt.u8): void { + let _261!: rt.usize; + let _328!: rt.u32; + let f!: Guard.Guard; + const guard: (a0: rt.u32) => Guard.Guard = (n5: rt.u32): Guard.Guard => { + return Guard.new(rt.u32Add(id, n5), Log.clone$Clone(log)); + }; + const key: (a0: rt.u32) => Key.Key = (n6: rt.u32): Key.Key => { + return Key.new(rt.u32Add(id, n6), Log.clone$Clone(log)); + }; + const _8: rt.u8 = rt.u8Rem(arg, 10); + if (_8 === 0) { + const iter: rt.Iter = rt.iterSlice(Uint8Array.of(0, 1, 3)); + while (true) { + const _13: rt.u8 | rt.Done = iter.next(); + if (_13 === rt.DONE) { + break; + } + const n: rt.u8 = _13; + const _24: Log.Log = Log.clone$Clone(log); + const _23: Listed.Listed = new Listed.Listed(id, _24, n); + const args2: rt.Fmt[] = [(f: rt.Formatter) => Listed.fmt$Debug(_23, f)]; + const _19: string = rt.fmtFormat(["listed ", args2[0]]); + _23[Symbol.dispose](); + Log.note(log, _19); + } + const _36: Log.Log = Log.clone$Clone(log); + const _35: Listed.Listed = new Listed.Listed(id, _36, 2); + const args4: rt.Fmt[] = [(f: rt.Formatter) => Listed.fmt$Debug(_35, f)]; + const _31: string = rt.fmtFormat(["pretty ", rt.fmtSpec({ alternate: true }, args4[0])]); + _35[Symbol.dispose](); + Log.note(log, _31); + } else if (_8 === 1) { + const _42: rt.Range = new rt.Range(guard(1), guard(2)); + rt.dropAll([_42.start, _42.end]); + const _50: rt.RangeInclusive = new rt.RangeInclusive(guard(3), guard(4)); + rt.dropAll([_50.lo, _50.hi]); + (({ start: guard(5) }.start[Symbol.dispose]())); + (({ end: guard(6) }.end[Symbol.dispose]())); + (({ end: guard(7), inclusive: true }.end[Symbol.dispose]())); + const r: rt.Range = new rt.Range(guard(8), guard(9)); + const start: Guard.Guard = r.start; + const part20 = Guard.id(start); + const args6: rt.Fmt[] = [(f: rt.Formatter) => rt.u32Display(part20, f)]; + Log.note(log, rt.fmtFormat(["moved ", args6[0]])); + const ranges: rt.Range[] = [new rt.Range(guard(10), guard(11)), new rt.Range(guard(12), guard(13))]; + const part21 = ranges.length; + const args8: rt.Fmt[] = [(f: rt.Formatter) => rt.usizeDisplay(part21, f)]; + Log.note(log, rt.fmtFormat(["ranges ", args8[0]])); + rt.dropAll(ranges, drop$Range_Guard); + start[Symbol.dispose](); + r.end[Symbol.dispose](); + } else if (_8 === 2) { + const v: Guard.Guard[] = rt.iterToArray(rt.iterMap(new rt.Range(1, 6), guard), undefined, 8, true); + const taken: Guard.Guard[] = rt.iterToArray(rt.dropAfter(new Spent.Spent(guard(10), 1, 3), (range12) => rt.vecDrain(v, rt.boundsOf(range12, Spent.startBound$RangeBounds_usize, Spent.endBound$RangeBounds_usize), rt.drop), rt.drop), "fold", 8, true); + const _136: rt.usize = taken.length; + const _139: rt.usize = v.length; + const args10: rt.Fmt[] = [(f: rt.Formatter) => rt.usizeDisplay(_136, f), (f: rt.Formatter) => rt.usizeDisplay(_139, f)]; + Log.note(log, rt.fmtFormat(["drained ", args10[0], " ", args10[1]])); + const _147: rt.Iter = rt.iterMap(new rt.Range(6, 9), guard); + const q: rt.VecDeque = rt.dequeExtend(rt.dequeNew() as rt.VecDeque, rt.iterSlice(rt.iterToArray(_147, undefined, 8, true))); + const it: rt.Iter = rt.dropAfter(new Spent.Spent(guard(11), 0, 2), (range13) => rt.dequeDrain(q, rt.boundsOf(range13, Spent.startBound$RangeBounds_usize, Spent.endBound$RangeBounds_usize), rt.drop), rt.drop); + const part17 = map$1raha9y(rt.iterToOption(it.next()), (g12: Guard.Guard): rt.u32 => { + const _012: rt.u32 = Guard.id(g12); + g12[Symbol.dispose](); + return _012; + }); + const args12: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtOption(part17, f, rt.u32Debug)]; + Log.note(log, rt.fmtFormat(["deque ", args12[0]])); + rt.drop(it); + let s: string = "abcdef"; + const _180: Spent.Spent = new Spent.Spent(guard(12), 1, 3); + const s4 = rt.place(() => s, (value2) => s = value2); + const part18 = rt.stringExtendChars("", rt.stringDrain(s4, rt.dropAfter(_180, (range14) => rt.boundsChecked(rt.boundsOf(range14, Spent.startBound$RangeBounds_usize, Spent.endBound$RangeBounds_usize), rt.stringLen(s4.v)), rt.drop)), true); + const args14: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtPad(f, part18)]; + Log.note(log, rt.fmtFormat(["text ", args14[0]])); + const _190: Spent.Spent = new Spent.Spent(guard(13), 0, 1); + s = rt.stringReplaceRange(s, rt.dropAfter(_190, (range15) => rt.boundsChecked(rt.boundsOf(range15, Spent.startBound$RangeBounds_usize, Spent.endBound$RangeBounds_usize), rt.stringLen(s)), rt.drop), "xy"); + const _197: Spent.Spent = new Spent.Spent(guard(14), 2, 4); + s = rt.stringExtendFromWithin(s, rt.dropAfter(_197, (range16) => rt.boundsChecked(rt.boundsOf(range16, Spent.startBound$RangeBounds_usize, Spent.endBound$RangeBounds_usize), rt.stringLen(s)), rt.drop)); + const bytes: Uint8Array = Uint8Array.of(1, 2, 3, 4); + const _203: rt.ByteSlice = rt.byteSliceFrom(bytes); + const bounds = rt.dropAfter(new Spent.Spent(guard(15), 0, 2), (range17) => rt.boundsRange(rt.boundsOf(range17, Spent.startBound$RangeBounds_usize, Spent.endBound$RangeBounds_usize), _203.length), rt.drop); + rt.byteSliceCopyWithin(_203, bounds[0], bounds[1], 2); + [s, rt.byteSliceFrom(bytes)] as [string, rt.ByteSlice]; + const _217: rt.Fmt = (f: rt.Formatter) => rt.fmtPad(f, s); + const arg2 = rt.byteSliceFrom(bytes); + const args16: rt.Fmt[] = [_217, (f: rt.Formatter) => rt.fmtList(rt.byteSliceView(arg2), f, rt.u8Debug)]; + Log.note(log, rt.fmtFormat(["edited ", args16[0], " ", args16[1]])); + const none: Guard.Guard[] = rt.iterToArray(rt.dropAfter(new Spent.Spent(guard(16), 1, 1), (range18) => rt.vecDrain(v, rt.boundsOf(range18, Spent.startBound$RangeBounds_usize, Spent.endBound$RangeBounds_usize), rt.drop), rt.drop), "fold", 8, true); + const part19 = none.length; + const args18: rt.Fmt[] = [(f: rt.Formatter) => rt.usizeDisplay(part19, f)]; + Log.note(log, rt.fmtFormat(["none ", args18[0]])); + rt.dropAll(none); + rt.dequeDrop(q, rt.drop); + rt.dropAll(taken); + rt.dropAll(v); + } else if (_8 === 3) { + const map: rt.BTreeMap = rt.btreeNew(rt.cmp) as rt.BTreeMap; + const part13 = rt.iterCount(rt.dropAfter(new Spent.Spent(guard(1), 0, 1), (range8) => rt.btreeRange(map, rt.boundsOf(range8, Spent.startBound$RangeBounds_usize, Spent.endBound$RangeBounds_usize)), rt.drop)); + const args20: rt.Fmt[] = [(f: rt.Formatter) => rt.usizeDisplay(part13, f)]; + Log.note(log, rt.fmtFormat(["empty ", args20[0]])); + let iterStart: rt.usize = 0; + const iterEnd: rt.usize = 4; + while ((_261 = iterStart++) < iterEnd) { + const n2: rt.usize = _261; + const _267: Guard.Guard = guard(rt.u32Add(10, n2 as rt.u32)); + rt.drop(rt.btreeInsert(map, n2, _267)); + } + const part15 = rt.iterCount(rt.dropAfter(new Spent.Spent(guard(2), 1, 3), (range9) => rt.btreeRange(map, rt.boundsOf(range9, Spent.startBound$RangeBounds_usize, Spent.endBound$RangeBounds_usize)), rt.drop)); + const args22: rt.Fmt[] = [(f: rt.Formatter) => rt.usizeDisplay(part15, f)]; + Log.note(log, rt.fmtFormat(["map ", args22[0]])); + const iter3: rt.Iter<[rt.usize, Guard.Guard]> = rt.dropAfter(new Spent.Spent(guard(3), 2, 9), (range10) => rt.btreeRange(map, rt.boundsOf(range10, Spent.startBound$RangeBounds_usize, Spent.endBound$RangeBounds_usize)), rt.drop); + while (true) { + const _298: [rt.usize, Guard.Guard] | rt.Done = iter3.next(); + if (_298 === rt.DONE) { + break; + } + Guard.note(_298[1], "ranged"); + } + const set: rt.BTreeSet = rt.btreeExtendKeys(rt.btreeNew(rt.cmp) as rt.BTreeSet, new rt.Range(0, 5), true, undefined, undefined, 4, true); + const part16 = rt.iterCount(rt.dropAfter(new Spent.Spent(guard(4), 3, 5), (range11) => rt.btreeRangeKeys(set, rt.boundsOf(range11, Spent.startBound$RangeBounds_usize, Spent.endBound$RangeBounds_usize)), rt.drop)); + const args24: rt.Fmt[] = [(f: rt.Formatter) => rt.usizeDisplay(part16, f)]; + Log.note(log, rt.fmtFormat(["set ", args24[0]])); + rt.btreeDrop(map, undefined, rt.drop); + } else if (_8 === 4) { + const map2: rt.BTreeMap = rt.btreeNew(Key.cmp$Ord) as rt.BTreeMap; + let iterStart2: rt.u32 = 1; + const iterEnd2: rt.u32 = 5; + while ((_328 = iterStart2++) < iterEnd2) { + const n3: rt.u32 = _328; + const _334: Key.Key = key(n3); + rt.btreeInsert(map2, _334, n3, rt.drop); + } + const part12 = rt.iterToArray(rt.iterMap(rt.dropAfter(new rt.Range(key(2), key(4)), (range5) => rt.btreeRange(map2, range5, Key.eq$PartialEq, rt.cmpGt(Key.partialCmp$PartialOrd)), drop$Range_Key), (_2: [Key.Key, rt.u32]): rt.u32 => { + return _2[1]; + }), "next", 4); + const args26: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtList(part12, f, rt.u32Debug)]; + Log.note(log, rt.fmtFormat(["keys ", args26[0]])); + const found2: rt.usize = rt.iterCount(rt.dropAfter(new rt.RangeInclusive(key(3), key(9)), (range6) => rt.btreeRange(map2, range6, Key.eq$PartialEq, rt.cmpGt(Key.partialCmp$PartialOrd)), drop$RangeInclusive_Key)); + const _371: rt.BTreeMap = rt.btreeNew(Key.cmp$Ord) as rt.BTreeMap; + const none2: rt.usize = rt.iterCount(rt.dropAfter(new rt.Range(key(5), key(6)), (range7) => rt.btreeRange(_371, range7, Key.eq$PartialEq, rt.cmpGt(Key.partialCmp$PartialOrd)), drop$Range_Key)); + rt.btreeDrop(_371, rt.drop); + const args28: rt.Fmt[] = [(f: rt.Formatter) => rt.usizeDisplay(found2, f), (f: rt.Formatter) => rt.usizeDisplay(none2, f)]; + Log.note(log, rt.fmtFormat(["keys ", args28[0], " ", args28[1]])); + rt.btreeDrop(map2, rt.drop); + } else if (_8 === 5) { + const map3: (a0: rt.u32) => rt.HashMap = (n9: rt.u32): rt.HashMap => { + const _318: [Key.Key, Guard.Guard][] = [[key(n9), guard(n9)] as [Key.Key, Guard.Guard]]; + return rt.hashExtend(rt.hashNew(rt.hashing(Key.hash$Hash_DefaultHasher as (a0: Key.Key, a1: rt.Hasher) => undefined, Key.eq$PartialEq)) as rt.HashMap, rt.iterSlice(_318, drop$Key_Guard), rt.drop, rt.drop, "fold", 58720256); + }; + const keys: rt.Iter = rt.hashKeys(map3(1), rt.drop, rt.drop); + const part5 = map$0782hf5(rt.iterToOption(keys.next()), (k2: Key.Key): rt.u32 => { + const _07: rt.u32 = rt.u32Sub(k2.id, id); + k2[Symbol.dispose](); + return _07; + }); + const args30: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtOption(part5, f, rt.u32Debug)]; + Log.note(log, rt.fmtFormat(["next ", args30[0]])); + const _421: Key.Key | undefined = rt.iterToOption(keys.next()); + const part6 = _421 === undefined; + const args32: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtBool(part6, f)]; + const _415: string = rt.fmtFormat(["done ", args32[0]]); + rt.drop(_421); + Log.note(log, _415); + rt.iterForEach(rt.hashValues(map3(2), rt.drop, rt.drop), (g8: Guard.Guard): undefined => { + Guard.note(g8, "each"); + g8[Symbol.dispose](); + }, true); + rt.iterFold(rt.hashKeys(map3(3), rt.drop, rt.drop), undefined, (_: undefined, k3: Key.Key): undefined => { + const part7 = rt.u32Sub(k3.id, id); + const args58: rt.Fmt[] = [(f: rt.Formatter) => rt.u32Display(part7, f)]; + Log.note(log, rt.fmtFormat(["fold ", args58[0]])); + k3[Symbol.dispose](); + }, true); + const part8 = map$1raha9y(rt.ownedLast(rt.hashValues(map3(4), rt.drop, rt.drop), rt.drop), (g9: Guard.Guard): rt.u32 => { + const _08: rt.u32 = Guard.id(g9); + g9[Symbol.dispose](); + return _08; + }); + const args34: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtOption(part8, f, rt.u32Debug)]; + Log.note(log, rt.fmtFormat(["last ", args34[0]])); + const part9 = rt.ownedCount(rt.hashKeys(map3(5), rt.drop, rt.drop), rt.drop); + const args36: rt.Fmt[] = [(f: rt.Formatter) => rt.usizeDisplay(part9, f)]; + Log.note(log, rt.fmtFormat(["count ", args36[0]])); + const _472: rt.Iter = rt.hashValues(map3(6), rt.drop, rt.drop); + const found3: Guard.Guard | undefined = rt.iterFind(_472, (g10: Guard.Guard): boolean => { + return Guard.id(g10) === rt.u32Add(id, 6); + }, rt.drop); + rt.drop(_472); + const part10 = map$1raha9y(found3, (g11: Guard.Guard): rt.u32 => { + const _010: rt.u32 = Guard.id(g11); + g11[Symbol.dispose](); + return _010; + }); + const args38: rt.Fmt[] = [(f: rt.Formatter) => rt.fmtOption(part10, f, rt.u32Debug)]; + Log.note(log, rt.fmtFormat(["found ", args38[0]])); + const part11 = rt.iterSum(rt.iterMap(rt.hashKeys(map3(7), rt.drop, rt.drop), (k4: Key.Key): rt.u32 => { + const _011: rt.u32 = rt.u32Sub(k4.id, id); + k4[Symbol.dispose](); + return _011; + }), rt.u32Add, 0, true); + const args40: rt.Fmt[] = [(f: rt.Formatter) => rt.u32Display(part11, f)]; + Log.note(log, rt.fmtFormat(["sum ", args40[0]])); + const taken2: Guard.Guard[] = rt.iterToArray(rt.iterTake(rt.hashValues(map3(8), rt.drop, rt.drop), 0, rt.drop), "next", 8); + const none3: rt.usize = rt.ownedCount(rt.hashKeys(rt.hashNew(rt.hashing(Key.hash$Hash_DefaultHasher as (a0: Key.Key, a1: rt.Hasher) => undefined, Key.eq$PartialEq)) as rt.HashMap, rt.drop, rt.drop), rt.drop); + const _522: rt.usize = taken2.length; + const args42: rt.Fmt[] = [(f: rt.Formatter) => rt.usizeDisplay(_522, f), (f: rt.Formatter) => rt.usizeDisplay(none3, f)]; + Log.note(log, rt.fmtFormat(["taken ", args42[0], " ", args42[1]])); + rt.dropAll(taken2); + rt.drop(keys); + } else if (_8 === 6) { + const _534: [Guard.Guard, Guard.Guard, Guard.Guard, Guard.Guard] = [guard(10), guard(11), guard(12), guard(13)]; + const c: Guard.Guard = _534[0]; + const d: Guard.Guard = _534[1]; + const e: Guard.Guard = _534[2]; + f = _534[3]; + const _551: rt.Iter = rt.iterTake(rt.iterSlice(rt.iterToArray(rt.iterMap(new rt.Range(1, 5), guard), undefined, 8, true), rt.drop), 2, rt.drop); + const captured3 = c; + rt.iterForEach(_551, rt.closure((g2: Guard.Guard): undefined => { + const part = Guard.id(captured3); + const args50: rt.Fmt[] = [(f: rt.Formatter) => rt.u32Display(part, f)]; + const _49: string = rt.fmtFormat(["each ", args50[0]]); + Guard.note(g2, _49); + g2[Symbol.dispose](); + }, (): void => { + captured3[Symbol.dispose](); + }), true, true); + const held: Guard.Guard = guard(14); + const _559: rt.Iter = rt.iterSlice(rt.iterToArray(rt.iterMap(new rt.Range(5, 8), guard), undefined, 8, true), rt.drop); + const captured4 = held; + const _558: rt.Iter<[Guard.Guard, rt.u32]> = rt.iterMap(_559, rt.closure((g3: Guard.Guard): [Guard.Guard, rt.u32] => { + return [g3, Guard.id(captured4)] as [Guard.Guard, rt.u32]; + }, (): void => { + captured4[Symbol.dispose](); + })); + const captured5 = d; + const part2 = rt.iterFold(_558, 0, rt.closure((n7: rt.i32, _311: [Guard.Guard, rt.u32]): rt.i32 => { + const g4: Guard.Guard = _311[0]; + const h: rt.u32 = _311[1]; + const _155: rt.u32 = Guard.id(captured5); + const args52: rt.Fmt[] = [(f: rt.Formatter) => rt.u32Display(h, f), (f: rt.Formatter) => rt.u32Display(_155, f)]; + const _87: string = rt.fmtFormat(["fold ", args52[0], " ", args52[1]]); + Guard.note(g4, _87); + const _04: rt.i32 = rt.i32Add(n7, 1); + g4[Symbol.dispose](); + return _04; + }, (): void => { + captured5[Symbol.dispose](); + }), true, true); + const args44: rt.Fmt[] = [(f: rt.Formatter) => rt.i32Display(part2, f)]; + Log.note(log, rt.fmtFormat(["folded ", args44[0]])); + const _576: rt.Iter = rt.iterSlice([1, 2]); + const captured6 = e; + rt.iterForEach(_576, rt.closure((n8: rt.u32): undefined => { + const _88: rt.u32 = Guard.id(captured6); + const args54: rt.Fmt[] = [(f: rt.Formatter) => rt.u32Display(n8, f), (f: rt.Formatter) => rt.u32Display(_88, f)]; + Log.note(log, rt.fmtFormat(["plain ", args54[0], " ", args54[1]])); + }, (): void => { + captured6[Symbol.dispose](); + }), undefined, true); + const _582: Guard.Guard[] = []; + const _581: rt.Iter = rt.iterSlice(_582, rt.drop); + const captured7 = f; + rt.iterForEach(_581, rt.closure((g5: Guard.Guard): undefined => { + const part3 = Guard.id(captured7); + const args56: rt.Fmt[] = [(f: rt.Formatter) => rt.u32Display(part3, f)]; + const _413: string = rt.fmtFormat([args56[0]]); + Guard.note(g5, _413); + g5[Symbol.dispose](); + }, (): void => { + captured7[Symbol.dispose](); + }), true, true); + const kept: Guard.Guard = rt.iterFold(rt.iterMap(new rt.Range(8, 10), guard), guard(15), (kept2: Guard.Guard, g6: Guard.Guard): Guard.Guard => { + let _05!: Guard.Guard; + let _108: boolean = false; + let _92: boolean = false; + _108 = true; + _92 = true; + if (!(rt.u32Rem(Guard.id(g6), 2) === 0)) { + _108 = false; + _05 = kept2; + } else { + _92 = false; + _05 = g6; + } + if (_92) { + g6[Symbol.dispose](); + } + if (_108) { + kept2[Symbol.dispose](); + return _05; + } + return _05; + }); + const part4 = Guard.id(kept); + const args46: rt.Fmt[] = [(f: rt.Formatter) => rt.u32Display(part4, f)]; + Log.note(log, rt.fmtFormat(["kept ", args46[0]])); + const _604: [Guard.Guard, rt.u32] = [guard(16), 0]; + const k: Guard.Guard = _604[0]; + let captured8 = 0; + const captured9 = k; + const captured10 = id; + const count: (a0: Guard.Guard) => undefined = rt.closure((g7: Guard.Guard): undefined => { + captured8 = rt.u32Add(captured8, rt.u32Sub(rt.u32Add(Guard.id(g7), Guard.id(captured9)), rt.u32Mul(2, captured10))); + g7[Symbol.dispose](); + }, (): void => { + captured9[Symbol.dispose](); + }); + rt.iterForEach(rt.iterMap(new rt.Range(17, 19), guard), count); + Log.note(log, "lent"); + rt.drop(count); + kept[Symbol.dispose](); + } else if (_8 === 7) { + const c2: Guard.Guard = guard(10); + const _622: rt.Iter = rt.iterMap(new rt.Range(1, 4), guard); + const captured = id; + const captured2 = c2; + rt.iterForEach(_622, rt.closure((g: Guard.Guard): undefined => { + if (!(Guard.id(g) !== rt.u32Add(captured, 2))) { + const _134: rt.u32 = Guard.id(g); + const _16: rt.u32 = Guard.id(captured2); + const args48: rt.Fmt[] = [(f: rt.Formatter) => rt.u32Display(_134, f), (f: rt.Formatter) => rt.u32Display(_16, f)]; + rt.panicFmt(["g", args48[0], " with ", args48[1]]); + } else { + g[Symbol.dispose](); + } + }, (): void => { + captured2[Symbol.dispose](); + }), undefined, true); + } else if (_8 === 8) { + const v3: Guard.Guard[] = rt.iterToArray(rt.iterMap(new rt.Range(1, 3), guard), undefined, 8, true); + rt.drop(rt.dropAfter(new Spent.Spent(guard(10), 1, 4), (range4) => rt.vecDrain(v3, rt.boundsOf(range4, Spent.startBound$RangeBounds_usize, Spent.endBound$RangeBounds_usize), rt.drop), rt.drop)); + rt.dropAll(v3); + } else { + let s2: string = "é"; + const bomb: Bomb.Bomb = new Bomb.Bomb(1, 2); + const _636: rt.u8 = rt.u8Rem(rt.u8Div(arg, 10), 3); + if (_636 === 0) { + const s3 = rt.place(() => s2, (value) => s2 = value); + rt.drop(rt.stringDrain(s3, rt.dropAfter(bomb, (range3) => rt.boundsChecked(rt.boundsOf(range3, Bomb.startBound$RangeBounds_usize, Bomb.endBound$RangeBounds_usize), rt.stringLen(s3.v)), rt.drop))); + } else if (_636 === 1) { + s2 = rt.stringReplaceRange(s2, rt.dropAfter(bomb, (range2) => rt.boundsChecked(rt.boundsOf(range2, Bomb.startBound$RangeBounds_usize, Bomb.endBound$RangeBounds_usize), rt.stringLen(s2)), rt.drop), "x"); + } else { + s2 = rt.stringExtendFromWithin(s2, rt.dropAfter(bomb, (range) => rt.boundsChecked(rt.boundsOf(range, Bomb.startBound$RangeBounds_usize, Bomb.endBound$RangeBounds_usize), rt.stringLen(s2)), rt.drop)); + } + } +} + +//# sourceMappingURL=inside.ts.map diff --git a/ts/fixtures/task/expected/lib.ts b/ts/fixtures/task/expected/lib.ts index 4b0c921de..3f18a2bbf 100644 --- a/ts/fixtures/task/expected/lib.ts +++ b/ts/fixtures/task/expected/lib.ts @@ -112,6 +112,18 @@ export function drop$Pair_Held(_1: Pair.Pair): void { _1.second[Symbol.dispose](); } +export function drop$RangeInclusive_Key(value: rt.RangeInclusive): void { + rt.dropAll([value.lo, value.hi]); +} + +export function drop$Range_Guard(value: rt.Range): void { + rt.dropAll([value.start, value.end]); +} + +export function drop$Range_Key(value: rt.Range): void { + rt.dropAll([value.start, value.end]); +} + export function drop$Result_Arc_Guard_Guard_Arc_dyn_Any(_1: rt.Result, rt.Arc>): void { if (_1.ok) { rt.arcDrop(_1.value, drop$Guard_Guard); diff --git a/ts/fixtures/task/src/drops.rs b/ts/fixtures/task/src/drops.rs index 495304963..d0eac5dfe 100644 --- a/ts/fixtures/task/src/drops.rs +++ b/ts/fixtures/task/src/drops.rs @@ -24,6 +24,7 @@ macro_rules! list { mod closures; mod folds; +mod inside; mod iters; mod objects; mod once; @@ -725,6 +726,13 @@ pub fn rfolded(log: &Log, id: u32, arg: u8) { folds::rfolded(log, id, arg); } +/// Run scenario `arg % 10` of where std drops values inside its iterators and formatting. +/// Three panic, each with std's message: in a `for_each`, a drain past the end, and a +/// range that panics as `String`'s drop it. +pub fn inside(log: &Log, id: u32, arg: u8) { + inside::inside(log, id, arg); +} + /// Run scenario `arg % 9` of what a `Vec`'s edits, its, a tuple's, and a box's `clone`, /// `Ord`'s defaults, and an iterator's `max` and `min` drop. One ends in an index past the /// end, which panics with std's message. diff --git a/ts/fixtures/task/src/drops/inside.rs b/ts/fixtures/task/src/drops/inside.rs new file mode 100644 index 000000000..fb680ba13 --- /dev/null +++ b/ts/fixtures/task/src/drops/inside.rs @@ -0,0 +1,235 @@ +//! Where std drops values inside its iterators and formatting: what `DebugList::entries` +//! writes, a range's bounds, a range that drains or searches a collection, the half of an +//! entry a hash map's `into_keys` and `into_values` leave, and the closure `for_each` and +//! `fold` are given. + +use std::collections::{BTreeMap, BTreeSet, HashMap, VecDeque}; +use std::fmt; +use std::ops::{Bound, RangeBounds}; + +use super::Key; +use crate::log::Log; +use crate::model::Guard; + +/// A guard written as its id. +struct Shown(Guard); + +impl fmt::Debug for Shown { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + self.0.note("shown"); + write!(f, "{}", self.0.id()) + } +} + +/// Writes the guards a step makes from `0..n` by `entries` of each kind of iterable. +struct Listed(u32, Log, u8); + +impl fmt::Debug for Listed { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let Self(id, log, n) = self; + let guard = |n: u8| Shown(Guard::new(id + u32::from(n), log.clone())); + let mut list = f.debug_list(); + // Made as `next` reads each, and dropped once written. + list.entries((0..*n).map(guard)); + // Owned by a `Vec`, and by its `IntoIter`, which drops what it holds after. + list.entries((10..10 + *n).map(guard).collect::>()); + list.entries( + (20..20 + *n) + .map(guard) + .collect::>() + .into_iter() + .map(|g| g.0.id()), + ); + // Borrowed, which drops nothing. + let kept: Vec = (30..30 + *n).map(guard).collect(); + list.entries(&kept); + list.finish() + } +} + +/// A `RangeBounds` that logs reading its bounds and its drop. +struct Spent(Guard, usize, usize); + +impl RangeBounds for Spent { + fn start_bound(&self) -> Bound<&usize> { + self.0.note("start"); + Bound::Included(&self.1) + } + + fn end_bound(&self) -> Bound<&usize> { + self.0.note("end"); + Bound::Excluded(&self.2) + } +} + +/// A range whose drop panics, which shows where std drops it. +struct Bomb(usize, usize); + +impl Drop for Bomb { + fn drop(&mut self) { + panic!("range {}..{} dropped", self.0, self.1); + } +} + +impl RangeBounds for Bomb { + fn start_bound(&self) -> Bound<&usize> { + Bound::Included(&self.0) + } + + fn end_bound(&self) -> Bound<&usize> { + Bound::Excluded(&self.1) + } +} + +/// Run scenario `arg % 10`. +pub(super) fn inside(log: &Log, id: u32, arg: u8) { + let guard = |n: u32| Guard::new(id + n, log.clone()); + let key = |n: u32| Key::new(id + n, log.clone()); + match arg % 10 { + 0 => { + for n in [0, 1, 3] { + log.note(format!("listed {:?}", Listed(id, log.clone(), n))); + } + log.note(format!("pretty {:#?}", Listed(id, log.clone(), 2))); + } + 1 => { + // Each range drops its bounds in the order its fields are. + drop(guard(1)..guard(2)); + drop(guard(3)..=guard(4)); + drop(guard(5)..); + drop(..guard(6)); + drop(..=guard(7)); + let r = guard(8)..guard(9); + let start = r.start; + log.note(format!("moved {}", start.id())); + let ranges = vec![guard(10)..guard(11), guard(12)..guard(13)]; + log.note(format!("ranges {}", ranges.len())); + } + 2 => { + // std drops a range once it has read its bounds, before it drains. + let mut v: Vec = (1..6).map(guard).collect(); + let taken: Vec = v.drain(Spent(guard(10), 1, 3)).collect(); + log.note(format!("drained {} {}", taken.len(), v.len())); + let mut q: VecDeque = (6..9).map(guard).collect(); + let mut it = q.drain(Spent(guard(11), 0, 2)); + log.note(format!("deque {:?}", it.next().map(|g| g.id()))); + drop(it); + let mut s = String::from("abcdef"); + log.note(format!("text {}", s.drain(Spent(guard(12), 1, 3)).collect::())); + s.replace_range(Spent(guard(13), 0, 1), "xy"); + s.extend_from_within(Spent(guard(14), 2, 4)); + let mut bytes = [1u8, 2, 3, 4]; + bytes.copy_within(Spent(guard(15), 0, 2), 2); + log.note(format!("edited {s} {bytes:?}")); + // Empty: read and dropped all the same. + let none: Vec = v.drain(Spent(guard(16), 1, 1)).collect(); + log.note(format!("none {}", none.len())); + } + 3 => { + // A B-tree drops a range once it has searched by it, or at once if empty. + let mut map = BTreeMap::new(); + log.note(format!("empty {}", map.range(Spent(guard(1), 0, 1)).count())); + for n in 0..4usize { + map.insert(n, guard(10 + n as u32)); + } + log.note(format!("map {}", map.range(Spent(guard(2), 1, 3)).count())); + for (_, g) in map.range_mut(Spent(guard(3), 2, 9)) { + g.note("ranged"); + } + let set: BTreeSet = (0..5).collect(); + log.note(format!("set {}", set.range(Spent(guard(4), 3, 5)).count())); + } + 4 => { + // A range of keys that drop, ordered by the crate's own `Ord`. + let mut map = BTreeMap::new(); + for n in 1..5 { + map.insert(key(n), n); + } + let found: Vec = map.range(key(2)..key(4)).map(|(_, &n)| n).collect(); + log.note(format!("keys {found:?}")); + let found = map.range(key(3)..=key(9)).count(); + let none = BTreeMap::::new().range(key(5)..key(6)).count(); + log.note(format!("keys {found} {none}")); + } + 5 => { + // One entry each, whose order std's hash table leaves no room to differ in: `next` + // drops the other half before it returns, and `fold` after its closure has the item. + let map = |n: u32| HashMap::from([(key(n), guard(n))]); + let mut keys = map(1).into_keys(); + log.note(format!("next {:?}", keys.next().map(|k| k.id - id))); + log.note(format!("done {}", keys.next().is_none())); + map(2).into_values().for_each(|g| g.note("each")); + map(3) + .into_keys() + .fold((), |(), k| log.note(format!("fold {}", k.id - id))); + log.note(format!("last {:?}", map(4).into_values().last().map(|g| g.id()))); + log.note(format!("count {}", map(5).into_keys().count())); + let found = map(6).into_values().find(|g| g.id() == id + 6); + log.note(format!("found {:?}", found.map(|g| g.id()))); + log.note(format!("sum {}", map(7).into_keys().map(|k| k.id - id).sum::())); + let taken: Vec = map(8).into_values().take(0).collect(); + let none = HashMap::::new().into_keys().count(); + log.note(format!("taken {} {none}", taken.len())); + } + 6 => { + // Each consumer's closure drops as its fold ends, before the iterator and what it + // still holds: a `take`'s source, and an adaptor's closure, which drops first. + let (c, d, e, f) = (guard(10), guard(11), guard(12), guard(13)); + let v: Vec = (1..5).map(guard).collect(); + v.into_iter() + .take(2) + .for_each(move |g| g.note(&format!("each {}", c.id()))); + let held = guard(14); + let n = (5..8) + .map(guard) + .collect::>() + .into_iter() + .map(move |g| (g, held.id())) + .fold(0, move |n, (g, h)| { + g.note(&format!("fold {h} {}", d.id())); + n + 1 + }); + log.note(format!("folded {n}")); + // A closure that drops over items that don't, and none at all. + [1u32, 2] + .iter() + .for_each(move |n| log.note(format!("plain {n} {}", e.id()))); + Vec::::new() + .into_iter() + .for_each(move |g| g.note(&format!("{}", f.id()))); + // An accumulator that drops, and a closure lent, which its owner drops after. + let kept = (8..10) + .map(guard) + .fold(guard(15), |kept, g| if g.id() % 2 == 0 { g } else { kept }); + log.note(format!("kept {}", kept.id())); + let (k, mut seen) = (guard(16), 0); + let mut count = move |g: Guard| seen += g.id() + k.id() - 2 * id; + (17..19).map(guard).for_each(&mut count); + log.note("lent".into()); + drop(count); + } + 7 => { + // A panic mid-iteration, which aborts before anything else drops. + let c = guard(10); + (1..4) + .map(guard) + .for_each(move |g| assert!(g.id() != id + 2, "g{} with {}", g.id(), c.id())); + } + 8 => { + // A range past the end, which panics with std's message. + let mut v: Vec = (1..3).map(guard).collect(); + v.drain(Spent(guard(10), 1, 4)); + } + _ => { + // `String`'s drop the range once they have checked its bounds, before they check + // its char boundaries: a range in `é` that cuts it panics as it drops. + let mut s = String::from("é"); + let bomb = Bomb(1, 2); + match arg / 10 % 3 { + 0 => drop(s.drain(bomb)), + 1 => s.replace_range(bomb, "x"), + _ => s.extend_from_within(bomb), + } + } + } +} diff --git a/ts/fixtures/task/src/harness.rs b/ts/fixtures/task/src/harness.rs index 4d45f77a2..5bbace253 100644 --- a/ts/fixtures/task/src/harness.rs +++ b/ts/fixtures/task/src/harness.rs @@ -143,6 +143,9 @@ fn steps() -> Vec<(&'static str, Step)> { exec.spawn(model::front(channels[c].consumer(), guard)); } }), + ("inside", |log, exec, _, arg| { + drops::inside(log, 1000 * exec.len() as u32, arg) + }), ] } diff --git a/ts/fixtures/task/ts.toml b/ts/fixtures/task/ts.toml index 79b2ab1af..1e8e38b0d 100644 --- a/ts/fixtures/task/ts.toml +++ b/ts/fixtures/task/ts.toml @@ -17,6 +17,7 @@ roots = [ "drops::cells", "drops::folded", "drops::rfolded", + "drops::inside", "futures::helpers", "futures::boxed", ] diff --git a/ts/runtime/rt.ts b/ts/runtime/rt.ts index 6e2aa80cd..434a76186 100644 --- a/ts/runtime/rt.ts +++ b/ts/runtime/rt.ts @@ -9,7 +9,7 @@ import type { Ordering } from "./rt/collections.ts"; import type { ParseFloatError } from "./rt/float.ts"; import { type char, type ParseCharError, type ParseIntError, type TryFromIntError, type u32, type usize, u8Debug, usizeDebug, usizeDisplay } from "./rt/int.ts"; import type { Range, RangeInclusive } from "./rt/iter.ts"; -import { dropAll, type Pending } from "./rt/task.ts"; +import { drop as dispose, dropAll, type Pending } from "./rt/task.ts"; import { AtIndex } from "./rt/collections.ts"; import { UNPRINTABLE } from "./rt/unicode.ts"; @@ -1571,9 +1571,13 @@ export function debugListEntry(b: DebugList, value: Fmt): DebugList { return b; } -/** `DebugList::entries`. */ -export function debugListEntries(b: DebugList, items: Iterable, debug: Debug): DebugList { - for (const item of items) debugListEntry(b, (f) => debug(item, f)); +/** `DebugList::entries`: each item written and then dropped by `drop`, and then `items` dropped, as std's `for` does. */ +export function debugListEntries(b: DebugList, items: Iterable, debug: Debug, drop?: (value: T) => void): DebugList { + for (const item of items) { + debugListEntry(b, (f) => debug(item, f)); + drop?.(item); + } + dispose(items); return b; } diff --git a/ts/runtime/rt/collections.ts b/ts/runtime/rt/collections.ts index 924a3a820..cb972ac3e 100644 --- a/ts/runtime/rt/collections.ts +++ b/ts/runtime/rt/collections.ts @@ -695,13 +695,41 @@ export class HashIter extends Iter implements Disposable { return s; } + /** + * The next item, `into_keys`' and `into_values`' with the other half dropped before it + * is returned, as std's `next` drops it. + */ next(): T | Done { if (this.left === 0) return DONE; this.left--; if (this.pick === PLACES) return this.place() as T; const entry = this.entry(); if (this.pick === ENTRIES) return entry as T; - return (this.pick === KEYS ? entry[0] : entry[1]) as unknown as T; + if (this.pick === KEYS) { + this.v?.(entry[1]); + return entry[0] as unknown as T; + } + this.k?.(entry[0]); + return entry[1] as unknown as T; + } + + /** std's `fold` of `into_keys` and `into_values`: the other half drops after `f` has its item. */ + override fold(acc: A, f: (acc: A, item: T) => A, release?: () => void): A { + if (this.pick !== KEYS && this.pick !== VALUES) return super.fold(acc, f, release); + const keys = this.pick === KEYS; + while (this.left > 0) { + this.left--; + const [key, value] = this.entry(); + if (keys) { + acc = f(acc, key as unknown as T); + this.v?.(value); + } else { + acc = f(acc, value as unknown as T); + this.k?.(key); + } + } + release?.(); + return acc; } override len(): number { @@ -731,14 +759,14 @@ export function hashIter(m: HashMap, k?: (key: K) => void, v?: (valu return new HashIter(m, ENTRIES, k, v); } -/** `keys` of a map and `iter` of a set, and with what drops each key, `into_keys` of values that don't drop and `into_iter`. */ -export function hashKeys(m: HashMap, k?: (key: K) => void): Iter { - return new HashIter(m, KEYS, k); +/** `keys` of a map and `iter` of a set, and with what drops each key and value, `into_keys` and `into_iter`. */ +export function hashKeys(m: HashMap, k?: (key: K) => void, v?: (value: V) => void): Iter { + return new HashIter(m, KEYS, k, v); } -/** `values` and `values_mut`, and with what drops each value, `into_values` of keys that don't drop. */ -export function hashValues(m: HashMap, v?: (value: V) => void): Iter { - return new HashIter(m, VALUES, undefined, v); +/** `values` and `values_mut`, and with what drops each value and key, `into_values`. */ +export function hashValues(m: HashMap, v?: (value: V) => void, k?: (key: K) => void): Iter { + return new HashIter(m, VALUES, k, v); } /** `iter_mut` of values JS copies: each key and the place of its value, in `hashIter`'s order. */ @@ -2474,6 +2502,12 @@ export function boundsRange(r: Bounds, n: number): [number, number] { return [start, end]; } +/** `slice::range` itself: `r` within `n` elements, as `{ start, end }`, panicking as std's does. */ +export function boundsChecked(r: Bounds, n: number): { start: number; end: number } { + const [start, end] = boundsRange(r, n); + return { start, end }; +} + /** * A slice's index `r` other than `a..b`, `a..`, `..b`, and `..`, as the start and end of * the part it reads within `n` elements, panicking as std's `index` does. diff --git a/ts/runtime/rt/iter.ts b/ts/runtime/rt/iter.ts index 7478ca8fb..28852f9de 100644 --- a/ts/runtime/rt/iter.ts +++ b/ts/runtime/rt/iter.ts @@ -786,25 +786,30 @@ export function iterReduce(it: Iter, f: (acc: T, item: T) => T, drops = fa return none; } -/** `Iterator::fold`. */ -export function iterFold(it: Iter, init: A, f: (acc: A, item: T) => A, drops = false): A { +/** + * `Iterator::fold`. If it `owns` `f`, a closure that drops, `f` drops as the fold ends, + * before `it`, as std's drops the closure it was given. + */ +export function iterFold(it: Iter, init: A, f: (acc: A, item: T) => A, drops = false, owns = false): A { if (!drops) { const folded = it.folded(); let acc = init; for (let item = folded.next(); item !== DONE; item = folded.next()) acc = f(acc, item); + if (owns) dispose(f); return acc; } - return it.fold(init, f); + return it.fold(init, f, owns ? () => dispose(f) : undefined); } -/** `Iterator::for_each`. */ -export function iterForEach(it: Iter, f: (item: T) => void, drops = false): void { +/** `Iterator::for_each`, which drops `f` if it `owns` it, as `iterFold` does. */ +export function iterForEach(it: Iter, f: (item: T) => void, drops = false, owns = false): void { if (!drops) { const folded = it.folded(); for (let item = folded.next(); item !== DONE; item = folded.next()) f(item); + if (owns) dispose(f); return; } - it.fold(undefined, (_, item) => f(item)); + it.fold(undefined, (_, item) => f(item), owns ? () => dispose(f) : undefined); } /** `sum`, adding with an integer type's checked `add`, so overflow panics as Rust's does. */ diff --git a/ts/runtime/rt/task.ts b/ts/runtime/rt/task.ts index 42f92e7b3..aa1572658 100644 --- a/ts/runtime/rt/task.ts +++ b/ts/runtime/rt/task.ts @@ -40,10 +40,13 @@ export function callOnce(f: (...args: A) => R, ...args: return r; } -/** `call()`, then `f` drops: a std function that calls `f` and keeps nothing of it drops it as it returns. */ -export function dropAfter(f: unknown, call: () => R): R { - const r = call(); - drop(f); +/** + * `call(f)`, then `f` dropped by `by`: a std function that calls `f`, or reads a range `f`, + * and keeps nothing of it drops it as it returns. + */ +export function dropAfter(f: T, call: (f: T) => R, by: (f: T) => void = drop): R { + const r = call(f); + by(f); return r; } diff --git a/ts/src/census.rs b/ts/src/census.rs index 901e8511f..89c46e276 100644 --- a/ts/src/census.rs +++ b/ts/src/census.rs @@ -147,7 +147,6 @@ const VERBATIM: &[&str] = &[ "BytesMut", "Copy", "Debug", - "DebugList::entries", "Display", "Drop", "From", diff --git a/ts/src/lower/collections.rs b/ts/src/lower/collections.rs index ef8db4804..c0b038bed 100644 --- a/ts/src/lower/collections.rs +++ b/ts/src/lower/collections.rs @@ -617,20 +617,15 @@ fn hash<'tcx>( (_, "iter" | "iter_mut") if !set => Expr::rt("hashIter", values), (_, "iter" | "keys") => Expr::rt("hashKeys", values), (_, "values" | "values_mut") => Expr::rt("hashValues", values), - // std's `fold` of either drops the half it does not yield after the one it does, where - // `next` drops it before. + // What drops the half it yields, then the other, which the runtime drops as std's + // does: before `next` returns, and after `fold` has the item. (_, "into_keys" | "into_values") => { let (kept, other) = if name == "into_keys" { (0, 1) } else { (1, 0) }; - if b.t.drops(arg(coll, other)) { - let other = arg(coll, other); - return Some(b.err( - span, - format!("`{name}` of `{coll}`, which drops `{other}`, which is not supported yet"), - )); - } - let dropper = b.t.dropper(arg(coll, kept), span); + let Some(droppers) = b.t.droppers([arg(coll, kept), arg(coll, other)], span) else { + return Some(Expr::undefined()); + }; let f = if name == "into_keys" { "hashKeys" } else { "hashValues" }; - Expr::rt(f, super::iter::tail(values, vec![dropper])) + Expr::rt(f, super::iter::tail(values, droppers)) } (_, "drain") => { let droppers = entry_droppers(b, coll, span); @@ -964,9 +959,11 @@ fn btree<'tcx>( let key = arg(coll, 0); let value = if set { None } else { Some(arg(coll, 1)) }; let mut values = args; + let mut ranged = None; if matches!(name, "range" | "range_mut") { - let range = values.pop()?; - values.push(bounds(b, call, range)); + let range = bounds(b, call, values.pop()?); + values.push(range.bounds.clone()); + ranged = Some(range); // std checks the ends by `==` and `>`, which a key of std's alone does as its `Ord` // does, and one holding the crate's own or a bound type by that type's `PartialEq` // and `PartialOrd`. @@ -1065,7 +1062,10 @@ fn btree<'tcx>( } _ => return None, }; - Some(e) + Some(match ranged { + Some(ranged) => ranged.after(e), + None => e, + }) } /// `collect` and `from` into an empty B-tree of type `coll`, from `source`, an iterator of @@ -1206,10 +1206,10 @@ fn deque<'tcx>( (_, "iter_mut") if b.t.needs_place(item) => Expr::rt("dequeIterMut", values), (_, "iter" | "iter_mut") => Expr::rt("dequeIter", values), (_, "drain") => { - let range = values.pop()?; - values.push(bounds(b, call, range)); + let ranged = bounds(b, call, values.pop()?); + values.push(ranged.bounds.clone()); let droppers = entry_droppers(b, coll, span); - Expr::rt("dequeDrain", super::iter::tail(values, droppers)) + ranged.after(Expr::rt("dequeDrain", super::iter::tail(values, droppers))) } (_, "reserve" | "reserve_exact" | "shrink_to_fit") => { discard(values, out); @@ -1617,30 +1617,64 @@ fn bytes<'tcx>(b: &Body<'_, '_, 'tcx>, ty: Ty<'tcx>) -> bool { matches!(elem.kind(), ty::Uint(ty::UintTy::U8)) } +/// What `bounds` makes of the range a call takes: what an `rt.Bounds` reads, and, for a +/// range that drops, the range and what drops it. +pub struct Ranged { + pub bounds: Expr, + dropped: Option<(Expr, String, Expr)>, +} + +impl Ranged { + /// `e`, the call, which drops a range that drops once it returns: std drops it once it + /// has read its bounds and searched by them, after which it does nothing JS can see + /// before it returns. + pub fn after(self, e: Expr) -> Expr { + let Some((range, name, drop)) = self.dropped else { + return e; + }; + let call = Expr::Lambda(vec![Param { name, ty: None }], Box::new(e)); + Expr::rt("dropAfter", vec![range, call, drop]) + } + + /// The bounds, for a call that checks more once `slice::range` has checked them within + /// `len`, as `String`'s do its char boundaries: a range that drops drops between the two, + /// as std's does, and the call takes the checked `{ start, end }`. + pub fn within(self, len: Expr) -> Expr { + let Some((range, name, drop)) = self.dropped else { + return self.bounds; + }; + let checked = Expr::rt("boundsChecked", vec![self.bounds, len]); + let call = Expr::Lambda(vec![Param { name, ty: None }], Box::new(checked)); + Expr::rt("dropAfter", vec![range, call, drop]) + } +} + /// Makes `range`, the range `call` takes, what an `rt.Bounds` reads: std's range types /// and a pair of `Bound`s are already, and any other `RangeBounds` becomes `rt.boundsOf` of -/// it and its `start_bound` and `end_bound`, which the runtime calls where std's does. A -/// range that drops is refused, since std drops it once it has read the bounds. -pub fn bounds<'tcx>(b: &mut Body<'_, '_, 'tcx>, call: &Call<'tcx>, range: Expr) -> Expr { +/// it and its `start_bound` and `end_bound`, which the runtime calls where std's does. +pub fn bounds<'tcx>(b: &mut Body<'_, '_, 'tcx>, call: &Call<'tcx>, range: Expr) -> Ranged { let tcx = b.t.tcx; let span = call.span; let (input, target) = range_input(b, call); let ty = b.t.sig(call.def_id, call.args).inputs()[input]; - if b.t.drops(ty) { - let (owner, name) = library::key(tcx, call.def_id).expect("a function of std"); - return b.err( - span, - format!("passing `{ty}`, which drops, to `{owner}::{name}`, which is not supported yet"), - ); - } + // One that drops is the parameter of what `Ranged::after` calls, so it is read once. + let (range, dropped) = match b.t.drop_fn(ty, span) { + Some(drop) => { + let name = b.fresh("range"); + (Expr::ident(&name), Some((range, name, drop))) + } + None => (range, None), + }; // Each instance decides for a range it is generic over. - if plain_bounds(b.t, ty) || b.t.deferred(ty) { - return range; - } - let args = tcx.mk_args(&[ty.into(), target.into()]); - let start = b.fn_value(trait_fn(tcx, "RangeBounds", "start_bound"), args, span); - let end = b.fn_value(trait_fn(tcx, "RangeBounds", "end_bound"), args, span); - Expr::rt("boundsOf", vec![range, start, end]) + let bounds = if plain_bounds(b.t, ty) || b.t.deferred(ty) { + range + } else { + let args = tcx.mk_args(&[ty.into(), target.into()]); + let start = b.fn_value(trait_fn(tcx, "RangeBounds", "start_bound"), args, span); + let end = b.fn_value(trait_fn(tcx, "RangeBounds", "end_bound"), args, span); + Expr::rt("boundsOf", vec![range, start, end]) + }; + Ranged { bounds, dropped } } /// Whether an `rt.Bounds` reads `ty` as it is: std's range types and a pair of `Bound`s. diff --git a/ts/src/lower/drop.rs b/ts/src/lower/drop.rs index b779a8c1d..390f808eb 100644 --- a/ts/src/lower/drop.rs +++ b/ts/src/lower/drop.rs @@ -61,7 +61,12 @@ impl<'a, 'tcx> Translator<'a, 'tcx> { | Std::BinaryHeap | Std::Bound | Std::TryLockError - | Std::Reverse, + | Std::Reverse + | Std::Range + | Std::RangeInclusive + | Std::RangeFrom + | Std::RangeTo + | Std::RangeToInclusive, ) => args.types().any(|t| self.drops(t)), // An entry borrows its map, and holds only the key it was given. Some(Std::Entry) => args.types().next().is_some_and(|k| self.drops(k)), @@ -317,6 +322,21 @@ impl<'a, 'tcx> Translator<'a, 'tcx> { Std::VecDeque => ("dequeDrop", vec![value, each(self, 0)?]), Std::BinaryHeap => ("heapDrop", vec![value, each(self, 0)?]), Std::PeekMut => ("peekMutDrop", vec![value]), + // Its bounds, in the order std's fields are, `rt.RangeInclusive`'s by its own names. + Std::Range | Std::RangeInclusive => { + let (lo, hi) = match std { + Std::Range => ("start", "end"), + _ => ("lo", "hi"), + }; + let bounds = Expr::Array(vec![value.clone().member(lo), value.member(hi)]); + let mut args = vec![bounds]; + if !self.disposable(arg(0), span) { + args.push(self.drop_fn(arg(0), span)?); + } + ("dropAll", args) + } + Std::RangeFrom => return self.drop_value(value.member("start"), arg(0), span), + Std::RangeTo | Std::RangeToInclusive => return self.drop_value(value.member("end"), arg(0), span), // A vacant entry holds the key it was given; an occupied one dropped it as // `entry` found the map's. Std::Entry => match self.tcx.item_name(adt.did()).as_str() { diff --git a/ts/src/lower/iter.rs b/ts/src/lower/iter.rs index 198c20c19..0a9eb067c 100644 --- a/ts/src/lower/iter.rs +++ b/ts/src/lower/iter.rs @@ -449,9 +449,14 @@ pub fn call<'tcx>( false => method(name, none), } } + // Each owns a closure it is given by value, which drops as its fold ends. "for_each" | "fold" => { let drops = iter_drops(b, self_ty, span); - method(&camel, tail(rest, vec![drops])) + let owns = match b.t.drops(targ(gargs.types().count() - 1)?) { + true => Expr::lit("true"), + false => Expr::undefined(), + }; + method(&camel, tail(rest, vec![drops, owns])) } // std's `Sum` and `Product` are of the type or a reference to it: another is the crate's. "sum" | "product" if item.peel_refs() != targ(1)? => None, @@ -750,6 +755,12 @@ fn std_iter_path(tcx: ty::TyCtxt<'_>, ty: Ty<'_>) -> Option> { Some(library::std_path(tcx, adt.did())).filter(|p| !p.is_empty()) } +/// Whether std's `owner::name` takes a closure by value that it drops as its fold ends, +/// before the iterator, which its mapping drops there too. +pub(super) fn releases(owner: &str, name: &str) -> bool { + matches!((owner, name), ("Iterator", "for_each" | "fold")) +} + /// The function or `Iterator` method named for `ty`, one of std's iterators of zero-sized /// fields, as `from_fn` makes a `FromFn` and `map` a `Map`, and its generic arguments: what /// MIR reads as a constant, rather than from that call, makes it of its fields in order. diff --git a/ts/src/lower/library.rs b/ts/src/lower/library.rs index 292334e3e..682ba5221 100644 --- a/ts/src/lower/library.rs +++ b/ts/src/lower/library.rs @@ -720,6 +720,7 @@ fn discards(owner: &str, name: &str) -> Option<&'static [usize]> { // What a panic would drop, which aborts. | ("Result", "unwrap" | "expect" | "unwrap_err") | ("Vec", "insert") + | ("RangeInclusive", "new") // Each element moves into the closure. | ("array", "map") => &[], // `Vec` drops each element `retain` rejects, `dedup` removes, and `truncate` and @@ -876,17 +877,19 @@ pub fn called_through<'tcx>( } /// The closures `call` calls that own a value that drops, by what its mapping does with -/// each: kept by the iterator it returns, if `iter::holds_closure`; dropped as it returns, if -/// `Fn` or `FnMut` call it and nothing else it takes by value drops, or the mapping discards -/// none of it, as then nothing it drops is ordered against it; dropped where `discarded` says, by the type's index among -/// the call's type arguments; or else leaked. A closure that `Fn` or `FnMut` call, given to -/// one that calls it through `FnOnce`, becomes `rt.once` of it, which drops it after the -/// call, as rustc's shim does. A reference to one is the closure in JS, so an iterator, -/// which drops what it holds, keeps `rt.lent` of it instead. +/// each: kept by the iterator it returns, if `iter::holds_closure`; dropped by the mapping, +/// if `released`, as `iter::releases` says; dropped as it returns, if `Fn` or `FnMut` call +/// it and nothing else it takes by value drops, or the mapping discards none of it, as then +/// nothing it drops is ordered against it; dropped where `discarded` says, by the type's +/// index among the call's type arguments; or else leaked. A closure that `Fn` or `FnMut` +/// call, given to one that calls it through `FnOnce`, becomes `rt.once` of it, which drops +/// it after the call, as rustc's shim does. A reference to one is the closure in JS, so an +/// iterator, which drops what it holds, keeps `rt.lent` of it instead. fn called_closures<'tcx>( b: &mut Body<'_, '_, 'tcx>, call: &Call<'tcx>, discarded: Option<&[usize]>, + released: bool, args: &mut [Expr], ) -> Closures<'tcx> { let tcx = b.t.tcx; @@ -930,8 +933,8 @@ fn called_closures<'tcx>( } continue; } - // Its owner drops a borrowed closure. - if lent { + // Its owner drops a borrowed closure, and the mapping a released one. + if lent || released { continue; } let index = call.args[..param.index as usize] @@ -1046,7 +1049,8 @@ pub fn call<'tcx>(b: &mut Body<'_, '_, 'tcx>, call: &Call<'tcx>, args: Vec } let discarded = discards(&owner, &name); let mut args = args; - let closures = called_closures(b, call, discarded, &mut args); + let released = super::iter::releases(&owner, &name); + let closures = called_closures(b, call, discarded, released, &mut args); let mut e = mapping(b, call, owner.clone(), name.clone(), discarded, args, out)?; if let Some(ty) = closures.leaked { return Some(b.err( @@ -1797,18 +1801,17 @@ fn mapping<'tcx>( }; rt2(values, of, &f) } - // Of a range, which `Vec::drain::` takes, and which `bounds` refuses if it - // drops, as the other operand is the vector. + // Of a range, which `Vec::drain::` takes, as the other operand is the vector. ("Vec", "drain") => { - let range = args.pop()?; - args.push(super::collections::bounds(b, call, range)); - return Some(match is_u8(targ(gargs, 0)) { + let ranged = super::collections::bounds(b, call, args.pop()?); + args.push(ranged.bounds.clone()); + return Some(ranged.after(match is_u8(targ(gargs, 0)) { true => Expr::rt("byteVecDrain", args), false => { let dropper = b.t.dropper(targ(gargs, 0), span); Expr::rt("vecDrain", super::iter::tail(args, vec![dropper])) } - }); + })); } ("Vec", "as_slice" | "as_mut_slice") => { let v = args.pop()?; @@ -1852,9 +1855,14 @@ fn mapping<'tcx>( ("String", "with_capacity") => Expr::rt("stringWithCapacity", args), // Of the place the `&mut` is, which it writes as it drops, and of a range, as `Vec::drain`. ("String", "drain") => { - let range = args.pop()?; - args.push(super::collections::bounds(b, call, range)); - Expr::rt("stringDrain", args) + let ranged = super::collections::bounds(b, call, args.pop()?); + let s = args.pop()?; + let s = match s.is_path() { + true => s, + false => b.spill(s, "s", out), + }; + let len = Expr::rt("stringLen", vec![s.clone().member("v")]); + return Some(Expr::rt("stringDrain", vec![s, ranged.within(len)])); } ("Drain", "as_str") => Expr::rt("stringDrainAsStr", args), ("ParseIntError", "kind") => args.pop()?.member("kind"), diff --git a/ts/src/lower/mir/call.rs b/ts/src/lower/mir/call.rs index 420de4ee0..d57c61b83 100644 --- a/ts/src/lower/mir/call.rs +++ b/ts/src/lower/mir/call.rs @@ -602,7 +602,8 @@ impl<'m, 'b, 'a, 'tcx> Fx<'m, 'b, 'a, 'tcx> { span, }; let range = std::mem::replace(&mut values[1], Expr::undefined()); - values[1] = crate::lower::collections::bounds(self.b, &call, range); + let len = Expr::rt("stringLen", vec![values[0].clone()]); + values[1] = crate::lower::collections::bounds(self.b, &call, range).within(len); } let edited = match name.as_str() { "clear" => Expr::Str(String::new()), @@ -792,8 +793,9 @@ impl<'m, 'b, 'a, 'tcx> Fx<'m, 'b, 'a, 'tcx> { args: gargs, span, }; - let range = crate::lower::collections::bounds(self.b, &call, range); - let checked = Expr::rt("boundsRange", vec![range, s.clone().member("length")]); + let ranged = crate::lower::collections::bounds(self.b, &call, range); + let checked = Expr::rt("boundsRange", vec![ranged.bounds.clone(), s.clone().member("length")]); + let checked = ranged.after(checked); let pair = self.path(checked, "bounds", out); (pair.clone().index(Expr::lit("0")), pair.index(Expr::lit("1"))) } @@ -1010,11 +1012,13 @@ impl<'m, 'b, 'a, 'tcx> Fx<'m, 'b, 'a, 'tcx> { } ("DebugList", "entries") => { let list = self.operand(&args[0].node, span, out); - let iter_ty = targ(1)?; + let (item_ty, iter_ty) = (targ(0)?, targ(1)?); let items = self.operand(&args[1].node, span, out); let items = self.items(items, iter_ty, span)?; - let debug = self.b.fmt_fn(fmt::Trait::Debug, targ(0)?, span); - done(Expr::rt("debugListEntries", vec![list, items, debug]), true) + let debug = self.b.fmt_fn(fmt::Trait::Debug, item_ty, span); + let mut values = vec![list, items, debug]; + values.extend(self.b.t.drop_fn(item_ty, span)); + done(Expr::rt("debugListEntries", values), true) } _ => None, } @@ -1512,15 +1516,11 @@ impl<'m, 'b, 'a, 'tcx> Fx<'m, 'b, 'a, 'tcx> { .collect() } - /// What a `DebugList` iterates, as an iterable JS value, which drops nothing it reads. + /// What a `DebugList` iterates, as an iterable JS value: an array or `Vec`'s elements, + /// whose items the runtime drops if it owns them, or else an `rt.Iter`, which it drops + /// once done. fn items(&mut self, value: Expr, ty: Ty<'tcx>, span: Span) -> Option { let tcx = self.tcx; - if self.b.t.drops(ty) { - return Some(self.err( - span, - format!("`DebugList::entries` of `{ty}`, which drops, which is not supported yet"), - )); - } match ty.peel_refs().kind() { ty::Slice(_) | ty::Array(..) => Some(library::elements(value, ty)), ty::Adt(adt, _) if Std::of(tcx, adt.did()) == Some(Std::Vec) => Some(library::elements(value, ty)), diff --git a/ts/src/print.rs b/ts/src/print.rs index fc52eb1e4..2531dd31f 100644 --- a/ts/src/print.rs +++ b/ts/src/print.rs @@ -711,9 +711,9 @@ impl Printer<'_> { match &stmt.kind { StmtKind::Expr(e) => { // A statement can't start with `{`, which would open a block. - let prec = match e { - Expr::Object(_) => 20, - _ => 0, + let prec = match starts_with_object(e) { + true => 20, + false => 0, }; self.expr(e, prec); self.write(";\n"); @@ -1251,3 +1251,20 @@ fn collect_expr_locals(e: &Expr, out: &mut Vec) { Expr::Ident(_) | Expr::This | Expr::Sym(_) | Expr::Rt(_) | Expr::Lit(_) | Expr::Str(_) => {} } } + +/// Whether `e` prints starting with an object literal, as `{ start: g }.start` does. +fn starts_with_object(e: &Expr) -> bool { + match e { + Expr::Object(_) => true, + Expr::Member(e, _) + | Expr::Index(e, _) + | Expr::Call(e, _) + | Expr::Postfix(e, _) + | Expr::Binary(e, _, _) + | Expr::Cond(e, _, _) + | Expr::Assign(e, _) + | Expr::As(e, _) + | Expr::Located(_, e) => starts_with_object(e), + _ => false, + } +} diff --git a/ts/tests/task.ts b/ts/tests/task.ts index d00129943..e2ad146a3 100644 --- a/ts/tests/task.ts +++ b/ts/tests/task.ts @@ -56,6 +56,7 @@ export interface Fixture { cells(log: Log, id: number, arg: number): void; folded(log: Log, id: number, arg: number): void; rfolded(log: Log, id: number, arg: number): void; + inside(log: Log, id: number, arg: number): void; }; futures: { helpers(rx: Consumer, guard: Guard): Future; @@ -309,6 +310,7 @@ export const steps: [string, (r: Run, arg: number) => void][] = [ if (c !== undefined) r.exec.spawn(r.f.front(r.f.Channel.consumer(r.channels[c]), guard(r))); }, ], + ["inside", (r, arg) => r.f.drops.inside(r.log, 1000 * r.exec.tasks.length, arg)], ]; /** The script runner, as `harness.rs` runs it natively. */ @@ -395,4 +397,6 @@ export const cases: Uint8Array[] = [ // Each scenario of adaptors' closures that drop, folded either way. ...Array.from({ length: 34 }, (_, arg) => script(["folded", arg])), ...Array.from({ length: 9 }, (_, arg) => script(["rfolded", arg])), + // Where std drops values inside its iterators and formatting. + ...[...Array.from({ length: 10 }, (_, arg) => arg), 19, 29].map((arg) => script(["inside", arg])), ];