-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 #322
Comments
Can we revisit this discussion now that the 1.0 launch craze has passed? |
This seems like it's covered by the const fn work? |
@sfackler Yeah, but |
Moreover the functions mentioned in #253 ( |
I was quite surprised that the following code does not compile: const CONDITION: bool = true;
const RESULT: u8 = if CONDITION { 1 } else { 0 };
I thought so too, but this doesn't compile: #![feature(const_fn)]
pub struct BitField (u8, u8);
impl BitField
{
const fn get_ms_bit_index(&self) -> u8 {
if self.0 > self.1 { self.0 } else { self.1 }
}
} |
Its in progress work. See the “postponed” label on the right hand side. |
@JinShil
|
The lack of |
If we allow |
Both if and match sound reasonable to me. |
Does anyone know what the status of conditionals within |
Found this RFC after creating rust-lang/rust#42906 . What can I do to help? What's the next step? |
MIRI is merged into rustc and is will be used for all const evaluation soon (rust-lang/rust#46882), and |
Deprecation of copy and Copyable
#46882 doesn't seem to have added support for
|
@jyn514 It's being worked on but slowly; see rust-lang/rust#49146 and more generally rust-lang/rust#57563 for all things |
See #253 for a limited form of CTFE. We can use this issue to track a more complete form too.
The text was updated successfully, but these errors were encountered: