diff --git a/quest/m3/ts-unsafe/README.md b/quest/m3/ts-unsafe/README.md index e54d29d86..0e7775f94 100644 --- a/quest/m3/ts-unsafe/README.md +++ b/quest/m3/ts-unsafe/README.md @@ -37,8 +37,8 @@ none of its own `unsafe`. A union over a type parameter lays out each instance s - Decided with the maintainer on 2026-11-01, typed allocation: memory from `alloc` for a `Layout::array::(n)`, or an equal layout of `T`'s size and alignment, cast to `*mut T` is a fresh JS array of `T`s, which `realloc` copies and `dealloc` frees. Untyped and - byte allocation stay refused. smallvec spills to it, and - [`Vec::from_raw_parts` of it](/quest/m3/ts-unsafe/vec-from-raw-parts.md) is left. + byte allocation stay refused. smallvec spills to it, and `Vec::from_raw_parts` adopts + it, or a `Vec`'s own, as the `Vec`'s items. - Decided with the maintainer on 2026-11-02: a raw slice pointer is `rs.RawSlice`, its first element's pointer and its length, read through only where Rust reads, and an empty slice from a pointer into no array keeps that pointer through every part of it. @@ -73,7 +73,6 @@ Public API: the translator's output. ## Required - [A raw pointer behind a reference](/quest/m3/ts-unsafe/raw-behind-ref.md) - `&raw const *r` of a value JS copies points where the reference came from -- [Vec::from_raw_parts of a typed allocation](/quest/m3/ts-unsafe/vec-from-raw-parts.md) - a `Vec` adopts an `alloc`ed array of `T`s, with its length, capacity, and drops - [Vec::drain from std's MIR](/quest/m3/ts-unsafe/vec-drain-mir.md) - std's `Drain` translates, replacing the runtime's port - [BinaryHeap from std's MIR](/quest/m3/ts-unsafe/binary-heap-mir.md) - std's `BinaryHeap` and `PeekMut` translate, replacing the runtime's port - [Unchecked integer operations](/quest/m3/ts-unsafe/unchecked-ops.md) - `unchecked_*` and `NonZero::new_unchecked` translate, aborting on a violated precondition diff --git a/quest/m3/ts-unsafe/vec-from-raw-parts.md b/quest/m3/ts-unsafe/vec-from-raw-parts.md deleted file mode 100644 index 7e77b7ed5..000000000 --- a/quest/m3/ts-unsafe/vec-from-raw-parts.md +++ /dev/null @@ -1,18 +0,0 @@ -# [S] Vec::from_raw_parts of a typed allocation - -## Goal - -[rust2-ts](/ts/README.md) translates `Vec::from_raw_parts` of memory `alloc` gave for a -`Layout::array::(n)` (or an equal layout), so the `Vec` adopts that JS array of `T`s -with its length and capacity and drops its elements and frees it as std does, proven by -differential tests against native Rust that check length, capacity, and drops. Today it -is an unsupported call. - -## Plan - -Typed allocation is a fresh JS array of `T`s since the 2026-11-01 decision in -[the epic](/quest/m3/ts-unsafe/README.md), and `rs.Vec` holds std's capacity since -[#555](https://github.com/moq-dev/rust2/pull/555). smallvec spills its inline buffer this -way: 2 of its 10 model refusals at the moq pin, which moq drops or binds. - -Public API: the translator's output. diff --git a/ts/README.md b/ts/README.md index a64f2f0b1..970bbc495 100644 --- a/ts/README.md +++ b/ts/README.md @@ -123,7 +123,7 @@ crate translation reaches is refused, and so are two versions of one crate it re | `Ordering`, `DefaultHasher`, `RandomState`, `BuildHasherDefault` | `rs.Ordering`, which is `-1`, `0`, or `1`; `rs.Hasher`; `rs.RandomState`, the keys of the `DefaultHasher` it builds, never changed once made; `undefined`, as `PhantomData` is, whose `build_hasher` is `H::default()` | | `Duration` | `rs.Duration`: `{ secs, nanos }`, std's whole seconds as an `rs.u64` and the nanoseconds past them, never changed once made | | `TypeId` | `rs.TypeId`: rustc's 128-bit hash of the type, which std's holds at run time, as 32 hex digits, equal by `===`; ordered as std's derive orders the hash's pointer-sized words, lowest first, hashed as its high 64 bits, and written as `TypeId(0x…)`, as std's are | -| `Layout`, `alloc::alloc` | `rs.Layout`: `{ size, align }`, never changed once made, checked as std's constructors check it; `alloc` gives an `rs.Block` of its bytes, which a cast of its pointer to `*mut T` the body shows came from `alloc` or `realloc` makes a JS array of `T`s, values JS copies, as an `rs.AtIndex` of its first; a cast back to `*mut u8` only as what `dealloc` or `realloc` takes, which free the array or copy it into a new one; its bytes, read, written, or cast to any other type, are refused, and fail at run time through a pointer from elsewhere | +| `Layout`, `alloc::alloc` | `rs.Layout`: `{ size, align }`, never changed once made, checked as std's constructors check it; `alloc` gives an `rs.Block` of its bytes, which a cast of its pointer to `*mut T` the body shows came from `alloc` or `realloc` makes a JS array of `T`s, values JS copies, as an `rs.AtIndex` of its first; a cast back to `*mut u8` only as what `dealloc` or `realloc` take, an array `Vec::from_raw_parts` adopts as a `Vec`'s itemss, which free the array or copy it into a new one; its bytes, read, written, or cast to any other type, are refused, and fail at run time through a pointer from elsewhere | | closure | an arrow function, with `[Symbol.dispose]` if it owns a value that drops, and what makes its clone if a clone can't be itself | | `fn` pointer, function item as a value | the function, or std's an arrow that calls it as a written call does, as a closure is typed: a `()` result is `undefined`, where a declared function returns `void` | | `&dyn Trait`, `&mut dyn Trait`, `Box`, `Arc`, `Rc`, `Weak`, `Pin

` of one | an object with the trait's methods, its supertraits' included: `shape.area$Shape()`; behind an `Arc` or an `Rc`, an `rs.ArcDyn` sharing the count of the `Arc` it was made from | @@ -1060,7 +1060,14 @@ they need. `truncate`, leaves the room as it was: std's `Vec` makes no promise to keep what it removes, so the slot it gave up is uninitialized, and `set_len` requires every slot it takes in to be initialized, which makes lengthening over that slot undefined in Rust - (decided with the maintainer on 2026-11-07). Their `try_reserve` and `try_reserve_exact`, and a + (decided with the maintainer on 2026-11-07). `Vec::from_raw_parts` of a pointer to the + start of memory from `alloc` or of a `Vec`'s, given up by `ManuallyDrop`, is the `Vec` + of that same storage, holding its first `length` items and, but for bytes, the rest in + its room, which `realloc` of the memory keeps, with the capacity it is given, so it drops + and reads back what std's does. One of a `Box`'s value holds it in the same place the pointer reads and writes, and one of + bytes from `alloc` new storage of the capacity; a + length past the capacity panics as std's check does, which can't unwind, and one of + values JS keeps as objects or of no bytes is refused. Their `try_reserve` and `try_reserve_exact`, and a `String`'s, give `Ok` where `reserve` makes room and `TryReserveError`'s `CapacityOverflow` where it panics, and `AllocError`, of the layout std's asks for, only where JS fails to allocate a byte `Vec`'s or `VecDeque`'s `Uint8Array` (decided with the diff --git a/ts/fixtures/lang/heap/expected/adopt.ts b/ts/fixtures/lang/heap/expected/adopt.ts new file mode 100644 index 000000000..9c1b0f482 --- /dev/null +++ b/ts/fixtures/lang/heap/expected/adopt.ts @@ -0,0 +1,304 @@ +// Generated by rust2-ts. Do not edit. + +import * as rs from "./rs.ts"; +import { thenSome$17jb8m8 } from "./core/bool.ts"; +import { unwrapOr$1fr498u as option_unwrapOr$1fr498u, mapOr$12lsao8 as option_mapOr$12lsao8 } from "./core/option.ts"; + +/** + * Memory from `alloc` for `n` `T`s, laid out by `Layout::array`, or by an equal layout of + * `T`'s size and alignment, grown from `n / 2 + 1` by `realloc` if `grown`. + */ +export function slots$Option_tuple2_u8_u16(n: rs.usize, equal: boolean, grown: boolean): rs.Place<[rs.u8, rs.u16] | undefined> { + const layout: (a0: rs.usize) => rs.Layout = (n2: rs.usize): rs.Layout => { + if (!equal) { + return rs.resultUnwrap(rs.layoutArray(n2, 6, 2), rs.fmtLayoutErrorDebug); + } + return rs.resultUnwrap(rs.layoutFromSizeAlign(rs.usizeMul(6, n2), 2), rs.fmtLayoutErrorDebug); + }; + if (!grown) { + const pointer2 = rs.alloc(layout(n)); + return rs.allocAs(rs.optionUnwrap(pointer2 === rs.NULL ? undefined : pointer2), 6, "std::option::Option<(u8, u16)>"); + } + const pointer = rs.realloc(rs.alloc(layout(rs.usizeAdd(rs.usizeDiv(n, 2), 1))), layout(n).size); + return rs.allocAs(rs.optionUnwrap(pointer === rs.NULL ? undefined : pointer), 6, "std::option::Option<(u8, u16)>"); +} + +/** + * Memory from `alloc` for `n` `T`s, laid out by `Layout::array`, or by an equal layout of + * `T`'s size and alignment, grown from `n / 2 + 1` by `realloc` if `grown`. + */ +export function slots$sync_Arc_u8(n: rs.usize, equal: boolean, grown: boolean): rs.Place> { + const layout: (a0: rs.usize) => rs.Layout = (n2: rs.usize): rs.Layout => { + if (!equal) { + return rs.resultUnwrap(rs.layoutArray(n2, 4, 4), rs.fmtLayoutErrorDebug); + } + return rs.resultUnwrap(rs.layoutFromSizeAlign(rs.usizeMul(4, n2), 4), rs.fmtLayoutErrorDebug); + }; + if (!grown) { + const pointer2 = rs.alloc(layout(n)); + return rs.allocAs(rs.optionUnwrap(pointer2 === rs.NULL ? undefined : pointer2), 4, "std::sync::Arc"); + } + const pointer = rs.realloc(rs.alloc(layout(rs.usizeAdd(rs.usizeDiv(n, 2), 1))), layout(n).size); + return rs.allocAs(rs.optionUnwrap(pointer === rs.NULL ? undefined : pointer), 4, "std::sync::Arc"); +} + +/** + * Memory from `alloc` for `n` `T`s, laid out by `Layout::array`, or by an equal layout of + * `T`'s size and alignment, grown from `n / 2 + 1` by `realloc` if `grown`. + */ +export function slots$u32(n: rs.usize, equal: boolean, grown: boolean): rs.Place { + const layout: (a0: rs.usize) => rs.Layout = (n2: rs.usize): rs.Layout => { + if (!equal) { + return rs.resultUnwrap(rs.layoutArray(n2, 4, 4), rs.fmtLayoutErrorDebug); + } + return rs.resultUnwrap(rs.layoutFromSizeAlign(rs.usizeMul(4, n2), 4), rs.fmtLayoutErrorDebug); + }; + if (!grown) { + const pointer2 = rs.alloc(layout(n)); + return rs.allocAs(rs.optionUnwrap(pointer2 === rs.NULL ? undefined : pointer2), 4, "u32"); + } + const pointer = rs.realloc(rs.alloc(layout(rs.usizeAdd(rs.usizeDiv(n, 2), 1))), layout(n).size); + return rs.allocAs(rs.optionUnwrap(pointer === rs.NULL ? undefined : pointer), 4, "u32"); +} + +/** + * A step on an adopted `Vec`, by `b`, which `make` gives values for: pushes, a `set_len` + * over the slots written past its length, a truncate, or a shrink. + */ +export function step$Option_tuple2_u8_u16_adopt_allocated_closure7(v: rs.Vec<[rs.u8, rs.u16] | undefined>, written: rs.usize, b: rs.u8, make: (a0: rs.usize) => [rs.u8, rs.u16] | undefined): void { + const _5: rs.u8 = rs.u8Rem(b, 4); + if (_5 === 0) { + rs.iterForEach(new rs.Range(0, rs.usizeRem(b >> 2 as rs.usize, 4)), (i: rs.usize): undefined => { + const _3: [rs.u8, rs.u16] | undefined = make(rs.usizeAdd(i, 100)); + v.items.push(_3); + }); + } else if (_5 === 1) { + rs.vecSetLen(v, written, 6, (): [rs.u8, rs.u16] | undefined => { + return (undefined as unknown) as [rs.u8, rs.u16] | undefined; + }); + } else if (_5 === 2) { + rs.vecTruncate(v, rs.usizeRem(b >> 2 as rs.usize, 3)); + } else { + rs.vecShrinkTo(v, 0, 6); + } +} + +/** + * A step on an adopted `Vec`, by `b`, which `make` gives values for: pushes, a `set_len` + * over the slots written past its length, a truncate, or a shrink. + */ +export function step$sync_Arc_u8_adopt_allocated_closure5(v: rs.Vec>, written: rs.usize, b: rs.u8, make: (a0: rs.usize) => rs.Arc): void { + const _5: rs.u8 = rs.u8Rem(b, 4); + if (_5 === 0) { + rs.iterForEach(new rs.Range(0, rs.usizeRem(b >> 2 as rs.usize, 4)), (i: rs.usize): undefined => { + const _3: rs.Arc = make(rs.usizeAdd(i, 100)); + v.items.push(_3); + }); + } else if (_5 === 1) { + rs.vecSetLen(v, written, 4, (): rs.Arc => { + return (undefined as unknown) as rs.Arc; + }); + } else if (_5 === 2) { + rs.vecTruncate(v, rs.usizeRem(b >> 2 as rs.usize, 3), rs.drop); + } else { + rs.vecShrinkTo(v, 0, 4); + } +} + +/** + * A step on an adopted `Vec`, by `b`, which `make` gives values for: pushes, a `set_len` + * over the slots written past its length, a truncate, or a shrink. + */ +export function step$u32_adopt_allocated_closure2(v: rs.Vec, written: rs.usize, b: rs.u8, make: (a0: rs.usize) => rs.u32): void { + const _5: rs.u8 = rs.u8Rem(b, 4); + if (_5 === 0) { + rs.iterForEach(new rs.Range(0, rs.usizeRem(b >> 2 as rs.usize, 4)), (i: rs.usize): undefined => { + const _3: rs.u32 = make(rs.usizeAdd(i, 100)); + v.items.push(_3); + }); + } else if (_5 === 1) { + rs.vecSetLen(v, written, 4, (): rs.u32 => { + return (undefined as unknown) as rs.u32; + }); + } else if (_5 === 2) { + rs.vecTruncate(v, rs.usizeRem(b >> 2 as rs.usize, 3)); + } else { + rs.vecShrinkTo(v, 0, 4); + } +} + +/** + * `Vec`s of `u32`s, of `Arc`s, whose strong counts show each drop, and of `Option` pairs, + * adopting memory from `alloc` of `cap` slots, `written` of them written, `len` of which the + * `Vec` holds, and what each holds and its capacity before and after a step. + */ +export function allocated(data: rs.ByteSlice, out: rs.ByteVec): void { + const shared: rs.Arc = new rs.Arc(7); + const iter: rs.Iter = rs.byteSliceChunks(data, 4); + while (true) { + const _7: rs.ByteSlice | rs.Done = iter.next(); + if (_7 === rs.DONE) { + break; + } + const _15: Uint8Array = rs.bytesFromFn(4, (i: rs.usize): rs.u8 => { + return option_unwrapOr$1fr498u(rs.byteSliceGet(_7, i), 0); + }); + const a: rs.u8 = _15[0]; + const b: rs.u8 = _15[1]; + const c: rs.u8 = _15[2]; + const d: rs.u8 = _15[3]; + const cap: rs.usize = rs.usizeAdd(rs.u8Rem(a, 6) as rs.usize, 1); + const len: rs.usize = rs.usizeRem(b as rs.usize, rs.usizeAdd(cap, 1)); + const written: rs.usize = rs.usizeAdd(len, rs.usizeRem(b >> 4 as rs.usize, rs.usizeAdd(rs.usizeSub(cap, len), 1))); + const _41: [boolean, boolean] = [(a & 64) !== 0, (a & 128) !== 0]; + const equal: boolean = _41[0]; + const grown: boolean = _41[1]; + const ints: rs.Place = slots$u32(cap, equal, grown); + rs.iterForEach(new rs.Range(0, written), (i2: rs.usize): undefined => { + rs.ptrAdd(ints, i2).v = rs.u32Add(rs.u32Mul(c as rs.u32, 1000), i2 as rs.u32); + }); + const ints2: rs.Vec = rs.vecFromRawParts(ints, len, cap, 4); + rs.iterExtendBytes(out, rs.iterSlice(Uint8Array.of(ints2.items.length & 0xff, rs.vecCapacity(ints2, 4) & 0xff)), undefined, true); + step$u32_adopt_allocated_closure2(ints2, written, d, (i3: rs.usize): rs.u32 => { + return i3 as rs.u32; + }); + rs.iterExtendBytes(out, rs.iterSlice(Uint8Array.of(ints2.items.length & 0xff, rs.vecCapacity(ints2, 4) & 0xff)), undefined, true); + rs.iterExtendBytes(out, rs.iterFlatMap(rs.iterSlice(ints2.items), (x: rs.u32): Uint8Array => { + return rs.u32ToBeBytes(x).reverse(); + }, (value: Uint8Array) => rs.iterSlice(value), true, 4), undefined, true); + const arcs: rs.Place> = slots$sync_Arc_u8(cap, equal, grown); + rs.iterForEach(new rs.Range(0, written), (i4: rs.usize): undefined => { + rs.ptrAdd(arcs, i4).v = rs.arcClone(shared); + }); + const arcs2: rs.Vec> = rs.vecFromRawParts(arcs, len, cap, 4); + rs.byteVecPush(out, shared.strong & 0xff); + const _89: rs.u8 = d >> 1; + const _92: (a0: rs.usize) => rs.Arc = (_2: rs.usize): rs.Arc => { + return rs.arcClone(shared); + }; + step$sync_Arc_u8_adopt_allocated_closure5(arcs2, written, _89, _92); + rs.iterExtendBytes(out, rs.iterSlice(Uint8Array.of(arcs2.items.length & 0xff, rs.vecCapacity(arcs2, 4) & 0xff, shared.strong & 0xff)), undefined, true); + rs.dropVec(arcs2); + rs.byteVecPush(out, shared.strong & 0xff); + const pairs: rs.Place<[rs.u8, rs.u16] | undefined> = slots$Option_tuple2_u8_u16(cap, !equal, false); + rs.iterForEach(new rs.Range(0, written), (i5: rs.usize): undefined => { + rs.ptrAdd(pairs, i5).v = thenSome$17jb8m8((c & rs.u8Shl(1, i5)) !== 0, [c, i5 & 0xffff] as [rs.u8, rs.u16]); + }); + const pairs2: rs.Vec<[rs.u8, rs.u16] | undefined> = rs.vecFromRawParts(pairs, len, cap, 6); + step$Option_tuple2_u8_u16_adopt_allocated_closure7(pairs2, written, d >> 2, (i6: rs.usize): [rs.u8, rs.u16] | undefined => { + return [d, i6 & 0xffff] as [rs.u8, rs.u16]; + }); + rs.iterExtendBytes(out, rs.iterSlice(Uint8Array.of(pairs2.items.length & 0xff, rs.vecCapacity(pairs2, 6) & 0xff)), undefined, true); + rs.iterExtendBytes(out, rs.iterMap(rs.iterSlice(pairs2.items), (p: [rs.u8, rs.u16] | undefined): rs.u8 => { + return option_mapOr$12lsao8(p, 0, (_22: [rs.u8, rs.u16]): rs.u8 => { + return _22[0] ^ (_22[1] & 0xff); + }); + }), undefined, true); + } + shared[Symbol.dispose](); +} + +/** + * `Vec`s given up by `ManuallyDrop` and adopted again by `from_raw_parts`, with and + * without room past their length, some of it written through the pointer, one from the + * pointer to its spare capacity while empty, one grown by `realloc` and adopted again, + * `Vec`s of a `Box`'s value and of bytes from `alloc`, and the empty `Vec` of a dangling + * pointer. + */ +export function readopted(data: rs.ByteSlice, out: rs.ByteVec): void { + const shared: rs.Arc = new rs.Arc(7); + const n: rs.usize = data.length; + const extra: rs.usize = rs.u8Rem(option_unwrapOr$1fr498u(rs.byteSliceFirst(data), 0), 4) as rs.usize; + const ints: rs.Vec = rs.vecWithCapacity(rs.usizeAdd(n, extra), 4); + const _16: rs.Iter = rs.iterMap(rs.iterSlice(rs.byteSliceView(data)), (_2: rs.u8): rs.u32 => { + return ((_2 as rs.u32) << 4) >>> 0; + }); + rs.iterExtend(ints, _16, undefined, 4, true); + const ints2: rs.Vec = ints; + const p: rs.Place = rs.vecAsPtr(ints2, 4); + rs.iterForEach(new rs.Range(n, rs.usizeAdd(n, extra)), (i: rs.usize): undefined => { + rs.ptrAdd(p, i).v = i as rs.u32; + }); + const _30: rs.usize = rs.vecCapacity(ints2, 4); + const ints3: rs.Vec = rs.vecFromRawParts(p, n, _30, 4); + rs.iterExtendBytes(out, rs.iterSlice(Uint8Array.of(ints3.items.length & 0xff, rs.vecCapacity(ints3, 4) & 0xff)), undefined, true); + rs.vecSetLen(ints3, rs.usizeAdd(n, extra), 4, (): rs.u32 => { + return (undefined as unknown) as rs.u32; + }); + ints3.items.push(9); + rs.iterExtendBytes(out, rs.iterSlice(Uint8Array.of(ints3.items.length & 0xff, rs.vecCapacity(ints3, 4) & 0xff)), undefined, true); + rs.iterExtendBytes(out, rs.iterFlatMap(rs.iterSlice(ints3.items), (x: rs.u32): Uint8Array => { + return rs.u32ToBeBytes(x).reverse(); + }, (value: Uint8Array) => rs.iterSlice(value), true, 4), undefined, true); + const arcs2: rs.Vec> = rs.iterToVec(rs.iterMap(rs.iterSlice(rs.byteSliceView(data)), (_22: rs.u8): rs.Arc => { + return rs.arcClone(shared); + }), undefined, 4, true); + const _69: [rs.Place>, rs.usize, rs.usize] = [rs.vecAsPtr(arcs2, 4), arcs2.items.length, rs.vecCapacity(arcs2, 4)]; + const arcs3: rs.Vec> = rs.vecFromRawParts(_69[0], rs.usizeDiv(_69[1], 2), _69[2], 4); + rs.iterExtendBytes(out, rs.iterSlice(Uint8Array.of(arcs3.items.length & 0xff, rs.vecCapacity(arcs3, 4) & 0xff, shared.strong & 0xff)), undefined, true); + rs.dropVec(arcs3); + rs.byteVecPush(out, shared.strong & 0xff); + const bytes: rs.ByteVec = rs.byteSliceToByteVec(data); + rs.byteVecReserve(bytes, extra); + const _106: [rs.Place, rs.usize, rs.usize] = [rs.byteVecAsPtr(bytes), bytes.length, bytes.data.length]; + const bytes2: rs.ByteVec = rs.byteVecFromRawParts(_106[0], _106[1], _106[2]); + rs.byteVecPush(bytes2, 1); + rs.iterExtendBytes(out, rs.iterSlice(Uint8Array.of(bytes2.length & 0xff, bytes2.data.length & 0xff)), undefined, true); + rs.byteVecExtendFromSlice(out, rs.byteVecSlice(bytes2)); + const spare: rs.Vec = rs.vecWithCapacity(rs.usizeAdd(n, 1), 4); + const cap3: rs.usize = rs.vecCapacity(spare, 4); + const p4: rs.Place = rs.sliceAsPtr(rs.vecSpare(spare, 4, (): rs.u32 => { + return (undefined as unknown) as rs.u32; + })); + rs.iterForEach(new rs.Range(0, cap3), (i2: rs.usize): undefined => { + rs.ptrAdd(p4, i2).v = rs.u32Mul(i2 as rs.u32, 3); + }); + const spare2: rs.Vec = rs.vecFromRawParts(p4, rs.usizeAdd(rs.usizeDiv(n, 2), 1), cap3, 4); + rs.iterExtendBytes(out, rs.iterSlice(Uint8Array.of(spare2.items.length & 0xff, rs.vecCapacity(spare2, 4) & 0xff)), undefined, true); + rs.iterExtendBytes(out, rs.iterFlatMap(rs.iterSlice(spare2.items), (x2: rs.u32): Uint8Array => { + return rs.u32ToBeBytes(x2).reverse(); + }, (value: Uint8Array) => rs.iterSlice(value), true, 4), undefined, true); + const p5: rs.Place = slots$u32(2, false, false); + p5.v = rs.u32Add(10, n as rs.u32); + rs.ptrAdd(p5, 1).v = 20; + const kept: rs.Vec = rs.vecFromRawParts(p5, 1, 2, 4); + const old: rs.Layout = rs.resultUnwrap(rs.layoutArray(rs.vecCapacity(kept, 4), 4, 4), rs.fmtLayoutErrorDebug); + const grown: rs.Vec = rs.vecFromRawParts(rs.allocAs(rs.realloc(rs.allocBytes(rs.vecAsPtr(kept, 4), 4, "u32"), rs.usizeAdd(old.size, 4)), 4, "u32"), 2, 3, 4); + rs.iterExtendBytes(out, rs.iterSlice(Uint8Array.of(grown.items.length & 0xff, rs.vecCapacity(grown, 4) & 0xff)), undefined, true); + rs.iterExtendBytes(out, rs.iterFlatMap(rs.iterSlice(grown.items), (x3: rs.u32): Uint8Array => { + return rs.u32ToBeBytes(x3).reverse(); + }, (value: Uint8Array) => rs.iterSlice(value), true, 4), undefined, true); + const p6: rs.Place = { v: rs.u32Mul(n as rs.u32, 7) }; + const boxed: rs.Vec = rs.vecFromRawParts(p6, rs.usizeRem(n, 2), 1, 4); + rs.vecSetLen(boxed, 1, 4, (): rs.u32 => { + return (undefined as unknown) as rs.u32; + }); + const at = rs.idx(boxed.items, 0); + boxed.items[at] = rs.u32Add(boxed.items[at], 1); + p6.v = rs.u32Add(p6.v, 2); + rs.iterExtendBytes(out, rs.iterSlice(rs.u32ToBeBytes(p6.v).reverse()), undefined, true); + boxed.items.push(3); + rs.iterExtendBytes(out, rs.iterSlice(Uint8Array.of(boxed.items.length & 0xff, rs.vecCapacity(boxed, 4) & 0xff)), undefined, true); + rs.iterExtendBytes(out, rs.iterFlatMap(rs.iterSlice(boxed.items), (x4: rs.u32): Uint8Array => { + return rs.u32ToBeBytes(x4).reverse(); + }, (value: Uint8Array) => rs.iterSlice(value), true, 4), undefined, true); + const b: rs.Place = { v: n & 0xff }; + const byte: rs.ByteVec = rs.byteVecFromRawParts(b, 1, 1); + const at2 = rs.idx(byte, 0); + byte.data[at2] = byte.data[at2] ^ 1; + b.v = rs.u8WrappingAdd(b.v, 1); + rs.byteVecPush(out, b.v); + rs.byteVecPush(byte, 4); + rs.byteVecExtendFromSlice(out, rs.byteVecSlice(byte)); + const fresh: rs.ByteVec = rs.byteVecFromRawParts(rs.alloc(rs.resultUnwrap(rs.layoutArray(rs.usizeAdd(extra, 1), 1, 1), rs.fmtLayoutErrorDebug)), 0, rs.usizeAdd(extra, 1)); + rs.byteVecExtendFromSlice(fresh, data); + rs.iterExtendBytes(out, rs.iterSlice(Uint8Array.of(fresh.length & 0xff, fresh.data.length & 0xff)), undefined, true); + rs.byteVecExtendFromSlice(out, rs.byteVecSlice(fresh)); + const none: rs.Vec = rs.vecFromRawParts(rs.DANGLING, 0, 0, 4); + rs.iterExtendBytes(out, rs.iterSlice(Uint8Array.of(none.items.length & 0xff, rs.vecCapacity(none, 4) & 0xff)), undefined, true); + none.items.push(n as rs.u32); + rs.iterExtendBytes(out, rs.iterSlice(Uint8Array.of(none.items.length & 0xff, rs.vecCapacity(none, 4) & 0xff, none.items[rs.idx(none.items, 0)] & 0xff)), undefined, true); + shared[Symbol.dispose](); +} + +//# sourceMappingURL=adopt.ts.map diff --git a/ts/fixtures/lang/heap/expected/lib.ts b/ts/fixtures/lang/heap/expected/lib.ts index c0346c86f..31b6e743a 100644 --- a/ts/fixtures/lang/heap/expected/lib.ts +++ b/ts/fixtures/lang/heap/expected/lib.ts @@ -1,6 +1,7 @@ // Generated by rust2-ts. Do not edit. import * as rs from "./rs.ts"; +import { allocated, readopted } from "./adopt.ts"; import { spills, remnants, layouts } from "./heap.ts"; import * as Spill from "./heap.Spill.ts"; @@ -27,6 +28,10 @@ export function cases(): rs.Vec<[string, (a0: rs.u8, a1: rs.ByteSlice, a2: rs.By layouts(data2, out2); }] as [string, (a0: rs.u8, a1: rs.ByteSlice, a2: rs.ByteVec) => undefined], ["heap::remnants", (_24: rs.u8, data3: rs.ByteSlice, out3: rs.ByteVec): undefined => { remnants(data3, out3); + }] as [string, (a0: rs.u8, a1: rs.ByteSlice, a2: rs.ByteVec) => undefined], ["adopt::allocated", (_25: rs.u8, data4: rs.ByteSlice, out4: rs.ByteVec): undefined => { + allocated(data4, out4); + }] as [string, (a0: rs.u8, a1: rs.ByteSlice, a2: rs.ByteVec) => undefined], ["adopt::readopted", (_26: rs.u8, data5: rs.ByteSlice, out5: rs.ByteVec): undefined => { + readopted(data5, out5); }] as [string, (a0: rs.u8, a1: rs.ByteSlice, a2: rs.ByteVec) => undefined]]); } diff --git a/ts/fixtures/lang/heap/src/adopt.rs b/ts/fixtures/lang/heap/src/adopt.rs new file mode 100644 index 000000000..ccedaaf7d --- /dev/null +++ b/ts/fixtures/lang/heap/src/adopt.rs @@ -0,0 +1,171 @@ +//! `Vec`s adopting memory by `from_raw_parts`, with its length and capacity: memory from +//! `alloc` laid out as an array, grown by `realloc` or not, and a `Vec`'s own, given up by +//! `ManuallyDrop`. Each drops what it holds and frees the memory as std's does. + +use std::alloc::{self, Layout}; +use std::mem::{self, ManuallyDrop}; +use std::ptr::NonNull; +use std::sync::Arc; + +/// Memory from `alloc` for `n` `T`s, laid out by `Layout::array`, or by an equal layout of +/// `T`'s size and alignment, grown from `n / 2 + 1` by `realloc` if `grown`. +fn slots(n: usize, equal: bool, grown: bool) -> *mut T { + let layout = |n: usize| match equal { + false => Layout::array::(n).unwrap(), + true => Layout::from_size_align(mem::size_of::() * n, mem::align_of::()).unwrap(), + }; + unsafe { + if grown { + let first = layout(n / 2 + 1); + let p = alloc::alloc(first); + NonNull::new(alloc::realloc(p, first, layout(n).size())) + .unwrap() + .cast() + .as_ptr() + } else { + NonNull::new(alloc::alloc(layout(n))).unwrap().cast().as_ptr() + } + } +} + +/// A step on an adopted `Vec`, by `b`, which `make` gives values for: pushes, a `set_len` +/// over the slots written past its length, a truncate, or a shrink. +fn step(v: &mut Vec, written: usize, b: u8, make: impl Fn(usize) -> T) { + match b % 4 { + 0 => (0..usize::from(b >> 2) % 4).for_each(|i| v.push(make(i + 100))), + // SAFETY: the slots up to `written` hold what was written there before the `Vec` + // adopted them, and no step since touched them. + 1 => unsafe { v.set_len(written) }, + 2 => v.truncate(usize::from(b >> 2) % 3), + _ => v.shrink_to_fit(), + } +} + +/// `Vec`s of `u32`s, of `Arc`s, whose strong counts show each drop, and of `Option` pairs, +/// adopting memory from `alloc` of `cap` slots, `written` of them written, `len` of which the +/// `Vec` holds, and what each holds and its capacity before and after a step. +pub fn allocated(data: &[u8], out: &mut Vec) { + let shared = Arc::new(7u8); + for part in data.chunks(4) { + let [a, b, c, d] = std::array::from_fn(|i| part.get(i).copied().unwrap_or(0)); + let cap = usize::from(a % 6) + 1; + let len = usize::from(b) % (cap + 1); + let written = len + usize::from(b >> 4) % (cap - len + 1); + let (equal, grown) = (a & 0x40 != 0, a & 0x80 != 0); + + let ints = slots::(cap, equal, grown); + (0..written).for_each(|i| unsafe { ints.add(i).write(u32::from(c) * 1000 + i as u32) }); + let mut ints = unsafe { Vec::from_raw_parts(ints, len, cap) }; + out.extend([ints.len() as u8, ints.capacity() as u8]); + step(&mut ints, written, d, |i| i as u32); + out.extend([ints.len() as u8, ints.capacity() as u8]); + out.extend(ints.iter().flat_map(|x| x.to_le_bytes())); + + let arcs = slots::>(cap, equal, grown); + (0..written).for_each(|i| unsafe { arcs.add(i).write(shared.clone()) }); + let mut arcs = unsafe { Vec::from_raw_parts(arcs, len, cap) }; + out.push(Arc::strong_count(&shared) as u8); + step(&mut arcs, written, d >> 1, |_| shared.clone()); + out.extend([ + arcs.len() as u8, + arcs.capacity() as u8, + Arc::strong_count(&shared) as u8, + ]); + drop(arcs); + out.push(Arc::strong_count(&shared) as u8); + + let pairs = slots::>(cap, !equal, false); + (0..written).for_each(|i| unsafe { pairs.add(i).write((c & 1 << i != 0).then_some((c, i as u16))) }); + let mut pairs = unsafe { Vec::from_raw_parts(pairs, len, cap) }; + step(&mut pairs, written, d >> 2, |i| Some((d, i as u16))); + out.extend([pairs.len() as u8, pairs.capacity() as u8]); + out.extend(pairs.iter().map(|p| p.map_or(0, |(x, y)| x ^ y as u8))); + } +} + +/// `Vec`s given up by `ManuallyDrop` and adopted again by `from_raw_parts`, with and +/// without room past their length, some of it written through the pointer, one from the +/// pointer to its spare capacity while empty, one grown by `realloc` and adopted again, +/// `Vec`s of a `Box`'s value and of bytes from `alloc`, and the empty `Vec` of a dangling +/// pointer. +pub fn readopted(data: &[u8], out: &mut Vec) { + let shared = Arc::new(7u8); + let n = data.len(); + let extra = usize::from(data.first().copied().unwrap_or(0) % 4); + + let mut ints = Vec::with_capacity(n + extra); + ints.extend(data.iter().map(|&b| u32::from(b) << 4)); + let mut ints = ManuallyDrop::new(ints); + let p = ints.as_mut_ptr(); + (n..n + extra).for_each(|i| unsafe { p.add(i).write(i as u32) }); + let mut ints = unsafe { Vec::from_raw_parts(p, n, ints.capacity()) }; + out.extend([ints.len() as u8, ints.capacity() as u8]); + unsafe { ints.set_len(n + extra) }; + ints.push(9); + out.extend([ints.len() as u8, ints.capacity() as u8]); + out.extend(ints.iter().flat_map(|x| x.to_le_bytes())); + + let arcs: Vec<_> = data.iter().map(|_| shared.clone()).collect(); + let mut arcs = ManuallyDrop::new(arcs); + let (p, len, cap) = (arcs.as_mut_ptr(), arcs.len(), arcs.capacity()); + let arcs = unsafe { Vec::from_raw_parts(p, len / 2, cap) }; + out.extend([ + arcs.len() as u8, + arcs.capacity() as u8, + Arc::strong_count(&shared) as u8, + ]); + drop(arcs); + out.push(Arc::strong_count(&shared) as u8); + + let mut bytes = ManuallyDrop::new(data.to_vec()); + bytes.reserve(extra); + let (p, len, cap) = (bytes.as_mut_ptr(), bytes.len(), bytes.capacity()); + let mut bytes = unsafe { Vec::from_raw_parts(p, len, cap) }; + bytes.push(1); + out.extend([bytes.len() as u8, bytes.capacity() as u8]); + out.extend_from_slice(&bytes); + + let mut spare = ManuallyDrop::new(Vec::::with_capacity(n + 1)); + let cap = spare.capacity(); + let p = spare.spare_capacity_mut().as_mut_ptr().cast::(); + (0..cap).for_each(|i| unsafe { p.add(i).write(i as u32 * 3) }); + let spare = unsafe { Vec::from_raw_parts(p, n / 2 + 1, cap) }; + out.extend([spare.len() as u8, spare.capacity() as u8]); + out.extend(spare.iter().flat_map(|x| x.to_le_bytes())); + + let p = slots::(2, false, false); + unsafe { (p.write(10 + n as u32), p.add(1).write(20)) }; + let mut kept = ManuallyDrop::new(unsafe { Vec::from_raw_parts(p, 1, 2) }); + let old = Layout::array::(kept.capacity()).unwrap(); + let q = unsafe { alloc::realloc(kept.as_mut_ptr() as *mut u8, old, old.size() + 4) }; + let grown = unsafe { Vec::from_raw_parts(q.cast::(), 2, 3) }; + out.extend([grown.len() as u8, grown.capacity() as u8]); + out.extend(grown.iter().flat_map(|x| x.to_le_bytes())); + + let p = Box::into_raw(Box::new(n as u32 * 7)); + let mut boxed = unsafe { Vec::from_raw_parts(p, n % 2, 1) }; + unsafe { boxed.set_len(1) }; + boxed[0] += 1; + unsafe { *p += 2 }; + out.extend(unsafe { *p }.to_le_bytes()); + boxed.push(3); + out.extend([boxed.len() as u8, boxed.capacity() as u8]); + out.extend(boxed.iter().flat_map(|x| x.to_le_bytes())); + let b = Box::into_raw(Box::new(n as u8)); + let mut byte = unsafe { Vec::from_raw_parts(b, 1, 1) }; + byte[0] ^= 1; + unsafe { *b = b.read().wrapping_add(1) }; + out.push(unsafe { *b }); + byte.push(4); + out.extend_from_slice(&byte); + let raw = unsafe { alloc::alloc(Layout::array::(extra + 1).unwrap()) }; + let mut fresh = unsafe { Vec::from_raw_parts(raw, 0, extra + 1) }; + fresh.extend_from_slice(data); + out.extend([fresh.len() as u8, fresh.capacity() as u8]); + out.extend_from_slice(&fresh); + + let mut none = unsafe { Vec::::from_raw_parts(NonNull::dangling().as_ptr(), 0, 0) }; + out.extend([none.len() as u8, none.capacity() as u8]); + none.push(n as u32); + out.extend([none.len() as u8, none.capacity() as u8, none[0] as u8]); +} diff --git a/ts/fixtures/lang/heap/src/lib.rs b/ts/fixtures/lang/heap/src/lib.rs index 1462c94ce..d5c290e81 100644 --- a/ts/fixtures/lang/heap/src/lib.rs +++ b/ts/fixtures/lang/heap/src/lib.rs @@ -1,6 +1,7 @@ //! A part of the language the driver translates, exercised against native Rust: what //! each of its modules says. +mod adopt; #[path = "../../harness.rs"] pub mod harness; mod heap; @@ -19,5 +20,7 @@ fn cases() -> Vec<(&'static str, Case)> { ("heap::spills", |_, data, out| heap::spills(data, out)), ("heap::layouts", |_, data, out| heap::layouts(data, out)), ("heap::remnants", |_, data, out| heap::remnants(data, out)), + ("adopt::allocated", |_, data, out| adopt::allocated(data, out)), + ("adopt::readopted", |_, data, out| adopt::readopted(data, out)), ] } diff --git a/ts/fixtures/lang/panics/hook/expected/hooked.ts b/ts/fixtures/lang/panics/hook/expected/hooked.ts index 8a2f337d4..f2da2a0de 100644 --- a/ts/fixtures/lang/panics/hook/expected/hooked.ts +++ b/ts/fixtures/lang/panics/hook/expected/hooked.ts @@ -83,7 +83,7 @@ export function hook(): void { captured(info); }, (): void => { rs.drop(captured); - }), { capacity: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/raw_vec/mod.rs", line: 29, col: 5 }, trusted_capacity: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/spec_from_iter_nested.rs", line: 57, col: 18 }, swap_remove: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 2178, col: 13 }, vec_set_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 2138, col: 9 }, into_flattened: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 3667, col: 36 }, rotate_left: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/mod.rs", line: 3902, col: 9 }, rotate_right: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/mod.rs", line: 3948, col: 9 }, ord_violation: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/sort/shared/smallsort.rs", line: 854, col: 5 }, ord_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cmp.rs", line: 1166, col: 9 }, f32_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/num/f32.rs", line: 1665, col: 9 }, f64_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/num/f64.rs", line: 1643, col: 9 }, encode_utf8: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/char/methods.rs", line: 2507, col: 9 }, encode_utf16: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/char/methods.rs", line: 2601, col: 13 }, format: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/fmt.rs", line: 657, col: 14 }, to_string: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/string.rs", line: 2997, col: 14 }, debug_struct_fields: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/fmt/mod.rs", line: 2572, col: 9 }, exact_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/traits/exact_size.rs", line: 122, col: 9 }, join_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/str.rs", line: 177, col: 10 }, int_sum: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/traits/accum.rs", line: 206, col: 1 }, int_forward: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/range.rs", line: 554, col: 1 }, char_forward: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/range.rs", line: 119, col: 45 }, hash_capacity: { file: "/cargo/registry/25cdd57fae9f0462/hashbrown-0.17.1/src/raw.rs", line: 36, col: 40 }, btree_range_equal_BTreeSet: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 110, col: 21 }, btree_range_equal_BTreeMap: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 112, col: 21 }, btree_range_order_BTreeSet: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 119, col: 21 }, btree_range_order_BTreeMap: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 121, col: 21 }, deque_insert: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 2612, col: 9 }, deque_swap_i: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 1062, col: 9 }, deque_swap_j: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 1063, col: 9 }, deque_rotate_left: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 3198, col: 9 }, deque_rotate_right: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 3243, col: 9 }, deque_split_off: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 2724, col: 9 }, list_split_off: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/linked_list.rs", line: 1015, col: 9 }, mutex_lock: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/std/src/sys/sync/mutex/no_threads.rs", line: 28, col: 9 }, once_force: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/std/src/sync/once.rs", line: 227, col: 20 }, reentrant_init: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell/once.rs", line: 325, col: 66 }, lazy_poisoned: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell/lazy.rs", line: 386, col: 5 }, ready_poll: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/future/ready.rs", line: 23, col: 35 }, ready_into_inner: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/future/ready.rs", line: 46, col: 16 }, duration_new: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 281, col: 18 }, duration_from_mins: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 540, col: 13 }, duration_from_hours: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 510, col: 13 }, duration_add: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1345, col: 31 }, duration_sub: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1365, col: 31 }, duration_mul: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1385, col: 31 }, bytes_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/lib.rs", line: 207, col: 5 }, bytes_does_not_fit: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/lib.rs", line: 215, col: 5 }, bytes_slice: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 374, col: 28 }, bytes_slice_ref_start: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 426, col: 9 }, bytes_slice_ref_end: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 432, col: 9 }, bytes_split_off: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 481, col: 9 }, bytes_split_to: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 533, col: 9 }, bytes_buf_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 694, col: 9 }, bytes_mut_split_off: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 329, col: 9 }, bytes_mut_split_to: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 408, col: 9 }, bytes_mut_set_len: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 545, col: 9 }, bytes_mut_overflow: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 700, col: 21 }, bytes_mut_overflow_offset: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 720, col: 29 }, bytes_mut_buf_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 1246, col: 9 } }); + }), { capacity: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/raw_vec/mod.rs", line: 29, col: 5 }, trusted_capacity: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/spec_from_iter_nested.rs", line: 57, col: 18 }, swap_remove: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 2178, col: 13 }, vec_set_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 2138, col: 9 }, vec_from_raw_parts: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 1133, col: 9 }, into_flattened: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 3667, col: 36 }, rotate_left: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/mod.rs", line: 3902, col: 9 }, rotate_right: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/mod.rs", line: 3948, col: 9 }, ord_violation: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/sort/shared/smallsort.rs", line: 854, col: 5 }, ord_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cmp.rs", line: 1166, col: 9 }, f32_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/num/f32.rs", line: 1665, col: 9 }, f64_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/num/f64.rs", line: 1643, col: 9 }, encode_utf8: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/char/methods.rs", line: 2507, col: 9 }, encode_utf16: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/char/methods.rs", line: 2601, col: 13 }, format: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/fmt.rs", line: 657, col: 14 }, to_string: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/string.rs", line: 2997, col: 14 }, debug_struct_fields: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/fmt/mod.rs", line: 2572, col: 9 }, exact_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/traits/exact_size.rs", line: 122, col: 9 }, join_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/str.rs", line: 177, col: 10 }, int_sum: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/traits/accum.rs", line: 206, col: 1 }, int_forward: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/range.rs", line: 554, col: 1 }, char_forward: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/range.rs", line: 119, col: 45 }, hash_capacity: { file: "/cargo/registry/25cdd57fae9f0462/hashbrown-0.17.1/src/raw.rs", line: 36, col: 40 }, btree_range_equal_BTreeSet: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 110, col: 21 }, btree_range_equal_BTreeMap: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 112, col: 21 }, btree_range_order_BTreeSet: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 119, col: 21 }, btree_range_order_BTreeMap: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 121, col: 21 }, deque_insert: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 2612, col: 9 }, deque_swap_i: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 1062, col: 9 }, deque_swap_j: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 1063, col: 9 }, deque_rotate_left: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 3198, col: 9 }, deque_rotate_right: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 3243, col: 9 }, deque_split_off: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 2724, col: 9 }, list_split_off: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/linked_list.rs", line: 1015, col: 9 }, mutex_lock: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/std/src/sys/sync/mutex/no_threads.rs", line: 28, col: 9 }, once_force: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/std/src/sync/once.rs", line: 227, col: 20 }, reentrant_init: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell/once.rs", line: 325, col: 66 }, lazy_poisoned: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell/lazy.rs", line: 386, col: 5 }, ready_poll: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/future/ready.rs", line: 23, col: 35 }, ready_into_inner: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/future/ready.rs", line: 46, col: 16 }, duration_new: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 281, col: 18 }, duration_from_mins: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 540, col: 13 }, duration_from_hours: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 510, col: 13 }, duration_add: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1345, col: 31 }, duration_sub: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1365, col: 31 }, duration_mul: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1385, col: 31 }, bytes_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/lib.rs", line: 207, col: 5 }, bytes_does_not_fit: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/lib.rs", line: 215, col: 5 }, bytes_slice: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 374, col: 28 }, bytes_slice_ref_start: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 426, col: 9 }, bytes_slice_ref_end: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 432, col: 9 }, bytes_split_off: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 481, col: 9 }, bytes_split_to: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 533, col: 9 }, bytes_buf_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 694, col: 9 }, bytes_mut_split_off: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 329, col: 9 }, bytes_mut_split_to: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 408, col: 9 }, bytes_mut_set_len: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 545, col: 9 }, bytes_mut_overflow: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 700, col: 21 }, bytes_mut_overflow_offset: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 720, col: 29 }, bytes_mut_buf_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 1246, col: 9 } }); } /** @@ -103,7 +103,7 @@ export function sized(): void { captured(info); }, (): void => { rs.drop(captured); - }), { capacity: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/raw_vec/mod.rs", line: 29, col: 5 }, trusted_capacity: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/spec_from_iter_nested.rs", line: 57, col: 18 }, swap_remove: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 2178, col: 13 }, vec_set_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 2138, col: 9 }, into_flattened: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 3667, col: 36 }, rotate_left: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/mod.rs", line: 3902, col: 9 }, rotate_right: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/mod.rs", line: 3948, col: 9 }, ord_violation: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/sort/shared/smallsort.rs", line: 854, col: 5 }, ord_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cmp.rs", line: 1166, col: 9 }, f32_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/num/f32.rs", line: 1665, col: 9 }, f64_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/num/f64.rs", line: 1643, col: 9 }, encode_utf8: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/char/methods.rs", line: 2507, col: 9 }, encode_utf16: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/char/methods.rs", line: 2601, col: 13 }, format: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/fmt.rs", line: 657, col: 14 }, to_string: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/string.rs", line: 2997, col: 14 }, debug_struct_fields: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/fmt/mod.rs", line: 2572, col: 9 }, exact_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/traits/exact_size.rs", line: 122, col: 9 }, join_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/str.rs", line: 177, col: 10 }, int_sum: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/traits/accum.rs", line: 206, col: 1 }, int_forward: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/range.rs", line: 554, col: 1 }, char_forward: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/range.rs", line: 119, col: 45 }, hash_capacity: { file: "/cargo/registry/25cdd57fae9f0462/hashbrown-0.17.1/src/raw.rs", line: 36, col: 40 }, btree_range_equal_BTreeSet: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 110, col: 21 }, btree_range_equal_BTreeMap: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 112, col: 21 }, btree_range_order_BTreeSet: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 119, col: 21 }, btree_range_order_BTreeMap: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 121, col: 21 }, deque_insert: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 2612, col: 9 }, deque_swap_i: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 1062, col: 9 }, deque_swap_j: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 1063, col: 9 }, deque_rotate_left: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 3198, col: 9 }, deque_rotate_right: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 3243, col: 9 }, deque_split_off: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 2724, col: 9 }, list_split_off: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/linked_list.rs", line: 1015, col: 9 }, mutex_lock: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/std/src/sys/sync/mutex/no_threads.rs", line: 28, col: 9 }, once_force: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/std/src/sync/once.rs", line: 227, col: 20 }, reentrant_init: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell/once.rs", line: 325, col: 66 }, lazy_poisoned: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell/lazy.rs", line: 386, col: 5 }, ready_poll: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/future/ready.rs", line: 23, col: 35 }, ready_into_inner: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/future/ready.rs", line: 46, col: 16 }, duration_new: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 281, col: 18 }, duration_from_mins: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 540, col: 13 }, duration_from_hours: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 510, col: 13 }, duration_add: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1345, col: 31 }, duration_sub: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1365, col: 31 }, duration_mul: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1385, col: 31 }, bytes_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/lib.rs", line: 207, col: 5 }, bytes_does_not_fit: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/lib.rs", line: 215, col: 5 }, bytes_slice: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 374, col: 28 }, bytes_slice_ref_start: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 426, col: 9 }, bytes_slice_ref_end: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 432, col: 9 }, bytes_split_off: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 481, col: 9 }, bytes_split_to: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 533, col: 9 }, bytes_buf_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 694, col: 9 }, bytes_mut_split_off: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 329, col: 9 }, bytes_mut_split_to: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 408, col: 9 }, bytes_mut_set_len: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 545, col: 9 }, bytes_mut_overflow: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 700, col: 21 }, bytes_mut_overflow_offset: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 720, col: 29 }, bytes_mut_buf_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 1246, col: 9 } }); + }), { capacity: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/raw_vec/mod.rs", line: 29, col: 5 }, trusted_capacity: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/spec_from_iter_nested.rs", line: 57, col: 18 }, swap_remove: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 2178, col: 13 }, vec_set_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 2138, col: 9 }, vec_from_raw_parts: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 1133, col: 9 }, into_flattened: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 3667, col: 36 }, rotate_left: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/mod.rs", line: 3902, col: 9 }, rotate_right: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/mod.rs", line: 3948, col: 9 }, ord_violation: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/sort/shared/smallsort.rs", line: 854, col: 5 }, ord_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cmp.rs", line: 1166, col: 9 }, f32_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/num/f32.rs", line: 1665, col: 9 }, f64_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/num/f64.rs", line: 1643, col: 9 }, encode_utf8: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/char/methods.rs", line: 2507, col: 9 }, encode_utf16: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/char/methods.rs", line: 2601, col: 13 }, format: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/fmt.rs", line: 657, col: 14 }, to_string: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/string.rs", line: 2997, col: 14 }, debug_struct_fields: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/fmt/mod.rs", line: 2572, col: 9 }, exact_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/traits/exact_size.rs", line: 122, col: 9 }, join_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/str.rs", line: 177, col: 10 }, int_sum: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/traits/accum.rs", line: 206, col: 1 }, int_forward: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/range.rs", line: 554, col: 1 }, char_forward: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/range.rs", line: 119, col: 45 }, hash_capacity: { file: "/cargo/registry/25cdd57fae9f0462/hashbrown-0.17.1/src/raw.rs", line: 36, col: 40 }, btree_range_equal_BTreeSet: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 110, col: 21 }, btree_range_equal_BTreeMap: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 112, col: 21 }, btree_range_order_BTreeSet: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 119, col: 21 }, btree_range_order_BTreeMap: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 121, col: 21 }, deque_insert: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 2612, col: 9 }, deque_swap_i: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 1062, col: 9 }, deque_swap_j: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 1063, col: 9 }, deque_rotate_left: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 3198, col: 9 }, deque_rotate_right: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 3243, col: 9 }, deque_split_off: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 2724, col: 9 }, list_split_off: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/linked_list.rs", line: 1015, col: 9 }, mutex_lock: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/std/src/sys/sync/mutex/no_threads.rs", line: 28, col: 9 }, once_force: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/std/src/sync/once.rs", line: 227, col: 20 }, reentrant_init: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell/once.rs", line: 325, col: 66 }, lazy_poisoned: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell/lazy.rs", line: 386, col: 5 }, ready_poll: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/future/ready.rs", line: 23, col: 35 }, ready_into_inner: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/future/ready.rs", line: 46, col: 16 }, duration_new: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 281, col: 18 }, duration_from_mins: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 540, col: 13 }, duration_from_hours: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 510, col: 13 }, duration_add: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1345, col: 31 }, duration_sub: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1365, col: 31 }, duration_mul: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1385, col: 31 }, bytes_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/lib.rs", line: 207, col: 5 }, bytes_does_not_fit: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/lib.rs", line: 215, col: 5 }, bytes_slice: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 374, col: 28 }, bytes_slice_ref_start: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 426, col: 9 }, bytes_slice_ref_end: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 432, col: 9 }, bytes_split_off: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 481, col: 9 }, bytes_split_to: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 533, col: 9 }, bytes_buf_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 694, col: 9 }, bytes_mut_split_off: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 329, col: 9 }, bytes_mut_split_to: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 408, col: 9 }, bytes_mut_set_len: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 545, col: 9 }, bytes_mut_overflow: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 700, col: 21 }, bytes_mut_overflow_offset: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 720, col: 29 }, bytes_mut_buf_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 1246, col: 9 } }); } export function tracked(n: rs.u8, caller: rs.Location): rs.u8 { @@ -229,7 +229,7 @@ export function aborted(kind: rs.u8, data: rs.ByteSlice, out: rs.ByteVec): void } }, (): void => { rs.drop(captured2); - }), { capacity: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/raw_vec/mod.rs", line: 29, col: 5 }, trusted_capacity: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/spec_from_iter_nested.rs", line: 57, col: 18 }, swap_remove: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 2178, col: 13 }, vec_set_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 2138, col: 9 }, into_flattened: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 3667, col: 36 }, rotate_left: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/mod.rs", line: 3902, col: 9 }, rotate_right: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/mod.rs", line: 3948, col: 9 }, ord_violation: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/sort/shared/smallsort.rs", line: 854, col: 5 }, ord_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cmp.rs", line: 1166, col: 9 }, f32_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/num/f32.rs", line: 1665, col: 9 }, f64_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/num/f64.rs", line: 1643, col: 9 }, encode_utf8: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/char/methods.rs", line: 2507, col: 9 }, encode_utf16: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/char/methods.rs", line: 2601, col: 13 }, format: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/fmt.rs", line: 657, col: 14 }, to_string: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/string.rs", line: 2997, col: 14 }, debug_struct_fields: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/fmt/mod.rs", line: 2572, col: 9 }, exact_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/traits/exact_size.rs", line: 122, col: 9 }, join_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/str.rs", line: 177, col: 10 }, int_sum: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/traits/accum.rs", line: 206, col: 1 }, int_forward: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/range.rs", line: 554, col: 1 }, char_forward: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/range.rs", line: 119, col: 45 }, hash_capacity: { file: "/cargo/registry/25cdd57fae9f0462/hashbrown-0.17.1/src/raw.rs", line: 36, col: 40 }, btree_range_equal_BTreeSet: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 110, col: 21 }, btree_range_equal_BTreeMap: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 112, col: 21 }, btree_range_order_BTreeSet: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 119, col: 21 }, btree_range_order_BTreeMap: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 121, col: 21 }, deque_insert: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 2612, col: 9 }, deque_swap_i: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 1062, col: 9 }, deque_swap_j: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 1063, col: 9 }, deque_rotate_left: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 3198, col: 9 }, deque_rotate_right: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 3243, col: 9 }, deque_split_off: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 2724, col: 9 }, list_split_off: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/linked_list.rs", line: 1015, col: 9 }, mutex_lock: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/std/src/sys/sync/mutex/no_threads.rs", line: 28, col: 9 }, once_force: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/std/src/sync/once.rs", line: 227, col: 20 }, reentrant_init: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell/once.rs", line: 325, col: 66 }, lazy_poisoned: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell/lazy.rs", line: 386, col: 5 }, ready_poll: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/future/ready.rs", line: 23, col: 35 }, ready_into_inner: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/future/ready.rs", line: 46, col: 16 }, duration_new: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 281, col: 18 }, duration_from_mins: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 540, col: 13 }, duration_from_hours: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 510, col: 13 }, duration_add: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1345, col: 31 }, duration_sub: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1365, col: 31 }, duration_mul: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1385, col: 31 }, bytes_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/lib.rs", line: 207, col: 5 }, bytes_does_not_fit: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/lib.rs", line: 215, col: 5 }, bytes_slice: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 374, col: 28 }, bytes_slice_ref_start: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 426, col: 9 }, bytes_slice_ref_end: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 432, col: 9 }, bytes_split_off: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 481, col: 9 }, bytes_split_to: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 533, col: 9 }, bytes_buf_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 694, col: 9 }, bytes_mut_split_off: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 329, col: 9 }, bytes_mut_split_to: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 408, col: 9 }, bytes_mut_set_len: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 545, col: 9 }, bytes_mut_overflow: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 700, col: 21 }, bytes_mut_overflow_offset: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 720, col: 29 }, bytes_mut_buf_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 1246, col: 9 } }); + }), { capacity: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/raw_vec/mod.rs", line: 29, col: 5 }, trusted_capacity: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/spec_from_iter_nested.rs", line: 57, col: 18 }, swap_remove: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 2178, col: 13 }, vec_set_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 2138, col: 9 }, vec_from_raw_parts: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 1133, col: 9 }, into_flattened: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 3667, col: 36 }, rotate_left: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/mod.rs", line: 3902, col: 9 }, rotate_right: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/mod.rs", line: 3948, col: 9 }, ord_violation: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/sort/shared/smallsort.rs", line: 854, col: 5 }, ord_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cmp.rs", line: 1166, col: 9 }, f32_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/num/f32.rs", line: 1665, col: 9 }, f64_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/num/f64.rs", line: 1643, col: 9 }, encode_utf8: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/char/methods.rs", line: 2507, col: 9 }, encode_utf16: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/char/methods.rs", line: 2601, col: 13 }, format: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/fmt.rs", line: 657, col: 14 }, to_string: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/string.rs", line: 2997, col: 14 }, debug_struct_fields: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/fmt/mod.rs", line: 2572, col: 9 }, exact_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/traits/exact_size.rs", line: 122, col: 9 }, join_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/str.rs", line: 177, col: 10 }, int_sum: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/traits/accum.rs", line: 206, col: 1 }, int_forward: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/range.rs", line: 554, col: 1 }, char_forward: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/range.rs", line: 119, col: 45 }, hash_capacity: { file: "/cargo/registry/25cdd57fae9f0462/hashbrown-0.17.1/src/raw.rs", line: 36, col: 40 }, btree_range_equal_BTreeSet: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 110, col: 21 }, btree_range_equal_BTreeMap: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 112, col: 21 }, btree_range_order_BTreeSet: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 119, col: 21 }, btree_range_order_BTreeMap: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 121, col: 21 }, deque_insert: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 2612, col: 9 }, deque_swap_i: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 1062, col: 9 }, deque_swap_j: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 1063, col: 9 }, deque_rotate_left: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 3198, col: 9 }, deque_rotate_right: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 3243, col: 9 }, deque_split_off: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 2724, col: 9 }, list_split_off: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/linked_list.rs", line: 1015, col: 9 }, mutex_lock: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/std/src/sys/sync/mutex/no_threads.rs", line: 28, col: 9 }, once_force: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/std/src/sync/once.rs", line: 227, col: 20 }, reentrant_init: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell/once.rs", line: 325, col: 66 }, lazy_poisoned: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell/lazy.rs", line: 386, col: 5 }, ready_poll: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/future/ready.rs", line: 23, col: 35 }, ready_into_inner: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/future/ready.rs", line: 46, col: 16 }, duration_new: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 281, col: 18 }, duration_from_mins: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 540, col: 13 }, duration_from_hours: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 510, col: 13 }, duration_add: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1345, col: 31 }, duration_sub: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1365, col: 31 }, duration_mul: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1385, col: 31 }, bytes_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/lib.rs", line: 207, col: 5 }, bytes_does_not_fit: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/lib.rs", line: 215, col: 5 }, bytes_slice: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 374, col: 28 }, bytes_slice_ref_start: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 426, col: 9 }, bytes_slice_ref_end: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 432, col: 9 }, bytes_split_off: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 481, col: 9 }, bytes_split_to: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 533, col: 9 }, bytes_buf_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 694, col: 9 }, bytes_mut_split_off: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 329, col: 9 }, bytes_mut_split_to: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 408, col: 9 }, bytes_mut_set_len: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 545, col: 9 }, bytes_mut_overflow: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 700, col: 21 }, bytes_mut_overflow_offset: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 720, col: 29 }, bytes_mut_buf_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 1246, col: 9 } }); rs.byteVecPush(out, n); const _13: rs.u8 = rs.u8Rem(kind, 5, { file: "fixtures/lang/panics/src/hooked.rs", line: 179, col: 11 }); if (_13 === 3 || _13 === 4) { @@ -268,7 +268,7 @@ export function sited(kind: rs.u8, data: rs.ByteSlice, out: rs.ByteVec): void { const _19: rs.u16[] = [n as rs.u16]; const set: rs.BTreeSet = rs.btreeExtendKeys(rs.btreeNew(rs.cmp) as rs.BTreeSet, rs.iterSlice(_19), true, undefined, undefined, 2, true); b0: { - const k: rs.u8 = rs.u8Rem(kind, 75, { file: "fixtures/lang/panics/src/hooked.rs", line: 203, col: 11 }); + const k: rs.u8 = rs.u8Rem(kind, 76, { file: "fixtures/lang/panics/src/hooked.rs", line: 203, col: 11 }); if (k === 0) { rs.byteVecPush(out, rs.byteVecWithCapacity(rs.usizeSub(4294967295, at, { file: "fixtures/lang/panics/src/hooked.rs", line: 204, col: 48 })).length & 0xff); } else if (k === 1) { @@ -513,6 +513,8 @@ export function sited(kind: rs.u8, data: rs.ByteSlice, out: rs.ByteVec): void { const _498: rs.usize = rs.usizeAdd(rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 346, col: 57 }), 3, { file: "fixtures/lang/panics/src/hooked.rs", line: 346, col: 57 }); rs.ioSliceAdvanceSlices(rs.place(() => left, (value) => left = value), _498, { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/io/io_slice.rs", line: 304, col: 13 }); rs.byteVecPush(out, left.length & 0xff); + } else if (k === 74) { + rs.byteVecPush(out, rs.vecFromRawParts(rs.DANGLING, rs.usizeAdd(rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 351, col: 89 }), 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 351, col: 89 }), rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 351, col: 101 }), 4).items.length & 0xff); } else { if (53 <= k) { if (k <= 56) { @@ -540,16 +542,16 @@ export function joined(kind: rs.u8, n: rs.u8, out: rs.ByteVec): void { let joined!: rs.ByteVec; const big: rs.ByteVec = rs.byteVecOf(n, 1 << 16); const refs: (a0: rs.usize) => rs.Vec = (count: rs.usize): rs.Vec => { - return rs.vecFromElem(rs.byteSliceRange(rs.byteVecSlice(big), 0, undefined, { file: "fixtures/lang/panics/src/hooked.rs", line: 357, col: 40 }), count, undefined); + return rs.vecFromElem(rs.byteSliceRange(rs.byteVecSlice(big), 0, undefined, { file: "fixtures/lang/panics/src/hooked.rs", line: 362, col: 40 }), count, undefined); }; if (kind === 0) { - joined = rs.byteSlicesJoin(rs.sliceFrom(refs(rs.usizeAdd(1 << 16, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 359, col: 19 })).items)); + joined = rs.byteSlicesJoin(rs.sliceFrom(refs(rs.usizeAdd(1 << 16, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 364, col: 19 })).items)); } else if (kind === 1) { - joined = rs.byteSlicesJoin(rs.sliceFrom(refs(rs.usizeAdd(1 << 16, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 360, col: 19 })).items), rs.byteSliceFrom(Uint8Array.of(n))); + joined = rs.byteSlicesJoin(rs.sliceFrom(refs(rs.usizeAdd(1 << 16, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 365, col: 19 })).items), rs.byteSliceFrom(Uint8Array.of(n))); } else if (kind === 2) { - joined = rs.byteSlicesJoin(rs.sliceFrom(refs(rs.usizeAdd(1 << 15, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 361, col: 19 })).items)); + joined = rs.byteSlicesJoin(rs.sliceFrom(refs(rs.usizeAdd(1 << 15, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 366, col: 19 })).items)); } else { - joined = rs.iterToByteVec(rs.iterMap(rs.iterSlice(rs.slicesJoin(rs.sliceFrom(rs.vecFromElem(rs.sliceFrom(rs.vecFromElem(n as rs.u16, 1 << 16, undefined).items), rs.usizeAdd(1 << 14, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 364, col: 42 }), undefined).items), 2, rs.sliceFrom([1])).items), (_2: rs.u16): rs.u8 => { + joined = rs.iterToByteVec(rs.iterMap(rs.iterSlice(rs.slicesJoin(rs.sliceFrom(rs.vecFromElem(rs.sliceFrom(rs.vecFromElem(n as rs.u16, 1 << 16, undefined).items), rs.usizeAdd(1 << 14, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 369, col: 42 }), undefined).items), 2, rs.sliceFrom([1])).items), (_2: rs.u16): rs.u8 => { return _2 & 0xff; }), undefined, true); } @@ -572,10 +574,10 @@ export function compared(kind: rs.u8, n: rs.u8): rs.u8 { const _5: [rs.RefCell, rs.RefCell] = [new rs.RefCell(n), new rs.RefCell(rs.u8WrappingAdd(n, 1))]; const a: rs.RefCell = _5[0]; const b: rs.RefCell = _5[1]; - if (!(rs.u8Rem(n, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 376, col: 20 }) === 0)) { - _held = rs.refCellBorrowMut(b, { file: "fixtures/lang/panics/src/hooked.rs", line: 376, col: 59 }); + if (!(rs.u8Rem(n, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 381, col: 20 }) === 0)) { + _held = rs.refCellBorrowMut(b, { file: "fixtures/lang/panics/src/hooked.rs", line: 381, col: 59 }); } else { - _held = rs.refCellBorrowMut(a, { file: "fixtures/lang/panics/src/hooked.rs", line: 376, col: 35 }); + _held = rs.refCellBorrowMut(a, { file: "fixtures/lang/panics/src/hooked.rs", line: 381, col: 35 }); } if (kind === 0) { _0 = rs.refCellBy(rs.same, { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell.rs", line: 1482, col: 15 }, { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell.rs", line: 1482, col: 34 })(a, b) ? 1 : 0; @@ -622,11 +624,11 @@ export function stock(kind: rs.u8, data: rs.ByteSlice, out: rs.ByteVec): void { const at: rs.usize = n as rs.usize; const whole: rs.ByteSlice = rs.bytesFromVec(rs.byteVecOf(n, 4)); b0: { - const k: rs.u8 = rs.u8Rem(kind, 33, { file: "fixtures/lang/panics/src/hooked.rs", line: 418, col: 24 }); + const k: rs.u8 = rs.u8Rem(kind, 33, { file: "fixtures/lang/panics/src/hooked.rs", line: 423, col: 24 }); if (0 <= k) { if (k <= 1) { rs.setHook((info: rs.PanicHookInfo): undefined => { - const at2: rs.Location = rs.optionUnwrap(info.location, undefined, { file: "fixtures/lang/panics/src/hooked.rs", line: 420, col: 38 }); + const at2: rs.Location = rs.optionUnwrap(info.location, undefined, { file: "fixtures/lang/panics/src/hooked.rs", line: 425, col: 38 }); const _10: string = at2.file; const _126: rs.u32 = at2.line; const _14: rs.u32 = at2.col; @@ -635,16 +637,16 @@ export function stock(kind: rs.u8, data: rs.ByteSlice, out: rs.ByteVec): void { rs.localKeyWithBorrowMut(NOTE, (note: rs.String): undefined => { rs.stringPushStr(note, line.v); }, { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/std/src/thread/local.rs", line: 721, col: 38 }); - rs.panicFmt(["unread"], { file: "fixtures/lang/panics/src/hooked.rs", line: 423, col: 13 }); - }, { capacity: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/raw_vec/mod.rs", line: 29, col: 5 }, trusted_capacity: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/spec_from_iter_nested.rs", line: 57, col: 18 }, swap_remove: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 2178, col: 13 }, vec_set_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 2138, col: 9 }, into_flattened: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 3667, col: 36 }, rotate_left: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/mod.rs", line: 3902, col: 9 }, rotate_right: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/mod.rs", line: 3948, col: 9 }, ord_violation: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/sort/shared/smallsort.rs", line: 854, col: 5 }, ord_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cmp.rs", line: 1166, col: 9 }, f32_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/num/f32.rs", line: 1665, col: 9 }, f64_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/num/f64.rs", line: 1643, col: 9 }, encode_utf8: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/char/methods.rs", line: 2507, col: 9 }, encode_utf16: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/char/methods.rs", line: 2601, col: 13 }, format: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/fmt.rs", line: 657, col: 14 }, to_string: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/string.rs", line: 2997, col: 14 }, debug_struct_fields: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/fmt/mod.rs", line: 2572, col: 9 }, exact_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/traits/exact_size.rs", line: 122, col: 9 }, join_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/str.rs", line: 177, col: 10 }, int_sum: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/traits/accum.rs", line: 206, col: 1 }, int_forward: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/range.rs", line: 554, col: 1 }, char_forward: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/range.rs", line: 119, col: 45 }, hash_capacity: { file: "/cargo/registry/25cdd57fae9f0462/hashbrown-0.17.1/src/raw.rs", line: 36, col: 40 }, btree_range_equal_BTreeSet: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 110, col: 21 }, btree_range_equal_BTreeMap: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 112, col: 21 }, btree_range_order_BTreeSet: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 119, col: 21 }, btree_range_order_BTreeMap: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 121, col: 21 }, deque_insert: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 2612, col: 9 }, deque_swap_i: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 1062, col: 9 }, deque_swap_j: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 1063, col: 9 }, deque_rotate_left: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 3198, col: 9 }, deque_rotate_right: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 3243, col: 9 }, deque_split_off: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 2724, col: 9 }, list_split_off: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/linked_list.rs", line: 1015, col: 9 }, mutex_lock: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/std/src/sys/sync/mutex/no_threads.rs", line: 28, col: 9 }, once_force: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/std/src/sync/once.rs", line: 227, col: 20 }, reentrant_init: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell/once.rs", line: 325, col: 66 }, lazy_poisoned: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell/lazy.rs", line: 386, col: 5 }, ready_poll: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/future/ready.rs", line: 23, col: 35 }, ready_into_inner: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/future/ready.rs", line: 46, col: 16 }, duration_new: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 281, col: 18 }, duration_from_mins: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 540, col: 13 }, duration_from_hours: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 510, col: 13 }, duration_add: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1345, col: 31 }, duration_sub: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1365, col: 31 }, duration_mul: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1385, col: 31 }, bytes_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/lib.rs", line: 207, col: 5 }, bytes_does_not_fit: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/lib.rs", line: 215, col: 5 }, bytes_slice: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 374, col: 28 }, bytes_slice_ref_start: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 426, col: 9 }, bytes_slice_ref_end: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 432, col: 9 }, bytes_split_off: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 481, col: 9 }, bytes_split_to: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 533, col: 9 }, bytes_buf_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 694, col: 9 }, bytes_mut_split_off: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 329, col: 9 }, bytes_mut_split_to: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 408, col: 9 }, bytes_mut_set_len: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 545, col: 9 }, bytes_mut_overflow: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 700, col: 21 }, bytes_mut_overflow_offset: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 720, col: 29 }, bytes_mut_buf_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 1246, col: 9 } }); + rs.panicFmt(["unread"], { file: "fixtures/lang/panics/src/hooked.rs", line: 428, col: 13 }); + }, { capacity: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/raw_vec/mod.rs", line: 29, col: 5 }, trusted_capacity: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/spec_from_iter_nested.rs", line: 57, col: 18 }, swap_remove: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 2178, col: 13 }, vec_set_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 2138, col: 9 }, vec_from_raw_parts: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 1133, col: 9 }, into_flattened: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/vec/mod.rs", line: 3667, col: 36 }, rotate_left: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/mod.rs", line: 3902, col: 9 }, rotate_right: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/mod.rs", line: 3948, col: 9 }, ord_violation: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/slice/sort/shared/smallsort.rs", line: 854, col: 5 }, ord_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cmp.rs", line: 1166, col: 9 }, f32_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/num/f32.rs", line: 1665, col: 9 }, f64_clamp: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/num/f64.rs", line: 1643, col: 9 }, encode_utf8: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/char/methods.rs", line: 2507, col: 9 }, encode_utf16: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/char/methods.rs", line: 2601, col: 13 }, format: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/fmt.rs", line: 657, col: 14 }, to_string: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/string.rs", line: 2997, col: 14 }, debug_struct_fields: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/fmt/mod.rs", line: 2572, col: 9 }, exact_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/traits/exact_size.rs", line: 122, col: 9 }, join_len: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/str.rs", line: 177, col: 10 }, int_sum: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/traits/accum.rs", line: 206, col: 1 }, int_forward: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/range.rs", line: 554, col: 1 }, char_forward: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/iter/range.rs", line: 119, col: 45 }, hash_capacity: { file: "/cargo/registry/25cdd57fae9f0462/hashbrown-0.17.1/src/raw.rs", line: 36, col: 40 }, btree_range_equal_BTreeSet: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 110, col: 21 }, btree_range_equal_BTreeMap: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 112, col: 21 }, btree_range_order_BTreeSet: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 119, col: 21 }, btree_range_order_BTreeMap: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/btree/search.rs", line: 121, col: 21 }, deque_insert: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 2612, col: 9 }, deque_swap_i: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 1062, col: 9 }, deque_swap_j: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 1063, col: 9 }, deque_rotate_left: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 3198, col: 9 }, deque_rotate_right: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 3243, col: 9 }, deque_split_off: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/vec_deque/mod.rs", line: 2724, col: 9 }, list_split_off: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/alloc/src/collections/linked_list.rs", line: 1015, col: 9 }, mutex_lock: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/std/src/sys/sync/mutex/no_threads.rs", line: 28, col: 9 }, once_force: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/std/src/sync/once.rs", line: 227, col: 20 }, reentrant_init: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell/once.rs", line: 325, col: 66 }, lazy_poisoned: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/cell/lazy.rs", line: 386, col: 5 }, ready_poll: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/future/ready.rs", line: 23, col: 35 }, ready_into_inner: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/future/ready.rs", line: 46, col: 16 }, duration_new: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 281, col: 18 }, duration_from_mins: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 540, col: 13 }, duration_from_hours: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 510, col: 13 }, duration_add: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1345, col: 31 }, duration_sub: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1365, col: 31 }, duration_mul: { file: "/rustc/7df81381d027710708209f36b98d11b1c88f8d2e/library/core/src/time.rs", line: 1385, col: 31 }, bytes_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/lib.rs", line: 207, col: 5 }, bytes_does_not_fit: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/lib.rs", line: 215, col: 5 }, bytes_slice: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 374, col: 28 }, bytes_slice_ref_start: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 426, col: 9 }, bytes_slice_ref_end: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 432, col: 9 }, bytes_split_off: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 481, col: 9 }, bytes_split_to: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 533, col: 9 }, bytes_buf_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes.rs", line: 694, col: 9 }, bytes_mut_split_off: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 329, col: 9 }, bytes_mut_split_to: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 408, col: 9 }, bytes_mut_set_len: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 545, col: 9 }, bytes_mut_overflow: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 700, col: 21 }, bytes_mut_overflow_offset: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 720, col: 29 }, bytes_mut_buf_advance: { file: "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.12.1/src/bytes_mut.rs", line: 1246, col: 9 } }); const subset: rs.ByteSlice = rs.bytesSlice(whole, 0, 1); if (k === 0) { - const _22: rs.ByteSlice = rs.bytesSlice(whole, rs.usizeAdd(1, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 427, col: 34 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 427, col: 30 })); + const _22: rs.ByteSlice = rs.bytesSlice(whole, rs.usizeAdd(1, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 432, col: 34 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 432, col: 30 })); held = rs.bytesSliceRef(_22, subset); rs.bytesDrop(_22); } else { const _32: rs.ByteSlice = rs.bytesSlice(whole, 0, 1); - const _35: rs.ByteSlice = rs.byteSliceRange(whole, 0, rs.usizeAdd(2, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 428, col: 58 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 428, col: 54 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 428, col: 51 }); + const _35: rs.ByteSlice = rs.byteSliceRange(whole, 0, rs.usizeAdd(2, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 433, col: 58 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 433, col: 54 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 433, col: 51 }); held = rs.bytesSliceRef(_32, _35); rs.bytesDrop(_32); } @@ -656,38 +658,38 @@ export function stock(kind: rs.u8, data: rs.ByteSlice, out: rs.ByteVec): void { } } hook(); - const shared: rs.BytesMut = rs.bytesMutFrom(rs.byteSliceRange(rs.byteSliceFrom(rs.bytes(8).fill(n)), 0, undefined, { file: "fixtures/lang/panics/src/hooked.rs", line: 434, col: 44 })); - const _52: rs.u8 = rs.u8Rem(kind, 33, { file: "fixtures/lang/panics/src/hooked.rs", line: 435, col: 11 }); + const shared: rs.BytesMut = rs.bytesMutFrom(rs.byteSliceRange(rs.byteSliceFrom(rs.bytes(8).fill(n)), 0, undefined, { file: "fixtures/lang/panics/src/hooked.rs", line: 439, col: 44 })); + const _52: rs.u8 = rs.u8Rem(kind, 33, { file: "fixtures/lang/panics/src/hooked.rs", line: 440, col: 11 }); if (_52 === 2) { - const _56: rs.ByteSlice = rs.bytesSlice(whole, rs.usizeAdd(at, 3, { file: "fixtures/lang/panics/src/hooked.rs", line: 436, col: 49 }), 2); + const _56: rs.ByteSlice = rs.bytesSlice(whole, rs.usizeAdd(at, 3, { file: "fixtures/lang/panics/src/hooked.rs", line: 441, col: 49 }), 2); rs.byteVecExtendFromSlice(out, _56); rs.bytesDrop(_56); } else if (_52 === 3) { - const _63: rs.ByteSlice = rs.bytesSlice(whole, 0, rs.usizeAdd(at, 5, { file: "fixtures/lang/panics/src/hooked.rs", line: 437, col: 51 })); + const _63: rs.ByteSlice = rs.bytesSlice(whole, 0, rs.usizeAdd(at, 5, { file: "fixtures/lang/panics/src/hooked.rs", line: 442, col: 51 })); rs.byteVecExtendFromSlice(out, _63); rs.bytesDrop(_63); } else if (_52 === 4) { - const _72: rs.RangeInclusive = new rs.RangeInclusive(rs.usizeSub(4294967295, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 438, col: 62 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 438, col: 49 }), 4294967295, rs.usizeStep); + const _72: rs.RangeInclusive = new rs.RangeInclusive(rs.usizeSub(4294967295, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 443, col: 62 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 443, col: 49 }), 4294967295, rs.usizeStep); const _70: rs.ByteSlice = rs.bytesSliceInclusive(whole, _72); rs.byteVecExtendFromSlice(out, _70); rs.bytesDrop(_70); } else if (_52 === 5) { let _81: rs.ByteSlice = rs.bytesClone(whole); - const _83: rs.usize = rs.usizeAdd(at, 5, { file: "fixtures/lang/panics/src/hooked.rs", line: 439, col: 60 }); + const _83: rs.usize = rs.usizeAdd(at, 5, { file: "fixtures/lang/panics/src/hooked.rs", line: 444, col: 60 }); const _79: rs.ByteSlice = rs.bytesSplitTo(rs.place(() => _81, (value9) => _81 = value9), _83); rs.byteVecExtendFromSlice(out, _79); rs.bytesDrop(_79); rs.bytesDrop(_81); } else if (_52 === 6) { let _89: rs.ByteSlice = rs.bytesClone(whole); - const _91: rs.usize = rs.usizeAdd(at, 5, { file: "fixtures/lang/panics/src/hooked.rs", line: 440, col: 61 }); + const _91: rs.usize = rs.usizeAdd(at, 5, { file: "fixtures/lang/panics/src/hooked.rs", line: 445, col: 61 }); const _87: rs.ByteSlice = rs.bytesSplitOff(rs.place(() => _89, (value8) => _89 = value8), _91); rs.byteVecExtendFromSlice(out, _87); rs.bytesDrop(_87); rs.bytesDrop(_89); } else if (_52 === 7) { let _94: rs.ByteSlice = rs.bytesClone(whole); - const _96: rs.usize = rs.usizeAdd(at, 5, { file: "fixtures/lang/panics/src/hooked.rs", line: 441, col: 36 }); + const _96: rs.usize = rs.usizeAdd(at, 5, { file: "fixtures/lang/panics/src/hooked.rs", line: 446, col: 36 }); rs.bytesAdvance(rs.place(() => _94, (value7) => _94 = value7), _96); rs.bytesDrop(_94); } else if (_52 === 8) { @@ -696,12 +698,12 @@ export function stock(kind: rs.u8, data: rs.ByteSlice, out: rs.ByteVec): void { rs.bytesDrop(_101); } else if (_52 === 9) { let _107: rs.ByteSlice = rs.bytesClone(whole); - const _109: rs.usize = rs.usizeAdd(9, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 443, col: 50 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 443, col: 46 }); + const _109: rs.usize = rs.usizeAdd(9, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 448, col: 50 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 448, col: 46 }); rs.byteVecPush(out, rs.u64Low(rs.u64FromBeBytes(rs.bytesReadInt(rs.place(() => _107, (value5) => _107 = value5), 8, _109, false, false))) & 0xff); rs.bytesDrop(_107); } else if (_52 === 10) { - let _114: rs.ByteSlice = rs.byteSliceRange(data, 0, undefined, { file: "fixtures/lang/panics/src/hooked.rs", line: 444, col: 21 }); - const _116: rs.usize = rs.usizeAdd(data.length, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 444, col: 35 }); + let _114: rs.ByteSlice = rs.byteSliceRange(data, 0, undefined, { file: "fixtures/lang/panics/src/hooked.rs", line: 449, col: 21 }); + const _116: rs.usize = rs.usizeAdd(data.length, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 449, col: 35 }); rs.byteSliceAdvance(rs.place(() => _114, (value4) => _114 = value4), _116); } else if (_52 === 11) { let _120: rs.ByteSlice = rs.bytesClone(whole); @@ -710,75 +712,75 @@ export function stock(kind: rs.u8, data: rs.ByteSlice, out: rs.ByteVec): void { rs.bytesDrop(_120); } else if (_52 === 12) { let _129: rs.ByteSlice = rs.bytesClone(whole); - const _131: rs.usize = rs.usizeAdd(at, 5, { file: "fixtures/lang/panics/src/hooked.rs", line: 446, col: 66 }); + const _131: rs.usize = rs.usizeAdd(at, 5, { file: "fixtures/lang/panics/src/hooked.rs", line: 451, col: 66 }); const _127: rs.ByteSlice = rs.bytesSplitTo(rs.place(() => _129, (value2) => _129 = value2), _131); rs.byteVecExtendFromSlice(out, _127); rs.bytesDrop(_127); rs.bytesDrop(_129); } else if (_52 === 13) { - let _137: rs.ByteSlice = rs.byteSliceRange(data, 0, undefined, { file: "fixtures/lang/panics/src/hooked.rs", line: 447, col: 44 }); - const _139: rs.usize = rs.usizeAdd(data.length, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 447, col: 64 }); + let _137: rs.ByteSlice = rs.byteSliceRange(data, 0, undefined, { file: "fixtures/lang/panics/src/hooked.rs", line: 452, col: 44 }); + const _139: rs.usize = rs.usizeAdd(data.length, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 452, col: 64 }); const _135: rs.ByteSlice = rs.byteSliceCopyToBytes(rs.place(() => _137, (value) => _137 = value), _139); rs.byteVecExtendFromSlice(out, _135); rs.bytesDrop(_135); } else if (_52 === 14) { const _146: rs.BytesMut = rs.bytesMutFrom(data); - const _144: rs.BytesMut = rs.bytesMutSplitTo(_146, rs.usizeAdd(data.length, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 448, col: 68 })); + const _144: rs.BytesMut = rs.bytesMutSplitTo(_146, rs.usizeAdd(data.length, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 453, col: 68 })); rs.byteVecExtendFromSlice(out, rs.bytesMutView(_144)); _144[Symbol.dispose](); _146[Symbol.dispose](); } else if (_52 === 15) { const _154: rs.BytesMut = rs.bytesMutWithCapacity(4); - const _152: rs.BytesMut = rs.bytesMutSplitOff(_154, rs.usizeAdd(at, 5, { file: "fixtures/lang/panics/src/hooked.rs", line: 449, col: 75 })); + const _152: rs.BytesMut = rs.bytesMutSplitOff(_154, rs.usizeAdd(at, 5, { file: "fixtures/lang/panics/src/hooked.rs", line: 454, col: 75 })); rs.byteVecExtendFromSlice(out, rs.bytesMutView(_152)); _152[Symbol.dispose](); _154[Symbol.dispose](); } else if (_52 === 16) { - const b: rs.BytesMut = rs.bytesMutWithCapacity(rs.usizeRem(at, 4, { file: "fixtures/lang/panics/src/hooked.rs", line: 451, col: 49 })); - rs.bytesMutSetLen(b, rs.usizeAdd(b.cap, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 453, col: 32 })); + const b: rs.BytesMut = rs.bytesMutWithCapacity(rs.usizeRem(at, 4, { file: "fixtures/lang/panics/src/hooked.rs", line: 456, col: 49 })); + rs.bytesMutSetLen(b, rs.usizeAdd(b.cap, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 458, col: 32 })); rs.byteVecPush(out, b.length & 0xff); b[Symbol.dispose](); } else if (_52 === 17) { - const b2: rs.BytesMut = rs.bytesMutWithCapacity(rs.usizeRem(at, 4, { file: "fixtures/lang/panics/src/hooked.rs", line: 457, col: 49 })); - rs.bytesMutAdvanceMut(b2, rs.usizeAdd(b2.cap, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 459, col: 36 })); + const b2: rs.BytesMut = rs.bytesMutWithCapacity(rs.usizeRem(at, 4, { file: "fixtures/lang/panics/src/hooked.rs", line: 462, col: 49 })); + rs.bytesMutAdvanceMut(b2, rs.usizeAdd(b2.cap, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 464, col: 36 })); rs.byteVecPush(out, b2.length & 0xff); b2[Symbol.dispose](); } else if (_52 === 18) { - const v: rs.ByteVec = rs.byteVecWithCapacity(rs.usizeRem(at, 4, { file: "fixtures/lang/panics/src/hooked.rs", line: 463, col: 50 })); - rs.byteVecAdvanceMut(v, rs.usizeAdd(v.data.length, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 465, col: 36 })); + const v: rs.ByteVec = rs.byteVecWithCapacity(rs.usizeRem(at, 4, { file: "fixtures/lang/panics/src/hooked.rs", line: 468, col: 50 })); + rs.byteVecAdvanceMut(v, rs.usizeAdd(v.data.length, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 470, col: 36 })); rs.byteVecPush(out, v.length & 0xff); } else if (_52 === 19) { const _197: rs.BytesMut = rs.bytesMutFrom(data); - rs.bytesMutAdvance(_197, rs.usizeAdd(data.length, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 468, col: 44 })); + rs.bytesMutAdvance(_197, rs.usizeAdd(data.length, 1, { file: "fixtures/lang/panics/src/hooked.rs", line: 473, col: 44 })); _197[Symbol.dispose](); } else if (_52 === 20) { - const _204: rs.BytesMut = rs.bytesMutFrom(rs.byteSliceRange(data, 0, rs.min(data.length, 3), { file: "fixtures/lang/panics/src/hooked.rs", line: 469, col: 44 })); + const _204: rs.BytesMut = rs.bytesMutFrom(rs.byteSliceRange(data, 0, rs.min(data.length, 3), { file: "fixtures/lang/panics/src/hooked.rs", line: 474, col: 44 })); rs.byteVecPush(out, (rs.bytesMutReadWord(_204, 4, false) as rs.u32) & 0xff); _204[Symbol.dispose](); } else if (_52 === 21) { - const _212: rs.BytesMut = rs.bytesMutWithCapacity(rs.usizeSub(4294967295, at, { file: "fixtures/lang/panics/src/hooked.rs", line: 470, col: 48 })); + const _212: rs.BytesMut = rs.bytesMutWithCapacity(rs.usizeSub(4294967295, at, { file: "fixtures/lang/panics/src/hooked.rs", line: 475, col: 48 })); rs.byteVecPush(out, _212.cap & 0xff); _212[Symbol.dispose](); } else if (_52 === 22) { const _tail: rs.BytesMut = rs.bytesMutSplitOff(shared, 4); - rs.bytesMutReserve(shared, rs.usizeSub(4294967295, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 474, col: 41 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 474, col: 28 })); + rs.bytesMutReserve(shared, rs.usizeSub(4294967295, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 479, col: 41 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 479, col: 28 })); _tail[Symbol.dispose](); } else if (_52 === 23) { rs.bytesMutSplitTo(shared, 4)[Symbol.dispose](); - rs.bytesMutReserve(shared, rs.usizeSub(4294967295 - 4, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 479, col: 45 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 479, col: 28 })); + rs.bytesMutReserve(shared, rs.usizeSub(4294967295 - 4, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 484, col: 45 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 484, col: 28 })); } else if (_52 === 24) { const _235: rs.u64 = n as rs.u64; - const _236: rs.usize = rs.usizeAdd(9, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 481, col: 49 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 481, col: 45 }); + const _236: rs.usize = rs.usizeAdd(9, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 486, col: 49 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 486, col: 45 }); rs.bytesMutPutInt(shared, rs.u64ToBeBytes(_235), _236, false); } else if (_52 === 25) { const _240: rs.i64 = n as rs.i64; - const _241: rs.usize = rs.usizeAdd(9, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 482, col: 45 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 482, col: 41 }); + const _241: rs.usize = rs.usizeAdd(9, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 487, col: 45 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 487, col: 41 }); rs.byteVecPutInt(out, rs.i64ToBeBytes(_240), _241, false); } else if (_52 === 26) { - rs.byteVecPutFill(out, n, rs.usizeSub(4294967295, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 483, col: 53 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 483, col: 40 })); + rs.byteVecPutFill(out, n, rs.usizeSub(4294967295, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 488, col: 53 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 488, col: 40 })); } else if (_52 === 27) { const _253: Take.Take = buf_impl_take$bytes_Buf_bytes_Bytes(rs.bytesClone(whole), 2); - const _251: rs.ByteSlice = Take.copyToBytes$bytes_Buf_bytes_Bytes(_253, rs.usizeAdd(at, 3, { file: "fixtures/lang/panics/src/hooked.rs", line: 484, col: 74 })); + const _251: rs.ByteSlice = Take.copyToBytes$bytes_Buf_bytes_Bytes(_253, rs.usizeAdd(at, 3, { file: "fixtures/lang/panics/src/hooked.rs", line: 489, col: 74 })); rs.byteVecExtendFromSlice(out, _251); rs.bytesDrop(_251); drop$bytes_buf_Take_bytes_Bytes(_253); @@ -788,15 +790,15 @@ export function stock(kind: rs.u8, data: rs.ByteSlice, out: rs.ByteVec): void { drop$bytes_buf_Take_bytes_Bytes(_261); } else if (_52 === 29) { const chunk: rs.ByteSlice = rs.bytesMutChunkMut(shared); - UninitSlice.writeByte(chunk, rs.usizeAdd(UninitSlice.len(chunk), rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 489, col: 44 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 489, col: 30 }), n); + UninitSlice.writeByte(chunk, rs.usizeAdd(UninitSlice.len(chunk), rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 494, col: 44 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 494, col: 30 }), n); } else if (_52 === 30) { - UninitSlice.writeByte(UninitSlice.indexMut$ops_IndexMut_ops_RangeFrom_usize(rs.byteVecChunkMut(rs.byteVecWithCapacity(rs.usizeRem(at, 4, { file: "fixtures/lang/panics/src/hooked.rs", line: 491, col: 40 }))), new rs.RangeFrom(rs.usizeAdd(65, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 491, col: 65 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 491, col: 60 }), rs.usizeStep), { file: "fixtures/lang/panics/src/hooked.rs", line: 491, col: 59 }), 0, n); + UninitSlice.writeByte(UninitSlice.indexMut$ops_IndexMut_ops_RangeFrom_usize(rs.byteVecChunkMut(rs.byteVecWithCapacity(rs.usizeRem(at, 4, { file: "fixtures/lang/panics/src/hooked.rs", line: 496, col: 40 }))), new rs.RangeFrom(rs.usizeAdd(65, rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 496, col: 65 }), { file: "fixtures/lang/panics/src/hooked.rs", line: 496, col: 60 }), rs.usizeStep), { file: "fixtures/lang/panics/src/hooked.rs", line: 496, col: 59 }), 0, n); } else if (_52 === 31) { const _287: rs.BytesMut = rs.bytesMutWithCapacity(0); - UninitSlice.copyFromSlice(UninitSlice.indexMut$ops_IndexMut_ops_RangeTo_usize(rs.bytesMutChunkMut(_287), { end: rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 492, col: 45 }) }, { file: "fixtures/lang/panics/src/hooked.rs", line: 492, col: 42 }), rs.byteSliceFrom(rs.bytes(3).fill(n))); + UninitSlice.copyFromSlice(UninitSlice.indexMut$ops_IndexMut_ops_RangeTo_usize(rs.bytesMutChunkMut(_287), { end: rs.usizeRem(at, 2, { file: "fixtures/lang/panics/src/hooked.rs", line: 497, col: 45 }) }, { file: "fixtures/lang/panics/src/hooked.rs", line: 497, col: 42 }), rs.byteSliceFrom(rs.bytes(3).fill(n))); _287[Symbol.dispose](); } else { - const _297: rs.BytesMut = rs.bytesMutZeroed(rs.usizeSub(4294967295, at, { file: "fixtures/lang/panics/src/hooked.rs", line: 493, col: 40 })); + const _297: rs.BytesMut = rs.bytesMutZeroed(rs.usizeSub(4294967295, at, { file: "fixtures/lang/panics/src/hooked.rs", line: 498, col: 40 })); rs.byteVecPush(out, _297.length & 0xff); _297[Symbol.dispose](); } @@ -812,7 +814,7 @@ export function stock(kind: rs.u8, data: rs.ByteSlice, out: rs.ByteVec): void { */ export function edition2018Panicked(kind: rs.u8, data: rs.ByteSlice, out: rs.ByteVec): void { b0: { - if (!(rs.u8Rem(kind, 7, { file: "fixtures/lang/panics/src/hooked.rs", line: 501, col: 8 }) !== 6)) { + if (!(rs.u8Rem(kind, 7, { file: "fixtures/lang/panics/src/hooked.rs", line: 506, col: 8 }) !== 6)) { if (!(option_unwrapOr$1fr498u(rs.byteSliceFirst(data), 0) > 200)) { break b0; } diff --git a/ts/fixtures/lang/panics/hook/expected/lib.ts b/ts/fixtures/lang/panics/hook/expected/lib.ts index b72d52964..e45940e1c 100644 --- a/ts/fixtures/lang/panics/hook/expected/lib.ts +++ b/ts/fixtures/lang/panics/hook/expected/lib.ts @@ -81,7 +81,7 @@ export class of$panics_Point { } typeId$Any(): rs.TypeId { - return "8e48006f0a085ab0ca68bcd6079f396f"; + return "37e450afe4d41be326161cb6b122df94"; } } diff --git a/ts/fixtures/lang/panics/src/hooked.rs b/ts/fixtures/lang/panics/src/hooked.rs index a55d819ca..4df7a9dd5 100644 --- a/ts/fixtures/lang/panics/src/hooked.rs +++ b/ts/fixtures/lang/panics/src/hooked.rs @@ -200,7 +200,7 @@ pub fn sited(kind: u8, data: &[u8], out: &mut Vec) { let deque = VecDeque::from(v.clone()); let map = BTreeMap::from([(u16::from(n), n)]); let set = BTreeSet::from([u16::from(n)]); - match kind % 75 { + match kind % 76 { 0 => out.push(Vec::::with_capacity(usize::MAX - at).len() as u8), 1 => v.clone().rotate_right(at + 3), 2 => out.push(n.clamp(n.max(1), n.max(1) - 1)), @@ -346,6 +346,11 @@ pub fn sited(kind: u8, data: &[u8], out: &mut Vec) { std::io::IoSlice::advance_slices(&mut left, at % 2 + 3); out.push(left.len() as u8); } + // SAFETY: none, past the capacity: std's check of its precondition aborts. + 74 => out.push( + unsafe { Vec::::from_raw_parts(std::ptr::NonNull::dangling().as_ptr(), at % 2 + 1, at % 2) }.len() + as u8, + ), _ => out.push(Lying(n).len() as u8), } } diff --git a/ts/fixtures/reject/census.txt b/ts/fixtures/reject/census.txt index 15daa35e1..95c6759ac 100644 --- a/ts/fixtures/reject/census.txt +++ b/ts/fixtures/reject/census.txt @@ -1,4 +1,6 @@ fixtures/reject/src/alloc.rs:addressed+1:17: a pointer's address, which JS has no counterpart of +fixtures/reject/src/alloc.rs:adopted+2:24: `Vec::from_raw_parts` of `pointers::Halves`, which JS keeps as an object that knows no array it is in +fixtures/reject/src/alloc.rs:adopted+3:23: `Vec::from_raw_parts` of `()`, which has no bytes fixtures/reject/src/alloc.rs:alloc_retyped+4:7: memory from `alloc` cast to pointers to `u32` and to `i32`, which reads the bytes of one type as another fixtures/reject/src/alloc.rs:alloc_retyped+5:11: memory from `alloc` cast to pointers to `i32` and to `u32`, which reads the bytes of one type as another fixtures/reject/src/alloc.rs:alloc_retyped+7:17: memory from `alloc` cast to pointers to `i32` and to `u32`, which reads the bytes of one type as another diff --git a/ts/fixtures/reject/expected.txt b/ts/fixtures/reject/expected.txt index af035c139..1aa3303a2 100644 --- a/ts/fixtures/reject/expected.txt +++ b/ts/fixtures/reject/expected.txt @@ -3,6 +3,8 @@ no item `clones::slice_of_object` in the crate no item `lopsided` in the crate no item `missing` in the crate fixtures/reject/src/alloc.rs:addressed+1:17: a pointer's address, which JS has no counterpart of +fixtures/reject/src/alloc.rs:adopted+2:24: `Vec::from_raw_parts` of `pointers::Halves`, which JS keeps as an object that knows no array it is in +fixtures/reject/src/alloc.rs:adopted+3:23: `Vec::from_raw_parts` of `()`, which has no bytes fixtures/reject/src/alloc.rs:alloc_retyped+4:7: memory from `alloc` cast to pointers to `u32` and to `i32`, which reads the bytes of one type as another fixtures/reject/src/alloc.rs:alloc_retyped+5:11: memory from `alloc` cast to pointers to `i32` and to `u32`, which reads the bytes of one type as another fixtures/reject/src/alloc.rs:alloc_retyped+7:17: memory from `alloc` cast to pointers to `i32` and to `u32`, which reads the bytes of one type as another diff --git a/ts/fixtures/reject/src/alloc.rs b/ts/fixtures/reject/src/alloc.rs index dd4e03d8b..ab5e6c6c1 100644 --- a/ts/fixtures/reject/src/alloc.rs +++ b/ts/fixtures/reject/src/alloc.rs @@ -69,3 +69,12 @@ pub fn alloc_retyped() -> i32 { pub fn zeroed() -> u32 { unsafe { *(std::alloc::alloc_zeroed(std::alloc::Layout::new::()) as *mut u32) } } + +/// `Vec`s adopting memory by `from_raw_parts`: of the crate's struct, which JS keeps as an +/// object that knows no array it is in, and of `()`, which has no bytes. +pub fn adopted() -> usize { + let dangling = std::ptr::NonNull::dangling().as_ptr(); + let halves = unsafe { Vec::::from_raw_parts(dangling, 0, 0) }; + let units = unsafe { Vec::<()>::from_raw_parts(std::ptr::NonNull::dangling().as_ptr(), 3, 0) }; + halves.len() + units.len() +} diff --git a/ts/fixtures/reject/ts.toml b/ts/fixtures/reject/ts.toml index 4d5efb53d..09ce3e1a1 100644 --- a/ts/fixtures/reject/ts.toml +++ b/ts/fixtures/reject/ts.toml @@ -1,6 +1,7 @@ package = "reject-fixture" roots = [ "alloc::addressed", + "alloc::adopted", "alloc::alloc_retyped", "alloc::allocated", "alloc::bytes_as_values", diff --git a/ts/runtime/rs.ts b/ts/runtime/rs.ts index e1f77d1f2..ea40fde0f 100644 --- a/ts/runtime/rs.ts +++ b/ts/runtime/rs.ts @@ -13,7 +13,7 @@ import type { Iter, Range, RangeInclusive } from "./rs/iter.ts"; import type { Location } from "./rs/location.ts"; import { drop as dispose, dropAll, partPlace, type Pending } from "./rs/task.ts"; -import { allocError, CAPACITY_OVERFLOW, type TryReserveError } from "./rs/alloc.ts"; +import { allocError, Block, CAPACITY_OVERFLOW, type TryReserveError } from "./rs/alloc.ts"; import { AtIndex } from "./rs/collections.ts"; import { escapeDebug } from "./rs/char.ts"; import { byteSliceUtf8Chunks, String as RsString, strFromUtf8Unchecked, stringClone, stringCloneFrom, stringFrom, stringLen, stringNew, stringOf, stringPush, stringPushStr, stringWithCapacity } from "./rs/str.ts"; @@ -2622,15 +2622,87 @@ export function vecSetLen(v: Vec, length: number, size: number, uninit: () const cap = vecCapacity(v, size); if (length > cap) panic(SET_LEN, "vec_set_len"); vecHold(v, cap); - const items = v.items; - if (length === items.length) return; + if (length === v.items.length) return; const room = roomOf(v, size); room.uninit = uninit; - for (let i = length; i < items.length; i++) room.set(i, items[i]); + relength(v, room, length); +} + +/** `v`'s items cut or lengthened to `length`: what they give up kept in `room`, and what they take in from there. */ +function relength(v: Vec, room: Room, length: number): void { + const items = v.items; + // A slot never written, as memory from `alloc` has, stays one. + for (let i = length; i < items.length; i++) if (i in items) room.set(i, items[i]); for (let i = items.length; i < length; i++) items.push(room.take(i)); if (length < items.length) items.length = length; } +/** What std's check of `from_raw_parts`'s precondition says. */ +const FROM_RAW_PARTS = "unsafe precondition(s) violated: Vec::from_raw_parts_in requires that length <= capacity\n\nThis indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety."; + +/** + * The storage the pointer `p`, which `Vec::from_raw_parts` takes, starts: the array it + * points at the start of, memory from `alloc` or a `Vec`'s, or an array of the one value + * in no array it points at, as a `Box`'s is; or `undefined` where it holds nothing, dangling + * or memory from `alloc` no cast typed. + */ +function rawPartsOf(p: Place): object | undefined { + if (p === DANGLING || p instanceof Block) return undefined; + if (!(p instanceof AtIndex)) return [p.v]; + if (p.index !== 0) { + throw new Error("rust2-ts: `Vec::from_raw_parts` of a pointer past the start of the memory it points into"); + } + return p.array; +} + +/** + * The place `p` of a value in no array, which a `Vec` adopted, made the place `at` of its + * first slot, so a write through either reads through the other, as both are Rust's one + * memory. + */ +function rehome(p: Place, at: Place): void { + Object.defineProperty(p, "v", { + get: () => at.v, + set: (value: unknown) => { + at.v = value; + }, + }); +} + +/** + * `Vec::from_raw_parts` of `size`-byte elements: the `Vec` of the array `p` starts, memory + * from `alloc` or a `Vec`'s, holding its first `length` and the rest in its room, with + * room for `cap`. Past the capacity it panics, as `vecSetLen` does. + */ +export function vecFromRawParts(p: Place, length: number, cap: number, size: number): Vec { + if (length > cap) panic(FROM_RAW_PARTS, "vec_from_raw_parts"); + const items = rawPartsOf(p); + if (items === undefined) return new Vec([], cap); + const v = new Vec(items as T[], cap); + // The room the items had, which this `Vec` holds now, or a new one. + relength(v, roomOf(v, size), length); + if (!(p instanceof AtIndex)) rehome(p, new AtIndex(v.items, 0)); + return v; +} + +/** `Vec::from_raw_parts` of bytes: the `Vec` of the storage `p` starts, exactly `cap` bytes, or a copy of the byte in no array it points at, holding its first `length`. */ +export function byteVecFromRawParts(p: Place, length: number, cap: number): ByteVec { + if (length > cap) panic(FROM_RAW_PARTS, "vec_from_raw_parts"); + const data = rawPartsOf(p); + const v = new ByteVec(data instanceof Uint8Array ? 0 : cap); + if (data instanceof Uint8Array) { + if (data.length !== cap) { + throw new Error(`rust2-ts: \`Vec::from_raw_parts\` of bytes with a capacity of ${cap}, which isn't the storage's`); + } + v.data = data; + } else if (data !== undefined) { + v.data.set(data as number[]); + rehome(p, new AtIndex(v.data, 0)); + } + v.length = length; + return v; +} + /** * `Vec::clone_from` of `src`, and `clone_into` of a byte slice, over `v`: its buffer, grown * as `reserve` grows it if it holds fewer, holding a copy of `src`'s bytes. diff --git a/ts/runtime/rs/alloc.ts b/ts/runtime/rs/alloc.ts index a628ffcd3..3229cd232 100644 --- a/ts/runtime/rs/alloc.ts +++ b/ts/runtime/rs/alloc.ts @@ -5,7 +5,7 @@ // write of its bytes fails. `realloc` keeps the values in a new array, and `dealloc` lets // the array go; a pointer into it after either reads what Rust leaves undefined. -import { Abort, Err, type Fmt, type FmtResult, type Formatter, fmtDebugStructFields, fmtPad, fmtWriteFmt, Ok, type Place, type Result } from "../rs.ts"; +import { Abort, Err, type Fmt, type FmtResult, type Formatter, fmtDebugStructFields, fmtPad, fmtWriteFmt, Ok, type Place, type Result, roomPast } from "../rs.ts"; import { AtIndex } from "./collections.ts"; import { type u32, u32Debug, type usize, usizeDebug } from "./int.ts"; @@ -207,6 +207,9 @@ export function realloc(p: Place, size: usize): Block { const n = Math.floor(size / block.elem); next.array = array.slice(0, n); next.array.length = n; + // What a `Vec` holding the memory keeps past its length is the memory's too. + const room = roomPast(array, array.length); + if (room) for (const [i, value] of room.slots) if (i >= array.length && i < n) next.array[i] = value; next.elem = block.elem; next.type = block.type; BLOCKS.set(next.array, next); diff --git a/ts/src/census.rs b/ts/src/census.rs index 55d1c8516..4761e2102 100644 --- a/ts/src/census.rs +++ b/ts/src/census.rs @@ -170,6 +170,7 @@ const VERBATIM: &[&str] = &[ "Result", "Some", "UpperExp", + "Vec::from_raw_parts", "Vec::into_flattened", "Vec::splice", "alloc", diff --git a/ts/src/lower/caller.rs b/ts/src/lower/caller.rs index dad6dba08..179575197 100644 --- a/ts/src/lower/caller.rs +++ b/ts/src/lower/caller.rs @@ -116,6 +116,12 @@ const SITES: &[(&str, &str, &str, &str)] = &[ "pub const unsafe fn set_len(", "ub_checks::assert_unsafe_precondition!(", ), + ( + "vec_from_raw_parts", + "alloc/src/vec/mod.rs", + "pub const unsafe fn from_raw_parts_in(", + "ub_checks::assert_unsafe_precondition!(", + ), ( "into_flattened", "alloc/src/vec/mod.rs", diff --git a/ts/src/lower/pointer.rs b/ts/src/lower/pointer.rs index dc6ef7636..259ccc897 100644 --- a/ts/src/lower/pointer.rs +++ b/ts/src/lower/pointer.rs @@ -853,6 +853,27 @@ pub fn call<'tcx>( _ => Expr::rs("vecAsPtr", vec![s, super::iter::size_of(b, elem, span)]), } } + // The `Vec` of the array a pointer starts, memory from `alloc` or a `Vec`'s, which it + // holds the first `len` of, and keeps the rest of in its room, up to `cap`. + ("Vec", "from_raw_parts") => { + let elem = pointee(); + let (p, len, cap) = (arg(), arg(), arg()); + if b.t.zero_sized(elem) { + return Ok(Some( + b.err(span, format!("`Vec::from_raw_parts` of `{elem}`, which has no bytes")), + )); + } + if let Some(why) = unmodeled(b, elem, "`Vec::from_raw_parts` of") { + return Ok(Some(b.err(span, why))); + } + match super::byte(elem) { + true => Expr::rs("byteVecFromRawParts", vec![p, len, cap]), + false => Expr::rs( + "vecFromRawParts", + vec![p, len, cap, super::iter::size_of(b, elem, span)], + ), + } + } ("ptr" | "NonNull", "add" | "sub" | "offset" | "wrapping_add" | "wrapping_sub" | "wrapping_offset") => { let (p, n) = (arg(), arg()); if b.t.zero_sized(pointee()) { diff --git a/ts/tests/pointers.ts b/ts/tests/pointers.ts index 70fd79509..19872d8a8 100644 --- a/ts/tests/pointers.ts +++ b/ts/tests/pointers.ts @@ -82,6 +82,11 @@ unsure(() => rs.realloc(words, 16)); const grown = rs.realloc(rs.allocBytes(words, 4, "u32"), 18); assert.deepEqual(Array.from(grown.array ?? []), [0xffffffff, undefined, undefined, undefined]); +// A `Vec` adopting memory from a pointer past where it starts, which no allocation does, +// and bytes with a capacity other than the storage's. +unsure(() => rs.vecFromRawParts(rs.ptrAdd(rs.allocAs(rs.alloc({ size: 8, align: 4 }), 4, "u32"), 1), 0, 1, 4)); +unsure(() => rs.byteVecFromRawParts(rs.byteVecAsPtr(rs.byteVecWithCapacity(4)), 0, 8)); + // A dangling pointer read through, written through, or copied from, which Rust leaves // undefined, rather than reading `undefined`. const dangling: rs.Place = rs.DANGLING;