rust/tests/ui/coherence/illegal-copy-bad-projection.rs

17 lines
274 B
Rust

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() {}