about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-10-03 19:12:17 +0200
committerGitHub <noreply@github.com>2022-10-03 19:12:17 +0200
commit2e7e17a84abea8f4c3e2d95ce432ef784af06bef (patch)
tree6ed48fc9816df9eee3bde078a2526d6100bb9365 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent33d351972ad9c43bc30e87edd2765de9a4898629 (diff)
parenta5402343f60271c7e428bb6e6aac704bd88bb2bf (diff)
downloadrust-2e7e17a84abea8f4c3e2d95ce432ef784af06bef.tar.gz
rust-2e7e17a84abea8f4c3e2d95ce432ef784af06bef.zip
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
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions