Skip to content

Allow uint discriminants. Fixes #7994. #8000

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

Merged
merged 3 commits into from
Jul 25, 2013
Merged

Conversation

kemurphy
Copy link
Contributor

No description provided.

@alexcrichton
Copy link
Member

Out of curiosity, does this disallow literals like -1 for discriminants?

@kemurphy
Copy link
Contributor Author

It shouldn't.... I should probably have tested that actually. It shouldn't disallow anything that was allowed before; I just changed mk_int() to mk_int_var(...) where it decided to care about the type, so as long as the discriminant parses into something that looks like a signed or unsigned integer, it should be fine.

@alexcrichton
Copy link
Member

Could you add a test (even to the same test file) exercising this functionality?

kemurphy added 3 commits July 24, 2013 23:54
Infers type of constants used as discriminants and ensures they are
integral, instead of forcing them to be a signed integer.

Also, stores discriminant values as uint instead of int interally and
deals with related fallout.

Fixes issue rust-lang#7994
@bors bors closed this Jul 25, 2013
@bors bors merged commit 6f25341 into rust-lang:master Jul 25, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 23, 2021
Don't check for a nightly toolchain in fmt test

changelog: None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants