From 3ee7bb19c62761f5387c463a804d970c1ea3db72 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Mon, 11 Apr 2022 07:37:53 +0100 Subject: [PATCH] better def of is signed in tests. --- library/core/tests/num/mod.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/library/core/tests/num/mod.rs b/library/core/tests/num/mod.rs index 10b8d975442..49580cdcc48 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: