Update rustfmt submodule
The version of rustfmt currently shipped with nightly breaks code that uses `break 'label`. This PR updates the submodule to include the fix (https://github.com/rust-lang-nursery/rustfmt/pull/2774).
Option::get_or_insert(_with): Replace unreachable! with unreachable_unchecked
Optimize codegen for both functions as the None branch is trivially not reachable.
Rename hir::ExprAgain to hir::ExprContinue
The current name is confusing and historical.
I also used this PR to clean up the annoying indentation in `check/mod.rs`. If that's viewed as too tangential a change, I'll split it up, but it seemed reasonable to slip it in to reduce @bors's work. It's easy to compare for the two commits individually.
r? @petrochenkov
async/await
This PR implements `async`/`await` syntax for `async fn` in Rust 2015 and `async` closures and `async` blocks in Rust 2018 (tracking issue: https://github.com/rust-lang/rust/issues/50547). Limitations: non-`move` async closures with arguments are currently not supported, nor are `async fn` with multiple different input lifetimes. These limitations are not fundamental and will be removed in the future, however I'd like to go ahead and get this PR merged so we can start experimenting with this in combination with futures 0.3.
Based on https://github.com/rust-lang/rust/pull/51414.
cc @petrochenkov for parsing changes.
r? @eddyb
Add label to lint for lifetimes used once
```
error: lifetime parameter `'a` only used once
--> $DIR/fn-types.rs:19:10
|
LL | a: for<'a> fn(&'a u32), //~ ERROR `'a` only used once
| ^^ -- ...is used only here
| |
| this lifetime...
```
Support future deprecation for rustc_deprecated
Follow-up to #49179 to allow `since` parameters to be set to future versions of Rust and correspondingly to not be treated as deprecated until that version. This is required for #30459 to be completed (though we'll need to wait until this hits beta).
Rollup of 6 pull requests
Successful merges:
- #51158 (Mention spec and indented blocks in doctest docs)
- #51629 (Do not consume semicolon twice while parsing local statement)
- #51637 (Update zx_cprng_draw_new on Fuchsia)
- #51664 (make more libsyntax methods public)
- #51666 (Disable probestack when GCOV profiling is being used)
- #51703 (Recognize the extra "LLVM tools versions" argument to build-manifest.)
Failed merges:
r? @ghost
Disable probestack when GCOV profiling is being used
If I compile Firefox with gcov profiling enabled, Firefox crashes at startup because of probestack.
Since it's disabled for PGO, I think it makes sense to disable it for gcov too.
make more libsyntax methods public
Followup for #51502, which was sufficient only for the latest stable release of Rocket. The `master` branch uses a few more. I plan to reimplement the deleted method `parse_seq` in Rocket (see SergioBenitez/Rocket#666), rather than resurrecting it in libsyntax.
r? @Mark-Simulacrum
Update zx_cprng_draw_new on Fuchsia
Fuchsia is changing the semantics for zx_cprng_draw and
zx_cprng_draw_new is a temporary name for the new semantics.
Do not consume semicolon twice while parsing local statement
The span for a `let` statement includes multiple semicolons. For example,
```rust
let x = 2;;;
// ^^^^^^^^^^^ The span for the above statement.
```
This PR fixes it.
cc https://github.com/rust-lang-nursery/rustfmt/issues/2791.
Mention spec and indented blocks in doctest docs
Fixes#49717.
This commit adds a new section to the Documentation Test docs, which briefly mentions indented code blocks, and links to the CommonMark specification for both.
I’m not sure about saying "fenced code blocks the more popular choice in the Rust community” because it seems like I’m speaking for everyone, but I can’t think of a better way to phrase it!
NLL: Walk the MIR only once for the "unused mut" lint
Turns the quadratic loop gathering local variable assignments into a single MIR walk, and brings down the number of `super_mir` calls generated from `do_mir_borrowck` to the expected levels seen in `nll::replace_regions_in_mir` and `nll::compute_regions`, i.e. on clap: 1883 `super_mir` calls instead of 8011.
The limited perf numbers I could gather on my machines look to be what we expected: `clap-check` seems to be gaining back a lot of the 7% we previously saw in `visit_mir`.
Fixes#51641.
r? @nikomatsakis
yet another "old borrowck" bug around match default bindings
We were getting the type of the parameter from its pattern, but that didn't include adjustments. I did a `ripgrep` around and this seemed to be the only affected case.
The reason this didn't show up as an ICE earlier is that mem-categorization is lenient with respect to weird discrepancies. I am going to add more delay-span-bug calls shortly around that (I'll push onto the PR).
This example is an ICE, but I presume that there is a way to make a soundness example out of this -- it basically ignores borrows occuring inside match-default-bindings in a closure, though only if the implicit deref is at the top-level. It happens though that this occurs frequently in iterators, which often give a `&T` parameter.
Fixes#51415Fixes#49534
r? @eddyb