]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/matches/single_match.rs
Merge remote-tracking branch 'upstream/master' into rustup
[rust.git] / clippy_lints / src / matches / single_match.rs
index 6314959f818eae141d99010cda787011e8fc0325..d496107ffd6b85a76a903cf912663ca1fd62369b 100644 (file)
@@ -198,6 +198,8 @@ fn form_exhaustive_matches<'a>(cx: &LateContext<'a>, ty: Ty<'a>, left: &Pat<'_>,
             // We don't actually know the position and the presence of the `..` (dotdot) operator
             // in the arms, so we need to evaluate the correct offsets here in order to iterate in
             // both arms at the same time.
+            let left_pos = left_pos.as_opt_usize();
+            let right_pos = right_pos.as_opt_usize();
             let len = max(
                 left_in.len() + usize::from(left_pos.is_some()),
                 right_in.len() + usize::from(right_pos.is_some()),