diff --git a/src/librustc_mir/build/matches/util.rs b/src/librustc_mir/build/matches/util.rs index cfd9100fc6a..25c42950dcb 100644 --- a/src/librustc_mir/build/matches/util.rs +++ b/src/librustc_mir/build/matches/util.rs @@ -35,8 +35,7 @@ pub fn prefix_slice_suffix<'pat>(&mut self, opt_slice: Option<&'pat Pattern<'tcx>>, suffix: &'pat [Pattern<'tcx>]) { let min_length = prefix.len() + suffix.len(); - assert!(min_length < u32::MAX as usize); - let min_length = min_length as u32; + let min_length = min_length.try_into().unwrap(); match_pairs.extend( prefix.iter()