]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/derive-trait-for-method-call.stderr
97fc1134a94774bc4376b52323fbd8624d4fb7c4
[rust.git] / src / test / 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
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            `Enum: Clone`
21            `Enum: Default`
22            `CloneEnum: Default`
23 help: consider annotating `Enum` with `#[derive(Clone)]`
24    |
25 LL | #[derive(Clone)]
26    |
27
28 error[E0599]: the method `test` exists for struct `Foo<Struct, CloneStruct>`, but its trait bounds were not satisfied
29   --> $DIR/derive-trait-for-method-call.rs:34:15
30    |
31 LL | struct Struct {
32    | -------------
33    | |
34    | doesn't satisfy `Struct: Clone`
35    | doesn't satisfy `Struct: Default`
36 ...
37 LL | struct CloneStruct {
38    | ------------------ doesn't satisfy `CloneStruct: Default`
39 ...
40 LL | struct Foo<X, Y> (X, Y);
41    | ------------------------ method `test` not found for this
42 ...
43 LL |     let y = x.test();
44    |               ^^^^ method cannot be called on `Foo<Struct, CloneStruct>` due to unsatisfied trait bounds
45    |
46    = note: the following trait bounds were not satisfied:
47            `Struct: Clone`
48            `Struct: Default`
49            `CloneStruct: Default`
50 help: consider annotating `CloneStruct` with `#[derive(Default)]`
51    |
52 LL | #[derive(Default)]
53    |
54 help: consider annotating `Struct` with `#[derive(Clone, Default)]`
55    |
56 LL | #[derive(Clone, Default)]
57    |
58
59 error[E0599]: the method `test` exists for struct `Foo<Vec<Enum>, Instant>`, but its trait bounds were not satisfied
60   --> $DIR/derive-trait-for-method-call.rs:40:15
61    |
62 LL | struct Foo<X, Y> (X, Y);
63    | ------------------------ method `test` not found for this
64 ...
65 LL |     let y = x.test();
66    |               ^^^^ method cannot be called on `Foo<Vec<Enum>, Instant>` due to unsatisfied trait bounds
67    |
68   ::: $SRC_DIR/std/src/time.rs:LL:COL
69    |
70 LL | pub struct Instant(time::Instant);
71    | ---------------------------------- doesn't satisfy `Instant: Default`
72    |
73   ::: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
74    |
75 LL | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
76    | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec<Enum>: Clone`
77    |
78    = note: the following trait bounds were not satisfied:
79            `Vec<Enum>: Clone`
80            `Instant: Default`
81
82 error: aborting due to 3 previous errors
83
84 For more information about this error, try `rustc --explain E0599`.