Skip to content

Commit

Permalink
Turn a bug!() into a span_delay_bug()
Browse files Browse the repository at this point in the history
No reason why this needs to be a `bug!()`.
  • Loading branch information
fmease committed Jan 2, 2024
1 parent 0e333c6 commit 484cacc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/rustc_hir_analysis/src/collect/generics_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,10 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics {

if is_host_effect {
if let Some(idx) = host_effect_index {
bug!("parent also has host effect param? index: {idx}, def: {def_id:?}");
tcx.dcx().span_delayed_bug(
param.span,
format!("parent also has host effect param? index: {idx}, def: {def_id:?}"),
);
}

host_effect_index = Some(index as usize);
Expand Down

0 comments on commit 484cacc

Please sign in to comment.