]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | // run-pass |
abe05a73 XL |
2 | // compile-flags:--test -O |
3 | ||
e74abb32 XL |
4 | // ignore-wasm32-bare compiled with panic=abort by default |
5 | ||
abe05a73 XL |
6 | #[test] |
7 | #[should_panic(expected = "creating inhabited type")] | |
8 | fn test() { | |
9 | FontLanguageOverride::system_font(SystemFont::new()); | |
10 | } | |
11 | ||
12 | pub enum FontLanguageOverride { | |
13 | Normal, | |
14 | Override(&'static str), | |
15 | System(SystemFont) | |
16 | } | |
17 | ||
18 | pub enum SystemFont {} | |
19 | ||
20 | impl FontLanguageOverride { | |
21 | fn system_font(f: SystemFont) -> Self { | |
22 | FontLanguageOverride::System(f) | |
23 | } | |
24 | } | |
25 | ||
26 | impl SystemFont { | |
27 | fn new() -> Self { | |
28 | panic!("creating inhabited type") | |
29 | } | |
30 | } |