# Conditional compilation for debug/release

**URL:** <https://users.rust-lang.org/t/conditional-compilation-for-debug-release/1098>\
**Category:** uncategorized\
**Created:** [April 23, 2015, 5:57am UTC](https://users.rust-lang.org/t/conditional-compilation-for-debug-release/1098 "2015-04-23T05:57:22Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![hoodie](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/hoodie/32/596_2.png) [@hoodie](https://users.rust-lang.org/u/hoodie)\
**Post date:** [April 18, 2016, 12:56pm UTC](https://users.rust-lang.org/t/conditional-compilation-for-debug-release/1098/6 "2016-04-18T12:56:27Z")

</div>

There really should be a `#[cfg(debug)]` currently you can define something like `#[cfg(feature= "debug")]` but you than have to manually add `--features debug` to your `cargo build`.

On the other hand, I can see why you would want an explicit call.

edit: hihi, I misjudged the age of this thread, reading "Apr'15" I though this was only 3 days old 😛

---

_[View the full topic](https://users.rust-lang.org/t/conditional-compilation-for-debug-release/1098)._
