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

@ -152,7 +152,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
let (Ok(e) | Err(e)) = prev
.build_mismatch_error(
&OpaqueHiddenType { ty, span: concrete_type.span },
opaque_type_key.def_id,
infcx.tcx,
)
.map(|d| d.emit());