]> git.lizzy.rs Git - rust.git/blobdiff - src/compiler_builtins.rs
Rustfmt
[rust.git] / src / compiler_builtins.rs
index 177f850afb398ef6c90e8d1e161920ec56d846e0..c6a247cf59eed11ac5e738af98db46567a9dd87a 100644 (file)
@@ -1,16 +1,18 @@
-macro builtin_functions($register:ident; $(fn $name:ident($($arg_name:ident: $arg_ty:ty),*) -> $ret_ty:ty;)*) {
-    #[cfg(feature = "jit")]
-    #[allow(improper_ctypes)]
-    extern "C" {
-        $(fn $name($($arg_name: $arg_ty),*) -> $ret_ty;)*
-    }
+macro_rules! builtin_functions {
+    ($register:ident; $(fn $name:ident($($arg_name:ident: $arg_ty:ty),*) -> $ret_ty:ty;)*) => {
+        #[cfg(feature = "jit")]
+        #[allow(improper_ctypes)]
+        extern "C" {
+            $(fn $name($($arg_name: $arg_ty),*) -> $ret_ty;)*
+        }
 
-    #[cfg(feature = "jit")]
-    pub(crate) fn $register(builder: &mut cranelift_jit::JITBuilder) {
-        for &(name, val) in &[$((stringify!($name), $name as *const u8)),*] {
-            builder.symbol(name, val);
+        #[cfg(feature = "jit")]
+        pub(crate) fn $register(builder: &mut cranelift_jit::JITBuilder) {
+            for (name, val) in [$((stringify!($name), $name as *const u8)),*] {
+                builder.symbol(name, val);
+            }
         }
-    }
+    };
 }
 
 builtin_functions! {