Don't sort span_suggestions, leave that to caller

This commit is contained in:
Esteban Küber 2023-11-08 18:24:49 +00:00
parent 42aa1273b0
commit f1ae02f4bd
10 changed files with 31 additions and 29 deletions

View file

@ -424,8 +424,9 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
improvements.push(suggestion);
}
}
let nonminimal_bool_lint = |suggestions: Vec<_>| {
let nonminimal_bool_lint = |mut suggestions: Vec<_>| {
if self.cx.tcx.lint_level_at_node(NONMINIMAL_BOOL, e.hir_id).0 != Level::Allow {
suggestions.sort();
span_lint_hir_and_then(
self.cx,
NONMINIMAL_BOOL,