about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/errors.rs
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-10-25 18:28:04 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-10-25 18:28:04 +0000
commit1c26a278f30a173a47606695211b586451396fbf (patch)
treeea8f8629af6defc611d61091bfeb884839529d6d /compiler/rustc_hir_analysis/src/errors.rs
parent8286ea5a4977a5bca5d75ce25f30e1afbbb95e31 (diff)
downloadrust-1c26a278f30a173a47606695211b586451396fbf.tar.gz
rust-1c26a278f30a173a47606695211b586451396fbf.zip
Split diagnostic details out into a separate function and fluent files
Diffstat (limited to 'compiler/rustc_hir_analysis/src/errors.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/errors.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs
index 9457da32ce6..bd0c1f5dd10 100644
--- a/compiler/rustc_hir_analysis/src/errors.rs
+++ b/compiler/rustc_hir_analysis/src/errors.rs
@@ -249,3 +249,24 @@ pub struct ExpectedUsedSymbol {
     #[primary_span]
     pub span: Span,
 }
+
+#[derive(Diagnostic)]
+#[diag(hir_analysis_const_impl_for_non_const_trait)]
+pub struct ConstImplForNonConstTrait {
+    #[primary_span]
+    pub trait_ref_span: Span,
+    pub trait_name: String,
+    #[suggestion(applicability = "machine-applicable", code = "#[const_trait]")]
+    pub local_trait_span: Option<Span>,
+    #[note]
+    pub marking: (),
+    #[note(adding)]
+    pub adding: (),
+}
+
+#[derive(Diagnostic)]
+#[diag(hir_analysis_const_bound_for_non_const_trait)]
+pub struct ConstBoundForNonConstTrait {
+    #[primary_span]
+    pub span: Span,
+}