1
Fork 0

Do not fetch HIR node when iterating to find lint.

This commit is contained in:
Camille GILLOT 2022-09-15 18:39:53 +02:00
parent 2cb9a65684
commit c9c6c507b7
2 changed files with 13 additions and 9 deletions

View file

@ -126,7 +126,7 @@ impl ShallowLintLevelMap {
return (Some(level), src);
}
for (parent, _) in tcx.hir().parent_iter(start) {
for parent in tcx.hir().parent_id_iter(start) {
let specs = tcx.shallow_lint_levels_on(parent);
if let Some(&(level, src)) = specs.specs.get(&id) {
return (Some(level), src);