1
Fork 0

Delay bug for negative auto trait rather than ICEing

This commit is contained in:
Michael Goulet 2025-03-07 17:09:36 +00:00
parent 03eb454523
commit bbc80a819b
3 changed files with 34 additions and 1 deletions

View file

@ -124,7 +124,10 @@ pub(crate) fn check_negative_auto_trait_impl<'tcx>(
// be implemented here to handle non-ADT rigid types.
Ok(())
} else {
span_bug!(tcx.def_span(impl_def_id), "incoherent impl of negative auto trait");
Err(tcx.dcx().span_delayed_bug(
tcx.def_span(impl_def_id),
"incoherent impl of negative auto trait",
))
}
}
}