Files
rust/tests/ui/async-await/in-trait/unconstrained-impl-region.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
500 B
Rust
Raw Normal View History

//@ 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 ()>) {}
2024-03-19 20:58:37 +00:00
//~^ ERROR the trait bound `impl Inbox<&'a ()>: Inbox<&'a ()>` is not satisfied
}
fn main() {}