Skip to content

Commit 9f3f1ca

Browse files
committed
Rename DiagnosticBuilder::handler as DiagnosticBuilder::dcx.
1 parent d1d0896 commit 9f3f1ca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_errors/src/diagnostic_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
441441
}
442442

443443
/// Retrieves the [`DiagCtxt`] if available
444-
pub fn handler(&self) -> Option<&DiagCtxt> {
444+
pub fn dcx(&self) -> Option<&DiagCtxt> {
445445
match self.inner.state {
446446
DiagnosticBuilderState::Emittable(handler) => Some(handler),
447447
DiagnosticBuilderState::AlreadyEmittedOrDuringCancellation => None,

compiler/rustc_mir_transform/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ pub(crate) struct UnsafeOpInUnsafeFn {
184184
impl<'a> DecorateLint<'a, ()> for UnsafeOpInUnsafeFn {
185185
#[track_caller]
186186
fn decorate_lint<'b>(self, diag: &'b mut DiagnosticBuilder<'a, ()>) {
187-
let handler = diag.handler().expect("lint should not yet be emitted");
187+
let handler = diag.dcx().expect("lint should not yet be emitted");
188188
let desc = handler.eagerly_translate_to_string(self.details.label(), [].into_iter());
189189
diag.set_arg("details", desc);
190190
diag.span_label(self.details.span, self.details.label());

0 commit comments

Comments
 (0)