mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-03 10:33:34 +00:00
Int constants must be valtrees in pattern lowering
This commit is contained in:
parent
d03df0a6b3
commit
bd6a96f04e
@ -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…
Reference in New Issue
Block a user