Skip to content

Docs produce invalid type when using bounds in associated type position #126432

Open
@tguichaoua

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

Metadata

Assignees

Labels

A-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateC-bugCategory: This is a bug.F-associated_type_bounds`#![feature(associated_type_bounds)]`T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions