You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I think I've found one case where warnings are still duplicated, or perhaps is a regression.
I'm using 1.62.1, and I see them doubled on Pycharm (up to date, with Rust plugin up to date).
To simulate, just create a new binary project, and insert any use:
use std::sync::Arc;fnmain(){println!("Hello, world!");}
Then, create a quick Run Configuration with cargo check --all-targets:
Note the "1 warning" on the left, but doubled on the complete output.
Also note that Pycharm uses JSON: cargo check --color=always --message-format=json-diagnostic-rendered-ansi --all-targets
On the terminal, I can reproduce with the exact same command, but not with either cargo check --color=always --message-format=json-diagnostic-rendered-ansi or cargo check --color=always --all-targets, hence I think the problem is on the interaction between these two options.
Thanks!
Steps
create a new bin project
insert any use
in Run -> Edit Configurations, add a cargo one with command: check --all-targets and your current workdir
run it (^R on macOS)
Possible Solution(s)
No response
Notes
No response
Version
No response
The text was updated successfully, but these errors were encountered:
There are two rustc invocations in your reproducible example (a test target and a bin target. check them with --verbose flag on). Both of them emit the same "unused import" diagnostics.
The deduplication behaviour was introduced since 1.55 by #9675. Cargo deduplicates rustc diagnostics message with a rudimental hash-them-all approach. For formats not primary for human to consume, such as json and json-diagnostic-rendered-ansi, Cargo would leave them as-is in order to open a door for downstream tools to program. We might consider introducing a new flag --dedup-message or so to explicitly deduplicate all kinds of messages, though I tend to avoid adding a bunch of flags onto Cargo's already complex surface. IMHO the current status is a good balance between human-readability and extensibility.
I am going to close this. If anyone gets a different thought, please leave comment below and we can revisit it. Thank you!
Problem
Hi, I think I've found one case where warnings are still duplicated, or perhaps is a regression.
I'm using 1.62.1, and I see them doubled on Pycharm (up to date, with Rust plugin up to date).
To simulate, just create a new binary project, and insert any use:
Then, create a quick Run Configuration with

cargo check --all-targets
:Note the "1 warning" on the left, but doubled on the complete output.
Also note that Pycharm uses JSON:
cargo check --color=always --message-format=json-diagnostic-rendered-ansi --all-targets
On the terminal, I can reproduce with the exact same command, but not with either
cargo check --color=always --message-format=json-diagnostic-rendered-ansi
orcargo check --color=always --all-targets
, hence I think the problem is on the interaction between these two options.Thanks!
Steps
use
cargo
one with command:check --all-targets
and your current workdirPossible Solution(s)
No response
Notes
No response
Version
No response
The text was updated successfully, but these errors were encountered: