summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/in-trait/signature-mismatch.rs
blob: 90682631aa0323050c60f96843c1f9adaee0c480 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// edition:2021

#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]

use std::future::Future;

pub trait AsyncTrait {
    fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>;
}

pub struct Struct;

impl AsyncTrait for Struct {
    fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
        //~^ ERROR `impl` item signature doesn't match `trait` item signature
        async move { buff.to_vec() }
    }
}

fn main() {}