Restore colour to rustdoc

This not only gives back the colour to structs, traits, and functions, but also restores the long-lost colour to enums. I’ve run [`linkchecker`](http://wummel.github.io/linkchecker/) and there don’t seem to be any more invalid links than usual.
I’m not entirely sure if the way I’ve implemented this is very idiomatic or reliable, but it seems to work.

Closes #17131.
Closes #16712.
Closes #16711.
This may end up causing confusion as it doesn't take into account `did.krate`, which can be nonzero in the case of inlining documentation from other crates. This could sporadically cause typedefs to become enums or vice versa perhaps.