Make meta-item API compatible with LocalInternedString::get soundness fix
This commit is contained in:
@@ -521,21 +521,21 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
|
||||
for attr in krate.module.as_ref().unwrap().attrs.lists("doc") {
|
||||
let diag = ctxt.sess().diagnostic();
|
||||
|
||||
let name = attr.ident_str();
|
||||
let name = attr.name_or_empty();
|
||||
if attr.is_word() {
|
||||
if name == Some("no_default_passes") {
|
||||
if name == "no_default_passes" {
|
||||
report_deprecated_attr("no_default_passes", diag);
|
||||
if default_passes == passes::DefaultPassOption::Default {
|
||||
default_passes = passes::DefaultPassOption::None;
|
||||
}
|
||||
}
|
||||
} else if let Some(value) = attr.value_str() {
|
||||
let sink = match name {
|
||||
Some("passes") => {
|
||||
let sink = match name.get() {
|
||||
"passes" => {
|
||||
report_deprecated_attr("passes = \"...\"", diag);
|
||||
&mut manual_passes
|
||||
},
|
||||
Some("plugins") => {
|
||||
"plugins" => {
|
||||
report_deprecated_attr("plugins = \"...\"", diag);
|
||||
eprintln!("WARNING: #![doc(plugins = \"...\")] no longer functions; \
|
||||
see CVE-2018-1000622");
|
||||
@@ -548,7 +548,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
|
||||
}
|
||||
}
|
||||
|
||||
if attr.is_word() && name == Some("document_private_items") {
|
||||
if attr.is_word() && name == "document_private_items" {
|
||||
if default_passes == passes::DefaultPassOption::Default {
|
||||
default_passes = passes::DefaultPassOption::Private;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user