Skip to content

rustdoc does not warn about misuse of html render option attributes #149187

@lolbinarycat

Description

@lolbinarycat

Code

#![doc(html_favicon_url)]
#![doc(html_logo_url)]
#![doc(html_playground_url)]
#![doc(issue_tracker_base_url)]
#![doc(html_no_source = "asdf")]

Expected Outcome

Rustdoc should emit a separate warning or error for each attribute misuse.

I would recommend a new lint (eg. rustdoc::bad_render_attr), which would be introduced as warn by default, then upgraded to deny by default, and eventually made a hard error over an edition.

Actual Output

All attributes are silently ignored.

Version

rustdoc 1.93.0-nightly (53732d5 2025-11-20)

Additional Details

Rustdoc also needs to handle cases like #![doc(html_logo_url = 3)] (mismatched type instead of missing argument).

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions