Skip to content

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

Closed as not planned
@joshtriplett

Description

@joshtriplett

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions