diff options
| author | Boxy <supbscripter@gmail.com> | 2022-11-24 11:12:34 +0000 |
|---|---|---|
| committer | Boxy <supbscripter@gmail.com> | 2022-11-24 11:12:46 +0000 |
| commit | 72d8879c29570ee18cc3ab2c3e96bfd97221d0bb (patch) | |
| tree | aa5db5c888d1e5da5df848167835b6c56214ba5d /compiler/rustc_middle | |
| parent | 4e0d0d757e2f1b61ec809420b006545a9f8974c0 (diff) | |
make `error_reported` check for delayed bugs
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/ty/visit.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/visit.rs b/compiler/rustc_middle/src/ty/visit.rs index 5e366ef703f..b04afe549ac 100644 --- a/compiler/rustc_middle/src/ty/visit.rs +++ b/compiler/rustc_middle/src/ty/visit.rs @@ -97,10 +97,10 @@ pub trait TypeVisitable<'tcx>: fmt::Debug + Clone { } fn error_reported(&self) -> Result<(), ErrorGuaranteed> { if self.references_error() { - if let Some(reported) = ty::tls::with(|tcx| tcx.sess.has_errors()) { + if let Some(reported) = ty::tls::with(|tcx| tcx.sess.is_compilation_going_to_fail()) { Err(reported) } else { - bug!("expect tcx.sess.has_errors return true"); + bug!("expect tcx.sess.is_compilation_going_to_fail return `Some`"); } } else { Ok(()) |
