Detect invalid cfg expressions, such as the cfg(feature_s_ = ...)
typo
#10224
Labels
A-lint
Area: New lints
cfg(feature_s_ = ...)
typo
#10224
What it does
It's generally easy to mistakenly use
features = "x"
instead offeature = "x"
incfg
s.To my knowledge,
features = "x"
doesn't currently have meaning, so it's likely to be the result of a mistake, and not intentional.The main thing to look out for when looking for this pattern is to ensure that we're within a
cfg
context.This can be generalized to ensuring that
cfg
conditions are always looking at "variables" that actually exist, such astarget_family
,target_os
, etc...Lint Name
invalid-cfg-condition
Category
correctness, suspicious
Advantage
Drawbacks
Example
Is highly likely to be an attempt at writing:
The text was updated successfully, but these errors were encountered: