]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-41677.rs
Merge commit '2ca58e7dda4a9eb142599638c59dc04d15961175' into clippyup
[rust.git] / src / test / ui / issues / issue-41677.rs
1 // run-pass
2 // Regression test for #41677. The local variable was winding up with
3 // a type `Receiver<?T, H>` where `?T` was unconstrained, because we
4 // failed to enforce the WF obligations and `?T` is a bivariant type
5 // parameter position.
6
7 #![allow(unused_variables, dead_code)]
8
9 use std::marker::PhantomData;
10
11 trait Handle {
12     type Inner;
13 }
14
15 struct ResizingHandle<H>(PhantomData<H>);
16 impl<H> Handle for ResizingHandle<H> {
17     type Inner = H;
18 }
19
20 struct Receiver<T, H: Handle<Inner=T>>(PhantomData<H>);
21
22 fn channel<T>(size: usize) -> Receiver<T, ResizingHandle<T>> {
23     let rx = Receiver(PhantomData);
24     rx
25 }
26
27 fn main() {
28 }