-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Unexpected cfg condition name diagnostic is sometimes confusing #141440
Copy link
Copy link
Closed
Labels
A-cfgArea: `cfg` conditional compilationArea: `cfg` conditional compilationA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-cfgArea: `cfg` conditional compilationArea: `cfg` conditional compilationA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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
versionas an example, this is generally applicable.)