Closed
Description
Location
https://doc.rust-lang.org/nightly/error_codes/E0158.html
Summary
The introduction says that this error is about using an associated const
in a pattern, and a user encountered it in that context. However, every paragraph after the erroneous code example talks about why you can't match a static
, not why you can't match an associated const
.
This seems like it might have been accidentally copied without edits from some other error, but there is no other copy of that text. (Was E0158 repurposed, perhaps?)
Proposed improvement
- E0158 should explain why associated consts may not be matched, and
- The text discussing
static
should be moved to E0530, which is the code actually produced by trying to use astatic
in a pattern, and which currently has only erroneous code samples and not an explanation of why.