]> git.lizzy.rs Git - rust.git/blob - tests/ui/compare-method/bad-self-type.stderr
Rollup merge of #107769 - compiler-errors:pointer-like, r=eholk
[rust.git] / tests / ui / compare-method / bad-self-type.stderr
1 error[E0053]: method `poll` has an incompatible type for trait
2   --> $DIR/bad-self-type.rs:10:13
3    |
4 LL |     fn poll(self, _: &mut Context<'_>) -> Poll<()> {
5    |             ^^^^
6    |             |
7    |             expected `Pin<&mut MyFuture>`, found `MyFuture`
8    |             help: change the self-receiver type to match the trait: `self: Pin<&mut MyFuture>`
9    |
10    = note: expected signature `fn(Pin<&mut MyFuture>, &mut Context<'_>) -> Poll<_>`
11               found signature `fn(MyFuture, &mut Context<'_>) -> Poll<_>`
12
13 error[E0053]: method `foo` has an incompatible type for trait
14   --> $DIR/bad-self-type.rs:22:18
15    |
16 LL |     fn foo(self: Box<Self>) {}
17    |            ------^^^^^^^^^
18    |            |     |
19    |            |     expected `MyFuture`, found `Box<MyFuture>`
20    |            help: change the self-receiver type to match the trait: `self`
21    |
22 note: type in trait
23   --> $DIR/bad-self-type.rs:17:12
24    |
25 LL |     fn foo(self);
26    |            ^^^^
27    = note: expected signature `fn(MyFuture)`
28               found signature `fn(Box<MyFuture>)`
29
30 error[E0053]: method `bar` has an incompatible type for trait
31   --> $DIR/bad-self-type.rs:24:18
32    |
33 LL |     fn bar(self) {}
34    |                  ^ expected `Option<()>`, found `()`
35    |
36 note: type in trait
37   --> $DIR/bad-self-type.rs:18:21
38    |
39 LL |     fn bar(self) -> Option<()>;
40    |                     ^^^^^^^^^^
41    = note: expected signature `fn(MyFuture) -> Option<()>`
42               found signature `fn(MyFuture)`
43 help: change the output type to match the trait
44    |
45 LL |     fn bar(self) -> Option<()> {}
46    |                  +++++++++++++
47
48 error: aborting due to 3 previous errors
49
50 For more information about this error, try `rustc --explain E0053`.