Skip to content

docs.rs failing to resolve links to feature gated items even though all-features is set to true #2100

Closed
@sam0x17

Description

@sam0x17

This is for the crate macro_magic: https://crates.io/crates/macro_magic

On this page I have some links to some things that are feature-gated within my crate: https://docs.rs/macro_magic/0.2.12/macro_magic/attr.export_tokens.html

Notice that the links to things in syn and local feature gated items are all broken (this did not happen before the feature gating).

I deal with this by always running cargo doc locally with cargo doc --all-features. Under these conditions all the links resolve fine and everything in my crate is properly documented.

To get this to work in docs.rs, I was told to add the following to my Cargo.toml, which I did several versions ago.

[package.metadata.docs.rs]
all-features = true

However, docs.rs still isn't resolving links to any of the feature gated items, whether they be to items in optional external crates like syn, or local constants and things that are feature gated. Links to anything feature gated will not work.

Strangely, however, I am able to go to the doc pages for those things, I just can't link to them. I think this is a legitimate bug in docs.rs

That said, happy to hear if there is a quick fix as I'm mostly just trying to fix my docs and I haven't seen this be an issue for other similar crates so I don't know what is going on

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