An unsafe const fn being used to compute an array length or const generic is incorrectly described as being an "item". #133441
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Say something other than "items do not inherit unsafety from separate enclosing items"
Rationale and extra context
Given that unsafe blocks apply "through" closures, I find it a bit weird that it doesn't apply through array lengths or const generics. Maybe this is fine, but at the very least, the error message should not describe the problem as being about "items", since there aren't any relevant items in sight.
Other cases
Other similar cases with similar errors:
Rust Version
Reproducible on the playground with stable rust version 1.82.0, and nightly rust version `1.85.0-nightly (2024-11-22 a47555110cf09b3ed598)`
Anything else?
No response
The text was updated successfully, but these errors were encountered: