Skip to content

Commit bd6a96f

Browse files
committed
Int constants must be valtrees in pattern lowering
1 parent d03df0a commit bd6a96f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

compiler/rustc_middle/src/thir.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1018,11 +1018,7 @@ impl<'tcx> PatRangeBoundary<'tcx> {
10181018
(Finite(mir::Const::Ty(a)), Finite(mir::Const::Ty(b)))
10191019
if matches!(ty.kind(), ty::Uint(_) | ty::Char) =>
10201020
{
1021-
if let Some(a) = a.try_to_valtree() {
1022-
if let Some(b) = b.try_to_valtree() {
1023-
return Some(a.cmp(&b));
1024-
}
1025-
}
1021+
return Some(a.to_valtree().cmp(&b.to_valtree()));
10261022
}
10271023
(
10281024
Finite(mir::Const::Val(mir::ConstValue::Scalar(Scalar::Int(a)), _)),

0 commit comments

Comments
 (0)