diff options
Diffstat (limited to 'src/librustdoc/config.rs')
| -rw-r--r-- | src/librustdoc/config.rs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs index 614a64d4020..3f7f9270b2d 100644 --- a/src/librustdoc/config.rs +++ b/src/librustdoc/config.rs @@ -421,7 +421,7 @@ impl Options { let paths = match theme::load_css_paths(content) { Ok(p) => p, Err(e) => { - dcx.struct_err(e).emit(); + dcx.err(e); return Err(1); } }; @@ -452,10 +452,10 @@ impl Options { let input = PathBuf::from(if describe_lints { "" // dummy, this won't be used } else if matches.free.is_empty() { - dcx.struct_err("missing file operand").emit(); + dcx.err("missing file operand"); return Err(1); } else if matches.free.len() > 1 { - dcx.struct_err("too many file operands").emit(); + dcx.err("too many file operands"); return Err(1); } else { &matches.free[0] @@ -467,7 +467,7 @@ impl Options { let extern_html_root_urls = match parse_extern_html_roots(matches) { Ok(ex) => ex, Err(err) => { - dcx.struct_err(err).emit(); + dcx.err(err); return Err(1); } }; @@ -534,7 +534,7 @@ impl Options { let output = matches.opt_str("output").map(|s| PathBuf::from(&s)); let output = match (out_dir, output) { (Some(_), Some(_)) => { - dcx.struct_err("cannot use both 'out-dir' and 'output' at once").emit(); + dcx.err("cannot use both 'out-dir' and 'output' at once"); return Err(1); } (Some(out_dir), None) => out_dir, @@ -549,7 +549,7 @@ impl Options { if let Some(ref p) = extension_css { if !p.is_file() { - dcx.struct_err("option --extend-css argument must be a file").emit(); + dcx.err("option --extend-css argument must be a file"); return Err(1); } } @@ -567,7 +567,7 @@ impl Options { let paths = match theme::load_css_paths(content) { Ok(p) => p, Err(e) => { - dcx.struct_err(e).emit(); + dcx.err(e); return Err(1); } }; @@ -577,26 +577,26 @@ impl Options { { if !theme_file.is_file() { dcx.struct_err(format!("invalid argument: \"{theme_s}\"")) - .help_mv("arguments to --theme must be files") + .with_help("arguments to --theme must be files") .emit(); return Err(1); } if theme_file.extension() != Some(OsStr::new("css")) { dcx.struct_err(format!("invalid argument: \"{theme_s}\"")) - .help_mv("arguments to --theme must have a .css extension") + .with_help("arguments to --theme must have a .css extension") .emit(); return Err(1); } let (success, ret) = theme::test_theme_against(&theme_file, &paths, &dcx); if !success { - dcx.struct_err(format!("error loading theme file: \"{theme_s}\"")).emit(); + dcx.err(format!("error loading theme file: \"{theme_s}\"")); return Err(1); } else if !ret.is_empty() { dcx.struct_warn(format!( "theme file \"{theme_s}\" is missing CSS rules from the default theme", )) - .warn_mv("the theme may appear incorrect when loaded") - .help_mv(format!( + .with_warn("the theme may appear incorrect when loaded") + .with_help(format!( "to see what rules are missing, call `rustdoc --check-theme \"{theme_s}\"`", )) .emit(); @@ -626,7 +626,7 @@ impl Options { match matches.opt_str("r").as_deref() { Some("rust") | None => {} Some(s) => { - dcx.struct_err(format!("unknown input format: {s}")).emit(); + dcx.err(format!("unknown input format: {s}")); return Err(1); } } @@ -634,7 +634,7 @@ impl Options { let index_page = matches.opt_str("index-page").map(|s| PathBuf::from(&s)); if let Some(ref index_page) = index_page { if !index_page.is_file() { - dcx.struct_err("option `--index-page` argument must be a file").emit(); + dcx.err("option `--index-page` argument must be a file"); return Err(1); } } @@ -646,7 +646,7 @@ impl Options { let crate_types = match parse_crate_types_from_list(matches.opt_strs("crate-type")) { Ok(types) => types, Err(e) => { - dcx.struct_err(format!("unknown crate type: {e}")).emit(); + dcx.err(format!("unknown crate type: {e}")); return Err(1); } }; @@ -664,7 +664,7 @@ impl Options { out_fmt } Err(e) => { - dcx.struct_err(e).emit(); + dcx.err(e); return Err(1); } }, @@ -809,7 +809,7 @@ fn check_deprecated_options(matches: &getopts::Matches, dcx: &rustc_errors::Diag for &flag in deprecated_flags.iter() { if matches.opt_present(flag) { dcx.struct_warn(format!("the `{flag}` flag is deprecated")) - .note_mv( + .with_note( "see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \ for more information", ) |
