Rollup merge of #120959 - nnethercote:rm-good_path, r=oli-obk

Remove good path delayed bugs

Because they're not that useful, and kind of annoying. Details in the individual commits.

r? ```@compiler-errors```
This commit is contained in:
Matthias Krüger 2024-02-13 17:38:10 +01:00 committed by GitHub
commit 93e9579b5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 56 additions and 133 deletions

View file

@ -132,20 +132,6 @@ pub struct TypeErrCtxt<'a, 'tcx> {
Box<dyn Fn(Ty<'tcx>) -> Vec<(Ty<'tcx>, Vec<PredicateObligation<'tcx>>)> + 'a>,
}
impl Drop for TypeErrCtxt<'_, '_> {
fn drop(&mut self) {
if self.dcx().has_errors().is_some() {
// Ok, emitted an error.
} else {
// Didn't emit an error; maybe it was created but not yet emitted.
self.infcx
.tcx
.sess
.good_path_delayed_bug("used a `TypeErrCtxt` without raising an error or lint");
}
}
}
impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
pub fn dcx(&self) -> &'tcx DiagCtxt {
self.infcx.tcx.dcx()