summaryrefslogtreecommitdiff
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.rs48
1 files changed, 45 insertions, 3 deletions
diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs
index f82169dee98..6e7eb4f6cdc 100644
--- a/compiler/rustc_hir_analysis/src/errors.rs
+++ b/compiler/rustc_hir_analysis/src/errors.rs
@@ -6,7 +6,7 @@ use rustc_errors::{
MultiSpan,
};
use rustc_macros::{Diagnostic, Subdiagnostic};
-use rustc_middle::ty::Ty;
+use rustc_middle::ty::{self, print::TraitRefPrintOnlyTraitPath, Ty};
use rustc_span::{symbol::Ident, Span, Symbol};
#[derive(Diagnostic)]
@@ -108,6 +108,14 @@ pub struct CopyImplOnNonAdt {
}
#[derive(Diagnostic)]
+#[diag(hir_analysis_const_param_ty_impl_on_non_adt)]
+pub struct ConstParamTyImplOnNonAdt {
+ #[primary_span]
+ #[label]
+ pub span: Span,
+}
+
+#[derive(Diagnostic)]
#[diag(hir_analysis_trait_object_declared_with_no_traits, code = "E0224")]
pub struct TraitObjectDeclaredWithNoTraits {
#[primary_span]
@@ -504,11 +512,23 @@ pub(crate) struct ReturnTypeNotationEqualityBound {
pub(crate) struct ReturnTypeNotationMissingMethod {
#[primary_span]
pub span: Span,
- pub trait_name: Symbol,
+ pub ty_name: String,
pub assoc_name: Symbol,
}
#[derive(Diagnostic)]
+#[diag(hir_analysis_return_type_notation_conflicting_bound)]
+#[note]
+pub(crate) struct ReturnTypeNotationConflictingBound<'tcx> {
+ #[primary_span]
+ pub span: Span,
+ pub ty_name: String,
+ pub assoc_name: Symbol,
+ pub first_bound: ty::Binder<'tcx, TraitRefPrintOnlyTraitPath<'tcx>>,
+ pub second_bound: ty::Binder<'tcx, TraitRefPrintOnlyTraitPath<'tcx>>,
+}
+
+#[derive(Diagnostic)]
#[diag(hir_analysis_placeholder_not_allowed_item_signatures, code = "E0121")]
pub(crate) struct PlaceholderNotAllowedItemSignatures {
#[primary_span]
@@ -649,7 +669,6 @@ pub enum ImplNotMarkedDefault {
#[note]
Err {
#[primary_span]
- #[label]
span: Span,
cname: Symbol,
ident: Symbol,
@@ -796,6 +815,15 @@ pub(crate) struct ClosureImplicitHrtb {
}
#[derive(Diagnostic)]
+#[diag(hir_analysis_empty_specialization)]
+pub(crate) struct EmptySpecialization {
+ #[primary_span]
+ pub span: Span,
+ #[note]
+ pub base_impl_span: Span,
+}
+
+#[derive(Diagnostic)]
#[diag(hir_analysis_const_specialize)]
pub(crate) struct ConstSpecialize {
#[primary_span]
@@ -815,3 +843,17 @@ pub(crate) struct MissingTildeConst {
#[primary_span]
pub span: Span,
}
+
+#[derive(Diagnostic)]
+pub(crate) enum DropImplPolarity {
+ #[diag(hir_analysis_drop_impl_negative)]
+ Negative {
+ #[primary_span]
+ span: Span,
+ },
+ #[diag(hir_analysis_drop_impl_reservation)]
+ Reservation {
+ #[primary_span]
+ span: Span,
+ },
+}