rust/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89118.rs

33 lines
619 B
Rust
Raw Normal View History

2021-10-02 21:08:11 -05:00
trait BufferMut {}
struct Ctx<D>(D);
trait BufferUdpStateContext<B> {}
impl<B: BufferMut, C> BufferUdpStateContext<B> for C {}
trait StackContext
where
Ctx<()>: for<'a> BufferUdpStateContext<&'a ()>,
{
type Dispatcher;
}
trait TimerContext {
type Handler;
}
impl<C> TimerContext for C
where
C: StackContext,
2021-10-02 22:24:45 -05:00
//~^ ERROR: is not satisfied [E0277]
2021-10-02 21:08:11 -05:00
{
type Handler = Ctx<C::Dispatcher>;
2021-10-02 22:24:45 -05:00
//~^ ERROR: is not satisfied [E0277]
2021-10-02 21:08:11 -05:00
}
struct EthernetWorker<C>(C)
where
Ctx<()>: for<'a> BufferUdpStateContext<&'a ()>;
impl<C> EthernetWorker<C> {}
2021-10-02 22:24:45 -05:00
//~^ ERROR: is not satisfied [E0277]
2021-10-02 21:08:11 -05:00
fn main() {}