]> git.proxmox.com Git - rustc.git/blob - tests/ui/implied-bounds/impl-implied-bounds-compatibility.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / 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() {}