1
Fork 0

check-cfg: only print the list of expected names once

This commit is contained in:
Urgau 2023-10-12 17:01:55 +02:00
parent dcfc484b09
commit 001a65c4b0
3 changed files with 6 additions and 25 deletions

View file

@ -758,7 +758,11 @@ pub trait LintContext: Sized {
possibilities.sort();
let possibilities = possibilities.join("`, `");
db.help(format!("expected names are: `{possibilities}`"));
// The list of expected names can be long (even by default) and
// so the diagnostic produced can take a lot of space. To avoid
// cloging the user output we only want to print that diagnostic
// once.
db.help_once(format!("expected names are: `{possibilities}`"));
}
},
BuiltinLintDiagnostics::UnexpectedCfgValue((name, name_span), value) => {