]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/derive-trait-for-method-call.stderr
Rollup merge of #90420 - GuillaumeGomez:rustdoc-internals-feature, r=camelid
[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 note: the following trait must be implemented
24   --> $SRC_DIR/core/src/default.rs:LL:COL
25    |
26 LL | / pub trait Default: Sized {
27 LL | |     /// Returns the "default value" for a type.
28 LL | |     ///
29 LL | |     /// Default values are often some kind of initial value, identity value, or anything else that
30 ...  |
31 LL | |     fn default() -> Self;
32 LL | | }
33    | |_^
34 help: consider annotating `Enum` with `#[derive(Clone)]`
35    |
36 LL | #[derive(Clone)]
37    |
38
39 error[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    |
42 LL | struct Struct {
43    | -------------
44    | |
45    | doesn't satisfy `Struct: Clone`
46    | doesn't satisfy `Struct: Default`
47 ...
48 LL | struct CloneStruct {
49    | ------------------ doesn't satisfy `CloneStruct: Default`
50 ...
51 LL | struct Foo<X, Y> (X, Y);
52    | ------------------------ method `test` not found for this
53 ...
54 LL |     let y = x.test();
55    |               ^^^^ method cannot be called on `Foo<Struct, CloneStruct>` due to unsatisfied trait bounds
56    |
57    = note: the following trait bounds were not satisfied:
58            `Struct: Clone`
59            `Struct: Default`
60            `CloneStruct: Default`
61 help: consider annotating `CloneStruct` with `#[derive(Default)]`
62    |
63 LL | #[derive(Default)]
64    |
65 help: consider annotating `Struct` with `#[derive(Clone, Default)]`
66    |
67 LL | #[derive(Clone, Default)]
68    |
69
70 error[E0599]: the method `test` exists for struct `Foo<Vec<Enum>, Instant>`, but its trait bounds were not satisfied
71   --> $DIR/derive-trait-for-method-call.rs:40:15
72    |
73 LL | struct Foo<X, Y> (X, Y);
74    | ------------------------ method `test` not found for this
75 ...
76 LL |     let y = x.test();
77    |               ^^^^ method cannot be called on `Foo<Vec<Enum>, Instant>` due to unsatisfied trait bounds
78    |
79   ::: $SRC_DIR/std/src/time.rs:LL:COL
80    |
81 LL | pub struct Instant(time::Instant);
82    | ---------------------------------- doesn't satisfy `Instant: Default`
83    |
84   ::: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
85    |
86 LL | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
87    | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec<Enum>: Clone`
88    |
89    = note: the following trait bounds were not satisfied:
90            `Vec<Enum>: Clone`
91            `Instant: Default`
92
93 error: aborting due to 3 previous errors
94
95 For more information about this error, try `rustc --explain E0599`.