]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir_build/src/build/matches/simplify.rs
do use ty::Const in patterns and abstract consts
[rust.git] / compiler / rustc_mir_build / src / build / matches / simplify.rs
index 895df5808dbe16c6eb0cbb2abbeecab6d35c9598..7f53d9dd70502ad10b0f567efdd81d9e77a9f3fa 100644 (file)
@@ -228,7 +228,9 @@ fn simplify_match_pair<'pat>(
                     _ => (None, 0),
                 };
                 if let Some((min, max, sz)) = range {
-                    if let (Some(lo), Some(hi)) = (lo.try_to_bits(sz), hi.try_to_bits(sz)) {
+                    if let (Some(lo), Some(hi)) =
+                        (lo.val().try_to_bits(sz), hi.val().try_to_bits(sz))
+                    {
                         // We want to compare ranges numerically, but the order of the bitwise
                         // representation of signed integers does not match their numeric order.
                         // Thus, to correct the ordering, we need to shift the range of signed