-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Tracking issue for const fn
integration with pattern matching
#57240
Comments
rust-lang/rfcs#2920 by @ecstatic-morse suggests an alternative way of dealing with |
rust-lang/rfcs#2920 would allow you to write the example in the OP with a few extra tokens. fn main() {
let f = Foo { f: 0, g: 1 };
match f {
const { ZERO(22) } => println!("hi"), // <-
_ => println!("1"),
}
} |
The explicit requirement of a
|
Another use case, which doesn't compile(error E0532) as of 1.47.0:
Although, if |
Closed in favor of RFC 2920 and |
Sub-tracking issue for rust-lang/rfcs#911.
This issue tracks integration of
const fn
with pattern matching... For example:This is currently not implemented:
The text was updated successfully, but these errors were encountered: