rust-lang / rust-lang/rust

Docs produce invalid type when using bounds in associated type position

Open
#126,432 1 comment 0 reactions 1 assignee View on GitHub

@fmease is already working on this.

Since Jun 14, 2024.

A-cross-crate-reexports C-bug F-associated_type_bounds T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

When using bounds in associated type position on a re-exported function or trait from another crate, the docs produces invalid type.

// In crate A
pub fn debug_iter() -> impl Iterator<Item: core::fmt::Debug> {
    core::iter::empty::<u8>()
}
// In crate B
pub use A::debug_iter;
// cargo doc -p A
pub fn debug_iter() -> impl Iterator<Item: Debug>
// cargo doc -p B
pub fn debug_iter() -> impl Iterator + Debug
Meta

rustc --version --verbose:

rustc 1.81.0-nightly (8337ba918 2024-06-12)
binary: rustc
commit-hash: 8337ba9189de188e2ed417018af2bf17a57d51ac
commit-date: 2024-06-12
host: x86_64-pc-windows-msvc
release: 1.81.0-nightly
LLVM version: 18.1.7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.