Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
dd2ebf5
chore(quest): claim quest/m3/ts-unsafe.md
kixelated Nov 1, 2026
3bafa03
feat(ts): translate pointers into arrays as rt.AtIndex
kixelated Nov 1, 2026
9988c74
fix(ts): refuse a pointer to an element of an array its variable or h…
kixelated Nov 1, 2026
3548e24
Merge remote-tracking branch 'origin/main' into model-unsafe-operations
kixelated Nov 1, 2026
2d8439e
chore(ts): refresh the lang harness snapshot after merging main
kixelated Nov 1, 2026
f2ed825
fix(ts): keep element pointers exact at wrapped addresses, lone value…
kixelated Nov 1, 2026
ca0d3aa
fix(ts): copy only a shared slice of a lone byte, and keep a lone val…
kixelated Nov 1, 2026
981806c
Merge remote-tracking branch 'origin/main' into model-unsafe-operations
kixelated Nov 1, 2026
505dcde
chore(ts): refresh the lang harness snapshot after merging main
kixelated Nov 1, 2026
c82cad5
Merge remote-tracking branch 'origin/main' into model-unsafe-operations
kixelated Nov 1, 2026
762bbd9
feat(ts): refuse pointers a body shows crossing what JS keeps apart
kixelated Nov 1, 2026
7b65f42
fix(ts): trace slices from raw parts, and type arguments past lifetimes
kixelated Nov 1, 2026
42894ef
chore(ts): refresh the lang snapshot for a shared part's pointers
kixelated Nov 1, 2026
f5176ec
feat(ts): model typed allocation as a fresh JS array
kixelated Nov 1, 2026
9fe6969
fix(ts): key memory from alloc by its type, and snapshot the heap cases
kixelated Nov 2, 2026
5ff200e
style(ts): format the alloc refusal
kixelated Nov 2, 2026
08da9f2
fix(ts): trace only std's pointer functions, copy unwritten memory, a…
kixelated Nov 2, 2026
c7beaa5
chore(ts): refresh the lang snapshot for the pointer fixes
kixelated Nov 2, 2026
41ee462
fix(ts): move null and dangling pointers by address
kixelated Nov 2, 2026
923432e
style(ts): format the dangling cases
kixelated Nov 2, 2026
fadfdfa
chore(ts): refresh the lang snapshot for dangling pointers
kixelated Nov 2, 2026
8a6e1f3
fix(ts): measure equal addresses as none apart
kixelated Nov 2, 2026
16d086b
style(ts): format the equal addresses case
kixelated Nov 2, 2026
19bb6ee
chore(ts): refresh the lang snapshot for equal addresses
kixelated Nov 2, 2026
2726e72
Merge remote-tracking branch 'origin/main' into model-unsafe-operations
kixelated Nov 2, 2026
1fff10c
chore(ts): refresh the snapshots after merging main
kixelated Nov 2, 2026
fc68973
Merge branch 'model-unsafe-operations' into ts-unsafe/typed-alloc
kixelated Nov 2, 2026
cd6c8e3
fix(ts): key alloc memory by what a MaybeUninit holds, and keep the v…
kixelated Nov 2, 2026
ffd4087
Merge remote-tracking branch 'origin/main' into quest/m3/ts-unsafe
kixelated Nov 2, 2026
21e4090
Merge remote-tracking branch 'origin/main' into quest/m3/ts-unsafe
kixelated Nov 2, 2026
39a0a39
fix(ts): free alloc memory through cast and as_ptr
kixelated Nov 2, 2026
763e2c5
Merge remote-tracking branch 'origin/quest/m3/ts-unsafe' into ts-unsa…
kixelated Nov 2, 2026
300d578
Merge remote-tracking branch 'origin/main' into ts-unsafe/typed-alloc
kixelated Nov 2, 2026
c88a91f
chore(ts): refresh the reject snapshot after merging main
kixelated Nov 2, 2026
d6b4f5f
Merge remote-tracking branch 'origin/main' into quest/m3/ts-unsafe
kixelated Nov 2, 2026
f1ff2f4
test(ts): accept wasm32's fma a last place off where the translation …
kixelated Nov 2, 2026
ca5ef08
fix(ts): refuse offset_from across array fields, fail on dangling ele…
kixelated Nov 2, 2026
a4b0bc3
chore(ts): regenerate the reject census after merging main
kixelated Nov 2, 2026
19af103
fix(ts): normalize pointers through mutable parts, keep null and dang…
kixelated Nov 2, 2026
702c5a1
Merge remote-tracking branch 'origin/main' into quest/m3/ts-unsafe
kixelated Nov 2, 2026
c209b23
fix(ts): keep the empty byte slices' sentinels tree-shakeable, regene…
kixelated Nov 2, 2026
b091e2e
fix(ts): keep the pointer an empty slice from no array was made from
kixelated Nov 2, 2026
6e3c854
Merge remote-tracking branch 'origin/main' into quest/m3/ts-unsafe
kixelated Nov 2, 2026
33d0b07
fix(ts): find an empty slice's null pointer, which ?? passes over
kixelated Nov 2, 2026
1c170e3
fix(ts): unsize a raw pointer to an array as the place of its slice, …
kixelated Nov 2, 2026
a15976e
test(ts): read an unsized raw slice pointer through a cast
kixelated Nov 2, 2026
b47bb4c
chore(ts): regenerate the elements snapshot
kixelated Nov 2, 2026
b7e835e
Merge remote-tracking branch 'origin/main' into quest/m3/ts-unsafe
kixelated Nov 2, 2026
f270a35
feat(ts): keep a raw slice pointer as its start and length
kixelated Nov 2, 2026
010d1ad
perf(ts): keep the slice a raw slice pointer's first read makes
kixelated Nov 2, 2026
b71eb2f
fix(ts): fail a raw slice read past an array that shrank
kixelated Nov 2, 2026
2224ffe
fix(ts): read through NonNull::as_mut of a slice
kixelated Nov 2, 2026
bbfa2a4
Merge remote-tracking branch 'origin/main' into t3/3bf18645
kixelated Nov 2, 2026
f3d30f7
Merge remote-tracking branch 'origin/main' into t3/3bf18645
kixelated Nov 2, 2026
4c5c4a7
fix(ts): keep the pointer of an empty slice of a lone byte
kixelated Nov 2, 2026
f3803a6
Merge commit '4c5c4a72' into t3/ta-418
kixelated Nov 2, 2026
1d82ffa
chore(ts): regenerate snapshots after merging #400's raw slices
kixelated Nov 2, 2026
3d1675e
Merge remote-tracking branch 'origin/main' into t3/ta-418
kixelated Nov 2, 2026
3c4b7c8
chore(quest): record offset_from across views of one byte buffer
kixelated Nov 2, 2026
aa24f66
Merge remote-tracking branch 'origin/main' into t3/ta-418
kixelated Nov 2, 2026
43d032c
fix(ts): refuse memory from alloc cast to two types in one body
kixelated Nov 2, 2026
a816bfb
fix(ts): trace an allocation's type through realloc in one body
kixelated Nov 2, 2026
d91b4e8
Merge remote-tracking branch 'origin/main' into t3/ta-418
kixelated Nov 2, 2026
7236720
fix(ts): trace an allocation through pointer cast calls
kixelated Nov 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions quest/m3/ts-unsafe.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ none of its own `unsafe`.
with a span; a pointer from elsewhere, such as a field, fails there loudly at run time.
A pointer to an element JS keeps as an object, such as a tuple or the crate's struct, is
that object, which knows no array it is in, so arithmetic on one stays refused:
hashbrown's buckets and kio's `log.rs` reach it. smallvec's pointer arithmetic
translates, but it spills to memory from `alloc::alloc`, which this Plan refuses, so it
translates whole only once the maintainer decides how a typed allocation
(`Layout::array::<T>`, then a cast to `*mut T`) is modeled or that smallvec is mapped.
hashbrown's buckets and kio's `log.rs` reach it.
- Decided with the maintainer on 2026-11-01, typed allocation: memory from `alloc` for a
`Layout::array::<T>(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 is
left.
- Decided with the maintainer on 2026-11-02: a raw slice pointer is `rt.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.
Expand All @@ -51,6 +53,10 @@ none of its own `unsafe`.
`set_len` is refused, and a write past the length fails loudly at run time, since the
JS array would grow by it. The spare slots need to live outside the array's length
until `set_len` takes them.
- `offset_from` between byte pointers into two views of one buffer, such as a slice's
`as_mut_ptr` and its `iter_mut`'s first element: each is an `rt.AtIndex` into its own
`Uint8Array`, so it fails loudly at run time where Rust measures the distance. Comparing
by buffer and byte offset closes it.
- `UnsafeCell::raw_get`, `from_mut`, and `replace`, refused with their span: none is in
moq's census at the pin.
- A slice's pointer cast to an array's of its length, `*(s as *const [u8] as *const
Expand Down
5 changes: 3 additions & 2 deletions ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ and each type a module of its own beside it, holding the type and its functions
from. `rt.ts` beside them is the
runtime: what std does that JS does not, with iterators in `rt/iter.ts`, `str`'s searches
in `rt/str.ts`, the ASCII methods of `u8`, `char`, `[u8]`, and `str` in `rt/ascii.ts`, collections in `rt/collections.ts`, hashing in `rt/hash.ts`, ownership, atomics, and async in
`rt/task.ts`, `f64`'s and `f32`'s methods in `rt/float.ts`, and `Duration` in `rt/time.ts`. What translates from std's own MIR,
`rt/task.ts`, `f64`'s and `f32`'s methods in `rt/float.ts`, `Duration` in `rt/time.ts`, and `Layout` and memory from `alloc` in `rt/alloc.ts`. What translates from std's own MIR,
`Option`'s, `Result`'s, and `Poll`'s methods, `==` of std's errors, `==` and ordering of a `Result` and a `Poll`, `cmp::max` and `min`, and the `str::parse` and
`from_str_radix` of an integer or a `NonZero` and `bool`'s `str::parse`, goes in a module under its crate's name, as
`core/option.ts` holds `map$1cf8u0y`. A dependency's modules go
Expand Down Expand Up @@ -118,6 +118,7 @@ crate translation reaches is refused, and so are two versions of one crate it re
| `PeekMut<T>` | `rt.PeekMut<T>`, the `rt.Place` of a heap's greatest element, which sifts it down as it drops once `DerefMut` lent it |
| `Ordering`, `DefaultHasher`, `RandomState` | `rt.Ordering`, which is `-1`, `0`, or `1`; `rt.Hasher`; `rt.RandomState`, the keys of the `DefaultHasher` it builds, never changed once made |
| `Duration` | `rt.Duration`: `{ secs, nanos }`, std's whole seconds as an `rt.u64` and the nanoseconds past them, never changed once made |
| `Layout`, `alloc::alloc` | `rt.Layout`: `{ size, align }`, never changed once made, checked as std's constructors check it; `alloc` gives an `rt.Block` of its bytes, which a cast of its pointer to `*mut T` the body shows came from `alloc` or `realloc` makes a JS array of `T`s, values JS copies, as an `rt.AtIndex` of its first; a cast back to `*mut u8` only as what `dealloc` or `realloc` takes, which free the array or copy it into a new one; its bytes, read, written, or cast to any other type, are refused, and fail at run time through a pointer from elsewhere |
| closure | an arrow function, with `[Symbol.dispose]` if it owns a value that drops, and what makes its clone if a clone can't be itself |
| `fn` pointer, function item as a value | the function, as a closure is typed: a `()` result is `undefined`, where a declared function returns `void` |
| `&dyn Trait`, `&mut dyn Trait`, `Box<dyn Trait>`, `Arc<dyn Trait>` | an object with the trait's methods, its supertraits' included: `shape.area$Shape()`; behind an `Arc`, an `rt.ArcDyn` sharing the count of the `Arc` it was made from |
Expand Down Expand Up @@ -852,7 +853,7 @@ they need.

## Not yet

Byte reinterpretation, pointer addresses, pointer arithmetic on a value JS keeps as an object (other than wrapping arithmetic on a null or dangling pointer), raw allocation, and unions whose
Byte reinterpretation, pointer addresses, pointer arithmetic on a value JS keeps as an object (other than wrapping arithmetic on a null or dangling pointer), memory from `alloc` other than an array of values JS copies, and unions whose
fields overlap in different types ([unsafe](/quest/m3/ts-unsafe.md)), and trait objects other than
`&dyn Debug`, `&dyn Display`, `dyn Future`, `dyn Any`, `dyn Fn*`, `dyn Buf`, and the translated crates' traits'
behind `&`, `&mut`, `Box`, or `Arc` ([trait objects](/quest/m3/ts-dyn.md)), fail translation. Until they translate, an item that needs one, such as a `dyn Error`, binds to
Expand Down
10 changes: 5 additions & 5 deletions ts/fixtures/lang/expected/core/any.Any.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import * as rt from "../rt.ts";
import type * as Square from "../dyns.Square.ts";
import type * as Tri from "../dyns.Tri.ts";
import type * as Fault from "../fmt.Fault.ts";
import type * as fmt_Fault from "../fmt.Fault.ts";

export type Any = object;

Expand Down Expand Up @@ -32,9 +32,9 @@ export class of$dyns_Tri {
}

export class of$fmt_Fault {
v: Fault.Fault;
v: fmt_Fault.Fault;

constructor(v: Fault.Fault) {
constructor(v: fmt_Fault.Fault) {
this.v = v;
}
}
Expand Down Expand Up @@ -96,9 +96,9 @@ export class ofPlace$dyns_Tri {
}

export class ofPlace$fmt_Fault {
v: rt.Place<Fault.Fault>;
v: rt.Place<fmt_Fault.Fault>;

constructor(v: rt.Place<Fault.Fault>) {
constructor(v: rt.Place<fmt_Fault.Fault>) {
this.v = v;
}
}
Expand Down
7 changes: 7 additions & 0 deletions ts/fixtures/lang/expected/core/bool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ export function thenSome$1jqdi5p(self: boolean, t: rt.Duration): rt.Duration | u
return t;
}

export function thenSome$0j2n934(self: boolean, t: [rt.u8, rt.u16]): [rt.u8, rt.u16] | undefined {
if (!self) {
return undefined;
}
return t;
}

export function thenSome$03chm1q(self: boolean, t: [rt.u8, rt.u8]): [rt.u8, rt.u8] | undefined {
if (!self) {
return undefined;
Expand Down
29 changes: 29 additions & 0 deletions ts/fixtures/lang/expected/core/option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import * as defaults_Made from "../defaults.Made.ts";
import type * as dyns_Shape from "../dyns.Shape.ts";
import * as edits_Named from "../edits.Named.ts";
import type * as Ticked from "../generics.Ticked.ts";
import type * as heap_Fault from "../heap.Fault.ts";
import type * as hints_Unit from "../hints.Unit.ts";
import type * as Badge from "../iters.Badge.ts";
import type * as Quarter from "../iters.Quarter.ts";
Expand Down Expand Up @@ -1470,6 +1471,13 @@ export function mapOr$0f73bb7(self: [rt.u8, [rt.usize, rt.ByteSlice]] | undefine
return f(self);
}

export function mapOr$0hi5qhf(self: [rt.u8, rt.u16] | undefined, default_: rt.u8, f: (a0: [rt.u8, rt.u16]) => rt.u8): rt.u8 {
if (self === undefined) {
return default_;
}
return f(self);
}

export function mapOr$16umieg(self: [rt.usize, string] | undefined, default_: rt.usize, f: (a0: [rt.usize, string]) => rt.usize): rt.usize {
if (self === undefined) {
return default_;
Expand Down Expand Up @@ -1519,6 +1527,13 @@ export function mapOr$1m2xzon(self: rt.u8 | undefined, default_: boolean, f: (a0
return f(self);
}

export function mapOr$1qo6t0j(self: rt.u8 | undefined, default_: rt.u32, _: (a0: rt.u8) => rt.u32): rt.u32 {
if (self === undefined) {
return default_;
}
return self as rt.u32;
}

export function mapOr$18ph0j9(self: undefined | rt.None, default_: rt.u8, f: (a0: undefined) => rt.u8): rt.u8 {
if (self === rt.None) {
return default_;
Expand Down Expand Up @@ -1561,6 +1576,13 @@ export function okOr$1b6nkwr(self: rt.char | undefined, err: rt.u8): rt.Result<r
return rt.Ok(self);
}

export function okOr$1rxv64q(self: rt.Place<rt.u8> | undefined, err: heap_Fault.Fault): rt.Result<rt.Place<rt.u8>, heap_Fault.Fault> {
if (self === undefined) {
return rt.Err(err);
}
return rt.Ok(self);
}

export function okOr$0gtm15y(self: rt.ByteSlice | undefined, err: rt.u8 | undefined): rt.Result<rt.ByteSlice, rt.u8 | undefined> {
if (self === undefined) {
return rt.Err(err);
Expand Down Expand Up @@ -1624,6 +1646,13 @@ export function okOr$0g9lvh7(self: rt.u8 | undefined, _: undefined): rt.Result<r
return rt.Ok(self);
}

export function okOr$169x1m6(self: rt.usize | undefined, err: heap_Fault.Fault): rt.Result<rt.usize, heap_Fault.Fault> {
if (self === undefined) {
return rt.Err(err);
}
return rt.Ok(self);
}

export function okOrElse$0awp3vn(self: rt.ByteVec | undefined, err: () => string): rt.Result<rt.ByteVec, string> {
if (self === undefined) {
return rt.Err(err());
Expand Down
8 changes: 8 additions & 0 deletions ts/fixtures/lang/expected/core/result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { eq$1horntk as float_parse_eq$1horntk } from "../core/num/float_parse.ts
import { eq$1v93ipo as str_error_eq$1v93ipo, eq$1f3e51k as str_error_eq$1f3e51k } from "../core/str/error.ts";
import { cmp$175ka5q as poll_cmp$175ka5q } from "../core/task/poll.ts";
import { eq$0dhyfbb as time_eq$0dhyfbb } from "../core/time.ts";
import type * as heap_Fault from "../heap.Fault.ts";
import type * as locks_Tally from "../locks.Tally.ts";
import * as Part from "../orders.Part.ts";
import type * as returns_Error from "../returns.Error.ts";
Expand Down Expand Up @@ -746,6 +747,13 @@ export function mapOrElse$0jxx67n(self: rt.Result<rt.u8, rt.u16>, default_: (a0:
return default_(self.error);
}

export function mapErr$0fesv1f(self: rt.Result<rt.Layout, rt.LayoutError>, op: (a0: rt.LayoutError) => heap_Fault.Fault): rt.Result<rt.Layout, heap_Fault.Fault> {
if (self.ok) {
return self as rt.Result<rt.Layout, heap_Fault.Fault>;
}
return rt.Err(op(self.error));
}

export function mapErr$12w1s5x(self: rt.Result<rt.u32[], rt.u8>, _: (a0: rt.u8) => rt.u16): rt.Result<rt.u32[], rt.u16> {
if (self.ok) {
return self as rt.Result<rt.u32[], rt.u16>;
Expand Down
23 changes: 15 additions & 8 deletions ts/fixtures/lang/expected/harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { ints, strings, derived, written as fmt_written, counts as fmt_counts, r
import { folds } from "./folds.ts";
import { methods, runs } from "./generics.ts";
import { values as hashes_values, random, bytes as hashes_bytes, own as hashes_own } from "./hashes.ts";
import { spills, remnants, layouts } from "./heap.ts";
import { hints, reserves } from "./hints.ts";
import { holds } from "./holds.ts";
import { u8Op, u16Op, u32Op, u64Op, u128Op, usizeOp, i8Op, i16Op, i32Op, i64Op, i128Op, isizeOp, i8Neg, i16Neg, i32Neg, i64Neg, i128Neg, isizeNeg, cast as ints_cast, convert, parses as ints_parses, widenings } from "./ints.ts";
Expand Down Expand Up @@ -293,18 +294,24 @@ export function cases(): [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec)
inline(data102, out103);
}] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["elements::edges", (_2203: rt.u8, data103: rt.ByteSlice, out104: rt.ByteVec): undefined => {
elements_edges(data103, out104);
}] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["elements::raw_slices", (_2204: rt.u8, data104: rt.ByteSlice, out105: rt.ByteVec): undefined => {
rawSlices(data104, out105);
}] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["elements::empty_parts", (_2205: rt.u8, data105: rt.ByteSlice, out106: rt.ByteVec): undefined => {
emptyParts(data105, out106);
}] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["hashes::own", (_2206: rt.u8, data106: rt.ByteSlice, out107: rt.ByteVec): undefined => {
hashes_own(data106, out107);
}] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["heap::spills", (_2204: rt.u8, data104: rt.ByteSlice, out105: rt.ByteVec): undefined => {
spills(data104, out105);
}] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["heap::layouts", (_2205: rt.u8, data105: rt.ByteSlice, out106: rt.ByteVec): undefined => {
layouts(data105, out106);
}] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["heap::remnants", (_2206: rt.u8, data106: rt.ByteSlice, out107: rt.ByteVec): undefined => {
remnants(data106, out107);
}] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["elements::raw_slices", (_2207: rt.u8, data107: rt.ByteSlice, out108: rt.ByteVec): undefined => {
rawSlices(data107, out108);
}] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["elements::empty_parts", (_2208: rt.u8, data108: rt.ByteSlice, out109: rt.ByteVec): undefined => {
emptyParts(data108, out109);
}] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["hashes::own", (_2209: rt.u8, data109: rt.ByteSlice, out110: rt.ByteVec): undefined => {
hashes_own(data109, out110);
}] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["refs::compared", (a0159: rt.u8, a1159: rt.ByteSlice, a2159: rt.ByteVec): undefined => {
compared(a0159, a1159.data, a1159.start, a1159.length, a2159);
}] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["rings::slices", (a0160: rt.u8, a1160: rt.ByteSlice, a2160: rt.ByteVec): undefined => {
rings_slices(a0160, a1160.data, a1160.start, a1160.length, a2160);
}] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["fmt::objects", (_2207: rt.u8, data107: rt.ByteSlice, out108: rt.ByteVec): undefined => {
fmt_objects(data107, out108);
}] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["fmt::objects", (_2210: rt.u8, data110: rt.ByteSlice, out111: rt.ByteVec): undefined => {
fmt_objects(data110, out111);
}] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["sorts::sorts", (a0161: rt.u8, a1161: rt.ByteSlice, a2161: rt.ByteVec): undefined => {
sorts(a0161, a1161.data, a1161.start, a1161.length, a2161);
}] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["sorts::disorders", disorders as (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined] as [string, (a0: rt.u8, a1: rt.ByteSlice, a2: rt.ByteVec) => undefined], ["sorts::btrees", (a0163: rt.u8, a1163: rt.ByteSlice, a2163: rt.ByteVec): undefined => {
Expand Down
17 changes: 17 additions & 0 deletions ts/fixtures/lang/expected/heap.Fault.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Generated by rust2-ts. Do not edit.

import * as rt from "./rt.ts";

export function fmt$fmt_Debug(self: Fault, f: rt.Formatter): rt.Result<undefined, rt.FmtError> {
if (self.tag === "Overflow") {
return rt.fmtWriteStr(f, "Overflow");
}
const _6: string = "Alloc";
const _7: string = "layout";
const _8: rt.Fmt = (f: rt.Formatter) => rt.fmtLayoutDebug(self.layout, f);
return rt.debugStructFinish(rt.debugStructField(rt.fmtDebugStruct(f, _6), _7, _8));
}

export type Fault = { tag: "Overflow" } | { tag: "Alloc"; layout: rt.Layout };

//# sourceMappingURL=heap.Fault.ts.map
Loading