Skip to content

Commit 1360871

Browse files
committed
Replace retain with assertion.
1 parent c2d5dd2 commit 1360871

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compiler/rustc_lint/src/levels.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,12 @@ fn shallow_lint_levels_on(tcx: TyCtxt<'_>, owner: hir::OwnerId) -> ShallowLintLe
174174
},
175175
}
176176

177-
let mut specs = levels.provider.specs;
178-
specs.specs.retain(|(_, v)| !v.is_empty());
177+
let specs = levels.provider.specs;
178+
179+
#[cfg(debug_assertions)]
180+
for (_, v) in specs.specs.iter() {
181+
debug_assert!(!v.is_empty());
182+
}
179183

180184
specs
181185
}

0 commit comments

Comments
 (0)