]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAdd std::thread::available_concurrency
Yoshua Wuyts [Sat, 18 Jul 2020 15:11:46 +0000 (17:11 +0200)]
Add std::thread::available_concurrency

3 years agoAuto merge of #77837 - Aaron1011:bump-miri-backtrace, r=RalfJung
bors [Mon, 12 Oct 2020 08:25:38 +0000 (08:25 +0000)]
Auto merge of #77837 - Aaron1011:bump-miri-backtrace, r=RalfJung

Bump miri

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

r? `@RalfJung`

3 years agoAuto merge of #75956 - jonas-schievink:lto-opt-sz, r=tmiasko
bors [Mon, 12 Oct 2020 06:10:50 +0000 (06:10 +0000)]
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

3 years agoAuto merge of #77819 - mati865:crossbeam-ub, r=Mark-Simulacrum
bors [Mon, 12 Oct 2020 04:18:56 +0000 (04:18 +0000)]
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

3 years agoAuto merge of #77790 - jyn514:undivided, r=ollie27
bors [Mon, 12 Oct 2020 02:20:04 +0000 (02:20 +0000)]
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`

3 years agoRemove unnecessary `RefCell` for doc_strings
Joshua Nelson [Mon, 12 Oct 2020 00:31:00 +0000 (20:31 -0400)]
Remove unnecessary `RefCell` for doc_strings

This was there for `Divider` and is no longer necessary.

3 years agoShow summary lines on cross-crate re-exports
Joshua Nelson [Mon, 12 Oct 2020 00:27:17 +0000 (20:27 -0400)]
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`.

3 years agoUse no-prefer-dynamic
Jonas Schievink [Sun, 11 Oct 2020 23:51:40 +0000 (01:51 +0200)]
Use no-prefer-dynamic

3 years agoBump miri
Aaron Hill [Sun, 11 Oct 2020 22:09:27 +0000 (18:09 -0400)]
Bump miri

3 years agoFix -Clinker-plugin-lto with opt-levels s and z
Jonas Schievink [Wed, 26 Aug 2020 20:11:53 +0000 (22:11 +0200)]
Fix -Clinker-plugin-lto with opt-levels s and z

3 years agoAuto merge of #75991 - shepmaster:silicon-ci, r=pietroalbini
bors [Sun, 11 Oct 2020 23:23:48 +0000 (23:23 +0000)]
Auto merge of #75991 - shepmaster:silicon-ci, r=pietroalbini

Set up CI for aarch64-apple-darwin

3 years agoUpdate crossbeam-channel to avoid UB
Mateusz Mikuła [Sun, 11 Oct 2020 14:19:35 +0000 (16:19 +0200)]
Update crossbeam-channel to avoid UB

3 years agoAuto merge of #76859 - Aaron1011:fix/llvm-cgu-reuse, r=davidtwco,nikic
bors [Sun, 11 Oct 2020 20:50:02 +0000 (20:50 +0000)]
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.

3 years agoAuto merge of #77824 - Aaron1011:bump-backtrace-miri, r=RalfJung
bors [Sun, 11 Oct 2020 18:24:40 +0000 (18:24 +0000)]
Auto merge of #77824 - Aaron1011:bump-backtrace-miri, r=RalfJung

Bump backtrace-rs

Fixes #77791

r? `@RalfJung`

cc `@alexcrichton`

3 years agoBump backtrace-rs
Aaron Hill [Sun, 11 Oct 2020 17:51:07 +0000 (13:51 -0400)]
Bump backtrace-rs

Fixes #77791

3 years agoAuto merge of #77793 - tmiasko:no-op-discriminant, r=ecstatic-morse
bors [Sun, 11 Oct 2020 16:33:47 +0000 (16:33 +0000)]
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.

3 years agoAuto merge of #77727 - thomcc:mach-info-order, r=Amanieu
bors [Sun, 11 Oct 2020 14:06:04 +0000 (14:06 +0000)]
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>

3 years agoAuto merge of #77743 - bugadani:idl-cleanup, r=bugadani
bors [Sun, 11 Oct 2020 09:50:19 +0000 (09:50 +0000)]
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`

3 years agoAuto merge of #77769 - camelid:regression-untriaged, r=jyn514
bors [Sun, 11 Oct 2020 07:55:20 +0000 (07:55 +0000)]
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`

3 years agoAuto merge of #77565 - khyperia:codegen-backend-dep, r=ecstatic-morse
bors [Sun, 11 Oct 2020 06:03:23 +0000 (06:03 +0000)]
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!

3 years agoAuto merge of #77774 - petrochenkov:floatuple, r=estebank
bors [Sun, 11 Oct 2020 03:54:26 +0000 (03:54 +0000)]
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.`

3 years agoAuto merge of #77649 - dash2507:replace_run_compiler, r=matthewjasper
bors [Sun, 11 Oct 2020 01:26:06 +0000 (01:26 +0000)]
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.

3 years agorustc_parse: More precise spans for `tuple.0.0`
Vadim Petrochenkov [Fri, 9 Oct 2020 23:01:44 +0000 (02:01 +0300)]
rustc_parse: More precise spans for `tuple.0.0`

3 years agoAuto merge of #77087 - estebank:issue-45817, r=matthewjasper
bors [Sat, 10 Oct 2020 23:27:28 +0000 (23:27 +0000)]
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.

3 years agoAuto merge of #76934 - camelid:rustdoc-allow-generic-params, r=jyn514
bors [Sat, 10 Oct 2020 21:19:50 +0000 (21:19 +0000)]
Auto merge of #76934 - camelid:rustdoc-allow-generic-params, r=jyn514

Allow generic parameters in intra-doc links

Fixes #62834.

---

The contents of the generics will be mostly ignored (except for warning
if fully-qualified syntax is used, which is currently unsupported in
intra-doc links - see issue #74563).

* Allow links like `Vec<T>`, `Result<T, E>`, and `Option<Box<T>>`
* Allow links like `Vec::<T>::new()`
* Warn on
  * Unbalanced angle brackets (e.g. `Vec<T` or `Vec<T>>`)
  * Missing type to apply generics to (`<T>` or `<Box<T>>`)
  * Use of fully-qualified syntax (`<Vec as IntoIterator>::into_iter`)
  * Invalid path separator (`Vec:<T>:new`)
  * Too many angle brackets (`Vec<<T>>`)
  * Empty angle brackets (`Vec<>`)

Note that this implementation *does* allow some constructs that aren't
valid in the actual Rust syntax, for example `Box::<T>new()`. That may
not be supported in rustdoc in the future; it is an implementation
detail.

3 years agoFix query docs
Camelid [Sat, 10 Oct 2020 19:49:31 +0000 (12:49 -0700)]
Fix query docs

They were not formatted correctly, so rustdoc was interpreting some
parts as code. Also cleaned up some other query docs that weren't
causing issues, but were formatted incorrectly.

3 years agoAuto merge of #77798 - JohnTitor:rollup-82u711m, r=JohnTitor
bors [Sat, 10 Oct 2020 19:26:13 +0000 (19:26 +0000)]
Auto merge of #77798 - JohnTitor:rollup-82u711m, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #77195 (Link to documentation-specific guidelines.)
 - #77629 (Cleanup of `eat_while()` in lexer)
 - #77709 (Link Vec leak doc to Box)
 - #77738 (fix __rust_alloc_error_handler comment)
 - #77748 (Dead code cleanup in windows-gnu std)
 - #77754 (Add TraitDef::find_map_relevant_impl)
 - #77766 (Clarify the debug-related values should take boolean)
 - #77777 (doc: disambiguate stat in MetadataExt::as_raw_stat)
 - #77782 (Fix typo in error code description)
 - #77787 (Update `changelog-seen` in config.toml.example)

Failed merges:

r? `@ghost`

3 years agoRollup merge of #77787 - jyn514:consistent-versions, r=spastorino
Yuki Okushi [Sat, 10 Oct 2020 18:19:21 +0000 (03:19 +0900)]
Rollup merge of #77787 - jyn514:consistent-versions, r=spastorino

Update `changelog-seen` in config.toml.example

This got out of sync when the version was bumped last time in #77133

Long-term we may want to find an easier way to maintain this that
doesn't require bumping the version in three different places. Off the
top of my head I can't think of anything, though. It _is_ documented in src/bootstrap/README.md, although I don't know how many people read that.

r? @Mark-Simulacrum
cc @spastorino

3 years agoRollup merge of #77782 - nhayama:fix-typo, r=jonas-schievink
Yuki Okushi [Sat, 10 Oct 2020 18:19:19 +0000 (03:19 +0900)]
Rollup merge of #77782 - nhayama:fix-typo, r=jonas-schievink

Fix typo in error code description

s/abitrary/arbitrary/

3 years agoRollup merge of #77777 - cuviper:doc-stat, r=jonas-schievink
Yuki Okushi [Sat, 10 Oct 2020 18:19:18 +0000 (03:19 +0900)]
Rollup merge of #77777 - cuviper:doc-stat, r=jonas-schievink

doc: disambiguate stat in MetadataExt::as_raw_stat

A few architectures in `os::linux::raw` import `libc::stat`, rather than
defining that type directly. However, that also imports the _function_
called `stat`, which makes this doc link ambiguous:

    error: `crate::os::linux::raw::stat` is both a struct and a function
      --> library/std/src/os/linux/fs.rs:21:19
       |
    21 |     /// [`stat`]: crate::os::linux::raw::stat
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous link
       |
       = note: `-D broken-intra-doc-links` implied by `-D warnings`
    help: to link to the struct, prefix with the item type
       |
    21 |     /// [`stat`]: struct@crate::os::linux::raw::stat
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    help: to link to the function, add parentheses
       |
    21 |     /// [`stat`]: crate::os::linux::raw::stat()
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

We want the `struct`, so it's now prefixed accordingly.

3 years agoRollup merge of #77766 - JohnTitor:fix-debug-config, r=jyn514
Yuki Okushi [Sat, 10 Oct 2020 18:19:16 +0000 (03:19 +0900)]
Rollup merge of #77766 - JohnTitor:fix-debug-config, r=jyn514

Clarify the debug-related values should take boolean

#76588 tweaked their placeholders but these values should take boolean and the current placeholders are confusing, at least for me.

3 years agoRollup merge of #77754 - bugadani:find_map_relevant_impl, r=matthewjasper
Yuki Okushi [Sat, 10 Oct 2020 18:19:14 +0000 (03:19 +0900)]
Rollup merge of #77754 - bugadani:find_map_relevant_impl, r=matthewjasper

Add TraitDef::find_map_relevant_impl

This PR adds a method to `TraitDef`. While `for_each_relevant_impl` covers the general use case, sometimes it's not necessary to scan through all the relevant implementations, so this PR introduces a new method, `find_map_relevant_impl`. I've also replaced the `for_each_relevant_impl` calls where possible.

I'm hoping for a tiny bit of efficiency gain here and there.

3 years agoRollup merge of #77748 - mati865:dead-code-cleanup, r=petrochenkov
Yuki Okushi [Sat, 10 Oct 2020 18:19:12 +0000 (03:19 +0900)]
Rollup merge of #77748 - mati865:dead-code-cleanup, r=petrochenkov

Dead code cleanup in windows-gnu std

Closes https://github.com/rust-lang/rust/issues/77622

This is the only leftover I could find.

3 years agoRollup merge of #77738 - RalfJung:alloc-error-handler-comment, r=Amanieu
Yuki Okushi [Sat, 10 Oct 2020 18:19:10 +0000 (03:19 +0900)]
Rollup merge of #77738 - RalfJung:alloc-error-handler-comment, r=Amanieu

fix __rust_alloc_error_handler comment

`__rust_alloc_error_handler` was added in the same `extern` block as the allocator functions, but the comment there was not actually correct for `__rust_alloc_error_handler`. So move it down to the rest of the default allocator handling with a fixed comment. At least the comment reflects my understanding of what happens, please check carefully. :)

r? @Amanieu Cc @haraldh

3 years agoRollup merge of #77709 - pickfire:patch-1, r=jyn514
Yuki Okushi [Sat, 10 Oct 2020 18:19:09 +0000 (03:19 +0900)]
Rollup merge of #77709 - pickfire:patch-1, r=jyn514

Link Vec leak doc to Box

3 years agoRollup merge of #77629 - Julian-Wollersberger:recomputeRawStrError, r=varkor
Yuki Okushi [Sat, 10 Oct 2020 18:19:07 +0000 (03:19 +0900)]
Rollup merge of #77629 - Julian-Wollersberger:recomputeRawStrError, r=varkor

Cleanup of `eat_while()` in lexer

The size of a lexer Token was inflated by the largest `TokenKind` variants `LiteralKind::RawStr` and `RawByteStr`, because
* it used `usize` although `u32` is sufficient in rustc, since crates must be smaller than 4GB,
* and it stored the 20 bytes big `RawStrError` enum for error reporting.

If a raw string is invalid, it now needs to be reparsed to get the `RawStrError` data, but that is a very cold code path.

Technically this breaks other tools that depend on rustc_lexer because they are now also restricted to a max file size of 4GB. But this shouldn't matter in practice, and rustc_lexer isn't stable anyway.

Can I also get a perf run?

Edit: This makes no difference in performance. The PR now only contains a small cleanup.

3 years agoRollup merge of #77195 - follower:patch-2, r=jyn514
Yuki Okushi [Sat, 10 Oct 2020 18:19:05 +0000 (03:19 +0900)]
Rollup merge of #77195 - follower:patch-2, r=jyn514

Link to documentation-specific guidelines.

Changed contribution information URL because it's not obvious how to get from the current URL to the documentation-specific content.

The current URL points to this "Getting Started" page, which contains nothing specific about documentation[*] and instead launches into how to *build* `rustc` which is not a strict prerequisite for contributing documentation fixes:

 * https://rustc-dev-guide.rust-lang.org/getting-started.html

[*] The most specific content is a "Writing documentation" bullet point which is not itself a link to anything (I guess a patch for that might be helpful too).

### Why?

Making this change will make it easier for people who wish to make small "drive by" documentation fixes (and read contribution guidelines ;) ) which I find are often how I start contributing to a project. (Exhibit A: https://github.com/rust-lang/rust/pull/77050 :) )

### Background

My impression is the change of content linked is an unintentional change due to a couple of other changes:

 * Originally, the link pointed to  `contributing.md` which started with a "table of contents" linking to each section. But the content in `contributing.md` was removed and replaced with a link to the "Getting Started" section here:

    * https://github.com/rust-lang/rust/commit/3f6928f1f6eff367e6ddbfb63ebc5e568ffe0eb1#diff-6a3371457528722a734f3c51d9238c13L1

   But the changed link doesn't actually point to the equivalent content, which is now located here:

    * https://rustc-dev-guide.rust-lang.org/contributing.html

   (If the "Guide to Rustc Development" is now considered the canonical location of "How to Contribute" content it might be a good idea to merge some of the "Contributing" Introduction section into the "Getting Started" section.)

 * This was then compounded by changing the link from `contributing.md` to  `contributing.html` here:

     * https://github.com/rust-lang/rust/pull/74037/files#diff-242481015141f373dcb178e93cffa850L88

    In order to even find the new location of the previous `contributing.md` content I ended up needing to do a GitHub search of the `rust-lang` org for the phrase "Documentation improvements are very welcome". :D

3 years agoAuto merge of #77337 - lzutao:asm-mips64, r=Amanieu
bors [Sat, 10 Oct 2020 17:32:28 +0000 (17:32 +0000)]
Auto merge of #77337 - lzutao:asm-mips64, r=Amanieu

Add asm! support for mips64

- [x] Updated `src/doc/unstable-book/src/library-features/asm.md`.
- [ ] No vector type support. I don't know much about those types.

cc #76839

3 years agoAuto merge of #77771 - nagisa:revert-77023, r=Mark-Simulacrum
bors [Sat, 10 Oct 2020 15:17:01 +0000 (15:17 +0000)]
Auto merge of #77771 - nagisa:revert-77023, r=Mark-Simulacrum

Revert "Assume slice len is bounded by allocation size"

https://github.com/rust-lang/rust/pull/77023#issuecomment-703987379
suggests that the original PR introduced a significant perf regression.

This reverts commit e44784b8750016a695361c990024750e037d8f9f / #77023.

cc `@HeroicKatora`

3 years agoClarify the debug-related values should take boolean
Yuki Okushi [Fri, 9 Oct 2020 20:36:33 +0000 (05:36 +0900)]
Clarify the debug-related values should take boolean

They should take boolean values and the current placeholders are confusing, at least for me.

3 years agoImprove vec leak wording
Ivan Tham [Sat, 10 Oct 2020 14:17:48 +0000 (22:17 +0800)]
Improve vec leak wording

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoAlloc vec doc mention cannot undo leak
Ivan Tham [Sat, 10 Oct 2020 14:12:28 +0000 (22:12 +0800)]
Alloc vec doc mention cannot undo leak

3 years agoUpdate `changelog-seen` in config.toml.example
Joshua Nelson [Sat, 10 Oct 2020 14:08:36 +0000 (10:08 -0400)]
Update `changelog-seen` in config.toml.example

This got out of sync when the version was bumped last time.

Long-term we may want to find an easier way to maintain this that
doesn't require bumping the version in three different places. Off the
top of my head I can't think of anything, though.

3 years agoRe-enable test case
Dániel Buga [Sat, 10 Oct 2020 08:20:10 +0000 (10:20 +0200)]
Re-enable test case

3 years agoApply suggestions from code review
Dániel Buga [Sat, 10 Oct 2020 07:30:10 +0000 (09:30 +0200)]
Apply suggestions from code review

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoRefactor path resolution and use Symbols instead of &str
Dániel Buga [Sat, 10 Oct 2020 00:13:34 +0000 (02:13 +0200)]
Refactor path resolution and use Symbols instead of &str

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoApply suggestions from code review
Dániel Buga [Fri, 9 Oct 2020 15:54:43 +0000 (17:54 +0200)]
Apply suggestions from code review

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoClean up hard to follow control flow
Dániel Buga [Fri, 9 Oct 2020 10:04:44 +0000 (12:04 +0200)]
Clean up hard to follow control flow

3 years agoClean up check_full_res
Dániel Buga [Fri, 9 Oct 2020 09:16:57 +0000 (11:16 +0200)]
Clean up check_full_res

3 years agoAuto merge of #77731 - cuviper:big-endian-backtrace, r=alexcrichton
bors [Sat, 10 Oct 2020 12:51:15 +0000 (12:51 +0000)]
Auto merge of #77731 - cuviper:big-endian-backtrace, r=alexcrichton

Update the backtrace crate to fix big-endian ELF

Pulls in rust-lang/backtrace-rs#373.
Fixes #77410.

r? `@alexcrichton`

3 years agoAuto merge of #77717 - tmiasko:posix-spawn-error-check, r=cuviper
bors [Sat, 10 Oct 2020 10:59:20 +0000 (10:59 +0000)]
Auto merge of #77717 - tmiasko:posix-spawn-error-check, r=cuviper

Fix error checking in posix_spawn implementation of Command

* Check for errors returned from posix_spawn*_init functions
* Check for non-zero return value from posix_spawn functions

3 years agoAuto merge of #77580 - petrochenkov:norestarg, r=matthewjasper
bors [Sat, 10 Oct 2020 09:07:35 +0000 (09:07 +0000)]
Auto merge of #77580 - petrochenkov:norestarg, r=matthewjasper

rustc_target: Refactor away `TargetResult`

Follow-up to https://github.com/rust-lang/rust/pull/77202.

Construction of a built-in target is always infallible now, so `TargetResult` is no longer necessary.

The second commit contains some further cleanup based on built-in target construction being infallible.

3 years agoFix typo in error code description
Naoki Hayama [Sat, 10 Oct 2020 09:02:53 +0000 (18:02 +0900)]
Fix typo in error code description

s/abitrary/arbitrary/

3 years agoAuto merge of #77336 - pietroalbini:pkgname, r=Mark-Simulacrum
bors [Sat, 10 Oct 2020 06:59:49 +0000 (06:59 +0000)]
Auto merge of #77336 - pietroalbini:pkgname, r=Mark-Simulacrum

Always use the Rust version in package names

The format of the tarballs produced by CI is roughly the following:

    {component}-{release}-{target}.{ext}

While on the beta and nightly channels `{release}` is just the channel name, on the stable channel is either the Rust version or the version of the component we're shipping:

    cargo-0.47.0-x86_64-unknown-linux-gnu.tar.xz
    clippy-0.0.212-x86_64-unknown-linux-gnu.tar.xz
    llvm-tools-1.46.0-x86_64-unknown-linux-gnu.tar.xz
    miri-0.1.0-x86_64-unknown-linux-gnu.tar.xz
    rls-1.41.0-x86_64-unknown-linux-gnu.tar.xz
    rust-1.46.0-x86_64-unknown-linux-gnu.tar.xz
    ...

This makes it really hard to get the package URL without having access to the manifest (and there is no manifest on ci-artifacts.rlo), as there is no consistent version number to use.

This PR addresses the problem by always using the Rust version number as `{release}` for the stable channel, regardless of the version number of the component we're shipping. I chose that instead of "stable" to avoid breaking the URL scheme *that* much.

Rustup should not be affected by this change, as it fetches the URLs from the manifest. Unfortunately we don't have a way to test other clients before making a stable release, as this change only affects the stable channel.

r? `@Mark-Simulacrum`

3 years agoaddress review comments
Esteban Küber [Fri, 9 Oct 2020 23:51:54 +0000 (16:51 -0700)]
address review comments

3 years agodoc: disambiguate stat in MetadataExt::as_raw_stat
Josh Stone [Sat, 10 Oct 2020 03:12:26 +0000 (20:12 -0700)]
doc: disambiguate stat in MetadataExt::as_raw_stat

A few architectures in `os::linux::raw` import `libc::stat`, rather than
defining that type directly. However, that also imports the _function_
called `stat`, which makes this doc link ambiguous:

    error: `crate::os::linux::raw::stat` is both a struct and a function
      --> library/std/src/os/linux/fs.rs:21:19
       |
    21 |     /// [`stat`]: crate::os::linux::raw::stat
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous link
       |
       = note: `-D broken-intra-doc-links` implied by `-D warnings`
    help: to link to the struct, prefix with the item type
       |
    21 |     /// [`stat`]: struct@crate::os::linux::raw::stat
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    help: to link to the function, add parentheses
       |
    21 |     /// [`stat`]: crate::os::linux::raw::stat()
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

We want the `struct`, so it's now prefixed accordingly.

3 years agoRecognize discriminant reads as no-ops in RemoveNoopLandingPads
Tomasz Miąsko [Sat, 10 Oct 2020 00:00:00 +0000 (00:00 +0000)]
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.

3 years agoMove `@has` checks closer to corresponding doc comments
Camelid [Fri, 9 Oct 2020 23:11:15 +0000 (16:11 -0700)]
Move `@has` checks closer to corresponding doc comments

3 years agoUse `next()` instead of `peek()` where possible
Camelid [Fri, 9 Oct 2020 23:08:15 +0000 (16:08 -0700)]
Use `next()` instead of `peek()` where possible

3 years agoLink to GitHub issue re macro resolution
Camelid [Fri, 9 Oct 2020 23:03:00 +0000 (16:03 -0700)]
Link to GitHub issue re macro resolution

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoRevert "Assume slice len is bounded by allocation size"
Simonas Kazlauskas [Fri, 9 Oct 2020 21:25:28 +0000 (00:25 +0300)]
Revert "Assume slice len is bounded by allocation size"

https://github.com/rust-lang/rust/pull/77023#issuecomment-703987379
suggests that the original PR introduced a significant perf regression.

This reverts commit e44784b8750016a695361c990024750e037d8f9f / #77023.

3 years agoAdd docstring
Esteban Küber [Thu, 24 Sep 2020 06:20:49 +0000 (23:20 -0700)]
Add docstring

3 years agoGiven `<T as Trait>::A: Ty` suggest `T: Trait<A = Ty>`
Esteban Küber [Thu, 24 Sep 2020 06:01:17 +0000 (23:01 -0700)]
Given `<T as Trait>::A: Ty` suggest `T: Trait<A = Ty>`

Fix #75829

3 years agoSuggest removing bounds even when potential typo
Esteban Küber [Wed, 23 Sep 2020 02:25:27 +0000 (19:25 -0700)]
Suggest removing bounds even when potential typo

3 years agoTweak output and add test cases
Esteban Küber [Wed, 23 Sep 2020 02:19:33 +0000 (19:19 -0700)]
Tweak output and add test cases

3 years agoPoint out why a trait is expected on `Struct + 'lt`
Esteban Küber [Wed, 23 Sep 2020 00:35:03 +0000 (17:35 -0700)]
Point out why a trait is expected on `Struct + 'lt`

