Skip to content

Commit

Permalink
Int constants must be valtrees in pattern lowering
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Mar 27, 2024
1 parent d03df0a commit bd6a96f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions compiler/rustc_middle/src/thir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)), _)),
Expand Down

0 comments on commit bd6a96f

Please sign in to comment.