]> git.lizzy.rs Git - rust.git/log
rust.git
21 months agoAuto merge of #101909 - weihanglo:update-cargo, r=ehuss
bors [Mon, 19 Sep 2022 23:18:12 +0000 (23:18 +0000)]
Auto merge of #101909 - weihanglo:update-cargo, r=ehuss

Update cargo (CVE fixes included)

8 commits in 082503982ea0fb7a8fd72210427d43a2e2128a63..73ba3f35e0205844418260722c11602113179c4a
2022-09-13 17:49:38 +0000 to 2022-09-18 06:38:16 +0000

- Revert "Clarify when cargo detects changes" (https://github.com/rust-lang/cargo/pull/11107)
- Fix links to workspace inheritance headings in workspace docs (https://github.com/rust-lang/cargo/pull/11103)
- docs(ref): Clarify workspace settings (https://github.com/rust-lang/cargo/pull/11082)
- Update comment about ResolveVersion default version (https://github.com/rust-lang/cargo/pull/11095)
- [master] Run `reach_max_unpack_size` test only on debug build (https://github.com/rust-lang/cargo/pull/11091)
- Clarify when cargo detects changes (https://github.com/rust-lang/cargo/pull/11092)
- [master] Fix for https://github.com/advisories/GHSA-rfj2-q3h3-hm5j and https://github.com/advisories/GHSA-2hvr-h6gw-qrxp (https://github.com/rust-lang/cargo/pull/11089)
- Expose cargo add internals as edit API (https://github.com/rust-lang/cargo/pull/11059)

21 months agoAuto merge of #101894 - dingxiangfei2009:let-else-avoid-duplicate-storage-live, r...
bors [Mon, 19 Sep 2022 17:27:30 +0000 (17:27 +0000)]
Auto merge of #101894 - dingxiangfei2009:let-else-avoid-duplicate-storage-live, r=oli-obk

Avoid duplicating StorageLive in let-else

cc `@est31`

Fix #101867
Fix #101932

#101410 introduced directives to activate storages of bindings in let-else earlier. However, since it is using the machinery of `match` and friends for pattern matching and binding, those storages are activated for the second time. This PR adjusts this behavior and avoid the duplicated activation for let-else statements.

21 months agoAuto merge of #101901 - lcnr:early-binder-type-foldable, r=compiler-errors
bors [Mon, 19 Sep 2022 10:35:09 +0000 (10:35 +0000)]
Auto merge of #101901 - lcnr:early-binder-type-foldable, r=compiler-errors

`EarlyBinder` prevent misuse

folding a type before substituting is pretty much always wrong and could happen by accident, e.g. see https://github.com/rust-lang/rust/pull/99798#discussion_r968666538

this PR removes the `TypeFoldable` and `TypeVisitable` impl from `EarlyBinder`.

r? types cc `@jackh726`

21 months agoextend polymorphization hack comment.
lcnr [Mon, 19 Sep 2022 09:44:29 +0000 (11:44 +0200)]
extend polymorphization hack comment.

21 months agoremove the `Subst` trait, always use `EarlyBinder`
lcnr [Fri, 16 Sep 2022 13:31:10 +0000 (15:31 +0200)]
remove the `Subst` trait, always use `EarlyBinder`

21 months agodo not implement type traversal for `EarlyBinder`
lcnr [Fri, 16 Sep 2022 13:09:38 +0000 (15:09 +0200)]
do not implement type traversal for `EarlyBinder`

21 months agoAuto merge of #101629 - compiler-errors:issue-101623, r=sanxiyn
bors [Mon, 19 Sep 2022 07:41:54 +0000 (07:41 +0000)]
Auto merge of #101629 - compiler-errors:issue-101623, r=sanxiyn

Be careful about `expr_ty_adjusted` when noting block tail type

Fixes #101623

21 months agoAuto merge of #101924 - jackh726:revert-static-hrtb-error, r=compiler-errors
bors [Mon, 19 Sep 2022 04:56:14 +0000 (04:56 +0000)]
Auto merge of #101924 - jackh726:revert-static-hrtb-error, r=compiler-errors

Re-add HRTB implied static bug note

r? `@compiler-errors` since you reviewed it previously

I deleted a `normalize` call and forgot about it. Whoops.

21 months agoAuto merge of #101799 - LukeMathWalker:distribute-json-doc, r=jyn514
bors [Mon, 19 Sep 2022 02:13:54 +0000 (02:13 +0000)]
Auto merge of #101799 - LukeMathWalker:distribute-json-doc, r=jyn514

Distribute json doc

# Overview

We add a new component, `rust-json-docs`, to distribute the JSON version of rustdoc's output for public compiler crates (i.e. `std`, `alloc`, `proc_macro`, `core` and `test`).
As discussed in #101383, we do not bundle this up as part of the existing `rust-docs` component since `rustdoc`'s JSON format is still unstable.

# Open questions / Doubts

I tried my best, but I never touched this codebase and I couldn't find much documentation on how `dist` works - I pattern-matched existing code, which might have led to some non-sensical choices in the eyes of people more familiar with the codebase. In particular, I am not sure if my choice of adding a new config flag is appropriate or if the decision to build/not build the JSON docs is more appropriately gated by one of the existing flags.
Any suggestion is more than welcome.

Closes #101383

21 months agoAuto merge of #101332 - sashashura:patch-1, r=pietroalbini
bors [Sun, 18 Sep 2022 14:10:57 +0000 (14:10 +0000)]
Auto merge of #101332 - sashashura:patch-1, r=pietroalbini

GitHub Workflows security hardening

This PR adds explicit [permissions section](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions) to workflows. This is a security best practice because by default workflows run with [extended set of permissions](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token) (except from `on: pull_request` [from external forks](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)). By specifying any permission explicitly all others are set to none. By using the principle of least privilege the damage a compromised workflow can do (because of an [injection](https://securitylab.github.com/research/github-actions-untrusted-input/) or compromised third party tool or action) is restricted.
It is recommended to have [most strict permissions on the top level](https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions) and grant write permissions on [job level](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs) case by case.

21 months agoAuto merge of #101955 - jam1garner:fix-proc-macro-typo, r=petrochenkov
bors [Sun, 18 Sep 2022 11:42:13 +0000 (11:42 +0000)]
Auto merge of #101955 - jam1garner:fix-proc-macro-typo, r=petrochenkov

Fix typo in proc_macro Span::eq documentation

21 months agoAuto merge of #101963 - scottmcm:from-ptr-range-optimization, r=Mark-Simulacrum
bors [Sun, 18 Sep 2022 08:44:27 +0000 (08:44 +0000)]
Auto merge of #101963 - scottmcm:from-ptr-range-optimization, r=Mark-Simulacrum

Add a codegen test for `slice::from_ptr_range`

I noticed back in #95579 that this didn't optimize as well as it should.

It's better now, after #95837 changed the code in `from_ptr_range` and https://github.com/llvm/llvm-project/issues/54824 was fixed in LLVM 15.

So here's a test to keep it generating the good version.

21 months agoUpdate cargo
Weihang Lo [Fri, 16 Sep 2022 17:24:45 +0000 (18:24 +0100)]
Update cargo

8 commits in 082503982ea0fb7a8fd72210427d43a2e2128a63..73ba3f35e0205844418260722c11602113179c4a
2022-09-13 17:49:38 +0000 to 2022-09-18 06:38:16 +0000

- Revert "Clarify when cargo detects changes" (rust-lang/cargo#11107)
- Fix links to workspace inheritance headings in workspace docs (rust-lang/cargo#11103)
- docs(ref): Clarify workspace settings (rust-lang/cargo#11082)
- Update comment about ResolveVersion default version (rust-lang/cargo#11095)
- [master] Run `reach_max_unpack_size` test only on debug build (rust-lang/cargo#11091)
- Clarify when cargo detects changes (rust-lang/cargo#11092)
- [master] Fix for CVE-2022-36113 and CVE-2022-36114 (rust-lang/cargo#11089)
- Expose cargo add internals as edit API (rust-lang/cargo#11059)

21 months agoAuto merge of #101816 - raldone01:cleanup/select_nth_unstable, r=Mark-Simulacrum
bors [Sun, 18 Sep 2022 06:03:22 +0000 (06:03 +0000)]
Auto merge of #101816 - raldone01:cleanup/select_nth_unstable, r=Mark-Simulacrum

Cleanup slice sort related closures in core and alloc

21 months agoadd miri test via const fn
Ding Xiang Fei [Sun, 18 Sep 2022 04:18:34 +0000 (12:18 +0800)]
add miri test via const fn

21 months agoadd mir-opt test
Ding Xiang Fei [Fri, 16 Sep 2022 11:54:41 +0000 (19:54 +0800)]
add mir-opt test

21 months agoavoid duplicating StorageLive in let-else
Ding Xiang Fei [Fri, 16 Sep 2022 11:02:45 +0000 (19:02 +0800)]
avoid duplicating StorageLive in let-else

21 months agoAuto merge of #101960 - matthiaskrgr:rollup-1l5v7ip, r=matthiaskrgr
bors [Sun, 18 Sep 2022 03:40:01 +0000 (03:40 +0000)]
Auto merge of #101960 - matthiaskrgr:rollup-1l5v7ip, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #101151 (Document x86_64-fortanix-unknown-sgx platform)
 - #101912 (Update `unicode-rs` crates to Unicode 15)
 - #101923 (Don't add rustdoc's CSS to other doc pages)
 - #101953 (Fix tooltip display for error codes)
 - #101954 (rustdoc: remove redundant `.location a { font-weight: 500 }`)

Failed merges:

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

21 months agoAdd a codegen test for slice::from_ptr_range
Scott McMurray [Sun, 18 Sep 2022 01:54:00 +0000 (18:54 -0700)]
Add a codegen test for slice::from_ptr_range

21 months agoRollup merge of #101954 - notriddle:notriddle/location-a-first-of-type, r=GuillaumeGomez
Matthias Krüger [Sun, 18 Sep 2022 00:55:31 +0000 (02:55 +0200)]
Rollup merge of #101954 - notriddle:notriddle/location-a-first-of-type, r=GuillaumeGomez

rustdoc: remove redundant `.location a { font-weight: 500 }`

The `class="location"` element is an h2, either in the sidebar or in the mobile header. Either way, it already has `font-weight: 500`, which the link inside will inherit.

The original version of this rule was added in 9e82fc7ef9b6c8a344dd27583990b02a661af78c. At that time, the location header was rendered as a paragraph with the full path:

https://github.com/rust-lang/rust/blob/9e82fc7ef9b6c8a344dd27583990b02a661af78c/src/librustdoc/html/render.rs#L2080

Nowadays, it's rendered as a true header, with only the name of the item, and the full path is included in a separate `fqn` header:

https://github.com/rust-lang/rust/blob/98ad6a5519651af36e246c0335c964dd52c554ba/src/librustdoc/html/render/mod.rs#L1797

21 months agoRollup merge of #101953 - GuillaumeGomez:fix-error-code-tooltip, r=notriddle
Matthias Krüger [Sun, 18 Sep 2022 00:55:30 +0000 (02:55 +0200)]
Rollup merge of #101953 - GuillaumeGomez:fix-error-code-tooltip, r=notriddle

Fix tooltip display for error codes

Fixes #101919.

You can test it [here](https://rustdoc.crud.net/imperio/fix-error-code-tooltip/index.html).

cc `@jsha`
r? `@notriddle`

21 months agoRollup merge of #101923 - jsha:aux-pages-no-rustdoc-css, r=Mark-Simulacrum
Matthias Krüger [Sun, 18 Sep 2022 00:55:30 +0000 (02:55 +0200)]
Rollup merge of #101923 - jsha:aux-pages-no-rustdoc-css, r=Mark-Simulacrum

Don't add rustdoc's CSS to other doc pages

This was originally added so those doc pages could use the same font files, but it turns out to be fragile. And those doc pages are just stubs that link to other pages, so they don't need fancy fonts.

Before:

![Screenshot from 2022-09-16 16-45-44](https://user-images.githubusercontent.com/220205/190831650-b626ee66-046a-4b71-8e57-dd06872359db.png)

After:

![Screenshot from 2022-09-16 16-52-06](https://user-images.githubusercontent.com/220205/190831657-f7d10a3f-d8c0-48a3-b30d-666db5a50563.png)

Demo of all affected pages:

https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/complement-design-faq.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/complement-lang-faq.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/complement-project-faq.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/grammar.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/guide-crates.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/guide-error-handling.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/guide-ffi.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/guide-macros.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/guide.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/guide-ownership.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/guide-plugins.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/guide-pointers.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/guide-strings.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/guide-tasks.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/guide-testing.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/guide-unsafe.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/index.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/intro.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/not_found.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/reference.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/rustdoc.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/rust.html
https://rustdoc.crud.net/jsha/aux-pages-no-rustdoc-css/tutorial.html

Prior art: https://github.com/rust-lang/rust/pull/86663

21 months agoRollup merge of #101912 - crlf0710:compiler_update_unicode_15, r=Manishearth
Matthias Krüger [Sun, 18 Sep 2022 00:55:29 +0000 (02:55 +0200)]
Rollup merge of #101912 - crlf0710:compiler_update_unicode_15, r=Manishearth

Update `unicode-rs` crates to Unicode 15

r? `@Manishearth`

21 months agoRollup merge of #101151 - jethrogb:jb/sgx-platform, r=JohnTitor
Matthias Krüger [Sun, 18 Sep 2022 00:55:29 +0000 (02:55 +0200)]
Rollup merge of #101151 - jethrogb:jb/sgx-platform, r=JohnTitor

Document x86_64-fortanix-unknown-sgx platform

cc `@raoulstrackx` `@mzohreva`

21 months agoAuto merge of #101862 - cjgillot:lint-regression, r=oli-obk
bors [Sun, 18 Sep 2022 00:46:14 +0000 (00:46 +0000)]
Auto merge of #101862 - cjgillot:lint-regression, r=oli-obk

Do not fetch HIR node when iterating to find lint.

Addresses the regression in https://github.com/rust-lang/rust/pull/101620

21 months agoFix typo in proc_macro Span::eq
jam1garner [Sat, 17 Sep 2022 23:15:30 +0000 (19:15 -0400)]
Fix typo in proc_macro Span::eq

21 months agorustdoc: remove redundant `.location a { font-weight: 500 }`
Michael Howell [Sat, 17 Sep 2022 22:30:23 +0000 (15:30 -0700)]
rustdoc: remove redundant `.location a { font-weight: 500 }`

The `class="location"` element is an h2, either in the sidebar or in the
mobile header. Either way, it already has `font-weight: 500`, which the link
inside will inherit.

The original version of this rule was added in
9e82fc7ef9b6c8a344dd27583990b02a661af78c. At that time, the location header
was rendered as a paragraph with the full path:

https://github.com/rust-lang/rust/blob/9e82fc7ef9b6c8a344dd27583990b02a661af78c/src/librustdoc/html/render.rs#L2080

Nowadays, it's rendered as a true header, with only the name of the item,
and the full path is included in a separate `fqn` header:

https://github.com/rust-lang/rust/blob/98ad6a5519651af36e246c0335c964dd52c554ba/src/librustdoc/html/render/mod.rs#L1797

21 months agoFix tooltip display for error codes
Guillaume Gomez [Sat, 17 Sep 2022 22:32:28 +0000 (00:32 +0200)]
Fix tooltip display for error codes

21 months agoAuto merge of #101949 - matthiaskrgr:rollup-xu5cqnd, r=matthiaskrgr
bors [Sat, 17 Sep 2022 22:04:28 +0000 (22:04 +0000)]
Auto merge of #101949 - matthiaskrgr:rollup-xu5cqnd, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #101093 (Initial version of 1.64 release notes)
 - #101713 (change AccessLevels representation)
 - #101821 (Bump Unicode to version 15.0.0, regenerate tables)
 - #101826 (Enforce "joined()" and "joined_with_noop()" test)
 - #101835 (Allow using vendoring when running bootstrap from outside the source root)
 - #101942 (Revert "Copy stage0 binaries into stage0-sysroot")
 - #101943 (rustdoc: remove unused CSS `.non-exhaustive { margin-bottom }`)

Failed merges:

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

21 months agoRollup merge of #101943 - notriddle:notriddle/non-exhaustive, r=GuillaumeGomez
Matthias Krüger [Sat, 17 Sep 2022 21:30:51 +0000 (23:30 +0200)]
Rollup merge of #101943 - notriddle:notriddle/non-exhaustive, r=GuillaumeGomez

rustdoc: remove unused CSS `.non-exhaustive { margin-bottom }`

This selector was added in 959a13d53e27ca92b59798e6c6737f8249d59a2e to target a `<div class="non-exhaustive">`. With 4edcf6147912e7e4c1f13208d830c3c25e544a8c, the non-exhaustive indicator was changed to a `<details>`, and a separate selector targetting `details.non-exhaustive` was added for it, but the old selector was never removed.

21 months agoRollup merge of #101942 - Mark-Simulacrum:fix-perf, r=jyn514
Matthias Krüger [Sat, 17 Sep 2022 21:30:50 +0000 (23:30 +0200)]
Rollup merge of #101942 - Mark-Simulacrum:fix-perf, r=jyn514

Revert "Copy stage0 binaries into stage0-sysroot"

This reverts PR #101711.

The PR broke the rustc/bootstrap benchmark on rustc-perf, I believe due to the assumption that the stage0 directory exists. Fixing that by just skipping this logic might be reasonable, but I think there's a larger discussion to be had around the right behavior when we don't have a single bin/ directory (when rustc= and cargo= are specified in config.toml). I think it's potentially reasonable to put those binaries (cargo, rustc, rustfmt?) into the bin directory, but for now just want to get us back to a healthy state.

r? `@jyn514` (but would appreciate review from others as this is just a direct revert).

21 months agoRollup merge of #101835 - jyn514:fix-vendoring, r=Mark-Simulacrum
Matthias Krüger [Sat, 17 Sep 2022 21:30:50 +0000 (23:30 +0200)]
Rollup merge of #101835 - jyn514:fix-vendoring, r=Mark-Simulacrum

Allow using vendoring when running bootstrap from outside the source root

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

21 months agoRollup merge of #101826 - andrewpollack:fix-joined-without-noop, r=Mark-Simulacrum
Matthias Krüger [Sat, 17 Sep 2022 21:30:50 +0000 (23:30 +0200)]
Rollup merge of #101826 - andrewpollack:fix-joined-without-noop, r=Mark-Simulacrum

Enforce "joined()" and "joined_with_noop()" test

Several similar tests come in the form of `joined()` and `joined_with_noop()`. In this test, the `joined()` has two calls to a noop, making it functionally equivalent to `joined_with_noop()`. This doesn't seem intended, and this PR removes those calls and changes the memory size to reflect the change

For my education, why do tests with `noop()` calls sometimes have `noop()` contributing to the size, while others do not? E.g. https://github.com/rust-lang/rust/blob/master/src/test/ui/async-await/async-fn-size-moved-locals.rs#L115 and https://github.com/rust-lang/rust/blob/master/src/test/ui/async-await/async-fn-size-moved-locals.rs#L116 have no size difference, whereas https://github.com/rust-lang/rust/blob/master/src/test/ui/async-await/async-fn-size-moved-locals.rs#L113 and https://github.com/rust-lang/rust/blob/master/src/test/ui/async-await/async-fn-size-moved-locals.rs#L114 have a size difference. Thank you!

21 months agoRollup merge of #101821 - thomcc:unicode-15, r=Manishearth
Matthias Krüger [Sat, 17 Sep 2022 21:30:49 +0000 (23:30 +0200)]
Rollup merge of #101821 - thomcc:unicode-15, r=Manishearth

Bump Unicode to version 15.0.0, regenerate tables

r? `@Mark-Simulacrum`

21 months agoRollup merge of #101713 - Bryanskiy:AccessLevels, r=petrochenkov
Matthias Krüger [Sat, 17 Sep 2022 21:30:49 +0000 (23:30 +0200)]
Rollup merge of #101713 - Bryanskiy:AccessLevels, r=petrochenkov

change AccessLevels representation

Part of RFC (https://github.com/rust-lang/rust/issues/48054). This patch implements effective visibility table with basic methods and change AccessLevels table representation according to it.

r? ``@petrochenkov``

21 months agoRollup merge of #101093 - joshtriplett:relnotes-1.64, r=Mark-Simulacrum
Matthias Krüger [Sat, 17 Sep 2022 21:30:48 +0000 (23:30 +0200)]
Rollup merge of #101093 - joshtriplett:relnotes-1.64, r=Mark-Simulacrum

Initial version of 1.64 release notes

Needs further expansion on some points, with text that will likely end up in
the blog post as well.

Also adds the release notes from 1.62.1 and 1.63, which weren't present on the
branch.

21 months agoAdd a new component, `rust-json-docs`, to distribute the JSON-formatted documentation...
Luca Palmieri [Wed, 14 Sep 2022 11:49:05 +0000 (13:49 +0200)]
Add a new component, `rust-json-docs`, to distribute the JSON-formatted documentation for std crates in nightly toolchains.
We also add a new flag to `x doc`, `--json`, to render the JSON-formatted version alongside the HTML-formatted one.

21 months agoAuto merge of #101946 - matthiaskrgr:rollup-jqkhsku, r=matthiaskrgr
bors [Sat, 17 Sep 2022 19:33:52 +0000 (19:33 +0000)]
Auto merge of #101946 - matthiaskrgr:rollup-jqkhsku, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #101672 (array docs - advertise how to get array from slice)
 - #101781 (Extend list of targets that support dyanmic linking for llvm tools)
 - #101783 (Improve handing of env vars during bootstrap process)
 - #101801 (add note for `layout_of` when query depth overflows)
 - #101824 (rustdoc: add test cases for turning ``[Vec<T>]`` into ``[`Vec<T>`]``)
 - #101861 (Update stdarch)
 - #101873 (Allow building `rust-analyzer-proc-macro-srv` as a standalone tool)
 - #101918 (rustdoc: clean up CSS for All Items and All Crates lists)
 - #101934 (Continue migration of CSS themes)

Failed merges:

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

21 months agoRelease notes update
Mark Rousskov [Sat, 17 Sep 2022 17:45:51 +0000 (13:45 -0400)]
Release notes update

Co-authored-by: Tyler Mandry <tmandry@gmail.com>
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
21 months agoRollup merge of #101934 - GuillaumeGomez:theme-links-cleanup, r=notriddle
Matthias Krüger [Sat, 17 Sep 2022 17:27:09 +0000 (19:27 +0200)]
Rollup merge of #101934 - GuillaumeGomez:theme-links-cleanup, r=notriddle

Continue migration of CSS themes

Now that https://github.com/rust-lang/rust/pull/101898 has been merged, we can move forward.

This PR moves more CSS theme rules as CSS variables. I also added a GUI test to prevent regressions.

Part of https://github.com/rust-lang/rust/pull/98460.

r? ``@notriddle``

21 months agoRollup merge of #101918 - notriddle:notriddle/all, r=GuillaumeGomez
Matthias Krüger [Sat, 17 Sep 2022 17:27:08 +0000 (19:27 +0200)]
Rollup merge of #101918 - notriddle:notriddle/all, r=GuillaumeGomez

rustdoc: clean up CSS for All Items and All Crates lists

This reduces the amount of CSS, and makes these two pages more consistent (which, necessarily, means changing them a bit).

# Before

![image](https://user-images.githubusercontent.com/1593513/190735035-c66b2664-3783-483c-9bc6-89f80e4a5490.png)

![image](https://user-images.githubusercontent.com/1593513/190735134-1d5df81d-58c5-4c86-b066-6dd3031ffc2e.png)

# After

![image](https://user-images.githubusercontent.com/1593513/190735261-fc3878bb-0cab-4c4e-a6da-b5f7abd06588.png)

![image](https://user-images.githubusercontent.com/1593513/190735389-935a7836-f2c0-4349-a7d0-7fe5378f6b9a.png)

21 months agoRollup merge of #101873 - WaffleLapkin:x-build-proc-macro-srv, r=jyn514
Matthias Krüger [Sat, 17 Sep 2022 17:27:08 +0000 (19:27 +0200)]
Rollup merge of #101873 - WaffleLapkin:x-build-proc-macro-srv, r=jyn514

Allow building `rust-analyzer-proc-macro-srv` as a standalone tool

This PR allows building `rust-analyzer-proc-macro-srv` as a standalone tool via `x b proc-macro-srv-cli` (I thought that `x b rust-analyzer-proc-macro-srv` should work, but it doesn't for some reason...). Also this PR adds a copy of `rust-analyzer-proc-macro-srv` binary to `build/{triple}/{stage}/libexec/` when building `rust-analyzer-proc-macro-srv`, so that r-a can pick it up.

This is useful to make r-a (and I assume Intellij IDEA) to expand macros when using a custom, build from source toolchain.

r? ``@jyn514``
[_zulip thread_](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/How.20to.20fix.20.60UnsupportedABI.60.20for.20custom.20toolchains.3F/near/299040175)

21 months agoRollup merge of #101861 - wesleywiser:update_stdarch, r=Amanieu
Matthias Krüger [Sat, 17 Sep 2022 17:27:07 +0000 (19:27 +0200)]
Rollup merge of #101861 - wesleywiser:update_stdarch, r=Amanieu

Update stdarch

This pulls in the following changes:

- [Use simd_bitmask intrinsic in a couple of places](https://github.com/rust-lang/stdarch/commit/9f0928782b051edb6add78e9310472abface1e5c)
- [Remove simd_shuffle<n> usage in favor of simd_shuffle](https://github.com/rust-lang/stdarch/commit/3fd17e46079dbb5b99888dbcfdd232f2c023dff5)
- [Remove late specifiers in __cpuid_count](https://github.com/rust-lang/stdarch/commit/f1db941633e6e12bf62093cf0458bcbd7031c663)
  - Helps with #101346
- [Use mov and xchg instead of movl(q) and xchgl(q)](https://github.com/rust-lang/stdarch/commit/3049a31937e4f7353e1dea2f6dc558b02451bb13)
- [Bump cfg-if dependency to 1.0](https://github.com/rust-lang/stdarch/commit/f305cc83e7036f250a2a437021552526d1398cb4)
- [Fix documentation of __m256bh and __m512bh structs](https://github.com/rust-lang/stdarch/commit/699c093a42283c07e9763b4c19439a900ae2d321)

r? ``@Amanieu``

21 months agoRollup merge of #101824 - notriddle:notriddle/html-as-generics-intra-doc-links, r...
Matthias Krüger [Sat, 17 Sep 2022 17:27:07 +0000 (19:27 +0200)]
Rollup merge of #101824 - notriddle:notriddle/html-as-generics-intra-doc-links, r=Mark-Simulacrum

rustdoc: add test cases for turning ``[Vec<T>]`` into ``[`Vec<T>`]``

21 months agoRollup merge of #101801 - SparrowLii:query_depth_note, r=estebank
Matthias Krüger [Sat, 17 Sep 2022 17:27:06 +0000 (19:27 +0200)]
Rollup merge of #101801 - SparrowLii:query_depth_note, r=estebank

add note for `layout_of` when query depth overflows

Fixes #101747
Added `try_find_layout_root` function to add a note for `layout_of` when query depth overflows. This would make the error in #101747 look like this:
```
error: queries overflow the depth limit!
   |
note: Query depth increased by 66 when computing layout of `core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<alloc::boxed::Box<alloc::string::String>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`!
  --> D:\rust-backup\parallel_rust\query_depth.rs:40:1
   |
40 | fn main() {
   | ^^^^^^^^^

error: aborting due to previous error
```

cc ``@semicoleon``

21 months agoRollup merge of #101783 - chriswailes:env-vars, r=jyn514
Matthias Krüger [Sat, 17 Sep 2022 17:27:06 +0000 (19:27 +0200)]
Rollup merge of #101783 - chriswailes:env-vars, r=jyn514

Improve handing of env vars during bootstrap process

This CL modifies the handing of env vars during the bootstrap process in two ways:
1. Replaces '-' characters with '_' characters in target names to increase compatibility with different shells
2. Passes Stage0 snapshot compiler related env vars to early invocations of Cargo

21 months agoRollup merge of #101781 - chriswailes:dynamic-llvm-on-musl, r=jyn514
Matthias Krüger [Sat, 17 Sep 2022 17:27:05 +0000 (19:27 +0200)]
Rollup merge of #101781 - chriswailes:dynamic-llvm-on-musl, r=jyn514

Extend list of targets that support dyanmic linking for llvm tools

This commit adds `linux-musl` to the list of targets that support dynamic linking for the LLVM tools.

21 months agoRollup merge of #101672 - idigdoug:array_try_into, r=Mark-Simulacrum
Matthias Krüger [Sat, 17 Sep 2022 17:27:05 +0000 (19:27 +0200)]
Rollup merge of #101672 - idigdoug:array_try_into, r=Mark-Simulacrum

array docs - advertise how to get array from slice

On my first Rust project, I spent more time than I care to admit figuring out how to efficiently get an array from a slice. Update the array documentation to explain this a bit more clearly.

(As a side note, it's a bit unfortunate that get-array-from-slice is only available via trait since that means it can't be used from const functions yet.)

21 months agoAuto merge of #101890 - rust-lang:pa-bump-version, r=pietroalbini
bors [Sat, 17 Sep 2022 16:32:58 +0000 (16:32 +0000)]
Auto merge of #101890 - rust-lang:pa-bump-version, r=pietroalbini

Bump version to 1.66.0

Part of the release process.

21 months agorustdoc: remove unused CSS `.non-exhaustive { margin-bottom }`
Michael Howell [Sat, 17 Sep 2022 16:00:20 +0000 (09:00 -0700)]
rustdoc: remove unused CSS `.non-exhaustive { margin-bottom }`

This selector was added in 959a13d53e27ca92b59798e6c6737f8249d59a2e to
target a `<div class="non-exhaustive">`. With
4edcf6147912e7e4c1f13208d830c3c25e544a8c, the non-exhaustive indicator was
changed to a `<details>`, and a separate selector targetting
`details.non-exhaustive` was added for it, but the old selector was never
removed.

21 months agoUse Predicate ConstraintCategory when normalizing
Jack Huey [Wed, 31 Aug 2022 01:50:22 +0000 (21:50 -0400)]
Use Predicate ConstraintCategory when normalizing

21 months agoAdd back in normalize call
Jack Huey [Fri, 16 Sep 2022 21:52:04 +0000 (17:52 -0400)]
Add back in normalize call

21 months agoRevert "fix #101691: copy stage0 binaries into stage0-sysroot"
Mark Rousskov [Sat, 17 Sep 2022 15:03:40 +0000 (11:03 -0400)]
Revert "fix #101691: copy stage0 binaries into stage0-sysroot"

This reverts commit 32f8eb2fee4d6781a79052b560abd10e12ebb34f.

21 months agoAuto merge of #101857 - lcnr:make-dyn-again, r=jackh726
bors [Sat, 17 Sep 2022 13:37:48 +0000 (13:37 +0000)]
Auto merge of #101857 - lcnr:make-dyn-again, r=jackh726

change `FnMutDelegate` to trait objects

cc #100016 as mentioned in the last t-compiler meeting

r? `@jackh726`

21 months agoAuto merge of #101938 - Dylan-DPC:rollup-6vlohhs, r=Dylan-DPC
bors [Sat, 17 Sep 2022 10:56:42 +0000 (10:56 +0000)]
Auto merge of #101938 - Dylan-DPC:rollup-6vlohhs, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #93628 (Stabilize `let else`)
 - #98441 (Implement simd_as for pointers)
 - #101790 (Do not suggest a placeholder to const and static without a type)
 - #101807 (Disallow defaults on type GATs)
 - #101915 (doc: fix redirected link in `/index.html`)
 - #101931 (doc: Fix a typo in `Rc::make_mut` docstring)

Failed merges:

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

21 months agoRollup merge of #101931 - msakuta:master, r=thomcc
Dylan DPC [Sat, 17 Sep 2022 10:01:09 +0000 (15:31 +0530)]
Rollup merge of #101931 - msakuta:master, r=thomcc

doc: Fix a typo in `Rc::make_mut` docstring

A very minor typo fix.

21 months agoRollup merge of #101915 - notriddle:notriddle/redirect, r=GuillaumeGomez
Dylan DPC [Sat, 17 Sep 2022 10:01:09 +0000 (15:31 +0530)]
Rollup merge of #101915 - notriddle:notriddle/redirect, r=GuillaumeGomez

doc: fix redirected link in `/index.html`

Fallout from #101166

21 months agoRollup merge of #101807 - jackh726:no-gat-defaults, r=lcnr
Dylan DPC [Sat, 17 Sep 2022 10:01:08 +0000 (15:31 +0530)]
Rollup merge of #101807 - jackh726:no-gat-defaults, r=lcnr

Disallow defaults on type GATs

Fixes #99205

21 months agoRollup merge of #101790 - TaKO8Ki:do-not-suggest-placeholder-to-const-and-static...
Dylan DPC [Sat, 17 Sep 2022 10:01:08 +0000 (15:31 +0530)]
Rollup merge of #101790 - TaKO8Ki:do-not-suggest-placeholder-to-const-and-static-without-type, r=compiler-errors

Do not suggest a placeholder to const and static without a type

Fixes #101755

21 months agoRollup merge of #98441 - calebzulawski:simd_as, r=oli-obk
Dylan DPC [Sat, 17 Sep 2022 10:01:07 +0000 (15:31 +0530)]
Rollup merge of #98441 - calebzulawski:simd_as, r=oli-obk

Implement simd_as for pointers

Expands `simd_as` (and `simd_cast`) to handle pointer-to-pointer, pointer-to-integer, and integer-to-pointer conversions.

cc ``@programmerjake`` ``@thomcc``

21 months agoRollup merge of #93628 - est31:stabilize_let_else, r=joshtriplett
Dylan DPC [Sat, 17 Sep 2022 10:01:06 +0000 (15:31 +0530)]
Rollup merge of #93628 - est31:stabilize_let_else, r=joshtriplett

Stabilize `let else`

:tada:  **Stabilizes the `let else` feature, added by [RFC 3137](https://github.com/rust-lang/rfcs/pull/3137).** :tada:

Reference PR: https://github.com/rust-lang/reference/pull/1156

closes #87335 (`let else` tracking issue)

FCP: https://github.com/rust-lang/rust/pull/93628#issuecomment-1029383585

----------

## Stabilization report

### Summary

The feature allows refutable patterns in `let` statements if the expression is
followed by a diverging `else`:

```Rust
fn get_count_item(s: &str) -> (u64, &str) {
    let mut it = s.split(' ');
    let (Some(count_str), Some(item)) = (it.next(), it.next()) else {
        panic!("Can't segment count item pair: '{s}'");
    };
    let Ok(count) = u64::from_str(count_str) else {
        panic!("Can't parse integer: '{count_str}'");
    };
    (count, item)
}
assert_eq!(get_count_item("3 chairs"), (3, "chairs"));
```

### Differences from the RFC / Desugaring

Outside of desugaring I'm not aware of any differences between the implementation and the RFC. The chosen desugaring has been changed from the RFC's [original](https://rust-lang.github.io/rfcs/3137-let-else.html#reference-level-explanations). You can read a detailed discussion of the implementation history of it in `@cormacrelf` 's [summary](https://github.com/rust-lang/rust/pull/93628#issuecomment-1041143670) in this thread, as well as the [followup](https://github.com/rust-lang/rust/pull/93628#issuecomment-1046598419). Since that followup, further changes have happened to the desugaring, in #98574, #99518, #99954. The later changes were mostly about the drop order: On match, temporaries drop in the same order as they would for a `let` declaration. On mismatch, temporaries drop before the `else` block.

### Test cases

In chronological order as they were merged.

Added by df9a2e0687895731e12f4a2651e8d70acd08872d (#87688):

* [`ui/pattern/usefulness/top-level-alternation.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/pattern/usefulness/top-level-alternation.rs) to ensure the unreachable pattern lint visits patterns inside `let else`.

Added by 5b95df4bdc330f34213812ad65cae86ced90d80c (#87688):

* [`ui/let-else/let-else-bool-binop-init.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-bool-binop-init.rs) to ensure that no lazy boolean expressions (using `&&` or `||`) are allowed in the expression, as the RFC mandates.
* [`ui/let-else/let-else-brace-before-else.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-brace-before-else.rs) to ensure that no `}` directly preceding the `else` is allowed in the expression, as the RFC mandates.
* [`ui/let-else/let-else-check.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-check.rs) to ensure that `#[allow(...)]` attributes added to the entire `let` statement apply for the `else` block.
* [`ui/let-else/let-else-irrefutable.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-irrefutable.rs) to ensure that the `irrefutable_let_patterns` lint fires.
* [`ui/let-else/let-else-missing-semicolon.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-missing-semicolon.rs) to ensure the presence of semicolons at the end of the `let` statement.
* [`ui/let-else/let-else-non-diverging.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-non-diverging.rs) to ensure the `else` block diverges.
* [`ui/let-else/let-else-run-pass.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-run-pass.rs) to ensure the feature works in some simple test case settings.
* [`ui/let-else/let-else-scope.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-scope.rs) to ensure the bindings created by the outer `let` expression are not available in the `else` block of it.

Added by bf7c32a4477a76bfd18fdcd8f45a939cbed82d34 (#89965):

* [`ui/let-else/issue-89960.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/issue-89960.rs) as a regression test for the ICE-on-error bug #89960 . Later in 102b9125e1cefbb8ed8408d2db3f9f7d5afddbf0 this got removed in favour of more comprehensive tests.

Added by 856541963ce95ef4f7d4a81784bb5002ccf63c93 (#89974):

* [`ui/let-else/let-else-if.rs`](https://github.com/rust-lang/rust/blob/1.58.1/src/test/ui/let-else/let-else-if.rs) to test for the improved error message that points out that `let else if` is not possible.

Added by 9b45713b6c1775f0103a1ebee6ab7c6d9b781a21:

* [`ui/let-else/let-else-allow-unused.rs`](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-allow-unused.rs) as a regression test for #89807, to ensure that `#[allow(...)]` attributes added to the entire `let` statement apply for bindings created by the `let else` pattern.

Added by 61bcd8d3075471b3867428788c49f54fffe53f52 (#89841):

* [`ui/let-else/let-else-non-copy.rs`](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-non-copy.rs) to ensure that a copy is performed out of non-copy wrapper types. This mirrors `if let` behaviour. The test case bases on rustc internal changes originally meant for #89933 but then removed from the PR due to the error prior to the improvements of #89841.
* [`ui/let-else/let-else-source-expr-nomove-pass.rs `](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-source-expr-nomove-pass.rs) to ensure that while there is a move of the binding in the successful case, the `else` case can still access the non-matching value. This mirrors `if let` behaviour.

Added by 102b9125e1cefbb8ed8408d2db3f9f7d5afddbf0 (#89841):

* [`ui/let-else/let-else-ref-bindings.rs`](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-ref-bindings.rs) and [`ui/let-else/let-else-ref-bindings-pass.rs `](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-ref-bindings-pass.rs) to check `ref` and `ref mut` keywords in the pattern work correctly and error when needed.

Added by 2715c5f984fda7faa156d1c9cf91aa4934f0e00f (#89841):

* Match ergonomic tests adapted from the `rfc2005` test suite.

Added by fec8a507a27de1b08a0b95592dc8ec93bf0a321a (#89841):

* [`ui/let-else/let-else-deref-coercion-annotated.rs`](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-deref-coercion-annotated.rs) and [`ui/let-else/let-else-deref-coercion.rs`](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-deref-coercion.rs) to check deref coercions.

#### Added since this stabilization report was originally written (2022-02-09)

Added by 76ea56667703ac06689ff1d6fba5d170fa7392a7 (#94211):

* [`ui/let-else/let-else-destructuring.rs`](https://github.com/rust-lang/rust/blob/1.63.0/src/test/ui/let-else/let-else-destructuring.rs) to give a nice error message if an user tries to do an assignment with a (possibly refutable) pattern and an `else` block, like asked for in #93995.

Added by e7730dcb7eb29a10ee73f269f4dc6e9d606db0da (#94208):

* [`ui/let-else/let-else-allow-in-expr.rs`](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-allow-in-expr.rs) to test whether `#[allow(unused_variables)]` works in the expr, as well as its non presence, as well as putting it on the entire `let else` *affects* the expr, too. This was adding a missing test as pointed out by the stabilization report.
* Expansion of `ui/let-else/let-else-allow-unused.rs` and `ui/let-else/let-else-check.rs` to ensure that non-presence of `#[allow(unused)]` does issue the unused lint. This was adding a missing test case as pointed out by the stabilization report.

Added by 5bd71063b3810d977aa376d1e6dd7cec359330cc (#94208):

* [`ui/let-else/let-else-slicing-error.rs`](https://github.com/rust-lang/rust/blob/1.61.0/src/test/ui/let-else/let-else-slicing-error.rs), a regression test for #92069, which got fixed without addition of a regression test. This resolves a missing test as pointed out by the stabilization report.

Added by 5374688e1d8cbcff7d1d14bb34e38fe6fe7c233e (#98574):

* [`src/test/ui/async-await/async-await-let-else.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/async-await/async-await-let-else.rs) to test the interaction of async/await with `let else`

Added by 6c529ded8674b89c46052da92399227c3b764c6a (#98574):

* [`src/test/ui/let-else/let-else-temporary-lifetime.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/let-else/let-else-temporary-lifetime.rs) as a (partial) regression test for #98672

Added by 9b566401068cb8450912f6ab48f3d0e60f5cb482 (#99518):

* [`src/test/ui/let-else/let-else-temp-borrowck.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/let-else/let-else-temporary-lifetime.rs) as a regression test for #93951
* Extension of `src/test/ui/let-else/let-else-temporary-lifetime.rs` to include a partial regression test for #98672 (especially regarding `else` drop order)

Added by baf9a7cb57120ec1411196214fd0d1c33fb18bf6 (#99518):

* Extension of `src/test/ui/let-else/let-else-temporary-lifetime.rs` to include a partial regression test for #93951, similar to `let-else-temp-borrowck.rs`

Added by 60be2de8b7b8a1c4eee7e065b8cef38ea629a6a3 (#99518):

* Extension of `src/test/ui/let-else/let-else-temporary-lifetime.rs` to include a program that can now be compiled thanks to borrow checker implications of #99518

Added by 47a7a91c969ed2edd12c674ca05c1baf867f6f6f (#100132):

* [`src/test/ui/let-else/issue-100103.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/let-else/issue-100103.rs), as a regression test for #100103, to ensure that there is no ICE when doing `Err(...)?` inside else blocks.

Added by e3c5bd617d040b5ee0bc79e6e7f01772adce791b (#100443):

* [`src/test/ui/let-else/let-else-then-diverge.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/let-else/let-else-then-diverge.rs), to verify that there is no unreachable code error with the current desugaring.

Added by 981852677c531d52f701b870bb27b45668a44d52 (#100443):

* [`src/test/ui/let-else/issue-94176.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/let-else/issue-94176.rs), to make sure that a correct span is emitted for a missing trailing expression error. Regression test for #94176.

Added by e182d12a8493b40a557394325a3a713b6528de60 (#100434):

* [src/test/ui/unpretty/pretty-let-else.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/unpretty/pretty-let-else.rs), as a regression test to ensure pretty printing works for `let else` (this bug surfaced in many different ways)

Added by e26285603ca8b83b9d06e56f74e10e3d410553ff (#99954):

* [`src/test/ui/let-else/let-else-temporary-lifetime.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/let-else/let-else-temporary-lifetime.rs) extended to contain & borrows as well, as this was identified as an earlier issue with the desugaring: https://github.com/rust-lang/rust/issues/98672#issuecomment-1200196921

Added by 2d8460ef43d902f34ba2133fe38f66ee8d2fdafc (#99291):

* [`src/test/ui/let-else/let-else-drop-order.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/let-else/let-else-drop-order.rs) a matrix based test for various drop order behaviour of `let else`. Especially, it verifies equality of `let` and `let else` drop orders, [resolving](https://github.com/rust-lang/rust/pull/93628#issuecomment-1238498468) a [stabilization blocker](https://github.com/rust-lang/rust/pull/93628#issuecomment-1055738523).

Added by 1b87ce0d4092045728c1c68282769d555706f273 (#101410):

* Edit to `src/test/ui/let-else/let-else-temporary-lifetime.rs` to add the `-Zvalidate-mir` flag, as a regression test for #99228

Added by af591ebe4d0cf2097a5fdc0bb710442d0f2e7876 (#101410):

* [`src/test/ui/let-else/issue-99975.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui/let-else/issue-99975.rs) as a regression test for the ICE #99975.

Added by this PR:

* `ui/let-else/let-else.rs`, a simple run-pass check, similar to `ui/let-else/let-else-run-pass.rs`.

### Things not currently tested

* ~~The `#[allow(...)]` tests check whether allow works, but they don't check whether the non-presence of allow causes a lint to fire.~~ → *test added by e7730dcb7eb29a10ee73f269f4dc6e9d606db0da*
* ~~There is no `#[allow(...)]` test for the expression, as there are tests for the pattern and the else block.~~ → *test added by e7730dcb7eb29a10ee73f269f4dc6e9d606db0da*
* ~~`let-else-brace-before-else.rs` forbids the `let ... = {} else {}` pattern and there is a rustfix to obtain `let ... = ({}) else {}`. I'm not sure whether the `.fixed` files are checked by the tooling that they compile. But if there is no such check, it would be neat to make sure that `let ... = ({}) else {}` compiles.~~ → *test added by e7730dcb7eb29a10ee73f269f4dc6e9d606db0da*
* ~~#92069 got closed as fixed, but no regression test was added. Not sure it's worth to add one.~~ → *test added by 5bd71063b3810d977aa376d1e6dd7cec359330cc*
* ~~consistency between `let else` and `if let` regarding lifetimes and drop order: https://github.com/rust-lang/rust/pull/93628#issuecomment-1055738523~~ → *test added by 2d8460ef43d902f34ba2133fe38f66ee8d2fdafc*

Edit: they are all tested now.

### Possible future work / Refutable destructuring assignments

[RFC 2909](https://rust-lang.github.io/rfcs/2909-destructuring-assignment.html) specifies destructuring assignment, allowing statements like `FooBar { a, b, c } = foo();`.
As it was stabilized, destructuring assignment only allows *irrefutable* patterns, which before the advent of `let else` were the only patterns that `let` supported.
So the combination of `let else` and destructuring assignments gives reason to think about extensions of the destructuring assignments feature that allow refutable patterns, discussed in #93995.

A naive mapping of `let else` to destructuring assignments in the form of `Some(v) = foo() else { ... };` might not be the ideal way. `let else` needs a diverging `else` clause as it introduces new bindings, while assignments have a default behaviour to fall back to if the pattern does not match, in the form of not performing the assignment. Thus, there is no good case to require divergence, or even an `else` clause at all, beyond the need for having *some* introducer syntax so that it is clear to readers that the assignment is not a given (enums and structs look similar). There are better candidates for introducer syntax however than an empty `else {}` clause, like `maybe` which could be added as a keyword on an edition boundary:

```Rust
let mut v = 0;
maybe Some(v) = foo(&v);
maybe Some(v) = foo(&v) else { bar() };
```

Further design discussion is left to an RFC, or the linked issue.

21 months agoAuto merge of #101784 - reitermarkus:const-memchr, r=thomcc
bors [Sat, 17 Sep 2022 08:15:35 +0000 (08:15 +0000)]
Auto merge of #101784 - reitermarkus:const-memchr, r=thomcc

Simplify `const` `memchr`.

Extracted from https://github.com/rust-lang/rust/pull/101607.

Removes the need for `const_eval_select`.

21 months agoAuto merge of #101928 - notriddle:rollup-pexhhxe, r=notriddle
bors [Sat, 17 Sep 2022 05:45:28 +0000 (05:45 +0000)]
Auto merge of #101928 - notriddle:rollup-pexhhxe, r=notriddle

Rollup of 8 pull requests

Successful merges:

 - #101340 (Adding Fuchsia zxdb debugging walkthrough to docs)
 - #101741 (Adding needs-unwind arg to applicable compiler ui tests)
 - #101782 (Update `symbol_mangling` diagnostics migration)
 - #101878 (More simple formatting)
 - #101898 (Remove some unused CSS rules)
 - #101911 (rustdoc: remove no-op CSS on `.source .content`)
 - #101914 (rustdoc-json-types: Document that ResolvedPath can also be a union)
 - #101921 (Pass --cfg=bootstrap for rustdoc for proc_macro crates)

Failed merges:

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

21 months agoFix a typo in docstring
msakuta [Sat, 17 Sep 2022 04:58:53 +0000 (13:58 +0900)]
Fix a typo in docstring

21 months agoRollup merge of #101921 - est31:bootstrap_cfg_rustdoc, r=joshtriplett
Michael Howell [Sat, 17 Sep 2022 03:37:17 +0000 (20:37 -0700)]
Rollup merge of #101921 - est31:bootstrap_cfg_rustdoc, r=joshtriplett

Pass --cfg=bootstrap for rustdoc for proc_macro crates

This PR does three things:

* First, it passes --cfg=bootstrap on stage 0 for rustdoc invocations on proc_macro crates. This mirrors what we do already for rustc invocations of those, and is needed because cargo doesn't respect RUSTFLAGS or RUSTDOCFLAGS when confronted with a proc macro.
* Second, it marks the bootstrap config variable as expected. This is needed both on later stages where it's not set, but also on stage 0, where it is set.
* Third, it adjusts the comment in the rustc wrapper to better reflect the reason why we set the bootstrap variable as
  expected: due to recent changes, setting it as expected
  is also required even if the cfg variable is passed: ebf4cc361e0d0f11a25b42372bd629953365d17e .

21 months agoRollup merge of #101914 - aDotInTheVoid:rdj-path-union-docs, r=jsha
Michael Howell [Sat, 17 Sep 2022 03:37:17 +0000 (20:37 -0700)]
Rollup merge of #101914 - aDotInTheVoid:rdj-path-union-docs, r=jsha

rustdoc-json-types: Document that ResolvedPath can also be a union

r? rustdoc

21 months agoRollup merge of #101911 - notriddle:notriddle/source-content, r=GuillaumeGomez
Michael Howell [Sat, 17 Sep 2022 03:37:17 +0000 (20:37 -0700)]
Rollup merge of #101911 - notriddle:notriddle/source-content, r=GuillaumeGomez

rustdoc: remove no-op CSS on `.source .content`

# `margin-left: 0`

This rule originated in 7669f04fb0ddc3d71a1fb44dc1c5c00a6564ae99, to override the default, massive left margin that content used to accommodate the sidebar:

https://github.com/rust-lang/rust/blob/7669f04fb0ddc3d71a1fb44dc1c5c00a6564ae99/src/librustdoc/html/static/main.css#L307-L309

This massive left margin doesn't exist any more. It was replaced with a flexbox-based sidebar layout in 135281ed1525db15edd8ebd092aa10aa40df2386.

# `max-width: none`

This rule originated in 7669f04fb0ddc3d71a1fb44dc1c5c00a6564ae99, to override the default, limited line-width that makes sense for prose, but doesn't make sense for code (which typically uses hard-wrapped lines):

https://github.com/rust-lang/rust/blob/7669f04fb0ddc3d71a1fb44dc1c5c00a6564ae99/src/librustdoc/html/static/main.css#L153

This line width limiter isn't applied to the `<div class="content">` node any more. It's been moved to a separate wrapper `<div>` that used to be called `main-inner` (in 135281ed1525db15edd8ebd092aa10aa40df2386) but is now called `width-limiter` (since d7528e2157762fadb9665518fd1e4dee6d6a2809).

21 months agoRollup merge of #101898 - GuillaumeGomez:rm-unused-css, r=notriddle
Michael Howell [Sat, 17 Sep 2022 03:37:16 +0000 (20:37 -0700)]
Rollup merge of #101898 - GuillaumeGomez:rm-unused-css, r=notriddle

Remove some unused CSS rules

Since we now have list of items for the ones on the page, we don't need the CSS rules anymore in the sidebar (`.sidebar a`). As for the `.content` ones, they are used to highlight the items in the page (for definitions and others). Surprisingly enough, `method` and `tymethod` are all replaced with `fnname`.

I also used this opportunity to remove these rules in `ayu.css`:

```css
.stab.unstable {}
h2,
h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {}
```

In the second commit, I removed the `.block a.current*` CSS rules as they're overridden by `.sidebar a.current*` CSS rules.

In the third commit I removed unneeded empty rules (that were there to satisfy the `--check-theme` option).

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

21 months agoRollup merge of #101878 - Rageking8:More-simple-formatting, r=lcnr
Michael Howell [Sat, 17 Sep 2022 03:37:16 +0000 (20:37 -0700)]
Rollup merge of #101878 - Rageking8:More-simple-formatting, r=lcnr

More simple formatting

21 months agoRollup merge of #101782 - JhonnyBillM:refactor-symbol-mangling-diags-migration, r...
Michael Howell [Sat, 17 Sep 2022 03:37:15 +0000 (20:37 -0700)]
Rollup merge of #101782 - JhonnyBillM:refactor-symbol-mangling-diags-migration, r=davidtwco

Update `symbol_mangling` diagnostics migration

Addresses comments raised in #100831.

r? `@eddyb` `@davidtwco`

21 months agoRollup merge of #101741 - andrewpollack:add-needs-unwind-ui-tests, r=tmandry
Michael Howell [Sat, 17 Sep 2022 03:37:15 +0000 (20:37 -0700)]
Rollup merge of #101741 - andrewpollack:add-needs-unwind-ui-tests, r=tmandry

Adding needs-unwind arg to applicable compiler ui tests

Adding `needs-unwind` arg to applicable compiler ui tests

21 months agoRollup merge of #101340 - andrewpollack:fuchsia-zxdb-docs, r=tmandry
Michael Howell [Sat, 17 Sep 2022 03:37:14 +0000 (20:37 -0700)]
Rollup merge of #101340 - andrewpollack:fuchsia-zxdb-docs, r=tmandry

Adding Fuchsia zxdb debugging walkthrough to docs

Adding `zxdb` docs to walkthrough to show debugging steps

21 months agoAuto merge of #98588 - b-naber:valtrees-cleanup, r=lcnr
bors [Sat, 17 Sep 2022 03:04:22 +0000 (03:04 +0000)]
Auto merge of #98588 - b-naber:valtrees-cleanup, r=lcnr

Use only ty::Unevaluated<'tcx, ()> in type system

r? `@lcnr`

21 months agoDon't add rustdoc's CSS to other doc pages
Jacob Hoffman-Andrews [Fri, 16 Sep 2022 23:53:53 +0000 (16:53 -0700)]
Don't add rustdoc's CSS to other doc pages

This was originally added so those doc pages could use the same font
files, but it turns out to be fragile. And those doc pages are just
stubs that link to other pages, so they don't need fancy fonts.

21 months agoImprove handing of env vars during bootstrap process
Chris Wailes [Tue, 13 Sep 2022 23:13:43 +0000 (16:13 -0700)]
Improve handing of env vars during bootstrap process

This CL modifies the handing of env vars during the bootstrap process in
two ways:
1. Replaces '-' characters with '_' characters in target names to
   increase compatibility with different shells
2. Passes Stage0 snapshot compiler related env vars to early invocations
   of Cargo

21 months agoFinal bits
Jack Huey [Fri, 16 Sep 2022 21:43:45 +0000 (17:43 -0400)]
Final bits

21 months agorustdoc: update test case for All Crates page
Michael Howell [Fri, 16 Sep 2022 21:40:24 +0000 (14:40 -0700)]
rustdoc: update test case for All Crates page

21 months agoPass --cfg=bootstrap for rustdoc for proc_macro crates
est31 [Fri, 16 Sep 2022 21:28:02 +0000 (23:28 +0200)]
Pass --cfg=bootstrap for rustdoc for proc_macro crates

This commit does three things:

* First, it passes --cfg=bootstrap on stage 0 for rustdoc
  invocations on proc_macro crates. This mirrors what we
  do already for rustc invocations of those, and is needed
  because cargo doesn't respect RUSTFLAGS or RUSTDOCFLAGS
  when confronted with a proc macro.
* Second, it marks the bootstrap config variable as expected.
  This is needed both on later stages where it's not set,
  but also on stage 0, where it is set.
* Third, it adjusts the comment in the rustc wrapper to better
  reflect the reason why we set the bootstrap variable as
  expected: due to recent changes, setting it as expected
  is also required even if the cfg variable is passed: ebf4cc361e0d0f11a25b42372bd629953365d17e .

21 months agoAdd ExtraConstraintInfo
Jack Huey [Fri, 16 Sep 2022 21:33:12 +0000 (17:33 -0400)]
Add ExtraConstraintInfo

21 months agoAdd AscribeUserTypeProvePredicate
Jack Huey [Fri, 16 Sep 2022 21:20:11 +0000 (17:20 -0400)]
Add AscribeUserTypeProvePredicate

21 months agoAdd outlives_constraint to BlameConstraint
Jack Huey [Fri, 16 Sep 2022 21:08:35 +0000 (17:08 -0400)]
Add outlives_constraint to BlameConstraint

21 months agoAdd to_constraint_category to ObligationCause and SubregionOrigin
Jack Huey [Fri, 16 Sep 2022 21:00:11 +0000 (17:00 -0400)]
Add to_constraint_category to ObligationCause and SubregionOrigin

21 months agorustdoc: clean up CSS for All Items and All Crates lists
Michael Howell [Fri, 16 Sep 2022 20:40:21 +0000 (13:40 -0700)]
rustdoc: clean up CSS for All Items and All Crates lists

This reduces the amount of CSS, and makes these two pages more consistent
(which, necessarily, means changing them a bit).

21 months agoPass ConstraintCategory thorough a few more places
Jack Huey [Fri, 16 Sep 2022 20:44:18 +0000 (16:44 -0400)]
Pass ConstraintCategory thorough a few more places

21 months agoMake QueryOutlivesConstraint contain a ConstraintCategory
Jack Huey [Fri, 16 Sep 2022 20:15:41 +0000 (16:15 -0400)]
Make QueryOutlivesConstraint contain a ConstraintCategory

21 months agoRemove the allow-list for dynamic linking of LLVM tools
Chris Wailes [Tue, 13 Sep 2022 23:06:07 +0000 (16:06 -0700)]
Remove the allow-list for dynamic linking of LLVM tools

This commit removes an allow-list for the dynamic linking of the LLVM
tools and instead relies on the builder's linking preference only.

21 months agoAuto merge of #97800 - pnkfelix:issue-97463-fix-aarch64-call-abi-does-not-zeroext...
bors [Fri, 16 Sep 2022 20:08:05 +0000 (20:08 +0000)]
Auto merge of #97800 - pnkfelix:issue-97463-fix-aarch64-call-abi-does-not-zeroext, r=wesleywiser

Aarch64 call abi does not zeroext (and one cannot assume it does so)

Fix #97463

21 months agodoc: fix redirected link in `/index.html`
Michael Howell [Fri, 16 Sep 2022 19:30:18 +0000 (12:30 -0700)]
doc: fix redirected link in `/index.html`

21 months agoAdding needs-unwind arg to applicable compiler ui tests
Andrew Pollack [Mon, 12 Sep 2022 22:42:04 +0000 (22:42 +0000)]
Adding needs-unwind arg to applicable compiler ui tests

21 months agoAdding Fuchsia zxdb debugging walkthrough to docs
Andrew Pollack [Fri, 2 Sep 2022 19:21:14 +0000 (19:21 +0000)]
Adding Fuchsia zxdb debugging walkthrough to docs

21 months agoAllow using `tinyvec_macros` dependency, which was introduced by newer version of...
Charles Lew [Fri, 16 Sep 2022 18:48:38 +0000 (02:48 +0800)]
Allow using `tinyvec_macros` dependency, which was introduced by newer version of `tinyvec`

21 months agoDocument that ResolvedPath can also be a union
Nixon Enraght-Moony [Fri, 16 Sep 2022 18:45:26 +0000 (19:45 +0100)]
Document that ResolvedPath can also be a union

21 months agoUpdate `unicode-rs` crates to Unicode 15
Charles Lew [Fri, 16 Sep 2022 17:55:56 +0000 (01:55 +0800)]
Update `unicode-rs` crates to Unicode 15

21 months agorustdoc: remove no-op CSS `.source .content { max-width: none }`
Michael Howell [Fri, 16 Sep 2022 17:42:00 +0000 (10:42 -0700)]
rustdoc: remove no-op CSS `.source .content { max-width: none }`

This rule originated in 7669f04fb0ddc3d71a1fb44dc1c5c00a6564ae99, to
override the default, limited line-width that makes sense for prose, but
doesn't make sense for code (which typically uses hard-wrapped lines):

https://github.com/rust-lang/rust/blob/7669f04fb0ddc3d71a1fb44dc1c5c00a6564ae99/src/librustdoc/html/static/main.css#L153

This line width limiter isn't applied to the `<div class="content">` node
any more. It's been moved to a separate wrapper `<div>` that used to be
called `main-inner` (in 135281ed1525db15edd8ebd092aa10aa40df2386) but is
now called `width-limiter` (since
d7528e2157762fadb9665518fd1e4dee6d6a2809).

21 months agorustdoc: remove no-op CSS `.source .content { margin-left: 0 }`
Michael Howell [Fri, 16 Sep 2022 17:41:09 +0000 (10:41 -0700)]
rustdoc: remove no-op CSS `.source .content { margin-left: 0 }`

This rule originated in 7669f04fb0ddc3d71a1fb44dc1c5c00a6564ae99, to
override the default, massive left margin that content used to accommodate
the sidebar:

https://github.com/rust-lang/rust/blob/7669f04fb0ddc3d71a1fb44dc1c5c00a6564ae99/src/librustdoc/html/static/main.css#L307-L309

This massive left margin doesn't exist any more. It was replaced with a
flexbox-based sidebar layout in 135281ed1525db15edd8ebd092aa10aa40df2386.

21 months agofix typo in comment noted by bjorn3.
Felix S. Klock II [Fri, 16 Sep 2022 17:26:58 +0000 (13:26 -0400)]
fix typo in comment noted by bjorn3.

21 months agoDo not run run-make test tied to unix-style `$(CC)` on MSVC host.
Felix S. Klock II [Fri, 16 Sep 2022 17:26:22 +0000 (13:26 -0400)]
Do not run run-make test tied to unix-style `$(CC)` on MSVC host.

21 months agoAuto merge of #101902 - jackh726:revert-static-hrtb-error, r=nikomatsakis
bors [Fri, 16 Sep 2022 16:46:14 +0000 (16:46 +0000)]
Auto merge of #101902 - jackh726:revert-static-hrtb-error, r=nikomatsakis

Partially revert #101433

reverts #101433 to fix #101844

We should get this into the beta cut, since the ICE is getting hit quite a bit.

21 months agoAdd GUI test for links colors
Guillaume Gomez [Fri, 16 Sep 2022 16:22:23 +0000 (18:22 +0200)]
Add GUI test for links colors

21 months agoCreate new CSS variables for links color
Guillaume Gomez [Fri, 16 Sep 2022 15:57:07 +0000 (17:57 +0200)]
Create new CSS variables for links color