]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #60160 - xldenis:fix-overlapping-zero-width-annotation, r=estebank
Mazdak Farrokhzad [Thu, 25 Apr 2019 01:05:24 +0000 (03:05 +0200)]
Rollup merge of #60160 - xldenis:fix-overlapping-zero-width-annotation, r=estebank

Fix #58270, fix off-by-one error in error diagnostics.

This fixes #58270 by checking if two diagnostics overlap completely when we're calculating the line offset for each message.

5 years agoRollup merge of #60038 - michaelwoerister:pgo-updates-2, r=alexcrichton
Mazdak Farrokhzad [Thu, 25 Apr 2019 01:05:22 +0000 (03:05 +0200)]
Rollup merge of #60038 - michaelwoerister:pgo-updates-2, r=alexcrichton

Add codegen test for PGO instrumentation.

This PR adds a codegen test that makes sure that LLVM actually generates instrumentation code when we enable PGO instrumentation in `rustc`.

The second commit updates a test case to the new commandline option syntax introduced in #59874. Without the fix the test still works, but it confusingly creates a directory called `test.profraw`, which usually is the name of the _file_ where profiling data is collected.

5 years agoRollup merge of #59697 - euclio:label-fixes, r=zackmdavis
Mazdak Farrokhzad [Thu, 25 Apr 2019 01:05:20 +0000 (03:05 +0200)]
Rollup merge of #59697 - euclio:label-fixes, r=zackmdavis

tweak unresolved label suggestion

Only suggest label names in the same hygiene context, and use a
structured suggestion.

Question for reviewer: Is this the right way to check for label hygiene?

5 years agoRollup merge of #59560 - matthewjasper:mir-generation-cleanup, r=oli-obk
Mazdak Farrokhzad [Thu, 25 Apr 2019 01:05:19 +0000 (03:05 +0200)]
Rollup merge of #59560 - matthewjasper:mir-generation-cleanup, r=oli-obk

MIR generation cleanup

* Handle the case where the body of a constant is a subtype of the type of the constant (see `mir_static_subtype.rs`).
* Move the evaluation of `ExprKind::Use` into `into.rs`, saving an unnecessary copy.

5 years agoEvaluate hair::ExprKind::Use in into
Matthew Jasper [Sat, 30 Mar 2019 13:05:33 +0000 (13:05 +0000)]
Evaluate hair::ExprKind::Use in into

This avoids some unnecessary moves

5 years agoAllow subtyping of the final expression of a constant
Matthew Jasper [Sat, 30 Mar 2019 13:00:41 +0000 (13:00 +0000)]
Allow subtyping of the final expression of a constant

Fixes an ICE for the following code:

