about summary refs log tree commit diff
path: root/src/librustc_data_structures
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-11-24 01:31:51 +0800
committerGitHub <noreply@github.com>2018-11-24 01:31:51 +0800
commit12f6a42f610f0d4cd72886848d91f00e98d40590 (patch)
tree2d6732ff24d12a2afa71686b49d0fd57d7718656 /src/librustc_data_structures
parentef2cbec5a601f7f4414808034c93a8cbbb2066f7 (diff)
parent65e6fdb92e8b706a944bd02bc01058857f787667 (diff)
downloadrust-12f6a42f610f0d4cd72886848d91f00e98d40590.tar.gz
rust-12f6a42f610f0d4cd72886848d91f00e98d40590.zip
Rollup merge of #55945 - oli-obk:static_assert_arg_type, r=michaelwoerister
Ensure that the argument to `static_assert` is a `bool`

cc @eddyb
Diffstat (limited to 'src/librustc_data_structures')
-rw-r--r--src/librustc_data_structures/macros.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustc_data_structures/macros.rs b/src/librustc_data_structures/macros.rs
index 3cc91b0e93f..286a374b280 100644
--- a/src/librustc_data_structures/macros.rs
+++ b/src/librustc_data_structures/macros.rs
@@ -11,11 +11,12 @@
 /// A simple static assertion macro. The first argument should be a unique
 /// ALL_CAPS identifier that describes the condition.
 #[macro_export]
+#[allow_internal_unstable]
 macro_rules! static_assert {
     ($name:ident: $test:expr) => {
         // Use the bool to access an array such that if the bool is false, the access
         // is out-of-bounds.
         #[allow(dead_code)]
-        static $name: () = [()][!$test as usize];
+        static $name: () = [()][!($test: bool) as usize];
     }
 }