Do not assert in try_to_int.

This commit is contained in:
Camille GILLOT 2023-01-18 20:29:02 +00:00
parent f222a2dd8f
commit d35be6c097

View File

@ -2317,7 +2317,7 @@ impl<'tcx> ConstantKind<'tcx> {
#[inline]
pub fn try_to_scalar_int(self) -> Option<ScalarInt> {
Some(self.try_to_scalar()?.assert_int())
self.try_to_scalar()?.try_to_int().ok()
}
#[inline]