0

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.
secretshardul
  • 1,635
  • 19
  • 31

2 Answers2

2

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

[profile.test]
overflow-checks = false
HHK
  • 4,852
  • 1
  • 23
  • 40
1

cargo test -- --show-output shows println!() statements

David
  • 53
  • 6