about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorOliver Scherer <github35764891676564198441@oli-obk.de>2018-10-31 11:06:38 +0100
committerOliver Scherer <github35764891676564198441@oli-obk.de>2018-11-12 12:33:16 +0100
commit6fc8779b1e040a29ad5088bdc72058765678869b (patch)
tree3b9cae848ea3fa71d3dffde2c71285591042ade1 /src
parent0195812aeafeecaa8760a4ddceae187472db8fe6 (diff)
downloadrust-6fc8779b1e040a29ad5088bdc72058765678869b.tar.gz
rust-6fc8779b1e040a29ad5088bdc72058765678869b.zip
Merge an assert + cast into a `try_into` call
Diffstat (limited to 'src')
-rw-r--r--src/librustc_mir/build/matches/util.rs3
1 files changed, 1 insertions, 2 deletions
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 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
                                      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()