]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-trait/in-trait/signature-mismatch.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / impl-trait / in-trait / signature-mismatch.rs
1 // edition:2021
2
3 #![feature(return_position_impl_trait_in_trait)]
4 #![allow(incomplete_features)]
5
6 use std::future::Future;
7
8 pub trait AsyncTrait {
9     fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>;
10 }
11
12 pub struct Struct;
13
14 impl AsyncTrait for Struct {
15     fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
16         //~^ ERROR `impl` item signature doesn't match `trait` item signature
17         async move { buff.to_vec() }
18     }
19 }
20
21 fn main() {}