]> git.lizzy.rs Git - rust.git/log
rust.git
20 months agoDon't erroneously deny semicolons after closure expr within parentheses in a macro
Michael Goulet [Wed, 19 Oct 2022 04:55:31 +0000 (04:55 +0000)]
Don't erroneously deny semicolons after closure expr within parentheses in a macro

20 months agoAuto merge of #103172 - pcwalton:deduced-param-attrs, r=oli-obk
bors [Sat, 22 Oct 2022 02:28:05 +0000 (02:28 +0000)]
Auto merge of #103172 - pcwalton:deduced-param-attrs, r=oli-obk

Introduce deduced parameter attributes, and use them for deducing `readonly` on indirect immutable freeze by-value function parameters.

Introduce deduced parameter attributes, and use them for deducing `readonly` on
indirect immutable freeze by-value function parameters.

Right now, `rustc` only examines function signatures and the platform ABI when
determining the LLVM attributes to apply to parameters. This results in missed
optimizations, because there are some attributes that can be determined via
analysis of the MIR making up the function body. In particular, `readonly`
could be applied to most indirectly-passed by-value function arguments
(specifically, those that are freeze and are observed not to be mutated), but
it currently is not.

This patch introduces the machinery that allows `rustc` to determine those
attributes. It consists of a query, `deduced_param_attrs`, that, when
evaluated, analyzes the MIR of the function to determine supplementary
attributes. The results of this query for each function are written into the
crate metadata so that the deduced parameter attributes can be applied to
cross-crate functions. In this patch, we simply check the parameter for
mutations to determine whether the `readonly` attribute should be applied to
parameters that are indirect immutable freeze by-value.  More attributes could
conceivably be deduced in the future: `nocapture` and `noalias` come to mind.

Adding `readonly` to indirect function parameters where applicable enables some
potential optimizations in LLVM that are discussed in [issue 103103] and [PR
103070] around avoiding stack-to-stack memory copies that appear in functions
like `core::fmt::Write::write_fmt` and `core::panicking::assert_failed`. These
functions pass a large structure unchanged by value to a subfunction that also
doesn't mutate it. Since the structure in this case is passed as an indirect
parameter, it's a pointer from LLVM's perspective. As a result, the
intermediate copy of the structure that our codegen emits could be optimized
away by LLVM's MemCpyOptimizer if it knew that the pointer is `readonly
nocapture noalias` in both the caller and callee. We already pass `nocapture
noalias`, but we're missing `readonly`, as we can't determine whether a
by-value parameter is mutated by examining the signature in Rust. I didn't have
much success with having LLVM infer the `readonly` attribute, even with fat
LTO; it seems that deducing it at the MIR level is necessary.

No large benefits should be expected from this optimization *now*; LLVM needs
some changes (discussed in [PR 103070]) to more aggressively use the `noalias
nocapture readonly` combination in its alias analysis. I have some LLVM patches
for these optimizations and have had them looked over. With all the patches
applied locally, I enabled LLVM to remove all the `memcpy`s from the following
code:

```rust
fn main() {
    println!("Hello {}", 3);
}
```

which is a significant codegen improvement over the status quo. I expect that if this optimization kicks in in multiple places even for such a simple program, then it will apply to Rust code all over the place.

[issue 103103]: https://github.com/rust-lang/rust/issues/103103

[PR 103070]: https://github.com/rust-lang/rust/pull/103070

20 months agoAuto merge of #103375 - matthiaskrgr:rollup-4xrs7f2, r=matthiaskrgr
bors [Fri, 21 Oct 2022 23:42:01 +0000 (23:42 +0000)]
Auto merge of #103375 - matthiaskrgr:rollup-4xrs7f2, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #102635 (make `order_dependent_trait_objects` show up in future-breakage reports)
 - #103335 (Replaced wrong test with the correct mcve)
 - #103339 (Fix some typos)
 - #103340 (WinConsole::new is not actually fallible)
 - #103341 (Add test for issue 97607)
 - #103351 (Require Drop impls to have the same constness on its bounds as the bounds on the struct have)
 - #103359 (Remove incorrect comment in `Vec::drain`)
 - #103364 (rustdoc: clean up rustdoc-toggle CSS)
 - #103370 (rustdoc: remove unused CSS `.out-of-band { font-weight: normal }`)

Failed merges:

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

20 months agoRollup merge of #103370 - notriddle:notriddle/out-of-band, r=GuillaumeGomez
Matthias Krüger [Fri, 21 Oct 2022 22:14:04 +0000 (00:14 +0200)]
Rollup merge of #103370 - notriddle:notriddle/out-of-band, r=GuillaumeGomez

rustdoc: remove unused CSS `.out-of-band { font-weight: normal }`

This CSS was added in 083c3952e0d5473cd5c41a9eb7b4ffca18cc8e5f to normalize the appearance of out-of-band elements that were nested directly below headers.

Now, the only use of `out-of-band` is in the main page header, and it is nested below a wrapper, not the `<h1>` itself.

20 months agoRollup merge of #103364 - notriddle:notriddle/toggles, r=jsha
Matthias Krüger [Fri, 21 Oct 2022 22:14:03 +0000 (00:14 +0200)]
Rollup merge of #103364 - notriddle:notriddle/toggles, r=jsha

rustdoc: clean up rustdoc-toggle CSS

20 months agoRollup merge of #103359 - WaffleLapkin:drain_no_mut_qqq, r=scottmcm
Matthias Krüger [Fri, 21 Oct 2022 22:14:03 +0000 (00:14 +0200)]
Rollup merge of #103359 - WaffleLapkin:drain_no_mut_qqq, r=scottmcm

Remove incorrect comment in `Vec::drain`

r? ``@scottmcm``

Turns out this comment wasn't correct for 6 years, since #34951, which switched from using `slice::IterMut` into using `slice::Iter`.

20 months agoRollup merge of #103351 - oli-obk:tilde_const_impls, r=fee1-dead
Matthias Krüger [Fri, 21 Oct 2022 22:14:02 +0000 (00:14 +0200)]
Rollup merge of #103351 - oli-obk:tilde_const_impls, r=fee1-dead

Require Drop impls to have the same constness on its bounds as the bounds on the struct have

r? ``@fee1-dead``

20 months agoRollup merge of #103341 - Rageking8:add-test-for-issue-97607, r=compiler-errors
Matthias Krüger [Fri, 21 Oct 2022 22:14:01 +0000 (00:14 +0200)]
Rollup merge of #103341 - Rageking8:add-test-for-issue-97607, r=compiler-errors

Add test for issue 97607

Fixes #97607

r? ``@compiler-errors``

Not sure which UI test dir to put this under, kindly let me know of a better dir if necessary and I will change it. Thanks.

20 months agoRollup merge of #103340 - RalfJung:winconsole, r=thomcc
Matthias Krüger [Fri, 21 Oct 2022 22:14:01 +0000 (00:14 +0200)]
Rollup merge of #103340 - RalfJung:winconsole, r=thomcc

WinConsole::new is not actually fallible

I just noticed this while reading the code for other reasons.
r? ``@thomcc``

20 months agoRollup merge of #103339 - Rageking8:fix-some-typos, r=fee1-dead
Matthias Krüger [Fri, 21 Oct 2022 22:14:00 +0000 (00:14 +0200)]
Rollup merge of #103339 - Rageking8:fix-some-typos, r=fee1-dead

Fix some typos

20 months agoRollup merge of #103335 - SarthakSingh31:issue-89008, r=jackh726
Matthias Krüger [Fri, 21 Oct 2022 22:14:00 +0000 (00:14 +0200)]
Rollup merge of #103335 - SarthakSingh31:issue-89008, r=jackh726

Replaced wrong test with the correct mcve

Closes #89008.

The old test was wrong and the compiler was [correctly raising an error](https://github.com/rust-lang/rust/issues/89008#issuecomment-1285128060). The bug in the issue was resolved at some point but due to the wrong test the issue was never closed.

This pr replaces that test with the correct MCVE (made by ``@jackh726).``

The error raised by the bug changed between when the bug was posted (2021-09-08) and when the MCVE [was posted](https://github.com/rust-lang/rust/issues/89008#issuecomment-950110735) (2021-10-23).
I ran them both through `nightly-2021-09-08` and they produce identical error messages. They also produce identical but different from before error messages when ran through `nightly-2021-10-23`.

<details>
  <summary>Error message with <code>nightly-2021-09-08</code></summary>

The code with the original bug report:
  ```
