Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions quest/m3/ts-unsafe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,6 @@ Public API: the translator's output.
- [BinaryHeap from std's MIR](/quest/m3/ts-unsafe/binary-heap-mir.md) - std's `BinaryHeap` and `PeekMut` translate, replacing the runtime's port
- [A slice's pointer cast to an array's](/quest/m3/ts-unsafe/array-casts.md) - `*(s as *const [u8] as *const [u8; N])` in a crate's own code, and `IoSlice`
- [Unchecked integer operations](/quest/m3/ts-unsafe/unchecked-ops.md) - `unchecked_*` and `NonZero::new_unchecked` translate, aborting on a violated precondition
- [NonZero's unchecked arithmetic](/quest/m3/ts-unsafe/nonzero-unchecked-ops.md) - `NonZero::unchecked_add` and `unchecked_mul` translate, aborting at std's site
- [UnsafeCell's raw accessors](/quest/m3/ts-unsafe/unsafecell.md) - `UnsafeCell::raw_get`, `from_mut`, and `replace` translate
- [A Box of one uninitialized value](/quest/m3/ts-unsafe/box-new-uninit.md) - `Box::new_uninit` and `new_zeroed` for one value translate, through `write` and `assume_init`
19 changes: 19 additions & 0 deletions quest/m3/ts-unsafe/nonzero-unchecked-ops.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# [XS] NonZero's unchecked arithmetic

## Goal

[rust2-ts](/ts/README.md) translates `NonZero::unchecked_add` and `NonZero::unchecked_mul`,
proven by differential tests against native Rust. Today each is refused by name.

## Plan

Left by [#622](https://github.com/moq-dev/rust2/pull/622), which translated the integers'
`unchecked_*` and `NonZero::new_unchecked` through `rs.precondition`. Both are unstable
(`nonzero_ops`) and not `#[track_caller]`, so a violated precondition aborts with std's
`unsafe precondition(s) violated` text located inside std's source, through `caller.rs`'s
`SITES`, rather than at the call.

Decided with the maintainer on 2026-11-07: ✅ m3, in this epic (rejected: skip). No
consumer at the moq pin.

Public API: the translator's output.