]> git.lizzy.rs Git - rust.git/log
rust.git
21 months agoAuto merge of #98840 - cjgillot:span-inline-ctxt, r=wesleywiser
bors [Thu, 22 Sep 2022 17:59:27 +0000 (17:59 +0000)]
Auto merge of #98840 - cjgillot:span-inline-ctxt, r=wesleywiser

Inline SyntaxContext in both encoded span representation.

The current interned representation for spans does not use the `ctxt_or_zero: u16` field.  This PR proposes to use this field to store the `SyntaxContext` of the interned span instead.  When `ctxt_or_zero` and the interned span's `ctxt` don't match, the inlined one takes precedence.

This allows to implement `Span::ctxt` and `Span::with_ctxt` with much less probability to access the interner.  Those functions are used a lot for hygiene, so this may be worth it.

21 months agoAuto merge of #102139 - Dylan-DPC:rollup-ljlipt8, r=Dylan-DPC
bors [Thu, 22 Sep 2022 15:18:35 +0000 (15:18 +0000)]
Auto merge of #102139 - Dylan-DPC:rollup-ljlipt8, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #101598 (Update rustc's information on Android's sanitizers)
 - #102036 (Remove use of `io::ErrorKind::Other` in std)
 - #102037 (Make cycle errors recoverable)
 - #102069 (Skip `Equate` relation in `handle_opaque_type`)
 - #102076 (rustc_transmute: fix big-endian discriminants)
 - #102107 (Add missing space between notable trait tooltip and where clause)
 - #102119 (Fix a typo “pararmeter” in error message)
 - #102131 (Added which number is computed in compute_float.)

Failed merges:

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

21 months agoRollup merge of #102131 - orlp:patch-1, r=thomcc
Dylan DPC [Thu, 22 Sep 2022 12:55:57 +0000 (18:25 +0530)]
Rollup merge of #102131 - orlp:patch-1, r=thomcc

Added which number is computed in compute_float.

The original comment was very elaborate but ultimately did not mention at all what is being computed using parameters `w, q`, only referencing an external article for the algorithm.

21 months agoRollup merge of #102119 - steffahn:fix-pararmeter, r=dtolnay
Dylan DPC [Thu, 22 Sep 2022 12:55:56 +0000 (18:25 +0530)]
Rollup merge of #102119 - steffahn:fix-pararmeter, r=dtolnay

Fix a typo “pararmeter” in error message

Issue reported on IRLO: https://internals.rust-lang.org/t/fixing-a-typo/17427

21 months agoRollup merge of #102107 - Urgau:rustdoc-missing-space-before-where-clause, r=Guillaum...
Dylan DPC [Thu, 22 Sep 2022 12:55:55 +0000 (18:25 +0530)]
Rollup merge of #102107 - Urgau:rustdoc-missing-space-before-where-clause, r=GuillaumeGomez

Add missing space between notable trait tooltip and where clause

This PR add a missing space between the notable trait tooltip and the where clause.

The issue can be seeing on the [BufRead](https://doc.rust-lang.org/nightly/std/io/trait.BufRead.html) page.

Added a simple snapshot regression test in `src/test/rustdoc/where.rs`.

Before:
![image](https://user-images.githubusercontent.com/3616612/191566999-2f80e138-29c9-4f66-8bed-07781cbd9783.png)

After:
![image](https://user-images.githubusercontent.com/3616612/191567025-0ed3f7d4-7cec-4788-901f-5980fc241daa.png)

r? `@GuillaumeGomez`

21 months agoRollup merge of #102076 - cuviper:transmute-discr-endian, r=jackh726
Dylan DPC [Thu, 22 Sep 2022 12:55:54 +0000 (18:25 +0530)]
Rollup merge of #102076 - cuviper:transmute-discr-endian, r=jackh726

rustc_transmute: fix big-endian discriminants

I noticed that some new tests were failing in Fedora on s390x only, which usually means there's a problem with big-endian, and sure enough there's a FIXME(``@jswrenn)`` for that in `rustc_transmute`. This patch implements the appropriate consideration for target endianness, rather than using native (host) endian.

21 months agoRollup merge of #102069 - compiler-errors:no-eq-in-register-opaque, r=oli-obk
Dylan DPC [Thu, 22 Sep 2022 12:55:54 +0000 (18:25 +0530)]
Rollup merge of #102069 - compiler-errors:no-eq-in-register-opaque, r=oli-obk

Skip `Equate` relation in `handle_opaque_type`

r? ``@oli-obk``

21 months agoRollup merge of #102037 - jyn514:normalize-docs, r=lcnr
Dylan DPC [Thu, 22 Sep 2022 12:55:53 +0000 (18:25 +0530)]
Rollup merge of #102037 - jyn514:normalize-docs, r=lcnr

Make cycle errors recoverable

In particular, this allows rustdoc to recover from cycle errors when normalizing associated types for documentation.

In the past, ```@jackh726``` has said we need to be careful about overflow errors: https://github.com/rust-lang/rust/pull/91430#issuecomment-983997013

> Off the top of my head, we definitely should be careful about treating overflow errors the same as
"not implemented for some reason" errors. Otherwise, you could end up with behavior that is
different depending on recursion depth. But, that might be context-dependent.

But cycle errors should be safe to unconditionally report; they don't depend on the recursion depth, they will always be an error whenever they're encountered.

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

r? ```@lcnr``` cc ```@matthewjasper```

21 months agoRollup merge of #102036 - Patiga:remove-io-errorkind-other-use-in-std, r=Mark-Simulacrum
Dylan DPC [Thu, 22 Sep 2022 12:55:52 +0000 (18:25 +0530)]
Rollup merge of #102036 - Patiga:remove-io-errorkind-other-use-in-std, r=Mark-Simulacrum

Remove use of `io::ErrorKind::Other` in std

The documentation states that this `ErrorKind` is not used by the standard library. Instead, `io::ErrorKind::Uncategorized` should be used.

The two instances are in the unstable API [linux_pidfd](https://github.com/rust-lang/rust/issues/82971).

21 months agoRollup merge of #101598 - chriswailes:sanitizers, r=nagisa,eholk
Dylan DPC [Thu, 22 Sep 2022 12:55:51 +0000 (18:25 +0530)]
Rollup merge of #101598 - chriswailes:sanitizers, r=nagisa,eholk

Update rustc's information on Android's sanitizers

This patch updates sanitizer support definitions for Android inside the compiler.  It also adjusts the logic to make sure no pre-built sanitizer runtime libraries are emitted as these are instead provided dynamically on Android targets.

21 months agoAuto merge of #100980 - compiler-errors:normalize-opaque-w-bound-vars, r=lcnr
bors [Thu, 22 Sep 2022 12:47:31 +0000 (12:47 +0000)]
Auto merge of #100980 - compiler-errors:normalize-opaque-w-bound-vars, r=lcnr

Normalize opaques w/ bound vars

First, we reenable normalization of opaque types with escaping late bound regions to fix rust-lang/miri#2433. This essentially reverts #89285.

Second, we mitigate the perf regression found in #88862 by simplifying the way that we relate (sub and eq) GeneratorWitness types.

This relies on the fact that we construct these GeneratorWitness types somewhat particularly (with all free regions found in the witness types replaced with late bound regions) -- but those bound regions really should be treated as existential regions, not universal ones. Those two facts leads me to believe that we do not need to use the full `higher_ranked_sub` machinery to relate two generator witnesses. I'm pretty confident that this is correct, but I'm glad to discuss this further.

21 months agoAuto merge of #102028 - oli-obk:miri_subtree, r=oli-obk
bors [Thu, 22 Sep 2022 09:45:04 +0000 (09:45 +0000)]
Auto merge of #102028 - oli-obk:miri_subtree, r=oli-obk

Make miri a subtree instead of a submodule

r? `@RalfJung`

fixes #101867
fixes https://github.com/rust-lang/rust/issues/100134

21 months agoAdded which number is computed in compute_float.
Orson Peters [Thu, 22 Sep 2022 09:34:42 +0000 (11:34 +0200)]
Added which number is computed in compute_float.

21 months agoAllow miri docs to keep failing for now
Oli Scherer [Thu, 22 Sep 2022 07:17:26 +0000 (07:17 +0000)]
Allow miri docs to keep failing for now

21 months agoAuto merge of #101999 - the8472:source-lines-partition-point, r=davidtwco
bors [Thu, 22 Sep 2022 07:03:42 +0000 (07:03 +0000)]
Auto merge of #101999 - the8472:source-lines-partition-point, r=davidtwco

use partition_point instead of binary_search when looking up source lines

In local benchmarks this results in 0.4% fewer cycles in a critical sequential section when compiling libcore.

21 months agoAuto merge of #100982 - fee1-dead-contrib:const-impl-requires-const-trait, r=oli-obk
bors [Thu, 22 Sep 2022 04:22:24 +0000 (04:22 +0000)]
Auto merge of #100982 - fee1-dead-contrib:const-impl-requires-const-trait, r=oli-obk

Require `#[const_trait]` on `Trait` for `impl const Trait`

r? `@oli-obk`

21 months agoNormalize generator interior type before erasing
Michael Goulet [Mon, 29 Aug 2022 20:09:45 +0000 (20:09 +0000)]
Normalize generator interior type before erasing

21 months agoComment, and bail early if bound vars list differs
Michael Goulet [Mon, 29 Aug 2022 18:23:45 +0000 (18:23 +0000)]
Comment, and bail early if bound vars list differs

21 months agoOptimize subtyping and equation of GeneratorWitness
Michael Goulet [Mon, 29 Aug 2022 07:00:11 +0000 (07:00 +0000)]
Optimize subtyping and equation of GeneratorWitness

21 months agoNormalize opaques with escaping bound vars
Michael Goulet [Thu, 25 Aug 2022 02:08:38 +0000 (02:08 +0000)]
Normalize opaques with escaping bound vars

21 months agoAuto merge of #102121 - JohnTitor:rollup-3fb1wrt, r=JohnTitor
bors [Thu, 22 Sep 2022 01:41:03 +0000 (01:41 +0000)]
Auto merge of #102121 - JohnTitor:rollup-3fb1wrt, r=JohnTitor

Rollup of 12 pull requests

Successful merges:

 - #101952 (Avoid panicking on missing fallback)
 - #102030 (Don't crate-locally reexport walk functions in tidy)
 - #102032 (Adding ignore fuchsia tests for signal interpretation cases)
 - #102033 (Adding needs-unwind to nicer-assert-messages compiler ui tests)
 - #102054 (Unify "all items" page's sidebar with other pages)
 - #102071 (Adding needs-unwind for tests testing memory size of Futures/Closures)
 - #102073 (Adding ignore fuchsia tests for execvp)
 - #102075 (rustdoc: remove no-op CSS `.content > .methods > .method`)
 - #102079 (Update books)
 - #102084 (Adding needs-unwind for test using panic::catch_unwind)
 - #102100 (Prevent usage of .stab elements to create scrollable areas in doc blocks)
 - #102102 (Add doc aliases on Sized trait)

Failed merges:

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

21 months agoRollup merge of #102102 - GuillaumeGomez:doc-aliases-sized-trait, r=thomcc
Yuki Okushi [Thu, 22 Sep 2022 00:03:57 +0000 (09:03 +0900)]
Rollup merge of #102102 - GuillaumeGomez:doc-aliases-sized-trait, r=thomcc

Add doc aliases on Sized trait

Fixes #101267.

It adds both `?` and `?Sized` doc aliases for the `Sized` trait.

Some screenshots of the result:

![Screenshot from 2022-09-21 16-19-55](https://user-images.githubusercontent.com/3050060/191529854-65a79b75-6c20-4fd4-88c2-56d617d1acff.png)
![Screenshot from 2022-09-21 16-20-04](https://user-images.githubusercontent.com/3050060/191529857-2d11b477-5c5d-4080-9382-0b07950fd7f6.png)

21 months agoRollup merge of #102100 - GuillaumeGomez:stab-in-docblocks, r=notriddle
Yuki Okushi [Thu, 22 Sep 2022 00:03:56 +0000 (09:03 +0900)]
Rollup merge of #102100 - GuillaumeGomez:stab-in-docblocks, r=notriddle

Prevent usage of .stab elements to create scrollable areas in doc blocks

Fixes #101874.

You can test it online [here](https://rustdoc.crud.net/imperio/stab-in-doblocks/foo/index.html).

r? `@notriddle`

21 months agoRollup merge of #102084 - andrewpollack:add-issue-panic-unwind, r=bjorn3
Yuki Okushi [Thu, 22 Sep 2022 00:03:56 +0000 (09:03 +0900)]
Rollup merge of #102084 - andrewpollack:add-issue-panic-unwind, r=bjorn3

Adding needs-unwind for test using panic::catch_unwind

Adding needs-unwind for test using panic::catch_unwind

cc. `@djkoloski`

r? `@tmandry`

21 months agoRollup merge of #102079 - ehuss:update-books, r=ehuss
Yuki Okushi [Thu, 22 Sep 2022 00:03:55 +0000 (09:03 +0900)]
Rollup merge of #102079 - ehuss:update-books, r=ehuss

Update books

## nomicon

1 commits in d880e6ac2acf133dce640da24b9fb692844f02d4..f53bfa056929217870a5d2df1366d2e7ba35096d
2022-08-24 12:42:34 -0700 to 2022-09-05 07:19:02 -0700
- Small typo (rust-lang/nomicon#379)

## reference

9 commits in f62e93c28323ed9637d0a205a0c256498674a509..a7cdac33ca7356ad49d5c2b5e2c5010889b33eee
2022-08-28 10:01:28 -0700 to 2022-09-19 17:39:58 -0700
- Clarify wording for references. (rust-lang/reference#1223)
- Update Unicode reference to match rustc implementation (rust-lang/reference#1271)
- Add documentation for raw-dylib and link_ordinal (rust-lang/reference#1244)
- Specify guarantees for repr(rust) structs (rust-lang/reference#1152)
- Classify AsyncBlockExpression as ExpressionWithoutBlock (rust-lang/reference#1268)
- Update closure-expr.md (rust-lang/reference#1269)
- Clarify that 0 is a valid multiple of a type's alignment (rust-lang/reference#1260)
- Remove `ne` from derive example (rust-lang/reference#1264)
- Clarify reference on async blocks (rust-lang/reference#1262)

## book

6 commits in 0a5421ceb238357b3634fb75234eba4d1dad643c..f1e5ad844d0c61738006cdef26227beeb136948e
2022-08-28 19:51:04 -0400 to 2022-09-19 09:48:21 -0400
- Fix punctuation in ch05-02
- Ownership move chapter link fix
- Wrong listing number
- Reword text around box
- `Box<T>` instead of "box"
- Update Clippy output in Appendix D

## rust-by-example

2 commits in 03301f8ae55fa6f20f7ea152a517598e6db2cdb7..767a6bd9727a596d7cfdbaeee475e65b2670ea3a
2022-08-14 08:51:44 -0300 to 2022-09-14 09:17:18 -0300
- struct_visibility.md:  Remove unneeded '#[allow(dead_code)]' (rust-lang/rust-by-example#1609)
- Fix assorted typos (rust-lang/rust-by-example#1601)

## rustc-dev-guide

15 commits in 04892c1a6fc145602ac7367945fda9d4ee83c9fb..f587d6e7cddeaa3cf0a33ec1e368df1a408fa0aa
2022-08-29 20:07:51 +0200 to 2022-09-20 07:43:59 +0900
- Update stability guide to use CURRENT_RUSTC_VERSION (rust-lang/rustc-dev-guide#1468)
- Add a note about building `rust-analyzer-proc-macro-srv` (rust-lang/rustc-dev-guide#1467)
- Link from "implementing to new features" to mcp.md (rust-lang/rustc-dev-guide#1465)
- remove stray **
- Explain the new valtree system for type level constants. (rust-lang/rustc-dev-guide#1097)
- fix typos and formatting
- Say "bootstrap" instead of "rustbuild"; the latter is not explained anywhere and is not much more clear.
- Rewrite the section on passing flags to subcommands
- Remove the diagram of all outputs generated by x.py
- "symbol names" => ABI
- Add symbol-addition to the how-to for new features (rust-lang/rustc-dev-guide#1457)
- Fix typo (rust-lang/rustc-dev-guide#1459)
- Document multipart_suggestion derive on SessionSubdiagnostic
- Add reference for updating Windows PATH and fix typo
- Update for removal of RLS (rust-lang/rustc-dev-guide#1450)

## embedded-book

1 commits in befe6840874311635c417cf731377f07234ee373..4ce51cb7441a6f02b5bf9b07b2eb755c21ab7954
2022-07-25 07:51:14 +0000 to 2022-09-15 08:53:09 +0000
- Create CITATION.bib (as per rust-embedded/book#327)  (rust-embedded/book#329)

21 months agoRollup merge of #102075 - notriddle:notriddle/content-methods-method, r=GuillaumeGomez
Yuki Okushi [Thu, 22 Sep 2022 00:03:55 +0000 (09:03 +0900)]
Rollup merge of #102075 - notriddle:notriddle/content-methods-method, r=GuillaumeGomez

rustdoc: remove no-op CSS `.content > .methods > .method`

# `font-size: 1rem`

This rule was added in 22dad4b0440b184568956c10f2cbedabf763065a, back when the `method` class was attached to headers instead of DIVs that wrap headers.

Old method rendering:

https://github.com/rust-lang/rust/blob/a96247bcac385671757034bd928c13097fd2ce76/src/librustdoc/html/render.rs#L2062

Current method rendering:

https://github.com/rust-lang/rust/blob/432abd86f231c908f6df3cdd779e83f35084be90/src/librustdoc/html/render/print_item.rs#L721

# `position: relative`

This rule was added in 88fe6dfa31a1bee49090dc72c537c5cd7bd632f4 to assist in position the hide/show togges on methods. This is no longer needed, because these toggles are no longer implemented as absolutely positioned links nested inside headers.

21 months agoRollup merge of #102073 - andrewpollack:add-execvp-call-ignore, r=tmandry
Yuki Okushi [Thu, 22 Sep 2022 00:03:54 +0000 (09:03 +0900)]
Rollup merge of #102073 - andrewpollack:add-execvp-call-ignore, r=tmandry

Adding ignore fuchsia tests for execvp

Adding ignore fuchsia tests for execvp

cc. ``@djkoloski``

r? ``@tmandry``

21 months agoRollup merge of #102071 - andrewpollack:add-needs-unwind-for-binary-size, r=tmandry
Yuki Okushi [Thu, 22 Sep 2022 00:03:54 +0000 (09:03 +0900)]
Rollup merge of #102071 - andrewpollack:add-needs-unwind-for-binary-size, r=tmandry

Adding needs-unwind for tests testing memory size of Futures/Closures

Adding needs-unwind for tests testing memory size of Futures/Closures

cc. ``@djkoloski``

r? ``@tmandry``

21 months agoRollup merge of #102054 - GuillaumeGomez:sidebar-all-page, r=notriddle
Yuki Okushi [Thu, 22 Sep 2022 00:03:54 +0000 (09:03 +0900)]
Rollup merge of #102054 - GuillaumeGomez:sidebar-all-page, r=notriddle

Unify "all items" page's sidebar with other pages

Currently, the "all types" page's sidebar doesn't list the different categories of type available. This PR fixes it.

Before:

![Screenshot from 2022-09-20 17-11-15](https://user-images.githubusercontent.com/3050060/191296348-95d8771d-a887-432e-96bd-d5284d87d743.png)

After:

![Screenshot from 2022-09-20 17-11-09](https://user-images.githubusercontent.com/3050060/191296344-8e7318a3-eb51-4037-ae94-7ae2115363ce.png)

r? `@notriddle`

21 months agoRollup merge of #102033 - andrewpollack:add-unwind-on-pretty, r=tmandry
Yuki Okushi [Thu, 22 Sep 2022 00:03:53 +0000 (09:03 +0900)]
Rollup merge of #102033 - andrewpollack:add-unwind-on-pretty, r=tmandry

Adding needs-unwind to nicer-assert-messages compiler ui tests

Tests where unwind is required for asserting on contents of error message

cc. ``@djkoloski``

r? ``@tmandry``

21 months agoRollup merge of #102032 - andrewpollack:bad-signal-compiler-tests, r=tmandry
Yuki Okushi [Thu, 22 Sep 2022 00:03:53 +0000 (09:03 +0900)]
Rollup merge of #102032 - andrewpollack:bad-signal-compiler-tests, r=tmandry

Adding ignore fuchsia tests for signal interpretation cases

Tests where Signal interpreting is required. Since Fuchsia currently does not return signals of type `libc::SIGSEGV` etc., instead, use generalized `!status.success()` case.

cc. `@djkoloski`

r? `@tmandry`

21 months agoRollup merge of #102030 - est31:tidy_walk_no_reexport, r=Mark-Simulacrum
Yuki Okushi [Thu, 22 Sep 2022 00:03:52 +0000 (09:03 +0900)]
Rollup merge of #102030 - est31:tidy_walk_no_reexport, r=Mark-Simulacrum

Don't crate-locally reexport walk functions in tidy

I've moved the walk functions into their own module in #100591 and didn't want to make changing the paths everywhere in tidy part of the PRs diff, so I just reexported the functions locally. This PR removes the crate-local reexport and instead does module level reexports. I'm not sure how much it's worth it and whether the new state is better, idk. Feel free to have any opinion on this.

21 months agoRollup merge of #101952 - Mark-Simulacrum:missing-fallback, r=ehuss
Yuki Okushi [Thu, 22 Sep 2022 00:03:52 +0000 (09:03 +0900)]
Rollup merge of #101952 - Mark-Simulacrum:missing-fallback, r=ehuss

Avoid panicking on missing fallback

This just prints a message but continues on if a fallback is missing, which can happen when we're building a partial set of builders and producing a dev-static build from it (e.g., when no Apple builder runs at all).

Probably the more extensive fix is to allow the build-manifest invoker to specify the expected set of targets & hosts, but that's a far more extensive change. The main risk from this is that we accidentally start falling back to linux docs across all platforms without noticing. I'm not sure that we can do much about that though at this time.

cc `@ehuss` since IIRC you participated in adding this system

This comes up when building a test nightly from a try build, e.g., https://github.com/rust-lang/rust/pull/101855#issuecomment-1250123298. For now I'm going to manually cherry pick this onto that PR for testing purposes.

21 months agoBless test output changes
Frank Steffahn [Wed, 21 Sep 2022 23:32:37 +0000 (01:32 +0200)]
Bless test output changes

21 months agoFix a typo in error message
Frank Steffahn [Wed, 21 Sep 2022 23:28:45 +0000 (01:28 +0200)]
Fix a typo in error message

21 months agoAuto merge of #102106 - djkoloski:sync-from-clippy, r=Manishearth
bors [Wed, 21 Sep 2022 22:59:40 +0000 (22:59 +0000)]
Auto merge of #102106 - djkoloski:sync-from-clippy, r=Manishearth

Update clippy

r? `@Manishearth`

21 months agoAuto merge of #101558 - JhonnyBillM:session-diagnostic-to-diagnostic-handler-refactor...
bors [Wed, 21 Sep 2022 19:58:39 +0000 (19:58 +0000)]
Auto merge of #101558 - JhonnyBillM:session-diagnostic-to-diagnostic-handler-refactor, r=davidtwco

Move and rename `SessionDiagnostic` & `SessionSubdiagnostic` traits and macros

After PR #101434, we want to:
- [x] Move `SessionDiagnostic` to `rustc_errors`.
- [x] Add `emit_` methods that accept `impl SessionDiagnostic` to `Handler`.
- [x] _(optional)_ Rename trait `SessionDiagnostic` to `DiagnosticHandler`.
- [x] _(optional)_ Rename macro `SessionDiagnostic` to `DiagnosticHandler`.
- [x] Update Rustc Dev Guide and Docs to reflect these changes. https://github.com/rust-lang/rustc-dev-guide/pull/1460

Now I am having build issues getting the compiler to build when trying to rename the macro.

<details>
  <summary>See diagnostics errors and context when building.</summary>

```
error: diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
  --> compiler/rustc_attr/src/session_diagnostics.rs:13:10
   |
13 |   #[derive(DiagnosticHandler)]
   |            ^^^^^^^^^^^^^^^^^ in this derive macro expansion
   |
  ::: /Users/jhonny/.cargo/registry/src/github.com-1ecc6299db9ec823/synstructure-0.12.6/src/macros.rs:94:9
   |
94 | /         pub fn $derives(
95 | |             i: $crate::macros::TokenStream
96 | |         ) -> $crate::macros::TokenStream {
   | |________________________________________- in this expansion of `#[derive(DiagnosticHandler)]`
   |
note: the lint level is defined here
  --> compiler/rustc_attr/src/lib.rs:10:9
   |
10 | #![deny(rustc::diagnostic_outside_of_impl)]
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

```

And also this one:

```
error: diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
   --> compiler/rustc_attr/src/session_diagnostics.rs:213:32
    |
213 |         let mut diag = handler.struct_span_err_with_code(
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^
```

> **Note**
> Can't find where this message is coming from, because you can see in [this experimental branch](https://github.com/JhonnyBillM/rust/tree/experimental/trying-to-rename-session-diagnostic-macro)  that I updated all errors and diags to say:
> error: diagnostics should only be created in **`DiagnosticHandler`**/`AddSubdiagnostic` impls
> and not:
> error: diagnostics should only be created in **`SessionDiagnostic`**/`AddSubdiagnostic` impls

</details>

I tried building the compiler in different ways (playing with the stages etc), but nothing worked.

## Question

**Do we need to build or do something different when renaming a macro and identifiers?**

For context, see experimental commit https://github.com/JhonnyBillM/rust/commit/f2193a98b44db3f2af77a878824b152cdf0d34a5 where the macro and symbols are renamed, but it doesn't compile.

21 months agoAuto merge of #102097 - Dylan-DPC:rollup-gc75oh4, r=Dylan-DPC
bors [Wed, 21 Sep 2022 17:17:25 +0000 (17:17 +0000)]
Auto merge of #102097 - Dylan-DPC:rollup-gc75oh4, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #89891 (`alloc`: add unstable cfg features `no_rc` and `no_sync`)
 - #101995 (Add another example for `uN::carrying_mul`)
 - #102031 (Adding ignore fuchsia tests for Backtrace, ErrorKind cases)
 - #102041 (Improve `-Zmeta-stats` some more)
 - #102045 (fix ConstProp handling of written_only_inside_own_block_locals)
 - #102058 (Clarify Path::extension() semantics in docs abstract)
 - #102059 (Use rebind instead of dummy binder in `SameTypeModuloInfer` relation)

Failed merges:

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

21 months agoMerge commit '7248d06384c6a90de58c04c1f46be88821278d8b' into sync-from-clippy
David Koloski [Wed, 21 Sep 2022 17:02:37 +0000 (13:02 -0400)]
Merge commit '7248d06384c6a90de58c04c1f46be88821278d8b' into sync-from-clippy

21 months agoAdd missing space between notable trait tooltip and where clause
Urgau [Wed, 21 Sep 2022 17:01:49 +0000 (19:01 +0200)]
Add missing space between notable trait tooltip and where clause

21 months agoAdding ignore fuchsia tests for signal cases
Andrew Pollack [Mon, 19 Sep 2022 21:02:42 +0000 (21:02 +0000)]
Adding ignore fuchsia tests for signal cases

21 months agoFIX - adopt new Diagnostic naming in newly migrated modules
Jhonny Bill Mena [Thu, 15 Sep 2022 04:01:44 +0000 (00:01 -0400)]
FIX - adopt new Diagnostic naming in newly migrated modules

FIX - ambiguous Diagnostic link in docs

UPDATE - rename diagnostic_items to IntoDiagnostic and AddToDiagnostic

[Gardening] FIX - formatting via `x fmt`

FIX - rebase conflicts. NOTE: Confirm wheather or not we want to handle TargetDataLayoutErrorsWrapper this way

DELETE - unneeded allow attributes in Handler method

FIX - broken test

FIX - Rebase conflict

UPDATE - rename residual _SessionDiagnostic and fix LintDiag link

21 months agoUPDATE - rename SessionSubdiagnostic macro to Subdiagnostic
Jhonny Bill Mena [Sun, 18 Sep 2022 15:47:31 +0000 (11:47 -0400)]
UPDATE - rename SessionSubdiagnostic macro to Subdiagnostic

Also renames:
- sym::AddSubdiagnostic to sym:: Subdiagnostic
- rustc_diagnostic_item = "AddSubdiagnostic" to rustc_diagnostic_item = "Subdiagnostic"

21 months agoUPDATE - rename DiagnosticHandler macro to Diagnostic
Jhonny Bill Mena [Sun, 18 Sep 2022 15:46:56 +0000 (11:46 -0400)]
UPDATE - rename DiagnosticHandler macro to Diagnostic

21 months agoUPDATE - rename AddSubdiagnostic trait to AddToDiagnostic
Jhonny Bill Mena [Sun, 18 Sep 2022 15:46:16 +0000 (11:46 -0400)]
UPDATE - rename AddSubdiagnostic trait to AddToDiagnostic

21 months agoUPDATE - rename DiagnosticHandler trait to IntoDiagnostic
Jhonny Bill Mena [Sun, 18 Sep 2022 15:45:41 +0000 (11:45 -0400)]
UPDATE - rename DiagnosticHandler trait to IntoDiagnostic

21 months agoUPDATE - move SessionDiagnostic from rustc_session to rustc_errors
Jhonny Bill Mena [Wed, 7 Sep 2022 13:36:08 +0000 (09:36 -0400)]
UPDATE - move SessionDiagnostic from rustc_session to rustc_errors

21 months agoRemove unused imports
Oli Scherer [Tue, 20 Sep 2022 07:35:35 +0000 (07:35 +0000)]
Remove unused imports

21 months agoAdd 'src/tools/miri/' from commit '75dd959a3a40eb5b4574f8d2e23aa6efbeb33573'
Oli Scherer [Wed, 21 Sep 2022 15:36:26 +0000 (15:36 +0000)]
Add 'src/tools/miri/' from commit '75dd959a3a40eb5b4574f8d2e23aa6efbeb33573'

git-subtree-dir: src/tools/miri
git-subtree-mainline: 3f3167fb59341ac3240ca1774f48e8c053219131
git-subtree-split: 75dd959a3a40eb5b4574f8d2e23aa6efbeb33573

21 months agomiri is not in toolstate any more
Ralf Jung [Tue, 20 Sep 2022 10:57:42 +0000 (12:57 +0200)]
miri is not in toolstate any more

21 months agoHACK: Treat miri as if it were a submodule
Oli Scherer [Tue, 20 Sep 2022 07:22:54 +0000 (07:22 +0000)]
HACK: Treat miri as if it were a submodule

21 months agoRemove miri from the submodule list and require it for CI to pass
Oli Scherer [Mon, 19 Sep 2022 19:08:02 +0000 (19:08 +0000)]
Remove miri from the submodule list and require it for CI to pass

21 months agoRemove miri submodule
Oli Scherer [Mon, 19 Sep 2022 14:03:23 +0000 (14:03 +0000)]
Remove miri submodule

21 months agoMake error messages great again (and fix clippy and add test)
Deadbeef [Wed, 21 Sep 2022 15:02:15 +0000 (15:02 +0000)]
Make error messages great again (and fix clippy and add test)

21 months agoAdd GUI test for `.stab` elements in docblocks
Guillaume Gomez [Wed, 21 Sep 2022 14:08:54 +0000 (16:08 +0200)]
Add GUI test for `.stab` elements in docblocks

21 months agoAdd doc aliases on Sized trait
Guillaume Gomez [Wed, 21 Sep 2022 14:20:15 +0000 (16:20 +0200)]
Add doc aliases on Sized trait

21 months agoPrevent usage of `.stab` elements to create scrollable areas in doc blocks
Guillaume Gomez [Wed, 21 Sep 2022 14:08:29 +0000 (16:08 +0200)]
Prevent usage of `.stab` elements to create scrollable areas in doc blocks

21 months agoRollup merge of #102059 - compiler-errors:issue-101984, r=jackh726
Dylan DPC [Wed, 21 Sep 2022 13:31:09 +0000 (19:01 +0530)]
Rollup merge of #102059 - compiler-errors:issue-101984, r=jackh726

Use rebind instead of dummy binder in `SameTypeModuloInfer` relation

Lazy binder usage (sorry, my fault) + assertion in `Binder::dummy`

Fixes #101984

21 months agoRollup merge of #102058 - mqudsi:path_extension_docs, r=thomcc
Dylan DPC [Wed, 21 Sep 2022 13:31:09 +0000 (19:01 +0530)]
Rollup merge of #102058 - mqudsi:path_extension_docs, r=thomcc

Clarify Path::extension() semantics in docs abstract

State up-front and center what shape the returned extension will have, without making the user read through the description and examples.

This is a doc-only change. There are no changes to the API contract and the clarification is in line with what was already stated/promised in the existing doc text - just clarified, summarized, and served bright and early.

Rationale: Various frameworks and libraries for different platforms have their different conventions as to whether an "extension" is ".ext" or just "ext" and anyone that's had to deal with this ambiguity in the past is always double- or triple-checking to make sure the function call returns an extension that matches the expected semantics. Offer the answer to this important question right off the bat instead of making them dig to find it.

```@rustbot``` label +A-docs

21 months agoRollup merge of #102045 - RalfJung:const-prop-regression-fix, r=oli-obk
Dylan DPC [Wed, 21 Sep 2022 13:31:08 +0000 (19:01 +0530)]
Rollup merge of #102045 - RalfJung:const-prop-regression-fix, r=oli-obk

fix ConstProp handling of written_only_inside_own_block_locals

Fixes a regression introduced by https://github.com/rust-lang/rust/pull/100239, which adds an early return and thus skips some code in `visit_terminator` that must be run for soundness.

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

21 months agoRollup merge of #102041 - nnethercote:improve-meta-stats, r=bjorn3
Dylan DPC [Wed, 21 Sep 2022 13:31:08 +0000 (19:01 +0530)]
Rollup merge of #102041 - nnethercote:improve-meta-stats, r=bjorn3

Improve `-Zmeta-stats` some more

A follow-up to #97384.

r? ```@bjorn3```

21 months agoRollup merge of #102031 - andrewpollack:compiler-tests-backtrace, r=tmandry
Dylan DPC [Wed, 21 Sep 2022 13:31:07 +0000 (19:01 +0530)]
Rollup merge of #102031 - andrewpollack:compiler-tests-backtrace, r=tmandry

Adding ignore fuchsia tests for Backtrace, ErrorKind cases

Tests where Backtrace parses are required (invalid since Fuchsia backtraces are not symbolized), and test where ErrorKind is not properly translated from a Fuchsia-style to Unix-style error code

cc. ```@djkoloski```

r? ```@tmandry```

21 months agoRollup merge of #101995 - scottmcm:carrying-mul-example, r=Mark-Simulacrum
Dylan DPC [Wed, 21 Sep 2022 13:31:07 +0000 (19:01 +0530)]
Rollup merge of #101995 - scottmcm:carrying-mul-example, r=Mark-Simulacrum

Add another example for `uN::carrying_mul`

The prose talks about doing this, so might as well add a simple code example of it too.

21 months agoRollup merge of #89891 - ojeda:modular-alloc, r=Mark-Simulacrum
Dylan DPC [Wed, 21 Sep 2022 13:31:06 +0000 (19:01 +0530)]
Rollup merge of #89891 - ojeda:modular-alloc, r=Mark-Simulacrum

`alloc`: add unstable cfg features `no_rc` and `no_sync`

In Rust for Linux we are using these to make `alloc` a bit more modular.

See https://github.com/rust-lang/rust/pull/86048 and https://github.com/rust-lang/rust/pull/84266 for similar requests.

Of course, the particular names are not important.

21 months agoAuto merge of #2557 - RalfJung:triple-to-string, r=RalfJung
bors [Wed, 21 Sep 2022 13:26:05 +0000 (13:26 +0000)]
Auto merge of #2557 - RalfJung:triple-to-string, r=RalfJung

remove unnecessary to_string

21 months agoformat > to_string
Ralf Jung [Wed, 21 Sep 2022 13:25:30 +0000 (15:25 +0200)]
format > to_string

21 months agoremove unnecessary to_string
Ralf Jung [Wed, 21 Sep 2022 13:24:06 +0000 (15:24 +0200)]
remove unnecessary to_string

21 months agoAuto merge of #9471 - jplatte:patch-1, r=xFrednet
bors [Wed, 21 Sep 2022 12:56:19 +0000 (12:56 +0000)]
Auto merge of #9471 - jplatte:patch-1, r=xFrednet

Add matches! checking to nonstandard_macro_braces

changelog: Enhancement: [`nonstandard_macro_braces`]: Now includes `matches!()` in the default lint config
  [#9471](https://github.com/rust-lang/rust-clippy/pull/9471)

21 months agoAuto merge of #2555 - oli-obk:libffi-is-unhappy, r=RalfJung
bors [Wed, 21 Sep 2022 12:49:24 +0000 (12:49 +0000)]
Auto merge of #2555 - oli-obk:libffi-is-unhappy, r=RalfJung

Only support libffi on unix for now

21 months agoOnly support libffi on unix for now
Oli Scherer [Wed, 21 Sep 2022 09:49:30 +0000 (09:49 +0000)]
Only support libffi on unix for now

21 months agoAuto merge of #101846 - chenyukang:fix-101793, r=davidtwco
bors [Wed, 21 Sep 2022 12:32:54 +0000 (12:32 +0000)]
Auto merge of #101846 - chenyukang:fix-101793, r=davidtwco

Fix the wording of help msg for bitwise not

Fixes #101793

21 months agoAuto merge of #101329 - QuinnPainter:armv5te-targets, r=nagisa
bors [Wed, 21 Sep 2022 09:36:21 +0000 (09:36 +0000)]
Auto merge of #101329 - QuinnPainter:armv5te-targets, r=nagisa

Add armv5te-none-eabi and thumbv5te-none-eabi targets

Creates two new Tier 3 targets, `armv5te-none-eabi` and `thumbv5te-none-eabi`. They are for the same target architecture (armv5te), but one defaults to the A32 instruction set and the other defaults to T32. Based on the existing `armv4t-none-eabi` and `thumbv4t-none-eabi` targets.

My particular use case for these targets is Nintendo DS homebrew, but they should be usable for any armv5te system.

Going through the Tier 3 target policy:

> A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)

That will be me.

> Targets must use naming consistent with any existing targets.

Naming is consistent with previous targets.

>> Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility.

No ambiguity here.

> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

Doesn't create any legal issues.

>> The target must not introduce license incompatibilities.

This doesn't introduce any new licenses.

>> Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0).

Yep.

>> The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements.

No new license requirements.

>> Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries.

Everything this uses is FOSS, no proprietary required.

> Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.

OK.

>> This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements.

OK.

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.

This is a bare-metal target with only support for `core` (and `alloc`, if the user provides an allocator).

> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary.

Documentation has been added.

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.

OK.

> Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications.

OK.

> Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

This doesn't break any other targets.

>> In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target.

No unnecessary unconditional features here.

21 months agoLint fixes
Oli Scherer [Mon, 19 Sep 2022 22:40:04 +0000 (22:40 +0000)]
Lint fixes

21 months agoAuto merge of #9505 - mikerite:fix-9504-2, r=dswij
bors [Wed, 21 Sep 2022 05:53:36 +0000 (05:53 +0000)]
Auto merge of #9505 - mikerite:fix-9504-2, r=dswij

Fix ICE in `unnecessary_to_owned`

Fixes #9504

Compiler generated call `into_future` nodes return empty substs which we need when checking it's predicates. Handle this by simply exitting when we encounter one. This change introduces false negatives in place of the ICEs.

changelog: [`unnecessary_to_owned`]: fix ICE

21 months agoFix ICE in `unnecessary_to_owned`
Michael Wright [Wed, 21 Sep 2022 05:02:52 +0000 (07:02 +0200)]
Fix ICE in `unnecessary_to_owned`

Fixes #9504

Compiler generated call `into_iter` nodes return empty substs
which we need when checking it's predicates. Handle this by
simply exitting when we encounter one. This change introduces
false negatives in place of the ICEs.

21 months agoAuto merge of #100096 - compiler-errors:fn-return-must-be-sized, r=jackh726
bors [Wed, 21 Sep 2022 04:35:20 +0000 (04:35 +0000)]
Auto merge of #100096 - compiler-errors:fn-return-must-be-sized, r=jackh726

a fn pointer doesn't implement `Fn`/`FnMut`/`FnOnce` if its return type isn't sized

I stumbled upon #83915 which hasn't received much attention recently, and I wanted to revive it since this is one existing soundness hole that seems pretty easy to fix.

I'm not actually sure that the [alternative approach described here](https://github.com/rust-lang/rust/pull/83915#issuecomment-823643322) is sufficient, given the `src/test/ui/function-pointer/unsized-ret.rs` example I provided below. Rebasing the branch mentioned in that comment and testing that UI test, it seems that we actually end up only observing that `str: !Sized` during monomorphization, whereupon we ICE. Even if we were to fix that ICE, ideally we'd be raising an error that a fn pointer is being used badly during _typecheck_ instead of monomorphization, hence adapting the original approach in #83915.

I am happy to close this if people would prefer we rebase the original PR and land that -- I am partly opening to be annoying and get people thinking about this unsoundness again :heart: :smile_cat:

cc: `@estebank` and `@nikomatsakis`
r? types

Here's a link to the thread: https://rust-lang.zulipchat.com/#narrow/stream/144729-t-types/topic/PR.20.2383915/near/235421351 for more context.

21 months agoOverhaul `-Zmeta-stats` output.
Nicholas Nethercote [Tue, 20 Sep 2022 06:08:25 +0000 (16:08 +1000)]
Overhaul `-Zmeta-stats` output.

It's now much more like the `-Zhir-stats` output.
- Each line is preceded with `meta-stats`, which makes the provenance
  clearer and allows filtering of the output.
- Sections are now sorted in reverse order of size.
- Column headings avoid the need to repeat the word "bytes" on every line.
- Long numbers now have `_` separators for easier reading.
- Consistent use of '-' within section labels, rather than a mix of '-',
  '_', and ' '.

The code itself is shorter and easier to read thanks to:
- the `stat` macro, which encapsulates each section's encoding, avoids
  some boilerplate, and removes the need for some low-value comments;
- the `stats` vector, which replaces dozens of local variables.

21 months agoAdding needs-unwind for test using panic::catch_unwind
Andrew Pollack [Wed, 21 Sep 2022 00:54:23 +0000 (00:54 +0000)]
Adding needs-unwind for test using panic::catch_unwind

21 months agoAuto merge of #100214 - scottmcm:strict-range, r=thomcc
bors [Wed, 21 Sep 2022 00:41:33 +0000 (00:41 +0000)]
Auto merge of #100214 - scottmcm:strict-range, r=thomcc

Optimize `array::IntoIter`

`.into_iter()` on arrays was slower than it needed to be (especially compared to slice iterator) since it uses `Range<usize>`, which needs to handle degenerate ranges like `10..4`.

This PR adds an internal `IndexRange` type that's like `Range<usize>` but with a safety invariant that means it doesn't need to worry about those cases -- it only handles `start <= end` -- and thus can give LLVM more information to optimize better.

I added one simple demonstration of the improvement as a codegen test.

(`vec::IntoIter` uses pointers instead of indexes, so doesn't have this problem, but that only works because its elements are boxed.  `array::IntoIter` can't use pointers because that would keep it from being movable.)

21 months agoUpdate books
Eric Huss [Wed, 21 Sep 2022 00:04:55 +0000 (17:04 -0700)]
Update books

21 months agorustdoc: remove no-op `.method { position: relative }`
Michael Howell [Tue, 20 Sep 2022 23:16:17 +0000 (16:16 -0700)]
rustdoc: remove no-op `.method { position: relative }`

This rule was added in 88fe6dfa31a1bee49090dc72c537c5cd7bd632f4 to assist
in position the hide/show togges on methods. This is no longer needed,
because these toggles are no longer implemented as absolutely positioned
links nested inside headers.

21 months agorustdoc: remove no-op `.method { font-size: 1rem }`
Michael Howell [Tue, 20 Sep 2022 23:15:54 +0000 (16:15 -0700)]
rustdoc: remove no-op `.method { font-size: 1rem }`

This rule was added in 22dad4b0440b184568956c10f2cbedabf763065a, back when
the `method` class was attached to headers instead of DIVs that wrap
headers.

Old method rendering:

https://github.com/rust-lang/rust/blob/a96247bcac385671757034bd928c13097fd2ce76/src/librustdoc/html/render.rs#L2062

Current method rendering:

https://github.com/rust-lang/rust/blob/432abd86f231c908f6df3cdd779e83f35084be90/src/librustdoc/html/render/print_item.rs#L721

21 months agoAvoid panicking on missing fallback
Mark Rousskov [Sat, 17 Sep 2022 22:13:59 +0000 (18:13 -0400)]
Avoid panicking on missing fallback

This just prints a message but continues on if a fallback is missing,
which can happen when we're building a partial set of builders and
producing a dev-static build from it (e.g., when no Apple builder runs
at all).

Probably the more extensive fix is to allow the build-manifest invoker
to specify the expected set of targets & hosts, but that's a far more
extensive change. The main risk from this is that we accidentally start
falling back to linux docs across all platforms without noticing. I'm
not sure that we can do much about that though at this time.

21 months agoWrap some long comment lines.
Nicholas Nethercote [Tue, 20 Sep 2022 04:29:14 +0000 (14:29 +1000)]
Wrap some long comment lines.

21 months agoAuto merge of #100581 - joboet:sync_rwlock_everywhere, r=thomcc
bors [Tue, 20 Sep 2022 22:00:08 +0000 (22:00 +0000)]
Auto merge of #100581 - joboet:sync_rwlock_everywhere, r=thomcc

std: use `sync::RwLock` for internal statics

Since `sync::RwLock` is now `const`-constructible, it can be used for internal statics, removing the need for `sys_common::StaticRwLock`. This adds some extra allocations on platforms which need to box their locks (currently SGX and some UNIX), but these will become unnecessary with the lock improvements tracked in #93740.

21 months agoAdding ignore fuchsia tests for execvp
Andrew Pollack [Tue, 20 Sep 2022 21:37:08 +0000 (21:37 +0000)]
Adding ignore fuchsia tests for execvp

21 months agoUnify generation of section on "All items" page with all other pages
Guillaume Gomez [Tue, 20 Sep 2022 21:23:03 +0000 (23:23 +0200)]
Unify generation of section on "All items" page with all other pages

21 months agoUpdate rustc's information on Android's sanitizers
Chris Wailes [Thu, 8 Sep 2022 23:33:44 +0000 (16:33 -0700)]
Update rustc's information on Android's sanitizers

This patch updates sanitizier support definitions for Android inside the
compiler.  It also adjusts the logic to make sure no pre-built sanitizer
runtime libraries are emitted as these are instead provided dynamically
on Android targets.

21 months agoSkip Equate relation in handle_opaque_type
Michael Goulet [Tue, 20 Sep 2022 19:52:56 +0000 (19:52 +0000)]
Skip Equate relation in handle_opaque_type

21 months agorustc_transmute: fix big-endian discriminants
Josh Stone [Tue, 20 Sep 2022 20:03:43 +0000 (13:03 -0700)]
rustc_transmute: fix big-endian discriminants

21 months agoAdding needs-unwind to tests involving changing memory size of Futures/Closures
Andrew Pollack [Tue, 20 Sep 2022 19:46:27 +0000 (19:46 +0000)]
Adding needs-unwind to tests involving changing memory size of Futures/Closures

21 months agoAuto merge of #102061 - notriddle:rollup-kwu9vp8, r=notriddle
bors [Tue, 20 Sep 2022 19:10:11 +0000 (19:10 +0000)]
Auto merge of #102061 - notriddle:rollup-kwu9vp8, r=notriddle

Rollup of 12 pull requests

Successful merges:

 - #100250 (Manually cleanup token stream when macro expansion aborts.)
 - #101014 (Fix -Zmeta-stats ICE by giving `FileEncoder` file read permissions)
 - #101958 (Improve error for when query is unsupported by crate)
 - #101976 (MirPhase: clarify that linting is not a semantic change)
 - #102001 (Use LLVM C-API to build atomic cmpxchg and fence)
 - #102008 (Add GUI test for notable traits element position)
 - #102013 (Simplify rpitit handling on lower_fn_decl)
 - #102021 (some post-valtree cleanup)
 - #102027 (rustdoc: remove `docblock` class from `item-decl`)
 - #102034 (rustdoc: remove no-op CSS `h1-6 { border-bottom-color }`)
 - #102038 (Make the `normalize-overflow` rustdoc test actually do something)
 - #102053 (:arrow_up: rust-analyzer)

Failed merges:

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

21 months agoRollup merge of #102053 - lnicola:rust-analyzer-2022-09-20, r=lnicola
Michael Howell [Tue, 20 Sep 2022 17:13:03 +0000 (10:13 -0700)]
Rollup merge of #102053 - lnicola:rust-analyzer-2022-09-20, r=lnicola

:arrow_up: rust-analyzer

r? ``@ghost``

21 months agoRollup merge of #102038 - jyn514:rustdoc-normalize-test, r=compiler-errors
Michael Howell [Tue, 20 Sep 2022 17:13:02 +0000 (10:13 -0700)]
Rollup merge of #102038 - jyn514:rustdoc-normalize-test, r=compiler-errors

Make the `normalize-overflow` rustdoc test actually do something

Since https://github.com/rust-lang/rust/pull/88679, rustdoc doesn't load crates eagerly. Add an explicit `extern crate` item to make sure the crate is loaded and the bug reproduces.
You can verify this fix by adding `// compile-flags: -Znormalize-docs` and running the test to make sure it gives an error.

21 months agoRollup merge of #102034 - notriddle:notriddle/border-bottom, r=GuillaumeGomez
Michael Howell [Tue, 20 Sep 2022 17:13:02 +0000 (10:13 -0700)]
Rollup merge of #102034 - notriddle:notriddle/border-bottom, r=GuillaumeGomez

rustdoc: remove no-op CSS `h1-6 { border-bottom-color }`

For this rule to have an actual effect, the border-bottom width needs specified, elsewhere, without also specifying the color. This doesn't happen. Ever since 88b137d5fe0cbe28dab4f9af61045c726f831872, every spot where headers get a border assigned to them also assigns the color.

Preview: https://notriddle.com/notriddle-rustdoc-test/border-bottom/rustc_monomorphize/collector/index.html

21 months agoRollup merge of #102027 - notriddle:notriddle/docblock-item-decl, r=GuillaumeGomez
Michael Howell [Tue, 20 Sep 2022 17:13:01 +0000 (10:13 -0700)]
Rollup merge of #102027 - notriddle:notriddle/docblock-item-decl, r=GuillaumeGomez

rustdoc: remove `docblock` class from `item-decl`

This class was originally added in 73b97c7e7c9cfac4dfa4804654b1db6ab687b589 to support hiding and showing the item, because `main.js` went through all `docblock` elements in the DOM and added toggles to them.

https://github.com/rust-lang/rust/blob/73b97c7e7c9cfac4dfa4804654b1db6ab687b589/src/librustdoc/html/static/main.js#L1856-L1867

The `item-decl` is no longer auto-hidden since c96f86de3026f864e78397aff9097e885f2f8fdf removed it.

`item-decl` used to be called `type-decl`: that name was changed in 8b7a2dd4626acf164e1ce8397878b3f5af83d585.

The `docblock` class is no longer used for implementing toggles, since rustdoc switched to using `<details>` elements.

Preview: https://notriddle.com/notriddle-rustdoc-test/docblock-item-decl/rustdoc/clean/types/enum.Type.html

21 months agoRollup merge of #102021 - lcnr:tyConst-fun, r=b-naber,BoxyUwU
Michael Howell [Tue, 20 Sep 2022 17:13:01 +0000 (10:13 -0700)]
Rollup merge of #102021 - lcnr:tyConst-fun, r=b-naber,BoxyUwU

some post-valtree cleanup

r? project-const-generics cc ```@b-naber```

21 months agoRollup merge of #102013 - spastorino:rpitit-lower-fn-decl, r=compiler-errors
Michael Howell [Tue, 20 Sep 2022 17:13:00 +0000 (10:13 -0700)]
Rollup merge of #102013 - spastorino:rpitit-lower-fn-decl, r=compiler-errors

Simplify rpitit handling on lower_fn_decl

r? `````@compiler-errors`````

21 months agoRollup merge of #102008 - GuillaumeGomez:notable-trait-gui-test, r=notriddle
Michael Howell [Tue, 20 Sep 2022 17:12:59 +0000 (10:12 -0700)]
Rollup merge of #102008 - GuillaumeGomez:notable-trait-gui-test, r=notriddle

Add GUI test for notable traits element position

Fixes #101891.

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

21 months agoRollup merge of #102001 - cuviper:build-atomic-capi, r=nikic
Michael Howell [Tue, 20 Sep 2022 17:12:59 +0000 (10:12 -0700)]
Rollup merge of #102001 - cuviper:build-atomic-capi, r=nikic

Use LLVM C-API to build atomic cmpxchg and fence

We don't need C++ wrappers because the LLVM C API can build these.