]>
git.proxmox.com Git - rustc.git/blob - src/test/run-pass/issues/issue-41677.rs
1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
12 // Regression test for #41677. The local variable was winding up with
13 // a type `Receiver<?T, H>` where `?T` was unconstrained, because we
14 // failed to enforce the WF obligations and `?T` is a bivariant type
15 // parameter position.
17 #![allow(unused_variables, dead_code)]
19 use std
::marker
::PhantomData
;
25 struct ResizingHandle
<H
>(PhantomData
<H
>);
26 impl<H
> Handle
for ResizingHandle
<H
> {
30 struct Receiver
<T
, H
: Handle
<Inner
=T
>>(PhantomData
<H
>);
32 fn channel
<T
>(size
: usize) -> Receiver
<T
, ResizingHandle
<T
>> {
33 let rx
= Receiver(PhantomData
);