summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_codegen_cranelift/example/subslice-patterns-const-eval.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_codegen_cranelift/example/subslice-patterns-const-eval.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/example/subslice-patterns-const-eval.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_cranelift/example/subslice-patterns-const-eval.rs b/compiler/rustc_codegen_cranelift/example/subslice-patterns-const-eval.rs
index 2cb84786f..3c8789166 100644
--- a/compiler/rustc_codegen_cranelift/example/subslice-patterns-const-eval.rs
+++ b/compiler/rustc_codegen_cranelift/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: