]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/in-trait/signature-mismatch.rs
Rollup merge of #102961 - reitermarkus:const-cstr-from-ptr, r=oli-obk
[rust.git] / src / test / 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() {}