Skip to content

Better associate rustc diagnostics to crate #8977

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
dtolnay opened this issue Dec 15, 2020 · 1 comment
Open

Better associate rustc diagnostics to crate #8977

dtolnay opened this issue Dec 15, 2020 · 1 comment
Labels
A-console-output Area: Terminal output, colors, progress bar, etc. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage.

Comments

@dtolnay
Copy link
Member

dtolnay commented Dec 15, 2020

I am seeing an unfortunate phenomenon where, since I have a lot of crates that are used in a lot of projects, statistically it happens very often that Cargo prints "Compiling [one of my crates]" immediately followed by a compiler diagnostic from some totally unrelated crate. The user sees something like the following and understands it to mean that the error occurred while compiling quote, which is true in a sense because the crates are compiling in parallel, but quite misleading.

$ cargo build
...
   Compiling quote v1.0.7
error[E0412]: cannot find type `DeviceState` in this scope
  --> /home/builder/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/device_query-0.2.7/src/lib.rs:39:22
   |
39 | impl DeviceQuery for DeviceState {
   |                      ^^^^^^^^^^^ not found in this scope

I have been seeing a rising number of misdirected bug reports on my crates due to this behavior.

I think it would help a lot if Cargo could guarantee that compiler diagnostics were always printed below "Compiling [that exact crate]" (or equivalently labeled in some way), even if it means double-printing "Compiling [that exact crate]" or some terminal UI hack.

@dtolnay dtolnay added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Dec 15, 2020
@ehuss ehuss added the A-console-output Area: Terminal output, colors, progress bar, etc. label Dec 16, 2020
@jyn514
Copy link
Member

jyn514 commented Feb 18, 2021

cc #8889

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-console-output Area: Terminal output, colors, progress bar, etc. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

4 participants