You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code compiles, since the return type is inferred to be Option<()>:
fnmain(){Some(5).map(|_| ());}
However, this will not compile because rustc cannot infer a type:
fnmain(){Some(5).map(|_| fail!());}
If we used something like Void instead of !, the return type would obviously be Option<Void> here. However, since ! isn't allowed anywhere but a function signature this is a pain.