diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:32 +0000 |
commit | 4547b622d8d29df964fa2914213088b148c498fc (patch) | |
tree | 9fc6b25f3c3add6b745be9a2400a6e96140046e9 /compiler/rustc_trait_selection/src/errors.rs | |
parent | Releasing progress-linux version 1.66.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-4547b622d8d29df964fa2914213088b148c498fc.tar.xz rustc-4547b622d8d29df964fa2914213088b148c498fc.zip |
Merging upstream version 1.67.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_trait_selection/src/errors.rs')
-rw-r--r-- | compiler/rustc_trait_selection/src/errors.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rustc_trait_selection/src/errors.rs b/compiler/rustc_trait_selection/src/errors.rs index 7f8705824..19f404cb5 100644 --- a/compiler/rustc_trait_selection/src/errors.rs +++ b/compiler/rustc_trait_selection/src/errors.rs @@ -58,24 +58,25 @@ pub struct NoValueInOnUnimplemented { pub span: Span, } -pub struct NegativePositiveConflict<'a> { +pub struct NegativePositiveConflict<'tcx> { pub impl_span: Span, - pub trait_desc: &'a str, - pub self_desc: &'a Option<String>, + pub trait_desc: ty::TraitRef<'tcx>, + pub self_ty: Option<Ty<'tcx>>, pub negative_impl_span: Result<Span, Symbol>, pub positive_impl_span: Result<Span, Symbol>, } impl IntoDiagnostic<'_> for NegativePositiveConflict<'_> { + #[track_caller] fn into_diagnostic( self, handler: &Handler, ) -> rustc_errors::DiagnosticBuilder<'_, ErrorGuaranteed> { let mut diag = handler.struct_err(fluent::trait_selection_negative_positive_conflict); - diag.set_arg("trait_desc", self.trait_desc); + diag.set_arg("trait_desc", self.trait_desc.print_only_trait_path().to_string()); diag.set_arg( "self_desc", - self.self_desc.clone().map_or_else(|| String::from("none"), |ty| ty), + self.self_ty.map_or_else(|| "none".to_string(), |ty| ty.to_string()), ); diag.set_span(self.impl_span); diag.code(rustc_errors::error_code!(E0751)); |