Auto merge of #119097 - nnethercote:fix-EmissionGuarantee, r=compiler-errors
Fix `EmissionGuarantee` There are some problems with the `DiagCtxt` API related to `EmissionGuarantee`. This PR fixes them. r? `@compiler-errors`
This commit is contained in:
commit
cee794ee98
45 changed files with 605 additions and 701 deletions
|
@ -1,7 +1,7 @@
|
|||
use crate::fluent_generated as fluent;
|
||||
use rustc_errors::{
|
||||
AddToDiagnostic, Applicability, DiagCtxt, Diagnostic, ErrorGuaranteed, IntoDiagnostic,
|
||||
SubdiagnosticMessage,
|
||||
AddToDiagnostic, Applicability, DiagCtxt, Diagnostic, DiagnosticBuilder, EmissionGuarantee,
|
||||
IntoDiagnostic, Level, SubdiagnosticMessage,
|
||||
};
|
||||
use rustc_macros::Diagnostic;
|
||||
use rustc_middle::ty::{self, ClosureKind, PolyTraitRef, Ty};
|
||||
|
@ -57,13 +57,15 @@ pub struct NegativePositiveConflict<'tcx> {
|
|||
pub positive_impl_span: Result<Span, Symbol>,
|
||||
}
|
||||
|
||||
impl IntoDiagnostic<'_> for NegativePositiveConflict<'_> {
|
||||
impl<G: EmissionGuarantee> IntoDiagnostic<'_, G> for NegativePositiveConflict<'_> {
|
||||
#[track_caller]
|
||||
fn into_diagnostic(
|
||||
self,
|
||||
dcx: &DiagCtxt,
|
||||
) -> rustc_errors::DiagnosticBuilder<'_, ErrorGuaranteed> {
|
||||
let mut diag = dcx.struct_err(fluent::trait_selection_negative_positive_conflict);
|
||||
level: Level,
|
||||
) -> rustc_errors::DiagnosticBuilder<'_, G> {
|
||||
let mut diag =
|
||||
DiagnosticBuilder::new(dcx, level, fluent::trait_selection_negative_positive_conflict);
|
||||
diag.set_arg("trait_desc", self.trait_desc.print_only_trait_path().to_string());
|
||||
diag.set_arg(
|
||||
"self_desc",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue