1. 05 1月, 2016 2 次提交
    • B
      Auto merge of #30523 - ubsan:wrapping_op_assign, r=eddyb · 5e8cb381
      bors 提交于
      Add OpAssign to Wrapping<T>, plus fix some problems in core::num::wrapping
      
      including, but not limited to:
      
      * Testing Wrapping<T>
      * Pull out a lot of broken code that doesn't need to be there with the new stage0 compiler
      * Adding Rem and RemAssign to Wrapping<T>
      * Removed 3 (assumed accidental) re-exports, which is a minor [breaking-change].
      * Change shl and shr to take all integer types, instead of a usize; this is a more major [breaking-change], because of values that were inferred before, but brings us in line with the integer shifts.
      
      Fixes #30524 and #30523
      5e8cb381
    • B
      Auto merge of #30553 - luqmana:mir-match-arm-guards, r=nikomatsakis · b6228915
      bors 提交于
      Fixes #30527.
      
      ```Rust
      
      fn main() {
          let _abc = match Some(101i8) {
              Some(xyz) if xyz > 100 => xyz,
              Some(_) => -1,
              None => -2
          };
      }
      ```
      
      Resulting MIR now includes the `Some(xyz)` arm, guard and all:
      ![match.dot](https://cloud.githubusercontent.com/assets/287063/11999413/066f7610-aa8b-11e5-927b-24215af57fc4.png)
      
      ~~Not quite sure how to write a test for this.~~ Thinking too hard, just tested the end result.
      
      r? @nikomatsakis
      b6228915
  2. 04 1月, 2016 6 次提交
    • B
      Auto merge of #30690 - LawrenceWoodman:patch-2, r=steveklabnik · 543bb03d
      bors 提交于
      `fs::File` was being referenced without either calling via `std::fs::File` or by using `File` after having used `std::fs::File`.  Also `Path` was being referenced without first having used `std::path::Path`.
      543bb03d
    • L
      Add missing use statements · 0c3d6b46
      Lawrence Woodman 提交于
      fs::File was being referenced without either calling via std::fs::File or by using File after having used fs::File.  Also Path was being referenced without first having used std::path::Path.
      0c3d6b46
    • B
      Auto merge of #30651 - nagisa:mir-fix-equality-checks, r=eddyb · 191ff2d8
      bors 提交于
      This is not a fix to checks themselves per se (though we still use `Eq` MIR test instead of calling `PartialEq::eq`), but rather how we handle items we encounter in pattern position.
      
      Previously we would just call `PartialEq` with the constant and the matchee, but now we essentially inline the constant instead. E.g. these two snippets are functionally equivalent at MIR level:
      
      ```
      match val { Some(42) => true, _ => false }
      ```
      and
      ```
      const SECRET: Option<u8> = Some(42);
      match val { SECRET => true, _ => false }
      ```
      
      This approach also allows for more optimizations of matches. I.e. It can now exploit `SwitchInt` to switch on number inside a `Some` regardless of whether the value being an item or not.
      
      This is based on @tsion’s already approved PR so I could reuse the file for more tests.
      
      r? @EddyB
      cc @nikomatsakis @tsion
      191ff2d8
    • B
      Auto merge of #29732 - nathansizemore:master, r=steveklabnik · 99e59dec
      bors 提交于
      99e59dec
    • B
      Auto merge of #30677 - diwic:master, r=bluss · 8f11a9ef
      bors 提交于
      Obviously we can't remove the character one past the end of the String. And we can't today either - we'll just panic at char_at() instead - but if we're going to keep that assertion, we should at least have a correct assertion.
      8f11a9ef
    • B
      Auto merge of #29949 - fhahn:issue-21659-show-relevant-trait-impls, r=arielb1 · cae9267d
      bors 提交于
      This PR for #21659 uses `DefId.for_each_relevant_impl()` to show other possible implementations in the "trait not implemented" message.
      cae9267d
  3. 03 1月, 2016 9 次提交
  4. 02 1月, 2016 10 次提交
  5. 01 1月, 2016 13 次提交