Skip to content

doc(cfg()) doesn't follow hide/show rules #162085

Description

@GuillaumeGomez

Can be seen with this code:

#![feature(doc_cfg)]
#![doc(auto_cfg(hide(
    target_pointer_width, values("64"),
)))]

pub trait Trait {
    fn f(&self) {}
}

pub struct X;

#[doc(cfg(any(target_pointer_width = "64", target_arch = "wasm32")))]
#[doc(auto_cfg(hide(target_arch, values("wasm32"))))]
mod imp {
    impl super::Trait for super::X { fn f(&self) {} }
}

Part of #43781.

Metadata

Metadata

Labels

C-bugCategory: This is a bug.F-doc_cfg`#![feature(doc_cfg)]`T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions