Improve check-cfg diagnostics (part 2)
This commit is contained in:
parent
a5f8dba4cd
commit
53647845b9
12 changed files with 192 additions and 47 deletions
|
@ -589,7 +589,7 @@ pub fn cfg_matches(
|
|||
cfg.span,
|
||||
lint_node_id,
|
||||
"unexpected `cfg` condition value",
|
||||
BuiltinLintDiagnostics::UnexpectedCfg(
|
||||
BuiltinLintDiagnostics::UnexpectedCfgValue(
|
||||
(cfg.name, cfg.name_span),
|
||||
cfg.value.map(|v| (v, cfg.value_span.unwrap())),
|
||||
),
|
||||
|
@ -601,7 +601,10 @@ pub fn cfg_matches(
|
|||
cfg.span,
|
||||
lint_node_id,
|
||||
"unexpected `cfg` condition name",
|
||||
BuiltinLintDiagnostics::UnexpectedCfg((cfg.name, cfg.name_span), None),
|
||||
BuiltinLintDiagnostics::UnexpectedCfgName(
|
||||
(cfg.name, cfg.name_span),
|
||||
cfg.value.map(|v| (v, cfg.value_span.unwrap())),
|
||||
),
|
||||
);
|
||||
}
|
||||
_ => { /* not unexpected */ }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue