From dccb088961bae41d4612a220192add3631430dd0 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 6 Aug 2020 10:49:58 +0800 Subject: [PATCH] stable: put macro debug flags behind feature gate This enables tests to work on stable. To enable macro debugging, build with `--features macro-debug`. Signed-off-by: Sean Cross --- Cargo.toml | 6 +++++- src/lib.rs | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 83d39b1..108095d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,10 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +macro-debug = [] +default = [] + [dependencies] -[workspace] \ No newline at end of file +[workspace] diff --git a/src/lib.rs b/src/lib.rs index 5b196bd..a7c6263 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,6 @@ -#![feature(trace_macros)] -#![feature(log_syntax)] +#![cfg_attr(feature="macro-debug",feature(trace_macros))] +#![cfg_attr(feature="macro-debug",feature(log_syntax))] +#[cfg(feature="macro-debug")] trace_macros!{true} /* @@ -314,4 +315,4 @@ fn no_label() { ); assert_eq!(mcode, [ 0xA9, 0xFB, 0xA9, 0xAB ]); } -*/ \ No newline at end of file +*/