fork/rust

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

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

master
3.9 KiB108 linesraw
1error[E0599]: the method `test` exists for struct `Foo<Enum, CloneEnum>`, but its trait bounds were not satisfied
2  --> $DIR/derive-trait-for-method-call.rs:28:15
3   |
4LL | enum Enum {
5   | ---------
6   | |
7   | doesn't satisfy `Enum: Clone`
8   | doesn't satisfy `Enum: Default`
9...
10LL | enum CloneEnum {
11   | -------------- doesn't satisfy `CloneEnum: Default`
12...
13LL | struct Foo<X, Y> (X, Y);
14   | ---------------- method `test` not found for this struct
15...
16LL |     let y = x.test();
17   |               ^^^^ method cannot be called on `Foo<Enum, CloneEnum>` due to unsatisfied trait bounds
18   |
19note: the following trait bounds were not satisfied:
20      `CloneEnum: Default`
21      `Enum: Clone`
22      `Enum: Default`
23  --> $DIR/derive-trait-for-method-call.rs:20:9
24   |
25LL | impl<X: Clone + Default + , Y: Clone + Default> Foo<X, Y> {
26   |         ^^^^^   ^^^^^^^                ^^^^^^^  ---------
27   |         |       |                      |
28   |         |       |                      unsatisfied trait bound introduced here
29   |         |       unsatisfied trait bound introduced here
30   |         unsatisfied trait bound introduced here
31note: the trait `Default` must be implemented
32  --> $SRC_DIR/core/src/default.rs:LL:COL
33help: consider annotating `Enum` with `#[derive(Clone)]`
34   |
35LL + #[derive(Clone)]
36LL | enum Enum {
37   |
38
39error[E0599]: the method `test` exists for struct `Foo<Struct, CloneStruct>`, but its trait bounds were not satisfied
40  --> $DIR/derive-trait-for-method-call.rs:34:15
41   |
42LL | struct Struct {
43   | -------------
44   | |
45   | doesn't satisfy `Struct: Clone`
46   | doesn't satisfy `Struct: Default`
47...
48LL | struct CloneStruct {
49   | ------------------ doesn't satisfy `CloneStruct: Default`
50...
51LL | struct Foo<X, Y> (X, Y);
52   | ---------------- method `test` not found for this struct
53...
54LL |     let y = x.test();
55   |               ^^^^ method cannot be called on `Foo<Struct, CloneStruct>` due to unsatisfied trait bounds
56   |
57note: the following trait bounds were not satisfied:
58      `CloneStruct: Default`
59      `Struct: Clone`
60      `Struct: Default`
61  --> $DIR/derive-trait-for-method-call.rs:20:9
62   |
63LL | impl<X: Clone + Default + , Y: Clone + Default> Foo<X, Y> {
64   |         ^^^^^   ^^^^^^^                ^^^^^^^  ---------
65   |         |       |                      |
66   |         |       |                      unsatisfied trait bound introduced here
67   |         |       unsatisfied trait bound introduced here
68   |         unsatisfied trait bound introduced here
69help: consider annotating `CloneStruct` with `#[derive(Default)]`
70   |
71LL + #[derive(Default)]
72LL | struct CloneStruct {
73   |
74help: consider annotating `Struct` with `#[derive(Clone, Default)]`
75   |
76LL + #[derive(Clone, Default)]
77LL | struct Struct {
78   |
79
80error[E0599]: the method `test` exists for struct `Foo<Vec<Enum>, Instant>`, but its trait bounds were not satisfied
81  --> $DIR/derive-trait-for-method-call.rs:40:15
82   |
83LL | struct Foo<X, Y> (X, Y);
84   | ---------------- method `test` not found for this struct
85...
86LL |     let y = x.test();
87   |               ^^^^ method cannot be called on `Foo<Vec<Enum>, Instant>` due to unsatisfied trait bounds
88  --> $SRC_DIR/std/src/time.rs:LL:COL
89   |
90   = note: doesn't satisfy `Instant: Default`
91  --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
92   |
93   = note: doesn't satisfy `Vec<Enum>: Clone`
94   |
95note: the following trait bounds were not satisfied:
96      `Instant: Default`
97      `Vec<Enum>: Clone`
98  --> $DIR/derive-trait-for-method-call.rs:20:9
99   |
100LL | impl<X: Clone + Default + , Y: Clone + Default> Foo<X, Y> {
101   |         ^^^^^                          ^^^^^^^  ---------
102   |         |                              |
103   |         |                              unsatisfied trait bound introduced here
104   |         unsatisfied trait bound introduced here
105
106error: aborting due to 3 previous errors
107
108For more information about this error, try `rustc --explain E0599`.