Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2da59b8

Browse files
committedDec 2, 2023
Auto merge of #118470 - nnethercote:cleanup-error-handlers, r=compiler-errors
Cleanup error handlers Mostly by making function naming more consistent. More to do after this, but this is enough for one PR. r? compiler-errors
2 parents bd3a221 + 61f9356 commit 2da59b8

File tree

170 files changed

+495
-517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+495
-517
lines changed
 

‎compiler/rustc_abi/src/layout.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::{
1414
pub trait LayoutCalculator {
1515
type TargetDataLayoutRef: Borrow<TargetDataLayout>;
1616

17-
fn delay_bug(&self, txt: String);
17+
fn delayed_bug(&self, txt: String);
1818
fn current_data_layout(&self) -> Self::TargetDataLayoutRef;
1919

2020
fn scalar_pair<FieldIdx: Idx, VariantIdx: Idx>(
@@ -792,7 +792,7 @@ pub trait LayoutCalculator {
792792
let only_variant = &variants[VariantIdx::new(0)];
793793
for field in only_variant {
794794
if field.is_unsized() {
795-
self.delay_bug("unsized field in union".to_string());
795+
self.delayed_bug("unsized field in union".to_string());
796796
}
797797

798798
align = align.max(field.align);
@@ -1038,7 +1038,7 @@ fn univariant<
10381038
for &i in &inverse_memory_index {
10391039
let field = &fields[i];
10401040
if !sized {
1041-
this.delay_bug(format!(
1041+
this.delayed_bug(format!(
10421042
"univariant: field #{} comes after unsized field",
10431043
offsets.len(),
10441044
));

‎compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
327327
),
328328
ExprKind::Yield(opt_expr) => self.lower_expr_yield(e.span, opt_expr.as_deref()),
329329
ExprKind::Err => hir::ExprKind::Err(
330-
self.tcx.sess.delay_span_bug(e.span, "lowered ExprKind::Err"),
330+
self.tcx.sess.span_delayed_bug(e.span, "lowered ExprKind::Err"),
331331
),
332332
ExprKind::Try(sub_expr) => self.lower_expr_try(e.span, sub_expr),
333333

@@ -799,7 +799,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
799799
self.expr_ident_mut(span, task_context_ident, task_context_hid)
800800
} else {
801801
// Use of `await` outside of an async context, we cannot use `task_context` here.
802-
self.expr_err(span, self.tcx.sess.delay_span_bug(span, "no task_context hir id"))
802+
self.expr_err(span, self.tcx.sess.span_delayed_bug(span, "no task_context hir id"))
803803
};
804804
let new_unchecked = self.expr_call_lang_item_fn_mut(
805805
span,

0 commit comments

Comments
 (0)
Please sign in to comment.