about summary refs log tree commit diff
path: root/src/test/compile-fail/feature-gate-static-assert.rs
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2015-03-02 21:46:31 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2015-03-03 13:00:10 +1100
commitc195783c05d253c8e32fb781cce1ae978f8bd6bd (patch)
tree1a07800240ff1a16cceada0879260e839b286c51 /src/test/compile-fail/feature-gate-static-assert.rs
parent157614249594f187f421cd97f928e64c5ab5c1fa (diff)
downloadrust-c195783c05d253c8e32fb781cce1ae978f8bd6bd.tar.gz
rust-c195783c05d253c8e32fb781cce1ae978f8bd6bd.zip
Feature gate `#[static_assert]`.
The API this exposes is a little strange (being attached to `static`s),
so it makes sense to conservatively feature gate it. If it is highly
popular, it is possible to reverse this gating.
Diffstat (limited to 'src/test/compile-fail/feature-gate-static-assert.rs')
-rw-r--r--src/test/compile-fail/feature-gate-static-assert.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/compile-fail/feature-gate-static-assert.rs b/src/test/compile-fail/feature-gate-static-assert.rs
new file mode 100644
index 00000000000..25740397d7a
--- /dev/null
+++ b/src/test/compile-fail/feature-gate-static-assert.rs
@@ -0,0 +1,14 @@
+// Copyright 2015 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.
+
+#[static_assert] //~ ERROR `#[static_assert]` is an experimental feature
+static X: bool = true;
+
+fn main() {}