Skip to content

Rustdoc should give an error if you set both doc(inline) and doc(no_inline) #80275

Closed
@jyn514

Description

@jyn514

Given the following code:

#![crate_type = "lib"]

pub mod inner {
    pub struct S;
}

#[doc(inline)]
#[doc(no_inline)]
pub use inner::S;

Rustdoc will generate image
This is bogus: rustdoc is ignoring one of the attributes. Instead, it should give an error that you can't apply both attributes to the same item.

Thought of while reviewing #80267.

Metadata

Metadata

Labels

C-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.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