Closed
Description
there are multiple small things to improve ErrorGuaranteed
:
- remove https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.DelaySpanBugEmitted.html and always use
ErrorGuaranteed
directly. - add a way to create a
ty_error
andconst_error
by using an existingErrorGuaranteed
instead of using anotherdelay_span_bug
. - change uses of
references_error
which usedelay_span_bug
right after to instead useTypeVisitable::error_reported()
and not emit a span_bug. - in
TypeVisitable::error_reported()
, instead of usingErrorGuaranteed::unchecked_claim_error_was_emitted()
, use the tlstcx
to check thattcx.sess.has_errors()
is true (maybe in a#[cold]
nested function for perf). - change
error_reported
to useResult<(), ErrorGuaranteed>
instead of an option - consider merging
error_reported
andreferences_error
so that there's only 1 function, using.is_ok()
in the current uses ofreferences_error
. Not sure about this point, might not make stuff clearer and I can't think of a good name.