Skip to content

-Zprofile and should_panic don't work together. #94090

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wllenyj opened this issue Feb 17, 2022 · 1 comment
Closed

-Zprofile and should_panic don't work together. #94090

wllenyj opened this issue Feb 17, 2022 · 1 comment
Labels
C-bug Category: This is a bug.

Comments

@wllenyj
Copy link

wllenyj commented Feb 17, 2022

When I run the cargo test as follows:

export CARGO_INCREMENTAL=0
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
export RUSTDOCFLAGS=-Cpanic=abort
cargo clean
sudo -E cargo test $CARGO_OPTIONS -- -Z unstable-options

The test will panic. This test case is a should_panic test.

...
test x86_64::cpuid::bit_helper::tests::test_invalid_msb_index - should panic ... FAILED
...
failures:

---- x86_64::cpuid::bit_helper::tests::test_invalid_msb_index stdout ----
---- x86_64::cpuid::bit_helper::tests::test_invalid_msb_index stderr ----
thread 'main' panicked at 'Invalid BitRange', crates/db-arch/src/x86_64/cpuid/bit_helper.rs:67:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This is a probability issue, as I am running in project ci and using rust nightly are the latest version. The most recent recurrence is rustc 1.60.0-nightly (75d9a0a 2022-02-16).

See https://github.com/openanolis/dragonball-sandbox/runs/5234196020 for more details.

Sorry about this issues may report the wrong place. But this problem is really annoying and can occur every day.

@wllenyj wllenyj added the C-bug Category: This is a bug. label Feb 17, 2022
@workingjubilee workingjubilee changed the title -Zprofile and shoule_panic don't work together. -Zprofile and should_panic don't work together. Feb 18, 2022
@jieyouxu
Copy link
Member

jieyouxu commented Nov 12, 2024

Triage: -Zprofile removed #132447

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants