1. 17 9月, 2016 10 次提交
  2. 16 9月, 2016 22 次提交
  3. 15 9月, 2016 8 次提交
    • B
      Auto merge of #36491 - Manishearth:rollup, r=Manishearth · dc75933a
      bors 提交于
      Rollup of 9 pull requests
      
      - Successful merges: #36384, #36405, #36425, #36429, #36438, #36454, #36459, #36461, #36463
      - Failed merges: #36444
      dc75933a
    • M
      Rollup merge of #36463 - eugene-bulkin:duration-checked-ops, r=alexcrichton · ec081288
      Manish Goregaokar 提交于
      Add checked operation methods to Duration
      
      Addresses #35774.
      ec081288
    • M
      Rollup merge of #36461 - nikomatsakis:issue-36053, r=arielb1 · 0c9dc539
      Manish Goregaokar 提交于
      clear obligations-added flag with nested fulfillcx
      
      This flag is a debugging measure designed to detect cases where we start
      a snapshot, create type variables, register obligations involving those
      type variables in the fulfillment cx, and then have to unroll the
      snapshot, leaving "dangling type variables" behind.  HOWEVER, in some
      cases the flag is wrong. In particular, we sometimes create a
      "mini-fulfilment-cx" in which we enroll obligations. As long as this
      fulfillment cx is fully drained before we return, this is not a problem,
      as there won't be any escaping obligations in the main cx. So we add a
      fn to save/restore the flag.
      
      Fixes #36053.
      
      r? @arielb1
      0c9dc539
    • M
      Rollup merge of #36459 - nikomatsakis:issue-35546, r=eddyb · 959f764f
      Manish Goregaokar 提交于
      invoke drop glue with a ptr to (data, meta)
      
      This is done by creating a little space on the stack. Hokey, but it's the simplest fix I can see, and I am in "kill regressions" mode right now.
      
      Fixes #35546
      
      r? @EddyB
      959f764f
    • M
      Rollup merge of #36454 - bluss:slice-primitive-index, r=alexcrichton · 69a7f92a
      Manish Goregaokar 提交于
      Use primitive indexing in slice's Index/IndexMut
      
      [T]'s Index implementation is normally not used for indexing, instead
      the compiler supplied indexing is used.
      
      Use the compiler supplied version in Index/IndexMut.
      
      This removes an inconsistency:
      
      Compiler supplied bound check failures look like this:
      
      thread 'main' panicked at 'index out of bounds: the len is 3 but the index is 4'
      
      If you convince Rust to use the Index impl for slices, bounds check
      failure looks like this instead:
      
      thread 'main' panicked at 'assertion failed: index < self.len()'
      
      The latter is used if you for example use Index generically:
      
      ```rust
      use std::ops::Index;
      fn foo<T: ?Sized>(x: &T) where T: Index<usize> { &x[4]; }
      
      foo(&[1, 2, 3][..])
      ```
      69a7f92a
    • M
      Rollup merge of #36438 - jseyfried:node_ids_in_expansion, r=nrc · bab9238a
      Manish Goregaokar 提交于
      Assign node ids during macro expansion
      
      After this PR,
       - The `ExtCtxt` can access `resolve`'s `Resolver` through the trait object `ext::base::Resolver`.
        - The `Resolver` trait object can load macros and replaces today's `MacroLoader` trait object.
        - The macro expander uses the `Resolver` trait object to resolve macro invocations.
       - The macro expander assigns node ids and builds the `Resolver`'s `macros_at_scope` map.
         - This is groundwork for merging import resolution and expansion.
       - Performance of expansion together with node id assignment improves by ~5%.
      
      **EDIT:** Since Github is reordering the commits, here is `git log`:
       - b54e1e39: Differentiate between monotonic and non-monotonic expansion and only assign node ids during monotonic expansion.
       - 78c00398: Expand generated test harnesses and macro registries.
       - f3c2dca3: Remove scope placeholders from the crate root.
       - c86c8d41: Perform node id assignment and `macros_at_scope` construction during the `InvocationCollector` and `PlaceholderExpander` folds.
       - 72a63697: Move macro resolution into `librustc_resolve`.
       - 20b43b23: Rewrite the unit tests in `ext/expand.rs` as a `compile-fail` test.
       - a9821e16: Refactor `ExtCtxt` to use a `Resolver` instead of a `MacroLoader`.
       - 60440b22: Refactor `noop_fold_stmt_kind` out of `noop_fold_stmt`.
       - 50f94f6c: Avoid needless reexpansions.
      
      r? @nrc
      bab9238a
    • M
      Rollup merge of #36429 - durka:patch-30, r=nagisa · 23e0c24c
      Manish Goregaokar 提交于
      fix "X is not a member of trait Y" span labels
      
      Fixes #36428.
      23e0c24c
    • M
      Rollup merge of #36425 - michaelwoerister:stable-projection-bounds, r=eddyb · 7494bc7c
      Manish Goregaokar 提交于
      Fix indeterminism in ty::TraitObject representation.
      
      Make sure that projection bounds in `ty::TraitObject` are sorted in a way that is stable across compilation sessions and crate boundaries.
      
      This PR
      +  moves `DefPathHashes` up into `librustc` so it can be used there to create a stable sort key for `DefId`s,
      + changes `PolyExistentialProjection::sort_key()` to take advantage of the above,
      + and removes the unused `PolyProjectionPredicate::sort_key()` and `ProjectionTy::sort_key()` methods.
      
      Fixes #36155
      7494bc7c