Skip to content

Commit 616f6c5

Browse files
committed
chore(unit-tests): disable debug-assertions in test builds
We need to do this because we have tests which create Files from a raw fds or do an explicit close on fds. This causes UB check to trigger and test to panic. There is no separate flag to disable these checks, so we have to disable all debug-assertions in test builds. Tracking issue: rust-lang/rust#123499 Signed-off-by: Egor Lazarchuk <[email protected]>
1 parent a501eae commit 616f6c5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Cargo.toml

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ tests_outside_test_module = "warn"
2222
assertions_on_result_states = "warn"
2323
error_impl_error = "warn"
2424

25+
[profile.test]
26+
# Some unit tests create files from raw fds and
27+
# this triggers UB checks to panic. There is no
28+
# separate flag to disable those as of right now,
29+
# so we have to disable debug-assertions.
30+
# Tracking issue: https://github.com/rust-lang/rust/issues/123499
31+
debug-assertions = false
32+
2533
[profile.dev]
2634
panic = "abort"
2735

0 commit comments

Comments
 (0)