]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #11622 : bjz/rust/simplify-primitive-trait, r=brson
authorbors <bors@rust-lang.org>
Sat, 18 Jan 2014 13:36:47 +0000 (05:36 -0800)
committerbors <bors@rust-lang.org>
Sat, 18 Jan 2014 13:36:47 +0000 (05:36 -0800)
As part of #10387, this removes the `Primitive::{bits, bytes, is_signed}` methods and removes the trait's operator trait constraints for the reasons outlined below:

- The `Primitive::{bits, bytes}` associated functions were originally added to reflect the existing `BITS` and `BYTES`statics included in the numeric modules. These statics are only exist as a workaround for Rust's lack of CTFE, and should be deprecated in the future in favor of using the `std::mem::size_of` function (see #11621).

- `Primitive::is_signed` seems to be of little utility and does not seem to be used anywhere in the Rust compiler or libraries. It is also rather ugly to call due to the `Option<Self>` workaround for #8888.

- The operator trait constraints are already covered by the `Num` trait.

1  2 
src/libstd/num/f32.rs
src/libstd/num/f64.rs
src/libstd/num/mod.rs

Simple merge
Simple merge
Simple merge