Description
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 different remoteprocess
crates 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 line use remoteprocess::SomeTrait
, and also suggested removing the line use remoteprocess::SomeTrait
because it was unused.
Current output
error[E0599]: no method named `copy` found for struct `Process` in the current scope
--> src/shmem.rs:273:22
|
273 | .copy(current.metadata.name_ptr, current.metadata.name_len)?;
| ^^^^ method not found in `Process`
|
::: /Users/njs/.cargo/registry/src/github.com-1ecc6299db9ec823/remoteprocess-0.4.11/src/lib.rs:170:8
|
170 | fn copy(&self, addr: usize, length: usize) -> Result<Vec<u8>, Error> {
| ---- the method is available for `remoteprocess::osx::Process` here
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
1 | use remoteprocess::ProcessMemory;
|
warning: unused import: `remoteprocess::ProcessMemory`
--> src/shmem.rs:5:5
|
5 | use remoteprocess::ProcessMemory;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
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