]> git.lizzy.rs Git - rust.git/log
rust.git
21 months agoRevert "fix #101691: copy stage0 binaries into stage0-sysroot"
Mark Rousskov [Sat, 17 Sep 2022 15:03:40 +0000 (11:03 -0400)]
Revert "fix #101691: copy stage0 binaries into stage0-sysroot"

This reverts commit 32f8eb2fee4d6781a79052b560abd10e12ebb34f.

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

Rollup of 6 pull requests

Successful merges:

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

Failed merges:

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

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

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

A very minor typo fix.

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

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

Fallout from #101166

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

Disallow defaults on type GATs

Fixes #99205

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

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

Fixes #101755

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

Implement simd_as for pointers

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

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

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

Stabilize `let else`

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

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

closes #87335 (`let else` tracking issue)

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

----------

## Stabilization report

### Summary

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

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

### Differences from the RFC / Desugaring

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

### Test cases

In chronological order as they were merged.

Added by df9a2e0687895731e12f4a2651e8d70acd08872d (#87688):

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

Added by 5b95df4bdc330f34213812ad65cae86ced90d80c (#87688):

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

Added by bf7c32a4477a76bfd18fdcd8f45a939cbed82d34 (#89965):

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

Added by 856541963ce95ef4f7d4a81784bb5002ccf63c93 (#89974):

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

Added by 9b45713b6c1775f0103a1ebee6ab7c6d9b781a21:

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

Added by 61bcd8d3075471b3867428788c49f54fffe53f52 (#89841):

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

Added by 102b9125e1cefbb8ed8408d2db3f9f7d5afddbf0 (#89841):

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

Added by 2715c5f984fda7faa156d1c9cf91aa4934f0e00f (#89841):

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

Added by fec8a507a27de1b08a0b95592dc8ec93bf0a321a (#89841):

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

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

Added by 76ea56667703ac06689ff1d6fba5d170fa7392a7 (#94211):

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

Added by e7730dcb7eb29a10ee73f269f4dc6e9d606db0da (#94208):

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

Added by 5bd71063b3810d977aa376d1e6dd7cec359330cc (#94208):

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

Added by 5374688e1d8cbcff7d1d14bb34e38fe6fe7c233e (#98574):

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

Added by 6c529ded8674b89c46052da92399227c3b764c6a (#98574):

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

Added by 9b566401068cb8450912f6ab48f3d0e60f5cb482 (#99518):

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

Added by baf9a7cb57120ec1411196214fd0d1c33fb18bf6 (#99518):

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

Added by 60be2de8b7b8a1c4eee7e065b8cef38ea629a6a3 (#99518):

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

Added by 47a7a91c969ed2edd12c674ca05c1baf867f6f6f (#100132):

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

Added by e3c5bd617d040b5ee0bc79e6e7f01772adce791b (#100443):

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

Added by 981852677c531d52f701b870bb27b45668a44d52 (#100443):

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

Added by e182d12a8493b40a557394325a3a713b6528de60 (#100434):

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

Added by e26285603ca8b83b9d06e56f74e10e3d410553ff (#99954):

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

Added by 2d8460ef43d902f34ba2133fe38f66ee8d2fdafc (#99291):

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

Added by 1b87ce0d4092045728c1c68282769d555706f273 (#101410):

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

Added by af591ebe4d0cf2097a5fdc0bb710442d0f2e7876 (#101410):

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

Added by this PR:

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

### Things not currently tested

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

Edit: they are all tested now.

### Possible future work / Refutable destructuring assignments

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

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

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

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

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

Simplify `const` `memchr`.

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

Removes the need for `const_eval_select`.

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

Rollup of 8 pull requests

Successful merges:

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

Failed merges:

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

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

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

Pass --cfg=bootstrap for rustdoc for proc_macro crates

This PR does three things:

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

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

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

r? rustdoc

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

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

# `margin-left: 0`

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

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

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

# `max-width: none`

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

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

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

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

Remove some unused CSS rules

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

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

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

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

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

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

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

More simple formatting

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

Update `symbol_mangling` diagnostics migration

Addresses comments raised in #100831.

r? `@eddyb` `@davidtwco`

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

Adding needs-unwind arg to applicable compiler ui tests

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

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

Adding Fuchsia zxdb debugging walkthrough to docs

Adding `zxdb` docs to walkthrough to show debugging steps

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

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

r? `@lcnr`

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

This commit does three things:

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

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

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

Fix #97463

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Partially revert #101433

reverts #101433 to fix #101844

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

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

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

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

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

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

This reverts commit c75817b0a75d4b6b01ee10900ba5d01d4915e6a8.

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

This reverts commit aae37f87632dd74856d55c0cd45d2c192379c990.

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

Rollup of 7 pull requests

Successful merges:

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

Failed merges:

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

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

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

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

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

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

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

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

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

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

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

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

Slight vertical formatting

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

Suggest associated const for incorrect use of let in traits

Fixes #101797

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

Fix back RPIT changes

r? `@oli-obk`

cc `@compiler-errors`

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

Extend CSS check to CSS variables

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

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

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

r? `@notriddle`

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

rustdoc mobile: move notable traits to return type

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

r? `@notriddle`

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

Don't throw away information just to recompute it again

also allows making some functions private.

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

Rollup of 7 pull requests

Successful merges:

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

Failed merges:

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

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

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

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

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

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

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

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

Replace `check_missing_items.py` with `jsondoclint`

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

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

### Motivation

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

cc ``@CraftSpider``

r? ``@GuillaumeGomez``

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

Constify impl Fn* &(mut) Fn*

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

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

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

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

cache `collect_trait_impl_trait_tys`

Micro-optimization for RPITITs

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

Prefer explict closure sig types over expected ones

fixes #100800

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

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

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

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

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

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

Rustdoc-Json: Fix Type docs.

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

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

21 months agodo not suggest a placeholder to const and static without a type
Takayuki Maeda [Fri, 16 Sep 2022 02:24:14 +0000 (11:24 +0900)]
do not suggest a placeholder to const and static without a type

21 months agorustdoc: remove no-op CSS `.block { padding: 0 }`
Michael Howell [Fri, 16 Sep 2022 00:16:59 +0000 (17:16 -0700)]
rustdoc: remove no-op CSS `.block { padding: 0 }`

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

21 months agoAuto merge of #101711 - chenyukang:fix-101691, r=jyn514
bors [Fri, 16 Sep 2022 00:02:46 +0000 (00:02 +0000)]
Auto merge of #101711 - chenyukang:fix-101691, r=jyn514

Copy stage0 binaries into stage0-sysroot

Fixes #101691

21 months agoAuto merge of #101831 - compiler-errors:issue-75899, r=jackh726
bors [Thu, 15 Sep 2022 21:06:36 +0000 (21:06 +0000)]
Auto merge of #101831 - compiler-errors:issue-75899, r=jackh726

Normalize struct field types in `confirm_builtin_unsize_candidate`

Fixes #75899

---

edited to move the normalization into `confirm_builtin_unsize_candidate` instead of the coercion code.

21 months agonits
b-naber [Thu, 15 Sep 2022 20:27:41 +0000 (22:27 +0200)]
nits

21 months agorustdoc: fix test cases
Michael Howell [Thu, 15 Sep 2022 20:14:30 +0000 (13:14 -0700)]
rustdoc: fix test cases

21 months agorustdoc: use more precise URLs for jump-to-definition links
Michael Howell [Thu, 15 Sep 2022 20:03:04 +0000 (13:03 -0700)]
rustdoc: use more precise URLs for jump-to-definition links

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

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

21 months agoFix clippy
est31 [Fri, 4 Feb 2022 09:13:48 +0000 (10:13 +0100)]
Fix clippy

21 months agoRemove the let_else feature gate from the testsuite
est31 [Sun, 27 Feb 2022 06:08:31 +0000 (07:08 +0100)]
Remove the let_else feature gate from the testsuite

Result of running:

rg -l "feature.let_else" src/test/  | xargs sed -s -i "s#^...feature.let_else..\$##"

Plus manual tidy fixes.

21 months agoOnly enable the let_else feature on bootstrap
est31 [Sun, 27 Feb 2022 06:07:36 +0000 (07:07 +0100)]
Only enable the let_else feature on bootstrap

On later stages, the feature is already stable.

Result of running:

rg -l "feature.let_else" compiler/ src/librustdoc/ library/ | xargs sed -s -i "s#\\[feature.let_else#\\[cfg_attr\\(bootstrap, feature\\(let_else\\)#"

21 months agoRemove feature gate from let else suggestion
est31 [Mon, 16 May 2022 04:27:31 +0000 (06:27 +0200)]
Remove feature gate from let else suggestion

The let else suggestion added by 0d92752b8aac53e033541d04fc7d9677d8bca227
does not need a feature gate any more.

21 months agoStabilize the let_else feature
est31 [Tue, 30 Aug 2022 12:46:35 +0000 (14:46 +0200)]
Stabilize the let_else feature

21 months agoAuto merge of #101858 - oli-obk:lift_derive, r=lcnr
bors [Thu, 15 Sep 2022 18:14:29 +0000 (18:14 +0000)]
Auto merge of #101858 - oli-obk:lift_derive, r=lcnr

derive various impls instead of hand-rolling them

r? `@lcnr`

This may not have been what you asked for in https://github.com/rust-lang/rust/commit/964b97e845d5dd18e09d5e045f5b376086714836#r84051418 but I got carried away while following the compiler team meeting today.

21 months agotweak suggestion
yukang [Thu, 15 Sep 2022 17:09:26 +0000 (01:09 +0800)]
tweak suggestion

21 months agorustdoc: remove no-op CSS `h1-4 { color: --main-color }`
Michael Howell [Thu, 15 Sep 2022 16:59:27 +0000 (09:59 -0700)]
rustdoc: remove no-op CSS `h1-4 { color: --main-color }`

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

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

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

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

21 months agoDon't throw away information just to recompute it again
Oli Scherer [Thu, 8 Sep 2022 15:18:43 +0000 (15:18 +0000)]
Don't throw away information just to recompute it again

21 months agoslight vertical formatting
Rageking8 [Thu, 15 Sep 2022 15:51:43 +0000 (23:51 +0800)]
slight vertical formatting

21 months agoMerge all `TypeVisitable for &List<T>` impls into one generic one
Oli Scherer [Thu, 15 Sep 2022 15:33:46 +0000 (15:33 +0000)]
Merge all `TypeVisitable for &List<T>` impls into one generic one

21 months agoAuto merge of #101410 - dingxiangfei2009:fix-let-else-scoping, r=jackh726
bors [Thu, 15 Sep 2022 15:19:40 +0000 (15:19 +0000)]
Auto merge of #101410 - dingxiangfei2009:fix-let-else-scoping, r=jackh726

Reorder nesting scopes and declare bindings without drop schedule

Fix #99228
Fix #99975

Storages are previously not declared before entering the `else` block of a `let .. else` statement. However, when breaking out of the pattern matching into the `else` block, those storages are recorded as scheduled for drops. This is not expected.

This MR fixes this issue by not scheduling the drops for those storages.

cc `@est31`

21 months agoReplace more manual TypeFoldable and TypeVisitable impls with derives
Oli Scherer [Thu, 15 Sep 2022 15:05:03 +0000 (15:05 +0000)]
Replace more manual TypeFoldable and TypeVisitable impls with derives

21 months agoderive TypeVisitable and TypeFoldable for mir types
Oli Scherer [Thu, 15 Sep 2022 14:42:43 +0000 (14:42 +0000)]
derive TypeVisitable and TypeFoldable for mir types

21 months agoDerive TypeFoldable and TypeVisitable for mir::PlaceElement
Oli Scherer [Thu, 15 Sep 2022 13:43:44 +0000 (13:43 +0000)]
Derive TypeFoldable and TypeVisitable for mir::PlaceElement

21 months agoResolve a FIXME
Oli Scherer [Thu, 15 Sep 2022 13:37:34 +0000 (13:37 +0000)]
Resolve a FIXME

21 months agoderive various Lift impl instead of hand rolling them
Oli Scherer [Thu, 8 Sep 2022 09:04:52 +0000 (09:04 +0000)]
derive various Lift impl instead of hand rolling them

21 months agoAuto merge of #101173 - jyn514:simplify-macro-arguments, r=cjgillot
bors [Thu, 15 Sep 2022 11:54:03 +0000 (11:54 +0000)]
Auto merge of #101173 - jyn514:simplify-macro-arguments, r=cjgillot

Further simplify the macros generated by `rustc_queries`

This doesn't actually move anything outside the macros, but it makes them simpler to read.

- Add a new `rustc_query_names` macro. This allows a much simpler syntax for the matchers in the macros passed to it as a callback.
- Convert `define_dep_nodes` and `alloc_once` to use `rustc_query_names`. This is possible because they only use the names
  (despite the quite complicated matchers in `define_dep_nodes`, none of the other arguments are used).
- Get rid of `rustc_dep_node_append`.

r? `@cjgillot`

21 months agoCorrectly handle parens
Guillaume Gomez [Thu, 15 Sep 2022 11:53:20 +0000 (13:53 +0200)]
Correctly handle parens

21 months agoAuto merge of #101811 - flip1995:clippyup, r=flip1995
bors [Thu, 15 Sep 2022 08:53:51 +0000 (08:53 +0000)]
Auto merge of #101811 - flip1995:clippyup, r=flip1995

Clippy pre beta branch fix

Before beta is branched on Friday, I want to move the `unused_peekable` lint  that was added in this release cycle (1.65) to `nursery`. This lint was already reported twice (https://github.com/rust-lang/rust-clippy/issues/9456, https://github.com/rust-lang/rust-clippy/issues/9462) in a short time, so it is probably a good idea to fix it before it hits beta and then stable.

r? `@Manishearth`

21 months agofix #101797: Suggest associated const for incorrect use of let in traits
yukang [Thu, 15 Sep 2022 07:18:23 +0000 (15:18 +0800)]
fix #101797: Suggest associated const for incorrect use of let in traits

21 months agoAuto merge of #101838 - matthiaskrgr:rollup-d1nm6b3, r=matthiaskrgr
bors [Thu, 15 Sep 2022 06:12:39 +0000 (06:12 +0000)]
Auto merge of #101838 - matthiaskrgr:rollup-d1nm6b3, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #100415 (Add BE8 support)
 - #101559 (Adding "backtrace off" option for fuchsia targets)
 - #101740 (Adding ignore-fuchsia arg to non-applicable compiler ui tests)
 - #101778 (rustdoc: clean up DOM by removing `.dockblock-short p`)
 - #101786 (Tidy will not check coding style in bootstrap/target)
 - #101810 (Constify `PartialEq` for `Ordering`)
 - #101812 (rustdoc: clean up CSS `#titles` using flexbox)
 - #101820 (rustdoc: remove no-op rule `a { background: transparent }`)
 - #101828 (Add test for #101743)

Failed merges:

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

21 months agoRollup merge of #101828 - aDotInTheVoid:test-101743, r=jsha
Matthias Krüger [Thu, 15 Sep 2022 06:00:18 +0000 (08:00 +0200)]
Rollup merge of #101828 - aDotInTheVoid:test-101743, r=jsha

Add test for #101743

The issue was closes as we stopped rendering `const`s like this, but if we move back to doing that, make sure we don't accidently generate tags

21 months agoRollup merge of #101820 - notriddle:notriddle/a, r=GuillaumeGomez
Matthias Krüger [Thu, 15 Sep 2022 06:00:18 +0000 (08:00 +0200)]
Rollup merge of #101820 - notriddle:notriddle/a, r=GuillaumeGomez

rustdoc: remove no-op rule `a { background: transparent }`

The background is transparent by default.

It was added in 5a01dbe67b43660bf1df96074f34a635aad50e56 to work around a bug in the JavaScript syntax highlighting engine that rustdoc used at the time.

21 months agoRollup merge of #101812 - notriddle:notriddle/titles-button, r=GuillaumeGomez
Matthias Krüger [Thu, 15 Sep 2022 06:00:17 +0000 (08:00 +0200)]
Rollup merge of #101812 - notriddle:notriddle/titles-button, r=GuillaumeGomez

rustdoc: clean up CSS `#titles` using flexbox

This commit allows it to stop manually specifying pixel heights for the tabs on search result pages. There's less messing with manual breakpoints and less complex CSS selectors.

# Before

![image](https://user-images.githubusercontent.com/1593513/190215034-253c0f58-07c6-41c9-8848-0442c0522070.png)

# After

![image](https://user-images.githubusercontent.com/1593513/190215065-d2453dca-edf0-4353-8fc8-3a3b31f03892.png)

21 months agoRollup merge of #101810 - raldone01:feat/const_partial_eq_ordering, r=fee1-dead
Matthias Krüger [Thu, 15 Sep 2022 06:00:16 +0000 (08:00 +0200)]
Rollup merge of #101810 - raldone01:feat/const_partial_eq_ordering, r=fee1-dead

Constify `PartialEq` for `Ordering`

Adds `impl const PartialEq for Ordering {}` to #92391.

21 months agoRollup merge of #101786 - chenyukang:fix-tidy-for-bootstrap, r=jyn514
Matthias Krüger [Thu, 15 Sep 2022 06:00:15 +0000 (08:00 +0200)]
Rollup merge of #101786 - chenyukang:fix-tidy-for-bootstrap, r=jyn514

Tidy will not check coding style in bootstrap/target

`bootstrap/target` may contains the files generated by `rust-analysis`, which we won't want to be checked.

21 months agoRollup merge of #101778 - notriddle:notriddle/docblock-short-p, r=GuillaumeGomez
Matthias Krüger [Thu, 15 Sep 2022 06:00:14 +0000 (08:00 +0200)]
Rollup merge of #101778 - notriddle:notriddle/docblock-short-p, r=GuillaumeGomez

rustdoc: clean up DOM by removing `.dockblock-short p`

On https://doc.rust-lang.org/nightly/std/ this reduces the number out of `document.querySelectorAll("*").length` from 1278 to 1103.

Preview: https://notriddle.com/notriddle-rustdoc-test/docblock-short-p/std/index.html

21 months agoRollup merge of #101740 - andrewpollack:add-ignore-fuchsia-ui-tests, r=tmandry
Matthias Krüger [Thu, 15 Sep 2022 06:00:13 +0000 (08:00 +0200)]
Rollup merge of #101740 - andrewpollack:add-ignore-fuchsia-ui-tests, r=tmandry

Adding ignore-fuchsia arg to non-applicable compiler ui tests

Adding `ignore-fuchsia` flag to tests involving `std::process::Command` calls, and `execve` calls

21 months agoRollup merge of #101559 - andrewpollack:add-backtrace-off-fuchsia, r=tmandry
Matthias Krüger [Thu, 15 Sep 2022 06:00:12 +0000 (08:00 +0200)]
Rollup merge of #101559 - andrewpollack:add-backtrace-off-fuchsia, r=tmandry

Adding "backtrace off" option for fuchsia targets

Used for improving compiler test suite results on Fuchsia targets

21 months agoRollup merge of #100415 - WorksButNotTested:be8, r=wesleywiser
Matthias Krüger [Thu, 15 Sep 2022 06:00:11 +0000 (08:00 +0200)]
Rollup merge of #100415 - WorksButNotTested:be8, r=wesleywiser

Add BE8 support

Built using the following `/config.toml`
```
changelog-seen = 2

[llvm]
download-ci-llvm = false
skip-rebuild = true
optimize = true
ninja = true
targets = "ARM;X86"
clang = false

[build]
target = ["x86_64-unknown-linux-gnu", "armeb-linux-gnueabi"]
docs = false
docs-minification = false
compiler-docs = false
[install]
prefix = "/home/user/x-tools/rust/"

[rust]
debug-logging=true
backtrace = true
incremental = true

[target.x86_64-unknown-linux-gnu]

[dist]

[target.armeb-linux-gnueabi]
cc = "/home/user/x-tools/armeb-linux-gnueabi/bin/armeb-linux-gnueabi-gcc"
cxx = "/home/user/x-tools/armeb-linux-gnueabi/bin/armeb-linux-gnueabi-g++"
ar = "/home/user/x-tools/armeb-linux-gnueabi/bin/armeb-linux-gnueabi-ar"
ranlib = "/home/user/x-tools/armeb-linux-gnueabi/bin/armeb-linux-gnueabi-ranlib"
linker = "/home/user/x-tools/armeb-linux-gnueabi/bin/armeb-linux-gnueabi-gcc"
llvm-config = "/home/user/x-tools/clang/bin/llvm-config"
llvm-filecheck = "/home/user/x-tools/clang/bin/FileCheck"
```

The following `.cargo/config` is needed inside any project directory:
```
[build]
target = "armeb-linux-gnueabi"

[target.armeb-linux-gnueabi]
linker = "armeb-linux-gnueabi-gcc"
```

21 months agoAuto merge of #101830 - nnethercote:streamline-register_res, r=jyn514
bors [Thu, 15 Sep 2022 02:58:21 +0000 (02:58 +0000)]
Auto merge of #101830 - nnethercote:streamline-register_res, r=jyn514

Streamline `register_res`.

Turns out it's only ever passed a `Res::Def`.

r? `@jyn514`

21 months agoadd diagram to explain the MIR structure
Ding Xiang Fei [Tue, 13 Sep 2022 14:07:16 +0000 (22:07 +0800)]
add diagram to explain the MIR structure

21 months agoadd explanatory note
Ding Xiang Fei [Tue, 13 Sep 2022 13:01:48 +0000 (21:01 +0800)]
add explanatory note

21 months agoenclose else block in terminating scope
Ding Xiang Fei [Mon, 12 Sep 2022 14:50:52 +0000 (22:50 +0800)]
enclose else block in terminating scope

21 months agosupplement for the missing or incomplete comments
Ding Xiang Fei [Mon, 5 Sep 2022 06:24:13 +0000 (14:24 +0800)]
supplement for the missing or incomplete comments

21 months agoadd test for #99975
Ding Xiang Fei [Mon, 5 Sep 2022 06:17:41 +0000 (14:17 +0800)]
add test for #99975

21 months agoreorder nesting scopes and declare bindings without drop schedule
Ding Xiang Fei [Sun, 4 Sep 2022 15:17:43 +0000 (23:17 +0800)]
reorder nesting scopes and declare bindings without drop schedule