Unexpected cfg condition name diagnostic is sometimes confusing #141440
Labels
A-cfg
Area: `cfg` conditional compilation
A-diagnostics
Area: Messages for errors, warnings, and lints
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Originally posted by @jieyouxu in #141413 (comment)
If a cfg by the name-with-parenthesized-value form exists (e.g.
cfg(version(..))
) and the user writes the meta literal(?) form e.g.cfg(version = "..")
, we currently produce a diagnostic that saysThis is technically true, because we don't expect the
version = ".."
form, we expect theversion(..)
form.I wonder if we could clarify the diagnostic here if the
version(..)
form is a thing but not theversion = ".."
form.(Picked
version
as an example, this is generally applicable.)The text was updated successfully, but these errors were encountered: