Wrong error message (E401) when storing the result of a generic const fn inside a const member of a generic function #68373
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code, assuming the result of
size_of::<T>()
would be considered a constant value since it would be known at function monomorphization:This resulted in the following compilation error:
As it turns out, the error message here is incorrect, and the issue can be solved by using
let
instead, something the error message was rather unhelpful with.PLAYGROUND LINK
Meta
The text was updated successfully, but these errors were encountered: