@@ -6,7 +6,7 @@ use clippy_utils::diagnostics::span_lint;
6
6
use rustc_ast:: { CoroutineKind , Fn , FnRetTy , Item , ItemKind } ;
7
7
use rustc_data_structures:: sync:: Lrc ;
8
8
use rustc_errors:: emitter:: EmitterWriter ;
9
- use rustc_errors:: Handler ;
9
+ use rustc_errors:: DiagCtxt ;
10
10
use rustc_lint:: LateContext ;
11
11
use rustc_parse:: maybe_new_parser_from_source_str;
12
12
use rustc_parse:: parser:: ForceCollect ;
@@ -45,10 +45,10 @@ pub fn check(
45
45
let fallback_bundle =
46
46
rustc_errors:: fallback_fluent_bundle ( rustc_driver:: DEFAULT_LOCALE_RESOURCES . to_vec ( ) , false ) ;
47
47
let emitter = EmitterWriter :: new ( Box :: new ( io:: sink ( ) ) , fallback_bundle) ;
48
- let handler = Handler :: with_emitter ( Box :: new ( emitter) ) . disable_warnings ( ) ;
49
- #[ expect( clippy:: arc_with_non_send_sync) ] // `Lrc` is expected by with_span_handler
48
+ let dcx = DiagCtxt :: with_emitter ( Box :: new ( emitter) ) . disable_warnings ( ) ;
49
+ #[ expect( clippy:: arc_with_non_send_sync) ] // `Lrc` is expected by with_dcx
50
50
let sm = Lrc :: new ( SourceMap :: new ( FilePathMapping :: empty ( ) ) ) ;
51
- let sess = ParseSess :: with_span_handler ( handler , sm) ;
51
+ let sess = ParseSess :: with_dcx ( dcx , sm) ;
52
52
53
53
let mut parser = match maybe_new_parser_from_source_str ( & sess, filename, code) {
54
54
Ok ( p) => p,
0 commit comments