diff options
| author | Brian Anderson <banderson@mozilla.com> | 2014-01-17 16:22:48 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2014-01-17 20:10:47 -0800 |
| commit | f52bd5e4b75c48d94876e3909c7bf6f8f0a1c26a (patch) | |
| tree | bc051e516fde4bdd130e8f23ba80213d69d8d2b9 | |
| parent | aa67e13498936c42581f70daaf3b6d028426dde6 (diff) | |
| download | rust-f52bd5e4b75c48d94876e3909c7bf6f8f0a1c26a.tar.gz rust-f52bd5e4b75c48d94876e3909c7bf6f8f0a1c26a.zip | |
rustc: Feature gate `log_syntax!`. Closes #11602
| -rw-r--r-- | src/librustc/front/feature_gate.rs | 6 | ||||
| -rw-r--r-- | src/test/compile-fail/log-syntax-gate.rs | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/librustc/front/feature_gate.rs b/src/librustc/front/feature_gate.rs index d51f3e3f037..26ba38f5f8c 100644 --- a/src/librustc/front/feature_gate.rs +++ b/src/librustc/front/feature_gate.rs @@ -45,6 +45,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[ ("link_args", Active), ("phase", Active), ("macro_registrar", Active), + ("log_syntax", Active), // These are used to test this portion of the compiler, they don't actually // mean anything @@ -187,6 +188,11 @@ impl Visitor<()> for Context { self.gate_feature("asm", path.span, "inline assembly is not \ stable enough for use and is subject to change"); } + + else if path.segments.last().identifier == self.sess.ident_of("log_syntax") { + self.gate_feature("log_syntax", path.span, "`log_syntax!` is not \ + stable enough for use and is subject to change"); + } } fn visit_ty(&mut self, t: &ast::Ty, _: ()) { diff --git a/src/test/compile-fail/log-syntax-gate.rs b/src/test/compile-fail/log-syntax-gate.rs new file mode 100644 index 00000000000..b74c1d61eb8 --- /dev/null +++ b/src/test/compile-fail/log-syntax-gate.rs @@ -0,0 +1,13 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + log_syntax!() //~ ERROR `log_syntax!` is not stable enough +} \ No newline at end of file |
