about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-17 14:40:04 +0000
committerbors <bors@rust-lang.org>2024-08-17 14:40:04 +0000
commit9b318d2e93ce35e7ba32d8cfa96a1dbe63a7bed1 (patch)
tree2dd72d118de1410abacbc3cad76da93abb3c5585 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parentc6f81a452e291dd4ff5bcbc6ecb9cd6f2271f164 (diff)
parent110b19b2b6a9896d4d73b8bd8b735fa9c2503d1e (diff)
downloadrust-9b318d2e93ce35e7ba32d8cfa96a1dbe63a7bed1.tar.gz
rust-9b318d2e93ce35e7ba32d8cfa96a1dbe63a7bed1.zip
Auto merge of #128786 - estebank:multiple-crate-versions, r=fee1-dead
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: there are multiple different versions of crate `dependency` in the 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
```

Fix #128569, fix #110926, fix #109161, fix #81659, fix #51458, fix #32611. Follow up to #124944.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions