]> git.lizzy.rs Git - rust.git/blob - tests/ui/derives/issue-91550.stderr
Elaborate unmet obligations in E0599 for more context
[rust.git] / tests / ui / derives / issue-91550.stderr
1 error[E0599]: the method `insert` exists for struct `HashSet<Value>`, but its trait bounds were not satisfied
2   --> $DIR/issue-91550.rs:8:8
3    |
4 LL | struct Value(u32);
5    | ------------
6    | |
7    | doesn't satisfy `Value: Eq`
8    | doesn't satisfy `Value: Hash`
9    | doesn't satisfy `Value: PartialEq`
10 ...
11 LL |     hs.insert(Value(0));
12    |        ^^^^^^
13    |
14    = note: the following trait bounds were not satisfied:
15            `Value: Eq`
16            `Value: PartialEq`
17            which is required by `Value: Eq`
18            `Value: Hash`
19 help: consider annotating `Value` with `#[derive(Eq, Hash, PartialEq)]`
20    |
21 LL | #[derive(Eq, Hash, PartialEq)]
22    |
23
24 error[E0599]: the method `use_eq` exists for struct `Object<NoDerives>`, but its trait bounds were not satisfied
25   --> $DIR/issue-91550.rs:26:9
26    |
27 LL | pub struct NoDerives;
28    | --------------------
29    | |
30    | doesn't satisfy `NoDerives: Eq`
31    | doesn't satisfy `NoDerives: PartialEq`
32 LL |
33 LL | struct Object<T>(T);
34    | ---------------- method `use_eq` not found for this struct
35 ...
36 LL |     foo.use_eq();
37    |         ^^^^^^ method cannot be called on `Object<NoDerives>` due to unsatisfied trait bounds
38    |
39 note: the following trait bounds were not satisfied:
40       `NoDerives: Eq`
41       `NoDerives: PartialEq`
42   --> $DIR/issue-91550.rs:15:9
43    |
44 LL | impl<T: Eq> Object<T> {
45    |         ^^  ---------
46    |         |
47    |         unsatisfied trait bound introduced here
48 help: consider annotating `NoDerives` with `#[derive(Eq, PartialEq)]`
49    |
50 LL | #[derive(Eq, PartialEq)]
51    |
52
53 error[E0599]: the method `use_ord` exists for struct `Object<NoDerives>`, but its trait bounds were not satisfied
54   --> $DIR/issue-91550.rs:27:9
55    |
56 LL | pub struct NoDerives;
57    | --------------------
58    | |
59    | doesn't satisfy `NoDerives: Eq`
60    | doesn't satisfy `NoDerives: Ord`
61    | doesn't satisfy `NoDerives: PartialEq`
62    | doesn't satisfy `NoDerives: PartialOrd`
63 LL |
64 LL | struct Object<T>(T);
65    | ---------------- method `use_ord` not found for this struct
66 ...
67 LL |     foo.use_ord();
68    |         ^^^^^^^ method cannot be called on `Object<NoDerives>` due to unsatisfied trait bounds
69    |
70 note: the following trait bounds were not satisfied:
71       `NoDerives: Eq`
72       `NoDerives: Ord`
73       `NoDerives: PartialEq`
74       `NoDerives: PartialOrd`
75   --> $DIR/issue-91550.rs:18:9
76    |
77 LL | impl<T: Ord> Object<T> {
78    |         ^^^  ---------
79    |         |
80    |         unsatisfied trait bound introduced here
81 help: consider annotating `NoDerives` with `#[derive(Eq, Ord, PartialEq, PartialOrd)]`
82    |
83 LL | #[derive(Eq, Ord, PartialEq, PartialOrd)]
84    |
85
86 error[E0599]: the method `use_ord_and_partial_ord` exists for struct `Object<NoDerives>`, but its trait bounds were not satisfied
87   --> $DIR/issue-91550.rs:28:9
88    |
89 LL | pub struct NoDerives;
90    | --------------------
91    | |
92    | doesn't satisfy `NoDerives: Eq`
93    | doesn't satisfy `NoDerives: Ord`
94    | doesn't satisfy `NoDerives: PartialEq`
95    | doesn't satisfy `NoDerives: PartialOrd`
96 LL |
97 LL | struct Object<T>(T);
98    | ---------------- method `use_ord_and_partial_ord` not found for this struct
99 ...
100 LL |     foo.use_ord_and_partial_ord();
101    |         ^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `Object<NoDerives>` due to unsatisfied trait bounds
102    |
103 note: the following trait bounds were not satisfied:
104       `NoDerives: Eq`
105       `NoDerives: Ord`
106       `NoDerives: PartialEq`
107       `NoDerives: PartialOrd`
108   --> $DIR/issue-91550.rs:21:9
109    |
110 LL | impl<T: Ord + PartialOrd> Object<T> {
111    |         ^^^   ^^^^^^^^^^  ---------
112    |         |     |
113    |         |     unsatisfied trait bound introduced here
114    |         unsatisfied trait bound introduced here
115 help: consider annotating `NoDerives` with `#[derive(Eq, Ord, PartialEq, PartialOrd)]`
116    |
117 LL | #[derive(Eq, Ord, PartialEq, PartialOrd)]
118    |
119
120 error: aborting due to 4 previous errors
121
122 For more information about this error, try `rustc --explain E0599`.