-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
non-exhaustive match for masked integer #30578
Comments
Exhaustiveness analysis cares only about types. The type of your masked integer is still |
Yes, but |
No and there is no plan for making Rust's analyses to be based on runtime properties other than types. |
Of course, if we ever implement dependent types or something, we would integrate it with the exhaustiveness checker, but until then, we won't be working in this direction. |
I have the following program which fails to compile:
with the following error:
It would be really nice if the compiler could recognize that
foo & 0x01
can only result in0x00
or0x01
, making the match exhaustive.This looks related to #12483.
The text was updated successfully, but these errors were encountered: