about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/errors.rs
diff options
context:
space:
mode:
authorJhonny Bill Mena <jhonnybillm@gmail.com>2022-11-13 14:03:22 -0500
committerJhonny Bill Mena <jhonnybillm@gmail.com>2022-12-27 20:59:21 -0500
commite26366ad99a6da4df5c9b476eff00c48e50d1774 (patch)
tree9e49dc2ff0bb1f0f76c9eaafa752e4abed816d4f /compiler/rustc_codegen_ssa/src/errors.rs
parentd41112a8c5f0b85649b4f0e1663edf15f7f2601e (diff)
downloadrust-e26366ad99a6da4df5c9b476eff00c48e50d1774.tar.gz
rust-e26366ad99a6da4df5c9b476eff00c48e50d1774.zip
[WIP] UPDATE - migrate intrinsic.rs to new diagnostic infrastructure
WIP - replacing span_invalid_monomorphization_error function. Still in progress due to its use in codegen_llvm inside macros
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/errors.rs')
-rw-r--r--compiler/rustc_codegen_ssa/src/errors.rs43
1 files changed, 43 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_ssa/src/errors.rs b/compiler/rustc_codegen_ssa/src/errors.rs
index de0a80280be..7303ab96797 100644
--- a/compiler/rustc_codegen_ssa/src/errors.rs
+++ b/compiler/rustc_codegen_ssa/src/errors.rs
@@ -6,6 +6,7 @@ use rustc_errors::{
     IntoDiagnosticArg,
 };
 use rustc_macros::Diagnostic;
+use rustc_middle::ty::Ty;
 use rustc_span::{Span, Symbol};
 use std::borrow::Cow;
 use std::io::Error;
@@ -589,3 +590,45 @@ pub struct ShuffleIndicesEvaluation {
     #[primary_span]
     pub span: Span,
 }
+
+#[derive(Diagnostic)]
+#[diag(codegen_ssa_missing_memory_ordering)]
+pub struct MissingMemoryOrdering;
+
+#[derive(Diagnostic)]
+#[diag(codegen_ssa_unknown_atomic_ordering)]
+pub struct UnknownAtomicOrdering;
+
+#[derive(Diagnostic)]
+#[diag(codegen_ssa_atomic_compare_exchange)]
+pub struct AtomicCompareExchange;
+
+#[derive(Diagnostic)]
+#[diag(codegen_ssa_unknown_atomic_operation)]
+pub struct UnknownAtomicOperation;
+
+#[derive(Diagnostic)]
+pub enum InvalidMonomorphization<'tcx> {
+    #[diag(codegen_ssa_invalid_monomorphization_basic_integer_type, code = "E0511")]
+    BasicIntegerType {
+        #[primary_span]
+        span: Span,
+        name: Symbol,
+        ty: Ty<'tcx>,
+    },
+
+    #[diag(codegen_ssa_invalid_monomorphization_basic_float_type, code = "E0511")]
+    BasicFloatType {
+        #[primary_span]
+        span: Span,
+        name: Symbol,
+        ty: Ty<'tcx>,
+    },
+
+    #[diag(codegen_ssa_invalid_monomorphization_float_to_int_unchecked, code = "E0511")]
+    FloatToIntUnchecked {
+        #[primary_span]
+        span: Span,
+        ty: Ty<'tcx>,
+    },
+}