Closed
Description
Right now the following program will error on the line commented point B, but once #7083 is implemented it will no longer be an error. The program should instead error on line A, or else you could coerce arbitrary types.
trait Send2 : Send { }
struct X<T>(T);
impl <T> Send for X<T> { } // point A
impl <T> Send2 for X<T> { }
fn foo<T: Send2>(x: T) {
let (p,c) = std::comm::oneshot();
c.send(x); // point B
}
fn main() {
let mut a = 0;
foo(X(&mut a));
}