rust/tests/ui/implied-bounds/impl-implied-bounds-compatibility.rs

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

19 lines
505 B
Rust
Raw Normal View History

2022-12-11 21:16:43 +00:00
use std::cell::RefCell;
pub struct MessageListeners<'a> {
listeners: RefCell<Vec<Box<dyn FnMut(()) + 'a>>>,
}
pub trait MessageListenersInterface {
fn listeners<'c>(&'c self) -> &'c MessageListeners<'c>;
}
impl<'a> MessageListenersInterface for MessageListeners<'a> {
fn listeners<'b>(&'b self) -> &'a MessageListeners<'b> {
//~^ ERROR cannot infer an appropriate lifetime for lifetime parameter 'b in generic type due to conflicting requirements
2022-12-11 21:16:43 +00:00
self
}
}
fn main() {}