From c1eccfe05cfc3157917a3d10559893646d01a437 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Wed, 17 Apr 2024 22:38:30 +0900 Subject: [PATCH] tools: --check-cfg has been stabilized https://github.com/rust-lang/rust/pull/123501 --- tools/build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/build.sh b/tools/build.sh index 4d88a2da..301fe3c3 100755 --- a/tools/build.sh +++ b/tools/build.sh @@ -194,12 +194,13 @@ nightly='' if [[ "${rustc_version}" == *"nightly"* ]] || [[ "${rustc_version}" == *"dev"* ]]; then nightly=1 rustup ${pre_args[@]+"${pre_args[@]}"} component add rust-src &>/dev/null - # The latest syntax of -Z check-cfg requires 1.75.0-nightly. + # The latest syntax of cargo -Z check-cfg requires 1.75.0-nightly. + # rustc --check-cfg has been stabilized in 1.79. # We only check this on the recent nightly to avoid old clippy bugs. # shellcheck disable=SC2207 if [[ "${rustc_minor_version}" -ge 79 ]]; then build_scripts=(build.rs) - check_cfg='-Z unstable-options --check-cfg=cfg(target_pointer_width,values("128")) --check-cfg=cfg(target_arch,values("xtensa")) --check-cfg=cfg(target_feature,values("x87","lse2","lse128","rcpc3","v8m","partword-atomics","quadword-atomics","fast-serialization"))' + check_cfg='--check-cfg=cfg(target_pointer_width,values("128")) --check-cfg=cfg(target_arch,values("xtensa")) --check-cfg=cfg(target_feature,values("x87","lse2","lse128","rcpc3","v8m","partword-atomics","quadword-atomics","fast-serialization"))' known_cfgs+=($(grep -E 'cargo:rustc-cfg=' "${build_scripts[@]}" | sed -E 's/^.*cargo:rustc-cfg=//; s/(=\\)?".*$//' | LC_ALL=C sort -u)) # TODO: handle multi-line target_feature_if known_target_feature_values+=($(grep -E 'target_feature_if\("' "${build_scripts[@]}" | sed -E 's/^.*target_feature_if\(//; s/",.*$/"/' | LC_ALL=C sort -u))