-
Notifications
You must be signed in to change notification settings - Fork 14k
Description
Discussion (not in scope for this PR): Maybe this diagnostic is a bit misleading?
versionis a condition name, but just that the parenthesized name-value form (forgot what that form is called technically) is what's considered valid cfg, and not theversion = ".."name-with-literal-value form.
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 says
warning: unexpected `cfg` condition name: `version`This is technically true, because we don't expect the version = ".." form, we expect the version(..) form.
I wonder if we could clarify the diagnostic here if the version(..) form is a thing but not the version = ".." form.
(Picked version as an example, this is generally applicable.)