about summary refs log tree commit diff
path: root/compiler/rustc_session/src/errors.rs
diff options
context:
space:
mode:
authorMads Marquart <mads@marquart.dk>2025-02-11 11:02:36 +0100
committerMads Marquart <mads@marquart.dk>2025-04-04 15:02:22 +0200
commit7e4379c4eb25a423b8484d99b01bfc8f5bb7efd8 (patch)
treef7a078ac4def59c185aa0b7e1e2ae77aabfc7415 /compiler/rustc_session/src/errors.rs
parentd74ce25b65e60cd5ccade3c6fd4234dbd201bda8 (diff)
downloadrust-7e4379c4eb25a423b8484d99b01bfc8f5bb7efd8.tar.gz
rust-7e4379c4eb25a423b8484d99b01bfc8f5bb7efd8.zip
refactor: Move env parsing of deployment target to rustc_session
Diffstat (limited to 'compiler/rustc_session/src/errors.rs')
-rw-r--r--compiler/rustc_session/src/errors.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs
index 71d8dbe44fe..c4e726613a0 100644
--- a/compiler/rustc_session/src/errors.rs
+++ b/compiler/rustc_session/src/errors.rs
@@ -1,4 +1,4 @@
-use std::num::NonZero;
+use std::num::{NonZero, ParseIntError};
 
 use rustc_ast::token;
 use rustc_ast::util::literal::LitError;
@@ -14,6 +14,14 @@ use rustc_target::spec::{SplitDebuginfo, StackProtector, TargetTuple};
 use crate::config::CrateType;
 use crate::parse::ParseSess;
 
+#[derive(Diagnostic)]
+pub(crate) enum AppleDeploymentTarget {
+    #[diag(session_apple_deployment_target_invalid)]
+    Invalid { env_var: &'static str, error: ParseIntError },
+    #[diag(session_apple_deployment_target_too_low)]
+    TooLow { env_var: &'static str, version: String, os_min: String },
+}
+
 pub(crate) struct FeatureGateError {
     pub(crate) span: MultiSpan,
     pub(crate) explain: DiagMessage,