@@ -406,7 +406,7 @@ pub trait Int: Primitive
406
406
///
407
407
/// assert_eq!(n.count_ones(), 3);
408
408
/// ```
409
- fn count_ones ( self ) -> Self ;
409
+ fn count_ones ( self ) -> uint ;
410
410
411
411
/// Returns the number of zeros in the binary representation of the integer.
412
412
///
@@ -418,7 +418,7 @@ pub trait Int: Primitive
418
418
/// assert_eq!(n.count_zeros(), 5);
419
419
/// ```
420
420
#[ inline]
421
- fn count_zeros ( self ) -> Self {
421
+ fn count_zeros ( self ) -> uint {
422
422
( !self ) . count_ones ( )
423
423
}
424
424
@@ -432,7 +432,7 @@ pub trait Int: Primitive
432
432
///
433
433
/// assert_eq!(n.leading_zeros(), 10);
434
434
/// ```
435
- fn leading_zeros ( self ) -> Self ;
435
+ fn leading_zeros ( self ) -> uint ;
436
436
437
437
/// Returns the number of trailing zeros in the binary representation
438
438
/// of the integer.
@@ -444,7 +444,7 @@ pub trait Int: Primitive
444
444
///
445
445
/// assert_eq!(n.trailing_zeros(), 3);
446
446
/// ```
447
- fn trailing_zeros ( self ) -> Self ;
447
+ fn trailing_zeros ( self ) -> uint ;
448
448
449
449
/// Shifts the bits to the left by a specified amount amount, `n`, wrapping
450
450
/// the truncated bits to the end of the resulting integer.
@@ -569,13 +569,13 @@ macro_rules! int_impl {
569
569
( $T: ty, $BITS: expr, $ctpop: path, $ctlz: path, $cttz: path, $bswap: path) => {
570
570
impl Int for $T {
571
571
#[ inline]
572
- fn count_ones( self ) -> $T { unsafe { $ctpop( self ) } }
572
+ fn count_ones( self ) -> uint { unsafe { $ctpop( self ) as uint } }
573
573
574
574
#[ inline]
575
- fn leading_zeros( self ) -> $T { unsafe { $ctlz( self ) } }
575
+ fn leading_zeros( self ) -> uint { unsafe { $ctlz( self ) as uint } }
576
576
577
577
#[ inline]
578
- fn trailing_zeros( self ) -> $T { unsafe { $cttz( self ) } }
578
+ fn trailing_zeros( self ) -> uint { unsafe { $cttz( self ) as uint } }
579
579
580
580
#[ inline]
581
581
fn rotate_left( self , n: uint) -> $T {
@@ -629,13 +629,13 @@ macro_rules! int_cast_impl {
629
629
( $T: ty, $U: ty) => {
630
630
impl Int for $T {
631
631
#[ inline]
632
- fn count_ones( self ) -> $T { ( self as $U) . count_ones( ) as $T }
632
+ fn count_ones( self ) -> uint { ( self as $U) . count_ones( ) }
633
633
634
634
#[ inline]
635
- fn leading_zeros( self ) -> $T { ( self as $U) . leading_zeros( ) as $T }
635
+ fn leading_zeros( self ) -> uint { ( self as $U) . leading_zeros( ) }
636
636
637
637
#[ inline]
638
- fn trailing_zeros( self ) -> $T { ( self as $U) . trailing_zeros( ) as $T }
638
+ fn trailing_zeros( self ) -> uint { ( self as $U) . trailing_zeros( ) }
639
639
640
640
#[ inline]
641
641
fn rotate_left( self , n: uint) -> $T { ( self as $U) . rotate_left( n) as $T }
0 commit comments