get rid of visit_constant in thir visitor
This commit is contained in:
parent
14e3d038c0
commit
c3491378e3
5 changed files with 27 additions and 24 deletions
|
@ -183,12 +183,10 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
|
|||
Some((*lo, *hi))
|
||||
}
|
||||
(Some(PatKind::Constant { value: lo }), None) => {
|
||||
let hi = ty.numeric_max_val(self.tcx)?;
|
||||
Some((*lo, ty::Const::from_bits(self.tcx, hi, ty::ParamEnv::empty().and(ty))))
|
||||
Some((*lo, ty.numeric_max_val(self.tcx)?))
|
||||
}
|
||||
(None, Some(PatKind::Constant { value: hi })) => {
|
||||
let lo = ty.numeric_min_val(self.tcx)?;
|
||||
Some((ty::Const::from_bits(self.tcx, lo, ty::ParamEnv::empty().and(ty)), *hi))
|
||||
Some((ty.numeric_min_val(self.tcx)?, *hi))
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue