Commit Graph

129312 Commits

Author SHA1 Message Date
Scott McMurray
8374c1702c Bump the version of rustfmt used in tidy
To pick up https://github.com/rust-lang/rustfmt/pull/4461
So that rustfmt has the parsing fix from https://github.com/rust-lang/rust/pull/76274

...and do a reformat that it wants.
2020-10-13 07:58:22 -07:00
Scott McMurray
5573a16353 Use try{} in try_fold to decouple library from Try details 2020-10-12 16:17:12 -07:00
bors
8dae8cdcc8 Auto merge of #77847 - Xanewok:update-rls, r=Xanewok
Update RLS

cc #77819
Fixes #77810

r? `@ghost`
2020-10-12 21:03:35 +00:00
bors
16788545e7 Auto merge of #77867 - JohnTitor:rollup-0odg1n4, r=JohnTitor
Rollup of 10 pull requests

Successful merges:

 - #77550 (add shims for WithOptConstParam query calls)
 - #77699 (Add word wrap for short descriptions)
 - #77724 (Implement `AsRawFd` for `StdinLock` etc. on WASI.)
 - #77746 (Fix `x.py setup` sets `changelog-seen`)
 - #77784 (Fix intra-docs link in core::ffi::VaList)
 - #77811 (rustdoc: Make some functions private that don't need to be public)
 - #77818 (Mono collector: replace pair of ints with Range)
 - #77831 (Use std methods on char instead of open coding them)
 - #77852 (update url in bootstrap README (gcc-rs -> cc-rs))
 - #77863 (Remove `mark-i-m` from rustc-dev-guide maintainers)

Failed merges:

r? `@ghost`
2020-10-12 19:09:08 +00:00
Yuki Okushi
984f78b7ed
Rollup merge of #77863 - JohnTitor:remove-mark-i-m, r=pietroalbini
Remove `mark-i-m` from rustc-dev-guide maintainers

They aren't a maintainer anymore and it causes failure on our CI now: https://github.com/rust-lang-ci/rust/runs/1243600577
2020-10-13 04:08:07 +09:00
Yuki Okushi
93ec29b0cb
Rollup merge of #77852 - 12101111:fix-bootstrap-doc, r=jonas-schievink
update url in bootstrap README (gcc-rs -> cc-rs)

gcc-rs is renamed to cc-rs 3 years ago.
2020-10-13 04:08:05 +09:00
Yuki Okushi
e40ae080ac
Rollup merge of #77831 - LingMan:use_std, r=jonas-schievink
Use std methods on char instead of open coding them
2020-10-13 04:08:03 +09:00
Yuki Okushi
233319fc65
Rollup merge of #77818 - bugadani:range, r=oli-obk
Mono collector: replace pair of ints with Range

I found the initial PR (#33171) that introduced this piece of code but I didn't find any information about why a tuple was preferred over a `Range<usize>`.

I'm hoping there are no technical reasons to not do this.
2020-10-13 04:08:02 +09:00
Yuki Okushi
fe0d5b6828
Rollup merge of #77811 - jyn514:private, r=GuillaumeGomez
rustdoc: Make some functions private that don't need to be public

r? @GuillaumeGomez
2020-10-13 04:08:00 +09:00
Yuki Okushi
71d8c10886
Rollup merge of #77784 - aDotInTheVoid:ffi-sealed_trait-intra-docs, r=jyn514
Fix intra-docs link in core::ffi::VaList

At some point, `VaList` was changes to be a [wrapper](https://github.com/rust-lang/rust/blob/1661f77/library/core/src/ffi.rs#L177-L201) over `VaListImpl`, and now the `Arg` method exists on [`VaListImpl`](https://github.com/rust-lang/rust/blob/1661f77/library/core/src/ffi.rs#L333-L336). This PR fixes the intradoc links so that when `--document-private-items` is ran on std (via [patch](https://gist.github.com/aDotInTheVoid/42c82306210203f9c9093c952b765ab4)), it works
2020-10-13 04:07:58 +09:00
Yuki Okushi
dde997710a
Rollup merge of #77746 - winnayx:issue-77572-fix, r=jyn514
Fix `x.py setup` sets `changelog-seen`

Fixes #77572 by setting changelog-seen in setup.rs
2020-10-13 04:07:56 +09:00
Yuki Okushi
ad6e179060
Rollup merge of #77724 - sunfishcode:stdinlock-asrawfd, r=alexcrichton
Implement `AsRawFd` for `StdinLock` etc. on WASI.

WASI implements `AsRawFd` for `Stdin`, `Stdout`, and `Stderr`, so
implement it for `StdinLock`, `StdoutLock`, and `StderrLock` as well.

r? @alexcrichton
2020-10-13 04:07:54 +09:00
Yuki Okushi
a6cc660774
Rollup merge of #77699 - GuillaumeGomez:word-wrap, r=XAMPPRocky
Add word wrap for short descriptions

Fixes #77652

![Screenshot from 2020-10-08 13-26-18](https://user-images.githubusercontent.com/3050060/95452770-11845280-096a-11eb-80da-723da85261fa.png)

cc @WaffleLapkin
r? @jyn514
2020-10-13 04:07:52 +09:00
Yuki Okushi
687d7646de
Rollup merge of #77550 - lcnr:ty-dep-path-ct-cleanup, r=ecstatic-morse
add shims for WithOptConstParam query calls

r? @ecstatic-morse @eddyb
2020-10-13 04:07:50 +09:00
Yuki Okushi
cabedfebcb Remove mark-i-m from rustc-dev-guide maintainers 2020-10-13 03:13:00 +09:00
bors
f3ab6f0584 Auto merge of #77854 - pietroalbini:ETOOMANYCHANNELS, r=Mark-Simulacrum
build-manifest: stop generating numbered channel names except for stable

This fixes numbered channel names being created for the nightly channel, and once the root cause of this rides the trains, for beta.

r? `@Mark-Simulacrum`
2020-10-12 15:50:36 +00:00
Pietro Albini
5973fd42a2
build-manifest: stop generating numbered channel names except for stable
This fixes numbered channel names being created for the nightly channel,
and once the root cause of this rides the trains, for beta.
2020-10-12 17:39:13 +02:00
Guillaume Gomez
9f1048d723 Add word-wrap rule for short descriptions 2020-10-12 15:41:37 +02:00
12101111
5d44402345 update url in bootstrap README 2020-10-12 21:17:11 +08:00
bors
d6b5ffb5b4 Auto merge of #77821 - tmiasko:discriminant-value-is-safe, r=jonas-schievink
Remove unnecessary unsafe block around calls to discriminant_value

Since 63793 the discriminant_value intrinsic is safe to call. Remove
unnecessary unsafe block around calls to this intrinsic in built-in
derive macros.
2020-10-12 12:12:54 +00:00
Igor Matuszewski
1852392120 Update RLS 2020-10-12 13:10:43 +02:00
bors
d9b931669b Auto merge of #75914 - arlosi:aarch64-ci, r=pietroalbini
Promote aarch64-pc-windows-msvc to Tier 2 Development Platform

Adds a GitHub Actions CI build for `aarch64-pc-windows-msvc` via cross-compilation on an x86_64 host.

This promotes `aarch64-pc-windows-msvc` from a Tier 2 Compilation Target (std) to a Tier 2 Development Platform (std+rustc+cargo+tools).

Fixes #72881

r? `@pietroalbini`
2020-10-12 10:17:48 +00:00
bors
a8d6da3f57 Auto merge of #77837 - Aaron1011:bump-miri-backtrace, r=RalfJung
Bump miri

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

r? `@RalfJung`
2020-10-12 08:25:38 +00:00
bors
62cbe81b8a Auto merge of #75956 - jonas-schievink:lto-opt-sz, r=tmiasko
Fix -Clinker-plugin-lto with opt-levels s and z

Pass s and z as `-plugin-opt=O2` to the linker. This is what `-Os` and `-Oz` correspond to, apparently.

Fixes https://github.com/rust-lang/rust/issues/75940
2020-10-12 06:10:50 +00:00
bors
63962f0203 Auto merge of #77819 - mati865:crossbeam-ub, r=Mark-Simulacrum
Update crossbeam-channel to avoid UB

More info: https://github.com/RustSec/advisory-db/pull/425
2020-10-12 04:18:56 +00:00
bors
1fe9b7f3fe Auto merge of #77790 - jyn514:undivided, r=ollie27
Show summary lines on cross-crate re-exports

See my write-up in https://github.com/rust-lang/rust/issues/77783#issuecomment-706551743 for what's going on here.

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

r? `@ollie27`
2020-10-12 02:20:04 +00:00
Joshua Nelson
41878285e8 Remove unnecessary RefCell for doc_strings
This was there for `Divider` and is no longer necessary.
2020-10-11 20:31:00 -04:00
Joshua Nelson
1772f2d2dc Show summary lines on cross-crate re-exports
This removes the unnecessary `DocFragmentKind::Divider` in favor of just
using the logic I actually want in `collapse_docs`.
2020-10-11 20:27:17 -04:00
Jonas Schievink
32cf035046 Use no-prefer-dynamic 2020-10-12 01:51:40 +02:00
Aaron Hill
5e34bddc1b
Bump miri 2020-10-11 19:45:15 -04:00
Jonas Schievink
4f5394199b Fix -Clinker-plugin-lto with opt-levels s and z 2020-10-12 01:45:00 +02:00
bors
576e2277ac Auto merge of #75991 - shepmaster:silicon-ci, r=pietroalbini
Set up CI for aarch64-apple-darwin
2020-10-11 23:23:48 +00:00
Mateusz Mikuła
5aa661757a Update crossbeam-channel to avoid UB 2020-10-11 23:40:29 +02:00
bors
c71248b708 Auto merge of #76859 - Aaron1011:fix/llvm-cgu-reuse, r=davidtwco,nikic
Use llvm::computeLTOCacheKey to determine post-ThinLTO CGU reuse

During incremental ThinLTO compilation, we attempt to re-use the
optimized (post-ThinLTO) bitcode file for a module if it is 'safe' to do
so.

Up until now, 'safe' has meant that the set of modules that our current
modules imports from/exports to is unchanged from the previous
compilation session. See PR #67020 and PR #71131 for more details.

However, this turns out be insufficient to guarantee that it's safe
to reuse the post-LTO module (i.e. that optimizing the pre-LTO module
would produce the same result). When LLVM optimizes a module during
ThinLTO, it may look at other information from the 'module index', such
as whether a (non-imported!) global variable is used. If this
information changes between compilation runs, we may end up re-using an
optimized module that (for example) had dead-code elimination run on a
function that is now used by another module.

Fortunately, LLVM implements its own ThinLTO module cache, which is used
when ThinLTO is performed by a linker plugin (e.g. when clang is used to
compile a C proect). Using this cache directly would require extensive
refactoring of our code - but fortunately for us, LLVM provides a
function that does exactly what we need.

The function `llvm::computeLTOCacheKey` is used to compute a SHA-1 hash
from all data that might influence the result of ThinLTO on a module.
In addition to the module imports/exports that we manually track, it
also hashes information about global variables (e.g. their liveness)
which might be used during optimization. By using this function, we
shouldn't have to worry about new LLVM passes breaking our module re-use
behavior.

In LLVM, the output of this function forms part of the filename used to
store the post-ThinLTO module. To keep our current filename structure
intact, this PR just writes out the mapping 'CGU name -> Hash' to a
file. To determine if a post-LTO module should be reused, we compare
hashes from the previous session.

This should unblock PR #75199 - by sheer chance, it seems to have hit
this issue due to the particular CGU partitioning and optimization
decisions that end up getting made.
2020-10-11 20:50:02 +00:00
Winnie Xiao
d7494af551 Mostly print statements to see where things are
More print statementsstatements lol

Solved the basic case of eliminating check_version ifk_version if subcommand = setup

Finished v1

checking out old bootstrap.py

checked out old irrelevant files

fixed tidy

Moved VERSION from bin/main.rs to lib.rs

Fixed semicolon return issue

x.py fmt
2020-10-11 22:32:06 +02:00
LingMan
a56b0e96d0 Simplify using is_ascii_alphabetic and is_ascii_alphanumeric 2020-10-11 22:27:21 +02:00
LingMan
e533bb73bc Don't duplicate char::is_ascii_digit 2020-10-11 22:27:20 +02:00
bors
06a079c43e Auto merge of #77824 - Aaron1011:bump-backtrace-miri, r=RalfJung
Bump backtrace-rs

Fixes #77791

r? `@RalfJung`

cc `@alexcrichton`
2020-10-11 18:24:40 +00:00
Aaron Hill
44fdfd66ab
Bump backtrace-rs
Fixes #77791
2020-10-11 13:52:20 -04:00
bors
8cc82ee340 Auto merge of #77793 - tmiasko:no-op-discriminant, r=ecstatic-morse
Recognize discriminant reads as no-ops in RemoveNoopLandingPads

The cleanup blocks often contain read of discriminants. Teach
RemoveNoopLandingPads to recognize them as no-ops to remove
additional no-op landing pads.
2020-10-11 16:33:47 +00:00
Joshua Nelson
83c790ffda Make some functions private that don't need to be public 2020-10-11 11:54:40 -04:00
bors
bc74dd711f Auto merge of #77727 - thomcc:mach-info-order, r=Amanieu
Avoid SeqCst or static mut in mach_timebase_info and QueryPerformanceFrequency caches

This patch went through a couple iterations but the end result is replacing a pattern where an `AtomicUsize` (updated with many SeqCst ops) guards a `static mut` with a single `AtomicU64` that is known to use 0 as a value indicating that it is not initialized.

The code in both places exists to cache values used in the conversion of Instants to Durations on macOS, iOS, and Windows.

I have no numbers to prove that this improves performance (It seems a little futile to benchmark something like this), but it's much simpler, safer, and in practice we'd expect it to be faster everywhere where Relaxed operations on AtomicU64 are cheaper than SeqCst operations on AtomicUsize, which is a lot of places.

Anyway, it also removes a bunch of unsafe code and greatly simplifies the logic, so IMO that alone would be worth it unless it was a regression.

If you want to take a look at the assembly output though, see https://godbolt.org/z/rbr6vn for x86_64, https://godbolt.org/z/cqcbqv for aarch64 (Note that this just the output of the mac side, but i'd expect the windows part to be the same and don't feel like doing another godbolt for it). There are several versions of this function in the godbolt:

- `info_new`: version in the current patch
- `info_less_new`: version in initial PR
- `info_original`: version currently in the tree
- `info_orig_but_better_orderings`: a version that just tries to change the original code's orderings from SeqCst to the (probably) minimal orderings required for soundness/correctness.

The biggest concern I have here is if we can use AtomicU64, or if there are targets that dont have it that this code supports. AFAICT: no. (If that changes in the future, it's easy enough to do something different for them)

r? `@Amanieu` because he caught a couple issues last time I tried to do a patch reducing orderings 😅

---

<details>
<summary>I rewrote this whole message so the original is inside here</summary>

I happened to notice the code we use for caching the result of mach_timebase_info uses SeqCst exclusively.

However, thinking a little more, it's actually pretty easy to avoid the static mut by packing the timebase info into an AtomicU64.

This entirely avoids needing to do the compare_exchange. The AtomicU64 can be read/written using Relaxed ops, which on current macos/ios platforms (x86_64/aarch64) have no overhead compared to direct loads/stores. This simplifies the code and makes it a lot safer too.

I have no numbers to prove that this improves performance (It seems a little futile to benchmark something like this), although it should do that on both targets it applies to.

That said, it also removes a bunch of unsafe code and simplifies the logic (arguably at least — there are only two states now, initialized or not), so I think it's a net win even without concrete numbers.

If you want to take a look at the assembly output though, see below. It has the new version, the original, and a version of the original with lower Orderings (which is still worse than the version in this PR)

- godbolt.org/z/obfqf9 x86_64-apple-darwin

- godbolt.org/z/Wz5cWc aarch64-unknown-linux-gnu (godbolt can't do aarch64-apple-ios but that doesn't matter here)

A different (and more efficient) option than this would be to just use the AtomicU64 and use the knowledge that after initialization the denominator should be nonzero... That felt like it's relying on too many things I'm not confident in, so I didn't want to do that.
</details>
2020-10-11 14:06:04 +00:00
bors
c38f001db5 Auto merge of #77743 - bugadani:idl-cleanup, r=bugadani
Clean up in intra-doc link collector

This PR makes the following changes in intra-doc links:
 - clean up hard to follow closure-based logic in `check_full_res`
 - fix a FIXME comment by figuring out that `true` and `false` need to be resolved separately
 - refactor path resolution by extracting common code to a helper method and trying to reduce the number of unnecessary early returns
 - primitive types are now defined by their symbols, not their name strings
 - re-enables a commented-out test case

Closes #77267 (cc `@Stupremee)`

r? `@jyn514`
2020-10-11 09:50:19 +00:00
bors
c6bebc14a1 Auto merge of #77769 - camelid:regression-untriaged, r=jyn514
Auto-prioritize issues with `regression-untriaged`

This auto-prioritizes issues with the `regression-untriaged` label. (I just added it per <https://github.com/rust-lang/rust/pull/77725#discussion_r502135703>.)

Cc #77725

r? `@Mark-Simulacrum`
2020-10-11 07:55:20 +00:00
bors
fb27a7db50 Auto merge of #77565 - khyperia:codegen-backend-dep, r=ecstatic-morse
Add -Z codegen-backend dylib to deps

When the codegen-backend dylib changes, the program should be rebuilt.

---

Unfortunately I was unable to test this works locally due to running into a TLS issue when running the custom backend, `thread 'rustc' panicked at 'no ImplicitCtxt stored in tls', compiler/rustc_middle/src/ty/context.rs:1750:54`, which seems similar to https://github.com/rust-lang/rust/issues/62717 but has a completely different cause and backtrace.

`@eddyb` said to ping `@Mark-Simulacrum` about what they think about this, so, ping!
2020-10-11 06:03:23 +00:00
bors
9a8ca69602 Auto merge of #77774 - petrochenkov:floatuple, r=estebank
rustc_parse: More precise spans for `tuple.0.0`

This should help with https://github.com/rust-lang/rustfmt/issues/4355, but I haven't verified, cc `@calebcartwright.`
2020-10-11 03:54:26 +00:00
bors
25d2d09da7 Auto merge of #77649 - dash2507:replace_run_compiler, r=matthewjasper
Replace run_compiler with RunCompiler builder pattern

Fixes #77286. Replaces rustc_driver:run_compiler with RunCompiler builder pattern.
2020-10-11 01:26:06 +00:00
Tomasz Miąsko
50da126557 Remove unnecessary unsafe block around calls to discriminant_value
Since 63793 the discriminant_value intrinsic is safe to call. Remove
unnecessary unsafe block around calls to this intrinsic in built-in
derive macros.
2020-10-11 00:00:00 +00:00
Vadim Petrochenkov
dee704930d rustc_parse: More precise spans for tuple.0.0 2020-10-11 02:33:49 +03:00
bors
08764ad163 Auto merge of #77087 - estebank:issue-45817, r=matthewjasper
Provide structured suggestions when finding structs when expecting a trait

When finding an ADT in a trait object definition provide some solutions. Fix #45817.
Given `<Param as Trait>::Assoc: Ty` suggest `Param: Trait<Assoc = Ty>`. Fix #75829.
2020-10-10 23:27:28 +00:00