When I said std::alloc, I was referring to allocating things yourself in nightly with std::alloc::GlobalAlloc, which is not the same as poking at liballoc internals.
I also think that it’s hardly fair to call RawVec an implementation detail, when the nomicon describes its internals in detail (mind, not as API, but as a long-form example of safe unsafe usage), and when we get to touch other internal state of a Vec directly (i.e., the eponymous set_len).
Making alloc::raw_vec::RawVec inaccessible is fine. What I’m saying is that it’s possible to implement your own RawVec without allowing manipulation of Vec in extraordinarily dangerous ways. It’s pretty clear that people who have valid uses for set_len as it exists today can just implement a growable unsafe buffer themselves, instead of leaving a massive security footgun within arms’ reach.
Relatedly, I believe Scott made a point about panic-safety, which I get, but which completely misses my point. I already insist in abort-on-panic (something I can turn on for my binaries), so I don’t care about panic-safety here; I care about libraries, std or otherwise, reaching for set_len without understanding that possibly touching unallocated memory by mistake isn’t just UB, it’s asking to have your key material leaked and your service compromised.
(I do apologize for my rather rambling posts on this topic. Trying to make a point about security sometimes causes me to be a bit harsher than I intend to.)