about summary refs log tree commit diff
path: root/src/test/ui/dead-code-tuple-struct-field.rs
diff options
context:
space:
mode:
authorOliver Scherer <github35764891676564198441@oli-obk.de>2018-12-18 15:52:32 +0100
committerOliver Scherer <github35764891676564198441@oli-obk.de>2018-12-18 15:54:06 +0100
commitf7314456d03d2bfed188baf3a988c77b40864dc8 (patch)
tree139790089c657b0748b0f50c698e1d3e91e249ae /src/test/ui/dead-code-tuple-struct-field.rs
parent041254b81495a5aa67af839e00b890e78ed0cbeb (diff)
downloadrust-f7314456d03d2bfed188baf3a988c77b40864dc8.tar.gz
rust-f7314456d03d2bfed188baf3a988c77b40864dc8.zip
Mark tuple structs as live if their constructors are used
Diffstat (limited to 'src/test/ui/dead-code-tuple-struct-field.rs')
-rw-r--r--src/test/ui/dead-code-tuple-struct-field.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/ui/dead-code-tuple-struct-field.rs b/src/test/ui/dead-code-tuple-struct-field.rs
new file mode 100644
index 00000000000..f4989fa1037
--- /dev/null
+++ b/src/test/ui/dead-code-tuple-struct-field.rs
@@ -0,0 +1,22 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-pass
+
+#![deny(dead_code)]
+
+const LEN: usize = 4;
+
+#[derive(Debug)]
+struct Wrapper([u8; LEN]);
+
+fn main() {
+    println!("{:?}", Wrapper([0, 1, 2, 3]));
+}