fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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