]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agocode review fixes
Saleem Jaffer [Thu, 1 Aug 2019 06:43:49 +0000 (12:13 +0530)]
code review fixes

4 years agocode review fixes
Saleem Jaffer [Thu, 1 Aug 2019 04:19:01 +0000 (09:49 +0530)]
code review fixes

4 years agocode review fixes
Saleem Jaffer [Wed, 31 Jul 2019 12:44:49 +0000 (18:14 +0530)]
code review fixes

4 years agocode review fixes
Saleem Jaffer [Wed, 31 Jul 2019 11:08:39 +0000 (16:38 +0530)]
code review fixes

4 years agocode review fixes
Saleem Jaffer [Wed, 31 Jul 2019 07:18:54 +0000 (12:48 +0530)]
code review fixes

4 years agothrow_X macros use err_X macros
Saleem Jaffer [Tue, 30 Jul 2019 15:06:17 +0000 (20:36 +0530)]
throw_X macros use err_X macros

4 years agorenaming throw_err_* to throw_*
Saleem Jaffer [Tue, 30 Jul 2019 14:48:50 +0000 (20:18 +0530)]
renaming throw_err_* to throw_*

4 years agorenaming err to err_unsup
Saleem Jaffer [Tue, 30 Jul 2019 10:38:32 +0000 (16:08 +0530)]
renaming err to err_unsup

4 years agotidy fixes
Saleem Jaffer [Tue, 30 Jul 2019 10:16:02 +0000 (15:46 +0530)]
tidy fixes

4 years agoadding throw_ and err_ macros for InterpError
Saleem Jaffer [Tue, 30 Jul 2019 09:55:12 +0000 (15:25 +0530)]
adding throw_ and err_ macros for InterpError

4 years agoaddding an interp_error module
Saleem Jaffer [Tue, 30 Jul 2019 07:48:36 +0000 (13:18 +0530)]
addding an interp_error module

4 years agocode review fixes
Saleem Jaffer [Tue, 30 Jul 2019 07:02:43 +0000 (12:32 +0530)]
code review fixes

4 years agocode review fixes
Saleem Jaffer [Mon, 29 Jul 2019 14:56:25 +0000 (20:26 +0530)]
code review fixes

4 years agocode review fixes
Saleem Jaffer [Mon, 29 Jul 2019 14:47:52 +0000 (20:17 +0530)]
code review fixes

4 years agocode review fixes
Saleem Jaffer [Mon, 29 Jul 2019 08:11:32 +0000 (13:41 +0530)]
code review fixes

4 years agouse PanicInfo and UnsupportedOpInfo
Saleem Jaffer [Mon, 29 Jul 2019 07:58:55 +0000 (13:28 +0530)]
use PanicInfo and UnsupportedOpInfo

4 years agoadding a err macro for each of the InterpError variants
Saleem Jaffer [Mon, 29 Jul 2019 07:36:42 +0000 (13:06 +0530)]
adding a err macro for each of the InterpError variants

4 years agoimplementing Debug for UnsupportedInfo
Saleem Jaffer [Sun, 28 Jul 2019 14:37:33 +0000 (20:07 +0530)]
implementing Debug for UnsupportedInfo

4 years agotidy fixes
Saleem Jaffer [Sat, 27 Jul 2019 12:26:45 +0000 (17:56 +0530)]
tidy fixes

4 years agofixing fallout due to InterpError refactor
Saleem Jaffer [Sat, 27 Jul 2019 12:19:12 +0000 (17:49 +0530)]
fixing fallout due to InterpError refactor

4 years agocode review fixes
Saleem Jaffer [Fri, 26 Jul 2019 13:38:12 +0000 (19:08 +0530)]
code review fixes

4 years agomoving remaining variants to UnsupportedInfo
Saleem Jaffer [Fri, 26 Jul 2019 11:01:12 +0000 (16:31 +0530)]
moving remaining variants to UnsupportedInfo

4 years agomore grouping of the variants in InterpError
Saleem Jaffer [Fri, 26 Jul 2019 09:58:27 +0000 (15:28 +0530)]
more grouping of the variants in InterpError

4 years agogrouping the variants of InterpError
Saleem Jaffer [Fri, 26 Jul 2019 05:21:54 +0000 (10:51 +0530)]
grouping the variants of InterpError

4 years agochanging the fields of InterpError
Saleem Jaffer [Thu, 25 Jul 2019 11:29:38 +0000 (16:59 +0530)]
changing the fields of InterpError

4 years agoAuto merge of #63094 - Centril:rollup-lm7peuh, r=Centril
bors [Mon, 29 Jul 2019 00:12:12 +0000 (00:12 +0000)]
Auto merge of #63094 - Centril:rollup-lm7peuh, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #62809 (rustc: Update wasm32 support for LLVM 9)
 - #63055 (Various cleanups to save analysis)
 - #63076 (Miri: fix determining size of an "extra function" allocation)
 - #63077 (cleanup: Remove some language features related to built-in macros)
 - #63086 (Ignore test cases that are not supported by vxWorks)
 - #63092 (Update `impl Trait` gate issues)

Failed merges:

r? @ghost

4 years agoRollup merge of #63092 - Centril:update-impl-trait-gates, r=varkor
Mazdak Farrokhzad [Mon, 29 Jul 2019 00:11:00 +0000 (02:11 +0200)]
Rollup merge of #63092 - Centril:update-impl-trait-gates, r=varkor

Update `impl Trait` gate issues

cc https://github.com/rust-lang/rust/issues/63065
cc https://github.com/rust-lang/rust/issues/63063

r? @varkor cc @alexreg

4 years agoRollup merge of #63086 - BaoshanPang:testcases, r=nagisa
Mazdak Farrokhzad [Mon, 29 Jul 2019 00:10:58 +0000 (02:10 +0200)]
Rollup merge of #63086 - BaoshanPang:testcases, r=nagisa

Ignore test cases that are not supported by vxWorks

bypass x86stdcall.rs for vxworks

ignore wait-forked-but-failed-child.rs as there is no command 'ps' on vxWorks

ignore process-sigpipe.rs as there is no 'sh' on vxWorks

ignore core-run-destroy.rs as there is no 'cat' and 'sleep' on vxWorks

4 years agoRollup merge of #63077 - petrochenkov:nolangfeat, r=petrochenkov
Mazdak Farrokhzad [Mon, 29 Jul 2019 00:10:57 +0000 (02:10 +0200)]
Rollup merge of #63077 - petrochenkov:nolangfeat, r=petrochenkov

cleanup: Remove some language features related to built-in macros

They are now library features.
Cleanup after https://github.com/rust-lang/rust/pull/62086.
The unstable book files are moved because tidy complained.

4 years agoRollup merge of #63076 - RalfJung:miri-fn-ptr-alloc-size, r=oli-obk
Mazdak Farrokhzad [Mon, 29 Jul 2019 00:10:55 +0000 (02:10 +0200)]
Rollup merge of #63076 - RalfJung:miri-fn-ptr-alloc-size, r=oli-obk

Miri: fix determining size of an "extra function" allocation

Fixes [a bug](https://github.com/rust-lang/miri/pull/862) introduced by https://github.com/rust-lang/rust/pull/62982. Best reviewed commit-by-commit.

r? @oli-obk

4 years agoRollup merge of #63055 - Mark-Simulacrum:save-analysis-clean-2, r=Xanewok
Mazdak Farrokhzad [Mon, 29 Jul 2019 00:10:54 +0000 (02:10 +0200)]
Rollup merge of #63055 - Mark-Simulacrum:save-analysis-clean-2, r=Xanewok

Various cleanups to save analysis

4 years agoRollup merge of #62809 - alexcrichton:wasm-llvm-9, r=nikic
Mazdak Farrokhzad [Mon, 29 Jul 2019 00:10:52 +0000 (02:10 +0200)]
Rollup merge of #62809 - alexcrichton:wasm-llvm-9, r=nikic

rustc: Update wasm32 support for LLVM 9

This commit brings in a number of minor updates for rustc's support for
the wasm target which has changed in the LLVM 9 update. Notable updates
include:

* The compiler now no longer manually inserts the `producers` section,
  instead relying on LLVM to do so. LLVM uses the `llvm.ident` metadata
  for the `processed-by` directive (which is now emitted on the wasm
  target in this PR) and it uses debuginfo to figure out what `language`
  to put in the `producers` section.

* Threaded WebAssembly code now requires different flags to be passed
  with LLD. In LLD we now pass:

  * `--shared-memory` - required since objects are compiled with
    atomics. This also means that the generated memory will be marked as
    `shared`.
  * `--max-memory=1GB` - required with the `--shared-memory` argument
    since shared memories in WebAssembly must have a maximum size. The
    1GB number is intended to be a conservative estimate for rustc, but
    it should be overridable with `-C link-arg` if necessary.
  * `--passive-segments` - this has become the default for multithreaded
    memory, but when compiling a threaded module all data segments need
    to be marked as passive to ensure they don't re-initialize memory
    for each thread. This will also cause LLD to emit a synthetic
    function to initialize memory which users will have to arrange to
    call.
  * The `__heap_base` and `__data_end` globals are explicitly exported
    since they're now hidden by default due to the `--export` flags we
    pass to LLD.

4 years agoUpdate existential_type + impl_trait_in_bindings issue numbers.
Mazdak Farrokhzad [Sun, 28 Jul 2019 21:39:39 +0000 (23:39 +0200)]
Update existential_type + impl_trait_in_bindings issue numbers.

4 years agoreplace match by ok()
Ralf Jung [Sun, 28 Jul 2019 20:30:19 +0000 (22:30 +0200)]
replace match by ok()

4 years agoAuto merge of #63090 - Centril:rollup-xnjwm2h, r=Centril
bors [Sun, 28 Jul 2019 20:22:42 +0000 (20:22 +0000)]
Auto merge of #63090 - Centril:rollup-xnjwm2h, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #61856 (Lint attributes on function arguments)
 - #62360 (Document that ManuallyDrop::drop should not called more than once)
 - #62392 (Update minifier-rs version)
 - #62871 (Explicit error message for async recursion.)
 - #62995 (Avoid ICE when suggestion span is at Eof)
 - #63053 (SystemTime docs: recommend Instant for elapsed time)
 - #63081 (tidy: Cleanup the directory whitelist)
 - #63088 (Remove anonymous_parameters from unrelated test)

Failed merges:

r? @ghost

4 years agoRollup merge of #63088 - dtolnay:anonymous, r=Centril
Mazdak Farrokhzad [Sun, 28 Jul 2019 19:20:02 +0000 (21:20 +0200)]
Rollup merge of #63088 - dtolnay:anonymous, r=Centril

Remove anonymous_parameters from unrelated test

The parsing of anonymous_parameters is sufficiently covered by:

- [src/test/ui/issues/issue-13105.rs](https://github.com/rust-lang/rust/blob/023525dbda35748a10713471b948974b68a1c2cc/src/test/ui/issues/issue-13105.rs)
- [src/test/ui/issues/issue-13775.rs](https://github.com/rust-lang/rust/blob/023525dbda35748a10713471b948974b68a1c2cc/src/test/ui/issues/issue-13775.rs)
- [src/test/ui/issues/issue-34074.rs](https://github.com/rust-lang/rust/blob/023525dbda35748a10713471b948974b68a1c2cc/src/test/ui/issues/issue-34074.rs)

Removing anonymous_parameters from this test means fewer exclusions for me in https://github.com/dtolnay/syn/issues/644.

4 years agoRollup merge of #63081 - petrochenkov:cleantidy, r=Mark-Simulacrum
Mazdak Farrokhzad [Sun, 28 Jul 2019 19:20:00 +0000 (21:20 +0200)]
Rollup merge of #63081 - petrochenkov:cleantidy, r=Mark-Simulacrum

tidy: Cleanup the directory whitelist

Some entries were outdated - pre-"llvm-project", pre-"crates.io", pre-"Cargo.toml outside of src".
Some entries were unnecessary - `owning_ref` could be fixed and directories outside of `src` are not visited by tidy at all.

r? @Mark-Simulacrum

4 years agoRollup merge of #63053 - kornelski:clockdrift, r=shepmaster
Mazdak Farrokhzad [Sun, 28 Jul 2019 19:19:59 +0000 (21:19 +0200)]
Rollup merge of #63053 - kornelski:clockdrift, r=shepmaster

SystemTime docs: recommend Instant for elapsed time

Introduction to `SystemTime` mentions problems with non-monotonic clocks, but individual methods don't.

For benefit of users who jump directly to method's documentation, also recommend `Instant` in `elapsed` and `duration_since`.

`SystemTime::elapsed()` docs overpromised the elapsed time. It's not elapsed time, but a difference between two clocks.

4 years agoRollup merge of #62995 - estebank:issue-62973, r=varkor
Mazdak Farrokhzad [Sun, 28 Jul 2019 19:19:58 +0000 (21:19 +0200)]
Rollup merge of #62995 - estebank:issue-62973, r=varkor

Avoid ICE when suggestion span is at Eof

Fix #62973.

4 years agoRollup merge of #62871 - gilescope:async-recursion-error, r=Centril
Mazdak Farrokhzad [Sun, 28 Jul 2019 19:19:56 +0000 (21:19 +0200)]
Rollup merge of #62871 - gilescope:async-recursion-error, r=Centril

Explicit error message for async recursion.

Attempt at clearer error message when async recusion is attempted. In response to #62539 (and #53690).

4 years agoRollup merge of #62392 - GuillaumeGomez:update-minifier, r=GuillaumeGomez
Mazdak Farrokhzad [Sun, 28 Jul 2019 19:19:54 +0000 (21:19 +0200)]
Rollup merge of #62392 - GuillaumeGomez:update-minifier, r=GuillaumeGomez

Update minifier-rs version

The `main.js` file size goes from 52868 to 50134. A few fixes have been included as well (no more eluded parts of js files).

r? @QuietMisdreavus

4 years agoRollup merge of #62360 - Aaron1011:patch-2, r=RalfJung
Mazdak Farrokhzad [Sun, 28 Jul 2019 19:19:52 +0000 (21:19 +0200)]
Rollup merge of #62360 - Aaron1011:patch-2, r=RalfJung

Document that ManuallyDrop::drop should not called more than once

Double dropping is unsound (e.g. https://github.com/rust-lang/rust/issues/60977). This commit documents the fact that `ManuallyDrop::drop` should not be called multiple times on the same instance, as it might not be immediately obvious that this counts as a use of uninitialized data.

4 years agoRollup merge of #61856 - c410-f3r:attrs-fn, r=matthewjasper
Mazdak Farrokhzad [Sun, 28 Jul 2019 19:19:50 +0000 (21:19 +0200)]
Rollup merge of #61856 - c410-f3r:attrs-fn, r=matthewjasper

Lint attributes on function arguments

Fixes #61238.

cc #60406

4 years agoUpdate minifier-rs version
Guillaume Gomez [Sun, 28 Jul 2019 18:24:52 +0000 (20:24 +0200)]
Update minifier-rs version

4 years agoRemove anonymous_parameters from unrelated test
David Tolnay [Sun, 28 Jul 2019 17:17:19 +0000 (10:17 -0700)]
Remove anonymous_parameters from unrelated test

4 years agobypass x86stdcall.rs for vxworks
Baoshan Pang [Sun, 28 Jul 2019 16:15:43 +0000 (09:15 -0700)]
bypass x86stdcall.rs for vxworks

ignore wait-forked-but-failed-child.rs as there is no command 'ps' on vxWorks

ignore process-sigpipe.rs as there is no 'sh' on vxWorks

ignore core-run-destroy.rs as there is no 'cat' and 'sleep' on vxWorks

4 years agoAuto merge of #62910 - petrochenkov:buildwarn2, r=Mark-Simulacrum
bors [Sun, 28 Jul 2019 16:34:59 +0000 (16:34 +0000)]
Auto merge of #62910 - petrochenkov:buildwarn2, r=Mark-Simulacrum

cleanup: Remove lint annotations in specific crates that are already enforced by rustbuild

Remove some random unnecessary lint `allow`s.

Deny `unused_lifetimes` through rustbuild.

r? @Mark-Simulacrum

4 years agoBetter recursive async fn error message.
Giles Cope [Tue, 23 Jul 2019 18:50:53 +0000 (19:50 +0100)]
Better recursive async fn error message.

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
4 years agoFix `cfg(parallel_compiler)` mode
Vadim Petrochenkov [Wed, 24 Jul 2019 08:44:14 +0000 (11:44 +0300)]
Fix `cfg(parallel_compiler)` mode

Fix rebase

4 years agoDeny `unused_lifetimes` through rustbuild
Vadim Petrochenkov [Tue, 23 Jul 2019 19:17:27 +0000 (22:17 +0300)]
Deny `unused_lifetimes` through rustbuild

4 years agoRemove lint annotations in specific crates that are already enforced by rustbuild
Vadim Petrochenkov [Tue, 23 Jul 2019 17:34:17 +0000 (20:34 +0300)]
Remove lint annotations in specific crates that are already enforced by rustbuild

Remove some random unnecessary lint `allow`s

4 years agoAuto merge of #62943 - matthiaskrgr:submodule_upd, r=matthiaskrgr
bors [Sun, 28 Jul 2019 12:50:34 +0000 (12:50 +0000)]
Auto merge of #62943 - matthiaskrgr:submodule_upd, r=matthiaskrgr

submodules: update clippy from 164310dd to dc69a5c0

Changes:
````
ci: temporarily disable rustfmt checks/tetss since it's broken for nightly
rustup https://github.com/rust-lang/rust/pull/62964
Bump version of clippy_dummy
update test stderr, not sure which rustc pull request caused this.
rustup https://github.com/rust-lang/rust/pull/62859
Fix tests for edition 2018 compatibility
Revert "Revert global fmt config and use `rustfmt::skip`"
Fix breakage due to rust-lang/rust#60913
Fix breakage due to rust-lang/rust#62705
Revert global fmt config and use `rustfmt::skip`
Fix fmt
rustup https://github.com/rust-lang/rust/pull/62679/
Update pulldown-cmark to 0.5.3
rustup https://github.com/rust-lang/rust/pull/62764
Add test
Format code
Decrease maximum length for stderr files
Improved imports
Fix "unkown clippy lint" error in UI test.
Corrections for PR review.
Implement lint for inherent to_string() method.
UI Test Cleanup: Extract match_ref_pats tests
Update UI tests
Allow no_effect lint
Remove comment
cargo fmt
UI Test Cleanup: Split up checked_unwrap tests
Removed lintining on never type.
UI Test Cleanup: Split out out_of_bounds_indexing
false positives fixes of `implicit_return`
Ignore generated fresh lifetimes in elision check.
````

fixes clippy toolstate
r? @Manishearth

4 years agotidy: Cleanup the directory whitelist
Vadim Petrochenkov [Sun, 28 Jul 2019 11:36:26 +0000 (14:36 +0300)]
tidy: Cleanup the directory whitelist

4 years agoget_size_and_align: fix handling of function pointers
Ralf Jung [Sun, 28 Jul 2019 11:02:01 +0000 (13:02 +0200)]
get_size_and_align: fix handling of function pointers

4 years agocleanup: Remove some language features related to built-in macros
Vadim Petrochenkov [Sun, 28 Jul 2019 11:02:08 +0000 (14:02 +0300)]
cleanup: Remove some language features related to built-in macros

They are now library features.

4 years agomiri: add get and get_mut to AllocMap; use that in get_size_and_align and avoid right...
Ralf Jung [Sun, 28 Jul 2019 10:58:39 +0000 (12:58 +0200)]
miri: add get and get_mut to AllocMap; use that in get_size_and_align and avoid rightwards drift

4 years agoSystemTime docs: recommend Instant for elapsed time
Kornel [Sat, 27 Jul 2019 20:46:18 +0000 (21:46 +0100)]
SystemTime docs: recommend Instant for elapsed time

4 years agoAuto merge of #63074 - Centril:rollup-k1a8z0n, r=Centril
bors [Sun, 28 Jul 2019 09:12:04 +0000 (09:12 +0000)]
Auto merge of #63074 - Centril:rollup-k1a8z0n, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #62550 (Implement RFC 2707 + Parser recovery for range patterns)
 - #62759 (Actually add rustc-guide to toolstate, don't fail builds for the guide)
 - #62806 (Fix few Clippy warnings)
 - #62974 (bump crossbeam-epoch dependency)
 - #63051 (Avoid ICE when referencing desugared local binding in borrow error)
 - #63061 (In which we constantly improve the Vec(Deque) array PartialEq impls)
 - #63067 (Add test for issue-50900)
 - #63071 (Allow rustbot to add `F-*` + `requires-nightly`.)

Failed merges:

r? @ghost

4 years agoRollup merge of #63071 - rust-lang:some-new-labels, r=pietroalbini
Mazdak Farrokhzad [Sun, 28 Jul 2019 09:11:16 +0000 (11:11 +0200)]
Rollup merge of #63071 - rust-lang:some-new-labels, r=pietroalbini

Allow rustbot to add `F-*` + `requires-nightly`.

r? @pietroalbini

4 years agoRollup merge of #63067 - JohnTitor:test-for-50900, r=Centril
Mazdak Farrokhzad [Sun, 28 Jul 2019 09:11:15 +0000 (11:11 +0200)]
Rollup merge of #63067 - JohnTitor:test-for-50900, r=Centril

Add test for issue-50900

Closes #50900

4 years agoRollup merge of #63061 - Centril:constantly-improving, r=scottmcm
Mazdak Farrokhzad [Sun, 28 Jul 2019 09:11:14 +0000 (11:11 +0200)]
Rollup merge of #63061 - Centril:constantly-improving, r=scottmcm

In which we constantly improve the Vec(Deque) array PartialEq impls

Use the same approach as in https://github.com/rust-lang/rust/pull/62435 as sanctioned by https://github.com/rust-lang/rust/issues/61415#issuecomment-504155110.

r? @scottmcm

4 years agoRollup merge of #63051 - estebank:borrow-ice, r=matthewjasper
Mazdak Farrokhzad [Sun, 28 Jul 2019 09:11:12 +0000 (11:11 +0200)]
Rollup merge of #63051 - estebank:borrow-ice, r=matthewjasper

Avoid ICE when referencing desugared local binding in borrow error

To avoid leaking the names of local bindings from expressions like for loops, #60984 explicitly ignored them, but an assertion that `LocalKind::Var` *must* have a name would trigger an ICE.

Before this change, the binding generated by desugaring the for loop would leak into the diagnostic (#63027):
```
error[E0515]: cannot return value referencing local variable `__next`
  --> return-local-binding-from-desugaring.rs:LL:CC
   |
LL |     for ref x in xs {
   |         ----- `__next` is borrowed here
...
LL |     result
   |     ^^^^^^ returns a value referencing data owned by the current function
```

Ideally `LocalKind` would carry more information to more accurately explain the problem, but for now, in order to avoid the ICE (fix #63026), we accept `LocalKind::Var` without a name and produce the following output:

```
error[E0515]: cannot return value referencing local binding
  --> $DIR/return-local-binding-from-desugaring.rs:30:5
   |
LL |     for ref x in xs {
   |                  -- local binding introduced here
...
LL |     result
   |     ^^^^^^ returns a value referencing data owned by the current function
```

4 years agoRollup merge of #62974 - RalfJung:crossbeam, r=alexcrichton
Mazdak Farrokhzad [Sun, 28 Jul 2019 09:11:10 +0000 (11:11 +0200)]
Rollup merge of #62974 - RalfJung:crossbeam, r=alexcrichton

bump crossbeam-epoch dependency

The new crossbeam-epoch release depends on a memoffset with a whole bunch of soundness holes fixed.

The old memoffset is still indirectly depended on (at least) by rustc-rayon, though -- a crate that looks rather unmaintained (no change in more than a year).

4 years agoRollup merge of #62806 - mati865:clippy, r=TimNN
Mazdak Farrokhzad [Sun, 28 Jul 2019 09:11:08 +0000 (11:11 +0200)]
Rollup merge of #62806 - mati865:clippy, r=TimNN

Fix few Clippy warnings

4 years agoRollup merge of #62759 - mark-i-m:rustc-guide-toolstate-check, r=kennytm
Mazdak Farrokhzad [Sun, 28 Jul 2019 09:11:06 +0000 (11:11 +0200)]
Rollup merge of #62759 - mark-i-m:rustc-guide-toolstate-check, r=kennytm

Actually add rustc-guide to toolstate, don't fail builds for the guide

cc @ehuss

r? @kennytm

4 years agoRollup merge of #62550 - Centril:rest-patterns, r=petrochenkov
Mazdak Farrokhzad [Sun, 28 Jul 2019 09:11:04 +0000 (11:11 +0200)]
Rollup merge of #62550 - Centril:rest-patterns, r=petrochenkov

Implement RFC 2707 + Parser recovery for range patterns

Implement https://github.com/rust-lang/rfcs/pull/2707.

- Add a new basic syntactic pattern form `ast::PatKind::Rest` (parsed as `..` or `DOTDOT`) and simplify `ast::PatKind::{Slice, Tuple, TupleStruct}` as a result.

- Lower `ast::PatKind::Rest` in combination with the aforementioned `PatKind` variants as well as `PatKind::Ident`. The HIR remains unchanged for now (may be advisable to make slight adjustments later).

- Refactor `parser.rs` wrt. parsing sequences and lists of things in the process.

- Add parser recovery for range patterns of form `X..`, `X..=`, `X...`, `..Y`, `..=Y`, and `...Y`.
   This should make it easy to actually support these patterns semantically later if we so desire.

cc https://github.com/rust-lang/rust/issues/62254

r? @petrochenkov

4 years agoAllow rustbot to add `F-*` + `requires-nightly`.
Mazdak Farrokhzad [Sun, 28 Jul 2019 08:29:38 +0000 (10:29 +0200)]
Allow rustbot to add `F-*` + `requires-nightly`.

4 years agoMove to src/test/ui/match/
Yuki Okushi [Sun, 28 Jul 2019 07:51:21 +0000 (16:51 +0900)]
Move to src/test/ui/match/

4 years agoAdd test for issue-50900
Yuki Okushi [Sun, 28 Jul 2019 07:26:01 +0000 (16:26 +0900)]
Add test for issue-50900

4 years agoborrowck-describe-lvalue: --bless --compare-mode=nll.
Mazdak Farrokhzad [Sun, 28 Jul 2019 05:04:16 +0000 (07:04 +0200)]
borrowck-describe-lvalue: --bless --compare-mode=nll.

4 years agoAnd --bless tests accordingly for those exceptions.
Mazdak Farrokhzad [Wed, 24 Jul 2019 02:01:38 +0000 (04:01 +0200)]
And --bless tests accordingly for those exceptions.

4 years agoAdd exceptions for ExprKind::Err/TyKind::Error.
Mazdak Farrokhzad [Wed, 24 Jul 2019 02:01:12 +0000 (04:01 +0200)]
Add exceptions for ExprKind::Err/TyKind::Error.

4 years agoAddress comments re. off-topic errors.
Mazdak Farrokhzad [Wed, 24 Jul 2019 00:30:37 +0000 (02:30 +0200)]
Address comments re. off-topic errors.

4 years agoAddress comments in lowering + parsing.
Mazdak Farrokhzad [Wed, 24 Jul 2019 00:00:46 +0000 (02:00 +0200)]
Address comments in lowering + parsing.

4 years agoUse AstP more in lowering.
Mazdak Farrokhzad [Thu, 11 Jul 2019 14:11:09 +0000 (16:11 +0200)]
Use AstP more in lowering.

4 years agoUpdate error_codes.rs with new subslice syntax.
Mazdak Farrokhzad [Wed, 10 Jul 2019 16:53:39 +0000 (18:53 +0200)]
Update error_codes.rs with new subslice syntax.

4 years ago--bless tests after rebase.
Mazdak Farrokhzad [Wed, 10 Jul 2019 14:18:01 +0000 (16:18 +0200)]
--bless tests after rebase.

4 years agoGet out of bootstrapping pickle.
Mazdak Farrokhzad [Wed, 10 Jul 2019 03:18:01 +0000 (05:18 +0200)]
Get out of bootstrapping pickle.

4 years agoAdjust documentation in HAIR.
Mazdak Farrokhzad [Wed, 10 Jul 2019 03:17:26 +0000 (05:17 +0200)]
Adjust documentation in HAIR.

4 years agoUpdate unstable book wrt. subslice patterns.
Mazdak Farrokhzad [Wed, 10 Jul 2019 03:16:47 +0000 (05:16 +0200)]
Update unstable book wrt. subslice patterns.

4 years agoWin some lose some; Unfortunately we lost recovery in one case.
Mazdak Farrokhzad [Mon, 8 Jul 2019 13:35:56 +0000 (15:35 +0200)]
Win some lose some; Unfortunately we lost recovery in one case.

4 years ago(pat, ..,) is now syntactically legal.
Mazdak Farrokhzad [Mon, 8 Jul 2019 01:03:12 +0000 (03:03 +0200)]
(pat, ..,) is now syntactically legal.

4 years agoAccount for better recovery in two cases.
Mazdak Farrokhzad [Tue, 9 Jul 2019 04:30:03 +0000 (06:30 +0200)]
Account for better recovery in two cases.

4 years agoIntersection patterns 'p1 @ p2' are not supported.
Mazdak Farrokhzad [Mon, 8 Jul 2019 00:06:49 +0000 (02:06 +0200)]
Intersection patterns 'p1 @ p2' are not supported.

4 years ago--bless tests due to new subslice syntax.
Mazdak Farrokhzad [Sun, 7 Jul 2019 23:58:28 +0000 (01:58 +0200)]
--bless tests due to new subslice syntax.

4 years agoUse new 'p @ ..' syntax in tests.
Mazdak Farrokhzad [Sun, 7 Jul 2019 23:47:46 +0000 (01:47 +0200)]
Use new 'p @ ..' syntax in tests.

4 years agoTest parsing and recovery of all sorts of range patterns.
Mazdak Farrokhzad [Tue, 9 Jul 2019 23:50:54 +0000 (01:50 +0200)]
Test parsing and recovery of all sorts of range patterns.

4 years agoAnd also --bless those recovery tests.
Mazdak Farrokhzad [Tue, 9 Jul 2019 06:44:56 +0000 (08:44 +0200)]
And also --bless those recovery tests.

4 years agoUpdate tests wrt. recovery of range patterns.
Mazdak Farrokhzad [Tue, 9 Jul 2019 06:44:46 +0000 (08:44 +0200)]
Update tests wrt. recovery of range patterns.

4 years agoRecover on 'X..' / 'X..=' / 'X...' range patterns.
Mazdak Farrokhzad [Tue, 9 Jul 2019 04:06:41 +0000 (06:06 +0200)]
Recover on 'X..' / 'X..=' / 'X...' range patterns.

4 years agoRecover on '..X' / '..=X' / '...X' range patterns.
Mazdak Farrokhzad [Tue, 9 Jul 2019 01:55:13 +0000 (03:55 +0200)]
Recover on '..X' / '..=X' / '...X' range patterns.

4 years agoAdjust parsing of Slice, Tuple, TupleStruct patterns.
Mazdak Farrokhzad [Tue, 9 Jul 2019 08:36:14 +0000 (10:36 +0200)]
Adjust parsing of Slice, Tuple, TupleStruct patterns.

4 years agoCleanup using the new parse_*_seq methods.
Mazdak Farrokhzad [Tue, 9 Jul 2019 08:34:53 +0000 (10:34 +0200)]
Cleanup using the new parse_*_seq methods.

4 years agoAdd more parse_*_seq methods for code reuse.
Mazdak Farrokhzad [Tue, 9 Jul 2019 08:31:24 +0000 (10:31 +0200)]
Add more parse_*_seq methods for code reuse.

4 years agoCleanup parse_seq_* methods + record trailing separators.
Mazdak Farrokhzad [Tue, 9 Jul 2019 08:27:07 +0000 (10:27 +0200)]
Cleanup parse_seq_* methods + record trailing separators.

4 years agoAdjust lowering of Slice patterns.
Mazdak Farrokhzad [Tue, 9 Jul 2019 08:03:30 +0000 (10:03 +0200)]
Adjust lowering of Slice patterns.
- Make sure extra `x @ ..` do not cause ICEs.

4 years agoAdjust lowering of Tuple/TupleStruct patterns.
Mazdak Farrokhzad [Tue, 9 Jul 2019 08:11:21 +0000 (10:11 +0200)]
Adjust lowering of Tuple/TupleStruct patterns.
- Make sure we ban duplicate '..'.
- Avoid ICEs on PatKind::Rest that doesn't generate HIR nodes.

4 years agoAdjust and document 'Pat::to_ty' accordingly.
Mazdak Farrokhzad [Tue, 9 Jul 2019 07:23:51 +0000 (09:23 +0200)]
Adjust and document 'Pat::to_ty' accordingly.

4 years agoAdjust pretty printing accordingly.
Mazdak Farrokhzad [Tue, 9 Jul 2019 07:12:14 +0000 (09:12 +0200)]
Adjust pretty printing accordingly.

4 years agoAdjust feature gating of subslice patterns accordingly.
Mazdak Farrokhzad [Tue, 9 Jul 2019 07:12:49 +0000 (09:12 +0200)]
Adjust feature gating of subslice patterns accordingly.