1. 24 1月, 2018 2 次提交
    • B
      Auto merge of #45337 - Zoxc:gen-static, r=nikomatsakis · fdecb056
      bors 提交于
      Immovable generators
      
      This adds support for immovable generators which allow you to borrow local values inside generator across suspension points. These are declared using a `static` keyword:
      ```rust
      let mut generator = static || {
          let local = &Vec::new();
          yield;
          local.push(0i8);
      };
      generator.resume();
      
      // ERROR moving the generator after it has resumed would invalidate the interior reference
      // drop(generator);
      ```
      
      Region inference is no longer affected by the types stored in generators so the regions inside should be similar to other code (and unaffected by the presence of `yield` expressions). The borrow checker is extended to pick up the slack so interior references still result in errors for movable generators. This fixes #44197, #45259 and #45093.
      
      This PR depends on [PR #44917 (immovable types)](https://github.com/rust-lang/rust/pull/44917), I suggest potential reviewers ignore the first commit as it adds immovable types.
      fdecb056
    • B
      Auto merge of #47678 - kennytm:rollup, r=kennytm · 4e3901d3
      bors 提交于
      Rollup of 14 pull requests
      
      - Successful merges: #47423, #47425, #47440, #47541, #47549, #47554, #47558, #47610, #47635, #47655, #47661, #47662, #47667, #47672
      - Failed merges:
      4e3901d3
  2. 23 1月, 2018 34 次提交
  3. 22 1月, 2018 4 次提交
    • B
      Auto merge of #47353 - nikomatsakis:nll-issue-47189, r=pnkfelix+nmatsakis · fdc18b30
      bors 提交于
      renumber regions in generators
      
      This fixes #47189, but I think we still have to double check various things around how to treat generators in MIR type check + borrow check (e.g., what borrows should be invalidated by a `Suspend`? What consistency properties should type check be enforcing anyway around the "interior" type?)
      
      Also fixes #47587 thanks to @spastorino's commit.
      
      r? @pnkfelix
      fdc18b30
    • M
      Update to new commonmark arg · fe93adad
      Manish Goregaokar 提交于
      fe93adad
    • R
      Fix spurious warning on empty proc macro crates · e1bffbdf
      Ryan Cumming 提交于
      While attempting to reproduce rust-lang/rust#47086 I noticed the
      following warning:
      
      ```shell
      > rustc /dev/null --crate-type proc-macro
      warning: unused variable: `registrar`
       --> /dev/null:0:1
      ```
      
      As there are no macros to register the automatically generated registrar
      function for the crate has no body. As a result its `registrar` argument
      is unused triggering the above warning.
      
      The warning is confusing and not easily actionable by the developer. It
      could also be triggered legitimately by e.g. having all of the macros in
      a crate #[cfg]'ed out.
      
      Fix by naming the generated argument `_registrar` inside
      `mk_registrar()`. This suppresses the unused variable warning.
      e1bffbdf
    • M
      Review fixes · dc547525
      Manish Goregaokar 提交于
      dc547525