1A non-`const` function was called in a `const` context.23Erroneous code example:45```compile_fail,E00156fn create_some() -> Option<u8> {7 Some(1)8}910// error: cannot call non-const function `create_some` in constants11const FOO: Option<u8> = create_some();12```1314All functions used in a `const` context (constant or static expression) must15be marked `const`.1617To fix this error, you can declare `create_some` as a constant function:1819```20// declared as a `const` function:21const fn create_some() -> Option<u8> {22 Some(1)23}2425const FOO: Option<u8> = create_some(); // no error!26```
Findings
✓ No findings reported for this file.