I have read several answers on SO already, and gathered these use-cases:
- When a function
panic!s - When a function has an infinite loop in it
But it is still unclear to me why we need to define the function like this:
fn func() -> ! {
panic!("Error!");
}
if it will work the same way as this (without the exclamation sign):
fn func() {
panic!("Error!");
}
and at the same time, why do we need to use ! in functions with infinite loops? It look like this signature doesn't bring any real usage information.