const_fn feature allows marking free functions and inherent methods as
const , enabling them to be called in constants contexts, with constant arguments.
What is real need to explicitly and verbousely mark this functions with 'const' keyword?
Is there drawbacks if Rust mark all functions called in constant context as 'const fn' automatically and internally.
const declaration on a function is a promise made by the implementor that they won’t change the function in a non-
const-compatible way. This is a common theme in Rust’s design: To reduce breakage as code evolves, you’re only allowed to rely on features that have been intentionally declared by the author.
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.