Skip to content

rustdoc: deprecate #![doc(no_default_passes)], #![doc(passes "...")], #![doc(plugins = "...")] #48164

Closed
@QuietMisdreavus

Description

@QuietMisdreavus

While digging around in librustdoc, i found this little nugget:

rust/src/librustdoc/lib.rs

Lines 593 to 610 in 16362c7

for attr in krate.module.as_ref().unwrap().attrs.lists("doc") {
let name = attr.name().map(|s| s.as_str());
let name = name.as_ref().map(|s| &s[..]);
if attr.is_word() {
if name == Some("no_default_passes") {
default_passes = false;
}
} else if let Some(value) = attr.value_str() {
let sink = match name {
Some("passes") => &mut passes,
Some("plugins") => &mut plugins,
_ => continue,
};
for p in value.as_str().split_whitespace() {
sink.push(p.to_string());
}
}
}

What this does is handle the #![doc(no_default_passes)], #![doc(passes "...")], and #![doc(plugins = "...")] attributes the same way as the --no-defaults, --passes, and --plugins CLI flags. It would be useful to provide an analogue to --document-private-items and emit deprecation warnings for these attributes, as part of deprecating passes and plugins generally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.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