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

Time:11-29

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.

CodePudding user response:

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

[profile.test]
overflow-checks = false
  • Related