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