summaryrefslogtreecommitdiffstats
path: root/tests/ui/coherence/illegal-copy-bad-projection.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/coherence/illegal-copy-bad-projection.rs')
-rw-r--r--tests/ui/coherence/illegal-copy-bad-projection.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/coherence/illegal-copy-bad-projection.rs b/tests/ui/coherence/illegal-copy-bad-projection.rs
new file mode 100644
index 000000000..797443a0a
--- /dev/null
+++ b/tests/ui/coherence/illegal-copy-bad-projection.rs
@@ -0,0 +1,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() {}