]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #62600 - emmericp:libtest-add-show-output, r=gnzlbg
Mazdak Farrokhzad [Tue, 27 Aug 2019 06:17:48 +0000 (08:17 +0200)]
Rollup merge of #62600 - emmericp:libtest-add-show-output, r=gnzlbg

libtest: add --show-output flag to print stdout of successful tests

This pull request adds a new flag `--show-output` for tests to show the output of successful tests. For most formatters this was already supported just not exposed via the CLI (apparently only used by `librustdoc`). I've also added support for this option in the JSON formatter.

This kind of fixes https://github.com/rust-lang/rust/issues/54669 which wants `--format json` to work with `--nocapture`, which is... well, impossible. What this issue really calls for is `--show-output` as implemented here.

4 years agoAuto merge of #63926 - Centril:rollup-6kckn9n, r=Centril
bors [Tue, 27 Aug 2019 00:07:38 +0000 (00:07 +0000)]
Auto merge of #63926 - Centril:rollup-6kckn9n, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #63317 (Do not complain about unused code when used in `impl` `Self` type)
 - #63693 (Fully implement or-pattern parsing)
 - #63836 (VxWorks does not provide a way to set the task name except at creation time)
 - #63845 (Removed a confusing FnOnce example)
 - #63855 (Refactor feature gates)
 - #63921 (add link to FileCheck docs)

Failed merges:

r? @ghost

4 years agoRollup merge of #63921 - RalfJung:file-check, r=alexcrichton
Mazdak Farrokhzad [Mon, 26 Aug 2019 21:55:51 +0000 (23:55 +0200)]
Rollup merge of #63921 - RalfJung:file-check, r=alexcrichton

add link to FileCheck docs

Thanks @gnzlbg for pointing me to those docs.

4 years agoRollup merge of #63855 - killercup:refactor/feature-gates, r=Centril
Mazdak Farrokhzad [Mon, 26 Aug 2019 21:55:49 +0000 (23:55 +0200)]
Rollup merge of #63855 - killercup:refactor/feature-gates, r=Centril

Refactor feature gates

After #63824, this goes a few steps further by

- parsing doc comments in the macros to extract descriptions for feature gates, and
- introducing a common `Feature` type to replace the tuples used previously to improve readability.

The descriptions are not yet used, but I felt like this PR is a useful enough refactoring on its own.

r? @Centril

4 years agoRollup merge of #63845 - DevQps:47091-remove-bad-example, r=nikomatsakis
Mazdak Farrokhzad [Mon, 26 Aug 2019 21:55:47 +0000 (23:55 +0200)]
Rollup merge of #63845 - DevQps:47091-remove-bad-example, r=nikomatsakis

Removed a confusing FnOnce example

# Description
See #47091 for a discussion.

## Changes
- Removed an example that might suggest readers that square_x is (only) FnOnce.

closes #47091

4 years agoRollup merge of #63836 - Wind-River:master_003, r=alexcrichton
Mazdak Farrokhzad [Mon, 26 Aug 2019 21:55:46 +0000 (23:55 +0200)]
Rollup merge of #63836 - Wind-River:master_003, r=alexcrichton

VxWorks does not provide a way to set the task name except at creation time

Make set_name do thing as VxWorks does not provide a way to set the task name except at creation time.

r? @alexcrichton

cc @n-salim

4 years agoRollup merge of #63693 - Centril:polish-parse-or-pats, r=estebank
Mazdak Farrokhzad [Mon, 26 Aug 2019 21:55:44 +0000 (23:55 +0200)]
Rollup merge of #63693 - Centril:polish-parse-or-pats, r=estebank

Fully implement or-pattern parsing

Builds upon the initial parsing in https://github.com/rust-lang/rust/pull/61708 to fully implement or-pattern (`p | q`) parsing as specified in [the grammar section of RFC 2535](https://github.com/rust-lang/rfcs/blob/master/text/2535-or-patterns.md#grammar).

Noteworthy:

- We allow or-patterns in `[p | q, ...]`.
- We allow or-patterns in `let` statements and `for` expressions including with leading `|`.
- We improve recovery for `p || q` (+ tests for that in `multiple-pattern-typo.rs`).
- We improve recovery for `| p | q` in inner patterns (tests in `or-patterns-syntactic-fail.rs`).
- We rigorously test or-pattern parsing (in `or-patterns-syntactic-{pass,fail}.rs`).
- We harden the feature gating tests.
- We do **_not_** change `ast.rs`. That is, `ExprKind::Let.0` and `Arm.pats` still accept `Vec<P<Pat>>`.
   I was starting work on that but it would be cleaner to do this in a separate PR so this one has a narrower scope.

cc @dlrobertson
cc the tracking issue https://github.com/rust-lang/rust/issues/54883.

r? @estebank

4 years agoRollup merge of #63317 - estebank:dead-code, r=matthewjasper
Mazdak Farrokhzad [Mon, 26 Aug 2019 21:55:42 +0000 (23:55 +0200)]
Rollup merge of #63317 - estebank:dead-code, r=matthewjasper

Do not complain about unused code when used in `impl` `Self` type

Fix https://github.com/rust-lang/rust/issues/18290.

4 years agoreview comment
Esteban Küber [Mon, 26 Aug 2019 20:25:27 +0000 (13:25 -0700)]
review comment

4 years agoparser: fix span for leading vert.
Mazdak Farrokhzad [Mon, 26 Aug 2019 20:14:31 +0000 (22:14 +0200)]
parser: fix span for leading vert.

4 years agoadd link to FileCheck docs
Ralf Jung [Mon, 26 Aug 2019 18:40:30 +0000 (20:40 +0200)]
add link to FileCheck docs

4 years agoAuto merge of #63901 - estebank:unknown-receiver-type, r=zackmdavis
bors [Mon, 26 Aug 2019 17:33:50 +0000 (17:33 +0000)]
Auto merge of #63901 - estebank:unknown-receiver-type, r=zackmdavis

Point at method call on missing annotation error

Make it clearer where the type name that couldn't be inferred comes from.

Before:

```
error[E0282]: type annotations needed
 --> src/test/ui/span/type-annotations-needed-expr.rs:2:13
  |
2 |     let _ = (vec![1,2,3]).into_iter().sum() as f64; //~ ERROR E0282
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for `S`
  |
  = note: type must be known at this point
```
after
```
error[E0282]: type annotations needed
 --> src/test/ui/span/type-annotations-needed-expr.rs:2:39
  |
2 |     let _ = (vec![1,2,3]).into_iter().sum() as f64; //~ ERROR E0282
  |                                       ^^^ cannot infer type for `S`
  |
  = note: type must be known at this point
```

CC #63852.

4 years agoAuto merge of #63897 - petrochenkov:prettycomma, r=estebank
bors [Mon, 26 Aug 2019 13:45:18 +0000 (13:45 +0000)]
Auto merge of #63897 - petrochenkov:prettycomma, r=estebank

pprust: Do not print spaces before some tokens

Fixes https://github.com/rust-lang/rust/issues/63896

r? @Mark-Simulacrum

4 years agoAuto merge of #63580 - wesleywiser:move_promoted_out, r=oli-obk
bors [Mon, 26 Aug 2019 07:48:24 +0000 (07:48 +0000)]
Auto merge of #63580 - wesleywiser:move_promoted_out, r=oli-obk

Move promoted MIR out of `mir::Body`

r? @oli-obk

4 years agoAuto merge of #62891 - vext01:improve-black-box-docs, r=RalfJung,Centril,gnzlbg
bors [Mon, 26 Aug 2019 04:10:54 +0000 (04:10 +0000)]
Auto merge of #62891 - vext01:improve-black-box-docs, r=RalfJung,Centril,gnzlbg

Improve the documentation for std::hint::black_box.

The other day a colleague was reviewing some of my code which was using `black_box` to block constant propogation. There was a little confusion because the documentation kind of implies that `black_box` is only useful for dead code elimination, and only in benchmarking scenarios.

The docs currently say:

> A function that is opaque to the optimizer, to allow benchmarks to pretend to use outputs to assist in avoiding dead-code elimination.

Here is our discussion, in which I show (using godbolt) that a black box can also block constant propagation:
https://github.com/softdevteam/yk/pull/21#discussion_r302985038

This change makes the docstring for `black_box` a little more general, and while we are here, I've added an example (the same one from our discussion).

![image](https://user-images.githubusercontent.com/604955/61701322-ddf1e400-ad35-11e9-878c-b5b44a20770c.png)

OK to go in?

4 years agoAuto merge of #62603 - cuviper:no-unwind-abort, r=joshtriplett
bors [Mon, 26 Aug 2019 00:27:17 +0000 (00:27 +0000)]
Auto merge of #62603 - cuviper:no-unwind-abort, r=joshtriplett

Permit unwinding through FFI by default

This repeats #62505 for master (Rust 1.38+), as #58794 is not yet resolved. This is a stopgap until a stable alternative is available, like [RFC 2699](https://github.com/rust-lang/rfcs/pull/2699), as long as progress is being made to that end.

r? @joshtriplett

4 years agoPoint at method call on missing annotation error
Esteban Küber [Sun, 25 Aug 2019 20:34:57 +0000 (13:34 -0700)]
Point at method call on missing annotation error

Make it clearer where the type name that couldn't be infered comes from.

4 years agoAuto merge of #61613 - sinkuu:impl_trait_inline, r=ollie27
bors [Sun, 25 Aug 2019 19:20:20 +0000 (19:20 +0000)]
Auto merge of #61613 - sinkuu:impl_trait_inline, r=ollie27

Support `impl Trait` in inlined documentation

`impl Trait` in argument position was not properly rendered when inlined from other crates. ([a live example on docs.rs](https://docs.rs/libp2p/0.8.1/libp2p/floodsub/struct.Floodsub.html#method.unsubscribe))

![old](https://user-images.githubusercontent.com/7091080/59089838-14ba9900-8946-11e9-830b-53b317bdecb4.png)

![new](https://user-images.githubusercontent.com/7091080/59089844-16845c80-8946-11e9-9fe3-8998af9d73ce.png)

4 years agoRefactor feature gate checking code
Pascal Hertleif [Sat, 24 Aug 2019 15:50:21 +0000 (17:50 +0200)]
Refactor feature gate checking code

Tries to clarify the filtering of active features and make the code more
expressive.

4 years agopprust: Do not print spaces before some tokens
Vadim Petrochenkov [Sun, 25 Aug 2019 17:41:52 +0000 (20:41 +0300)]
pprust: Do not print spaces before some tokens

4 years agoForce #[unwind(aborts)] in test/codegen/c-variadic.rs
Josh Stone [Fri, 10 May 2019 22:10:15 +0000 (15:10 -0700)]
Force #[unwind(aborts)] in test/codegen/c-variadic.rs

4 years agoRevert "Allow a dirty MirBuilt for make_extern and make_method_extern"
Josh Stone [Tue, 2 Apr 2019 21:53:57 +0000 (14:53 -0700)]
Revert "Allow a dirty MirBuilt for make_extern and make_method_extern"

This reverts commit b4a6f597934f16f89e27058a32a514c9572f148f.

4 years agoPermit unwinding through FFI by default
Mark Rousskov [Thu, 28 Feb 2019 00:21:31 +0000 (17:21 -0700)]
Permit unwinding through FFI by default

See #58794 for context.

4 years agoAuto merge of #63878 - phansch:update_clippy_submodule, r=Manishearth
bors [Sun, 25 Aug 2019 15:42:13 +0000 (15:42 +0000)]
Auto merge of #63878 - phansch:update_clippy_submodule, r=Manishearth

submodules: update Clippy from 2bcb615 to 05f603e

changes: https://github.com/rust-lang/rust-clippy/compare/2bcb615...05f603e

Should fix the Clippy toolstate.

4 years agosubmodules: update clippy from 2bcb6155948e2f8b86db08152a5f54bd5af625e5 to 05f603e6ce...
Philipp Hansch [Sun, 25 Aug 2019 10:54:31 +0000 (12:54 +0200)]
submodules: update clippy from 2bcb6155948e2f8b86db08152a5f54bd5af625e5 to 05f603e6cec63d0b2681a84d4a64a51bccac1624

4 years agoIntroduce and use `Feature` type for feature gates
Pascal Hertleif [Sat, 24 Aug 2019 15:50:21 +0000 (17:50 +0200)]
Introduce and use `Feature` type for feature gates

This replaces the ad-hoc tuples used in the different feature gate files
and unifies their content into a common type, leading to more readable
matches and other good stuff that comes from having named fields. It
also contains the description of each feature as extracted from the doc
comment.

4 years agoAuto merge of #63874 - spastorino:places-drive-by-cleanups, r=Centril
bors [Sun, 25 Aug 2019 08:06:06 +0000 (08:06 +0000)]
Auto merge of #63874 - spastorino:places-drive-by-cleanups, r=Centril

Places drive by cleanups

Small fixes of things meanwhile I was doing the box part of Place 2.0, based on @centril reviews.

4 years agoAuto merge of #63862 - Centril:match-cleanup, r=oli-obk
bors [Sun, 25 Aug 2019 04:26:26 +0000 (04:26 +0000)]
Auto merge of #63862 - Centril:match-cleanup, r=oli-obk

typeck: refactor patterns => `pat.rs`  + make the `def_bm` algo more declarative

Spurred by the relative difficulty I had in working up an explanation of how default match bindings work in https://github.com/rust-lang/rust/pull/63118#issuecomment-524161584, this PR refactors the type checking of patterns into `pat.rs`.

The PR is probably best read commit-by-commit and includes various changes beyond the following, which are the most important highlights:

- The algorithm for determining `def_bm` is encoded in a more declarative fashion now with important sub-steps divided into functions that make sense as logical units (and as described in the reference). This is done starting with *"extract `is_no_ref_pat`."* to *"extract `calc_default_binding_mode`"*.

- Dedicated functions like `check_pat_{lit,range,ident,tuple,box,ref,slice}` are then introduced for the various kinds of patterns to make things overall more readable.

- `fn check_pat_top(...)` becomes the sole entry point to type checking patterns.

   This will take care of initializing the default binding mode (hence: `def_bm`) to `BindByValue` and is called by all contexts that have a pattern that needs to be type checked (functions, `match`, `if let`, `let`, ...). The overall result is that the notion of `def_bm` is internal to checking patterns.

- Various diagnostics are extracted to dedicated functions to disturb the flow of type checking logic less.

r? @oli-obk

4 years agoparser: TopLevel -> RecoverComma.
Mazdak Farrokhzad [Sun, 25 Aug 2019 04:15:11 +0000 (06:15 +0200)]
parser: TopLevel -> RecoverComma.

4 years agoor_patterns: add run-rustfix tests.
Mazdak Farrokhzad [Sun, 25 Aug 2019 03:45:51 +0000 (05:45 +0200)]
or_patterns: add run-rustfix tests.

4 years agoparser: gracefully handle `fn foo(A | B: type)`.
Mazdak Farrokhzad [Sun, 25 Aug 2019 02:39:28 +0000 (04:39 +0200)]
parser: gracefully handle `fn foo(A | B: type)`.

4 years agoAdd a period at the end of the sentence
Santiago Pastorino [Sat, 24 Aug 2019 22:26:25 +0000 (15:26 -0700)]
Add a period at the end of the sentence

4 years agoJoin arms patterns, body is empty in all arms
Santiago Pastorino [Sat, 24 Aug 2019 21:19:32 +0000 (14:19 -0700)]
Join arms patterns, body is empty in all arms

4 years agoAllow lifetime parameters to be inferred
Santiago Pastorino [Sat, 24 Aug 2019 21:16:56 +0000 (14:16 -0700)]
Allow lifetime parameters to be inferred

4 years agoAuto merge of #63873 - Centril:rollup-jgglypd, r=Centril
bors [Sun, 25 Aug 2019 00:47:28 +0000 (00:47 +0000)]
Auto merge of #63873 - Centril:rollup-jgglypd, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #62744 (Refactor `TinyList::contains` and `len` to iterate instead of recurse)
 - #63813 (Do not suggest `.try_into()` on `i32::from(x)`)
 - #63833 (Suggest calling closure with resolved return type when appropriate)
 - #63839 (Ensure miri can do bit ops on pointer values)
 - #63854 (Modifies how Arg, Arm, Field, FieldPattern and Variant are visited)
 - #63859 (Don't unwrap the result of `span_to_snippet`)

Failed merges:

r? @ghost

4 years agoRollup merge of #63859 - matthewjasper:check-snippet-result, r=Centril
Mazdak Farrokhzad [Sun, 25 Aug 2019 00:45:05 +0000 (02:45 +0200)]
Rollup merge of #63859 - matthewjasper:check-snippet-result, r=Centril

Don't unwrap the result of `span_to_snippet`

Closes #63800

4 years agoRollup merge of #63854 - c410-f3r:attrs-visit, r=petrochenkov
Mazdak Farrokhzad [Sun, 25 Aug 2019 00:45:04 +0000 (02:45 +0200)]
Rollup merge of #63854 - c410-f3r:attrs-visit, r=petrochenkov

Modifies how Arg, Arm, Field, FieldPattern and Variant are visited

Part of the necessary work to accomplish #63468.

4 years agoRollup merge of #63839 - oli-obk:intptrcast, r=RalfJung
Mazdak Farrokhzad [Sun, 25 Aug 2019 00:45:02 +0000 (02:45 +0200)]
Rollup merge of #63839 - oli-obk:intptrcast, r=RalfJung

Ensure miri can do bit ops on pointer values

r? @RalfJung

Fixes https://github.com/rust-lang/miri/issues/916

4 years agoRollup merge of #63833 - estebank:suggest-closure-call, r=petrochenkov
Mazdak Farrokhzad [Sun, 25 Aug 2019 00:45:01 +0000 (02:45 +0200)]
Rollup merge of #63833 - estebank:suggest-closure-call, r=petrochenkov

Suggest calling closure with resolved return type when appropriate

Follow up to #63337. CC #63100.

```
error[E0308]: mismatched types
  --> $DIR/fn-or-tuple-struct-without-args.rs:46:20
   |
LL |     let closure = || 42;
   |                   -- closure defined here
LL |     let _: usize = closure;
   |                    ^^^^^^^
   |                    |
   |                    expected usize, found closure
   |                    help: use parentheses to call this closure: `closure()`
   |
   = note: expected type `usize`
              found type `[closure@$DIR/fn-or-tuple-struct-without-args.rs:45:19: 45:24]`
```

4 years agoRollup merge of #63813 - estebank:int-from, r=varkor
Mazdak Farrokhzad [Sun, 25 Aug 2019 00:44:59 +0000 (02:44 +0200)]
Rollup merge of #63813 - estebank:int-from, r=varkor

Do not suggest `.try_into()` on `i32::from(x)`

Fix #63697.

4 years agoRollup merge of #62744 - llogiq:tiny-list-refactor, r=eddyb
Mazdak Farrokhzad [Sun, 25 Aug 2019 00:44:58 +0000 (02:44 +0200)]
Rollup merge of #62744 - llogiq:tiny-list-refactor, r=eddyb

Refactor `TinyList::contains` and `len` to iterate instead of recurse

None

4 years agoparser: 'while parsing this or-pattern...'
Mazdak Farrokhzad [Sat, 24 Aug 2019 23:50:21 +0000 (01:50 +0200)]
parser: 'while parsing this or-pattern...'

4 years agoparser: simplify parse_pat_with_or_{inner}
Mazdak Farrokhzad [Sat, 24 Aug 2019 23:00:19 +0000 (01:00 +0200)]
parser: simplify parse_pat_with_or_{inner}

4 years agotypeck/pat.rs: dedup in `check_pat_box`.
Mazdak Farrokhzad [Sat, 24 Aug 2019 22:27:55 +0000 (00:27 +0200)]
typeck/pat.rs: dedup in `check_pat_box`.

4 years agotypeck/pat.rs: dedup in `check_pat_ref`.
Mazdak Farrokhzad [Sat, 24 Aug 2019 22:08:28 +0000 (00:08 +0200)]
typeck/pat.rs: dedup in `check_pat_ref`.

4 years agoreview comment
Esteban Küber [Sat, 24 Aug 2019 21:54:35 +0000 (14:54 -0700)]
review comment

4 years agoparser: reword || recovery.
Mazdak Farrokhzad [Sat, 24 Aug 2019 21:44:28 +0000 (23:44 +0200)]
parser: reword || recovery.

4 years agoparser: extract recover_inner_leading_vert.
Mazdak Farrokhzad [Sat, 24 Aug 2019 21:10:46 +0000 (23:10 +0200)]
parser: extract recover_inner_leading_vert.

4 years agoparse_top_pat: silence leading vert gating sometimes.
Mazdak Farrokhzad [Sat, 24 Aug 2019 20:46:17 +0000 (22:46 +0200)]
parse_top_pat: silence leading vert gating sometimes.

4 years agoparser: bool -> TopLevel.
Mazdak Farrokhzad [Sat, 24 Aug 2019 20:12:19 +0000 (22:12 +0200)]
parser: bool -> TopLevel.

4 years agoparser: bool -> GateOr.
Mazdak Farrokhzad [Sat, 24 Aug 2019 19:43:28 +0000 (21:43 +0200)]
parser: bool -> GateOr.

4 years agoparser: better recovery for || in inner pats.
Mazdak Farrokhzad [Mon, 19 Aug 2019 00:40:24 +0000 (02:40 +0200)]
parser: better recovery for || in inner pats.

4 years agoor-patterns: harden feature gating tests.
Mazdak Farrokhzad [Sun, 18 Aug 2019 22:19:40 +0000 (00:19 +0200)]
or-patterns: harden feature gating tests.

4 years agomove `feature-gate-or_patterns.*` -> `ui/or-patterns/`
Mazdak Farrokhzad [Sun, 18 Aug 2019 21:57:43 +0000 (23:57 +0200)]
move `feature-gate-or_patterns.*` -> `ui/or-patterns/`

4 years agoor-patterns: add syntactic tests.
Mazdak Farrokhzad [Sun, 18 Aug 2019 21:53:08 +0000 (23:53 +0200)]
or-patterns: add syntactic tests.

4 years agomove `ui/or-pattern-mismatch` -> `ui/or-patterns/`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 21:07:21 +0000 (23:07 +0200)]
move `ui/or-pattern-mismatch` -> `ui/or-patterns/`.

4 years agoparser: drive-by: simplify `parse_arg_general`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 20:57:34 +0000 (22:57 +0200)]
parser: drive-by: simplify `parse_arg_general`.

4 years agoparser: `let` stmts & `for` exprs: allow or-patterns.
Mazdak Farrokhzad [Sun, 18 Aug 2019 20:54:07 +0000 (22:54 +0200)]
parser: `let` stmts & `for` exprs: allow or-patterns.

4 years agoparser: document `parse_pat`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 20:35:53 +0000 (22:35 +0200)]
parser: document `parse_pat`.

4 years agoparser: `parse_pats` -> `parse_top_pat{_unpack}`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 20:04:28 +0000 (22:04 +0200)]
parser: `parse_pats` -> `parse_top_pat{_unpack}`.

4 years agoparser: document `ban_unexpected_or_or`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 16:38:36 +0000 (18:38 +0200)]
parser: document `ban_unexpected_or_or`.

4 years agoparser: move `maybe_recover_unexpected_comma` to a more appropriate place.
Mazdak Farrokhzad [Sun, 18 Aug 2019 16:37:41 +0000 (18:37 +0200)]
parser: move `maybe_recover_unexpected_comma` to a more appropriate place.

4 years agoparser: use `eat_or_separator` for leading vert.
Mazdak Farrokhzad [Sun, 18 Aug 2019 16:34:35 +0000 (18:34 +0200)]
parser: use `eat_or_separator` for leading vert.

4 years agoparser: improve `parse_pat_with_or` docs.
Mazdak Farrokhzad [Sun, 18 Aug 2019 16:15:17 +0000 (18:15 +0200)]
parser: improve `parse_pat_with_or` docs.

4 years agoparser: extract `eat_or_separator`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 16:13:19 +0000 (18:13 +0200)]
parser: extract `eat_or_separator`.

4 years agoparser: integrate `maybe_recover_unexpected_comma` in `parse_pat_with_or`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 15:44:27 +0000 (17:44 +0200)]
parser: integrate `maybe_recover_unexpected_comma` in `parse_pat_with_or`.

4 years agoparser: extract `maybe_recover_unexpected_comma`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 15:11:12 +0000 (17:11 +0200)]
parser: extract `maybe_recover_unexpected_comma`.

4 years agoparser: simplify `parse_pat_with_or`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 14:55:52 +0000 (16:55 +0200)]
parser: simplify `parse_pat_with_or`.

4 years agoparser: `multiple-pattern-typo`: cover more or-pattern places.
Mazdak Farrokhzad [Sun, 18 Aug 2019 14:52:49 +0000 (16:52 +0200)]
parser: `multiple-pattern-typo`: cover more or-pattern places.

4 years agoparser: move `multiple-pattern-typo` -> `or-patterns` directory.
Mazdak Farrokhzad [Sun, 18 Aug 2019 14:45:08 +0000 (16:45 +0200)]
parser: move `multiple-pattern-typo` -> `or-patterns` directory.

4 years agoparser: improve or-patterns recovery.
Mazdak Farrokhzad [Sun, 18 Aug 2019 14:35:19 +0000 (16:35 +0200)]
parser: improve or-patterns recovery.

4 years agoparser: refactor `parse_pat_with_or` + use it in [p0, p1, ..] pats.
Mazdak Farrokhzad [Sun, 18 Aug 2019 13:45:44 +0000 (15:45 +0200)]
parser: refactor `parse_pat_with_or` + use it in [p0, p1, ..] pats.

4 years agoparser: type alias `type Expected = Option<&'static str>;`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 13:31:34 +0000 (15:31 +0200)]
parser: type alias `type Expected = Option<&'static str>;`.

4 years agoparser: extract `ban_unexpected_or_or`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 13:28:14 +0000 (15:28 +0200)]
parser: extract `ban_unexpected_or_or`.

4 years agoImprove the documentation for std::hint::black_box.
Edd Barrett [Tue, 23 Jul 2019 09:30:13 +0000 (10:30 +0100)]
Improve the documentation for std::hint::black_box.

4 years agotypeck/pat.rs: extract `error_inexistent_fields`.
Mazdak Farrokhzad [Sat, 24 Aug 2019 15:54:33 +0000 (17:54 +0200)]
typeck/pat.rs: extract `error_inexistent_fields`.

4 years agotypeck/pat.rs: extract `error_unmentioned_fields`.
Mazdak Farrokhzad [Sat, 24 Aug 2019 15:44:43 +0000 (17:44 +0200)]
typeck/pat.rs: extract `error_unmentioned_fields`.

4 years agotypeck/pat.rs: extract `error_field_already_bound`.
Mazdak Farrokhzad [Sat, 24 Aug 2019 15:34:15 +0000 (17:34 +0200)]
typeck/pat.rs: extract `error_field_already_bound`.

4 years agotypeck/pat.rs: extract diagnostics from `check_pat_slice`.
Mazdak Farrokhzad [Sat, 24 Aug 2019 14:42:15 +0000 (16:42 +0200)]
typeck/pat.rs: extract diagnostics from `check_pat_slice`.

