That's sad, because I used to use unimplemented!() for all functions, which I don't care about in that moment, but is not possible, when I want to return an impl trait.
Is there a workaround? Is that something that could be done with a language change (RFC)?!
Doesn't surprise me. impl Trait still requires the compiler to know what the return type is, and unimplemented!() diverges. Just give the poor compiler a type.
! isn't a type. It's to types what NaN is to floats... kinda.
A function (or expression) can't evaluate to !, because ! means it doesn't evaluate to anything. But this function is defined to have a return type... so the compiler needs to give it one... and it's been told to infer it... but the body never returns, so... presumably it just gives up and assigns ().
The workaround for stable is use a if true else block. Just hope you can construct the type simply or it defeats the purpose (even more) of the unimplemented.
No, ! is a type. There're functions in std which returns !, including process::abort, which absolutely makes sense as it never returns. And also, <String as FromStr>::Error will become !, so "foo".parse::<String>() returns Result<String, !>.
No, it's not a type. That's what never_type will change; emphasis on future tense. Currently, it's a thing you can have instead of a return type on functions.