Skip to content

allow(rustdoc::broken_intra_doc_links) not propagated to methods copied across due to Deref/DerefMut impl #135108

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

Closed
joshtriplett opened this issue Jan 4, 2025 · 0 comments

Comments

@joshtriplett
Copy link
Member

library/core/src/slice/mod.rs has this on binary_search_by_key:

    // Lint rustdoc::broken_intra_doc_links is allowed as `slice::sort_by_key` is
    // in crate `alloc`, and as such doesn't exists yet when building `core`: #74481.
    // This breaks links when slice is displayed in core, but changing it to use relative links
    // would break when the item is re-exported. So allow the core links to be broken for now.
    #[allow(rustdoc::broken_intra_doc_links)]

That fixes the issue for the documentation generated in that file. However, adding another type in a different file with a Deref to a slice (e.g. a Deref to [u8]) will result in broken intra-doc links for that file as well, and the allow won't be taken into account for those.

Using allow(rustdoc::broken_intra_doc_links) on a method should apply to any copies of that method propagated due to Deref/DerefMut.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 4, 2025
@joshtriplett joshtriplett added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jan 4, 2025
@joshtriplett joshtriplett closed this as not planned Won't fix, can't repro, duplicate, stale Jan 5, 2025
@jieyouxu jieyouxu removed T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants