Skip to content

rustdoc: cannot resolve links to associated items on more complex primitive types #92536

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

Open
mdibaiee opened this issue Jan 3, 2022 · 2 comments
Labels
A-associated-items Area: Associated items (types, constants & functions) A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@mdibaiee
Copy link
Contributor

mdibaiee commented Jan 3, 2022

As a continuation of #90703

#92443 fixes this for "simple" primitives such as:
char, str, bool, never, usize, u{8, 16, 32, 64, 128}, isize, i{8, 16, 32, 64, 128} and f32, f64. However, for types that wrap around other types, such as Tuple, Array, Slice, RawPtr, etc. I was not able to make it work at first try. See the discussion here: #92443 (comment)

Basically we want these comments to have links to the respective primitive type's implementation, e.g.:

/// [`<&[u32]>::fmt()`] [`<(u32, u32)>::eq()`]

Should link to

Note that for the tuple, we ideally want to link to the implementation for the specified size of the tuple.

Not sure if we also need to know whether the type inside the tuple actually has the necessary traits, e.g. in the case of [(a, b)::fmt()], a and b should also have Debug. This is pretty complex and we might be able to get away without it.

@mdibaiee
Copy link
Contributor Author

mdibaiee commented Jan 3, 2022

@rustbot label +T-rustdoc +A-intra-doc-links

@rustbot rustbot added A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jan 3, 2022
@camelid camelid changed the title rustdoc: cannot resolve links to associated trait items for complex primitives rustdoc: cannot resolve links to associated trait items for generic primitives Jan 3, 2022
@fmease

This comment has been minimized.

@fmease fmease added A-associated-items Area: Associated items (types, constants & functions) C-bug Category: This is a bug. labels Sep 6, 2023
@fmease fmease changed the title rustdoc: cannot resolve links to associated trait items for generic primitives rustdoc: cannot resolve links to associated items on more complex primitive types Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-associated-items Area: Associated items (types, constants & functions) A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-bug Category: This is a bug. 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

3 participants