about summary refs log tree commit diff
path: root/tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorTsukasa OI <floss_rust@irq.a4lg.com>2025-06-29 07:06:25 +0000
committerAmanieu d'Antras <amanieu@gmail.com>2025-07-07 23:13:29 +0000
commit1bc289da3a90cecf3d288c28a2c8a5d8c9fcd371 (patch)
treedbd8e1d040de824977494d094e2bd455a6ccdf4d /tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parentce73251d44a8c60a77951ce989bda57aafd144cc (diff)
downloadrust-1bc289da3a90cecf3d288c28a2c8a5d8c9fcd371.tar.gz
rust-1bc289da3a90cecf3d288c28a2c8a5d8c9fcd371.zip
std_detect: RISC-V Linux: Ergonomic querying with `riscv_hwprobe`
Originally, we used an array of `riscv_hwprobe` directly and indexed
using raw numbers, making correspondence between the index and the query
key less obvious.

We also frequently used `out[idx].key != -1` to test whether the key is
supported by the `riscv_hwprobe` system call (on the Linux kernel
version we are testing) but we'd better to integrate with an operation
to retrieve the value.

This commit improves the ergonomics of feature querying by:

1.  Utilizing macros to
    a.  enable indexing by identifier names and
    b.  encapsulate accesses to the `riscv_hwprobe` array to query and
2.  New method `riscv_hwprobe::get()` returning `Option<u64>`,
    integrating availability checking and value retrieval.

It also removes `has_ima` for now because it's redundant if we only need
to test for single base behavior.
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions