Open catenacyber opened 3 years ago
I am successfully using -Z build-std
and -Z instrument-coverage
in my codebase. Can you double-check if this is still an issue in your case?
Can you double-check if this is still an issue in your case?
Failed with rustc 1.50.0-nightly (603ab5bd6 2020-11-15)
and again after running dustup update and using rustc 1.51.0-nightly (d1aed50ab 2021-01-26)
I use RUSTFLAGS="-Zinstrument-coverage"
instead of -Z instrument-coverage
cargo build -Z build-std -Z instrument-coveragefails with
error: unknown -Z
flag specified: instrument-coverage`
I can reproduce this problem with the default bin crate.
cargo new --bin scratch
cd scratch
RUSTFLAGS=-Cinstrument-coverage cargo build -Zbuild-std --target=x86_64-unknown-linux-gnu
My rustc is
rustc 1.61.0-nightly (38a0b81b1 2022-03-06)
binary: rustc
commit-hash: 38a0b81b1c32764d6a583a5efb6f306b8c44c503
commit-date: 2022-03-06
host: x86_64-unknown-linux-gnu
release: 1.61.0-nightly
LLVM version: 14.0.0
@Amanieu I'm very curious to know what you're doing that makes this work.
Reported first in https://github.com/rust-lang/rust/issues/79401
I tried this code:
I expected to see this happen: Compilation succeeds
Instead, this happened: Compilation failed with
and many more errors about other duplicate items
Meta
This is part of https://github.com/rust-lang/rust/issues/34701 cc @richkadel
rustc --version --verbose
:Backtrace
``` Updating crates.io index Compiling core v0.0.0 (/Users/catena/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core) error[E0152]: found duplicate lang item `f32` --> /Users/catena/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/num/f32.rs:319:1 | 319 | / impl f32 { 320 | | /// The radix or base of the internal representation of `f32`. 321 | | #[stable(feature = "assoc_int_consts", since = "1.43.0")] 322 | | pub const RADIX: u32 = 2; ... | 937 | | } 938 | | } | |_^ | = note: the lang item is first defined in crate `core`. = note: first definition in `core` loaded from /Users/catena/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-e3cd79f6ad1173fd.rlib = note: second definition in the local crate (`core`) ```