fn ex_falso<T>(x: !) -> T {
panic!("You proved falsehood exists, the universe will now deconstruct. I hope you’re happy")
}
fn testi_mc_testface() {
let always_ok: Result<(), !> = Ok(());
match always_ok {
Ok(_) => println!("ok"),
Err(e) => ex_falso(e), // Commenting this out yields a inexhaustive match
}
}
Some active reading, some opinions. This is more of a basis for discussion rather than a please-merge-as-is.
Notes:
Vec
is the type constructor, notVec<>
. Reason: You would sayf: bool -> bool
, notf(): bool -> bool
.fn f(x: !) {}
is called not very useful, that’s not true!