File tree 5 files changed +13
-0
lines changed
5 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -590,6 +590,9 @@ impl Primitive for f32 {
590
590
591
591
#[ inline]
592
592
fn bytes ( _: Option < f32 > ) -> uint { Primitive :: bits ( Some ( 0f32 ) ) / 8 }
593
+
594
+ #[ inline]
595
+ fn is_signed ( _: Option < f32 > ) -> bool { true }
593
596
}
594
597
595
598
impl Float for f32 {
Original file line number Diff line number Diff line change @@ -638,6 +638,9 @@ impl Primitive for f64 {
638
638
639
639
#[ inline]
640
640
fn bytes ( _: Option < f64 > ) -> uint { Primitive :: bits ( Some ( 0f64 ) ) / 8 }
641
+
642
+ #[ inline]
643
+ fn is_signed ( _: Option < f64 > ) -> bool { true }
641
644
}
642
645
643
646
impl Float for f64 {
Original file line number Diff line number Diff line change @@ -380,6 +380,9 @@ impl Primitive for $T {
380
380
381
381
#[ inline]
382
382
fn bytes( _: Option <$T>) -> uint { bits / 8 }
383
+
384
+ #[ inline]
385
+ fn is_signed( _: Option <$T>) -> bool { true }
383
386
}
384
387
385
388
// String conversion functions and impl str -> num
Original file line number Diff line number Diff line change @@ -286,6 +286,7 @@ pub trait Primitive: Clone
286
286
// FIXME (#8888): Removing `unused_self` requires #8888 to be fixed.
287
287
fn bits ( unused_self : Option < Self > ) -> uint ;
288
288
fn bytes ( unused_self : Option < Self > ) -> uint ;
289
+ fn is_signed ( unused_self : Option < Self > ) -> bool ;
289
290
}
290
291
291
292
/// A collection of traits relevant to primitive signed and unsigned integers
Original file line number Diff line number Diff line change @@ -306,6 +306,9 @@ impl Primitive for $T {
306
306
307
307
#[ inline]
308
308
fn bytes( _: Option <$T>) -> uint { bits / 8 }
309
+
310
+ #[ inline]
311
+ fn is_signed( _: Option <$T>) -> bool { false }
309
312
}
310
313
311
314
impl BitCount for $T {
You can’t perform that action at this time.
0 commit comments