]> git.lizzy.rs Git - rust.git/blob - tests/ui/compare-method/bad-self-type.rs
Rollup merge of #107769 - compiler-errors:pointer-like, r=eholk
[rust.git] / tests / ui / compare-method / bad-self-type.rs
1 use std::future::Future;
2 use std::task::{Context, Poll};
3
4 fn main() {}
5
6 struct MyFuture {}
7
8 impl Future for MyFuture {
9     type Output = ();
10     fn poll(self, _: &mut Context<'_>) -> Poll<()> {
11     //~^ ERROR method `poll` has an incompatible type for trait
12         todo!()
13     }
14 }
15
16 trait T {
17     fn foo(self);
18     fn bar(self) -> Option<()>;
19 }
20
21 impl T for MyFuture {
22     fn foo(self: Box<Self>) {}
23     //~^ ERROR method `foo` has an incompatible type for trait
24     fn bar(self) {}
25     //~^ ERROR method `bar` has an incompatible type for trait
26 }