4 years agotypeck/pat.rs: extract `new_ref_ty`.
Mazdak Farrokhzad [Sat, 24 Aug 2019 13:51:48 +0000 (15:51 +0200)]
typeck/pat.rs: extract `new_ref_ty`.

4 years agotypeck/pat.rs: some common imports.
Mazdak Farrokhzad [Sat, 24 Aug 2019 12:49:32 +0000 (14:49 +0200)]
typeck/pat.rs: some common imports.

4 years agotypeck/pat.rs: `check_pat_walk` -> `check_pat`.
Mazdak Farrokhzad [Sat, 24 Aug 2019 12:01:59 +0000 (14:01 +0200)]
typeck/pat.rs: `check_pat_walk` -> `check_pat`.

It's just shorter and we usually don't use the `_walk` suffix.

4 years agotypeck/pat.rs: `check_pat_top` is the entry point.
Mazdak Farrokhzad [Sat, 24 Aug 2019 11:47:07 +0000 (13:47 +0200)]
typeck/pat.rs: `check_pat_top` is the entry point.

This clarifies the fact that type checking patterns unconditionally
starts with `BindByValue` as the default binding mode making the
notion of a default binding mode internal to type checking patterns.

4 years agoAuto merge of #63858 - matthiaskrgr:submodule_upd, r=oli-obk
bors [Sat, 24 Aug 2019 17:49:35 +0000 (17:49 +0000)]
Auto merge of #63858 - matthiaskrgr:submodule_upd, r=oli-obk

submodules: update clippy from cd3df6be to 2bcb6155

Changes:
````
Refactor some minor things
Use more if-chains
Refactor 'lint_or_fun_call'
Refactor 'check_unwrap_or_default'
Refactor 'check_impl_item'
Add missing field to LitKind::Str
Run update_lints for Unicode lint
Re-add false positive check
Add raw string regression test for useless_format lint
Re-factor useless_format lint
Update Unicode lint tests
Add two more tests, allow 2 other lints.
Fix `temporary_cstring_as_ptr` false negative
Add more testcases for redundant_pattern_matching
Fix suggestions for redundant_pattern_matching
Add note on how to find the latest beta commit
Remove feature gate for async_await
Update if_chain doc link
Requested test cleanup
Requested changes
Ignore lines starting with '#'
run-rustfix for unseparated-prefix-literals
Add autofixable suggestion for unseparated integer literal suffices
Further text improvements
Add image
docs: Explain how to update the changelog
````

