diff --git a/library/core/tests/num/mod.rs b/library/core/tests/num/mod.rs index 10b8d97544213..49580cdcc481a 100644 --- a/library/core/tests/num/mod.rs +++ b/library/core/tests/num/mod.rs @@ -124,15 +124,9 @@ fn test_int_from_str_overflow() { fn test_can_not_overflow() { fn can_overflow(radix: u32, input: &str) -> bool where - T: Default - + core::ops::Sub - + std::convert::From - + std::cmp::PartialOrd - + Copy, + T: std::convert::TryFrom, { - let one = true.into(); - let zero = ::default(); - !can_not_overflow::(radix, zero - one < zero, input.as_bytes()) + !can_not_overflow::(radix, T::try_from(-1_i8).is_ok(), input.as_bytes()) } // Positive tests: