Skip to content

Commit

Permalink
Rename new_handler as new_dcx.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Dec 18, 2023
1 parent 7b8644e commit e13b5c8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/librustdoc/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use rustc_session::EarlyDiagCtxt;
use rustc_span::edition::Edition;
use rustc_target::spec::TargetTriple;

use crate::core::new_handler;
use crate::core::new_dcx;
use crate::externalfiles::ExternalHtml;
use crate::html;
use crate::html::markdown::IdMap;
Expand Down Expand Up @@ -348,7 +348,7 @@ impl Options {
let codegen_options = CodegenOptions::build(handler, matches);
let unstable_opts = UnstableOptions::build(handler, matches);

let diag = new_handler(error_format, None, diagnostic_width, &unstable_opts);
let diag = new_dcx(error_format, None, diagnostic_width, &unstable_opts);

// check for deprecated options
check_deprecated_options(matches, &diag);
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ impl<'tcx> DocContext<'tcx> {
/// Creates a new `DiagCtxt` that can be used to emit warnings and errors.
///
/// If the given `error_format` is `ErrorOutputType::Json` and no `SourceMap` is given, a new one
/// will be created for the handler.
pub(crate) fn new_handler(
/// will be created for the `DiagCtxt`.
pub(crate) fn new_dcx(
error_format: ErrorOutputType,
source_map: Option<Lrc<source_map::SourceMap>>,
diagnostic_width: Option<usize>,
Expand Down
8 changes: 2 additions & 6 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -745,12 +745,8 @@ fn main_args(
}
};

let diag = core::new_handler(
options.error_format,
None,
options.diagnostic_width,
&options.unstable_opts,
);
let diag =
core::new_dcx(options.error_format, None, options.diagnostic_width, &options.unstable_opts);

match (options.should_test, options.markdown_input()) {
(true, true) => return wrap_return(&diag, markdown::test(options)),
Expand Down

0 comments on commit e13b5c8

Please sign in to comment.