1
Fork 0

Rollup merge of #103915 - chenyukang:yukang/fix-103874, r=lcnr

Improve use of ErrorGuaranteed and code cleanup

Part of #103874
This commit is contained in:
Matthias Krüger 2022-11-04 06:40:32 +01:00 committed by GitHub
commit 61c6cdb5f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 30 additions and 51 deletions

View file

@ -45,11 +45,10 @@ impl<'tcx> MirPass<'tcx> for PromoteTemps<'tcx> {
// There's not really any point in promoting errorful MIR.
//
// This does not include MIR that failed const-checking, which we still try to promote.
if body.return_ty().references_error() {
tcx.sess.delay_span_bug(body.span, "PromoteTemps: MIR had errors");
if let Err(_) = body.return_ty().error_reported() {
debug!("PromoteTemps: MIR had errors");
return;
}
if body.source.promoted.is_some() {
return;
}