about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/errors.rs
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2023-06-18 05:24:38 +0000
committerDeadbeef <ent3rm4n@gmail.com>2023-06-18 05:24:38 +0000
commit89c24af133ddc3e5ee2bee03222da935b50d10e8 (patch)
treef973dc2adfca10313d1fb03b64d11d71955d7824 /compiler/rustc_const_eval/src/errors.rs
parented7281e784423249ab85c094aaba81e3b949a65f (diff)
downloadrust-89c24af133ddc3e5ee2bee03222da935b50d10e8.tar.gz
rust-89c24af133ddc3e5ee2bee03222da935b50d10e8.zip
Better error for non const `PartialEq` call generated by `match`
Diffstat (limited to 'compiler/rustc_const_eval/src/errors.rs')
-rw-r--r--compiler/rustc_const_eval/src/errors.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/errors.rs b/compiler/rustc_const_eval/src/errors.rs
index eed3091d481..ca38cce710e 100644
--- a/compiler/rustc_const_eval/src/errors.rs
+++ b/compiler/rustc_const_eval/src/errors.rs
@@ -271,6 +271,18 @@ pub struct RawBytesNote {
     pub bytes: String,
 }
 
+// FIXME(fee1-dead) do not use stringly typed `ConstContext`
+
+#[derive(Diagnostic)]
+#[diag(const_eval_match_eq_non_const, code = "E0015")]
+#[note]
+pub struct NonConstMatchEq<'tcx> {
+    #[primary_span]
+    pub span: Span,
+    pub ty: Ty<'tcx>,
+    pub kind: ConstContext,
+}
+
 #[derive(Diagnostic)]
 #[diag(const_eval_for_loop_into_iter_non_const, code = "E0015")]
 pub struct NonConstForLoopIntoIter<'tcx> {