On my local machine I was getting failures in `test/ui-fulldeps`, but I was also getting them again after reverting the change, so I'm hoping that this works.
I removed the test because that's what the other PR that unreserved a keyword did and I feel that it doesn't make sense/keep value to keep a test for something removed years ago.
bors [Sat, 9 Jun 2018 21:22:36 +0000 (21:22 +0000)]
Auto merge of #51459 - kennytm:dist-at-stage-0, r=Mark-Simulacrum
Miscellaneous changes to rustbuild and CI.
1. Don't build LLVM when running rust-installer.
2. If toolstate is unchanged, don't push a commit to the toolstate repo.
3. Allow `./x.py build src/librustc_codegen_llvm`
4. Added log to track #50887.
bors [Sat, 9 Jun 2018 17:46:36 +0000 (17:46 +0000)]
Auto merge of #51068 - Crazycolorz5:pluseqsplitting, r=petrochenkov
parser: Split `+=` into `+` and `=` where `+` is explicitly requested (such as generics)
Added functions in tokens to check whether a token leads with `+`. Used them when parsing to allow for token splitting of `+=` into `+` and `=`.
Fixes https://github.com/rust-lang/rust/issues/47856
bors [Sat, 9 Jun 2018 15:41:44 +0000 (15:41 +0000)]
Auto merge of #51441 - bstrie:sizeof128, r=dtolnay
Document size_of for 128-bit integers
We might want to consider separately documenting the alignment of
primitives, rather than just their size, since 128-bit integers, unlike
all other primitives, have an alignment that is not identical to their
size (size_of is 16, align_of is 8)
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)
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.
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.
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%.
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!
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.
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.
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.
bstrie [Fri, 8 Jun 2018 19:20:28 +0000 (19:20 +0000)]
Document size_of for 128-bit integers
We might want to consider separately documenting the alignment of
primitives, rather than just their size, since 128-bit integers, unlike
all other primitives, have an alignment that is not identical to their
size (size_of is 16, align_of is 8)
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.
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.
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.
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)
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).
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.
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.
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...))
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%.
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.
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.