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
@ -762,13 +762,19 @@ fn parse_contents(contents: &str, module: &str, lints: &mut Vec<Lint>) {
|
||||
Literal{..}(desc)
|
||||
);
|
||||
|
||||
if let Some(LintDeclSearchResult {
|
||||
token_kind: TokenKind::CloseBrace,
|
||||
range,
|
||||
..
|
||||
}) = iter.next()
|
||||
{
|
||||
lints.push(Lint::new(name, group, desc, module, start..range.end));
|
||||
if let Some(end) = iter.find_map(|t| {
|
||||
if let LintDeclSearchResult {
|
||||
token_kind: TokenKind::CloseBrace,
|
||||
range,
|
||||
..
|
||||
} = t
|
||||
{
|
||||
Some(range.end)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}) {
|
||||
lints.push(Lint::new(name, group, desc, module, start..end));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user