about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-08-07 15:08:43 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-08-12 19:29:47 +0000
commitb2e7ae1f65fd5e1579692a9a7a8c95fb95aa1b04 (patch)
tree95604b39904a1e74363d100da4f7f510c9b5e83e /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent91376f416222a238227c84a848d168835ede2cc3 (diff)
downloadrust-b2e7ae1f65fd5e1579692a9a7a8c95fb95aa1b04.tar.gz
rust-b2e7ae1f65fd5e1579692a9a7a8c95fb95aa1b04.zip
Detect multiple crate versions on method not found
When a type comes indirectly from one crate version but the imported trait comes from a separate crate version, the called method won't be found. We now show additional context:

```
error[E0599]: no method named `foo` found for struct `dep_2_reexport::Type` in the current scope
 --> multiple-dep-versions.rs:8:10
  |
8 |     Type.foo();
  |          ^^^ method not found in `Type`
  |
note: you have multiple different versions of crate `dependency` in your dependency graph
 --> multiple-dep-versions.rs:4:32
  |
4 | use dependency::{do_something, Trait};
  |                                ^^^^^ `dependency` imported here doesn't correspond to the right crate version
  |
 ::: ~/rust/build/x86_64-unknown-linux-gnu/test/run-make/crate-loading/rmake_out/multiple-dep-versions-1.rs:4:1
  |
4 | pub trait Trait {
  | --------------- this is the trait that was imported
  |
 ::: ~/rust/build/x86_64-unknown-linux-gnu/test/run-make/crate-loading/rmake_out/multiple-dep-versions-2.rs:4:1
  |
4 | pub trait Trait {
  | --------------- this is the trait that is needed
5 |     fn foo(&self);
  |        --- the method is available for `dep_2_reexport::Type` here
```
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions