message: Remove implementation of Isqrt for signed ints
diff: @@ -7,14 +7,15 @@ pub trait Isqrt {
  fn isqrt(self) -> Self;
  }
  -impl<
  - I: ops::Add<I, Output = I>
  +impl<I> Isqrt for I
  +where
  + I: Unsigned
  + + ops::Add<I, Output = I>
  + ops::Div<I, Output = I>
  + ops::Shr<u8, Output = I>
  + cmp::PartialOrd
  + Copy
  + From<u8>,
  - > Isqrt for I
  {
  /// Algorithm adapted from
  /// [Wikipedia](https://en.wikipedia.org/wiki/Integer_square_root#Example_implementation_in_C).
  @@ -37,17 +38,28 @@ impl<
  }
  }
  +/// Marker trait for types that represent unsigned integers.
  +pub trait Unsigned {}
  +impl Unsigned for u8 {}
  +impl Unsigned for u16 {}
  +impl Unsigned for u32 {}
  +impl Unsigned for u64 {}
  +impl Unsigned for u128 {}
  +
  #[test]
  fn isqrts() {
  // Let's check correctness.
  - assert_eq!(0.isqrt(), 0);
  - assert_eq!(1.isqrt(), 1);
  - assert_eq!(24.isqrt(), 4);
  - assert_eq!(25.isqrt(), 5);
  - assert_eq!(26.isqrt(), 5);
  - assert_eq!(36.isqrt(), 6);
  + assert_eq!(0u8.isqrt(), 0);
  + assert_eq!(1u8.isqrt(), 1);
  + assert_eq!(24u8.isqrt(), 4);
  + assert_eq!(25u8.isqrt(), 5);
  + assert_eq!(26u8.isqrt(), 5);
  + assert_eq!(36u8.isqrt(), 6);
  // Let's also check different types.
  assert_eq!(26u8.isqrt(), 5);
  + assert_eq!(26u16.isqrt(), 5);
  + assert_eq!(26u32.isqrt(), 5);
  + assert_eq!(26u64.isqrt(), 5);
  assert_eq!(26u128.isqrt(), 5);
  }
  