Do not expose fallible to_int
operation on Scalar
.
Any use of it has been shown to be a bug in the past.
This commit is contained in:
parent
0dd5a1b622
commit
9f407ae5ee
3 changed files with 17 additions and 19 deletions
|
@ -2473,7 +2473,7 @@ impl ConstantKind<'tcx> {
|
|||
|
||||
#[inline]
|
||||
pub fn try_to_scalar_int(self) -> Option<ScalarInt> {
|
||||
self.try_to_value()?.try_to_scalar()?.to_int().ok()
|
||||
Some(self.try_to_value()?.try_to_scalar()?.assert_int())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue