1
Fork 0

Make sure refinement still works

This commit is contained in:
Michael Goulet 2024-01-18 17:28:37 +00:00
parent e65abc0ea5
commit 1a3214b774
4 changed files with 53 additions and 3 deletions

View file

@ -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
}
}