diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:42 +0000 |
commit | 837b550238aa671a591ccf282dddeab29cadb206 (patch) | |
tree | 914b6b8862bace72bd3245ca184d374b08d8a672 /src/librustdoc/config.rs | |
parent | Adding debian version 1.70.0+dfsg2-1. (diff) | |
download | rustc-837b550238aa671a591ccf282dddeab29cadb206.tar.xz rustc-837b550238aa671a591ccf282dddeab29cadb206.zip |
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/librustdoc/config.rs')
-rw-r--r-- | src/librustdoc/config.rs | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs index 1be4f364e..9f08609a6 100644 --- a/src/librustdoc/config.rs +++ b/src/librustdoc/config.rs @@ -314,7 +314,6 @@ impl Options { matches: &getopts::Matches, args: Vec<String>, ) -> Result<(Options, RenderOptions), i32> { - let args = &args[1..]; // Check for unstable options. nightly_options::check_nightly_options(matches, &opts()); @@ -382,7 +381,7 @@ impl Options { match kind.parse() { Ok(kind) => emit.push(kind), Err(()) => { - diag.err(&format!("unrecognized emission type: {}", kind)); + diag.err(format!("unrecognized emission type: {}", kind)); return Err(1); } } @@ -491,7 +490,7 @@ impl Options { // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset // // The original key values we have are the same as the DOM storage API keys and the - // command line options, so contain `-`. Our Javascript needs to be able to look + // command line options, so contain `-`. Our JavaScript needs to be able to look // these values up both in `dataset` and in the storage API, so it needs to be able // to convert the names back and forth. Despite doing this kebab-case to // StudlyCaps transformation automatically, the JS DOM API does not provide a @@ -559,28 +558,28 @@ impl Options { matches.opt_strs("theme").iter().map(|s| (PathBuf::from(&s), s.to_owned())) { if !theme_file.is_file() { - diag.struct_err(&format!("invalid argument: \"{}\"", theme_s)) + diag.struct_err(format!("invalid argument: \"{}\"", theme_s)) .help("arguments to --theme must be files") .emit(); return Err(1); } if theme_file.extension() != Some(OsStr::new("css")) { - diag.struct_err(&format!("invalid argument: \"{}\"", theme_s)) + diag.struct_err(format!("invalid argument: \"{}\"", theme_s)) .help("arguments to --theme must have a .css extension") .emit(); return Err(1); } let (success, ret) = theme::test_theme_against(&theme_file, &paths, &diag); if !success { - diag.struct_err(&format!("error loading theme file: \"{}\"", theme_s)).emit(); + diag.struct_err(format!("error loading theme file: \"{}\"", theme_s)).emit(); return Err(1); } else if !ret.is_empty() { - diag.struct_warn(&format!( + diag.struct_warn(format!( "theme file \"{}\" is missing CSS rules from the default theme", theme_s )) .warn("the theme may appear incorrect when loaded") - .help(&format!( + .help(format!( "to see what rules are missing, call `rustdoc --check-theme \"{}\"`", theme_s )) @@ -611,7 +610,7 @@ impl Options { match matches.opt_str("r").as_deref() { Some("rust") | None => {} Some(s) => { - diag.struct_err(&format!("unknown input format: {}", s)).emit(); + diag.struct_err(format!("unknown input format: {}", s)).emit(); return Err(1); } } @@ -631,7 +630,7 @@ impl Options { let crate_types = match parse_crate_types_from_list(matches.opt_strs("crate-type")) { Ok(types) => types, Err(e) => { - diag.struct_err(&format!("unknown crate type: {}", e)).emit(); + diag.struct_err(format!("unknown crate type: {}", e)).emit(); return Err(1); } }; @@ -649,7 +648,7 @@ impl Options { out_fmt } Err(e) => { - diag.struct_err(&e).emit(); + diag.struct_err(e).emit(); return Err(1); } }, @@ -790,7 +789,7 @@ fn check_deprecated_options(matches: &getopts::Matches, diag: &rustc_errors::Han for &flag in deprecated_flags.iter() { if matches.opt_present(flag) { - diag.struct_warn(&format!("the `{}` flag is deprecated", flag)) + diag.struct_warn(format!("the `{}` flag is deprecated", flag)) .note( "see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \ for more information", @@ -803,7 +802,7 @@ fn check_deprecated_options(matches: &getopts::Matches, diag: &rustc_errors::Han for &flag in removed_flags.iter() { if matches.opt_present(flag) { - let mut err = diag.struct_warn(&format!("the `{}` flag no longer functions", flag)); + let mut err = diag.struct_warn(format!("the `{}` flag no longer functions", flag)); err.note( "see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \ for more information", |