mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 00:47:16 +00:00
Fix cargo dev update_lints
Now that lints can add @eval_always at the end of their definition, the lint declaration might not end right after the description. The `update_lints` command can skip everything that comes after that.
This commit is contained in:
parent
c64f1e3591
commit
b27570b19b
1 changed files with 13 additions and 7 deletions
|
@ -762,13 +762,19 @@ fn parse_contents(contents: &str, module: &str, lints: &mut Vec<Lint>) {
|
|||
Literal{..}(desc)
|
||||
);
|
||||
|
||||
if let Some(LintDeclSearchResult {
|
||||
if let Some(end) = iter.find_map(|t| {
|
||||
if let LintDeclSearchResult {
|
||||
token_kind: TokenKind::CloseBrace,
|
||||
range,
|
||||
..
|
||||
}) = iter.next()
|
||||
} = t
|
||||
{
|
||||
lints.push(Lint::new(name, group, desc, module, start..range.end));
|
||||
Some(range.end)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}) {
|
||||
lints.push(Lint::new(name, group, desc, module, start..end));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue