diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2018-12-23 23:09:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-23 23:09:05 +0100 |
| commit | 5157c22eba67e0761e6068dac96368b394efcb0c (patch) | |
| tree | 2af192eb63c775da0972f305e9adee95f4865abb /src/test | |
| parent | 93af1e73696c82de22eb445423f10df35130dded (diff) | |
| parent | 405d8b0bb3d749e3baad25f68455873b66b219be (diff) | |
| download | rust-5157c22eba67e0761e6068dac96368b394efcb0c.tar.gz rust-5157c22eba67e0761e6068dac96368b394efcb0c.zip | |
Rollup merge of #56953 - oli-obk:dead_const, r=petrochenkov
Mark tuple structs as live if their constructors are used fixes https://github.com/rust-lang/rust/issues/56281
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/dead-code-tuple-struct-field.rs | 12 |
1 files changed, 12 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..496ce4fb378 --- /dev/null +++ b/src/test/ui/dead-code-tuple-struct-field.rs @@ -0,0 +1,12 @@ +// compile-pass + +#![deny(dead_code)] + +const LEN: usize = 4; + +#[derive(Debug)] +struct Wrapper([u8; LEN]); + +fn main() { + println!("{:?}", Wrapper([0, 1, 2, 3])); +} |
