Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Disable overflow checks in VS Code's rust-analyzer tests but retain println

I need to turn off overflow checks in unit tests. I can use command line to accomplish this using cargo test --release, however:

  1. GUI test buttons provided by rust-analyzer provide a better experience, however they’re configured to run on debug mode with overflow checks on.
  2. cargo test --release hides println! statements, but I would like to see them.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Just disable overflow checking for tests in your Cargo.toml file:

[profile.test]
overflow-checks = false
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading