diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-17 21:48:57 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-18 16:06:19 +1100 |
| commit | cde19c016e4608288a02f5bdec0b5330d474c26f (patch) | |
| tree | 09dd310cfaaa8c3909727f8015245c9090a9b5bd /compiler/rustc_builtin_macros/src | |
| parent | 321b6565a5f8ebf6f23622fc91ea1191a54f2a38 (diff) | |
| download | rust-cde19c016e4608288a02f5bdec0b5330d474c26f.tar.gz rust-cde19c016e4608288a02f5bdec0b5330d474c26f.zip | |
Rename `Handler` as `DiagCtxt`.
Diffstat (limited to 'compiler/rustc_builtin_macros/src')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/errors.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_builtin_macros/src/proc_macro_harness.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_builtin_macros/src/test_harness.rs | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_builtin_macros/src/errors.rs b/compiler/rustc_builtin_macros/src/errors.rs index 3d02cd72e54..0523f9acd62 100644 --- a/compiler/rustc_builtin_macros/src/errors.rs +++ b/compiler/rustc_builtin_macros/src/errors.rs @@ -1,5 +1,5 @@ use rustc_errors::{ - AddToDiagnostic, DiagnosticBuilder, ErrorGuaranteed, Handler, IntoDiagnostic, MultiSpan, + AddToDiagnostic, DiagCtxt, DiagnosticBuilder, ErrorGuaranteed, IntoDiagnostic, MultiSpan, SingleLabelManySpans, }; use rustc_macros::{Diagnostic, Subdiagnostic}; @@ -448,7 +448,7 @@ pub(crate) struct EnvNotDefinedWithUserMessage { // Hand-written implementation to support custom user messages. impl<'a> IntoDiagnostic<'a> for EnvNotDefinedWithUserMessage { #[track_caller] - fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> { + fn into_diagnostic(self, handler: &'a DiagCtxt) -> DiagnosticBuilder<'a, ErrorGuaranteed> { #[expect( rustc::untranslatable_diagnostic, reason = "cannot translate user-provided messages" @@ -802,7 +802,7 @@ pub(crate) struct AsmClobberNoReg { } impl<'a> IntoDiagnostic<'a> for AsmClobberNoReg { - fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> { + fn into_diagnostic(self, handler: &'a DiagCtxt) -> DiagnosticBuilder<'a, ErrorGuaranteed> { let mut diag = handler.struct_err(crate::fluent_generated::builtin_macros_asm_clobber_no_reg); diag.set_span(self.spans.clone()); diff --git a/compiler/rustc_builtin_macros/src/proc_macro_harness.rs b/compiler/rustc_builtin_macros/src/proc_macro_harness.rs index dae1bc5bfe5..01db87d3c3f 100644 --- a/compiler/rustc_builtin_macros/src/proc_macro_harness.rs +++ b/compiler/rustc_builtin_macros/src/proc_macro_harness.rs @@ -38,7 +38,7 @@ enum ProcMacro { struct CollectProcMacros<'a> { macros: Vec<ProcMacro>, in_root: bool, - handler: &'a rustc_errors::Handler, + handler: &'a rustc_errors::DiagCtxt, source_map: &'a SourceMap, is_proc_macro_crate: bool, is_test_crate: bool, @@ -52,7 +52,7 @@ pub fn inject( is_proc_macro_crate: bool, has_proc_macro_decls: bool, is_test_crate: bool, - handler: &rustc_errors::Handler, + handler: &rustc_errors::DiagCtxt, ) { let ecfg = ExpansionConfig::default("proc_macro".to_string(), features); let mut cx = ExtCtxt::new(sess, ecfg, resolver, None); diff --git a/compiler/rustc_builtin_macros/src/test_harness.rs b/compiler/rustc_builtin_macros/src/test_harness.rs index c5daf17abb9..6ba81553742 100644 --- a/compiler/rustc_builtin_macros/src/test_harness.rs +++ b/compiler/rustc_builtin_macros/src/test_harness.rs @@ -389,7 +389,7 @@ fn get_test_name(i: &ast::Item) -> Option<Symbol> { attr::first_attr_value_str_by_name(&i.attrs, sym::rustc_test_marker) } -fn get_test_runner(sd: &rustc_errors::Handler, krate: &ast::Crate) -> Option<ast::Path> { +fn get_test_runner(sd: &rustc_errors::DiagCtxt, krate: &ast::Crate) -> Option<ast::Path> { let test_attr = attr::find_by_name(&krate.attrs, sym::test_runner)?; let meta_list = test_attr.meta_item_list()?; let span = test_attr.span; |
