2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2017-12-05 21:37:51 +00:00
|
|
|
// compile-flags:--test -O
|
|
|
|
|
2021-12-03 15:32:51 +00:00
|
|
|
// needs-unwind
|
2019-08-17 05:08:01 +00:00
|
|
|
|
2017-12-05 21:37:51 +00:00
|
|
|
#[test]
|
|
|
|
#[should_panic(expected = "creating inhabited type")]
|
|
|
|
fn test() {
|
|
|
|
FontLanguageOverride::system_font(SystemFont::new());
|
|
|
|
}
|
|
|
|
|
|
|
|
pub enum FontLanguageOverride {
|
|
|
|
Normal,
|
|
|
|
Override(&'static str),
|
|
|
|
System(SystemFont)
|
|
|
|
}
|
|
|
|
|
|
|
|
pub enum SystemFont {}
|
|
|
|
|
|
|
|
impl FontLanguageOverride {
|
|
|
|
fn system_font(f: SystemFont) -> Self {
|
|
|
|
FontLanguageOverride::System(f)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SystemFont {
|
|
|
|
fn new() -> Self {
|
|
|
|
panic!("creating inhabited type")
|
|
|
|
}
|
|
|
|
}
|