Skip to content

Commit 26d93f3

Browse files
Add entry for const_if_match in unstable book
1 parent ccb6e98 commit 26d93f3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# `const_if_match`
2+
3+
The tracking issue for this feature is: [#49146]
4+
5+
[#49146]: https://github.com/rust-lang/rust/issues/49146
6+
7+
------------------------
8+
9+
Allows for the use of conditionals (`if` and `match`) in a const context.
10+
Const contexts include `static`, `static mut`, `const`, `const fn`, const
11+
generics, and array initializers. Enabling this feature flag will also make
12+
`&&` and `||` function normally in a const-context by removing the hack that
13+
replaces them with their non-short-circuiting equivalents, `&` and `|`, in a
14+
`const` or `static`.

0 commit comments

Comments
 (0)