summary refs log tree commit diff
path: root/src/libsyntax/ext/log_syntax.rs
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2015-02-15 23:49:55 +0100
committerFelix S. Klock II <pnkfelix@pnkfx.org>2015-02-16 01:36:06 +0100
commitdc0797c0c99e7079170d0e09f82fc6f66b721932 (patch)
tree5b0e828bc786427580c67ade6f7a26f1390997a3 /src/libsyntax/ext/log_syntax.rs
parent52bdda778ad595e661d06b16a193b3affe443d41 (diff)
downloadrust-dc0797c0c99e7079170d0e09f82fc6f66b721932.tar.gz
rust-dc0797c0c99e7079170d0e09f82fc6f66b721932.zip
Address the other cases of #22234; fix #22234.
The other cases: `concat_idents!`, `log_syntax!`, and `trace_macros!`,
(these macros, with `asm!`, are handled (eagerly) in feature_gate.rs).
Diffstat (limited to 'src/libsyntax/ext/log_syntax.rs')
-rw-r--r--src/libsyntax/ext/log_syntax.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libsyntax/ext/log_syntax.rs b/src/libsyntax/ext/log_syntax.rs
index 30301e3b8cc..8173dd93f74 100644
--- a/src/libsyntax/ext/log_syntax.rs
+++ b/src/libsyntax/ext/log_syntax.rs
@@ -11,12 +11,20 @@
 use ast;
 use codemap;
 use ext::base;
+use feature_gate;
 use print;
 
 pub fn expand_syntax_ext<'cx>(cx: &'cx mut base::ExtCtxt,
                               sp: codemap::Span,
                               tts: &[ast::TokenTree])
                               -> Box<base::MacResult+'cx> {
+    if !cx.ecfg.enable_log_syntax() {
+        feature_gate::emit_feature_err(&cx.parse_sess.span_diagnostic,
+                                       "log_syntax",
+                                       sp,
+                                       feature_gate::EXPLAIN_LOG_SYNTAX);
+        return base::DummyResult::any(sp);
+    }
 
     cx.print_backtrace();