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:
commit
5157c22eba
3 changed files with 51 additions and 43 deletions
12
src/test/ui/dead-code-tuple-struct-field.rs
Normal file
12
src/test/ui/dead-code-tuple-struct-field.rs
Normal 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]));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue