]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAuto merge of #49469 - Nokel81:allow-irrefutable-let-patterns, r=nikomatsakis
bors [Tue, 26 Jun 2018 09:20:33 +0000 (09:20 +0000)]
Auto merge of #49469 - Nokel81:allow-irrefutable-let-patterns, r=nikomatsakis

Implementation of RFC 2086 - Allow Irrefutable Let patterns

This is the set of changes for RFC2086. Tracking issue #44495. Rendered [here](https://github.com/rust-lang/rfcs/pull/2086)

6 years agoAuto merge of #51613 - nnethercote:ob-forest-cleanup, r=nikomatsakis
bors [Tue, 26 Jun 2018 07:06:18 +0000 (07:06 +0000)]
Auto merge of #51613 - nnethercote:ob-forest-cleanup, r=nikomatsakis

Obligation forest cleanup

While looking at this code I was scratching my head about whether a node could appear in both `parent` and `dependents`. Turns out it can, but it's not useful to do so, so this PR cleans things up so it's no longer possible.

6 years agoAuto merge of #50630 - sharkdp:fix-50619, r=sfackler
bors [Tue, 26 Jun 2018 03:49:37 +0000 (03:49 +0000)]
Auto merge of #50630 - sharkdp:fix-50619, r=sfackler

Fix possibly endless loop in ReadDir iterator

Certain directories in `/proc` can cause the `ReadDir` iterator to loop indefinitely. We get an error code (22) when calling libc's `readdir_r` on these directories, but `entry_ptr` is `NULL` at the same time, signalling the end of the directory stream.

This change introduces an internal state to the iterator such that the `Some(Err(..))` value will only be returned once when calling `next`. Subsequent calls will return `None`.

fixes #50619

6 years agoAuto merge of #50966 - leodasvacas:self-in-where-clauses-is-not-object-safe, r=nikoma...
bors [Tue, 26 Jun 2018 01:42:14 +0000 (01:42 +0000)]
Auto merge of #50966 - leodasvacas:self-in-where-clauses-is-not-object-safe, r=nikomatsakis

`Self` in where clauses may not be object safe

Needs crater, virtually certain to cause regressions.

In #50781 it was discovered that our object safety rules are not sound because we allow `Self` in where clauses without restrain. This PR is a direct fix to the rules so that we disallow methods with unsound where clauses.

This currently uses hard error to measure impact, but we will want to downgrade it to a future compat error.

Part of #50781.

r? @nikomatsakis

6 years agomake the `while let` loop terminate
Niko Matsakis [Mon, 25 Jun 2018 21:33:49 +0000 (17:33 -0400)]
make the `while let` loop terminate

6 years agoAuto merge of #51785 - cuviper:fstatat64, r=Mark-Simulacrum
bors [Mon, 25 Jun 2018 19:40:56 +0000 (19:40 +0000)]
Auto merge of #51785 - cuviper:fstatat64, r=Mark-Simulacrum

Use fstatat64 where available

None

6 years agoUse fstatat64 where available
Josh Stone [Mon, 25 Jun 2018 18:42:27 +0000 (11:42 -0700)]
Use fstatat64 where available

6 years agoAuto merge of #51728 - bradjc:llvm-tools2, r=kennytm
bors [Mon, 25 Jun 2018 17:22:12 +0000 (17:22 +0000)]
Auto merge of #51728 - bradjc:llvm-tools2, r=kennytm

build: add llvm-tools to manifest

This commit expands on a previous commit to build llvm-tools as a rustup component. It causes the llvm-tools component to be built if the extended step is active. It also adds llvm-tools to the build manifest so rustup can find it.

I tested this as far as I could, but had to hack `build-manifest/src/main.rs` a bit as it is not supported on MacOS. The main change I am not sure about is this line:

```rust
self.package("llvm-tools", &mut manifest.pkg, TARGETS);
```

There are numerous calls to `self.package()`, and I'm not sure if `TARGETS`, `HOSTS`, or `["*"]` is appropriate for llvm-tools.

Otherwise I mostly copied the example set by `rustfmt-preview`.

6 years agoAuto merge of #51750 - zackmdavis:superstructure, r=oli-obk
bors [Mon, 25 Jun 2018 13:43:22 +0000 (13:43 +0000)]
Auto merge of #51750 - zackmdavis:superstructure, r=oli-obk

