]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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;
        }
    }

5 years agoAdd `AsyncArgument` to AST.
David Wood [Tue, 12 Mar 2019 16:00:20 +0000 (17:00 +0100)]
Add `AsyncArgument` to AST.

This commit adds an `AsyncArgument` struct to the AST that contains the
generated argument and statement that will be used in HIR lowering, name
resolution and def collection.

5 years agoUse sysroot libserialize in newtype_index test
Igor Matuszewski [Sun, 21 Apr 2019 13:51:28 +0000 (15:51 +0200)]
Use sysroot libserialize in newtype_index test

5 years agoAuto merge of #60124 - petrochenkov:stanomut, r=eddyb
bors [Sun, 21 Apr 2019 13:40:22 +0000 (13:40 +0000)]
Auto merge of #60124 - petrochenkov:stanomut, r=eddyb

Remove mutability from `Def::Static`

Querify `TyCtxt::is_static`.
Use `Mutability` instead of bool in foreign statics in AST/HIR.

cc https://github.com/rust-lang/rust/pull/60110
r? @eddyb

5 years agoAST/HIR: Use `Mutability` instead of bool in foreign statics
Vadim Petrochenkov [Sun, 21 Apr 2019 12:29:58 +0000 (15:29 +0300)]
AST/HIR: Use `Mutability` instead of bool in foreign statics

5 years agoRemove mutability from `Def::Static`
Vadim Petrochenkov [Fri, 19 Apr 2019 20:32:26 +0000 (23:32 +0300)]
Remove mutability from `Def::Static`

5 years agoChange return type of `TyCtxt::is_static` to bool
Vadim Petrochenkov [Sun, 21 Apr 2019 11:41:51 +0000 (14:41 +0300)]
Change return type of `TyCtxt::is_static` to bool

Add `TyCtxt::is_mutable_static`

5 years agoIntroduce query `static_mutability`
Vadim Petrochenkov [Fri, 19 Apr 2019 20:32:26 +0000 (23:32 +0300)]
Introduce query `static_mutability`

5 years agoSwitch to serde-enabled rls-* and update RLS appropriately
Igor Matuszewski [Sun, 21 Apr 2019 10:52:07 +0000 (12:52 +0200)]
Switch to serde-enabled rls-* and update RLS appropriately

This also bumps RLS version to 1.36.
The updated rls-* packages use serde but *not* serde_derive thanks to
manual proc macro expansion. This is a hack, since rustc cannot handle
crates.io proc macros (duplicated in tools) when cross-compiling, so
that's the best we can do in order to support serde_json in save-analysis.

5 years agosave-analysis: Use serde instead of libserialize to dump JSON data
Igor Matuszewski [Wed, 17 Apr 2019 19:34:35 +0000 (21:34 +0200)]
save-analysis: Use serde instead of libserialize to dump JSON data

5 years agoAuto merge of #60119 - estebank:bad-recovery, r=davidtwco
bors [Sun, 21 Apr 2019 10:13:27 +0000 (10:13 +0000)]
Auto merge of #60119 - estebank:bad-recovery, r=davidtwco

Remove assumption from recovery code

Fix #60115.

5 years agoAllow unused_extern_crates for rustc_libserialize
Philipp Hansch [Sun, 21 Apr 2019 08:52:12 +0000 (10:52 +0200)]
Allow unused_extern_crates for rustc_libserialize

5 years agoIntroduce `LocalSource` into the AST.
David Wood [Tue, 12 Mar 2019 15:53:33 +0000 (16:53 +0100)]
Introduce `LocalSource` into the AST.

This will be used to keep track of the origin of a local in the AST. In
particular, it will be used by `async fn` lowering for the locals in
`let <pat>: <ty> = __arg0;` statements.

5 years agoAdd test for drop order in async functions.
David Wood [Thu, 7 Mar 2019 22:15:57 +0000 (23:15 +0100)]
Add test for drop order in async functions.

This tests that async functions drop parameters in the same order as
regular functions.

5 years agoAuto merge of #60132 - davidtwco:issue-60075, r=estebank
bors [Sun, 21 Apr 2019 07:20:14 +0000 (07:20 +0000)]
Auto merge of #60132 - davidtwco:issue-60075, r=estebank

Fix fn front matter parsing ICE from invalid code.

Fixes #60075.

This PR fixes an "unreachable code" ICE that results from parsing
invalid code where the compiler is expecting the next trait item
declaration in the middle of the previous trait item due to extra
closing braces.

r? @estebank (thanks for the minimized test case)

5 years agoUpdate Fira Sans to version 4.202
Manish Goregaokar [Sun, 21 Apr 2019 02:37:25 +0000 (19:37 -0700)]
Update Fira Sans to version 4.202

From https://github.com/mozilla/Fira

5 years agoUpdate Source Code Pro fonts to version 2.030
Manish Goregaokar [Sun, 21 Apr 2019 02:33:58 +0000 (19:33 -0700)]
Update Source Code Pro fonts to version 2.030

Pulled in from https://github.com/adobe-fonts/source-code-pro/