Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Execution of a test case in flatten.rs at a particular compilation optimization level appears to be failed #538

Open
cicilzx opened this issue May 5, 2024 · 1 comment

Comments

@cicilzx
Copy link

cicilzx commented May 5, 2024

I find that when using -C opt-level=0 as the compilation optimization level, all of the test cases can pass. However, if we use -C opt-level=1/2/3/s/z, an error would be triggered.

For example, using the command:

RUSTFLAGS="-Z mir-opt-level=0 -C opt-level=1" cargo test

The output is as below:

Running tests/flatten.rs (target/debug/deps/flatten-01ee475df42d1a15)

running 6 tests
error: The argument '<arg>' was provided more than once, but cannot be used multiple times

USAGE:
    test <arg>

For more information try --help
error: test failed, to rerun pass `--test flatten`

Caused by:
  process didn't exit successfully: `/local/home/zixliu/crates/structopt/target/debug/deps/flatten-01ee475df42d1a15` (exit status: 1)
note: test exited abnormally; to see the full output pass --nocapture to the harness.
@TeXitoi
Copy link
Owner

TeXitoi commented May 5, 2024

Looks like a rust test bug. The test is should_panic, it panics, but the test fails in release.

Can be reproduced on stable with cargo test --release -- --test flatten_twice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants