We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 79e8653 commit 3ee7bb1Copy full SHA for 3ee7bb1
library/core/tests/num/mod.rs
@@ -124,15 +124,9 @@ fn test_int_from_str_overflow() {
124
fn test_can_not_overflow() {
125
fn can_overflow<T>(radix: u32, input: &str) -> bool
126
where
127
- T: Default
128
- + core::ops::Sub<Output = T>
129
- + std::convert::From<bool>
130
- + std::cmp::PartialOrd
131
- + Copy,
+ T: std::convert::TryFrom<i8>,
132
{
133
- let one = true.into();
134
- let zero = <T>::default();
135
- !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())
136
}
137
138
// Positive tests:
0 commit comments