aboutsummaryrefslogtreecommitdiff
path: root/test cases/rust/1 basic/prog.rs
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2023-02-22 13:30:58 -0800
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2023-04-21 15:18:56 +0530
commitc62989ce80c562c655795ffc6fc799b9a048dc59 (patch)
tree657bc94a2d4c2061c35a16e506c0c59309807692 /test cases/rust/1 basic/prog.rs
parentf80f40fa4feb0fa3f365f3debcbe2a43d7d125af (diff)
downloadmeson-c62989ce80c562c655795ffc6fc799b9a048dc59.zip
meson-c62989ce80c562c655795ffc6fc799b9a048dc59.tar.gz
meson-c62989ce80c562c655795ffc6fc799b9a048dc59.tar.bz2
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.
Diffstat (limited to 'test cases/rust/1 basic/prog.rs')
-rw-r--r--test cases/rust/1 basic/prog.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/test cases/rust/1 basic/prog.rs b/test cases/rust/1 basic/prog.rs
index f1b3d30..69d2935 100644
--- a/test cases/rust/1 basic/prog.rs
+++ b/test cases/rust/1 basic/prog.rs
@@ -1,4 +1,5 @@
fn main() {
let foo = "rust compiler is working";
+ debug_assert!(false, "debug_asserts on!");
println!("{}", foo);
}