diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-18 10:15:45 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-18 16:06:22 +1100 |
| commit | f422dca3ae8b8a8c9a99b8e6ec0899e08dc072c3 (patch) | |
| tree | 246774c222d64bdac2b129eed55c8f64f2cf4b66 /compiler/rustc_builtin_macros/src/errors.rs | |
| parent | 4dc7fab56f224467439237dafb8b3211f1a0d165 (diff) | |
| download | rust-f422dca3ae8b8a8c9a99b8e6ec0899e08dc072c3.tar.gz rust-f422dca3ae8b8a8c9a99b8e6ec0899e08dc072c3.zip | |
Rename many `DiagCtxt` arguments.
Diffstat (limited to 'compiler/rustc_builtin_macros/src/errors.rs')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/errors.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/rustc_builtin_macros/src/errors.rs b/compiler/rustc_builtin_macros/src/errors.rs index 0523f9acd62..6ffeb401453 100644 --- a/compiler/rustc_builtin_macros/src/errors.rs +++ b/compiler/rustc_builtin_macros/src/errors.rs @@ -448,12 +448,12 @@ 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 DiagCtxt) -> DiagnosticBuilder<'a, ErrorGuaranteed> { + fn into_diagnostic(self, dcx: &'a DiagCtxt) -> DiagnosticBuilder<'a, ErrorGuaranteed> { #[expect( rustc::untranslatable_diagnostic, reason = "cannot translate user-provided messages" )] - let mut diag = handler.struct_err(self.msg_from_user.to_string()); + let mut diag = dcx.struct_err(self.msg_from_user.to_string()); diag.set_span(self.span); diag } @@ -802,17 +802,16 @@ pub(crate) struct AsmClobberNoReg { } impl<'a> IntoDiagnostic<'a> for AsmClobberNoReg { - 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); + fn into_diagnostic(self, dcx: &'a DiagCtxt) -> DiagnosticBuilder<'a, ErrorGuaranteed> { + let mut diag = dcx.struct_err(crate::fluent_generated::builtin_macros_asm_clobber_no_reg); diag.set_span(self.spans.clone()); // eager translation as `span_labels` takes `AsRef<str>` - let lbl1 = handler.eagerly_translate_to_string( + let lbl1 = dcx.eagerly_translate_to_string( crate::fluent_generated::builtin_macros_asm_clobber_abi, [].into_iter(), ); diag.span_labels(self.clobbers, &lbl1); - let lbl2 = handler.eagerly_translate_to_string( + let lbl2 = dcx.eagerly_translate_to_string( crate::fluent_generated::builtin_macros_asm_clobber_outputs, [].into_iter(), ); |
