Very confusing diagnostics #46388
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Let's presume you have the following code in your Cargo.toml:
And this inside main.rs:
This works fine.
Now you decide to update flate2 from 0.2 to 1.0 and change the line in Cargo.toml to
flate2="1.0"
, not doing anything else.You will get an error message that is super confusing:
First it says it can't find the trait. That is the only true thing that rustc says. Version 1.0 of flate2 has removed that trait, so you must change your code.
Second, it says that the trait is not used anywhere. This is wrong, we want to use it, right below!
Third, it suggests to add a use for the trait. But we have done precisely that!
I can even live with the second error, but the suggestion inside the third error is definitely bad.
The underlying issue is probably that syntect version 1.8.x depends on flate2 0.2 so rustc has the metadata of flate2 0.2 loaded. It seems to mix up the versions somehow :).
The text was updated successfully, but these errors were encountered: