summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_hir_analysis/src/errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_hir_analysis/src/errors.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/errors.rs63
1 files changed, 62 insertions, 1 deletions
diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs
index 6e7eb4f6c..c2d2e5f7e 100644
--- a/compiler/rustc_hir_analysis/src/errors.rs
+++ b/compiler/rustc_hir_analysis/src/errors.rs
@@ -5,7 +5,7 @@ use rustc_errors::{
error_code, Applicability, DiagnosticBuilder, ErrorGuaranteed, Handler, IntoDiagnostic,
MultiSpan,
};
-use rustc_macros::{Diagnostic, Subdiagnostic};
+use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
use rustc_middle::ty::{self, print::TraitRefPrintOnlyTraitPath, Ty};
use rustc_span::{symbol::Ident, Span, Symbol};
@@ -184,6 +184,16 @@ pub struct UnconstrainedOpaqueType {
pub what: &'static str,
}
+#[derive(Diagnostic)]
+#[diag(hir_analysis_tait_forward_compat)]
+#[note]
+pub struct TaitForwardCompat {
+ #[primary_span]
+ pub span: Span,
+ #[note]
+ pub item_span: Span,
+}
+
pub struct MissingTypeParams {
pub span: Span,
pub def_span: Span,
@@ -857,3 +867,54 @@ pub(crate) enum DropImplPolarity {
span: Span,
},
}
+
+#[derive(Diagnostic)]
+pub(crate) enum ReturnTypeNotationIllegalParam {
+ #[diag(hir_analysis_return_type_notation_illegal_param_type)]
+ Type {
+ #[primary_span]
+ span: Span,
+ #[label]
+ param_span: Span,
+ },
+ #[diag(hir_analysis_return_type_notation_illegal_param_const)]
+ Const {
+ #[primary_span]
+ span: Span,
+ #[label]
+ param_span: Span,
+ },
+}
+
+#[derive(Diagnostic)]
+pub(crate) enum LateBoundInApit {
+ #[diag(hir_analysis_late_bound_type_in_apit)]
+ Type {
+ #[primary_span]
+ span: Span,
+ #[label]
+ param_span: Span,
+ },
+ #[diag(hir_analysis_late_bound_const_in_apit)]
+ Const {
+ #[primary_span]
+ span: Span,
+ #[label]
+ param_span: Span,
+ },
+ #[diag(hir_analysis_late_bound_lifetime_in_apit)]
+ Lifetime {
+ #[primary_span]
+ span: Span,
+ #[label]
+ param_span: Span,
+ },
+}
+
+#[derive(LintDiagnostic)]
+#[diag(hir_analysis_unused_associated_type_bounds)]
+#[note]
+pub struct UnusedAssociatedTypeBounds {
+ #[suggestion(code = "")]
+ pub span: Span,
+}