about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src
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_ty_utils/src
parent733b47ea4b1b86216f14ef56e49440c33933f230 (diff)
downloadrust-93f1201c0616672d71e640a0ad600d029448c40a.tar.gz
rust-93f1201c0616672d71e640a0ad600d029448c40a.zip
compiler: Parse `p-` specs in datalayout string, allow definition of custom default data address space
Diffstat (limited to 'compiler/rustc_ty_utils/src')
-rw-r--r--compiler/rustc_ty_utils/src/layout.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_ty_utils/src/layout.rs b/compiler/rustc_ty_utils/src/layout.rs
index a225b712d4b..163e2b30883 100644
--- a/compiler/rustc_ty_utils/src/layout.rs
+++ b/compiler/rustc_ty_utils/src/layout.rs
@@ -379,7 +379,7 @@ fn layout_of_uncached<'tcx>(
 
         // Potentially-wide pointers.
         ty::Ref(_, pointee, _) | ty::RawPtr(pointee, _) => {
-            let mut data_ptr = scalar_unit(Pointer(AddressSpace::DATA));
+            let mut data_ptr = scalar_unit(Pointer(AddressSpace::ZERO));
             if !ty.is_raw_ptr() {
                 data_ptr.valid_range_mut().start = 1;
             }
@@ -435,7 +435,7 @@ fn layout_of_uncached<'tcx>(
                     }
                     ty::Slice(_) | ty::Str => scalar_unit(Int(dl.ptr_sized_integer(), false)),
                     ty::Dynamic(..) => {
-                        let mut vtable = scalar_unit(Pointer(AddressSpace::DATA));
+                        let mut vtable = scalar_unit(Pointer(AddressSpace::ZERO));
                         vtable.valid_range_mut().start = 1;
                         vtable
                     }