From c62989ce80c562c655795ffc6fc799b9a048dc59 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 22 Feb 2023 13:30:58 -0800 Subject: rust: add support for b_ndebug Rust has a `debug_assert!()` macro, which is designed to be toggled on the command line. It is on by default in debug builds, and off by default in release builds, in cargo. This matches what meson's b_ndebug option does in `if-release` mode. --- docs/markdown/snippets/rustc-ndebug.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 docs/markdown/snippets/rustc-ndebug.md (limited to 'docs') diff --git a/docs/markdown/snippets/rustc-ndebug.md b/docs/markdown/snippets/rustc-ndebug.md new file mode 100644 index 000000000..e35386591 --- /dev/null +++ b/docs/markdown/snippets/rustc-ndebug.md @@ -0,0 +1,6 @@ +## Rust now supports the b_ndebug option + +Which controls the `debug_assertions` cfg, which in turn controls +`debug_assert!()` macro. This macro is roughly equivalent to C's `assert()`, as +it can be toggled with command line options, unlike Rust's `assert!()`, which +cannot be turned off, and is not designed to be. -- cgit v1.2.3