This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 6fbf444
committed
Tweak diagnostic output
```
error[E0277]: the trait bound `dep_2_reexport::Type: Trait` is not satisfied because the trait comes from a different crate version
--> multiple-dep-versions.rs:7:18
|
7 | do_something(Type);
| ^^^^ the trait `Trait` is not implemented for `dep_2_reexport::Type`
|
note: there are multiple different versions of crate `dependency` in the dependency graph
--> /home/gh-estebank/rust/build/x86_64-unknown-linux-gnu/test/run-make/crate-loading/rmake_out/multiple-dep-versions-1.rs:4:1
|
3 | pub struct Type(pub i32);
| --------------- this type implements the required trait
4 | pub trait Trait {
| ^^^^^^^^^^^^^^^ this is the required trait
|
::: multiple-dep-versions.rs:1:1
|
1 | extern crate dep_2_reexport;
| ---------------------------- one version of crate `dependency` is used here, as a dependency of crate `foo`
2 | extern crate dependency;
| ------------------------ one version of crate `dependency` is used here, as a direct dependency of the current crate
|
::: /home/gh-estebank/rust/build/x86_64-unknown-linux-gnu/test/run-make/crate-loading/rmake_out/multiple-dep-versions-2.rs:3:1
|
3 | pub struct Type;
| --------------- this type doesn't implement the required trait
4 | pub trait Trait {
| --------------- this is the found trait
= note: two types coming from two different versions of the same crate are different types even if they look the same
= help: you can use `cargo tree` to explore your dependency tree
note: required by a bound in `do_something`
--> /home/gh-estebank/rust/build/x86_64-unknown-linux-gnu/test/run-make/crate-loading/rmake_out/multiple-dep-versions-1.rs:12:24
|
12 | pub fn do_something<X: Trait>(_: X) {}
| ^^^^^ required by this bound in `do_something`
```1 parent 35bde07 commit 6fbf444
File tree
2 files changed
+48
-58
lines changed- compiler/rustc_trait_selection/src/error_reporting/traits
- tests/run-make/crate-loading
2 files changed
+48
-58
lines changedLines changed: 21 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1723 | 1723 | | |
1724 | 1724 | | |
1725 | 1725 | | |
1726 | | - | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
1727 | 1734 | | |
1728 | 1735 | | |
1729 | 1736 | | |
| |||
1740 | 1747 | | |
1741 | 1748 | | |
1742 | 1749 | | |
1743 | | - | |
1744 | | - | |
1745 | | - | |
| 1750 | + | |
1746 | 1751 | | |
1747 | 1752 | | |
1748 | | - | |
1749 | | - | |
1750 | | - | |
1751 | | - | |
1752 | | - | |
1753 | | - | |
1754 | | - | |
1755 | | - | |
1756 | | - | |
1757 | | - | |
1758 | | - | |
1759 | | - | |
1760 | | - | |
1761 | | - | |
1762 | 1753 | | |
1763 | 1754 | | |
1764 | 1755 | | |
| |||
1786 | 1777 | | |
1787 | 1778 | | |
1788 | 1779 | | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
1789 | 1787 | | |
1790 | 1788 | | |
1791 | 1789 | | |
1792 | 1790 | | |
1793 | 1791 | | |
1794 | 1792 | | |
1795 | 1793 | | |
1796 | | - | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
1797 | 1799 | | |
1798 | 1800 | | |
1799 | 1801 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 29 | + | |
| 30 | + | |
40 | 31 | | |
41 | 32 | | |
42 | 33 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
47 | 42 | | |
48 | 43 | | |
49 | 44 | | |
50 | 45 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
56 | 53 | | |
57 | 54 | | |
58 | 55 | | |
59 | 56 | | |
60 | 57 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 58 | + | |
| 59 | + | |
65 | 60 | | |
66 | 61 | | |
67 | 62 | | |
| |||
70 | 65 | | |
71 | 66 | | |
72 | 67 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 68 | + | |
| 69 | + | |
77 | 70 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 71 | + | |
| 72 | + | |
82 | 73 | | |
83 | 74 | | |
84 | 75 | | |
85 | 76 | | |
86 | 77 | | |
87 | 78 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 79 | + | |
| 80 | + | |
92 | 81 | | |
93 | 82 | | |
94 | 83 | | |
| |||
98 | 87 | | |
99 | 88 | | |
100 | 89 | | |
101 | | - | |
102 | | - | |
| 90 | + | |
103 | 91 | | |
104 | 92 | | |
105 | 93 | | |
| |||
0 commit comments