← board

Rust frontend — borrowed slice type (&[T], generalized &str)

What it does

&str (ptr+len over string data) is trivial — reuses AnsiString's existing length-prefixed layout read-only. The general case is the actual gap: &[T] for arbitrary T needs a non-owning ptr+len view type. Every existing PXX length-prefixed layout (AnsiString, dynarray) is heap-owning/refcounted — a slice borrows into someone else's storage (a stack array, part of a Vec, etc.) and must never free/refcount it.

Scope

Acceptance

Log