Skip to content
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

Remove the global variables that store the discriminant IDs per variant #1488

Closed
kevina opened this issue Jan 10, 2012 · 2 comments
Closed
Labels
A-codegen Area: Code generation C-cleanup Category: PRs that clean code up or issues documenting cleanup.

Comments

@kevina
Copy link
Contributor

kevina commented Jan 10, 2012

Consider removing global variables that store the discriminant IDs per variant as they are likely not really needed.

See pull request #1397.

@kevina
Copy link
Contributor Author

kevina commented Jan 11, 2012

One of the reasons I am hesitant about doing this is that it may be useful to have a an actual variable if it is necessary to take a reference of the tag literal. Without out a global variable to refer to a temporary will need to be allocated on the stack.

Then again, I could be wrong, I am basing my knowledge with how C++ would work, Rust could be different.

@graydon
Copy link
Contributor

graydon commented Feb 15, 2012

No, I think you're right. Closing this as I think reference-to-constant-enum is something that could sometimes happen.

@graydon graydon closed this as completed Feb 15, 2012
bjorn3 pushed a commit to bjorn3/rust that referenced this issue May 13, 2024
* add the `llvm.x86.sse42.crc32.32.32` intrinsic
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
…e types (rust-lang#1488)

* feat: add bool test

* feat: add nonzerou8 test

* feat: add array test

* feat: add result test

* feat: add option test

* feat: add custom test

* refactor: rename non_zero_u8 to non_zero

* chore: add newlines to all test files

* docs: make test case notes docstrings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Projects
None yet
Development

No branches or pull requests

2 participants