1. 12 5月, 2015 3 次提交
  2. 30 4月, 2015 2 次提交
    • A
      Use hash-tables in trait selection · 7ae4a8e9
      Ariel Ben-Yehuda 提交于
      Puts implementations in bins hashed by the fast-reject key, and
      only looks up the relevant impls, reducing O(n^2)-ishness
      
      Before: 688.92user 5.08system 8:56.70elapsed 129%CPU (0avgtext+0avgdata 1208164maxresident)k, LLVM 379.142s
      After: 637.78user 5.11system 8:17.48elapsed 129%CPU (0avgtext+0avgdata 1201448maxresident)k LLVM 375.552s
      
      Performance increase is +7%-ish
      7ae4a8e9
    • A
      Stop using Rc in TraitRef and TraitDef · bd1f7342
      Ariel Ben-Yehuda 提交于
      The former stopped making sense when we started interning substs and made
      TraitRef a 2-word copy type, and I'm moving the latter into an arena as
      they live as long as the type context.
      bd1f7342
  3. 24 4月, 2015 3 次提交
  4. 22 4月, 2015 1 次提交
    • A
      std: Remove deprecated/unstable num functionality · eeb94886
      Alex Crichton 提交于
      This commit removes all the old casting/generic traits from `std::num` that are
      no longer in use by the standard library. This additionally removes the old
      `strconv` module which has not seen much use in quite a long time. All generic
      functionality has been supplanted with traits in the `num` crate and the
      `strconv` module is supplanted with the [rust-strconv crate][rust-strconv].
      
      [rust-strconv]: https://github.com/lifthrasiir/rust-strconv
      
      This is a breaking change due to the removal of these deprecated crates, and the
      alternative crates are listed above.
      
      [breaking-change]
      eeb94886
  5. 15 4月, 2015 1 次提交
  6. 04 4月, 2015 1 次提交
  7. 31 3月, 2015 2 次提交
    • A
      Stabilize std::num · 232424d9
      Aaron Turon 提交于
      This commit stabilizes the `std::num` module:
      
      * The `Int` and `Float` traits are deprecated in favor of (1) the
        newly-added inherent methods and (2) the generic traits available in
        rust-lang/num.
      
      * The `Zero` and `One` traits are reintroduced in `std::num`, which
        together with various other traits allow you to recover the most
        common forms of generic programming.
      
      * The `FromStrRadix` trait, and associated free function, is deprecated
        in favor of inherent implementations.
      
      * A wide range of methods and constants for both integers and floating
        point numbers are now `#[stable]`, having been adjusted for integer
        guidelines.
      
      * `is_positive` and `is_negative` are renamed to `is_sign_positive` and
        `is_sign_negative`, in order to address #22985
      
      * The `Wrapping` type is moved to `std::num` and stabilized;
        `WrappingOps` is deprecated in favor of inherent methods on the
        integer types, and direct implementation of operations on
        `Wrapping<X>` for each concrete integer type `X`.
      
      Closes #22985
      Closes #21069
      
      [breaking-change]
      232424d9
    • A
      std: Standardize (input, output) param orderings · acd48a2b
      Alex Crichton 提交于
      This functions swaps the order of arguments to a few functions that previously
      took (output, input) parameters, but now take (input, output) parameters (in
      that order).
      
      The affected functions are:
      
      * ptr::copy
      * ptr::copy_nonoverlapping
      * slice::bytes::copy_memory
      * intrinsics::copy
      * intrinsics::copy_nonoverlapping
      
      Closes #22890
      [breaking-change]
      acd48a2b
  8. 27 3月, 2015 1 次提交
  9. 13 3月, 2015 1 次提交
  10. 07 3月, 2015 1 次提交
    • N
      Change the data structures for tracking defaulted traits. In the tcx, we · dbec033e
      Niko Matsakis 提交于
      now have a simple set of trait def-ids. During coherence, we use a
      separate table to track the default impls for any given trait so that we
      can report a nice error. This fixes various bugs in the metadata
      encoding that led to `ty::trait_has_default_impl` yielding the wrong
      values in the cross-crate case. (In particular, default impl def-ids
      were not included in the list of all impl def-ids; I debated fixing just
      that, but this approach seemed cleaner overall, since we usually treat
      the "defaulted" bit on traits as being a property of the trait, and now
      iterating over a list of impls doesn't intermingle default impls with
      normal impls.)
      dbec033e
  11. 05 3月, 2015 2 次提交
    • A
      std: Deprecate std::old_io::fs · 95d90462
      Alex Crichton 提交于
      This commit deprecates the majority of std::old_io::fs in favor of std::fs and
      its new functionality. Some functions remain non-deprecated but are now behind a
      feature gate called `old_fs`. These functions will be deprecated once
      suitable replacements have been implemented.
      
      The compiler has been migrated to new `std::fs` and `std::path` APIs where
      appropriate as part of this change.
      95d90462
    • N
      Separate supertrait collection from processing a `TraitDef`. This allows · bc9ae36d
      Niko Matsakis 提交于
      us to construct trait-references and do other things without forcing a
      full evaluation of the supertraits. One downside of this scheme is that
      we must invoke `ensure_super_predicates` before using any construct that
      might require knowing about the super-predicates.
      bc9ae36d
  12. 04 3月, 2015 1 次提交
    • M
      Encode codemap and span information in crate metadata. · 2f886555
      Michael Woerister 提交于
      This allows to create proper debuginfo line information for items inlined from other crates (e.g. instantiations of generics).
      Only the codemap's 'metadata' is stored in a crate's metadata. That is, just filename, line-beginnings, etc. but not the actual source code itself. We are thus missing the opportunity of making Rust the first "open-source-only" programming language out there. Pity.
      2f886555
  13. 03 3月, 2015 1 次提交
    • J
      Add `core::num::wrapping` and fix overflow errors. · 1246d406
      James Miller 提交于
      Many of the core rust libraries have places that rely on integer
      wrapping behaviour. These places have been altered to use the wrapping_*
      methods:
      
       * core::hash::sip - A number of macros
       * core::str - The `maximal_suffix` method in `TwoWaySearcher`
       * rustc::util::nodemap - Implementation of FnvHash
       * rustc_back::sha2 - A number of macros and other places
       * rand::isaac - Isaac64Rng, changed to use the Wrapping helper type
      
      Some places had "benign" underflow. This is when underflow or overflow
      occurs, but the unspecified value is not used due to other conditions.
      
       * collections::bit::Bitv - underflow when `self.nbits` is zero.
       * collections::hash::{map,table} - Underflow when searching an empty
         table. Did cause undefined behaviour in this case due to an
         out-of-bounds ptr::offset based on the underflowed index. However the
         resulting pointers would never be read from.
       * syntax::ext::deriving::encodable - Underflow when calculating the
         index of the last field in a variant with no fields.
      
      These cases were altered to avoid the underflow, often by moving the
      underflowing operation to a place where underflow could not happen.
      
      There was one case that relied on the fact that unsigned arithmetic and
      two's complement arithmetic are identical with wrapping semantics. This
      was changed to use the wrapping_* methods.
      
      Finally, the calculation of variant discriminants could overflow if the
      preceeding discriminant was `U64_MAX`. The logic in `rustc::middle::ty`
      for this was altered to avoid the overflow completely, while the
      remaining places were changed to use wrapping methods. This is because
      `rustc::middle::ty::enum_variants` now throws an error when the
      calculated discriminant value overflows a `u64`.
      
      This behaviour can be triggered by the following code:
      
      ```
      enum Foo {
        A = U64_MAX,
        B
      }
      ```
      
      This commit also implements the remaining integer operators for
      Wrapped<T>.
      1246d406
  14. 28 2月, 2015 1 次提交
  15. 24 2月, 2015 4 次提交
  16. 22 2月, 2015 3 次提交
  17. 21 2月, 2015 1 次提交
  18. 13 2月, 2015 2 次提交
  19. 03 2月, 2015 1 次提交
  20. 01 2月, 2015 1 次提交
  21. 31 1月, 2015 1 次提交
    • A
      std: Stabilize FromStr and parse · 0cdde6e5
      Alex Crichton 提交于
      This commits adds an associated type to the `FromStr` trait representing an
      error payload for parses which do not succeed. The previous return value,
      `Option<Self>` did not allow for this form of payload. After the associated type
      was added, the following attributes were applied:
      
      * `FromStr` is now stable
      * `FromStr::Err` is now stable
      * `FromStr::from_str` is now stable
      * `StrExt::parse` is now stable
      * `FromStr for bool` is now stable
      * `FromStr for $float` is now stable
      * `FromStr for $integral` is now stable
      * Errors returned from stable `FromStr` implementations are stable
      * Errors implement `Display` and `Error` (both impl blocks being `#[stable]`)
      
      Closes #15138
      0cdde6e5
  22. 30 1月, 2015 1 次提交
  23. 29 1月, 2015 1 次提交
  24. 28 1月, 2015 1 次提交
  25. 27 1月, 2015 1 次提交
  26. 20 1月, 2015 1 次提交
  27. 16 1月, 2015 1 次提交