summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-25901.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/issues/issue-25901.rs')
-rw-r--r--src/test/ui/issues/issue-25901.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-25901.rs b/src/test/ui/issues/issue-25901.rs
new file mode 100644
index 000000000..ba12e1ad0
--- /dev/null
+++ b/src/test/ui/issues/issue-25901.rs
@@ -0,0 +1,14 @@
+struct A;
+struct B;
+
+static S: &'static B = &A;
+//~^ ERROR cannot perform deref coercion on `A` in statics
+
+use std::ops::Deref;
+
+impl Deref for A {
+ type Target = B;
+ fn deref(&self)->&B { static B_: B = B; &B_ }
+}
+
+fn main(){}