Make sure refinement still works
This commit is contained in:
parent
e65abc0ea5
commit
1a3214b774
4 changed files with 53 additions and 3 deletions
|
@ -4,11 +4,12 @@
|
|||
use std::future::Future;
|
||||
use std::task::Poll;
|
||||
|
||||
trait MyTrait {
|
||||
#[allow(async_fn_in_trait)]
|
||||
pub trait MyTrait {
|
||||
async fn foo(&self) -> i32;
|
||||
}
|
||||
|
||||
struct MyFuture;
|
||||
pub struct MyFuture;
|
||||
impl Future for MyFuture {
|
||||
type Output = i32;
|
||||
fn poll(self: std::pin::Pin<&mut Self>, _: &mut std::task::Context<'_>) -> Poll<Self::Output> {
|
||||
|
@ -17,7 +18,9 @@ impl Future for MyFuture {
|
|||
}
|
||||
|
||||
impl MyTrait for u32 {
|
||||
#[warn(refining_impl_trait)]
|
||||
fn foo(&self) -> MyFuture {
|
||||
//~^ WARN impl trait in impl method signature does not match trait method signature
|
||||
MyFuture
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue