]> git.lizzy.rs Git - rust.git/blob - src/test/ui/structs-enums/tag-align-shape.rs
Rollup merge of #105955 - Nilstrieb:no-trivial-opt-wrappers-we-have-field-accesses...
[rust.git] / src / test / ui / structs-enums / tag-align-shape.rs
1 // run-pass
2 #![allow(non_camel_case_types)]
3 #![allow(dead_code)]
4
5 #[derive(Debug)]
6 enum a_tag {
7     a_tag_var(u64)
8 }
9
10 #[derive(Debug)]
11 struct t_rec {
12     c8: u8,
13     t: a_tag
14 }
15
16 pub fn main() {
17     let x = t_rec {c8: 22, t: a_tag::a_tag_var(44)};
18     let y = format!("{:?}", x);
19     println!("y = {:?}", y);
20     assert_eq!(y, "t_rec { c8: 22, t: a_tag_var(44) }".to_string());
21 }