about summary refs log tree commit diff
path: root/example/subslice-patterns-const-eval.rs
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-04-29 12:00:43 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-04-29 12:00:43 +0000
commit8bf550e616acdf226df60a7d4ae8ed1bb53f09a6 (patch)
tree10038a672e47a766014bf55362a646370d6ce368 /example/subslice-patterns-const-eval.rs
parent2f624db5eaeeebadbebdef727b941c599916aa15 (diff)
Merge commit 'ef07e8e60f994ec014d049a95591426fb92ebb79' into sync_cg_clif-2023-04-29
Diffstat (limited to 'example/subslice-patterns-const-eval.rs')
-rw-r--r--example/subslice-patterns-const-eval.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/example/subslice-patterns-const-eval.rs b/example/subslice-patterns-const-eval.rs
index 2cb84786f56..3c878916663 100644
--- a/example/subslice-patterns-const-eval.rs
+++ b/example/subslice-patterns-const-eval.rs
@@ -19,7 +19,9 @@ macro_rules! n {
 // This macro has an unused variable so that it can be repeated base on the
 // number of times a repeated variable (`$e` in `z`) occurs.
 macro_rules! zed {
-    ($e:expr) => { Z }
+    ($e:expr) => {
+        Z
+    };
 }
 
 macro_rules! z {
@@ -32,12 +34,14 @@ macro_rules! z {
 macro_rules! compare_evaluation {
     ($e:expr, $t:ty $(,)?) => {{
         const CONST_EVAL: $t = $e;
-        const fn const_eval() -> $t { $e }
+        const fn const_eval() -> $t {
+            $e
+        }
         static CONST_EVAL2: $t = const_eval();
         let runtime_eval = $e;
         assert_eq!(CONST_EVAL, runtime_eval);
         assert_eq!(CONST_EVAL2, runtime_eval);
-    }}
+    }};
 }
 
 // Repeat `$test`, substituting the given macro variables with the given
@@ -65,6 +69,7 @@ macro_rules! repeat {
     }
 }
 
+#[rustfmt::skip]
 fn main() {
     repeat! {
         ($arr $Ty); n, N; z, Z: