]> git.lizzy.rs Git - rust.git/log
rust.git
22 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.

22 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

22 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

22 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

22 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

22 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`

22 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

22 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`

22 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`

22 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

22 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

22 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

22 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

22 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.

22 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).

22 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.

22 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!

22 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`

22 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``

22 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.

22 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

22 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>
22 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``

22 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)

22 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)

22 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``

22 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>`]``

22 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``

22 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

22 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.

22 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.)

22 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.

22 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.

22 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.

22 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`

22 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

22 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.

22 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

22 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

22 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

22 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``

22 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.

22 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`.

22 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

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

22 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 .

22 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

22 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).

22 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``

22 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

22 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`

22 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

22 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

22 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`

22 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.

22 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

22 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

22 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 .

22 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).

22 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.

22 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

22 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`

22 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

22 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

22 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`

22 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

22 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

22 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).

22 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.

22 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.

22 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.

22 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.

22 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

22 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

22 months agoRemove unneeded empty ayu CSS rules
Guillaume Gomez [Fri, 16 Sep 2022 14:48:24 +0000 (16:48 +0200)]
Remove unneeded empty ayu CSS rules

22 months agoRemove unused `.block a.current*` rules
Guillaume Gomez [Fri, 16 Sep 2022 14:30:06 +0000 (16:30 +0200)]
Remove unused `.block a.current*` rules

22 months agoRemove some unused CSS rules
Guillaume Gomez [Fri, 16 Sep 2022 12:43:06 +0000 (14:43 +0200)]
Remove some unused CSS rules

22 months agoAdd test for #101844
Jack Huey [Fri, 16 Sep 2022 13:47:37 +0000 (09:47 -0400)]
Add test for #101844

22 months agoRevert "Better errors for implied static bound"
Jack Huey [Fri, 16 Sep 2022 13:47:07 +0000 (09:47 -0400)]
Revert "Better errors for implied static bound"

This reverts commit c75817b0a75d4b6b01ee10900ba5d01d4915e6a8.

22 months agoRevert "Use Predicate ConstraintCategory when normalizing"
Jack Huey [Fri, 16 Sep 2022 13:01:28 +0000 (09:01 -0400)]
Revert "Use Predicate ConstraintCategory when normalizing"

This reverts commit aae37f87632dd74856d55c0cd45d2c192379c990.

22 months agoAuto merge of #101895 - GuillaumeGomez:rollup-ured85q, r=GuillaumeGomez
bors [Fri, 16 Sep 2022 12:43:22 +0000 (12:43 +0000)]
Auto merge of #101895 - GuillaumeGomez:rollup-ured85q, r=GuillaumeGomez

Rollup of 7 pull requests

Successful merges:

 - #101494 (rustdoc mobile: move notable traits to return type)
 - #101813 (Extend CSS check to CSS variables)
 - #101825 (Fix back RPIT changes)
 - #101843 (Suggest associated const for incorrect use of let in traits)
 - #101859 (Slight vertical formatting)
 - #101868 (rustdoc: use more precise URLs for jump-to-definition links)
 - #101877 (rustdoc: remove no-op CSS `.block { padding: 0 }`)

Failed merges:

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

22 months agomore simple formatting
Rageking8 [Fri, 16 Sep 2022 03:46:47 +0000 (11:46 +0800)]
more simple formatting

22 months agoRollup merge of #101877 - notriddle:notriddle/block, r=Dylan-DPC
Guillaume Gomez [Fri, 16 Sep 2022 11:07:19 +0000 (13:07 +0200)]
Rollup merge of #101877 - notriddle:notriddle/block, r=Dylan-DPC

rustdoc: remove no-op CSS `.block { padding: 0 }`

This rule was changed in 8fb1250aba8135679463351a3813c04ae45bf311 from the original version that had a non-zero padding. It's not needed, because it's not overriding anything that would've given `.block` a padding.

22 months agoRollup merge of #101868 - notriddle:notriddle/short-links-jump-to-definition, r=Guill...
Guillaume Gomez [Fri, 16 Sep 2022 11:07:19 +0000 (13:07 +0200)]
Rollup merge of #101868 - notriddle:notriddle/short-links-jump-to-definition, r=GuillaumeGomez

rustdoc: use more precise URLs for jump-to-definition links

As an example, this cuts down <https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/ty/mod.rs.html> by about 11%.

    $ du -h new_mod.rs.html old_mod.rs.html
    296K new_mod.rs.html
    332K old_mod.rs.html

Like https://github.com/rust-lang/rust/pull/83237, but separate code since source links have a different URL structure.

Related to [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/RFC.20for.20.22jump.20to.20definition.22.20feature/near/299029786) and [the jump-to-definition pre-RFC](https://github.com/GuillaumeGomez/rfcs/pull/1).

22 months agoRollup merge of #101859 - Rageking8:slight-vertical-formatting, r=compiler-errors
Guillaume Gomez [Fri, 16 Sep 2022 11:07:18 +0000 (13:07 +0200)]
Rollup merge of #101859 - Rageking8:slight-vertical-formatting, r=compiler-errors

Slight vertical formatting

22 months agoRollup merge of #101843 - chenyukang:fix-101797, r=oli-obk
Guillaume Gomez [Fri, 16 Sep 2022 11:07:18 +0000 (13:07 +0200)]
Rollup merge of #101843 - chenyukang:fix-101797, r=oli-obk

Suggest associated const for incorrect use of let in traits

Fixes #101797

22 months agoRollup merge of #101825 - spastorino:fix-rpit-changes, r=oli-obk
Guillaume Gomez [Fri, 16 Sep 2022 11:07:17 +0000 (13:07 +0200)]
Rollup merge of #101825 - spastorino:fix-rpit-changes, r=oli-obk

Fix back RPIT changes

r? `@oli-obk`

cc `@compiler-errors`

22 months agoRollup merge of #101813 - GuillaumeGomez:check-css-variables, r=notriddle
Guillaume Gomez [Fri, 16 Sep 2022 11:07:17 +0000 (13:07 +0200)]
Rollup merge of #101813 - GuillaumeGomez:check-css-variables, r=notriddle

Extend CSS check to CSS variables

This PR is a bit big because the first commit is a rewrite of the CSS parser to something a bit simpler which still allows to get easily access to CSS properties name.

The other two are about adding tests and adding the CSS variables check.

This check was missing because we are relying more and more on CSS variables rather than CSS selectors in themes.

r? `@notriddle`

22 months agoRollup merge of #101494 - jsha:notable-traits-right, r=GuillaumeGomez
Guillaume Gomez [Fri, 16 Sep 2022 11:07:16 +0000 (13:07 +0200)]
Rollup merge of #101494 - jsha:notable-traits-right, r=GuillaumeGomez

rustdoc mobile: move notable traits to return type

These were originally on the left, but were moved to the return type in c90fb7185a5febb00b7f8ccb49abceacd41bad6e. The CSS rule for mobile did not get updated at the time, so updating it now.

r? `@notriddle`

22 months agoAuto merge of #101860 - oli-obk:information_throwing, r=compiler-errors
bors [Fri, 16 Sep 2022 09:57:32 +0000 (09:57 +0000)]
Auto merge of #101860 - oli-obk:information_throwing, r=compiler-errors

Don't throw away information just to recompute it again

also allows making some functions private.

22 months agobump version to 1.66.0
Pietro Albini [Fri, 16 Sep 2022 08:51:09 +0000 (10:51 +0200)]
bump version to 1.66.0

22 months agoAuto merge of #101882 - Dylan-DPC:rollup-9lxwuwj, r=Dylan-DPC
bors [Fri, 16 Sep 2022 07:14:29 +0000 (07:14 +0000)]
Auto merge of #101882 - Dylan-DPC:rollup-9lxwuwj, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #101722 (Rustdoc-Json: Fix Type docs.)
 - #101738 (Fix `#[link kind="raw-dylib"]` to respect `#[link_name]`)
 - #101753 (Prefer explict closure sig types over expected ones)
 - #101787 (cache `collect_trait_impl_trait_tys`)
 - #101802 (Constify impl Fn* &(mut) Fn*)
 - #101809 (Replace `check_missing_items.py` with `jsondoclint`)
 - #101864 (rustdoc: remove no-op CSS `h1-4 { color: --main-color }`)

Failed merges:

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

22 months agoUse `builder.sysroot(...)` instead of a hack
Maybe Waffle [Fri, 16 Sep 2022 07:10:20 +0000 (11:10 +0400)]
Use `builder.sysroot(...)` instead of a hack

22 months agoRollup merge of #101864 - notriddle:notriddle/h1-h2-h3-h4, r=GuillaumeGomez
Dylan DPC [Fri, 16 Sep 2022 05:47:03 +0000 (11:17 +0530)]
Rollup merge of #101864 - notriddle:notriddle/h1-h2-h3-h4, r=GuillaumeGomez

rustdoc: remove no-op CSS `h1-4 { color: --main-color }`

Headers already inherit the font color they need from their parents.

This rule dates back to earlier versions of the rustdoc theme, where headers and body had different text colors.

https://github.com/rust-lang/rust/blob/68c15be8b5a28297ae58ea030adf49f265e41127/src/librustdoc/html/static/main.css#L72-L98

Nowadays, since the two have exactly the same color (specified by the `--main-color` variable), this rule does nothing.

22 months agoRollup merge of #101809 - aDotInTheVoid:jsondoclint, r=GuillaumeGomez
Dylan DPC [Fri, 16 Sep 2022 05:47:02 +0000 (11:17 +0530)]
Rollup merge of #101809 - aDotInTheVoid:jsondoclint, r=GuillaumeGomez

Replace `check_missing_items.py` with `jsondoclint`

[zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/check_missing_items.2Epy.20Replacement.2E)

check_missing_items.py was a python script that checked rustdoc json output to make sure all the Id's referenced existed in the JSON index. This PR replaces that with a rust binary (`jsondoclint`) that does the same thing.

### Motivation

1. Easier to change when `rustdoc-json-types` changes, as `jsondoclint` uses the types directly.
2. Better Errors:
    - Multiple Errors can be emited for a single crate
    - Errors can say where in JSON they occored
        ```
        2:2889:408 not in index or paths, but refered to at '.index."2:2888:104".inner.items[0]'
        2:2890:410 not in index or paths, but refered to at '.index."2:2888:104".inner.items[1]'
        ```
3. Catches more bugs.
    - Because matches are exaustive, all posible variants considered for enums
    - All Id's checked
    - Has already found #101770, #101199 and #100973
    - Id type is also checked, so the Id's in a structs fields can only be field items.
4. Allows the possibility of running from `rustdoc::json`, which we should do in a crator run at some point.

cc ``@CraftSpider``

r? ``@GuillaumeGomez``

22 months agoRollup merge of #101802 - chriss0612:const_fn_trait_ref_impls, r=fee1-dead
Dylan DPC [Fri, 16 Sep 2022 05:47:02 +0000 (11:17 +0530)]
Rollup merge of #101802 - chriss0612:const_fn_trait_ref_impls, r=fee1-dead

Constify impl Fn* &(mut) Fn*

Tracking Issue: [101803](https://github.com/rust-lang/rust/issues/101803)

Feature gate: `#![feature(const_fn_trait_ref_impls)]`

This feature allows using references to Fn* Items as Fn* Items themself in a const context.

22 months agoRollup merge of #101787 - compiler-errors:cache-rpitit, r=petrochenkov
Dylan DPC [Fri, 16 Sep 2022 05:47:01 +0000 (11:17 +0530)]
Rollup merge of #101787 - compiler-errors:cache-rpitit, r=petrochenkov

cache `collect_trait_impl_trait_tys`

Micro-optimization for RPITITs

22 months agoRollup merge of #101753 - oli-obk:tait_closure_args, r=compiler-errors
Dylan DPC [Fri, 16 Sep 2022 05:47:01 +0000 (11:17 +0530)]
Rollup merge of #101753 - oli-obk:tait_closure_args, r=compiler-errors

Prefer explict closure sig types over expected ones

fixes #100800

Previously we only checked that given closure arguments are equal to expected closure arguments, but now we choose the given closure arguments for the signature that is used when type checking the closure body, and keep the other signature for the type of the closure as seen outside of it.

22 months agoRollup merge of #101738 - dpaoliello:linkname, r=petrochenkov
Dylan DPC [Fri, 16 Sep 2022 05:47:00 +0000 (11:17 +0530)]
Rollup merge of #101738 - dpaoliello:linkname, r=petrochenkov

Fix `#[link kind="raw-dylib"]` to respect `#[link_name]`

Issue Details:
When using `#[link kind="raw-dylib"]` (#58713), the Rust compiler ignored any `#[link_name]` attributes when generating the import library and so the resulting binary would fail to link due to missing symbols.

Fix Details:
Use the name from `#[link_name]` if present when generating the `raw-dylib` import library, otherwise default back to the actual symbol name.

22 months agoRollup merge of #101722 - aDotInTheVoid:rdy-ty-prim-docs, r=CraftSpider
Dylan DPC [Fri, 16 Sep 2022 05:47:00 +0000 (11:17 +0530)]
Rollup merge of #101722 - aDotInTheVoid:rdy-ty-prim-docs, r=CraftSpider

Rustdoc-Json: Fix Type docs.

Primitive doesn't include Array/Slice/Tuple, as they are their own variants.

ResolvedPath doesn't include Traits, as they appear in the DynTrait variant.