3 #![allow(unused_imports)]
4 // Corrected regression test for #20831. The original did not compile.
5 // When fixed, it revealed another problem concerning projections that
6 // appear in associated type bindings in object types, which were not
7 // being properly flagged.
9 // pretty-expanded FIXME #23616
11 use std::ops::{Shl, Shr};
12 use std::cell::RefCell;
14 pub trait Subscriber {
20 pub trait Publisher<'a> {
22 fn subscribe(&mut self, _: Box<dyn Subscriber<Input=Self::Output> + 'a>);
25 pub trait Processor<'a> : Subscriber + Publisher<'a> { }
27 impl<'a, P> Processor<'a> for P where P : Subscriber + Publisher<'a> { }
30 sub: Box<dyn Subscriber<Input=u64> + 'a>
33 impl<'a> Publisher<'a> for MyStruct<'a> {
35 fn subscribe(&mut self, t : Box<dyn Subscriber<Input=u64> + 'a>) {