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

error[E0599]: the method `test` exists for struct `Foo<Struct, CloneStruct>`, but its trait bounds were not satisfied
  --> $DIR/derive-trait-for-method-call.rs:34:15
   |
LL | struct Struct {
   | -------------
   | |
   | doesn't satisfy `Struct: Clone`
   | doesn't satisfy `Struct: Default`
...
LL | struct CloneStruct {
   | ------------------ doesn't satisfy `CloneStruct: Default`
...
LL | struct Foo<X, Y> (X, Y);
   | ---------------- method `test` not found for this struct
...
LL |     let y = x.test();
   |               ^^^^ method cannot be called on `Foo<Struct, CloneStruct>` due to unsatisfied trait bounds
   |
note: the following trait bounds were not satisfied:
      `CloneStruct: Default`
      `Struct: Clone`
      `Struct: Default`
  --> $DIR/derive-trait-for-method-call.rs:20:9
   |
LL | impl<X: Clone + Default + , Y: Clone + Default> Foo<X, Y> {
   |         ^^^^^   ^^^^^^^                ^^^^^^^  ---------
   |         |       |                      |
   |         |       |                      unsatisfied trait bound introduced here
   |         |       unsatisfied trait bound introduced here
   |         unsatisfied trait bound introduced here
help: consider annotating `CloneStruct` with `#[derive(Default)]`
   |
LL + #[derive(Default)]
LL | struct CloneStruct {
   |
help: consider annotating `Struct` with `#[derive(Clone, Default)]`
   |
LL + #[derive(Clone, Default)]
LL | struct Struct {
   |

error[E0599]: the method `test` exists for struct `Foo<Vec<Enum>, Instant>`, but its trait bounds were not satisfied
  --> $DIR/derive-trait-for-method-call.rs:40:15
   |
LL | struct Foo<X, Y> (X, Y);
   | ---------------- method `test` not found for this struct
...
LL |     let y = x.test();
   |               ^^^^ method cannot be called on `Foo<Vec<Enum>, Instant>` due to unsatisfied trait bounds
  --> $SRC_DIR/std/src/time.rs:LL:COL
   |
   = note: doesn't satisfy `Instant: Default`
  --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
   |
   = note: doesn't satisfy `Vec<Enum>: Clone`
   |
note: the following trait bounds were not satisfied:
      `Instant: Default`
      `Vec<Enum>: Clone`
  --> $DIR/derive-trait-for-method-call.rs:20:9
   |
LL | impl<X: Clone + Default + , Y: Clone + Default> Foo<X, Y> {
   |         ^^^^^                          ^^^^^^^  ---------
   |         |                              |
   |         |                              unsatisfied trait bound introduced here
   |         unsatisfied trait bound introduced here

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0599`.