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

cargo test --release ignores profile.release and profile.test settings #9874

Closed
ferencdg opened this issue Sep 5, 2021 · 1 comment
Closed
Labels
C-bug Category: bug

Comments

@ferencdg
Copy link

ferencdg commented Sep 5, 2021

Problem
my Cargo.toml settings

[profile.release]
overflow-checks = true

[profile.test]
overflow-checks = true

if I use cargo build --release then the -C overflow-checks is correctly passed to rustc, however cargo test --release doesn't pass the overflow-checks to rustc

Steps
see above

Possible Solution(s)

Notes

Output of cargo version:

cargo 1.54.0 (5ae8d74 2021-06-22)

@ferencdg ferencdg added the C-bug Category: bug label Sep 5, 2021
@ehuss
Copy link
Contributor

ehuss commented Sep 6, 2021

When using --release, tests switch to the bench profile. There's more information about profile selection at https://doc.rust-lang.org/cargo/reference/profiles.html#profile-selection. Named profiles (tracked in #6988) will likely change that behavior to pick release since it uses a more consistent profile choice.

@ehuss ehuss closed this as completed Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants