Skip to content

Commit

Permalink
better def of is signed in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
gilescope committed Apr 11, 2022
1 parent 79e8653 commit 3ee7bb1
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions library/core/tests/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,9 @@ fn test_int_from_str_overflow() {
fn test_can_not_overflow() {
fn can_overflow<T>(radix: u32, input: &str) -> bool
where
T: Default
+ core::ops::Sub<Output = T>
+ std::convert::From<bool>
+ std::cmp::PartialOrd
+ Copy,
T: std::convert::TryFrom<i8>,
{
let one = true.into();
let zero = <T>::default();
!can_not_overflow::<T>(radix, zero - one < zero, input.as_bytes())
!can_not_overflow::<T>(radix, T::try_from(-1_i8).is_ok(), input.as_bytes())
}

// Positive tests:
Expand Down

0 comments on commit 3ee7bb1

Please sign in to comment.