Files
rust/src/test/rustdoc
Matthias Krüger 2e7e17a84a Rollup merge of #102439 - fmease:rustdoc-simplify-cross-crate-trait-bounds, r=GuillaumeGomez
rustdoc: re-sugar more cross-crate trait bounds

Previously, we would only ever re-sugar cross-crate predicates like `Type: Trait, <Type as Trait>::Name == Rhs` to `Type: Trait<Name = Rhs>` if the `Type` was a generic parameter like `Self` or `T`. With this PR, `Type` can be any type.

Most notably, this means that we now re-sugar predicates involving associated types (where `Type` is of the form `Self::Name`) which are then picked up by the pre-existing logic that re-sugars them into bounds. As a result of that, the associated type `IntoIter` of `std`'s `IntoIterator` trait (re-exported from `core`) is no longer rendered as:

```rust
type IntoIter: Iterator
where
    <Self::IntoIter as Iterator>::Item == Self::Item;
```

but as one would expect: `type IntoIter: Iterator<Item = Self::Item>;`.

Cross-crate closure bounds like `F: Fn(i32) -> bool` are now also rendered properly (previously, the return type (`Self::Output`) would not be rendered and we would show the underlying equality predicate).

Fixes #77763.
Fixes #84579.
Fixes #102142.

`@rustbot` label T-rustdoc A-cross-crate-reexports
r? rustdoc
2022-10-03 19:12:17 +02:00
..
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2022-08-13 00:52:16 -04:00
2022-07-06 14:58:46 +02:00
2021-12-12 11:20:03 +00:00
2021-12-12 11:20:03 +00:00
2022-02-02 00:29:33 -08:00
2022-02-02 00:29:33 -08:00
2018-12-25 21:08:33 -07:00
2022-07-05 21:33:39 +02:00
2019-10-29 13:42:55 +01:00
2020-11-12 14:58:07 +01:00
2022-09-10 10:18:32 +02:00
2020-02-29 20:47:10 +03:00
2022-08-13 00:52:16 -04:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2021-06-02 20:30:18 +02:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2022-08-13 00:52:16 -04:00
2021-02-20 17:51:41 -07:00
2021-06-02 20:30:18 +02:00
2018-12-25 21:08:33 -07:00
2022-04-14 21:12:13 -04:00
2018-12-25 21:08:33 -07:00
2022-07-05 21:33:39 +02:00
2022-04-14 21:12:13 -04:00
2018-12-25 21:08:33 -07:00
2022-08-31 18:24:55 +08:00
2022-08-13 00:52:16 -04:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2022-08-13 00:52:16 -04:00
2022-08-13 00:52:16 -04:00
2022-08-13 00:52:16 -04:00
2022-07-05 21:33:39 +02:00
2022-08-31 18:24:55 +08:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2022-08-31 18:13:39 +02:00
2018-12-25 21:08:33 -07:00
2021-06-02 20:30:18 +02:00
2022-08-31 18:13:39 +02:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2019-04-22 16:57:01 +01:00
2018-12-25 21:08:33 -07:00
2022-08-13 00:52:16 -04:00
2018-12-25 21:08:33 -07:00
2022-01-08 09:49:41 -05:00
2018-12-25 21:08:33 -07:00
2022-08-13 00:52:16 -04:00
2019-02-10 23:42:32 +00:00
2018-12-25 21:08:33 -07:00
2022-08-13 00:52:16 -04:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2022-08-13 00:52:16 -04:00
2022-08-18 17:47:40 +02:00
2022-08-13 00:52:16 -04:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2022-02-02 00:29:33 -08:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2022-08-13 00:52:16 -04:00
2022-08-31 18:13:39 +02:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2019-04-22 16:57:01 +01:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2022-08-20 13:33:41 +02:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2021-06-02 20:30:18 +02:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2022-08-13 00:52:16 -04:00
2022-02-02 00:29:33 -08:00
2019-04-22 16:57:01 +01:00
2021-06-02 20:30:18 +02:00
2021-06-02 20:30:18 +02:00
2022-07-05 21:33:39 +02:00
2022-02-02 00:29:33 -08:00
2022-08-13 00:52:16 -04:00
2022-04-25 13:31:53 -07:00
2022-09-14 22:19:43 +01:00
2018-12-25 21:08:33 -07:00
2022-08-14 13:31:46 +02:00
2021-08-28 00:24:39 -07:00
2021-08-28 00:24:39 -07:00
2022-08-13 00:52:16 -04:00
2018-12-25 21:08:33 -07:00
2022-08-13 00:52:16 -04:00
2021-06-02 20:30:18 +02:00
2018-12-25 21:08:33 -07:00
2022-08-13 00:52:16 -04:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2021-06-02 20:30:18 +02:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2022-08-13 00:52:16 -04:00
2018-12-25 21:08:33 -07:00
2022-08-13 00:52:16 -04:00
2021-04-05 00:29:43 +01:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2021-05-02 12:29:23 -07:00
2018-12-25 21:08:33 -07:00
2022-06-18 10:35:19 -07:00
2022-08-13 00:52:16 -04:00
2020-10-29 11:43:21 +01:00
2021-06-04 08:05:54 -04:00
2019-04-03 22:18:41 +02:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2022-08-31 18:13:39 +02:00
2018-12-25 21:08:33 -07:00
2019-02-09 14:29:03 +01:00