]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAuto merge of #51359 - cramertj:fdio_spawn, r=sfackler
bors [Sat, 9 Jun 2018 03:41:31 +0000 (03:41 +0000)]
Auto merge of #51359 - cramertj:fdio_spawn, r=sfackler

[fuchsia] Migrate from launchpad to fdio_spawn_etc

fdio_spawn_etc is the preferred way of creating processes on Fuchsia
now.

cc @abarth

6 years agoAuto merge of #51042 - matthewjasper:reenable-trivial-bounds, r=nikomatsakis
bors [Sat, 9 Jun 2018 01:32:48 +0000 (01:32 +0000)]
Auto merge of #51042 - matthewjasper:reenable-trivial-bounds, r=nikomatsakis

Re-enable trivial bounds

cc #50825

Remove implementations from global bounds in winnowing when there is ambiguity.

This results in the reverse of #24066 happening sometimes. I'm not sure if anything can be done about that though.

cc #48214

r? @nikomatsakis

6 years agoAuto merge of #51448 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Fri, 8 Jun 2018 23:22:33 +0000 (23:22 +0000)]
Auto merge of #51448 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 13 pull requests

Successful merges:

 - #50143 (Add deprecation lint for duplicated `macro_export`s)
 - #51099 (Fix Issue 38777)
 - #51276 (Dedup auto traits in trait objects.)
 - #51298 (Stabilize unit tests with non-`()` return type)
 - #51360 (Suggest parentheses when a struct literal needs them)
 - #51391 (Use spans pointing at the inside of a rustdoc attribute)
 - #51394 (Use scope tree depths to speed up `nearest_common_ancestor`.)
 - #51396 (Make the size of Option<NonZero*> a documented guarantee.)
 - #51401 (Warn on `repr` without hints)
 - #51412 (Avoid useless Vec clones in pending_obligations().)
 - #51427 (compiletest: autoremove duplicate .nll.* files (#51204))
 - #51436 (Do not require stage 2 compiler for rustdoc)
 - #51437 (rustbuild: generate full list of dependencies for metadata)

Failed merges:

6 years agoRollup merge of #51437 - est31:rustbuild_metadata, r=Mark-Simulacrum
Mark Rousskov [Fri, 8 Jun 2018 23:21:10 +0000 (17:21 -0600)]
Rollup merge of #51437 - est31:rustbuild_metadata, r=Mark-Simulacrum

rustbuild: generate full list of dependencies for metadata

Previously, we didn't send --features to our cargo metadata invocations,
and thus missed some dependencies that we enable through the --features
mechanism.

6 years agoRollup merge of #51436 - Mark-Simulacrum:doc-stage1, r=QuietMisdreavus
Mark Rousskov [Fri, 8 Jun 2018 23:21:09 +0000 (17:21 -0600)]
Rollup merge of #51436 - Mark-Simulacrum:doc-stage1, r=QuietMisdreavus

Do not require stage 2 compiler for rustdoc

r? @QuietMisdreavus

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

I *think* this is correct; though I'm not certain. If it passes CI though I expect that to be good enough...

6 years agoRollup merge of #51427 - FelixMcFelix:nll-stderr-remover, r=oli-obk
Mark Rousskov [Fri, 8 Jun 2018 23:21:08 +0000 (17:21 -0600)]
Rollup merge of #51427 - FelixMcFelix:nll-stderr-remover, r=oli-obk

compiletest: autoremove duplicate .nll.* files (#51204)

UI tests in bless mode should now check to see if `.nll.*` files have a
matching `.*` file. If a match is found, it will be deleted.
This should be extensible to other modes (i.e., Polonius).
On running with `--bless`, the two files removed in #51186 are, in turn,
removed automatically.

fixes #51204

6 years agoRollup merge of #51412 - nnethercote:pending_obligations, r=estebank
Mark Rousskov [Fri, 8 Jun 2018 23:21:07 +0000 (17:21 -0600)]
Rollup merge of #51412 - nnethercote:pending_obligations, r=estebank

Avoid useless Vec clones in pending_obligations().

The only instance of `ObligationForest` in use has an obligation type of
`PendingPredicateObligation`, which contains a `PredicateObligation` and a
`Vec<Ty>`.

`FulfillmentContext::pending_obligations()` calls
`ObligationForest::pending_obligations()`, which clones all the
`PendingPredicateObligation`s. But the `Vec<Ty>` field of those cloned
obligations is never touched.

This patch changes `ObligationForest::pending_obligations()` to
`map_pending_obligations` -- which gives callers control about which part
of the obligation to clone -- and takes advantage of the change to avoid
cloning the `Vec<Ty>`. The change speeds up runs of a few rustc-perf
benchmarks, the best by 1%.

6 years agoRollup merge of #51401 - estebank:warn-repr, r=cramertj
Mark Rousskov [Fri, 8 Jun 2018 23:21:05 +0000 (17:21 -0600)]
Rollup merge of #51401 - estebank:warn-repr, r=cramertj

Warn on `repr` without hints

Fix #51376.

6 years agoRollup merge of #51396 - SimonSapin:option-nonzero-layout, r=SimonSapin
Mark Rousskov [Fri, 8 Jun 2018 23:21:04 +0000 (17:21 -0600)]
Rollup merge of #51396 - SimonSapin:option-nonzero-layout, r=SimonSapin

Make the size of Option<NonZero*> a documented guarantee.

Closes #49137, the tracking issue for `NonZero*`, as this was the last remaining open question.

Note that `ptr::NonNull<T>` already documents a similar guarantee.

6 years agoRollup merge of #51394 - nnethercote:NCA-depths, r=nikomatsakis
Mark Rousskov [Fri, 8 Jun 2018 23:21:03 +0000 (17:21 -0600)]
Rollup merge of #51394 - nnethercote:NCA-depths, r=nikomatsakis

Use scope tree depths to speed up `nearest_common_ancestor`.

This patch adds depth markings to all entries in the `ScopeTree`'s
`parent_map`. This change increases memory usage somewhat, but permits a
much faster algorithm to be used:

- If one scope has a greater depth than the other, the deeper scope is
  moved upward until they are at equal depths.

- Then we move the two scopes upward in lockstep until they match.

This avoids the need to keep track of which scopes have already been
seen, which was the major part of the cost of the old algorithm. It also
reduces the number of child-to-parent moves (which are hash table
lookups) when the scopes start at different levels, because it never
goes past the nearest common ancestor the way the old algorithm did.

Finally, the case where one of the scopes is the root is now handled in
advance, because that is moderately common and lets us skip everything.

This change speeds up runs of several rust-perf benchmarks, the best by
6%.

A selection of the bigger improvements:
```
clap-rs-check
        avg: -2.6%      min: -6.6%      max: 0.0%
syn-check
        avg: -2.2%      min: -5.0%      max: 0.0%
style-servo-check
        avg: -2.9%?     min: -4.8%?     max: 0.0%?
cargo-check
        avg: -1.3%      min: -2.8%      max: 0.0%
sentry-cli-check
        avg: -1.0%      min: -2.1%      max: 0.0%
webrender-check
        avg: -0.9%      min: -2.0%      max: 0.0%
style-servo
        avg: -0.9%?     min: -1.8%?     max: -0.0%?
ripgrep-check
        avg: -0.7%      min: -1.8%      max: 0.1%
clap-rs
        avg: -0.9%      min: -1.6%      max: -0.2%
regex-check
        avg: -0.2%      min: -1.3%      max: 0.1%
syn
        avg: -0.6%      min: -1.3%      max: 0.1%
hyper-check
        avg: -0.5%      min: -1.1%      max: 0.0%
```
The idea came from multiple commenters on my blog and on Reddit. Thank you!

r? @nikomatsakis

6 years agoRollup merge of #51391 - estebank:docspan, r=GuillaumeGomez
Mark Rousskov [Fri, 8 Jun 2018 23:21:02 +0000 (17:21 -0600)]
Rollup merge of #51391 - estebank:docspan, r=GuillaumeGomez

Use spans pointing at the inside of a rustdoc attribute

Follow up to #51111.

Point to the link in a rustdoc attribute where intralink resolution failed, instead of the full rustdoc attribute's span.

r? @GuillaumeGomez cc @kennytm

6 years agoRollup merge of #51360 - estebank:braces-around-literal-structs, r=nikomatsakis
Mark Rousskov [Fri, 8 Jun 2018 23:21:00 +0000 (17:21 -0600)]
Rollup merge of #51360 - estebank:braces-around-literal-structs, r=nikomatsakis

Suggest parentheses when a struct literal needs them

When writing a struct literal in an expression that expects a block to
be started afterwards (like an `if` statement), do not suggest using the
same struct literal:

```
did you mean `S { /* fields * /}`?
```

Instead, suggest surrounding the expression with parentheses:

```
did you mean `(S { /* fields * /})`?
```

Fix #47360, #50090. Leaving #42982 open to come back to this problem with a better solution.

6 years agoRollup merge of #51298 - Dylan-DPC:stabilise/termination-test, r=nikomatsakis
Mark Rousskov [Fri, 8 Jun 2018 23:20:59 +0000 (17:20 -0600)]
Rollup merge of #51298 - Dylan-DPC:stabilise/termination-test, r=nikomatsakis

Stabilize unit tests with non-`()` return type

References #48854

6 years agoRollup merge of #51276 - Havvy:dyn-trait-send-send, r=nikomatsakis
Mark Rousskov [Fri, 8 Jun 2018 23:20:58 +0000 (17:20 -0600)]
Rollup merge of #51276 - Havvy:dyn-trait-send-send, r=nikomatsakis

Dedup auto traits in trait objects.

Fixes #47010

Note that the test file `run-pass/trait-object-auto-dedup.rs` passes before and after this change. It's the `ui` test that changed from compiling to not compiling. Which does make this a breaking change, but I cannot imagine anybody actually being broken by it.

6 years agoRollup merge of #51099 - Crazycolorz5:expectedcloseparen, r=estebank
Mark Rousskov [Fri, 8 Jun 2018 23:20:57 +0000 (17:20 -0600)]
Rollup merge of #51099 - Crazycolorz5:expectedcloseparen, r=estebank

Fix Issue 38777

When looking through for a closing bracket in the loop condition, adds them to expecteds.
https://github.com/rust-lang/rust/issues/38777

6 years agoRollup merge of #50143 - petrochenkov:mexuniq, r=nikomatsakis
Mark Rousskov [Fri, 8 Jun 2018 23:20:55 +0000 (17:20 -0600)]
Rollup merge of #50143 - petrochenkov:mexuniq, r=nikomatsakis

Add deprecation lint for duplicated `macro_export`s

cc https://github.com/rust-lang/rust/issues/35896#issuecomment-381370556

6 years agoBuilt, corrected, and run tests. Added expected stderr files.
Crazycolorz5 [Fri, 8 Jun 2018 21:25:53 +0000 (17:25 -0400)]
Built, corrected, and run tests. Added expected stderr files.

6 years agoAuto merge of #51247 - pnkfelix:issue-51190-report-type-moved-from-behind-borrow...
bors [Fri, 8 Jun 2018 20:41:20 +0000 (20:41 +0000)]
Auto merge of #51247 - pnkfelix:issue-51190-report-type-moved-from-behind-borrow, r=nikomatsakis

NLL: report type moved from behind borrow of array/slice

When NLL has illegal move due to borrowed content in an array or slice, provide feedback about why the move wasn't a copy.

Drive by: While comparing the resulting `.nll.stderr` files to their old borrowck variants, I noticed that the test for borrowck-vec-pattern-nesting.rs was not signaling some errors under NLL due to the test assuming lexical lifetimes. So I fixed that too.

Fix #51190

6 years agoAuto merge of #51410 - oli-obk:cargo_bump, r=nikomatsakis
bors [Fri, 8 Jun 2018 17:04:14 +0000 (17:04 +0000)]
Auto merge of #51410 - oli-obk:cargo_bump, r=nikomatsakis

Update the cargo submodule

This allows the next nightly to publish crates that are on the 2018 edition (in an unstable way)

6 years agoNormalize associated types when checking global bounds
Matthew Jasper [Fri, 8 Jun 2018 16:00:56 +0000 (17:00 +0100)]
Normalize associated types when checking global bounds

6 years agoFix a typo
Matthew Jasper [Fri, 8 Jun 2018 16:00:49 +0000 (17:00 +0100)]
Fix a typo

6 years ago Test that object bounds are preferred over global where clause bounds
Matthew Jasper [Fri, 8 Jun 2018 16:00:36 +0000 (17:00 +0100)]
 Test that object bounds are preferred over global where clause bounds

6 years agoAdd tests for associated types and inconsistent bounds
Matthew Jasper [Fri, 8 Jun 2018 16:00:26 +0000 (17:00 +0100)]
Add tests for associated types and inconsistent bounds

6 years agoReenable trivial bounds
Matthew Jasper [Fri, 8 Jun 2018 16:00:03 +0000 (17:00 +0100)]
Reenable trivial bounds

Removes extra global bounds at the winnowing stage rather than when
normalizing the param_env. This avoids breaking inference when there is
a global bound.

6 years agorustbuild: generate full list of dependencies for metadata
est31 [Fri, 8 Jun 2018 14:47:16 +0000 (16:47 +0200)]
rustbuild: generate full list of dependencies for metadata

Previously, we didn't send --features to our cargo metadata invocations,
and thus missed some dependencies that we enable through the --features
mechanism.

6 years agoDo not require stage 2 compiler for rustdoc
Mark Simulacrum [Fri, 8 Jun 2018 14:29:15 +0000 (08:29 -0600)]
Do not require stage 2 compiler for rustdoc

6 years agocompiletest: autoremove duplicate .nll.* files (#51204)
Kyle Simpson [Thu, 7 Jun 2018 15:13:25 +0000 (16:13 +0100)]
compiletest: autoremove duplicate .nll.* files (#51204)

UI tests in bless mode should now check to see if `.nll.*` files have a
matching `.*` file. If a match is found, it will be deleted.
This should be extensible to other modes (i.e., Polonius).
On running with `--bless`, the two files removed in #51186 are, in turn,
removed automatically.

6 years agoAuto merge of #51426 - kennytm:rollup, r=kennytm
bors [Thu, 7 Jun 2018 23:06:39 +0000 (23:06 +0000)]
Auto merge of #51426 - kennytm:rollup, r=kennytm

Rollup of 9 pull requests

Successful merges:

 - #51186 (Remove two redundant .nll.stderr files)
 - #51283 (Deny #[cfg] and #[cfg_attr] on generic parameters.)
 - #51368 (Fix the use of closures within #[panic_implementation])
 - #51380 (Remove dependency on fmt_macros from typeck)
 - #51389 (rustdoc: Fix missing stability and src links for inlined external macros)
 - #51399 (NLL performance boost)
 - #51407 (Update RLS and Rustfmt)
 - #51417 (Revert #49719)
 - #51420 (Tries to address the recent network issues)

Failed merges:

6 years agoRollup merge of #51420 - kennytm:some-network-issues, r=Mark-Simulacrum
kennytm [Thu, 7 Jun 2018 23:05:48 +0000 (07:05 +0800)]
Rollup merge of #51420 - kennytm:some-network-issues, r=Mark-Simulacrum

Tries to address the recent network issues

1. Set the DNS server to 8.8.8.8/8.8.4.4/1.1.1.1/1.0.0.1 to workaround the daily "Cannot resolve host" error these two weeks.
2. Remove the unnecessary command `gem update --system` (originally added as experiment of the "Could not find a valid gem" error, which turns out to be useless).

6 years agoRollup merge of #51417 - pietroalbini:revert-49719, r=nikomatsakis
kennytm [Thu, 7 Jun 2018 23:05:47 +0000 (07:05 +0800)]
Rollup merge of #51417 - pietroalbini:revert-49719, r=nikomatsakis

Revert #49719

This also needs to be backported into beta.

Fixes #51416.
r? @nikomatsakis

6 years agoRollup merge of #51407 - nrc:update, r=Mark-Simulacrum
kennytm [Thu, 7 Jun 2018 23:05:45 +0000 (07:05 +0800)]
Rollup merge of #51407 - nrc:update, r=Mark-Simulacrum

Update RLS and Rustfmt

r? @Mark-Simulacrum

Fixes tests

6 years agoRollup merge of #51399 - ngg:nll-performance, r=nikomatsakis
kennytm [Thu, 7 Jun 2018 23:05:44 +0000 (07:05 +0800)]
Rollup merge of #51399 - ngg:nll-performance, r=nikomatsakis

NLL performance boost

This makes compilation of the [inflate](https://github.com/rust-lang-nursery/rustc-perf/tree/master/collector/benchmarks/inflate) benchmark compile 2 times faster on my computer when NLL is enabled.
This does not fix the #51377 perfectly, it's still 4-5 times slower than without NLL, but it's a start.

6 years agoRollup merge of #51389 - ollie27:rustdoc_cross_macro_src_stab, r=QuietMisdreavus
kennytm [Thu, 7 Jun 2018 23:05:43 +0000 (07:05 +0800)]
Rollup merge of #51389 - ollie27:rustdoc_cross_macro_src_stab, r=QuietMisdreavus

rustdoc: Fix missing stability and src links for inlined external macros

Fixes #38951

r? @QuietMisdreavus

6 years agoRollup merge of #51380 - Mark-Simulacrum:remove-fmt-macros, r=oli-obk
kennytm [Thu, 7 Jun 2018 23:05:42 +0000 (07:05 +0800)]
Rollup merge of #51380 - Mark-Simulacrum:remove-fmt-macros, r=oli-obk

Remove dependency on fmt_macros from typeck

None

6 years agoRollup merge of #51368 - varkor:panic_implementation-closures, r=eddyb
kennytm [Thu, 7 Jun 2018 23:05:41 +0000 (07:05 +0800)]
Rollup merge of #51368 - varkor:panic_implementation-closures, r=eddyb

Fix the use of closures within #[panic_implementation]

Fixes #51365.

6 years agoRollup merge of #51283 - kennytm:fix-51279-preempt-the-warning-song-and-dance, r...
kennytm [Thu, 7 Jun 2018 23:05:39 +0000 (07:05 +0800)]
Rollup merge of #51283 - kennytm:fix-51279-preempt-the-warning-song-and-dance, r=nikomatsakis

Deny #[cfg] and #[cfg_attr] on generic parameters.

Fix #51279.

Attributes on generic parameters are not expanded, meaning `#[cfg]`, `#[cfg_attr]` and attribute proc macros are entirely ignored on them.

This PR makes using the first two attributes an error, because if they are correctly expanded will affect the AST and change code behavior.

I'm beta-nominating this, because generic parameter attributes are stabilizing in 1.27, and if we did not reserve their usage, we may never be able to repurpose the meaning of these attributes in the Rust 2015 edition.

6 years agoRollup merge of #51186 - pnkfelix:remove-unneccessary-nll-stderr-files, r=oli-obk
kennytm [Thu, 7 Jun 2018 23:05:38 +0000 (07:05 +0800)]
Rollup merge of #51186 - pnkfelix:remove-unneccessary-nll-stderr-files, r=oli-obk

Remove two redundant .nll.stderr files

It turns out that the diagnostics generated from NLL for these cases are now exactly the same as that produced by AST borrowck, and thus we can just fallback on those `.stderr` files that already exist for AST-borrowck.

Bravo!

(it is a good idea to remove these files, because it slightly reduces the amount of time humans will spend reviewing the .nll.stderr fileset...)

((it *might* be worthwhile trying to change the `compiletest` code to even issue a warning when two such files have equivalent contents... but I am not going so far as to try to implement that right now...))

6 years agoAvoid useless Vec clones in pending_obligations().
Nicholas Nethercote [Thu, 19 Apr 2018 05:13:20 +0000 (15:13 +1000)]
Avoid useless Vec clones in pending_obligations().

The only instance of `ObligationForest` in use has an obligation type of
`PendingPredicateObligation`, which contains a `PredicateObligation` and a
`Vec<Ty>`.

`FulfillmentContext::pending_obligations()` calls
`ObligationForest::pending_obligations()`, which clones all the
`PendingPredicateObligation`s. But the `Vec<Ty>` field of those cloned
obligations is never touched.

This patch changes `ObligationForest::pending_obligations()` to
`map_pending_obligations` -- which gives callers control about which part
of the obligation to clone -- and takes advantage of the change to avoid
cloning the `Vec<Ty>`. The change speeds up runs of a few rustc-perf
benchmarks, the best by 1%.

6 years agoUse public DNS server instead of 169.254.169.254 on CI.
kennytm [Thu, 7 Jun 2018 20:33:46 +0000 (04:33 +0800)]
Use public DNS server instead of 169.254.169.254 on CI.

Tries to workaround travis-ci/travis-ci#9696.

6 years agoRemove the `gem update` from `.travis.yml`
kennytm [Thu, 7 Jun 2018 20:31:30 +0000 (04:31 +0800)]
Remove the `gem update` from `.travis.yml`

It has no effect on deployment error and may cause further network issues.

6 years agoUse `from_inner_byte_pos` for cleaner code
Esteban Küber [Thu, 7 Jun 2018 16:47:09 +0000 (09:47 -0700)]
Use `from_inner_byte_pos` for cleaner code

6 years ago[fuchsia] Migrate from launchpad to fdio_spawn_etc
Adam Barth [Fri, 1 Jun 2018 19:58:30 +0000 (12:58 -0700)]
[fuchsia] Migrate from launchpad to fdio_spawn_etc

fdio_spawn_etc is the preferred way of creating processes on Fuchsia
now.

6 years agoRevert "Auto merge of #49719 - mark-i-m:no_sep, r=petrochenkov"
Pietro Albini [Thu, 7 Jun 2018 15:07:05 +0000 (17:07 +0200)]
Revert "Auto merge of #49719 - mark-i-m:no_sep, r=petrochenkov"

This reverts commit d6ba1b9b021c408fcad60ee52acf8af5e1b2eb00, reversing
changes made to 8de5353f75dcde04abe947e0560dc5edd861cf3a.

6 years agoUpdate the cargo submodule
Oliver Schneider [Thu, 7 Jun 2018 09:51:43 +0000 (11:51 +0200)]
Update the cargo submodule

6 years agoUse Ord::cmp for auto traits since stable sort not needed
Havvy [Thu, 7 Jun 2018 05:11:37 +0000 (22:11 -0700)]
Use Ord::cmp for auto traits since stable sort not needed

6 years agoUpdate RLS and Rustfmt
Nick Cameron [Thu, 7 Jun 2018 03:14:49 +0000 (15:14 +1200)]
Update RLS and Rustfmt

6 years agoDo not account for inner/outer attr
Esteban Küber [Thu, 7 Jun 2018 00:39:58 +0000 (17:39 -0700)]
Do not account for inner/outer attr

6 years agoUse consistent span for repr attr suggestion
Esteban Küber [Wed, 6 Jun 2018 22:48:08 +0000 (15:48 -0700)]
Use consistent span for repr attr suggestion

6 years agoAuto merge of #50699 - Zoxc:blocking-queries, r=mw
bors [Wed, 6 Jun 2018 22:24:07 +0000 (22:24 +0000)]
Auto merge of #50699 - Zoxc:blocking-queries, r=mw

Blocking Rayon queries

r? @michaelwoerister

6 years agoAdd i/u size
Esteban Küber [Wed, 6 Jun 2018 21:34:07 +0000 (14:34 -0700)]
Add i/u size

6 years agoChange repr documentation link
Esteban Küber [Wed, 6 Jun 2018 21:33:07 +0000 (14:33 -0700)]
Change repr documentation link

6 years agoExpand (fix) u* and i* `repr` hints
Esteban Küber [Wed, 6 Jun 2018 21:25:57 +0000 (14:25 -0700)]
Expand (fix) u* and i* `repr` hints

6 years agoAdd `transparent` as valid `repr` hint
Esteban Küber [Wed, 6 Jun 2018 21:18:13 +0000 (14:18 -0700)]
Add `transparent` as valid `repr` hint

6 years agoTurn warning into lint
Esteban Küber [Wed, 6 Jun 2018 21:11:48 +0000 (14:11 -0700)]
Turn warning into lint

6 years agoUpdate the expected error output to reflect changes in this PR.
Felix S. Klock II [Thu, 31 May 2018 10:58:34 +0000 (12:58 +0200)]
Update the expected error output to reflect changes in this PR.

6 years agoDrive-by: Make assignment conflict tests in borrowck-vec-pattern-nesting.rs robust...
Felix S. Klock II [Thu, 31 May 2018 10:58:10 +0000 (12:58 +0200)]
Drive-by: Make assignment conflict tests in borrowck-vec-pattern-nesting.rs robust for NLL.
6 years agoWhen NLL has illegal move due to borrowed content, provide feedback about why the...
Felix S. Klock II [Thu, 31 May 2018 10:46:43 +0000 (12:46 +0200)]
When NLL has illegal move due to borrowed content, provide feedback about why the move wasn't a copy.

This should address #51190.

6 years agoIt turns out that the diagnostics generated from NLL for these cases are now exactly...
Felix S. Klock II [Tue, 29 May 2018 21:25:53 +0000 (23:25 +0200)]
It turns out that the diagnostics generated from NLL for these cases are now exactly the same as that produced by AST borrowck. Bravo!

6 years agoAuto merge of #51263 - cramertj:futures-in-core, r=aturon
bors [Wed, 6 Jun 2018 19:42:19 +0000 (19:42 +0000)]
Auto merge of #51263 - cramertj:futures-in-core, r=aturon

Add Future and task system to the standard library

This adds preliminary versions of the `std::future` and `std::task` modules in order to unblock development of async/await (https://github.com/rust-lang/rust/issues/50547). These shouldn't be considered as final forms of these libraries-- design questions about the libraries should be left on https://github.com/rust-lang/rfcs/pull/2418. Once that RFC (or a successor) is merged, these APIs will be adjusted as necessary.

r? @aturon

6 years agoExpand output and suggestions, fix tests
Esteban Küber [Wed, 6 Jun 2018 19:31:43 +0000 (12:31 -0700)]
Expand output and suggestions, fix tests

6 years agoAdd Future and task system to the standard library
Taylor Cramer [Thu, 31 May 2018 01:23:10 +0000 (18:23 -0700)]
Add Future and task system to the standard library

6 years agoWarn on `repr` without hints
Esteban Küber [Wed, 6 Jun 2018 17:02:09 +0000 (10:02 -0700)]
Warn on `repr` without hints

6 years agoAuto merge of #51333 - GuillaumeGomez:reexport-fmt-alignment, r=SimonSapin
bors [Wed, 6 Jun 2018 17:01:56 +0000 (17:01 +0000)]
Auto merge of #51333 - GuillaumeGomez:reexport-fmt-alignment, r=SimonSapin

Reexport fmt::Alignment into std

Follow-up of #51078.

6 years agoWhen unable to sinthesize link span, fallback to previous behavior
Esteban Küber [Wed, 6 Jun 2018 16:14:09 +0000 (09:14 -0700)]
When unable to sinthesize link span, fallback to previous behavior

6 years agoUse spans pointing at the inside of a rustdoc attribute
Esteban Küber [Wed, 6 Jun 2018 07:30:25 +0000 (00:30 -0700)]
Use spans pointing at the inside of a rustdoc attribute

6 years agoNLL performance boost
Gergely Nagy [Wed, 6 Jun 2018 15:31:22 +0000 (17:31 +0200)]
NLL performance boost

6 years agofix stderrs
dylan_DPC [Wed, 6 Jun 2018 15:21:57 +0000 (20:51 +0530)]
fix stderrs

6 years agoAuto merge of #51201 - estebank:dotdot, r=petrochenkov
bors [Wed, 6 Jun 2018 14:04:06 +0000 (14:04 +0000)]
Auto merge of #51201 - estebank:dotdot, r=petrochenkov

Accept `..` in incorrect position to avoid further errors

We currently give a specific message when encountering a `..` anywhere
other than the end of a pattern. Modify the parser to accept it (while
still emitting the error) so that we don't also trigger "missing fields
in pattern" errors afterwards.

Add suggestions to either remove trailing `,` or moving the `..` to the
end.

Follow up to #49268.

6 years agoUpdate Cargo
John Kåre Alsaker [Wed, 6 Jun 2018 13:25:47 +0000 (15:25 +0200)]
Update Cargo

6 years agoReduce the amount of unsafe code and mark handle_deadlock as unsafe
John Kåre Alsaker [Tue, 5 Jun 2018 21:12:19 +0000 (23:12 +0200)]
Reduce the amount of unsafe code and mark handle_deadlock as unsafe

6 years agoAdd comments
John Kåre Alsaker [Thu, 31 May 2018 21:04:21 +0000 (23:04 +0200)]
Add comments

6 years agoMake QueryWaiter use safe code
John Kåre Alsaker [Thu, 31 May 2018 18:24:56 +0000 (20:24 +0200)]
Make QueryWaiter use safe code

6 years agoCreate thread-pool
John Kåre Alsaker [Sun, 27 May 2018 11:10:12 +0000 (13:10 +0200)]
Create thread-pool

6 years agoAdd comments and misc changes
John Kåre Alsaker [Sun, 27 May 2018 11:05:41 +0000 (13:05 +0200)]
Add comments and misc changes

6 years agoUse raw pointers
John Kåre Alsaker [Sun, 27 May 2018 07:01:57 +0000 (09:01 +0200)]
Use raw pointers

6 years agoAdd and use OnDrop::disable
John Kåre Alsaker [Sun, 27 May 2018 05:47:44 +0000 (07:47 +0200)]
Add and use OnDrop::disable

6 years agoUse try_lock in collect_active_jobs
John Kåre Alsaker [Sun, 27 May 2018 05:46:19 +0000 (07:46 +0200)]
Use try_lock in collect_active_jobs

6 years agoUpdate Rayon version
John Kåre Alsaker [Mon, 14 May 2018 01:00:52 +0000 (03:00 +0200)]
Update Rayon version

6 years agoMake queries block and handle query cycles
John Kåre Alsaker [Fri, 6 Apr 2018 10:56:59 +0000 (12:56 +0200)]
Make queries block and handle query cycles

6 years agoMake the size of Option<NonZero*> a documented guarantee.
Simon Sapin [Wed, 6 Jun 2018 11:46:51 +0000 (13:46 +0200)]
Make the size of Option<NonZero*> a documented guarantee.

Closes #49137, the tracking issue for `NonZero*`,
as this was the last remaining open question.

Note that `ptr::NonNull<T>` already documents a similar guarantee.

6 years agoAuto merge of #51316 - oli-obk:const_err, r=nikomatsakis
bors [Wed, 6 Jun 2018 11:17:15 +0000 (11:17 +0000)]
Auto merge of #51316 - oli-obk:const_err, r=nikomatsakis

Refactor the const eval diagnostic API

* no longer report "const eval error" for things that have typeck errors
* errors and lints have saner spans and messages
* unified the diagnostic logic (const eval errors were slightly different depending on where they were reported, and there was also code duplication between the different reporters)
* report errors if an erroneous constant is used inside a promoted (fixes most of #50814)

6 years agoUse scope tree depths to speed up `nearest_common_ancestor`.
Nicholas Nethercote [Wed, 6 Jun 2018 02:44:05 +0000 (12:44 +1000)]
Use scope tree depths to speed up `nearest_common_ancestor`.

This patch adds depth markings to all entries in the `ScopeTree`'s
`parent_map`. This change increases memory usage somewhat, but permits a
much faster algorithm to be used:

- If one scope has a greater depth than the other, the deeper scope is
  moved upward until they are at equal depths.

- Then we move the two scopes upward in lockstep until they match.

This avoids the need to keep track of which scopes have already been
seen, which was the major part of the cost of the old algorithm. It also
reduces the number of child-to-parent moves (which are hash table
lookups) when the scopes start at different levels, because it never
goes past the nearest common ancestor the way the old algorithm did.

Finally, the case where one of the scopes is the root is now handled in
advance, because that is moderately common and lets us skip everything.

This change speeds up runs of several rust-perf benchmarks, the best by
6%.

6 years agoAuto merge of #50844 - bjorn3:adhoc_compiller_calls, r=nrc
bors [Wed, 6 Jun 2018 08:14:11 +0000 (08:14 +0000)]
Auto merge of #50844 - bjorn3:adhoc_compiller_calls, r=nrc

Add AdHocCalls and pass self to build_controller as Box<Self>

This makes it easier to write custom drivers.

6 years agoappend unused variables with _
dylan_DPC [Wed, 6 Jun 2018 06:52:38 +0000 (12:22 +0530)]
append unused variables with _

6 years agorustdoc: Fix missing stability and src links for inlined external macros
Oliver Middleton [Wed, 6 Jun 2018 03:13:55 +0000 (04:13 +0100)]
rustdoc: Fix missing stability and src links for inlined external macros

6 years agoRemove fmt_macros dependency
Mark Simulacrum [Tue, 5 Jun 2018 21:55:07 +0000 (15:55 -0600)]
Remove fmt_macros dependency

6 years agoRebase fallout
Oliver Schneider [Tue, 5 Jun 2018 19:08:43 +0000 (21:08 +0200)]
Rebase fallout

6 years agoAdd source information the const propagation of places
Oliver Schneider [Tue, 5 Jun 2018 17:54:50 +0000 (19:54 +0200)]
Add source information the const propagation of places

6 years agoRemove another unused error variant
Oliver Schneider [Tue, 5 Jun 2018 17:06:29 +0000 (19:06 +0200)]
Remove another unused error variant

6 years agoRemove unused IndexOutOfBounds variant
Oliver Schneider [Tue, 5 Jun 2018 17:02:03 +0000 (19:02 +0200)]
Remove unused IndexOutOfBounds variant

6 years agoSatisfy the untiring tidy
Oliver Schneider [Sun, 3 Jun 2018 01:39:26 +0000 (03:39 +0200)]
Satisfy the untiring tidy

6 years agoProperly report transitive errors
Oliver Schneider [Sun, 3 Jun 2018 01:01:06 +0000 (03:01 +0200)]
Properly report transitive errors

6 years agoReferring to erroneous constants in promoteds must abort the build
Oliver Schneider [Sun, 3 Jun 2018 00:04:20 +0000 (02:04 +0200)]
Referring to erroneous constants in promoteds must abort the build

6 years agoRefactor the const eval diagnostic API
Oliver Schneider [Sat, 2 Jun 2018 21:38:57 +0000 (23:38 +0200)]
Refactor the const eval diagnostic API

6 years agoremove redundant match branch
dylan_DPC [Tue, 5 Jun 2018 18:14:42 +0000 (23:44 +0530)]
remove redundant match branch

6 years agoflag changed to none
dylan_DPC [Tue, 5 Jun 2018 17:58:32 +0000 (23:28 +0530)]
flag changed to none

6 years agoAdd comment
bjorn3 [Mon, 4 Jun 2018 10:14:50 +0000 (12:14 +0200)]
Add comment

6 years agoImpl CompilerCalls for CompileController instead of AdHocCompilerCalls
bjorn3 [Sun, 27 May 2018 18:02:51 +0000 (20:02 +0200)]
Impl CompilerCalls for CompileController instead of AdHocCompilerCalls

6 years agoAdd AdHocCalls and pass self to build_controller as Box<Self>
bjorn3 [Thu, 17 May 2018 18:32:09 +0000 (20:32 +0200)]
Add AdHocCalls and pass self to build_controller as Box<Self>

6 years agoAccount for comma in suggestion
Esteban Küber [Wed, 30 May 2018 18:04:39 +0000 (11:04 -0700)]
Account for comma in suggestion