Rollup merge of #135378 - compiler-errors:unnecessary-stashing, r=chenyukang

Remove a bunch of diagnostic stashing that doesn't do anything

#121669 removed a bunch of conditional diagnostic stashing/canceling, but left around the `steal` calls which just emitted the error eagerly instead of canceling the diagnostic. I think that these no-op `steal` calls don't do much and are confusing to encounter, so let's remove them.

The net effect is:
1. We emit more duplicated errors, since stashing has the side effect of duplicating diagnostics. This is not a big deal, since outside of `-Zdeduplicate-diagnostics=no`, the errors are already being deduplicated by the compiler.
2. It changes the order of diagnostics, since we're no longer stashing and then later stealing the errors. I don't think this matters much for the changes that the UI test suite manifests, and it makes these errors less order dependent.
This commit is contained in:
Matthias Krüger 2025-01-12 12:07:58 +01:00 committed by GitHub
commit b53239668a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 177 additions and 185 deletions

View file

@ -575,7 +575,7 @@ fn sanity_check_found_hidden_type<'tcx>(
} else {
let span = tcx.def_span(key.def_id);
let other = ty::OpaqueHiddenType { ty: hidden_ty, span };
Err(ty.build_mismatch_error(&other, key.def_id, tcx)?.emit())
Err(ty.build_mismatch_error(&other, tcx)?.emit())
}
}