Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tguichaoua opened this issue Jun 13, 2024 · 1 comment
Open
Assignees
Labels
A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate C-bug Category: This is a bug. F-associated_type_bounds `#![feature(associated_type_bounds)]` T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@tguichaoua
Copy link
Contributor

tguichaoua commented Jun 13, 2024

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
@tguichaoua tguichaoua added the C-bug Category: This is a bug. label Jun 13, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 13, 2024
@compiler-errors compiler-errors added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jun 13, 2024
@fmease fmease added F-associated_type_bounds `#![feature(associated_type_bounds)]` A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 14, 2024
@fmease fmease self-assigned this Jun 14, 2024
@fmease
Copy link
Member

fmease commented Jun 14, 2024

Right, thanks for your report! It was already tracked in my internal issue tracker but since assoc ty bounds are now stable I will up the priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate C-bug Category: This is a bug. F-associated_type_bounds `#![feature(associated_type_bounds)]` T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants