summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/in-trait/unconstrained-impl-region.rs
blob: c06f9f005f19ec661b30465065d6e4ea2629d018 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// edition: 2021

pub(crate) trait Inbox<M> {
    async fn next(self) -> M;
}

pub(crate) trait Actor: Sized {
    type Message;

    async fn on_mount(self, _: impl Inbox<Self::Message>);
}

impl<'a> Actor for () {
//~^ ERROR the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
    type Message = &'a ();
    async fn on_mount(self, _: impl Inbox<&'a ()>) {}
}

fn main() {}