Skip to content

Commit

Permalink
Address nit
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Aug 12, 2022
1 parent 237cbe9 commit c608918
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1890,14 +1890,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
.flat_map(|id| self.tcx.hir().body(id).params)
.skip(if is_method { 1 } else { 0 });

for (idx, param) in params.into_iter().enumerate() {
if let Some(expected_idx) = expected_idx {
if idx == expected_idx {
spans.push_span_label(param.span, "");
}
} else {
spans.push_span_label(param.span, "");
}
for (_, param) in params
.into_iter()
.enumerate()
.filter(|(idx, _)| expected_idx.map_or(true, |expected_idx| expected_idx == *idx))
{
spans.push_span_label(param.span, "");
}

let def_kind = self.tcx.def_kind(def_id);
Expand Down

0 comments on commit c608918

Please sign in to comment.