Skip to content

Commit d1d0896

Browse files
committed
Rename ParseSess::with_span_handler as ParseSess::with_dcx.
1 parent 73bac45 commit d1d0896

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

compiler/rustc_expand/src/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ where
5757
F: for<'a> FnOnce(&mut Parser<'a>) -> PResult<'a, T>,
5858
{
5959
let (handler, source_map, output) = create_test_handler();
60-
let ps = ParseSess::with_span_handler(handler, source_map);
60+
let ps = ParseSess::with_dcx(handler, source_map);
6161
let mut p = string_to_parser(&ps, source_str.to_string());
6262
let result = f(&mut p);
6363
assert!(result.is_ok());

compiler/rustc_session/src/parse.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,10 @@ impl ParseSess {
227227
let fallback_bundle = fallback_fluent_bundle(locale_resources, false);
228228
let sm = Lrc::new(SourceMap::new(file_path_mapping));
229229
let handler = DiagCtxt::with_tty_emitter(Some(sm.clone()), fallback_bundle);
230-
ParseSess::with_span_handler(handler, sm)
230+
ParseSess::with_dcx(handler, sm)
231231
}
232232

233-
pub fn with_span_handler(handler: DiagCtxt, source_map: Lrc<SourceMap>) -> Self {
233+
pub fn with_dcx(handler: DiagCtxt, source_map: Lrc<SourceMap>) -> Self {
234234
Self {
235235
dcx: handler,
236236
unstable_features: UnstableFeatures::from_environment(None),
@@ -258,7 +258,7 @@ impl ParseSess {
258258
let fatal_handler = DiagCtxt::with_tty_emitter(None, fallback_bundle).disable_warnings();
259259
let handler = DiagCtxt::with_emitter(Box::new(SilentEmitter { fatal_handler, fatal_note }))
260260
.disable_warnings();
261-
ParseSess::with_span_handler(handler, sm)
261+
ParseSess::with_dcx(handler, sm)
262262
}
263263

264264
#[inline]

compiler/rustc_session/src/session.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ pub fn build_session(
14481448
None
14491449
};
14501450

1451-
let mut parse_sess = ParseSess::with_span_handler(span_diagnostic, source_map);
1451+
let mut parse_sess = ParseSess::with_dcx(span_diagnostic, source_map);
14521452
parse_sess.assume_incomplete_release = sopts.unstable_opts.assume_incomplete_release;
14531453

14541454
let host_triple = config::host_triple();

src/librustdoc/doctest.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ pub(crate) fn make_test(
580580

581581
// FIXME(misdreavus): pass `-Z treat-err-as-bug` to the doctest parser
582582
let handler = DiagCtxt::with_emitter(Box::new(emitter)).disable_warnings();
583-
let sess = ParseSess::with_span_handler(handler, sm);
583+
let sess = ParseSess::with_dcx(handler, sm);
584584

585585
let mut found_main = false;
586586
let mut found_extern_crate = crate_name.is_none();
@@ -755,7 +755,7 @@ fn check_if_attr_is_complete(source: &str, edition: Edition) -> bool {
755755
let emitter = EmitterWriter::new(Box::new(io::sink()), fallback_bundle);
756756

757757
let handler = DiagCtxt::with_emitter(Box::new(emitter)).disable_warnings();
758-
let sess = ParseSess::with_span_handler(handler, sm);
758+
let sess = ParseSess::with_dcx(handler, sm);
759759
let mut parser =
760760
match maybe_new_parser_from_source_str(&sess, filename, source.to_owned()) {
761761
Ok(p) => p,

src/librustdoc/passes/lint/check_code_block_syntax.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn check_rust_syntax(
4444
let sm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
4545
let handler = DiagCtxt::with_emitter(Box::new(emitter)).disable_warnings();
4646
let source = dox[code_block.code].to_owned();
47-
let sess = ParseSess::with_span_handler(handler, sm);
47+
let sess = ParseSess::with_dcx(handler, sm);
4848

4949
let edition = code_block.lang_string.edition.unwrap_or_else(|| cx.tcx.sess.edition());
5050
let expn_data =

src/tools/clippy/clippy_lints/src/doc/needless_doctest_main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ pub fn check(
4646
rustc_errors::fallback_fluent_bundle(rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(), false);
4747
let emitter = EmitterWriter::new(Box::new(io::sink()), fallback_bundle);
4848
let handler = DiagCtxt::with_emitter(Box::new(emitter)).disable_warnings();
49-
#[expect(clippy::arc_with_non_send_sync)] // `Lrc` is expected by with_span_handler
49+
#[expect(clippy::arc_with_non_send_sync)] // `Lrc` is expected by with_dcx
5050
let sm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
51-
let sess = ParseSess::with_span_handler(handler, sm);
51+
let sess = ParseSess::with_dcx(handler, sm);
5252

5353
let mut parser = match maybe_new_parser_from_source_str(&sess, filename, code) {
5454
Ok(p) => p,

src/tools/rustfmt/src/parse/session.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl ParseSess {
166166
config.hide_parse_errors(),
167167
config.color(),
168168
);
169-
let parse_sess = RawParseSess::with_span_handler(handler, source_map);
169+
let parse_sess = RawParseSess::with_dcx(handler, source_map);
170170

171171
Ok(ParseSess {
172172
parse_sess,

0 commit comments

Comments
 (0)