]> git.lizzy.rs Git - rust.git/log
rust.git
21 months agoadd actions: write
sashashura [Sun, 4 Sep 2022 16:56:28 +0000 (19:56 +0300)]
add actions: write

21 months agoUpdate ci.yml
Alex [Fri, 2 Sep 2022 16:37:17 +0000 (17:37 +0100)]
Update ci.yml

Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>
21 months agoUpdate ci.yml
Alex [Fri, 2 Sep 2022 15:08:39 +0000 (16:08 +0100)]
Update ci.yml

Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>
21 months agoAuto merge of #101318 - GuillaumeGomez:rollup-qsr51z4, r=GuillaumeGomez
bors [Fri, 2 Sep 2022 10:55:24 +0000 (10:55 +0000)]
Auto merge of #101318 - GuillaumeGomez:rollup-qsr51z4, r=GuillaumeGomez

Rollup of 9 pull requests

Successful merges:

 - #97739 (Uplift the `let_underscore` lints from clippy into rustc.)
 - #99583 (Add additional methods to the Demand type)
 - #100147 (optimization of access level table construction)
 - #100552 (rustc_target: Add a compatibility layer to separate internal and user-facing linker flavors)
 - #100827 (Simplify MIR opt tests)
 - #101166 (Generate error index with mdbook instead of raw HTML pages)
 - #101294 (Fix #100844 rebase accident)
 - #101298 (rustdoc: remove unused CSS `#main-content > .since`)
 - #101304 (Add autolabels for `A-query-system`)

Failed merges:

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

21 months agoRollup merge of #101304 - jyn514:jnelson/tag-query-system, r=Dylan-DPC
Guillaume Gomez [Fri, 2 Sep 2022 09:34:55 +0000 (11:34 +0200)]
Rollup merge of #101304 - jyn514:jnelson/tag-query-system, r=Dylan-DPC

Add autolabels for `A-query-system`

r? `@cjgillot`

21 months agoRollup merge of #101298 - notriddle:notriddle/rustdoc-main-since, r=GuillaumeGomez
Guillaume Gomez [Fri, 2 Sep 2022 09:34:54 +0000 (11:34 +0200)]
Rollup merge of #101298 - notriddle:notriddle/rustdoc-main-since, r=GuillaumeGomez

rustdoc: remove unused CSS `#main-content > .since`

This rule was added (actually, it was called `#main > .since` back then) with cdca0843779eed0b9046e9fee48c91458ad51605 and you can see an example of the bug it's intended to fix in <https://doc.rust-lang.org/1.9.0/std/fmt/fn.write.html> by looking at the `1.0.0` version marker.

However, a5a2f2b951ea982a666eaf52b1874d8f1b17290b changed it so that `<span class="since">` is always placed in an out-of-band wrapper, so it's never nested directly below `#main` / `#main-content` any more.

21 months agoRollup merge of #101294 - Xiretza:fix-100844-accident, r=davidtwco
Guillaume Gomez [Fri, 2 Sep 2022 09:34:53 +0000 (11:34 +0200)]
Rollup merge of #101294 - Xiretza:fix-100844-accident, r=davidtwco

Fix #100844 rebase accident

This undoes the rebase accident in #100844, which accidentally caused #100970 to be reverted.

21 months agoRollup merge of #101166 - GuillaumeGomez:error-index-mdbook, r=notriddle
Guillaume Gomez [Fri, 2 Sep 2022 09:34:51 +0000 (11:34 +0200)]
Rollup merge of #101166 - GuillaumeGomez:error-index-mdbook, r=notriddle

Generate error index with mdbook instead of raw HTML pages

This is a follow-up of https://github.com/rust-lang/rust/pull/100922.

This comes from a remark from ````@estebank```` who said that the search was a nice thing on the previous version and that it wasn't possible anymore. An easy way to come around this limitation was to use `mdbook`, which is what I did here.

Now some explanations on the code. I'll explain how I developed this and why I reached this solution. First I did it very basically by simply setting the source directory and the output directory, generated a `SUMMARY.md` manually which listed all error codes and that was it. Two problems arose from this:
 1. A lot of new HTML files were generated at the top level
 2. An `index.html` file was generated at the top-level (the summary in short).

So for `1.`, it's not great to have too many files at the top-level as it could create file conflicts more easily. And for `2.`, this is actually a huge issue because <doc.rust-lang.org> generates an `index.html` file with a links to a few different resources, so it should never be overwritten. <s>Unfortunately, `mdbook` **always** generates an `index.html` file so the only solution I could see (except for sending them a contribution, I'll maybe do that later) was to temporaly move a potentially existing `index.html` file and then puts it back once done. For this last part, to ensure that we don't return *before* it has been put back, I wrapped the `mdbook` generation code inside `render_html_inner` which is called from `render_html` which in turn handle the "save" of `index.html`.</s>

EDIT: `mdbook` completely deletes ALL the content in the target directory so I instead generate into a sub directory and then I move the files to the real target directory.

To keep compatibility with the old version, I also put the `<script>` ````@notriddle```` nicely provided in the previous PR only into the `error-index.html` file to prevent unneeded repetition. I didn't use `mdbook` `additional-js` option because the JS is included at the end of all HTML files, which we don't want for two reasons:
 1. It's slow.
 2. We only want it to be run in `error-index.html` (even if we also ensure in the JS itself too!).

<s>Now the last part: why we generate the summary twice. We actually generate it once to tell `mdbook` what the book will look like and a second time because a create a new chapter content which will actually list all the error codes (with the updated paths).</s>

EDIT: I removed the need for two summaries.

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

r? ````@notriddle````

21 months agoRollup merge of #100827 - JakobDegen:better-tests, r=wesleywiser
Guillaume Gomez [Fri, 2 Sep 2022 09:34:50 +0000 (11:34 +0200)]
Rollup merge of #100827 - JakobDegen:better-tests, r=wesleywiser

Simplify MIR opt tests

This commit removes many cases of MIR opt tests emitting `.diff`s for more than one pass. These tests cannot be `unit-test`s, and so they are easy to break, and they also provide little value due to having excessively strong opinions over *how* a piece of code should be optimized.

Where reasonable, we instead add separate test files that only emit the `PreCodegen.after` MIR for code where we want to track what the end to end effect of the optimization pipeline on the example code is.

r? `````@wesleywiser`````

21 months agoRollup merge of #100552 - petrochenkov:flavorcompat, r=lqd
Guillaume Gomez [Fri, 2 Sep 2022 09:34:49 +0000 (11:34 +0200)]
Rollup merge of #100552 - petrochenkov:flavorcompat, r=lqd

rustc_target: Add a compatibility layer to separate internal and user-facing linker flavors

I want to do some refactorings in `rustc_target` - merge `lld_flavor` and `linker_is_gnu` into `linker_flavor`, support combination gcc+lld (https://github.com/rust-lang/rust/pull/96827).
This PR adds some compatibility infra that makes that possible without making any changes to user-facing interfaces - `-Clinker-flavor` values and json target specs. (For json target specs this infra may eventually go away since they are not very stable.)

The second commit does some light refactoring of internal linker flavors (applies changes from https://github.com/petrochenkov/rust/commit/53eca42973b7e379b9fa0469c33f08680b57c35f that don't require mass-editing target specs).

21 months agoRollup merge of #100147 - Bryanskiy:private-in-public, r=petrochenkov
Guillaume Gomez [Fri, 2 Sep 2022 09:34:48 +0000 (11:34 +0200)]
Rollup merge of #100147 - Bryanskiy:private-in-public, r=petrochenkov

optimization of access level table construction

Refactoring which was mentioned in #87487

21 months agoRollup merge of #99583 - shepmaster:provider-plus-plus, r=yaahc
Guillaume Gomez [Fri, 2 Sep 2022 09:34:46 +0000 (11:34 +0200)]
Rollup merge of #99583 - shepmaster:provider-plus-plus, r=yaahc

Add additional methods to the Demand type

This adds on to the original tracking issue #96024

r? `````@yaahc`````

21 months agoRollup merge of #97739 - a2aaron:let_underscore, r=estebank
Guillaume Gomez [Fri, 2 Sep 2022 09:34:45 +0000 (11:34 +0200)]
Rollup merge of #97739 - a2aaron:let_underscore, r=estebank

Uplift the `let_underscore` lints from clippy into rustc.

This PR resolves #97241.

This PR adds three lints from clippy--`let_underscore_drop`, `let_underscore_lock`, and `let_underscore_must_use`, which are meant to capture likely-incorrect uses of `let _ = ...` bindings (in particular, doing this on a type with a non-trivial `Drop` causes the `Drop` to occur immediately, instead of at the end of the scope. For a type like `MutexGuard`, this effectively releases the lock immediately, which is almost certainly the wrong behavior)

In porting the lints from clippy I had to copy over a bunch of utility functions from `clippy_util` that these lints also relied upon. Is that the right approach?

Note that I've set the `must_use` and `drop` lints to Allow by default and set `lock` to Deny by default (this matches the same settings that clippy has). In talking with `@estebank` he informed me to do a Crater run (I am not sure what type of Crater run to request here--I think it's just "check only"?)

On the linked issue, there's some discussion about using `must_use` and `Drop` together as a heuristic for when to warn--I did not implement this yet.

r? `@estebank`

21 months agoAuto merge of #100943 - jyn514:query-system-2, r=cjgillot
bors [Fri, 2 Sep 2022 08:28:08 +0000 (08:28 +0000)]
Auto merge of #100943 - jyn514:query-system-2, r=cjgillot

Simplify the `define_query` macro

This moves a bunch of control flow out of the macro into generic functions, leaving the macro just to call the function with a new generic parameter for each query.

It may be possible to improve compile-times / icache by instantiating the generic functions only with the query key, not the query type itself, but I'm going to leave that for a follow-up PR.

Helps with https://github.com/rust-lang/rust/issues/96524.

r? `@cjgillot`

21 months agoSimplify MIR opt tests
Jakob Degen [Sun, 21 Aug 2022 04:47:53 +0000 (21:47 -0700)]
Simplify MIR opt tests

This commit removes many cases of MIR opt tests emitting `.diff`s for more than one pass. These
tests cannot be `unit-test`s, and so they are easy to break, and they also provide little value due
to having excessively strong opinions over *how* a piece of code should be optimized.

Where reasonable, we instead add separate test files that only emit the `PreCodegen.after` MIR for
code where we want to track what the result of the net result of the optimization pipeline's output
is.

21 months agoAuto merge of #100935 - cuviper:upgrade-android-ci, r=Mark-Simulacrum
bors [Fri, 2 Sep 2022 05:32:57 +0000 (05:32 +0000)]
Auto merge of #100935 - cuviper:upgrade-android-ci, r=Mark-Simulacrum

ci: Upgrade android containers from ubuntu:16.04 to 22.04

The main goal of updating to 22.04 is to get away from `llvm.allow-old-toolchain`.
These containers are not building LLVM for android, so only the host version matters.
A side benefit is that they can also use the system `cmake` instead of building one.

21 months agoAuto merge of #100395 - Dylan-DPC:rollup-ajrwo1s, r=Dylan-DPC
bors [Fri, 2 Sep 2022 03:16:32 +0000 (03:16 +0000)]
Auto merge of #100395 - Dylan-DPC:rollup-ajrwo1s, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #92744 (Check if enum from foreign crate has any non exhaustive variants when attempting a cast)
 - #99337 (rustdoc: simplify highlight.rs)
 - #100007 (Never inline Windows dtor access)
 - #100030 (cleanup code w/ pointers in std a little)
 - #100192 ( Remove duplicated temporaries creating during box derefs elaboration)
 - #100247 (Generalize trait object generic param check to aliases.)
 - #100374 (Improve crate selection on rustdoc search results page)

Failed merges:

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

21 months agoAdd autolabels for `A-query-system`
Joshua Nelson [Fri, 2 Sep 2022 01:49:12 +0000 (20:49 -0500)]
Add autolabels for `A-query-system`

21 months agoAuto merge of #101248 - RalfJung:miri, r=RalfJung
bors [Fri, 2 Sep 2022 00:53:50 +0000 (00:53 +0000)]
Auto merge of #101248 - RalfJung:miri, r=RalfJung

update Miri

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

21 months agoDon't create two new closures for each query
Joshua Nelson [Mon, 29 Aug 2022 15:20:14 +0000 (10:20 -0500)]
Don't create two new closures for each query

- Parameterize DepKindStruct over `'tcx`

    This allows passing in an invariant function pointer in `query_callback`,
    rather than having to try and make it work for any lifetime.

- Add a new `execute_query` function to `QueryDescription` so we can call `tcx.$name` without needing to be in a macro context

21 months agoSimplify `try_load_from_on_disk_cache`
Joshua Nelson [Wed, 24 Aug 2022 04:34:23 +0000 (23:34 -0500)]
Simplify `try_load_from_on_disk_cache`

21 months agoMove almost all of the function in `query_callbacks` to a generic function
Joshua Nelson [Wed, 24 Aug 2022 04:31:12 +0000 (23:31 -0500)]
Move almost all of the function in `query_callbacks` to a generic function

21 months agoGet rid of `fn recover`
Joshua Nelson [Wed, 24 Aug 2022 03:49:20 +0000 (22:49 -0500)]
Get rid of `fn recover`

21 months agoMove `force_with_dep_node` outside the giant macro
Joshua Nelson [Wed, 24 Aug 2022 03:24:39 +0000 (22:24 -0500)]
Move `force_with_dep_node` outside the giant macro

21 months agoMove `try_on_disk_cache` out of the giant macro
Joshua Nelson [Wed, 24 Aug 2022 03:10:47 +0000 (22:10 -0500)]
Move `try_on_disk_cache` out of the giant macro

21 months agoGet rid of `make_query` module
Joshua Nelson [Wed, 24 Aug 2022 02:47:59 +0000 (21:47 -0500)]
Get rid of `make_query` module

21 months agorustdoc: remove unused CSS `#main-content > .since`
Michael Howell [Thu, 1 Sep 2022 20:06:24 +0000 (13:06 -0700)]
rustdoc: remove unused CSS `#main-content > .since`

This rule was added (actually, it was called `#main > .since` back then) with
cdca0843779eed0b9046e9fee48c91458ad51605 and you can see an example of the
bug it's intended to fix in <https://doc.rust-lang.org/1.9.0/std/fmt/fn.write.html>
by looking at the `1.0.0` version marker.

However, a5a2f2b951ea982a666eaf52b1874d8f1b17290b changed it so that
`<span class="since">` is always placed in an out-of-band wrapper, so it's
never nested directly below `#main` / `#main-content` any more.

21 months agoAuto merge of #101295 - matthiaskrgr:rollup-046o38p, r=matthiaskrgr
bors [Thu, 1 Sep 2022 22:12:32 +0000 (22:12 +0000)]
Auto merge of #101295 - matthiaskrgr:rollup-046o38p, r=matthiaskrgr

Rollup of 14 pull requests

Successful merges:

 - #94467 (Add `special_module_name` lint)
 - #100852 (Use `getuid` to check instead of `USER` env var in rustbuild)
 - #101072 (bootstrap: Add llvm-has-rust-patches target option)
 - #101190 (Make docs formulation more consistent for NonZero{int})
 - #101245 (Remove unneeded where whitespace)
 - #101251 (Fix  bad target name in Walkthrough)
 - #101254 (rustdoc: remove unused `.docblock .impl-items` CSS)
 - #101256 (Fixes/adjustments to Fuchsia doc walkthrough)
 - #101270 (Update outdated comment about output capturing in print_to.)
 - #101271 (Fix filename of armv4t-none-eabi.md)
 - #101274 (Fix typo in comment)
 - #101279 (Fix doc_auto_cfg for impl blocks in different modules with different `cfg`)
 - #101285 (Do not suggest adding `move` to closure when `move` is already used)
 - #101292 (rustdoc: remove unneeded CSS `.content table td:first-child > a`)

Failed merges:

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

21 months agoupdate Miri
Ralf Jung [Thu, 1 Sep 2022 20:59:05 +0000 (22:59 +0200)]
update Miri

21 months agoRollup merge of #101292 - rust-lang:notriddle/rustdoc-table-first-child, r=GuillaumeGomez
Matthias Krüger [Thu, 1 Sep 2022 19:37:23 +0000 (21:37 +0200)]
Rollup merge of #101292 - rust-lang:notriddle/rustdoc-table-first-child, r=GuillaumeGomez

rustdoc: remove unneeded CSS `.content table td:first-child > a`

This rule was added in c1c6175e62189f8f0e6479bff7bac0e59a95a406 to benefit the module items table. However, the module items table stopped using table tags when 6020c79ddeafe8d9760b27c14c39da81bac9b4a6 switched us over to grid layout.

21 months agoRollup merge of #101285 - TaKO8Ki:do-not-suggest-adding-move-when-closure-is-already...
Matthias Krüger [Thu, 1 Sep 2022 19:37:21 +0000 (21:37 +0200)]
Rollup merge of #101285 - TaKO8Ki:do-not-suggest-adding-move-when-closure-is-already-marked-as-move, r=oli-obk

Do not suggest adding `move` to closure when `move` is already used

Fixes #101227

21 months agoRollup merge of #101279 - GuillaumeGomez:doc_auto_cfg_nested_impl, r=notriddle
Matthias Krüger [Thu, 1 Sep 2022 19:37:20 +0000 (21:37 +0200)]
Rollup merge of #101279 - GuillaumeGomez:doc_auto_cfg_nested_impl, r=notriddle

Fix doc_auto_cfg for impl blocks in different modules with different `cfg`

Fixes #101129.

Just like reexports, impl blocks don't necessarily share the same "space" as the item they implement so we need to merge attributes from its parents as well.

r? `@notriddle`

21 months agoRollup merge of #101274 - aDotInTheVoid:comment-typo, r=TaKO8Ki
Matthias Krüger [Thu, 1 Sep 2022 19:37:19 +0000 (21:37 +0200)]
Rollup merge of #101274 - aDotInTheVoid:comment-typo, r=TaKO8Ki

Fix typo in comment

21 months agoRollup merge of #101271 - QuinnPainter:patch-1, r=Dylan-DPC
Matthias Krüger [Thu, 1 Sep 2022 19:37:17 +0000 (21:37 +0200)]
Rollup merge of #101271 - QuinnPainter:patch-1, r=Dylan-DPC

Fix filename of armv4t-none-eabi.md

The filename differed from the link in SUMMARY.md, causing it to 404.

21 months agoRollup merge of #101270 - m-ou-se:update-comment, r=joshtriplett
Matthias Krüger [Thu, 1 Sep 2022 19:37:16 +0000 (21:37 +0200)]
Rollup merge of #101270 - m-ou-se:update-comment, r=joshtriplett

Update outdated comment about output capturing in print_to.

21 months agoRollup merge of #101256 - andrewpollack:fuchsia-docs-adding, r=tmandry
Matthias Krüger [Thu, 1 Sep 2022 19:37:15 +0000 (21:37 +0200)]
Rollup merge of #101256 - andrewpollack:fuchsia-docs-adding, r=tmandry

Fixes/adjustments to Fuchsia doc walkthrough

Small fixes/adjustments missed during #100927

21 months agoRollup merge of #101254 - rust-lang:notriddle/remove-even-more-css, r=jsha
Matthias Krüger [Thu, 1 Sep 2022 19:37:14 +0000 (21:37 +0200)]
Rollup merge of #101254 - rust-lang:notriddle/remove-even-more-css, r=jsha

rustdoc: remove unused `.docblock .impl-items` CSS

The impl-items list stopped being nested inside a docblock since c1b1d6804bfce1aee3a95b3cbff3eaeb15bad9a4

21 months agoRollup merge of #101251 - diminishedprime:patch-1, r=JohnTitor
Matthias Krüger [Thu, 1 Sep 2022 19:37:12 +0000 (21:37 +0200)]
Rollup merge of #101251 - diminishedprime:patch-1, r=JohnTitor

Fix  bad target name in Walkthrough

Walkthrough currently say:

```
rustup target add aarch_64-fuchsia
```
but should say

```
rustup target add aarch64-fuchsia
```

21 months agoRollup merge of #101245 - GuillaumeGomez:remove-unneeded-where-whitespace, r=notriddle
Matthias Krüger [Thu, 1 Sep 2022 19:37:11 +0000 (21:37 +0200)]
Rollup merge of #101245 - GuillaumeGomez:remove-unneeded-where-whitespace, r=notriddle

Remove unneeded where whitespace

It fixes these two bugs:

![Screenshot from 2022-08-31 18-14-40](https://user-images.githubusercontent.com/3050060/187727950-94657419-abfa-454c-9d27-004280fbcb45.png)
![Screenshot from 2022-08-31 18-14-49](https://user-images.githubusercontent.com/3050060/187727956-21d1b39d-62d7-4e7b-8f6f-631ceda67a19.png)

It's a relic from a very old time (this commit: https://github.com/rust-lang/rust/commit/bfd01b7f40ae2cbfe9acbc1d10e79ffe16870df8).

You can test the result [here](https://rustdoc.crud.net/imperio/remove-unneeded-where-whitespace/lib2/struct.WhereWhitespace.html).

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

21 months agoRollup merge of #101190 - yjhn:patch-1, r=Mark-Simulacrum
Matthias Krüger [Thu, 1 Sep 2022 19:37:10 +0000 (21:37 +0200)]
Rollup merge of #101190 - yjhn:patch-1, r=Mark-Simulacrum

Make docs formulation more consistent for NonZero{int}

Use third person, as it is used for other `std` documentation.

21 months agoRollup merge of #101072 - tmandry:llvm-is-vanilla, r=Mark-Simulacrum
Matthias Krüger [Thu, 1 Sep 2022 19:37:09 +0000 (21:37 +0200)]
Rollup merge of #101072 - tmandry:llvm-is-vanilla, r=Mark-Simulacrum

bootstrap: Add llvm-has-rust-patches target option

This is so you can check out an upstream commit in src/llvm-project and
have everything just work.

This simplifies the logic in `is_rust_llvm` a bit; it doesn't need to
check for download-ci-llvm because we would have already errored if both
that and llvm-config were specified on the host platform.

21 months agoRollup merge of #100852 - Samyak2:samyak/100459, r=Mark-Simulacrum
Matthias Krüger [Thu, 1 Sep 2022 19:37:08 +0000 (21:37 +0200)]
Rollup merge of #100852 - Samyak2:samyak/100459, r=Mark-Simulacrum

Use `getuid` to check instead of `USER` env var in rustbuild

This makes it consistent with `x.py` as changed in #95671

Fixes #100459

21 months agoRollup merge of #94467 - ibraheemdev:master, r=pnkfelix
Matthias Krüger [Thu, 1 Sep 2022 19:37:07 +0000 (21:37 +0200)]
Rollup merge of #94467 - ibraheemdev:master, r=pnkfelix

Add `special_module_name` lint

Declaring `lib` as a module is one of the most common beginner mistakes when trying to setup a binary and library target in the same crate. `special_module_name` lints against it, as well as `mod main;`
```
warning: found module declaration for main.rs
  --> $DIR/special_module_name.rs:4:1
   |
LL | mod main;
   | ^^^^^^^^^
   |
   = note: a binary crate cannot be used as library

warning: found module declaration for lib.rs
  --> $DIR/special_module_name.rs:1:1
   |
LL | mod lib;
   | ^^^^^^^^
   |
   = note: `#[warn(special_module_name)]` on by default
   = note: lib.rs is the root of this crate's library target
   = help: to refer to it from other targets, use the library's name as the path
   ```

Note that the help message is not the best in that it doesn't provide an example of an import path (`the_actual_crate_name::`), and doesn't check whether the current file is part of a library/binary target to provide more specific error messages. I'm not sure where this lint would have to be run to access that information.

21 months agoAuto merge of #98960 - cjgillot:entry-kind, r=estebank
bors [Thu, 1 Sep 2022 19:31:14 +0000 (19:31 +0000)]
Auto merge of #98960 - cjgillot:entry-kind, r=estebank

Remove EntryKind from metadata.

This PR continues the refactor of metadata emission to be more systematic, iterating on definitions and filtering based on each definition's `DefKind`. This allows to remove the large `EntryKind` enum, replaced by linear tables in metadata.

21 months agoAllow deriving multiple subdiagnostics using one SessionSubdiagnostic
Xiretza [Thu, 1 Sep 2022 18:53:59 +0000 (20:53 +0200)]
Allow deriving multiple subdiagnostics using one SessionSubdiagnostic

This reimplements ac638c1, which had to be reverted in the previous
commit because it contains a rebase accident that itself reverted
significant unrelated changes to SessionSubdiagnostic.

21 months agorustdoc: remove unneeded CSS `.content table td:first-child > a`
Michael Howell [Thu, 1 Sep 2022 17:25:23 +0000 (10:25 -0700)]
rustdoc: remove unneeded CSS `.content table td:first-child > a`

This rule was added in c1c6175e62189f8f0e6479bff7bac0e59a95a406 to benefit
the module items table. However, the module items table stopped using table
tags when 6020c79ddeafe8d9760b27c14c39da81bac9b4a6 switched us over to grid
layout.

21 months agoRevert parts of "use derive proc macro to impl SessionDiagnostic"
Xiretza [Thu, 1 Sep 2022 17:42:49 +0000 (19:42 +0200)]
Revert parts of "use derive proc macro to impl SessionDiagnostic"

This reverts parts of commit ac638c1f5fca36484506415319ab254ad522a692.

During rebase, this commit accidentally reverted unrelated changes to
the subdiagnostic derive (those allowing multipart_suggestions to be
derived). This commit reverts all changes to the subdiagnostic code made
in ac638c1f5fc, the next commit will reintroduce the actually intended
changes.

21 months agoAuto merge of #101239 - oli-obk:tracing_cleanup, r=estebank
bors [Thu, 1 Sep 2022 16:25:32 +0000 (16:25 +0000)]
Auto merge of #101239 - oli-obk:tracing_cleanup, r=estebank

Tracing cleanup

r? `@ghost`

21 months agoAdjust stderr file
Oli Scherer [Wed, 31 Aug 2022 14:46:51 +0000 (14:46 +0000)]
Adjust stderr file

21 months agotracing::instrument cleanup
Oli Scherer [Tue, 28 Jun 2022 15:18:07 +0000 (15:18 +0000)]
tracing::instrument cleanup

21 months agoAlways import all tracing macros for the entire crate instead of piecemeal by module
Oli Scherer [Wed, 31 Aug 2022 13:09:26 +0000 (13:09 +0000)]
Always import all tracing macros for the entire crate instead of piecemeal by module

21 months agoDirectly use the `instrument` macro instead of its full path
Oli Scherer [Wed, 31 Aug 2022 13:01:10 +0000 (13:01 +0000)]
Directly use the `instrument` macro instead of its full path

21 months agodo not suggest adding `move` to closure when `move` is already used
Takayuki Maeda [Thu, 1 Sep 2022 14:50:51 +0000 (23:50 +0900)]
do not suggest adding `move` to closure when `move` is already used

21 months agorustc_target: Refactor internal linker flavors slightly
Vadim Petrochenkov [Sun, 14 Aug 2022 21:31:31 +0000 (00:31 +0300)]
rustc_target: Refactor internal linker flavors slightly

Remove one unstable user-facing linker flavor (l4-bender)

21 months agorustc_target: Add a compatibility layer to separate internal and user-facing linker...
Vadim Petrochenkov [Sun, 14 Aug 2022 17:28:34 +0000 (20:28 +0300)]
rustc_target: Add a compatibility layer to separate internal and user-facing linker flavors

21 months agoAuto merge of #100606 - cuviper:upgrade-linux-ci, r=Mark-Simulacrum
bors [Thu, 1 Sep 2022 13:21:03 +0000 (13:21 +0000)]
Auto merge of #100606 - cuviper:upgrade-linux-ci, r=Mark-Simulacrum

ci: Upgrade non-dist Linux testers from ubuntu:16.04 to 22.04

The main goal of updating to 22.04 is to get away from `llvm.allow-old-toolchain`.
A side benefit is that they can also use the system `cmake` instead of building one.

21 months agoAdd regression test for #101129
Guillaume Gomez [Thu, 1 Sep 2022 12:31:41 +0000 (14:31 +0200)]
Add regression test for #101129

21 months agoCorrectly merge impl block cfg attributes with its parents
Guillaume Gomez [Thu, 1 Sep 2022 12:31:27 +0000 (14:31 +0200)]
Correctly merge impl block cfg attributes with its parents

21 months agoMove error code book into a sub folder
Guillaume Gomez [Wed, 31 Aug 2022 19:00:05 +0000 (21:00 +0200)]
Move error code book into a sub folder

21 months agoFix typo in comment
Nixon Enraght-Moony [Thu, 1 Sep 2022 11:09:42 +0000 (12:09 +0100)]
Fix typo in comment

21 months agoAuto merge of #100958 - mikebenfield:workaround, r=nikic
bors [Thu, 1 Sep 2022 10:30:10 +0000 (10:30 +0000)]
Auto merge of #100958 - mikebenfield:workaround, r=nikic

compiler/rustc_codegen_ssa/src/mir/place.rs: Remove LLVM bug workaround

This memset was inserted as a workaround to Rust issue #34427, which was
an LLVM bug that apparently no longer manifests.

21 months agoFix filename of armv4t-none-eabi.md
Quinn Painter [Thu, 1 Sep 2022 09:23:15 +0000 (10:23 +0100)]
Fix filename of armv4t-none-eabi.md

The filename differed from the link in SUMMARY.md, causing it to 404.

21 months agoUpdate outdated comment about output capturing in print_to.
Mara Bos [Thu, 1 Sep 2022 09:20:08 +0000 (11:20 +0200)]
Update outdated comment about output capturing in print_to.

21 months agoAuto merge of #100869 - nnethercote:replace-ThinVec, r=spastorino
bors [Thu, 1 Sep 2022 08:01:06 +0000 (08:01 +0000)]
Auto merge of #100869 - nnethercote:replace-ThinVec, r=spastorino

Replace `rustc_data_structures::thin_vec::ThinVec` with `thin_vec::ThinVec`

`rustc_data_structures::thin_vec::ThinVec` looks like this:
```
pub struct ThinVec<T>(Option<Box<Vec<T>>>);
```
It's just a zero word if the vector is empty, but requires two
allocations if it is non-empty. So it's only usable in cases where the
vector is empty most of the time.

This commit removes it in favour of `thin_vec::ThinVec`, which is also
word-sized, but stores the length and capacity in the same allocation as
the elements. It's good in a wider variety of situation, e.g. in enum
variants where the vector is usually/always non-empty.

The commit also:
- Sorts some `Cargo.toml` dependency lists, to make additions easier.
- Sorts some `use` item lists, to make additions easier.
- Changes `clean_trait_ref_with_bindings` to take a
  `ThinVec<TypeBinding>` rather than a `&[TypeBinding]`, because this
  avoid some unnecessary allocations.

r? `@spastorino`

21 months agoAuto merge of #100707 - dzvon:fix-typo, r=davidtwco
bors [Thu, 1 Sep 2022 05:39:58 +0000 (05:39 +0000)]
Auto merge of #100707 - dzvon:fix-typo, r=davidtwco

Fix a bunch of typo

This PR will fix some typos detected by [typos].

I only picked the ones I was sure were spelling errors to fix, mostly in
the comments.

[typos]: https://github.com/crate-ci/typos

21 months agoAuto merge of #100537 - petrochenkov:piccheck, r=oli-obk
bors [Thu, 1 Sep 2022 03:13:46 +0000 (03:13 +0000)]
Auto merge of #100537 - petrochenkov:piccheck, r=oli-obk

rustc_target: Add some more target spec sanity checking

21 months agoTweaks to fuchsia doc walkthrough
Andrew Pollack [Wed, 31 Aug 2022 23:49:48 +0000 (23:49 +0000)]
Tweaks to fuchsia doc walkthrough

21 months agoAuto merge of #100210 - mystor:proc_macro_diag_struct, r=eddyb
bors [Thu, 1 Sep 2022 00:26:53 +0000 (00:26 +0000)]
Auto merge of #100210 - mystor:proc_macro_diag_struct, r=eddyb

proc_macro/bridge: send diagnostics over the bridge as a struct

This removes some RPC when creating and emitting diagnostics, and
simplifies the bridge slightly.

After this change, there are no remaining methods which take advantage
of the support for `&mut` references to objects in the store as
arguments, meaning that support for them could technically be removed if
we wanted. The only remaining uses of immutable references into the
store are `TokenStream` and `SourceFile`.

r? `@eddyb`

21 months agorustdoc: remove unused `.docblock .impl-items` CSS
Michael Howell [Wed, 31 Aug 2022 17:06:48 +0000 (10:06 -0700)]
rustdoc: remove unused `.docblock .impl-items` CSS

The impl-items list stopped being nested inside a docblock since c1b1d6804bfce1aee3a95b3cbff3eaeb15bad9a4

21 months agoAuto merge of #101249 - matthiaskrgr:rollup-wahnoz8, r=matthiaskrgr
bors [Wed, 31 Aug 2022 21:45:18 +0000 (21:45 +0000)]
Auto merge of #101249 - matthiaskrgr:rollup-wahnoz8, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - #100787 (Pretty printing give proper error message without panic)
 - #100838 (Suggest moving redundant generic args of an assoc fn to its trait)
 - #100844 (migrate rustc_query_system to use SessionDiagnostic)
 - #101140 (Update Clippy)
 - #101161 (Fix uintended diagnostic caused by `drain(..)`)
 - #101165 (Use more `into_iter` rather than `drain(..)`)
 - #101229 (Link “? operator” to relevant chapter in The Book)
 - #101230 (lint: avoid linting diag functions with diag lints)
 - #101236 (Avoid needless buffer zeroing in `std::sys::windows::fs`)
 - #101240 (Fix a typo on `wasm64-unknown-unknown` doc)

Failed merges:

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

21 months agoFix bad target name in Walkthrough
Matt Hamrick [Wed, 31 Aug 2022 20:21:47 +0000 (13:21 -0700)]
Fix  bad target name in Walkthrough

Walkthrough currently say:

```
rustup target add aarch_64-fuchsia
```
but should say

```
rustup target add aarch64-fuchsia
```

21 months agoRollup merge of #101240 - JohnTitor:JohnTitor-patch-1, r=ehuss
Matthias Krüger [Wed, 31 Aug 2022 19:30:18 +0000 (21:30 +0200)]
Rollup merge of #101240 - JohnTitor:JohnTitor-patch-1, r=ehuss

Fix a typo on `wasm64-unknown-unknown` doc

21 months agoRollup merge of #101236 - thomcc:winfs-nozero, r=ChrisDenton
Matthias Krüger [Wed, 31 Aug 2022 19:30:17 +0000 (21:30 +0200)]
Rollup merge of #101236 - thomcc:winfs-nozero, r=ChrisDenton

Avoid needless buffer zeroing in `std::sys::windows::fs`

Followup to https://github.com/rust-lang/rust/pull/101171 and https://github.com/rust-lang/rust/pull/101193. This finishes up avoiding buffer zeroing pointed out in https://github.com/rust-lang/rust/pull/100729#issuecomment-1220055311 (thanks!)

r? `@ChrisDenton`

21 months agoRollup merge of #101230 - davidtwco:translation-internal-lint-no-self-lint, r=fee1...
Matthias Krüger [Wed, 31 Aug 2022 19:30:16 +0000 (21:30 +0200)]
Rollup merge of #101230 - davidtwco:translation-internal-lint-no-self-lint, r=fee1-dead

lint: avoid linting diag functions with diag lints

Functions annotated with `#[rustc_lint_diagnostics]` are used by the diagnostic migration lints to know when to lint, but functions that are annotated with this attribute shouldn't themselves be linted.

cc #100717 https://github.com/rust-lang/rust/pull/101041#discussion_r959303706

21 months agoRollup merge of #101229 - mgeisler:link-try-operator, r=thomcc
Matthias Krüger [Wed, 31 Aug 2022 19:30:15 +0000 (21:30 +0200)]
Rollup merge of #101229 - mgeisler:link-try-operator, r=thomcc

Link “? operator” to relevant chapter in The Book

Before, the text simply asked people to use a symbol which is hard to
search for. Now the text links back to the chapter on error
propagation in The Book. That should help people find the relevant
keywords for further searches.

21 months agoRollup merge of #101165 - ldm0:drain_to_iter, r=cjgillot
Matthias Krüger [Wed, 31 Aug 2022 19:30:13 +0000 (21:30 +0200)]
Rollup merge of #101165 - ldm0:drain_to_iter, r=cjgillot

Use more `into_iter` rather than `drain(..)`

Clearer semantic.

21 months agoRollup merge of #101161 - ldm0:ldm_fix_diagnostic, r=cjgillot
Matthias Krüger [Wed, 31 Aug 2022 19:30:12 +0000 (21:30 +0200)]
Rollup merge of #101161 - ldm0:ldm_fix_diagnostic, r=cjgillot

Fix uintended diagnostic caused by `drain(..)`

Calling `drain(..)` makes later `suggestable_variants.is_empty()` always true, which makes the diagnostics unintended.

21 months agoRollup merge of #101140 - Jarcho:clippyup, r=Jarcho
Matthias Krüger [Wed, 31 Aug 2022 19:30:11 +0000 (21:30 +0200)]
Rollup merge of #101140 - Jarcho:clippyup, r=Jarcho

Update Clippy

r? ```@Manishearth```

21 months agoRollup merge of #100844 - evopen:migrate-diag, r=davidtwco
Matthias Krüger [Wed, 31 Aug 2022 19:30:09 +0000 (21:30 +0200)]
Rollup merge of #100844 - evopen:migrate-diag, r=davidtwco

migrate rustc_query_system to use SessionDiagnostic

issues:
* variable list is not supported in fluent
* ~~cannot have two sub diagnostic with the same tag (eg. 2 .note or 2 .help)~~

allow multiple tag with SessionSubdiagnostic derive

21 months agoRollup merge of #100838 - hkmatsumoto:move-gen-args-to-trait-when-appropriate, r...
Matthias Krüger [Wed, 31 Aug 2022 19:30:08 +0000 (21:30 +0200)]
Rollup merge of #100838 - hkmatsumoto:move-gen-args-to-trait-when-appropriate, r=davidtwco

Suggest moving redundant generic args of an assoc fn to its trait

Closes #89064

21 months agoRollup merge of #100787 - chenyukang:fix-100770-pretty-crash, r=petrochenkov
Matthias Krüger [Wed, 31 Aug 2022 19:30:07 +0000 (21:30 +0200)]
Rollup merge of #100787 - chenyukang:fix-100770-pretty-crash, r=petrochenkov

Pretty printing give proper error message without panic

Fixes #100770

21 months agoAuto merge of #100085 - RalfJung:op-ty-len, r=oli-obk
bors [Wed, 31 Aug 2022 18:42:49 +0000 (18:42 +0000)]
Auto merge of #100085 - RalfJung:op-ty-len, r=oli-obk

interpret: use new OpTy::len for Len rvalue

This avoids a `force_allocation`.

21 months agoGenerate error index with mdbook instead of raw HTML pages
Guillaume Gomez [Mon, 29 Aug 2022 16:05:21 +0000 (18:05 +0200)]
Generate error index with mdbook instead of raw HTML pages

21 months agoAdd rustdoc GUI test
Guillaume Gomez [Wed, 31 Aug 2022 16:13:59 +0000 (18:13 +0200)]
Add rustdoc GUI test

21 months agoUpdate rustdoc tests
Guillaume Gomez [Wed, 31 Aug 2022 15:05:46 +0000 (17:05 +0200)]
Update rustdoc tests

21 months agoRemove unneeded extra whitespace before where clause
Guillaume Gomez [Wed, 31 Aug 2022 15:05:38 +0000 (17:05 +0200)]
Remove unneeded extra whitespace before where clause

21 months agoUse `CountIsStart` in clippy
Jason Newcomb [Wed, 31 Aug 2022 13:33:32 +0000 (09:33 -0400)]
Use `CountIsStart` in clippy

21 months agoFix a typo on `wasm64-unknown-unknown` doc
Yuki Okushi [Wed, 31 Aug 2022 13:27:37 +0000 (22:27 +0900)]
Fix a typo on `wasm64-unknown-unknown` doc

21 months agoMerge commit 'f51aade56f93175dde89177a92e3669ebd8e7592' into clippyup
Jason Newcomb [Wed, 31 Aug 2022 13:24:45 +0000 (09:24 -0400)]
Merge commit 'f51aade56f93175dde89177a92e3669ebd8e7592' into clippyup

21 months agofix a clippy test
Ralf Jung [Wed, 31 Aug 2022 13:24:40 +0000 (15:24 +0200)]
fix a clippy test

21 months agointerpret: use new OpTy::len for Len rvalue
Ralf Jung [Wed, 3 Aug 2022 00:52:15 +0000 (20:52 -0400)]
interpret: use new OpTy::len for Len rvalue

This avoids a `force_allocation`

21 months agoAuto merge of #101238 - RalfJung:rollup-bzcmobj, r=RalfJung
bors [Wed, 31 Aug 2022 13:01:38 +0000 (13:01 +0000)]
Auto merge of #101238 - RalfJung:rollup-bzcmobj, r=RalfJung

Rollup of 7 pull requests

Successful merges:

 - #90946 (Ignore `reference`s in "Type::inner_def_id")
 - #100730 (Migrate rustc_monomorphize to use SessionDiagnostic)
 - #100753 (translations(rustc_session): migrates `rustc_session` to use `SessionDiagnostic` - Pt. 1)
 - #100831 (Migrate `symbol_mangling` module to new diagnostics structs)
 - #101204 (rustdoc: Resugar async fn return type in `clean`, not `html`)
 - #101216 (Use in-page links for sanitizer docs.)
 - #101237 (fix into_iter on ZST)

Failed merges:

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

21 months agolint: avoid linting diag functions with diag lints
David Wood [Wed, 31 Aug 2022 11:06:22 +0000 (12:06 +0100)]
lint: avoid linting diag functions with diag lints

Functions annotated with `#[rustc_lint_diagnostics]` are used by the
diagnostic migration lints to know when to lint, but functions that are
annotated with this attribute shouldn't themselves be linted.

Signed-off-by: David Wood <david.wood@huawei.com>
21 months agoRollup merge of #101237 - RalfJung:into-iter-zst, r=thomcc
Ralf Jung [Wed, 31 Aug 2022 12:29:55 +0000 (14:29 +0200)]
Rollup merge of #101237 - RalfJung:into-iter-zst, r=thomcc

fix into_iter on ZST

Fixes https://github.com/rust-lang/rust/issues/101235
Thanks to `@ChrisDenton` for [spotting the problem](https://github.com/rust-lang/rust/pull/100819#pullrequestreview-1091755930).

21 months agoRollup merge of #101216 - ehuss:sanitizer-links, r=JohnTitor
Ralf Jung [Wed, 31 Aug 2022 12:29:54 +0000 (14:29 +0200)]
Rollup merge of #101216 - ehuss:sanitizer-links, r=JohnTitor

Use in-page links for sanitizer docs.

This updates the sanitizer documentation page so that the links in the summary at the top jump to the relevant sections within the page instead of leading away to a different site. I think this makes it a little easier to navigate this page which has gotten quite long.

This also fixes the broken link for MemTagSanitizer which was not defined.  It also adds MemTagSanitizer to the external summary list at the bottom of the page.

21 months agoRollup merge of #101204 - aDotInTheVoid:async-resugar-in-clean, r=GuillaumeGomez
Ralf Jung [Wed, 31 Aug 2022 12:29:54 +0000 (14:29 +0200)]
Rollup merge of #101204 - aDotInTheVoid:async-resugar-in-clean, r=GuillaumeGomez

rustdoc: Resugar async fn return type in `clean`, not `html`

This way it also happens for json output.

Fixes #101199

r? ``@GuillaumeGomez``

21 months agoRollup merge of #100831 - JhonnyBillM:migrate-symbol-mangling-to-diagnostics-structs...
Ralf Jung [Wed, 31 Aug 2022 12:29:53 +0000 (14:29 +0200)]
Rollup merge of #100831 - JhonnyBillM:migrate-symbol-mangling-to-diagnostics-structs, r=davidtwco

Migrate `symbol_mangling` module to new diagnostics structs

21 months agoRollup merge of #100753 - LuisCardosoOliveira:translation-migrate-session, r=davidtwco
Ralf Jung [Wed, 31 Aug 2022 12:29:52 +0000 (14:29 +0200)]
Rollup merge of #100753 - LuisCardosoOliveira:translation-migrate-session, r=davidtwco

translations(rustc_session): migrates `rustc_session` to use `SessionDiagnostic` - Pt. 1

## Description

This is the first PR for the migration of the module `rustc_session`. You can follow my progress [here](https://github.com/rust-lang/rust/issues/100717#issuecomment-1220279883).

The PR migrates the files `cgu_reuse_tracker` and `parse.rs` to use `SessionDiagnostic `.

21 months agoRollup merge of #100730 - CleanCut:diagnostics-rustc_monomorphize, r=davidtwco
Ralf Jung [Wed, 31 Aug 2022 12:29:51 +0000 (14:29 +0200)]
Rollup merge of #100730 - CleanCut:diagnostics-rustc_monomorphize, r=davidtwco

Migrate rustc_monomorphize to use SessionDiagnostic

### Description

- Migrates diagnostics in `rustc_monomorphize` to use `SessionDiagnostic`
- Adds an `impl IntoDiagnosticArg for PathBuf`

### TODO / Help!
- [x] I'm having trouble figuring out how to apply an optional note. 😕  Help!?
  - Resolved. It was bad docs. Fixed in https://github.com/rust-lang/rustc-dev-guide/pull/1437/files
- [x] `errors:RecursionLimit` should be `#[fatal ...]`, but that doesn't exist so it's `#[error ...]` at the moment.
  - Maybe I can switch after this is merged in? --> https://github.com/rust-lang/rust/pull/100694
  - Or maybe I need to manually implement `SessionDiagnostic` instead of deriving it?
- [x] How does one go about converting an error inside of [a call to struct_span_lint_hir](https://github.com/rust-lang/rust/blob/8064a495086c2e63c0ef77e8e82fe3b9b5dc535f/compiler/rustc_monomorphize/src/collector.rs#L917-L927)?
- [x] ~What placeholder do you use in the fluent template to refer to the value in a vector? It seems like [this code](https://github.com/rust-lang/rust/blob/0b79f758c9aa6646606662a6d623a0752286cd17/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs#L83-L114) ought to have the answer (or something near it)...but I can't figure it out.~ You can't. Punted.

21 months agoRollup merge of #90946 - GuillaumeGomez:def-id-remove-weird-case, r=Manishearth
Ralf Jung [Wed, 31 Aug 2022 12:29:51 +0000 (14:29 +0200)]
Rollup merge of #90946 - GuillaumeGomez:def-id-remove-weird-case, r=Manishearth

Ignore `reference`s in "Type::inner_def_id"

Fixes #90775.

Reopening of #90726.

As discussed on [zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/rendering.20for.20reference.20primitive.20doc.20page), the reference page shouldn't list these implementations (since they are listed on the types and on the traits in any case). And more generally, you don't implement something on a reference but on something behind a reference. I think it's the important point.

So currently it looks like this:

![Screenshot from 2021-11-16 10-20-41](https://user-images.githubusercontent.com/3050060/141957799-57aeadc5-41f8-45f6-a4a5-33b1eca6a500.png)

With this PR, only the implementations over generics behind a reference are kept.

You can test it [here](https://rustdoc.crud.net/imperio/def-id-remove-weird-case/std/primitive.reference.html).

cc ``@camelid``