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)
|
Literal{..}(desc)
|
||||||
);
|
);
|
||||||
|
|
||||||
if let Some(LintDeclSearchResult {
|
if let Some(end) = iter.find_map(|t| {
|
||||||
token_kind: TokenKind::CloseBrace,
|
if let LintDeclSearchResult {
|
||||||
range,
|
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 New Issue
Block a user