Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions src/doc/unstable-book/src/language-features/const-fn.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)