Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify std::num::Primitive trait definition #11622

Closed

Commits on Jan 17, 2014

  1. Simplify std::num::Primitive trait definition

    This removes the `Primitive::{bits, bytes, is_signed}` methods and removes the 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 probably be deprecated in the future in favor of using the `std::mem::size_of` function (see rust-lang#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 rust-lang#8888.
    
    - The operator trait constraints are already covered by the `Num` trait.
    brendanzab committed Jan 17, 2014
    Configuration menu
    Copy the full SHA
    472dfe7 View commit details
    Browse the repository at this point in the history
  2. 5 Configuration menu
    Copy the full SHA
    f125b71 View commit details
    Browse the repository at this point in the history