error[E0277]: the size for values of type `Repr` cannot be known at compilation time
  --> src/main.rs:23:43
   |
23 |     fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {
   |                        ----               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
   |                        |
   |                        this type parameter needs to be `std::marker::Sized`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `test-234234` due to previous error
  ```

MVCE:
```
error[E0277]: the size for values of type `Repr` cannot be known at compilation time
  --> src/main.rs:30:43
   |
30 |     fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {
   |                        ----               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
   |                        |
   |                        this type parameter needs to be `std::marker::Sized`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `test-234234` due to previous error
```
</details>

<details>
<summary>Error message with <code>nightly-2021-10-23</code></summary>

The code with the original bug report:
```
error[E0271]: type mismatch resolving `<impl futures::Future as futures::Future>::Output == impl futures::Stream`
  --> src/main.rs:23:43
   |
19 |     type LineStream<'a, Repr> = impl Stream<Item = Repr>;
   |                                 ------------------------ the expected opaque type
...
23 |     fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {
   |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected opaque type, found struct `futures::stream::Empty`
   |
   = note: expected opaque type `impl futures::Stream`
                   found struct `futures::stream::Empty<_>`

error: could not find defining uses
  --> src/main.rs:19:33
   |
19 |     type LineStream<'a, Repr> = impl Stream<Item = Repr>;
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0271`.
error: could not compile `test-234234` due to 2 previous errors
```

MCVE:
```
error[E0271]: type mismatch resolving `<impl Future as Future>::Output == impl Stream`
  --> src/main.rs:30:43
   |
28 |     type LineStream<'a, Repr> = impl Stream<Item = Repr>;
   |                                 ------------------------ the expected opaque type
29 |     type LineStreamFut<'a, Repr> = impl Future<Output = Self::LineStream<'a, Repr>>;
30 |     fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {
   |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected opaque type, found struct `Empty`
   |
   = note: expected opaque type `impl Stream`
                   found struct `Empty<_>`

error: could not find defining uses
  --> src/main.rs:28:33
   |
28 |     type LineStream<'a, Repr> = impl Stream<Item = Repr>;
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0271`.
error: could not compile `test-234234` due to 2 previous errors
```
</details>

20 months agoRollup merge of #102635 - lcnr:incoherent_auto_trait_objects, r=jackh726
Matthias Krüger [Fri, 21 Oct 2022 22:13:59 +0000 (00:13 +0200)]
Rollup merge of #102635 - lcnr:incoherent_auto_trait_objects, r=jackh726

make `order_dependent_trait_objects` show up in future-breakage reports

tried to change it to a hard error in #102474 but breaking the more than 1000 dependents of `traitobject` doesn't feel great :sweat_smile:

This lint has existed since more than 3 years now and the way this is currently implemented is buggy and will break with #102472. imo we should upgrade it to also report for dependencies and maybe also backport this to beta. Then after maybe 2-3 stable versions I would like to finally convert this lint to a hard error.

20 months agorustdoc: remove unused CSS `.out-of-band { font-weight: normal }`
Michael Howell [Fri, 21 Oct 2022 21:12:42 +0000 (14:12 -0700)]
rustdoc: remove unused CSS `.out-of-band { font-weight: normal }`

This CSS was added in 083c3952e0d5473cd5c41a9eb7b4ffca18cc8e5f to
normalize the appearance of out-of-band elements that were nested directly
below headers.

Now, the only use of `out-of-band` is in the main page header, and it is
nested below a wrapper, not the `<h1>` itself.

20 months agoAuto merge of #101263 - lopopolo:lopopolo/c-unwind-fn-ptr-impls, r=thomcc
bors [Fri, 21 Oct 2022 20:59:03 +0000 (20:59 +0000)]
Auto merge of #101263 - lopopolo:lopopolo/c-unwind-fn-ptr-impls, r=thomcc

Add default trait implementations for "c-unwind" ABI function pointers

Following up on #92964, only add default trait implementations for the `c-unwind` family of function pointers. The previous attempt in #92964 added trait implementations for many more ABIs and ran into concerns regarding the increase in size of the libcore rlib.

An attempt to abstract away function pointer types behind a unified trait to reduce the duplication of trait impls is being discussed in #99531 but this change looks to be blocked on a lang MCP.

Following `@RalfJung's` suggestion in https://github.com/rust-lang/rust/pull/99531#issuecomment-1233440142, this commit is another cut at #92964 but it _only_ adds the impls for `extern "C-unwind" fn` and `unsafe extern "C-unwind" fn`.

I am interested in landing this patch to unblock the stabilization of the `c_unwind` feature.

RFC: https://github.com/rust-lang/rfcs/pull/2945
Tracking Issue: https://github.com/rust-lang/rust/issues/74990

20 months agoAuto merge of #101077 - sunshowers:signal-mask-inherit, r=sunshowers
bors [Fri, 21 Oct 2022 18:09:03 +0000 (18:09 +0000)]
Auto merge of #101077 - sunshowers:signal-mask-inherit, r=sunshowers

Change process spawning to inherit the parent's signal mask by default

Previously, the signal mask was always reset when a child process is
started. This breaks tools like `nohup` which expect `SIGHUP` to be
blocked for all transitive processes.

With this change, the default behavior changes to inherit the signal mask.

This also changes the signal disposition for `SIGPIPE` to only be changed if the `#[unix_sigpipe]` attribute isn't set.

20 months agorustdoc: prevent method summary margin from being applied to docblocks
Michael Howell [Fri, 21 Oct 2022 17:48:41 +0000 (10:48 -0700)]
rustdoc: prevent method summary margin from being applied to docblocks

20 months agorustdoc: merge identical CSS blocks
Michael Howell [Fri, 21 Oct 2022 17:31:33 +0000 (10:31 -0700)]
rustdoc: merge identical CSS blocks

20 months agoRemove incorrect comment in `Vec::drain`
Maybe Waffle [Fri, 21 Oct 2022 15:29:02 +0000 (15:29 +0000)]
Remove incorrect comment in `Vec::drain`

20 months agoAuto merge of #98450 - lqd:doc-metadata, r=lqd,GuillaumeGomez
bors [Fri, 21 Oct 2022 15:27:56 +0000 (15:27 +0000)]
Auto merge of #98450 - lqd:doc-metadata, r=lqd,GuillaumeGomez

Remove more attributes from metadata

A lot of the attributes that are currently stored in the metadata aren't used at all. The biggest metadata usage comes from the doc attributes currently but they are needed by rustdoc so we only removed the ones that cannot be used in downstream crates (doc comments on private items).

r? `@ghost`

20 months agoRequire Drop impls to have the same constness on its bounds as the bounds on the...
Oli Scherer [Fri, 21 Oct 2022 13:49:11 +0000 (13:49 +0000)]
Require Drop impls to have the same constness on its bounds as the bounds on the struct have

20 months agoRemove needless special cases and dead code
Oli Scherer [Fri, 21 Oct 2022 08:27:39 +0000 (08:27 +0000)]
Remove needless special cases and dead code

20 months agoAuto merge of #103344 - Dylan-DPC:rollup-d1rpfvx, r=Dylan-DPC
bors [Fri, 21 Oct 2022 12:41:09 +0000 (12:41 +0000)]
Auto merge of #103344 - Dylan-DPC:rollup-d1rpfvx, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #102287 (Elaborate supertrait bounds when triggering `unused_must_use` on `impl Trait`)
 - #102922 (Filtering spans when emitting json)
 - #103051 (translation: doc comments with derives, subdiagnostic-less enum variants, more derive use)
 - #103111 (Account for hygiene in typo suggestions, and use them to point to shadowed names)
 - #103260 (Fixup a few tests needing asm support)
 - #103321 (rustdoc: improve appearance of source page navigation bar)

Failed merges:

 - #103209 (Diagnostic derives: allow specifying multiple alternative suggestions)

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

20 months agoRollup merge of #103321 - notriddle:notriddle/source-page-top-bar-layout, r=Guillaume...
Dylan DPC [Fri, 21 Oct 2022 12:00:00 +0000 (17:30 +0530)]
Rollup merge of #103321 - notriddle:notriddle/source-page-top-bar-layout, r=GuillaumeGomez

rustdoc: improve appearance of source page navigation bar

This commit changes things so that the search bar is exactly centered between the top of the page and the top of the source code content area.

Preview: https://notriddle.com/notriddle-rustdoc-demos/source-page-header/src/std/lib.rs.html

## Before

![image](https://user-images.githubusercontent.com/1593513/197053420-02a64627-48ed-4bb6-9363-a1863d47b092.png)

## After

![image](https://user-images.githubusercontent.com/1593513/197053355-bd6149f9-0f5c-47da-aeb7-590b5eecb5da.png)

20 months agoRollup merge of #103260 - cuviper:needs-asm-support, r=fee1-dead
Dylan DPC [Fri, 21 Oct 2022 11:59:59 +0000 (17:29 +0530)]
Rollup merge of #103260 - cuviper:needs-asm-support, r=fee1-dead

Fixup a few tests needing asm support

20 months agoRollup merge of #103111 - cjgillot:shadow-label, r=estebank
Dylan DPC [Fri, 21 Oct 2022 11:59:59 +0000 (17:29 +0530)]
Rollup merge of #103111 - cjgillot:shadow-label, r=estebank

Account for hygiene in typo suggestions, and use them to point to shadowed names

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

r? `@estebank`

20 months agoRollup merge of #103051 - davidtwco:translation-tidying-up, r=compiler-errors
Dylan DPC [Fri, 21 Oct 2022 11:59:58 +0000 (17:29 +0530)]
Rollup merge of #103051 - davidtwco:translation-tidying-up, r=compiler-errors

translation: doc comments with derives, subdiagnostic-less enum variants, more derive use

- Adds support for `doc` attributes in the diagnostic derives so that documentation comments don't result in the derive failing.
- Adds support for enum variants in the subdiagnostic derive to not actually correspond to an addition to a diagnostic.
- Made use of the derive in more places in the `rustc_ast_lowering`, `rustc_ast_passes`, `rustc_lint`, `rustc_session`, `rustc_infer` - taking advantage of recent additions like eager subdiagnostics, multispan suggestions, etc.

cc #100717

20 months agoRollup merge of #102922 - kper:bugfix/102902-filtering-json, r=oli-obk
Dylan DPC [Fri, 21 Oct 2022 11:59:58 +0000 (17:29 +0530)]
Rollup merge of #102922 - kper:bugfix/102902-filtering-json, r=oli-obk

Filtering spans when emitting json

According to the issue #102902, we shouldn't emit spans which have an empty span and no suggested replacement.

20 months agoRollup merge of #102287 - compiler-errors:unused-must-use-also-supertrait, r=fee1...
Dylan DPC [Fri, 21 Oct 2022 11:59:57 +0000 (17:29 +0530)]
Rollup merge of #102287 - compiler-errors:unused-must-use-also-supertrait, r=fee1-dead

Elaborate supertrait bounds when triggering `unused_must_use` on `impl Trait`

Given `impl Trait`, if one of its supertraits has a `#[must_use]`, then trigger the lint. This means that, for example, `-> impl ExactSizeIterator` also triggers the `must_use` on `trait Iterator`, which fixes #102183.

This might need `@rust-lang/lang` sign-off, since it changes the behavior of the lint, so cc'ing them.

20 months agoadd test for issue 97607
Rageking8 [Fri, 21 Oct 2022 10:20:11 +0000 (18:20 +0800)]
add test for issue 97607

20 months agoWinConsole::new is not actually fallible
Ralf Jung [Fri, 21 Oct 2022 10:18:33 +0000 (12:18 +0200)]
WinConsole::new is not actually fallible

20 months agofix some typos
Rageking8 [Fri, 21 Oct 2022 09:40:36 +0000 (17:40 +0800)]
fix some typos

20 months agoAuto merge of #103310 - lcnr:rustc_hir_typeck, r=compiler-errors
bors [Fri, 21 Oct 2022 09:52:18 +0000 (09:52 +0000)]
Auto merge of #103310 - lcnr:rustc_hir_typeck, r=compiler-errors

move hir typeck into separate crate

second part https://github.com/rust-lang/compiler-team/issues/529

I avoided pretty much anything that wasn't just a simple move + path adjustment. Left fixmes for methods which are at an odd place

r? `@compiler-errors`

20 months agoIntroduce deduced parameter attributes, and use them for deducing `readonly` on
Patrick Walton [Tue, 18 Oct 2022 02:42:15 +0000 (19:42 -0700)]
Introduce deduced parameter attributes, and use them for deducing `readonly` on
indirect immutable freeze by-value function parameters.

Right now, `rustc` only examines function signatures and the platform ABI when
determining the LLVM attributes to apply to parameters. This results in missed
optimizations, because there are some attributes that can be determined via
analysis of the MIR making up the function body. In particular, `readonly`
could be applied to most indirectly-passed by-value function arguments
(specifically, those that are freeze and are observed not to be mutated), but
it currently is not.

This patch introduces the machinery that allows `rustc` to determine those
attributes. It consists of a query, `deduced_param_attrs`, that, when
evaluated, analyzes the MIR of the function to determine supplementary
attributes. The results of this query for each function are written into the
crate metadata so that the deduced parameter attributes can be applied to
cross-crate functions. In this patch, we simply check the parameter for
mutations to determine whether the `readonly` attribute should be applied to
parameters that are indirect immutable freeze by-value.  More attributes could
conceivably be deduced in the future: `nocapture` and `noalias` come to mind.

Adding `readonly` to indirect function parameters where applicable enables some
potential optimizations in LLVM that are discussed in [issue 103103] and [PR
103070] around avoiding stack-to-stack memory copies that appear in functions
like `core::fmt::Write::write_fmt` and `core::panicking::assert_failed`. These
functions pass a large structure unchanged by value to a subfunction that also
doesn't mutate it. Since the structure in this case is passed as an indirect
parameter, it's a pointer from LLVM's perspective. As a result, the
intermediate copy of the structure that our codegen emits could be optimized
away by LLVM's MemCpyOptimizer if it knew that the pointer is `readonly
nocapture noalias` in both the caller and callee. We already pass `nocapture
noalias`, but we're missing `readonly`, as we can't determine whether a
by-value parameter is mutated by examining the signature in Rust. I didn't have
much success with having LLVM infer the `readonly` attribute, even with fat
LTO; it seems that deducing it at the MIR level is necessary.

No large benefits should be expected from this optimization *now*; LLVM needs
some changes (discussed in [PR 103070]) to more aggressively use the `noalias
nocapture readonly` combination in its alias analysis. I have some LLVM patches
for these optimizations and have had them looked over. With all the patches
applied locally, I enabled LLVM to remove all the `memcpy`s from the following
code:

```rust
fn main() {
    println!("Hello {}", 3);
}
```

which is a significant codegen improvement over the status quo. I expect that
if this optimization kicks in in multiple places even for such a simple
program, then it will apply to Rust code all over the place.

[issue 103103]: https://github.com/rust-lang/rust/issues/103103

[PR 103070]: https://github.com/rust-lang/rust/pull/103070

20 months agoreplaced wrong test with the correct mcve
Sarthak Singh [Fri, 21 Oct 2022 07:38:30 +0000 (13:08 +0530)]
replaced wrong test with the correct mcve

20 months agoAuto merge of #103308 - sunfishcode:sunfishcode/wasi-io-safety, r=joshtriplett
bors [Fri, 21 Oct 2022 04:05:02 +0000 (04:05 +0000)]
Auto merge of #103308 - sunfishcode:sunfishcode/wasi-io-safety, r=joshtriplett

Mark `std::os::wasi::io::AsFd` etc. as stable.

io_safety was stabilized in Rust 1.63, so mark the io_safety exports in `std::os::wasi::io` as stable.

Fixes #103306.

20 months agoAdd UI regression test when querying visibility of generic parameter
Guillaume Gomez [Tue, 13 Sep 2022 14:56:18 +0000 (16:56 +0200)]
Add UI regression test when querying visibility of generic parameter

20 months agoAdd ui test to ensure attributes generated from macros are kept as expected
Guillaume Gomez [Tue, 13 Sep 2022 13:30:16 +0000 (15:30 +0200)]
Add ui test to ensure attributes generated from macros are kept as expected

20 months agoAdd code comments and documentation
Guillaume Gomez [Tue, 13 Sep 2022 13:29:25 +0000 (15:29 +0200)]
Add code comments and documentation

20 months agoRemove doc comments only for private items or some specific doc comments
Guillaume Gomez [Tue, 13 Sep 2022 13:27:59 +0000 (15:27 +0200)]
Remove doc comments only for private items or some specific doc comments

20 months agoAdd missing @local_only on attributes
Guillaume Gomez [Tue, 13 Sep 2022 13:23:54 +0000 (15:23 +0200)]
Add missing @local_only on attributes

20 months agoChange process spawning to inherit the parent's signal mask by default
Rain [Fri, 23 Sep 2022 05:48:14 +0000 (22:48 -0700)]
Change process spawning to inherit the parent's signal mask by default

Previously, the signal mask is always reset when a child process is
started. This breaks tools like `nohup` which expect `SIGHUP` to be
blocked.

With this change, the default behavior changes to inherit the signal mask.

This also changes the signal disposition for `SIGPIPE` to only be
changed if the `#[unix_sigpipe]` attribute isn't set.

20 months agoupdate doc links
lcnr [Thu, 20 Oct 2022 21:47:49 +0000 (23:47 +0200)]
update doc links

20 months agoMake the whole `std::os::wasi::io` module stable.
Dan Gohman [Thu, 20 Oct 2022 21:31:11 +0000 (14:31 -0700)]
Make the whole `std::os::wasi::io` module stable.

20 months agoAuto merge of #103322 - matthiaskrgr:rollup-m9zgpft, r=matthiaskrgr
bors [Thu, 20 Oct 2022 21:08:28 +0000 (21:08 +0000)]
Auto merge of #103322 - matthiaskrgr:rollup-m9zgpft, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #103221 (Fix `SelfVisitor::is_self_ty` ICE)
 - #103230 (Clarify startup)
 - #103281 (Adjust `transmute{,_copy}` to be clearer about which of `T` and `U` is input vs output)
 - #103288 (Fixed docs typo in `library/std/src/time.rs`)
 - #103296 (+/- shortcut now only expand/collapse, not both)
 - #103297 (fix typo)
 - #103313 (Don't label `src/test` tests as `A-testsuite`)
 - #103315 (interpret: remove an incorrect assertion)
 - #103319 (Improve "`~const` is not allowed here" message)

Failed merges:

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

20 months agoRollup merge of #103319 - fee1-dead-contrib:improve_tilde_const_msg, r=oli-obk
Matthias Krüger [Thu, 20 Oct 2022 20:42:42 +0000 (22:42 +0200)]
Rollup merge of #103319 - fee1-dead-contrib:improve_tilde_const_msg, r=oli-obk

Improve "`~const` is not allowed here" message

r? `@oli-obk`

20 months agoRollup merge of #103315 - RalfJung:interpret-switchint-ice, r=bjorn3
Matthias Krüger [Thu, 20 Oct 2022 20:42:41 +0000 (22:42 +0200)]
Rollup merge of #103315 - RalfJung:interpret-switchint-ice, r=bjorn3

interpret: remove an incorrect assertion

This fixes an ICE in Miri, [reported](https://rust-lang.zulipchat.com/#narrow/stream/269128-miri/topic/SwitchInt.20with.20no.20targets.3F) by `@saethlin.` The faulty assertion was introduced by https://github.com/rust-lang/rust/commit/432535da2b5144d467056efcfa6864d35ba2de0f, when a previously correct assertion checking that the `otherwise` target exists got replaced by this assertion checking that at least one more target beyond `otherwise` exists.

Sadly we don't have a small reproducer so I don't think we can easily add a testcase.

20 months agoRollup merge of #103313 - compiler-errors:no-test, r=jyn514
Matthias Krüger [Thu, 20 Oct 2022 20:42:41 +0000 (22:42 +0200)]
Rollup merge of #103313 - compiler-errors:no-test, r=jyn514

Don't label `src/test` tests as `A-testsuite`

Nearly every PR modifies `src/test`; A-testsuite is meant to be for things affecting the test runners themselves.

cc https://github.com/rust-lang/rust/pull/103204#discussion_r1000868781

r? `@jyn514`

20 months agoRollup merge of #103297 - catandcoder:master, r=JohnTitor
Matthias Krüger [Thu, 20 Oct 2022 20:42:40 +0000 (22:42 +0200)]
Rollup merge of #103297 - catandcoder:master, r=JohnTitor

fix typo

20 months agoRollup merge of #103296 - GuillaumeGomez:collapse-expand-shortcuts, r=notriddle
Matthias Krüger [Thu, 20 Oct 2022 20:42:40 +0000 (22:42 +0200)]
Rollup merge of #103296 - GuillaumeGomez:collapse-expand-shortcuts, r=notriddle

+/- shortcut now only expand/collapse, not both

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

r? ```@notriddle```

20 months agoRollup merge of #103288 - johnmatthiggins:master, r=thomcc
Matthias Krüger [Thu, 20 Oct 2022 20:42:39 +0000 (22:42 +0200)]
Rollup merge of #103288 - johnmatthiggins:master, r=thomcc

Fixed docs typo in `library/std/src/time.rs`

* Changed comment from `Previous rust versions panicked when self was earlier than the current time.` to `Previous rust versions panicked when the current time was earlier than self.`
* Resolves #103282.

20 months agoRollup merge of #103281 - thomcc:long-overdue, r=jyn514
Matthias Krüger [Thu, 20 Oct 2022 20:42:39 +0000 (22:42 +0200)]
Rollup merge of #103281 - thomcc:long-overdue, r=jyn514

Adjust `transmute{,_copy}` to be clearer about which of `T` and `U` is input vs output

This is essentially a documentation-only change (although it does touch code in an irrelevant way).

20 months agoRollup merge of #103230 - nnethercote:clarify-startup, r=jyn514
Matthias Krüger [Thu, 20 Oct 2022 20:42:38 +0000 (22:42 +0200)]
Rollup merge of #103230 - nnethercote:clarify-startup, r=jyn514

Clarify startup

A small follow-up to #102769.

r? `@jyn514`

20 months agoRollup merge of #103221 - TaKO8Ki:fix-103202, r=oli-obk
Matthias Krüger [Thu, 20 Oct 2022 20:42:38 +0000 (22:42 +0200)]
Rollup merge of #103221 - TaKO8Ki:fix-103202, r=oli-obk

Fix `SelfVisitor::is_self_ty` ICE

Fixes #103202

20 months agorustdoc: improve appearance of source page navigation bar
Michael Howell [Thu, 20 Oct 2022 20:22:36 +0000 (13:22 -0700)]
rustdoc: improve appearance of source page navigation bar

This commit changes things so that the search bar is exactly centered between
the top of the page and the top of the source code content area.

20 months agoImprove "`~const` is not allowed here" message
Deadbeef [Thu, 20 Oct 2022 19:32:16 +0000 (19:32 +0000)]
Improve "`~const` is not allowed here" message

20 months agoElaborate supertrait bounds when triggering unused_must_use on impl Trait
Michael Goulet [Sun, 25 Sep 2022 22:23:36 +0000 (22:23 +0000)]
Elaborate supertrait bounds when triggering unused_must_use on impl Trait

20 months agointerpret: remove an incorrect assertion
Ralf Jung [Thu, 20 Oct 2022 17:06:34 +0000 (19:06 +0200)]
interpret: remove an incorrect assertion

20 months agono test in testsuite label
Michael Goulet [Thu, 20 Oct 2022 16:46:05 +0000 (16:46 +0000)]
no test in testsuite label

20 months agoAuto merge of #103092 - petrochenkov:weaklto, r=wesleywiser
bors [Thu, 20 Oct 2022 16:20:50 +0000 (16:20 +0000)]
Auto merge of #103092 - petrochenkov:weaklto, r=wesleywiser

linker: Fix weak lang item linking with combination windows-gnu + LLD + LTO

In https://github.com/rust-lang/rust/pull/100404 this logic was originally disabled for MSVC due to issues with LTO, but the same issues appear on windows-gnu with LLD because that LLD uses the same underlying logic as MSVC LLD, just with re-syntaxed command line options.

So this PR just disables it for LTO builds in general.

20 months agoadd increased recursion limit
lcnr [Thu, 20 Oct 2022 16:03:28 +0000 (18:03 +0200)]
add increased recursion limit

20 months agorustc_hir_typeck: fix clippy
lcnr [Thu, 20 Oct 2022 15:51:48 +0000 (17:51 +0200)]
rustc_hir_typeck: fix clippy

20 months agorustc_hir_typeck: fix paths and partially mv files
lcnr [Thu, 20 Oct 2022 15:51:37 +0000 (17:51 +0200)]
rustc_hir_typeck: fix paths and partially mv files

20 months agorustc_hir_typeck: move whole files
lcnr [Thu, 20 Oct 2022 13:52:05 +0000 (15:52 +0200)]
rustc_hir_typeck: move whole files

20 months agoMark `std::os::wasi::io::AsFd` etc. as stable.
Dan Gohman [Thu, 20 Oct 2022 15:04:19 +0000 (08:04 -0700)]
Mark `std::os::wasi::io::AsFd` etc. as stable.

io_safety was stabilized in Rust 1.63, so mark the io_safety exports in
`std::os::wasi::io` as stable.

Fixes #103306.

20 months agoSkip C-unwind fn pointer impls with the bootstrap compiler
Ryan Lopopolo [Thu, 20 Oct 2022 14:35:16 +0000 (07:35 -0700)]
Skip C-unwind fn pointer impls with the bootstrap compiler

These need to wait until #103239 makes it into the bootstrap compiler.

20 months agoAuto merge of #103290 - matthiaskrgr:rollup-ngozai3, r=matthiaskrgr
bors [Thu, 20 Oct 2022 13:33:50 +0000 (13:33 +0000)]
Auto merge of #103290 - matthiaskrgr:rollup-ngozai3, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #103197 (Stabilize proc_macro::Span::source_text)
 - #103251 (Fix item declaration highlighting)
 - #103262 (Adjusting test to needs-unwind, with linking issue)
 - #103268 (rustdoc: remove no-op CSS `nav.sub { font-size: 1rem }`)
 - #103272 (Remove extra spaces in docs)
 - #103276 (Erase regions before checking for `Default` in uninitialized binding error)

Failed merges:

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

20 months agoAuto merge of #103185 - chenyukang:yukang/fix-span-next-point, r=davidtwco
bors [Thu, 20 Oct 2022 10:40:09 +0000 (10:40 +0000)]
Auto merge of #103185 - chenyukang:yukang/fix-span-next-point, r=davidtwco

Fix the bug of next_point in source_map

There is a bug in `next_point`, the new span won't move to next position when be called in the first time.

For this reason, our current code is working like this:
1. When we really want to move to the next position, we called two times of `next_point`
2. Some code which use `next_point` actually done the same thing with `shrink_to_hi`

This fix make sure when `next_point` is called, span will move with the width at least 1, and also work correctly in the scenario of multiple bytes.

Ref: https://github.com/rust-lang/rust/pull/103140#discussion_r997710998

r? `@davidtwco`

20 months agofix typo
cui fliter [Thu, 20 Oct 2022 10:00:36 +0000 (18:00 +0800)]
fix typo

20 months agoAdd GUI tests for collapse/expand actions
Guillaume Gomez [Thu, 20 Oct 2022 09:34:40 +0000 (11:34 +0200)]
Add GUI tests for collapse/expand actions

20 months ago+/- shortcut now only expand/collapse, not both
Guillaume Gomez [Thu, 20 Oct 2022 09:33:31 +0000 (11:33 +0200)]
+/- shortcut now only expand/collapse, not both

20 months agoImplement assertions and fixes to not emit empty spans without suggestions
Kevin Per [Tue, 11 Oct 2022 16:17:59 +0000 (16:17 +0000)]
Implement assertions and fixes to not emit empty spans without suggestions

20 months agoRollup merge of #103276 - compiler-errors:default-on-uninit-ice, r=TaKO8Ki
Matthias Krüger [Thu, 20 Oct 2022 05:58:58 +0000 (07:58 +0200)]
Rollup merge of #103276 - compiler-errors:default-on-uninit-ice, r=TaKO8Ki

Erase regions before checking for `Default` in uninitialized binding error

Fixes #103250

20 months agoRollup merge of #103272 - clubby789:extra-spaces, r=thomcc
Matthias Krüger [Thu, 20 Oct 2022 05:58:57 +0000 (07:58 +0200)]
Rollup merge of #103272 - clubby789:extra-spaces, r=thomcc

Remove extra spaces in docs

Removing some random extra spaces in the examples for `core::sync::atomic`.

r? `@thomcc`

20 months agoRollup merge of #103268 - notriddle:notriddle/nav-sub-font-size, r=GuillaumeGomez
Matthias Krüger [Thu, 20 Oct 2022 05:58:57 +0000 (07:58 +0200)]
Rollup merge of #103268 - notriddle:notriddle/nav-sub-font-size, r=GuillaumeGomez

rustdoc: remove no-op CSS `nav.sub { font-size: 1rem }`

This rule originated as a `font-size: 16px`, when body had `font-size: 13px` set in 4fd061c426902b0904c65e64a3780b21f9ab3afb.

It remained even when body's font size was bumped up to 16px, 4d5f4ff5e9297dcad21612f9dd20ae4598b5b7e2, making the rule a no-op, and was carried forward when it was converted to 1rem in cc18120425a5c571a968d850c75cc935a8321136.

20 months agoRollup merge of #103262 - andrewpollack:switch-needs-unwind, r=tmandry
Matthias Krüger [Thu, 20 Oct 2022 05:58:56 +0000 (07:58 +0200)]
Rollup merge of #103262 - andrewpollack:switch-needs-unwind, r=tmandry

Adjusting test to needs-unwind, with linking issue

Test requires `needs-unwind` (see linked issue #103261)

20 months agoRollup merge of #103251 - GuillaumeGomez:item-decl-highlighting, r=notriddle
Matthias Krüger [Thu, 20 Oct 2022 05:58:56 +0000 (07:58 +0200)]
Rollup merge of #103251 - GuillaumeGomez:item-decl-highlighting, r=notriddle

Fix item declaration highlighting

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

As mentioned in the issue, https://github.com/rust-lang/rust/pull/102924 introduced this regression. This PR partially reverts it and adds a regression test.

r? `@notriddle`

20 months agoRollup merge of #103197 - est31:stabilize_proc_macro_source_text, r=petrochenkov
Matthias Krüger [Thu, 20 Oct 2022 05:58:55 +0000 (07:58 +0200)]
Rollup merge of #103197 - est31:stabilize_proc_macro_source_text, r=petrochenkov

Stabilize proc_macro::Span::source_text

Splits `proc_macro::Span::source_text` into a new feature gate and stabilizes it. The [FCP is complete](https://github.com/rust-lang/rust/issues/101991#issuecomment-1279393265).

```Rust
impl Span {
    pub fn source_text(&self) -> Option<String>;
}
```

Closes #101991

20 months agoAuto merge of #103220 - compiler-errors:deny-infers, r=lcnr
bors [Thu, 20 Oct 2022 05:56:56 +0000 (05:56 +0000)]
Auto merge of #103220 - compiler-errors:deny-infers, r=lcnr

Deny hashing ty/re/ct inference variables

cc `@cjgillot` and https://github.com/rust-lang/rust/pull/102695#issuecomment-1275706528
r? `@lcnr`

best reviewed one commit at a time, mostly because the second commit that fixes `ClosureOutlivesRequirement` is mostly noise because of losing its `<'tcx>` lifetime parameter.

20 months agoAdjust `transmute{,_copy}` to be clearer about which of `T` and `U` is input vs output
Thom Chiovoloni [Thu, 20 Oct 2022 02:07:24 +0000 (19:07 -0700)]
Adjust `transmute{,_copy}` to be clearer about which of `T` and `U` is input vs output

20 months agocheck if impl_self is `Some`
Takayuki Maeda [Thu, 20 Oct 2022 05:10:52 +0000 (14:10 +0900)]
check if impl_self is `Some`

20 months agoFixed docs typo in `library/std/src/time.rs`
John Higgins [Thu, 20 Oct 2022 04:49:29 +0000 (21:49 -0700)]
Fixed docs typo in `library/std/src/time.rs`

20 months agoAuto merge of #103205 - spastorino:fix-rpits-lifetime-remapping, r=cjgillot
bors [Thu, 20 Oct 2022 03:07:17 +0000 (03:07 +0000)]
Auto merge of #103205 - spastorino:fix-rpits-lifetime-remapping, r=cjgillot

Do anonymous lifetimes remapping correctly for nested rpits

Closes #103141

r? `@cjgillot` `@nikomatsakis`

This fixes a stable to stable regression that in my opinion is `P-critical` so, we probably want to backport it all the way up to stable.

20 months agoUpdate stability annotations on fnptr impls for C-unwind ABI
Ryan Lopopolo [Wed, 19 Oct 2022 22:29:30 +0000 (15:29 -0700)]
Update stability annotations on fnptr impls for C-unwind ABI

20 months agoBless ui tests
Ryan Lopopolo [Thu, 1 Sep 2022 05:55:04 +0000 (22:55 -0700)]
Bless ui tests

20 months agoAdd default trait implementations for "c-unwind" ABI function pointers
Ryan Lopopolo [Thu, 1 Sep 2022 05:14:40 +0000 (22:14 -0700)]
Add default trait implementations for "c-unwind" ABI function pointers

Following up on #92964, only add default trait implementations for the
`c-unwind` family of function pointers. The previous attempt in #92964
added trait implementations for many more ABIs and ran into concerns
regarding the increase in size of the libcore rlib.

An attempt to abstract away function pointer types behind a unified
trait to reduce the duplication of trait impls is being discussed in #99531
but this change looks to be blocked on a lang MCP.

Following @RalfJung's suggestion in
https://github.com/rust-lang/rust/pull/99531#issuecomment-1233440142,
this commit is another cut at #92964 but it _only_ adds the impls for
`extern "C-unwind" fn` and `unsafe extern "C-unwind" fn`.

I am interested in landing this patch to unblock the stabilization of
the `c_unwind` feature.

RFC: https://github.com/rust-lang/rfcs/pull/2945
Tracking Issue: https://github.com/rust-lang/rust/issues/74990

20 months agoAdjusting test to needs-unwind, with linking issue
Andrew Pollack [Wed, 19 Oct 2022 19:02:55 +0000 (19:02 +0000)]
Adjusting test to needs-unwind, with linking issue

20 months agoAuto merge of #102417 - oli-obk:opaque_lifetimes2, r=jackh726
bors [Thu, 20 Oct 2022 00:22:17 +0000 (00:22 +0000)]
Auto merge of #102417 - oli-obk:opaque_lifetimes2, r=jackh726

Require lifetime bounds for opaque types in order to allow hidden types to capture said lifetimes

fixes #96996

cc `@aliemjay`

20 months agoErase regions before checking for default in uninitialized binding error
Michael Goulet [Wed, 19 Oct 2022 23:35:47 +0000 (23:35 +0000)]
Erase regions before checking for default in uninitialized binding error

20 months agoRemove extra spaces
clubby789 [Wed, 19 Oct 2022 22:54:00 +0000 (23:54 +0100)]
Remove extra spaces

20 months agoAuto merge of #103264 - matthiaskrgr:rollup-3ja4spo, r=matthiaskrgr
bors [Wed, 19 Oct 2022 21:17:09 +0000 (21:17 +0000)]
Auto merge of #103264 - matthiaskrgr:rollup-3ja4spo, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #103211 (rustdoc: remove class name `location` from sidebar sibling nav)
 - #103223 (Use already checked RHS ty for LHS deref suggestions)
 - #103237 (Clean up codeblock-tooltip rustdoc-gui test)
 - #103239 (Allow #[unstable] impls for fn() with unstable abi.)
 - #103246 (Mark `rust-analyzer` as a host-only tool)
 - #103257 (rustdoc: move `setting-line` color CSS to settings.css)
 - #103258 (Make miri read_dir test a little more robust)

Failed merges:

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

20 months agorustdoc: remove no-op CSS `nav.sub { font-size: 1rem }`
Michael Howell [Wed, 19 Oct 2022 20:57:39 +0000 (13:57 -0700)]
rustdoc: remove no-op CSS `nav.sub { font-size: 1rem }`

This rule originated as a `font-size: 16px`, when body had `font-size: 13px`
set in 4fd061c426902b0904c65e64a3780b21f9ab3afb.

It remained even when body's font size was bumped up to 16px,
4d5f4ff5e9297dcad21612f9dd20ae4598b5b7e2, making the rule a no-op, and was
carried forward when it was converted to 1rem in
cc18120425a5c571a968d850c75cc935a8321136.

20 months agoDo anonymous lifetimes remapping correctly for nested rpits
Santiago Pastorino [Tue, 18 Oct 2022 17:05:17 +0000 (14:05 -0300)]
Do anonymous lifetimes remapping correctly for nested rpits

20 months agoExtract orig_opt_local_def_id as a function
Santiago Pastorino [Wed, 19 Oct 2022 19:49:21 +0000 (16:49 -0300)]
Extract orig_opt_local_def_id as a function

20 months agoRollup merge of #103258 - SUPERCILEX:miri, r=RalfJung
Matthias Krüger [Wed, 19 Oct 2022 19:38:42 +0000 (21:38 +0200)]
Rollup merge of #103258 - SUPERCILEX:miri, r=RalfJung

Make miri read_dir test a little more robust

r? `@RalfJung`

20 months agoRollup merge of #103257 - notriddle:notriddle/setting-line, r=GuillaumeGomez
Matthias Krüger [Wed, 19 Oct 2022 19:38:42 +0000 (21:38 +0200)]
Rollup merge of #103257 - notriddle:notriddle/setting-line, r=GuillaumeGomez

rustdoc: move `setting-line` color CSS to settings.css

20 months agoRollup merge of #103246 - ferrocene:pa-rust-analyzer-hosts, r=Mark-Simulacrum
Matthias Krüger [Wed, 19 Oct 2022 19:38:41 +0000 (21:38 +0200)]
Rollup merge of #103246 - ferrocene:pa-rust-analyzer-hosts, r=Mark-Simulacrum

Mark `rust-analyzer` as a host-only tool

All tools meant to be shipped with host toolchains only should be marked as `ONLY_HOSTS = true`, but rust-analyzer was marked as `ONLY_HOSTS = false` incorrectly. This meant that bootstrap attempted to build rust-analyzer for cross-compilation-only targets, causing errors because libstd is not present on some of them.

It will still be possible to cross-compile rust-analyzer by passing a different `--host` flag to `./x`, like you can cross-compile other tools.

The problem can be reproduced by running:

```
./x build src/tools/rust-analyzer --target x86_64-unknown-linux-gnu,aarch64-unknown-none
```

20 months agoRollup merge of #103239 - m-ou-se:unstable-abi-fn-impl-check, r=lcnr
Matthias Krüger [Wed, 19 Oct 2022 19:38:41 +0000 (21:38 +0200)]
Rollup merge of #103239 - m-ou-se:unstable-abi-fn-impl-check, r=lcnr

Allow #[unstable] impls for fn() with unstable abi.

This allows `#[unstable]` trait impls for `extern "unwind-C" fn()`, based on the fact that that abi and therefore that type is unstable.

See https://github.com/rust-lang/rust/pull/101263#issuecomment-1283099947

20 months agoRollup merge of #103237 - GuillaumeGomez:codeblock-tooltip-cleanup, r=notriddle
Matthias Krüger [Wed, 19 Oct 2022 19:38:40 +0000 (21:38 +0200)]
Rollup merge of #103237 - GuillaumeGomez:codeblock-tooltip-cleanup, r=notriddle

Clean up codeblock-tooltip rustdoc-gui test

r? ``@notriddle``

20 months agoRollup merge of #103223 - compiler-errors:deref-sugg-slow, r=wesleywiser
Matthias Krüger [Wed, 19 Oct 2022 19:38:40 +0000 (21:38 +0200)]
Rollup merge of #103223 - compiler-errors:deref-sugg-slow, r=wesleywiser

Use already checked RHS ty for LHS deref suggestions

There's no reason to do the `check_lhs_assignable` and RHS `check_expr_with_hint` in that order, so invert them and use the typeck results to avoid exponential blowup on error.

Fixes #103219

20 months agoRollup merge of #103211 - notriddle:notriddle/dot-location, r=GuillaumeGomez
Matthias Krüger [Wed, 19 Oct 2022 19:38:39 +0000 (21:38 +0200)]
Rollup merge of #103211 - notriddle:notriddle/dot-location, r=GuillaumeGomez

rustdoc: remove class name `location` from sidebar sibling nav

Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-location/std/vec/struct.Vec.html

This change tweaks the CSS to apply most of its styles to `.sidebar h2`, cleaning up a few redundant rules from `.mobile-topbar .location` and restoring useful navigation aids in mobile mode.

## Before

![location-before](https://user-images.githubusercontent.com/1593513/196521014-d8730830-c3a2-4ed7-9266-05454cd31e05.png)

## After

![location-after](https://user-images.githubusercontent.com/1593513/196521020-75ec1fa5-b3dc-4c5d-97b6-afccb5fbe00a.png)