unsafe: Alignof, Offsetof, Sizeof documentation does not account for variable-size types #53921
Labels
Documentation
Issues describing a change to documentation.
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes (master)
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
go doc unsafe.Sizeof
What did you expect to see?
A statement that variables whose types are or contain type parameters have variable size, and so Alignof, Offsetof, and Sizeof are not constant expressions in those cases.
What did you see instead?
This implies that https://go.dev/play/p/ZcHTDWGcQgG should compile, but it does not.
Partially related: #40322
@gopherbot please add label Documentation
The text was updated successfully, but these errors were encountered: