about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorOliver Scherer <github35764891676564198441@oli-obk.de>2019-07-25 19:29:48 +0200
committerOliver Scherer <github35764891676564198441@oli-obk.de>2019-07-25 19:29:48 +0200
commitb75dfa8a2bac745d7d09212e3e28cb4f0bc28fdf (patch)
tree23b4a57b801ebd793ef3eb09c191833eedbe0905 /src/test
parenteedf6ce4ef54bb03818ab21d714f1b9f13a6b31c (diff)
downloadrust-b75dfa8a2bac745d7d09212e3e28cb4f0bc28fdf.tar.gz
rust-b75dfa8a2bac745d7d09212e3e28cb4f0bc28fdf.zip
Don't access a static just for its size and alignment
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/consts/static-cycle-error.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/consts/static-cycle-error.rs b/src/test/ui/consts/static-cycle-error.rs
new file mode 100644
index 00000000000..9ce050aae21
--- /dev/null
+++ b/src/test/ui/consts/static-cycle-error.rs
@@ -0,0 +1,11 @@
+// check-pass
+
+struct Foo {
+    foo: Option<&'static Foo>
+}
+
+static FOO: Foo = Foo {
+    foo: Some(&FOO),
+};
+
+fn main() {}