r? @oli-obk  @Manishearth

4 years agoDon't unwrap the result of `span_to_snippet`
Matthew Jasper [Sat, 24 Aug 2019 17:25:34 +0000 (18:25 +0100)]
Don't unwrap the result of `span_to_snippet`

It can return `Err` due to macros being expanded across crates or
files.

4 years agotypeck/pat.rs: `(*)` -> `(note_1)` for clarity.
Mazdak Farrokhzad [Sat, 24 Aug 2019 11:40:42 +0000 (13:40 +0200)]
typeck/pat.rs: `(*)` -> `(note_1)` for clarity.

4 years agotypeck/pat.rs: simplify `check_pat_walk`.
Mazdak Farrokhzad [Sat, 24 Aug 2019 03:13:57 +0000 (05:13 +0200)]
typeck/pat.rs: simplify `check_pat_walk`.

4 years agotypeck/pat.rs: extract `check_pat_slice`.
Mazdak Farrokhzad [Sat, 24 Aug 2019 03:08:49 +0000 (05:08 +0200)]
typeck/pat.rs: extract `check_pat_slice`.

4 years agotypeck/pat.rs: extract `check_pat_ref`.
Mazdak Farrokhzad [Sat, 24 Aug 2019 02:45:59 +0000 (04:45 +0200)]
typeck/pat.rs: extract `check_pat_ref`.

4 years agotypeck/pat.rs: extract `check_pat_box`.
Mazdak Farrokhzad [Sat, 24 Aug 2019 02:39:23 +0000 (04:39 +0200)]
typeck/pat.rs: extract `check_pat_box`.

4 years agotypeck/pat.rs: extract `check_pat_tuple`.
Mazdak Farrokhzad [Sat, 24 Aug 2019 02:30:03 +0000 (04:30 +0200)]
typeck/pat.rs: extract `check_pat_tuple`.

4 years agotypeck/pat.rs: extract `check_pat_ident`.
Mazdak Farrokhzad [Sat, 24 Aug 2019 02:19:16 +0000 (04:19 +0200)]
typeck/pat.rs: extract `check_pat_ident`.

4 years agotypeck/pat.rs: extract `check_pat_range`.
Mazdak Farrokhzad [Sat, 24 Aug 2019 01:59:15 +0000 (03:59 +0200)]
typeck/pat.rs: extract `check_pat_range`.

4 years agotypeck/pat.rs: extract `check_pat_lit`.
Mazdak Farrokhzad [Sat, 24 Aug 2019 01:52:09 +0000 (03:52 +0200)]
typeck/pat.rs: extract `check_pat_lit`.

4 years agotypeck/pat.rs: extract `calc_default_binding_mode`.
Mazdak Farrokhzad [Fri, 23 Aug 2019 14:06:33 +0000 (16:06 +0200)]
typeck/pat.rs: extract `calc_default_binding_mode`.

4 years agotypeck/pat.rs: simplify `peel_off_references`.
Mazdak Farrokhzad [Fri, 23 Aug 2019 13:55:35 +0000 (15:55 +0200)]
typeck/pat.rs: simplify `peel_off_references`.

4 years agotypeck/pat.rs: extract `peel_off_references` and define `def_bm` algorithm more decla...
Mazdak Farrokhzad [Fri, 23 Aug 2019 13:51:18 +0000 (15:51 +0200)]
typeck/pat.rs: extract `peel_off_references` and define `def_bm` algorithm more declaratively.

4 years agotypeck/pat.rs: extract `is_non_ref_pat`.
Mazdak Farrokhzad [Fri, 23 Aug 2019 13:31:38 +0000 (15:31 +0200)]
typeck/pat.rs: extract `is_non_ref_pat`.

4 years agotypeck/pat.rs: move note out of `check_dereferenceable` as it angers VSCode.
Mazdak Farrokhzad [Fri, 23 Aug 2019 13:05:58 +0000 (15:05 +0200)]
typeck/pat.rs: move note out of `check_dereferenceable` as it angers VSCode.

4 years agotypeck: move `check_pat_walk` and children to `pat.rs`.
Mazdak Farrokhzad [Fri, 23 Aug 2019 13:03:21 +0000 (15:03 +0200)]
typeck: move `check_pat_walk` and children to `pat.rs`.