Confusing error when comparing references to primitives in a const context #90870
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.
Given the following code: (playground)
The current output is:
Ideally the output should look like:
I've encountered this "in the wild" while trying to implement
const
version ofstr::strip_prefix
: (playground). Another, a bit simpler example (const fn
&[u8]
eq): (playground). In both cases references were created implicitly by matching on a slice.The text was updated successfully, but these errors were encountered: