]> git.lizzy.rs Git - rust.git/log
rust.git
22 months agoDelay span bug when failing to normalize negative coherence impl subject due to other...
Michael Goulet [Sat, 13 Aug 2022 22:04:50 +0000 (22:04 +0000)]
Delay span bug when failing to normalize negative coherence impl subject due to other malformed impls

22 months agoAuto merge of #100380 - nicholasbishop:bishop-update-cb2, r=Mark-Simulacrum
bors [Sat, 13 Aug 2022 05:10:01 +0000 (05:10 +0000)]
Auto merge of #100380 - nicholasbishop:bishop-update-cb2, r=Mark-Simulacrum

Update compiler_builtins to 0.1.79

This pulls in a memcmp fix and some UEFI float-to-int fixes:
https://github.com/rust-lang/compiler-builtins/compare/0.1.78...0.1.79

22 months agoAuto merge of #100341 - andrewpollack:fuchsia-llvm-libunwind, r=tmandry
bors [Sat, 13 Aug 2022 02:41:27 +0000 (02:41 +0000)]
Auto merge of #100341 - andrewpollack:fuchsia-llvm-libunwind, r=tmandry

Use llvm-libunwind="in-tree" for Fuchsia targets

With updates to Fuchsia CI's Zircon libraries #99833, we can introduce `llvm-libunwind="in-tree"` for Fuchsia targets. This PR restores functionality removed from https://github.com/rust-lang/rust/pull/93604#issuecomment-1136515651.

cc `@tmandry` `@djkoloski`

22 months agoAuto merge of #100324 - Mark-Simulacrum:bootstrap-bump, r=jyn514
bors [Sat, 13 Aug 2022 00:12:48 +0000 (00:12 +0000)]
Auto merge of #100324 - Mark-Simulacrum:bootstrap-bump, r=jyn514

Bump bootstrap compiler to 1.64

r? `@jyn514` perhaps?

22 months agoApply changes from rustfmt bump
Mark Rousskov [Tue, 9 Aug 2022 14:16:52 +0000 (10:16 -0400)]
Apply changes from rustfmt bump

22 months agoAdjust cfgs
Mark Rousskov [Tue, 9 Aug 2022 13:56:13 +0000 (09:56 -0400)]
Adjust cfgs

22 months agoBump bootstrap compiler
Mark Rousskov [Tue, 9 Aug 2022 13:40:54 +0000 (09:40 -0400)]
Bump bootstrap compiler

22 months agoAuto merge of #100456 - Dylan-DPC:rollup-fn17z9f, r=Dylan-DPC
bors [Fri, 12 Aug 2022 16:32:24 +0000 (16:32 +0000)]
Auto merge of #100456 - Dylan-DPC:rollup-fn17z9f, r=Dylan-DPC

Rollup of 9 pull requests

Successful merges:

 - #100022 (Optimize thread ID generation)
 - #100030 (cleanup code w/ pointers in std a little)
 - #100229 (add -Zextra-const-ub-checks to enable more UB checking in const-eval)
 - #100247 (Generalize trait object generic param check to aliases.)
 - #100255 (Adding more verbose documentation for `std::fmt::Write`)
 - #100366 (errors: don't fail on broken primary translations)
 - #100396 (Suggest const and static for global variable)
 - #100409 (rustdoc: don't generate DOM element for operator)
 - #100443 (Add two let else regression tests)

Failed merges:

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

22 months agoRollup merge of #100443 - est31:let_else_regression_tests, r=Mark-Simulacrum
Dylan DPC [Fri, 12 Aug 2022 15:09:18 +0000 (20:39 +0530)]
Rollup merge of #100443 - est31:let_else_regression_tests, r=Mark-Simulacrum

Add two let else regression tests

Adds a regression test for #94176, as it was fixed by #98574 but doesn't have a regression test. The PR also incorporates a commit from #94012 which added a test for an issue discovered in that PR.

Originally they have been part of #99291, but I've moved them out in the hopes of getting them merged more quickly, as that PR is already open since a month, and so that #99291 can focus on the drop order part of things.

Closes #94176
Closes #96961 -- dupe of #94176

22 months agoRollup merge of #100409 - jsha:highlight-lighter, r=GuillaumeGomez
Dylan DPC [Fri, 12 Aug 2022 15:09:17 +0000 (20:39 +0530)]
Rollup merge of #100409 - jsha:highlight-lighter, r=GuillaumeGomez

rustdoc: don't generate DOM element for operator

In our source page highlighting, we were generating `<span class="op">` tags for all "operators", including e.g. `<` `>` around generic parameters, `*`, `&`. This contributed significantly to DOM size, but we don't actually style `.op` except in the ayu theme.

Remove the styles for `.op` in ayu, and stop generating the `<span>`s.

This reduces DOM size of an example page[1] from 265,938 HTML elements to 242,165 elements, a 9% reduction.

r? ``@GuillaumeGomez``

Demo: (warning - slow!) https://rustdoc.crud.net/jsha/highlight-lighter/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.html

[1]:
https://doc.rust-lang.org/nightly/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.html

22 months agoRollup merge of #100396 - chenyukang:fix-100394, r=petrochenkov
Dylan DPC [Fri, 12 Aug 2022 15:09:16 +0000 (20:39 +0530)]
Rollup merge of #100396 - chenyukang:fix-100394, r=petrochenkov

Suggest const and static for global variable

Fixing #100394

22 months agoRollup merge of #100366 - davidtwco:translation-never-fail, r=compiler-errors
Dylan DPC [Fri, 12 Aug 2022 15:09:14 +0000 (20:39 +0530)]
Rollup merge of #100366 - davidtwco:translation-never-fail, r=compiler-errors

errors: don't fail on broken primary translations

If a primary bundle doesn't contain a message then the fallback bundle is used. However, if the primary bundle's message is broken (e.g. it refers to a interpolated variable that the compiler isn't providing) then this would just result in a compiler panic. While there aren't any primary bundles right now, this is the type of issue that could come up once translation is further along.

r? ```@compiler-errors``` (since this comes out of a in-person discussion we had at RustConf)

22 months agoRollup merge of #100255 - thedanvail:issue-98861-fix, r=joshtriplett
Dylan DPC [Fri, 12 Aug 2022 15:09:13 +0000 (20:39 +0530)]
Rollup merge of #100255 - thedanvail:issue-98861-fix, r=joshtriplett

Adding more verbose documentation for `std::fmt::Write`

Attempts to address #98861

22 months agoRollup merge of #100247 - cjgillot:verify-dyn-trait-alias-defaults, r=lcnr
Dylan DPC [Fri, 12 Aug 2022 15:09:12 +0000 (20:39 +0530)]
Rollup merge of #100247 - cjgillot:verify-dyn-trait-alias-defaults, r=lcnr

Generalize trait object generic param check to aliases.

The current algorithm only checks that `Self` does not appear in defaults for traits.  This is not sufficient for trait aliases.
This PR moves the check to trait object elaboration, which sees through trait aliases.

Fixes https://github.com/rust-lang/rust/issues/82927.
Fixes https://github.com/rust-lang/rust/issues/84789.

22 months agoRollup merge of #100229 - RalfJung:extra-const-ub-checks, r=lcnr
Dylan DPC [Fri, 12 Aug 2022 15:09:11 +0000 (20:39 +0530)]
Rollup merge of #100229 - RalfJung:extra-const-ub-checks, r=lcnr

add -Zextra-const-ub-checks to enable more UB checking in const-eval

Cc https://github.com/rust-lang/rust/issues/99923
r? `@oli-obk`

22 months agoRollup merge of #100030 - WaffleLapkin:nice_pointer_sis, r=scottmcm
Dylan DPC [Fri, 12 Aug 2022 15:09:10 +0000 (20:39 +0530)]
Rollup merge of #100030 - WaffleLapkin:nice_pointer_sis, r=scottmcm

cleanup code w/ pointers in std a little

Use pointer methods (`byte_add`, `null_mut`, etc) to make code in std a little nicer.

22 months agoRollup merge of #100022 - joboet:faster_threadid, r=joshtriplett
Dylan DPC [Fri, 12 Aug 2022 15:09:09 +0000 (20:39 +0530)]
Rollup merge of #100022 - joboet:faster_threadid, r=joshtriplett

Optimize thread ID generation

By using atomics where available, thread IDs can be generated without locking while still enforcing uniqueness.

22 months agoAuto merge of #100328 - davidtwco:perf-implications, r=nnethercote
bors [Fri, 12 Aug 2022 13:51:26 +0000 (13:51 +0000)]
Auto merge of #100328 - davidtwco:perf-implications, r=nnethercote

passes: load `defined_lib_features` query less

Hopefully addresses the perf regressions from #99212 (see #99905).

Re-structure the stability checks for library features to avoid calling `defined_lib_features` for any more crates than necessary for each of the implications or local feature attributes that need validation.

r? `@ghost` (just checking perf at first)

22 months agoAuto merge of #99624 - vincenzopalazzo:macros/unix_error, r=Amanieu
bors [Fri, 12 Aug 2022 09:49:55 +0000 (09:49 +0000)]
Auto merge of #99624 - vincenzopalazzo:macros/unix_error, r=Amanieu

promote debug_assert to assert when possible and useful

This PR fixed a very old issue https://github.com/rust-lang/rust/issues/94705 to clarify and improve the POSIX error checking, and some of the checks are skipped because can have no benefit, but I'm sure that this can open some interesting discussion.

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

cc: `@tavianator`
cc: `@cuviper`

22 months agoAdd regression test for #94176
est31 [Fri, 15 Jul 2022 16:53:23 +0000 (18:53 +0200)]
Add regression test for #94176

22 months agolet-else: add a test for warnings on let-else with diverging tail
Cormac Relf [Tue, 15 Feb 2022 06:42:50 +0000 (17:42 +1100)]
let-else: add a test for warnings on let-else with diverging tail

22 months agoAuto merge of #100435 - ehuss:update-cargo, r=ehuss
bors [Fri, 12 Aug 2022 06:45:35 +0000 (06:45 +0000)]
Auto merge of #100435 - ehuss:update-cargo, r=ehuss

Update cargo

8 commits in ce40690a5e4e315d3dab0aae1eae69d0252c52ac..efd4ca3dc0b89929dc8c5f5c023d25978d76cb61
2022-08-09 22:32:17 +0000 to 2022-08-12 01:28:28 +0000
- Use `std::thread::scope` to replace crossbeam (rust-lang/cargo#10977)
- [docs] Remove extra "in" from `cargo-test.md` (rust-lang/cargo#10978)
- Enable two windows tests (rust-lang/cargo#10930)
- Improve error msg for get target runner (rust-lang/cargo#10968)
- Ensure rustc-echo-wrapper works with an overridden build.target-dir (rust-lang/cargo#10962)
- Switch back to `available_parallelism` (rust-lang/cargo#10969)
- Only override published resolver when the workspace is different (rust-lang/cargo#10961)
- Add `CARGO_LOG` to "Environment variables Cargo reads" (rust-lang/cargo#10967)

22 months agoUpdate cargo
Eric Huss [Fri, 12 Aug 2022 03:03:43 +0000 (20:03 -0700)]
Update cargo

22 months agoAuto merge of #99464 - nikic:llvm-15, r=cuviper
bors [Fri, 12 Aug 2022 02:58:51 +0000 (02:58 +0000)]
Auto merge of #99464 - nikic:llvm-15, r=cuviper

Update to LLVM 15

For preliminary testing. Some LLVM 15 compatibility fixes were applied separately in #99512.

Release timeline:
 * LLVM 15 branched on Jul 26.
 * The final LLVM 15.0.0 release is scheduled for Sep 6.
 * Current nightly (1.65.0) is scheduled for Nov 3.

Changes in this PR (apart from the LLVM update):
 * Pass `--set llvm.allow-old-toolchain` for many Docker images. LLVM 16 will require GCC >= 7.1, while LLVM 15 still allows older compilers with an option. Specify the option for builders still using GCC 5.4. #95026 updated some of the used toolchains, but not all.
 * Use the `+atomics-32` target feature for thumbv6m.
 * Explicitly link libatomic when cross-compiling LLVM to 32-bit target.
 * Explicitly disable zstd support, to avoid libzstd.so dependency.

New LLVM patches ([commits](https://github.com/rust-lang/llvm-project/commits/rustc/15.0-2022-08-09)):
 * [rust-only] Fix ICE with GCC 5.4 (https://github.com/nikic/llvm-project/commit/15be58d7f0342b1da5af219bac8bd71d01da6dff)
 * [rust-only] Fix build with GCC 5.4 (https://github.com/nikic/llvm-project/commit/774edc10fa45229c2aa678f1bef8b4812dc0f76a)
 * ~~[rust-only] Fix build with GCC 5.2 (https://github.com/nikic/llvm-project/commit/1a6069a7bb35ace1e40d566035cbf7ed2fa3b1f7)~~
 * ~~[rust-only] Fix ICE with GCC 5.2 (https://github.com/nikic/llvm-project/commit/493081f2909206e0ed55af68a4058a76c0ad7a64)~~
 * ~~[rust-only] Fix build with GCC 5.2 (https://github.com/nikic/llvm-project/commit/0fc5979d738c3a1f9510fe2d62417f7d2af37817)~~
 * [backported] Addition of `+atomics` target feature (https://github.com/llvm/llvm-project/commit/57bdd9892d0eba5bdd25fc44799235be7b9f5153).
 * [backported] Revert compiler-rt change that broke powerpc (https://github.com/llvm/llvm-project/commit/9c68b43915fc1c9c0a07e935163ae8d638d7241b)
 * [awaiting backport] Fix RelLookupTableConverter on gnux32 (https://github.com/nikic/llvm-project/commit/639388a05f25772fb23eea5b1045e7df83bcfaa7 / https://github.com/llvm/llvm-project/issues/57021)

Tested images: dist-x86_64-linux, armhf-gnu, arm-android, dist-s390x-linux, dist-x86_64-illumos, dist-x86_64-freebsd, wasm32, dist-x86_64-musl, dist-various-1, dist-riscv64-linux, dist-mips-linux, dist-mipsel-linux, dist-powerpc-linux, dist-aarch64-linux, dist-x86_64-apple, x86_64-msvc-1, x86_64-msvc-2, dist-various-2, dist-arm-linux
Tested up to the usual ipv6 error: test-various, i686-gnu, x86_64-gnu-nopt

r? `@ghost`

22 months agoAuto merge of #100419 - flip1995:clippyup, r=Manishearth
bors [Fri, 12 Aug 2022 00:12:51 +0000 (00:12 +0000)]
Auto merge of #100419 - flip1995:clippyup, r=Manishearth

Update Clippy

r? `@Manishearth`

22 months agorustdoc: don't generate DOM element for operator
Jacob Hoffman-Andrews [Thu, 11 Aug 2022 13:59:58 +0000 (06:59 -0700)]
rustdoc: don't generate DOM element for operator

In our source page highlighting, we were generating `<span class="op">`
tags for all "operators", including e.g. `<` `>` around generic
parameters, `*`, `&`. This contributed significantly to DOM size, but
we don't actually style `.op` except in the ayu theme.

Remove the styles for `.op` in ayu, and stop generating the `<span>`s.

This reduces DOM size of an example page[1] from 265,938 HTML elements
to 242,165 elements, a 9% reduction.

[1]:
https://doc.rust-lang.org/nightly/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.html

22 months agoPatch lld for older toolchains
Josh Stone [Thu, 11 Aug 2022 22:51:59 +0000 (15:51 -0700)]
Patch lld for older toolchains

22 months agoAuto merge of #100426 - matthiaskrgr:rollup-0ks4dou, r=matthiaskrgr
bors [Thu, 11 Aug 2022 21:30:07 +0000 (21:30 +0000)]
Auto merge of #100426 - matthiaskrgr:rollup-0ks4dou, r=matthiaskrgr

Rollup of 13 pull requests

Successful merges:

 - #93896 (rustdoc: make item-infos dimmer on dark theme)
 - #99337 (rustdoc: simplify highlight.rs)
 - #99421 (add crt-static for android)
 - #99500 (Fix flags when using clang as linker for Fuchsia)
 - #99511 (make raw_eq precondition more restrictive)
 - #99992 (Add `x.sh` and `x.ps1` shell scripts)
 - #100112 (Fix test: chunks_mut_are_send_and_sync)
 - #100203 (provide correct size hint for unsupported platform `CommandArgs`)
 - #100307 (Fix #96847)
 - #100350 (Stringify non-shorthand visibility correctly)
 - #100374 (Improve crate selection on rustdoc search results page)
 - #100392 (Simplify visitors)
 - #100418 (Add stability attributes to BacktraceStatus variants)

Failed merges:

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

22 months agoRollup merge of #100418 - tbodt:stabilize-backtrace, r=dtolnay
Matthias Krüger [Thu, 11 Aug 2022 20:53:10 +0000 (22:53 +0200)]
Rollup merge of #100418 - tbodt:stabilize-backtrace, r=dtolnay

Add stability attributes to BacktraceStatus variants

Fixes #100399

22 months agoRollup merge of #100392 - nnethercote:simplify-visitors, r=cjgillot
Matthias Krüger [Thu, 11 Aug 2022 20:53:08 +0000 (22:53 +0200)]
Rollup merge of #100392 - nnethercote:simplify-visitors, r=cjgillot

Simplify visitors

By removing some unused arguments.

r? `@cjgillot`

22 months agoRollup merge of #100374 - GuillaumeGomez:improve_rustdoc_search_results_page_crates_s...
Matthias Krüger [Thu, 11 Aug 2022 20:53:07 +0000 (22:53 +0200)]
Rollup merge of #100374 - GuillaumeGomez:improve_rustdoc_search_results_page_crates_selection, r=notriddle

Improve crate selection on rustdoc search results page

Take over of #98855 (screenshots and explanations are there).

You can test it [here](https://rustdoc.crud.net/imperio/improve_rustdoc_search_results_page_crates_selection/std/index.html?search=test).

cc ``@steffahn`` ``@jsha``
r? ``@notriddle``

22 months agoRollup merge of #100350 - jhpratt:stringify-vis, r=cjgillot
Matthias Krüger [Thu, 11 Aug 2022 20:53:06 +0000 (22:53 +0200)]
Rollup merge of #100350 - jhpratt:stringify-vis, r=cjgillot

Stringify non-shorthand visibility correctly

This makes `stringify!(pub(in crate))` evaluate to `pub(in crate)` rather than `pub(crate)`, matching the behavior before the `crate` shorthand was removed. Further, this changes `stringify!(pub(in super))` to evaluate to `pub(in super)` rather than the current `pub(super)`. If the latter is not desired (it is _technically_ breaking), it can be undone.

Fixes #99981

`@rustbot` label +C-bug +regression-from-stable-to-beta +T-compiler

22 months agoRollup merge of #100307 - nnethercote:fix-96847, r=cjgillot
Matthias Krüger [Thu, 11 Aug 2022 20:53:05 +0000 (22:53 +0200)]
Rollup merge of #100307 - nnethercote:fix-96847, r=cjgillot

Fix #96847

r? `@petrochenkov`

22 months agoRollup merge of #100203 - compiler-errors:command-args-size-hint, r=m-ou-se
Matthias Krüger [Thu, 11 Aug 2022 20:53:04 +0000 (22:53 +0200)]
Rollup merge of #100203 - compiler-errors:command-args-size-hint, r=m-ou-se

provide correct size hint for unsupported platform `CommandArgs`

Split from https://github.com/rust-lang/rust/pull/99880#discussion_r932994172

22 months agoRollup merge of #100112 - RalfJung:assert_send_and_sync, r=m-ou-se
Matthias Krüger [Thu, 11 Aug 2022 20:53:03 +0000 (22:53 +0200)]
Rollup merge of #100112 - RalfJung:assert_send_and_sync, r=m-ou-se

Fix test: chunks_mut_are_send_and_sync

Follow-up to https://github.com/rust-lang/rust/pull/100023 to make the test actually effective

22 months agoRollup merge of #99992 - jyn514:shell-scripts, r=Mark-Simulacrum
Matthias Krüger [Thu, 11 Aug 2022 20:53:02 +0000 (22:53 +0200)]
Rollup merge of #99992 - jyn514:shell-scripts, r=Mark-Simulacrum

Add `x.sh` and `x.ps1` shell scripts

This is a more ambitious version of https://github.com/rust-lang/rust/pull/98716.
It still changes the x.py shebang back to python3, for compatibility with non-Unix systems,
but also adds alternative entrypoints for systems without `python3` installed.

These scripts will be necessary for the rust entrypoint (#94829), so I see
little downside in adding them early.

I'll update the dev-guide to suggest using these instead of x.py once this is merged.

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

r? `@Mark-Simulacrum` cc `@dtolnay` `@CAD97` `@yoshuawuyts`

22 months agoRollup merge of #99511 - RalfJung:raw_eq, r=wesleywiser
Matthias Krüger [Thu, 11 Aug 2022 20:53:01 +0000 (22:53 +0200)]
Rollup merge of #99511 - RalfJung:raw_eq, r=wesleywiser

make raw_eq precondition more restrictive

Specifically, don't allow comparing pointers that way. Comparing pointers is subtle because you have to talk about what happens to the provenance.

This matches what [Miri already implements](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=9eb1dfb8a61b5a2d4a7cee43df2717af), and all existing users are fine with this.

If raw_eq on pointers is ever desired, we can adjust the intrinsic spec and Miri implementation as needed, but for now that seems just unnecessary. Also, this is a const intrinsic, and in const, comparing pointers this way is *not possible* -- so if we allow the intrinsic to compare pointers in general, we need to impose an extra restrictions saying that in const-context, pointers are *not* okay.

22 months agoRollup merge of #99500 - tmandry:fuchsia-flags, r=petrochenkov
Matthias Krüger [Thu, 11 Aug 2022 20:52:59 +0000 (22:52 +0200)]
Rollup merge of #99500 - tmandry:fuchsia-flags, r=petrochenkov

Fix flags when using clang as linker for Fuchsia

Don't add C runtime or set dynamic linker when linking with clang for
Fuchsia. Clang already does this for us.

22 months agoRollup merge of #99421 - Bryanskiy:android-crt-static, r=petrochenkov
Matthias Krüger [Thu, 11 Aug 2022 20:52:58 +0000 (22:52 +0200)]
Rollup merge of #99421 - Bryanskiy:android-crt-static, r=petrochenkov

add crt-static for android

22 months agoRollup merge of #99337 - jsha:simplify-highlight, r=GuillaumeGomez
Matthias Krüger [Thu, 11 Aug 2022 20:52:57 +0000 (22:52 +0200)]
Rollup merge of #99337 - jsha:simplify-highlight, r=GuillaumeGomez

rustdoc: simplify highlight.rs

Split render_with_highlighting, which took many optional parameters, into three functions for specific purposes, which each take a smaller number of mostly required parameters.

Remove some plumbing to pass through an "edition" parameter, which was used solely to avoid highlighting some 2021 Edition keywords in non-2021 code.

I've tested a build of std docs before and after, and this does not change the generated HTML at all.

Followup from https://github.com/rust-lang/rust/pull/91264#discussion_r901151101

r? ```@GuillaumeGomez```

22 months agoRollup merge of #93896 - jsha:dark-colors, r=GuillaumeGomez
Matthias Krüger [Thu, 11 Aug 2022 20:52:56 +0000 (22:52 +0200)]
Rollup merge of #93896 - jsha:dark-colors, r=GuillaumeGomez

rustdoc: make item-infos dimmer on dark theme

Previously the item-info background colors were too bright for a dark theme, making a bright rectangle that draws the attention.

Demo:

https://rustdoc.crud.net/jsha/dark-colors/std/os/linux/process/struct.PidFd.html
https://rustdoc.crud.net/jsha/dark-colors/std/error/trait.Error.html#method.description

Before:

<img width=300 src="https://user-images.githubusercontent.com/220205/153565049-f35ee83e-181d-491c-b2af-7cce1baa4912.png">

After:

<img width=300 src="https://user-images.githubusercontent.com/220205/181166727-b4218e96-daf1-46cd-a2df-5fd870eaa857.png">

r? `@GuillaumeGomez`

22 months agoAuto merge of #100416 - Dylan-DPC:rollup-m344lh1, r=Dylan-DPC
bors [Thu, 11 Aug 2022 18:05:55 +0000 (18:05 +0000)]
Auto merge of #100416 - Dylan-DPC:rollup-m344lh1, r=Dylan-DPC

Rollup of 11 pull requests

Successful merges:

 - #92744 (Check if enum from foreign crate has any non exhaustive variants when attempting a cast)
 - #99110 (Determine match_has_guard from candidates instead of looking up thir table again)
 - #100184 (Stabilize ptr_const_cast)
 - #100192 ( Remove duplicated temporaries creating during box derefs elaboration)
 - #100232 (Do not consider method call receiver as an argument in AST.)
 - #100287 (linux: Use `pthread_setname_np` instead of `prctl`)
 - #100351 (Use `&mut Diagnostic` instead of `&mut DiagnosticBuilder` unless needed)
 - #100370 (Remove more Clean trait implementations)
 - #100391 (Improve size assertions)
 - #100398 (Improve `-Zhir-stats`)
 - #100403 (Improve error messages when running rustdoc GUI tests)

Failed merges:

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

22 months agoAdd stability attributes to BacktraceStatus variants
Theodore Dubois [Thu, 11 Aug 2022 18:00:07 +0000 (11:00 -0700)]
Add stability attributes to BacktraceStatus variants

Fixes #100399

22 months agoUpdate Cargo.lock
Philipp Krones [Thu, 11 Aug 2022 17:42:37 +0000 (19:42 +0200)]
Update Cargo.lock

22 months agoMerge commit '2b2190cb5667cdd276a24ef8b9f3692209c54a89' into clippyup
Philipp Krones [Thu, 11 Aug 2022 17:42:16 +0000 (19:42 +0200)]
Merge commit '2b2190cb5667cdd276a24ef8b9f3692209c54a89' into clippyup

22 months agoAuto merge of #9323 - flip1995:rustup, r=flip1995
bors [Thu, 11 Aug 2022 17:28:47 +0000 (17:28 +0000)]
Auto merge of #9323 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

22 months agoBump Clippy version -> 0.1.65
Philipp Krones [Thu, 11 Aug 2022 17:26:38 +0000 (19:26 +0200)]
Bump Clippy version -> 0.1.65

22 months agoBump nightly version -> 2022-08-11
Philipp Krones [Thu, 11 Aug 2022 17:26:26 +0000 (19:26 +0200)]
Bump nightly version -> 2022-08-11

22 months agoMerge remote-tracking branch 'upstream/master' into rustup
Philipp Krones [Thu, 11 Aug 2022 17:26:04 +0000 (19:26 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

22 months agoRollup merge of #100403 - GuillaumeGomez:improve-messages, r=jsha
Dylan DPC [Thu, 11 Aug 2022 17:17:07 +0000 (22:47 +0530)]
Rollup merge of #100403 - GuillaumeGomez:improve-messages, r=jsha

Improve error messages when running rustdoc GUI tests

There was already a message on how to install `browser-ui-test`, so nothing to be done there. However, we didn't show how to update its version, so the first commit adds it.

Another pain point was how to fix the unexpected crash in `browser-ui-test` (because of a missing `--no-sandbox`, still no idea why it became mandatory a few months ago on some linux distributions...). It now looks like this:

```console
Running 1 rustdoc-gui (8 concurrently) ...
ERROR: puppeteer failed when trying to create a new page. Please try again with `--no-sandbox`

`browser-ui-test` crashed unexpectedly. Please try again with adding `--test-args --no-sandbox` at the end. For example: `x.py test src/test/rustdoc-gui --test-args --no-sandbox`

Build completed unsuccessfully in 0:00:03
```

Thanks to `@jsha` for suggesting these improvements!

r? `@jsha`

22 months agoRollup merge of #100398 - nnethercote:improve-Zhir-stats, r=michaelwoerister
Dylan DPC [Thu, 11 Aug 2022 17:17:06 +0000 (22:47 +0530)]
Rollup merge of #100398 - nnethercote:improve-Zhir-stats, r=michaelwoerister

Improve `-Zhir-stats`

Add testing, improve coverage, avoid some double counting, and add more detail.

r? `@michaelwoerister`

22 months agoRollup merge of #100391 - nnethercote:improve-size-assertions, r=lqd
Dylan DPC [Thu, 11 Aug 2022 17:17:05 +0000 (22:47 +0530)]
Rollup merge of #100391 - nnethercote:improve-size-assertions, r=lqd

Improve size assertions

r? `@lqd`

22 months agoRollup merge of #100370 - GuillaumeGomez:rm-more-clean-impls, r=Dylan-DPC
Dylan DPC [Thu, 11 Aug 2022 17:17:04 +0000 (22:47 +0530)]
Rollup merge of #100370 - GuillaumeGomez:rm-more-clean-impls, r=Dylan-DPC

Remove more Clean trait implementations

Follow-up of https://github.com/rust-lang/rust/pull/99638.

r? `@Dylan-DPC`

22 months agoRollup merge of #100351 - compiler-errors:diagnostic-convention, r=fee1-dead
Dylan DPC [Thu, 11 Aug 2022 17:17:03 +0000 (22:47 +0530)]
Rollup merge of #100351 - compiler-errors:diagnostic-convention, r=fee1-dead

Use `&mut Diagnostic` instead of `&mut DiagnosticBuilder` unless needed

This seems to be the established convention (02ff9e0) when `DiagnosticBuilder` was first added. I am guilty of introducing some of these.

22 months agoRollup merge of #100287 - cuviper:no-linux-prctl, r=Mark-Simulacrum
Dylan DPC [Thu, 11 Aug 2022 17:17:02 +0000 (22:47 +0530)]
Rollup merge of #100287 - cuviper:no-linux-prctl, r=Mark-Simulacrum

linux: Use `pthread_setname_np` instead of `prctl`

This function is available on Linux since glibc 2.12, musl 1.1.16, and
uClibc 1.0.20. The main advantage over `prctl` is that it properly
represents the pointer argument, rather than a multi-purpose `long`,
so we're better representing strict provenance (#95496).

22 months agoRollup merge of #100232 - cjgillot:no-desugar-methodcall, r=nagisa
Dylan DPC [Thu, 11 Aug 2022 17:17:01 +0000 (22:47 +0530)]
Rollup merge of #100232 - cjgillot:no-desugar-methodcall, r=nagisa

Do not consider method call receiver as an argument in AST.

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

22 months agoRollup merge of #100192 - tmiasko:rm-duplicated-locals, r=nagisa
Dylan DPC [Thu, 11 Aug 2022 17:16:59 +0000 (22:46 +0530)]
Rollup merge of #100192 - tmiasko:rm-duplicated-locals, r=nagisa

 Remove duplicated temporaries creating during box derefs elaboration

Temporaries created with `MirPatch::new_temp` will be declared after
patch application. Remove manually created duplicate declarations.

Removing duplicates exposes another issue. Visitor elaborates
terminator twice and attempts to access new, but not yet available,
local declarations. Remove duplicated call to `visit_terminator`.

Extracted from #99946.

22 months agoRollup merge of #100184 - Kixunil:stabilize_ptr_const_cast, r=m-ou-se
Dylan DPC [Thu, 11 Aug 2022 17:16:58 +0000 (22:46 +0530)]
Rollup merge of #100184 - Kixunil:stabilize_ptr_const_cast, r=m-ou-se

Stabilize ptr_const_cast

This stabilizes `ptr_const_cast` feature as was decided in a recent
[FCP](https://github.com/rust-lang/rust/issues/92675#issuecomment-1190660233)

Closes #92675

22 months agoRollup merge of #99110 - audunhalland:match_has_guard_from_candidate, r=pnkfelix
Dylan DPC [Thu, 11 Aug 2022 17:16:57 +0000 (22:46 +0530)]
Rollup merge of #99110 - audunhalland:match_has_guard_from_candidate, r=pnkfelix

Determine match_has_guard from candidates instead of looking up thir table again

Currently looking through mir build of matches because of interest in deref patterns. Finding some micro-optimizable things.

22 months agoRollup merge of #92744 - lambinoo:I-91161-non-exhaustive-foreign-variants, r=scottmcm
Dylan DPC [Thu, 11 Aug 2022 17:16:56 +0000 (22:46 +0530)]
Rollup merge of #92744 - lambinoo:I-91161-non-exhaustive-foreign-variants, r=scottmcm

Check if enum from foreign crate has any non exhaustive variants when attempting a cast

Fixes #91161

As stated in the issue, this will require a crater run as it might break other people's stuff.

22 months agosuggest const or static for global variable
chenyukang [Thu, 11 Aug 2022 14:26:26 +0000 (22:26 +0800)]
suggest const or static for global variable

22 months agomore typos
Ralf Jung [Thu, 11 Aug 2022 11:37:22 +0000 (07:37 -0400)]
more typos

Co-authored-by: Nicholas Nethercote <n.nethercote@gmail.com>
22 months agoImprove error message when browser-ui-test crashes
Guillaume Gomez [Thu, 11 Aug 2022 11:20:18 +0000 (13:20 +0200)]
Improve error message when browser-ui-test crashes

22 months agoAvoid lowering a `MacArgs::Eq` twice.
Nicholas Nethercote [Tue, 9 Aug 2022 05:03:56 +0000 (15:03 +1000)]
Avoid lowering a `MacArgs::Eq` twice.

Fixes #96847.

22 months agoAdd instructions on how to update the browser-ui-test version
Guillaume Gomez [Thu, 11 Aug 2022 11:02:19 +0000 (13:02 +0200)]
Add instructions on how to update the browser-ui-test version

22 months agoAuto merge of #100315 - compiler-errors:norm-ct-in-proj, r=lcnr
bors [Thu, 11 Aug 2022 10:47:48 +0000 (10:47 +0000)]
Auto merge of #100315 - compiler-errors:norm-ct-in-proj, r=lcnr

Keep going if normalized projection has unevaluated consts in `QueryNormalizer`

#100312 was the wrong approach, I think this is the right one.

When normalizing a type, if we see that it's a projection, we currently defer to `tcx.normalize_projection_ty`, which normalizes the projections away but doesn't touch the unevaluated constants. So now we just continue to fold the type if it has unevaluated constants so we make sure to evaluate those too, if we can.

Fixes #100217
Fixes #83972
Fixes #84669
Fixes #86710
Fixes #82268
Fixes #73298

22 months agoAdd a second level to the AST size reporting.
Nicholas Nethercote [Thu, 11 Aug 2022 04:37:21 +0000 (14:37 +1000)]
Add a second level to the AST size reporting.

This tells you which variants of the enums are most common, which is
very useful. I've only done it for the AST for now, HIR can be done
later.

22 months agoAllow old toolchain on images with CUSTOM_MINGW
Josh Stone [Thu, 11 Aug 2022 04:07:13 +0000 (21:07 -0700)]
Allow old toolchain on images with CUSTOM_MINGW

22 months agoAdd percentages to `-Zhir-stats` output.
Nicholas Nethercote [Thu, 11 Aug 2022 03:46:26 +0000 (13:46 +1000)]
Add percentages to `-Zhir-stats` output.

22 months agoChange how `AssocItem` is reported.
Nicholas Nethercote [Thu, 11 Aug 2022 02:34:52 +0000 (12:34 +1000)]
Change how `AssocItem` is reported.

Currently it's reported as either `TraitItem` or `ImplItem`. This commit
changes it to `AssocItem`, because having the report match the type name
is (a) consistent with other types, and (b) the trait/impl split isn't
that important here.

22 months agoImprove AST stat collector.
Nicholas Nethercote [Thu, 11 Aug 2022 02:18:21 +0000 (12:18 +1000)]
Improve AST stat collector.

This commit:
- Adds a comment explaining which `visit_*` methods should be
  implemented.
- Adds and removes some `visit_*` methods accordingly, improving
  coverage, and avoiding some double counting.

22 months agoAuto merge of #100298 - BlackHoleFox:hashmap_keygen_cleanup, r=Mark-Simulacrum
bors [Thu, 11 Aug 2022 02:46:32 +0000 (02:46 +0000)]
Auto merge of #100298 - BlackHoleFox:hashmap_keygen_cleanup, r=Mark-Simulacrum

Replace pointer casting in hashmap_random_keys with safe code

The old code was unnecessarily unsafe and relied on the layout of tuples always being the same as an array of the same size (which might be bad with `-Z randomize-layout`)?

The replacement has [identical codegen](https://rust.godbolt.org/z/qxsvdb8nx), so it seems like a reasonable change.

22 months agoAdd a test for `-Zhir-stats` output.
Nicholas Nethercote [Thu, 11 Aug 2022 00:11:13 +0000 (10:11 +1000)]
Add a test for `-Zhir-stats` output.

This will be very useful in subsequent commits where I will improve the
output.

22 months agopromote debug_assert to assert
Vincenzo Palazzo [Tue, 9 Aug 2022 22:19:13 +0000 (22:19 +0000)]
promote debug_assert to assert

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
22 months agoSimplify `rustc_hir::intravisit::Visitor::visit_enum_def`.
Nicholas Nethercote [Thu, 11 Aug 2022 01:07:34 +0000 (11:07 +1000)]
Simplify `rustc_hir::intravisit::Visitor::visit_enum_def`.

It is passed an argument that is never used.

22 months agoSimplify `rustc_ast::visit::Visitor::visit_poly_trait_ref`.
Nicholas Nethercote [Thu, 11 Aug 2022 01:05:26 +0000 (11:05 +1000)]
Simplify `rustc_ast::visit::Visitor::visit_poly_trait_ref`.

It is passed an argument that is never used.

22 months agoSimplify `rustc_ast::visit::Visitor::visit_enum_def`.
Nicholas Nethercote [Wed, 10 Aug 2022 02:02:48 +0000 (12:02 +1000)]
Simplify `rustc_ast::visit::Visitor::visit_enum_def`.

It's passed three arguments that are never used.

22 months agoSimplify `rustc_hir::intravisit::Visitor::visit_variant_data`.
Nicholas Nethercote [Wed, 10 Aug 2022 01:22:01 +0000 (11:22 +1000)]
Simplify `rustc_hir::intravisit::Visitor::visit_variant_data`.

It has four arguments that are never used. This avoids lots of argument
passing in functions that feed into `visit_variant_data`.

22 months agoAuto merge of #99174 - scottmcm:reoptimize-layout-array, r=joshtriplett
bors [Wed, 10 Aug 2022 23:50:18 +0000 (23:50 +0000)]
Auto merge of #99174 - scottmcm:reoptimize-layout-array, r=joshtriplett

Reoptimize layout array

This way it's one check instead of two, so hopefully (cc #99117) it'll be simpler for rustc perf too 🤞

Quick demonstration:
```rust
pub fn demo(n: usize) -> Option<Layout> {
    Layout::array::<i32>(n).ok()
}
```

Nightly: <https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=e97bf33508aa03f38968101cdeb5322d>
```nasm
mov rax, rdi
mov ecx, 4
mul rcx
seto cl
movabs rdx, 9223372036854775805
xor esi, esi
cmp rax, rdx
setb sil
shl rsi, 2
xor edx, edx
test cl, cl
cmove rdx, rsi
ret
```

This PR (note no `mul`, in addition to being much shorter):
```nasm
xor edx, edx
lea rax, [4*rcx]
shr rcx, 61
sete dl
shl rdx, 2
ret
```

This is built atop `@CAD97` 's #99136; the new changes are cb8aba66ef6a0e17f08a0574e4820653e31b45a0.

I added a bunch more tests for `Layout::from_size_align` and `Layout::array` too.

22 months agoFix flags when using clang as linker for Fuchsia
Tyler Mandry [Wed, 20 Jul 2022 09:30:29 +0000 (02:30 -0700)]
Fix flags when using clang as linker for Fuchsia

Don't add C runtime or set dynamic linker when linking with clang for
Fuchsia. Clang already does this for us.

22 months agoAuto merge of #100385 - RalfJung:miri, r=RalfJung
bors [Wed, 10 Aug 2022 20:52:35 +0000 (20:52 +0000)]
Auto merge of #100385 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/100361
r? `@ghost`

22 months agogrammar
Ralf Jung [Wed, 10 Aug 2022 20:15:21 +0000 (16:15 -0400)]
grammar

Co-authored-by: Frank Steffahn <fdsteffahn@gmail.com>
22 months agoupdate Miri
Ralf Jung [Wed, 10 Aug 2022 18:17:48 +0000 (14:17 -0400)]
update Miri

22 months agoAuto merge of #100378 - compiler-errors:rollup-8vzsd92, r=compiler-errors
bors [Wed, 10 Aug 2022 18:05:34 +0000 (18:05 +0000)]
Auto merge of #100378 - compiler-errors:rollup-8vzsd92, r=compiler-errors

Rollup of 8 pull requests

Successful merges:

 - #100286 (Add support for link-flavor rust-lld for macOS)
 - #100317 (Remove logic related to deprecated nvptx-nvidia-cuda (32-bit) target)
 - #100339 (Fixes bootstrap panic when running x fmt --check )
 - #100348 (Add regression test for #93205)
 - #100349 (Refactor: remove a type string comparison)
 - #100353 (Fix doc links in core::time::Duration::as_secs)
 - #100359 (Special-case references to leafs in valtree pretty-printing)
 - #100371 (Inline CStr::from_bytes_with_nul_unchecked::rt_impl)

Failed merges:

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

22 months agoUpdate error message to clarify that it's not the enum itself that's non_exhaustive
Scott McMurray [Wed, 10 Aug 2022 17:02:03 +0000 (10:02 -0700)]
Update error message to clarify that it's not the enum itself that's non_exhaustive

22 months agoCheck if extern crate enum has non exhaustive variant when cast
Lamb [Mon, 10 Jan 2022 21:01:23 +0000 (21:01 +0000)]
Check if extern crate enum has non exhaustive variant when cast

22 months agoadd crt-static for android
Bryanskiy [Sat, 16 Jul 2022 16:33:54 +0000 (19:33 +0300)]
add crt-static for android

22 months agoAdapt ui-fulldeps test.
Camille GILLOT [Sun, 7 Aug 2022 15:36:00 +0000 (17:36 +0200)]
Adapt ui-fulldeps test.

22 months agoDo not consider method call receiver as an argument in AST.
Camille GILLOT [Sun, 7 Aug 2022 13:21:11 +0000 (15:21 +0200)]
Do not consider method call receiver as an argument in AST.

22 months agoBan indirect references to `Self` too.
Camille GILLOT [Sun, 7 Aug 2022 20:02:02 +0000 (22:02 +0200)]
Ban indirect references to `Self` too.

22 months agoGeneralize trait object generic param check to aliases.
Camille GILLOT [Sun, 7 Aug 2022 19:03:28 +0000 (21:03 +0200)]
Generalize trait object generic param check to aliases.

22 months agoRollup merge of #100371 - xfix:inline-from-bytes-with-nul-unchecked-rt-impl, r=scottmcm
Michael Goulet [Wed, 10 Aug 2022 16:28:25 +0000 (09:28 -0700)]
Rollup merge of #100371 - xfix:inline-from-bytes-with-nul-unchecked-rt-impl, r=scottmcm

Inline CStr::from_bytes_with_nul_unchecked::rt_impl

Currently `CStr::from_bytes_with_nul_unchecked::rt_impl` is not being inlined. The following function:

```rust
pub unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) {
    CStr::from_bytes_with_nul_unchecked(bytes);
}
```

Outputs the following assembly on current nightly

```asm
example::from_bytes_with_nul_unchecked:
        jmp     qword ptr [rip + _ZN4core3ffi5c_str4CStr29from_bytes_with_nul_unchecked7rt_impl17h026f29f3d6a41333E@GOTPCREL]
```

Meanwhile on beta this provides the following assembly:

```asm
example::from_bytes_with_nul_unchecked:
        ret
```

This pull request adds `#[inline]` annotation to`rt_impl` to fix a code generation regression for `CStr::from_bytes_with_nul_unchecked`.

22 months agoRollup merge of #100359 - b-naber:valtrees-pretty-print-ice, r=lcnr
Michael Goulet [Wed, 10 Aug 2022 16:28:24 +0000 (09:28 -0700)]
Rollup merge of #100359 - b-naber:valtrees-pretty-print-ice, r=lcnr

Special-case references to leafs in valtree pretty-printing

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

22 months agoRollup merge of #100353 - theli-ua:master, r=joshtriplett
Michael Goulet [Wed, 10 Aug 2022 16:28:23 +0000 (09:28 -0700)]
Rollup merge of #100353 - theli-ua:master, r=joshtriplett

Fix doc links in core::time::Duration::as_secs

22 months agoRollup merge of #100349 - TaKO8Ki:remove-type-string-comparison, r=lcnr
Michael Goulet [Wed, 10 Aug 2022 16:28:22 +0000 (09:28 -0700)]
Rollup merge of #100349 - TaKO8Ki:remove-type-string-comparison, r=lcnr

Refactor: remove a type string comparison

22 months agoRollup merge of #100348 - camelid:test-93205, r=jyn514
Michael Goulet [Wed, 10 Aug 2022 16:28:21 +0000 (09:28 -0700)]
Rollup merge of #100348 - camelid:test-93205, r=jyn514

Add regression test for #93205

Closes #93205.

This issue was most likely fixed by #93805.

22 months agoRollup merge of #100339 - shourya5:issue#100258, r=jyn514
Michael Goulet [Wed, 10 Aug 2022 16:28:20 +0000 (09:28 -0700)]
Rollup merge of #100339 - shourya5:issue#100258, r=jyn514

Fixes bootstrap panic when running x fmt --check

closes #100258 wherein bootstrap panics when running x fmt --check. Fixed by replacing resume_unwind  in #98994. with process::exit.

22 months agoRollup merge of #100317 - kjetilkjeka:remove-nvptx32-logic, r=eddyb
Michael Goulet [Wed, 10 Aug 2022 16:28:19 +0000 (09:28 -0700)]
Rollup merge of #100317 - kjetilkjeka:remove-nvptx32-logic, r=eddyb

Remove logic related to deprecated nvptx-nvidia-cuda (32-bit) target

As described in the MCP https://github.com/rust-lang/compiler-team/issues/496#issuecomment-1196328748

r? ``@eddyb``

22 months agoRollup merge of #100286 - Thog:rust-lld-macosx-target, r=petrochenkov
Michael Goulet [Wed, 10 Aug 2022 16:28:18 +0000 (09:28 -0700)]
Rollup merge of #100286 - Thog:rust-lld-macosx-target, r=petrochenkov

Add support for link-flavor rust-lld for macOS

Also refactor iOS, watchOS and tvOS common code.

The ``-arch`` argument was moved to the ``apple_base`` module instead of the target definitions for macOS.
As ld64 requires ``-syslibroot`` to be passed, ``add_apple_sdk`` was modified accordingly.

22 months agoUpdate compiler_builtins to 0.1.79
Nicholas Bishop [Wed, 10 Aug 2022 16:13:33 +0000 (12:13 -0400)]
Update compiler_builtins to 0.1.79