X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_trait_selection%2Fsrc%2Ferrors.rs;h=19f404cb5b78821894ca5b810ade1f1a92ede472;hb=1a6ed3050ff0ba96d0fa4e91fd657fe983623330;hp=23c3715860ea6a4669737d2cd479b205a6048aa2;hpb=534ddc6166a9031b0c269544929d68f2539ea7a0;p=rust.git diff --git a/compiler/rustc_trait_selection/src/errors.rs b/compiler/rustc_trait_selection/src/errors.rs index 23c3715860e..19f404cb5b7 100644 --- a/compiler/rustc_trait_selection/src/errors.rs +++ b/compiler/rustc_trait_selection/src/errors.rs @@ -58,10 +58,10 @@ 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, + pub trait_desc: ty::TraitRef<'tcx>, + pub self_ty: Option>, pub negative_impl_span: Result, pub positive_impl_span: Result, } @@ -73,10 +73,10 @@ fn into_diagnostic( 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));