1. 28 6月, 2019 12 次提交
    • M
      Rollup merge of #62156 - ehuss:update-books, r=ehuss · 766795fe
      Mazdak Farrokhzad 提交于
      Update books
      
      Update nomicon, reference, book, rust-by-example, rustc-guide
      
      ## nomicon
      
      2 commits in c656171b749b7307f21371dd0d3278efee5573b8..341c221116a8b9f1010cf1eece952b80c5ec7f54
      2019-04-25 15:31:26 -0400 to 2019-06-19 09:08:47 -0700
      - Fix some links.
      - cleanup the intro, and clarify how it relates to the reference (rust-lang-nursery/nomicon#140)
      
      ## reference
      
      2 commits in 08ae27a4921ca53967656a7391c82f6c0ddd1ccc..7a5aab5fd50d6290679beb4cf42fa5f46ed22aec
      2019-06-17 11:24:13 -0700 to 2019-06-20 17:38:52 +0200
      - Update for cfg on generic parameter. (rust-lang-nursery/reference#624)
      - Link to "const functions" section from constant expressions list (rust-lang-nursery/reference#623)
      
      ## book
      
      2 commits in 9aacfcc4c5b102c8cda195932addefd32fe955d2..6c0d83499c8e77e06a71d28c5e1adccec278d4f3
      2019-06-16 21:27:26 -0400 to 2019-06-23 20:25:30 -0400
      - fancy quotes
      - Edits made in copyedit
      
      ## rust-by-example
      
      2 commits in b27472962986e85c94f4183b1a6d2207660d3ed6..62b3ff2cb44dd8b648c3ef2a9347c3706d148014
      2019-06-17 15:52:07 -0300 to 2019-06-24 09:17:21 -0300
      - A couple of fixes for the `Box, stack and heap` chapter. (rust-lang/rust-by-example#1206)
      - [typo] Note, that it is -> Note that, it is (rust-lang/rust-by-example#1207)
      
      ## rustc-guide
      
      38 commits in f55e97c145cf37fd664db2e0e2f2d05df328bf4f..abf512fc9cc969dcbea69aa15b44586bbeb13c2d
      2019-06-15 17:29:12 -0500 to 2019-06-26 11:05:58 -0500
      - fix long line
      - add `point` to the glossary and link a use of it
      - fix indentation
      - Update src/borrow_check/region_inference/placeholders_and_universes.md
      - Update src/borrow_check/region_inference/placeholders_and_universes.md
      - Update src/borrow_check/region_inference/placeholders_and_universes.md
      - Update src/borrow_check/region_inference/member_constraints.md
      - Update src/borrow_check/region_inference/constraint_propagation.md
      - Update src/borrow_check/region_inference/member_constraints.md
      - Update src/borrow_check/region_inference/constraint_propagation.md
      - Update src/borrow_check/region_inference/member_constraints.md
      - Update src/borrow_check/region_inference/member_constraints.md
      - Update src/borrow_check/region_inference/lifetime_parameters.md
      - Update src/borrow_check/region_inference/member_constraints.md
      - Update src/borrow_check/region_inference/constraint_propagation.md
      - Update src/borrow_check/region_inference/constraint_propagation.md
      - Update src/borrow_check/region_inference/constraint_propagation.md
      - Update src/borrow_check/region_inference/constraint_propagation.md
      - Update src/borrow_check/region_inference/constraint_propagation.md
      - Update src/borrow_check/region_inference/constraint_propagation.md
      - Update src/borrow_check/region_inference/constraint_propagation.md
      - Update src/borrow_check/region_inference/lifetime_parameters.md
      - Update src/borrow_check/region_inference/lifetime_parameters.md
      - Update src/borrow_check/region_inference/lifetime_parameters.md
      - Update src/borrow_check/region_inference/constraint_propagation.md
      - adjust overview slightly
      - describe region inference and member constraints in some detail
      - start filling out the constraint propagation chapter in more detail
      - break out parts of the region inference chapter into sub-chapters
      - fix typo
      - avoid ftp links
      - fix broken links
      - add bibligraphy appendix
      - Update to mdbook-linkcheck 0.3.0
      - Update mdbook
      - Change stage0 cfg_attr to bootstrap
      - fix compiler-team
      - Added Rustc Debugger Support Chapter
      766795fe
    • M
      Rollup merge of #62155 - cramertj:61872, r=centril · a1a0e0c9
      Mazdak Farrokhzad 提交于
      Add regression test for MIR drop generation in async loops
      
      Fixes #61986.
      
      r? @Centril
      a1a0e0c9
    • M
      Rollup merge of #62154 - mark-i-m:old-fixme, r=Centril · 0fe028ea
      Mazdak Farrokhzad 提交于
      Remove old fixme
      
      fixed in https://github.com/rust-lang/rust/pull/60160
      
      r? @Centril
      0fe028ea
    • M
      Rollup merge of #62152 - doctorn:async_let_ice, r=cramertj · 274c3de1
      Mazdak Farrokhzad 提交于
      Don't ICE on item in `.await` expression
      
      The code for lowering a `.await` expression missed that item IDs may already have been assigned for items inside of an `async` block, or for closures. This change means we no longer exit early after finding a `.await` in a block that isn't `async` and instead just emit the error. This avoids an ICE generated due to item IDs not being densely generated. (The `YieldSource` of the generated `yield` expression is  used to avoid errors generated about having `yield` expressions outside of generator literals.)
      
      r? @cramertj
      
      Resolves #62009 and resolves #61685
      274c3de1
    • M
      Rollup merge of #62131 - Xanewok:clip-some-nits, r=petrochenkov · 4aa3e272
      Mazdak Farrokhzad 提交于
      libsyntax: Fix some Clippy warnings
      
      When I was working on it before a lot of these popped up in the RLS so I figured I'll send a small patch fixing only the (hopefully) uncontroversial ones.
      
      Others that could be also fixed included also [`clippy::print_with_newline`](https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline) and [`clippy::cast_lossless`](https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless). Should I add them as well?
      
      since most of it touches libsyntax...
      r? @petrochenkov
      4aa3e272
    • M
      Rollup merge of #62124 - matklad:without-with, r=petrochenkov · bc335d6c
      Mazdak Farrokhzad 提交于
      refactor lexer to use idiomatic borrowing
      bc335d6c
    • M
      Rollup merge of #62106 - cramertj:test-await, r=centril · e8f39862
      Mazdak Farrokhzad 提交于
      Add more tests for async/await
      
      I'll follow up with more of these, but here's an initial few.
      
      r? @Centril
      e8f39862
    • M
      Rollup merge of #62102 - RalfJung:read, r=Centril · 36b26e9b
      Mazdak Farrokhzad 提交于
      call out explicitly that general read needs to be called with an initialized buffer
      36b26e9b
    • M
      Rollup merge of #62076 - XAMPPRocky:master, r=XAMPPRocky · 1c7d311f
      Mazdak Farrokhzad 提交于
      Updated RELEASES.md for 1.36.0
      
      [Rendered](https://github.com/XAMPPRocky/rust/blob/master/RELEASES.md)
      
      r? @Mark-Simulacrum
      
      cc @rust-lang/release
      1c7d311f
    • M
      Rollup merge of #62067 - doctorn:await_diagnostic, r=matthewjasper · df97fc60
      Mazdak Farrokhzad 提交于
      Add suggestion for missing `.await` keyword
      
      This commit adds a suggestion diagnostic for missing `.await`. In order to do this, the trait `Future` is promoted to a lang item.
      
      Compiling code of the form:
      
      ```rust
      #![feature(async_await)]
      
      fn take_u32(x: u32) {}
      
      async fn make_u32() -> u32 {
          22
      }
      
      async fn foo() {
          let x = make_u32();
          take_u32(x)
      }
      
      fn main() {}
      ```
      
      Will now result in the suggestion:
      
      ```
      error[E0308]: mismatched types
        --> src/main.rs:11:18
         |
      11 |         take_u32(x)
         |                  ^
         |                  |
         |                  expected u32, found opaque type
         |                  help: consider using `.await` here: `x.await`
         |
         = note: expected type `u32`
                    found type `impl std::future::Future`
      ```
      
      This commit does not cover chained expressions and therefore only covers the case originally pointed out in #61076. Cases I can think of that still need to be covered:
      
      - [ ] Return places for functions
      - [ ] Field access
      - [ ] Method invocation
      
      I'm planning to submit PRs for each of these separately as and when I have figured them out.
      df97fc60
    • M
      Rollup merge of #62043 - Centril:remove-fnbox, r=cramertj · 2f6cf36b
      Mazdak Farrokhzad 提交于
      Remove `FnBox`
      
      Remove `FnBox` since we now have `Box<dyn FnOnce>`.
      
      Closes https://github.com/rust-lang/rust/issues/28796.
      
      r? @cramertj
      2f6cf36b
    • M
      Rollup merge of #61878 - RalfJung:pin, r=Dylan-DPC · 7ddfae74
      Mazdak Farrokhzad 提交于
      improve pinning projection docs
      
      This tries to improve the explanation of structural pinning and pinning projections based on [this URLO thread](https://users.rust-lang.org/t/when-is-it-safe-to-move-a-member-value-out-of-a-pinned-future/28182).
      
      Fixes https://github.com/rust-lang/rust/issues/61272.
      7ddfae74
  2. 27 6月, 2019 7 次提交
  3. 26 6月, 2019 21 次提交
    • N
      Don't ICE on item in `.await` expression · 5cb841d7
      Nathan Corbyn 提交于
      5cb841d7
    • I
      Fix clippy::precedence · ad62b420
      Igor Matuszewski 提交于
      ad62b420
    • I
      Fix clippy::print_with_newline · 1af1f627
      Igor Matuszewski 提交于
      1af1f627
    • I
      Fix clippy::redundant_closure · 33f58baf
      Igor Matuszewski 提交于
      33f58baf
    • I
      Fix clippy::cast_losless · 6c93b47c
      Igor Matuszewski 提交于
      6c93b47c
    • I
      Fix clippy::redundant_field_names · 12806b70
      Igor Matuszewski 提交于
      12806b70
    • M
      Rollup merge of #62145 - alexcrichton:sync-azure, r=pietroalbini · cd938883
      Mazdak Farrokhzad 提交于
      ci: Sync AppVeyor/Travis with Azure configuration
      
      Manually make sure that we do the same thing across all the services,
      uncovering one spot where we needed to pass one more configure flag on
      Azure but otherwise we're good to go!
      cd938883
    • M
      Rollup merge of #62143 - alexcrichton:toolstate, r=pietroalbini · 7acf4002
      Mazdak Farrokhzad 提交于
      ci: Publish toolstate changes from Azure
      
      This commit moves toolstate publishing from Travis to Azure. We've been
      testing on azure for some time now and this works by deleting the Travis
      config and updating the credentials used on Azure.
      7acf4002
    • M
      Rollup merge of #62142 - alexcrichton:azure-try, r=pietroalbini · c09cf0f5
      Mazdak Farrokhzad 提交于
      ci: Switch official `try` builds to happen on Azure
      
      This commit switches the `try` builers to officially happen on Azure
      Pipelines instead of Travis where they're currently run. This also cuts
      back the number of builders to just the two we run on Travis, leaving
      expansion as a possible future extension.
      c09cf0f5
    • M
      Rollup merge of #62141 - alexcrichton:less-assertions, r=pietroalbini · 00efd134
      Mazdak Farrokhzad 提交于
      ci: Disable assertions in PR builds
      
      The PR builder on Azure currently takes 2.5h which is a bit long, so
      this commit disables debug assertions and llvm assertions in an attempt
      to speed up that builder and have PR builds come back a bit more
      quickly. Other builders continue to enable debug assertions and test the
      compiler there.
      00efd134
    • M
      Rollup merge of #62140 - alexcrichton:less-pr-builds, r=pietroalbini · b863efbf
      Mazdak Farrokhzad 提交于
      ci: Turn off PR builds on Travis
      
      This commit turns off PR builds happening on Travis, instead entirely
      relying on Azure for PR builds to succeed.
      b863efbf
    • A
      ci: Sync AppVeyor/Travis with Azure configuration · db4f2367
      Alex Crichton 提交于
      Manually make sure that we do the same thing across all the services,
      uncovering one spot where we needed to pass one more configure flag on
      Azure but otherwise we're good to go!
      db4f2367
    • A
      ci: Publish toolstate changes from Azure · f78f3720
      Alex Crichton 提交于
      This commit moves toolstate publishing from Travis to Azure. We've been
      testing on azure for some time now and this works by deleting the Travis
      config and updating the credentials used on Azure.
      f78f3720
    • A
      ci: Switch official `try` builds to happen on Azure · f6adc394
      Alex Crichton 提交于
      This commit switches the `try` builers to officially happen on Azure
      Pipelines instead of Travis where they're currently run. This also cuts
      back the number of builders to just the two we run on Travis, leaving
      expansion as a possible future extension.
      f6adc394
    • A
      ci: Disable assertions in PR builds · 07efcf25
      Alex Crichton 提交于
      The PR builder on Azure currently takes 2.5h which is a bit long, so
      this commit disables debug assertions and llvm assertions in an attempt
      to speed up that builder and have PR builds come back a bit more
      quickly. Other builders continue to enable debug assertions and test the
      compiler there.
      07efcf25
    • A
      ci: Turn of PR builds on Travis · b5b4e59b
      Alex Crichton 提交于
      This commit turns off PR builds happening on Travis, instead entirely
      relying on Azure for PR builds to succeed.
      b5b4e59b
    • B
      Auto merge of #61872 - matthewjasper:refactor-mir-drop-gen, r=nikomatsakis · d3e2cec2
      bors 提交于
      Clean up MIR drop generation
      
      * Don't assign twice to the destination of a `while` loop containing a `break` expression
      * Use `as_temp` to evaluate statement expression
      * Avoid consecutive `StorageLive`s for the condition of a `while` loop
      * Unify `return`, `break` and `continue` handling, and move it to `scopes.rs`
      * Make some of the `scopes.rs` internals private
      * Don't use `Place`s that are always `Local`s in MIR drop generation
      
      Closes #42371
      Closes #61579
      Closes #61731
      Closes #61834
      Closes #61910
      Closes #62115
      d3e2cec2
    • L
      submodules: Update clippy from 8c80b65f to e3cb40e4 · 615347fb
      Lzu Tao 提交于
      615347fb
    • B
      Auto merge of #62072 - eddyb:generator-memory-index, r=tmandry · bdd4bda4
      bors 提交于
      rustc: correctly transform memory_index mappings for generators.
      
      Fixes #61793, closes #62011 (previous attempt at fixing #61793).
      
      During #60187, I made the mistake of suggesting that the (re-)computation of `memory_index` in `ty::layout`, after generator-specific logic split/recombined fields, be done off of the `offsets` of those fields (which needed to be computed anyway), as opposed to the `memory_index`.
      
      `memory_index` maps each field to its in-memory order index, which ranges over the same `0..n` values as the fields themselves, making it a bijective mapping, and more specifically a permutation (indeed, it's the permutation resulting from field reordering optimizations).
      
      Each field has an unique "memory index", meaning a sort based on them, even an unstable one, will not put them in the wrong order. But offsets don't have that property, because of ZSTs (which do not increase the offset), so sorting based on the offset of fields alone can (and did) result in wrong orders.
      
      Instead of going back to sorting based on (slices/subsets of) `memory_index`, or special-casing ZSTs to make sorting based on offsets produce the right results (presumably), as #62011 does, I opted to drop sorting altogether and focus on `O(n)` operations involving *permutations*:
      * a permutation is easily inverted (see the `invert_mapping` `fn`)
        * an `inverse_memory_index` was already employed in other parts of the `ty::layout` code (that is, a mapping from memory order to field indices)
        * inverting twice produces the original permutation, so you can invert, modify, and invert again, if it's easier to modify the inverse mapping than the direct one
      * you can modify/remove elements in a permutation, as long as the result remains dense (i.e. using every integer in `0..len`, without gaps)
        * for splitting a `0..n` permutation into disjoint `0..x` and `x..n` ranges, you can pick the elements based on a `i < x` / `i >= x` predicate, and for the latter, also subtract `x` to compact the range to `0..n-x`
        * in the general case, for taking an arbitrary subset of the permutation, you need a renumbering from that subset to a dense `0..subset.len()` - but notably, this is still `O(n)`!
      * you can merge permutations, as long as the result remains disjoint (i.e. each element is unique)
        * for concatenating two `0..n` and `0..m` permutations, you can renumber the elements in the latter to `n..n+m`
      * some of these operations can be combined, and an inverse mapping (be it a permutation or not) can still be used instead of a forward one by changing the "domain" of the loop performing the operation
      
      I wish I had a nicer / more mathematical description of the recombinations involved, but my focus was to fix the bug (in a way which preserves information more directly than sorting would), so I may have missed potential changes in the surrounding generator layout code, that would make this all more straight-forward.
      
      r? @tmandry
      bdd4bda4
    • M
      31314277
    • M
      Add StorageDead statements for `while` conditions · b86e6755
      Matthew Jasper 提交于
      b86e6755