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
This commit is contained in:
Mazdak Farrokhzad 2018-12-23 23:09:05 +01:00 committed by GitHub
commit 5157c22eba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 51 additions and 43 deletions

View file

@ -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]));
}