1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
trait AsPtr { type Ptr; } impl AsPtr for () { type Ptr = *const void; //~^ ERROR cannot find type `void` in this scope } #[derive(Copy, Clone)] struct Foo { p: <() as AsPtr>::Ptr, // Do not report a "`Copy` cannot be implemented" here. } fn main() {}