Unreachable call of non-const fn from const fn is not a compilation error #110831
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code (playground):
I expected to see this happen: a compilation error. Calling a non-const function (even though it's unreachable) should produce a compilation error, just like it would with a
i64
value instead oftodo!()
.The compilation error with a value instead of
todo!()
:Instead, this happened: the code compiles (with a warning
unreachable call
).Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: