rustdoc: Correctly distinguish enums and types

Closes #16712.