diff options
| author | Daiki Ihara <sasurau4@gmail.com> | 2020-12-10 01:03:44 +0900 |
|---|---|---|
| committer | Daiki Ihara <sasurau4@gmail.com> | 2020-12-10 22:29:43 +0900 |
| commit | caab16fa20c582f1c7e39f835286482eaa51710a (patch) | |
| tree | 3cbb3725bebe571c43226b13621d8ed57bd2dd51 /src/doc | |
| parent | 5019791e2d4ac67b4c5c56853600a02f4b84e515 (diff) | |
Update const-fn doc in unstable-book
Update src/doc/unstable-book/src/language-features/const-fn.md Co-authored-by: Ivan Tham <pickfire@riseup.net>
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/unstable-book/src/language-features/const-fn.md | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/doc/unstable-book/src/language-features/const-fn.md b/src/doc/unstable-book/src/language-features/const-fn.md index 50dbbaf5674..bcf7f78b8fe 100644 --- a/src/doc/unstable-book/src/language-features/const-fn.md +++ b/src/doc/unstable-book/src/language-features/const-fn.md @@ -6,24 +6,5 @@ The tracking issue for this feature is: [#57563] ------------------------ -The `const_fn` feature allows marking free functions and inherent methods as -`const`, enabling them to be called in constants contexts, with constant -arguments. - -## Examples - -```rust -#![feature(const_fn)] - -const fn double(x: i32) -> i32 { - x * 2 -} - -const FIVE: i32 = 5; -const TEN: i32 = double(FIVE); - -fn main() { - assert_eq!(5, FIVE); - assert_eq!(10, TEN); -} -``` +The `const_fn` feature enables additional functionality not stabilized in the +[minimal subset of `const_fn`](https://github.com/rust-lang/rust/issues/53555) |
