1
Fork 0

rustc_errors: let DiagnosticBuilder::emit return a "guarantee of emission".

This commit is contained in:
Eduard-Mihai Burtescu 2022-01-27 09:44:25 +00:00
parent 0b9d70cf6d
commit b7e95dee65
83 changed files with 842 additions and 471 deletions

View file

@ -450,7 +450,7 @@ fn report_conflicting_impls(
sg.has_errored = true;
if overlap.with_impl.is_local() || !tcx.orphan_check_crate(()).contains(&impl_def_id) {
let err = struct_span_err!(tcx.sess, impl_span, E0119, "");
decorate(LintDiagnosticBuilder::new(err));
decorate(LintDiagnosticBuilder::new(err.forget_guarantee()));
} else {
tcx.sess.delay_span_bug(impl_span, "impl should have failed the orphan check");
}