about summary refs log tree commit diff
path: root/tests/ui/drop/static-variable-with-drop-trait-9243.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/drop/static-variable-with-drop-trait-9243.rs')
-rw-r--r--tests/ui/drop/static-variable-with-drop-trait-9243.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/drop/static-variable-with-drop-trait-9243.rs b/tests/ui/drop/static-variable-with-drop-trait-9243.rs
new file mode 100644
index 00000000000..0ae32c983e9
--- /dev/null
+++ b/tests/ui/drop/static-variable-with-drop-trait-9243.rs
@@ -0,0 +1,17 @@
+// https://github.com/rust-lang/rust/issues/9243
+//@ build-pass
+#![allow(dead_code)]
+// Regression test for issue 9243
+#![allow(non_upper_case_globals)]
+
+pub struct Test {
+    mem: isize,
+}
+
+pub static g_test: Test = Test {mem: 0};
+
+impl Drop for Test {
+    fn drop(&mut self) {}
+}
+
+fn main() {}