]> git.lizzy.rs Git - rust.git/blob - src/test/ui/structs-enums/tag-disr-val-shape.rs
Rollup merge of #93112 - pietroalbini:pa-cve-2022-21658-nightly, r=pietroalbini
[rust.git] / src / test / ui / structs-enums / tag-disr-val-shape.rs
1 // run-pass
2 #![allow(dead_code)]
3 #![allow(non_camel_case_types)]
4
5 #[derive(Debug)]
6 enum color {
7     red = 0xff0000,
8     green = 0x00ff00,
9     blue = 0x0000ff,
10     black = 0x000000,
11     white = 0xFFFFFF,
12 }
13
14 pub fn main() {
15     let act = format!("{:?}", color::red);
16     println!("{}", act);
17     assert_eq!("red".to_string(), act);
18     assert_eq!("green".to_string(), format!("{:?}", color::green));
19     assert_eq!("white".to_string(), format!("{:?}", color::white));
20 }