three diagnostics upgrades

 * reword `...` expression syntax error to not imply that you should use it in patterns either (#51043) and make it a structured suggestion
 * shorten the top-line message for the trivial-casts lint by tucking the advisory sentence into a help note
 * structured suggestion for pattern-named-the-same-as-variant warning

r? @oli-obk

6 years agoAuto merge of #51733 - varkor:ice-match-slice, r=oli-obk
bors [Mon, 25 Jun 2018 11:36:13 +0000 (11:36 +0000)]
Auto merge of #51733 - varkor:ice-match-slice, r=oli-obk

Fix an ICE when matching over const slices

Fixes #51655. I'm not super familiar with this code, so tell me if this is the wrong approach šŸ˜…

r? @oli-obk

6 years agoFill in tracking issue for WHERE_CLAUSES_OBJECT_SAFETY future compat lint
leonardo.yvens [Fri, 8 Jun 2018 21:26:37 +0000 (18:26 -0300)]
Fill in tracking issue for WHERE_CLAUSES_OBJECT_SAFETY future compat lint

6 years agoMake where clause object safety be a warn-by-default lint
leonardo.yvens [Wed, 30 May 2018 12:06:08 +0000 (09:06 -0300)]
Make where clause object safety be a warn-by-default lint

6 years ago`Self` in where clauses may not be object safe
leonardo.yvens [Tue, 22 May 2018 15:09:35 +0000 (12:09 -0300)]
`Self` in where clauses may not be object safe

This is virtually certain to cause regressions, needs crater.

In #50781 it was discovered that our object safety rules are not sound because we allow `Self` in where clauses without restrain. This PR is a direct fix to the rules so that we disallow methods with unsound where clauses.

This currently uses hard error to measure impact, but we will want to downgrade it to a future compat error.

Fixes #50781.

r? @nikomatsakis

6 years agoAuto merge of #51335 - mark-i-m:allocator, r=oli-obk
bors [Mon, 25 Jun 2018 08:54:16 +0000 (08:54 +0000)]
Auto merge of #51335 - mark-i-m:allocator, r=oli-obk

Prohibit `global_allocator` in submodules

Background: #44113 is caused by weird interactions with hygiene. Hygiene is hard. After a lot of playing around, we decided that the best path forward would be to prohibit `global_allocator`s from being in submodules for now. When somebody gets it working, we can re-enable it.

This PR contains the following
- Some hygiene "fixes" -- things I suspect are the correct thing to do that will make life easier in the future. This includes using call_site hygiene for the generated module and passing the correct crate name to the expansion config.
- Comments and minor formatting fixes
- Some debugging code
- Code to prohibit `global_allocator` in submodules
- Test checking that the proper error occurs.

cc #44113 #49320 #51241

r? @alexcrichton

6 years agoAuto merge of #51688 - spastorino:error-note-field-after-move, r=nikomatsakis
bors [Mon, 25 Jun 2018 06:44:08 +0000 (06:44 +0000)]
Auto merge of #51688 - spastorino:error-note-field-after-move, r=nikomatsakis

Fix erroneous error note when using field after move

Closes #51512

r? @nikomatsakis

6 years agoused debug, not info
mark [Sat, 23 Jun 2018 00:59:29 +0000 (19:59 -0500)]
used debug, not info

6 years agoactually fix test
mark [Tue, 19 Jun 2018 02:59:32 +0000 (21:59 -0500)]
actually fix test

6 years agofix test
mark [Tue, 19 Jun 2018 02:11:59 +0000 (21:11 -0500)]
fix test

6 years agoenable fold_mac
Mark Mansi [Wed, 6 Jun 2018 00:24:10 +0000 (19:24 -0500)]
enable fold_mac

6 years agoProhibit global_allocator in submodules for now
Mark Mansi [Sun, 20 May 2018 22:04:00 +0000 (17:04 -0500)]
Prohibit global_allocator in submodules for now

- we need to figure out hygiene first
- change the test to check that the prohibition works with a good error
  msg
- leaves some comments and debugging code
- leaves some of our supposed fixes

6 years agoAttempt to fix hygiene for global_allocator
Mark Mansi [Fri, 13 Apr 2018 20:58:16 +0000 (15:58 -0500)]
Attempt to fix hygiene for global_allocator

6 years agoAuto merge of #51740 - GuillaumeGomez:fix-error-code-numbers, r=cramertj
bors [Sun, 24 Jun 2018 15:08:48 +0000 (15:08 +0000)]
Auto merge of #51740 - GuillaumeGomez:fix-error-code-numbers, r=cramertj

Fix error code numbers

Fixes issue created by #51580.

r? @cramertj

6 years agoin which the trivial-casts word to the wise is tucked into a help note
Zack M. Davis [Sat, 23 Jun 2018 23:57:23 +0000 (16:57 -0700)]
in which the trivial-casts word to the wise is tucked into a help note

The top level message shouldn't be too long; the
replaced-by-coercion/temporary-variable advice can live in a note. Also,
don't mention type ascription when it's not actually available as a real
thing. (The current state of discussion on the type ascription tracking
issue #23416 makes one rather suspect it will never be a stable thing in
its current form, but that's not for us to adjudicate in this commit.)

While we're here, yank out the differentiating parts of the
numeric/other conditional and only have one codepath emitting the
diagnostic.

6 years agostructured suggestion and rewording for `...` expression syntax error
Zack M. Davis [Sat, 23 Jun 2018 23:49:09 +0000 (16:49 -0700)]
structured suggestion and rewording for `...` expression syntax error

Now that `..=` inclusive ranges are stabilized, people probably
shouldn't be using `...` even in patterns, even if it's still legal
there (see #51043). To avoid drawing attention to `...` being a real
thing, let's reword this message to just say "unexpected token" rather
"cannot be used in expressions".

6 years agouse structured suggestion for pattern-named-the-same-as-variant warning
Zack M. Davis [Sat, 23 Jun 2018 23:46:41 +0000 (16:46 -0700)]
use structured suggestion for pattern-named-the-same-as-variant warning

6 years agoAuto merge of #51726 - petrochenkov:hygclean, r=oli-obk
bors [Sun, 24 Jun 2018 01:06:21 +0000 (01:06 +0000)]
Auto merge of #51726 - petrochenkov:hygclean, r=oli-obk

expansion/hygiene: Some renaming, refactoring and comments

Pure refactoring, no functional changes.
Commits are isolated and self-descriptive.

6 years agoAuto merge of #51739 - Amanieu:update_rustfmt, r=Mark-Simulacrum
bors [Sat, 23 Jun 2018 22:27:30 +0000 (22:27 +0000)]
Auto merge of #51739 - Amanieu:update_rustfmt, r=Mark-Simulacrum

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).

6 years agobuild: llvm-tools: replace compiler.host
Brad Campbell [Sat, 23 Jun 2018 21:32:25 +0000 (17:32 -0400)]
build: llvm-tools: replace compiler.host

Use `target` instead.

6 years agoAuto merge of #51653 - mglagla:option-unreachable, r=dtolnay
bors [Sat, 23 Jun 2018 20:10:35 +0000 (20:10 +0000)]
Auto merge of #51653 - mglagla:option-unreachable, r=dtolnay

Option::get_or_insert(_with): Replace unreachable! with unreachable_unchecked

Optimize codegen for both functions as the None branch is trivially not reachable.

6 years agoFix error code numbers
Guillaume Gomez [Sat, 23 Jun 2018 18:14:04 +0000 (20:14 +0200)]
Fix error code numbers

6 years agohygiene: Merge `NameAndSpan` into `ExpnInfo`
Vadim Petrochenkov [Sat, 23 Jun 2018 18:41:39 +0000 (21:41 +0300)]
hygiene: Merge `NameAndSpan` into `ExpnInfo`

6 years agoUpdate Cargo.lock
Amanieu d'Antras [Sat, 23 Jun 2018 18:15:34 +0000 (19:15 +0100)]
Update Cargo.lock

6 years agoUpdate rustfmt submodule
Amanieu d'Antras [Sat, 23 Jun 2018 17:54:42 +0000 (18:54 +0100)]
Update rustfmt submodule

6 years agohygiene: Make sure transparency of `Mark::root()` is an implementation detail and...
Vadim Petrochenkov [Sat, 23 Jun 2018 17:42:25 +0000 (20:42 +0300)]
hygiene: Make sure transparency of `Mark::root()` is an implementation detail and cannot be inspected outside of `hygiene.rs`

6 years agohygiene: Do not reset expansion info for `quote!`
Vadim Petrochenkov [Sat, 23 Jun 2018 17:09:11 +0000 (20:09 +0300)]
hygiene: Do not reset expansion info for `quote!`

6 years agohygiene: More descriptive names for things involved in late hygienic name resolution
Vadim Petrochenkov [Sat, 23 Jun 2018 16:27:28 +0000 (19:27 +0300)]
hygiene: More descriptive names for things involved in late hygienic name resolution

6 years agoexpansion: Add some comments
Vadim Petrochenkov [Sat, 23 Jun 2018 16:27:01 +0000 (19:27 +0300)]
expansion: Add some comments

6 years agoexpansion: Improve searchability for `AstFragments` methods
Vadim Petrochenkov [Fri, 22 Jun 2018 22:05:07 +0000 (01:05 +0300)]
expansion: Improve searchability for `AstFragments` methods

6 years agoexpansion: Rename `Expansion` to `AstFragment`
Vadim Petrochenkov [Tue, 19 Jun 2018 23:08:08 +0000 (02:08 +0300)]
expansion: Rename `Expansion` to `AstFragment`

6 years agohygiene: Rename `MarkKind` to `Transparency`
Vadim Petrochenkov [Tue, 19 Jun 2018 21:54:17 +0000 (00:54 +0300)]
hygiene: Rename `MarkKind` to `Transparency`

Move `is_builtin` for `Mark` to a separate flag

6 years agohygiene: Make sure expansion info is set at most once for a given `Mark`
Vadim Petrochenkov [Tue, 19 Jun 2018 21:13:11 +0000 (00:13 +0300)]
hygiene: Make sure expansion info is set at most once for a given `Mark`

6 years agoexpansion: Remove unnecessary override from `impl Folder for Marker`
Vadim Petrochenkov [Tue, 19 Jun 2018 21:09:56 +0000 (00:09 +0300)]
expansion: Remove unnecessary override from `impl Folder for Marker`

6 years agohygiene: Give `Debug` impls to hygiene structures
Vadim Petrochenkov [Tue, 19 Jun 2018 21:08:14 +0000 (00:08 +0300)]
hygiene: Give `Debug` impls to hygiene structures

6 years agobuild: llvm_tools tidy
Brad Campbell [Sat, 23 Jun 2018 16:34:18 +0000 (12:34 -0400)]
build: llvm_tools tidy

6 years agoAuto merge of #51727 - varkor:expragain-to-exprcontinue, r=petrochenkov
bors [Sat, 23 Jun 2018 14:33:10 +0000 (14:33 +0000)]
Auto merge of #51727 - varkor:expragain-to-exprcontinue, r=petrochenkov

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

6 years agoFix an ICE when matching over const slices
varkor [Sat, 23 Jun 2018 13:41:01 +0000 (14:41 +0100)]
Fix an ICE when matching over const slices

6 years agoAuto merge of #51723 - estebank:abolish-ice, r=oli-obk
bors [Sat, 23 Jun 2018 11:00:43 +0000 (11:00 +0000)]
Auto merge of #51723 - estebank:abolish-ice, r=oli-obk

Accept `TyError` in `analyze_closure` to avoid ICE

Fix #51714.

6 years agoReindent check/mod.rs
varkor [Sat, 23 Jun 2018 10:00:02 +0000 (11:00 +0100)]
Reindent check/mod.rs

6 years agobuild: add llvm-tools to manifest
Brad Campbell [Sat, 23 Jun 2018 09:49:02 +0000 (05:49 -0400)]
build: add llvm-tools to manifest

This commit expands on a previous commit to build llvm-tools as a rustup
component. It causes the llvm-tools component to be built if the
extended step is active. It also adds llvm-tools to the build manifest
so rustup can find it.

6 years agoRename ExprAgain to ExprContinue
varkor [Sat, 23 Jun 2018 09:51:01 +0000 (10:51 +0100)]
Rename ExprAgain to ExprContinue

6 years agoAuto merge of #51580 - cramertj:async-await, r=eddyb
bors [Sat, 23 Jun 2018 09:02:45 +0000 (09:02 +0000)]
Auto merge of #51580 - cramertj:async-await, r=eddyb

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

6 years agoAuto merge of #51696 - estebank:fuzzy-ice-ice, r=oli-obk
bors [Sat, 23 Jun 2018 06:56:12 +0000 (06:56 +0000)]
Auto merge of #51696 - estebank:fuzzy-ice-ice, r=oli-obk

Accept `TyError` in patterns to avoid ICE on bad input

Fix #50585.

6 years agoAuto merge of #51724 - tikue:master, r=Mark-Simulacrum
bors [Sat, 23 Jun 2018 04:19:51 +0000 (04:19 +0000)]
Auto merge of #51724 - tikue:master, r=Mark-Simulacrum

Re-pub some items whose visibilities were recently reduced.

Reasons described in the most recent comments of https://github.com/rust-lang/rust/pull/51265.

tarpc can't move off of plugins until proc macros can be reexported from other crates.

Fixes https://github.com/google/tarpc/issues/191

6 years agoUpdate libsyntax test
Taylor Cramer [Sat, 23 Jun 2018 02:50:56 +0000 (19:50 -0700)]
Update libsyntax test

6 years agoAuto merge of #51712 - SLaabsDev:master, r=Mark-Simulacrum
bors [Sat, 23 Jun 2018 02:21:04 +0000 (02:21 +0000)]
Auto merge of #51712 - SLaabsDev:master, r=Mark-Simulacrum

Add support for current directory prefixes (#51071)

Fixes #51071

6 years agoFix rustdoc and remove default impl for FnHeader
Taylor Cramer [Sat, 23 Jun 2018 00:27:58 +0000 (17:27 -0700)]
Fix rustdoc and remove default impl for FnHeader

6 years agoAuto merge of #51697 - estebank:once-used-lifetime-label, r=oli-obk
bors [Sat, 23 Jun 2018 00:06:54 +0000 (00:06 +0000)]
Auto merge of #51697 - estebank:once-used-lifetime-label, r=oli-obk

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...
```

6 years agoRe-reexport some items that were recently made crate-private.
Tim Kuehn [Fri, 22 Jun 2018 23:23:25 +0000 (16:23 -0700)]
Re-reexport some items that were recently made crate-private.

6 years agoRemove impl trait names and move bits of await into a function
Taylor Cramer [Fri, 22 Jun 2018 23:08:07 +0000 (16:08 -0700)]
Remove impl trait names and move bits of await into a function

6 years agoAccept `TyError` in `analyze_closure` to avoid ICE
Esteban KĆ¼ber [Fri, 22 Jun 2018 22:35:52 +0000 (15:35 -0700)]
Accept `TyError` in `analyze_closure` to avoid ICE

6 years agoAuto merge of #51482 - GuillaumeGomez:table-display, r=QuietMisdreavus
bors [Fri, 22 Jun 2018 22:02:10 +0000 (22:02 +0000)]
Auto merge of #51482 - GuillaumeGomez:table-display, r=QuietMisdreavus

Greatly improve tables display in docs

Fixes #51454.

r? @QuietMisdreavus

Before:

<img width="1440" alt="screen shot 2018-06-10 at 22 43 52" src="https://user-images.githubusercontent.com/3050060/41206138-cc61b2b4-6cff-11e8-9b6f-0b1e435d4b1b.png">

After:

<img width="1440" alt="screen shot 2018-06-10 at 23 33 16" src="https://user-images.githubusercontent.com/3050060/41207049-d455c03c-6d0e-11e8-968f-d4fccaeb4265.png">

6 years agoRun rustfmt
Santiago Pastorino [Fri, 22 Jun 2018 03:10:52 +0000 (00:10 -0300)]
Run rustfmt

6 years agoFix erroneous error note when using field after move
Santiago Pastorino [Thu, 21 Jun 2018 02:51:18 +0000 (23:51 -0300)]
Fix erroneous error note when using field after move

6 years agoAuto merge of #51681 - varkor:rustc_deprecated-future-deprecation, r=petrochenkov
bors [Fri, 22 Jun 2018 19:55:30 +0000 (19:55 +0000)]
Auto merge of #51681 - varkor:rustc_deprecated-future-deprecation, r=petrochenkov

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).

6 years agoRemove unused map_slice
Taylor Cramer [Fri, 22 Jun 2018 19:12:53 +0000 (12:12 -0700)]
Remove unused map_slice

6 years agoReview nits and updates
Taylor Cramer [Fri, 22 Jun 2018 18:36:01 +0000 (11:36 -0700)]
Review nits and updates

Move future_from_generator out of raw
Update await to use $crate
Renumber errors

6 years agoAuto merge of #51670 - estebank:issue-51634, r=oli-obk
bors [Fri, 22 Jun 2018 17:51:02 +0000 (17:51 +0000)]
Auto merge of #51670 - estebank:issue-51634, r=oli-obk

Don't suggest incorrect syntax

Fix #51634.

6 years agoAuto merge of #51704 - kennytm:rollup, r=kennytm
bors [Fri, 22 Jun 2018 15:26:52 +0000 (15:26 +0000)]
Auto merge of #51704 - kennytm:rollup, r=kennytm

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

6 years agoHandle current directory prefix for parsing command arguments in bootstrap test command.
Steven Laabs [Fri, 22 Jun 2018 04:57:06 +0000 (23:57 -0500)]
Handle current directory prefix for parsing command arguments in bootstrap test command.

6 years agoAdded stripping current directory prefixes when comparing suite path names
Steven Laabs [Thu, 21 Jun 2018 22:48:24 +0000 (17:48 -0500)]
Added stripping current directory prefixes when comparing suite path names

6 years agoAuto merge of #51184 - lambtowolf:master, r=nikomatsakis
bors [Fri, 22 Jun 2018 11:10:20 +0000 (11:10 +0000)]
Auto merge of #51184 - lambtowolf:master, r=nikomatsakis

Issue #50974 : Suboptimal error in case of duplicate `,` in struct constructor

Fixes #50974

6 years agoadd an explanatory comment for recovery behavior
Niko Matsakis [Tue, 5 Jun 2018 17:04:15 +0000 (13:04 -0400)]
add an explanatory comment for recovery behavior

6 years agoIssue #50974: Fix compilation error and test
Lamb [Wed, 30 May 2018 11:06:05 +0000 (13:06 +0200)]
Issue #50974: Fix compilation error and test

6 years agoFix when the help message is displayed
Maerten [Wed, 30 May 2018 07:16:18 +0000 (09:16 +0200)]
Fix when the help message is displayed

Only display the "remove this comma" suggestion when followed by an identifier

6 years agoIssue #50974: Adding issue number in the test
Lamb [Tue, 29 May 2018 19:44:55 +0000 (21:44 +0200)]
Issue #50974: Adding issue number in the test

6 years agoIssue #50974: Adding tests
Lamb [Tue, 29 May 2018 18:15:59 +0000 (20:15 +0200)]
Issue #50974: Adding tests

6 years agoIssue #50974: Change text of suggestion to be more direct
Lamb [Tue, 29 May 2018 18:15:47 +0000 (20:15 +0200)]
Issue #50974: Change text of suggestion to be more direct

6 years agoIssue #50974: Suboptimal error in case of duplicate `,` in struct constructor
Lamb [Tue, 29 May 2018 11:19:58 +0000 (13:19 +0200)]
Issue #50974: Suboptimal error in case of duplicate `,` in struct constructor

6 years agoRollup merge of #51703 - kennytm:fix-51699, r=nrc
kennytm [Fri, 22 Jun 2018 08:50:45 +0000 (16:50 +0800)]
Rollup merge of #51703 - kennytm:fix-51699, r=nrc

Recognize the extra "LLVM tools versions" argument to build-manifest.

Fix #51699.

6 years agoRollup merge of #51666 - marco-c:disable_probestack, r=nagisa
kennytm [Fri, 22 Jun 2018 08:50:44 +0000 (16:50 +0800)]
Rollup merge of #51666 - marco-c:disable_probestack, r=nagisa

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.

6 years agoRollup merge of #51664 - jebrosen:pub_parse_methods2, r=Mark-Simulacrum
kennytm [Fri, 22 Jun 2018 08:50:43 +0000 (16:50 +0800)]
Rollup merge of #51664 - jebrosen:pub_parse_methods2, r=Mark-Simulacrum

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

6 years agoRollup merge of #51637 - abarth:new_prng, r=cramertj
kennytm [Fri, 22 Jun 2018 08:50:42 +0000 (16:50 +0800)]
Rollup merge of #51637 - abarth:new_prng, r=cramertj

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.

6 years agoRollup merge of #51629 - topecongiro:multiple-semicolon-in-local-span, r=petrochenkov
kennytm [Fri, 22 Jun 2018 08:50:41 +0000 (16:50 +0800)]
Rollup merge of #51629 - topecongiro:multiple-semicolon-in-local-span, r=petrochenkov

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.

6 years agoRollup merge of #51158 - ogham:patch-1, r=steveklabnik
kennytm [Fri, 22 Jun 2018 08:50:39 +0000 (16:50 +0800)]
Rollup merge of #51158 - ogham:patch-1, r=steveklabnik

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!

6 years agoAuto merge of #51660 - lqd:the-MIRnistry-of-walks, r=nikomatsakis
bors [Fri, 22 Jun 2018 08:34:26 +0000 (08:34 +0000)]
Auto merge of #51660 - lqd:the-MIRnistry-of-walks, r=nikomatsakis

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

6 years agoRecognize the extra "LLVM tools versions" argument to build-manifest.
kennytm [Fri, 22 Jun 2018 08:22:01 +0000 (16:22 +0800)]
Recognize the extra "LLVM tools versions" argument to build-manifest.

Fix #51699.

6 years agoAuto merge of #51686 - nikomatsakis:issue-51415-borrowck-match-default-bindings-bug...
bors [Fri, 22 Jun 2018 06:36:11 +0000 (06:36 +0000)]
Auto merge of #51686 - nikomatsakis:issue-51415-borrowck-match-default-bindings-bug, r=eddyb

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 #51415
Fixes #49534

r? @eddyb

6 years agoPathParameters -> GenericArgs fixes
Taylor Cramer [Fri, 22 Jun 2018 06:24:51 +0000 (23:24 -0700)]
PathParameters -> GenericArgs fixes

6 years agoAdd path parameters to std_path
Taylor Cramer [Fri, 22 Jun 2018 05:24:24 +0000 (22:24 -0700)]
Add path parameters to std_path

6 years agoFix test using ExprKind::Closure
Taylor Cramer [Wed, 20 Jun 2018 02:12:41 +0000 (19:12 -0700)]
Fix test using ExprKind::Closure

6 years agoTruncate errors to make tidy happy
Taylor Cramer [Tue, 19 Jun 2018 22:58:10 +0000 (15:58 -0700)]
Truncate errors to make tidy happy

6 years agoFix parse-fail tests that now mention async
Taylor Cramer [Tue, 19 Jun 2018 22:07:52 +0000 (15:07 -0700)]
Fix parse-fail tests that now mention async

6 years agoMove async edition check to the current span
Taylor Cramer [Tue, 19 Jun 2018 20:58:32 +0000 (13:58 -0700)]
Move async edition check to the current span

6 years agoAllow unsafe code inside of await macro
Taylor Cramer [Tue, 19 Jun 2018 17:36:16 +0000 (10:36 -0700)]
Allow unsafe code inside of await macro

6 years agoExplicitly ban async in trait impls
Taylor Cramer [Tue, 19 Jun 2018 17:35:05 +0000 (10:35 -0700)]
Explicitly ban async in trait impls

This wouldn't compile before because the return type wouldn't match,
but now it's properly an error.

6 years agoAsync methods
Taylor Cramer [Tue, 19 Jun 2018 04:18:10 +0000 (21:18 -0700)]
Async methods

6 years agoFix typo in multiple lifetimes error
Taylor Cramer [Mon, 18 Jun 2018 23:57:14 +0000 (16:57 -0700)]
Fix typo in multiple lifetimes error

6 years agoParse `unsafe async fn` instead of `async unsafe fn`
Taylor Cramer [Mon, 18 Jun 2018 23:49:34 +0000 (16:49 -0700)]
Parse `unsafe async fn` instead of `async unsafe fn`

6 years agoasync await desugaring and tests
Taylor Cramer [Wed, 6 Jun 2018 22:50:59 +0000 (15:50 -0700)]
async await desugaring and tests

6 years agoDisplay async fn in rustdoc.
Without Boats [Thu, 17 May 2018 21:47:52 +0000 (14:47 -0700)]
Display async fn in rustdoc.