Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/test-utils/src/minicore.rs')
| -rw-r--r-- | crates/test-utils/src/minicore.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/test-utils/src/minicore.rs b/crates/test-utils/src/minicore.rs index c5ebc0d248..0588b1c77d 100644 --- a/crates/test-utils/src/minicore.rs +++ b/crates/test-utils/src/minicore.rs @@ -2353,6 +2353,18 @@ pub mod pat { } } + impl const RangePattern for i32 { + const MIN: i32 = 0x80_00_00_00; + const MAX: i32 = 0x7F_FF_FF_FF; + fn sub_one(self) -> Self { + if self == Self::MIN { + panic!("exclusive range end at minimum value of type") + } else { + self - 1 + } + } + } + // region:coerce_unsized impl<T: crate::marker::PointeeSized, U: crate::marker::PointeeSized> crate::ops::CoerceUnsized<pattern_type!(*const U is !null)> for pattern_type!(*const T is !null) |