// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // run-pass // Regression test for #41677. The local variable was winding up with // a type `Receiver` where `?T` was unconstrained, because we // failed to enforce the WF obligations and `?T` is a bivariant type // parameter position. #![allow(unused_variables, dead_code)] use std::marker::PhantomData; trait Handle { type Inner; } struct ResizingHandle(PhantomData); impl Handle for ResizingHandle { type Inner = H; } struct Receiver>(PhantomData); fn channel(size: usize) -> Receiver> { let rx = Receiver(PhantomData); rx } fn main() { }