2023-06-12 16:56:54 -05:00
|
|
|
#![feature(never_type)]
|
|
|
|
|
|
|
|
#[allow(nonstandard_style)]
|
|
|
|
pub struct never;
|
|
|
|
|
2024-06-03 02:35:56 -05:00
|
|
|
pub fn loops() -> ! {
|
|
|
|
loop {}
|
|
|
|
}
|
|
|
|
pub fn returns() -> never {
|
|
|
|
never
|
|
|
|
}
|
2023-06-12 16:56:54 -05:00
|
|
|
|
2024-06-03 02:35:56 -05:00
|
|
|
pub fn impossible(x: !) {
|
|
|
|
match x {}
|
|
|
|
}
|
|
|
|
pub fn uninteresting(x: never) {
|
|
|
|
match x {
|
|
|
|
never => {}
|
|
|
|
}
|
|
|
|
}
|
2023-06-12 16:56:54 -05:00
|
|
|
|
2024-06-03 02:35:56 -05:00
|
|
|
pub fn box_impossible(x: Box<!>) {
|
|
|
|
match *x {}
|
|
|
|
}
|
|
|
|
pub fn box_uninteresting(x: Box<never>) {
|
|
|
|
match *x {
|
|
|
|
never => {}
|
|
|
|
}
|
|
|
|
}
|