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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
274 B
Rust
Raw Normal View History

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