Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit d35be6c

Browse files
committed
Do not assert in try_to_int.
1 parent f222a2d commit d35be6c

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_middle/src/mir

1 file changed

+1
-1
lines changed

compiler/rustc_middle/src/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2317,7 +2317,7 @@ impl<'tcx> ConstantKind<'tcx> {
23172317

23182318
#[inline]
23192319
pub fn try_to_scalar_int(self) -> Option<ScalarInt> {
2320-
Some(self.try_to_scalar()?.assert_int())
2320+
self.try_to_scalar()?.try_to_int().ok()
23212321
}
23222322

23232323
#[inline]

0 commit comments

Comments
 (0)