One of the big advantages of PrimaryMap is that it protects against using the wrong indices via a distinct index type. A Deref trait that returns a plain slice would accept other indices. Add a comment explaining this.
This crate contains array-based data structures used by the core Cranelift code generator which use densely numbered entity references as mapping keys.