While digging around in librustdoc, i found this little nugget:
|
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.
While digging around in librustdoc, i found this little nugget:
rust/src/librustdoc/lib.rs
Lines 593 to 610 in 16362c7
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--pluginsCLI flags. It would be useful to provide an analogue to--document-private-itemsand emit deprecation warnings for these attributes, as part of deprecating passes and plugins generally.