]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agobootstrap: use the normal compiler to build std
Pietro Albini [Mon, 21 Dec 2020 17:04:58 +0000 (18:04 +0100)]
bootstrap: use the normal compiler to build std

3 years agobootstrap: avoid producing the rust tarball during dry runs
Pietro Albini [Mon, 7 Dec 2020 16:23:26 +0000 (17:23 +0100)]
bootstrap: avoid producing the rust tarball during dry runs

3 years agobootstrap: convert rustc-src to use Tarball
Pietro Albini [Mon, 7 Dec 2020 10:49:22 +0000 (11:49 +0100)]
bootstrap: convert rustc-src to use Tarball

3 years agobootstrap: convert rust to use Tarball
Pietro Albini [Wed, 2 Dec 2020 12:29:45 +0000 (13:29 +0100)]
bootstrap: convert rust to use Tarball

3 years agobootstrap: convert rust-src to use Tarball
Pietro Albini [Mon, 30 Nov 2020 12:25:34 +0000 (13:25 +0100)]
bootstrap: convert rust-src to use Tarball

3 years agobootstrap: convert rust-analyzer to use Tarball
Pietro Albini [Fri, 27 Nov 2020 17:20:23 +0000 (18:20 +0100)]
bootstrap: convert rust-analyzer to use Tarball

3 years agobootstrap: convert rls to use Tarball
Pietro Albini [Fri, 27 Nov 2020 17:12:17 +0000 (18:12 +0100)]
bootstrap: convert rls to use Tarball

3 years agobootstrap: convert rustfmt to use Tarball
Pietro Albini [Fri, 27 Nov 2020 17:07:58 +0000 (18:07 +0100)]
bootstrap: convert rustfmt to use Tarball

3 years agobootstrap: convert miri to use Tarball
Pietro Albini [Fri, 27 Nov 2020 17:03:41 +0000 (18:03 +0100)]
bootstrap: convert miri to use Tarball

3 years agobootstrap: simplify including licenses and readmes to tarballs
Pietro Albini [Fri, 27 Nov 2020 16:56:22 +0000 (17:56 +0100)]
bootstrap: simplify including licenses and readmes to tarballs

3 years agobootstrap: convert clippy to use Tarball
Pietro Albini [Fri, 27 Nov 2020 16:43:03 +0000 (17:43 +0100)]
bootstrap: convert clippy to use Tarball

3 years agobootstrap: convert cargo to use Tarball
Pietro Albini [Fri, 27 Nov 2020 12:11:11 +0000 (13:11 +0100)]
bootstrap: convert cargo to use Tarball

3 years agobootstrap: convert rust-analysis to use Tarball
Pietro Albini [Fri, 27 Nov 2020 11:52:44 +0000 (12:52 +0100)]
bootstrap: convert rust-analysis to use Tarball

3 years agobootstrap: convert rustc-dev to use Tarball
Pietro Albini [Fri, 27 Nov 2020 11:46:02 +0000 (12:46 +0100)]
bootstrap: convert rustc-dev to use Tarball

3 years agobootstrap: convert rust-std to use Tarball
Pietro Albini [Thu, 26 Nov 2020 21:54:35 +0000 (22:54 +0100)]
bootstrap: convert rust-std to use Tarball

3 years agobootstrap: refactor showing the "dist" info
Pietro Albini [Thu, 26 Nov 2020 21:50:38 +0000 (22:50 +0100)]
bootstrap: refactor showing the "dist" info

3 years agobootstrap: convert rustc to use Tarball
Pietro Albini [Thu, 26 Nov 2020 21:42:52 +0000 (22:42 +0100)]
bootstrap: convert rustc to use Tarball

3 years agobootstrap: convert rust-mingw to use Tarball
Pietro Albini [Thu, 26 Nov 2020 21:29:33 +0000 (22:29 +0100)]
bootstrap: convert rust-mingw to use Tarball

3 years agobootstrap: convert rustc-docs to use Tarball
Pietro Albini [Thu, 26 Nov 2020 21:24:34 +0000 (22:24 +0100)]
bootstrap: convert rustc-docs to use Tarball

3 years agobootstrap: convert rust-docs to use Tarball
Pietro Albini [Thu, 26 Nov 2020 21:20:45 +0000 (22:20 +0100)]
bootstrap: convert rust-docs to use Tarball

3 years agobootstrap: convert llvm-tools to use Tarball
Pietro Albini [Thu, 26 Nov 2020 16:47:48 +0000 (17:47 +0100)]
bootstrap: convert llvm-tools to use Tarball

3 years agobootstrap: convert build-manifest to use the new Tarball struct
Pietro Albini [Thu, 26 Nov 2020 15:52:20 +0000 (16:52 +0100)]
bootstrap: convert build-manifest to use the new Tarball struct

3 years agoUpdate cargo
Eric Huss [Wed, 23 Dec 2020 03:42:03 +0000 (19:42 -0800)]
Update cargo

3 years agoAuto merge of #80328 - flip1995:clippyup, r=Mark-Simulacrum
bors [Wed, 23 Dec 2020 15:57:13 +0000 (15:57 +0000)]
Auto merge of #80328 - flip1995:clippyup, r=Mark-Simulacrum

Clippy: Revert change from last sync

r? `@Manishearth`

cc `@ebroto`

Note that the commit e898015 doesn't exist like this in the Clippy repo. I didn't want to do a full sync, because this would've included at least one new lint, which I wanted to avoid a week before beta is branched. This just reverts one commit from the last sync.

3 years agoAdd more comments to trait queries
Joshua Nelson [Wed, 23 Dec 2020 15:24:29 +0000 (10:24 -0500)]
Add more comments to trait queries

This also adds back a comment that was mistakenly removed in
ac9dfc3e7785c9bba96ebac4fd51726189e1bf91.

3 years agoAdd more tests
Joshua Nelson [Wed, 23 Dec 2020 02:26:17 +0000 (21:26 -0500)]
Add more tests

3 years agoAuto merge of #80262 - Mark-Simulacrum:pgo-rustc, r=pietroalbini
bors [Wed, 23 Dec 2020 12:54:56 +0000 (12:54 +0000)]
Auto merge of #80262 - Mark-Simulacrum:pgo-rustc, r=pietroalbini

Utilize PGO for rustc linux dist builds

This implements support for applying PGO to the rustc compilation step (not
standard library or any tooling, including rustdoc). Expanding PGO to more tools
is not terribly difficult but will involve more work and greater CI time
commitment.

For the same reason of avoiding greater implementation time commitment,
implementing for platforms outside of x86_64-unknown-linux-gnu is skipped.
In practice it should be quite simple to extend over time to more platforms. The
initial implementation is intentionally minimal here to avoid too much work
investment before we start seeing wins for a subset of Rust users.

The choice of workloads to profile here is somewhat arbitrary, but the general
rationale was to aim for a small set that largely avoided time regressions on
perf.rust-lang.org's full suite of crates. The set chosen is libcore, cargo (and
its dependencies), and a few ad-hoc stress tests from perf.rlo. The stress tests
are arguably the most controversial, but they benefit those cases (avoiding
regressions) and do not really remove wins from other benchmarks.

The primary next step after this PR lands is to implement support for PGO in
LLVM. It is unclear whether we can afford a full LLVM rebuild in CI, though, so
the approach taken there may need to be more staggered. rustc-only PGO seems
well affordable on linux at least, giving us up to 20% wall time wins on some
crates for 15 minutes of extra CI time (1 hour with this PR, up from 45 minutes).

The PGO data is uploaded to allow others to reuse it if attempting to reproduce
the CI build or potentially, in the future, on other platforms where an
off-by-one strategy is used for dist builds at minimal performance cost.

r? `@michaelwoerister` (but tell me if you don't want to / don't feel comfortable approving and we can find others)

3 years agoFix typo in simplify_try.rs
Ikko Ashimine [Wed, 23 Dec 2020 12:11:59 +0000 (21:11 +0900)]
Fix typo in simplify_try.rs

assigment -> assignment

3 years agoRustup to rustc 1.50.0-nightly (bb1fbbf84 2020-12-22)
bjorn3 [Wed, 23 Dec 2020 11:47:20 +0000 (12:47 +0100)]
Rustup to rustc 1.50.0-nightly (bb1fbbf84 2020-12-22)

3 years agoSync from rust 28d73a3ee3e2c32f2768d1cbc9b42cb63472e9e9
bjorn3 [Wed, 23 Dec 2020 11:27:58 +0000 (12:27 +0100)]
Sync from rust 28d73a3ee3e2c32f2768d1cbc9b42cb63472e9e9

3 years agoSpecial sync of 'e89801553ddbaccdeb2eac4db08900edb51ac7ff'
flip1995 [Wed, 23 Dec 2020 09:52:53 +0000 (10:52 +0100)]
Special sync of 'e89801553ddbaccdeb2eac4db08900edb51ac7ff'

3 years agoRevert "Pass Clippy args also trough RUSTFLAGS"
Philipp Krones [Tue, 22 Dec 2020 18:17:59 +0000 (19:17 +0100)]
Revert "Pass Clippy args also trough RUSTFLAGS"

3 years agoAuto merge of #79261 - faern:deprecate-compare-and-swap, r=Amanieu
bors [Wed, 23 Dec 2020 09:32:38 +0000 (09:32 +0000)]
Auto merge of #79261 - faern:deprecate-compare-and-swap, r=Amanieu

Deprecate atomic compare_and_swap method

Finish implementing [RFC 1443](https://github.com/rust-lang/rfcs/blob/master/text/1443-extended-compare-and-swap.md) (https://github.com/rust-lang/rfcs/pull/1443).

It was decided to deprecate `compare_and_swap` [back in Rust 1.12 already](https://github.com/rust-lang/rust/issues/31767#issuecomment-215903038). I can't find any info about that decision being reverted. My understanding is just that it has been forgotten. If there has been a decision on keeping `compare_and_swap` then it's hard to find, and even if this PR does not go through it can act as a place where people can find out about the decision being reverted.

Atomic operations are hard to understand, very hard. And it does not help that there are multiple similar methods to do compare and swap with. They are so similar that for a reader it might be hard to understand the difference. This PR aims to make that simpler by finally deprecating `compare_and_swap` which is essentially just a more limited version of `compare_exchange`. The documentation is also updated (according to the RFC text) to explain the differences a bit better.

Even if we decide to not deprecate `compare_and_swap`. I still think the documentation for the atomic operations should be improved to better describe their differences and similarities. And the documentation can be written nicer than the PR currently proposes, but I wanted to start somewhere. Most of it is just copied from the RFC.

The documentation for `compare_exchange` and `compare_exchange_weak` indeed describe how they work! The problem is that they are more complex and harder to understand than `compare_and_swap`. So for someone who does not fully grasp this they might fall back to using `compare_and_swap`. Making the documentation outline the similarities and differences might build a bridge for people so they can cross over to the more powerful and sometimes more efficient operations.

The conversions I do to avoid the `std` internal deprecation errors are very straight forward `compare_and_swap -> compare_exchange` changes where the orderings are just using the mapping in the new documentation. Only in one place did I use `compare_exchange_weak`. This can probably be improved further. But the goal here was not for those operations to be perfect. Just to not get worse and to allow the deprecation to happen.

3 years agoAuto merge of #80099 - jyn514:visibility-on-demand, r=GuillaumeGomez
bors [Wed, 23 Dec 2020 06:39:15 +0000 (06:39 +0000)]
Auto merge of #80099 - jyn514:visibility-on-demand, r=GuillaumeGomez

Remove `DefPath` from `Visibility` and calculate it on demand

Depends on #80090 and should not be merged before. Helps with https://github.com/rust-lang/rust/issues/79103 and https://github.com/rust-lang/rust/issues/76382.

cc https://github.com/rust-lang/rust/pull/80014#issuecomment-746810284 - `@nnethercote` I figured it out! It was simpler than I expected :)

This brings the size of `clean::Visibility` down from 40 bytes to 8.

Note that this does *not* remove `clean::Visibility`, even though it's now basically the same as `ty::Visibility`, because the `Invsible` variant means something different from `Inherited` and I thought it would be be confusing to merge the two. See the new comments on `impl Clean for ty::Visibility` for details.

3 years agoUpdated the match with the matches macro
PankajChaudhary5 [Wed, 23 Dec 2020 05:32:04 +0000 (11:02 +0530)]
Updated the match with the matches macro

3 years agoAuto merge of #80095 - jyn514:stability-on-demand, r=GuillaumeGomez
bors [Wed, 23 Dec 2020 03:35:32 +0000 (03:35 +0000)]
Auto merge of #80095 - jyn514:stability-on-demand, r=GuillaumeGomez

[rustdoc] Calculate stability, const_stability, and deprecation on-demand

Previously, they would always be calculated ahead of time, which bloated the size of `clean::Item`.

Builds on https://github.com/rust-lang/rust/pull/80090 and should not be merged before. Helps with https://github.com/rust-lang/rust/issues/79103 and https://github.com/rust-lang/rust/issues/76382.

cc https://github.com/rust-lang/rust/pull/80014#issuecomment-746810284

This brings `Item` down to 568 bytes, down from 616.

3 years agoAdd a test that rustc compiles and links separately
Victor Ding [Wed, 23 Dec 2020 01:17:45 +0000 (12:17 +1100)]
Add a test that rustc compiles and links separately

3 years agoExclude unnecessary info from CodegenResults
Victor Ding [Sat, 19 Dec 2020 11:36:35 +0000 (22:36 +1100)]
Exclude unnecessary info from CodegenResults

`foreign_module` and `wasm_import_module` are not needed for linking,
and hence can be removed from CodegenResults.

3 years agoFix elided lifetimes shown as `'_` on async functions
Joshua Nelson [Wed, 23 Dec 2020 01:22:47 +0000 (20:22 -0500)]
Fix elided lifetimes shown as `'_` on async functions

3 years agoAuto merge of #80314 - GuillaumeGomez:rollup-9rc48vx, r=GuillaumeGomez
bors [Wed, 23 Dec 2020 00:41:46 +0000 (00:41 +0000)]
Auto merge of #80314 - GuillaumeGomez:rollup-9rc48vx, r=GuillaumeGomez

Rollup of 17 pull requests

Successful merges:

 - #80136 (Add test for issue #74824)
 - #80203 (Edit rustc_middle::lint::LintSource docs)
 - #80204 (docs: Edit rustc_middle::ty::query::on_disk_cache)
 - #80219 (Fix labels for 'Library Tracking Issue' template)
 - #80222 (Fix rustc-std-workspace-core documentation)
 - #80223 (docs: Fix outdated crate reference)
 - #80225 (Add module-level docs to rustc_middle::ty)
 - #80241 (Fix typo)
 - #80248 (Remove `I-prioritize` from Zulip topic)
 - #80266 (Remove redundant test)
 - #80272 (rustc_span: Provide a reserved identifier check for a specific edition)
 - #80285 (Update books)
 - #80286 (docs: Edit rustc_middle::middle::privacy)
 - #80297 (Add some intra-doc links to compiler docs)
 - #80298 (Improve the code quality by using matches macro)
 - #80299 (Turn helper method into a closure)
 - #80302 (docs: Update rustc_middle::middle::region::ScopeTree)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoInclude rustdoc in the compiler docs index.
Eric Huss [Wed, 23 Dec 2020 00:33:36 +0000 (16:33 -0800)]
Include rustdoc in the compiler docs index.

3 years agoIgnore proc-macros when assembling rustc libdir
Tomasz Miąsko [Wed, 23 Dec 2020 00:00:00 +0000 (00:00 +0000)]
Ignore proc-macros when assembling rustc libdir

3 years agoRollup merge of #80302 - pierwill:fix-80287, r=lcnr
Guillaume Gomez [Tue, 22 Dec 2020 23:14:01 +0000 (00:14 +0100)]
Rollup merge of #80302 - pierwill:fix-80287, r=lcnr

docs: Update rustc_middle::middle::region::ScopeTree

Correct return type in docs for [`yield_in_source`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/middle/region/struct.ScopeTree.html#method.yield_in_scope) method.

Closes #80287.

3 years agoRollup merge of #80299 - LingMan:helper, r=lcnr
Guillaume Gomez [Tue, 22 Dec 2020 23:13:59 +0000 (00:13 +0100)]
Rollup merge of #80299 - LingMan:helper, r=lcnr

Turn helper method into a closure

`replace_prefix` is currently implemented as a method but has no real relation
to the struct it is implemented on. Turn it into a closure and move it into the
only method from which it is called.

`@rustbot` modify labels +C-cleanup +T-compiler
r? `@lcnr`

3 years agoRollup merge of #80298 - PankajChaudhary5:PankajChaudhary, r=GuillaumeGomez
Guillaume Gomez [Tue, 22 Dec 2020 23:13:56 +0000 (00:13 +0100)]
Rollup merge of #80298 - PankajChaudhary5:PankajChaudhary, r=GuillaumeGomez

Improve the code quality by using matches macro

Improved the code quality by using matches macro
r? `@GuillaumeGomez`

3 years agoRollup merge of #80297 - jyn514:more-docs, r=bjorn3
Guillaume Gomez [Tue, 22 Dec 2020 23:13:53 +0000 (00:13 +0100)]
Rollup merge of #80297 - jyn514:more-docs, r=bjorn3

Add some intra-doc links to compiler docs

r? `@pierwill`

3 years agoRollup merge of #80286 - pierwill:rustc-middle-privacy, r=petrochenkov
Guillaume Gomez [Tue, 22 Dec 2020 23:13:52 +0000 (00:13 +0100)]
Rollup merge of #80286 - pierwill:rustc-middle-privacy, r=petrochenkov

docs: Edit rustc_middle::middle::privacy

Add descriptions of `AccessLevel` and `AccessLevels`.

Add missing punctuation.

3 years agoRollup merge of #80285 - ehuss:update-books, r=ehuss
Guillaume Gomez [Tue, 22 Dec 2020 23:13:50 +0000 (00:13 +0100)]
Rollup merge of #80285 - ehuss:update-books, r=ehuss

Update books

## nomicon

2 commits in d8383b65f7948c2ca19191b3b4bd709b403aaf45..a5a48441d411f61556b57d762b03d6874afe575d
2020-11-22 10:24:42 -0500 to 2020-12-06 10:39:41 +0900
- Update atomics.md (rust-lang/nomicon#249)
- Rename `AllocRef` to `Allocator` and `(de)alloc` to `(de)allocate` (rust-lang/nomicon#248)

## reference

2 commits in a8afdca5d0715b2257b6f8b9a032fd4dd7dae855..b278478b766178491a8b6f67afa4bcd6b64d977a
2020-11-30 06:44:46 -0800 to 2020-12-21 18:18:03 -0800
- Update unions for safe ManuallyDrop assignment. (rust-lang/reference#912)
- Removing ambiguity in type-layout.md (rust-lang/reference#911)

## book

25 commits in a190438d77d28041f24da4f6592e287fab073a61..5bb44f8b5b0aa105c8b22602e9b18800484afa21
2020-11-16 10:44:08 -0600 to 2020-12-18 20:07:31 -0500
- Make some further edits to rust-lang/book#2447
- Merge remote-tracking branch 'origin/pr/2447'
- Remove copied and dangling link brackets
- Merge remote-tracking branch 'origin/pr/2359'
- Override toolchain to nightly for run lints action. (rust-lang/book#2528)
- Remove an uneeded 'static lifetime (rust-lang/book#1752)
- Fixes rust-lang/book#2330. Clarify why the lock is held too long
- Update paragraph about rustfmt in Chapter 1.2 (rust-lang/book#2304)
- Clarify language around  further from rust-lang/book#2418
- Merge remote-tracking branch 'origin/pr/2418'
- Merge remote-tracking branch 'origin/pr/2475'
- Add some further edits to rust-lang/book#2433
- Merge remote-tracking branch 'origin/pr/2433'
- Note all the method families to handle integer overflow
- Merge remote-tracking branch 'origin/pr/2405'
- Fix rust-lang/book#1855 - incorporate new reference cycle diagram
- Make some further edits to the changes in rust-lang/book#1886
- Merge remote-tracking branch 'origin/pr/1886'
- Make some further edits to rust-lang/book#1998
- Merge remote-tracking branch 'origin/pr/1998'
- Update Rust version and output (rust-lang/book#2518)
- Fix typo, regarding privileged ports being up to 1023 instead of 1024 (rust-lang/book#2509)
- Change "appendixes" to "appendices" in intro. (rust-lang/book#2498)
- Update 16-11 to use method call expression for `clone` (rust-lang/book#2511)
- Correct chapter 20 final listing (rust-lang/book#2516)

## rust-by-example

7 commits in 236c734a2cb323541b3394f98682cb981b9ec086..1cce0737d6a7d3ceafb139b4a206861fb1dcb2ab
2020-11-30 14:05:49 -0300 to 2020-12-21 17:36:29 -0300
- Add book.description in book.toml (rust-lang/rust-by-example#1397)
- Simplify the call of filter_map (rust-lang/rust-by-example#1396)
- Update README.md (rust-lang/rust-by-example#1382)
- Add missing main function in static life time example. (rust-lang/rust-by-example#1383)
- Clarify first matching arm and all possible values (rust-lang/rust-by-example#1395)
- Clarify distinction between for iter and into_iter (rust-lang/rust-by-example#1394)
- Drop extern crate (rust-lang/rust-by-example#1393)

3 years agoRollup merge of #80272 - petrochenkov:kwed, r=oli-obk
Guillaume Gomez [Tue, 22 Dec 2020 23:13:48 +0000 (00:13 +0100)]
Rollup merge of #80272 - petrochenkov:kwed, r=oli-obk

rustc_span: Provide a reserved identifier check for a specific edition

while keeping edition evaluation lazy because it may be expensive.

Needed for https://github.com/rust-lang/rust/pull/80226.

3 years agoRollup merge of #80266 - bugadani:dup-test, r=jyn514
Guillaume Gomez [Tue, 22 Dec 2020 23:13:47 +0000 (00:13 +0100)]
Rollup merge of #80266 - bugadani:dup-test, r=jyn514

Remove redundant test

Remove ignored test. This test can also be found at src/test/rustdoc-ui/intra-doc/double-anchor.rs and the second version isn't ignored.

r? ``@jyn514``

3 years agoRollup merge of #80248 - camelid:prioritize-zulip-topic, r=Mark-Simulacrum
Guillaume Gomez [Tue, 22 Dec 2020 23:13:45 +0000 (00:13 +0100)]
Rollup merge of #80248 - camelid:prioritize-zulip-topic, r=Mark-Simulacrum

Remove `I-prioritize` from Zulip topic

It doesn't add anything since every topic in
`t-compiler/wg-prioritization/alerts` is about prioritization.
And it makes it harder to see the issue title, which is what the topic
is actually about.

cc ``@rust-lang/wg-prioritization``

3 years agoRollup merge of #80241 - pierwill:patch-12, r=lcnr
Guillaume Gomez [Tue, 22 Dec 2020 23:13:43 +0000 (00:13 +0100)]
Rollup merge of #80241 - pierwill:patch-12, r=lcnr

Fix typo

Fix typo in rustc_middle::ty::inhabitedness::DefIdForest docs.

3 years agoRollup merge of #80225 - pierwill:patch-11, r=lcnr
Guillaume Gomez [Tue, 22 Dec 2020 23:13:41 +0000 (00:13 +0100)]
Rollup merge of #80225 - pierwill:patch-11, r=lcnr

Add module-level docs to rustc_middle::ty

I thought it would be nice to point out `Ty` and `TyCtxt` on the module page, and link out to the [rustc-dev-guide chapter](https://rustc-dev-guide.rust-lang.org/ty.html).

3 years agoRollup merge of #80223 - pierwill:patch-10, r=lcnr
Guillaume Gomez [Tue, 22 Dec 2020 23:13:40 +0000 (00:13 +0100)]
Rollup merge of #80223 - pierwill:patch-10, r=lcnr

docs: Fix outdated crate reference

3 years agoRollup merge of #80222 - GreenRecycleBin:daniel/fix-rustc-std-workspace-core-document...
Guillaume Gomez [Tue, 22 Dec 2020 23:13:38 +0000 (00:13 +0100)]
Rollup merge of #80222 - GreenRecycleBin:daniel/fix-rustc-std-workspace-core-documentation, r=jyn514

Fix rustc-std-workspace-core documentation

r? ```@steveklabnik```

3 years agoRollup merge of #80219 - camelid:library_tracking_issue-labels, r=m-ou-se
Guillaume Gomez [Tue, 22 Dec 2020 23:13:36 +0000 (00:13 +0100)]
Rollup merge of #80219 - camelid:library_tracking_issue-labels, r=m-ou-se

Fix labels for 'Library Tracking Issue' template

Each label needs to be separated by a comma (see the ICE issue template
for an example of correct usage).

r? `````@m-ou-se`````

3 years agoRollup merge of #80204 - pierwill:pierwill-rustcmiddle-ondisk, r=varkor
Guillaume Gomez [Tue, 22 Dec 2020 23:13:34 +0000 (00:13 +0100)]
Rollup merge of #80204 - pierwill:pierwill-rustcmiddle-ondisk, r=varkor

docs: Edit rustc_middle::ty::query::on_disk_cache

Expand abbreviations for "incremental compliation".

Also added the word "to" to the description of CacheEncoder.

3 years agoRollup merge of #80203 - pierwill:pierwill-rustcmiddle-lint, r=oli-obk
Guillaume Gomez [Tue, 22 Dec 2020 23:13:33 +0000 (00:13 +0100)]
Rollup merge of #80203 - pierwill:pierwill-rustcmiddle-lint, r=oli-obk

Edit rustc_middle::lint::LintSource docs

Edit punctuation in doc comment for [rustc_middle::lint::LintSource::CommandLine](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/lint/enum.LintSource.html#variant.CommandLine).

3 years agoRollup merge of #80136 - aDotInTheVoid:74824-test, r=Mark-Simulacrum
Guillaume Gomez [Tue, 22 Dec 2020 23:13:31 +0000 (00:13 +0100)]
Rollup merge of #80136 - aDotInTheVoid:74824-test, r=Mark-Simulacrum

Add test for issue #74824

It was fixed a while ago, but doesn't have a test.

Closes #74824

3 years agorustc_query_system: avoid race condition when using edge_count
Tyson Nottingham [Tue, 22 Dec 2020 18:38:48 +0000 (10:38 -0800)]
rustc_query_system: avoid race condition when using edge_count

3 years agorustc_query_system: add more comments for dependency graph
Tyson Nottingham [Wed, 16 Dec 2020 06:58:19 +0000 (22:58 -0800)]
rustc_query_system: add more comments for dependency graph

3 years agorustc_query_system: rename intern_node to intern_new_node
Tyson Nottingham [Wed, 16 Dec 2020 06:57:21 +0000 (22:57 -0800)]
rustc_query_system: rename intern_node to intern_new_node

3 years agorustc_query_system: remove inline annotation from edge_count
Tyson Nottingham [Wed, 16 Dec 2020 06:42:38 +0000 (22:42 -0800)]
rustc_query_system: remove inline annotation from edge_count

This isn't called frequently enough to justify inlining.

3 years agorustc_query_system: minor cleanup
Tyson Nottingham [Tue, 1 Dec 2020 05:13:49 +0000 (21:13 -0800)]
rustc_query_system: minor cleanup

Remove effectively unused parameter and delete out of date comment.

3 years agorustc_query_system: use more space-efficient edges representation
Tyson Nottingham [Tue, 1 Dec 2020 05:07:08 +0000 (21:07 -0800)]
rustc_query_system: use more space-efficient edges representation

Use single vector of edges rather than per-node vector. There is a small
hit to instruction counts (< 0.5%), but the memory savings make up for it.

3 years agorustc_query_system: share previous graph edges with current graph
Tyson Nottingham [Sun, 29 Nov 2020 01:42:41 +0000 (17:42 -0800)]
rustc_query_system: share previous graph edges with current graph

Reduce memory consumption by sharing the previous dependency graph's
edges with the current graph when it is known to be valid to do so. It
is known to be valid whenever we mark a node green because all of its
dependencies were green. It is *not* known to be valid when we mark a
node green because we re-executed its query and its result was the same
as in the previous compilation session. In that case, the dependency set
might have changed (we don't try to determine whether or not it changed
and whether or not we can share).

3 years agorustc_query_system: share previous graph data with current graph
Tyson Nottingham [Thu, 26 Nov 2020 09:10:43 +0000 (01:10 -0800)]
rustc_query_system: share previous graph data with current graph

Reduce memory consumption by taking advantage of red/green algorithm
properties to share the previous dependency graph's node data with the
current graph instead of storing node data redundantly. Red nodes can
share the `DepNode`, and green nodes can share the `DepNode` and
`Fingerprint`. Edges will be shared when possible in a later change.

3 years agoAuto merge of #80242 - Nadrieril:explain-and-factor-splitting, r=varkor
bors [Tue, 22 Dec 2020 21:51:04 +0000 (21:51 +0000)]
Auto merge of #80242 - Nadrieril:explain-and-factor-splitting, r=varkor

Clarify constructor splitting in exhaustiveness checking

I reworked the explanation of the algorithm completely to make it properly account for the various extensions we've added. This includes constructor splitting, which was previously not clearly included in the algorithm. This makes wildcards less magical; I added some detailed examples; and this distinguishes clearly between constructors that only make sense in patterns (like ranges) and those that make sense for values (like `Some`). This reformulation had been floating around in my mind for a while, and I'm quite happy with how it turned out. Let me know how you feel about it.
I also factored out all three cases of splitting (wildcards, ranges and slices) into dedicated structs to encapsulate the complicated bits.
I measured no perf impact but I don't trust my local measurements for refactors since https://github.com/rust-lang/rust/pull/79284.

r? `@varkor`
`@rustbot` modify labels: +A-exhaustiveness-checking

3 years agoAdd regression test for #80179
ThePuzzlemaker [Tue, 22 Dec 2020 19:25:37 +0000 (13:25 -0600)]
Add regression test for #80179

3 years agoSuggest fn ptr rather than fn item and suggest to use `Fn` trait bounds rather than...
ThePuzzlemaker [Tue, 22 Dec 2020 02:23:21 +0000 (20:23 -0600)]
Suggest fn ptr rather than fn item and suggest to use `Fn` trait bounds rather than the unique closure type in E0121

This is a squash of the titular commit along with these minor commits:
- Improve note
- Improve note pt2

3 years agoAuto merge of #80177 - tgnottingham:foreign_defpathhash_registration, r=Aaron1011
bors [Tue, 22 Dec 2020 19:02:28 +0000 (19:02 +0000)]
Auto merge of #80177 - tgnottingham:foreign_defpathhash_registration, r=Aaron1011

rustc_query_system: explicitly register reused dep nodes

Register nodes that we've reused from the previous session explicitly
with `OnDiskCache`. Previously, we relied on this happening as a side
effect of accessing the nodes in the `PreviousDepGraph`. For the sake of
performance and avoiding unintended side effects, register explictily.

3 years agodocs: Update rustc_middle::middle::region::ScopeTree
pierwill [Tue, 22 Dec 2020 18:50:41 +0000 (10:50 -0800)]
docs: Update rustc_middle::middle::region::ScopeTree

This corrects the return type in docs for yield_in_source method.

Closes #80287.

3 years agoUtilize PGO for rustc linux dist builds
Mark Rousskov [Mon, 14 Dec 2020 18:50:59 +0000 (13:50 -0500)]
Utilize PGO for rustc linux dist builds

This implements support for applying PGO to the rustc compilation step (not
standard library or any tooling, including rustdoc). Expanding PGO to more tools
is not terribly difficult but will involve more work and greater CI time
commitment.

For the same reason of avoiding greater time commitment, this currently avoids
implementing for platforms outside of x86_64-unknown-linux-gnu, though in
practice it should be quite simple to extend over time to more platforms. The
initial implementation is intentionally minimal here to avoid too much work
investment before we start seeing wins for a subset of Rust users.

The choice of workloads to profile here is somewhat arbitrary, but the general
rationale was to aim for a small set that largely avoided time regressions on
perf.rust-lang.org's full suite of crates. The set chosen is libcore, cargo (and
its dependencies), and a few ad-hoc stress tests from perf.rlo. The stress tests
are arguably the most controversial, but they benefit those cases (avoiding
regressions) and do not really remove wins from other benchmarks.

The primary next step after this PR lands is to implement support for PGO in
LLVM. It is unclear whether we can afford a full LLVM rebuild in CI, though, so
the approach taken there may need to be more staggered. rustc-only PGO seems
well affordable on linux at least, giving us up to 20% wall time wins on some
crates for 15 minutes of extra CI time (1 hour up from 45 minutes).

The PGO data is uploaded to allow others to reuse it if attempting to reproduce
the CI build or potentially, in the future, on other platforms where an
off-by-one strategy is used for dist builds at minimal performance cost.

3 years agoFix new ambiguity in the standard library
Joshua Nelson [Sat, 19 Dec 2020 14:23:34 +0000 (09:23 -0500)]
Fix new ambiguity in the standard library

This caught several bugs where people expected `slice` to link to the
primitive, but it linked to the module instead.

This also uses `cfg_attr(bootstrap)` since the ambiguity only occurs
when compiling with stage 1.

3 years agoFix intra-doc links for non-path primitives
Joshua Nelson [Sat, 19 Dec 2020 06:52:43 +0000 (01:52 -0500)]
Fix intra-doc links for non-path primitives

This does *not* currently work for associated items that are
auto-implemented by the compiler (e.g. `never::eq`), because they aren't
present in the source code. I plan to fix this in a follow-up PR.

3 years agoAdd a custom `Res` type
Joshua Nelson [Sat, 19 Dec 2020 04:35:44 +0000 (23:35 -0500)]
Add a custom `Res` type

- Don't make rustc_resolve::Res public; use a new type alias instead

3 years agoAuto merge of #80071 - jyn514:timings, r=Mark-Simulacrum
bors [Tue, 22 Dec 2020 16:09:59 +0000 (16:09 +0000)]
Auto merge of #80071 - jyn514:timings, r=Mark-Simulacrum

Add more timing info to rustdoc

This helped me confirm in https://github.com/rust-lang/rust/issues/79103#issuecomment-745737864 that get_blanket_impls is indeed what's taking all the time on stm32.

r? `@Mark-Simulacrum`

3 years agoImprove the code quality by using matches macro
PankajChaudhary5 [Tue, 22 Dec 2020 15:22:38 +0000 (20:52 +0530)]
Improve the code quality by using matches macro

3 years agoFix a comment
Nadrieril [Tue, 22 Dec 2020 11:28:17 +0000 (11:28 +0000)]
Fix a comment

3 years agoApply suggestions from code review
Nadrieril [Tue, 22 Dec 2020 06:09:54 +0000 (06:09 +0000)]
Apply suggestions from code review

Co-authored-by: varkor <github@varkor.com>
3 years agoSimplify field filtering
Nadrieril [Sat, 19 Dec 2020 07:11:00 +0000 (07:11 +0000)]
Simplify field filtering

3 years agoMake the special "missing patterns" constructor real
Nadrieril [Sun, 20 Dec 2020 00:39:37 +0000 (00:39 +0000)]
Make the special "missing patterns" constructor real

3 years agoCompletely rework the explanation of the algorithm
Nadrieril [Sun, 20 Dec 2020 13:29:39 +0000 (13:29 +0000)]
Completely rework the explanation of the algorithm

3 years agoPass `Matrix` explicitly instead of via `PatCtxt`
Nadrieril [Sun, 20 Dec 2020 14:29:42 +0000 (14:29 +0000)]
Pass `Matrix` explicitly instead of via `PatCtxt`

3 years agoInline the constructor-specific `split` functions
Nadrieril [Sun, 20 Dec 2020 14:22:53 +0000 (14:22 +0000)]
Inline the constructor-specific `split` functions

3 years agoInline `all_constructors`
Nadrieril [Mon, 14 Dec 2020 01:09:06 +0000 (01:09 +0000)]
Inline `all_constructors`

3 years agoRebrand `MissingConstructors` as `SplitWildcard`
Nadrieril [Sun, 13 Dec 2020 23:56:13 +0000 (23:56 +0000)]
Rebrand `MissingConstructors` as `SplitWildcard`

3 years agoFactor out `SplitVarLenSlice` used for slice splitting
Nadrieril [Fri, 11 Dec 2020 22:20:14 +0000 (22:20 +0000)]
Factor out `SplitVarLenSlice` used for slice splitting

3 years agoRun the annoying lint separately
Nadrieril [Sat, 19 Dec 2020 00:37:36 +0000 (00:37 +0000)]
Run the annoying lint separately

3 years agoFactor out `SplitIntRange` used for integer range splitting
Nadrieril [Thu, 10 Dec 2020 13:52:51 +0000 (13:52 +0000)]
Factor out `SplitIntRange` used for integer range splitting

3 years agoAdd some tests
Nadrieril [Sat, 14 Nov 2020 21:50:53 +0000 (21:50 +0000)]
Add some tests

3 years agoTurn helper method into a closure
LingMan [Tue, 22 Dec 2020 15:18:34 +0000 (16:18 +0100)]
Turn helper method into a closure

`replace_prefix` is currently implemented as a method but has no real relation
to the struct it is implemented on. Turn it into a closure and move it into the
only method from which it is called.

3 years agoRework beautify_doc_string so that it returns a Symbol instead of a String
Guillaume Gomez [Sun, 20 Dec 2020 22:37:24 +0000 (23:37 +0100)]
Rework beautify_doc_string so that it returns a Symbol instead of a String

3 years agoAdd some intra-doc links to compiler docs
Joshua Nelson [Tue, 22 Dec 2020 14:54:23 +0000 (09:54 -0500)]
Add some intra-doc links to compiler docs

3 years agoAdd example to lint docs
Wesley Wiser [Mon, 21 Dec 2020 02:44:27 +0000 (21:44 -0500)]
Add example to lint docs

3 years agoRevert "Promote missing_fragment_specifier to hard error"
Wesley Wiser [Sat, 19 Dec 2020 21:30:56 +0000 (16:30 -0500)]
Revert "Promote missing_fragment_specifier to hard error"

This reverts commit 02eae432e7476a0686633a8c2b7cb1d5aab1bd2c.

3 years agoRevert "Remove missing_fragment_specifier lint"
Wesley Wiser [Sat, 19 Dec 2020 21:29:38 +0000 (16:29 -0500)]
Revert "Remove missing_fragment_specifier lint"

This reverts commit 5ba961018c482e050af908de60e4f8bd1a00f0ae.

3 years agoAuto merge of #79451 - usbalbin:array_zip, r=m-ou-se
bors [Tue, 22 Dec 2020 13:19:40 +0000 (13:19 +0000)]
Auto merge of #79451 - usbalbin:array_zip, r=m-ou-se

Added [T; N]::zip()

This is my first PR to rust so I hope I have done everything right, or at least close :)

---

This is PR adds the array method `[T; N]::zip()` which, in my mind, is a natural extension to #75212.

My implementation of `zip()` is mostly just a modified copy-paste of `map()`. Should I keep the comments? Also am I right in assuming there should be no way for the `for`-loop to panic, thus no need for the dropguard seen in the `map()`-function?

The doc comment is in a similar way a slightly modified copy paste of [`Iterator::zip()`](https://doc.rust-lang.org/beta/std/iter/trait.Iterator.html#method.zip)

`@jplatte` mentioned in [#75490](https://github.com/rust-lang/rust/pull/75490#issuecomment-677790758) `zip_with()`,
> zip and zip_with seem like they would be useful :)

is this something I should add (assuming there is interest for this PR at all :))

3 years agoUpdate library/std/src/sys/windows/thread_parker.rs
Linus Färnstrand [Tue, 22 Dec 2020 11:33:11 +0000 (12:33 +0100)]
Update library/std/src/sys/windows/thread_parker.rs

Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
3 years agoFix compare_and_swap in Windows thread_parker
Linus Färnstrand [Tue, 22 Dec 2020 11:24:17 +0000 (12:24 +0100)]
Fix compare_and_swap in Windows thread_parker