> Why does the rust compiler fail to enforce it in this case?
A bug. The one linked, that we're all talking about.
Feel free to share a link to any software that has zero bugs.