// Issue #14061: tests the interaction between generic implementation // parameter bounds and trait objects. use std::marker; struct S(marker::PhantomData); trait Gettable { fn get(&self) -> T { panic!() } } impl Gettable for S {} fn f(val: T) { let t: S = S(marker::PhantomData); let a = &t as &dyn Gettable; //~^ ERROR `T` cannot be sent between threads safely //~| ERROR : Copy` is not satisfied } fn g(val: T) { let t: S = S(marker::PhantomData); let a: &dyn Gettable = &t; //~^ ERROR `T` cannot be sent between threads safely //~| ERROR : Copy` is not satisfied } fn foo<'a>() { let t: S<&'a isize> = S(marker::PhantomData); let a = &t as &dyn Gettable<&'a isize>; } fn foo2<'a>() { let t: Box> = Box::new(S(marker::PhantomData)); let a = t as Box>; //~^ ERROR : Copy` is not satisfied } fn foo3<'a>() { struct Foo; // does not impl Copy let t: Box> = Box::new(S(marker::PhantomData)); let a: Box> = t; //~^ ERROR : Copy` is not satisfied } fn main() { }