deprecate unchecked_claim_error_was_emitted in error_reported
This commit is contained in:
parent
1f21b96dce
commit
465ac26405
@ -97,7 +97,11 @@ fn references_error(&self) -> bool {
|
||||
}
|
||||
fn error_reported(&self) -> Result<(), ErrorGuaranteed> {
|
||||
if self.references_error() {
|
||||
Err(ErrorGuaranteed::unchecked_claim_error_was_emitted())
|
||||
if let Some(reported) = ty::tls::with(|tcx| tcx.sess.has_errors()) {
|
||||
Err(reported)
|
||||
} else {
|
||||
bug!("expect tcx.sess.has_errors return true");
|
||||
}
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user