diff --git a/quest/m3/README.md b/quest/m3/README.md index d7109b4bc..e5fd9a959 100644 --- a/quest/m3/README.md +++ b/quest/m3/README.md @@ -51,3 +51,4 @@ memory model for values whose address is reinterpreted, without a consumer. - [`if let` of a temporary whose rest drops](/quest/m3/ts-if-let-drop.md) - `if let Some(E::A(x)) = temp()` with a destructor in the rest of `temp` emits TypeScript that type-checks - [`u64` wrapping arithmetic in V8](/quest/m3/ts-u64-wrapping.md) - `rs.u64WrappingAdd` and its kin cost near a plain `+` while the value is a safe integer - [Array references from slices and cells](/quest/m3/ts-array-ref-conversions.md) - `try_into` of a slice into an array reference, `Cell::as_array_of_cells`, and `identity` of a `&mut [T; N]` lend the array where it is +- [A Pin of a crate's own Deref type](/quest/m3/ts-pin-own-deref.md) - `Pin
` over a crate's own `Deref` derefs through its impl and type-checks diff --git a/quest/m3/ts-pin-own-deref.md b/quest/m3/ts-pin-own-deref.md new file mode 100644 index 000000000..57569126e --- /dev/null +++ b/quest/m3/ts-pin-own-deref.md @@ -0,0 +1,19 @@ +# [S] A Pin of a crate's own Deref type type-checks + +## Goal + +[rust2-ts](/ts/README.md) translates a `Pin
` whose `P` is a crate's own `Deref` type, +such as `Pin::new(OwnPtr(Cell::new(0)))` with `old.get()` called through it, into +TypeScript that type-checks, its deref going through `P`'s own `Deref` impl, proven by +differential tests against native Rust. Today `tsc` rejects it (TS2739), since `Pin
`'s +deref is typed as `P` itself. + +## Plan + +Found on [#621](https://github.com/moq-dev/rust2/pull/621) while checking a review finding. +It is safe Rust, where m3's [unsafe policy](/quest/m3/README.md) puts translation effort, +though no consumer at the moq pin reaches it. + +Decided with the maintainer on 2026-11-07: ✅ plan it, in m3 (from #621's follow-ups). + +Public API: the translator's output.