2 Suggests the use of `const` in functions and methods where possible.
5 Not having the function const prevents callers of the function from being const as well.
8 Const functions are currently still being worked on, with some features only being available
9 on nightly. This lint does not consider all edge cases currently and the suggestions may be
10 incorrect if you are using this lint on stable.
12 Also, the lint only runs one pass over the code. Consider these two non-const functions:
23 When running Clippy, the lint will only suggest to make `a` const, because `b` at this time
24 can't be const as it calls a non-const function. Making `a` const and running Clippy again,
25 will suggest to make `b` const, too.
30 Self { random_number: 42 }
37 const fn new() -> Self {
38 Self { random_number: 42 }