26ede3115f
Fix out of bounds access by checking length equality BEFORE accessing by index. Fixes #5780 changelog: fix out of bounds access in unnested_or_patterns lint. Edit: I did not bother reducing a testcase from `librustc_typeck` crate but I can confirm that with the change the crash no longer occurs.