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
#![feature(never_type)]structA{n:usize}fna() -> Result<A, !>{Ok(A{n:5})}fnmain(){letOk(A{ n }) = a();}
I expected the code to compile, because Err is obviously an irrefutable pattern here.
I'm not even sure this is a bug (maybe rust's typesystem cannot understand that n inconstructible pattern on a n + 1 variants enum make the last pattern irrefutable ?)
The text was updated successfully, but these errors were encountered:
I tried this code:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=165744f32b174e1068e0813fe906735f
I expected the code to compile, because Err is obviously an irrefutable pattern here.
I'm not even sure this is a bug (maybe rust's typesystem cannot understand that n inconstructible pattern on a n + 1 variants enum make the last pattern irrefutable ?)
The text was updated successfully, but these errors were encountered: