about summary refs log tree commit diff
path: root/src/test/ui/consts
diff options
context:
space:
mode:
authorOliver Scherer <github35764891676564198441@oli-obk.de>2019-01-18 13:31:05 +0100
committerOliver Scherer <github35764891676564198441@oli-obk.de>2019-01-18 13:31:05 +0100
commitefda6816bd29beea2702c7c3f76a252a405e60ae (patch)
treec00141747fd2000905b27e2aa2da3793232e6152 /src/test/ui/consts
parent1dc4e417fa2a73d5ffa24428df6b7d4dbbf41f4a (diff)
downloadrust-efda6816bd29beea2702c7c3f76a252a405e60ae.tar.gz
rust-efda6816bd29beea2702c7c3f76a252a405e60ae.zip
Allow evaluating trivial drop glue in constants
Diffstat (limited to 'src/test/ui/consts')
-rw-r--r--src/test/ui/consts/drop_none.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/consts/drop_none.rs b/src/test/ui/consts/drop_none.rs
new file mode 100644
index 00000000000..86a197ffb99
--- /dev/null
+++ b/src/test/ui/consts/drop_none.rs
@@ -0,0 +1,13 @@
+// compile-pass
+#![allow(dead_code)]
+struct A;
+impl Drop for A {
+    fn drop(&mut self) {}
+}
+
+const FOO: Option<A> = None;
+
+const BAR: () = (FOO, ()).1;
+
+
+fn main() {}