]> git.proxmox.com Git - cargo.git/commit
Auto merge of #9077 - ehuss:fix-doc-resolver2-proc-macro, r=alexcrichton
authorbors <bors@rust-lang.org>
Wed, 20 Jan 2021 19:02:26 +0000 (19:02 +0000)
committerbors <bors@rust-lang.org>
Wed, 20 Jan 2021 19:02:26 +0000 (19:02 +0000)
commit783bc43c660bf39c1e562c8c429b32078ad3099b
treea3f4a822e7bc1c4190e1b035f85efee2942f5a84
parent8e075c9cab41eb1ed6222f819924999476477f2e
parentc5e3f17f3b5d5aebe2725bd56019a6ecb05c0360
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.

Fixes #9064
src/cargo/core/compiler/unit_dependencies.rs
src/cargo/ops/cargo_compile.rs