Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Better associate rustc diagnostics to crate #8977

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`

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.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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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`
Projects
None yet
Development

No branches or pull requests

3 participants