Commit Graph

200095 Commits

Author SHA1 Message Date
Matthias Krüger
4757d2d57e
Rollup merge of #101801 - SparrowLii:query_depth_note, r=estebank
add note for `layout_of` when query depth overflows

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

error: aborting due to previous error
```

cc ``@semicoleon``
2022-09-17 19:27:06 +02:00
Matthias Krüger
9c32773a8d
Rollup merge of #101783 - chriswailes:env-vars, r=jyn514
Improve handing of env vars during bootstrap process

This CL modifies the handing of env vars during the bootstrap process in two ways:
1. Replaces '-' characters with '_' characters in target names to increase compatibility with different shells
2. Passes Stage0 snapshot compiler related env vars to early invocations of Cargo
2022-09-17 19:27:06 +02:00
Matthias Krüger
ec6104784d
Rollup merge of #101781 - chriswailes:dynamic-llvm-on-musl, r=jyn514
Extend list of targets that support dyanmic linking for llvm tools

This commit adds `linux-musl` to the list of targets that support dynamic linking for the LLVM tools.
2022-09-17 19:27:05 +02:00
Matthias Krüger
00d88bdb2c
Rollup merge of #101672 - idigdoug:array_try_into, r=Mark-Simulacrum
array docs - advertise how to get array from slice

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

(As a side note, it's a bit unfortunate that get-array-from-slice is only available via trait since that means it can't be used from const functions yet.)
2022-09-17 19:27:05 +02:00
bors
48de123d7a Auto merge of #101857 - lcnr:make-dyn-again, r=jackh726
change `FnMutDelegate` to trait objects

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

r? `@jackh726`
2022-09-17 13:37:48 +00:00
bors
672831a5c8 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
2022-09-17 10:56:42 +00:00
Dylan DPC
80cceb8f77
Rollup merge of #101931 - msakuta:master, r=thomcc
doc: Fix a typo in `Rc::make_mut` docstring

A very minor typo fix.
2022-09-17 15:31:09 +05:30
Dylan DPC
4515cb9621
Rollup merge of #101915 - notriddle:notriddle/redirect, r=GuillaumeGomez
doc: fix redirected link in `/index.html`

Fallout from #101166
2022-09-17 15:31:09 +05:30
Dylan DPC
7c55c992ab
Rollup merge of #101807 - jackh726:no-gat-defaults, r=lcnr
Disallow defaults on type GATs

Fixes #99205
2022-09-17 15:31:08 +05:30
Dylan DPC
4c64c14420
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
2022-09-17 15:31:08 +05:30
Dylan DPC
cbd561d41f
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``
2022-09-17 15:31:07 +05:30
Dylan DPC
3ad81e0dd8
Rollup merge of #93628 - est31:stabilize_let_else, r=joshtriplett
Stabilize `let else`

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

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 df9a2e0687 (#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 5b95df4bdc (#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 bf7c32a447 (#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 102b9125e1 this got removed in favour of more comprehensive tests.

Added by 856541963c (#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 9b45713b6c:

* [`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 61bcd8d307 (#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 102b9125e1 (#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 2715c5f984 (#89841):

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

Added by fec8a507a2 (#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 76ea566677 (#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 e7730dcb7e (#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 5bd71063b3 (#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 5374688e1d (#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 6c529ded86 (#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 9b56640106 (#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 baf9a7cb57 (#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 60be2de8b7 (#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 47a7a91c96 (#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 e3c5bd617d (#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 981852677c (#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 e182d12a84 (#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 e26285603c (#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 2d8460ef43 (#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 1b87ce0d40 (#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 af591ebe4d (#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.
2022-09-17 15:31:06 +05:30
bors
b195f5349a 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`.
2022-09-17 08:15:35 +00:00
bors
4a12d10bcc 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
2022-09-17 05:45:28 +00:00
msakuta
673c43b6e1 Fix a typo in docstring 2022-09-17 13:58:53 +09:00
Michael Howell
cafca7d219
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: ebf4cc361e .
2022-09-16 20:37:17 -07:00
Michael Howell
bba939ee94
Rollup merge of #101914 - aDotInTheVoid:rdj-path-union-docs, r=jsha
rustdoc-json-types: Document that ResolvedPath can also be a union

r? rustdoc
2022-09-16 20:37:17 -07:00
Michael Howell
b1178afcb4
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 7669f04fb0, to override the default, massive left margin that content used to accommodate the sidebar:

7669f04fb0/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 135281ed15.

# `max-width: none`

This rule originated in 7669f04fb0, 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):

7669f04fb0/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 135281ed15) but is now called `width-limiter` (since d7528e2157).
2022-09-16 20:37:17 -07:00
Michael Howell
9c6ef4ae38
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``
2022-09-16 20:37:16 -07:00
Michael Howell
8b88370ee5
Rollup merge of #101878 - Rageking8:More-simple-formatting, r=lcnr
More simple formatting
2022-09-16 20:37:16 -07:00
Michael Howell
d6534317c7
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`
2022-09-16 20:37:15 -07:00
Michael Howell
217a82a2aa
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
2022-09-16 20:37:15 -07:00
Michael Howell
fffb7f295a
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
2022-09-16 20:37:14 -07:00
bors
c524c7dd25 Auto merge of #98588 - b-naber:valtrees-cleanup, r=lcnr
Use only ty::Unevaluated<'tcx, ()> in type system

r? `@lcnr`
2022-09-17 03:04:22 +00:00
Chris Wailes
d1291dc8b4 Improve handing of env vars during bootstrap process
This CL modifies the handing of env vars during the bootstrap process in
two ways:
1. Replaces '-' characters with '_' characters in target names to
   increase compatibility with different shells
2. Passes Stage0 snapshot compiler related env vars to early invocations
   of Cargo
2022-09-16 15:03:11 -07:00
est31
706f0f018b 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: ebf4cc361e .
2022-09-16 23:35:00 +02:00
Chris Wailes
9995029786 Remove the allow-list for dynamic linking of LLVM tools
This commit removes an allow-list for the dynamic linking of the LLVM
tools and instead relies on the builder's linking preference only.
2022-09-16 13:08:44 -07:00
bors
95a992a686 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
2022-09-16 20:08:05 +00:00
Michael Howell
b6c851ad4a doc: fix redirected link in /index.html 2022-09-16 12:30:18 -07:00
Andrew Pollack
5d27f19505 Adding needs-unwind arg to applicable compiler ui tests 2022-09-16 19:28:21 +00:00
Andrew Pollack
2b8886fb5d Adding Fuchsia zxdb debugging walkthrough to docs 2022-09-16 19:22:54 +00:00
Nixon Enraght-Moony
cb6c923cf4 Document that ResolvedPath can also be a union 2022-09-16 19:51:58 +01:00
Michael Howell
ac8628bcf6 rustdoc: remove no-op CSS .source .content { max-width: none }
This rule originated in 7669f04fb0, 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):

7669f04fb0/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 135281ed15) but is
now called `width-limiter` (since
d7528e2157).
2022-09-16 10:46:55 -07:00
Michael Howell
1676a9ad61 rustdoc: remove no-op CSS .source .content { margin-left: 0 }
This rule originated in 7669f04fb0, to
override the default, massive left margin that content used to accommodate
the sidebar:

7669f04fb0/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 135281ed15.
2022-09-16 10:46:47 -07:00
Felix S. Klock II
a2de75a827 fix typo in comment noted by bjorn3. 2022-09-16 13:26:58 -04:00
Felix S. Klock II
d73614a2ee Do not run run-make test tied to unix-style $(CC) on MSVC host. 2022-09-16 13:26:22 -04:00
bors
4d4e51e428 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.
2022-09-16 16:46:14 +00:00
Guillaume Gomez
28956d18d1 Remove unneeded empty ayu CSS rules 2022-09-16 18:25:08 +02:00
Guillaume Gomez
7cf67bfaa2 Remove unused .block a.current* rules 2022-09-16 18:25:08 +02:00
Guillaume Gomez
99c00714cf Remove some unused CSS rules 2022-09-16 16:18:54 +02:00
Jack Huey
d97fdf16d9 Add test for #101844 2022-09-16 09:47:37 -04:00
Jack Huey
92b759f517 Revert "Better errors for implied static bound"
This reverts commit c75817b0a7.
2022-09-16 09:47:07 -04:00
Jack Huey
bba514b7b4 Revert "Use Predicate ConstraintCategory when normalizing"
This reverts commit aae37f8763.
2022-09-16 09:01:28 -04:00
bors
54f20bbb8a 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
2022-09-16 12:43:22 +00:00
Rageking8
d433efa649 more simple formatting 2022-09-16 19:07:42 +08:00
Guillaume Gomez
e284393c9e
Rollup merge of #101877 - notriddle:notriddle/block, r=Dylan-DPC
rustdoc: remove no-op CSS `.block { padding: 0 }`

This rule was changed in 8fb1250aba 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.
2022-09-16 13:07:19 +02:00
Guillaume Gomez
c21dcd7914
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).
2022-09-16 13:07:19 +02:00
Guillaume Gomez
9a72ded562
Rollup merge of #101859 - Rageking8:slight-vertical-formatting, r=compiler-errors
Slight vertical formatting
2022-09-16 13:07:18 +02:00
Guillaume Gomez
72d9e0821e
Rollup merge of #101843 - chenyukang:fix-101797, r=oli-obk
Suggest associated const for incorrect use of let in traits

Fixes #101797
2022-09-16 13:07:18 +02:00
Guillaume Gomez
8ba133fa7b
Rollup merge of #101825 - spastorino:fix-rpit-changes, r=oli-obk
Fix back RPIT changes

r? `@oli-obk`

cc `@compiler-errors`
2022-09-16 13:07:17 +02:00