about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFang He <hf.enigma@gmail.com>2025-09-08 18:39:39 +0800
committerFang He <hf.enigma@gmail.com>2025-09-08 18:39:39 +0800
commitbe284b697fef4c560e040a433fbe2b832ed8426d (patch)
tree21cdc5f615682e6f0bb506bf884281407dd2c2ae
parentc776fbf1eb44a90aa613042c60ba48859f4949e4 (diff)
downloadrust-be284b697fef4c560e040a433fbe2b832ed8426d.tar.gz
rust-be284b697fef4c560e040a433fbe2b832ed8426d.zip
add some comments to clarify the fix
-rw-r--r--library/std_detect/src/detect/os/linux/aarch64.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/library/std_detect/src/detect/os/linux/aarch64.rs b/library/std_detect/src/detect/os/linux/aarch64.rs
index ba5e8f00256..2c36a073b74 100644
--- a/library/std_detect/src/detect/os/linux/aarch64.rs
+++ b/library/std_detect/src/detect/os/linux/aarch64.rs
@@ -209,6 +209,12 @@ impl From<auxvec::AuxVec> for AtHwcap {
             wfxt: bit::test(auxv.hwcap2, 31),
             ..Default::default()
         };
+
+        // Hardware capabilites from bits 32 to 63 should only
+        // be tested on LP64 targets with 64 bits `usize`.
+        // On ILP32 targets like `aarch64-unknown-linux-gun_ilp32`,
+        // these hardware capabilites will default to `false`.
+        // https://github.com/rust-lang/rust/issues/146230
         #[cfg(target_pointer_width = "64")]
         {
             // cap.ebf16: bit::test(auxv.hwcap2, 32);