Open and answer this issue on GitHub.
std, views, decision · opened 2026-11-20 · updated 2026-11-22 · 0 comments
Found while std’s “nothing was copied” and “allocates nothing” Rust tests count allocations instead of comparing addresses or sizes (#2319)
A program (and above all a test) can ask whether two values share their storage: “this slice is a view into that text”, “the move copied nothing”, “the cache handed back the same value”. Today the only way a Nikaia test sees “nothing was copied” is counting allocations with std::mem::allocations() (ADR-400), which needs the counting allocator and says less than the identity itself.
std::mem::same(a, b) -> Bool, std::mem::shares(view, owner) -> Bool) or an operator; what it compares (the address of the first byte; for a view, whether its range lies inside the owner’s).std::mem function that answers on the storage of two values, documented as no promise the compiler keeps across versions, used first by #2319’s tests.An ADR or specification section decides the form; the build is filed ready with a test in tests/compiler/tests/.