rust/tests/rustdoc-js/never-search.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
406 B
Rust
Raw Normal View History

#![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
}
2024-06-03 02:35:56 -05:00
pub fn impossible(x: !) {
match x {}
}
pub fn uninteresting(x: never) {
match x {
never => {}
}
}
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 => {}
}
}