about summary refs log tree commit diff
path: root/compiler/rustc_errors
diff options
context:
space:
mode:
authorEdoardo Marangoni <edoardo.marangoni@scisemi.com>2025-06-29 12:11:51 +0200
committerEdoardo Marangoni <ecmm@anche.no>2025-07-07 09:04:53 +0200
commit93f1201c0616672d71e640a0ad600d029448c40a (patch)
tree0b66541f5856f978ce18ce1643da965898cdd8d3 /compiler/rustc_errors
parent733b47ea4b1b86216f14ef56e49440c33933f230 (diff)
compiler: Parse `p-` specs in datalayout string, allow definition of custom default data address space
Diffstat (limited to 'compiler/rustc_errors')
-rw-r--r--compiler/rustc_errors/messages.ftl3
-rw-r--r--compiler/rustc_errors/src/diagnostic_impls.rs4
2 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_errors/messages.ftl b/compiler/rustc_errors/messages.ftl
index d68dba0be5e..ad2e206260d 100644
--- a/compiler/rustc_errors/messages.ftl
+++ b/compiler/rustc_errors/messages.ftl
@@ -41,5 +41,8 @@ errors_target_invalid_bits =
 
 errors_target_invalid_bits_size = {$err}
 
+errors_target_invalid_datalayout_pointer_spec =
+    unknown pointer specification `{$err}` in datalayout string
+
 errors_target_missing_alignment =
     missing alignment for `{$cause}` in "data-layout"
diff --git a/compiler/rustc_errors/src/diagnostic_impls.rs b/compiler/rustc_errors/src/diagnostic_impls.rs
index 8b59ba9984c..eeb9ac28808 100644
--- a/compiler/rustc_errors/src/diagnostic_impls.rs
+++ b/compiler/rustc_errors/src/diagnostic_impls.rs
@@ -374,6 +374,10 @@ impl<G: EmissionGuarantee> Diagnostic<'_, G> for TargetDataLayoutErrors<'_> {
             TargetDataLayoutErrors::InvalidBitsSize { err } => {
                 Diag::new(dcx, level, fluent::errors_target_invalid_bits_size).with_arg("err", err)
             }
+            TargetDataLayoutErrors::UnknownPointerSpecification { err } => {
+                Diag::new(dcx, level, fluent::errors_target_invalid_datalayout_pointer_spec)
+                    .with_arg("err", err)
+            }
         }
     }
 }