mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
c8c04663c5
This is useful when you have two dependencies that use different trait for the same thing and with the same name. The user can accidentally implement the bad one which might be confusing. This commits refactorizes existing diagnostics about multiple different crates with the same version and adds a note when similarly named traits are found. All diagnostics are merged into a single one.
25 lines
908 B
Plaintext
25 lines
908 B
Plaintext
error[E0277]: the trait bound `re_export_foo::foo::Foo: From<Bar>` is not satisfied
|
|
--> main.rs:14:29
|
|
|
|
|
LL | re_export_foo::into_foo(Bar);
|
|
| ----------------------- ^^^ the trait `From<Bar>` is not implemented for `re_export_foo::foo::Foo`
|
|
| |
|
|
| required by a bound introduced by this call
|
|
|
|
|
help: item with same name found
|
|
--> $DIR/foo-v1.rs:1:1
|
|
|
|
|
LL | pub struct Foo;
|
|
| ^^^^^^^^^^^^^^
|
|
= note: there are multiple different versions of crate `foo` in the dependency graph
|
|
= note: required for `Bar` to implement `Into<re_export_foo::foo::Foo>`
|
|
note: required by a bound in `into_foo`
|
|
--> $DIR/re-export-foo.rs:3:25
|
|
|
|
|
LL | pub fn into_foo(_: impl Into<foo::Foo>) {}
|
|
| ^^^^^^^^^^^^^^ required by this bound in `into_foo`
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|