1. 28 6月, 2015 2 次提交
    • J
      Address nits · 15bc4a30
      Jared Roesch 提交于
      15bc4a30
    • J
      Begin refactor type checking state · 79d02895
      Jared Roesch 提交于
      This first patch starts by moving around pieces of state related to
      type checking. The goal is to slowly unify the type checking state
      into a single typing context. This initial patch moves the
      ParameterEnvironment into the InferCtxt and moves shared tables
      from Inherited and ty::ctxt into their own struct Tables. This
      is the foundational work to refactoring the type checker to
      enable future evolution of the language and tooling.
      79d02895
  2. 19 6月, 2015 3 次提交
  3. 11 6月, 2015 1 次提交
  4. 10 6月, 2015 1 次提交
  5. 08 6月, 2015 1 次提交
  6. 26 5月, 2015 2 次提交
  7. 22 5月, 2015 1 次提交
  8. 20 5月, 2015 1 次提交
  9. 19 5月, 2015 1 次提交
  10. 14 5月, 2015 1 次提交
  11. 30 4月, 2015 1 次提交
    • 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
  12. 26 4月, 2015 1 次提交
  13. 24 4月, 2015 1 次提交
  14. 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
  15. 17 4月, 2015 1 次提交
  16. 14 4月, 2015 1 次提交
  17. 03 4月, 2015 1 次提交
  18. 01 4月, 2015 1 次提交
  19. 28 3月, 2015 1 次提交
  20. 27 3月, 2015 1 次提交
  21. 24 3月, 2015 1 次提交
  22. 20 3月, 2015 1 次提交
  23. 19 3月, 2015 1 次提交
  24. 18 3月, 2015 1 次提交
  25. 17 3月, 2015 1 次提交
  26. 14 3月, 2015 1 次提交
  27. 12 3月, 2015 2 次提交
  28. 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
  29. 03 3月, 2015 4 次提交
    • 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
    • K
      metadata: Flatten `tag_table_id` and `tag_table_val` tags. · 36a09a16
      Kang Seonghoon 提交于
      This avoids a biggish eight-byte `tag_table_id` tag in favor of
      autoserialized integer tags, which are smaller and can be later
      used to encode them in the optimal number of bytes. `NodeId` was
      u32 after all.
      
      Previously:
      
                             <------------- len1 -------------->
          tag_table_* <len1> tag_table_id 88 <nodeid in 8 bytes>
                             tag_table_val <len2> <actual data>
                                                  <-- len2 --->
      
      Now:
      
                            <--------------- len --------------->
          tag_table_* <len> U32 <nodeid in 4 bytes> <actual data>
      36a09a16
    • K
      metadata: Implement relaxation of short RBML lengths. · 84e9a61e
      Kang Seonghoon 提交于
      We try to move the data when the length can be encoded in
      the much smaller number of bytes. This interferes with indices and
      type abbreviations however, so this commit introduces a public
      interface to get and mark a "stable" (i.e. not affected by
      relaxation) position of the current pointer.
      
      The relaxation logic only moves a small data, currently at most
      256 bytes, as moving the data can be costly. There might be
      further opportunities to allow more relaxation by moving fields
      around, which I didn't seriously try.
      84e9a61e
    • B
      core: Audit num module for int/uint · 76e9fa63
      Brian Anderson 提交于
      * count_ones/zeros, trailing_ones/zeros return u32, not usize
      * rotate_left/right take u32, not usize
      * RADIX, MANTISSA_DIGITS, DIGITS, BITS, BYTES are u32, not usize
      
      Doesn't touch pow because there's another PR for it.
      
      [breaking-change]
      76e9fa63
  30. 24 2月, 2015 3 次提交