-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.Area: Enabling/disabling target features like AVX, Neon, etc.C-bugCategory: This is a bug.Category: This is a bug.P-lowLow priorityLow priorityPG-portable-simdProject group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)Project group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Description
Summary
Can't build core with target_feature = "avx512f"
rust/library/portable-simd/crates/core_simd/src/masks.rs
Lines 5 to 13 in 4559163
#[cfg_attr( | |
not(all(target_arch = "x86_64", target_feature = "avx512f")), | |
path = "masks/full_masks.rs" | |
)] | |
#[cfg_attr( | |
all(target_arch = "x86_64", target_feature = "avx512f"), | |
path = "masks/bitmask.rs" | |
)] | |
mod mask_impl; |
Command used
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS=-Ctarget-cpu=znver4 -Clinker=clang -Clink-arg=-fuse-ld=lld -Ctarget-feature=-crt-static
./x build
Expected behaviour
It should build
Actual behaviour
Multiple errors about unreachable pub
item
Bootstrap configuration (config.toml)
[llvm]
download-ci-llvm = false
link-shared = true
use-libcxx = true
[build]
build = "x86_64-unknown-linux-musl"
verbose = 1
[install]
[rust]
default-linker = "clang"
[target.x86_64-unknown-linux-musl]
ar = "llvm-ar"
cc = "clang"
cxx = "clang++"
linker = "clang"
ranlib = "llvm-ranlib"
llvm-libunwind = "system"
llvm-config = "/usr/lib/llvm/19/bin/llvm-config"
crt-static = false
musl-root = "/usr"
[dist]
Operating system
Gentoo Linux amd64 (musl-llvm profile)
HEAD
Additional context
Build Log
error: unreachable `pub` item
--> library/core/src/../../portable-simd/crates/core_simd/src/masks/bitmask.rs:8:1
|
8 | pub struct Mask<T, const N: usize>(
| ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(super)`
|
= help: or consider exporting it for use by other crates
= note: `-D unreachable-pub` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(unreachable_pub)]`
error: unreachable `pub` item
--> library/core/src/../../portable-simd/crates/core_simd/src/masks/bitmask.rs:81:5
|
81 | pub fn splat(value: bool) -> Self {
| ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(super)`
error: unreachable `pub` item
--> library/core/src/../../portable-simd/crates/core_simd/src/masks/bitmask.rs:96:5
|
96 | pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
| ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(super)`
error: unreachable `pub` item
--> library/core/src/../../portable-simd/crates/core_simd/src/masks/bitmask.rs:101:5
|
101 | pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
| ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(super)`
error: unreachable `pub` item
--> library/core/src/../../portable-simd/crates/core_simd/src/masks/bitmask.rs:109:5
|
109 | pub fn to_int(self) -> Simd<T, N> {
| ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(super)`
error: unreachable `pub` item
--> library/core/src/../../portable-simd/crates/core_simd/src/masks/bitmask.rs:121:5
|
121 | pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
| ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(super)`
error: unreachable `pub` item
--> library/core/src/../../portable-simd/crates/core_simd/src/masks/bitmask.rs:126:5
|
126 | pub fn to_bitmask_integer(self) -> u64 {
| ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(super)`
error: unreachable `pub` item
--> library/core/src/../../portable-simd/crates/core_simd/src/masks/bitmask.rs:133:5
|
133 | pub fn from_bitmask_integer(bitmask: u64) -> Self {
| ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(super)`
error: unreachable `pub` item
--> library/core/src/../../portable-simd/crates/core_simd/src/masks/bitmask.rs:144:5
|
144 | pub fn convert<U>(self) -> Mask<U, N>
| ^--
| |
| _____help: consider restricting its visibility: `pub(super)`
| |
145 | | where
146 | | U: MaskElement,
| |_______________________^
error: unreachable `pub` item
--> library/core/src/../../portable-simd/crates/core_simd/src/masks/bitmask.rs:154:5
|
154 | pub fn any(self) -> bool {
| ---^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(super)`
error: unreachable `pub` item
--> library/core/src/../../portable-simd/crates/core_simd/src/masks/bitmask.rs:160:5
|
160 | pub fn all(self) -> bool {
| ---^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(super)`
Building [=====> ] 8/34: core
Did not run successfully: exit status: 1
LD_LIBRARY_PATH="/home/han/Project/rust/build/x86_64-unknown-linux-musl/stage0/lib:/home/han/Project/rust/build/x86_64-unknown-linux-musl/stage0-std/release/deps" "/home/han/Project/rust/build/x86_64-unknown-linux-musl/stage0/bin/rustc" "--crate-name" "core" "--edition=2021" "library/core/src/lib.rs" "--error-format=json" "--json=diagnostic-rendered-ansi,artifacts,future-incompat" "--diagnostic-width=147" "--crate-type" "lib" "--emit=dep-info,metadata,link" "-C" "opt-level=3" "-C" "embed-bitcode=no" "--warn=unexpected_cfgs" "--check-cfg" "cfg(bootstrap)" "--check-cfg" "cfg(no_fp_fmt_parse)" "--check-cfg" "cfg(stdarch_intel_sde)" "--check-cfg" "cfg(feature, values(any()))" "--check-cfg" "cfg(docsrs,test)" "--check-cfg" "cfg(feature, values(\"debug_refcell\", \"debug_typeid\", \"optimize_for_size\", \"panic_immediate_abort\"))" "-C" "metadata=8f1374cf7fcb7396" "-C" "extra-filename=-e24e7bfa0bd6d9f5" "--out-dir" "/home/han/Project/rust/build/x86_64-unknown-linux-musl/stage0-std/x86_64-unknown-linux-musl/release/deps" "--target" "x86_64-unknown-linux-musl" "-C" "linker=clang" "-L" "dependency=/home/han/Project/rust/build/x86_64-unknown-linux-musl/stage0-std/x86_64-unknown-linux-musl/release/deps" "-L" "dependency=/home/han/Project/rust/build/x86_64-unknown-linux-musl/stage0-std/release/deps" "-Ctarget-cpu=znver4" "-Clinker=clang" "-Clink-arg=-fuse-ld=lld" "-Ctarget-feature=-crt-static" "--cfg=bootstrap" "-Csymbol-mangling-version=legacy" "--check-cfg=cfg(feature,values(any()))" "-Zunstable-options" "--check-cfg=cfg(bootstrap)" "-Zmacro-backtrace" "-Csplit-debuginfo=off" "-Ctarget-feature=-crt-static" "-Cprefer-dynamic" "-Zinline-mir" "-Zinline-mir-preserve-debug" "-Zmir_strip_debuginfo=locals-in-tiny-functions" "-Clink-args=-Wl,-z,origin" "-Clink-args=-Wl,-rpath,$ORIGIN/../lib" "-Alinker-messages" "-L" "native=/usr/lib" "-Cforce-frame-pointers=yes" "-Zcrate-attr=doc(html_root_url=\"https://doc.rust-lang.org/nightly/\")" "-Z" "binary-dep-depinfo" "-Wrust_2018_idioms" "-Wunused_lifetimes" "-Dwarnings" "--sysroot" "/home/han/Project/rust/build/x86_64-unknown-linux-musl/stage0-sysroot" "-Z" "force-unstable-if-unmarked"
-------------
error: could not compile `core` (lib) due to 11 previous errors
Caused by:
process didn't exit successfully: `/home/han/Project/rust/build/bootstrap/debug/rustc /home/han/Project/rust/build/bootstrap/debug/rustc --crate-name core --edition=2021 library/core/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=147 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --warn=unexpected_cfgs --check-cfg 'cfg(bootstrap)' --check-cfg 'cfg(no_fp_fmt_parse)' --check-cfg 'cfg(stdarch_intel_sde)' --check-cfg 'cfg(feature, values(any()))' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("debug_refcell", "debug_typeid", "optimize_for_size", "panic_immediate_abort"))' -C metadata=8f1374cf7fcb7396 -C extra-filename=-e24e7bfa0bd6d9f5 --out-dir /home/han/Project/rust/build/x86_64-unknown-linux-musl/stage0-std/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -C linker=clang -L dependency=/home/han/Project/rust/build/x86_64-unknown-linux-musl/stage0-std/x86_64-unknown-linux-musl/release/deps -L dependency=/home/han/Project/rust/build/x86_64-unknown-linux-musl/stage0-std/release/deps -Ctarget-cpu=znver4 -Clinker=clang -Clink-arg=-fuse-ld=lld -Ctarget-feature=-crt-static --cfg=bootstrap -Csymbol-mangling-version=legacy '--check-cfg=cfg(feature,values(any()))' -Zunstable-options '--check-cfg=cfg(bootstrap)' -Zmacro-backtrace -Csplit-debuginfo=off -Ctarget-feature=-crt-static -Cprefer-dynamic -Zinline-mir -Zinline-mir-preserve-debug -Zmir_strip_debuginfo=locals-in-tiny-functions -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Alinker-messages -L native=/usr/lib -Cforce-frame-pointers=yes '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' -Z binary-dep-depinfo` (exit status: 1)
command did not execute successfully: cd "/home/han/Project/rust" && env -u MAKEFLAGS -u MFLAGS AR_x86_64_unknown_linux_musl="llvm-ar" CARGO_INCREMENTAL="0" CARGO_LOG="cargo::core::compiler::fingerprint=info" CARGO_PROFILE_RELEASE_DEBUG="0" CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS="false" CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS="false" CARGO_PROFILE_RELEASE_STRIP="false" CARGO_TARGET_DIR="/home/han/Project/rust/build/x86_64-unknown-linux-musl/stage0-std" CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER="clang" CC_x86_64_unknown_linux_musl="clang" CFG_COMPILER_BUILD_TRIPLE="x86_64-unknown-linux-musl" CFG_COMPILER_HOST_TRIPLE="x86_64-unknown-linux-musl" CFG_RELEASE_CHANNEL="dev" CFLAGS_x86_64_unknown_linux_musl="" CXXFLAGS_x86_64_unknown_linux_musl="" CXX_x86_64_unknown_linux_musl="clang++" LIBC_CHECK_CFG="1" RANLIB_x86_64_unknown_linux_musl="llvm-ar s" REAL_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" RUSTBUILD_NATIVE_DIR="/home/han/Project/rust/build/x86_64-unknown-linux-musl/native" RUSTC="/home/han/Project/rust/build/bootstrap/debug/rustc" RUSTC_BOOTSTRAP="1" RUSTC_BREAK_ON_ICE="1" RUSTC_ERROR_METADATA_DST="/home/han/Project/rust/build/tmp/extended-error-metadata" RUSTC_FORCE_UNSTABLE="1" RUSTC_HOST_FLAGS="--cfg=bootstrap -Zunstable-options --check-cfg=cfg(bootstrap) -Ctarget-feature=-crt-static -Clinker=clang" RUSTC_INSTALL_BINDIR="bin" RUSTC_LIBDIR="/home/han/Project/rust/build/x86_64-unknown-linux-musl/stage0/lib" RUSTC_LINK_STD_INTO_RUSTC_DRIVER="1" RUSTC_LINT_FLAGS="-Wrust_2018_idioms -Wunused_lifetimes -Dwarnings" RUSTC_REAL="/home/han/Project/rust/build/x86_64-unknown-linux-musl/stage0/bin/rustc" RUSTC_SNAPSHOT="/home/han/Project/rust/build/x86_64-unknown-linux-musl/stage0/bin/rustc" RUSTC_SNAPSHOT_LIBDIR="/home/han/Project/rust/build/x86_64-unknown-linux-musl/stage0/lib" RUSTC_STAGE="0" RUSTC_SYSROOT="/home/han/Project/rust/build/x86_64-unknown-linux-musl/stage0-sysroot" RUSTC_VERBOSE="1" RUSTC_WRAPPER="/home/han/Project/rust/build/bootstrap/debug/rustc" RUSTDOC="/home/han/Project/rust/build/bootstrap/debug/rustdoc" RUSTDOCFLAGS="-Ctarget-cpu=znver4 -Clinker=clang -Clink-arg=-fuse-ld=lld -Ctarget-feature=-crt-static --cfg=bootstrap -Csymbol-mangling-version=legacy --check-cfg=cfg(feature,values(any())) -Zunstable-options --check-cfg=cfg(bootstrap) -Dwarnings -Wrustdoc::invalid_codeblock_attributes --crate-version 1.87.0-dev -Clinker=clang -Zcrate-attr=doc(html_root_url=\"https://doc.rust-lang.org/nightly/\") -Zcrate-attr=warn(rust_2018_idioms)" RUSTDOC_REAL="/path/to/nowhere/rustdoc/not/required" RUSTFLAGS="-Ctarget-cpu=znver4 -Clinker=clang -Clink-arg=-fuse-ld=lld -Ctarget-feature=-crt-static --cfg=bootstrap -Csymbol-mangling-version=legacy --check-cfg=cfg(feature,values(any())) -Zunstable-options --check-cfg=cfg(bootstrap) -Zmacro-backtrace -Csplit-debuginfo=off -Ctarget-feature=-crt-static -Cprefer-dynamic -Zinline-mir -Zinline-mir-preserve-debug -Zmir_strip_debuginfo=locals-in-tiny-functions -Clink-args=-Wl,-z,origin -Clink-args=-Wl,-rpath,$ORIGIN/../lib -Alinker-messages -L native=/usr/lib -Cforce-frame-pointers=yes -Zcrate-attr=doc(html_root_url=\"https://doc.rust-lang.org/nightly/\")" RUST_TEST_THREADS="32" WINAPI_NO_BUNDLED_LIBRARIES="1" __CARGO_DEFAULT_LIB_METADATA="bootstrapstd1.87.0" "/home/han/Project/rust/build/x86_64-unknown-linux-musl/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-musl" "-Zbinary-dep-depinfo" "-j" "32" "-Zroot-dir=/home/han/Project/rust" "-v" "--release" "--features" "backtrace panic-unwind system-llvm-libunwind" "--manifest-path" "/home/han/Project/rust/library/sysroot/Cargo.toml" "--message-format" "json-render-diagnostics"
expected success, got: exit status: 101
Traceback (most recent call last):
File "/home/han/Project/rust/x.py", line 53, in <module>
bootstrap.main()
File "/home/han/Project/rust/src/bootstrap/bootstrap.py", line 1339, in main
bootstrap(args)
File "/home/han/Project/rust/src/bootstrap/bootstrap.py", line 1314, in bootstrap
run(args, env=env, verbose=build.verbose, is_bootstrap=True)
File "/home/han/Project/rust/src/bootstrap/bootstrap.py", line 236, in run
raise RuntimeError(err)
RuntimeError: failed to run: /home/han/Project/rust/build/bootstrap/debug/bootstrap build
timber-schroeder
Metadata
Metadata
Assignees
Labels
A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.Area: Enabling/disabling target features like AVX, Neon, etc.C-bugCategory: This is a bug.Category: This is a bug.P-lowLow priorityLow priorityPG-portable-simdProject group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)Project group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
FireBurn commentedon Mar 5, 2025
It's happening with glibc too. Dropping "-C target-cpu=native" gets things going again
Urgau commentedon Mar 6, 2025
Since #134286 we enabled the
unreachable_pub
lint incore
, but our CI is not testing building core with special target feature enhance the failure in those non standard configuration.@calebzulawski @workingjubilee what would be the best way forward? Fix in portable-simd with subtree sync? Allow in core for the moment?
calebzulawski commentedon Mar 6, 2025
Subtree sync is probably easiest. @workingjubilee should we even bother with the avx512 mask layout for now? The regular masks still codegen to k registers as long as they don't go to memory
Urgau commentedon Mar 16, 2025
Any input on the previous message @workingjubilee?
Deny `unreachable_pub` lint
unreachable_pub
lint rust-lang/portable-simd#455Deny `unreachable_pub` lint
apiraino commentedon Mar 19, 2025
Assigning priority (discussion on Zulip).
@rustbot label -I-prioritize +P-low
Urgau commentedon Mar 20, 2025
Fixed with #138687
Amanieu commentedon Mar 26, 2025
#138687 is merged, is this now resolved?
Urgau commentedon Mar 26, 2025
It's technically a stable to beta regression and #138687 is only in master/was not backported.