]> git.lizzy.rs Git - rust.git/commitdiff
Add entry for `const_if_match` in unstable book
authorDylan MacKenzie <ecstaticmorse@gmail.com>
Sat, 16 Nov 2019 06:55:45 +0000 (22:55 -0800)
committerDylan MacKenzie <ecstaticmorse@gmail.com>
Thu, 21 Nov 2019 23:23:51 +0000 (15:23 -0800)
src/doc/unstable-book/src/language-features/const-if-match.md [new file with mode: 0644]

diff --git a/src/doc/unstable-book/src/language-features/const-if-match.md b/src/doc/unstable-book/src/language-features/const-if-match.md
new file mode 100644 (file)
index 0000000..ee9cfcb
--- /dev/null
@@ -0,0 +1,14 @@
+# `const_if_match`
+
+The tracking issue for this feature is: [#49146]
+
+[#49146]: https://github.com/rust-lang/rust/issues/49146
+
+------------------------
+
+Allows for the use of conditionals (`if` and `match`) in a const context.
+Const contexts include `static`, `static mut`, `const`, `const fn`, const
+generics, and array initializers. Enabling this feature flag will also make
+`&&` and `||` function normally in a const-context by removing the hack that
+replaces them with their non-short-circuiting equivalents, `&` and `|`, in a
+`const` or `static`.