-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed as duplicate of#145594
Closed as duplicate of#145594
Copy link
Labels
-Zbuild-stdUnstable Cargo option: Compile the standard library yourself.Unstable Cargo option: Compile the standard library yourself.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcO-appleOperating system: Apple (macOS, iOS, tvOS, visionOS, watchOS)Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS)O-iosOperating system: iOSOperating system: iOSS-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.Status: This issue has no reproduction and needs a reproduction to make progress.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Description
Code
I tried this code:
// Any Rust project with Cargo.toml
[package]
name = "test-lang-item"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["staticlib"]
cargo +nightly build --target aarch64-apple-ios-sim -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort
I expected to see this happen: The project should compile successfully for Apple iOS targets when using -Z build-std
.
Instead, this happened: Compilation fails with duplicate lang item error during std_detect
crate compilation:
error[E0152]: duplicate lang item in crate `core`: `sized`
|
= note: the lang item is first defined in crate `core` (which `std_detect` depends on)
= note: first definition in `core` loaded from /target/aarch64-apple-ios-sim/release/deps/libcore-4c40bdd97baee939.rmeta
= note: second definition in `core` loaded from /.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/aarch64-apple-ios-sim/lib/libcore-215222db00f59ba6.rlib
error: could not compile `std_detect` (lib) due to 1 previous error
Version it worked on
It most recently worked on: nightly-2025-08-15 (rustc 1.91.0-nightly (898aff7 2025-08-14))
Version with regression
rustc --version --verbose
:
rustc 1.91.0-nightly (9eb4a2652 2025-08-18)
binary: rustc
commit-hash: 9eb4a2652031ed5ba97c29ef21c79db1645f7883
commit-date: 2025-08-18
host: aarch64-apple-darwin
release: 1.91.0-nightly
LLVM version: 21.1.0
Additional Information
- Affected targets:
aarch64-apple-ios
,aarch64-apple-ios-sim
,x86_64-apple-ios
- Command variations: Issue occurs with various
-Z build-std
flag combinations - Impact: Blocking iOS development workflows and CI/CD pipelines
- Environment: macOS with aarch64-apple-darwin host
The error suggests that there are conflicting definitions of the sized
lang item between the locally built core
crate (via -Z build-std
) and the pre-compiled core
crate from the toolchain.
@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged
Metadata
Metadata
Assignees
Labels
-Zbuild-stdUnstable Cargo option: Compile the standard library yourself.Unstable Cargo option: Compile the standard library yourself.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcO-appleOperating system: Apple (macOS, iOS, tvOS, visionOS, watchOS)Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS)O-iosOperating system: iOSOperating system: iOSS-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.Status: This issue has no reproduction and needs a reproduction to make progress.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.