Auto merge of #9077 - ehuss:fix-doc-resolver2-proc-macro, r=alexcrichton
Fix some issues with `cargo doc` and the new feature resolver.
This contains two related commits fixing some issues with `cargo doc` and the new feature resolver.
The first commit fixes a panic. The old code was using `UnitFor::new_normal` when computing doc units, but this was wrong. That essentially circumvents the new feature resolver, and breaks determining the correct features to use. I don't remember exactly what I was thinking when I wrote that, other than "rustdoc shouldn't care", but it does matter.
Unfortunately changing that makes collisions worse because it aggravates #6313, so the second commit adds some logic for removing some collisions automatically. Specifically:
- Prefers dependencies for the target over dependencies for the host (such as proc-macros).
- Prefers the "newest" version if it comes from the same source.
There are still plenty of situations where there can be collisions, but I'm uncertain on the best way to handle those.