1
Fork 0

Get rid of mir::Const::from_ty_const

This commit is contained in:
Michael Goulet 2025-01-20 03:29:04 +00:00
parent 9a1d156f38
commit e9a566002d
10 changed files with 21 additions and 98 deletions

View file

@ -794,9 +794,7 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> {
// fictitious values after `{u,i}size::MAX` (see [`IntRange::split`] for why we do
// this). We show this to the user as `usize::MAX..` which is slightly incorrect but
// probably clear enough.
let c = ty.numeric_max_val(cx.tcx).unwrap();
let value = mir::Const::from_ty_const(c, ty.0, cx.tcx);
lo = PatRangeBoundary::Finite(value);
lo = PatRangeBoundary::Finite(ty.numeric_max_val(cx.tcx).unwrap());
}
let hi = if let Some(hi) = range.hi.minus_one() {
hi