1 // Issue #14061: tests the interaction between generic implementation
2 // parameter bounds and trait objects.
8 struct S<T>(marker::PhantomData<T>);
11 fn get(&self) -> T { panic!() }
14 impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
17 let t: S<T> = S(marker::PhantomData);
18 let a = &t as &dyn Gettable<T>;
19 //~^ ERROR `T` cannot be sent between threads safely
20 //~| ERROR : Copy` is not satisfied
24 let t: S<T> = S(marker::PhantomData);
25 let a: &dyn Gettable<T> = &t;
26 //~^ ERROR `T` cannot be sent between threads safely
27 //~| ERROR : Copy` is not satisfied
31 let t: S<&'a isize> = S(marker::PhantomData);
32 let a = &t as &dyn Gettable<&'a isize>;
33 //~^ ERROR does not fulfill
37 let t: Box<S<String>> = Box::new(S(marker::PhantomData));
38 let a = t as Box<dyn Gettable<String>>;
39 //~^ ERROR : Copy` is not satisfied
43 struct Foo; // does not impl Copy
45 let t: Box<S<Foo>> = Box::new(S(marker::PhantomData));
46 let a: Box<dyn Gettable<Foo>> = t;
47 //~^ ERROR : Copy` is not satisfied