rust const fn what does it exactly mean

Viewed 1795

Rust const fn

In the following article I saw the following:

A const fn allows you to execute code in a "const context." For example:

const fn five() -> i32 {
    5
}

const FIVE: i32 = five();

What does const fn exactly do in rust? Does it just say that the function can be completely be calculated at compile time (my guess based on reading the article)

0 Answers
Related