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

Implement constant folding in the frontend #685

Closed
steveklabnik opened this issue Jan 21, 2015 · 3 comments
Closed

Implement constant folding in the frontend #685

steveklabnik opened this issue Jan 21, 2015 · 3 comments
Labels
T-compiler Relevant to the compiler team, which will review and decide on the RFC.

Comments

@steveklabnik
Copy link
Member

Issue by pcwalton
Tuesday Jul 16, 2013 at 22:22 GMT

For earlier discussion, see rust-lang/rust#7834

This issue was labelled with: A-codegen, B-RFC, I-compiletime in the Rust repository


We should be able to do constant folding in the frontend to eliminate "if" conditions that are never executed. It would also be nice to be able to call size_of at compile time in constants. (This latter part is an RFC.)

@reem
Copy link

reem commented Jan 21, 2015

@steveklabnik this really seems like it should belong in the rust repo, since this is basically just a codegen enhancement/bug.

@steveklabnik
Copy link
Member Author

I read this as more than that, given the second part of the message here. calling size_of at compile time is certainly an RFC-worthy topic.

@petrochenkov petrochenkov added the T-compiler Relevant to the compiler team, which will review and decide on the RFC. label Jan 28, 2018
@Centril
Copy link
Contributor

Centril commented Oct 7, 2018

https://doc.rust-lang.org/nightly/std/mem/fn.size_of.html is today a const fn, so this is done. Closing therefore.

@Centril Centril closed this as completed Oct 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-compiler Relevant to the compiler team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests

4 participants