about summary refs log tree commit diff
path: root/tests/ui/static/static-struct-with-option-8578.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/static/static-struct-with-option-8578.rs')
-rw-r--r--tests/ui/static/static-struct-with-option-8578.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/static/static-struct-with-option-8578.rs b/tests/ui/static/static-struct-with-option-8578.rs
new file mode 100644
index 00000000000..d490a3f50b4
--- /dev/null
+++ b/tests/ui/static/static-struct-with-option-8578.rs
@@ -0,0 +1,20 @@
+// https://github.com/rust-lang/rust/issues/8578
+//@ check-pass
+#![allow(dead_code)]
+#![allow(non_camel_case_types)]
+#![allow(non_upper_case_globals)]
+
+pub struct UninterpretedOption_NamePart {
+    name_part: Option<String>,
+}
+
+impl<'a> UninterpretedOption_NamePart {
+    pub fn default_instance() -> &'static UninterpretedOption_NamePart {
+        static instance: UninterpretedOption_NamePart = UninterpretedOption_NamePart {
+            name_part: None,
+        };
+        &instance
+    }
+}
+
+pub fn main() {}