3 years agoAuto-prioritize issues with `regression-untriaged`
Camelid [Fri, 9 Oct 2020 21:10:44 +0000 (14:10 -0700)]
Auto-prioritize issues with `regression-untriaged`

3 years agoAuto merge of #77276 - GuillaumeGomez:reexported-item-lints, r=jyn514,ollie27
bors [Fri, 9 Oct 2020 21:01:51 +0000 (21:01 +0000)]
Auto merge of #77276 - GuillaumeGomez:reexported-item-lints, r=jyn514,ollie27

Warn on broken intra-doc links added to cross-crate re-exports

This emits `broken_intra_doc_links` for docs applied to pub use statements that point to external items and are inlined.
Does not address #77200 - any existing broken links from the original crate will not show warnings.

r? `@jyn514`

3 years agoAuto merge of #77674 - cuviper:direntry-diet, r=dtolnay
bors [Fri, 9 Oct 2020 19:06:45 +0000 (19:06 +0000)]
Auto merge of #77674 - cuviper:direntry-diet, r=dtolnay

unix/vxworks: make DirEntry slightly smaller

`DirEntry` contains a `ReadDir` handle, which used to just be a wrapper
on `Arc<InnerReadDir>`. Commit af75314ecdbc5 added `end_of_stream: bool`
which is not needed by `DirEntry`, but adds 8 bytes after padding. We
can let `DirEntry` have an `Arc<InnerReadDir>` directly to avoid that.

3 years agoDon't filter out imports added by the compiler for the moment
Guillaume Gomez [Mon, 5 Oct 2020 09:04:08 +0000 (11:04 +0200)]
Don't filter out imports added by the compiler for the moment

3 years agoRemove unneeded ImportItem on glob ones
Guillaume Gomez [Tue, 29 Sep 2020 18:23:02 +0000 (20:23 +0200)]
Remove unneeded ImportItem on glob ones

3 years agoSimplify included import items handling
Guillaume Gomez [Tue, 29 Sep 2020 15:04:40 +0000 (17:04 +0200)]
Simplify included import items handling

3 years agoAdd test to ensure that external items aren't lint-checked
Guillaume Gomez [Sun, 27 Sep 2020 22:19:31 +0000 (00:19 +0200)]
Add test to ensure that external items aren't lint-checked

3 years agoCorrectly handle "pub use" reexports
Guillaume Gomez [Sun, 27 Sep 2020 22:18:09 +0000 (00:18 +0200)]
Correctly handle "pub use" reexports

3 years agoAdd test for reexported items lints
Guillaume Gomez [Sun, 27 Sep 2020 19:22:39 +0000 (21:22 +0200)]
Add test for reexported items lints

3 years agoDon't remove export items so that we can run lints on them
Guillaume Gomez [Sun, 27 Sep 2020 19:22:11 +0000 (21:22 +0200)]
Don't remove export items so that we can run lints on them

3 years agosimplify the cfg in ReadDir construction
Josh Stone [Fri, 9 Oct 2020 17:54:50 +0000 (10:54 -0700)]
simplify the cfg in ReadDir construction

Co-authored-by: David Tolnay <dtolnay@gmail.com>
3 years agoAuto merge of #77747 - flip1995:clippyup, r=Manishearth
bors [Fri, 9 Oct 2020 17:14:39 +0000 (17:14 +0000)]
Auto merge of #77747 - flip1995:clippyup, r=Manishearth

Update Clippy

Biweekly Clippy update.

This includes a `Cargo.lock` update: 7ea42be

r? `@Manishearth`

3 years agoremove ReadDir.end_of_stream on targets that don't use it
Josh Stone [Fri, 9 Oct 2020 16:59:39 +0000 (09:59 -0700)]
remove ReadDir.end_of_stream on targets that don't use it

3 years agounix/vxworks: make DirEntry slightly smaller
Josh Stone [Wed, 7 Oct 2020 21:35:51 +0000 (14:35 -0700)]
unix/vxworks: make DirEntry slightly smaller

`DirEntry` contains a `ReadDir` handle, which used to just be a wrapper
on `Arc<InnerReadDir>`. Commit af75314ecdbc5 added `end_of_stream: bool`
which is not needed by `DirEntry`, but adds 8 bytes after padding. We
can let `DirEntry` have an `Arc<InnerReadDir>` directly to avoid that.

3 years agoRevert calculate_dtor signature change
Dániel Buga [Fri, 9 Oct 2020 15:18:57 +0000 (17:18 +0200)]
Revert calculate_dtor signature change

3 years agoAuto merge of #77609 - ortem:fix-lldb-commands, r=Mark-Simulacrum
bors [Fri, 9 Oct 2020 15:18:41 +0000 (15:18 +0000)]
Auto merge of #77609 - ortem:fix-lldb-commands, r=Mark-Simulacrum

Remove redundant backslashes from `lldb_commands`

3 years agoReimplement for_each_relevant_impl on top of find_map...
Dániel Buga [Fri, 9 Oct 2020 14:56:09 +0000 (16:56 +0200)]
Reimplement for_each_relevant_impl on top of find_map...

3 years agoAdd find_map_relevant_impl
Dániel Buga [Fri, 9 Oct 2020 13:28:32 +0000 (15:28 +0200)]
Add find_map_relevant_impl

3 years agobootstrap: always use the Rust version in package names
Pietro Albini [Tue, 29 Sep 2020 13:33:25 +0000 (15:33 +0200)]
bootstrap: always use the Rust version in package names

The format of the tarballs produced by CI is roughly the following:

    {component}-{release}-{target}.{ext}

While on the beta and nightly channels `{release}` is just the channel
name, on the stable channel is either the Rust version or the version of
the component we're shipping:

    cargo-0.47.0-x86_64-unknown-linux-gnu.tar.xz
    clippy-0.0.212-x86_64-unknown-linux-gnu.tar.xz
    llvm-tools-1.46.0-x86_64-unknown-linux-gnu.tar.xz
    miri-0.1.0-x86_64-unknown-linux-gnu.tar.xz
    rls-1.41.0-x86_64-unknown-linux-gnu.tar.xz
    rust-1.46.0-x86_64-unknown-linux-gnu.tar.xz
    ...

This makes it really hard to get the package URL without having access
to the manifest (and there is no manifest on ci-artifacts.rlo), as there
is no consistent version number to use.

This commit addresses the problem by always using the Rust version
number as `{release}` for the stable channel, regardless of the version
number of the component we're shipping. I chose that instead of "stable"
to avoid breaking the URL scheme *that* much.

Rustup should not be affected by this change, as it fetches the URLs
from the manifest. Unfortunately we don't have a way to test other
clients before making a stable release, as this change only affects the
stable channel.

3 years agoAuto merge of #77690 - est31:llvm_8_required, r=matthewjasper
bors [Fri, 9 Oct 2020 12:23:49 +0000 (12:23 +0000)]
Auto merge of #77690 - est31:llvm_8_required, r=matthewjasper

Simplify some code in rustc_llvm/build.rs now that LLVM 8 is required

LLVM 8 is required since 8506bb006040cf8e8cb004202706c81e62ddacee
so this is safe to do.

3 years agoRemove useless `all` in cfg
Mateusz Mikuła [Thu, 8 Oct 2020 19:54:59 +0000 (21:54 +0200)]
Remove useless `all` in cfg

3 years agoRemove some dead code in windows-gnu std
Mateusz Mikuła [Thu, 8 Oct 2020 19:54:33 +0000 (21:54 +0200)]
Remove some dead code in windows-gnu std

3 years agoUpdate Cargo.lock
flip1995 [Fri, 9 Oct 2020 10:46:26 +0000 (12:46 +0200)]
Update Cargo.lock

3 years agoMerge commit '2f6439ae6a6803d030cceb3ee14c9150e91b328b' into clippyup
flip1995 [Fri, 9 Oct 2020 10:45:29 +0000 (12:45 +0200)]
Merge commit '2f6439ae6a6803d030cceb3ee14c9150e91b328b' into clippyup

3 years agoAuto merge of #77698 - vandenheuvel:chalkup, r=jackh726
bors [Fri, 9 Oct 2020 10:32:52 +0000 (10:32 +0000)]
Auto merge of #77698 - vandenheuvel:chalkup, r=jackh726

Update chalk to 0.32.0

r? `@jackh726`

3 years agorename __default_lib_allocator -> __default_alloc_error_handler
Ralf Jung [Fri, 9 Oct 2020 09:39:28 +0000 (11:39 +0200)]
rename __default_lib_allocator -> __default_alloc_error_handler

3 years agoalso extend global allocator comment
Ralf Jung [Fri, 9 Oct 2020 09:31:54 +0000 (11:31 +0200)]
also extend global allocator comment

3 years agofix __rust_alloc_error_handler comment
Ralf Jung [Fri, 9 Oct 2020 09:17:08 +0000 (11:17 +0200)]
fix __rust_alloc_error_handler comment

3 years agoNoticed a potential bug in `eat_while()`: it doesn't account for number of UTF8 bytes.
Julian Wollersberger [Fri, 9 Oct 2020 09:12:54 +0000 (11:12 +0200)]
Noticed a potential bug in `eat_while()`: it doesn't account for number of UTF8 bytes.
Fixed it by inlining it in the two places where the count is used and simplified the logic there.

3 years agoAuto merge of #6136 - dtolnay:serve, r=flip1995
bors [Fri, 9 Oct 2020 08:58:19 +0000 (08:58 +0000)]
Auto merge of #6136 - dtolnay:serve, r=flip1995

Clippy dev subcommand to build and serve website

This PR adds `clippy dev serve` which will pop open a browser with a local rendered 'ALL the Clippy Lints' website, and re-render as you edit stuff.

---

changelog: none

3 years agoAuto merge of #77687 - est31:hash_shorter_path, r=davidtwco
bors [Fri, 9 Oct 2020 08:09:32 +0000 (08:09 +0000)]
Auto merge of #77687 - est31:hash_shorter_path, r=davidtwco

Use shorter path for std::hash::Hash

3 years agoAuto merge of #6115 - ebroto:changelog_1_48, r=flip1995
bors [Fri, 9 Oct 2020 08:09:23 +0000 (08:09 +0000)]
Auto merge of #6115 - ebroto:changelog_1_48, r=flip1995

Add changelog for 1.48 beta

[Rendered](https://github.com/ebroto/rust-clippy/blob/changelog_1_48/CHANGELOG.md)

I've not added the PRs fixing `same_item_push` because those were backported, namely:
* [#5908](https://github.com/rust-lang/rust-clippy/pull/5908)
* [#5997](https://github.com/rust-lang/rust-clippy/pull/5997)
* [#6016](https://github.com/rust-lang/rust-clippy/pull/6016)

The following PR was reverted, so I've ignored it too:
* [#5984](https://github.com/rust-lang/rust-clippy/pull/5984)

~~Also, I took the liberty of adding a "Thanks" section, naming all the contributors to this release. I think they deserve visibility in the changelog. Please tell me if we want to add this or maybe it's redundant given we link to the PRs?~~

changelog: none

r? `@flip1995`

3 years agoAuto merge of #6145 - flip1995:backport_remerge, r=flip1995
bors [Fri, 9 Oct 2020 06:53:55 +0000 (06:53 +0000)]
Auto merge of #6145 - flip1995:backport_remerge, r=flip1995

Backport remerge

Step 1 in the release process.

r? `@ghost`

changelog: none

3 years agoMerge remote-tracking branch 'upstream/beta' into backport_remerge
flip1995 [Fri, 9 Oct 2020 06:52:06 +0000 (08:52 +0200)]
Merge remote-tracking branch 'upstream/beta' into backport_remerge