-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
If two crates have the same name, distinguish them in rustc's output? #110926
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-crate-version-mismatchDiagnostics: Errors or lints caused be the use of two different crate versions.Diagnostics: Errors or lints caused be the use of two different crate versions.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-crate-version-mismatchDiagnostics: Errors or lints caused be the use of two different crate versions.Diagnostics: Errors or lints caused be the use of two different crate versions.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Code
I'm writing code that uses the py-spy and remoteprocess crates. py-spy also uses remoteprocess internally. I tried to switch to using a different version of remoteprocess with some patches, but I foolishly did this by changing my top-level crate to depend on
remoteprocess = { git = ... }, when what I really wanted was to use a[patch.crates-io]stanza. Anyway, the end result is that I had two differentremoteprocesscrates in my dependency tree without knowing it, and rustc gave me some spectacularly confusing errors. In particular, in a single message output, it suggested to try adding the lineuse remoteprocess::SomeTrait, and also suggested removing the lineuse remoteprocess::SomeTraitbecause it was unused.Current output
Desired output
It'd be nice if rustc detected this case and printed something hinting at what's going on?
Rationale and extra context
No response
Other cases
No response
Anything else?
No response