fn foo(_ : &()) {}
static X: fn(&'static ()) = foo;

5 years agoRemove incorrect debug assertion in interpret
Matthew Jasper [Sat, 29 Dec 2018 21:10:00 +0000 (21:10 +0000)]
Remove incorrect debug assertion in interpret

Cast type may be a subtype of the destination type. There is a later
assertion that they have the same layout.

5 years agoAuto merge of #60180 - ehuss:update-cargo-books, r=alexcrichton
bors [Wed, 24 Apr 2019 15:19:57 +0000 (15:19 +0000)]
Auto merge of #60180 - ehuss:update-cargo-books, r=alexcrichton

Update cargo, books

## cargo

5 commits in b6581d383ed596b133e330011658c6f83cf85c2f..6be12653dcefb46ee7b605f063ee75b5e6cba513
2019-04-16 16:02:11 +0000 to 2019-04-19 15:05:03 +0000
- Improved docs for `maintenance` options (rust-lang/cargo#6863)
- publish-lockfile: Various updates (rust-lang/cargo#6840)
- Treat HTTP/2 stream errors as spurious network errors. (rust-lang/cargo#6861)
- Validate registry token before operations that require it. (rust-lang/cargo#6854)
- Cleanups wrt DYLD_FALLBACK_LIBRARY_PATH handling (rust-lang/cargo#6856)

## reference

2 commits in 98f90ff4de8e588f651f0fb493b5c7496551cd59..2a2de9ce095979978ad7b582daecf94e4070b916
2019-04-06 09:29:08 -0700 to 2019-04-22 10:25:52 -0700
- Remove unused link references. (rust-lang-nursery/reference#560)
- Fix attribute redirects. (rust-lang-nursery/reference#562)

## book

22 commits in b93ec30bbc7b1b5c2f44223249ab359bed2ed5a6..db919bc6bb9071566e9c4f05053672133eaac33e
2019-03-26 16:54:10 -0400 to 2019-04-15 20:11:03 -0400
- Link to chapters mentioned in chapter 12
- Split up a long sentence
- Unclear wording 4.3 (rust-lang/book#1907)
- Corrected error for array out of bounds (rust-lang/book#1900)
- Make lifetime explanation clearer (rust-lang/book#1901)
- Replace `T: 'a + Messenger` with `T: Messenger` (rust-lang/book#1831)
- Update range so matches rust-fmt . (rust-lang/book#1890)
- Adding trailing comma (rust-lang/book#1891)
- point 2018 book redirects to existing pages instead of index (rust-lang/book#1919)
- Update ch04-03-slices.md (rust-lang/book#1921)
- Update link for Russian translation. (rust-lang/book#1915)
- Ch7 layout (rust-lang/book#1917)
- Update the version of mdbook we use in-tree to match rust-lang/rust (rust-lang/book#1912)
- Fix spellingz
- Update listings in ch 19-6 for nostarch
- Add a high-level overview of the changes in this version of the book
- Fix Travis CI badge url (rust-lang/book#1893)
- Redo listing numbers in chapter 19 after removals
- Remove Advanced Lifetimes section completely
- Merge branch 'gh1780'
- Merge remote-tracking branch 'origin/master' into gh1567
- remove lifetime subtyping

## rust-by-example

4 commits in f68ef3d0f4959f6a7d92a08d9994b117f0f4d32d..1ff0f8e018838a710ebc0cc1a7bf74ebe73ad9f1
2019-03-12 15:32:12 -0300 to 2019-04-15 08:15:32 -0300
- Fix borrow so it fails in 2018 edition Fixes rust-lang/rust-by-example#1141 (rust-lang/rust-by-example#1152)
- Replace lvalue and rvalue with place and value (rust-lang/rust-by-example#1160)
- Mutate array in iter_mut() example (rust-lang/rust-by-example#1165)
- Fix a typo ("half" -> "halve") (rust-lang/rust-by-example#1172)

## rustc-guide

8 commits in 464cb5b166378dff64619081dd4c42533a1eb989..99e1b1d53656be08654df399fc200584aebb50e4
2019-03-23 18:39:14 -0500 to 2019-04-20 09:57:54 -0500
- Update BodyId description
- Update test-implementation chapter to current code
- update chalk with new organization
- move to subsection
- fix MovePathIndex link
- Update query chapter for the query macro rewrite
- subchapter with information about `--error-format json`
- Update query-evaluation-model-in-detail.md

## edition-guide

1 commits in b56ddb11548450a6df4edd1ed571b2bc304eb9e6..c413d42a207bd082f801ec0137c31b71e4bfed4c
2019-03-10 10:23:16 +0100 to 2019-04-22 01:14:56 +0200
- fix command (rust-lang-nursery/edition-guide#155)

## embedded-book

1 commits in 7989c723607ef5b13b57208022259e6c771e11d0..de3d55f521e657863df45260ebbca1b10527f662
2019-04-04 12:14:37 +0000 to 2019-04-22 12:58:28 +0000
- Minor fixes  (rust-embedded/book#185)

## nomicon

6 commits in c02e0e7754a76886e55b976a3a4fac20100cd35d..fb29b147be4d9a1f8e24aba753a7e1de537abf61
2019-03-25 16:52:56 -0400 to 2019-04-22 19:10:29 -0400
- Fix link to copy_nonoverlapping (rust-lang-nursery/nomicon#134)
- Various unchecked-uninit improvements (rust-lang-nursery/nomicon#130)
- OOM behaviour in `vec-alloc.md` (rust-lang-nursery/nomicon#133)
- Added missing "things". (rust-lang-nursery/nomicon#131)
- Fix number agreement in subtyping chapter (rust-lang-nursery/nomicon#128)
- Minor improvements (rust-lang-nursery/nomicon#129)

5 years agoFix ignore-logic for sanitizer run-make tests.
Michael Woerister [Wed, 24 Apr 2019 09:14:24 +0000 (11:14 +0200)]
Fix ignore-logic for sanitizer run-make tests.

5 years agoAuto merge of #60213 - Manishearth:clippyup, r=oli-obk
bors [Wed, 24 Apr 2019 06:09:05 +0000 (06:09 +0000)]
Auto merge of #60213 - Manishearth:clippyup, r=oli-obk

Update clippy

r? @oli-obk @centril

5 years agoUpdate cargo, books
Eric Huss [Mon, 22 Apr 2019 20:12:52 +0000 (13:12 -0700)]
Update cargo, books

5 years agoAuto merge of #60224 - Centril:rollup-lfuhhsk, r=Centril
bors [Wed, 24 Apr 2019 03:16:47 +0000 (03:16 +0000)]
Auto merge of #60224 - Centril:rollup-lfuhhsk, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #56278 (Future-proof MIR for dedicated debuginfo.)
 - #59739 (Stabilize futures_api)
 - #59822 (Fix dark css rule)
 - #60186 (Temporarily accept [i|u][32|size] suffixes on a tuple index and warn)
 - #60190 (Don't generate unnecessary rmeta files.)

Failed merges:

r? @ghost

5 years agoRollup merge of #60190 - nnethercote:less-metadata-gen, r=alexcrichton
Mazdak Farrokhzad [Wed, 24 Apr 2019 03:16:23 +0000 (05:16 +0200)]
Rollup merge of #60190 - nnethercote:less-metadata-gen, r=alexcrichton

Don't generate unnecessary rmeta files.

As per https://github.com/rust-lang/rust/pull/60006#issuecomment-484284191.

r? @alexcrichton

5 years agoRollup merge of #60186 - estebank:accept-suffix, r=nikomatsakis
Mazdak Farrokhzad [Wed, 24 Apr 2019 03:16:22 +0000 (05:16 +0200)]
Rollup merge of #60186 - estebank:accept-suffix, r=nikomatsakis

Temporarily accept [i|u][32|size] suffixes on a tuple index and warn

Fix #60138.

#59553 will need to be kept open to track the change back to rejecting this code a few versions down thee line.

5 years agoRollup merge of #59822 - GuillaumeGomez:fix-dark-theme-css, r=Manishearth
Mazdak Farrokhzad [Wed, 24 Apr 2019 03:16:20 +0000 (05:16 +0200)]
Rollup merge of #59822 - GuillaumeGomez:fix-dark-theme-css, r=Manishearth

Fix dark css rule

Fixes #59817.

r? @rust-lang/rustdoc

5 years agoRollup merge of #59739 - cramertj:stabilize, r=withoutboats
Mazdak Farrokhzad [Wed, 24 Apr 2019 03:16:18 +0000 (05:16 +0200)]
Rollup merge of #59739 - cramertj:stabilize, r=withoutboats

Stabilize futures_api

cc https://github.com/rust-lang/rust/issues/59725.
Based on https://github.com/rust-lang/rust/pull/59733 and https://github.com/rust-lang/rust/pull/59119 -- only the last two commits here are relevant.

r? @withoutboats , @oli-obk for the introduction of `rustc_allow_const_fn_ptr`.

5 years agoRollup merge of #56278 - eddyb:mir-debuginfo-proof, r=nikomatsakis
Mazdak Farrokhzad [Wed, 24 Apr 2019 03:16:17 +0000 (05:16 +0200)]
Rollup merge of #56278 - eddyb:mir-debuginfo-proof, r=nikomatsakis

Future-proof MIR for dedicated debuginfo.

This is #56231 without the last commit (the one that actually moves to `VarDebuginfo`).
Nothing should be broken, but it should no longer depend on debuginfo for anything else.

r? @nikomatsakis

5 years agoAuto merge of #58623 - Amanieu:hashbrown3, r=alexcrichton
bors [Wed, 24 Apr 2019 00:20:56 +0000 (00:20 +0000)]
Auto merge of #58623 - Amanieu:hashbrown3, r=alexcrichton

Replace HashMap implementation with SwissTable (as an external crate)

This is the same as #56241 except that it imports `hashbrown` as an external crate instead of copying the implementation into libstd.

This includes a few API changes (all unstable):
- `try_reserve` is added to `HashSet`.
- Some trait bounds have been changed in the `raw_entry` API.
- `search_bucket` has been removed from the `raw_entry` API (doesn't work with SwissTable).

5 years agoDon't generate unnecessary rmeta files.
Nicholas Nethercote [Tue, 23 Apr 2019 23:08:25 +0000 (09:08 +1000)]
Don't generate unnecessary rmeta files.

5 years agoStabilize futures_api
Taylor Cramer [Fri, 5 Apr 2019 21:14:19 +0000 (14:14 -0700)]
Stabilize futures_api

5 years agoAdd rustc_allow_const_fn_ptr
Taylor Cramer [Fri, 5 Apr 2019 21:13:44 +0000 (14:13 -0700)]
Add rustc_allow_const_fn_ptr

5 years agoUpdate hashbrown to 0.3.0
Amanieu d'Antras [Mon, 22 Apr 2019 22:31:52 +0000 (06:31 +0800)]
Update hashbrown to 0.3.0

5 years agoUpdate hashbrown to 0.2.2
Amanieu d'Antras [Tue, 16 Apr 2019 12:47:20 +0000 (13:47 +0100)]
Update hashbrown to 0.2.2

5 years agoRemove stabilized alloc feature from rustc-std-workspace-alloc
Amanieu d'Antras [Tue, 16 Apr 2019 09:44:38 +0000 (10:44 +0100)]
Remove stabilized alloc feature from rustc-std-workspace-alloc

5 years agoUpdate hashbrown to 0.2.1
Amanieu d'Antras [Sun, 14 Apr 2019 10:48:53 +0000 (11:48 +0100)]
Update hashbrown to 0.2.1

5 years agoRemove broken tests
Amanieu d'Antras [Fri, 22 Feb 2019 19:11:48 +0000 (19:11 +0000)]
Remove broken tests

5 years agoFix test
Amanieu d'Antras [Fri, 22 Feb 2019 13:25:10 +0000 (13:25 +0000)]
Fix test

5 years agoReplace the robin-hood hash table with hashbrown
Amanieu d'Antras [Wed, 20 Feb 2019 11:13:35 +0000 (11:13 +0000)]
Replace the robin-hood hash table with hashbrown

5 years agoMake libstd depend on the hashbrown crate
Amanieu d'Antras [Thu, 7 Feb 2019 11:08:05 +0000 (12:08 +0100)]
Make libstd depend on the hashbrown crate

5 years agoMark HashSet functions with #[inline]
Amanieu d'Antras [Thu, 7 Feb 2019 11:28:38 +0000 (12:28 +0100)]
Mark HashSet functions with #[inline]

5 years agoAdd try_reserve to HashSet
Amanieu d'Antras [Thu, 7 Feb 2019 11:28:27 +0000 (12:28 +0100)]
Add try_reserve to HashSet

5 years agoRemove the Recover trait for HashSet
Amanieu d'Antras [Thu, 7 Feb 2019 11:08:37 +0000 (12:08 +0100)]
Remove the Recover trait for HashSet

5 years agoreview comment: change linked ticket
Esteban Küber [Tue, 23 Apr 2019 21:31:42 +0000 (14:31 -0700)]
review comment: change linked ticket

5 years agorustc_mir: create the `let` and "remainder" scopes in source order.
Eduard-Mihai Burtescu [Fri, 1 Jun 2018 16:25:28 +0000 (19:25 +0300)]
rustc_mir: create the `let` and "remainder" scopes in source order.

5 years agorustc_mir: pretty-print all locals into their respective scopes.
Eduard-Mihai Burtescu [Thu, 17 May 2018 15:32:47 +0000 (18:32 +0300)]
rustc_mir: pretty-print all locals into their respective scopes.

5 years agorustc_mir: don't rely on mir::LocalDecl `visibility_scope`s in the MIR borrowck.
Eduard-Mihai Burtescu [Tue, 27 Nov 2018 03:19:07 +0000 (05:19 +0200)]
rustc_mir: don't rely on mir::LocalDecl `visibility_scope`s in the MIR borrowck.

5 years agorustc: dissuade compiler developers from misusing upvar debuginfo.
Eduard-Mihai Burtescu [Mon, 26 Nov 2018 19:40:05 +0000 (21:40 +0200)]
rustc: dissuade compiler developers from misusing upvar debuginfo.

5 years agorustc_codegen_ssa: rename debuginfo_upvar_decls_ops_sequence to debuginfo_upvar_ops_s...
Eduard-Mihai Burtescu [Mon, 26 Nov 2018 19:03:15 +0000 (21:03 +0200)]
rustc_codegen_ssa: rename debuginfo_upvar_decls_ops_sequence to debuginfo_upvar_ops_sequence.

5 years agorustc_mir: don't use upvar_decls in the miri validity checks.
Eduard-Mihai Burtescu [Mon, 26 Nov 2018 18:58:59 +0000 (20:58 +0200)]
rustc_mir: don't use upvar_decls in the miri validity checks.

5 years agorustc_mir: don't use upvar_decls in the generator state transform.
Eduard-Mihai Burtescu [Wed, 16 May 2018 12:48:11 +0000 (15:48 +0300)]
rustc_mir: don't use upvar_decls in the generator state transform.

5 years agorustc: don't track var_hir_id or mutability in mir::UpvarDecl.
Eduard-Mihai Burtescu [Wed, 16 May 2018 12:40:32 +0000 (15:40 +0300)]
rustc: don't track var_hir_id or mutability in mir::UpvarDecl.

5 years agoUpdate clippy
Manish Goregaokar [Tue, 23 Apr 2019 20:05:45 +0000 (13:05 -0700)]
Update clippy

5 years agoAuto merge of #60211 - Centril:rollup-akw4r85, r=Centril
bors [Tue, 23 Apr 2019 19:52:05 +0000 (19:52 +0000)]
Auto merge of #60211 - Centril:rollup-akw4r85, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #59823 ([wg-async-await] Drop `async fn` arguments in async block )
 - #59839 (Warn on unused results for operation methods on nums)
 - #60146 (Update fonts used by rustdoc)
 - #60169 (Warn when ignore-tidy-linelength is present, but no lines are too long)
 - #60177 (Promote rust comments to rustdoc)
 - #60191 (Add f16c target_feature)

Failed merges:

r? @ghost

5 years agoRollup merge of #60191 - gnzlbg:f16c, r=alexcrichton
Mazdak Farrokhzad [Tue, 23 Apr 2019 19:51:00 +0000 (21:51 +0200)]
Rollup merge of #60191 - gnzlbg:f16c, r=alexcrichton

Add f16c target_feature

This is requires for Intel 16-bit half-precision float intrinsics: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=fp16&expand=1769 - see companion stdsimd PR: https://github.com/rust-lang-nursery/stdsimd/pull/737.

LLVM, Wikipedia CPUID page, and the Intel Dev Manual all call this CPUID feature "F16C", but the Intel intrinsics guide calls this "FP16C" - this is probably a bug in the intrinsics guide which we are tracking here: https://github.com/rust-lang-nursery/stdsimd/issues/738

r? @alexcrichton

5 years agoRollup merge of #60177 - rasendubi:rustdoc-comments, r=varkor
Mazdak Farrokhzad [Tue, 23 Apr 2019 19:50:58 +0000 (21:50 +0200)]
Rollup merge of #60177 - rasendubi:rustdoc-comments, r=varkor

Promote rust comments to rustdoc

5 years agoRollup merge of #60169 - varkor:tidy-unnecessary-ignore-newline, r=kennytm
Mazdak Farrokhzad [Tue, 23 Apr 2019 19:50:57 +0000 (21:50 +0200)]
Rollup merge of #60169 - varkor:tidy-unnecessary-ignore-newline, r=kennytm

Warn when ignore-tidy-linelength is present, but no lines are too long

It's easy for a `// ignore-tidy-linelength` to be added when there is a genuine need to ignore a file's line length, but then after refactoring the need is gone, but the tidy directive is not removed. This means that in the future, further editing may accidentally add unnecessarily long lines. This change forces `// ignore-tidy-linelength` to be used exactly when necessary, to make sure such changes are intentional.

5 years agoRollup merge of #60146 - Manishearth:font-update, r=QuietMisdreavus
Mazdak Farrokhzad [Tue, 23 Apr 2019 19:50:55 +0000 (21:50 +0200)]
Rollup merge of #60146 - Manishearth:font-update, r=QuietMisdreavus

Update fonts used by rustdoc

Our version of Source Serif Pro is pretty old and is causing issues on Linux, see https://bugzilla.mozilla.org/show_bug.cgi?id=1545317 . I took this opportunity to update all of the fonts we use.

r? @steveklabnik @QuietMisdreavus

5 years agoRollup merge of #59839 - KodrAus:must-use-num, r=sfackler
Mazdak Farrokhzad [Tue, 23 Apr 2019 19:50:54 +0000 (21:50 +0200)]
Rollup merge of #59839 - KodrAus:must-use-num, r=sfackler

Warn on unused results for operation methods on nums

From a suggestion by @llogiq

Adds a `#[must_use]` attribute to operation methods on integers that take self by value as the first operand and another value as the second. It makes it clear that these methods return the result of the operation instead of mutating `self`, which is the source of a rather embarrassing bug I had in a codebase of mine recently...

As an example:

```rust
struct Int {
   value: i64,
}

impl Int {
    fn add(&mut self, other: i64) {
        self.value.wrapping_add(other);
    }
}
```

Will produce a warning like:

```
warning: unused return value of `core::num::<impl i64>::wrapping_add` that must be used
 --> src/main.rs:7:7
  |
7 |       self.value.wrapping_add(other);
  |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: #[warn(unused_must_use)] on by default
  = note: this returns the result of the operation, without modifying the original
```

If this is something we're on board with, we could do something similar for `f32` and `f64` too. There are probably other methods on integers that make sense.

5 years agoRollup merge of #59823 - davidtwco:issue-54716, r=cramertj
Mazdak Farrokhzad [Tue, 23 Apr 2019 19:50:52 +0000 (21:50 +0200)]
Rollup merge of #59823 - davidtwco:issue-54716, r=cramertj

[wg-async-await] Drop `async fn` arguments in async block

Fixes #54716.

This PR modifies the HIR lowering (and some other places to make this work) so that unused arguments to a async function are always dropped inside the async move block and not at the end of the function body.

```
async fn foo(<pattern>: <type>) {
  async move {
  }
} // <-- dropped as you "exit" the fn

// ...becomes...
fn foo(__arg0: <ty>) {
  async move {
    let <pattern>: <ty> = __arg0;
  } // <-- dropped as you "exit" the async block
}
```

However, the exact ordering of drops is not the same as a regular function, [as visible in this playground example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=be39af1a58e5d430be1eb3c722cb1ec3) - I believe this to be an unrelated issue. There is a [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/187312-t-compiler.2Fwg-async-await/topic/.2354716.20drop.20order) for this.

r? @cramertj
cc @nikomatsakis

5 years agoReduce noise and document test case.
David Wood [Tue, 23 Apr 2019 17:44:41 +0000 (18:44 +0100)]
Reduce noise and document test case.

This commit introduces a `assert_drop_order_after_poll` helper function
to the test case for this case to reduce repetitive noise and documents
what each function aims to test.

5 years agoAuto merge of #60155 - davidtwco:issue-59819, r=oli-obk
bors [Tue, 23 Apr 2019 15:54:23 +0000 (15:54 +0000)]
Auto merge of #60155 - davidtwco:issue-59819, r=oli-obk

Suggest dereferencing when `Deref` is implemented.

Fixes #59819.

r? @oli-obk
cc @estebank

5 years agorustc_mir: don't rely on mir::UpvarDecl in the MIR borrowck.
Eduard-Mihai Burtescu [Wed, 16 May 2018 12:38:32 +0000 (15:38 +0300)]
rustc_mir: don't rely on mir::UpvarDecl in the MIR borrowck.

5 years agoAuto merge of #60152 - stepnivlk:visit_subpats-removal, r=varkor
bors [Tue, 23 Apr 2019 12:27:38 +0000 (12:27 +0000)]
Auto merge of #60152 - stepnivlk:visit_subpats-removal, r=varkor

Remove `visit_subpats` parameter from `check_pat`

The core idea is to keep track of current ID directly in `EllipsisInclusiveRangePatterns` struct and early return in `check_pat` based on it.

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

r? @varkor

5 years agoFix regression in line ending test
varkor [Tue, 23 Apr 2019 10:44:27 +0000 (11:44 +0100)]
Fix regression in line ending test

5 years agoRemove unnecessary tidy ignore directives
varkor [Mon, 22 Apr 2019 19:56:27 +0000 (20:56 +0100)]
Remove unnecessary tidy ignore directives

5 years agoCheck for other unused tidy check directives
varkor [Mon, 22 Apr 2019 19:56:13 +0000 (20:56 +0100)]
Check for other unused tidy check directives

5 years agoUpdate ui tests
varkor [Mon, 22 Apr 2019 16:35:37 +0000 (17:35 +0100)]
Update ui tests

5 years agoRemove unnecessary ignore-tidy-linelength
varkor [Mon, 22 Apr 2019 15:15:50 +0000 (16:15 +0100)]
Remove unnecessary ignore-tidy-linelength

5 years agoTidy warn on ignored line length when lines are not too long
varkor [Mon, 22 Apr 2019 15:15:39 +0000 (16:15 +0100)]
Tidy warn on ignored line length when lines are not too long

5 years agoLook specifically for comments containing tidy ignore directives
varkor [Mon, 22 Apr 2019 15:15:18 +0000 (16:15 +0100)]
Look specifically for comments containing tidy ignore directives

5 years agoAuto merge of #60125 - estebank:continue-evaluating, r=oli-obk
bors [Tue, 23 Apr 2019 09:38:34 +0000 (09:38 +0000)]
Auto merge of #60125 - estebank:continue-evaluating, r=oli-obk

Don't stop evaluating due to errors before borrow checking

r? @oli-obk

Fix #60005. Follow up to #59903. Blocked on #53708, fixing the ICE in `src/test/ui/consts/match_ice.rs`.

5 years agoAdd f16c target_feature
gnzlbg [Tue, 23 Apr 2019 06:43:13 +0000 (08:43 +0200)]
Add f16c target_feature

5 years agoAuto merge of #60172 - varkor:tidy-double-trailing-newline, r=kennytm
bors [Tue, 23 Apr 2019 06:40:12 +0000 (06:40 +0000)]
Auto merge of #60172 - varkor:tidy-double-trailing-newline, r=kennytm

Disallow double trailing newlines in tidy

This wasn't done previously in https://github.com/rust-lang/rust/pull/47064#issuecomment-354533010 as it affected too many files, but I think it's best to fix it now so that the number of files with double trailing newlines doesn't keep increasing.

r? kennytm

5 years agoAuto merge of #60121 - davazp:fix-sync-all-macos, r=KodrAus
bors [Tue, 23 Apr 2019 03:34:21 +0000 (03:34 +0000)]
Auto merge of #60121 - davazp:fix-sync-all-macos, r=KodrAus

Fix sync_all on macos/ios

`sync_all` should flush all metadata in macos/ios, so it should call `fcntl` with the `F_FULLFSYNC` flag as `sync_data` does.

Note that without this `sync_data` performs more flushes than `sync_all` on macos/ios.

5 years agoAuto merge of #60140 - euclio:pulldown-cmark, r=GuillaumeGomez
bors [Tue, 23 Apr 2019 00:44:58 +0000 (00:44 +0000)]
Auto merge of #60140 - euclio:pulldown-cmark, r=GuillaumeGomez

upgrade rustdoc's pulldown-cmark to 0.4.1

Fixes #59194.

5 years agoFix #58270, fix off-by-one error in error diagnostics.
Xavier Denis [Tue, 16 Apr 2019 22:26:41 +0000 (19:26 -0300)]
Fix #58270, fix off-by-one error in error diagnostics.

5 years agoTemporarily accept [i|u][32|size] suffixes on a tuple index and warn
Esteban Küber [Mon, 22 Apr 2019 22:55:45 +0000 (15:55 -0700)]
Temporarily accept [i|u][32|size] suffixes on a tuple index and warn

5 years agoAuto merge of #60126 - estebank:continue-eval, r=oli-obk
bors [Mon, 22 Apr 2019 21:46:07 +0000 (21:46 +0000)]
Auto merge of #60126 - estebank:continue-eval, r=oli-obk

Continue evaluating after item-type checking

Fix #30999.

r? @oli-obk

5 years agoRemove visit_subpats from check_pat in favor of state in EllipsisInclusiveRangePatterns
Tomas Koutsky [Sun, 21 Apr 2019 14:09:30 +0000 (17:09 +0300)]
Remove visit_subpats from check_pat in favor of state in EllipsisInclusiveRangePatterns

5 years agoreview comment: add HACK comment
Esteban Küber [Mon, 22 Apr 2019 20:14:43 +0000 (13:14 -0700)]
review comment: add HACK comment

5 years agoFix ICE related to #53708
Esteban Küber [Fri, 19 Apr 2019 21:53:34 +0000 (14:53 -0700)]
Fix ICE related to #53708

5 years agoNever stop due to errors before borrow checking
Esteban Küber [Mon, 15 Apr 2019 19:54:18 +0000 (12:54 -0700)]
Never stop due to errors before borrow checking

5 years agoRemove needless error in test
Esteban Küber [Mon, 22 Apr 2019 19:19:07 +0000 (12:19 -0700)]
Remove needless error in test

5 years agoreview comments: deduplicate tests
Esteban Küber [Mon, 22 Apr 2019 19:11:46 +0000 (12:11 -0700)]
review comments: deduplicate tests

5 years agoUpdate ui tests
varkor [Mon, 22 Apr 2019 18:50:11 +0000 (19:50 +0100)]
Update ui tests

5 years agoPromote rust comments to rustdoc
Alexey Shmalko [Mon, 22 Apr 2019 18:29:11 +0000 (21:29 +0300)]
Promote rust comments to rustdoc

5 years agoContinue evaluating after item-type checking
Esteban Küber [Fri, 19 Apr 2019 22:37:34 +0000 (15:37 -0700)]
Continue evaluating after item-type checking

5 years agoOnly make suggestion when type is `Copy`.
David Wood [Mon, 22 Apr 2019 09:16:47 +0000 (10:16 +0100)]
Only make suggestion when type is `Copy`.

This commit makes the suggestion to dereference when a type implements
`Deref` only apply if the dereference would succeed (ie. the type is
`Copy`, otherwise a borrow check error would occur).

5 years agoAuto merge of #60168 - varkor:tidy-leading-newline, r=alexcrichton
bors [Mon, 22 Apr 2019 16:30:42 +0000 (16:30 +0000)]
Auto merge of #60168 - varkor:tidy-leading-newline, r=alexcrichton

Add a tidy check for leading newlines

This is fairly uncommon, but it can slip through when refactoring (as evidenced by the files with leading newlines here).

5 years agoUpdate ui tests
varkor [Mon, 22 Apr 2019 16:30:54 +0000 (17:30 +0100)]
Update ui tests

5 years agoRemove leading newlines
varkor [Mon, 22 Apr 2019 14:50:02 +0000 (15:50 +0100)]
Remove leading newlines

5 years agoAdd a tidy check for leading trailing newlines
varkor [Mon, 22 Apr 2019 14:49:51 +0000 (15:49 +0100)]
Add a tidy check for leading trailing newlines

5 years agoDisallow double trailing newlines in tidy
varkor [Mon, 22 Apr 2019 15:56:47 +0000 (16:56 +0100)]
Disallow double trailing newlines in tidy

5 years agoRemove double trailing newlines
varkor [Mon, 22 Apr 2019 15:55:33 +0000 (16:55 +0100)]
Remove double trailing newlines

5 years agoupgrade rustdoc's pulldown-cmark to 0.4.1
Andy Russell [Sat, 20 Apr 2019 17:03:59 +0000 (13:03 -0400)]
upgrade rustdoc's pulldown-cmark to 0.4.1

5 years agoAuto merge of #59114 - matthewjasper:enable-migate-2015, r=pnkfelix
bors [Mon, 22 Apr 2019 12:09:59 +0000 (12:09 +0000)]
Auto merge of #59114 - matthewjasper:enable-migate-2015, r=pnkfelix

Enable NLL migrate mode on the 2015 edition

## What is in this PR?

* Remove the `-Zborrowck=ast` flag option from rustc.
* The default in the 2015 edition is now `-Zborrowck=migrate`.
* The 2018 edition default is unchanged: it's still `-Zborrowck=migrate`.
* Enable two-phase borrows (currently toggled via the `-Ztwo-phase-borrows` flag) on all editions.
* Remove most dead code that handled these options.
* Update tests for the above changes.

## What is *not* in this PR?

These are left for future PRs

* Use `-Zborrowck=mir` in NLL compare mode tests (#56993)
* Remove the `-Zborrowck=compare` option (#59193)
* Remove the `-Ztwo-phase-borrows` flag. It's kept, as a flag that does nothing so that perf.rlo has time to stop using it (cc @Mark-Simulacrum)
* Remove MIR typeck as its own MIR pass - it's now run by NLL.
* Enabling `-Zborrowck=mir` by default (#58781)
* Replace `allow_bind_by_move_patterns_with_guards` and `check_for_mutation_in_guard_via_ast_walk` with just using the feature gate. (#59192)

Soundness issues that are fixed by NLL will stay open until full NLL is emitting hard errors. However, these diagnostics and completeness issues can now be closed:

Closes #18330
Closes #22323
Closes #23591
Closes #26736
Closes #27487
Closes #28092
Closes #28970
Closes #29733
Closes #30104
Closes #38915
Closes #39908
Closes #43407
Closes #47524
Closes #48540
Closes #49073
Closes #52614
Closes #55085
Closes #56093
Closes #56496
Closes #57804

cc #43234

r? @pnkfelix
cc @rust-lang/lang
cc @rust-lang/wg-compiler-nll

5 years agoupdate tests for migrate mode by default
Matthew Jasper [Mon, 22 Apr 2019 07:40:08 +0000 (08:40 +0100)]
update tests for migrate mode by default

5 years agoAuto merge of #60133 - phansch:deny_rust_2018_idioms, r=Centril
bors [Mon, 22 Apr 2019 07:28:20 +0000 (07:28 +0000)]
Auto merge of #60133 - phansch:deny_rust_2018_idioms, r=Centril

Deny rust_2018_idioms globally

cc https://github.com/rust-lang/rust/issues/58099#issuecomment-484921194

5 years agoAuto merge of #60053 - Xanewok:serde-save-analysis, r=nrc
bors [Mon, 22 Apr 2019 01:46:13 +0000 (01:46 +0000)]
Auto merge of #60053 - Xanewok:serde-save-analysis, r=nrc

save-analysis: Use serde instead of libserialize to dump JSON data

This breaks the save-analysis infrastructure (which also includes `rls-{analysis, data, span}` crates) from depending on rustc_serialize and so we can start moving them to being supported on stable without implementing `Decodable` et al. by hand for data structures defined there.

Notable benefits:
- we drop the awkward raw byte `PathBuf` [serialization](https://gist.github.com/Xanewok/f4fe8564d0dc0c3ab1dbc244279ff895) (until now (de)serialized as `&[u8]`)
- [faster](https://github.com/serde-rs/json-benchmark) (hopefully noticeable for inner crate dependencies for the RLS workloads)
- we can easily explore the binary serialization backend (which we planned to do for save-analysis anyway)

~This should be merged together with an update to RLS (https://github.com/rust-lang/rls/pull/1435), which technically could be included right now because we can use the bundled `rls-analysis` here directly, however I'd prefer to publish this to crates.io first (https://github.com/rust-lang/rls/pull/1434, cc @nrc) and use the published version, instead.~
Includes https://github.com/rust-lang/rls/pull/1436.

@matklad @nikomatsakis This is also important for the potential RLS 1.0 - 2.0 bridge we talked about on Zulip today

5 years agoAuto merge of #60158 - Xanewok:update-clippy, r=matthiaskrgr
bors [Sun, 21 Apr 2019 21:46:15 +0000 (21:46 +0000)]
Auto merge of #60158 - Xanewok:update-clippy, r=matthiaskrgr

Update Clippy

Fixes fallout from https://github.com/rust-lang/rust/pull/60124.
Closes #60154.

r? @oli-obk
cc @matthiaskrgr

5 years agoUpdate Clippy
Igor Matuszewski [Sun, 21 Apr 2019 21:03:27 +0000 (23:03 +0200)]
Update Clippy

Fixes fallout from https://github.com/rust-lang/rust/pull/60124.
Closes #60154.

5 years agoEnable migrate mode by default on the 2015 edition
Matthew Jasper [Sat, 26 Jan 2019 17:25:37 +0000 (17:25 +0000)]
Enable migrate mode by default on the 2015 edition

This also fully stabilizes two-phase borrows on all editions

5 years agoSuggest dereferencing when `Deref` is implemented.
David Wood [Sun, 21 Apr 2019 19:00:32 +0000 (20:00 +0100)]
Suggest dereferencing when `Deref` is implemented.

This commit suggests dereferencing a type when it implements `Deref`
with the correct `Output` associated type.

5 years agoAdd existing behaviour test for deref suggestions.
David Wood [Sun, 21 Apr 2019 17:49:02 +0000 (18:49 +0100)]
Add existing behaviour test for deref suggestions.

This commit adds a test that demonstrates the current behaviour where
suggestions to add a dereference aren't given for non-references.

5 years agoDisplay original pattern in rustdoc.
David Wood [Sun, 21 Apr 2019 13:33:28 +0000 (14:33 +0100)]
Display original pattern in rustdoc.

This commit displays the original pattern in generated documentation for
async functions rather than the synthesized pattern.

5 years agoCorrect lowering order to avoid ICE after rebase.
David Wood [Sat, 20 Apr 2019 23:04:10 +0000 (00:04 +0100)]
Correct lowering order to avoid ICE after rebase.

This commit changes the order that arguments and bodies of async
functions are lowered so that when the body attempts to `lower_def` of a
upvar then the id has already been assigned by lowering the argument
first.

5 years agoIntroduce `ArgSource` for diagnostics.
David Wood [Wed, 13 Mar 2019 16:10:27 +0000 (17:10 +0100)]
Introduce `ArgSource` for diagnostics.

This commit introduces an `ArgSource` enum that is lowered into the HIR
so that diagnostics can correctly refer to the argument pattern's
original name rather than the generated pattern.

5 years agoDo not specify type in generated let bindings.
David Wood [Wed, 13 Mar 2019 16:08:34 +0000 (17:08 +0100)]
Do not specify type in generated let bindings.

This avoids issues with `impl_trait_in_bindings` as the type from the
argument is normally used as the let binding, but `impl Trait` is
unstable in binding position.

5 years agoEnforce consistent drop order w/ async methods.
David Wood [Wed, 13 Mar 2019 09:45:36 +0000 (10:45 +0100)]
Enforce consistent drop order w/ async methods.

This commit extends the previous commit to apply to trait methods as
well as free functions.

5 years agoMove `async fn` arguments into closure.
David Wood [Tue, 12 Mar 2019 16:12:18 +0000 (17:12 +0100)]
Move `async fn` arguments into closure.

This commit takes advantage of `AsyncArgument` type that was added in a
previous commit to replace the arguments of the `async fn` in the HIR
and add statements to move the bindings from the new arguments to the
pattern from the old argument.

For example, the async function `foo` below:

    async fn foo((x, _y): (T, V)) {
        async move {
        }
    }

becomes:

    async fn foo(__arg0: (T, V)) {
        async move {
            let (x, _y) = __arg0;
        }
    }