summaryrefslogtreecommitdiffstats
path: root/tests/ui/type-alias-impl-trait/auxiliary/collect_hidden_types.rs
blob: 75d20a6fef9fe4a9aebe801674e3591dfe982bf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#![feature(type_alias_impl_trait)]

// edition:2018

use std::future::Future;

pub trait Service<Request> {
    type Future: Future<Output = ()>;
    fn call(&mut self, req: Request) -> Self::Future;
}

// NOTE: the pub(crate) here is critical
pub(crate) fn new() -> () {}

pub struct A;
impl Service<()> for A {
    type Future = impl Future<Output = ()>;
    fn call(&mut self, _: ()) -> Self::Future {
        async { new() }
    }
}