rust-analyzer/crates
bors b00b4ea65b Auto merge of #143182 - xdoardo:more-addrspace, r=workingjubilee
Allow custom default address spaces and parse `p-` specifications in the datalayout string

Some targets, such as CHERI, use as default an address space different from the "normal" default address space `0` (in the case of CHERI, [200 is used](https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-877.pdf)). Currently, `rustc` does not allow to specify custom address spaces and does not take into consideration [`p-` specifications in the datalayout string](https://llvm.org/docs/LangRef.html#langref-datalayout).

This patch tries to mitigate these problems by allowing targets to define a custom default address space (while keeping the default value to address space `0`) and adding the code to parse the `p-` specifications in `rustc_abi`. The main changes are that `TargetDataLayout` now uses functions to refer to pointer-related informations, instead of having specific fields for the size and alignment of pointers in the default address space; furthermore, the two `pointer_size` and `pointer_align` fields in `TargetDataLayout` are replaced with an `FxHashMap` that holds info for all the possible address spaces, as parsed by the `p-` specifications.

The potential performance drawbacks of not having ad-hoc fields for the default address space will be tested in this PR's CI run.

r? workingjubilee
2025-07-07 17:28:14 +00:00
..
base-db Bump salsa 2025-07-03 10:05:16 +02:00
cfg Don't run doctests 2025-06-23 00:50:22 +03:00
edition chore: Bump Edition::CURRENT to 2024 2025-03-17 12:29:19 +01:00
hir chore: Remove dead field from InferenceContext 2025-07-06 10:57:06 +02:00
hir-def Skip unnecessary eq work in BodySourceMap 2025-07-04 11:36:06 +02:00
hir-expand Fix some things with builtin derives 2025-07-03 23:05:56 +03:00
hir-ty Auto merge of #143182 - xdoardo:more-addrspace, r=workingjubilee 2025-07-07 17:28:14 +00:00
ide Merge pull request #20031 from jnyfah/some-branch 2025-07-04 09:20:14 +00:00
ide-assists minor: Handle match arm commas in make::match_arm 2025-07-04 11:08:28 +02:00
ide-completion Fix some things with builtin derives 2025-07-03 23:05:56 +03:00
ide-db Merge pull request #20132 from A4-Tacks/asmut-borrow-minicore 2025-07-06 08:01:54 +00:00
ide-diagnostics fix: Closure capturing for let exprs, again 2025-07-03 22:51:16 +09:00
ide-ssr Don't run doctests 2025-06-23 00:50:22 +03:00
intern Backport new sized-hierarchy trait bounds in old ways 2025-06-26 23:22:26 +09:00
load-cargo Add fn load_workspace_into_db variant for ra_ap_load_cargo's fn load_workspace 2025-07-03 23:09:49 +02:00
mbe Don't run doctests 2025-06-23 00:50:22 +03:00
parser Parse new const trait syntax 2025-06-26 11:08:30 +02:00
paths Don't run doctests 2025-06-23 00:50:22 +03:00
proc-macro-api Don't run doctests 2025-06-23 00:50:22 +03:00
proc-macro-srv Do not append --compile-time-deps to overwritten build script commands 2025-06-29 09:07:55 +02:00
proc-macro-srv-cli Support spans with proc macro servers from before the ast id changes 2025-06-12 16:08:48 +03:00
profile Don't run doctests 2025-06-23 00:50:22 +03:00
project-model Improve flycheck and build script progress reporting 2025-07-04 11:52:09 +02:00
query-group-macro Don't run doctests 2025-06-23 00:50:22 +03:00
rust-analyzer fix: Avoid .unwrap() when running the discover command 2025-07-04 16:55:53 +01:00
span Bump salsa 2025-07-03 10:05:16 +02:00
stdx Don't run doctests 2025-06-23 00:50:22 +03:00
syntax minor: Handle match arm commas in make::match_arm 2025-07-04 11:08:28 +02:00
syntax-bridge Don't run doctests 2025-06-23 00:50:22 +03:00
test-fixture Fix comparison of proc macros 2025-06-12 13:31:55 +03:00
test-utils Merge pull request #20132 from A4-Tacks/asmut-borrow-minicore 2025-07-06 08:01:54 +00:00
toolchain Don't run doctests 2025-06-23 00:50:22 +03:00
tt Workaround missing none group support in builtin macros 2025-06-27 12:06:23 +02:00
vfs Bump salsa 2025-07-03 10:05:16 +02:00
vfs-notify Don't run doctests 2025-06-23 00:50:22 +03:00