]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-46519.rs
New upstream version 1.49.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-46519.rs
CommitLineData
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")]
8fn test() {
9 FontLanguageOverride::system_font(SystemFont::new());
10}
11
12pub enum FontLanguageOverride {
13 Normal,
14 Override(&'static str),
15 System(SystemFont)
16}
17
18pub enum SystemFont {}
19
20impl FontLanguageOverride {
21 fn system_font(f: SystemFont) -> Self {
22 FontLanguageOverride::System(f)
23 }
24}
25
26impl SystemFont {
27 fn new() -> Self {
28 panic!("creating inhabited type")
29 }
30}