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

Add limited CTFE #253

Closed
wants to merge 2 commits into from
Closed

Add limited CTFE #253

wants to merge 2 commits into from

Conversation

mahkoh
Copy link
Contributor

@mahkoh mahkoh commented Sep 20, 2014

Implement compile time evaluation of a limited set of compiler-internal functions:

  • size_of
  • min_align_of
  • pref_align_of

Rendered

Old rendered link (not working)

EDIT: Fixed rendered link / Centril

@SiegeLord
Copy link

I've always thought that it'd be easiest to make all of these be associated statics of the Sized kind.

the detailed description above resolves to `core::mem::size_of` because some
programs might wish to avoid even `libcore`.

Thus, this feature should live behind a feature gate.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All new features are going to end up landing behind a feature gate at first, so this part isn't really relevant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant that this should be behind a feature gate until real CTFE has been implemented (if ever). Real CTFE would immediately replace this, but because this is not 100% compatible you would have to continue to maintain this if it's not marked unstable in some way.

@Ericson2314
Copy link
Contributor

I've always thought that it'd be easiest to make all of these be associated statics of the Sized kind.

+1. This seems like an excellent workaround until we get "real CTFE".

@nrc
Copy link
Member

nrc commented Sep 25, 2014

We discussed this in the triage meeting today, and while CTFE of some kind is something we are interested in, it is backwards compatible and not high enough priority to block 1.0. Therefore we are postponing discussion on this until post-1.0. Thanks for the RFC!

@nrc nrc closed this Sep 25, 2014
@nrc nrc added the postponed RFCs that have been postponed and may be revisited at a later time. label Sep 25, 2014
@nrc nrc mentioned this pull request Sep 25, 2014
withoutboats pushed a commit to withoutboats/rfcs that referenced this pull request Jan 15, 2017
@fschutt
Copy link

fschutt commented Dec 13, 2017

The "rendered" link in the first comment is broken. Just wanted to report that.

@Centril
Copy link
Contributor

Centril commented Dec 14, 2017

@fschutt Thanks; Fixed =)

@petrochenkov petrochenkov removed the postponed RFCs that have been postponed and may be revisited at a later time. label Feb 24, 2018
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.

8 participants