Skip to content

doc(cfg) doesn't inherit down onto trait impls in modules #79201

Closed
@Nemo157

Description

@Nemo157

I tried this code:

#![feature(doc_cfg)]

pub trait Foo {}

#[doc(cfg(feature = "foobar"))]
impl crate::Foo for usize {}

#[doc(cfg(feature = "foobar"))]
mod imp {
    impl crate::Foo for () {}
}

I expected to see this happen: both impls being highlighted as needing the foobar feature.

Instead, this happened: only the usize impl got the message:

image

Meta

rustdoc 1.50.0-nightly (825637983 2020-11-18)
binary: rustdoc
commit-hash: 8256379832b5ecb7f71e8c5e2018446482223c12
commit-date: 2020-11-18
host: x86_64-unknown-linux-gnu
release: 1.50.0-nightly

Metadata

Metadata

Assignees

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