about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/errors.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-09-02 04:02:11 +0000
committerMichael Goulet <michael@errs.io>2023-09-07 00:49:09 +0000
commite10262ca0aa2ff434b33898d1d03413fdde60edf (patch)
tree2ae53a01dc25e3c04aa6a7f0e1c7254a1142d8e5 /compiler/rustc_hir_analysis/src/errors.rs
parentb0d45536acf8be99036c6a1261359e3cf89f9d63 (diff)
downloadrust-e10262ca0aa2ff434b33898d1d03413fdde60edf.tar.gz
rust-e10262ca0aa2ff434b33898d1d03413fdde60edf.zip
Implement refinement lint for RPITIT
Diffstat (limited to 'compiler/rustc_hir_analysis/src/errors.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/errors.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs
index 9471ad9ca90..a1b306edd64 100644
--- a/compiler/rustc_hir_analysis/src/errors.rs
+++ b/compiler/rustc_hir_analysis/src/errors.rs
@@ -919,6 +919,21 @@ pub struct UnusedAssociatedTypeBounds {
     pub span: Span,
 }
 
+#[derive(LintDiagnostic)]
+#[diag(hir_analysis_rpitit_refined)]
+pub(crate) struct ReturnPositionImplTraitInTraitRefined<'tcx> {
+    #[suggestion(applicability = "maybe-incorrect", code = "{pre}{return_ty}{post}")]
+    pub impl_return_span: Span,
+    #[label]
+    pub trait_return_span: Option<Span>,
+    #[label(hir_analysis_unmatched_bound_label)]
+    pub unmatched_bound: Option<Span>,
+
+    pub pre: &'static str,
+    pub post: &'static str,
+    pub return_ty: Ty<'tcx>,
+}
+
 #[derive(Diagnostic)]
 #[diag(hir_analysis_assoc_bound_on_const)]
 #[note]