Int constants must be valtrees in pattern lowering
This commit is contained in:
parent
d03df0a6b3
commit
bd6a96f04e
1 changed files with 1 additions and 5 deletions
|
|
@ -1018,11 +1018,7 @@ impl<'tcx> PatRangeBoundary<'tcx> {
|
|||
(Finite(mir::Const::Ty(a)), Finite(mir::Const::Ty(b)))
|
||||
if matches!(ty.kind(), ty::Uint(_) | ty::Char) =>
|
||||
{
|
||||
if let Some(a) = a.try_to_valtree() {
|
||||
if let Some(b) = b.try_to_valtree() {
|
||||
return Some(a.cmp(&b));
|
||||
}
|
||||
}
|
||||
return Some(a.to_valtree().cmp(&b.to_valtree()));
|
||||
}
|
||||
(
|
||||
Finite(mir::Const::Val(mir::ConstValue::Scalar(Scalar::Int(a)), _)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue