Replace retain with assertion.
This commit is contained in:
parent
c2d5dd2566
commit
13608715d8
1 changed files with 6 additions and 2 deletions
|
@ -174,8 +174,12 @@ fn shallow_lint_levels_on(tcx: TyCtxt<'_>, owner: hir::OwnerId) -> ShallowLintLe
|
|||
},
|
||||
}
|
||||
|
||||
let mut specs = levels.provider.specs;
|
||||
specs.specs.retain(|(_, v)| !v.is_empty());
|
||||
let specs = levels.provider.specs;
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
for (_, v) in specs.specs.iter() {
|
||||
debug_assert!(!v.is_empty());
|
||||
}
|
||||
|
||||
specs
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue