Improve unexpected_cfgs lint when their is no value expected
This commit is contained in:
parent
86067bb461
commit
92544f43b0
7 changed files with 52 additions and 29 deletions
|
@ -476,7 +476,7 @@ pub fn cfg_matches(
|
|||
cfg.span,
|
||||
lint_node_id,
|
||||
"unexpected `cfg` condition name",
|
||||
BuiltinLintDiagnostics::UnexpectedCfg(ident.span, name, None),
|
||||
BuiltinLintDiagnostics::UnexpectedCfg((name, ident.span), None),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -489,9 +489,8 @@ pub fn cfg_matches(
|
|||
lint_node_id,
|
||||
"unexpected `cfg` condition value",
|
||||
BuiltinLintDiagnostics::UnexpectedCfg(
|
||||
cfg.name_value_literal_span().unwrap(),
|
||||
name,
|
||||
Some(value),
|
||||
(name, ident.span),
|
||||
Some((value, cfg.name_value_literal_span().unwrap())),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue