]> git.lizzy.rs Git - rust.git/blob - src/test/ui/implied-bounds/impl-implied-bounds-compatibility.rs
Auto merge of #106025 - matthiaskrgr:rollup-vz5rqah, r=matthiaskrgr
[rust.git] / src / test / ui / implied-bounds / impl-implied-bounds-compatibility.rs
1 #![deny(implied_bounds_entailment)]
2
3 use std::cell::RefCell;
4
5 pub struct MessageListeners<'a> {
6     listeners: RefCell<Vec<Box<dyn FnMut(()) + 'a>>>,
7 }
8
9 pub trait MessageListenersInterface {
10     fn listeners<'c>(&'c self) -> &'c MessageListeners<'c>;
11 }
12
13 impl<'a> MessageListenersInterface for MessageListeners<'a> {
14     fn listeners<'b>(&'b self) -> &'a MessageListeners<'b> {
15         //~^ ERROR impl method assumes more implied bounds than the corresponding trait method
16         //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
17         self
18     }
19 }
20
21 fn main() {}