You seem to be referring to an older version of the RFC. In the current version, there is no StackPin
proposal, or anything called “pinned”.
I think the name Pin works by analogy to MutexGuard. The existence of a MutexGuard means the mutex is locked, but the guard value isn’t called a Locked. Analogously, then, the Pin serves as evidence that the inner value is pinned.
Also, the word “pinned” describes the inner value, not the outer reference. If a Pin was just a flat wrapper type representing the status of the inner value, naming it after the adjective describing that status would make sense. However, the Pin is a separate reference value, so it makes more sense for its name to be a noun, indicating that it is a thing rather than a status.
As for StackPin, in the event of a stack pinning proposal, I agree that it’s inconsistent. If the existence of a Pin is evidence that a value is pinned, and a StackPin is a reference to a stack value that isn’t pinned yet, then it isn’t itself a pin, making the name wrong. I’d suggest a name like StackHasp. I suppose “hasp” is a bit of a non-obvious name (like my above mentioned “fob” which hasn’t seen any love
), but it fits remarkably well, since a hasp is a fastener that needs to be secured with a pin, and a hasp that hasn’t been pinned isn’t secure yet, which perfectly describes the role of the intermediate value required to make stack pinning work.
I’m not sure about PinBox though. I get that it’s a pin which is also a box, but the name suggests that it’s a box for pins rather than a box which is also a pin. Alternatives would be OwningPin by analogy to OwningRef, or PinningBox. These are of course longer, but I’m not sure length matters as much as for Pin.
Also, PinBox makes me think of PMBOK® Guide, but that’s neither here nor there.