Skip to content

Commit

Permalink
librustc_typeck: remove loop that never actually loops
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Feb 27, 2020
1 parent a8437cf commit b6f0567
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/librustc_typeck/astconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2358,10 +2358,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
break;
}
}
for binding in segment.generic_args().bindings {

// Only emit the first error to avoid overloading the user with error messages.
if let [binding, ..] = segment.generic_args().bindings {
has_err = true;
Self::prohibit_assoc_ty_binding(self.tcx(), binding.span);
break;
}
}
has_err
Expand Down

0 comments on commit b6f0567

Please sign in to comment.