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